mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[Quest API] Add IsRaining() and IsSnowing() to Perl/Lua. (#2477)
* [Quest API] Add IsRaining() and IsSnowing() to Perl/Lua. - Add quest::IsRaining() to Perl. - Add quest::IsSnowing() to Perl. - Add eq.is_raining() to Lua. - Add eq.is_snowing() to Lua. This will allow server operators to tell if a zone is currently raining, snowing, or neither. * Remove unnecessary quest manager stuff. * Added constants and cleaned up #weather command * Revert "Added constants and cleaned up #weather command" This reverts commit2ec85304b7. * Revert "Revert "Added constants and cleaned up #weather command"" This reverts commit76f4e411b6. * Delete settings.json * Update zone.cpp
This commit is contained in:
@@ -513,3 +513,21 @@ std::string EQ::constants::GetObjectTypeName(int object_type)
|
||||
|
||||
return std::string();
|
||||
}
|
||||
|
||||
const std::map<uint8, std::string>& EQ::constants::GetWeatherTypeMap()
|
||||
{
|
||||
static const std::map<uint8, std::string> weather_type_map ={
|
||||
{ WeatherTypes::None, "None" },
|
||||
{ WeatherTypes::Raining, "Raining" },
|
||||
{ WeatherTypes::Snowing, "Snowing" }
|
||||
};
|
||||
}
|
||||
|
||||
std::string EQ::constants::GetWeatherTypeName(uint8 weather_type)
|
||||
{
|
||||
if (EQ::ValueWithin(weather_type, WeatherTypes::None, WeatherTypes::Snowing)) {
|
||||
return EQ::constants::GetWeatherTypeMap().find(weather_type)->second;
|
||||
}
|
||||
|
||||
return std::string();
|
||||
}
|
||||
@@ -312,6 +312,12 @@ namespace EQ
|
||||
NoDeposit
|
||||
};
|
||||
|
||||
enum WeatherTypes : uint8 {
|
||||
None,
|
||||
Raining,
|
||||
Snowing
|
||||
};
|
||||
|
||||
const char *GetStanceName(StanceType stance_type);
|
||||
int ConvertStanceTypeToIndex(StanceType stance_type);
|
||||
|
||||
@@ -345,6 +351,9 @@ namespace EQ
|
||||
extern const std::map<int, std::string>& GetObjectTypeMap();
|
||||
std::string GetObjectTypeName(int object_type);
|
||||
|
||||
extern const std::map<uint8, std::string>& GetWeatherTypeMap();
|
||||
std::string GetWeatherTypeName(uint8 weather_type);
|
||||
|
||||
const int STANCE_TYPE_FIRST = stancePassive;
|
||||
const int STANCE_TYPE_LAST = stanceBurnAE;
|
||||
const int STANCE_TYPE_COUNT = stanceBurnAE;
|
||||
|
||||
Reference in New Issue
Block a user