mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 17:51:28 +00:00
[Quest API] Add IsHorse() to Perl and Lua. (#1264)
This commit is contained in:
parent
2346b0f6ab
commit
66d24ff419
@ -2999,7 +2999,7 @@ void EntityList::Depop(bool StartSpawnTimer)
|
|||||||
if (own && own->IsClient())
|
if (own && own->IsClient())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (pnpc->IsHorse)
|
if (pnpc->IsHorse())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (pnpc->IsFindable())
|
if (pnpc->IsFindable())
|
||||||
|
|||||||
@ -36,7 +36,7 @@ Horse::Horse(Client *_owner, uint16 spell_id, const glm::vec4& position)
|
|||||||
strn0cpy(name, _owner->GetCleanName(), 55);
|
strn0cpy(name, _owner->GetCleanName(), 55);
|
||||||
strcat(name,"`s_Mount00");
|
strcat(name,"`s_Mount00");
|
||||||
|
|
||||||
IsHorse = true;
|
is_horse = true;
|
||||||
|
|
||||||
owner = _owner;
|
owner = _owner;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2309,6 +2309,12 @@ void Lua_Mob::SetBucket(std::string bucket_name, std::string bucket_value, std::
|
|||||||
self->SetBucket(bucket_name, bucket_value, expiration);
|
self->SetBucket(bucket_name, bucket_value, expiration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Lua_Mob::IsHorse()
|
||||||
|
{
|
||||||
|
Lua_Safe_Call_Bool();
|
||||||
|
return self->IsHorse();
|
||||||
|
}
|
||||||
|
|
||||||
luabind::scope lua_register_mob() {
|
luabind::scope lua_register_mob() {
|
||||||
return luabind::class_<Lua_Mob, Lua_Entity>("Mob")
|
return luabind::class_<Lua_Mob, Lua_Entity>("Mob")
|
||||||
.def(luabind::constructor<>())
|
.def(luabind::constructor<>())
|
||||||
@ -2706,7 +2712,8 @@ luabind::scope lua_register_mob() {
|
|||||||
.def("GetBucketKey", (std::string(Lua_Mob::*)(void))&Lua_Mob::GetBucketKey)
|
.def("GetBucketKey", (std::string(Lua_Mob::*)(void))&Lua_Mob::GetBucketKey)
|
||||||
.def("GetBucketRemaining", (std::string(Lua_Mob::*)(std::string))&Lua_Mob::GetBucketRemaining)
|
.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))&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() {
|
luabind::scope lua_register_special_abilities() {
|
||||||
|
|||||||
@ -433,6 +433,7 @@ public:
|
|||||||
std::string GetBucketRemaining(std::string bucket_name);
|
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);
|
||||||
void SetBucket(std::string bucket_name, std::string bucket_value, std::string expiration);
|
void SetBucket(std::string bucket_name, std::string bucket_value, std::string expiration);
|
||||||
|
bool IsHorse();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -313,7 +313,7 @@ Mob::Mob(
|
|||||||
isgrouped = false;
|
isgrouped = false;
|
||||||
israidgrouped = false;
|
israidgrouped = false;
|
||||||
|
|
||||||
IsHorse = false;
|
is_horse = false;
|
||||||
|
|
||||||
entity_id_being_looted = 0;
|
entity_id_being_looted = 0;
|
||||||
_appearance = eaStanding;
|
_appearance = eaStanding;
|
||||||
|
|||||||
@ -901,6 +901,7 @@ public:
|
|||||||
inline void SetPetOwnerClient(bool value) { pet_owner_client = value; }
|
inline void SetPetOwnerClient(bool value) { pet_owner_client = value; }
|
||||||
inline bool IsTempPet() const { return _IsTempPet; }
|
inline bool IsTempPet() const { return _IsTempPet; }
|
||||||
inline void SetTempPet(bool value) { _IsTempPet = value; }
|
inline void SetTempPet(bool value) { _IsTempPet = value; }
|
||||||
|
inline bool IsHorse() { return is_horse; }
|
||||||
|
|
||||||
inline const bodyType GetBodyType() const { return bodytype; }
|
inline const bodyType GetBodyType() const { return bodytype; }
|
||||||
inline const bodyType GetOrigBodyType() const { return orig_bodytype; }
|
inline const bodyType GetOrigBodyType() const { return orig_bodytype; }
|
||||||
@ -1592,7 +1593,7 @@ protected:
|
|||||||
std::unordered_map<uint32, std::pair<uint32, uint32>> aa_ranks;
|
std::unordered_map<uint32, std::pair<uint32, uint32>> aa_ranks;
|
||||||
Timer aa_timers[aaTimerMax];
|
Timer aa_timers[aaTimerMax];
|
||||||
|
|
||||||
bool IsHorse;
|
bool is_horse;
|
||||||
|
|
||||||
AuraMgr aura_mgr;
|
AuraMgr aura_mgr;
|
||||||
AuraMgr trap_mgr;
|
AuraMgr trap_mgr;
|
||||||
|
|||||||
@ -6179,6 +6179,21 @@ XS(XS_Mob_SetBucket) {
|
|||||||
XSRETURN_EMPTY;
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C"
|
||||||
@ -6209,6 +6224,7 @@ XS(boot_Mob) {
|
|||||||
newXSproto(strcpy(buf, "IsDoor"), XS_Mob_IsDoor, file, "$");
|
newXSproto(strcpy(buf, "IsDoor"), XS_Mob_IsDoor, file, "$");
|
||||||
newXSproto(strcpy(buf, "IsTrap"), XS_Mob_IsTrap, file, "$");
|
newXSproto(strcpy(buf, "IsTrap"), XS_Mob_IsTrap, file, "$");
|
||||||
newXSproto(strcpy(buf, "IsBeacon"), XS_Mob_IsBeacon, 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, "CastToClient"), XS_Mob_CastToClient, file, "$");
|
||||||
newXSproto(strcpy(buf, "CastToNPC"), XS_Mob_CastToNPC, file, "$");
|
newXSproto(strcpy(buf, "CastToNPC"), XS_Mob_CastToNPC, file, "$");
|
||||||
newXSproto(strcpy(buf, "CastToMob"), XS_Mob_CastToMob, file, "$");
|
newXSproto(strcpy(buf, "CastToMob"), XS_Mob_CastToMob, file, "$");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user