Merge branch 'master' into hate_list_quest_api

This commit is contained in:
Alex 2021-02-25 22:58:41 -05:00 committed by GitHub
commit af517be184
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 33 additions and 8 deletions

View File

@ -1 +1 @@
ALTER TABLE `npc_spell_entries` MODIFY `spellid` UNSIGNED SMALLINT(5) NOT NULL DEFAULT 0;
ALTER TABLE `npc_spells_entries` MODIFY `spellid` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0;

View File

@ -2999,7 +2999,7 @@ void EntityList::Depop(bool StartSpawnTimer)
if (own && own->IsClient())
continue;
if (pnpc->IsHorse)
if (pnpc->IsHorse())
continue;
if (pnpc->IsFindable())

View File

@ -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;
}

View File

@ -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_<Lua_Mob, Lua_Entity>("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() {

View File

@ -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

View File

@ -313,7 +313,7 @@ Mob::Mob(
isgrouped = false;
israidgrouped = false;
IsHorse = false;
is_horse = false;
entity_id_being_looted = 0;
_appearance = eaStanding;

View File

@ -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<uint32, std::pair<uint32, uint32>> aa_ranks;
Timer aa_timers[aaTimerMax];
bool IsHorse;
bool is_horse;
AuraMgr aura_mgr;
AuraMgr trap_mgr;

View File

@ -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, "$");