mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-26 19:47:16 +00:00
[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.
This commit is contained in:
@@ -3706,6 +3706,16 @@ bool Perl__hasrecipelearned(uint32 recipe_id)
|
|||||||
return quest_manager.HasRecipeLearned(recipe_id);
|
return quest_manager.HasRecipeLearned(recipe_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Perl__IsRaining()
|
||||||
|
{
|
||||||
|
return quest_manager.IsRaining();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Perl__IsSnowing()
|
||||||
|
{
|
||||||
|
return quest_manager.IsSnowing();
|
||||||
|
}
|
||||||
|
|
||||||
void perl_register_quest()
|
void perl_register_quest()
|
||||||
{
|
{
|
||||||
perl::interpreter perl(PERL_GET_THX);
|
perl::interpreter perl(PERL_GET_THX);
|
||||||
@@ -3752,6 +3762,8 @@ void perl_register_quest()
|
|||||||
package.add("delete_data", &Perl__delete_data);
|
package.add("delete_data", &Perl__delete_data);
|
||||||
package.add("IsBeneficialSpell", &Perl__IsBeneficialSpell);
|
package.add("IsBeneficialSpell", &Perl__IsBeneficialSpell);
|
||||||
package.add("IsEffectInSpell", &Perl__IsEffectInSpell);
|
package.add("IsEffectInSpell", &Perl__IsEffectInSpell);
|
||||||
|
package.add("IsRaining", &Perl__IsRaining);
|
||||||
|
package.add("IsSnowing", &Perl__IsSnowing);
|
||||||
package.add("IsRunning", &Perl__IsRunning);
|
package.add("IsRunning", &Perl__IsRunning);
|
||||||
package.add("LearnRecipe", &Perl__LearnRecipe);
|
package.add("LearnRecipe", &Perl__LearnRecipe);
|
||||||
package.add("MerchantCountItem", &Perl__MerchantCountItem);
|
package.add("MerchantCountItem", &Perl__MerchantCountItem);
|
||||||
|
|||||||
@@ -3427,6 +3427,22 @@ bool lua_has_recipe_learned(uint32 recipe_id) {
|
|||||||
return quest_manager.HasRecipeLearned(recipe_id);
|
return quest_manager.HasRecipeLearned(recipe_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool lua_is_raining() {
|
||||||
|
if (!zone) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return zone->IsRaining();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool lua_is_snowing() {
|
||||||
|
if (!zone) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return zone->IsSnowing();
|
||||||
|
}
|
||||||
|
|
||||||
#define LuaCreateNPCParse(name, c_type, default_value) do { \
|
#define LuaCreateNPCParse(name, c_type, default_value) do { \
|
||||||
cur = table[#name]; \
|
cur = table[#name]; \
|
||||||
if(luabind::type(cur) != LUA_TNIL) { \
|
if(luabind::type(cur) != LUA_TNIL) { \
|
||||||
@@ -3891,6 +3907,8 @@ luabind::scope lua_register_general() {
|
|||||||
luabind::def("get_recipe_made_count", &lua_get_recipe_made_count),
|
luabind::def("get_recipe_made_count", &lua_get_recipe_made_count),
|
||||||
luabind::def("get_recipe_name", &lua_get_recipe_name),
|
luabind::def("get_recipe_name", &lua_get_recipe_name),
|
||||||
luabind::def("has_recipe_learned", &lua_has_recipe_learned),
|
luabind::def("has_recipe_learned", &lua_has_recipe_learned),
|
||||||
|
luabind::def("is_raining", &lua_is_raining),
|
||||||
|
luabind::def("is_snowing", &lua_is_snowing),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Cross Zone
|
Cross Zone
|
||||||
|
|||||||
@@ -3723,3 +3723,19 @@ void QuestManager::LearnRecipe(uint32 recipe_id) {
|
|||||||
|
|
||||||
initiator->LearnRecipe(recipe_id);
|
initiator->LearnRecipe(recipe_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QuestManager::IsRaining() {
|
||||||
|
if (!zone) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return zone->IsRaining();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QuestManager::IsSnowing() {
|
||||||
|
if (!zone) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return zone->IsSnowing();
|
||||||
|
}
|
||||||
|
|||||||
@@ -340,6 +340,8 @@ public:
|
|||||||
int GetRecipeMadeCount(uint32 recipe_id);
|
int GetRecipeMadeCount(uint32 recipe_id);
|
||||||
std::string GetRecipeName(uint32 recipe_id);
|
std::string GetRecipeName(uint32 recipe_id);
|
||||||
bool HasRecipeLearned(uint32 recipe_id);
|
bool HasRecipeLearned(uint32 recipe_id);
|
||||||
|
bool IsRaining();
|
||||||
|
bool IsSnowing();
|
||||||
|
|
||||||
Client *GetInitiator() const;
|
Client *GetInitiator() const;
|
||||||
NPC *GetNPC() const;
|
NPC *GetNPC() const;
|
||||||
|
|||||||
@@ -249,6 +249,9 @@ public:
|
|||||||
uint32 GetCurrencyID(uint32 item_id);
|
uint32 GetCurrencyID(uint32 item_id);
|
||||||
uint32 GetCurrencyItemID(uint32 currency_id);
|
uint32 GetCurrencyItemID(uint32 currency_id);
|
||||||
|
|
||||||
|
inline bool IsRaining() { return zone_weather == 1; }
|
||||||
|
inline bool IsSnowing() { return zone_weather == 2; }
|
||||||
|
|
||||||
std::string GetZoneDescription();
|
std::string GetZoneDescription();
|
||||||
void SendReloadMessage(std::string reload_type);
|
void SendReloadMessage(std::string reload_type);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user