diff --git a/utils/sql/git/required/2021_02_15_npc_spell_entries_unsigned.sql b/utils/sql/git/required/2021_02_15_npc_spell_entries_unsigned.sql index 1022c8708..cc03b8daa 100644 --- a/utils/sql/git/required/2021_02_15_npc_spell_entries_unsigned.sql +++ b/utils/sql/git/required/2021_02_15_npc_spell_entries_unsigned.sql @@ -1 +1 @@ -ALTER TABLE `npc_spell_entries` MODIFY `spellid` UNSIGNED SMALLINT(5) NOT NULL DEFAULT 0; \ No newline at end of file +ALTER TABLE `npc_spells_entries` MODIFY `spellid` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0; diff --git a/zone/entity.cpp b/zone/entity.cpp index cc531ca38..f79409249 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -2999,7 +2999,7 @@ void EntityList::Depop(bool StartSpawnTimer) if (own && own->IsClient()) continue; - if (pnpc->IsHorse) + if (pnpc->IsHorse()) continue; if (pnpc->IsFindable()) diff --git a/zone/horse.cpp b/zone/horse.cpp index 0a23995ad..a31c58901 100644 --- a/zone/horse.cpp +++ b/zone/horse.cpp @@ -36,7 +36,7 @@ Horse::Horse(Client *_owner, uint16 spell_id, const glm::vec4& position) strn0cpy(name, _owner->GetCleanName(), 55); strcat(name,"`s_Mount00"); - IsHorse = true; + is_horse = true; owner = _owner; } diff --git a/zone/lua_mob.cpp b/zone/lua_mob.cpp index 08d8d5bdc..e702b8bf1 100644 --- a/zone/lua_mob.cpp +++ b/zone/lua_mob.cpp @@ -2309,6 +2309,12 @@ void Lua_Mob::SetBucket(std::string bucket_name, std::string bucket_value, std:: self->SetBucket(bucket_name, bucket_value, expiration); } +bool Lua_Mob::IsHorse() +{ + Lua_Safe_Call_Bool(); + return self->IsHorse(); +} + Lua_Mob Lua_Mob::GetHateClosest() { Lua_Safe_Call_Class(Lua_Mob); return Lua_Mob(self->GetHateClosest()); @@ -2336,7 +2342,6 @@ Lua_HateList Lua_Mob::GetHateListByDistance(int distance) { return ret; } - luabind::scope lua_register_mob() { return luabind::class_("Mob") .def(luabind::constructor<>()) @@ -2737,7 +2742,8 @@ luabind::scope lua_register_mob() { .def("GetBucketKey", (std::string(Lua_Mob::*)(void))&Lua_Mob::GetBucketKey) .def("GetBucketRemaining", (std::string(Lua_Mob::*)(std::string))&Lua_Mob::GetBucketRemaining) .def("SetBucket", (void(Lua_Mob::*)(std::string,std::string))&Lua_Mob::SetBucket) - .def("SetBucket", (void(Lua_Mob::*)(std::string,std::string,std::string))&Lua_Mob::SetBucket); + .def("SetBucket", (void(Lua_Mob::*)(std::string,std::string,std::string))&Lua_Mob::SetBucket) + .def("IsHorse", &Lua_Mob::IsHorse); } luabind::scope lua_register_special_abilities() { diff --git a/zone/lua_mob.h b/zone/lua_mob.h index 58245a4b0..4b090765c 100644 --- a/zone/lua_mob.h +++ b/zone/lua_mob.h @@ -436,6 +436,7 @@ public: std::string GetBucketRemaining(std::string bucket_name); void SetBucket(std::string bucket_name, std::string bucket_value); void SetBucket(std::string bucket_name, std::string bucket_value, std::string expiration); + bool IsHorse(); }; #endif diff --git a/zone/mob.cpp b/zone/mob.cpp index 751d4d445..853096592 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -313,7 +313,7 @@ Mob::Mob( isgrouped = false; israidgrouped = false; - IsHorse = false; + is_horse = false; entity_id_being_looted = 0; _appearance = eaStanding; diff --git a/zone/mob.h b/zone/mob.h index 61be1a0c2..cad133442 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -903,6 +903,7 @@ public: inline void SetPetOwnerClient(bool value) { pet_owner_client = value; } inline bool IsTempPet() const { return _IsTempPet; } inline void SetTempPet(bool value) { _IsTempPet = value; } + inline bool IsHorse() { return is_horse; } inline const bodyType GetBodyType() const { return bodytype; } inline const bodyType GetOrigBodyType() const { return orig_bodytype; } @@ -1593,8 +1594,8 @@ protected: std::unordered_map> aa_ranks; Timer aa_timers[aaTimerMax]; - - bool IsHorse; + + bool is_horse; AuraMgr aura_mgr; AuraMgr trap_mgr; diff --git a/zone/perl_mob.cpp b/zone/perl_mob.cpp index 48af0f5c7..f5dc1067a 100644 --- a/zone/perl_mob.cpp +++ b/zone/perl_mob.cpp @@ -6179,6 +6179,22 @@ XS(XS_Mob_SetBucket) { XSRETURN_EMPTY; } +XS(XS_Mob_IsHorse); +XS(XS_Mob_IsHorse) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Mob::IsHorse(THIS)"); // @categories Script Utility + { + Mob *THIS; + bool RETVAL; + VALIDATE_THIS_IS_MOB; + RETVAL = THIS->IsHorse(); + ST(0) = boolSV(RETVAL); + sv_2mortal(ST(0)); + } + XSRETURN(1); +} + XS(XS_Mob_GetHateListByDistance); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_GetHateListByDistance) { dXSARGS; @@ -6248,6 +6264,7 @@ XS(boot_Mob) { newXSproto(strcpy(buf, "IsDoor"), XS_Mob_IsDoor, file, "$"); newXSproto(strcpy(buf, "IsTrap"), XS_Mob_IsTrap, file, "$"); newXSproto(strcpy(buf, "IsBeacon"), XS_Mob_IsBeacon, file, "$"); + newXSproto(strcpy(buf, "IsHorse"), XS_Mob_IsHorse, file, "$"); newXSproto(strcpy(buf, "CastToClient"), XS_Mob_CastToClient, file, "$"); newXSproto(strcpy(buf, "CastToNPC"), XS_Mob_CastToNPC, file, "$"); newXSproto(strcpy(buf, "CastToMob"), XS_Mob_CastToMob, file, "$");