mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 16:41:29 +00:00
[Quest API] Add RemoveAllNimbusEffects() to Perl/Lua. (#1413)
* [Quest API] Add RemoveAllNimbusEffects() to Perl/Lua. - Add $client->RemoveAllNimbusEffects() to Perl. - Add client:RemoveAllNimbusEffects() to Lua. * Optimize.
This commit is contained in:
parent
82ad8b5fe2
commit
3f8b67e500
@ -2364,6 +2364,11 @@ const char *Lua_Mob::GetLastName() {
|
|||||||
return self->GetLastName();
|
return self->GetLastName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Lua_Mob::RemoveAllNimbusEffects() {
|
||||||
|
Lua_Safe_Call_Void();
|
||||||
|
self->RemoveAllNimbusEffects();
|
||||||
|
}
|
||||||
|
|
||||||
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<>())
|
||||||
@ -2767,7 +2772,8 @@ luabind::scope lua_register_mob() {
|
|||||||
.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)
|
.def("IsHorse", &Lua_Mob::IsHorse)
|
||||||
.def("GetLastName", &Lua_Mob::GetLastName);
|
.def("GetLastName", &Lua_Mob::GetLastName)
|
||||||
|
.def("RemoveAllNimbusEffects", &Lua_Mob::RemoveAllNimbusEffects);
|
||||||
}
|
}
|
||||||
|
|
||||||
luabind::scope lua_register_special_abilities() {
|
luabind::scope lua_register_special_abilities() {
|
||||||
|
|||||||
@ -355,6 +355,7 @@ public:
|
|||||||
void DoKnockback(Lua_Mob caster, uint32 pushback, uint32 pushup);
|
void DoKnockback(Lua_Mob caster, uint32 pushback, uint32 pushup);
|
||||||
void AddNimbusEffect(int effect_id);
|
void AddNimbusEffect(int effect_id);
|
||||||
void RemoveNimbusEffect(int effect_id);
|
void RemoveNimbusEffect(int effect_id);
|
||||||
|
void RemoveAllNimbusEffects();
|
||||||
bool IsRunning();
|
bool IsRunning();
|
||||||
void SetRunning(bool running);
|
void SetRunning(bool running);
|
||||||
void SetBodyType(int new_body, bool overwrite_orig);
|
void SetBodyType(int new_body, bool overwrite_orig);
|
||||||
|
|||||||
16
zone/mob.cpp
16
zone/mob.cpp
@ -4891,6 +4891,22 @@ void Mob::RemoveNimbusEffect(int effectid)
|
|||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Mob::RemoveAllNimbusEffects()
|
||||||
|
{
|
||||||
|
uint32 nimbus_effects[3] = { nimbus_effect1, nimbus_effect2, nimbus_effect3 };
|
||||||
|
for (auto ¤t_nimbus : nimbus_effects) {
|
||||||
|
auto remove_packet = new EQApplicationPacket(OP_RemoveNimbusEffect, sizeof(RemoveNimbusEffect_Struct));
|
||||||
|
auto *remove_effect = (RemoveNimbusEffect_Struct*)remove_packet->pBuffer;
|
||||||
|
remove_effect->spawnid = GetID();
|
||||||
|
remove_effect->nimbus_effect = current_nimbus;
|
||||||
|
entity_list.QueueClients(this, remove_packet);
|
||||||
|
safe_delete(remove_packet);
|
||||||
|
}
|
||||||
|
nimbus_effect1 = 0;
|
||||||
|
nimbus_effect2 = 0;
|
||||||
|
nimbus_effect3 = 0;
|
||||||
|
}
|
||||||
|
|
||||||
bool Mob::IsBoat() const {
|
bool Mob::IsBoat() const {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -413,6 +413,7 @@ public:
|
|||||||
inline virtual uint32 GetNimbusEffect3() const { return nimbus_effect3; }
|
inline virtual uint32 GetNimbusEffect3() const { return nimbus_effect3; }
|
||||||
void AddNimbusEffect(int effectid);
|
void AddNimbusEffect(int effectid);
|
||||||
void RemoveNimbusEffect(int effectid);
|
void RemoveNimbusEffect(int effectid);
|
||||||
|
void RemoveAllNimbusEffects();
|
||||||
inline const glm::vec3& GetTargetRingLocation() const { return m_TargetRing; }
|
inline const glm::vec3& GetTargetRingLocation() const { return m_TargetRing; }
|
||||||
inline float GetTargetRingX() const { return m_TargetRing.x; }
|
inline float GetTargetRingX() const { return m_TargetRing.x; }
|
||||||
inline float GetTargetRingY() const { return m_TargetRing.y; }
|
inline float GetTargetRingY() const { return m_TargetRing.y; }
|
||||||
|
|||||||
@ -6257,6 +6257,19 @@ XS(XS_Mob_GetLastName) {
|
|||||||
XSRETURN(1);
|
XSRETURN(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XS(XS_Mob_RemoveAllNimbusEffects); /* prototype to pass -Wmissing-prototypes */
|
||||||
|
XS(XS_Mob_RemoveAllNimbusEffects) {
|
||||||
|
dXSARGS;
|
||||||
|
if (items != 1)
|
||||||
|
Perl_croak(aTHX_ "Usage: Mob::RemoveAllNimbusEffects(THIS)"); // @categories Script Utility
|
||||||
|
{
|
||||||
|
Mob *THIS;
|
||||||
|
VALIDATE_THIS_IS_MOB;
|
||||||
|
THIS->RemoveAllNimbusEffects();
|
||||||
|
}
|
||||||
|
XSRETURN_EMPTY;
|
||||||
|
}
|
||||||
|
|
||||||
XS(XS_Mob_AddNimbusEffect);
|
XS(XS_Mob_AddNimbusEffect);
|
||||||
XS(XS_Mob_AddNimbusEffect) {
|
XS(XS_Mob_AddNimbusEffect) {
|
||||||
dXSARGS;
|
dXSARGS;
|
||||||
@ -6639,6 +6652,7 @@ XS(boot_Mob) {
|
|||||||
newXSproto(strcpy(buf, "GetHateClosest"), XS_Mob_GetHateClosest, file, "$");
|
newXSproto(strcpy(buf, "GetHateClosest"), XS_Mob_GetHateClosest, file, "$");
|
||||||
newXSproto(strcpy(buf, "GetHateListByDistance"), XS_Mob_GetHateListByDistance, file, "$;$");
|
newXSproto(strcpy(buf, "GetHateListByDistance"), XS_Mob_GetHateListByDistance, file, "$;$");
|
||||||
newXSproto(strcpy(buf, "GetLastName"), XS_Mob_GetLastName, file, "$");
|
newXSproto(strcpy(buf, "GetLastName"), XS_Mob_GetLastName, file, "$");
|
||||||
|
newXSproto(strcpy(buf, "RemoveAllNimbusEffects"), XS_Mob_RemoveAllNimbusEffects, file, "$");
|
||||||
newXSproto(strcpy(buf, "AddNimbusEffect"), XS_Mob_AddNimbusEffect, file, "$$");
|
newXSproto(strcpy(buf, "AddNimbusEffect"), XS_Mob_AddNimbusEffect, file, "$$");
|
||||||
#ifdef BOTS
|
#ifdef BOTS
|
||||||
newXSproto(strcpy(buf, "CastToBot"), XS_Mob_CastToBot, file, "$");
|
newXSproto(strcpy(buf, "CastToBot"), XS_Mob_CastToBot, file, "$");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user