mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 18:51:29 +00:00
Add IsTaunting() to Perl/Lua.
This commit is contained in:
parent
5f0d3e9026
commit
ee55755c85
@ -237,6 +237,11 @@ void Lua_NPC::SetTaunting(bool t) {
|
|||||||
self->SetTaunting(t);
|
self->SetTaunting(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Lua_NPC::IsTaunting() {
|
||||||
|
Lua_Safe_Call_Bool();
|
||||||
|
return self->IsTaunting();
|
||||||
|
}
|
||||||
|
|
||||||
void Lua_NPC::PickPocket(Lua_Client thief) {
|
void Lua_NPC::PickPocket(Lua_Client thief) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
self->PickPocket(thief);
|
self->PickPocket(thief);
|
||||||
@ -602,6 +607,7 @@ luabind::scope lua_register_npc() {
|
|||||||
.def("SetPetSpellID", (void(Lua_NPC::*)(int))&Lua_NPC::SetPetSpellID)
|
.def("SetPetSpellID", (void(Lua_NPC::*)(int))&Lua_NPC::SetPetSpellID)
|
||||||
.def("GetMaxDamage", (uint32(Lua_NPC::*)(int))&Lua_NPC::GetMaxDamage)
|
.def("GetMaxDamage", (uint32(Lua_NPC::*)(int))&Lua_NPC::GetMaxDamage)
|
||||||
.def("SetTaunting", (void(Lua_NPC::*)(bool))&Lua_NPC::SetTaunting)
|
.def("SetTaunting", (void(Lua_NPC::*)(bool))&Lua_NPC::SetTaunting)
|
||||||
|
.def("IsTaunting", (bool(Lua_NPC::*)(void))&Lua_NPC::IsTaunting)
|
||||||
.def("PickPocket", (void(Lua_NPC::*)(Lua_Client))&Lua_NPC::PickPocket)
|
.def("PickPocket", (void(Lua_NPC::*)(Lua_Client))&Lua_NPC::PickPocket)
|
||||||
.def("StartSwarmTimer", (void(Lua_NPC::*)(uint32))&Lua_NPC::StartSwarmTimer)
|
.def("StartSwarmTimer", (void(Lua_NPC::*)(uint32))&Lua_NPC::StartSwarmTimer)
|
||||||
.def("DoClassAttacks", (void(Lua_NPC::*)(Lua_Mob))&Lua_NPC::DoClassAttacks)
|
.def("DoClassAttacks", (void(Lua_NPC::*)(Lua_Mob))&Lua_NPC::DoClassAttacks)
|
||||||
|
|||||||
@ -73,6 +73,7 @@ public:
|
|||||||
void SetPetSpellID(int id);
|
void SetPetSpellID(int id);
|
||||||
uint32 GetMaxDamage(int level);
|
uint32 GetMaxDamage(int level);
|
||||||
void SetTaunting(bool t);
|
void SetTaunting(bool t);
|
||||||
|
bool IsTaunting();
|
||||||
void PickPocket(Lua_Client thief);
|
void PickPocket(Lua_Client thief);
|
||||||
void StartSwarmTimer(uint32 duration);
|
void StartSwarmTimer(uint32 duration);
|
||||||
void DoClassAttacks(Lua_Mob target);
|
void DoClassAttacks(Lua_Mob target);
|
||||||
|
|||||||
@ -991,6 +991,30 @@ XS(XS_NPC_SetTaunting) {
|
|||||||
XSRETURN_EMPTY;
|
XSRETURN_EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XS(XS_NPC_IsTaunting); /* prototype to pass -Wmissing-prototypes */
|
||||||
|
XS(XS_NPC_IsTaunting) {
|
||||||
|
dXSARGS;
|
||||||
|
if (items != 1)
|
||||||
|
Perl_croak(aTHX_ "Usage: NPC::IsTaunting(THIS)");
|
||||||
|
{
|
||||||
|
NPC *THIS;
|
||||||
|
bool RETVAL;
|
||||||
|
|
||||||
|
if (sv_derived_from(ST(0), "NPC")) {
|
||||||
|
IV tmp = SvIV((SV *) SvRV(ST(0)));
|
||||||
|
THIS = INT2PTR(NPC *, tmp);
|
||||||
|
} else
|
||||||
|
Perl_croak(aTHX_ "THIS is not of type NPC");
|
||||||
|
if (THIS == nullptr)
|
||||||
|
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||||
|
|
||||||
|
RETVAL = THIS->IsTaunting();
|
||||||
|
ST(0) = boolSV(RETVAL);
|
||||||
|
sv_2mortal(ST(0));
|
||||||
|
}
|
||||||
|
XSRETURN(1);
|
||||||
|
}
|
||||||
|
|
||||||
XS(XS_NPC_PickPocket); /* prototype to pass -Wmissing-prototypes */
|
XS(XS_NPC_PickPocket); /* prototype to pass -Wmissing-prototypes */
|
||||||
XS(XS_NPC_PickPocket) {
|
XS(XS_NPC_PickPocket) {
|
||||||
dXSARGS;
|
dXSARGS;
|
||||||
@ -2528,6 +2552,7 @@ XS(boot_NPC) {
|
|||||||
newXSproto(strcpy(buf, "SetPetSpellID"), XS_NPC_SetPetSpellID, file, "$$");
|
newXSproto(strcpy(buf, "SetPetSpellID"), XS_NPC_SetPetSpellID, file, "$$");
|
||||||
newXSproto(strcpy(buf, "GetMaxDamage"), XS_NPC_GetMaxDamage, file, "$$");
|
newXSproto(strcpy(buf, "GetMaxDamage"), XS_NPC_GetMaxDamage, file, "$$");
|
||||||
newXSproto(strcpy(buf, "SetTaunting"), XS_NPC_SetTaunting, file, "$$");
|
newXSproto(strcpy(buf, "SetTaunting"), XS_NPC_SetTaunting, file, "$$");
|
||||||
|
newXSproto(strcpy(buf, "IsTaunting"), XS_NPC_IsTaunting, file, "$");
|
||||||
newXSproto(strcpy(buf, "PickPocket"), XS_NPC_PickPocket, file, "$$");
|
newXSproto(strcpy(buf, "PickPocket"), XS_NPC_PickPocket, file, "$$");
|
||||||
newXSproto(strcpy(buf, "StartSwarmTimer"), XS_NPC_StartSwarmTimer, file, "$$");
|
newXSproto(strcpy(buf, "StartSwarmTimer"), XS_NPC_StartSwarmTimer, file, "$$");
|
||||||
newXSproto(strcpy(buf, "DoClassAttacks"), XS_NPC_DoClassAttacks, file, "$$");
|
newXSproto(strcpy(buf, "DoClassAttacks"), XS_NPC_DoClassAttacks, file, "$$");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user