From 7dbf24b95d304dc892a8b17438edd4f5a92ead21 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 18:14:31 -0500 Subject: [PATCH 01/33] Cleanup perl_client.cpp Usage types --- zone/perl_client.cpp | 807 ++++++++++++++++++++----------------------- 1 file changed, 383 insertions(+), 424 deletions(-) diff --git a/zone/perl_client.cpp b/zone/perl_client.cpp index 622551ce0..2b7d51c42 100644 --- a/zone/perl_client.cpp +++ b/zone/perl_client.cpp @@ -69,7 +69,7 @@ XS(XS_Client_Save) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::Save(THIS, iCommitNow)"); + Perl_croak(aTHX_ "Usage: Client::Save(THIS, uint8 commit_now)"); { Client * THIS; bool RETVAL; @@ -338,7 +338,7 @@ XS(XS_Client_SetGM) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::SetGM(THIS, toggle)"); + Perl_croak(aTHX_ "Usage: Client::SetGM(THIS, bool toggle)"); { Client * THIS; bool toggle = (bool)SvTRUE(ST(1)); @@ -362,7 +362,7 @@ XS(XS_Client_SetPVP) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::SetPVP(THIS, toggle)"); + Perl_croak(aTHX_ "Usage: Client::SetPVP(THIS, bool toggle)"); { Client * THIS; bool toggle = (bool)SvTRUE(ST(1)); @@ -438,7 +438,7 @@ XS(XS_Client_SetBaseClass) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::SetBaseClass(THIS, i)"); + Perl_croak(aTHX_ "Usage: Client::SetBaseClass(THIS, uint32 class_id)"); { Client * THIS; uint32 i = (uint32)SvUV(ST(1)); @@ -462,7 +462,7 @@ XS(XS_Client_SetBaseRace) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::SetBaseRace(THIS, i)"); + Perl_croak(aTHX_ "Usage: Client::SetBaseRace(THIS, uint32 race_id)"); { Client * THIS; uint32 i = (uint32)SvUV(ST(1)); @@ -486,7 +486,7 @@ XS(XS_Client_SetBaseGender) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::SetBaseGender(THIS, i)"); + Perl_croak(aTHX_ "Usage: Client::SetBaseGender(THIS, uint32 gender_id)"); { Client * THIS; uint32 i = (uint32)SvUV(ST(1)); @@ -536,7 +536,7 @@ XS(XS_Client_GetLanguageSkill) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::GetLanguageSkill(THIS, n)"); + Perl_croak(aTHX_ "Usage: Client::GetLanguageSkill(THIS, uint16 lanuage_id)"); { Client * THIS; uint8 RETVAL; @@ -559,27 +559,27 @@ XS(XS_Client_GetLanguageSkill) } XS(XS_Client_GetLastName); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetLastName) -{ +XS(XS_Client_GetLastName) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetLastName(THIS)"); { - Client * THIS; - Const_char * RETVAL; + Client *THIS; + Const_char *RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLastName(); - sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; + sv_setpv(TARG, RETVAL); + XSprePUSH; + PUSHTARG; } XSRETURN(1); } @@ -589,7 +589,7 @@ XS(XS_Client_GetLDoNPointsTheme) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::GetLDoNPointsTheme(THIS, theme)"); + Perl_croak(aTHX_ "Usage: Client::GetLDoNPointsTheme(THIS, int32 theme)"); { Client * THIS; uint32 RETVAL; @@ -928,7 +928,7 @@ XS(XS_Client_UpdateLDoNPoints) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::UpdateLDoNPoints(THIS, points, theme)"); + Perl_croak(aTHX_ "Usage: Client::UpdateLDoNPoints(THIS, int32 points, uint32 theme)"); { Client * THIS; bool RETVAL; @@ -956,7 +956,7 @@ XS(XS_Client_SetDeity) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::SetDeity(THIS, i)"); + Perl_croak(aTHX_ "Usage: Client::SetDeity(THIS, uint32 deity_id)"); { Client * THIS; uint32 i = (uint32)SvUV(ST(1)); @@ -980,7 +980,7 @@ XS(XS_Client_AddEXP) { dXSARGS; if (items < 2 || items > 4) - Perl_croak(aTHX_ "Usage: Client::AddEXP(THIS, add_exp, conlevel= 0xFF, resexp= false)"); + Perl_croak(aTHX_ "Usage: Client::AddEXP(THIS, uint32 experience_points)"); { Client * THIS; uint32 add_exp = (uint32)SvUV(ST(1)); @@ -1018,7 +1018,7 @@ XS(XS_Client_SetEXP) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ "Usage: Client::SetEXP(THIS, set_exp, set_aaxp, resexp=false)"); + Perl_croak(aTHX_ "Usage: Client::SetEXP(THIS, uint32 experience_points, uint32 aa_experience_points, [bool resexp=false])"); { Client * THIS; uint32 set_exp = (uint32)SvUV(ST(1)); @@ -1050,7 +1050,7 @@ XS(XS_Client_SetBindPoint) { dXSARGS; if (items < 1 || items > 6) - Perl_croak(aTHX_ "Usage: Client::SetBindPoint(THIS, to_zone= -1, to_instance = 0, new_x= 0.0f, new_y= 0.0f, new_z= 0.0f)"); + Perl_croak(aTHX_ "Usage: Client::SetBindPoint(THIS, int to_zone = -1, int to_instance = 0, float new_x = 0.0f, float new_y = 0.0f, float new_z = 0.0f)"); { Client * THIS; int to_zone; @@ -1108,7 +1108,7 @@ XS(XS_Client_GetBindX) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: Client::GetBindX(index)"); + Perl_croak(aTHX_ "Usage: Client::GetBindX(int index = 0)"); { Client * THIS; int index = 0; @@ -1141,7 +1141,7 @@ XS(XS_Client_GetBindY) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: Client::GetBindY(index)"); + Perl_croak(aTHX_ "Usage: Client::GetBindY(int index = 0)"); { Client * THIS; int index = 0; @@ -1174,7 +1174,7 @@ XS(XS_Client_GetBindZ) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: Client::GetBindZ(index)"); + Perl_croak(aTHX_ "Usage: Client::GetBindZ(int index = 0)"); { Client * THIS; int index = 0; @@ -1207,7 +1207,7 @@ XS(XS_Client_GetBindHeading) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: Client::GetBindHeading(index)"); + Perl_croak(aTHX_ "Usage: Client::GetBindHeading(int index = 0)"); { Client * THIS; int index = 0; @@ -1240,7 +1240,7 @@ XS(XS_Client_GetBindZoneID) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: Client::GetBindZoneID(index)"); + Perl_croak(aTHX_ "Usage: Client::GetBindZoneID(int index = 0)"); { Client * THIS; uint32 index = 0; @@ -1274,7 +1274,7 @@ XS(XS_Client_MovePC) { dXSARGS; if (items != 6) - Perl_croak(aTHX_ "Usage: Client::MovePC(THIS, zoneID, x, y, z, heading)"); + Perl_croak(aTHX_ "Usage: Client::MovePC(THIS, uint32 zone_id, float x, float y, float z, float heading)"); { Client * THIS; uint32 zoneID = (uint32)SvUV(ST(1)); @@ -1323,7 +1323,7 @@ XS(XS_Client_MovePCInstance) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ "Usage: Client::MovePCInstance(THIS, zoneID, instanceID, x, y, z, heading)"); + Perl_croak(aTHX_ "Usage: Client::MovePCInstance(THIS, uint32 zone_id, uint32 instance_id, float x, float y, float z, float heading)"); { Client * THIS; uint32 zoneID = (uint32)SvUV(ST(1)); @@ -1374,7 +1374,7 @@ XS(XS_Client_ChangeLastName) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::ChangeLastName(THIS, in_lastname)"); + Perl_croak(aTHX_ "Usage: Client::ChangeLastName(THIS, string last_name)"); { Client * THIS; char* in_lastname = (char *)SvPV_nolen(ST(1)); @@ -1398,7 +1398,7 @@ XS(XS_Client_GetFactionLevel) { dXSARGS; if (items != 8) - Perl_croak(aTHX_ "Usage: Client::GetFactionLevel(THIS, char_id, npc_id, p_race, p_class, p_deity, pFaction, tnpc)"); + Perl_croak(aTHX_ "Usage: Client::GetFactionLevel(THIS, uint32 character_id, uint32 npc_id, uint32 player_race_id, uint32 player_class_id, uint32 player_deity_id, uint32 player_faction_id, Mob*)"); { Client * THIS; FACTION_VALUE RETVAL; @@ -1440,7 +1440,7 @@ XS(XS_Client_SetFactionLevel) { dXSARGS; if (items != 6) - Perl_croak(aTHX_ "Usage: Client::SetFactionLevel(THIS, char_id, npc_id, char_class, char_race, char_deity)"); + Perl_croak(aTHX_ "Usage: Client::SetFactionLevel(THIS, uint32 character_id, uint32 npc_id, uint8 character_class, uint8 character_race, uint8 character_deity)"); { Client * THIS; uint32 char_id = (uint32)SvUV(ST(1)); @@ -1468,30 +1468,29 @@ XS(XS_Client_SetFactionLevel2) { dXSARGS; if (items < 7 || items > 8) - Perl_croak(aTHX_ "Usage: Client::SetFactionLevel2(THIS, char_id, faction_id, char_class, char_race, char_deity, value, temp)"); + Perl_croak(aTHX_ "Usage: Client::SetFactionLevel2(THIS, uint32 character_id, int32 faction_id, uint8 character_class, uint8 character_race, uint8 character_deity, int32 value, uint8 temp)"); { - Client * THIS; - uint32 char_id = (uint32)SvUV(ST(1)); - int32 faction_id = (int32)SvIV(ST(2)); - uint8 char_class = (uint8)SvUV(ST(3)); - uint8 char_race = (uint8)SvUV(ST(4)); - uint8 char_deity = (uint8)SvUV(ST(5)); - int32 value = (int32)SvIV(ST(6)); - uint8 temp; + Client *THIS; + uint32 char_id = (uint32) SvUV(ST(1)); + int32 faction_id = (int32) SvIV(ST(2)); + uint8 char_class = (uint8) SvUV(ST(3)); + uint8 char_race = (uint8) SvUV(ST(4)); + uint8 char_deity = (uint8) SvUV(ST(5)); + int32 value = (int32) SvIV(ST(6)); + uint8 temp; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items == 7) temp = 0; else { - temp = (uint8)SvUV(ST(7)); + temp = (uint8) SvUV(ST(7)); } THIS->SetFactionLevel2(char_id, faction_id, char_class, char_race, char_deity, value, temp); @@ -1552,27 +1551,27 @@ XS(XS_Client_AccountID) } XS(XS_Client_AccountName); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_AccountName) -{ +XS(XS_Client_AccountName) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::AccountName(THIS)"); { - Client * THIS; - Const_char * RETVAL; + Client *THIS; + Const_char *RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->AccountName(); - sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; + sv_setpv(TARG, RETVAL); + XSprePUSH; + PUSHTARG; } XSRETURN(1); } @@ -1634,7 +1633,7 @@ XS(XS_Client_UpdateAdmin) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: Client::UpdateAdmin(THIS, iFromDB= true)"); + Perl_croak(aTHX_ "Usage: Client::UpdateAdmin(THIS, bool from_db = true)"); { Client * THIS; bool iFromDB; @@ -1660,28 +1659,26 @@ XS(XS_Client_UpdateAdmin) } XS(XS_Client_UpdateWho); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_UpdateWho) -{ +XS(XS_Client_UpdateWho) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: Client::UpdateWho(THIS, remove= 0)"); + Perl_croak(aTHX_ "Usage: Client::UpdateWho(THIS, uint8 remove = 0)"); { - Client * THIS; - uint8 remove; + Client *THIS; + uint8 remove; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) remove = 0; else { - remove = (uint8)SvUV(ST(1)); + remove = (uint8) SvUV(ST(1)); } THIS->UpdateWho(remove); @@ -1772,7 +1769,7 @@ XS(XS_Client_TakeMoneyFromPP) { dXSARGS; if (items < 2 || items > 3) - Perl_croak(aTHX_ "Usage: Client::TakeMoneyFromPP(THIS, copper, updateclient=false)"); + Perl_croak(aTHX_ "Usage: Client::TakeMoneyFromPP(THIS, uint32 copper, bool update_client = false)"); { Client * THIS; bool RETVAL; @@ -1799,26 +1796,25 @@ XS(XS_Client_TakeMoneyFromPP) } XS(XS_Client_AddMoneyToPP); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_AddMoneyToPP) -{ +XS(XS_Client_AddMoneyToPP) { dXSARGS; if (items != 6) - Perl_croak(aTHX_ "Usage: Client::AddMoneyToPP(THIS, copper, silver, gold, platinum, updateclient)"); + Perl_croak(aTHX_ + "Usage: Client::AddMoneyToPP(THIS, uint32 copper, uint32 silver, uint32 gold, uint32 platinum, bool update_client)"); { - Client * THIS; - uint32 copper = (uint32)SvUV(ST(1)); - uint32 silver = (uint32)SvUV(ST(2)); - uint32 gold = (uint32)SvUV(ST(3)); - uint32 platinum = (uint32)SvUV(ST(4)); - bool updateclient = (bool)SvTRUE(ST(5)); + Client *THIS; + uint32 copper = (uint32) SvUV(ST(1)); + uint32 silver = (uint32) SvUV(ST(2)); + uint32 gold = (uint32) SvUV(ST(3)); + uint32 platinum = (uint32) SvUV(ST(4)); + bool updateclient = (bool) SvTRUE(ST(5)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->AddMoneyToPP(copper, silver, gold, platinum, updateclient); @@ -1907,7 +1903,7 @@ XS(XS_Client_IncreaseSkill) { dXSARGS; if (items < 2 || items > 3) - Perl_croak(aTHX_ "Usage: Client::IncreaseSkill(THIS, skill_id, value= 1)"); + Perl_croak(aTHX_ "Usage: Client::IncreaseSkill(THIS, int skill_id, int value = 1)"); { Client * THIS; int skill_id = (int)SvIV(ST(1)); @@ -1938,7 +1934,7 @@ XS(XS_Client_IncreaseLanguageSkill) { dXSARGS; if (items < 2 || items > 3) - Perl_croak(aTHX_ "Usage: Client::IncreaseLanguageSkill(THIS, skill_id, value= 1)"); + Perl_croak(aTHX_ "Usage: Client::IncreaseLanguageSkill(THIS, int skill_id, int value = 1)"); { Client * THIS; int skill_id = (int)SvIV(ST(1)); @@ -1969,7 +1965,7 @@ XS(XS_Client_GetSkill) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::GetSkill(THIS, skill_id)"); + Perl_croak(aTHX_ "Usage: Client::GetSkill(THIS, uint16 skill_id)"); { Client * THIS; uint16 RETVAL; @@ -1996,7 +1992,7 @@ XS(XS_Client_GetRawSkill) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::GetRawSkill(THIS, skill_id)"); + Perl_croak(aTHX_ "Usage: Client::GetRawSkill(THIS, int skill_id)"); { Client * THIS; uint32 RETVAL; @@ -2023,7 +2019,7 @@ XS(XS_Client_HasSkill) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::HasSkill(THIS, skill_id)"); + Perl_croak(aTHX_ "Usage: Client::HasSkill(THIS, int skill_id)"); { Client * THIS; bool RETVAL; @@ -2050,7 +2046,7 @@ XS(XS_Client_CanHaveSkill) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::CanHaveSkill(THIS, skill_id)"); + Perl_croak(aTHX_ "Usage: Client::CanHaveSkill(THIS, int skill_id)"); { Client * THIS; bool RETVAL; @@ -2077,7 +2073,7 @@ XS(XS_Client_SetSkill) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::SetSkill(THIS, skill_num, value)"); + Perl_croak(aTHX_ "Usage: Client::SetSkill(THIS, int skill_id, uint16 value)"); { Client * THIS; EQEmu::skills::SkillType skill_num = (EQEmu::skills::SkillType)SvUV(ST(1)); @@ -2098,23 +2094,21 @@ XS(XS_Client_SetSkill) } XS(XS_Client_AddSkill); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_AddSkill) -{ +XS(XS_Client_AddSkill) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::AddSkill(THIS, skillid, value)"); + Perl_croak(aTHX_ "Usage: Client::AddSkill(THIS, int skill_id, uint16 value)"); { - Client * THIS; - EQEmu::skills::SkillType skillid = (EQEmu::skills::SkillType)SvUV(ST(1)); - uint16 value = (uint16)SvUV(ST(2)); + Client *THIS; + EQEmu::skills::SkillType skillid = (EQEmu::skills::SkillType) SvUV(ST(1)); + uint16 value = (uint16) SvUV(ST(2)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->AddSkill(skillid, value); @@ -2127,7 +2121,7 @@ XS(XS_Client_CheckSpecializeIncrease) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::CheckSpecializeIncrease(THIS, spell_id)"); + Perl_croak(aTHX_ "Usage: Client::CheckSpecializeIncrease(THIS, uint16 spell_id)"); { Client * THIS; uint16 spell_id = (uint16)SvUV(ST(1)); @@ -2151,7 +2145,7 @@ XS(XS_Client_CheckIncreaseSkill) { dXSARGS; if (items < 2 || items > 3) - Perl_croak(aTHX_ "Usage: Client::CheckIncreaseSkill(THIS, skillid, chancemodi= 0)"); + Perl_croak(aTHX_ "Usage: Client::CheckIncreaseSkill(THIS, int skill_id, int chance_modifier = 0)"); { Client * THIS; bool RETVAL; @@ -2181,65 +2175,63 @@ XS(XS_Client_CheckIncreaseSkill) } XS(XS_Client_SetLanguageSkill); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetLanguageSkill) -{ +XS(XS_Client_SetLanguageSkill) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::SetLanguageSkill(THIS, langid, value)"); + Perl_croak(aTHX_ "Usage: Client::SetLanguageSkill(THIS, int language_id, int value)"); { - Client * THIS; - int langid = (int)SvIV(ST(1)); - int value = (int)SvIV(ST(2)); + Client *THIS; + int langid = (int) SvIV(ST(1)); + int value = (int) SvIV(ST(2)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetLanguageSkill(langid, value); } XSRETURN_EMPTY; + } XS(XS_Client_MaxSkill); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_MaxSkill) -{ +XS(XS_Client_MaxSkill) { dXSARGS; if (items < 2 || items > 4) - Perl_croak(aTHX_ "Usage: Client::MaxSkill(THIS, skillid, class, level)"); + Perl_croak(aTHX_ "Usage: Client::MaxSkill(THIS, uint16 skill_id, uint16 class_id, uint16 level)"); { - Client * THIS; - uint16 RETVAL; - EQEmu::skills::SkillType skillid = (EQEmu::skills::SkillType)SvUV(ST(1)); - uint16 class_ = 0; - uint16 level = 0; + Client *THIS; + uint16 RETVAL; + EQEmu::skills::SkillType skillid = (EQEmu::skills::SkillType) SvUV(ST(1)); + uint16 class_ = 0; + uint16 level = 0; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - if(items > 2) - class_ = (uint16)SvUV(ST(2)); + if (items > 2) + class_ = (uint16) SvUV(ST(2)); else class_ = THIS->GetClass(); - if(items > 3) - level = (uint16)SvUV(ST(3)); + if (items > 3) + level = (uint16) SvUV(ST(3)); else level = THIS->GetLevel(); RETVAL = THIS->MaxSkill(skillid, class_, level); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } @@ -2417,30 +2409,28 @@ XS(XS_Client_ResetAA) } XS(XS_Client_MemSpell); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_MemSpell) -{ +XS(XS_Client_MemSpell) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ "Usage: Client::MemSpell(THIS, spell_id, slot, update_client= true)"); + Perl_croak(aTHX_ "Usage: Client::MemSpell(THIS, uint16 spell_id, int slot, [bool update_client = true])"); { - Client * THIS; - uint16 spell_id = (uint16)SvUV(ST(1)); - int slot = (int)SvIV(ST(2)); - bool update_client; + Client *THIS; + uint16 spell_id = (uint16) SvUV(ST(1)); + int slot = (int) SvIV(ST(2)); + bool update_client; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 4) update_client = true; else { - update_client = (bool)SvTRUE(ST(3)); + update_client = (bool) SvTRUE(ST(3)); } THIS->MemSpell(spell_id, slot, update_client); @@ -2449,29 +2439,27 @@ XS(XS_Client_MemSpell) } XS(XS_Client_UnmemSpell); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_UnmemSpell) -{ +XS(XS_Client_UnmemSpell) { dXSARGS; if (items < 2 || items > 3) - Perl_croak(aTHX_ "Usage: Client::UnmemSpell(THIS, slot, update_client= true)"); + Perl_croak(aTHX_ "Usage: Client::UnmemSpell(THIS, int slot, [bool update_client = true])"); { - Client * THIS; - int slot = (int)SvIV(ST(1)); - bool update_client; + Client *THIS; + int slot = (int) SvIV(ST(1)); + bool update_client; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) update_client = true; else { - update_client = (bool)SvTRUE(ST(2)); + update_client = (bool) SvTRUE(ST(2)); } THIS->UnmemSpell(slot, update_client); @@ -2480,22 +2468,20 @@ XS(XS_Client_UnmemSpell) } XS(XS_Client_UnmemSpellBySpellID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_UnmemSpellBySpellID) -{ +XS(XS_Client_UnmemSpellBySpellID) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::UnmemSpellBySpellID(THIS, spell_id)"); + Perl_croak(aTHX_ "Usage: Client::UnmemSpellBySpellID(THIS, int32 spell_id)"); { - Client * THIS; - int32 spell_id = (int32)SvIV(ST(1)); + Client *THIS; + int32 spell_id = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->UnmemSpellBySpellID(spell_id); @@ -2504,28 +2490,26 @@ XS(XS_Client_UnmemSpellBySpellID) } XS(XS_Client_UnmemSpellAll); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_UnmemSpellAll) -{ +XS(XS_Client_UnmemSpellAll) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: Client::UnmemSpellAll(THIS, update_client= true)"); + Perl_croak(aTHX_ "Usage: Client::UnmemSpellAll(THIS, [bool update_client = true])"); { - Client * THIS; - bool update_client; + Client *THIS; + bool update_client; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) update_client = true; else { - update_client = (bool)SvTRUE(ST(1)); + update_client = (bool) SvTRUE(ST(1)); } THIS->UnmemSpellAll(update_client); @@ -2534,30 +2518,28 @@ XS(XS_Client_UnmemSpellAll) } XS(XS_Client_ScribeSpell); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_ScribeSpell) -{ +XS(XS_Client_ScribeSpell) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ "Usage: Client::ScribeSpell(THIS, spell_id, slot, update_client= true)"); + Perl_croak(aTHX_ "Usage: Client::ScribeSpell(THIS, uint16 spell_id, int slot, [bool update_client = true])"); { - Client * THIS; - uint16 spell_id = (uint16)SvUV(ST(1)); - int slot = (int)SvIV(ST(2)); - bool update_client; + Client *THIS; + uint16 spell_id = (uint16) SvUV(ST(1)); + int slot = (int) SvIV(ST(2)); + bool update_client; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 4) update_client = true; else { - update_client = (bool)SvTRUE(ST(3)); + update_client = (bool) SvTRUE(ST(3)); } THIS->ScribeSpell(spell_id, slot, update_client); @@ -2566,29 +2548,27 @@ XS(XS_Client_ScribeSpell) } XS(XS_Client_UnscribeSpell); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_UnscribeSpell) -{ +XS(XS_Client_UnscribeSpell) { dXSARGS; if (items < 2 || items > 3) - Perl_croak(aTHX_ "Usage: Client::UnscribeSpell(THIS, slot, update_client= true)"); + Perl_croak(aTHX_ "Usage: Client::UnscribeSpell(THIS, int slot, [bool update_client = true])"); { - Client * THIS; - int slot = (int)SvIV(ST(1)); - bool update_client; + Client *THIS; + int slot = (int) SvIV(ST(1)); + bool update_client; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) update_client = true; else { - update_client = (bool)SvTRUE(ST(2)); + update_client = (bool) SvTRUE(ST(2)); } THIS->UnscribeSpell(slot, update_client); @@ -2601,7 +2581,7 @@ XS(XS_Client_UnscribeSpellAll) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: Client::UnscribeSpellAll(THIS, update_client= true)"); + Perl_croak(aTHX_ "Usage: Client::UnscribeSpellAll(THIS, [bool update_client = true])"); { Client * THIS; bool update_client; @@ -2631,7 +2611,7 @@ XS(XS_Client_TrainDiscBySpellID) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::TrainDiscBySpellID(THIS, spell_id)"); + Perl_croak(aTHX_ "Usage: Client::TrainDiscBySpellID(THIS, int32 spell_id)"); { Client * THIS; int32 spell_id = (int32)SvIV(ST(1)); @@ -2655,7 +2635,7 @@ XS(XS_Client_GetDiscSlotBySpellID) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::GetDiscSlotBySpellID(THIS, spell_id)"); + Perl_croak(aTHX_ "Usage: Client::GetDiscSlotBySpellID(THIS, int32 spell_id)"); { Client * THIS; int RETVAL; @@ -2678,29 +2658,27 @@ XS(XS_Client_GetDiscSlotBySpellID) } XS(XS_Client_UntrainDisc); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_UntrainDisc) -{ +XS(XS_Client_UntrainDisc) { dXSARGS; if (items < 2 || items > 3) - Perl_croak(aTHX_ "Usage: Client::UntrainDisc(THIS, slot, update_client= true)"); + Perl_croak(aTHX_ "Usage: Client::UntrainDisc(THIS, int slot, [bool update_client = true])"); { - Client * THIS; - int slot = (int)SvIV(ST(1)); - bool update_client; + Client *THIS; + int slot = (int) SvIV(ST(1)); + bool update_client; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) update_client = true; else { - update_client = (bool)SvTRUE(ST(2)); + update_client = (bool) SvTRUE(ST(2)); } THIS->UntrainDisc(slot, update_client); @@ -2709,28 +2687,26 @@ XS(XS_Client_UntrainDisc) } XS(XS_Client_UntrainDiscAll); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_UntrainDiscAll) -{ +XS(XS_Client_UntrainDiscAll) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: Client::UntrainDiscAll(THIS, update_client= true)"); + Perl_croak(aTHX_ "Usage: Client::UntrainDiscAll(THIS, [update_client = true])"); { - Client * THIS; - bool update_client; + Client *THIS; + bool update_client; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) update_client = true; else { - update_client = (bool)SvTRUE(ST(1)); + update_client = (bool) SvTRUE(ST(1)); } THIS->UntrainDiscAll(update_client); @@ -2991,58 +2967,55 @@ XS(XS_Client_GetHorseId) } XS(XS_Client_NukeItem); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_NukeItem) -{ +XS(XS_Client_NukeItem) { dXSARGS; if (items != 3 && items != 2) - Perl_croak(aTHX_ "Usage: Client::NukeItem(THIS, itemnum, [where_to_check])"); + Perl_croak(aTHX_ "Usage: Client::NukeItem(THIS, uint32 item_id, [uint8 slot_to_check])"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; - uint32 itemnum = (uint32)SvUV(ST(1)); - uint8 where_to_check; + uint32 itemnum = (uint32) SvUV(ST(1)); + uint8 where_to_check; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - if(items < 3){ + if (items < 3) { where_to_check = 0xFF; } - if(items == 3){ - where_to_check = (uint8)SvUV(ST(2)); + if (items == 3) { + where_to_check = (uint8) SvUV(ST(2)); } RETVAL = THIS->NukeItem(itemnum, where_to_check); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_SetTint); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetTint) -{ +XS(XS_Client_SetTint) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::SetTint(THIS, slot_id, color)"); + Perl_croak(aTHX_ "Usage: Client::SetTint(THIS, int16 slot_id, uint32 color)"); { - Client * THIS; - int16 slot_id = (int16)SvIV(ST(1)); - uint32 color = (uint32)SvUV(ST(2)); + Client *THIS; + int16 slot_id = (int16) SvIV(ST(1)); + uint32 color = (uint32) SvUV(ST(2)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetTint(slot_id, color); @@ -3051,23 +3024,21 @@ XS(XS_Client_SetTint) } XS(XS_Client_SetMaterial); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetMaterial) -{ +XS(XS_Client_SetMaterial) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::SetMaterial(THIS, slot_id, item_id)"); + Perl_croak(aTHX_ "Usage: Client::SetMaterial(THIS, int16 slot_id, uint32 item_id)"); { - Client * THIS; - int16 slot_id = (int16)SvIV(ST(1)); - uint32 item_id = (uint32)SvUV(ST(2)); + Client *THIS; + int16 slot_id = (int16) SvIV(ST(1)); + uint32 item_id = (uint32) SvUV(ST(2)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetMaterial(slot_id, item_id); @@ -3103,7 +3074,7 @@ XS(XS_Client_GetItemIDAt) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::GetItemIDAt(THIS, slot_id)"); + Perl_croak(aTHX_ "Usage: Client::GetItemIDAt(THIS, int16 slot_id)"); { Client * THIS; int32 RETVAL; @@ -3130,7 +3101,7 @@ XS(XS_Client_GetAugmentIDAt) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::GetAugmentIDAt(THIS, slot_id, augslot)"); + Perl_croak(aTHX_ "Usage: Client::GetAugmentIDAt(THIS, int16 slot_id, int16 aug_slot)"); { Client * THIS; int32 RETVAL; @@ -3154,36 +3125,35 @@ XS(XS_Client_GetAugmentIDAt) } XS(XS_Client_DeleteItemInInventory); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_DeleteItemInInventory) -{ +XS(XS_Client_DeleteItemInInventory) { dXSARGS; if (items < 2 || items > 4) - Perl_croak(aTHX_ "Usage: Client::DeleteItemInInventory(THIS, slot_id, quantity= 0, client_update= false)"); + Perl_croak(aTHX_ + "Usage: Client::DeleteItemInInventory(THIS, int16 slot_id, [int8 quantity = 0], [bool client_update = false])"); { - Client * THIS; - int16 slot_id = (int16)SvIV(ST(1)); - int8 quantity; - bool client_update; + Client *THIS; + int16 slot_id = (int16) SvIV(ST(1)); + int8 quantity; + bool client_update; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) quantity = 0; else { - quantity = (int8)SvIV(ST(2)); + quantity = (int8) SvIV(ST(2)); } if (items < 4) client_update = false; else { - client_update = (bool)SvTRUE(ST(3)); + client_update = (bool) SvTRUE(ST(3)); } THIS->DeleteItemInInventory(slot_id, quantity, client_update); @@ -3196,7 +3166,7 @@ XS(XS_Client_SummonItem) { dXSARGS; if (items < 2 || items > 10) - Perl_croak(aTHX_ "Usage: Client::SummonItem(THIS, item_id, charges=0, attune=0, aug1=0, aug2=0, aug3=0, aug4=0, aug5=0, slot_id=30)"); + Perl_croak(aTHX_ "Usage: Client::SummonItem(THIS, uint32 item_id, [int16 charges = -1], [bool attune = false], [uint32 aug1 = 0], [uint32 aug2 = 0], [uint32 aug3 = 0], [uint32 aug4 = 0], [uint32 aug5 = 0], [uint16 slot_id = 30])"); { Client * THIS; uint32 item_id = (uint32)SvUV(ST(1)); @@ -3253,7 +3223,7 @@ XS(XS_Client_SetStats) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::SetStats(THIS, type, increase_val)"); + Perl_croak(aTHX_ "Usage: Client::SetStats(THIS, uint8 type, uint16 increase_val)"); { Client * THIS; uint8 type = (uint8)SvUV(ST(1)); @@ -3278,7 +3248,7 @@ XS(XS_Client_IncStats) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::IncStats(THIS, type, increase_val)"); + Perl_croak(aTHX_ "Usage: Client::IncStats(THIS, uint8 type, uint16 increase_val)"); { Client * THIS; uint8 type = (uint8)SvUV(ST(1)); @@ -3303,7 +3273,7 @@ XS(XS_Client_DropItem) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::DropItem(THIS, slot_id)"); + Perl_croak(aTHX_ "Usage: Client::DropItem(THIS, int16 slot_id)"); { Client * THIS; int16 slot_id = (int16)SvIV(ST(1)); @@ -3529,7 +3499,7 @@ XS(XS_Client_GetInstrumentMod) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::GetInstrumentMod(THIS, spell_id)"); + Perl_croak(aTHX_ "Usage: Client::GetInstrumentMod(THIS, uint16 spell_id)"); { Client * THIS; uint16 RETVAL; @@ -3556,7 +3526,7 @@ XS(XS_Client_DecreaseByID) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::DecreaseByID(THIS, type, amt)"); + Perl_croak(aTHX_ "Usage: Client::DecreaseByID(THIS, uint32 type, unit8 amount)"); { Client * THIS; bool RETVAL; @@ -3584,7 +3554,7 @@ XS(XS_Client_SlotConvert2) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::SlotConvert2(THIS, slot)"); + Perl_croak(aTHX_ "Usage: Client::SlotConvert2(THIS, uint8 slot)"); { Client * THIS; uint8 RETVAL; @@ -3699,68 +3669,64 @@ XS(XS_Client_ForageItem) } XS(XS_Client_CalcPriceMod); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_CalcPriceMod) -{ +XS(XS_Client_CalcPriceMod) { dXSARGS; if (items < 1 || items > 3) - Perl_croak(aTHX_ "Usage: Client::CalcPriceMod(THIS, other= 0, reverse= false)"); + Perl_croak(aTHX_ "Usage: Client::CalcPriceMod(THIS, Mob*, [bool reverse = false])"); { - Client * THIS; - float RETVAL; + Client *THIS; + float RETVAL; dXSTARG; - Mob* other; - bool reverse; + Mob *other; + bool reverse; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) other = 0; else { if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - other = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + other = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == nullptr) + if (other == nullptr) Perl_croak(aTHX_ "other is nullptr, avoiding crash."); } if (items < 3) reverse = false; else { - reverse = (bool)SvTRUE(ST(2)); + reverse = (bool) SvTRUE(ST(2)); } RETVAL = THIS->CalcPriceMod(other, reverse); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Client_ResetTrade); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_ResetTrade) -{ +XS(XS_Client_ResetTrade) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::ResetTrade(THIS)"); { - Client * THIS; + Client *THIS; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ResetTrade(); @@ -3769,77 +3735,72 @@ XS(XS_Client_ResetTrade) } XS(XS_Client_UseDiscipline); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_UseDiscipline) -{ +XS(XS_Client_UseDiscipline) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::UseDiscipline(THIS, spell_id, target)"); + Perl_croak(aTHX_ "Usage: Client::UseDiscipline(THIS, int32 spell_id, int32 target)"); { - Client * THIS; - bool RETVAL; - uint32 spell_id = (uint32)SvUV(ST(1)); - uint32 target = (uint32)SvUV(ST(2)); + Client *THIS; + bool RETVAL; + uint32 spell_id = (uint32) SvUV(ST(1)); + uint32 target = (uint32) SvUV(ST(2)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->UseDiscipline(spell_id, target); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Client_GetCharacterFactionLevel); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetCharacterFactionLevel) -{ +XS(XS_Client_GetCharacterFactionLevel) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::GetCharacterFactionLevel(THIS, faction_id)"); + Perl_croak(aTHX_ "Usage: Client::GetCharacterFactionLevel(THIS, int32 faction_id)"); { - Client * THIS; - int32 RETVAL; + Client *THIS; + int32 RETVAL; dXSTARG; - int32 faction_id = (int32)SvIV(ST(1)); + int32 faction_id = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCharacterFactionLevel(faction_id); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Client_SetZoneFlag); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetZoneFlag) -{ +XS(XS_Client_SetZoneFlag) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::SetZoneFlag(THIS, zone_id)"); + Perl_croak(aTHX_ "Usage: Client::SetZoneFlag(THIS, uint32 zone_id)"); { - Client * THIS; - uint32 zone_id = (uint32)SvUV(ST(1)); + Client *THIS; + uint32 zone_id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetZoneFlag(zone_id); @@ -3848,22 +3809,20 @@ XS(XS_Client_SetZoneFlag) } XS(XS_Client_ClearZoneFlag); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_ClearZoneFlag) -{ +XS(XS_Client_ClearZoneFlag) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::ClearZoneFlag(THIS, zone_id)"); + Perl_croak(aTHX_ "Usage: Client::ClearZoneFlag(THIS, uint32 zone_id)"); { - Client * THIS; - uint32 zone_id = (uint32)SvUV(ST(1)); + Client *THIS; + uint32 zone_id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ClearZoneFlag(zone_id); @@ -3876,7 +3835,7 @@ XS(XS_Client_HasZoneFlag) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::HasZoneFlag(THIS, zone_id)"); + Perl_croak(aTHX_ "Usage: Client::HasZoneFlag(THIS, uint32 zone_id)"); { Client * THIS; bool RETVAL; @@ -3903,7 +3862,7 @@ XS(XS_Client_SendZoneFlagInfo) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::SendZoneFlagInfo(THIS, to)"); + Perl_croak(aTHX_ "Usage: Client::SendZoneFlagInfo(THIS, Client* to)"); { Client * THIS; Client * to; @@ -3959,7 +3918,7 @@ XS(XS_Client_SetAATitle) { dXSARGS; if ((items < 2) || (items > 3)) - Perl_croak(aTHX_ "Usage: Client::SetAATitle(THIS, txt, [save])"); + Perl_croak(aTHX_ "Usage: Client::SetAATitle(THIS, string text, [bool save = false])"); { Client * THIS; char * txt = (char *)SvPV_nolen(ST(1)); @@ -4044,7 +4003,7 @@ XS(XS_Client_SetTitleSuffix); XS(XS_Client_SetTitleSuffix) { dXSARGS; if ((items < 2) || (items > 3)) - Perl_croak(aTHX_ "Usage: Client::SetTitleSuffix(THIS, txt, [save])"); + Perl_croak(aTHX_ "Usage: Client::SetTitleSuffix(THIS, string text, [bool save = false])"); { Client * THIS; char * txt = (char *)SvPV_nolen(ST(1)); @@ -4077,7 +4036,7 @@ XS(XS_Client_SetAAPoints); XS(XS_Client_SetAAPoints) { dXSARGS; if(items != 2) - Perl_croak(aTHX_ "Usage: Client::SetAAPoints(THIS, points)"); + Perl_croak(aTHX_ "Usage: Client::SetAAPoints(THIS, uint32 points)"); { Client * THIS; uint32 points = SvUV(ST(1)); @@ -4150,7 +4109,7 @@ XS(XS_Client_AddAAPoints); XS(XS_Client_AddAAPoints) { dXSARGS; if(items != 2) - Perl_croak(aTHX_ "Usage: Client::AddAAPoints(THIS, number)"); + Perl_croak(aTHX_ "Usage: Client::AddAAPoints(THIS, uint32 points)"); { Client * THIS; uint32 points = SvUV(ST(1)); @@ -4196,7 +4155,7 @@ XS(XS_Client_GetModCharacterFactionLevel) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::GetModCharacterFactionLevel(THIS, faction_id)"); + Perl_croak(aTHX_ "Usage: Client::GetModCharacterFactionLevel(THIS, int32 faction_id)"); { Client * THIS; int32 RETVAL; @@ -4275,7 +4234,7 @@ XS(XS_Client_GetLDoNWinsTheme) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::GetLDoNWinsTheme(THIS, theme)"); + Perl_croak(aTHX_ "Usage: Client::GetLDoNWinsTheme(THIS, int32 theme)"); { Client * THIS; uint32 RETVAL; @@ -4302,7 +4261,7 @@ XS(XS_Client_GetLDoNLossesTheme) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::GetLDoNLossesTheme(THIS, theme)"); + Perl_croak(aTHX_ "Usage: Client::GetLDoNLossesTheme(THIS, int32 theme)"); { Client * THIS; uint32 RETVAL; @@ -4329,7 +4288,7 @@ XS(XS_Client_GetItemAt) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::GetItemAt(THIS, slot)"); + Perl_croak(aTHX_ "Usage: Client::GetItemAt(THIS, uint32 slot)"); { Client * THIS; EQEmu::ItemInstance * RETVAL; @@ -4356,7 +4315,7 @@ XS(XS_Client_GetAugmentAt) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::GetAugmentAt(THIS, slot, aug_slot)"); + Perl_croak(aTHX_ "Usage: Client::GetAugmentAt(THIS, uint32 slot, uint32 aug_slot)"); { Client * THIS; EQEmu::ItemInstance * RETVAL; @@ -4419,7 +4378,7 @@ XS(XS_Client_SetStartZone) { dXSARGS; if (items != 2 && items != 5) - Perl_croak(aTHX_ "Usage: Client::SetStartZone(THIS, zoneid [, x, y, z])"); + Perl_croak(aTHX_ "Usage: Client::SetStartZone(THIS, uint32 zone_id, [float x = 0], [float y = 0], [float z = 0])"); { Client * THIS; uint32 zoneid = (uint32)SvUV(ST(1)); @@ -4452,7 +4411,7 @@ XS(XS_Client_KeyRingAdd) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::KeyRingAdd(THIS, item_id)"); + Perl_croak(aTHX_ "Usage: Client::KeyRingAdd(THIS, uint32 item_id)"); { Client * THIS; uint32 item_id = (uint32)SvUV(ST(1)); @@ -4476,7 +4435,7 @@ XS(XS_Client_KeyRingCheck) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::KeyRingCheck(THIS, item_id)"); + Perl_croak(aTHX_ "Usage: Client::KeyRingCheck(THIS, uint32 item_id)"); { Client * THIS; bool RETVAL; @@ -4503,7 +4462,7 @@ XS(XS_Client_AddPVPPoints) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::AddPVPPoints(THIS, Points)"); + Perl_croak(aTHX_ "Usage: Client::AddPVPPoints(THIS, uint32 points)"); { Client * THIS; uint32 Points = (uint32)SvUV(ST(1)); @@ -4527,7 +4486,7 @@ XS(XS_Client_AddCrystals) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::AddCrystals(THIS, RadiantCount, EbonCount)"); + Perl_croak(aTHX_ "Usage: Client::AddCrystals(THIS, uint32 radiant_count, uint32 ebon_count)"); { Client * THIS; uint32 Radiant = (uint32)SvUV(ST(1)); @@ -4630,7 +4589,7 @@ XS(XS_Client_ReadBook) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::ReadBook(THIS, Book Text, Type)"); + Perl_croak(aTHX_ "Usage: Client::ReadBook(THIS, char* book_test, uint8 type)"); { Client * THIS; char* in_txt = (char *)SvPV_nolen(ST(1)); @@ -4655,7 +4614,7 @@ XS(XS_Client_UpdateGroupAAs) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::UpdateGroupAAs(THIS, points, type)"); + Perl_croak(aTHX_ "Usage: Client::UpdateGroupAAs(THIS, int32 points, uint32 type)"); { Client * THIS; int32 points = (int32)SvIV(ST(1)); @@ -4732,7 +4691,7 @@ XS(XS_Client_LearnRecipe) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::LearnRecipe(THIS, recipe_id)"); + Perl_croak(aTHX_ "Usage: Client::LearnRecipe(THIS, uint32 recipe_id)"); { Client * THIS; uint32 recipe_id = (uint32)SvUV(ST(1)); @@ -4858,7 +4817,7 @@ XS(XS_Client_SendOPTranslocateConfirm) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::SendOPTranslocateConfirm(THIS, Caster, SpellID)"); + Perl_croak(aTHX_ "Usage: Client::SendOPTranslocateConfirm(THIS, Mob* caster, int32 spell_id)"); { Client * THIS; Mob * caster = nullptr; @@ -4892,7 +4851,7 @@ XS(XS_Client_NPCSpawn) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ "Usage: Client::NPCSpawn(THIS, target_npc, option, respawntime=1200)"); + Perl_croak(aTHX_ "Usage: Client::NPCSpawn(THIS, NPC*, string option, uint32 respawn_time=1200)"); { Client * THIS; NPC * target_npc = nullptr; @@ -4956,7 +4915,7 @@ XS(XS_Client_AddLevelBasedExp) { dXSARGS; if (items < 2 || items > 3 ) - Perl_croak(aTHX_ "Usage: Client::AddLevelBasedExp(THIS, exp_percentage, max_level=0)"); + Perl_croak(aTHX_ "Usage: Client::AddLevelBasedExp(THIS, uint8 exp_percentage, uint8 max_level = 0)"); { Client * THIS; uint8 exp_percentage = (uint8)SvUV(ST(1)); @@ -4984,7 +4943,7 @@ XS(XS_Client_IncrementAA) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::IncrementAA(THIS, aaskillid)"); + Perl_croak(aTHX_ "Usage: Client::IncrementAA(THIS, uint32 aa_skill_id)"); { Client * THIS; uint32 aaskillid = SvUV(ST(1)); @@ -5008,7 +4967,7 @@ XS(XS_Client_GrantAlternateAdvancementAbility) { dXSARGS; if(items < 3 || items > 4) - Perl_croak(aTHX_ "Usage: Client::GrantAlternateAdvancementAbility(THIS, aa_id, points, [ignore_cost])"); + Perl_croak(aTHX_ "Usage: Client::GrantAlternateAdvancementAbility(THIS, int aa_id, int points, [bool ignore_cost = false])"); { Client * THIS; bool RETVAL; @@ -5041,7 +5000,7 @@ XS(XS_Client_GetAALevel) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::GetAALevel(THIS, aaskillid)"); + Perl_croak(aTHX_ "Usage: Client::GetAALevel(THIS, uint32 aa_skill_id)"); { Client * THIS; uint32 RETVAL; @@ -5068,7 +5027,7 @@ XS(XS_Client_MarkCompassLoc) { dXSARGS; if (items != 4) - Perl_croak(aTHX_ "Usage: Client::MarkCompassLoc(THIS, x, y, z)"); + Perl_croak(aTHX_ "Usage: Client::MarkCompassLoc(THIS, float x, float y, float z)"); { Client * THIS; float x = SvNV(ST(1)); @@ -5117,7 +5076,7 @@ XS(XS_Client_GetFreeSpellBookSlot) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: Client::GetFreeSpellBookSlot(THIS, start_slot=0)"); + Perl_croak(aTHX_ "Usage: Client::GetFreeSpellBookSlot(THIS, uint32 start_slot = 0)"); { Client * THIS; int RETVAL; @@ -5147,7 +5106,7 @@ XS(XS_Client_GetSpellBookSlotBySpellID) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::GetSpellBookSlotBySpellID(THIS, spell_id)"); + Perl_croak(aTHX_ "Usage: Client::GetSpellBookSlotBySpellID(THIS, uint32 spell_id)"); { Client * THIS; int RETVAL; @@ -5174,7 +5133,7 @@ XS(XS_Client_UpdateTaskActivity) { dXSARGS; if (items < 4) - Perl_croak(aTHX_ "Usage: Client::UpdateTaskActivity(THIS, TaskID, ActivityID, Count, [ignore_quest_update])"); + Perl_croak(aTHX_ "Usage: Client::UpdateTaskActivity(THIS, int task_id, int activity_id, int count, [bool ignore_quest_update = false])"); { bool ignore_quest_update = false; @@ -5207,7 +5166,7 @@ XS(XS_Client_GetTaskActivityDoneCount) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::GetTaskActivityDoneCount(THIS, TaskID, ActivityID)"); + Perl_croak(aTHX_ "Usage: Client::GetTaskActivityDoneCount(THIS, int task_id, int activity_id)"); { Client * THIS; int RETVAL; @@ -5236,7 +5195,7 @@ XS(XS_Client_AssignTask) { dXSARGS; if (items != 3 && items != 4) - Perl_croak(aTHX_ "Usage: Client::AssignTask(THIS, TaskID, NPCID, enforce_level_requirement)"); + Perl_croak(aTHX_ "Usage: Client::AssignTask(THIS, int task_id, int npc_id, [bool enforce_level_requirement = false])"); { Client * THIS; int TaskID = (int)SvIV(ST(1)); @@ -5268,7 +5227,7 @@ XS(XS_Client_FailTask) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::FailTask(THIS, TaskID)"); + Perl_croak(aTHX_ "Usage: Client::FailTask(THIS, int task_id)"); { Client * THIS; int TaskID = (int)SvIV(ST(1)); @@ -5292,7 +5251,7 @@ XS(XS_Client_IsTaskCompleted) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::IsTaskCompleted(THIS, TaskID)"); + Perl_croak(aTHX_ "Usage: Client::IsTaskCompleted(THIS, int task_id)"); { Client * THIS; int RETVAL; @@ -5319,7 +5278,7 @@ XS(XS_Client_IsTaskActive) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::IsTaskActive(THIS, TaskID)"); + Perl_croak(aTHX_ "Usage: Client::IsTaskActive(THIS, int task_id)"); { Client * THIS; bool RETVAL; @@ -5346,7 +5305,7 @@ XS(XS_Client_IsTaskActivityActive) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::IsTaskActivityActive(THIS, TaskID, ActivityID)"); + Perl_croak(aTHX_ "Usage: Client::IsTaskActivityActive(THIS, int task_id, int activity_id)"); { Client * THIS; bool RETVAL; @@ -5400,7 +5359,7 @@ XS(XS_Client_GetCorpseID) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::GetCorpseID(THIS, corpse)"); + Perl_croak(aTHX_ "Usage: Client::GetCorpseID(THIS, uint8 corpse)"); { Client * THIS; uint8 corpse = (uint8)SvIV(ST(1)); @@ -5427,7 +5386,7 @@ XS(XS_Client_GetCorpseItemAt) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::GetCorpseItemAt(THIS, corpse_id, slotid)"); + Perl_croak(aTHX_ "Usage: Client::GetCorpseItemAt(THIS, uint32 corpse_id, uint16 slot_id)"); { Client * THIS; uint32 corpse_id = (uint32)SvIV(ST(1)); @@ -5455,7 +5414,7 @@ XS(XS_Client_AssignToInstance) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::AssignToInstance(THIS, instance_id)"); + Perl_croak(aTHX_ "Usage: Client::AssignToInstance(THIS, uint16 instance_id)"); { Client * THIS; uint16 instance_id = (uint16)SvUV(ST(1)); @@ -5479,7 +5438,7 @@ XS(XS_Client_RemoveFromInstance) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::RemoveFromInstance(THIS, instance_id)"); + Perl_croak(aTHX_ "Usage: Client::RemoveFromInstance(THIS, uint16 instance_id)"); { Client * THIS; uint16 instance_id = (uint16)SvUV(ST(1)); @@ -5631,7 +5590,7 @@ XS(XS_Client_GetItemInInventory) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::GetItemInInventory(THIS, slot_id)"); + Perl_croak(aTHX_ "Usage: Client::GetItemInInventory(THIS, int16 slot_id)"); { Client * THIS; int16 slot_id = (int16)SvIV(ST(1)); @@ -5658,7 +5617,7 @@ XS(XS_Client_SetCustomItemData) { dXSARGS; if (items != 4) - Perl_croak(aTHX_ "Usage: Client::SetCustomItemData(THIS, slot_id, identifier, value)"); + Perl_croak(aTHX_ "Usage: Client::SetCustomItemData(THIS, int16 slot_id, string identifier, string value)"); { Client * THIS; int16 slot_id = (int16)SvIV(ST(1)); @@ -5684,7 +5643,7 @@ XS(XS_Client_GetCustomItemData) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::GetCustomItemData(THIS, slot_id, identifier)"); + Perl_croak(aTHX_ "Usage: Client::GetCustomItemData(THIS, int16 slot_id, string identifier)"); { Client * THIS; int16 slot_id = (int16)SvIV(ST(1)); @@ -5736,7 +5695,7 @@ XS(XS_Client_SignalClient) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::SignalClient(THIS, data)"); + Perl_croak(aTHX_ "Usage: Client::SignalClient(THIS, uint32 data)"); { Client * THIS; uint32 data = (uint32)SvUV(ST(1)); @@ -5785,7 +5744,7 @@ XS(XS_Client_SendWebLink) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: Client::SendWebLink(THIS, website)"); + Perl_croak(aTHX_ "Usage: Client::SendWebLink(THIS, string website_url)"); { Client * THIS; char * website = nullptr; @@ -5837,7 +5796,7 @@ XS(XS_Client_HasSpellScribed) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::HasSpellScribed(THIS, spell_id)"); + Perl_croak(aTHX_ "Usage: Client::HasSpellScribed(THIS, int spell_id)"); { Client * THIS; bool RETVAL; @@ -5864,7 +5823,7 @@ XS(XS_Client_SetAccountFlag) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::SetAccountFlag(THIS, flag, value)"); + Perl_croak(aTHX_ "Usage: Client::SetAccountFlag(THIS, string flag, string value)"); { Client * THIS; //char* flag = (char *)SvPV_nolen(ST(1)); @@ -5892,7 +5851,7 @@ XS(XS_Client_GetAccountFlag) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::GetAccountFlag(THIS, flag)"); + Perl_croak(aTHX_ "Usage: Client::GetAccountFlag(THIS, string flag)"); { Client * THIS; //char* flag = (char *)SvPV_nolen(ST(1)); @@ -5998,7 +5957,7 @@ XS(XS_Client_SetThirst) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::SetThirst(THIS, in_thirst)"); + Perl_croak(aTHX_ "Usage: Client::SetThirst(THIS, int32 in_thirst)"); { Client * THIS; int32 in_thirst = (uint32)SvUV(ST(1)); @@ -6022,7 +5981,7 @@ XS(XS_Client_SendTargetCommand) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::SendTargetCommand(THIS, in_entid)"); + Perl_croak(aTHX_ "Usage: Client::SendTargetCommand(THIS, int32 entity_id)"); { Client * THIS; int32 in_entid = (uint32)SvUV(ST(1)); @@ -6046,7 +6005,7 @@ XS(XS_Client_SetConsumption) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::SetHunger(THIS, in_hunger, in_thirst)"); + Perl_croak(aTHX_ "Usage: Client::SetHunger(THIS, int32 hunger_amount, int32 thirst_amount)"); { Client * THIS; int32 in_hunger = (uint32)SvUV(ST(1)); @@ -6071,7 +6030,7 @@ XS(XS_Client_SilentMessage) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Client::SilentMessage(THIS, Message)"); + Perl_croak(aTHX_ "Usage: Client::SilentMessage(THIS, string message)"); { Client * THIS; dXSTARG; @@ -6102,7 +6061,7 @@ XS(XS_Client_PlayMP3) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: Client::PlayMP3(THIS, fname)"); + Perl_croak(aTHX_ "Usage: Client::PlayMP3(THIS, string file_name)"); { Client * THIS; char * fname = nullptr; @@ -6128,7 +6087,7 @@ XS(XS_Client_ExpeditionMessage) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::ExpeditionMessage(THIS, ExpdID, Message)"); + Perl_croak(aTHX_ "Usage: Client::ExpeditionMessage(THIS, int expedition_id, string message)"); { Client * THIS; int ExpdID = (int)SvUV(ST(1)); @@ -6156,7 +6115,7 @@ XS(XS_Client_SendMarqueeMessage) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ "Usage: Client::SendMarqueeMessage(THIS, type, priority, fade_in, fade_out, duration, msg)"); + Perl_croak(aTHX_ "Usage: Client::SendMarqueeMessage(THIS, uint32 type, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, string msg)"); { Client * THIS; uint32 type = (uint32)SvUV(ST(1)); @@ -6186,7 +6145,7 @@ XS(XS_Client_SendColoredText) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Client::SendColoredText(color, message)"); + Perl_croak(aTHX_ "Usage: Client::SendColoredText(uint32 color, string message)"); { Client * THIS; uint32 color = (uint32)SvUV(ST(1)); @@ -6212,7 +6171,7 @@ XS(XS_Client_SendSpellAnim) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: SendSpellAnim(uint16 spell_id, uint32 seq)"); + Perl_croak(aTHX_ "Usage: SendSpellAnim(uint16 target_id, uint32 spell_animation_id)"); { Client * THIS; uint16 targetid = (uint16)SvUV(ST(1)); @@ -6228,7 +6187,7 @@ XS(XS_Client_SendSpellAnim) if(THIS == NULL) Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); - THIS->SendSpellAnim(targetid,spell_id); + THIS->SendSpellAnim(targetid, spell_id); } XSRETURN_EMPTY; } @@ -6345,7 +6304,7 @@ XS(XS_Client_QuestReward) { dXSARGS; if (items < 1 || items > 9) - Perl_croak(aTHX_ "Usage: Client::QuestReward(THIS, mob, copper, silver, gold, platinum, itemid, exp, faction)"); + Perl_croak(aTHX_ "Usage: Client::QuestReward(THIS, int32 mob, int32 copper, int32 silver, int32 gold, int32 platinum, int32 item_id, int32 exp, [bool faction = false])"); { Client* THIS; Mob * mob = nullptr; @@ -6394,7 +6353,7 @@ XS(XS_Client_GetMoney) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: GetMoney(THIS, type, subtype)"); + Perl_croak(aTHX_ "Usage: GetMoney(THIS, int8 type, int8 subtype)"); { Client* THIS; uint32 RETVAL; @@ -6449,7 +6408,7 @@ XS(XS_Client_Popup2) { dXSARGS; if (items < 3 || items > 10) - Perl_croak(aTHX_ "Usage: Client::SendFullPopup(THIS, Title, Text, PopupID, NegativeID, Buttons, Duration, ButtonName0, ButtonName1, SoundControls)"); + Perl_croak(aTHX_ "Usage: Client::SendFullPopup(THIS, string title, string text, uint32 popup_id, uint32 negative_id, uint32 buttons, uint32 duration, string button_name_0, string button_name_1, uint32 sound_controls)"); { Client * THIS; char* Title = (char *)SvPV_nolen(ST(1)); From 4d87216ec633deedb1f3b8849e8bee997f791339 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 18:16:04 -0500 Subject: [PATCH 02/33] Format perl_client.cpp --- zone/perl_client.cpp | 4896 ++++++++++++++++++++---------------------- 1 file changed, 2289 insertions(+), 2607 deletions(-) diff --git a/zone/perl_client.cpp b/zone/perl_client.cpp index 2b7d51c42..47d5dd89a 100644 --- a/zone/perl_client.cpp +++ b/zone/perl_client.cpp @@ -26,7 +26,9 @@ */ #include "../common/features.h" + #ifdef EMBPERL_XS_CLASSES + #include "../common/global_define.h" #include "embperl.h" @@ -37,26 +39,24 @@ #include "client.h" #include "titles.h" -#ifdef THIS /* this macro seems to leak out on some systems */ +#ifdef THIS /* this macro seems to leak out on some systems */ #undef THIS #endif XS(XS_Client_SendSound); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SendSound) -{ +XS(XS_Client_SendSound) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::SendSound(THIS)"); { - Client * THIS; + Client *THIS; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SendSound(); @@ -65,48 +65,44 @@ XS(XS_Client_SendSound) } XS(XS_Client_Save); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_Save) -{ +XS(XS_Client_Save) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::Save(THIS, uint8 commit_now)"); { - Client * THIS; - bool RETVAL; - uint8 iCommitNow = (uint8)SvUV(ST(1)); + Client *THIS; + bool RETVAL; + uint8 iCommitNow = (uint8) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->Save(iCommitNow); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Client_SaveBackup); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SaveBackup) -{ +XS(XS_Client_SaveBackup) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::SaveBackup(THIS)"); { - Client * THIS; + Client *THIS; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SaveBackup(); @@ -115,22 +111,20 @@ XS(XS_Client_SaveBackup) } XS(XS_Client_Connected); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_Connected) -{ +XS(XS_Client_Connected) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::Connected(THIS)"); { - Client * THIS; - bool RETVAL; + Client *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->Connected(); @@ -141,22 +135,20 @@ XS(XS_Client_Connected) } XS(XS_Client_InZone); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_InZone) -{ +XS(XS_Client_InZone) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::InZone(THIS)"); { - Client * THIS; - bool RETVAL; + Client *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->InZone(); @@ -167,21 +159,19 @@ XS(XS_Client_InZone) } XS(XS_Client_Kick); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_Kick) -{ +XS(XS_Client_Kick) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::Kick(THIS)"); { - Client * THIS; + Client *THIS; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Kick(); @@ -190,21 +180,19 @@ XS(XS_Client_Kick) } XS(XS_Client_Disconnect); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_Disconnect) -{ +XS(XS_Client_Disconnect) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::Disconnect(THIS)"); { - Client * THIS; + Client *THIS; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Disconnect(); @@ -213,22 +201,20 @@ XS(XS_Client_Disconnect) } XS(XS_Client_IsLD); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_IsLD) -{ +XS(XS_Client_IsLD) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::IsLD(THIS)"); { - Client * THIS; - bool RETVAL; + Client *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsLD(); @@ -239,21 +225,19 @@ XS(XS_Client_IsLD) } XS(XS_Client_WorldKick); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_WorldKick) -{ +XS(XS_Client_WorldKick) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::WorldKick(THIS)"); { - Client * THIS; + Client *THIS; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->WorldKick(); @@ -262,47 +246,44 @@ XS(XS_Client_WorldKick) } XS(XS_Client_GetAnon); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetAnon) -{ +XS(XS_Client_GetAnon) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetAnon(THIS)"); { - Client * THIS; - uint8 RETVAL; + Client *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAnon(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_Duck); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_Duck) -{ +XS(XS_Client_Duck) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::Duck(THIS)"); { - Client * THIS; + Client *THIS; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Duck(); @@ -311,21 +292,19 @@ XS(XS_Client_Duck) } XS(XS_Client_Stand); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_Stand) -{ +XS(XS_Client_Stand) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::Stand(THIS)"); { - Client * THIS; + Client *THIS; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Stand(); @@ -334,22 +313,20 @@ XS(XS_Client_Stand) } XS(XS_Client_SetGM); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetGM) -{ +XS(XS_Client_SetGM) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::SetGM(THIS, bool toggle)"); { - Client * THIS; - bool toggle = (bool)SvTRUE(ST(1)); + Client *THIS; + bool toggle = (bool) SvTRUE(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetGM(toggle); @@ -358,22 +335,20 @@ XS(XS_Client_SetGM) } XS(XS_Client_SetPVP); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetPVP) -{ +XS(XS_Client_SetPVP) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::SetPVP(THIS, bool toggle)"); { - Client * THIS; - bool toggle = (bool)SvTRUE(ST(1)); + Client *THIS; + bool toggle = (bool) SvTRUE(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetPVP(toggle); @@ -382,22 +357,20 @@ XS(XS_Client_SetPVP) } XS(XS_Client_GetPVP); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetPVP) -{ +XS(XS_Client_GetPVP) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetPVP(THIS)"); { - Client * THIS; - bool RETVAL; + Client *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPVP(); @@ -408,22 +381,20 @@ XS(XS_Client_GetPVP) } XS(XS_Client_GetGM); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetGM) -{ +XS(XS_Client_GetGM) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetGM(THIS)"); { - Client * THIS; - bool RETVAL; + Client *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGM(); @@ -434,22 +405,20 @@ XS(XS_Client_GetGM) } XS(XS_Client_SetBaseClass); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetBaseClass) -{ +XS(XS_Client_SetBaseClass) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::SetBaseClass(THIS, uint32 class_id)"); { - Client * THIS; - uint32 i = (uint32)SvUV(ST(1)); + Client *THIS; + uint32 i = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetBaseClass(i); @@ -458,22 +427,20 @@ XS(XS_Client_SetBaseClass) } XS(XS_Client_SetBaseRace); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetBaseRace) -{ +XS(XS_Client_SetBaseRace) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::SetBaseRace(THIS, uint32 race_id)"); { - Client * THIS; - uint32 i = (uint32)SvUV(ST(1)); + Client *THIS; + uint32 i = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetBaseRace(i); @@ -482,22 +449,20 @@ XS(XS_Client_SetBaseRace) } XS(XS_Client_SetBaseGender); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetBaseGender) -{ +XS(XS_Client_SetBaseGender) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::SetBaseGender(THIS, uint32 gender_id)"); { - Client * THIS; - uint32 i = (uint32)SvUV(ST(1)); + Client *THIS; + uint32 i = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetBaseGender(i); @@ -506,54 +471,52 @@ XS(XS_Client_SetBaseGender) } XS(XS_Client_GetBaseFace); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetBaseFace) -{ +XS(XS_Client_GetBaseFace) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetBaseFace(THIS)"); { - Client * THIS; - uint8 RETVAL; + Client *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBaseFace(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetLanguageSkill); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetLanguageSkill) -{ +XS(XS_Client_GetLanguageSkill) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::GetLanguageSkill(THIS, uint16 lanuage_id)"); { - Client * THIS; - uint8 RETVAL; + Client *THIS; + uint8 RETVAL; dXSTARG; - uint16 n = (uint16)SvUV(ST(1)); + uint16 n = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLanguageSkill(n); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } @@ -585,389 +548,372 @@ XS(XS_Client_GetLastName) { } XS(XS_Client_GetLDoNPointsTheme); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetLDoNPointsTheme) -{ +XS(XS_Client_GetLDoNPointsTheme) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::GetLDoNPointsTheme(THIS, int32 theme)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; - int32 theme_out = (int32)SvIV(ST(1)); + int32 theme_out = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLDoNPointsTheme(theme_out); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetBaseSTR); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetBaseSTR) -{ +XS(XS_Client_GetBaseSTR) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetBaseSTR(THIS)"); { - Client * THIS; - uint8 RETVAL; + Client *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBaseSTR(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetBaseSTA); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetBaseSTA) -{ +XS(XS_Client_GetBaseSTA) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetBaseSTA(THIS)"); { - Client * THIS; - uint8 RETVAL; + Client *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBaseSTA(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetBaseCHA); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetBaseCHA) -{ +XS(XS_Client_GetBaseCHA) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetBaseCHA(THIS)"); { - Client * THIS; - uint8 RETVAL; + Client *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBaseCHA(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetBaseDEX); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetBaseDEX) -{ +XS(XS_Client_GetBaseDEX) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetBaseDEX(THIS)"); { - Client * THIS; - uint8 RETVAL; + Client *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBaseDEX(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetBaseINT); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetBaseINT) -{ +XS(XS_Client_GetBaseINT) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetBaseINT(THIS)"); { - Client * THIS; - uint8 RETVAL; + Client *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBaseINT(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetBaseAGI); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetBaseAGI) -{ +XS(XS_Client_GetBaseAGI) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetBaseAGI(THIS)"); { - Client * THIS; - uint8 RETVAL; + Client *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBaseAGI(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetBaseWIS); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetBaseWIS) -{ +XS(XS_Client_GetBaseWIS) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetBaseWIS(THIS)"); { - Client * THIS; - uint8 RETVAL; + Client *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBaseWIS(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetWeight); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetWeight) -{ +XS(XS_Client_GetWeight) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetWeight(THIS)"); { - Client * THIS; - uint16 RETVAL; + Client *THIS; + uint16 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetWeight(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetEXP); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetEXP) -{ +XS(XS_Client_GetEXP) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetEXP(THIS)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEXP(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetAAExp); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetAAExp) -{ +XS(XS_Client_GetAAExp) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetAAExp(THIS)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAAXP(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetAAPercent); -XS(XS_Client_GetAAPercent) -{ +XS(XS_Client_GetAAPercent) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetAAPercent(THIS)"); { - Client* THIS; + Client *THIS; uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAAPercent(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetTotalSecondsPlayed); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetTotalSecondsPlayed) -{ +XS(XS_Client_GetTotalSecondsPlayed) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetTotalSecondsPlayed(THIS)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetTotalSecondsPlayed(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_UpdateLDoNPoints); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_UpdateLDoNPoints) -{ +XS(XS_Client_UpdateLDoNPoints) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Client::UpdateLDoNPoints(THIS, int32 points, uint32 theme)"); { - Client * THIS; - bool RETVAL; - int32 points = (int32)SvIV(ST(1)); - uint32 theme = (uint32)SvUV(ST(2)); + Client *THIS; + bool RETVAL; + int32 points = (int32) SvIV(ST(1)); + uint32 theme = (uint32) SvUV(ST(2)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->UpdateLDoNPoints(points, theme); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Client_SetDeity); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetDeity) -{ +XS(XS_Client_SetDeity) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::SetDeity(THIS, uint32 deity_id)"); { - Client * THIS; - uint32 i = (uint32)SvUV(ST(1)); + Client *THIS; + uint32 i = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetDeity(i); @@ -976,36 +922,34 @@ XS(XS_Client_SetDeity) } XS(XS_Client_AddEXP); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_AddEXP) -{ +XS(XS_Client_AddEXP) { dXSARGS; if (items < 2 || items > 4) Perl_croak(aTHX_ "Usage: Client::AddEXP(THIS, uint32 experience_points)"); { - Client * THIS; - uint32 add_exp = (uint32)SvUV(ST(1)); - uint8 conlevel; - bool resexp; + Client *THIS; + uint32 add_exp = (uint32) SvUV(ST(1)); + uint8 conlevel; + bool resexp; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) conlevel = 0xFF; else { - conlevel = (uint8)SvUV(ST(2)); + conlevel = (uint8) SvUV(ST(2)); } if (items < 4) resexp = false; else { - resexp = (bool)SvTRUE(ST(3)); + resexp = (bool) SvTRUE(ST(3)); } THIS->AddEXP(add_exp, conlevel, resexp); @@ -1014,30 +958,29 @@ XS(XS_Client_AddEXP) } XS(XS_Client_SetEXP); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetEXP) -{ +XS(XS_Client_SetEXP) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ "Usage: Client::SetEXP(THIS, uint32 experience_points, uint32 aa_experience_points, [bool resexp=false])"); + Perl_croak(aTHX_ + "Usage: Client::SetEXP(THIS, uint32 experience_points, uint32 aa_experience_points, [bool resexp=false])"); { - Client * THIS; - uint32 set_exp = (uint32)SvUV(ST(1)); - uint32 set_aaxp = (uint32)SvUV(ST(2)); - bool resexp; + Client *THIS; + uint32 set_exp = (uint32) SvUV(ST(1)); + uint32 set_aaxp = (uint32) SvUV(ST(2)); + bool resexp; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 4) resexp = false; else { - resexp = (bool)SvTRUE(ST(3)); + resexp = (bool) SvTRUE(ST(3)); } THIS->SetEXP(set_exp, set_aaxp, resexp); @@ -1046,56 +989,55 @@ XS(XS_Client_SetEXP) } XS(XS_Client_SetBindPoint); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetBindPoint) -{ +XS(XS_Client_SetBindPoint) { dXSARGS; if (items < 1 || items > 6) - Perl_croak(aTHX_ "Usage: Client::SetBindPoint(THIS, int to_zone = -1, int to_instance = 0, float new_x = 0.0f, float new_y = 0.0f, float new_z = 0.0f)"); + Perl_croak(aTHX_ + "Usage: Client::SetBindPoint(THIS, int to_zone = -1, int to_instance = 0, float new_x = 0.0f, float new_y = 0.0f, float new_z = 0.0f)"); { - Client * THIS; - int to_zone; - int to_instance; - float new_x; - float new_y; - float new_z; + Client *THIS; + int to_zone; + int to_instance; + float new_x; + float new_y; + float new_z; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) to_zone = -1; else { - to_zone = (int)SvIV(ST(1)); + to_zone = (int) SvIV(ST(1)); } - if(items < 3) + if (items < 3) to_instance = 0; else { - to_instance = (int)SvIV(ST(2)); + to_instance = (int) SvIV(ST(2)); } if (items < 4) new_x = 0.0f; else { - new_x = (float)SvNV(ST(3)); + new_x = (float) SvNV(ST(3)); } if (items < 5) new_y = 0.0f; else { - new_y = (float)SvNV(ST(4)); + new_y = (float) SvNV(ST(4)); } if (items < 6) new_z = 0.0f; else { - new_z = (float)SvNV(ST(5)); + new_z = (float) SvNV(ST(5)); } THIS->SetBindPoint(0, to_zone, to_instance, glm::vec3(new_x, new_y, new_z)); @@ -1104,211 +1046,205 @@ XS(XS_Client_SetBindPoint) } XS(XS_Client_GetBindX); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetBindX) -{ +XS(XS_Client_GetBindX) { dXSARGS; if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: Client::GetBindX(int index = 0)"); { - Client * THIS; - int index = 0; + Client *THIS; + int index = 0; float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items == 1) index = 0; else if (items == 2) { - index = (uint32)SvUV(ST(1)); + index = (uint32) SvUV(ST(1)); } RETVAL = THIS->GetBindX(index); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Client_GetBindY); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetBindY) -{ +XS(XS_Client_GetBindY) { dXSARGS; if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: Client::GetBindY(int index = 0)"); { - Client * THIS; - int index = 0; + Client *THIS; + int index = 0; float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items == 1) index = 0; else if (items == 2) { - index = (uint32)SvUV(ST(1));; + index = (uint32) SvUV(ST(1));; } RETVAL = THIS->GetBindY(index); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Client_GetBindZ); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetBindZ) -{ +XS(XS_Client_GetBindZ) { dXSARGS; if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: Client::GetBindZ(int index = 0)"); { - Client * THIS; - int index = 0; + Client *THIS; + int index = 0; float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items == 1) index = 0; else if (items == 2) { - index = (uint32)SvUV(ST(1)); + index = (uint32) SvUV(ST(1)); } RETVAL = THIS->GetBindZ(index); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Client_GetBindHeading); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetBindHeading) -{ +XS(XS_Client_GetBindHeading) { dXSARGS; if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: Client::GetBindHeading(int index = 0)"); { - Client * THIS; - int index = 0; + Client *THIS; + int index = 0; float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items == 1) index = 0; else if (items == 2) { - index = (uint32)SvUV(ST(1)); + index = (uint32) SvUV(ST(1)); } RETVAL = THIS->GetBindHeading(index); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Client_GetBindZoneID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetBindZoneID) -{ +XS(XS_Client_GetBindZoneID) { dXSARGS; if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: Client::GetBindZoneID(int index = 0)"); { - Client * THIS; + Client *THIS; uint32 index = 0; uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items == 1) index = 0; else if (items == 2) { - index = (uint32)SvUV(ST(1)); + index = (uint32) SvUV(ST(1)); } RETVAL = THIS->GetBindZoneID(index); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_MovePC); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_MovePC) -{ +XS(XS_Client_MovePC) { dXSARGS; if (items != 6) Perl_croak(aTHX_ "Usage: Client::MovePC(THIS, uint32 zone_id, float x, float y, float z, float heading)"); { - Client * THIS; - uint32 zoneID = (uint32)SvUV(ST(1)); - float x = (float)SvNV(ST(2)); - float y = (float)SvNV(ST(3)); - float z = (float)SvNV(ST(4)); - float heading = (float)SvNV(ST(5)); + Client *THIS; + uint32 zoneID = (uint32) SvUV(ST(1)); + float x = (float) SvNV(ST(2)); + float y = (float) SvNV(ST(3)); + float z = (float) SvNV(ST(4)); + float heading = (float) SvNV(ST(5)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (THIS->IsClient()) { THIS->MovePC(zoneID, x, y, z, heading); - } - else { + } else { if (THIS->IsMerc()) { - Log(Logs::Detail, Logs::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Merc reference"); + Log(Logs::Detail, Logs::None, + "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Merc reference"); + } else if (THIS->IsNPC()) { + Log(Logs::Detail, Logs::None, + "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type NPC reference"); } - else if (THIS->IsNPC()) { - Log(Logs::Detail, Logs::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type NPC reference"); - } - #ifdef BOTS - else if (THIS->IsBot()) { - Log(Logs::Detail, Logs::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Bot reference"); - } - #endif +#ifdef BOTS + else if (THIS->IsBot()) { + Log(Logs::Detail, Logs::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Bot reference"); + } +#endif else { - Log(Logs::Detail, Logs::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process an Unknown type reference"); + Log(Logs::Detail, Logs::None, + "[CLIENT] Perl(XS_Client_MovePC) attempted to process an Unknown type reference"); } Perl_croak(aTHX_ "THIS is not of type Client"); @@ -1319,46 +1255,46 @@ XS(XS_Client_MovePC) } XS(XS_Client_MovePCInstance); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_MovePCInstance) -{ +XS(XS_Client_MovePCInstance) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ "Usage: Client::MovePCInstance(THIS, uint32 zone_id, uint32 instance_id, float x, float y, float z, float heading)"); + Perl_croak(aTHX_ + "Usage: Client::MovePCInstance(THIS, uint32 zone_id, uint32 instance_id, float x, float y, float z, float heading)"); { - Client * THIS; - uint32 zoneID = (uint32)SvUV(ST(1)); - uint32 instanceID = (uint32)SvUV(ST(2)); - float x = (float)SvNV(ST(3)); - float y = (float)SvNV(ST(4)); - float z = (float)SvNV(ST(5)); - float heading = (float)SvNV(ST(6)); + Client *THIS; + uint32 zoneID = (uint32) SvUV(ST(1)); + uint32 instanceID = (uint32) SvUV(ST(2)); + float x = (float) SvNV(ST(3)); + float y = (float) SvNV(ST(4)); + float z = (float) SvNV(ST(5)); + float heading = (float) SvNV(ST(6)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (THIS->IsClient()) { THIS->MovePC(zoneID, instanceID, x, y, z, heading); - } - else { + } else { if (THIS->IsMerc()) { - Log(Logs::Detail, Logs::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Merc reference"); + Log(Logs::Detail, Logs::None, + "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Merc reference"); + } else if (THIS->IsNPC()) { + Log(Logs::Detail, Logs::None, + "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type NPC reference"); } - else if (THIS->IsNPC()) { - Log(Logs::Detail, Logs::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type NPC reference"); - } - #ifdef BOTS - else if (THIS->IsBot()) { - Log(Logs::Detail, Logs::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Bot reference"); - } - #endif +#ifdef BOTS + else if (THIS->IsBot()) { + Log(Logs::Detail, Logs::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Bot reference"); + } +#endif else { - Log(Logs::Detail, Logs::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process an Unknown type reference"); + Log(Logs::Detail, Logs::None, + "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process an Unknown type reference"); } Perl_croak(aTHX_ "THIS is not of type Client"); @@ -1370,22 +1306,20 @@ XS(XS_Client_MovePCInstance) } XS(XS_Client_ChangeLastName); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_ChangeLastName) -{ +XS(XS_Client_ChangeLastName) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::ChangeLastName(THIS, string last_name)"); { - Client * THIS; - char* in_lastname = (char *)SvPV_nolen(ST(1)); + Client *THIS; + char *in_lastname = (char *) SvPV_nolen(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ChangeLastName(in_lastname); @@ -1394,68 +1328,66 @@ XS(XS_Client_ChangeLastName) } XS(XS_Client_GetFactionLevel); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetFactionLevel) -{ +XS(XS_Client_GetFactionLevel) { dXSARGS; if (items != 8) - Perl_croak(aTHX_ "Usage: Client::GetFactionLevel(THIS, uint32 character_id, uint32 npc_id, uint32 player_race_id, uint32 player_class_id, uint32 player_deity_id, uint32 player_faction_id, Mob*)"); + Perl_croak(aTHX_ + "Usage: Client::GetFactionLevel(THIS, uint32 character_id, uint32 npc_id, uint32 player_race_id, uint32 player_class_id, uint32 player_deity_id, uint32 player_faction_id, Mob*)"); { - Client * THIS; - FACTION_VALUE RETVAL; + Client *THIS; + FACTION_VALUE RETVAL; dXSTARG; - uint32 char_id = (uint32)SvUV(ST(1)); - uint32 npc_id = (uint32)SvUV(ST(2)); - uint32 p_race = (uint32)SvUV(ST(3)); - uint32 p_class = (uint32)SvUV(ST(4)); - uint32 p_deity = (uint32)SvUV(ST(5)); - int32 pFaction = (int32)SvIV(ST(6)); - Mob* tnpc; + uint32 char_id = (uint32) SvUV(ST(1)); + uint32 npc_id = (uint32) SvUV(ST(2)); + uint32 p_race = (uint32) SvUV(ST(3)); + uint32 p_class = (uint32) SvUV(ST(4)); + uint32 p_deity = (uint32) SvUV(ST(5)); + int32 pFaction = (int32) SvIV(ST(6)); + Mob *tnpc; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(7), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(7))); - tnpc = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(7))); + tnpc = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "tnpc is not of type Mob"); - if(tnpc == nullptr) + if (tnpc == nullptr) Perl_croak(aTHX_ "tnpc is nullptr, avoiding crash."); RETVAL = THIS->GetFactionLevel(char_id, npc_id, p_race, p_class, p_deity, pFaction, tnpc); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Client_SetFactionLevel); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetFactionLevel) -{ +XS(XS_Client_SetFactionLevel) { dXSARGS; if (items != 6) - Perl_croak(aTHX_ "Usage: Client::SetFactionLevel(THIS, uint32 character_id, uint32 npc_id, uint8 character_class, uint8 character_race, uint8 character_deity)"); + Perl_croak(aTHX_ + "Usage: Client::SetFactionLevel(THIS, uint32 character_id, uint32 npc_id, uint8 character_class, uint8 character_race, uint8 character_deity)"); { - Client * THIS; - uint32 char_id = (uint32)SvUV(ST(1)); - uint32 npc_id = (uint32)SvUV(ST(2)); - uint8 char_class = (uint8)SvUV(ST(3)); - uint8 char_race = (uint8)SvUV(ST(4)); - uint8 char_deity = (uint8)SvUV(ST(5)); + Client *THIS; + uint32 char_id = (uint32) SvUV(ST(1)); + uint32 npc_id = (uint32) SvUV(ST(2)); + uint8 char_class = (uint8) SvUV(ST(3)); + uint8 char_race = (uint8) SvUV(ST(4)); + uint8 char_deity = (uint8) SvUV(ST(5)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetFactionLevel(char_id, npc_id, char_class, char_race, char_deity); @@ -1464,11 +1396,11 @@ XS(XS_Client_SetFactionLevel) } XS(XS_Client_SetFactionLevel2); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetFactionLevel2) -{ +XS(XS_Client_SetFactionLevel2) { dXSARGS; if (items < 7 || items > 8) - Perl_croak(aTHX_ "Usage: Client::SetFactionLevel2(THIS, uint32 character_id, int32 faction_id, uint8 character_class, uint8 character_race, uint8 character_deity, int32 value, uint8 temp)"); + Perl_croak(aTHX_ + "Usage: Client::SetFactionLevel2(THIS, uint32 character_id, int32 faction_id, uint8 character_class, uint8 character_race, uint8 character_deity, int32 value, uint8 temp)"); { Client *THIS; uint32 char_id = (uint32) SvUV(ST(1)); @@ -1499,53 +1431,51 @@ XS(XS_Client_SetFactionLevel2) } XS(XS_Client_GetRawItemAC); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetRawItemAC) -{ +XS(XS_Client_GetRawItemAC) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetRawItemAC(THIS)"); { - Client * THIS; - int16 RETVAL; + Client *THIS; + int16 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetRawItemAC(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Client_AccountID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_AccountID) -{ +XS(XS_Client_AccountID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::AccountID(THIS)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->AccountID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } @@ -1577,80 +1507,76 @@ XS(XS_Client_AccountName) { } XS(XS_Client_Admin); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_Admin) -{ +XS(XS_Client_Admin) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::Admin(THIS)"); { - Client * THIS; - int16 RETVAL; + Client *THIS; + int16 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->Admin(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Client_CharacterID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_CharacterID) -{ +XS(XS_Client_CharacterID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::CharacterID(THIS)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CharacterID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_UpdateAdmin); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_UpdateAdmin) -{ +XS(XS_Client_UpdateAdmin) { dXSARGS; if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: Client::UpdateAdmin(THIS, bool from_db = true)"); { - Client * THIS; - bool iFromDB; + Client *THIS; + bool iFromDB; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) iFromDB = true; else { - iFromDB = (bool)SvTRUE(ST(1)); + iFromDB = (bool) SvTRUE(ST(1)); } THIS->UpdateAdmin(iFromDB); @@ -1665,7 +1591,7 @@ XS(XS_Client_UpdateWho) { Perl_croak(aTHX_ "Usage: Client::UpdateWho(THIS, uint8 remove = 0)"); { Client *THIS; - uint8 remove; + uint8 remove; if (sv_derived_from(ST(0), "Client")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -1687,109 +1613,104 @@ XS(XS_Client_UpdateWho) { } XS(XS_Client_GuildRank); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GuildRank) -{ +XS(XS_Client_GuildRank) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GuildRank(THIS)"); { - Client * THIS; - uint8 RETVAL; + Client *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GuildRank(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GuildID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GuildID) -{ +XS(XS_Client_GuildID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GuildID(THIS)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GuildID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetFace); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetFace) -{ +XS(XS_Client_GetFace) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetFace(THIS)"); { - Client * THIS; - uint8 RETVAL; + Client *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetFace(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_TakeMoneyFromPP); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_TakeMoneyFromPP) -{ +XS(XS_Client_TakeMoneyFromPP) { dXSARGS; if (items < 2 || items > 3) Perl_croak(aTHX_ "Usage: Client::TakeMoneyFromPP(THIS, uint32 copper, bool update_client = false)"); { - Client * THIS; - bool RETVAL; - bool updateclient = false; - uint32 copper = (uint32)SvUV(ST(1)); + Client *THIS; + bool RETVAL; + bool updateclient = false; + uint32 copper = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 2) - updateclient = (bool)SvTRUE(ST(2)); + updateclient = (bool) SvTRUE(ST(2)); RETVAL = THIS->TakeMoneyFromPP(copper, updateclient); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); @@ -1823,22 +1744,20 @@ XS(XS_Client_AddMoneyToPP) { } XS(XS_Client_TGB); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_TGB) -{ +XS(XS_Client_TGB) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::TGB(THIS)"); { - Client * THIS; - bool RETVAL; + Client *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->TGB(); @@ -1849,48 +1768,45 @@ XS(XS_Client_TGB) } XS(XS_Client_GetSkillPoints); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetSkillPoints) -{ +XS(XS_Client_GetSkillPoints) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetSkillPoints(THIS)"); { - Client * THIS; - uint16 RETVAL; + Client *THIS; + uint16 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSkillPoints(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_SetSkillPoints); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetSkillPoints) -{ +XS(XS_Client_SetSkillPoints) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::SetSkillPoints(THIS, inp)"); { - Client * THIS; - int inp = (int)SvIV(ST(1)); + Client *THIS; + int inp = (int) SvIV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSkillPoints(inp); @@ -1899,29 +1815,27 @@ XS(XS_Client_SetSkillPoints) } XS(XS_Client_IncreaseSkill); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_IncreaseSkill) -{ +XS(XS_Client_IncreaseSkill) { dXSARGS; if (items < 2 || items > 3) Perl_croak(aTHX_ "Usage: Client::IncreaseSkill(THIS, int skill_id, int value = 1)"); { - Client * THIS; - int skill_id = (int)SvIV(ST(1)); - int value; + Client *THIS; + int skill_id = (int) SvIV(ST(1)); + int value; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) value = 1; else { - value = (int)SvIV(ST(2)); + value = (int) SvIV(ST(2)); } THIS->IncreaseSkill(skill_id, value); @@ -1930,29 +1844,27 @@ XS(XS_Client_IncreaseSkill) } XS(XS_Client_IncreaseLanguageSkill); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_IncreaseLanguageSkill) -{ +XS(XS_Client_IncreaseLanguageSkill) { dXSARGS; if (items < 2 || items > 3) Perl_croak(aTHX_ "Usage: Client::IncreaseLanguageSkill(THIS, int skill_id, int value = 1)"); { - Client * THIS; - int skill_id = (int)SvIV(ST(1)); - int value; + Client *THIS; + int skill_id = (int) SvIV(ST(1)); + int value; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) value = 1; else { - value = (int)SvIV(ST(2)); + value = (int) SvIV(ST(2)); } THIS->IncreaseLanguageSkill(skill_id, value); @@ -1961,131 +1873,123 @@ XS(XS_Client_IncreaseLanguageSkill) } XS(XS_Client_GetSkill); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetSkill) -{ +XS(XS_Client_GetSkill) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::GetSkill(THIS, uint16 skill_id)"); { - Client * THIS; - uint16 RETVAL; + Client *THIS; + uint16 RETVAL; dXSTARG; - EQEmu::skills::SkillType skill_id = (EQEmu::skills::SkillType)SvUV(ST(1)); + EQEmu::skills::SkillType skill_id = (EQEmu::skills::SkillType) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSkill(skill_id); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetRawSkill); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetRawSkill) -{ +XS(XS_Client_GetRawSkill) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::GetRawSkill(THIS, int skill_id)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; - EQEmu::skills::SkillType skill_id = (EQEmu::skills::SkillType)SvUV(ST(1)); + EQEmu::skills::SkillType skill_id = (EQEmu::skills::SkillType) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetRawSkill(skill_id); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_HasSkill); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_HasSkill) -{ +XS(XS_Client_HasSkill) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::HasSkill(THIS, int skill_id)"); { - Client * THIS; - bool RETVAL; - EQEmu::skills::SkillType skill_id = (EQEmu::skills::SkillType)SvUV(ST(1)); + Client *THIS; + bool RETVAL; + EQEmu::skills::SkillType skill_id = (EQEmu::skills::SkillType) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->HasSkill(skill_id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Client_CanHaveSkill); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_CanHaveSkill) -{ +XS(XS_Client_CanHaveSkill) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::CanHaveSkill(THIS, int skill_id)"); { - Client * THIS; - bool RETVAL; - EQEmu::skills::SkillType skill_id = (EQEmu::skills::SkillType)SvUV(ST(1)); + Client *THIS; + bool RETVAL; + EQEmu::skills::SkillType skill_id = (EQEmu::skills::SkillType) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CanHaveSkill(skill_id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Client_SetSkill); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetSkill) -{ +XS(XS_Client_SetSkill) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Client::SetSkill(THIS, int skill_id, uint16 value)"); { - Client * THIS; - EQEmu::skills::SkillType skill_num = (EQEmu::skills::SkillType)SvUV(ST(1)); - uint16 value = (uint16)SvUV(ST(2)); + Client *THIS; + EQEmu::skills::SkillType skill_num = (EQEmu::skills::SkillType) SvUV(ST(1)); + uint16 value = (uint16) SvUV(ST(2)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSkill(skill_num, value); @@ -2099,7 +2003,7 @@ XS(XS_Client_AddSkill) { if (items != 3) Perl_croak(aTHX_ "Usage: Client::AddSkill(THIS, int skill_id, uint16 value)"); { - Client *THIS; + Client *THIS; EQEmu::skills::SkillType skillid = (EQEmu::skills::SkillType) SvUV(ST(1)); uint16 value = (uint16) SvUV(ST(2)); @@ -2117,22 +2021,20 @@ XS(XS_Client_AddSkill) { } XS(XS_Client_CheckSpecializeIncrease); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_CheckSpecializeIncrease) -{ +XS(XS_Client_CheckSpecializeIncrease) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::CheckSpecializeIncrease(THIS, uint16 spell_id)"); { - Client * THIS; - uint16 spell_id = (uint16)SvUV(ST(1)); + Client *THIS; + uint16 spell_id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->CheckSpecializeIncrease(spell_id); @@ -2141,34 +2043,32 @@ XS(XS_Client_CheckSpecializeIncrease) } XS(XS_Client_CheckIncreaseSkill); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_CheckIncreaseSkill) -{ +XS(XS_Client_CheckIncreaseSkill) { dXSARGS; if (items < 2 || items > 3) Perl_croak(aTHX_ "Usage: Client::CheckIncreaseSkill(THIS, int skill_id, int chance_modifier = 0)"); { - Client * THIS; - bool RETVAL; - EQEmu::skills::SkillType skillid = (EQEmu::skills::SkillType)SvUV(ST(1)); - int chancemodi; + Client *THIS; + bool RETVAL; + EQEmu::skills::SkillType skillid = (EQEmu::skills::SkillType) SvUV(ST(1)); + int chancemodi; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) chancemodi = 0; else { - chancemodi = (int)SvIV(ST(2)); + chancemodi = (int) SvIV(ST(2)); } RETVAL = THIS->CheckIncreaseSkill(skillid, nullptr, chancemodi); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); @@ -2181,8 +2081,8 @@ XS(XS_Client_SetLanguageSkill) { Perl_croak(aTHX_ "Usage: Client::SetLanguageSkill(THIS, int language_id, int value)"); { Client *THIS; - int langid = (int) SvIV(ST(1)); - int value = (int) SvIV(ST(2)); + int langid = (int) SvIV(ST(1)); + int value = (int) SvIV(ST(2)); if (sv_derived_from(ST(0), "Client")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -2204,7 +2104,7 @@ XS(XS_Client_MaxSkill) { if (items < 2 || items > 4) Perl_croak(aTHX_ "Usage: Client::MaxSkill(THIS, uint16 skill_id, uint16 class_id, uint16 level)"); { - Client *THIS; + Client *THIS; uint16 RETVAL; EQEmu::skills::SkillType skillid = (EQEmu::skills::SkillType) SvUV(ST(1)); uint16 class_ = 0; @@ -2237,21 +2137,19 @@ XS(XS_Client_MaxSkill) { } XS(XS_Client_GMKill); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GMKill) -{ +XS(XS_Client_GMKill) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GMKill(THIS)"); { - Client * THIS; + Client *THIS; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->GMKill(); @@ -2260,22 +2158,20 @@ XS(XS_Client_GMKill) } XS(XS_Client_IsMedding); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_IsMedding) -{ +XS(XS_Client_IsMedding) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::IsMedding(THIS)"); { - Client * THIS; - bool RETVAL; + Client *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsMedding(); @@ -2286,48 +2182,45 @@ XS(XS_Client_IsMedding) } XS(XS_Client_GetDuelTarget); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetDuelTarget) -{ +XS(XS_Client_GetDuelTarget) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetDuelTarget(THIS)"); { - Client * THIS; - uint16 RETVAL; + Client *THIS; + uint16 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDuelTarget(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_IsDueling); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_IsDueling) -{ +XS(XS_Client_IsDueling) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::IsDueling(THIS)"); { - Client * THIS; - bool RETVAL; + Client *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsDueling(); @@ -2338,22 +2231,20 @@ XS(XS_Client_IsDueling) } XS(XS_Client_SetDuelTarget); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetDuelTarget) -{ +XS(XS_Client_SetDuelTarget) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::SetDuelTarget(THIS, set_id)"); { - Client * THIS; - uint16 set_id = (uint16)SvUV(ST(1)); + Client *THIS; + uint16 set_id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetDuelTarget(set_id); @@ -2362,22 +2253,20 @@ XS(XS_Client_SetDuelTarget) } XS(XS_Client_SetDueling); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetDueling) -{ +XS(XS_Client_SetDueling) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::SetDueling(THIS, duel)"); { - Client * THIS; - bool duel = (bool)SvTRUE(ST(1)); + Client *THIS; + bool duel = (bool) SvTRUE(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetDueling(duel); @@ -2386,21 +2275,19 @@ XS(XS_Client_SetDueling) } XS(XS_Client_ResetAA); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_ResetAA) -{ +XS(XS_Client_ResetAA) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::ResetAA(THIS)"); { - Client * THIS; + Client *THIS; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ResetAA(); @@ -2445,8 +2332,8 @@ XS(XS_Client_UnmemSpell) { Perl_croak(aTHX_ "Usage: Client::UnmemSpell(THIS, int slot, [bool update_client = true])"); { Client *THIS; - int slot = (int) SvIV(ST(1)); - bool update_client; + int slot = (int) SvIV(ST(1)); + bool update_client; if (sv_derived_from(ST(0), "Client")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -2474,7 +2361,7 @@ XS(XS_Client_UnmemSpellBySpellID) { Perl_croak(aTHX_ "Usage: Client::UnmemSpellBySpellID(THIS, int32 spell_id)"); { Client *THIS; - int32 spell_id = (int32) SvIV(ST(1)); + int32 spell_id = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "Client")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -2496,7 +2383,7 @@ XS(XS_Client_UnmemSpellAll) { Perl_croak(aTHX_ "Usage: Client::UnmemSpellAll(THIS, [bool update_client = true])"); { Client *THIS; - bool update_client; + bool update_client; if (sv_derived_from(ST(0), "Client")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -2554,8 +2441,8 @@ XS(XS_Client_UnscribeSpell) { Perl_croak(aTHX_ "Usage: Client::UnscribeSpell(THIS, int slot, [bool update_client = true])"); { Client *THIS; - int slot = (int) SvIV(ST(1)); - bool update_client; + int slot = (int) SvIV(ST(1)); + bool update_client; if (sv_derived_from(ST(0), "Client")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -2577,28 +2464,26 @@ XS(XS_Client_UnscribeSpell) { } XS(XS_Client_UnscribeSpellAll); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_UnscribeSpellAll) -{ +XS(XS_Client_UnscribeSpellAll) { dXSARGS; if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: Client::UnscribeSpellAll(THIS, [bool update_client = true])"); { - Client * THIS; - bool update_client; + Client *THIS; + bool update_client; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) update_client = true; else { - update_client = (bool)SvTRUE(ST(1)); + update_client = (bool) SvTRUE(ST(1)); } THIS->UnscribeSpellAll(update_client); @@ -2607,22 +2492,20 @@ XS(XS_Client_UnscribeSpellAll) } XS(XS_Client_TrainDiscBySpellID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_TrainDiscBySpellID) -{ +XS(XS_Client_TrainDiscBySpellID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::TrainDiscBySpellID(THIS, int32 spell_id)"); { - Client * THIS; - int32 spell_id = (int32)SvIV(ST(1)); + Client *THIS; + int32 spell_id = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->TrainDiscBySpellID(spell_id); @@ -2631,28 +2514,27 @@ XS(XS_Client_TrainDiscBySpellID) } XS(XS_Client_GetDiscSlotBySpellID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetDiscSlotBySpellID) -{ +XS(XS_Client_GetDiscSlotBySpellID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::GetDiscSlotBySpellID(THIS, int32 spell_id)"); { - Client * THIS; - int RETVAL; - int32 spell_id = (int32)SvIV(ST(1)); + Client *THIS; + int RETVAL; + int32 spell_id = (int32) SvIV(ST(1)); dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDiscSlotBySpellID(spell_id); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } @@ -2664,8 +2546,8 @@ XS(XS_Client_UntrainDisc) { Perl_croak(aTHX_ "Usage: Client::UntrainDisc(THIS, int slot, [bool update_client = true])"); { Client *THIS; - int slot = (int) SvIV(ST(1)); - bool update_client; + int slot = (int) SvIV(ST(1)); + bool update_client; if (sv_derived_from(ST(0), "Client")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -2693,7 +2575,7 @@ XS(XS_Client_UntrainDiscAll) { Perl_croak(aTHX_ "Usage: Client::UntrainDiscAll(THIS, [update_client = true])"); { Client *THIS; - bool update_client; + bool update_client; if (sv_derived_from(ST(0), "Client")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -2715,22 +2597,20 @@ XS(XS_Client_UntrainDiscAll) { } XS(XS_Client_IsSitting); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_IsSitting) -{ +XS(XS_Client_IsSitting) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::IsSitting(THIS)"); { - Client * THIS; - bool RETVAL; + Client *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsSitting(); @@ -2741,22 +2621,20 @@ XS(XS_Client_IsSitting) } XS(XS_Client_IsBecomeNPC); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_IsBecomeNPC) -{ +XS(XS_Client_IsBecomeNPC) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::IsBecomeNPC(THIS)"); { - Client * THIS; - bool RETVAL; + Client *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsBecomeNPC(); @@ -2767,48 +2645,45 @@ XS(XS_Client_IsBecomeNPC) } XS(XS_Client_GetBecomeNPCLevel); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetBecomeNPCLevel) -{ +XS(XS_Client_GetBecomeNPCLevel) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetBecomeNPCLevel(THIS)"); { - Client * THIS; - uint8 RETVAL; + Client *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBecomeNPCLevel(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_SetBecomeNPC); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetBecomeNPC) -{ +XS(XS_Client_SetBecomeNPC) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::SetBecomeNPC(THIS, flag)"); { - Client * THIS; - bool flag = (bool)SvTRUE(ST(1)); + Client *THIS; + bool flag = (bool) SvTRUE(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetBecomeNPC(flag); @@ -2817,22 +2692,20 @@ XS(XS_Client_SetBecomeNPC) } XS(XS_Client_SetBecomeNPCLevel); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetBecomeNPCLevel) -{ +XS(XS_Client_SetBecomeNPCLevel) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::SetBecomeNPCLevel(THIS, level)"); { - Client * THIS; - uint8 level = (uint8)SvUV(ST(1)); + Client *THIS; + uint8 level = (uint8) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetBecomeNPCLevel(level); @@ -2841,22 +2714,20 @@ XS(XS_Client_SetBecomeNPCLevel) } XS(XS_Client_SetFeigned); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetFeigned) -{ +XS(XS_Client_SetFeigned) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::SetFeigned(THIS, in_feigned)"); { - Client * THIS; - bool in_feigned = (bool)SvTRUE(ST(1)); + Client *THIS; + bool in_feigned = (bool) SvTRUE(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetFeigned(in_feigned); @@ -2865,22 +2736,20 @@ XS(XS_Client_SetFeigned) } XS(XS_Client_GetFeigned); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetFeigned) -{ +XS(XS_Client_GetFeigned) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetFeigned(THIS)"); { - Client * THIS; - bool RETVAL; + Client *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetFeigned(); @@ -2891,22 +2760,20 @@ XS(XS_Client_GetFeigned) } XS(XS_Client_AutoSplitEnabled); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_AutoSplitEnabled) -{ +XS(XS_Client_AutoSplitEnabled) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::AutoSplitEnabled(THIS)"); { - Client * THIS; - bool RETVAL; + Client *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->AutoSplitEnabled(); @@ -2917,22 +2784,20 @@ XS(XS_Client_AutoSplitEnabled) } XS(XS_Client_SetHorseId); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetHorseId) -{ +XS(XS_Client_SetHorseId) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::SetHorseId(THIS, horseid_in)"); { - Client * THIS; - uint16 horseid_in = (uint16)SvUV(ST(1)); + Client *THIS; + uint16 horseid_in = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetHorseId(horseid_in); @@ -2941,27 +2806,26 @@ XS(XS_Client_SetHorseId) } XS(XS_Client_GetHorseId); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetHorseId) -{ +XS(XS_Client_GetHorseId) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetHorseId(THIS)"); { - Client * THIS; - uint16 RETVAL; + Client *THIS; + uint16 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHorseId(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } @@ -3047,21 +2911,19 @@ XS(XS_Client_SetMaterial) { } XS(XS_Client_Undye); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_Undye) -{ +XS(XS_Client_Undye) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::Undye(THIS)"); { - Client * THIS; + Client *THIS; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Undye(); @@ -3070,56 +2932,54 @@ XS(XS_Client_Undye) } XS(XS_Client_GetItemIDAt); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetItemIDAt) -{ +XS(XS_Client_GetItemIDAt) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::GetItemIDAt(THIS, int16 slot_id)"); { - Client * THIS; - int32 RETVAL; + Client *THIS; + int32 RETVAL; dXSTARG; - int16 slot_id = (int16)SvIV(ST(1)); + int16 slot_id = (int16) SvIV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetItemIDAt(slot_id); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetAugmentIDAt); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetAugmentIDAt) -{ +XS(XS_Client_GetAugmentIDAt) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Client::GetAugmentIDAt(THIS, int16 slot_id, int16 aug_slot)"); { - Client * THIS; - int32 RETVAL; + Client *THIS; + int32 RETVAL; dXSTARG; - int16 slot_id = (int16)SvIV(ST(1)); - int16 augslot = (uint8)SvIV(ST(2)); + int16 slot_id = (int16) SvIV(ST(1)); + int16 augslot = (uint8) SvIV(ST(2)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAugmentIDAt(slot_id, augslot); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } @@ -3162,55 +3022,54 @@ XS(XS_Client_DeleteItemInInventory) { } XS(XS_Client_SummonItem); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SummonItem) -{ +XS(XS_Client_SummonItem) { dXSARGS; if (items < 2 || items > 10) - Perl_croak(aTHX_ "Usage: Client::SummonItem(THIS, uint32 item_id, [int16 charges = -1], [bool attune = false], [uint32 aug1 = 0], [uint32 aug2 = 0], [uint32 aug3 = 0], [uint32 aug4 = 0], [uint32 aug5 = 0], [uint16 slot_id = 30])"); + Perl_croak(aTHX_ + "Usage: Client::SummonItem(THIS, uint32 item_id, [int16 charges = -1], [bool attune = false], [uint32 aug1 = 0], [uint32 aug2 = 0], [uint32 aug3 = 0], [uint32 aug4 = 0], [uint32 aug5 = 0], [uint16 slot_id = 30])"); { - Client * THIS; - uint32 item_id = (uint32)SvUV(ST(1)); - int16 charges = -1; - bool attune = false; - uint32 aug1 = 0; - uint32 aug2 = 0; - uint32 aug3 = 0; - uint32 aug4 = 0; - uint32 aug5 = 0; - uint16 slot_id = 30; + Client *THIS; + uint32 item_id = (uint32) SvUV(ST(1)); + int16 charges = -1; + bool attune = false; + uint32 aug1 = 0; + uint32 aug2 = 0; + uint32 aug3 = 0; + uint32 aug4 = 0; + uint32 aug5 = 0; + uint16 slot_id = 30; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 2) { - charges = (int16)SvIV(ST(2)); + charges = (int16) SvIV(ST(2)); } if (items > 3) { - attune = (bool)SvTRUE(ST(3)); + attune = (bool) SvTRUE(ST(3)); } if (items > 4) { - aug1 = (uint32)SvUV(ST(4)); + aug1 = (uint32) SvUV(ST(4)); } if (items > 5) { - aug2 = (uint32)SvUV(ST(5)); + aug2 = (uint32) SvUV(ST(5)); } if (items > 6) { - aug3 = (uint32)SvUV(ST(6)); + aug3 = (uint32) SvUV(ST(6)); } if (items > 7) { - aug4 = (uint32)SvUV(ST(7)); + aug4 = (uint32) SvUV(ST(7)); } if (items > 8) { - aug5 = (uint32)SvUV(ST(8)); + aug5 = (uint32) SvUV(ST(8)); } if (items > 9) { - slot_id = (uint16)SvUV(ST(9)); + slot_id = (uint16) SvUV(ST(9)); } THIS->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, 0, attune, slot_id); @@ -3219,23 +3078,21 @@ XS(XS_Client_SummonItem) } XS(XS_Client_SetStats); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetStats) -{ +XS(XS_Client_SetStats) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Client::SetStats(THIS, uint8 type, uint16 increase_val)"); { - Client * THIS; - uint8 type = (uint8)SvUV(ST(1)); - int16 increase_val = (int16)SvIV(ST(2)); + Client *THIS; + uint8 type = (uint8) SvUV(ST(1)); + int16 increase_val = (int16) SvIV(ST(2)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetStats(type, increase_val); @@ -3244,23 +3101,21 @@ XS(XS_Client_SetStats) } XS(XS_Client_IncStats); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_IncStats) -{ +XS(XS_Client_IncStats) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Client::IncStats(THIS, uint8 type, uint16 increase_val)"); { - Client * THIS; - uint8 type = (uint8)SvUV(ST(1)); - int16 increase_val = (int16)SvIV(ST(2)); + Client *THIS; + uint8 type = (uint8) SvUV(ST(1)); + int16 increase_val = (int16) SvIV(ST(2)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->IncStats(type, increase_val); @@ -3269,22 +3124,20 @@ XS(XS_Client_IncStats) } XS(XS_Client_DropItem); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_DropItem) -{ +XS(XS_Client_DropItem) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::DropItem(THIS, int16 slot_id)"); { - Client * THIS; - int16 slot_id = (int16)SvIV(ST(1)); + Client *THIS; + int16 slot_id = (int16) SvIV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->DropItem(slot_id); @@ -3293,21 +3146,19 @@ XS(XS_Client_DropItem) } XS(XS_Client_BreakInvis); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_BreakInvis) -{ +XS(XS_Client_BreakInvis) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::BreakInvis(THIS)"); { - Client * THIS; + Client *THIS; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->BreakInvis(); @@ -3316,47 +3167,43 @@ XS(XS_Client_BreakInvis) } XS(XS_Client_GetGroup); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetGroup) -{ +XS(XS_Client_GetGroup) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetGroup(THIS)"); { - Client * THIS; - Group * RETVAL; + Client *THIS; + Group *RETVAL; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGroup(); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Group", (void*)RETVAL); + sv_setref_pv(ST(0), "Group", (void *) RETVAL); } XSRETURN(1); } XS(XS_Client_LeaveGroup); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_LeaveGroup) -{ +XS(XS_Client_LeaveGroup) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::LeaveGroup(THIS)"); { - Client * THIS; + Client *THIS; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->LeaveGroup(); @@ -3365,48 +3212,44 @@ XS(XS_Client_LeaveGroup) } XS(XS_Client_GetRaid); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetRaid) -{ +XS(XS_Client_GetRaid) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetRaid(THIS)"); { - Client * THIS; - Raid * RETVAL; + Client *THIS; + Raid *RETVAL; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetRaid(); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Raid", (void*)RETVAL); + sv_setref_pv(ST(0), "Raid", (void *) RETVAL); } XSRETURN(1); } XS(XS_Client_IsGrouped); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_IsGrouped) -{ +XS(XS_Client_IsGrouped) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::IsGrouped(THIS)"); { - Client * THIS; - bool RETVAL; + Client *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsGrouped(); @@ -3417,22 +3260,20 @@ XS(XS_Client_IsGrouped) } XS(XS_Client_IsRaidGrouped); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_IsRaidGrouped) -{ +XS(XS_Client_IsRaidGrouped) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::IsRaidGrouped(THIS)"); { - Client * THIS; - bool RETVAL; + Client *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsRaidGrouped(); @@ -3443,22 +3284,20 @@ XS(XS_Client_IsRaidGrouped) } XS(XS_Client_Hungry); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_Hungry) -{ +XS(XS_Client_Hungry) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::Hungry(THIS)"); { - Client * THIS; - bool RETVAL; + Client *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->Hungry(); @@ -3469,22 +3308,20 @@ XS(XS_Client_Hungry) } XS(XS_Client_Thirsty); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_Thirsty) -{ +XS(XS_Client_Thirsty) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::Thirsty(THIS)"); { - Client * THIS; - bool RETVAL; + Client *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->Thirsty(); @@ -3495,103 +3332,97 @@ XS(XS_Client_Thirsty) } XS(XS_Client_GetInstrumentMod); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetInstrumentMod) -{ +XS(XS_Client_GetInstrumentMod) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::GetInstrumentMod(THIS, uint16 spell_id)"); { - Client * THIS; - uint16 RETVAL; + Client *THIS; + uint16 RETVAL; dXSTARG; - uint16 spell_id = (uint16)SvUV(ST(1)); + uint16 spell_id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetInstrumentMod(spell_id); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_DecreaseByID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_DecreaseByID) -{ +XS(XS_Client_DecreaseByID) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Client::DecreaseByID(THIS, uint32 type, unit8 amount)"); { - Client * THIS; - bool RETVAL; - uint32 type = (uint32)SvUV(ST(1)); - uint8 amt = (uint8)SvUV(ST(2)); + Client *THIS; + bool RETVAL; + uint32 type = (uint32) SvUV(ST(1)); + uint8 amt = (uint8) SvUV(ST(2)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->DecreaseByID(type, amt); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Client_SlotConvert2); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SlotConvert2) -{ +XS(XS_Client_SlotConvert2) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::SlotConvert2(THIS, uint8 slot)"); { - Client * THIS; - uint8 RETVAL; + Client *THIS; + uint8 RETVAL; dXSTARG; - uint8 slot = (uint8)SvUV(ST(1)); + uint8 slot = (uint8) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->SlotConvert2(slot); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_Escape); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_Escape) -{ +XS(XS_Client_Escape) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::Escape(THIS)"); { - Client * THIS; + Client *THIS; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Escape(); @@ -3600,21 +3431,19 @@ XS(XS_Client_Escape) } XS(XS_Client_RemoveNoRent); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_RemoveNoRent) -{ +XS(XS_Client_RemoveNoRent) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::RemoveNoRent(THIS)"); { - Client * THIS; + Client *THIS; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveNoRent(); @@ -3623,21 +3452,19 @@ XS(XS_Client_RemoveNoRent) } XS(XS_Client_GoFish); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GoFish) -{ +XS(XS_Client_GoFish) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GoFish(THIS)"); { - Client * THIS; + Client *THIS; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->GoFish(); @@ -3646,21 +3473,19 @@ XS(XS_Client_GoFish) } XS(XS_Client_ForageItem); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_ForageItem) -{ +XS(XS_Client_ForageItem) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::ForageItem(THIS)"); { - Client * THIS; + Client *THIS; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ForageItem(); @@ -3675,10 +3500,10 @@ XS(XS_Client_CalcPriceMod) { Perl_croak(aTHX_ "Usage: Client::CalcPriceMod(THIS, Mob*, [bool reverse = false])"); { Client *THIS; - float RETVAL; + float RETVAL; dXSTARG; - Mob *other; - bool reverse; + Mob *other; + bool reverse; if (sv_derived_from(ST(0), "Client")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -3767,9 +3592,9 @@ XS(XS_Client_GetCharacterFactionLevel) { Perl_croak(aTHX_ "Usage: Client::GetCharacterFactionLevel(THIS, int32 faction_id)"); { Client *THIS; - int32 RETVAL; + int32 RETVAL; dXSTARG; - int32 faction_id = (int32) SvIV(ST(1)); + int32 faction_id = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "Client")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -3831,58 +3656,53 @@ XS(XS_Client_ClearZoneFlag) { } XS(XS_Client_HasZoneFlag); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_HasZoneFlag) -{ +XS(XS_Client_HasZoneFlag) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::HasZoneFlag(THIS, uint32 zone_id)"); { - Client * THIS; - bool RETVAL; - uint32 zone_id = (uint32)SvUV(ST(1)); + Client *THIS; + bool RETVAL; + uint32 zone_id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->HasZoneFlag(zone_id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Client_SendZoneFlagInfo); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SendZoneFlagInfo) -{ +XS(XS_Client_SendZoneFlagInfo) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::SendZoneFlagInfo(THIS, Client* to)"); { - Client * THIS; - Client * to; + Client *THIS; + Client *to; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - to = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + to = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "to is not of type Client"); - if(to == nullptr) + if (to == nullptr) Perl_croak(aTHX_ "to is nullptr, avoiding crash."); THIS->SendZoneFlagInfo(to); @@ -3891,21 +3711,19 @@ XS(XS_Client_SendZoneFlagInfo) } XS(XS_Client_LoadZoneFlags); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_LoadZoneFlags) -{ +XS(XS_Client_LoadZoneFlags) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::LoadZoneFlags(THIS)"); { - Client * THIS; + Client *THIS; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->LoadZoneFlags(); @@ -3914,32 +3732,30 @@ XS(XS_Client_LoadZoneFlags) } XS(XS_Client_SetAATitle); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetAATitle) -{ +XS(XS_Client_SetAATitle) { dXSARGS; if ((items < 2) || (items > 3)) Perl_croak(aTHX_ "Usage: Client::SetAATitle(THIS, string text, [bool save = false])"); { - Client * THIS; - char * txt = (char *)SvPV_nolen(ST(1)); + Client *THIS; + char *txt = (char *) SvPV_nolen(ST(1)); bool SaveTitle = false; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - if(strlen(txt) > 31) + if (strlen(txt) > 31) Perl_croak(aTHX_ "Title must be 31 characters or less"); - if(items == 3) + if (items == 3) SaveTitle = (SvIV(ST(2)) != 0); - if(!SaveTitle) + if (!SaveTitle) THIS->SetAATitle(txt); else title_manager.CreateNewPlayerTitle(THIS, txt); @@ -3948,53 +3764,51 @@ XS(XS_Client_SetAATitle) } XS(XS_Client_GetClientVersion); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetClientVersion) -{ +XS(XS_Client_GetClientVersion) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetClientVersion(THIS)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = static_cast(THIS->ClientVersion()); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetClientVersionBit); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetClientVersionBit) -{ +XS(XS_Client_GetClientVersionBit) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetClientVersionBit(THIS)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->ClientVersionBit(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } @@ -4005,26 +3819,25 @@ XS(XS_Client_SetTitleSuffix) { if ((items < 2) || (items > 3)) Perl_croak(aTHX_ "Usage: Client::SetTitleSuffix(THIS, string text, [bool save = false])"); { - Client * THIS; - char * txt = (char *)SvPV_nolen(ST(1)); + Client *THIS; + char *txt = (char *) SvPV_nolen(ST(1)); bool SaveSuffix = false; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - if(strlen(txt) > 31) + if (strlen(txt) > 31) Perl_croak(aTHX_ "Title must be 31 characters or less"); - if(items == 3) + if (items == 3) SaveSuffix = (SvIV(ST(2)) != 0); - if(!SaveSuffix) + if (!SaveSuffix) THIS->SetTitleSuffix(txt); else title_manager.CreateNewPlayerSuffix(THIS, txt); @@ -4035,19 +3848,18 @@ XS(XS_Client_SetTitleSuffix) { XS(XS_Client_SetAAPoints); XS(XS_Client_SetAAPoints) { dXSARGS; - if(items != 2) + if (items != 2) Perl_croak(aTHX_ "Usage: Client::SetAAPoints(THIS, uint32 points)"); { - Client * THIS; + Client *THIS; uint32 points = SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetAAPoints(points); @@ -4058,24 +3870,24 @@ XS(XS_Client_SetAAPoints) { XS(XS_Client_GetAAPoints); XS(XS_Client_GetAAPoints) { dXSARGS; - if(items != 1) + if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetAAPoints(THIS)"); dXSTARG; { - Client * THIS; + Client *THIS; uint32 RETVAL; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAAPoints(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } @@ -4083,24 +3895,24 @@ XS(XS_Client_GetAAPoints) { XS(XS_Client_GetSpentAA); XS(XS_Client_GetSpentAA) { dXSARGS; - if(items != 1) + if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetSpentAA(THIS)"); dXSTARG; { - Client * THIS; + Client *THIS; uint32 RETVAL; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSpentAA(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } @@ -4108,19 +3920,18 @@ XS(XS_Client_GetSpentAA) { XS(XS_Client_AddAAPoints); XS(XS_Client_AddAAPoints) { dXSARGS; - if(items != 2) + if (items != 2) Perl_croak(aTHX_ "Usage: Client::AddAAPoints(THIS, uint32 points)"); { - Client * THIS; + Client *THIS; uint32 points = SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->AddAAPoints(points); @@ -4131,18 +3942,17 @@ XS(XS_Client_AddAAPoints) { XS(XS_Client_RefundAA); XS(XS_Client_RefundAA) { dXSARGS; - if(items != 1) + if (items != 1) Perl_croak(aTHX_ "Usage: Client::RefundAA(THIS)"); { - Client * THIS; + Client *THIS; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RefundAA(); @@ -4151,278 +3961,262 @@ XS(XS_Client_RefundAA) { } XS(XS_Client_GetModCharacterFactionLevel); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetModCharacterFactionLevel) -{ +XS(XS_Client_GetModCharacterFactionLevel) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::GetModCharacterFactionLevel(THIS, int32 faction_id)"); { - Client * THIS; - int32 RETVAL; + Client *THIS; + int32 RETVAL; dXSTARG; - int32 faction_id = (int32)SvIV(ST(1)); + int32 faction_id = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetModCharacterFactionLevel(faction_id); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetLDoNWins); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetLDoNWins) -{ +XS(XS_Client_GetLDoNWins) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetLDoNWins(THIS)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLDoNWins(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetLDoNLosses); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetLDoNLosses) -{ +XS(XS_Client_GetLDoNLosses) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetLDoNLosses(THIS)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLDoNLosses(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetLDoNWinsTheme); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetLDoNWinsTheme) -{ +XS(XS_Client_GetLDoNWinsTheme) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::GetLDoNWinsTheme(THIS, int32 theme)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; - int32 theme_out = (int32)SvIV(ST(1)); + int32 theme_out = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLDoNWinsTheme(theme_out); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetLDoNLossesTheme); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetLDoNLossesTheme) -{ +XS(XS_Client_GetLDoNLossesTheme) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::GetLDoNLossesTheme(THIS, int32 theme)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; - int32 theme_out = (int32)SvIV(ST(1)); + int32 theme_out = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLDoNLossesTheme(theme_out); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetItemAt); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetItemAt) -{ +XS(XS_Client_GetItemAt) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::GetItemAt(THIS, uint32 slot)"); { - Client * THIS; - EQEmu::ItemInstance * RETVAL; - uint32 slot = (int32)SvIV(ST(1)); + Client *THIS; + EQEmu::ItemInstance *RETVAL; + uint32 slot = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetInv().GetItem(slot); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "QuestItem", (void*)RETVAL); + sv_setref_pv(ST(0), "QuestItem", (void *) RETVAL); } XSRETURN(1); } XS(XS_Client_GetAugmentAt); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetAugmentAt) -{ +XS(XS_Client_GetAugmentAt) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Client::GetAugmentAt(THIS, uint32 slot, uint32 aug_slot)"); { - Client * THIS; - EQEmu::ItemInstance * RETVAL; - uint32 slot = (int32)SvIV(ST(1)); - uint32 aug_slot = (int32)SvIV(ST(1)); + Client *THIS; + EQEmu::ItemInstance *RETVAL; + uint32 slot = (int32) SvIV(ST(1)); + uint32 aug_slot = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - EQEmu::ItemInstance * inst = THIS->GetInv().GetItem(slot); - if(inst) - { + EQEmu::ItemInstance *inst = THIS->GetInv().GetItem(slot); + if (inst) { RETVAL = inst->GetAugment(aug_slot); - } - else - { + } else { RETVAL = nullptr; } ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "QuestItem", (void*)RETVAL); + sv_setref_pv(ST(0), "QuestItem", (void *) RETVAL); } XSRETURN(1); } XS(XS_Client_GetStartZone); -XS(XS_Client_GetStartZone) -{ +XS(XS_Client_GetStartZone) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetStartZone(THIS)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetStartZone(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_SetStartZone); -XS(XS_Client_SetStartZone) -{ +XS(XS_Client_SetStartZone) { dXSARGS; if (items != 2 && items != 5) - Perl_croak(aTHX_ "Usage: Client::SetStartZone(THIS, uint32 zone_id, [float x = 0], [float y = 0], [float z = 0])"); + Perl_croak(aTHX_ + "Usage: Client::SetStartZone(THIS, uint32 zone_id, [float x = 0], [float y = 0], [float z = 0])"); { - Client * THIS; - uint32 zoneid = (uint32)SvUV(ST(1)); - float x = 0; - float y = 0; - float z = 0; + Client *THIS; + uint32 zoneid = (uint32) SvUV(ST(1)); + float x = 0; + float y = 0; + float z = 0; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - if(items == 5) { + if (items == 5) { x = SvNV(ST(2)); y = SvNV(ST(3)); z = SvNV(ST(4)); } - THIS->SetStartZone(zoneid,x,y,z); + THIS->SetStartZone(zoneid, x, y, z); } XSRETURN_EMPTY; } XS(XS_Client_KeyRingAdd); -XS(XS_Client_KeyRingAdd) -{ +XS(XS_Client_KeyRingAdd) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::KeyRingAdd(THIS, uint32 item_id)"); { - Client * THIS; - uint32 item_id = (uint32)SvUV(ST(1)); + Client *THIS; + uint32 item_id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->KeyRingAdd(item_id);; @@ -4431,49 +4225,45 @@ XS(XS_Client_KeyRingAdd) } XS(XS_Client_KeyRingCheck); -XS(XS_Client_KeyRingCheck) -{ +XS(XS_Client_KeyRingCheck) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::KeyRingCheck(THIS, uint32 item_id)"); { - Client * THIS; - bool RETVAL; - uint32 item_id = (uint32)SvUV(ST(1)); + Client *THIS; + bool RETVAL; + uint32 item_id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->KeyRingCheck(item_id);; - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Client_AddPVPPoints); -XS(XS_Client_AddPVPPoints) -{ +XS(XS_Client_AddPVPPoints) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::AddPVPPoints(THIS, uint32 points)"); { - Client * THIS; - uint32 Points = (uint32)SvUV(ST(1)); + Client *THIS; + uint32 Points = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->AddPVPPoints(Points); @@ -4482,23 +4272,21 @@ XS(XS_Client_AddPVPPoints) } XS(XS_Client_AddCrystals); -XS(XS_Client_AddCrystals) -{ +XS(XS_Client_AddCrystals) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Client::AddCrystals(THIS, uint32 radiant_count, uint32 ebon_count)"); { - Client * THIS; - uint32 Radiant = (uint32)SvUV(ST(1)); - uint32 Ebon = (uint32)SvUV(ST(2)); + Client *THIS; + uint32 Radiant = (uint32) SvUV(ST(1)); + uint32 Ebon = (uint32) SvUV(ST(2)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->AddCrystals(Radiant, Ebon); @@ -4507,126 +4295,119 @@ XS(XS_Client_AddCrystals) } XS(XS_Client_GetPVPPoints); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetPVPPoints) -{ +XS(XS_Client_GetPVPPoints) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetPVPPoints(THIS)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPVPPoints(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetRadiantCrystals); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetRadiantCrystals) -{ +XS(XS_Client_GetRadiantCrystals) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetRadiantCrystals(THIS)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetRadiantCrystals(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetEbonCrystals); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetEbonCrystals) -{ +XS(XS_Client_GetEbonCrystals) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetEbonCrystals(THIS)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEbonCrystals(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_ReadBook); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_ReadBook) -{ +XS(XS_Client_ReadBook) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Client::ReadBook(THIS, char* book_test, uint8 type)"); { - Client * THIS; - char* in_txt = (char *)SvPV_nolen(ST(1)); - uint8 type = (uint8)SvUV(ST(2)); + Client *THIS; + char *in_txt = (char *) SvPV_nolen(ST(1)); + uint8 type = (uint8) SvUV(ST(2)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - THIS->QuestReadBook(in_txt, type); + THIS->QuestReadBook(in_txt, type); } -XSRETURN_EMPTY; + XSRETURN_EMPTY; } XS(XS_Client_UpdateGroupAAs); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_UpdateGroupAAs) -{ +XS(XS_Client_UpdateGroupAAs) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Client::UpdateGroupAAs(THIS, int32 points, uint32 type)"); { - Client * THIS; - int32 points = (int32)SvIV(ST(1)); - uint32 type = (uint32)SvUV(ST(2)); + Client *THIS; + int32 points = (int32) SvIV(ST(1)); + uint32 type = (uint32) SvUV(ST(2)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->UpdateGroupAAs(points, type); @@ -4635,74 +4416,70 @@ XS(XS_Client_UpdateGroupAAs) } XS(XS_Client_GetGroupPoints); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetGroupPoints) -{ +XS(XS_Client_GetGroupPoints) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetGroupPoints(THIS)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGroupPoints(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetRaidPoints); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetRaidPoints) -{ +XS(XS_Client_GetRaidPoints) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetRaidPoints(THIS)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetRaidPoints(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_LearnRecipe); -XS(XS_Client_LearnRecipe) -{ +XS(XS_Client_LearnRecipe) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::LearnRecipe(THIS, uint32 recipe_id)"); { - Client * THIS; - uint32 recipe_id = (uint32)SvUV(ST(1)); + Client *THIS; + uint32 recipe_id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->LearnRecipe(recipe_id);; @@ -4711,100 +4488,95 @@ XS(XS_Client_LearnRecipe) } XS(XS_Client_GetEndurance); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetEndurance) -{ +XS(XS_Client_GetEndurance) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetEndurance(THIS)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEndurance(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetMaxEndurance); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetMaxEndurance) -{ +XS(XS_Client_GetMaxEndurance) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetMaxEndurance(THIS)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxEndurance(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetEnduranceRatio); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetEnduranceRatio) -{ +XS(XS_Client_GetEnduranceRatio) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetEnduranceRatio(THIS)"); { - Client * THIS; - uint8 RETVAL; + Client *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEndurancePercent(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_SetEndurance); -XS(XS_Client_SetEndurance) -{ +XS(XS_Client_SetEndurance) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::SetEndurance(THIS, Endurance)"); { - Client * THIS; - int32 Endurance = (int32)SvUV(ST(1)); + Client *THIS; + int32 Endurance = (int32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetEndurance(Endurance); @@ -4813,32 +4585,29 @@ XS(XS_Client_SetEndurance) } XS(XS_Client_SendOPTranslocateConfirm); -XS(XS_Client_SendOPTranslocateConfirm) -{ +XS(XS_Client_SendOPTranslocateConfirm) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Client::SendOPTranslocateConfirm(THIS, Mob* caster, int32 spell_id)"); { - Client * THIS; - Mob * caster = nullptr; - int32 spell_id = (int32)SvUV(ST(2)); + Client *THIS; + Mob *caster = nullptr; + int32 spell_id = (int32) SvUV(ST(2)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - caster = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + caster = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "caster is not of type Mob"); - if(caster == nullptr) + if (caster == nullptr) Perl_croak(aTHX_ "caster is nullptr, avoiding crash."); THIS->SendOPTranslocateConfirm(caster, spell_id); @@ -4847,37 +4616,34 @@ XS(XS_Client_SendOPTranslocateConfirm) } XS(XS_Client_NPCSpawn); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_NPCSpawn) -{ +XS(XS_Client_NPCSpawn) { dXSARGS; if (items < 3 || items > 4) Perl_croak(aTHX_ "Usage: Client::NPCSpawn(THIS, NPC*, string option, uint32 respawn_time=1200)"); { - Client * THIS; - NPC * target_npc = nullptr; - Const_char * option = (Const_char *)SvPV_nolen(ST(2)); - uint32 respawntime = 1200; + Client *THIS; + NPC *target_npc = nullptr; + Const_char *option = (Const_char *) SvPV_nolen(ST(2)); + uint32 respawntime = 1200; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - target_npc = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + target_npc = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(target_npc == nullptr) + if (target_npc == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 3) - respawntime = (uint32)SvUV(ST(3)); + respawntime = (uint32) SvUV(ST(3)); THIS->NPCSpawn(target_npc, option, respawntime); } @@ -4885,53 +4651,50 @@ XS(XS_Client_NPCSpawn) } XS(XS_Client_GetIP); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetIP) -{ +XS(XS_Client_GetIP) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetIP(THIS)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetIP(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_AddLevelBasedExp); -XS(XS_Client_AddLevelBasedExp) -{ +XS(XS_Client_AddLevelBasedExp) { dXSARGS; - if (items < 2 || items > 3 ) + if (items < 2 || items > 3) Perl_croak(aTHX_ "Usage: Client::AddLevelBasedExp(THIS, uint8 exp_percentage, uint8 max_level = 0)"); { - Client * THIS; - uint8 exp_percentage = (uint8)SvUV(ST(1)); - uint8 max_level = 0; + Client *THIS; + uint8 exp_percentage = (uint8) SvUV(ST(1)); + uint8 max_level = 0; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 2) - max_level = (uint8)SvUV(ST(2)); + max_level = (uint8) SvUV(ST(2)); THIS->AddLevelBasedExp(exp_percentage, max_level); } @@ -4939,22 +4702,20 @@ XS(XS_Client_AddLevelBasedExp) } XS(XS_Client_IncrementAA); -XS(XS_Client_IncrementAA) -{ +XS(XS_Client_IncrementAA) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::IncrementAA(THIS, uint32 aa_skill_id)"); { - Client * THIS; - uint32 aaskillid = SvUV(ST(1)); + Client *THIS; + uint32 aaskillid = SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->IncrementAlternateAdvancementRank(aaskillid); @@ -4963,197 +4724,188 @@ XS(XS_Client_IncrementAA) } XS(XS_Client_GrantAlternateAdvancementAbility); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GrantAlternateAdvancementAbility) -{ +XS(XS_Client_GrantAlternateAdvancementAbility) { dXSARGS; - if(items < 3 || items > 4) - Perl_croak(aTHX_ "Usage: Client::GrantAlternateAdvancementAbility(THIS, int aa_id, int points, [bool ignore_cost = false])"); + if (items < 3 || items > 4) + Perl_croak(aTHX_ + "Usage: Client::GrantAlternateAdvancementAbility(THIS, int aa_id, int points, [bool ignore_cost = false])"); { - Client * THIS; - bool RETVAL; - int aa_id = (int)SvIV(ST(1)); - int points = (int)SvIV(ST(2)); - bool ignore_cost = false; + Client *THIS; + bool RETVAL; + int aa_id = (int) SvIV(ST(1)); + int points = (int) SvIV(ST(2)); + bool ignore_cost = false; - if(sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + if (sv_derived_from(ST(0), "Client")) { + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Client *, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - if(items > 3) { - ignore_cost = (bool)SvTRUE(ST(3)); + if (items > 3) { + ignore_cost = (bool) SvTRUE(ST(3)); } RETVAL = THIS->GrantAlternateAdvancementAbility(aa_id, points, ignore_cost); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Client_GetAALevel); -XS(XS_Client_GetAALevel) -{ +XS(XS_Client_GetAALevel) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::GetAALevel(THIS, uint32 aa_skill_id)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; - uint32 aaskillid = SvUV(ST(1)); + uint32 aaskillid = SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAA(aaskillid); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_MarkCompassLoc); -XS(XS_Client_MarkCompassLoc) -{ +XS(XS_Client_MarkCompassLoc) { dXSARGS; if (items != 4) Perl_croak(aTHX_ "Usage: Client::MarkCompassLoc(THIS, float x, float y, float z)"); { - Client * THIS; - float x = SvNV(ST(1)); - float y = SvNV(ST(2)); - float z = SvNV(ST(3)); + Client *THIS; + float x = SvNV(ST(1)); + float y = SvNV(ST(2)); + float z = SvNV(ST(3)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - THIS->MarkSingleCompassLoc(x,y,z); + THIS->MarkSingleCompassLoc(x, y, z); } XSRETURN_EMPTY; } XS(XS_Client_ClearCompassMark); -XS(XS_Client_ClearCompassMark) -{ +XS(XS_Client_ClearCompassMark) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::ClearCompassMark(THIS)"); { - Client * THIS; + Client *THIS; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - THIS->MarkSingleCompassLoc(0,0,0,0); + THIS->MarkSingleCompassLoc(0, 0, 0, 0); } XSRETURN_EMPTY; } XS(XS_Client_GetFreeSpellBookSlot); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetFreeSpellBookSlot) -{ +XS(XS_Client_GetFreeSpellBookSlot) { dXSARGS; if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: Client::GetFreeSpellBookSlot(THIS, uint32 start_slot = 0)"); { - Client * THIS; - int RETVAL; - uint32 start_slot = 0; + Client *THIS; + int RETVAL; + uint32 start_slot = 0; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 1) start_slot = SvUV(ST(1)); RETVAL = THIS->GetNextAvailableSpellBookSlot(start_slot); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetSpellBookSlotBySpellID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetSpellBookSlotBySpellID) -{ +XS(XS_Client_GetSpellBookSlotBySpellID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::GetSpellBookSlotBySpellID(THIS, uint32 spell_id)"); { - Client * THIS; - int RETVAL; - uint32 spell_id = SvUV(ST(1)); + Client *THIS; + int RETVAL; + uint32 spell_id = SvUV(ST(1)); dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->FindSpellBookSlotBySpellID(spell_id); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Client_UpdateTaskActivity); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_UpdateTaskActivity) -{ +XS(XS_Client_UpdateTaskActivity) { dXSARGS; if (items < 4) - Perl_croak(aTHX_ "Usage: Client::UpdateTaskActivity(THIS, int task_id, int activity_id, int count, [bool ignore_quest_update = false])"); + Perl_croak(aTHX_ + "Usage: Client::UpdateTaskActivity(THIS, int task_id, int activity_id, int count, [bool ignore_quest_update = false])"); { bool ignore_quest_update = false; - Client * THIS; + Client *THIS; - int TaskID = (int)SvIV(ST(1)); - int ActivityID = (int)SvIV(ST(2)); - int Count = (int)SvUV(ST(3)); + int TaskID = (int) SvIV(ST(1)); + int ActivityID = (int) SvIV(ST(2)); + int Count = (int) SvUV(ST(3)); - if (items == 5){ - ignore_quest_update = (bool)SvTRUE(ST(4)); + if (items == 5) { + ignore_quest_update = (bool) SvTRUE(ST(4)); } if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->UpdateTaskActivity(TaskID, ActivityID, Count, ignore_quest_update); @@ -5162,59 +4914,55 @@ XS(XS_Client_UpdateTaskActivity) } XS(XS_Client_GetTaskActivityDoneCount); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetTaskActivityDoneCount) -{ +XS(XS_Client_GetTaskActivityDoneCount) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Client::GetTaskActivityDoneCount(THIS, int task_id, int activity_id)"); { - Client * THIS; - int RETVAL; - int TaskID = (int)SvIV(ST(1)); - int ActivityID = (int)SvIV(ST(2)); + Client *THIS; + int RETVAL; + int TaskID = (int) SvIV(ST(1)); + int ActivityID = (int) SvIV(ST(2)); dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Client *, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Client"); if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetTaskActivityDoneCountFromTaskID(TaskID, ActivityID); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Client_AssignTask); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_AssignTask) -{ +XS(XS_Client_AssignTask) { dXSARGS; if (items != 3 && items != 4) - Perl_croak(aTHX_ "Usage: Client::AssignTask(THIS, int task_id, int npc_id, [bool enforce_level_requirement = false])"); + Perl_croak(aTHX_ + "Usage: Client::AssignTask(THIS, int task_id, int npc_id, [bool enforce_level_requirement = false])"); { - Client * THIS; - int TaskID = (int)SvIV(ST(1)); - int NPCID = (int)SvIV(ST(2)); - bool enforce_level_requirement = false; - if (items == 4) - { - if ((int)SvIV(ST(3)) == 1) - { + Client *THIS; + int TaskID = (int) SvIV(ST(1)); + int NPCID = (int) SvIV(ST(2)); + bool enforce_level_requirement = false; + if (items == 4) { + if ((int) SvIV(ST(3)) == 1) { enforce_level_requirement = true; } } if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->AssignTask(TaskID, NPCID, enforce_level_requirement); @@ -5223,22 +4971,20 @@ XS(XS_Client_AssignTask) } XS(XS_Client_FailTask); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_FailTask) -{ +XS(XS_Client_FailTask) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::FailTask(THIS, int task_id)"); { - Client * THIS; - int TaskID = (int)SvIV(ST(1)); + Client *THIS; + int TaskID = (int) SvIV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->FailTask(TaskID); @@ -5247,185 +4993,174 @@ XS(XS_Client_FailTask) } XS(XS_Client_IsTaskCompleted); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_IsTaskCompleted) -{ +XS(XS_Client_IsTaskCompleted) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::IsTaskCompleted(THIS, int task_id)"); { - Client * THIS; - int RETVAL; - int TaskID = (int)SvIV(ST(1)); + Client *THIS; + int RETVAL; + int TaskID = (int) SvIV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsTaskCompleted(TaskID); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Client_IsTaskActive); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_IsTaskActive) -{ +XS(XS_Client_IsTaskActive) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::IsTaskActive(THIS, int task_id)"); { - Client * THIS; - bool RETVAL; - int TaskID = (int)SvIV(ST(1)); + Client *THIS; + bool RETVAL; + int TaskID = (int) SvIV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsTaskActive(TaskID); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Client_IsTaskActivityActive); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_IsTaskActivityActive) -{ +XS(XS_Client_IsTaskActivityActive) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Client::IsTaskActivityActive(THIS, int task_id, int activity_id)"); { - Client * THIS; - bool RETVAL; - int TaskID = (int)SvIV(ST(1)); - int ActivityID = (int)SvIV(ST(2)); + Client *THIS; + bool RETVAL; + int TaskID = (int) SvIV(ST(1)); + int ActivityID = (int) SvIV(ST(2)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsTaskActivityActive(TaskID, ActivityID); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Client_GetCorpseCount); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetCorpseCount) -{ +XS(XS_Client_GetCorpseCount) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetCorpseCount(THIS)"); { - Client * THIS; - uint32 RETVAL; + Client *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCorpseCount(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetCorpseID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetCorpseID) -{ +XS(XS_Client_GetCorpseID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::GetCorpseID(THIS, uint8 corpse)"); { - Client * THIS; - uint8 corpse = (uint8)SvIV(ST(1)); - uint32 RETVAL; + Client *THIS; + uint8 corpse = (uint8) SvIV(ST(1)); + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCorpseID(corpse); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetCorpseItemAt); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetCorpseItemAt) -{ +XS(XS_Client_GetCorpseItemAt) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Client::GetCorpseItemAt(THIS, uint32 corpse_id, uint16 slot_id)"); { - Client * THIS; - uint32 corpse_id = (uint32)SvIV(ST(1)); - uint16 slotid = (uint16)SvIV(ST(2)); - uint32 RETVAL; + Client *THIS; + uint32 corpse_id = (uint32) SvIV(ST(1)); + uint16 slotid = (uint16) SvIV(ST(2)); + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCorpseItemAt(corpse_id, slotid); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Client_AssignToInstance); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_AssignToInstance) -{ +XS(XS_Client_AssignToInstance) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::AssignToInstance(THIS, uint16 instance_id)"); { - Client * THIS; - uint16 instance_id = (uint16)SvUV(ST(1)); + Client *THIS; + uint16 instance_id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->AssignToInstance(instance_id); @@ -5434,20 +5169,18 @@ XS(XS_Client_AssignToInstance) } XS(XS_Client_RemoveFromInstance); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_RemoveFromInstance) -{ +XS(XS_Client_RemoveFromInstance) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::RemoveFromInstance(THIS, uint16 instance_id)"); { - Client * THIS; - uint16 instance_id = (uint16)SvUV(ST(1)); + Client *THIS; + uint16 instance_id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Client *, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Client"); if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); @@ -5458,21 +5191,19 @@ XS(XS_Client_RemoveFromInstance) } XS(XS_Client_Freeze); -XS(XS_Client_Freeze) -{ +XS(XS_Client_Freeze) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client:Freeze(THIS)"); { - Client * THIS; + Client *THIS; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SendAppearancePacket(AT_Anim, ANIM_FREEZE); @@ -5481,21 +5212,19 @@ XS(XS_Client_Freeze) } XS(XS_Client_UnFreeze); -XS(XS_Client_UnFreeze) -{ +XS(XS_Client_UnFreeze) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client:UnFreeze(THIS)"); { - Client * THIS; + Client *THIS; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SendAppearancePacket(AT_Anim, ANIM_STAND); @@ -5505,132 +5234,125 @@ XS(XS_Client_UnFreeze) XS(XS_Client_GetAggroCount); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetAggroCount) -{ +XS(XS_Client_GetAggroCount) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetAggroCount(THIS)"); { - Client * THIS; - int RETVAL; + Client *THIS; + int RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAggroCount(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetCarriedMoney); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetCarriedMoney) -{ +XS(XS_Client_GetCarriedMoney) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetCarriedMoney(THIS)"); { - Client * THIS; - int RETVAL; + Client *THIS; + int RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCarriedMoney(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetAllMoney); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetAllMoney) -{ +XS(XS_Client_GetAllMoney) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetAllMoney(THIS)"); { - Client * THIS; - int RETVAL; + Client *THIS; + int RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAllMoney(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Client_GetItemInInventory); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetItemInInventory) -{ +XS(XS_Client_GetItemInInventory) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::GetItemInInventory(THIS, int16 slot_id)"); { - Client * THIS; - int16 slot_id = (int16)SvIV(ST(1)); - EQEmu::ItemInstance *RETVAL = nullptr; + Client *THIS; + int16 slot_id = (int16) SvIV(ST(1)); + EQEmu::ItemInstance *RETVAL = nullptr; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetInv().GetItem(slot_id); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "QuestItem", (void*)RETVAL); + sv_setref_pv(ST(0), "QuestItem", (void *) RETVAL); } XSRETURN(1); } XS(XS_Client_SetCustomItemData); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetCustomItemData) -{ +XS(XS_Client_SetCustomItemData) { dXSARGS; if (items != 4) Perl_croak(aTHX_ "Usage: Client::SetCustomItemData(THIS, int16 slot_id, string identifier, string value)"); { - Client * THIS; - int16 slot_id = (int16)SvIV(ST(1)); - Const_char* identifier = SvPV_nolen(ST(2)); - Const_char* value = SvPV_nolen(ST(3)); + Client *THIS; + int16 slot_id = (int16) SvIV(ST(1)); + Const_char *identifier = SvPV_nolen(ST(2)); + Const_char *value = SvPV_nolen(ST(3)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->GetInv().SetCustomItemData(THIS->CharacterID(), slot_id, std::string(identifier), std::string(value)); @@ -5639,50 +5361,48 @@ XS(XS_Client_SetCustomItemData) } XS(XS_Client_GetCustomItemData); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetCustomItemData) -{ +XS(XS_Client_GetCustomItemData) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Client::GetCustomItemData(THIS, int16 slot_id, string identifier)"); { - Client * THIS; - int16 slot_id = (int16)SvIV(ST(1)); - Const_char* identifier = SvPV_nolen(ST(2)); - Const_char * RETVAL; + Client *THIS; + int16 slot_id = (int16) SvIV(ST(1)); + Const_char *identifier = SvPV_nolen(ST(2)); + Const_char *RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); std::string ret_val = THIS->GetInv().GetCustomItemData(slot_id, std::string(identifier)); RETVAL = ret_val.c_str(); - sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; + sv_setpv(TARG, RETVAL); + XSprePUSH; + PUSHTARG; } XSRETURN(1); } XS(XS_Client_OpenLFGuildWindow); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_OpenLFGuildWindow) -{ +XS(XS_Client_OpenLFGuildWindow) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::OpenLFGuildWindow(THIS)"); { - Client * THIS; + Client *THIS; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->OpenLFGuildWindow(); @@ -5691,22 +5411,20 @@ XS(XS_Client_OpenLFGuildWindow) } XS(XS_Client_SignalClient); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SignalClient) -{ +XS(XS_Client_SignalClient) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Client::SignalClient(THIS, uint32 data)"); { - Client * THIS; - uint32 data = (uint32)SvUV(ST(1)); + Client *THIS; + uint32 data = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Signal(data); @@ -5715,23 +5433,21 @@ XS(XS_Client_SignalClient) } XS(XS_Client_AddAlternateCurrencyValue); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_AddAlternateCurrencyValue) -{ +XS(XS_Client_AddAlternateCurrencyValue) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Client::AddAlternateCurrencyValue(THIS, uint32 currency_id, int32 amount)"); { - Client * THIS; - uint32 currency_id = (uint32)SvUV(ST(1)); - int32 amount = (int32)SvUV(ST(2)); + Client *THIS; + uint32 currency_id = (uint32) SvUV(ST(1)); + int32 amount = (int32) SvUV(ST(2)); if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->AddAlternateCurrencyValue(currency_id, amount); @@ -5740,25 +5456,23 @@ XS(XS_Client_AddAlternateCurrencyValue) } XS(XS_Client_SendWebLink); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SendWebLink) -{ +XS(XS_Client_SendWebLink) { dXSARGS; if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: Client::SendWebLink(THIS, string website_url)"); { - Client * THIS; - char * website = nullptr; + Client *THIS; + char *website = nullptr; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - if (items > 1) { website = (char *)SvPV_nolen(ST(1)); } + if (items > 1) { website = (char *) SvPV_nolen(ST(1)); } THIS->SendWebLink(website); } @@ -5766,316 +5480,298 @@ XS(XS_Client_SendWebLink) } XS(XS_Client_GetInstanceID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetInstanceID) -{ +XS(XS_Client_GetInstanceID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Client::GetInstanceID(THIS)"); { - Client * THIS; - int8 RETVAL; + Client *THIS; + int8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetInstanceID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Client_HasSpellScribed); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_HasSpellScribed) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: Client::HasSpellScribed(THIS, int spell_id)"); - { - Client * THIS; - bool RETVAL; - int spell_id = (int)SvUV(ST(1)); +XS(XS_Client_HasSpellScribed) { + dXSARGS; + if (items != 2) + Perl_croak(aTHX_ "Usage: Client::HasSpellScribed(THIS, int spell_id)"); + { + Client *THIS; + bool RETVAL; + int spell_id = (int) SvUV(ST(1)); - if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else - Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if (sv_derived_from(ST(0), "Client")) { + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else + Perl_croak(aTHX_ "THIS is not of type Client"); + if (THIS == NULL) + Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); - RETVAL = THIS->HasSpellScribed(spell_id); - ST(0) = boolSV(RETVAL); - sv_2mortal(ST(0)); - } - XSRETURN(1); + RETVAL = THIS->HasSpellScribed(spell_id); + ST(0) = boolSV(RETVAL); + sv_2mortal(ST(0)); + } + XSRETURN(1); } XS(XS_Client_SetAccountFlag); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetAccountFlag) -{ - dXSARGS; - if (items != 3) - Perl_croak(aTHX_ "Usage: Client::SetAccountFlag(THIS, string flag, string value)"); - { - Client * THIS; - //char* flag = (char *)SvPV_nolen(ST(1)); - //char* value = (char *)SvTRUE(ST(2)); +XS(XS_Client_SetAccountFlag) { + dXSARGS; + if (items != 3) + Perl_croak(aTHX_ "Usage: Client::SetAccountFlag(THIS, string flag, string value)"); + { + Client *THIS; + //char* flag = (char *)SvPV_nolen(ST(1)); + //char* value = (char *)SvTRUE(ST(2)); - std::string flag( (char *)SvPV_nolen(ST(1)) ); - std::string value( (char *)SvTRUE(ST(2)) ); + std::string flag((char *) SvPV_nolen(ST(1))); + std::string value((char *) SvTRUE(ST(2))); - if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else - Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if (sv_derived_from(ST(0), "Client")) { + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else + Perl_croak(aTHX_ "THIS is not of type Client"); + if (THIS == NULL) + Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); - THIS->SetAccountFlag(flag, value); - } - XSRETURN_EMPTY; + THIS->SetAccountFlag(flag, value); + } + XSRETURN_EMPTY; } XS(XS_Client_GetAccountFlag); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetAccountFlag) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: Client::GetAccountFlag(THIS, string flag)"); - { - Client * THIS; - //char* flag = (char *)SvPV_nolen(ST(1)); - //char* value = (char *)SvTRUE(ST(2)); +XS(XS_Client_GetAccountFlag) { + dXSARGS; + if (items != 2) + Perl_croak(aTHX_ "Usage: Client::GetAccountFlag(THIS, string flag)"); + { + Client *THIS; + //char* flag = (char *)SvPV_nolen(ST(1)); + //char* value = (char *)SvTRUE(ST(2)); - std::string flag( (char *)SvPV_nolen(ST(1)) ); - dXSTARG; + std::string flag((char *) SvPV_nolen(ST(1))); + dXSTARG; - if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else - Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if (sv_derived_from(ST(0), "Client")) { + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else + Perl_croak(aTHX_ "THIS is not of type Client"); + if (THIS == NULL) + Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); - std::string value = THIS->GetAccountFlag(flag); + std::string value = THIS->GetAccountFlag(flag); - sv_setpv(TARG, value.c_str()); XSprePUSH; PUSHTARG; - } - XSRETURN(1); + sv_setpv(TARG, value.c_str()); + XSprePUSH; + PUSHTARG; + } + XSRETURN(1); } XS(XS_Client_GetHunger); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetHunger) -{ +XS(XS_Client_GetHunger) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: Client::GetHunger(THIS)"); - { - Client * THIS; - int32 RETVAL; - dXSTARG; + Perl_croak(aTHX_ "Usage: Client::GetHunger(THIS)"); + { + Client *THIS; + int32 RETVAL; + dXSTARG; - if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else - Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) - Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); + if (sv_derived_from(ST(0), "Client")) { + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else + Perl_croak(aTHX_ "THIS is not of type Client"); + if (THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - RETVAL = THIS->GetHunger(); - XSprePUSH; PUSHi((IV)RETVAL); - } - XSRETURN(1); + RETVAL = THIS->GetHunger(); + XSprePUSH; + PUSHi((IV) RETVAL); + } + XSRETURN(1); } XS(XS_Client_GetThirst); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetThirst) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: Client::GetThirst(THIS)"); - { - Client * THIS; - int32 RETVAL; - dXSTARG; +XS(XS_Client_GetThirst) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Client::GetThirst(THIS)"); + { + Client *THIS; + int32 RETVAL; + dXSTARG; - if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else - Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) - Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); + if (sv_derived_from(ST(0), "Client")) { + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else + Perl_croak(aTHX_ "THIS is not of type Client"); + if (THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - RETVAL = THIS->GetThirst(); - XSprePUSH; PUSHi((IV)RETVAL); - } - XSRETURN(1); + RETVAL = THIS->GetThirst(); + XSprePUSH; + PUSHi((IV) RETVAL); + } + XSRETURN(1); } XS(XS_Client_SetHunger); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetHunger) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: Client::SetHunger(THIS, in_hunger)"); - { - Client * THIS; - int32 in_hunger = (uint32)SvUV(ST(1)); +XS(XS_Client_SetHunger) { + dXSARGS; + if (items != 2) + Perl_croak(aTHX_ "Usage: Client::SetHunger(THIS, in_hunger)"); + { + Client *THIS; + int32 in_hunger = (uint32) SvUV(ST(1)); - if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else - Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) - Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); + if (sv_derived_from(ST(0), "Client")) { + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else + Perl_croak(aTHX_ "THIS is not of type Client"); + if (THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - THIS->SetHunger(in_hunger); - } - XSRETURN_EMPTY; + THIS->SetHunger(in_hunger); + } + XSRETURN_EMPTY; } XS(XS_Client_SetThirst); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetThirst) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: Client::SetThirst(THIS, int32 in_thirst)"); - { - Client * THIS; - int32 in_thirst = (uint32)SvUV(ST(1)); +XS(XS_Client_SetThirst) { + dXSARGS; + if (items != 2) + Perl_croak(aTHX_ "Usage: Client::SetThirst(THIS, int32 in_thirst)"); + { + Client *THIS; + int32 in_thirst = (uint32) SvUV(ST(1)); - if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else - Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) - Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); + if (sv_derived_from(ST(0), "Client")) { + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else + Perl_croak(aTHX_ "THIS is not of type Client"); + if (THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - THIS->SetThirst(in_thirst); - } - XSRETURN_EMPTY; + THIS->SetThirst(in_thirst); + } + XSRETURN_EMPTY; } XS(XS_Client_SendTargetCommand); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SendTargetCommand) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: Client::SendTargetCommand(THIS, int32 entity_id)"); - { - Client * THIS; - int32 in_entid = (uint32)SvUV(ST(1)); +XS(XS_Client_SendTargetCommand) { + dXSARGS; + if (items != 2) + Perl_croak(aTHX_ "Usage: Client::SendTargetCommand(THIS, int32 entity_id)"); + { + Client *THIS; + int32 in_entid = (uint32) SvUV(ST(1)); - if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else - Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) - Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); + if (sv_derived_from(ST(0), "Client")) { + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else + Perl_croak(aTHX_ "THIS is not of type Client"); + if (THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - THIS->SendTargetCommand(in_entid); - } - XSRETURN_EMPTY; + THIS->SendTargetCommand(in_entid); + } + XSRETURN_EMPTY; } XS(XS_Client_SetConsumption); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SetConsumption) -{ - dXSARGS; - if (items != 3) - Perl_croak(aTHX_ "Usage: Client::SetHunger(THIS, int32 hunger_amount, int32 thirst_amount)"); - { - Client * THIS; - int32 in_hunger = (uint32)SvUV(ST(1)); - int32 in_thirst = (uint32)SvUV(ST(2)); +XS(XS_Client_SetConsumption) { + dXSARGS; + if (items != 3) + Perl_croak(aTHX_ "Usage: Client::SetHunger(THIS, int32 hunger_amount, int32 thirst_amount)"); + { + Client *THIS; + int32 in_hunger = (uint32) SvUV(ST(1)); + int32 in_thirst = (uint32) SvUV(ST(2)); - if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else - Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) - Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); + if (sv_derived_from(ST(0), "Client")) { + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else + Perl_croak(aTHX_ "THIS is not of type Client"); + if (THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - THIS->SetConsumption(in_hunger, in_thirst); - } - XSRETURN_EMPTY; + THIS->SetConsumption(in_hunger, in_thirst); + } + XSRETURN_EMPTY; } XS(XS_Client_SilentMessage); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SilentMessage) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: Client::SilentMessage(THIS, string message)"); - { - Client * THIS; - dXSTARG; +XS(XS_Client_SilentMessage) { + dXSARGS; + if (items != 2) + Perl_croak(aTHX_ "Usage: Client::SilentMessage(THIS, string message)"); + { + Client *THIS; + dXSTARG; - if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else - Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); - if(THIS->GetTarget() != NULL){ - if(THIS->GetTarget()->IsNPC()){ - if (DistanceSquaredNoZ(THIS->GetPosition(), THIS->GetTarget()->GetPosition()) <= 200) { - if(THIS->GetTarget()->CastToNPC()->IsMoving() && !THIS->GetTarget()->CastToNPC()->IsOnHatelist(THIS->GetTarget())) - THIS->GetTarget()->CastToNPC()->PauseWandering(RuleI(NPC, SayPauseTimeInSec)); - THIS->ChannelMessageReceived(8, 0, 100, SvPV_nolen(ST(1))); - } - } - } - } - XSRETURN_EMPTY; + if (sv_derived_from(ST(0), "Client")) { + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else + Perl_croak(aTHX_ "THIS is not of type Client"); + if (THIS == NULL) + Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if (THIS->GetTarget() != NULL) { + if (THIS->GetTarget()->IsNPC()) { + if (DistanceSquaredNoZ(THIS->GetPosition(), THIS->GetTarget()->GetPosition()) <= 200) { + if (THIS->GetTarget()->CastToNPC()->IsMoving() && + !THIS->GetTarget()->CastToNPC()->IsOnHatelist(THIS->GetTarget())) + THIS->GetTarget()->CastToNPC()->PauseWandering(RuleI(NPC, SayPauseTimeInSec)); + THIS->ChannelMessageReceived(8, 0, 100, SvPV_nolen(ST(1))); + } + } + } + } + XSRETURN_EMPTY; } XS(XS_Client_PlayMP3); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_PlayMP3) -{ +XS(XS_Client_PlayMP3) { dXSARGS; if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: Client::PlayMP3(THIS, string file_name)"); { - Client * THIS; - char * fname = nullptr; + Client *THIS; + char *fname = nullptr; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - if (items > 1) { fname = (char *)SvPV_nolen(ST(1)); } + if (items > 1) { fname = (char *) SvPV_nolen(ST(1)); } THIS->PlayMP3(fname); } @@ -6083,24 +5779,22 @@ XS(XS_Client_PlayMP3) } XS(XS_Client_ExpeditionMessage); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_ExpeditionMessage) -{ +XS(XS_Client_ExpeditionMessage) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Client::ExpeditionMessage(THIS, int expedition_id, string message)"); { - Client * THIS; - int ExpdID = (int)SvUV(ST(1)); - const char * Message = (const char *)SvPV_nolen(ST(2)); + Client *THIS; + int ExpdID = (int) SvUV(ST(1)); + const char *Message = (const char *) SvPV_nolen(ST(2)); dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) + if (THIS == NULL) Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); THIS->ExpeditionSay(Message, ExpdID); @@ -6111,28 +5805,27 @@ XS(XS_Client_ExpeditionMessage) //Client::SendMarqueeMessage(uint32 type, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, std::string msg) XS(XS_Client_SendMarqueeMessage); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SendMarqueeMessage) -{ +XS(XS_Client_SendMarqueeMessage) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ "Usage: Client::SendMarqueeMessage(THIS, uint32 type, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, string msg)"); + Perl_croak(aTHX_ + "Usage: Client::SendMarqueeMessage(THIS, uint32 type, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, string msg)"); { - Client * THIS; - uint32 type = (uint32)SvUV(ST(1)); - uint32 priority = (uint32)SvUV(ST(2)); - uint32 fade_in = (uint32)SvUV(ST(3)); - uint32 fade_out = (uint32)SvUV(ST(4)); - uint32 duration = (uint32)SvUV(ST(5)); - std::string msg = (std::string)SvPV_nolen(ST(6)); + Client *THIS; + uint32 type = (uint32) SvUV(ST(1)); + uint32 priority = (uint32) SvUV(ST(2)); + uint32 fade_in = (uint32) SvUV(ST(3)); + uint32 fade_out = (uint32) SvUV(ST(4)); + uint32 duration = (uint32) SvUV(ST(5)); + std::string msg = (std::string) SvPV_nolen(ST(6)); dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) + if (THIS == NULL) Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); THIS->SendMarqueeMessage(type, priority, fade_in, fade_out, duration, msg); @@ -6141,24 +5834,22 @@ XS(XS_Client_SendMarqueeMessage) } XS(XS_Client_SendColoredText); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SendColoredText) -{ +XS(XS_Client_SendColoredText) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Client::SendColoredText(uint32 color, string message)"); { - Client * THIS; - uint32 color = (uint32)SvUV(ST(1)); - std::string msg = (std::string)SvPV_nolen(ST(2)); + Client *THIS; + uint32 color = (uint32) SvUV(ST(1)); + std::string msg = (std::string) SvPV_nolen(ST(2)); dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) + if (THIS == NULL) Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); THIS->SendColoredText(color, msg); @@ -6167,24 +5858,22 @@ XS(XS_Client_SendColoredText) } XS(XS_Client_SendSpellAnim); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_SendSpellAnim) -{ +XS(XS_Client_SendSpellAnim) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: SendSpellAnim(uint16 target_id, uint32 spell_animation_id)"); { - Client * THIS; - uint16 targetid = (uint16)SvUV(ST(1)); - uint16 spell_id = (uint16)SvUV(ST(2)); + Client *THIS; + uint16 targetid = (uint16) SvUV(ST(1)); + uint16 spell_id = (uint16) SvUV(ST(2)); dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) + if (THIS == NULL) Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); THIS->SendSpellAnim(targetid, spell_id); @@ -6193,155 +5882,149 @@ XS(XS_Client_SendSpellAnim) } XS(XS_Client_GetTargetRingX); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetTargetRingX) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: Client::GetTargetRingX(THIS)"); - { - Client * THIS; - float RETVAL; - dXSTARG; +XS(XS_Client_GetTargetRingX) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Client::GetTargetRingX(THIS)"); + { + Client *THIS; + float RETVAL; + dXSTARG; - if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else - Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) - Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); + if (sv_derived_from(ST(0), "Client")) { + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else + Perl_croak(aTHX_ "THIS is not of type Client"); + if (THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetTargetRingX(); - XSprePUSH; PUSHn((double)RETVAL); - } - XSRETURN(1); + XSprePUSH; + PUSHn((double) RETVAL); + } + XSRETURN(1); } XS(XS_Client_GetTargetRingY); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetTargetRingY) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: Client::GetTargetRingY(THIS)"); - { - Client * THIS; - float RETVAL; - dXSTARG; +XS(XS_Client_GetTargetRingY) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Client::GetTargetRingY(THIS)"); + { + Client *THIS; + float RETVAL; + dXSTARG; - if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else - Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) - Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); + if (sv_derived_from(ST(0), "Client")) { + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else + Perl_croak(aTHX_ "THIS is not of type Client"); + if (THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetTargetRingY(); - XSprePUSH; PUSHn((double)RETVAL); - } - XSRETURN(1); + XSprePUSH; + PUSHn((double) RETVAL); + } + XSRETURN(1); } XS(XS_Client_GetTargetRingZ); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_GetTargetRingZ) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: Client::GetTargetRingZ(THIS)"); - { - Client * THIS; - float RETVAL; - dXSTARG; +XS(XS_Client_GetTargetRingZ) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Client::GetTargetRingZ(THIS)"); + { + Client *THIS; + float RETVAL; + dXSTARG; - if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else - Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) - Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); + if (sv_derived_from(ST(0), "Client")) { + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else + Perl_croak(aTHX_ "THIS is not of type Client"); + if (THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetTargetRingZ(); - XSprePUSH; PUSHn((double)RETVAL); - } - XSRETURN(1); + XSprePUSH; + PUSHn((double) RETVAL); + } + XSRETURN(1); } XS(XS_Client_CalcEXP); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_CalcEXP) -{ +XS(XS_Client_CalcEXP) { dXSARGS; if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: CalcEXP(THIS, uint8 conlevel)"); { - Client * THIS; - uint8 conlevel = 0xFF; + Client *THIS; + uint8 conlevel = 0xFF; uint32 RETVAL; - if(items == 2) - conlevel = (uint16)SvUV(ST(1)); + if (items == 2) + conlevel = (uint16) SvUV(ST(1)); dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) + if (THIS == NULL) Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); RETVAL = THIS->CalcEXP(conlevel); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Client_QuestReward); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_QuestReward) -{ +XS(XS_Client_QuestReward) { dXSARGS; if (items < 1 || items > 9) - Perl_croak(aTHX_ "Usage: Client::QuestReward(THIS, int32 mob, int32 copper, int32 silver, int32 gold, int32 platinum, int32 item_id, int32 exp, [bool faction = false])"); + Perl_croak(aTHX_ + "Usage: Client::QuestReward(THIS, int32 mob, int32 copper, int32 silver, int32 gold, int32 platinum, int32 item_id, int32 exp, [bool faction = false])"); { - Client* THIS; - Mob * mob = nullptr; - int32 copper = 0; - int32 silver = 0; - int32 gold = 0; - int32 platinum = 0; - int32 itemid = 0; - int32 exp = 0; - bool faction = false; + Client *THIS; + Mob *mob = nullptr; + int32 copper = 0; + int32 silver = 0; + int32 gold = 0; + int32 platinum = 0; + int32 itemid = 0; + int32 exp = 0; + bool faction = false; if (sv_derived_from(ST(0), "THIS")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Client *, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type client"); if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - if (items > 1) { + if (items > 1) { if (sv_derived_from(ST(1), "mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); + IV tmp = SvIV((SV *) SvRV(ST(1))); mob = INT2PTR(Mob *, tmp); - } - else + } else Perl_croak(aTHX_ "mob is not of type Mob"); if (mob == nullptr) Perl_croak(aTHX_ "mob is nullptr, avoiding crash."); } - if (items > 2) { copper = (int32)SvIV(ST(2)); } - if (items > 3) { silver = (int32)SvIV(ST(3)); } - if (items > 4) { gold = (int32)SvIV(ST(4)); } - if (items > 5) { platinum = (int32)SvIV(ST(5)); } - if (items > 6) { itemid = (int32)SvIV(ST(6)); } - if (items > 7) { exp = (int32)SvIV(ST(7)); } - if (items > 8) { faction = (bool)SvIV(ST(8)); } + if (items > 2) { copper = (int32) SvIV(ST(2)); } + if (items > 3) { silver = (int32) SvIV(ST(3)); } + if (items > 4) { gold = (int32) SvIV(ST(4)); } + if (items > 5) { platinum = (int32) SvIV(ST(5)); } + if (items > 6) { itemid = (int32) SvIV(ST(6)); } + if (items > 7) { exp = (int32) SvIV(ST(7)); } + if (items > 8) { faction = (bool) SvIV(ST(8)); } THIS->QuestReward(mob, copper, silver, gold, platinum, itemid, exp, faction); } @@ -6349,30 +6032,29 @@ XS(XS_Client_QuestReward) } XS(XS_Client_GetMoney); -XS(XS_Client_GetMoney) -{ +XS(XS_Client_GetMoney) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: GetMoney(THIS, int8 type, int8 subtype)"); { - Client* THIS; + Client *THIS; uint32 RETVAL; - uint8 type = (uint8)SvUV(ST(1)); - uint8 subtype = (uint8)SvUV(ST(2)); + uint8 type = (uint8) SvUV(ST(1)); + uint8 subtype = (uint8) SvUV(ST(2)); dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - - if(THIS == nullptr) + + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMoney(type, subtype); - XSprePUSH; PUSHn((uint32)RETVAL); + XSprePUSH; + PUSHn((uint32) RETVAL); } XSRETURN(1); } @@ -6383,63 +6065,63 @@ XS(XS_Client_GetAccountAge) { if (items != 1) Perl_croak(aTHX_ "Usage: GetAccountAge(THIS)"); { - Client* THIS; + Client *THIS; int RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - - if(THIS == nullptr) + + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAccountAge(); - XSprePUSH; PUSHn((int)RETVAL); + XSprePUSH; + PUSHn((int) RETVAL); } XSRETURN(1); } XS(XS_Client_Popup2); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Client_Popup2) -{ +XS(XS_Client_Popup2) { dXSARGS; if (items < 3 || items > 10) - Perl_croak(aTHX_ "Usage: Client::SendFullPopup(THIS, string title, string text, uint32 popup_id, uint32 negative_id, uint32 buttons, uint32 duration, string button_name_0, string button_name_1, uint32 sound_controls)"); + Perl_croak(aTHX_ + "Usage: Client::SendFullPopup(THIS, string title, string text, uint32 popup_id, uint32 negative_id, uint32 buttons, uint32 duration, string button_name_0, string button_name_1, uint32 sound_controls)"); { - Client * THIS; - char* Title = (char *)SvPV_nolen(ST(1)); - char* Text = (char *)SvPV_nolen(ST(2)); - uint32 PopupID = 0; - uint32 NegativeID = 0; - uint32 Buttons = 0; - uint32 Duration = 0; - char* ButtonName0 = 0; - char* ButtonName1 = 0; - uint32 SoundControls = 0; + Client *THIS; + char *Title = (char *) SvPV_nolen(ST(1)); + char *Text = (char *) SvPV_nolen(ST(2)); + uint32 PopupID = 0; + uint32 NegativeID = 0; + uint32 Buttons = 0; + uint32 Duration = 0; + char *ButtonName0 = 0; + char *ButtonName1 = 0; + uint32 SoundControls = 0; if (sv_derived_from(ST(0), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - - if (items > 3) { PopupID = (uint32)SvUV(ST(3)); } - if (items > 4) { NegativeID = (uint32)SvUV(ST(4)); } - if (items > 5) { Buttons = (uint32)SvUV(ST(5)); } - if (items > 6) { Duration = (uint32)SvUV(ST(6)); } - if (items > 7) { ButtonName0 = (char *)SvPV_nolen(ST(7)); } - if (items > 8) { ButtonName1 = (char *)SvPV_nolen(ST(8)); } - if (items > 9) { SoundControls = (uint32)SvUV(ST(9)); } + + if (items > 3) { PopupID = (uint32) SvUV(ST(3)); } + if (items > 4) { NegativeID = (uint32) SvUV(ST(4)); } + if (items > 5) { Buttons = (uint32) SvUV(ST(5)); } + if (items > 6) { Duration = (uint32) SvUV(ST(6)); } + if (items > 7) { ButtonName0 = (char *) SvPV_nolen(ST(7)); } + if (items > 8) { ButtonName1 = (char *) SvPV_nolen(ST(8)); } + if (items > 9) { SoundControls = (uint32) SvUV(ST(9)); } - THIS->SendFullPopup(Title, Text, PopupID, NegativeID, Buttons, Duration, ButtonName0, ButtonName1, SoundControls); + THIS->SendFullPopup(Title, Text, PopupID, NegativeID, Buttons, Duration, ButtonName0, ButtonName1, + SoundControls); } XSRETURN_EMPTY; } @@ -6449,14 +6131,13 @@ XS(XS_Client_Popup2) extern "C" #endif XS(boot_Client); /* prototype to pass -Wmissing-prototypes */ -XS(boot_Client) -{ +XS(boot_Client) { dXSARGS; char file[256]; strncpy(file, __FILE__, 256); file[255] = 0; - if(items != 1) + if (items != 1) fprintf(stderr, "boot_quest does not take any arguments."); char buf[128]; @@ -6464,242 +6145,243 @@ XS(boot_Client) - XS_VERSION_BOOTCHECK ; + XS_VERSION_BOOTCHECK; - newXSproto(strcpy(buf, "SendSound"), XS_Client_SendSound, file, "$"); - newXSproto(strcpy(buf, "Save"), XS_Client_Save, file, "$$"); - newXSproto(strcpy(buf, "SaveBackup"), XS_Client_SaveBackup, file, "$"); - newXSproto(strcpy(buf, "Connected"), XS_Client_Connected, file, "$"); - newXSproto(strcpy(buf, "InZone"), XS_Client_InZone, file, "$"); - newXSproto(strcpy(buf, "Kick"), XS_Client_Kick, file, "$"); - newXSproto(strcpy(buf, "Disconnect"), XS_Client_Disconnect, file, "$"); - newXSproto(strcpy(buf, "IsLD"), XS_Client_IsLD, file, "$"); - newXSproto(strcpy(buf, "WorldKick"), XS_Client_WorldKick, file, "$"); - newXSproto(strcpy(buf, "GetAnon"), XS_Client_GetAnon, file, "$"); - newXSproto(strcpy(buf, "Duck"), XS_Client_Duck, file, "$"); - newXSproto(strcpy(buf, "Stand"), XS_Client_Stand, file, "$"); - newXSproto(strcpy(buf, "SetGM"), XS_Client_SetGM, file, "$$"); - newXSproto(strcpy(buf, "SetPVP"), XS_Client_SetPVP, file, "$$"); - newXSproto(strcpy(buf, "GetPVP"), XS_Client_GetPVP, file, "$"); - newXSproto(strcpy(buf, "GetGM"), XS_Client_GetGM, file, "$"); - newXSproto(strcpy(buf, "SetBaseClass"), XS_Client_SetBaseClass, file, "$$"); - newXSproto(strcpy(buf, "SetBaseRace"), XS_Client_SetBaseRace, file, "$$"); - newXSproto(strcpy(buf, "SetBaseGender"), XS_Client_SetBaseGender, file, "$$"); - newXSproto(strcpy(buf, "GetBaseFace"), XS_Client_GetBaseFace, file, "$"); - newXSproto(strcpy(buf, "GetLanguageSkill"), XS_Client_GetLanguageSkill, file, "$$"); - newXSproto(strcpy(buf, "GetLastName"), XS_Client_GetLastName, file, "$"); - newXSproto(strcpy(buf, "GetLDoNPointsTheme"), XS_Client_GetLDoNPointsTheme, file, "$"); - newXSproto(strcpy(buf, "GetBaseSTR"), XS_Client_GetBaseSTR, file, "$"); - newXSproto(strcpy(buf, "GetBaseSTA"), XS_Client_GetBaseSTA, file, "$"); - newXSproto(strcpy(buf, "GetBaseCHA"), XS_Client_GetBaseCHA, file, "$"); - newXSproto(strcpy(buf, "GetBaseDEX"), XS_Client_GetBaseDEX, file, "$"); - newXSproto(strcpy(buf, "GetBaseINT"), XS_Client_GetBaseINT, file, "$"); - newXSproto(strcpy(buf, "GetBaseAGI"), XS_Client_GetBaseAGI, file, "$"); - newXSproto(strcpy(buf, "GetBaseWIS"), XS_Client_GetBaseWIS, file, "$"); - newXSproto(strcpy(buf, "GetWeight"), XS_Client_GetWeight, file, "$"); - newXSproto(strcpy(buf, "GetEXP"), XS_Client_GetEXP, file, "$"); - newXSproto(strcpy(buf, "GetAAExp"), XS_Client_GetAAExp, file, "$"); - newXSproto(strcpy(buf, "GetAAPercent"), XS_Client_GetAAPercent, file, "$"); - newXSproto(strcpy(buf, "GetTotalSecondsPlayed"), XS_Client_GetTotalSecondsPlayed, file, "$"); - newXSproto(strcpy(buf, "UpdateLDoNPoints"), XS_Client_UpdateLDoNPoints, file, "$$$"); - newXSproto(strcpy(buf, "SetDeity"), XS_Client_SetDeity, file, "$$"); - newXSproto(strcpy(buf, "AddEXP"), XS_Client_AddEXP, file, "$$;$$"); - newXSproto(strcpy(buf, "SetEXP"), XS_Client_SetEXP, file, "$$$;$"); - newXSproto(strcpy(buf, "SetBindPoint"), XS_Client_SetBindPoint, file, "$;$$$$$"); - newXSproto(strcpy(buf, "GetBindX"), XS_Client_GetBindX, file, "$$"); - newXSproto(strcpy(buf, "GetBindY"), XS_Client_GetBindY, file, "$$"); - newXSproto(strcpy(buf, "GetBindZ"), XS_Client_GetBindZ, file, "$$"); - newXSproto(strcpy(buf, "GetBindHeading"), XS_Client_GetBindHeading, file, "$$"); - newXSproto(strcpy(buf, "GetBindZoneID"), XS_Client_GetBindZoneID, file, "$$"); - newXSproto(strcpy(buf, "MovePC"), XS_Client_MovePC, file, "$$$$$$"); - newXSproto(strcpy(buf, "MovePCInstance"), XS_Client_MovePCInstance, file, "$$$$$$$"); - newXSproto(strcpy(buf, "ChangeLastName"), XS_Client_ChangeLastName, file, "$$"); - newXSproto(strcpy(buf, "GetFactionLevel"), XS_Client_GetFactionLevel, file, "$$$$$$$$"); - newXSproto(strcpy(buf, "SetFactionLevel"), XS_Client_SetFactionLevel, file, "$$$$$$"); - newXSproto(strcpy(buf, "SetFactionLevel2"), XS_Client_SetFactionLevel2, file, "$$$$$$$"); - newXSproto(strcpy(buf, "GetRawItemAC"), XS_Client_GetRawItemAC, file, "$"); - newXSproto(strcpy(buf, "AccountID"), XS_Client_AccountID, file, "$"); - newXSproto(strcpy(buf, "AccountName"), XS_Client_AccountName, file, "$"); - newXSproto(strcpy(buf, "Admin"), XS_Client_Admin, file, "$"); - newXSproto(strcpy(buf, "CharacterID"), XS_Client_CharacterID, file, "$"); - newXSproto(strcpy(buf, "UpdateAdmin"), XS_Client_UpdateAdmin, file, "$;$"); - newXSproto(strcpy(buf, "UpdateWho"), XS_Client_UpdateWho, file, "$;$"); - newXSproto(strcpy(buf, "GuildRank"), XS_Client_GuildRank, file, "$"); - newXSproto(strcpy(buf, "GuildID"), XS_Client_GuildID, file, "$"); - newXSproto(strcpy(buf, "GetFace"), XS_Client_GetFace, file, "$"); - newXSproto(strcpy(buf, "TakeMoneyFromPP"), XS_Client_TakeMoneyFromPP, file, "$$;$"); - newXSproto(strcpy(buf, "AddMoneyToPP"), XS_Client_AddMoneyToPP, file, "$$$$$$"); - newXSproto(strcpy(buf, "TGB"), XS_Client_TGB, file, "$"); - newXSproto(strcpy(buf, "GetSkillPoints"), XS_Client_GetSkillPoints, file, "$"); - newXSproto(strcpy(buf, "SetSkillPoints"), XS_Client_SetSkillPoints, file, "$$"); - newXSproto(strcpy(buf, "IncreaseSkill"), XS_Client_IncreaseSkill, file, "$$;$"); - newXSproto(strcpy(buf, "IncreaseLanguageSkill"), XS_Client_IncreaseLanguageSkill, file, "$$;$"); - newXSproto(strcpy(buf, "GetSkill"), XS_Client_GetSkill, file, "$$"); - newXSproto(strcpy(buf, "GetRawSkill"), XS_Client_GetRawSkill, file, "$$"); - newXSproto(strcpy(buf, "HasSkill"), XS_Client_HasSkill, file, "$$"); - newXSproto(strcpy(buf, "CanHaveSkill"), XS_Client_CanHaveSkill, file, "$$"); - newXSproto(strcpy(buf, "SetSkill"), XS_Client_SetSkill, file, "$$$"); - newXSproto(strcpy(buf, "AddSkill"), XS_Client_AddSkill, file, "$$$"); - newXSproto(strcpy(buf, "CheckSpecializeIncrease"), XS_Client_CheckSpecializeIncrease, file, "$$"); - newXSproto(strcpy(buf, "CheckIncreaseSkill"), XS_Client_CheckIncreaseSkill, file, "$$;$"); - newXSproto(strcpy(buf, "SetLanguageSkill"), XS_Client_SetLanguageSkill, file, "$$$"); - newXSproto(strcpy(buf, "MaxSkill"), XS_Client_MaxSkill, file, "$$;$$"); - newXSproto(strcpy(buf, "GMKill"), XS_Client_GMKill, file, "$"); - newXSproto(strcpy(buf, "IsMedding"), XS_Client_IsMedding, file, "$"); - newXSproto(strcpy(buf, "GetDuelTarget"), XS_Client_GetDuelTarget, file, "$"); - newXSproto(strcpy(buf, "IsDueling"), XS_Client_IsDueling, file, "$"); - newXSproto(strcpy(buf, "SetDuelTarget"), XS_Client_SetDuelTarget, file, "$$"); - newXSproto(strcpy(buf, "SetDueling"), XS_Client_SetDueling, file, "$$"); - newXSproto(strcpy(buf, "ResetAA"), XS_Client_ResetAA, file, "$"); - newXSproto(strcpy(buf, "MemSpell"), XS_Client_MemSpell, file, "$$$;$"); - newXSproto(strcpy(buf, "UnmemSpell"), XS_Client_UnmemSpell, file, "$$;$"); - newXSproto(strcpy(buf, "UnmemSpellBySpellID"), XS_Client_UnmemSpellBySpellID, file, "$$"); - newXSproto(strcpy(buf, "UnmemSpellAll"), XS_Client_UnmemSpellAll, file, "$;$"); - newXSproto(strcpy(buf, "ScribeSpell"), XS_Client_ScribeSpell, file, "$$$;$"); - newXSproto(strcpy(buf, "UnscribeSpell"), XS_Client_UnscribeSpell, file, "$$;$"); - newXSproto(strcpy(buf, "UnscribeSpellAll"), XS_Client_UnscribeSpellAll, file, "$;$"); - newXSproto(strcpy(buf, "TrainDiscBySpellID"), XS_Client_TrainDiscBySpellID, file, "$$"); - newXSproto(strcpy(buf, "GetDiscSlotBySpellID"), XS_Client_GetDiscSlotBySpellID, file, "$$"); - newXSproto(strcpy(buf, "UntrainDisc"), XS_Client_UntrainDisc, file, "$$;$"); - newXSproto(strcpy(buf, "UntrainDiscAll"), XS_Client_UntrainDiscAll, file, "$;$"); - newXSproto(strcpy(buf, "IsSitting"), XS_Client_IsSitting, file, "$"); - newXSproto(strcpy(buf, "IsBecomeNPC"), XS_Client_IsBecomeNPC, file, "$"); - newXSproto(strcpy(buf, "GetBecomeNPCLevel"), XS_Client_GetBecomeNPCLevel, file, "$"); - newXSproto(strcpy(buf, "SetBecomeNPC"), XS_Client_SetBecomeNPC, file, "$$"); - newXSproto(strcpy(buf, "SetBecomeNPCLevel"), XS_Client_SetBecomeNPCLevel, file, "$$"); - newXSproto(strcpy(buf, "SetFeigned"), XS_Client_SetFeigned, file, "$$"); - newXSproto(strcpy(buf, "GetFeigned"), XS_Client_GetFeigned, file, "$"); - newXSproto(strcpy(buf, "AutoSplitEnabled"), XS_Client_AutoSplitEnabled, file, "$"); - newXSproto(strcpy(buf, "SetHorseId"), XS_Client_SetHorseId, file, "$$"); - newXSproto(strcpy(buf, "GetHorseId"), XS_Client_GetHorseId, file, "$"); - newXSproto(strcpy(buf, "NukeItem"), XS_Client_NukeItem, file, "$$;$"); - newXSproto(strcpy(buf, "SetTint"), XS_Client_SetTint, file, "$$$"); - newXSproto(strcpy(buf, "SetMaterial"), XS_Client_SetMaterial, file, "$$$"); - newXSproto(strcpy(buf, "Undye"), XS_Client_Undye, file, "$"); - newXSproto(strcpy(buf, "GetItemIDAt"), XS_Client_GetItemIDAt, file, "$$"); - newXSproto(strcpy(buf, "GetAugmentIDAt"), XS_Client_GetAugmentIDAt, file, "$$$"); - newXSproto(strcpy(buf, "DeleteItemInInventory"), XS_Client_DeleteItemInInventory, file, "$$;$$"); - newXSproto(strcpy(buf, "SummonItem"), XS_Client_SummonItem, file, "$$;$$$$$$$$"); - newXSproto(strcpy(buf, "SetStats"), XS_Client_SetStats, file, "$$$"); - newXSproto(strcpy(buf, "IncStats"), XS_Client_IncStats, file, "$$$"); - newXSproto(strcpy(buf, "DropItem"), XS_Client_DropItem, file, "$$"); - newXSproto(strcpy(buf, "BreakInvis"), XS_Client_BreakInvis, file, "$"); - newXSproto(strcpy(buf, "GetGroup"), XS_Client_GetGroup, file, "$"); - newXSproto(strcpy(buf, "LeaveGroup"), XS_Client_LeaveGroup, file, "$"); - newXSproto(strcpy(buf, "GetRaid"), XS_Client_GetRaid, file, "$"); - newXSproto(strcpy(buf, "IsGrouped"), XS_Client_IsGrouped, file, "$"); - newXSproto(strcpy(buf, "IsRaidGrouped"), XS_Client_IsRaidGrouped, file, "$"); - newXSproto(strcpy(buf, "Hungry"), XS_Client_Hungry, file, "$"); - newXSproto(strcpy(buf, "Thirsty"), XS_Client_Thirsty, file, "$"); - newXSproto(strcpy(buf, "GetInstrumentMod"), XS_Client_GetInstrumentMod, file, "$$"); - newXSproto(strcpy(buf, "DecreaseByID"), XS_Client_DecreaseByID, file, "$$$"); - newXSproto(strcpy(buf, "SlotConvert2"), XS_Client_SlotConvert2, file, "$$"); - newXSproto(strcpy(buf, "Escape"), XS_Client_Escape, file, "$"); - newXSproto(strcpy(buf, "RemoveNoRent"), XS_Client_RemoveNoRent, file, "$"); - newXSproto(strcpy(buf, "GoFish"), XS_Client_GoFish, file, "$"); - newXSproto(strcpy(buf, "ForageItem"), XS_Client_ForageItem, file, "$"); - newXSproto(strcpy(buf, "CalcPriceMod"), XS_Client_CalcPriceMod, file, "$;$$"); - newXSproto(strcpy(buf, "ResetTrade"), XS_Client_ResetTrade, file, "$"); - newXSproto(strcpy(buf, "UseDiscipline"), XS_Client_UseDiscipline, file, "$$$"); - newXSproto(strcpy(buf, "GetCharacterFactionLevel"), XS_Client_GetCharacterFactionLevel, file, "$$"); - newXSproto(strcpy(buf, "SetZoneFlag"), XS_Client_SetZoneFlag, file, "$$"); - newXSproto(strcpy(buf, "ClearZoneFlag"), XS_Client_ClearZoneFlag, file, "$$"); - newXSproto(strcpy(buf, "HasZoneFlag"), XS_Client_HasZoneFlag, file, "$$"); - newXSproto(strcpy(buf, "SendZoneFlagInfo"), XS_Client_SendZoneFlagInfo, file, "$$"); - newXSproto(strcpy(buf, "LoadZoneFlags"), XS_Client_LoadZoneFlags, file, "$"); - newXSproto(strcpy(buf, "SetAATitle"), XS_Client_SetAATitle, file, "$$;$"); - newXSproto(strcpy(buf, "GetClientVersion"), XS_Client_GetClientVersion, file, "$"); - newXSproto(strcpy(buf, "GetClientVersionBit"), XS_Client_GetClientVersionBit, file, "$"); - newXSproto(strcpy(buf, "SetTitleSuffix"), XS_Client_SetTitleSuffix, file, "$$;$"); - newXSproto(strcpy(buf, "SetAAPoints"), XS_Client_SetAAPoints, file, "$$"); - newXSproto(strcpy(buf, "GetAAPoints"), XS_Client_GetAAPoints, file, "$$"); - newXSproto(strcpy(buf, "GetSpentAA"), XS_Client_GetSpentAA, file, "$$"); - newXSproto(strcpy(buf, "AddAAPoints"), XS_Client_AddAAPoints, file, "$$"); - newXSproto(strcpy(buf, "RefundAA"), XS_Client_RefundAA, file, "$$"); - newXSproto(strcpy(buf, "GetModCharacterFactionLevel"), XS_Client_GetModCharacterFactionLevel, file, "$$"); - newXSproto(strcpy(buf, "GetLDoNWins"), XS_Client_GetLDoNWins, file, "$"); - newXSproto(strcpy(buf, "GetLDoNLosses"), XS_Client_GetLDoNLosses, file, "$"); - newXSproto(strcpy(buf, "GetLDoNWinsTheme"), XS_Client_GetLDoNWinsTheme, file, "$$"); - newXSproto(strcpy(buf, "GetLDoNLossesTheme"), XS_Client_GetLDoNLossesTheme, file, "$$"); - newXSproto(strcpy(buf, "GetItemAt"), XS_Client_GetItemAt, file, "$$"); - newXSproto(strcpy(buf, "GetAugmentAt"), XS_Client_GetAugmentAt, file, "$$$"); - newXSproto(strcpy(buf, "GetStartZone"), XS_Client_GetStartZone, file, "$"); - newXSproto(strcpy(buf, "SetStartZone"), XS_Client_SetStartZone, file, "$$"); - newXSproto(strcpy(buf, "KeyRingAdd"), XS_Client_KeyRingAdd, file, "$$"); - newXSproto(strcpy(buf, "KeyRingCheck"), XS_Client_KeyRingCheck, file, "$$"); - newXSproto(strcpy(buf, "AddPVPPoints"), XS_Client_AddPVPPoints, file, "$$"); - newXSproto(strcpy(buf, "AddCrystals"), XS_Client_AddCrystals, file, "$$"); - newXSproto(strcpy(buf, "GetPVPPoints"), XS_Client_GetPVPPoints, file, "$"); - newXSproto(strcpy(buf, "GetRadiantCrystals"), XS_Client_GetRadiantCrystals, file, "$"); - newXSproto(strcpy(buf, "GetEbonCrystals"), XS_Client_GetEbonCrystals, file, "$"); - newXSproto(strcpy(buf, "ReadBook"), XS_Client_ReadBook, file, "$$$"); - newXSproto(strcpy(buf, "UpdateGroupAAs"), XS_Client_UpdateGroupAAs, file, "$$$"); - newXSproto(strcpy(buf, "GetGroupPoints"), XS_Client_GetGroupPoints, file, "$"); - newXSproto(strcpy(buf, "GetRaidPoints"), XS_Client_GetRaidPoints, file, "$"); - newXSproto(strcpy(buf, "LearnRecipe"), XS_Client_LearnRecipe, file, "$$"); - newXSproto(strcpy(buf, "GetEndurance"), XS_Client_GetEndurance, file, "$"); - newXSproto(strcpy(buf, "GetMaxEndurance"), XS_Client_GetMaxEndurance, file, "$"); - newXSproto(strcpy(buf, "GetEnduranceRatio"), XS_Client_GetEnduranceRatio, file, "$"); - newXSproto(strcpy(buf, "SetEndurance"), XS_Client_SetEndurance, file, "$$"); - newXSproto(strcpy(buf, "SendOPTranslocateConfirm"), XS_Client_SendOPTranslocateConfirm, file, "$$$"); - newXSproto(strcpy(buf, "NPCSpawn"), XS_Client_NPCSpawn, file, "$$$;$"); - newXSproto(strcpy(buf, "GetIP"), XS_Client_GetIP, file, "$"); - newXSproto(strcpy(buf, "AddLevelBasedExp"), XS_Client_AddLevelBasedExp, file, "$$;$"); - newXSproto(strcpy(buf, "IncrementAA"), XS_Client_IncrementAA, file, "$$"); - newXSproto(strcpy(buf, "GrantAlternateAdvancementAbility"), XS_Client_GrantAlternateAdvancementAbility, file, "$$$;$"); - newXSproto(strcpy(buf, "GetAALevel"), XS_Client_GetAALevel, file, "$$"); - newXSproto(strcpy(buf, "MarkCompassLoc"), XS_Client_MarkCompassLoc, file, "$$$$"); - newXSproto(strcpy(buf, "ClearCompassMark"), XS_Client_ClearCompassMark, file, "$"); - newXSproto(strcpy(buf, "GetFreeSpellBookSlot"), XS_Client_GetFreeSpellBookSlot, file, "$;$"); - newXSproto(strcpy(buf, "GetSpellBookSlotBySpellID"), XS_Client_GetSpellBookSlotBySpellID, file, "$$"); - newXSproto(strcpy(buf, "UpdateTaskActivity"), XS_Client_UpdateTaskActivity, file, "$$$$;$"); - newXSproto(strcpy(buf, "AssignTask"), XS_Client_AssignTask, file, "$$$;$"); - newXSproto(strcpy(buf, "FailTask"), XS_Client_FailTask, file, "$$"); - newXSproto(strcpy(buf, "IsTaskCompleted"), XS_Client_IsTaskCompleted, file, "$$"); - newXSproto(strcpy(buf, "IsTaskActive"), XS_Client_IsTaskActive, file, "$$"); - newXSproto(strcpy(buf, "IsTaskActivityActive"), XS_Client_IsTaskActivityActive, file, "$$$"); - newXSproto(strcpy(buf, "GetTaskActivityDoneCount"), XS_Client_GetTaskActivityDoneCount, file, "$$$"); - newXSproto(strcpy(buf, "GetCorpseCount"), XS_Client_GetCorpseCount, file, "$"); - newXSproto(strcpy(buf, "GetCorpseID"), XS_Client_GetCorpseID, file, "$$"); - newXSproto(strcpy(buf, "GetCorpseItemAt"), XS_Client_GetCorpseItemAt, file, "$$$"); - newXSproto(strcpy(buf, "AssignToInstance"), XS_Client_AssignToInstance, file, "$$"); - newXSproto(strcpy(buf, "Freeze"), XS_Client_Freeze, file, "$"); - newXSproto(strcpy(buf, "UnFreeze"), XS_Client_UnFreeze, file, "$"); - newXSproto(strcpy(buf, "GetAggroCount"), XS_Client_GetAggroCount, file, "$"); - newXSproto(strcpy(buf, "GetCarriedMoney"), XS_Client_GetCarriedMoney, file, "$"); - newXSproto(strcpy(buf, "GetAllMoney"), XS_Client_GetAllMoney, file, "$"); - newXSproto(strcpy(buf, "GetItemInInventory"), XS_Client_GetItemInInventory, file, "$$"); - newXSproto(strcpy(buf, "SetCustomItemData"), XS_Client_SetCustomItemData, file, "$$$$"); - newXSproto(strcpy(buf, "GetCustomItemData"), XS_Client_GetCustomItemData, file, "$$$"); - newXSproto(strcpy(buf, "OpenLFGuildWindow"), XS_Client_OpenLFGuildWindow, file, "$"); - newXSproto(strcpy(buf, "SignalClient"), XS_Client_SignalClient, file, "$"); - newXSproto(strcpy(buf, "AddAlternateCurrencyValue"), XS_Client_AddAlternateCurrencyValue, file, "$$$"); - newXSproto(strcpy(buf, "SendWebLink"), XS_Client_SendWebLink, file, "$:$"); - newXSproto(strcpy(buf, "GetInstanceID"), XS_Client_GetInstanceID, file, "$$"); - newXSproto(strcpy(buf, "HasSpellScribed"), XS_Client_HasSkill, file, "$$"); - newXSproto(strcpy(buf, "SetAccountFlag"), XS_Client_SetAccountFlag, file, "$$"); - newXSproto(strcpy(buf, "GetAccountFlag"), XS_Client_GetAccountFlag, file, "$$"); - newXSproto(strcpy(buf, "GetHunger"), XS_Client_GetHunger, file, "$$"); - newXSproto(strcpy(buf, "GetThirst"), XS_Client_GetThirst, file, "$$"); - newXSproto(strcpy(buf, "SetHunger"), XS_Client_SetHunger, file, "$$"); - newXSproto(strcpy(buf, "SetThirst"), XS_Client_SetThirst, file, "$$"); - newXSproto(strcpy(buf, "SetConsumption"), XS_Client_SetConsumption, file, "$$$"); - newXSproto(strcpy(buf, "SilentMessage"), XS_Client_SilentMessage, file, "$$"); - newXSproto(strcpy(buf, "PlayMP3"), XS_Client_PlayMP3, file, "$;$"); - newXSproto(strcpy(buf, "SendTargetCommand"), XS_Client_SendTargetCommand, file, "$$"); - newXSproto(strcpy(buf, "ExpeditionMessage"), XS_Client_ExpeditionMessage, file, "$$$"); - newXSproto(strcpy(buf, "SendMarqueeMessage"), XS_Client_SendMarqueeMessage, file, "$$$$$$$"); - newXSproto(strcpy(buf, "SendColoredText"), XS_Client_SendColoredText, file, "$$$"); - newXSproto(strcpy(buf, "SendSpellAnim"), XS_Client_SendSpellAnim, file, "$$$"); - newXSproto(strcpy(buf, "GetTargetRingX"), XS_Client_GetTargetRingX, file, "$$"); - newXSproto(strcpy(buf, "GetTargetRingY"), XS_Client_GetTargetRingY, file, "$$"); - newXSproto(strcpy(buf, "GetTargetRingZ"), XS_Client_GetTargetRingZ, file, "$$"); - newXSproto(strcpy(buf, "QuestReward"), XS_Client_QuestReward, file, "$$;$$$$$$$"); - newXSproto(strcpy(buf, "CalcEXP"), XS_Client_CalcEXP, file, "$"); - newXSproto(strcpy(buf, "GetMoney"), XS_Client_GetMoney, file, "$$$"); - newXSproto(strcpy(buf, "GetAccountAge"), XS_Client_GetAccountAge, file, "$"); - newXSproto(strcpy(buf, "Popup2"), XS_Client_Popup2, file, "$$$;$$$$$$$"); - XSRETURN_YES; + newXSproto(strcpy(buf, "SendSound"), XS_Client_SendSound, file, "$"); + newXSproto(strcpy(buf, "Save"), XS_Client_Save, file, "$$"); + newXSproto(strcpy(buf, "SaveBackup"), XS_Client_SaveBackup, file, "$"); + newXSproto(strcpy(buf, "Connected"), XS_Client_Connected, file, "$"); + newXSproto(strcpy(buf, "InZone"), XS_Client_InZone, file, "$"); + newXSproto(strcpy(buf, "Kick"), XS_Client_Kick, file, "$"); + newXSproto(strcpy(buf, "Disconnect"), XS_Client_Disconnect, file, "$"); + newXSproto(strcpy(buf, "IsLD"), XS_Client_IsLD, file, "$"); + newXSproto(strcpy(buf, "WorldKick"), XS_Client_WorldKick, file, "$"); + newXSproto(strcpy(buf, "GetAnon"), XS_Client_GetAnon, file, "$"); + newXSproto(strcpy(buf, "Duck"), XS_Client_Duck, file, "$"); + newXSproto(strcpy(buf, "Stand"), XS_Client_Stand, file, "$"); + newXSproto(strcpy(buf, "SetGM"), XS_Client_SetGM, file, "$$"); + newXSproto(strcpy(buf, "SetPVP"), XS_Client_SetPVP, file, "$$"); + newXSproto(strcpy(buf, "GetPVP"), XS_Client_GetPVP, file, "$"); + newXSproto(strcpy(buf, "GetGM"), XS_Client_GetGM, file, "$"); + newXSproto(strcpy(buf, "SetBaseClass"), XS_Client_SetBaseClass, file, "$$"); + newXSproto(strcpy(buf, "SetBaseRace"), XS_Client_SetBaseRace, file, "$$"); + newXSproto(strcpy(buf, "SetBaseGender"), XS_Client_SetBaseGender, file, "$$"); + newXSproto(strcpy(buf, "GetBaseFace"), XS_Client_GetBaseFace, file, "$"); + newXSproto(strcpy(buf, "GetLanguageSkill"), XS_Client_GetLanguageSkill, file, "$$"); + newXSproto(strcpy(buf, "GetLastName"), XS_Client_GetLastName, file, "$"); + newXSproto(strcpy(buf, "GetLDoNPointsTheme"), XS_Client_GetLDoNPointsTheme, file, "$"); + newXSproto(strcpy(buf, "GetBaseSTR"), XS_Client_GetBaseSTR, file, "$"); + newXSproto(strcpy(buf, "GetBaseSTA"), XS_Client_GetBaseSTA, file, "$"); + newXSproto(strcpy(buf, "GetBaseCHA"), XS_Client_GetBaseCHA, file, "$"); + newXSproto(strcpy(buf, "GetBaseDEX"), XS_Client_GetBaseDEX, file, "$"); + newXSproto(strcpy(buf, "GetBaseINT"), XS_Client_GetBaseINT, file, "$"); + newXSproto(strcpy(buf, "GetBaseAGI"), XS_Client_GetBaseAGI, file, "$"); + newXSproto(strcpy(buf, "GetBaseWIS"), XS_Client_GetBaseWIS, file, "$"); + newXSproto(strcpy(buf, "GetWeight"), XS_Client_GetWeight, file, "$"); + newXSproto(strcpy(buf, "GetEXP"), XS_Client_GetEXP, file, "$"); + newXSproto(strcpy(buf, "GetAAExp"), XS_Client_GetAAExp, file, "$"); + newXSproto(strcpy(buf, "GetAAPercent"), XS_Client_GetAAPercent, file, "$"); + newXSproto(strcpy(buf, "GetTotalSecondsPlayed"), XS_Client_GetTotalSecondsPlayed, file, "$"); + newXSproto(strcpy(buf, "UpdateLDoNPoints"), XS_Client_UpdateLDoNPoints, file, "$$$"); + newXSproto(strcpy(buf, "SetDeity"), XS_Client_SetDeity, file, "$$"); + newXSproto(strcpy(buf, "AddEXP"), XS_Client_AddEXP, file, "$$;$$"); + newXSproto(strcpy(buf, "SetEXP"), XS_Client_SetEXP, file, "$$$;$"); + newXSproto(strcpy(buf, "SetBindPoint"), XS_Client_SetBindPoint, file, "$;$$$$$"); + newXSproto(strcpy(buf, "GetBindX"), XS_Client_GetBindX, file, "$$"); + newXSproto(strcpy(buf, "GetBindY"), XS_Client_GetBindY, file, "$$"); + newXSproto(strcpy(buf, "GetBindZ"), XS_Client_GetBindZ, file, "$$"); + newXSproto(strcpy(buf, "GetBindHeading"), XS_Client_GetBindHeading, file, "$$"); + newXSproto(strcpy(buf, "GetBindZoneID"), XS_Client_GetBindZoneID, file, "$$"); + newXSproto(strcpy(buf, "MovePC"), XS_Client_MovePC, file, "$$$$$$"); + newXSproto(strcpy(buf, "MovePCInstance"), XS_Client_MovePCInstance, file, "$$$$$$$"); + newXSproto(strcpy(buf, "ChangeLastName"), XS_Client_ChangeLastName, file, "$$"); + newXSproto(strcpy(buf, "GetFactionLevel"), XS_Client_GetFactionLevel, file, "$$$$$$$$"); + newXSproto(strcpy(buf, "SetFactionLevel"), XS_Client_SetFactionLevel, file, "$$$$$$"); + newXSproto(strcpy(buf, "SetFactionLevel2"), XS_Client_SetFactionLevel2, file, "$$$$$$$"); + newXSproto(strcpy(buf, "GetRawItemAC"), XS_Client_GetRawItemAC, file, "$"); + newXSproto(strcpy(buf, "AccountID"), XS_Client_AccountID, file, "$"); + newXSproto(strcpy(buf, "AccountName"), XS_Client_AccountName, file, "$"); + newXSproto(strcpy(buf, "Admin"), XS_Client_Admin, file, "$"); + newXSproto(strcpy(buf, "CharacterID"), XS_Client_CharacterID, file, "$"); + newXSproto(strcpy(buf, "UpdateAdmin"), XS_Client_UpdateAdmin, file, "$;$"); + newXSproto(strcpy(buf, "UpdateWho"), XS_Client_UpdateWho, file, "$;$"); + newXSproto(strcpy(buf, "GuildRank"), XS_Client_GuildRank, file, "$"); + newXSproto(strcpy(buf, "GuildID"), XS_Client_GuildID, file, "$"); + newXSproto(strcpy(buf, "GetFace"), XS_Client_GetFace, file, "$"); + newXSproto(strcpy(buf, "TakeMoneyFromPP"), XS_Client_TakeMoneyFromPP, file, "$$;$"); + newXSproto(strcpy(buf, "AddMoneyToPP"), XS_Client_AddMoneyToPP, file, "$$$$$$"); + newXSproto(strcpy(buf, "TGB"), XS_Client_TGB, file, "$"); + newXSproto(strcpy(buf, "GetSkillPoints"), XS_Client_GetSkillPoints, file, "$"); + newXSproto(strcpy(buf, "SetSkillPoints"), XS_Client_SetSkillPoints, file, "$$"); + newXSproto(strcpy(buf, "IncreaseSkill"), XS_Client_IncreaseSkill, file, "$$;$"); + newXSproto(strcpy(buf, "IncreaseLanguageSkill"), XS_Client_IncreaseLanguageSkill, file, "$$;$"); + newXSproto(strcpy(buf, "GetSkill"), XS_Client_GetSkill, file, "$$"); + newXSproto(strcpy(buf, "GetRawSkill"), XS_Client_GetRawSkill, file, "$$"); + newXSproto(strcpy(buf, "HasSkill"), XS_Client_HasSkill, file, "$$"); + newXSproto(strcpy(buf, "CanHaveSkill"), XS_Client_CanHaveSkill, file, "$$"); + newXSproto(strcpy(buf, "SetSkill"), XS_Client_SetSkill, file, "$$$"); + newXSproto(strcpy(buf, "AddSkill"), XS_Client_AddSkill, file, "$$$"); + newXSproto(strcpy(buf, "CheckSpecializeIncrease"), XS_Client_CheckSpecializeIncrease, file, "$$"); + newXSproto(strcpy(buf, "CheckIncreaseSkill"), XS_Client_CheckIncreaseSkill, file, "$$;$"); + newXSproto(strcpy(buf, "SetLanguageSkill"), XS_Client_SetLanguageSkill, file, "$$$"); + newXSproto(strcpy(buf, "MaxSkill"), XS_Client_MaxSkill, file, "$$;$$"); + newXSproto(strcpy(buf, "GMKill"), XS_Client_GMKill, file, "$"); + newXSproto(strcpy(buf, "IsMedding"), XS_Client_IsMedding, file, "$"); + newXSproto(strcpy(buf, "GetDuelTarget"), XS_Client_GetDuelTarget, file, "$"); + newXSproto(strcpy(buf, "IsDueling"), XS_Client_IsDueling, file, "$"); + newXSproto(strcpy(buf, "SetDuelTarget"), XS_Client_SetDuelTarget, file, "$$"); + newXSproto(strcpy(buf, "SetDueling"), XS_Client_SetDueling, file, "$$"); + newXSproto(strcpy(buf, "ResetAA"), XS_Client_ResetAA, file, "$"); + newXSproto(strcpy(buf, "MemSpell"), XS_Client_MemSpell, file, "$$$;$"); + newXSproto(strcpy(buf, "UnmemSpell"), XS_Client_UnmemSpell, file, "$$;$"); + newXSproto(strcpy(buf, "UnmemSpellBySpellID"), XS_Client_UnmemSpellBySpellID, file, "$$"); + newXSproto(strcpy(buf, "UnmemSpellAll"), XS_Client_UnmemSpellAll, file, "$;$"); + newXSproto(strcpy(buf, "ScribeSpell"), XS_Client_ScribeSpell, file, "$$$;$"); + newXSproto(strcpy(buf, "UnscribeSpell"), XS_Client_UnscribeSpell, file, "$$;$"); + newXSproto(strcpy(buf, "UnscribeSpellAll"), XS_Client_UnscribeSpellAll, file, "$;$"); + newXSproto(strcpy(buf, "TrainDiscBySpellID"), XS_Client_TrainDiscBySpellID, file, "$$"); + newXSproto(strcpy(buf, "GetDiscSlotBySpellID"), XS_Client_GetDiscSlotBySpellID, file, "$$"); + newXSproto(strcpy(buf, "UntrainDisc"), XS_Client_UntrainDisc, file, "$$;$"); + newXSproto(strcpy(buf, "UntrainDiscAll"), XS_Client_UntrainDiscAll, file, "$;$"); + newXSproto(strcpy(buf, "IsSitting"), XS_Client_IsSitting, file, "$"); + newXSproto(strcpy(buf, "IsBecomeNPC"), XS_Client_IsBecomeNPC, file, "$"); + newXSproto(strcpy(buf, "GetBecomeNPCLevel"), XS_Client_GetBecomeNPCLevel, file, "$"); + newXSproto(strcpy(buf, "SetBecomeNPC"), XS_Client_SetBecomeNPC, file, "$$"); + newXSproto(strcpy(buf, "SetBecomeNPCLevel"), XS_Client_SetBecomeNPCLevel, file, "$$"); + newXSproto(strcpy(buf, "SetFeigned"), XS_Client_SetFeigned, file, "$$"); + newXSproto(strcpy(buf, "GetFeigned"), XS_Client_GetFeigned, file, "$"); + newXSproto(strcpy(buf, "AutoSplitEnabled"), XS_Client_AutoSplitEnabled, file, "$"); + newXSproto(strcpy(buf, "SetHorseId"), XS_Client_SetHorseId, file, "$$"); + newXSproto(strcpy(buf, "GetHorseId"), XS_Client_GetHorseId, file, "$"); + newXSproto(strcpy(buf, "NukeItem"), XS_Client_NukeItem, file, "$$;$"); + newXSproto(strcpy(buf, "SetTint"), XS_Client_SetTint, file, "$$$"); + newXSproto(strcpy(buf, "SetMaterial"), XS_Client_SetMaterial, file, "$$$"); + newXSproto(strcpy(buf, "Undye"), XS_Client_Undye, file, "$"); + newXSproto(strcpy(buf, "GetItemIDAt"), XS_Client_GetItemIDAt, file, "$$"); + newXSproto(strcpy(buf, "GetAugmentIDAt"), XS_Client_GetAugmentIDAt, file, "$$$"); + newXSproto(strcpy(buf, "DeleteItemInInventory"), XS_Client_DeleteItemInInventory, file, "$$;$$"); + newXSproto(strcpy(buf, "SummonItem"), XS_Client_SummonItem, file, "$$;$$$$$$$$"); + newXSproto(strcpy(buf, "SetStats"), XS_Client_SetStats, file, "$$$"); + newXSproto(strcpy(buf, "IncStats"), XS_Client_IncStats, file, "$$$"); + newXSproto(strcpy(buf, "DropItem"), XS_Client_DropItem, file, "$$"); + newXSproto(strcpy(buf, "BreakInvis"), XS_Client_BreakInvis, file, "$"); + newXSproto(strcpy(buf, "GetGroup"), XS_Client_GetGroup, file, "$"); + newXSproto(strcpy(buf, "LeaveGroup"), XS_Client_LeaveGroup, file, "$"); + newXSproto(strcpy(buf, "GetRaid"), XS_Client_GetRaid, file, "$"); + newXSproto(strcpy(buf, "IsGrouped"), XS_Client_IsGrouped, file, "$"); + newXSproto(strcpy(buf, "IsRaidGrouped"), XS_Client_IsRaidGrouped, file, "$"); + newXSproto(strcpy(buf, "Hungry"), XS_Client_Hungry, file, "$"); + newXSproto(strcpy(buf, "Thirsty"), XS_Client_Thirsty, file, "$"); + newXSproto(strcpy(buf, "GetInstrumentMod"), XS_Client_GetInstrumentMod, file, "$$"); + newXSproto(strcpy(buf, "DecreaseByID"), XS_Client_DecreaseByID, file, "$$$"); + newXSproto(strcpy(buf, "SlotConvert2"), XS_Client_SlotConvert2, file, "$$"); + newXSproto(strcpy(buf, "Escape"), XS_Client_Escape, file, "$"); + newXSproto(strcpy(buf, "RemoveNoRent"), XS_Client_RemoveNoRent, file, "$"); + newXSproto(strcpy(buf, "GoFish"), XS_Client_GoFish, file, "$"); + newXSproto(strcpy(buf, "ForageItem"), XS_Client_ForageItem, file, "$"); + newXSproto(strcpy(buf, "CalcPriceMod"), XS_Client_CalcPriceMod, file, "$;$$"); + newXSproto(strcpy(buf, "ResetTrade"), XS_Client_ResetTrade, file, "$"); + newXSproto(strcpy(buf, "UseDiscipline"), XS_Client_UseDiscipline, file, "$$$"); + newXSproto(strcpy(buf, "GetCharacterFactionLevel"), XS_Client_GetCharacterFactionLevel, file, "$$"); + newXSproto(strcpy(buf, "SetZoneFlag"), XS_Client_SetZoneFlag, file, "$$"); + newXSproto(strcpy(buf, "ClearZoneFlag"), XS_Client_ClearZoneFlag, file, "$$"); + newXSproto(strcpy(buf, "HasZoneFlag"), XS_Client_HasZoneFlag, file, "$$"); + newXSproto(strcpy(buf, "SendZoneFlagInfo"), XS_Client_SendZoneFlagInfo, file, "$$"); + newXSproto(strcpy(buf, "LoadZoneFlags"), XS_Client_LoadZoneFlags, file, "$"); + newXSproto(strcpy(buf, "SetAATitle"), XS_Client_SetAATitle, file, "$$;$"); + newXSproto(strcpy(buf, "GetClientVersion"), XS_Client_GetClientVersion, file, "$"); + newXSproto(strcpy(buf, "GetClientVersionBit"), XS_Client_GetClientVersionBit, file, "$"); + newXSproto(strcpy(buf, "SetTitleSuffix"), XS_Client_SetTitleSuffix, file, "$$;$"); + newXSproto(strcpy(buf, "SetAAPoints"), XS_Client_SetAAPoints, file, "$$"); + newXSproto(strcpy(buf, "GetAAPoints"), XS_Client_GetAAPoints, file, "$$"); + newXSproto(strcpy(buf, "GetSpentAA"), XS_Client_GetSpentAA, file, "$$"); + newXSproto(strcpy(buf, "AddAAPoints"), XS_Client_AddAAPoints, file, "$$"); + newXSproto(strcpy(buf, "RefundAA"), XS_Client_RefundAA, file, "$$"); + newXSproto(strcpy(buf, "GetModCharacterFactionLevel"), XS_Client_GetModCharacterFactionLevel, file, "$$"); + newXSproto(strcpy(buf, "GetLDoNWins"), XS_Client_GetLDoNWins, file, "$"); + newXSproto(strcpy(buf, "GetLDoNLosses"), XS_Client_GetLDoNLosses, file, "$"); + newXSproto(strcpy(buf, "GetLDoNWinsTheme"), XS_Client_GetLDoNWinsTheme, file, "$$"); + newXSproto(strcpy(buf, "GetLDoNLossesTheme"), XS_Client_GetLDoNLossesTheme, file, "$$"); + newXSproto(strcpy(buf, "GetItemAt"), XS_Client_GetItemAt, file, "$$"); + newXSproto(strcpy(buf, "GetAugmentAt"), XS_Client_GetAugmentAt, file, "$$$"); + newXSproto(strcpy(buf, "GetStartZone"), XS_Client_GetStartZone, file, "$"); + newXSproto(strcpy(buf, "SetStartZone"), XS_Client_SetStartZone, file, "$$"); + newXSproto(strcpy(buf, "KeyRingAdd"), XS_Client_KeyRingAdd, file, "$$"); + newXSproto(strcpy(buf, "KeyRingCheck"), XS_Client_KeyRingCheck, file, "$$"); + newXSproto(strcpy(buf, "AddPVPPoints"), XS_Client_AddPVPPoints, file, "$$"); + newXSproto(strcpy(buf, "AddCrystals"), XS_Client_AddCrystals, file, "$$"); + newXSproto(strcpy(buf, "GetPVPPoints"), XS_Client_GetPVPPoints, file, "$"); + newXSproto(strcpy(buf, "GetRadiantCrystals"), XS_Client_GetRadiantCrystals, file, "$"); + newXSproto(strcpy(buf, "GetEbonCrystals"), XS_Client_GetEbonCrystals, file, "$"); + newXSproto(strcpy(buf, "ReadBook"), XS_Client_ReadBook, file, "$$$"); + newXSproto(strcpy(buf, "UpdateGroupAAs"), XS_Client_UpdateGroupAAs, file, "$$$"); + newXSproto(strcpy(buf, "GetGroupPoints"), XS_Client_GetGroupPoints, file, "$"); + newXSproto(strcpy(buf, "GetRaidPoints"), XS_Client_GetRaidPoints, file, "$"); + newXSproto(strcpy(buf, "LearnRecipe"), XS_Client_LearnRecipe, file, "$$"); + newXSproto(strcpy(buf, "GetEndurance"), XS_Client_GetEndurance, file, "$"); + newXSproto(strcpy(buf, "GetMaxEndurance"), XS_Client_GetMaxEndurance, file, "$"); + newXSproto(strcpy(buf, "GetEnduranceRatio"), XS_Client_GetEnduranceRatio, file, "$"); + newXSproto(strcpy(buf, "SetEndurance"), XS_Client_SetEndurance, file, "$$"); + newXSproto(strcpy(buf, "SendOPTranslocateConfirm"), XS_Client_SendOPTranslocateConfirm, file, "$$$"); + newXSproto(strcpy(buf, "NPCSpawn"), XS_Client_NPCSpawn, file, "$$$;$"); + newXSproto(strcpy(buf, "GetIP"), XS_Client_GetIP, file, "$"); + newXSproto(strcpy(buf, "AddLevelBasedExp"), XS_Client_AddLevelBasedExp, file, "$$;$"); + newXSproto(strcpy(buf, "IncrementAA"), XS_Client_IncrementAA, file, "$$"); + newXSproto(strcpy(buf, "GrantAlternateAdvancementAbility"), XS_Client_GrantAlternateAdvancementAbility, file, + "$$$;$"); + newXSproto(strcpy(buf, "GetAALevel"), XS_Client_GetAALevel, file, "$$"); + newXSproto(strcpy(buf, "MarkCompassLoc"), XS_Client_MarkCompassLoc, file, "$$$$"); + newXSproto(strcpy(buf, "ClearCompassMark"), XS_Client_ClearCompassMark, file, "$"); + newXSproto(strcpy(buf, "GetFreeSpellBookSlot"), XS_Client_GetFreeSpellBookSlot, file, "$;$"); + newXSproto(strcpy(buf, "GetSpellBookSlotBySpellID"), XS_Client_GetSpellBookSlotBySpellID, file, "$$"); + newXSproto(strcpy(buf, "UpdateTaskActivity"), XS_Client_UpdateTaskActivity, file, "$$$$;$"); + newXSproto(strcpy(buf, "AssignTask"), XS_Client_AssignTask, file, "$$$;$"); + newXSproto(strcpy(buf, "FailTask"), XS_Client_FailTask, file, "$$"); + newXSproto(strcpy(buf, "IsTaskCompleted"), XS_Client_IsTaskCompleted, file, "$$"); + newXSproto(strcpy(buf, "IsTaskActive"), XS_Client_IsTaskActive, file, "$$"); + newXSproto(strcpy(buf, "IsTaskActivityActive"), XS_Client_IsTaskActivityActive, file, "$$$"); + newXSproto(strcpy(buf, "GetTaskActivityDoneCount"), XS_Client_GetTaskActivityDoneCount, file, "$$$"); + newXSproto(strcpy(buf, "GetCorpseCount"), XS_Client_GetCorpseCount, file, "$"); + newXSproto(strcpy(buf, "GetCorpseID"), XS_Client_GetCorpseID, file, "$$"); + newXSproto(strcpy(buf, "GetCorpseItemAt"), XS_Client_GetCorpseItemAt, file, "$$$"); + newXSproto(strcpy(buf, "AssignToInstance"), XS_Client_AssignToInstance, file, "$$"); + newXSproto(strcpy(buf, "Freeze"), XS_Client_Freeze, file, "$"); + newXSproto(strcpy(buf, "UnFreeze"), XS_Client_UnFreeze, file, "$"); + newXSproto(strcpy(buf, "GetAggroCount"), XS_Client_GetAggroCount, file, "$"); + newXSproto(strcpy(buf, "GetCarriedMoney"), XS_Client_GetCarriedMoney, file, "$"); + newXSproto(strcpy(buf, "GetAllMoney"), XS_Client_GetAllMoney, file, "$"); + newXSproto(strcpy(buf, "GetItemInInventory"), XS_Client_GetItemInInventory, file, "$$"); + newXSproto(strcpy(buf, "SetCustomItemData"), XS_Client_SetCustomItemData, file, "$$$$"); + newXSproto(strcpy(buf, "GetCustomItemData"), XS_Client_GetCustomItemData, file, "$$$"); + newXSproto(strcpy(buf, "OpenLFGuildWindow"), XS_Client_OpenLFGuildWindow, file, "$"); + newXSproto(strcpy(buf, "SignalClient"), XS_Client_SignalClient, file, "$"); + newXSproto(strcpy(buf, "AddAlternateCurrencyValue"), XS_Client_AddAlternateCurrencyValue, file, "$$$"); + newXSproto(strcpy(buf, "SendWebLink"), XS_Client_SendWebLink, file, "$:$"); + newXSproto(strcpy(buf, "GetInstanceID"), XS_Client_GetInstanceID, file, "$$"); + newXSproto(strcpy(buf, "HasSpellScribed"), XS_Client_HasSkill, file, "$$"); + newXSproto(strcpy(buf, "SetAccountFlag"), XS_Client_SetAccountFlag, file, "$$"); + newXSproto(strcpy(buf, "GetAccountFlag"), XS_Client_GetAccountFlag, file, "$$"); + newXSproto(strcpy(buf, "GetHunger"), XS_Client_GetHunger, file, "$$"); + newXSproto(strcpy(buf, "GetThirst"), XS_Client_GetThirst, file, "$$"); + newXSproto(strcpy(buf, "SetHunger"), XS_Client_SetHunger, file, "$$"); + newXSproto(strcpy(buf, "SetThirst"), XS_Client_SetThirst, file, "$$"); + newXSproto(strcpy(buf, "SetConsumption"), XS_Client_SetConsumption, file, "$$$"); + newXSproto(strcpy(buf, "SilentMessage"), XS_Client_SilentMessage, file, "$$"); + newXSproto(strcpy(buf, "PlayMP3"), XS_Client_PlayMP3, file, "$;$"); + newXSproto(strcpy(buf, "SendTargetCommand"), XS_Client_SendTargetCommand, file, "$$"); + newXSproto(strcpy(buf, "ExpeditionMessage"), XS_Client_ExpeditionMessage, file, "$$$"); + newXSproto(strcpy(buf, "SendMarqueeMessage"), XS_Client_SendMarqueeMessage, file, "$$$$$$$"); + newXSproto(strcpy(buf, "SendColoredText"), XS_Client_SendColoredText, file, "$$$"); + newXSproto(strcpy(buf, "SendSpellAnim"), XS_Client_SendSpellAnim, file, "$$$"); + newXSproto(strcpy(buf, "GetTargetRingX"), XS_Client_GetTargetRingX, file, "$$"); + newXSproto(strcpy(buf, "GetTargetRingY"), XS_Client_GetTargetRingY, file, "$$"); + newXSproto(strcpy(buf, "GetTargetRingZ"), XS_Client_GetTargetRingZ, file, "$$"); + newXSproto(strcpy(buf, "QuestReward"), XS_Client_QuestReward, file, "$$;$$$$$$$"); + newXSproto(strcpy(buf, "CalcEXP"), XS_Client_CalcEXP, file, "$"); + newXSproto(strcpy(buf, "GetMoney"), XS_Client_GetMoney, file, "$$$"); + newXSproto(strcpy(buf, "GetAccountAge"), XS_Client_GetAccountAge, file, "$"); + newXSproto(strcpy(buf, "Popup2"), XS_Client_Popup2, file, "$$$;$$$$$$$"); + XSRETURN_YES; } #endif //EMBPERL_XS_CLASSES From 0786b1158aa8b8bea1d217bd2adc5232276a0566 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 18:16:23 -0500 Subject: [PATCH 03/33] Add initial perl-doc-parser.pl for Client --- utils/scripts/perl-doc-parser.pl | 64 ++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100755 utils/scripts/perl-doc-parser.pl diff --git a/utils/scripts/perl-doc-parser.pl b/utils/scripts/perl-doc-parser.pl new file mode 100755 index 000000000..e64ea85d6 --- /dev/null +++ b/utils/scripts/perl-doc-parser.pl @@ -0,0 +1,64 @@ +use File::Find; +use Data::Dumper; + +my @files; +my $start_dir = "zone/"; +find( + sub { push @files, $File::Find::name unless -d; }, + $start_dir +); +for my $file (@files) { + + #::: Skip non Perl files + if($file!~/perl_/i){ + next; + } + + @methods = (); + + #::: Open File + print "Opening '" . $file . "'\n"; + open (FILE, $file); + while () { + chomp; + $line = $_; + + if ($line=~/Client::/i) { + + $split_key = "Client::"; + $object_prefix = "\$client->"; + + #::: Split on croak usage + @data = split($split_key, $line); + $usage = trim($data[1]); + + #::: Split out param borders and get method name + @params_begin = split('\(', $usage); + $method_name = trim($params_begin[0]); + + #::: Get params string built + @params_end = split('\)', $params_begin[1]); + $params_string = trim($params_end[0]); + $params_string =~s/THIS\,//g; + $params_string =~s/THIS//g; + $params_string = trim($params_string); + + $method = $object_prefix . $method_name . "(" . lc($params_string) . ")\n"; + + push @methods, $method; + } + } + + @methods = sort @methods; + foreach $method (@methods) { + print $method; + } +} + +#::: Trim Whitespaces +sub trim { + my $string = $_[0]; + $string =~ s/^\s+//; + $string =~ s/\s+$//; + return $string; +} \ No newline at end of file From 1a1cce859ab76bde06f41257151582311c807165 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 19:26:50 -0500 Subject: [PATCH 04/33] Update perl_mob.cpp croak usage blocks --- zone/perl_mob.cpp | 333 +++++++++++++++++++++------------------------- 1 file changed, 148 insertions(+), 185 deletions(-) diff --git a/zone/perl_mob.cpp b/zone/perl_mob.cpp index a085309d8..82e22132a 100644 --- a/zone/perl_mob.cpp +++ b/zone/perl_mob.cpp @@ -529,7 +529,7 @@ XS(XS_Mob_BehindMob) { dXSARGS; if (items < 1 || items > 4) - Perl_croak(aTHX_ "Usage: Mob::BehindMob(THIS, other= 0, playerx= 0.0f, playery= 0.0f)"); + Perl_croak(aTHX_ "Usage: Mob::BehindMob(THIS, Mob* other = 0, [float x = 0.0f], [float y= 0.0f])"); { Mob * THIS; bool RETVAL; @@ -583,7 +583,7 @@ XS(XS_Mob_SetLevel) { dXSARGS; if (items < 2 || items > 3) - Perl_croak(aTHX_ "Usage: Mob::SetLevel(THIS, in_level, command= false)"); + Perl_croak(aTHX_ "Usage: Mob::SetLevel(THIS, uint8 in_level, [bool command = false])"); { Mob * THIS; uint8 in_level = (uint8)SvUV(ST(1)); @@ -614,7 +614,7 @@ XS(XS_Mob_GetSkill) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::GetSkill(THIS, skill_num)"); + Perl_croak(aTHX_ "Usage: Mob::GetSkill(THIS, int skill_id)"); { Mob * THIS; uint32 RETVAL; @@ -641,7 +641,7 @@ XS(XS_Mob_SendWearChange) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::SendWearChange(THIS, material_slot)"); + Perl_croak(aTHX_ "Usage: Mob::SendWearChange(THIS, uint8 material_slot)"); { Mob * THIS; uint8 material_slot = (uint8)SvUV(ST(1)); @@ -665,7 +665,7 @@ XS(XS_Mob_GetEquipment) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::GetEquipment(THIS, material_slot)"); + Perl_croak(aTHX_ "Usage: Mob::GetEquipment(THIS, uint8 material_slot)"); { Mob * THIS; int32 RETVAL; @@ -692,7 +692,7 @@ XS(XS_Mob_GetEquipmentMaterial) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::GetEquipmentMaterial(THIS, material_slot)"); + Perl_croak(aTHX_ "Usage: Mob::GetEquipmentMaterial(THIS, uint8 material_slot)"); { Mob * THIS; int32 RETVAL; @@ -719,7 +719,7 @@ XS(XS_Mob_GetEquipmentColor) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::GetEquipmentColor(THIS, material_slot)"); + Perl_croak(aTHX_ "Usage: Mob::GetEquipmentColor(THIS, uint8 material_slot)"); { Mob * THIS; int32 RETVAL; @@ -746,7 +746,7 @@ XS(XS_Mob_GetArmorTint) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::GetArmorTint(THIS, material_slot)"); + Perl_croak(aTHX_ "Usage: Mob::GetArmorTint(THIS, uint8 material_slot)"); { Mob * THIS; int32 RETVAL; @@ -845,7 +845,7 @@ XS(XS_Mob_Attack) { dXSARGS; if (items < 2 || items > 4) - Perl_croak(aTHX_ "Usage: Mob::Attack(THIS, other, Hand= 13, FromRiposte= false)"); + Perl_croak(aTHX_ "Usage: Mob::Attack(THIS, Mob* other, [int hand = 13 [prim|sec]], [bool from_riposte = false])"); { Mob * THIS; bool RETVAL; @@ -895,7 +895,7 @@ XS(XS_Mob_Damage) { dXSARGS; if (items < 5 || items > 8) - Perl_croak(aTHX_ "Usage: Mob::Damage(THIS, from, damage, spell_id, attack_skill, avoidable= true, buffslot= -1, iBuffTic= false)"); + Perl_croak(aTHX_ "Usage: Mob::Damage(THIS, Mob* from, int32 damage, uint16 spell_id, int attack_skill, [bool avoidable = true], [int8 buffslot = -1], [bool buff_tic = false])"); { Mob * THIS; Mob* from; @@ -952,7 +952,7 @@ XS(XS_Mob_RangedAttack) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::RangedAttack(THIS, other)"); + Perl_croak(aTHX_ "Usage: Mob::RangedAttack(THIS, Mob* other)"); { Mob * THIS; Mob* other; @@ -985,7 +985,7 @@ XS(XS_Mob_ThrowingAttack) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::ThrowingAttack(THIS, other)"); + Perl_croak(aTHX_ "Usage: Mob::ThrowingAttack(THIS, Mob* other)"); { Mob * THIS; Mob* other; @@ -1042,7 +1042,7 @@ XS(XS_Mob_HealDamage) { dXSARGS; if (items < 2 || items > 3) - Perl_croak(aTHX_ "Usage: Mob::HealDamage(THIS, amount, caster = 0)"); + Perl_croak(aTHX_ "Usage: Mob::HealDamage(THIS, int32 amount, [Mob* caster = 0])"); { Mob * THIS; int32 heal_amt = (int32)SvIV(ST(1)); @@ -1102,7 +1102,7 @@ XS(XS_Mob_GetLevelCon) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::GetLevelCon(THIS, iOtherLevel)"); + Perl_croak(aTHX_ "Usage: Mob::GetLevelCon(THIS, uint8 other_level)"); { Mob * THIS; uint32 RETVAL; @@ -1129,7 +1129,7 @@ XS(XS_Mob_SetHP) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::SetHP(THIS, hp)"); + Perl_croak(aTHX_ "Usage: Mob::SetHP(THIS, int32 hp)"); { Mob * THIS; int32 hp = (int32)SvIV(ST(1)); @@ -1153,7 +1153,7 @@ XS(XS_Mob_DoAnim) { dXSARGS; if (items < 2 || items > 3) - Perl_croak(aTHX_ "Usage: Mob::DoAnim(THIS, animnum, type=0)"); + Perl_croak(aTHX_ "Usage: Mob::DoAnim(THIS, int animation_number, [int type = 0])"); { Mob * THIS; int animnum = (int)SvIV(ST(1)); @@ -1184,7 +1184,7 @@ XS(XS_Mob_ChangeSize) { dXSARGS; if (items < 2 || items > 3) - Perl_croak(aTHX_ "Usage: Mob::ChangeSize(THIS, in_size, bNoRestriction= false)"); + Perl_croak(aTHX_ "Usage: Mob::ChangeSize(THIS, float in_size, [bool no_restriction = false])"); { Mob * THIS; float in_size = (float)SvNV(ST(1)); @@ -1215,7 +1215,7 @@ XS(XS_Mob_GMMove) { dXSARGS; if (items < 4 || items > 5) - Perl_croak(aTHX_ "Usage: Mob::GMMove(THIS, x, y, z, heading= 0.01)"); + Perl_croak(aTHX_ "Usage: Mob::GMMove(THIS, float x, float y, float z, [float heading = 0.01])"); { Mob * THIS; float x = (float)SvNV(ST(1)); @@ -1248,7 +1248,7 @@ XS(XS_Mob_SendPosUpdate) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: Mob::SendPosUpdate(THIS, iSendToSelf= 0)"); + Perl_croak(aTHX_ "Usage: Mob::SendPosUpdate(THIS, [uint8 send_to_self = 0])"); { Mob * THIS; uint8 iSendToSelf; @@ -1327,7 +1327,7 @@ XS(XS_Mob_IsInvisible) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: Mob::IsInvisible(THIS, other= 0)"); + Perl_croak(aTHX_ "Usage: Mob::IsInvisible(THIS, [Mob* other = 0])"); { Mob * THIS; bool RETVAL; @@ -1367,7 +1367,7 @@ XS(XS_Mob_SetInvisible) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::SetInvisible(THIS, state)"); + Perl_croak(aTHX_ "Usage: Mob::SetInvisible(THIS, uint8 state)"); { Mob * THIS; uint8 state = (uint8)SvUV(ST(1)); @@ -1391,7 +1391,7 @@ XS(XS_Mob_FindBuff) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::FindBuff(THIS, spellid)"); + Perl_croak(aTHX_ "Usage: Mob::FindBuff(THIS, uint16 spell_id)"); { Mob * THIS; bool RETVAL; @@ -1418,7 +1418,7 @@ XS(XS_Mob_FindType) { dXSARGS; if (items < 2 || items > 4) - Perl_croak(aTHX_ "Usage: Mob::FindType(THIS, type, bOffensive= false, threshold= 100)"); + Perl_croak(aTHX_ "Usage: Mob::FindType(THIS, uint8 type, [bool offensive = false], [uint16 threshold = 100])"); { Mob * THIS; bool RETVAL; @@ -1459,7 +1459,7 @@ XS(XS_Mob_GetBuffSlotFromType) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::GetBuffSlotFromType(THIS, type)"); + Perl_croak(aTHX_ "Usage: Mob::GetBuffSlotFromType(THIS, uint16 type)"); { Mob * THIS; int8 RETVAL; @@ -1486,7 +1486,7 @@ XS(XS_Mob_MakePet) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ "Usage: Mob::MakePet(THIS, spell_id, pettype, name=nullptr)"); + Perl_croak(aTHX_ "Usage: Mob::MakePet(THIS, uint16 spell_id, string pet_type, [string name = nullptr])"); { Mob * THIS; uint16 spell_id = (uint16)SvUV(ST(1)); @@ -1518,7 +1518,7 @@ XS(XS_Mob_MakeTempPet) { dXSARGS; if (items < 2 || items > 6) - Perl_croak(aTHX_ "Usage: Mob::MakeTempPet(THIS, spell_id, name=nullptr, duration=0, target=nullptr, sticktarg=0)"); + Perl_croak(aTHX_ "Usage: Mob::MakeTempPet(THIS, uint16 spell_id, [string name = nullptr], [uint32 duration = 0], [Mob* target = nullptr], [bool sticktarg = 0])"); { Mob * THIS; uint16 spell_id = (uint16)SvUV(ST(1)); @@ -1571,7 +1571,7 @@ XS(XS_Mob_TypesTempPet) { dXSARGS; if (items < 2 || items > 7) - Perl_croak(aTHX_ "Usage: Mob::TypesTempPet(THIS, typesid, name=nullptr, duration=0, follow=0, target=nullptr, sticktarg=0,)"); + Perl_croak(aTHX_ "Usage: Mob::TypesTempPet(THIS, uint32 type_id, [string name = nullptr], [uint32 duration = 0], [bool follow = 0], [Mob* target = nullptr], [bool stick_targ = 0])"); { Mob * THIS; uint32 typesid = (uint32)SvUV(ST(1)); @@ -3177,7 +3177,7 @@ XS(XS_Mob_GetActSpellRange) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Mob::GetActSpellRange(THIS, spell_id, range)"); + Perl_croak(aTHX_ "Usage: Mob::GetActSpellRange(THIS, uint16 spell_id, float range)"); { Mob * THIS; float RETVAL; @@ -3205,7 +3205,7 @@ XS(XS_Mob_GetActSpellDamage) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Mob::GetActSpellDamage(THIS, spell_id, value)"); + Perl_croak(aTHX_ "Usage: Mob::GetActSpellDamage(THIS, uint16 spell_id, int32 value)"); { Mob * THIS; int32 RETVAL; @@ -3233,7 +3233,7 @@ XS(XS_Mob_GetActSpellHealing) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Mob::GetActSpellHealing(THIS, spell_id, value)"); + Perl_croak(aTHX_ "Usage: Mob::GetActSpellHealing(THIS, uint16 spell_id, int32 value)"); { Mob * THIS; int32 RETVAL; @@ -3261,7 +3261,7 @@ XS(XS_Mob_GetActSpellCost) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Mob::GetActSpellCost(THIS, spell_id, cost)"); + Perl_croak(aTHX_ "Usage: Mob::GetActSpellCost(THIS, uint16 spell_id, int32 cost)"); { Mob * THIS; int32 RETVAL; @@ -3289,7 +3289,7 @@ XS(XS_Mob_GetActSpellDuration) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Mob::GetActSpellDuration(THIS, spell_id, duration)"); + Perl_croak(aTHX_ "Usage: Mob::GetActSpellDuration(THIS, uint16 spell_id, int32 duration)"); { Mob * THIS; int32 RETVAL; @@ -3317,7 +3317,7 @@ XS(XS_Mob_GetActSpellCasttime) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Mob::GetActSpellCasttime(THIS, spell_id, casttime)"); + Perl_croak(aTHX_ "Usage: Mob::GetActSpellCasttime(THIS, uint16 spell_id, uint32 cast_time)"); { Mob * THIS; int32 RETVAL; @@ -3345,7 +3345,7 @@ XS(XS_Mob_ResistSpell) { dXSARGS; if (items != 4) - Perl_croak(aTHX_ "Usage: Mob::ResistSpell(THIS, ressit_type, spell_id, caster)"); + Perl_croak(aTHX_ "Usage: Mob::ResistSpell(THIS, uint8 resist_type, uint16 spell_id, [Mob* caster = nullptr])"); { Mob * THIS; double RETVAL; @@ -3383,7 +3383,7 @@ XS(XS_Mob_GetSpecializeSkillValue) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::GetSpecializeSkillValue(THIS, spell_id)"); + Perl_croak(aTHX_ "Usage: Mob::GetSpecializeSkillValue(THIS, uint16 spell_id)"); { Mob * THIS; uint16 RETVAL; @@ -3823,7 +3823,7 @@ XS(XS_Mob_Message) { dXSARGS; if (items < 3) - Perl_croak(aTHX_ "Usage: Mob::Message(THIS, type, message, ...)"); + Perl_croak(aTHX_ "Usage: Mob::Message(THIS, uint32 emote_color_type, string message)"); { Mob * THIS; uint32 type = (uint32)SvUV(ST(1)); @@ -3848,7 +3848,7 @@ XS(XS_Mob_Message_StringID) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ "Usage: Mob::Message_StringID(THIS, type, string_id, distance= 0)"); + Perl_croak(aTHX_ "Usage: Mob::Message_StringID(THIS, uint32 emote_color_type, uint32 string_id, [uint32 distance = 0])"); { Mob * THIS; uint32 type = (uint32)SvUV(ST(1)); @@ -3880,7 +3880,7 @@ XS(XS_Mob_Say) { dXSARGS; if (items < 2) - Perl_croak(aTHX_ "Usage: Mob::Say(THIS, format, ...)"); + Perl_croak(aTHX_ "Usage: Mob::Say(THIS, string message)"); { Mob * THIS; char * format = (char *)SvPV_nolen(ST(1)); @@ -3904,7 +3904,7 @@ XS(XS_Mob_Shout) { dXSARGS; if (items < 2) - Perl_croak(aTHX_ "Usage: Mob::Shout(THIS, format, ...)"); + Perl_croak(aTHX_ "Usage: Mob::Shout(THIS, string message)"); { Mob * THIS; char * format = (char *)SvPV_nolen(ST(1)); @@ -3928,7 +3928,7 @@ XS(XS_Mob_Emote) { dXSARGS; if (items < 2) - Perl_croak(aTHX_ "Usage: Mob::Emote(THIS, format, ...)"); + Perl_croak(aTHX_ "Usage: Mob::Emote(THIS, string message)"); { Mob * THIS; char * format = (char *)SvPV_nolen(ST(1)); @@ -3952,7 +3952,7 @@ XS(XS_Mob_InterruptSpell) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: Mob::InterruptSpell(THIS, spellid= 0xFFFF)"); + Perl_croak(aTHX_ "Usage: Mob::InterruptSpell(THIS, [uint16 spell_id = 0xFFFF])"); { Mob * THIS; uint16 spellid; @@ -3982,7 +3982,7 @@ XS(XS_Mob_CastSpell) { dXSARGS; if (items < 3 || items > 7) - Perl_croak(aTHX_ "Usage: Mob::CastSpell(THIS, spell_id, target_id, slot= 22, casttime= -1, mana_cost= -1, resist_adjust = 0)"); + Perl_croak(aTHX_ "Usage: Mob::CastSpell(THIS, uint16 spell_id, uint16 target_id, [int slot = 22], [int32 cast_time = -1], [int32 mana_cost = -1], [int16 resist_adjust = 0])"); { Mob * THIS; uint16 spell_id = (uint16)SvUV(ST(1)); @@ -4041,7 +4041,7 @@ XS(XS_Mob_SpellFinished) { dXSARGS; if (items < 2 || items > 5) - Perl_croak(aTHX_ "Usage: Mob::SpellFinished(spell_id, spell_target = this, mana_cost = 0, resist_diff = 0)"); + Perl_croak(aTHX_ "Usage: Mob::SpellFinished(uint16 spell_id, [Mob* spell_target = this], [uint16 mana_cost = 0], [uint16 resist_diff = 0])"); { Mob * THIS; uint16 spell_id = (uint16)SvUV(ST(1)); @@ -4095,7 +4095,7 @@ XS(XS_Mob_IsImmuneToSpell) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Mob::IsImmuneToSpell(THIS, spell_id, caster)"); + Perl_croak(aTHX_ "Usage: Mob::IsImmuneToSpell(THIS, uint16 spell_id, [Mob* caster = nullptr])"); { Mob * THIS; bool RETVAL; @@ -4132,7 +4132,7 @@ XS(XS_Mob_BuffFadeBySpellID) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::BuffFadeBySpellID(THIS, spell_id)"); + Perl_croak(aTHX_ "Usage: Mob::BuffFadeBySpellID(THIS, uint16 spell_id)"); { Mob * THIS; uint16 spell_id = (uint16)SvUV(ST(1)); @@ -4156,7 +4156,7 @@ XS(XS_Mob_BuffFadeByEffect) { dXSARGS; if (items < 2 || items > 3) - Perl_croak(aTHX_ "Usage: Mob::BuffFadeByEffect(THIS, effectid, skipslot= -1)"); + Perl_croak(aTHX_ "Usage: Mob::BuffFadeByEffect(THIS, int effect_id, int skip_slot = -1)"); { Mob * THIS; int effectid = (int)SvIV(ST(1)); @@ -4210,7 +4210,7 @@ XS(XS_Mob_BuffFadeBySlot) { dXSARGS; if (items < 2 || items > 3) - Perl_croak(aTHX_ "Usage: Mob::BuffFadeBySlot(THIS, slot, iRecalcBonuses= true)"); + Perl_croak(aTHX_ "Usage: Mob::BuffFadeBySlot(THIS, int slot, bool recalc_bonuses = true)"); { Mob * THIS; int slot = (int)SvIV(ST(1)); @@ -4241,7 +4241,7 @@ XS(XS_Mob_CanBuffStack) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ "Usage: Mob::CanBuffStack(THIS, spellid, caster_level, iFailIfOverwrite= false)"); + Perl_croak(aTHX_ "Usage: Mob::CanBuffStack(THIS, uint16 spell_id, uint8 caster_level, [bool fail_if_overwritten = false])"); { Mob * THIS; int RETVAL; @@ -4328,7 +4328,7 @@ XS(XS_Mob_SetAppearance) { dXSARGS; if (items < 2 || items > 3) - Perl_croak(aTHX_ "Usage: Mob::SetAppearance(THIS, app, iIgnoreSelf= true)"); + Perl_croak(aTHX_ "Usage: Mob::SetAppearance(THIS, int appearance [0|1|2|3|4], [ignore_self = true])"); { Mob * THIS; EmuAppearance app = (EmuAppearance)SvUV(ST(1)); @@ -4411,7 +4411,7 @@ XS(XS_Mob_SetRunAnimSpeed) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::SetRunAnimSpeed(THIS, in)"); + Perl_croak(aTHX_ "Usage: Mob::SetRunAnimSpeed(THIS, int8 speed)"); { Mob * THIS; int8 in = (int8)SvIV(ST(1)); @@ -4435,7 +4435,7 @@ XS(XS_Mob_SetPetID) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::SetPetID(THIS, NewPetID)"); + Perl_croak(aTHX_ "Usage: Mob::SetPetID(THIS, uint16 new_pet_id)"); { Mob * THIS; uint16 NewPetID = (uint16)SvUV(ST(1)); @@ -4485,7 +4485,7 @@ XS(XS_Mob_SetOwnerID) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::SetOwnerID(THIS, NewOwnerID)"); + Perl_croak(aTHX_ "Usage: Mob::SetOwnerID(THIS, uint16 new_owner_id)"); { Mob * THIS; uint16 NewOwnerID = (uint16)SvUV(ST(1)); @@ -4587,7 +4587,7 @@ XS(XS_Mob_Stun) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::Stun(THIS, duration)"); + Perl_croak(aTHX_ "Usage: Mob::Stun(THIS, int duration)"); { Mob * THIS; int duration = (int)SvIV(ST(1)); @@ -4657,7 +4657,7 @@ XS(XS_Mob_SetInvul) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::SetInvul(THIS, invul)"); + Perl_croak(aTHX_ "Usage: Mob::SetInvul(THIS, bool set_invulnerable)"); { Mob * THIS; bool invul = (bool)SvTRUE(ST(1)); @@ -4707,7 +4707,7 @@ XS(XS_Mob_SetExtraHaste) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::SetExtraHaste(THIS, Haste)"); + Perl_croak(aTHX_ "Usage: Mob::SetExtraHaste(THIS, int haste)"); { Mob * THIS; int Haste = (int)SvIV(ST(1)); @@ -5306,7 +5306,7 @@ XS(XS_Mob_AddToHateList) { dXSARGS; if (items < 2 || items > 7) - Perl_croak(aTHX_ "Usage: Mob::AddToHateList(THIS, other, hate= 0, damage= 0, iYellForHelp= true, bFrenzy= false, iBuffTic= false)"); + Perl_croak(aTHX_ "Usage: Mob::AddToHateList(THIS, Mob* other, [int32 hate = 0], [int32 damage = 0], [bool yell_for_help = true], [bool frenzy = false], [bool buff_tic = false])"); { Mob * THIS; Mob* other; @@ -5374,7 +5374,7 @@ XS(XS_Mob_SetHate) { dXSARGS; if (items < 2 || items > 4) - Perl_croak(aTHX_ "Usage: Mob::SetHate(THIS, other, hate= 0, damage= 0)"); + Perl_croak(aTHX_ "Usage: Mob::SetHate(THIS, Mob* other, [int32 hate = 0], [int32 damage = 0])"); { Mob * THIS; Mob* other; @@ -5421,7 +5421,7 @@ XS(XS_Mob_HalveAggro) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::HalveAggro(THIS, other)"); + Perl_croak(aTHX_ "Usage: Mob::HalveAggro(THIS, Mob* other)"); { Mob * THIS; Mob * other; @@ -5454,7 +5454,7 @@ XS(XS_Mob_DoubleAggro) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::DoubleAggro(THIS, other)"); + Perl_croak(aTHX_ "Usage: Mob::DoubleAggro(THIS, Mob* other)"); { Mob * THIS; Mob * other; @@ -5487,7 +5487,7 @@ XS(XS_Mob_GetHateAmount) { dXSARGS; if (items < 2 || items > 3) - Perl_croak(aTHX_ "Usage: Mob::GetHateAmount(THIS, tmob, is_dam= false)"); + Perl_croak(aTHX_ "Usage: Mob::GetHateAmount(THIS, Mob* mob, [bool is_damage = false])"); { Mob * THIS; uint32 RETVAL; @@ -5530,7 +5530,7 @@ XS(XS_Mob_GetDamageAmount) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::GetDamageAmount(THIS, tmob)"); + Perl_croak(aTHX_ "Usage: Mob::GetDamageAmount(THIS, Mob* target_mob)"); { Mob * THIS; uint32 RETVAL; @@ -5592,7 +5592,7 @@ XS(XS_Mob_GetHateDamageTop) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::GetHateDamageTop(THIS, other)"); + Perl_croak(aTHX_ "Usage: Mob::GetHateDamageTop(THIS, Mob* other)"); { Mob * THIS; Mob * RETVAL; @@ -5702,34 +5702,31 @@ XS(XS_Mob_HateSummon) } XS(XS_Mob_FaceTarget); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_FaceTarget) -{ +XS(XS_Mob_FaceTarget) { dXSARGS; if (items < 1 || items > 3) - Perl_croak(aTHX_ "Usage: Mob::FaceTarget(THIS, MobToFace= 0)"); + Perl_croak(aTHX_ "Usage: Mob::FaceTarget(THIS, [Mob* target = 0])"); { - Mob * THIS; - Mob* MobToFace; + Mob *THIS; + Mob *MobToFace; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) MobToFace = 0; else { if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - MobToFace = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + MobToFace = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "MobToFace is not of type Mob"); - if(MobToFace == nullptr) + if (MobToFace == nullptr) Perl_croak(aTHX_ "MobToFace is nullptr, avoiding crash."); } @@ -5743,7 +5740,7 @@ XS(XS_Mob_SetHeading) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::SetHeading(THIS, iHeading)"); + Perl_croak(aTHX_ "Usage: Mob::SetHeading(THIS, float heading)"); { Mob * THIS; float iHeading = (float)SvNV(ST(1)); @@ -5790,7 +5787,7 @@ XS(XS_Mob_CheckAggro) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::CheckAggro(THIS, other)"); + Perl_croak(aTHX_ "Usage: Mob::CheckAggro(THIS, Mob* other)"); { Mob * THIS; bool RETVAL; @@ -5826,7 +5823,7 @@ XS(XS_Mob_CalculateHeadingToTarget) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Mob::CalculateHeadingToTarget(THIS, in_x, in_y)"); + Perl_croak(aTHX_ "Usage: Mob::CalculateHeadingToTarget(THIS, float x, float y)"); { Mob * THIS; int8 RETVAL; @@ -5854,7 +5851,7 @@ XS(XS_Mob_CalculateNewPosition) { dXSARGS; if (items < 5 || items > 6) - Perl_croak(aTHX_ "Usage: Mob::CalculateNewPosition(THIS, x, y, z, speed, checkZ= false)"); + Perl_croak(aTHX_ "Usage: Mob::CalculateNewPosition(THIS, float x, float y, float z, float speed, [bool check_z = false])"); { Mob * THIS; bool RETVAL; @@ -5891,7 +5888,7 @@ XS(XS_Mob_CalculateDistance) { dXSARGS; if (items != 4) - Perl_croak(aTHX_ "Usage: Mob::CalculateDistance(THIS, x, y, z)"); + Perl_croak(aTHX_ "Usage: Mob::CalculateDistance(THIS, float x, float y, float z)"); { Mob * THIS; float RETVAL; @@ -5920,7 +5917,7 @@ XS(XS_Mob_SendTo) { dXSARGS; if (items != 4) - Perl_croak(aTHX_ "Usage: Mob::SendTo(THIS, new_x, new_y, new_z)"); + Perl_croak(aTHX_ "Usage: Mob::SendTo(THIS, float new_x, float new_y, float new_z)"); { Mob * THIS; float new_x = (float)SvNV(ST(1)); @@ -5946,7 +5943,7 @@ XS(XS_Mob_SendToFixZ) { dXSARGS; if (items != 4) - Perl_croak(aTHX_ "Usage: Mob::SendToFixZ(THIS, new_x, new_y, new_z)"); + Perl_croak(aTHX_ "Usage: Mob::SendToFixZ(THIS, float new_x, float new_y, float new_z)"); { Mob * THIS; float new_x = (float)SvNV(ST(1)); @@ -5972,7 +5969,7 @@ XS(XS_Mob_NPCSpecialAttacks) { dXSARGS; if (items < 3 || items > 5) - Perl_croak(aTHX_ "Usage: Mob::NPCSpecialAttacks(THIS, parse, permtag, [reset], [remove])"); + Perl_croak(aTHX_ "Usage: Mob::NPCSpecialAttacks(THIS, string abilities_string, int perm_tag, [bool reset = true], [bool remove = true])"); { Mob * THIS; char* parse = (char *)SvPV_nolen(ST(1)); @@ -6241,7 +6238,7 @@ XS(XS_Mob_GetLevelHP) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::GetLevelHP(THIS, tlevel)"); + Perl_croak(aTHX_ "Usage: Mob::GetLevelHP(THIS, uint8 level)"); { Mob * THIS; uint32 RETVAL; @@ -6294,7 +6291,7 @@ XS(XS_Mob_CheckAggroAmount) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::CheckAggroAmount(THIS, spellid)"); + Perl_croak(aTHX_ "Usage: Mob::CheckAggroAmount(THIS, uint16 spell_id)"); { Mob * THIS; uint32 RETVAL; @@ -6321,7 +6318,7 @@ XS(XS_Mob_CheckHealAggroAmount) { dXSARGS; if (items != 2 && items != 3) - Perl_croak(aTHX_ "Usage: Mob::CheckHealAggroAmount(THIS, spellid, possible_heal_amt)"); + Perl_croak(aTHX_ "Usage: Mob::CheckHealAggroAmount(THIS, uint16 spell_id, uint32 possible_heal_amt)"); { Mob * THIS; uint32 RETVAL; @@ -6354,7 +6351,7 @@ XS(XS_Mob_GetAA) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::GetAA(THIS, rank_id)"); + Perl_croak(aTHX_ "Usage: Mob::GetAA(THIS, uint32 rank_id)"); { Mob * THIS; uint32 RETVAL; @@ -6381,7 +6378,7 @@ XS(XS_Mob_GetAAByAAID) { dXSARGS; if(items != 2) - Perl_croak(aTHX_ "Usage: Mob::GetAAByAAID(THIS, aa_id)"); + Perl_croak(aTHX_ "Usage: Mob::GetAAByAAID(THIS, uint32 aa_id)"); { Mob * THIS; uint32 RETVAL; @@ -6408,7 +6405,7 @@ XS(XS_Mob_SetAA) { dXSARGS; if(items < 3 || items > 4) - Perl_croak(aTHX_ "Usage: Mob::SetAA(THIS, aa_id, points, [charges])"); + Perl_croak(aTHX_ "Usage: Mob::SetAA(THIS, int aa_id, int points, [int charges = 0])"); { Mob * THIS; bool RETVAL; @@ -6463,7 +6460,7 @@ XS(XS_Mob_AddFeignMemory) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::AddFeignMemory(THIS, attacker)"); + Perl_croak(aTHX_ "Usage: Mob::AddFeignMemory(THIS, Client* attacker)"); { Mob * THIS; Client* attacker; @@ -6496,7 +6493,7 @@ XS(XS_Mob_RemoveFromFeignMemory) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::RemoveFromFeignMemory(THIS, attacker)"); + Perl_croak(aTHX_ "Usage: Mob::RemoveFromFeignMemory(THIS, Client* attacker)"); { Mob * THIS; Client* attacker; @@ -6552,7 +6549,7 @@ XS(XS_Mob_SetOOCRegen) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::SetOOCRegen(THIS, newoocregen)"); + Perl_croak(aTHX_ "Usage: Mob::SetOOCRegen(THIS, int32 new_ooc_regen)"); { Mob * THIS; int32 newoocregen = (int32)SvIV(ST(1)); @@ -6576,7 +6573,7 @@ XS(XS_Mob_GetEntityVariable) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::GetEntityVariable(THIS, id)"); + Perl_croak(aTHX_ "Usage: Mob::GetEntityVariable(THIS, string id)"); { Mob * THIS; Const_char * id = SvPV_nolen(ST(1)); @@ -6603,7 +6600,7 @@ XS(XS_Mob_EntityVariableExists) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::EntityVariableExists(THIS, id)"); + Perl_croak(aTHX_ "Usage: Mob::EntityVariableExists(THIS, string id)"); { Mob * THIS; Const_char * id = SvPV_nolen(ST(1)); @@ -6630,7 +6627,7 @@ XS(XS_Mob_SetEntityVariable) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Mob::SetEntityVariable(THIS, id, var)"); + Perl_croak(aTHX_ "Usage: Mob::SetEntityVariable(THIS, string id, string var)"); { Mob * THIS; Const_char * id = SvPV_nolen(ST(1)); @@ -6686,46 +6683,12 @@ XS(XS_Mob_GetHateList) XSRETURN(num_entries); } -/* - dXSARGS; - int num_mobs = 0; - if (items != 1) - Perl_croak(aTHX_ "Usage: EntityList::GetCorpseList(THIS)"); - { - EntityList *THIS; - - if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else - Perl_croak(aTHX_ "THIS is not of type EntityList"); - - if(THIS == nullptr) - Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - - std::list corpse_list = entity_list.GetCorpseList(); - std::list::iterator iter = corpse_list.begin(); - - while(iter != corpse_list.end()) - { - Corpse *entry = (*iter); - ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Corpse", (void*)entry); - XPUSHs(ST(0)); - num_mobs++; - iter++; - } - } - XSRETURN(num_mobs); -*/ - XS(XS_Mob_SignalClient); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_SignalClient) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Mob::SignalClient(THIS, client, data)"); + Perl_croak(aTHX_ "Usage: Mob::SignalClient(THIS, Client* client, uint32 data)"); { Mob * THIS; Client* client = nullptr; @@ -6759,7 +6722,7 @@ XS(XS_Mob_CombatRange) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::CombatRange(THIS, target)"); + Perl_croak(aTHX_ "Usage: Mob::CombatRange(THIS, Mob* target)"); { Mob * THIS; Mob * target = nullptr; @@ -6795,7 +6758,7 @@ XS(XS_Mob_DoSpecialAttackDamage) { dXSARGS; if (items < 4 || items > 6) - Perl_croak(aTHX_ "Usage: Mob::DoSpecialAttackDamage(THIS, target, skill, max_damage, min_damage = 1, hate_override = -1)"); + Perl_croak(aTHX_ "Usage: Mob::DoSpecialAttackDamage(THIS, Mob* target, int skill, int32 max_damage, [int32 min_damage = 1], [int32 hate_override = -11])"); { Mob * THIS; Mob* target; @@ -6842,7 +6805,7 @@ XS(XS_Mob_CheckLoS) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::CheckLoS(THIS, mob)"); + Perl_croak(aTHX_ "Usage: Mob::CheckLoS(THIS, Mob*)"); { Mob * THIS; Mob* mob; @@ -6878,7 +6841,7 @@ XS(XS_Mob_CheckLoSToLoc) { dXSARGS; if (items != 4 && items != 5) - Perl_croak(aTHX_ "Usage: Mob::CheckLoSToLoc(THIS, loc_x, loc_y, loc_z, mob_size)"); + Perl_croak(aTHX_ "Usage: Mob::CheckLoSToLoc(THIS, float x, float y, float z, float mob_size)"); { Mob * THIS; float loc_x = (float)SvNV(ST(1)); @@ -6915,7 +6878,7 @@ XS(XS_Mob_FindGroundZ) { dXSARGS; if (items != 3 && items != 4) - Perl_croak(aTHX_ "Usage: Mob::FindGroundZ(THIS, new_x, new_y, z_offset)"); + Perl_croak(aTHX_ "Usage: Mob::FindGroundZ(THIS, float x, float y, float z_offset)"); { Mob * THIS; float new_x = (float)SvNV(ST(1)); @@ -6951,7 +6914,7 @@ XS(XS_Mob_ProjectileAnim) { dXSARGS; if (items < 3 || items > 9) - Perl_croak(aTHX_ "Usage: Mob::ProjectileAnim(THIS, mob, item_id, IsArrow?, speed, angle, tilt, arc)"); + Perl_croak(aTHX_ "Usage: Mob::ProjectileAnim(THIS, Mob* mob, int item_id, [bool is_arrow = false], [float speed = 0], [float angle = 0], [float tilt = 0], [float arc = 0])"); { Mob * THIS; @@ -7011,7 +6974,7 @@ XS(XS_Mob_HasNPCSpecialAtk) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::HasNPCSpecialAtk(THIS, parse)"); + Perl_croak(aTHX_ "Usage: Mob::HasNPCSpecialAtk(THIS, string ability_string)"); { Mob * THIS; char* parse = (char *)SvPV_nolen(ST(1)); @@ -7038,7 +7001,7 @@ XS(XS_Mob_SendAppearanceEffect) { dXSARGS; if (items < 2 || items > 7) - Perl_croak(aTHX_ "Usage: Mob::SendAppearanceEffect(THIS, parm1, parm2, parm3, parm4, parm5, singleclient)"); + Perl_croak(aTHX_ "Usage: Mob::SendAppearanceEffect(THIS, int32 param_1, [int32 param_2 = 0], [int32 param_3 = 0], [int32 param_4 = 0], [int32 param_5 = 0], [Client* single_client_to_send_to = null])"); { Mob * THIS; int32 parm1 = (int32)SvIV(ST(1)); @@ -7082,7 +7045,7 @@ XS(XS_Mob_SetFlyMode) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::SetFlyMode(THIS, 0|1|2|3)"); + Perl_croak(aTHX_ "Usage: Mob::SetFlyMode(THIS, uint8 flymode[0|1|2|3])"); { Mob * THIS; uint8 flymode = (uint8)SvIV(ST(1)); @@ -7106,7 +7069,7 @@ XS(XS_Mob_SetTexture) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::SetTexture(THIS, texture)"); + Perl_croak(aTHX_ "Usage: Mob::SetTexture(THIS, int32 texture)"); { Mob * THIS; int32 texture = (int32)SvIV(ST(1)); @@ -7130,7 +7093,7 @@ XS(XS_Mob_SetRace) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::SetRace(THIS, race)"); + Perl_croak(aTHX_ "Usage: Mob::SetRace(THIS, int32 race)"); { Mob * THIS; int32 race = (int32)SvIV(ST(1)); @@ -7154,7 +7117,7 @@ XS(XS_Mob_SetGender) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::SetGender(THIS, gender)"); + Perl_croak(aTHX_ "Usage: Mob::SetGender(THIS, int32 gender)"); { Mob * THIS; int32 gender = (int32)SvIV(ST(1)); @@ -7178,7 +7141,7 @@ XS(XS_Mob_SendIllusion) { dXSARGS; if (items < 2 || items > 14) - Perl_croak(aTHX_ "Usage: Mob::SendIllusion(THIS,race,gender,texture,helmtexture,face,hairstyle,haircolor,beard,beardcolor,drakkin_heritage,drakkin_tattoo,drakkin_details,size)"); + Perl_croak(aTHX_ "Usage: Mob::SendIllusion(THIS, uint16 race, [uint8 gender = 0xFF], [uint8 texture = 0xFF], [unit8 helmtexture = 0xFF], [unit8 face = 0xFF], [unit8 hairstyle = 0xFF], [uint8 hair_color = 0xFF], [uint8 beard = 0xFF], [uint8 beard_color = 0xFF], [uint32 drakkin_heritage = 0xFFFFFFFF], [uint32 drakkin_tattoo = 0xFFFFFFFF], [uint32 drakkin_details = 0xFFFFFFFF], [float size = -1])"); { Mob * THIS; uint16 race = (uint16)SvIV(ST(1)); @@ -7228,7 +7191,7 @@ XS(XS_Mob_CameraEffect) { dXSARGS; if (items < 2 || items > 5) - Perl_croak(aTHX_ "Usage: Mob::CameraEffect(THIS, duration, intensity, singleclient, global)"); + Perl_croak(aTHX_ "Usage: Mob::CameraEffect(THIS, uint32 duration, [uint32 intensity = 0], [Client* single_client = nullptr], [bool is_world_wide = false])"); { Mob * THIS; uint32 duration = (uint32)SvUV(ST(1)); @@ -7273,7 +7236,7 @@ XS(XS_Mob_SpellEffect) { dXSARGS; if (items < 2 || items > 8) - Perl_croak(aTHX_ "Usage: Mob::SpellEffect(THIS, effect, [duration, finish_delay, zone_wide, unk20, perm_effect, client])"); + Perl_croak(aTHX_ "Usage: Mob::SpellEffect(THIS, uint32 effect, [uint32 duration = 5000], [uint32 finish_delay = 0], [bool zone_wide = false], [uint32 unk20 = 3000], [bool perm_effect = false], [Client* single_client])"); { Mob * THIS; uint32 effect = (uint32)SvUV(ST(1)); @@ -7322,7 +7285,7 @@ XS(XS_Mob_TempName) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: Mob::TempName(THIS, name)"); + Perl_croak(aTHX_ "Usage: Mob::TempName(THIS, string name)"); { Mob * THIS; char * name = nullptr; @@ -7348,7 +7311,7 @@ XS(XS_Mob_GetItemStat) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Mob::GetItemStat(THIS, itemid, stat)"); + Perl_croak(aTHX_ "Usage: Mob::GetItemStat(THIS, uint32 item_id, string stat)"); { Mob * THIS; int32 RETVAL; @@ -7376,7 +7339,7 @@ XS(XS_Mob_GetGlobal) { dXSARGS; if (items < 2) - Perl_croak(aTHX_ "Usage: GetGlobal(THIS, varname)"); + Perl_croak(aTHX_ "Usage: GetGlobal(THIS, string var_name)"); { Mob* THIS; Const_char* varname = (Const_char*)SvPV_nolen(ST(1)); @@ -7407,7 +7370,7 @@ XS(XS_Mob_SetGlobal) { dXSARGS; if (items < 5 || items > 6) - Perl_croak(aTHX_ "Usage: SetGlobal(THIS, varname, newvalue, options, duration, other=nullptr)"); + Perl_croak(aTHX_ "Usage: SetGlobal(THIS, string var_name, string new_value, int options, string duration, [Mob* other = nullptr])"); { Mob * THIS; char * varname = (char *)SvPV_nolen(ST(1)); @@ -7446,7 +7409,7 @@ XS(XS_Mob_TarGlobal) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ "Usage: TarGlobal(THIS, varname, value, duration, npcid, charid, zoneid)"); + Perl_croak(aTHX_ "Usage: TarGlobal(THIS, string var_name, string value, string duration, int npc_id, int character_id, int zone_id)"); { Mob * THIS; char * varname = (char *)SvPV_nolen(ST(1)); @@ -7475,7 +7438,7 @@ XS(XS_Mob_DelGlobal) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: DelGlobal(THIS, varname)"); + Perl_croak(aTHX_ "Usage: DelGlobal(THIS, string var_name)"); { Mob * THIS; char * varname = (char *)SvPV_nolen(ST(1)); @@ -7499,7 +7462,7 @@ XS(XS_Mob_SetSlotTint) { dXSARGS; if (items != 5) - Perl_croak(aTHX_ "Usage: Mob::SetSlotTint(THIS, material_slot, red_tint, green_tint, blue_tint)"); + Perl_croak(aTHX_ "Usage: Mob::SetSlotTint(THIS, uint8 material_slot, uint8 red_tint, uint8 green_tint, uint8 blue_tint)"); { Mob * THIS; uint8 material_slot = (uint8)SvIV(ST(1)); @@ -7526,7 +7489,7 @@ XS(XS_Mob_WearChange) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ "Usage: Mob::WearChange(THIS, material_slot, texture, [color, hero_forge_model])"); + Perl_croak(aTHX_ "Usage: Mob::WearChange(THIS, uint8 material_slot, uint16 texture, [uint32 color = 0, uint32 hero_forge_model = 0])"); { Mob * THIS; uint8 material_slot = (uint8)SvIV(ST(1)); @@ -7560,7 +7523,7 @@ XS(XS_Mob_DoKnockback) { dXSARGS; if (items != 4) - Perl_croak(aTHX_ "Usage: Mob::DoKnockback(THIS, caster, pushback, pushup)"); + Perl_croak(aTHX_ "Usage: Mob::DoKnockback(THIS, Mob* caster, uint32 push_back_amount, uint32 push_up_amount)"); { Mob * THIS; Mob * caster; @@ -7595,7 +7558,7 @@ XS(XS_Mob_RemoveNimbusEffect) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::RemoveNimbusEffect(THIS, effectid)"); + Perl_croak(aTHX_ "Usage: Mob::RemoveNimbusEffect(THIS, int32 effect_id)"); { Mob * THIS; int32 effectid = (int32)SvIV(ST(1)); @@ -7619,7 +7582,7 @@ XS(XS_Mob_SetRunning) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::SetRunning(THIS, value)"); + Perl_croak(aTHX_ "Usage: Mob::SetRunning(THIS, bool value)"); { Mob * THIS; bool value = (bool)SvTRUE(ST(1)); @@ -7670,7 +7633,7 @@ XS(XS_Mob_SetBodyType) { dXSARGS; if (items < 2 || items > 3) - Perl_croak(aTHX_ "Usage: Mob::SetBodyType(THIS, type, overwrite_orig = false)"); + Perl_croak(aTHX_ "Usage: Mob::SetBodyType(THIS, int32 type, [bool overwrite_orig = false])"); { Mob * THIS; int32 type = (int32)SvIV(ST(1)); @@ -7699,7 +7662,7 @@ XS(XS_Mob_SetDeltas) { dXSARGS; if (items != 5) - Perl_croak(aTHX_ "Usage: Mob::SetDeltas(THIS, delta_x, delta_y, delta_z, delta_h)"); + Perl_croak(aTHX_ "Usage: Mob::SetDeltas(THIS, float delta_x, float delta_y, float delta_z, float delta_h)"); { Mob * THIS; auto delta = glm::vec4((float)SvNV(ST(1)), (float)SvNV(ST(2)), (float)SvNV(ST(3)), (float)SvNV(ST(4))); @@ -7723,7 +7686,7 @@ XS(XS_Mob_SetLD) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::SetLD(THIS, value)"); + Perl_croak(aTHX_ "Usage: Mob::SetLD(THIS, bool value)"); { Mob * THIS; bool value = (bool)SvTRUE(ST(1)); @@ -7747,7 +7710,7 @@ XS(XS_Mob_SetTargetDestSteps) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::SetTargetDestSteps(THIS, target_steps)"); + Perl_croak(aTHX_ "Usage: Mob::SetTargetDestSteps(THIS, uint8 target_steps)"); { Mob * THIS; uint8 target_steps = (uint8)SvIV(ST(1)); @@ -7771,7 +7734,7 @@ XS(XS_Mob_SetTargetable) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::SetTargetable(THIS, on)"); + Perl_croak(aTHX_ "Usage: Mob::SetTargetable(THIS, bool targetable)"); { Mob * THIS; bool on = (bool)SvTRUE(ST(1)); @@ -7795,7 +7758,7 @@ XS(XS_Mob_ModSkillDmgTaken) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Mob::ModSkillDmgTaken(THIS, skill, value)"); + Perl_croak(aTHX_ "Usage: Mob::ModSkillDmgTaken(THIS, int skill, int16 value)"); { Mob * THIS; EQEmu::skills::SkillType skill_num = (EQEmu::skills::SkillType)SvUV(ST(1)); @@ -7820,7 +7783,7 @@ XS(XS_Mob_GetModSkillDmgTaken) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::GetModSkillDmgTaken(THIS, skill_num)"); + Perl_croak(aTHX_ "Usage: Mob::GetModSkillDmgTaken(THIS, int skill_id)"); { Mob * THIS; int16 RETVAL; @@ -7847,7 +7810,7 @@ XS(XS_Mob_GetSkillDmgTaken) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::GetSkillDmgTaken(THIS, skill_num)"); + Perl_croak(aTHX_ "Usage: Mob::GetSkillDmgTaken(THIS, int skill_id)"); { Mob * THIS; int32 RETVAL; @@ -7874,7 +7837,7 @@ XS(XS_Mob_SetAllowBeneficial) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::SetAllowBeneficial(THIS, value)"); + Perl_croak(aTHX_ "Usage: Mob::SetAllowBeneficial(THIS, bool value)"); { Mob * THIS; bool value = (bool)SvTRUE(ST(1)); @@ -7924,7 +7887,7 @@ XS(XS_Mob_IsBeneficialAllowed) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::IsBeneficialAllowed(THIS, target)"); + Perl_croak(aTHX_ "Usage: Mob::IsBeneficialAllowed(THIS, Mob* target)"); { dXSTARG; Mob * THIS; @@ -7961,7 +7924,7 @@ XS(XS_Mob_ModVulnerability) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Mob::ModVulnerability(THIS, resist, value)"); + Perl_croak(aTHX_ "Usage: Mob::ModVulnerability(THIS, uint8 resist, int16 value)"); { Mob * THIS; uint8 resist = (uint8)SvIV(ST(1)); @@ -7986,7 +7949,7 @@ XS(XS_Mob_GetModVulnerability) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::GetModVulnerability(THIS, resist)"); + Perl_croak(aTHX_ "Usage: Mob::GetModVulnerability(THIS, uint8 resist)"); { Mob * THIS; int32 RETVAL; @@ -8013,7 +7976,7 @@ XS(XS_Mob_DoMeleeSkillAttackDmg) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ "Usage: Mob::DoMeleeSkillAttackDmg(THIS, target, weapon_damage, skill, chance_mod, focus, CanRiposte)"); + Perl_croak(aTHX_ "Usage: Mob::DoMeleeSkillAttackDmg(THIS, Mob* target, uint16 weapon_damage, int skill, int16 chance_mod, int16 focus, uint8 can_riposte)"); { Mob * THIS; Mob* target; @@ -8051,7 +8014,7 @@ XS(XS_Mob_DoArcheryAttackDmg) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ "Usage: Mob::DoArcheryAttackDmg(THIS, target, RangeWeapon=nullptr, Ammo=nullptr, weapon_damage, chance_mod, focus)"); + Perl_croak(aTHX_ "Usage: Mob::DoArcheryAttackDmg(THIS, Mob* target, [range_weapon_item_instance = nullptr], [ammo_item_instance = nullptr], uint16 weapon_damage, int16 chance_mod, int16 focus)"); { Mob * THIS; Mob* target; @@ -8089,7 +8052,7 @@ XS(XS_Mob_DoThrowingAttackDmg) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ "Usage: Mob::DoThrowingAttackDmg(THIS, target, RangeWeapon=nullptr,item=nullptr,weapon_damage, chance_mod, focus)"); + Perl_croak(aTHX_ "Usage: Mob::DoThrowingAttackDmg(THIS, Mob* target, [range_weapon_item_instance = nullptr], [ammo_item_instance = nullptr], uint16 weapon_damage, int16 chance_mod, int16 focus)"); { Mob * THIS; Mob* target; @@ -8127,7 +8090,7 @@ XS(XS_Mob_SetDisableMelee) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::SetDisableMelee(THIS, value)"); + Perl_croak(aTHX_ "Usage: Mob::SetDisableMelee(THIS, bool value)"); { Mob * THIS; bool value = (bool)SvTRUE(ST(1)); @@ -8177,7 +8140,7 @@ XS(XS_Mob_SetFlurryChance) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::SetFlurryChance(THIS, value)"); + Perl_croak(aTHX_ "Usage: Mob::SetFlurryChance(THIS, uint8 value)"); { Mob * THIS; uint8 value = (uint8)SvIV(ST(1)); @@ -8227,7 +8190,7 @@ XS(XS_Mob_GetSpellStat) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ "Usage: Mob::GetSpellStat(THIS, itemid, stat, slot)"); + Perl_croak(aTHX_ "Usage: Mob::GetSpellStat(THIS, uint32 spell_id, string stat, uint8 slot)"); { Mob * THIS; int32 RETVAL; @@ -8259,7 +8222,7 @@ XS(XS_Mob_GetSpecialAbility) { dXSARGS; if(items != 2) - Perl_croak(aTHX_ "Usage: Mob::GetSpecialAbility(THIS, special_ability)"); + Perl_croak(aTHX_ "Usage: Mob::GetSpecialAbility(THIS, int special_ability)"); { int RETVAL; Mob* THIS; @@ -8286,7 +8249,7 @@ XS(XS_Mob_GetSpecialAbilityParam) { dXSARGS; if(items != 3) - Perl_croak(aTHX_ "Usage: Mob::GetSpecialAbilityParam(THIS, special_ability, param)"); + Perl_croak(aTHX_ "Usage: Mob::GetSpecialAbilityParam(THIS, int special_ability, int param)"); { int RETVAL; Mob* THIS; @@ -8314,7 +8277,7 @@ XS(XS_Mob_SetSpecialAbility) { dXSARGS; if(items != 3) - Perl_croak(aTHX_ "Usage: Mob::SetSpecialAbility(THIS, ability, value)"); + Perl_croak(aTHX_ "Usage: Mob::SetSpecialAbility(THIS, int ability, int value)"); { Mob* THIS; int ability = SvIV(ST(1)); @@ -8339,7 +8302,7 @@ XS(XS_Mob_SetSpecialAbilityParam) { dXSARGS; if(items != 4) - Perl_croak(aTHX_ "Usage: Mob::SetSpecialAbilityParam(THIS, ability, param, value)"); + Perl_croak(aTHX_ "Usage: Mob::SetSpecialAbilityParam(THIS, int ability, int param, int value)"); { Mob* THIS; int ability = SvIV(ST(1)); @@ -8388,7 +8351,7 @@ XS(XS_Mob_ProcessSpecialAbilities) { dXSARGS; if(items != 2) - Perl_croak(aTHX_ "Usage: Mob::ProcessSpecialAbilities(THIS, str)"); + Perl_croak(aTHX_ "Usage: Mob::ProcessSpecialAbilities(THIS, string str)"); { Mob* THIS; const char *str = (const char*)SvPV_nolen(ST(1)); @@ -8412,7 +8375,7 @@ XS(XS_Mob_CanClassEquipItem) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::CanClassEquipItem(THIS, item_id)"); + Perl_croak(aTHX_ "Usage: Mob::CanClassEquipItem(THIS, uint32 item_id)"); { Mob * THIS; bool RETVAL; @@ -8771,7 +8734,7 @@ XS(XS_Mob_GetHerosForgeModel); XS(XS_Mob_GetHerosForgeModel) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::GetHerosForgeModel(THIS, material_slot)"); + Perl_croak(aTHX_ "Usage: Mob::GetHerosForgeModel(THIS, uint8 material_slot)"); { Mob* THIS; int32 RETVAL; @@ -8799,7 +8762,7 @@ XS(XS_Mob_IsEliteMaterialItem); XS(XS_Mob_IsEliteMaterialItem) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::IsEliteMaterialItem(THIS, material_slot)"); + Perl_croak(aTHX_ "Usage: Mob::IsEliteMaterialItem(THIS, uint8 material_slot)"); { Mob* THIS; uint32 RETVAL; @@ -9006,7 +8969,7 @@ XS(XS_Mob_TryMoveAlong); XS(XS_Mob_TryMoveAlong) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ "Usage: Mob::TryMoveAlong(THIS, distance, angle, send?)"); + Perl_croak(aTHX_ "Usage: Mob::TryMoveAlong(THIS, float distance, float angle, bool send)"); { Mob* THIS; float distance = (float)SvNV(ST(1)); From 214503617ebc73c7b8d26b0e932124b1a7025ddb Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 19:28:01 -0500 Subject: [PATCH 05/33] perl_mob.cpp formatting --- zone/perl_mob.cpp | 7100 +++++++++++++++++++++------------------------ 1 file changed, 3301 insertions(+), 3799 deletions(-) diff --git a/zone/perl_mob.cpp b/zone/perl_mob.cpp index 82e22132a..c295da59c 100644 --- a/zone/perl_mob.cpp +++ b/zone/perl_mob.cpp @@ -26,7 +26,9 @@ */ #include "../common/features.h" + #ifdef EMBPERL_XS_CLASSES + #include "../common/global_define.h" #include "embperl.h" @@ -46,22 +48,20 @@ typedef const char Const_char; XS(XS_Mob_IsClient); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsClient) -{ +XS(XS_Mob_IsClient) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsClient(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsClient(); @@ -72,22 +72,20 @@ XS(XS_Mob_IsClient) } XS(XS_Mob_IsNPC); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsNPC) -{ +XS(XS_Mob_IsNPC) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsNPC(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsNPC(); @@ -98,22 +96,20 @@ XS(XS_Mob_IsNPC) } XS(XS_Mob_IsMob); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsMob) -{ +XS(XS_Mob_IsMob) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsMob(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsMob(); @@ -124,22 +120,20 @@ XS(XS_Mob_IsMob) } XS(XS_Mob_IsCorpse); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsCorpse) -{ +XS(XS_Mob_IsCorpse) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsCorpse(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsCorpse(); @@ -150,22 +144,20 @@ XS(XS_Mob_IsCorpse) } XS(XS_Mob_IsPlayerCorpse); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsPlayerCorpse) -{ +XS(XS_Mob_IsPlayerCorpse) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsPlayerCorpse(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsPlayerCorpse(); @@ -176,22 +168,20 @@ XS(XS_Mob_IsPlayerCorpse) } XS(XS_Mob_IsNPCCorpse); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsNPCCorpse) -{ +XS(XS_Mob_IsNPCCorpse) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsNPCCorpse(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsNPCCorpse(); @@ -202,22 +192,20 @@ XS(XS_Mob_IsNPCCorpse) } XS(XS_Mob_IsObject); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsObject) -{ +XS(XS_Mob_IsObject) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsObject(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsObject(); @@ -228,22 +216,20 @@ XS(XS_Mob_IsObject) } XS(XS_Mob_IsDoor); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsDoor) -{ +XS(XS_Mob_IsDoor) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsDoor(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsDoor(); @@ -254,22 +240,20 @@ XS(XS_Mob_IsDoor) } XS(XS_Mob_IsTrap); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsTrap) -{ +XS(XS_Mob_IsTrap) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsTrap(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsTrap(); @@ -280,22 +264,20 @@ XS(XS_Mob_IsTrap) } XS(XS_Mob_IsBeacon); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsBeacon) -{ +XS(XS_Mob_IsBeacon) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsBeacon(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsBeacon(); @@ -306,184 +288,173 @@ XS(XS_Mob_IsBeacon) } XS(XS_Mob_CastToClient); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_CastToClient) -{ +XS(XS_Mob_CastToClient) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::CastToClient(THIS)"); { - Mob * THIS; - Client * RETVAL; + Mob *THIS; + Client *RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CastToClient(); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Client", (void*)RETVAL); + sv_setref_pv(ST(0), "Client", (void *) RETVAL); } XSRETURN(1); } XS(XS_Mob_CastToNPC); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_CastToNPC) -{ +XS(XS_Mob_CastToNPC) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::CastToNPC(THIS)"); { - Mob * THIS; - NPC * RETVAL; + Mob *THIS; + NPC *RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CastToNPC(); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "NPC", (void*)RETVAL); + sv_setref_pv(ST(0), "NPC", (void *) RETVAL); } XSRETURN(1); } XS(XS_Mob_CastToMob); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_CastToMob) -{ +XS(XS_Mob_CastToMob) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::CastToMob(THIS)"); { - Mob * THIS; - Mob * RETVAL; + Mob *THIS; + Mob *RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CastToMob(); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Mob", (void*)RETVAL); + sv_setref_pv(ST(0), "Mob", (void *) RETVAL); } XSRETURN(1); } XS(XS_Mob_CastToCorpse); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_CastToCorpse) -{ +XS(XS_Mob_CastToCorpse) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::CastToCorpse(THIS)"); { - Mob * THIS; - Corpse * RETVAL; + Mob *THIS; + Corpse *RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CastToCorpse(); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Corpse", (void*)RETVAL); + sv_setref_pv(ST(0), "Corpse", (void *) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetID) -{ +XS(XS_Mob_GetID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetID(THIS)"); { - Mob * THIS; - uint16 RETVAL; + Mob *THIS; + uint16 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetName); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetName) -{ +XS(XS_Mob_GetName) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetName(THIS)"); { - Mob * THIS; - Const_char * RETVAL; + Mob *THIS; + Const_char *RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetName(); - sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; + sv_setpv(TARG, RETVAL); + XSprePUSH; + PUSHTARG; } XSRETURN(1); } XS(XS_Mob_Depop); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_Depop) -{ +XS(XS_Mob_Depop) { dXSARGS; if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: Mob::Depop(THIS, StartSpawnTimer = true)"); { - Mob * THIS; - bool StartSpawnTimer; + Mob *THIS; + bool StartSpawnTimer; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) StartSpawnTimer = true; else { - StartSpawnTimer = (bool)SvTRUE(ST(1)); + StartSpawnTimer = (bool) SvTRUE(ST(1)); } THIS->Depop(StartSpawnTimer); @@ -492,31 +463,28 @@ XS(XS_Mob_Depop) } XS(XS_Mob_RogueAssassinate); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_RogueAssassinate) -{ +XS(XS_Mob_RogueAssassinate) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::RogueAssassinate(THIS, other)"); { - Mob * THIS; - Mob* other; + Mob *THIS; + Mob *other; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - other = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + other = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == nullptr) + if (other == nullptr) Perl_croak(aTHX_ "other is nullptr, avoiding crash."); THIS->RogueAssassinate(other); @@ -525,50 +493,47 @@ XS(XS_Mob_RogueAssassinate) } XS(XS_Mob_BehindMob); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_BehindMob) -{ +XS(XS_Mob_BehindMob) { dXSARGS; if (items < 1 || items > 4) Perl_croak(aTHX_ "Usage: Mob::BehindMob(THIS, Mob* other = 0, [float x = 0.0f], [float y= 0.0f])"); { - Mob * THIS; - bool RETVAL; - Mob* other; - float playerx; - float playery; + Mob *THIS; + bool RETVAL; + Mob *other; + float playerx; + float playery; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) other = 0; else { if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - other = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + other = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == nullptr) + if (other == nullptr) Perl_croak(aTHX_ "other is nullptr, avoiding crash."); } if (items < 3) playerx = 0.0f; else { - playerx = (float)SvNV(ST(2)); + playerx = (float) SvNV(ST(2)); } if (items < 4) playery = 0.0f; else { - playery = (float)SvNV(ST(3)); + playery = (float) SvNV(ST(3)); } RETVAL = THIS->BehindMob(other, playerx, playery); @@ -579,29 +544,27 @@ XS(XS_Mob_BehindMob) } XS(XS_Mob_SetLevel); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetLevel) -{ +XS(XS_Mob_SetLevel) { dXSARGS; if (items < 2 || items > 3) Perl_croak(aTHX_ "Usage: Mob::SetLevel(THIS, uint8 in_level, [bool command = false])"); { - Mob * THIS; - uint8 in_level = (uint8)SvUV(ST(1)); - bool command; + Mob *THIS; + uint8 in_level = (uint8) SvUV(ST(1)); + bool command; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) command = false; else { - command = (bool)SvTRUE(ST(2)); + command = (bool) SvTRUE(ST(2)); } THIS->SetLevel(in_level, command); @@ -610,49 +573,46 @@ XS(XS_Mob_SetLevel) } XS(XS_Mob_GetSkill); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetSkill) -{ +XS(XS_Mob_GetSkill) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::GetSkill(THIS, int skill_id)"); { - Mob * THIS; - uint32 RETVAL; + Mob *THIS; + uint32 RETVAL; dXSTARG; - EQEmu::skills::SkillType skill_num = (EQEmu::skills::SkillType)SvUV(ST(1)); + EQEmu::skills::SkillType skill_num = (EQEmu::skills::SkillType) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSkill(skill_num); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_SendWearChange); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SendWearChange) -{ +XS(XS_Mob_SendWearChange) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SendWearChange(THIS, uint8 material_slot)"); { - Mob * THIS; - uint8 material_slot = (uint8)SvUV(ST(1)); + Mob *THIS; + uint8 material_slot = (uint8) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SendWearChange(material_slot); @@ -661,130 +621,124 @@ XS(XS_Mob_SendWearChange) } XS(XS_Mob_GetEquipment); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetEquipment) -{ +XS(XS_Mob_GetEquipment) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::GetEquipment(THIS, uint8 material_slot)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; - uint8 material_slot = (uint8)SvUV(ST(1)); + uint8 material_slot = (uint8) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEquipment(material_slot); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetEquipmentMaterial); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetEquipmentMaterial) -{ +XS(XS_Mob_GetEquipmentMaterial) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::GetEquipmentMaterial(THIS, uint8 material_slot)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; - uint8 material_slot = (uint8)SvUV(ST(1)); + uint8 material_slot = (uint8) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEquipmentMaterial(material_slot); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetEquipmentColor); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetEquipmentColor) -{ +XS(XS_Mob_GetEquipmentColor) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::GetEquipmentColor(THIS, uint8 material_slot)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; - uint8 material_slot = (uint8)SvUV(ST(1)); + uint8 material_slot = (uint8) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEquipmentColor(material_slot); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetArmorTint); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetArmorTint) -{ +XS(XS_Mob_GetArmorTint) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::GetArmorTint(THIS, uint8 material_slot)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; - uint8 material_slot = (uint8)SvUV(ST(1)); + uint8 material_slot = (uint8) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetArmorTint(material_slot); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_IsMoving); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsMoving) -{ +XS(XS_Mob_IsMoving) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsMoving(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsMoving(); @@ -795,21 +749,19 @@ XS(XS_Mob_IsMoving) } XS(XS_Mob_GoToBind); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GoToBind) -{ +XS(XS_Mob_GoToBind) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GoToBind(THIS)"); { - Mob * THIS; + Mob *THIS; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->GoToBind(); @@ -818,21 +770,19 @@ XS(XS_Mob_GoToBind) } XS(XS_Mob_Gate); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_Gate) -{ +XS(XS_Mob_Gate) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::Gate(THIS)"); { - Mob * THIS; + Mob *THIS; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Gate(); @@ -841,46 +791,44 @@ XS(XS_Mob_Gate) } XS(XS_Mob_Attack); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_Attack) -{ +XS(XS_Mob_Attack) { dXSARGS; if (items < 2 || items > 4) - Perl_croak(aTHX_ "Usage: Mob::Attack(THIS, Mob* other, [int hand = 13 [prim|sec]], [bool from_riposte = false])"); + Perl_croak(aTHX_ + "Usage: Mob::Attack(THIS, Mob* other, [int hand = 13 [prim|sec]], [bool from_riposte = false])"); { - Mob * THIS; - bool RETVAL; - Mob* other; - int Hand; - bool FromRiposte; + Mob *THIS; + bool RETVAL; + Mob *other; + int Hand; + bool FromRiposte; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - other = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + other = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == nullptr) + if (other == nullptr) Perl_croak(aTHX_ "other is nullptr, avoiding crash."); if (items < 3) Hand = 13; else { - Hand = (int)SvIV(ST(2)); + Hand = (int) SvIV(ST(2)); } if (items < 4) FromRiposte = false; else { - FromRiposte = (bool)SvTRUE(ST(3)); + FromRiposte = (bool) SvTRUE(ST(3)); } RETVAL = THIS->Attack(other, Hand, FromRiposte); @@ -891,55 +839,53 @@ XS(XS_Mob_Attack) } XS(XS_Mob_Damage); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_Damage) -{ +XS(XS_Mob_Damage) { dXSARGS; if (items < 5 || items > 8) - Perl_croak(aTHX_ "Usage: Mob::Damage(THIS, Mob* from, int32 damage, uint16 spell_id, int attack_skill, [bool avoidable = true], [int8 buffslot = -1], [bool buff_tic = false])"); + Perl_croak(aTHX_ + "Usage: Mob::Damage(THIS, Mob* from, int32 damage, uint16 spell_id, int attack_skill, [bool avoidable = true], [int8 buffslot = -1], [bool buff_tic = false])"); { - Mob * THIS; - Mob* from; - int32 damage = (int32)SvIV(ST(2)); - uint16 spell_id = (uint16)SvUV(ST(3)); - EQEmu::skills::SkillType attack_skill = (EQEmu::skills::SkillType)SvUV(ST(4)); - bool avoidable; - int8 buffslot; - bool iBuffTic; + Mob *THIS; + Mob *from; + int32 damage = (int32) SvIV(ST(2)); + uint16 spell_id = (uint16) SvUV(ST(3)); + EQEmu::skills::SkillType attack_skill = (EQEmu::skills::SkillType) SvUV(ST(4)); + bool avoidable; + int8 buffslot; + bool iBuffTic; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - from = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + from = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "from is not of type Mob"); - if(from == nullptr) + if (from == nullptr) Perl_croak(aTHX_ "from is nullptr, avoiding crash."); if (items < 6) avoidable = true; else { - avoidable = (bool)SvTRUE(ST(5)); + avoidable = (bool) SvTRUE(ST(5)); } if (items < 7) buffslot = -1; else { - buffslot = (int8)SvIV(ST(6)); + buffslot = (int8) SvIV(ST(6)); } if (items < 8) iBuffTic = false; else { - iBuffTic = (bool)SvTRUE(ST(7)); + iBuffTic = (bool) SvTRUE(ST(7)); } THIS->Damage(from, damage, spell_id, attack_skill, avoidable, buffslot, iBuffTic); @@ -948,31 +894,28 @@ XS(XS_Mob_Damage) } XS(XS_Mob_RangedAttack); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_RangedAttack) -{ +XS(XS_Mob_RangedAttack) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::RangedAttack(THIS, Mob* other)"); { - Mob * THIS; - Mob* other; + Mob *THIS; + Mob *other; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - other = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + other = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == nullptr) + if (other == nullptr) Perl_croak(aTHX_ "other is nullptr, avoiding crash."); THIS->RangedAttack(other); @@ -981,31 +924,28 @@ XS(XS_Mob_RangedAttack) } XS(XS_Mob_ThrowingAttack); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_ThrowingAttack) -{ +XS(XS_Mob_ThrowingAttack) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::ThrowingAttack(THIS, Mob* other)"); { - Mob * THIS; - Mob* other; + Mob *THIS; + Mob *other; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - other = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + other = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == nullptr) + if (other == nullptr) Perl_croak(aTHX_ "other is nullptr, avoiding crash."); THIS->ThrowingAttack(other); @@ -1014,21 +954,19 @@ XS(XS_Mob_ThrowingAttack) } XS(XS_Mob_Heal); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_Heal) -{ +XS(XS_Mob_Heal) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::Heal(THIS)"); { - Mob * THIS; + Mob *THIS; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Heal(); @@ -1038,34 +976,30 @@ XS(XS_Mob_Heal) XS(XS_Mob_HealDamage); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_HealDamage) -{ +XS(XS_Mob_HealDamage) { dXSARGS; if (items < 2 || items > 3) Perl_croak(aTHX_ "Usage: Mob::HealDamage(THIS, int32 amount, [Mob* caster = 0])"); { - Mob * THIS; - int32 heal_amt = (int32)SvIV(ST(1)); - Mob * caster = nullptr; + Mob *THIS; + int32 heal_amt = (int32) SvIV(ST(1)); + Mob *caster = nullptr; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - if(items == 3) - { + if (items == 3) { if (sv_derived_from(ST(2), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(2))); - caster = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(2))); + caster = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "caster is not of type Mob"); - if(caster == nullptr) + if (caster == nullptr) Perl_croak(aTHX_ "caster is nullptr, avoiding crash."); } @@ -1075,21 +1009,19 @@ XS(XS_Mob_HealDamage) } XS(XS_Mob_SetMaxHP); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetMaxHP) -{ +XS(XS_Mob_SetMaxHP) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::SetMaxHP(THIS)"); { - Mob * THIS; + Mob *THIS; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetMaxHP(); @@ -1098,49 +1030,46 @@ XS(XS_Mob_SetMaxHP) } XS(XS_Mob_GetLevelCon); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetLevelCon) -{ +XS(XS_Mob_GetLevelCon) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::GetLevelCon(THIS, uint8 other_level)"); { - Mob * THIS; - uint32 RETVAL; + Mob *THIS; + uint32 RETVAL; dXSTARG; - uint8 iOtherLevel = (uint8)SvUV(ST(1)); + uint8 iOtherLevel = (uint8) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLevelCon(iOtherLevel); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_SetHP); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetHP) -{ +XS(XS_Mob_SetHP) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetHP(THIS, int32 hp)"); { - Mob * THIS; - int32 hp = (int32)SvIV(ST(1)); + Mob *THIS; + int32 hp = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetHP(hp); @@ -1149,29 +1078,27 @@ XS(XS_Mob_SetHP) } XS(XS_Mob_DoAnim); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_DoAnim) -{ +XS(XS_Mob_DoAnim) { dXSARGS; if (items < 2 || items > 3) Perl_croak(aTHX_ "Usage: Mob::DoAnim(THIS, int animation_number, [int type = 0])"); { - Mob * THIS; - int animnum = (int)SvIV(ST(1)); - int type; + Mob *THIS; + int animnum = (int) SvIV(ST(1)); + int type; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) type = 0; else { - type = (int)SvIV(ST(2)); + type = (int) SvIV(ST(2)); } THIS->DoAnim(animnum, type); @@ -1180,29 +1107,27 @@ XS(XS_Mob_DoAnim) } XS(XS_Mob_ChangeSize); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_ChangeSize) -{ +XS(XS_Mob_ChangeSize) { dXSARGS; if (items < 2 || items > 3) Perl_croak(aTHX_ "Usage: Mob::ChangeSize(THIS, float in_size, [bool no_restriction = false])"); { - Mob * THIS; - float in_size = (float)SvNV(ST(1)); - bool bNoRestriction; + Mob *THIS; + float in_size = (float) SvNV(ST(1)); + bool bNoRestriction; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) bNoRestriction = false; else { - bNoRestriction = (bool)SvTRUE(ST(2)); + bNoRestriction = (bool) SvTRUE(ST(2)); } THIS->ChangeSize(in_size, bNoRestriction); @@ -1211,31 +1136,29 @@ XS(XS_Mob_ChangeSize) } XS(XS_Mob_GMMove); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GMMove) -{ +XS(XS_Mob_GMMove) { dXSARGS; if (items < 4 || items > 5) Perl_croak(aTHX_ "Usage: Mob::GMMove(THIS, float x, float y, float z, [float heading = 0.01])"); { - Mob * THIS; - float x = (float)SvNV(ST(1)); - float y = (float)SvNV(ST(2)); - float z = (float)SvNV(ST(3)); - float heading; + Mob *THIS; + float x = (float) SvNV(ST(1)); + float y = (float) SvNV(ST(2)); + float z = (float) SvNV(ST(3)); + float heading; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 5) heading = 0.01; else { - heading = (float)SvNV(ST(4)); + heading = (float) SvNV(ST(4)); } THIS->GMMove(x, y, z, heading); @@ -1244,28 +1167,26 @@ XS(XS_Mob_GMMove) } XS(XS_Mob_SendPosUpdate); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SendPosUpdate) -{ +XS(XS_Mob_SendPosUpdate) { dXSARGS; if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: Mob::SendPosUpdate(THIS, [uint8 send_to_self = 0])"); { - Mob * THIS; - uint8 iSendToSelf; + Mob *THIS; + uint8 iSendToSelf; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) iSendToSelf = 0; else { - iSendToSelf = (uint8)SvUV(ST(1)); + iSendToSelf = (uint8) SvUV(ST(1)); } THIS->SendPositionUpdate(iSendToSelf); @@ -1274,21 +1195,19 @@ XS(XS_Mob_SendPosUpdate) } XS(XS_Mob_SendPosition); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SendPosition) -{ +XS(XS_Mob_SendPosition) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::SendPosition(THIS)"); { - Mob * THIS; + Mob *THIS; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SendPosition(); @@ -1297,22 +1216,20 @@ XS(XS_Mob_SendPosition) } XS(XS_Mob_HasProcs); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_HasProcs) -{ +XS(XS_Mob_HasProcs) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::HasProcs(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->HasProcs(); @@ -1323,35 +1240,32 @@ XS(XS_Mob_HasProcs) } XS(XS_Mob_IsInvisible); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsInvisible) -{ +XS(XS_Mob_IsInvisible) { dXSARGS; if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: Mob::IsInvisible(THIS, [Mob* other = 0])"); { - Mob * THIS; - bool RETVAL; - Mob * other; + Mob *THIS; + bool RETVAL; + Mob *other; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) other = 0; else { if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - other = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + other = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == nullptr) + if (other == nullptr) Perl_croak(aTHX_ "other is nullptr, avoiding crash."); } @@ -1363,22 +1277,20 @@ XS(XS_Mob_IsInvisible) } XS(XS_Mob_SetInvisible); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetInvisible) -{ +XS(XS_Mob_SetInvisible) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetInvisible(THIS, uint8 state)"); { - Mob * THIS; - uint8 state = (uint8)SvUV(ST(1)); + Mob *THIS; + uint8 state = (uint8) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetInvisible(state); @@ -1387,125 +1299,118 @@ XS(XS_Mob_SetInvisible) } XS(XS_Mob_FindBuff); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_FindBuff) -{ +XS(XS_Mob_FindBuff) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::FindBuff(THIS, uint16 spell_id)"); { - Mob * THIS; - bool RETVAL; - uint16 spellid = (uint16)SvUV(ST(1)); + Mob *THIS; + bool RETVAL; + uint16 spellid = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->FindBuff(spellid); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Mob_FindType); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_FindType) -{ +XS(XS_Mob_FindType) { dXSARGS; if (items < 2 || items > 4) Perl_croak(aTHX_ "Usage: Mob::FindType(THIS, uint8 type, [bool offensive = false], [uint16 threshold = 100])"); { - Mob * THIS; - bool RETVAL; - uint8 type = (uint8)SvUV(ST(1)); - bool bOffensive; - uint16 threshold; + Mob *THIS; + bool RETVAL; + uint8 type = (uint8) SvUV(ST(1)); + bool bOffensive; + uint16 threshold; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) bOffensive = false; else { - bOffensive = (bool)SvTRUE(ST(2)); + bOffensive = (bool) SvTRUE(ST(2)); } if (items < 4) threshold = 100; else { - threshold = (uint16)SvUV(ST(3)); + threshold = (uint16) SvUV(ST(3)); } RETVAL = THIS->FindType(type, bOffensive, threshold); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Mob_GetBuffSlotFromType); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetBuffSlotFromType) -{ +XS(XS_Mob_GetBuffSlotFromType) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::GetBuffSlotFromType(THIS, uint16 type)"); { - Mob * THIS; - int8 RETVAL; + Mob *THIS; + int8 RETVAL; dXSTARG; - uint16 type = (uint16)SvUV(ST(1)); + uint16 type = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBuffSlotFromType(type); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_MakePet); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_MakePet) -{ +XS(XS_Mob_MakePet) { dXSARGS; if (items < 3 || items > 4) Perl_croak(aTHX_ "Usage: Mob::MakePet(THIS, uint16 spell_id, string pet_type, [string name = nullptr])"); { - Mob * THIS; - uint16 spell_id = (uint16)SvUV(ST(1)); - char* pettype = (char *)SvPV_nolen(ST(2)); - char * name; + Mob *THIS; + uint16 spell_id = (uint16) SvUV(ST(1)); + char *pettype = (char *) SvPV_nolen(ST(2)); + char *name; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 4) name = nullptr; else { - name = (char *)SvPV_nolen(ST(3)); + name = (char *) SvPV_nolen(ST(3)); } THIS->MakePet(spell_id, pettype, name); @@ -1514,51 +1419,49 @@ XS(XS_Mob_MakePet) } XS(XS_Mob_MakeTempPet); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_MakeTempPet) -{ +XS(XS_Mob_MakeTempPet) { dXSARGS; if (items < 2 || items > 6) - Perl_croak(aTHX_ "Usage: Mob::MakeTempPet(THIS, uint16 spell_id, [string name = nullptr], [uint32 duration = 0], [Mob* target = nullptr], [bool sticktarg = 0])"); + Perl_croak(aTHX_ + "Usage: Mob::MakeTempPet(THIS, uint16 spell_id, [string name = nullptr], [uint32 duration = 0], [Mob* target = nullptr], [bool sticktarg = 0])"); { - Mob * THIS; - uint16 spell_id = (uint16)SvUV(ST(1)); - char * name; - uint32 duration; - Mob * target; - bool sticktarg; + Mob *THIS; + uint16 spell_id = (uint16) SvUV(ST(1)); + char *name; + uint32 duration; + Mob *target; + bool sticktarg; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) name = nullptr; else - name = (char *)SvPV_nolen(ST(2)); + name = (char *) SvPV_nolen(ST(2)); if (items < 4) duration = 0; else - duration = (uint32)SvUV(ST(3)); + duration = (uint32) SvUV(ST(3)); if (items < 5) target = nullptr; else if (sv_derived_from(ST(4), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(4))); - target = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(4))); + target = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "owner is not of type Mob"); if (items < 6) sticktarg = false; else { - sticktarg = (bool)SvTRUE(ST(5)); + sticktarg = (bool) SvTRUE(ST(5)); } THIS->TemporaryPets(spell_id, target, name, duration, true, sticktarg); @@ -1567,59 +1470,57 @@ XS(XS_Mob_MakeTempPet) } XS(XS_Mob_TypesTempPet); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_TypesTempPet) -{ +XS(XS_Mob_TypesTempPet) { dXSARGS; if (items < 2 || items > 7) - Perl_croak(aTHX_ "Usage: Mob::TypesTempPet(THIS, uint32 type_id, [string name = nullptr], [uint32 duration = 0], [bool follow = 0], [Mob* target = nullptr], [bool stick_targ = 0])"); + Perl_croak(aTHX_ + "Usage: Mob::TypesTempPet(THIS, uint32 type_id, [string name = nullptr], [uint32 duration = 0], [bool follow = 0], [Mob* target = nullptr], [bool stick_targ = 0])"); { - Mob * THIS; - uint32 typesid = (uint32)SvUV(ST(1)); - char * name; - uint32 duration; - bool follow; - Mob * target; - bool sticktarg; + Mob *THIS; + uint32 typesid = (uint32) SvUV(ST(1)); + char *name; + uint32 duration; + bool follow; + Mob *target; + bool sticktarg; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) name = nullptr; else - name = (char *)SvPV_nolen(ST(2)); + name = (char *) SvPV_nolen(ST(2)); if (items < 4) duration = 0; else - duration = (uint32)SvUV(ST(3)); + duration = (uint32) SvUV(ST(3)); if (items < 5) follow = true; else { - follow = (bool)SvTRUE(ST(4)); + follow = (bool) SvTRUE(ST(4)); } if (items < 6) target = nullptr; else if (sv_derived_from(ST(5), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(5))); - target = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(5))); + target = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "target is not of type Mob"); if (items < 7) sticktarg = false; else { - sticktarg = (bool)SvTRUE(ST(6)); + sticktarg = (bool) SvTRUE(ST(6)); } THIS->TypesTemporaryPets(typesid, target, name, duration, follow, sticktarg); @@ -1628,577 +1529,553 @@ XS(XS_Mob_TypesTempPet) } XS(XS_Mob_GetBaseRace); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetBaseRace) -{ +XS(XS_Mob_GetBaseRace) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetBaseRace(THIS)"); { - Mob * THIS; - uint16 RETVAL; + Mob *THIS; + uint16 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBaseRace(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetBaseGender); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetBaseGender) -{ +XS(XS_Mob_GetBaseGender) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetBaseGender(THIS)"); { - Mob * THIS; - uint8 RETVAL; + Mob *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBaseGender(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetDeity); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetDeity) -{ +XS(XS_Mob_GetDeity) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetDeity(THIS)"); { - Mob * THIS; - uint8 RETVAL; + Mob *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDeity(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetRace); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetRace) -{ +XS(XS_Mob_GetRace) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetRace(THIS)"); { - Mob * THIS; - uint16 RETVAL; + Mob *THIS; + uint16 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetRace(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetGender); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetGender) -{ +XS(XS_Mob_GetGender) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetGender(THIS)"); { - Mob * THIS; - uint8 RETVAL; + Mob *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGender(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetTexture); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetTexture) -{ +XS(XS_Mob_GetTexture) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetTexture(THIS)"); { - Mob * THIS; - uint8 RETVAL; + Mob *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetTexture(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetHelmTexture); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetHelmTexture) -{ +XS(XS_Mob_GetHelmTexture) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetHelmTexture(THIS)"); { - Mob * THIS; - uint8 RETVAL; + Mob *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHelmTexture(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetHairColor); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetHairColor) -{ +XS(XS_Mob_GetHairColor) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetHairColor(THIS)"); { - Mob * THIS; - uint8 RETVAL; + Mob *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHairColor(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetBeardColor); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetBeardColor) -{ +XS(XS_Mob_GetBeardColor) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetBeardColor(THIS)"); { - Mob * THIS; - uint8 RETVAL; + Mob *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBeardColor(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetEyeColor1); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetEyeColor1) -{ +XS(XS_Mob_GetEyeColor1) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetEyeColor1(THIS)"); { - Mob * THIS; - uint8 RETVAL; + Mob *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEyeColor1(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetEyeColor2); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetEyeColor2) -{ +XS(XS_Mob_GetEyeColor2) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetEyeColor2(THIS)"); { - Mob * THIS; - uint8 RETVAL; + Mob *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEyeColor2(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetHairStyle); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetHairStyle) -{ +XS(XS_Mob_GetHairStyle) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetHairStyle(THIS)"); { - Mob * THIS; - uint8 RETVAL; + Mob *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHairStyle(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetLuclinFace); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetLuclinFace) -{ +XS(XS_Mob_GetLuclinFace) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetLuclinFace(THIS)"); { - Mob * THIS; - uint8 RETVAL; + Mob *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLuclinFace(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetBeard); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetBeard) -{ +XS(XS_Mob_GetBeard) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetBeard(THIS)"); { - Mob * THIS; - uint8 RETVAL; + Mob *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBeard(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetDrakkinHeritage); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetDrakkinHeritage) -{ +XS(XS_Mob_GetDrakkinHeritage) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetDrakkinHeritage(THIS)"); { - Mob * THIS; - uint8 RETVAL; + Mob *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDrakkinHeritage(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetDrakkinTattoo); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetDrakkinTattoo) -{ +XS(XS_Mob_GetDrakkinTattoo) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetDrakkinTattoo(THIS)"); { - Mob * THIS; - uint8 RETVAL; + Mob *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDrakkinTattoo(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetDrakkinDetails); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetDrakkinDetails) -{ +XS(XS_Mob_GetDrakkinDetails) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetDrakkinDetails(THIS)"); { - Mob * THIS; - uint8 RETVAL; + Mob *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDrakkinDetails(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetClass); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetClass) -{ +XS(XS_Mob_GetClass) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetClass(THIS)"); { - Mob * THIS; - uint8 RETVAL; + Mob *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetClass(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetLevel); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetLevel) -{ +XS(XS_Mob_GetLevel) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetLevel(THIS)"); { - Mob * THIS; - uint8 RETVAL; + Mob *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLevel(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetCleanName); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetCleanName) -{ +XS(XS_Mob_GetCleanName) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetCleanName(THIS)"); { - Mob * THIS; - Const_char * RETVAL; + Mob *THIS; + Const_char *RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCleanName(); - sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; + sv_setpv(TARG, RETVAL); + XSprePUSH; + PUSHTARG; } XSRETURN(1); } XS(XS_Mob_GetTarget); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetTarget) -{ +XS(XS_Mob_GetTarget) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetTarget(THIS)"); { - Mob * THIS; - Mob * RETVAL; + Mob *THIS; + Mob *RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetTarget(); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Mob", (void*)RETVAL); + sv_setref_pv(ST(0), "Mob", (void *) RETVAL); } XSRETURN(1); } XS(XS_Mob_SetTarget); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetTarget) -{ +XS(XS_Mob_SetTarget) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetTarget(THIS, mob)"); { - Mob * THIS; - Mob* mob; + Mob *THIS; + Mob *mob; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - mob = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + mob = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "mob is not of type Mob"); - if(mob == nullptr) + if (mob == nullptr) Perl_croak(aTHX_ "mob is nullptr, avoiding crash."); THIS->SetTarget(mob); @@ -2207,48 +2084,45 @@ XS(XS_Mob_SetTarget) } XS(XS_Mob_GetHPRatio); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetHPRatio) -{ +XS(XS_Mob_GetHPRatio) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetHPRatio(THIS)"); { - Mob * THIS; - float RETVAL; + Mob *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHPRatio(); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Mob_IsWarriorClass); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsWarriorClass) -{ +XS(XS_Mob_IsWarriorClass) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsWarriorClass(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsWarriorClass(); @@ -2259,288 +2133,276 @@ XS(XS_Mob_IsWarriorClass) } XS(XS_Mob_GetHP); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetHP) -{ +XS(XS_Mob_GetHP) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetHP(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHP(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetMaxHP); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetMaxHP) -{ +XS(XS_Mob_GetMaxHP) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetMaxHP(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxHP(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetItemHPBonuses); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetItemHPBonuses) -{ +XS(XS_Mob_GetItemHPBonuses) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetItemHPBonuses(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetItemHPBonuses(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetSpellHPBonuses); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetSpellHPBonuses) -{ +XS(XS_Mob_GetSpellHPBonuses) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetSpellHPBonuses(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSpellHPBonuses(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetSpellIDFromSlot); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetSpellIDFromSlot) -{ +XS(XS_Mob_GetSpellIDFromSlot) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::GetSpellIDFromSlot(THIS, slot)"); { - Mob * THIS; - int RETVAL; + Mob *THIS; + int RETVAL; dXSTARG; - uint8 slot = (uint16)SvUV(ST(1)); + uint8 slot = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob *, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (slot > THIS->GetMaxBuffSlots()) RETVAL = -1; - else + else RETVAL = THIS->GetSpellIDFromSlot(slot); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetWalkspeed); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetWalkspeed) -{ +XS(XS_Mob_GetWalkspeed) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetWalkspeed(THIS)"); { - Mob * THIS; - float RETVAL; + Mob *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetWalkspeed(); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetRunspeed); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetRunspeed) -{ +XS(XS_Mob_GetRunspeed) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetRunspeed(THIS)"); { - Mob * THIS; - float RETVAL; + Mob *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetRunspeed(); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetCasterLevel); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetCasterLevel) -{ +XS(XS_Mob_GetCasterLevel) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::GetCasterLevel(THIS, spell_id)"); { - Mob * THIS; - int RETVAL; + Mob *THIS; + int RETVAL; dXSTARG; - uint16 spell_id = (uint16)SvUV(ST(1)); + uint16 spell_id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCasterLevel(spell_id); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetMaxMana); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetMaxMana) -{ +XS(XS_Mob_GetMaxMana) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetMaxMana(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxMana(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetMana); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetMana) -{ +XS(XS_Mob_GetMana) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetMana(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMana(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_SetMana); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetMana) -{ +XS(XS_Mob_SetMana) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetMana(THIS, amount)"); { - Mob * THIS; - int32 amount = (int32)SvIV(ST(1)); + Mob *THIS; + int32 amount = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetMana(amount); @@ -2549,905 +2411,869 @@ XS(XS_Mob_SetMana) } XS(XS_Mob_GetManaRatio); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetManaRatio) -{ +XS(XS_Mob_GetManaRatio) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetManaRatio(THIS)"); { - Mob * THIS; - float RETVAL; + Mob *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetManaRatio(); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetAC); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetAC) -{ +XS(XS_Mob_GetAC) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetAC(THIS)"); { - Mob * THIS; - uint32 RETVAL; + Mob *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAC(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetATK); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetATK) -{ +XS(XS_Mob_GetATK) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetATK(THIS)"); { - Mob * THIS; - uint32 RETVAL; + Mob *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetATK(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetSTR); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetSTR) -{ +XS(XS_Mob_GetSTR) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetSTR(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSTR(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetSTA); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetSTA) -{ +XS(XS_Mob_GetSTA) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetSTA(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSTA(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetDEX); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetDEX) -{ +XS(XS_Mob_GetDEX) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetDEX(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDEX(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetAGI); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetAGI) -{ +XS(XS_Mob_GetAGI) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetAGI(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAGI(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetINT); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetINT) -{ +XS(XS_Mob_GetINT) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetINT(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetINT(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetWIS); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetWIS) -{ +XS(XS_Mob_GetWIS) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetWIS(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetWIS(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetCHA); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetCHA) -{ +XS(XS_Mob_GetCHA) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetCHA(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCHA(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetMR); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetMR) -{ +XS(XS_Mob_GetMR) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetMR(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMR(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetFR); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetFR) -{ +XS(XS_Mob_GetFR) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetFR(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetFR(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetDR); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetDR) -{ +XS(XS_Mob_GetDR) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetDR(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDR(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetPR); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetPR) -{ +XS(XS_Mob_GetPR) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetPR(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPR(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetCR); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetCR) -{ +XS(XS_Mob_GetCR) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetCR(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCR(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetCorruption); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetCorruption) -{ +XS(XS_Mob_GetCorruption) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetCorruption(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCorrup(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetPhR); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetPhR) -{ +XS(XS_Mob_GetPhR) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetPhR(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob *, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPhR(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetMaxSTR); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetMaxSTR) -{ +XS(XS_Mob_GetMaxSTR) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetMaxSTR(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxSTR(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetMaxSTA); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetMaxSTA) -{ +XS(XS_Mob_GetMaxSTA) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetMaxSTA(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxSTA(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetMaxDEX); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetMaxDEX) -{ +XS(XS_Mob_GetMaxDEX) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetMaxDEX(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxDEX(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetMaxAGI); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetMaxAGI) -{ +XS(XS_Mob_GetMaxAGI) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetMaxAGI(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxAGI(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetMaxINT); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetMaxINT) -{ +XS(XS_Mob_GetMaxINT) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetMaxINT(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxINT(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetMaxWIS); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetMaxWIS) -{ +XS(XS_Mob_GetMaxWIS) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetMaxWIS(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxWIS(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetMaxCHA); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetMaxCHA) -{ +XS(XS_Mob_GetMaxCHA) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetMaxCHA(THIS)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxCHA(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetActSpellRange); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetActSpellRange) -{ +XS(XS_Mob_GetActSpellRange) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Mob::GetActSpellRange(THIS, uint16 spell_id, float range)"); { - Mob * THIS; - float RETVAL; + Mob *THIS; + float RETVAL; dXSTARG; - uint16 spell_id = (uint16)SvUV(ST(1)); - float range = (float)SvNV(ST(2)); + uint16 spell_id = (uint16) SvUV(ST(1)); + float range = (float) SvNV(ST(2)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetActSpellRange(spell_id, range); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetActSpellDamage); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetActSpellDamage) -{ +XS(XS_Mob_GetActSpellDamage) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Mob::GetActSpellDamage(THIS, uint16 spell_id, int32 value)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; - uint16 spell_id = (uint16)SvUV(ST(1)); - int32 value = (int32)SvIV(ST(2)); + uint16 spell_id = (uint16) SvUV(ST(1)); + int32 value = (int32) SvIV(ST(2)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetActSpellDamage(spell_id, value); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetActSpellHealing); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetActSpellHealing) -{ +XS(XS_Mob_GetActSpellHealing) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Mob::GetActSpellHealing(THIS, uint16 spell_id, int32 value)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; - uint16 spell_id = (uint16)SvUV(ST(1)); - int32 value = (int32)SvIV(ST(2)); + uint16 spell_id = (uint16) SvUV(ST(1)); + int32 value = (int32) SvIV(ST(2)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetActSpellHealing(spell_id, value); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetActSpellCost); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetActSpellCost) -{ +XS(XS_Mob_GetActSpellCost) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Mob::GetActSpellCost(THIS, uint16 spell_id, int32 cost)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; - uint16 spell_id = (uint16)SvUV(ST(1)); - int32 cost = (int32)SvIV(ST(2)); + uint16 spell_id = (uint16) SvUV(ST(1)); + int32 cost = (int32) SvIV(ST(2)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetActSpellCost(spell_id, cost); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetActSpellDuration); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetActSpellDuration) -{ +XS(XS_Mob_GetActSpellDuration) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Mob::GetActSpellDuration(THIS, uint16 spell_id, int32 duration)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; - uint16 spell_id = (uint16)SvUV(ST(1)); - int32 duration = (int32)SvIV(ST(2)); + uint16 spell_id = (uint16) SvUV(ST(1)); + int32 duration = (int32) SvIV(ST(2)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetActSpellDuration(spell_id, duration); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetActSpellCasttime); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetActSpellCasttime) -{ +XS(XS_Mob_GetActSpellCasttime) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Mob::GetActSpellCasttime(THIS, uint16 spell_id, uint32 cast_time)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; - uint16 spell_id = (uint16)SvUV(ST(1)); - int32 casttime = (int32)SvIV(ST(2)); + uint16 spell_id = (uint16) SvUV(ST(1)); + int32 casttime = (int32) SvIV(ST(2)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetActSpellCasttime(spell_id, casttime); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_ResistSpell); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_ResistSpell) -{ +XS(XS_Mob_ResistSpell) { dXSARGS; if (items != 4) Perl_croak(aTHX_ "Usage: Mob::ResistSpell(THIS, uint8 resist_type, uint16 spell_id, [Mob* caster = nullptr])"); { - Mob * THIS; - double RETVAL; + Mob *THIS; + double RETVAL; dXSTARG; - uint8 ressit_type = (uint8)SvUV(ST(1)); - uint16 spell_id = (uint16)SvUV(ST(2)); - Mob * caster; + uint8 ressit_type = (uint8) SvUV(ST(1)); + uint16 spell_id = (uint16) SvUV(ST(2)); + Mob *caster; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(3), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(3))); - caster = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(3))); + caster = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "caster is not of type Mob"); - if(caster == nullptr) + if (caster == nullptr) Perl_croak(aTHX_ "caster is nullptr, avoiding crash."); RETVAL = THIS->ResistSpell(ressit_type, spell_id, caster); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetSpecializeSkillValue); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetSpecializeSkillValue) -{ +XS(XS_Mob_GetSpecializeSkillValue) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::GetSpecializeSkillValue(THIS, uint16 spell_id)"); { - Mob * THIS; - uint16 RETVAL; + Mob *THIS; + uint16 RETVAL; dXSTARG; - uint16 spell_id = (uint16)SvUV(ST(1)); + uint16 spell_id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSpecializeSkillValue(spell_id); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetNPCTypeID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetNPCTypeID) -{ +XS(XS_Mob_GetNPCTypeID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetNPCTypeID(THIS)"); { - Mob * THIS; - uint32 RETVAL; + Mob *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetNPCTypeID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_IsTargeted); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsTargeted) -{ +XS(XS_Mob_IsTargeted) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsTargeted(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsTargeted(); @@ -3458,283 +3284,271 @@ XS(XS_Mob_IsTargeted) } XS(XS_Mob_GetX); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetX) -{ +XS(XS_Mob_GetX) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetX(THIS)"); { - Mob * THIS; - float RETVAL; + Mob *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetX(); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetY); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetY) -{ +XS(XS_Mob_GetY) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetY(THIS)"); { - Mob * THIS; - float RETVAL; + Mob *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetY(); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetZ); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetZ) -{ +XS(XS_Mob_GetZ) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetZ(THIS)"); { - Mob * THIS; - float RETVAL; + Mob *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetZ(); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetHeading); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetHeading) -{ +XS(XS_Mob_GetHeading) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetHeading(THIS)"); { - Mob * THIS; - float RETVAL; + Mob *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHeading(); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetWaypointX); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetWaypointX) -{ +XS(XS_Mob_GetWaypointX) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetWaypointX(THIS)"); { - Mob * THIS; - float RETVAL; + Mob *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCurrentWayPoint().x; - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetWaypointY); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetWaypointY) -{ +XS(XS_Mob_GetWaypointY) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetWaypointY(THIS)"); { - Mob * THIS; - float RETVAL; + Mob *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCurrentWayPoint().y; - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetWaypointZ); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetWaypointZ) -{ +XS(XS_Mob_GetWaypointZ) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetWaypointZ(THIS)"); { - Mob * THIS; - float RETVAL; + Mob *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCurrentWayPoint().z; - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetWaypointH); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetWaypointH) -{ +XS(XS_Mob_GetWaypointH) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetWaypointH(THIS)"); { - Mob * THIS; - float RETVAL; + Mob *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCurrentWayPoint().w; - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetWaypointPause); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetWaypointPause) -{ +XS(XS_Mob_GetWaypointPause) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetWaypointPause(THIS)"); { - Mob * THIS; - uint32 RETVAL; + Mob *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCWPP(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetWaypointID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetWaypointID) -{ +XS(XS_Mob_GetWaypointID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetWaypointID(THIS)"); { - Mob * THIS; - uint32 RETVAL; + Mob *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCWP(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_SetCurrentWP); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetCurrentWP) -{ +XS(XS_Mob_SetCurrentWP) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetCurrentWP(THIS, waypoint)"); { - Mob * THIS; - uint16 waypoint = (uint16)SvUV(ST(1)); + Mob *THIS; + uint16 waypoint = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetCurrentWP(waypoint); @@ -3743,48 +3557,45 @@ XS(XS_Mob_SetCurrentWP) } XS(XS_Mob_GetSize); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetSize) -{ +XS(XS_Mob_GetSize) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetSize(THIS)"); { - Mob * THIS; - float RETVAL; + Mob *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSize(); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Mob_SetFollowID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetFollowID) -{ +XS(XS_Mob_SetFollowID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetFollowID(THIS, id)"); { - Mob * THIS; - uint32 id = (uint32)SvUV(ST(1)); + Mob *THIS; + uint32 id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetFollowID(id); @@ -3793,49 +3604,46 @@ XS(XS_Mob_SetFollowID) } XS(XS_Mob_GetFollowID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetFollowID) -{ +XS(XS_Mob_GetFollowID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetFollowID(THIS)"); { - Mob * THIS; - uint32 RETVAL; + Mob *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetFollowID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_Message); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_Message) -{ +XS(XS_Mob_Message) { dXSARGS; if (items < 3) Perl_croak(aTHX_ "Usage: Mob::Message(THIS, uint32 emote_color_type, string message)"); { - Mob * THIS; - uint32 type = (uint32)SvUV(ST(1)); - char* message = (char *)SvPV_nolen(ST(2)); + Mob *THIS; + uint32 type = (uint32) SvUV(ST(1)); + char *message = (char *) SvPV_nolen(ST(2)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Message(type, message); @@ -3844,30 +3652,29 @@ XS(XS_Mob_Message) } XS(XS_Mob_Message_StringID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_Message_StringID) -{ +XS(XS_Mob_Message_StringID) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ "Usage: Mob::Message_StringID(THIS, uint32 emote_color_type, uint32 string_id, [uint32 distance = 0])"); + Perl_croak(aTHX_ + "Usage: Mob::Message_StringID(THIS, uint32 emote_color_type, uint32 string_id, [uint32 distance = 0])"); { - Mob * THIS; - uint32 type = (uint32)SvUV(ST(1)); - uint32 string_id = (uint32)SvUV(ST(2)); - uint32 distance; + Mob *THIS; + uint32 type = (uint32) SvUV(ST(1)); + uint32 string_id = (uint32) SvUV(ST(2)); + uint32 distance; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 4) distance = 0; else { - distance = (uint32)SvUV(ST(3)); + distance = (uint32) SvUV(ST(3)); } THIS->Message_StringID(type, string_id, distance); @@ -3876,22 +3683,20 @@ XS(XS_Mob_Message_StringID) } XS(XS_Mob_Say); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_Say) -{ +XS(XS_Mob_Say) { dXSARGS; if (items < 2) Perl_croak(aTHX_ "Usage: Mob::Say(THIS, string message)"); { - Mob * THIS; - char * format = (char *)SvPV_nolen(ST(1)); + Mob *THIS; + char *format = (char *) SvPV_nolen(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Say(format); @@ -3900,22 +3705,20 @@ XS(XS_Mob_Say) } XS(XS_Mob_Shout); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_Shout) -{ +XS(XS_Mob_Shout) { dXSARGS; if (items < 2) Perl_croak(aTHX_ "Usage: Mob::Shout(THIS, string message)"); { - Mob * THIS; - char * format = (char *)SvPV_nolen(ST(1)); + Mob *THIS; + char *format = (char *) SvPV_nolen(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Shout(format); @@ -3924,22 +3727,20 @@ XS(XS_Mob_Shout) } XS(XS_Mob_Emote); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_Emote) -{ +XS(XS_Mob_Emote) { dXSARGS; if (items < 2) Perl_croak(aTHX_ "Usage: Mob::Emote(THIS, string message)"); { - Mob * THIS; - char * format = (char *)SvPV_nolen(ST(1)); + Mob *THIS; + char *format = (char *) SvPV_nolen(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Emote(format); @@ -3948,28 +3749,26 @@ XS(XS_Mob_Emote) } XS(XS_Mob_InterruptSpell); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_InterruptSpell) -{ +XS(XS_Mob_InterruptSpell) { dXSARGS; if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: Mob::InterruptSpell(THIS, [uint16 spell_id = 0xFFFF])"); { - Mob * THIS; - uint16 spellid; + Mob *THIS; + uint16 spellid; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) spellid = 0xFFFF; else { - spellid = (uint16)SvUV(ST(1)); + spellid = (uint16) SvUV(ST(1)); } THIS->InterruptSpell(spellid); @@ -3978,27 +3777,26 @@ XS(XS_Mob_InterruptSpell) } XS(XS_Mob_CastSpell); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_CastSpell) -{ +XS(XS_Mob_CastSpell) { dXSARGS; if (items < 3 || items > 7) - Perl_croak(aTHX_ "Usage: Mob::CastSpell(THIS, uint16 spell_id, uint16 target_id, [int slot = 22], [int32 cast_time = -1], [int32 mana_cost = -1], [int16 resist_adjust = 0])"); + Perl_croak(aTHX_ + "Usage: Mob::CastSpell(THIS, uint16 spell_id, uint16 target_id, [int slot = 22], [int32 cast_time = -1], [int32 mana_cost = -1], [int16 resist_adjust = 0])"); { - Mob * THIS; - uint16 spell_id = (uint16)SvUV(ST(1)); - uint16 target_id = (uint16)SvUV(ST(2)); + Mob *THIS; + uint16 spell_id = (uint16) SvUV(ST(1)); + uint16 target_id = (uint16) SvUV(ST(2)); EQEmu::CastingSlot slot; - int32 casttime; - int32 mana_cost; - int16 resist_adjust; + int32 casttime; + int32 mana_cost; + int16 resist_adjust; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 4) @@ -4010,80 +3808,73 @@ XS(XS_Mob_CastSpell) if (items < 5) casttime = -1; else { - casttime = (int32)SvIV(ST(4)); + casttime = (int32) SvIV(ST(4)); } if (items < 6) mana_cost = -1; else { - mana_cost = (int32)SvIV(ST(5)); + mana_cost = (int32) SvIV(ST(5)); } - if(items < 7) - { - resist_adjust = 0; - } - else - { - resist_adjust = (int16)SvIV(ST(6)); - } + if (items < 7) { + resist_adjust = 0; + } else { + resist_adjust = (int16) SvIV(ST(6)); + } - if (resist_adjust == 0)//If you do not pass resist adjust as nullptr it will ignore the spells default resist adjust + if (resist_adjust == + 0)//If you do not pass resist adjust as nullptr it will ignore the spells default resist adjust THIS->CastSpell(spell_id, target_id, slot, casttime, mana_cost, 0, 0xFFFFFFFF, 0xFFFFFFFF, 0); else - THIS->CastSpell(spell_id, target_id, slot, casttime, mana_cost, 0, 0xFFFFFFFF, 0xFFFFFFFF, 0, &resist_adjust); + THIS->CastSpell(spell_id, target_id, slot, casttime, mana_cost, 0, 0xFFFFFFFF, 0xFFFFFFFF, 0, + &resist_adjust); } XSRETURN_EMPTY; } XS(XS_Mob_SpellFinished); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SpellFinished) -{ +XS(XS_Mob_SpellFinished) { dXSARGS; if (items < 2 || items > 5) - Perl_croak(aTHX_ "Usage: Mob::SpellFinished(uint16 spell_id, [Mob* spell_target = this], [uint16 mana_cost = 0], [uint16 resist_diff = 0])"); + Perl_croak(aTHX_ + "Usage: Mob::SpellFinished(uint16 spell_id, [Mob* spell_target = this], [uint16 mana_cost = 0], [uint16 resist_diff = 0])"); { - Mob * THIS; - uint16 spell_id = (uint16)SvUV(ST(1)); - Mob * spell_target; - uint16 mana_cost = 0; - int16 resist_diff; + Mob *THIS; + uint16 spell_id = (uint16) SvUV(ST(1)); + Mob *spell_target; + uint16 mana_cost = 0; + int16 resist_diff; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); spell_target = THIS; - if (items > 2) - { + if (items > 2) { if (sv_derived_from(ST(2), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(2))); - spell_target = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(2))); + spell_target = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "spell_target is not of type Mob"); - if(spell_target == nullptr) + if (spell_target == nullptr) Perl_croak(aTHX_ "spell_target is nullptr, avoiding crash."); } if (items > 3) - mana_cost = (uint16)SvUV(ST(3)); + mana_cost = (uint16) SvUV(ST(3)); - if (items > 4) - { - resist_diff = (int16)SvUV(ST(4)); - } - else - { - resist_diff = spells[spell_id].ResistDiff; - } + if (items > 4) { + resist_diff = (int16) SvUV(ST(4)); + } else { + resist_diff = spells[spell_id].ResistDiff; + } THIS->SpellFinished(spell_id, spell_target, EQEmu::CastingSlot::Item, mana_cost, -1, resist_diff); } @@ -4091,59 +3882,54 @@ XS(XS_Mob_SpellFinished) } XS(XS_Mob_IsImmuneToSpell); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsImmuneToSpell) -{ +XS(XS_Mob_IsImmuneToSpell) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Mob::IsImmuneToSpell(THIS, uint16 spell_id, [Mob* caster = nullptr])"); { - Mob * THIS; - bool RETVAL; - uint16 spell_id = (uint16)SvUV(ST(1)); - Mob * caster; + Mob *THIS; + bool RETVAL; + uint16 spell_id = (uint16) SvUV(ST(1)); + Mob *caster; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(2), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(2))); - caster = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(2))); + caster = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "caster is not of type Mob"); - if(caster == nullptr) + if (caster == nullptr) Perl_croak(aTHX_ "caster is nullptr, avoiding crash."); RETVAL = THIS->IsImmuneToSpell(spell_id, caster); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Mob_BuffFadeBySpellID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_BuffFadeBySpellID) -{ +XS(XS_Mob_BuffFadeBySpellID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::BuffFadeBySpellID(THIS, uint16 spell_id)"); { - Mob * THIS; - uint16 spell_id = (uint16)SvUV(ST(1)); + Mob *THIS; + uint16 spell_id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->BuffFadeBySpellID(spell_id); @@ -4152,29 +3938,27 @@ XS(XS_Mob_BuffFadeBySpellID) } XS(XS_Mob_BuffFadeByEffect); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_BuffFadeByEffect) -{ +XS(XS_Mob_BuffFadeByEffect) { dXSARGS; if (items < 2 || items > 3) Perl_croak(aTHX_ "Usage: Mob::BuffFadeByEffect(THIS, int effect_id, int skip_slot = -1)"); { - Mob * THIS; - int effectid = (int)SvIV(ST(1)); - int skipslot; + Mob *THIS; + int effectid = (int) SvIV(ST(1)); + int skipslot; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) skipslot = -1; else { - skipslot = (int)SvIV(ST(2)); + skipslot = (int) SvIV(ST(2)); } THIS->BuffFadeByEffect(effectid, skipslot); @@ -4183,21 +3967,19 @@ XS(XS_Mob_BuffFadeByEffect) } XS(XS_Mob_BuffFadeAll); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_BuffFadeAll) -{ +XS(XS_Mob_BuffFadeAll) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::BuffFadeAll(THIS)"); { - Mob * THIS; + Mob *THIS; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->BuffFadeAll(); @@ -4206,29 +3988,27 @@ XS(XS_Mob_BuffFadeAll) } XS(XS_Mob_BuffFadeBySlot); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_BuffFadeBySlot) -{ +XS(XS_Mob_BuffFadeBySlot) { dXSARGS; if (items < 2 || items > 3) Perl_croak(aTHX_ "Usage: Mob::BuffFadeBySlot(THIS, int slot, bool recalc_bonuses = true)"); { - Mob * THIS; - int slot = (int)SvIV(ST(1)); - bool iRecalcBonuses; + Mob *THIS; + int slot = (int) SvIV(ST(1)); + bool iRecalcBonuses; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) iRecalcBonuses = true; else { - iRecalcBonuses = (bool)SvTRUE(ST(2)); + iRecalcBonuses = (bool) SvTRUE(ST(2)); } THIS->BuffFadeBySlot(slot, iRecalcBonuses); @@ -4237,57 +4017,55 @@ XS(XS_Mob_BuffFadeBySlot) } XS(XS_Mob_CanBuffStack); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_CanBuffStack) -{ +XS(XS_Mob_CanBuffStack) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ "Usage: Mob::CanBuffStack(THIS, uint16 spell_id, uint8 caster_level, [bool fail_if_overwritten = false])"); + Perl_croak(aTHX_ + "Usage: Mob::CanBuffStack(THIS, uint16 spell_id, uint8 caster_level, [bool fail_if_overwritten = false])"); { - Mob * THIS; - int RETVAL; + Mob *THIS; + int RETVAL; dXSTARG; - uint16 spellid = (uint16)SvUV(ST(1)); - uint8 caster_level = (uint8)SvUV(ST(2)); - bool iFailIfOverwrite; + uint16 spellid = (uint16) SvUV(ST(1)); + uint8 caster_level = (uint8) SvUV(ST(2)); + bool iFailIfOverwrite; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 4) iFailIfOverwrite = false; else { - iFailIfOverwrite = (bool)SvTRUE(ST(3)); + iFailIfOverwrite = (bool) SvTRUE(ST(3)); } RETVAL = THIS->CanBuffStack(spellid, caster_level, iFailIfOverwrite); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_IsCasting); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsCasting) -{ +XS(XS_Mob_IsCasting) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsCasting(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsCasting(); @@ -4298,55 +4076,52 @@ XS(XS_Mob_IsCasting) } XS(XS_Mob_CastingSpellID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_CastingSpellID) -{ +XS(XS_Mob_CastingSpellID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::CastingSpellID(THIS)"); { - Mob * THIS; - uint16 RETVAL; + Mob *THIS; + uint16 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CastingSpellID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_SetAppearance); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetAppearance) -{ +XS(XS_Mob_SetAppearance) { dXSARGS; if (items < 2 || items > 3) Perl_croak(aTHX_ "Usage: Mob::SetAppearance(THIS, int appearance [0|1|2|3|4], [ignore_self = true])"); { - Mob * THIS; - EmuAppearance app = (EmuAppearance)SvUV(ST(1)); - bool iIgnoreSelf; + Mob *THIS; + EmuAppearance app = (EmuAppearance) SvUV(ST(1)); + bool iIgnoreSelf; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) iIgnoreSelf = true; else { - iIgnoreSelf = (bool)SvTRUE(ST(2)); + iIgnoreSelf = (bool) SvTRUE(ST(2)); } THIS->SetAppearance(app, iIgnoreSelf); @@ -4355,74 +4130,70 @@ XS(XS_Mob_SetAppearance) } XS(XS_Mob_GetAppearance); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetAppearance) -{ +XS(XS_Mob_GetAppearance) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetAppearance(THIS)"); { - Mob * THIS; - EmuAppearance RETVAL; + Mob *THIS; + EmuAppearance RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAppearance(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetRunAnimSpeed); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetRunAnimSpeed) -{ +XS(XS_Mob_GetRunAnimSpeed) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetRunAnimSpeed(THIS)"); { - Mob * THIS; - uint8 RETVAL; + Mob *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetRunAnimSpeed(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_SetRunAnimSpeed); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetRunAnimSpeed) -{ +XS(XS_Mob_SetRunAnimSpeed) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetRunAnimSpeed(THIS, int8 speed)"); { - Mob * THIS; - int8 in = (int8)SvIV(ST(1)); + Mob *THIS; + int8 in = (int8) SvIV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetRunAnimSpeed(in); @@ -4431,22 +4202,20 @@ XS(XS_Mob_SetRunAnimSpeed) } XS(XS_Mob_SetPetID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetPetID) -{ +XS(XS_Mob_SetPetID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetPetID(THIS, uint16 new_pet_id)"); { - Mob * THIS; - uint16 NewPetID = (uint16)SvUV(ST(1)); + Mob *THIS; + uint16 NewPetID = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetPetID(NewPetID); @@ -4455,48 +4224,45 @@ XS(XS_Mob_SetPetID) } XS(XS_Mob_GetPetID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetPetID) -{ +XS(XS_Mob_GetPetID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetPetID(THIS)"); { - Mob * THIS; - uint16 RETVAL; + Mob *THIS; + uint16 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPetID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_SetOwnerID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetOwnerID) -{ +XS(XS_Mob_SetOwnerID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetOwnerID(THIS, uint16 new_owner_id)"); { - Mob * THIS; - uint16 NewOwnerID = (uint16)SvUV(ST(1)); + Mob *THIS; + uint16 NewOwnerID = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetOwnerID(NewOwnerID); @@ -4505,100 +4271,95 @@ XS(XS_Mob_SetOwnerID) } XS(XS_Mob_GetOwnerID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetOwnerID) -{ +XS(XS_Mob_GetOwnerID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetOwnerID(THIS)"); { - Mob * THIS; - uint16 RETVAL; + Mob *THIS; + uint16 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetOwnerID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetPetType); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetPetType) -{ +XS(XS_Mob_GetPetType) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetPetType(THIS)"); { - Mob * THIS; - uint16 RETVAL; + Mob *THIS; + uint16 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPetType(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetBodyType); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetBodyType) -{ +XS(XS_Mob_GetBodyType) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetBodyType(THIS)"); { - Mob * THIS; - uint8 RETVAL; + Mob *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBodyType(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_Stun); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_Stun) -{ +XS(XS_Mob_Stun) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::Stun(THIS, int duration)"); { - Mob * THIS; - int duration = (int)SvIV(ST(1)); + Mob *THIS; + int duration = (int) SvIV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Stun(duration); @@ -4607,21 +4368,19 @@ XS(XS_Mob_Stun) } XS(XS_Mob_Spin); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_Spin) -{ +XS(XS_Mob_Spin) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::Spin(THIS)"); { - Mob * THIS; + Mob *THIS; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Spin(); @@ -4630,21 +4389,19 @@ XS(XS_Mob_Spin) } XS(XS_Mob_Kill); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_Kill) -{ +XS(XS_Mob_Kill) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::Kill(THIS)"); { - Mob * THIS; + Mob *THIS; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Kill(); @@ -4653,22 +4410,20 @@ XS(XS_Mob_Kill) } XS(XS_Mob_SetInvul); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetInvul) -{ +XS(XS_Mob_SetInvul) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetInvul(THIS, bool set_invulnerable)"); { - Mob * THIS; - bool invul = (bool)SvTRUE(ST(1)); + Mob *THIS; + bool invul = (bool) SvTRUE(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetInvul(invul); @@ -4677,22 +4432,20 @@ XS(XS_Mob_SetInvul) } XS(XS_Mob_GetInvul); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetInvul) -{ +XS(XS_Mob_GetInvul) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetInvul(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetInvul(); @@ -4703,22 +4456,20 @@ XS(XS_Mob_GetInvul) } XS(XS_Mob_SetExtraHaste); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetExtraHaste) -{ +XS(XS_Mob_SetExtraHaste) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetExtraHaste(THIS, int haste)"); { - Mob * THIS; - int Haste = (int)SvIV(ST(1)); + Mob *THIS; + int Haste = (int) SvIV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetExtraHaste(Haste); @@ -4727,74 +4478,70 @@ XS(XS_Mob_SetExtraHaste) } XS(XS_Mob_GetHaste); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetHaste) -{ +XS(XS_Mob_GetHaste) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetHaste(THIS)"); { - Mob * THIS; - int RETVAL; + Mob *THIS; + int RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHaste(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetHandToHandDamage); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetHandToHandDamage) -{ +XS(XS_Mob_GetHandToHandDamage) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetHandToHandDamage(THIS)"); { - Mob * THIS; - int RETVAL; + Mob *THIS; + int RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHandToHandDamage(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_CanThisClassDoubleAttack); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_CanThisClassDoubleAttack) -{ +XS(XS_Mob_CanThisClassDoubleAttack) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::CanThisClassDoubleAttack(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CanThisClassDoubleAttack(); @@ -4805,22 +4552,20 @@ XS(XS_Mob_CanThisClassDoubleAttack) } XS(XS_Mob_CanThisClassDualWield); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_CanThisClassDualWield) -{ +XS(XS_Mob_CanThisClassDualWield) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::CanThisClassDualWield(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CanThisClassDualWield(); @@ -4831,22 +4576,20 @@ XS(XS_Mob_CanThisClassDualWield) } XS(XS_Mob_CanThisClassRiposte); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_CanThisClassRiposte) -{ +XS(XS_Mob_CanThisClassRiposte) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::CanThisClassRiposte(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CanThisClassRiposte(); @@ -4857,22 +4600,20 @@ XS(XS_Mob_CanThisClassRiposte) } XS(XS_Mob_CanThisClassDodge); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_CanThisClassDodge) -{ +XS(XS_Mob_CanThisClassDodge) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::CanThisClassDodge(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CanThisClassDodge(); @@ -4883,22 +4624,20 @@ XS(XS_Mob_CanThisClassDodge) } XS(XS_Mob_CanThisClassParry); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_CanThisClassParry) -{ +XS(XS_Mob_CanThisClassParry) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::CanThisClassParry(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CanThisClassParry(); @@ -4909,73 +4648,69 @@ XS(XS_Mob_CanThisClassParry) } XS(XS_Mob_GetHandToHandDelay); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetHandToHandDelay) -{ +XS(XS_Mob_GetHandToHandDelay) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetHandToHandDelay(THIS)"); { - Mob * THIS; - int RETVAL; + Mob *THIS; + int RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHandToHandDelay(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetClassLevelFactor); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetClassLevelFactor) -{ +XS(XS_Mob_GetClassLevelFactor) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetClassLevelFactor(THIS)"); { - Mob * THIS; - uint8 RETVAL; + Mob *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetClassLevelFactor(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_Mesmerize); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_Mesmerize) -{ +XS(XS_Mob_Mesmerize) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::Mesmerize(THIS)"); { - Mob * THIS; + Mob *THIS; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Mesmerize(); @@ -4984,22 +4719,20 @@ XS(XS_Mob_Mesmerize) } XS(XS_Mob_IsMezzed); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsMezzed) -{ +XS(XS_Mob_IsMezzed) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsMezzed(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsMezzed(); @@ -5010,22 +4743,20 @@ XS(XS_Mob_IsMezzed) } XS(XS_Mob_IsStunned); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsStunned) -{ +XS(XS_Mob_IsStunned) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsStunned(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsStunned(); @@ -5037,21 +4768,19 @@ XS(XS_Mob_IsStunned) XS(XS_Mob_StartEnrage); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_StartEnrage) -{ +XS(XS_Mob_StartEnrage) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::StartEnrage(THIS)"); { - Mob * THIS; + Mob *THIS; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->StartEnrage(); @@ -5060,22 +4789,20 @@ XS(XS_Mob_StartEnrage) } XS(XS_Mob_IsEnraged); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsEnraged) -{ +XS(XS_Mob_IsEnraged) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsEnraged(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsEnraged(); @@ -5086,58 +4813,54 @@ XS(XS_Mob_IsEnraged) } XS(XS_Mob_GetReverseFactionCon); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetReverseFactionCon) -{ +XS(XS_Mob_GetReverseFactionCon) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::GetReverseFactionCon(THIS, iOther)"); { - Mob * THIS; - FACTION_VALUE RETVAL; + Mob *THIS; + FACTION_VALUE RETVAL; dXSTARG; - Mob* iOther; + Mob *iOther; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - iOther = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + iOther = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "iOther is not of type Mob"); - if(iOther == nullptr) + if (iOther == nullptr) Perl_croak(aTHX_ "iOther is nullptr, avoiding crash."); RETVAL = THIS->GetReverseFactionCon(iOther); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_IsAIControlled); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsAIControlled) -{ +XS(XS_Mob_IsAIControlled) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsAIControlled(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsAIControlled(); @@ -5148,74 +4871,70 @@ XS(XS_Mob_IsAIControlled) } XS(XS_Mob_GetAggroRange); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetAggroRange) -{ +XS(XS_Mob_GetAggroRange) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetAggroRange(THIS)"); { - Mob * THIS; - float RETVAL; + Mob *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAggroRange(); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetAssistRange); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetAssistRange) -{ +XS(XS_Mob_GetAssistRange) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetAssistRange(THIS)"); { - Mob * THIS; - float RETVAL; + Mob *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAssistRange(); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Mob_SetPetOrder); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetPetOrder) -{ +XS(XS_Mob_SetPetOrder) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetPetOrder(THIS, i)"); { - Mob * THIS; - Mob::eStandingPetOrder i = (Mob::eStandingPetOrder)SvIV(ST(1)); + Mob *THIS; + Mob::eStandingPetOrder i = (Mob::eStandingPetOrder) SvIV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetPetOrder(i); @@ -5224,48 +4943,45 @@ XS(XS_Mob_SetPetOrder) } XS(XS_Mob_GetPetOrder); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetPetOrder) -{ +XS(XS_Mob_GetPetOrder) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetPetOrder(THIS)"); { - Mob * THIS; - Mob::eStandingPetOrder RETVAL; + Mob *THIS; + Mob::eStandingPetOrder RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPetOrder(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_IsRoamer); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsRoamer) -{ +XS(XS_Mob_IsRoamer) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsRoamer(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsRoamer(); @@ -5276,22 +4992,20 @@ XS(XS_Mob_IsRoamer) } XS(XS_Mob_IsRooted); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsRooted) -{ +XS(XS_Mob_IsRooted) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsRooted(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsRooted(); @@ -5302,66 +5016,64 @@ XS(XS_Mob_IsRooted) } XS(XS_Mob_AddToHateList); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_AddToHateList) -{ +XS(XS_Mob_AddToHateList) { dXSARGS; if (items < 2 || items > 7) - Perl_croak(aTHX_ "Usage: Mob::AddToHateList(THIS, Mob* other, [int32 hate = 0], [int32 damage = 0], [bool yell_for_help = true], [bool frenzy = false], [bool buff_tic = false])"); + Perl_croak(aTHX_ + "Usage: Mob::AddToHateList(THIS, Mob* other, [int32 hate = 0], [int32 damage = 0], [bool yell_for_help = true], [bool frenzy = false], [bool buff_tic = false])"); { - Mob * THIS; - Mob* other; - int32 hate; - int32 damage; - bool iYellForHelp; - bool bFrenzy; - bool iBuffTic; + Mob *THIS; + Mob *other; + int32 hate; + int32 damage; + bool iYellForHelp; + bool bFrenzy; + bool iBuffTic; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - other = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + other = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == nullptr) + if (other == nullptr) Perl_croak(aTHX_ "other is nullptr, avoiding crash."); if (items < 3) hate = 0; else { - hate = (int32)SvIV(ST(2)); + hate = (int32) SvIV(ST(2)); } if (items < 4) damage = 0; else { - damage = (int32)SvIV(ST(3)); + damage = (int32) SvIV(ST(3)); } if (items < 5) iYellForHelp = true; else { - iYellForHelp = (bool)SvTRUE(ST(4)); + iYellForHelp = (bool) SvTRUE(ST(4)); } if (items < 6) bFrenzy = false; else { - bFrenzy = (bool)SvTRUE(ST(5)); + bFrenzy = (bool) SvTRUE(ST(5)); } if (items < 7) iBuffTic = false; else { - iBuffTic = (bool)SvTRUE(ST(6)); + iBuffTic = (bool) SvTRUE(ST(6)); } THIS->AddToHateList(other, hate, damage, iYellForHelp, bFrenzy, iBuffTic); @@ -5370,45 +5082,42 @@ XS(XS_Mob_AddToHateList) } XS(XS_Mob_SetHate); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetHate) -{ +XS(XS_Mob_SetHate) { dXSARGS; if (items < 2 || items > 4) Perl_croak(aTHX_ "Usage: Mob::SetHate(THIS, Mob* other, [int32 hate = 0], [int32 damage = 0])"); { - Mob * THIS; - Mob* other; - int32 hate; - int32 damage; + Mob *THIS; + Mob *other; + int32 hate; + int32 damage; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - other = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + other = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == nullptr) + if (other == nullptr) Perl_croak(aTHX_ "other is nullptr, avoiding crash."); if (items < 3) hate = 0; else { - hate = (int32)SvIV(ST(2)); + hate = (int32) SvIV(ST(2)); } if (items < 4) damage = 0; else { - damage = (int32)SvIV(ST(3)); + damage = (int32) SvIV(ST(3)); } THIS->SetHateAmountOnEnt(other, hate, damage); @@ -5417,31 +5126,28 @@ XS(XS_Mob_SetHate) } XS(XS_Mob_HalveAggro); -XS(XS_Mob_HalveAggro) -{ +XS(XS_Mob_HalveAggro) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::HalveAggro(THIS, Mob* other)"); { - Mob * THIS; - Mob * other; + Mob *THIS; + Mob *other; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - other = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + other = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == nullptr) + if (other == nullptr) Perl_croak(aTHX_ "other is nullptr, avoiding crash."); THIS->HalveAggro(other); @@ -5450,31 +5156,28 @@ XS(XS_Mob_HalveAggro) } XS(XS_Mob_DoubleAggro); -XS(XS_Mob_DoubleAggro) -{ +XS(XS_Mob_DoubleAggro) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::DoubleAggro(THIS, Mob* other)"); { - Mob * THIS; - Mob * other; + Mob *THIS; + Mob *other; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - other = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + other = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == nullptr) + if (other == nullptr) Perl_croak(aTHX_ "other is nullptr, avoiding crash."); THIS->DoubleAggro(other); @@ -5483,189 +5186,176 @@ XS(XS_Mob_DoubleAggro) } XS(XS_Mob_GetHateAmount); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetHateAmount) -{ +XS(XS_Mob_GetHateAmount) { dXSARGS; if (items < 2 || items > 3) Perl_croak(aTHX_ "Usage: Mob::GetHateAmount(THIS, Mob* mob, [bool is_damage = false])"); { - Mob * THIS; - uint32 RETVAL; + Mob *THIS; + uint32 RETVAL; dXSTARG; - Mob* tmob; - bool is_dam; + Mob *tmob; + bool is_dam; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - tmob = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + tmob = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "tmob is not of type Mob"); - if(tmob == nullptr) + if (tmob == nullptr) Perl_croak(aTHX_ "tmob is nullptr, avoiding crash."); if (items < 3) is_dam = false; else { - is_dam = (bool)SvTRUE(ST(2)); + is_dam = (bool) SvTRUE(ST(2)); } RETVAL = THIS->GetHateAmount(tmob, is_dam); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetDamageAmount); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetDamageAmount) -{ +XS(XS_Mob_GetDamageAmount) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::GetDamageAmount(THIS, Mob* target_mob)"); { - Mob * THIS; - uint32 RETVAL; + Mob *THIS; + uint32 RETVAL; dXSTARG; - Mob* tmob; + Mob *tmob; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - tmob = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + tmob = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "tmob is not of type Mob"); - if(tmob == nullptr) + if (tmob == nullptr) Perl_croak(aTHX_ "tmob is nullptr, avoiding crash."); RETVAL = THIS->GetDamageAmount(tmob); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetHateTop); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetHateTop) -{ +XS(XS_Mob_GetHateTop) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetHateTop(THIS)"); { - Mob * THIS; - Mob * RETVAL; + Mob *THIS; + Mob *RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHateTop(); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Mob", (void*)RETVAL); + sv_setref_pv(ST(0), "Mob", (void *) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetHateDamageTop); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetHateDamageTop) -{ +XS(XS_Mob_GetHateDamageTop) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::GetHateDamageTop(THIS, Mob* other)"); { - Mob * THIS; - Mob * RETVAL; - Mob* other; + Mob *THIS; + Mob *RETVAL; + Mob *other; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - other = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + other = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == nullptr) + if (other == nullptr) Perl_croak(aTHX_ "other is nullptr, avoiding crash."); RETVAL = THIS->GetHateDamageTop(other); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Mob", (void*)RETVAL); + sv_setref_pv(ST(0), "Mob", (void *) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetHateRandom); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetHateRandom) -{ +XS(XS_Mob_GetHateRandom) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetHateRandom(THIS)"); { - Mob * THIS; - Mob * RETVAL; + Mob *THIS; + Mob *RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHateRandom(); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Mob", (void*)RETVAL); + sv_setref_pv(ST(0), "Mob", (void *) RETVAL); } XSRETURN(1); } XS(XS_Mob_IsEngaged); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsEngaged) -{ +XS(XS_Mob_IsEngaged) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsEngaged(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsEngaged(); @@ -5676,22 +5366,20 @@ XS(XS_Mob_IsEngaged) } XS(XS_Mob_HateSummon); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_HateSummon) -{ +XS(XS_Mob_HateSummon) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::HateSummon(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->HateSummon(); @@ -5736,22 +5424,20 @@ XS(XS_Mob_FaceTarget) { } XS(XS_Mob_SetHeading); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetHeading) -{ +XS(XS_Mob_SetHeading) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetHeading(THIS, float heading)"); { - Mob * THIS; - float iHeading = (float)SvNV(ST(1)); + Mob *THIS; + float iHeading = (float) SvNV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetHeading(iHeading); @@ -5760,21 +5446,19 @@ XS(XS_Mob_SetHeading) } XS(XS_Mob_WipeHateList); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_WipeHateList) -{ +XS(XS_Mob_WipeHateList) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::WipeHateList(THIS)"); { - Mob * THIS; + Mob *THIS; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->WipeHateList(); @@ -5783,32 +5467,29 @@ XS(XS_Mob_WipeHateList) } XS(XS_Mob_CheckAggro); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_CheckAggro) -{ +XS(XS_Mob_CheckAggro) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::CheckAggro(THIS, Mob* other)"); { - Mob * THIS; - bool RETVAL; - Mob* other; + Mob *THIS; + bool RETVAL; + Mob *other; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - other = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + other = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == nullptr) + if (other == nullptr) Perl_croak(aTHX_ "other is nullptr, avoiding crash."); RETVAL = THIS->CheckAggro(other); @@ -5819,118 +5500,113 @@ XS(XS_Mob_CheckAggro) } XS(XS_Mob_CalculateHeadingToTarget); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_CalculateHeadingToTarget) -{ +XS(XS_Mob_CalculateHeadingToTarget) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Mob::CalculateHeadingToTarget(THIS, float x, float y)"); { - Mob * THIS; - int8 RETVAL; + Mob *THIS; + int8 RETVAL; dXSTARG; - float in_x = (float)SvNV(ST(1)); - float in_y = (float)SvNV(ST(2)); + float in_x = (float) SvNV(ST(1)); + float in_y = (float) SvNV(ST(2)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CalculateHeadingToTarget(in_x, in_y); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_CalculateNewPosition); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_CalculateNewPosition) -{ +XS(XS_Mob_CalculateNewPosition) { dXSARGS; if (items < 5 || items > 6) - Perl_croak(aTHX_ "Usage: Mob::CalculateNewPosition(THIS, float x, float y, float z, float speed, [bool check_z = false])"); + Perl_croak(aTHX_ + "Usage: Mob::CalculateNewPosition(THIS, float x, float y, float z, float speed, [bool check_z = false])"); { - Mob * THIS; - bool RETVAL; - float x = (float)SvNV(ST(1)); - float y = (float)SvNV(ST(2)); - float z = (float)SvNV(ST(3)); - float speed = (float)SvNV(ST(4)); - bool checkZ; + Mob *THIS; + bool RETVAL; + float x = (float) SvNV(ST(1)); + float y = (float) SvNV(ST(2)); + float z = (float) SvNV(ST(3)); + float speed = (float) SvNV(ST(4)); + bool checkZ; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 6) checkZ = false; else { - checkZ = (bool)SvTRUE(ST(5)); + checkZ = (bool) SvTRUE(ST(5)); } RETVAL = THIS->CalculateNewPosition(x, y, z, speed, checkZ); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Mob_CalculateDistance); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_CalculateDistance) -{ +XS(XS_Mob_CalculateDistance) { dXSARGS; if (items != 4) Perl_croak(aTHX_ "Usage: Mob::CalculateDistance(THIS, float x, float y, float z)"); { - Mob * THIS; - float RETVAL; + Mob *THIS; + float RETVAL; dXSTARG; - float x = (float)SvNV(ST(1)); - float y = (float)SvNV(ST(2)); - float z = (float)SvNV(ST(3)); + float x = (float) SvNV(ST(1)); + float y = (float) SvNV(ST(2)); + float z = (float) SvNV(ST(3)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CalculateDistance(x, y, z); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Mob_SendTo); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SendTo) -{ +XS(XS_Mob_SendTo) { dXSARGS; if (items != 4) Perl_croak(aTHX_ "Usage: Mob::SendTo(THIS, float new_x, float new_y, float new_z)"); { - Mob * THIS; - float new_x = (float)SvNV(ST(1)); - float new_y = (float)SvNV(ST(2)); - float new_z = (float)SvNV(ST(3)); + Mob *THIS; + float new_x = (float) SvNV(ST(1)); + float new_y = (float) SvNV(ST(2)); + float new_z = (float) SvNV(ST(3)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SendTo(new_x, new_y, new_z); @@ -5939,24 +5615,22 @@ XS(XS_Mob_SendTo) } XS(XS_Mob_SendToFixZ); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SendToFixZ) -{ +XS(XS_Mob_SendToFixZ) { dXSARGS; if (items != 4) Perl_croak(aTHX_ "Usage: Mob::SendToFixZ(THIS, float new_x, float new_y, float new_z)"); { - Mob * THIS; - float new_x = (float)SvNV(ST(1)); - float new_y = (float)SvNV(ST(2)); - float new_z = (float)SvNV(ST(3)); + Mob *THIS; + float new_x = (float) SvNV(ST(1)); + float new_y = (float) SvNV(ST(2)); + float new_z = (float) SvNV(ST(3)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SendToFixZ(new_x, new_y, new_z); @@ -5965,25 +5639,24 @@ XS(XS_Mob_SendToFixZ) } XS(XS_Mob_NPCSpecialAttacks); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_NPCSpecialAttacks) -{ +XS(XS_Mob_NPCSpecialAttacks) { dXSARGS; if (items < 3 || items > 5) - Perl_croak(aTHX_ "Usage: Mob::NPCSpecialAttacks(THIS, string abilities_string, int perm_tag, [bool reset = true], [bool remove = true])"); + Perl_croak(aTHX_ + "Usage: Mob::NPCSpecialAttacks(THIS, string abilities_string, int perm_tag, [bool reset = true], [bool remove = true])"); { - Mob * THIS; - char* parse = (char *)SvPV_nolen(ST(1)); - int permtag = (int)SvIV(ST(2)); - bool reset = items == 4 ? (bool)SvTRUE(ST(3)) : true; - bool remove = items == 5 ? (bool)SvTRUE(ST(4)) : false; + Mob *THIS; + char *parse = (char *) SvPV_nolen(ST(1)); + int permtag = (int) SvIV(ST(2)); + bool reset = items == 4 ? (bool) SvTRUE(ST(3)) : true; + bool remove = items == 5 ? (bool) SvTRUE(ST(4)) : false; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->NPCSpecialAttacks(parse, permtag, reset, remove); @@ -5992,214 +5665,203 @@ XS(XS_Mob_NPCSpecialAttacks) } XS(XS_Mob_DontHealMeBefore); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_DontHealMeBefore) -{ +XS(XS_Mob_DontHealMeBefore) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::DontHealMeBefore(THIS)"); { - Mob * THIS; - uint32 RETVAL; + Mob *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->DontHealMeBefore(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_DontBuffMeBefore); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_DontBuffMeBefore) -{ +XS(XS_Mob_DontBuffMeBefore) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::DontBuffMeBefore(THIS)"); { - Mob * THIS; - uint32 RETVAL; + Mob *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->DontBuffMeBefore(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_DontDotMeBefore); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_DontDotMeBefore) -{ +XS(XS_Mob_DontDotMeBefore) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::DontDotMeBefore(THIS)"); { - Mob * THIS; - uint32 RETVAL; + Mob *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->DontDotMeBefore(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_DontRootMeBefore); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_DontRootMeBefore) -{ +XS(XS_Mob_DontRootMeBefore) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::DontRootMeBefore(THIS)"); { - Mob * THIS; - uint32 RETVAL; + Mob *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->DontRootMeBefore(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_DontSnareMeBefore); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_DontSnareMeBefore) -{ +XS(XS_Mob_DontSnareMeBefore) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::DontSnareMeBefore(THIS)"); { - Mob * THIS; - uint32 RETVAL; + Mob *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->DontSnareMeBefore(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetResist); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetResist) -{ +XS(XS_Mob_GetResist) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::GetResist(THIS, type)"); { - Mob * THIS; - int16 RETVAL; + Mob *THIS; + int16 RETVAL; dXSTARG; - uint8 type = (uint8)SvUV(ST(1)); + uint8 type = (uint8) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetResist(type); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetShieldTarget); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetShieldTarget) -{ +XS(XS_Mob_GetShieldTarget) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetShieldTarget(THIS)"); { - Mob * THIS; - Mob * RETVAL; + Mob *THIS; + Mob *RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetShieldTarget(); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Mob", (void*)RETVAL); + sv_setref_pv(ST(0), "Mob", (void *) RETVAL); } XSRETURN(1); } XS(XS_Mob_SetShieldTarget); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetShieldTarget) -{ +XS(XS_Mob_SetShieldTarget) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetShieldTarget(THIS, mob)"); { - Mob * THIS; - Mob* mob; + Mob *THIS; + Mob *mob; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - mob = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + mob = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "mob is not of type Mob"); - if(mob == nullptr) + if (mob == nullptr) Perl_croak(aTHX_ "mob is nullptr, avoiding crash."); THIS->SetShieldTarget(mob); @@ -6208,22 +5870,20 @@ XS(XS_Mob_SetShieldTarget) } XS(XS_Mob_Charmed); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_Charmed) -{ +XS(XS_Mob_Charmed) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::Charmed(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->Charmed(); @@ -6234,218 +5894,207 @@ XS(XS_Mob_Charmed) } XS(XS_Mob_GetLevelHP); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetLevelHP) -{ +XS(XS_Mob_GetLevelHP) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::GetLevelHP(THIS, uint8 level)"); { - Mob * THIS; - uint32 RETVAL; + Mob *THIS; + uint32 RETVAL; dXSTARG; - uint8 tlevel = (uint8)SvUV(ST(1)); + uint8 tlevel = (uint8) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLevelHP(tlevel); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetZoneID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetZoneID) -{ +XS(XS_Mob_GetZoneID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetZoneID(THIS)"); { - Mob * THIS; - uint32 RETVAL; + Mob *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetZoneID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_CheckAggroAmount); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_CheckAggroAmount) -{ +XS(XS_Mob_CheckAggroAmount) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::CheckAggroAmount(THIS, uint16 spell_id)"); { - Mob * THIS; - uint32 RETVAL; + Mob *THIS; + uint32 RETVAL; dXSTARG; - uint16 spellid = (uint16)SvUV(ST(1)); + uint16 spellid = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CheckAggroAmount(spellid, nullptr); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_CheckHealAggroAmount); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_CheckHealAggroAmount) -{ +XS(XS_Mob_CheckHealAggroAmount) { dXSARGS; if (items != 2 && items != 3) Perl_croak(aTHX_ "Usage: Mob::CheckHealAggroAmount(THIS, uint16 spell_id, uint32 possible_heal_amt)"); { - Mob * THIS; - uint32 RETVAL; + Mob *THIS; + uint32 RETVAL; dXSTARG; - uint16 spellid = (uint16)SvUV(ST(1)); - uint32 possible = 0; + uint16 spellid = (uint16) SvUV(ST(1)); + uint32 possible = 0; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - if(items == 3) - { - possible = (uint32)SvUV(ST(2)); + if (items == 3) { + possible = (uint32) SvUV(ST(2)); } RETVAL = THIS->CheckHealAggroAmount(spellid, nullptr, possible); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetAA); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetAA) -{ +XS(XS_Mob_GetAA) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::GetAA(THIS, uint32 rank_id)"); { - Mob * THIS; - uint32 RETVAL; + Mob *THIS; + uint32 RETVAL; dXSTARG; - uint32 rank_id = (uint32)SvUV(ST(1)); + uint32 rank_id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAA(rank_id); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetAAByAAID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetAAByAAID) -{ +XS(XS_Mob_GetAAByAAID) { dXSARGS; - if(items != 2) + if (items != 2) Perl_croak(aTHX_ "Usage: Mob::GetAAByAAID(THIS, uint32 aa_id)"); { - Mob * THIS; - uint32 RETVAL; + Mob *THIS; + uint32 RETVAL; dXSTARG; - uint32 aa_id = (uint32)SvUV(ST(1)); + uint32 aa_id = (uint32) SvUV(ST(1)); - if(sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + if (sv_derived_from(ST(0), "Mob")) { + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob *, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAAByAAID(aa_id); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_SetAA); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetAA) -{ +XS(XS_Mob_SetAA) { dXSARGS; - if(items < 3 || items > 4) + if (items < 3 || items > 4) Perl_croak(aTHX_ "Usage: Mob::SetAA(THIS, int aa_id, int points, [int charges = 0])"); { - Mob * THIS; - bool RETVAL; - int aa_id = (int)SvIV(ST(1)); - int points = (int)SvIV(ST(2)); - int charges = (items == 4) ? (int)SvIV(ST(3)) : 0; + Mob *THIS; + bool RETVAL; + int aa_id = (int) SvIV(ST(1)); + int points = (int) SvIV(ST(2)); + int charges = (items == 4) ? (int) SvIV(ST(3)) : 0; - if(sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + if (sv_derived_from(ST(0), "Mob")) { + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob *, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->SetAA(aa_id, points, charges); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Mob_DivineAura); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_DivineAura) -{ +XS(XS_Mob_DivineAura) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::DivineAura(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->DivineAura(); @@ -6456,31 +6105,28 @@ XS(XS_Mob_DivineAura) } XS(XS_Mob_AddFeignMemory); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_AddFeignMemory) -{ +XS(XS_Mob_AddFeignMemory) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::AddFeignMemory(THIS, Client* attacker)"); { - Mob * THIS; - Client* attacker; + Mob *THIS; + Client *attacker; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - attacker = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + attacker = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "attacker is not of type Client"); - if(attacker == nullptr) + if (attacker == nullptr) Perl_croak(aTHX_ "attacker is nullptr, avoiding crash."); THIS->AddFeignMemory(attacker); @@ -6489,31 +6135,28 @@ XS(XS_Mob_AddFeignMemory) } XS(XS_Mob_RemoveFromFeignMemory); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_RemoveFromFeignMemory) -{ +XS(XS_Mob_RemoveFromFeignMemory) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::RemoveFromFeignMemory(THIS, Client* attacker)"); { - Mob * THIS; - Client* attacker; + Mob *THIS; + Client *attacker; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - attacker = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + attacker = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "attacker is not of type Client"); - if(attacker == nullptr) + if (attacker == nullptr) Perl_croak(aTHX_ "attacker is nullptr, avoiding crash."); THIS->RemoveFromFeignMemory(attacker); @@ -6522,21 +6165,19 @@ XS(XS_Mob_RemoveFromFeignMemory) } XS(XS_Mob_ClearFeignMemory); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_ClearFeignMemory) -{ +XS(XS_Mob_ClearFeignMemory) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::ClearFeignMemory(THIS)"); { - Mob * THIS; + Mob *THIS; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ClearFeignMemory(); @@ -6545,22 +6186,20 @@ XS(XS_Mob_ClearFeignMemory) } XS(XS_Mob_SetOOCRegen); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetOOCRegen) -{ +XS(XS_Mob_SetOOCRegen) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetOOCRegen(THIS, int32 new_ooc_regen)"); { - Mob * THIS; - int32 newoocregen = (int32)SvIV(ST(1)); + Mob *THIS; + int32 newoocregen = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetOOCRegen(newoocregen); @@ -6569,77 +6208,73 @@ XS(XS_Mob_SetOOCRegen) } XS(XS_Mob_GetEntityVariable); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetEntityVariable) -{ +XS(XS_Mob_GetEntityVariable) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::GetEntityVariable(THIS, string id)"); { - Mob * THIS; - Const_char * id = SvPV_nolen(ST(1)); - Const_char * RETVAL; + Mob *THIS; + Const_char *id = SvPV_nolen(ST(1)); + Const_char *RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEntityVariable(id); - sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; + sv_setpv(TARG, RETVAL); + XSprePUSH; + PUSHTARG; } XSRETURN(1); } XS(XS_Mob_EntityVariableExists); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_EntityVariableExists) -{ +XS(XS_Mob_EntityVariableExists) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::EntityVariableExists(THIS, string id)"); { - Mob * THIS; - Const_char * id = SvPV_nolen(ST(1)); - bool RETVAL; + Mob *THIS; + Const_char *id = SvPV_nolen(ST(1)); + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->EntityVariableExists(id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Mob_SetEntityVariable); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetEntityVariable) -{ +XS(XS_Mob_SetEntityVariable) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Mob::SetEntityVariable(THIS, string id, string var)"); { - Mob * THIS; - Const_char * id = SvPV_nolen(ST(1)); - const char * var = (const char *)SvPV_nolen(ST(2)); + Mob *THIS; + Const_char *id = SvPV_nolen(ST(1)); + const char *var = (const char *) SvPV_nolen(ST(2)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetEntityVariable(id, var); @@ -6648,8 +6283,7 @@ XS(XS_Mob_SetEntityVariable) } XS(XS_Mob_GetHateList); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetHateList) -{ +XS(XS_Mob_GetHateList) { dXSARGS; int num_entries = 0; if (items != 1) @@ -6658,23 +6292,21 @@ XS(XS_Mob_GetHateList) Mob *THIS; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); auto hate_list = THIS->GetHateList(); - auto iter = hate_list.begin(); + auto iter = hate_list.begin(); - while(iter != hate_list.end()) - { + while (iter != hate_list.end()) { struct_HateList *entry = (*iter); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "HateEntry", (void*)entry); + sv_setref_pv(ST(0), "HateEntry", (void *) entry); XPUSHs(ST(0)); num_entries++; iter++; @@ -6684,32 +6316,29 @@ XS(XS_Mob_GetHateList) } XS(XS_Mob_SignalClient); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SignalClient) -{ +XS(XS_Mob_SignalClient) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Mob::SignalClient(THIS, Client* client, uint32 data)"); { - Mob * THIS; - Client* client = nullptr; - uint32 data = (uint32)SvUV(ST(2)); + Mob *THIS; + Client *client = nullptr; + uint32 data = (uint32) SvUV(ST(2)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - client = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + client = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "client is not of type Client"); - if(client == nullptr) + if (client == nullptr) Perl_croak(aTHX_ "client is nullptr, avoiding crash."); client->Signal(data); @@ -6718,81 +6347,74 @@ XS(XS_Mob_SignalClient) } XS(XS_Mob_CombatRange); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_CombatRange) -{ +XS(XS_Mob_CombatRange) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::CombatRange(THIS, Mob* target)"); { - Mob * THIS; - Mob * target = nullptr; - bool RETVAL; + Mob *THIS; + Mob *target = nullptr; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - target = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + target = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "target is not of type Mob"); - if(target == nullptr) + if (target == nullptr) Perl_croak(aTHX_ "target is nullptr, avoiding crash."); RETVAL = THIS->CombatRange(target); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Mob_DoSpecialAttackDamage); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_DoSpecialAttackDamage) -{ +XS(XS_Mob_DoSpecialAttackDamage) { dXSARGS; if (items < 4 || items > 6) - Perl_croak(aTHX_ "Usage: Mob::DoSpecialAttackDamage(THIS, Mob* target, int skill, int32 max_damage, [int32 min_damage = 1], [int32 hate_override = -11])"); + Perl_croak(aTHX_ + "Usage: Mob::DoSpecialAttackDamage(THIS, Mob* target, int skill, int32 max_damage, [int32 min_damage = 1], [int32 hate_override = -11])"); { - Mob * THIS; - Mob* target; - EQEmu::skills::SkillType attack_skill = (EQEmu::skills::SkillType)SvUV(ST(2)); - int32 max_damage = (int32)SvIV(ST(3)); - int32 min_damage = 1; - int32 hate_override = -11; + Mob *THIS; + Mob *target; + EQEmu::skills::SkillType attack_skill = (EQEmu::skills::SkillType) SvUV(ST(2)); + int32 max_damage = (int32) SvIV(ST(3)); + int32 min_damage = 1; + int32 hate_override = -11; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - target = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + target = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "target is not of type Mob"); - if(target == nullptr) + if (target == nullptr) Perl_croak(aTHX_ "target is nullptr, avoiding crash."); - if (items > 4) - { - min_damage = (int32)SvIV(ST(4)); + if (items > 4) { + min_damage = (int32) SvIV(ST(4)); } - if (items == 6) - { - hate_override = (int32)SvIV(ST(5)); + if (items == 6) { + hate_override = (int32) SvIV(ST(5)); } THIS->DoSpecialAttackDamage(target, attack_skill, max_damage, min_damage, hate_override); @@ -6801,32 +6423,29 @@ XS(XS_Mob_DoSpecialAttackDamage) } XS(XS_Mob_CheckLoS); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_CheckLoS) -{ +XS(XS_Mob_CheckLoS) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::CheckLoS(THIS, Mob*)"); { - Mob * THIS; - Mob* mob; - bool RETVAL; + Mob *THIS; + Mob *mob; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - mob = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + mob = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "mob is not of type Mob"); - if(mob == nullptr) + if (mob == nullptr) Perl_croak(aTHX_ "mob is nullptr, avoiding crash."); RETVAL = THIS->CheckLosFN(mob); @@ -6837,33 +6456,30 @@ XS(XS_Mob_CheckLoS) } XS(XS_Mob_CheckLoSToLoc); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_CheckLoSToLoc) -{ +XS(XS_Mob_CheckLoSToLoc) { dXSARGS; if (items != 4 && items != 5) Perl_croak(aTHX_ "Usage: Mob::CheckLoSToLoc(THIS, float x, float y, float z, float mob_size)"); { - Mob * THIS; - float loc_x = (float)SvNV(ST(1)); - float loc_y = (float)SvNV(ST(2)); - float loc_z = (float)SvNV(ST(3)); - float mob_size; - bool RETVAL; + Mob *THIS; + float loc_x = (float) SvNV(ST(1)); + float loc_y = (float) SvNV(ST(2)); + float loc_z = (float) SvNV(ST(3)); + float mob_size; + bool RETVAL; if (items == 5) { - mob_size = (float)SvNV(ST(4)); - } - else { + mob_size = (float) SvNV(ST(4)); + } else { mob_size = 6; } if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CheckLosFN(loc_x, loc_y, loc_z, mob_size); @@ -6874,94 +6490,90 @@ XS(XS_Mob_CheckLoSToLoc) } XS(XS_Mob_FindGroundZ); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_FindGroundZ) -{ +XS(XS_Mob_FindGroundZ) { dXSARGS; if (items != 3 && items != 4) Perl_croak(aTHX_ "Usage: Mob::FindGroundZ(THIS, float x, float y, float z_offset)"); { - Mob * THIS; - float new_x = (float)SvNV(ST(1)); - float new_y = (float)SvNV(ST(2)); - float z_offset; - float RETVAL; + Mob *THIS; + float new_x = (float) SvNV(ST(1)); + float new_y = (float) SvNV(ST(2)); + float z_offset; + float RETVAL; dXSTARG; if (items == 4) { - z_offset = (float)SvNV(ST(3)); - } - else { + z_offset = (float) SvNV(ST(3)); + } else { z_offset = 10; } if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGroundZ(new_x, new_y, z_offset); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Mob_ProjectileAnim); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_ProjectileAnim) -{ +XS(XS_Mob_ProjectileAnim) { dXSARGS; if (items < 3 || items > 9) - Perl_croak(aTHX_ "Usage: Mob::ProjectileAnim(THIS, Mob* mob, int item_id, [bool is_arrow = false], [float speed = 0], [float angle = 0], [float tilt = 0], [float arc = 0])"); + Perl_croak(aTHX_ + "Usage: Mob::ProjectileAnim(THIS, Mob* mob, int item_id, [bool is_arrow = false], [float speed = 0], [float angle = 0], [float tilt = 0], [float arc = 0])"); { - Mob * THIS; - Mob* mob; - int item_id = SvUV(ST(2)); - bool IsArrow = false; - float speed = 0; - float angle = 0; - float tilt = 0; - float arc = 0; - char * IDFile = nullptr; + Mob *THIS; + Mob *mob; + int item_id = SvUV(ST(2)); + bool IsArrow = false; + float speed = 0; + float angle = 0; + float tilt = 0; + float arc = 0; + char *IDFile = nullptr; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - mob = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + mob = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "mob is not of type Mob"); - if(mob == nullptr) + if (mob == nullptr) Perl_croak(aTHX_ "mob is nullptr, avoiding crash."); - if(items > 3){ - IsArrow = (bool)SvTRUE(ST(3)); + if (items > 3) { + IsArrow = (bool) SvTRUE(ST(3)); } - if(items > 4){ - speed = (float)SvNV(ST(4)); + if (items > 4) { + speed = (float) SvNV(ST(4)); } - if(items > 5){ - angle = (float)SvNV(ST(5)); + if (items > 5) { + angle = (float) SvNV(ST(5)); } - if(items > 6){ - tilt = (float)SvNV(ST(6)); + if (items > 6) { + tilt = (float) SvNV(ST(6)); } - if(items > 7){ - arc = (float)SvNV(ST(7)); + if (items > 7) { + arc = (float) SvNV(ST(7)); } - if (items > 8) { IDFile = (char *)SvPV_nolen(ST(8)); } + if (items > 8) { IDFile = (char *) SvPV_nolen(ST(8)); } THIS->ProjectileAnimation(mob, item_id, IsArrow, speed, angle, tilt, arc, IDFile); @@ -6970,68 +6582,64 @@ XS(XS_Mob_ProjectileAnim) } XS(XS_Mob_HasNPCSpecialAtk); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_HasNPCSpecialAtk) -{ +XS(XS_Mob_HasNPCSpecialAtk) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::HasNPCSpecialAtk(THIS, string ability_string)"); { - Mob * THIS; - char* parse = (char *)SvPV_nolen(ST(1)); - bool RETVAL; + Mob *THIS; + char *parse = (char *) SvPV_nolen(ST(1)); + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->HasNPCSpecialAtk(parse); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Mob_SendAppearanceEffect); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SendAppearanceEffect) -{ +XS(XS_Mob_SendAppearanceEffect) { dXSARGS; if (items < 2 || items > 7) - Perl_croak(aTHX_ "Usage: Mob::SendAppearanceEffect(THIS, int32 param_1, [int32 param_2 = 0], [int32 param_3 = 0], [int32 param_4 = 0], [int32 param_5 = 0], [Client* single_client_to_send_to = null])"); + Perl_croak(aTHX_ + "Usage: Mob::SendAppearanceEffect(THIS, int32 param_1, [int32 param_2 = 0], [int32 param_3 = 0], [int32 param_4 = 0], [int32 param_5 = 0], [Client* single_client_to_send_to = null])"); { - Mob * THIS; - int32 parm1 = (int32)SvIV(ST(1)); - int32 parm2 = 0; - int32 parm3 = 0; - int32 parm4 = 0; - int32 parm5 = 0; - Client* client = nullptr; + Mob *THIS; + int32 parm1 = (int32) SvIV(ST(1)); + int32 parm2 = 0; + int32 parm3 = 0; + int32 parm4 = 0; + int32 parm5 = 0; + Client *client = nullptr; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - if (items > 2) { parm2 = (int32)SvIV(ST(2)); } - if (items > 3) { parm3 = (int32)SvIV(ST(3)); } - if (items > 4) { parm4 = (int32)SvIV(ST(4)); } - if (items > 5) { parm5 = (int32)SvIV(ST(5)); } - if (items > 6) { + if (items > 2) { parm2 = (int32) SvIV(ST(2)); } + if (items > 3) { parm3 = (int32) SvIV(ST(3)); } + if (items > 4) { parm4 = (int32) SvIV(ST(4)); } + if (items > 5) { parm5 = (int32) SvIV(ST(5)); } + if (items > 6) { if (sv_derived_from(ST(6), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(6))); - client = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(6))); + client = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "client is not of type Client"); - if(client == nullptr) + if (client == nullptr) Perl_croak(aTHX_ "client is nullptr, avoiding crash."); } @@ -7041,22 +6649,20 @@ XS(XS_Mob_SendAppearanceEffect) } XS(XS_Mob_SetFlyMode); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetFlyMode) -{ +XS(XS_Mob_SetFlyMode) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetFlyMode(THIS, uint8 flymode[0|1|2|3])"); { - Mob * THIS; - uint8 flymode = (uint8)SvIV(ST(1)); + Mob *THIS; + uint8 flymode = (uint8) SvIV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetFlyMode(flymode); @@ -7065,22 +6671,20 @@ XS(XS_Mob_SetFlyMode) } XS(XS_Mob_SetTexture); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetTexture) -{ +XS(XS_Mob_SetTexture) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetTexture(THIS, int32 texture)"); { - Mob * THIS; - int32 texture = (int32)SvIV(ST(1)); + Mob *THIS; + int32 texture = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SendIllusionPacket(THIS->GetRace(), 0xFF, texture); @@ -7089,22 +6693,20 @@ XS(XS_Mob_SetTexture) } XS(XS_Mob_SetRace); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetRace) -{ +XS(XS_Mob_SetRace) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetRace(THIS, int32 race)"); { - Mob * THIS; - int32 race = (int32)SvIV(ST(1)); + Mob *THIS; + int32 race = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SendIllusionPacket(race); @@ -7113,163 +6715,156 @@ XS(XS_Mob_SetRace) } XS(XS_Mob_SetGender); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetGender) -{ +XS(XS_Mob_SetGender) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetGender(THIS, int32 gender)"); { - Mob * THIS; - int32 gender = (int32)SvIV(ST(1)); + Mob *THIS; + int32 gender = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - THIS->SendIllusionPacket(THIS->GetRace(),gender); + THIS->SendIllusionPacket(THIS->GetRace(), gender); } XSRETURN_EMPTY; } XS(XS_Mob_SendIllusion); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SendIllusion) -{ +XS(XS_Mob_SendIllusion) { dXSARGS; if (items < 2 || items > 14) - Perl_croak(aTHX_ "Usage: Mob::SendIllusion(THIS, uint16 race, [uint8 gender = 0xFF], [uint8 texture = 0xFF], [unit8 helmtexture = 0xFF], [unit8 face = 0xFF], [unit8 hairstyle = 0xFF], [uint8 hair_color = 0xFF], [uint8 beard = 0xFF], [uint8 beard_color = 0xFF], [uint32 drakkin_heritage = 0xFFFFFFFF], [uint32 drakkin_tattoo = 0xFFFFFFFF], [uint32 drakkin_details = 0xFFFFFFFF], [float size = -1])"); + Perl_croak(aTHX_ + "Usage: Mob::SendIllusion(THIS, uint16 race, [uint8 gender = 0xFF], [uint8 texture = 0xFF], [unit8 helmtexture = 0xFF], [unit8 face = 0xFF], [unit8 hairstyle = 0xFF], [uint8 hair_color = 0xFF], [uint8 beard = 0xFF], [uint8 beard_color = 0xFF], [uint32 drakkin_heritage = 0xFFFFFFFF], [uint32 drakkin_tattoo = 0xFFFFFFFF], [uint32 drakkin_details = 0xFFFFFFFF], [float size = -1])"); { - Mob * THIS; - uint16 race = (uint16)SvIV(ST(1)); - uint8 gender = 0xFF; - uint8 texture = 0xFF; - uint8 helmtexture = 0xFF; - uint8 face = 0xFF; - uint8 hairstyle = 0xFF; - uint8 haircolor = 0xFF; - uint8 beard = 0xFF; - uint8 beardcolor = 0xFF; - uint32 drakkin_heritage = 0xFFFFFFFF; - uint32 drakkin_tattoo = 0xFFFFFFFF; - uint32 drakkin_details = 0xFFFFFFFF; - float size = -1.0f; + Mob *THIS; + uint16 race = (uint16) SvIV(ST(1)); + uint8 gender = 0xFF; + uint8 texture = 0xFF; + uint8 helmtexture = 0xFF; + uint8 face = 0xFF; + uint8 hairstyle = 0xFF; + uint8 haircolor = 0xFF; + uint8 beard = 0xFF; + uint8 beardcolor = 0xFF; + uint32 drakkin_heritage = 0xFFFFFFFF; + uint32 drakkin_tattoo = 0xFFFFFFFF; + uint32 drakkin_details = 0xFFFFFFFF; + float size = -1.0f; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - if(items > 2) {gender = (uint8)SvIV(ST(2));} - if(items > 3) {texture = (uint8)SvIV(ST(3));} - if(items > 4) {helmtexture = (uint8)SvIV(ST(4));} - if(items > 5) {face = (uint8)SvIV(ST(5));} - if(items > 6) {hairstyle = (uint8)SvIV(ST(6));} - if(items > 7) {haircolor = (uint8)SvIV(ST(7));} - if(items > 8) {beard = (uint8)SvIV(ST(8));} - if(items > 9) {beardcolor = (uint8)SvIV(ST(9));} - if(items > 10) {drakkin_heritage = (uint32)SvIV(ST(10));} - if(items > 11) {drakkin_tattoo = (uint32)SvIV(ST(11));} - if(items > 12) {drakkin_details = (uint32)SvIV(ST(12));} - if(items > 13) {size = (float)SvNV(ST(13));} + if (items > 2) { gender = (uint8) SvIV(ST(2)); } + if (items > 3) { texture = (uint8) SvIV(ST(3)); } + if (items > 4) { helmtexture = (uint8) SvIV(ST(4)); } + if (items > 5) { face = (uint8) SvIV(ST(5)); } + if (items > 6) { hairstyle = (uint8) SvIV(ST(6)); } + if (items > 7) { haircolor = (uint8) SvIV(ST(7)); } + if (items > 8) { beard = (uint8) SvIV(ST(8)); } + if (items > 9) { beardcolor = (uint8) SvIV(ST(9)); } + if (items > 10) { drakkin_heritage = (uint32) SvIV(ST(10)); } + if (items > 11) { drakkin_tattoo = (uint32) SvIV(ST(11)); } + if (items > 12) { drakkin_details = (uint32) SvIV(ST(12)); } + if (items > 13) { size = (float) SvNV(ST(13)); } - THIS->SendIllusionPacket(race,gender,texture,helmtexture,haircolor,beardcolor,0xFF,0xFF, - hairstyle,face,beard,0xFF,drakkin_heritage,drakkin_tattoo,drakkin_details,size); + THIS->SendIllusionPacket(race, gender, texture, helmtexture, haircolor, beardcolor, 0xFF, 0xFF, + hairstyle, face, beard, 0xFF, drakkin_heritage, drakkin_tattoo, drakkin_details, size); } XSRETURN_EMPTY; } XS(XS_Mob_CameraEffect); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_CameraEffect) -{ +XS(XS_Mob_CameraEffect) { dXSARGS; if (items < 2 || items > 5) - Perl_croak(aTHX_ "Usage: Mob::CameraEffect(THIS, uint32 duration, [uint32 intensity = 0], [Client* single_client = nullptr], [bool is_world_wide = false])"); + Perl_croak(aTHX_ + "Usage: Mob::CameraEffect(THIS, uint32 duration, [uint32 intensity = 0], [Client* single_client = nullptr], [bool is_world_wide = false])"); { - Mob * THIS; - uint32 duration = (uint32)SvUV(ST(1)); - uint32 intensity = 0; - Client* client = nullptr; - bool global = false; - bool nullcli = false; + Mob *THIS; + uint32 duration = (uint32) SvUV(ST(1)); + uint32 intensity = 0; + Client *client = nullptr; + bool global = false; + bool nullcli = false; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - if (items > 2) { intensity = (uint32)SvUV(ST(2)); } - if (items > 3) { + if (items > 2) { intensity = (uint32) SvUV(ST(2)); } + if (items > 3) { if (sv_derived_from(ST(3), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(3))); - client = INT2PTR(Client *,tmp); - } - else - nullcli = true; - if(client == nullptr) - nullcli = true; - //Perl_croak(aTHX_ "client is nullptr, avoiding crash."); + IV tmp = SvIV((SV *) SvRV(ST(3))); + client = INT2PTR(Client *, tmp); + } else + nullcli = true; + if (client == nullptr) + nullcli = true; + //Perl_croak(aTHX_ "client is nullptr, avoiding crash."); } - if (items > 4) { global = (bool)SvTRUE(ST(4)); } + if (items > 4) { global = (bool) SvTRUE(ST(4)); } - if(nullcli) - THIS->CameraEffect(duration, intensity, 0, global); + if (nullcli) + THIS->CameraEffect(duration, intensity, 0, global); else - THIS->CameraEffect(duration, intensity, client, global); + THIS->CameraEffect(duration, intensity, client, global); } XSRETURN_EMPTY; } XS(XS_Mob_SpellEffect); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SpellEffect) -{ +XS(XS_Mob_SpellEffect) { dXSARGS; if (items < 2 || items > 8) - Perl_croak(aTHX_ "Usage: Mob::SpellEffect(THIS, uint32 effect, [uint32 duration = 5000], [uint32 finish_delay = 0], [bool zone_wide = false], [uint32 unk20 = 3000], [bool perm_effect = false], [Client* single_client])"); + Perl_croak(aTHX_ + "Usage: Mob::SpellEffect(THIS, uint32 effect, [uint32 duration = 5000], [uint32 finish_delay = 0], [bool zone_wide = false], [uint32 unk20 = 3000], [bool perm_effect = false], [Client* single_client])"); { - Mob * THIS; - uint32 effect = (uint32)SvUV(ST(1)); - uint32 duration = 5000; - uint32 finish_delay = 0; - bool zone_wide = true; - uint32 unk20 = 3000; - bool perm_effect = false; - Client* client = nullptr; + Mob *THIS; + uint32 effect = (uint32) SvUV(ST(1)); + uint32 duration = 5000; + uint32 finish_delay = 0; + bool zone_wide = true; + uint32 unk20 = 3000; + bool perm_effect = false; + Client *client = nullptr; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - if (items > 2) { duration = (uint32)SvUV(ST(2)); } - if (items > 3) { finish_delay = (uint32)SvUV(ST(3)); } - if (items > 4) { zone_wide = (bool)SvTRUE(ST(4)); } - if (items > 5) { unk20 = (uint32)SvUV(ST(5)); } - if (items > 6) { perm_effect = (bool)SvTRUE(ST(6)); } - if (items > 7) { + if (items > 2) { duration = (uint32) SvUV(ST(2)); } + if (items > 3) { finish_delay = (uint32) SvUV(ST(3)); } + if (items > 4) { zone_wide = (bool) SvTRUE(ST(4)); } + if (items > 5) { unk20 = (uint32) SvUV(ST(5)); } + if (items > 6) { perm_effect = (bool) SvTRUE(ST(6)); } + if (items > 7) { if (sv_derived_from(ST(7), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(7))); - client = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(7))); + client = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "client is not of type Client"); - if(client == nullptr) + if (client == nullptr) Perl_croak(aTHX_ "client is nullptr, avoiding crash."); } @@ -7281,25 +6876,23 @@ XS(XS_Mob_SpellEffect) XS(XS_Mob_TempName); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_TempName) -{ +XS(XS_Mob_TempName) { dXSARGS; if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: Mob::TempName(THIS, string name)"); { - Mob * THIS; - char * name = nullptr; + Mob *THIS; + char *name = nullptr; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - if (items > 1) { name = (char *)SvPV_nolen(ST(1)); } + if (items > 1) { name = (char *) SvPV_nolen(ST(1)); } THIS->TempName(name); } @@ -7307,51 +6900,48 @@ XS(XS_Mob_TempName) } XS(XS_Mob_GetItemStat); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetItemStat) -{ +XS(XS_Mob_GetItemStat) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Mob::GetItemStat(THIS, uint32 item_id, string stat)"); { - Mob * THIS; - int32 RETVAL; - uint32 itemid = (uint32)SvUV(ST(1)); - Const_char * stat = (Const_char *)SvPV_nolen(ST(2)); + Mob *THIS; + int32 RETVAL; + uint32 itemid = (uint32) SvUV(ST(1)); + Const_char *stat = (Const_char *) SvPV_nolen(ST(2)); dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetItemStat(itemid, stat); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetGlobal); -XS(XS_Mob_GetGlobal) -{ +XS(XS_Mob_GetGlobal) { dXSARGS; if (items < 2) Perl_croak(aTHX_ "Usage: GetGlobal(THIS, string var_name)"); { - Mob* THIS; - Const_char* varname = (Const_char*)SvPV_nolen(ST(1)); + Mob *THIS; + Const_char *varname = (Const_char *) SvPV_nolen(ST(1)); std::string ret_val = "Undefined"; - Const_char* RETVAL; + Const_char *RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob *, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); @@ -7360,42 +6950,42 @@ XS(XS_Mob_GetGlobal) ret_val = THIS->GetGlobal(varname); RETVAL = ret_val.c_str(); - sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; + sv_setpv(TARG, RETVAL); + XSprePUSH; + PUSHTARG; } XSRETURN(1); } XS(XS_Mob_SetGlobal); -XS(XS_Mob_SetGlobal) -{ +XS(XS_Mob_SetGlobal) { dXSARGS; if (items < 5 || items > 6) - Perl_croak(aTHX_ "Usage: SetGlobal(THIS, string var_name, string new_value, int options, string duration, [Mob* other = nullptr])"); + Perl_croak(aTHX_ + "Usage: SetGlobal(THIS, string var_name, string new_value, int options, string duration, [Mob* other = nullptr])"); { - Mob * THIS; - char * varname = (char *)SvPV_nolen(ST(1)); - char * newvalue = (char *)SvPV_nolen(ST(2)); - int options = (int)SvIV(ST(3)); - char * duration = (char *)SvPV_nolen(ST(4)); - Mob * other = nullptr; + Mob *THIS; + char *varname = (char *) SvPV_nolen(ST(1)); + char *newvalue = (char *) SvPV_nolen(ST(2)); + int options = (int) SvIV(ST(3)); + char *duration = (char *) SvPV_nolen(ST(4)); + Mob *other = nullptr; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 5) { if (sv_derived_from(ST(5), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(5))); - other = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(5))); + other = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(other == nullptr) + if (other == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); } @@ -7405,27 +6995,26 @@ XS(XS_Mob_SetGlobal) } XS(XS_Mob_TarGlobal); -XS(XS_Mob_TarGlobal) -{ +XS(XS_Mob_TarGlobal) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ "Usage: TarGlobal(THIS, string var_name, string value, string duration, int npc_id, int character_id, int zone_id)"); + Perl_croak(aTHX_ + "Usage: TarGlobal(THIS, string var_name, string value, string duration, int npc_id, int character_id, int zone_id)"); { - Mob * THIS; - char * varname = (char *)SvPV_nolen(ST(1)); - char * value = (char *)SvPV_nolen(ST(2)); - char * duration = (char *)SvPV_nolen(ST(3)); - int npcid = (int)SvIV(ST(4)); - int charid = (int)SvIV(ST(5)); - int zoneid = (int)SvIV(ST(6)); + Mob *THIS; + char *varname = (char *) SvPV_nolen(ST(1)); + char *value = (char *) SvPV_nolen(ST(2)); + char *duration = (char *) SvPV_nolen(ST(3)); + int npcid = (int) SvIV(ST(4)); + int charid = (int) SvIV(ST(5)); + int zoneid = (int) SvIV(ST(6)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->TarGlobal(varname, value, duration, npcid, charid, zoneid); @@ -7434,22 +7023,20 @@ XS(XS_Mob_TarGlobal) } XS(XS_Mob_DelGlobal); -XS(XS_Mob_DelGlobal) -{ +XS(XS_Mob_DelGlobal) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: DelGlobal(THIS, string var_name)"); { - Mob * THIS; - char * varname = (char *)SvPV_nolen(ST(1)); + Mob *THIS; + char *varname = (char *) SvPV_nolen(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->DelGlobal(varname); @@ -7458,25 +7045,24 @@ XS(XS_Mob_DelGlobal) } XS(XS_Mob_SetSlotTint); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetSlotTint) -{ +XS(XS_Mob_SetSlotTint) { dXSARGS; if (items != 5) - Perl_croak(aTHX_ "Usage: Mob::SetSlotTint(THIS, uint8 material_slot, uint8 red_tint, uint8 green_tint, uint8 blue_tint)"); + Perl_croak(aTHX_ + "Usage: Mob::SetSlotTint(THIS, uint8 material_slot, uint8 red_tint, uint8 green_tint, uint8 blue_tint)"); { - Mob * THIS; - uint8 material_slot = (uint8)SvIV(ST(1)); - uint8 red_tint = (uint8)SvIV(ST(2)); - uint8 green_tint = (uint8)SvIV(ST(3)); - uint8 blue_tint = (uint8)SvIV(ST(4)); + Mob *THIS; + uint8 material_slot = (uint8) SvIV(ST(1)); + uint8 red_tint = (uint8) SvIV(ST(2)); + uint8 green_tint = (uint8) SvIV(ST(3)); + uint8 blue_tint = (uint8) SvIV(ST(4)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSlotTint(material_slot, red_tint, green_tint, blue_tint); @@ -7485,32 +7071,31 @@ XS(XS_Mob_SetSlotTint) } XS(XS_Mob_WearChange); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_WearChange) -{ +XS(XS_Mob_WearChange) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ "Usage: Mob::WearChange(THIS, uint8 material_slot, uint16 texture, [uint32 color = 0, uint32 hero_forge_model = 0])"); + Perl_croak(aTHX_ + "Usage: Mob::WearChange(THIS, uint8 material_slot, uint16 texture, [uint32 color = 0, uint32 hero_forge_model = 0])"); { - Mob * THIS; - uint8 material_slot = (uint8)SvIV(ST(1)); - uint16 texture = (uint16)SvUV(ST(2)); - uint32 color = 0; - uint32 hero_forge_model = 0; + Mob *THIS; + uint8 material_slot = (uint8) SvIV(ST(1)); + uint16 texture = (uint16) SvUV(ST(2)); + uint32 color = 0; + uint32 hero_forge_model = 0; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 3) { - color = (uint32)SvUV(ST(3)); + color = (uint32) SvUV(ST(3)); } if (items > 4) { - hero_forge_model = (uint32)SvUV(ST(3)); + hero_forge_model = (uint32) SvUV(ST(3)); } THIS->WearChange(material_slot, texture, color, hero_forge_model); @@ -7519,33 +7104,30 @@ XS(XS_Mob_WearChange) } XS(XS_Mob_DoKnockback); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_DoKnockback) -{ +XS(XS_Mob_DoKnockback) { dXSARGS; if (items != 4) Perl_croak(aTHX_ "Usage: Mob::DoKnockback(THIS, Mob* caster, uint32 push_back_amount, uint32 push_up_amount)"); { - Mob * THIS; - Mob * caster; - uint32 pushback = (uint16)SvUV(ST(2)); - uint32 pushup = (uint16)SvUV(ST(2)); + Mob *THIS; + Mob *caster; + uint32 pushback = (uint16) SvUV(ST(2)); + uint32 pushup = (uint16) SvUV(ST(2)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - caster = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + caster = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "caster is not of type Mob"); - if(caster == nullptr) + if (caster == nullptr) Perl_croak(aTHX_ "caster is nullptr, avoiding crash."); THIS->DoKnockback(caster, pushback, pushup); @@ -7554,22 +7136,20 @@ XS(XS_Mob_DoKnockback) } XS(XS_Mob_RemoveNimbusEffect); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_RemoveNimbusEffect) -{ +XS(XS_Mob_RemoveNimbusEffect) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::RemoveNimbusEffect(THIS, int32 effect_id)"); { - Mob * THIS; - int32 effectid = (int32)SvIV(ST(1)); + Mob *THIS; + int32 effectid = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveNimbusEffect(effectid); @@ -7578,22 +7158,20 @@ XS(XS_Mob_RemoveNimbusEffect) } XS(XS_Mob_SetRunning); -XS(XS_Mob_SetRunning) -{ +XS(XS_Mob_SetRunning) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetRunning(THIS, bool value)"); { - Mob * THIS; - bool value = (bool)SvTRUE(ST(1)); + Mob *THIS; + bool value = (bool) SvTRUE(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetRunning(value); @@ -7602,23 +7180,21 @@ XS(XS_Mob_SetRunning) } XS(XS_Mob_IsRunning); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsRunning) -{ +XS(XS_Mob_IsRunning) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob:::IsRunning(THIS)"); { - Mob * THIS; + Mob *THIS; bool RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsRunning(); @@ -7629,51 +7205,47 @@ XS(XS_Mob_IsRunning) } XS(XS_Mob_SetBodyType); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetBodyType) -{ +XS(XS_Mob_SetBodyType) { dXSARGS; if (items < 2 || items > 3) Perl_croak(aTHX_ "Usage: Mob::SetBodyType(THIS, int32 type, [bool overwrite_orig = false])"); { - Mob * THIS; - int32 type = (int32)SvIV(ST(1)); - bool overwrite_orig = false; + Mob *THIS; + int32 type = (int32) SvIV(ST(1)); + bool overwrite_orig = false; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - if(items == 3) { - overwrite_orig = (bool)SvTRUE(ST(2)); + if (items == 3) { + overwrite_orig = (bool) SvTRUE(ST(2)); } - THIS->SetBodyType((bodyType)type, overwrite_orig); + THIS->SetBodyType((bodyType) type, overwrite_orig); } XSRETURN_EMPTY; } XS(XS_Mob_SetDeltas); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetDeltas) -{ +XS(XS_Mob_SetDeltas) { dXSARGS; if (items != 5) Perl_croak(aTHX_ "Usage: Mob::SetDeltas(THIS, float delta_x, float delta_y, float delta_z, float delta_h)"); { - Mob * THIS; - auto delta = glm::vec4((float)SvNV(ST(1)), (float)SvNV(ST(2)), (float)SvNV(ST(3)), (float)SvNV(ST(4))); + Mob *THIS; + auto delta = glm::vec4((float) SvNV(ST(1)), (float) SvNV(ST(2)), (float) SvNV(ST(3)), (float) SvNV(ST(4))); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetDelta(delta); @@ -7682,22 +7254,20 @@ XS(XS_Mob_SetDeltas) } XS(XS_Mob_SetLD); -XS(XS_Mob_SetLD) -{ +XS(XS_Mob_SetLD) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetLD(THIS, bool value)"); { - Mob * THIS; - bool value = (bool)SvTRUE(ST(1)); + Mob *THIS; + bool value = (bool) SvTRUE(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SendAppearancePacket(AT_Linkdead, value); @@ -7706,22 +7276,20 @@ XS(XS_Mob_SetLD) } XS(XS_Mob_SetTargetDestSteps); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetTargetDestSteps) -{ +XS(XS_Mob_SetTargetDestSteps) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetTargetDestSteps(THIS, uint8 target_steps)"); { - Mob * THIS; - uint8 target_steps = (uint8)SvIV(ST(1)); + Mob *THIS; + uint8 target_steps = (uint8) SvIV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetTargetDestSteps(target_steps); @@ -7730,22 +7298,20 @@ XS(XS_Mob_SetTargetDestSteps) } XS(XS_Mob_SetTargetable); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetTargetable) -{ +XS(XS_Mob_SetTargetable) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetTargetable(THIS, bool targetable)"); { - Mob * THIS; - bool on = (bool)SvTRUE(ST(1)); + Mob *THIS; + bool on = (bool) SvTRUE(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetTargetable(on); @@ -7754,101 +7320,95 @@ XS(XS_Mob_SetTargetable) } XS(XS_Mob_ModSkillDmgTaken); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_ModSkillDmgTaken) -{ +XS(XS_Mob_ModSkillDmgTaken) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Mob::ModSkillDmgTaken(THIS, int skill, int16 value)"); { - Mob * THIS; - EQEmu::skills::SkillType skill_num = (EQEmu::skills::SkillType)SvUV(ST(1)); - int16 value = (int16)SvIV(ST(2)); + Mob *THIS; + EQEmu::skills::SkillType skill_num = (EQEmu::skills::SkillType) SvUV(ST(1)); + int16 value = (int16) SvIV(ST(2)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - THIS->ModSkillDmgTaken(skill_num,value); + THIS->ModSkillDmgTaken(skill_num, value); } XSRETURN_EMPTY; } XS(XS_Mob_GetModSkillDmgTaken); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetModSkillDmgTaken) -{ +XS(XS_Mob_GetModSkillDmgTaken) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::GetModSkillDmgTaken(THIS, int skill_id)"); { - Mob * THIS; - int16 RETVAL; + Mob *THIS; + int16 RETVAL; dXSTARG; - EQEmu::skills::SkillType skill_num = (EQEmu::skills::SkillType)SvUV(ST(1)); + EQEmu::skills::SkillType skill_num = (EQEmu::skills::SkillType) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetModSkillDmgTaken(skill_num); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetSkillDmgTaken); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetSkillDmgTaken) -{ +XS(XS_Mob_GetSkillDmgTaken) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::GetSkillDmgTaken(THIS, int skill_id)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; - EQEmu::skills::SkillType skill_num = (EQEmu::skills::SkillType)SvUV(ST(1)); + EQEmu::skills::SkillType skill_num = (EQEmu::skills::SkillType) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSkillDmgTaken(skill_num); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_SetAllowBeneficial); -XS(XS_Mob_SetAllowBeneficial) -{ +XS(XS_Mob_SetAllowBeneficial) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetAllowBeneficial(THIS, bool value)"); { - Mob * THIS; - bool value = (bool)SvTRUE(ST(1)); + Mob *THIS; + bool value = (bool) SvTRUE(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetAllowBeneficial(value); @@ -7857,22 +7417,20 @@ XS(XS_Mob_SetAllowBeneficial) } XS(XS_Mob_GetAllowBeneficial); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetAllowBeneficial) -{ +XS(XS_Mob_GetAllowBeneficial) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetAllowBeneficial(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAllowBeneficial(); @@ -7883,34 +7441,31 @@ XS(XS_Mob_GetAllowBeneficial) } XS(XS_Mob_IsBeneficialAllowed); -XS(XS_Mob_IsBeneficialAllowed) -{ +XS(XS_Mob_IsBeneficialAllowed) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Mob::IsBeneficialAllowed(THIS, Mob* target)"); + Perl_croak(aTHX_ "Usage: Mob::IsBeneficialAllowed(THIS, Mob* target)"); { dXSTARG; - Mob * THIS; - Mob * target; + Mob *THIS; + Mob *target; bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - target = INT2PTR(Mob *,tmp); - } - else - Perl_croak(aTHX_ "target is not of type Mob"); - if(target == nullptr) - Perl_croak(aTHX_ "target is nullptr, avoiding crash."); + IV tmp = SvIV((SV *) SvRV(ST(1))); + target = INT2PTR(Mob *, tmp); + } else + Perl_croak(aTHX_ "target is not of type Mob"); + if (target == nullptr) + Perl_croak(aTHX_ "target is nullptr, avoiding crash."); RETVAL = THIS->IsBeneficialAllowed(target); ST(0) = boolSV(RETVAL); @@ -7920,23 +7475,21 @@ XS(XS_Mob_IsBeneficialAllowed) } XS(XS_Mob_ModVulnerability); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_ModVulnerability) -{ +XS(XS_Mob_ModVulnerability) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Mob::ModVulnerability(THIS, uint8 resist, int16 value)"); { - Mob * THIS; - uint8 resist = (uint8)SvIV(ST(1)); - int16 value = (int16)SvIV(ST(2)); + Mob *THIS; + uint8 resist = (uint8) SvIV(ST(1)); + int16 value = (int16) SvIV(ST(2)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ModVulnerability(resist, value); @@ -7945,63 +7498,60 @@ XS(XS_Mob_ModVulnerability) } XS(XS_Mob_GetModVulnerability); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetModVulnerability) -{ +XS(XS_Mob_GetModVulnerability) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::GetModVulnerability(THIS, uint8 resist)"); { - Mob * THIS; - int32 RETVAL; + Mob *THIS; + int32 RETVAL; dXSTARG; - uint8 resist = (uint8)SvUV(ST(1)); + uint8 resist = (uint8) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetModVulnerability(resist); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_DoMeleeSkillAttackDmg); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_DoMeleeSkillAttackDmg) -{ +XS(XS_Mob_DoMeleeSkillAttackDmg) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ "Usage: Mob::DoMeleeSkillAttackDmg(THIS, Mob* target, uint16 weapon_damage, int skill, int16 chance_mod, int16 focus, uint8 can_riposte)"); + Perl_croak(aTHX_ + "Usage: Mob::DoMeleeSkillAttackDmg(THIS, Mob* target, uint16 weapon_damage, int skill, int16 chance_mod, int16 focus, uint8 can_riposte)"); { - Mob * THIS; - Mob* target; - uint16 weapon_damage = (uint16)SvIV(ST(2)); - EQEmu::skills::SkillType skill = (EQEmu::skills::SkillType)SvUV(ST(3)); - int16 chance_mod = (int16)SvIV(ST(4)); - int16 focus = (int16)SvIV(ST(5)); - uint8 CanRiposte = (uint8)SvIV(ST(6)); + Mob *THIS; + Mob *target; + uint16 weapon_damage = (uint16) SvIV(ST(2)); + EQEmu::skills::SkillType skill = (EQEmu::skills::SkillType) SvUV(ST(3)); + int16 chance_mod = (int16) SvIV(ST(4)); + int16 focus = (int16) SvIV(ST(5)); + uint8 CanRiposte = (uint8) SvIV(ST(6)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - target = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + target = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "target is not of type Mob"); - if(target == nullptr) + if (target == nullptr) Perl_croak(aTHX_ "target is nullptr, avoiding crash."); THIS->DoMeleeSkillAttackDmg(target, weapon_damage, skill, chance_mod, focus, CanRiposte); @@ -8010,36 +7560,34 @@ XS(XS_Mob_DoMeleeSkillAttackDmg) } XS(XS_Mob_DoArcheryAttackDmg); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_DoArcheryAttackDmg) -{ +XS(XS_Mob_DoArcheryAttackDmg) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ "Usage: Mob::DoArcheryAttackDmg(THIS, Mob* target, [range_weapon_item_instance = nullptr], [ammo_item_instance = nullptr], uint16 weapon_damage, int16 chance_mod, int16 focus)"); + Perl_croak(aTHX_ + "Usage: Mob::DoArcheryAttackDmg(THIS, Mob* target, [range_weapon_item_instance = nullptr], [ammo_item_instance = nullptr], uint16 weapon_damage, int16 chance_mod, int16 focus)"); { - Mob * THIS; - Mob* target; - EQEmu::ItemInstance* RangeWeapon = nullptr; - EQEmu::ItemInstance* Ammo = nullptr; - uint16 weapon_damage = (uint16)SvIV(ST(4)); - int16 chance_mod = (int16)SvIV(ST(5)); - int16 focus = (int16)SvIV(ST(6)); + Mob *THIS; + Mob *target; + EQEmu::ItemInstance *RangeWeapon = nullptr; + EQEmu::ItemInstance *Ammo = nullptr; + uint16 weapon_damage = (uint16) SvIV(ST(4)); + int16 chance_mod = (int16) SvIV(ST(5)); + int16 focus = (int16) SvIV(ST(6)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - target = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + target = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "target is not of type Mob"); - if(target == nullptr) + if (target == nullptr) Perl_croak(aTHX_ "target is nullptr, avoiding crash."); THIS->DoArcheryAttackDmg(target, RangeWeapon, Ammo, weapon_damage, chance_mod, focus); @@ -8048,36 +7596,34 @@ XS(XS_Mob_DoArcheryAttackDmg) } XS(XS_Mob_DoThrowingAttackDmg); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_DoThrowingAttackDmg) -{ +XS(XS_Mob_DoThrowingAttackDmg) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ "Usage: Mob::DoThrowingAttackDmg(THIS, Mob* target, [range_weapon_item_instance = nullptr], [ammo_item_instance = nullptr], uint16 weapon_damage, int16 chance_mod, int16 focus)"); + Perl_croak(aTHX_ + "Usage: Mob::DoThrowingAttackDmg(THIS, Mob* target, [range_weapon_item_instance = nullptr], [ammo_item_instance = nullptr], uint16 weapon_damage, int16 chance_mod, int16 focus)"); { - Mob * THIS; - Mob* target; - EQEmu::ItemInstance* RangeWeapon = nullptr; - EQEmu::ItemData* item = nullptr; - uint16 weapon_damage = (uint16)SvIV(ST(4)); - int16 chance_mod = (int16)SvIV(ST(5)); - int16 focus = (int16)SvIV(ST(6)); + Mob *THIS; + Mob *target; + EQEmu::ItemInstance *RangeWeapon = nullptr; + EQEmu::ItemData *item = nullptr; + uint16 weapon_damage = (uint16) SvIV(ST(4)); + int16 chance_mod = (int16) SvIV(ST(5)); + int16 focus = (int16) SvIV(ST(6)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - target = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + target = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "target is not of type Mob"); - if(target == nullptr) + if (target == nullptr) Perl_croak(aTHX_ "target is nullptr, avoiding crash."); THIS->DoThrowingAttackDmg(target, RangeWeapon, item, weapon_damage, chance_mod, focus); @@ -8086,22 +7632,20 @@ XS(XS_Mob_DoThrowingAttackDmg) } XS(XS_Mob_SetDisableMelee); -XS(XS_Mob_SetDisableMelee) -{ +XS(XS_Mob_SetDisableMelee) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetDisableMelee(THIS, bool value)"); { - Mob * THIS; - bool value = (bool)SvTRUE(ST(1)); + Mob *THIS; + bool value = (bool) SvTRUE(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetDisableMelee(value); @@ -8110,22 +7654,20 @@ XS(XS_Mob_SetDisableMelee) } XS(XS_Mob_IsMeleeDisabled); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_IsMeleeDisabled) -{ +XS(XS_Mob_IsMeleeDisabled) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsMeleeDisabled(THIS)"); { - Mob * THIS; - bool RETVAL; + Mob *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsMeleeDisabled(); @@ -8136,22 +7678,20 @@ XS(XS_Mob_IsMeleeDisabled) } XS(XS_Mob_SetFlurryChance); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetFlurryChance) -{ +XS(XS_Mob_SetFlurryChance) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::SetFlurryChance(THIS, uint8 value)"); { - Mob * THIS; - uint8 value = (uint8)SvIV(ST(1)); + Mob *THIS; + uint8 value = (uint8) SvIV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetFlurryChance(value); @@ -8160,136 +7700,130 @@ XS(XS_Mob_SetFlurryChance) } XS(XS_Mob_GetFlurryChance); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetFlurryChance) -{ +XS(XS_Mob_GetFlurryChance) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetFlurryChance(THIS)"); { - Mob * THIS; - uint8 RETVAL; + Mob *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetFlurryChance(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetSpellStat); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetSpellStat) -{ +XS(XS_Mob_GetSpellStat) { dXSARGS; if (items < 3 || items > 4) Perl_croak(aTHX_ "Usage: Mob::GetSpellStat(THIS, uint32 spell_id, string stat, uint8 slot)"); { - Mob * THIS; - int32 RETVAL; - uint32 spellid = (uint32)SvUV(ST(1)); - Const_char * stat = (Const_char *)SvPV_nolen(ST(2)); - uint8 slot = (uint8)SvUV(ST(3)); + Mob *THIS; + int32 RETVAL; + uint32 spellid = (uint32) SvUV(ST(1)); + Const_char *stat = (Const_char *) SvPV_nolen(ST(2)); + uint8 slot = (uint8) SvUV(ST(3)); dXSTARG; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - if (items > 4) { slot = 0; } + if (items > 4) { slot = 0; } RETVAL = THIS->GetSpellStat(spellid, stat, slot); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetSpecialAbility); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetSpecialAbility) -{ +XS(XS_Mob_GetSpecialAbility) { dXSARGS; - if(items != 2) + if (items != 2) Perl_croak(aTHX_ "Usage: Mob::GetSpecialAbility(THIS, int special_ability)"); { int RETVAL; - Mob* THIS; + Mob *THIS; int ability = SvIV(ST(1)); dXSTARG; - if(sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + if (sv_derived_from(ST(0), "Mob")) { + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob *, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSpecialAbility(ability); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_GetSpecialAbilityParam); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_GetSpecialAbilityParam) -{ +XS(XS_Mob_GetSpecialAbilityParam) { dXSARGS; - if(items != 3) + if (items != 3) Perl_croak(aTHX_ "Usage: Mob::GetSpecialAbilityParam(THIS, int special_ability, int param)"); { int RETVAL; - Mob* THIS; + Mob *THIS; int ability = SvIV(ST(1)); - int param = SvIV(ST(2)); + int param = SvIV(ST(2)); dXSTARG; - if(sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + if (sv_derived_from(ST(0), "Mob")) { + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob *, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSpecialAbilityParam(ability, param); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_Mob_SetSpecialAbility); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetSpecialAbility) -{ +XS(XS_Mob_SetSpecialAbility) { dXSARGS; - if(items != 3) + if (items != 3) Perl_croak(aTHX_ "Usage: Mob::SetSpecialAbility(THIS, int ability, int value)"); { - Mob* THIS; + Mob *THIS; int ability = SvIV(ST(1)); - int value = SvIV(ST(2)); + int value = SvIV(ST(2)); - if(sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + if (sv_derived_from(ST(0), "Mob")) { + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob *, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSpecialAbility(ability, value); @@ -8298,24 +7832,22 @@ XS(XS_Mob_SetSpecialAbility) } XS(XS_Mob_SetSpecialAbilityParam); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_SetSpecialAbilityParam) -{ +XS(XS_Mob_SetSpecialAbilityParam) { dXSARGS; - if(items != 4) + if (items != 4) Perl_croak(aTHX_ "Usage: Mob::SetSpecialAbilityParam(THIS, int ability, int param, int value)"); { - Mob* THIS; + Mob *THIS; int ability = SvIV(ST(1)); - int param = SvIV(ST(2)); - int value = SvIV(ST(3)); + int param = SvIV(ST(2)); + int value = SvIV(ST(3)); - if(sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + if (sv_derived_from(ST(0), "Mob")) { + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob *, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSpecialAbilityParam(ability, param, value); @@ -8324,21 +7856,19 @@ XS(XS_Mob_SetSpecialAbilityParam) } XS(XS_Mob_ClearSpecialAbilities); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_ClearSpecialAbilities) -{ +XS(XS_Mob_ClearSpecialAbilities) { dXSARGS; - if(items != 1) + if (items != 1) Perl_croak(aTHX_ "Usage: Mob::ClearSpecialAbilities(THIS)"); { - Mob* THIS; + Mob *THIS; - if(sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + if (sv_derived_from(ST(0), "Mob")) { + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob *, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ClearSpecialAbilities(); @@ -8347,22 +7877,20 @@ XS(XS_Mob_ClearSpecialAbilities) } XS(XS_Mob_ProcessSpecialAbilities); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_ProcessSpecialAbilities) -{ +XS(XS_Mob_ProcessSpecialAbilities) { dXSARGS; - if(items != 2) + if (items != 2) Perl_croak(aTHX_ "Usage: Mob::ProcessSpecialAbilities(THIS, string str)"); { - Mob* THIS; - const char *str = (const char*)SvPV_nolen(ST(1)); + Mob *THIS; + const char *str = (const char *) SvPV_nolen(ST(1)); - if(sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + if (sv_derived_from(ST(0), "Mob")) { + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob *, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ProcessSpecialAbilities(str); @@ -8371,27 +7899,25 @@ XS(XS_Mob_ProcessSpecialAbilities) } XS(XS_Mob_CanClassEquipItem); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Mob_CanClassEquipItem) -{ +XS(XS_Mob_CanClassEquipItem) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Mob::CanClassEquipItem(THIS, uint32 item_id)"); { - Mob * THIS; - bool RETVAL; - uint32 item_id = (uint32)SvUV(ST(1)); + Mob *THIS; + bool RETVAL; + uint32 item_id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CanClassEquipItem(item_id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); @@ -8403,18 +7929,17 @@ XS(XS_Mob_IsFeared) { if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsFeared(THIS)"); { - Mob* THIS; + Mob *THIS; bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob*, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - + RETVAL = THIS->IsFeared(); ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); @@ -8428,18 +7953,17 @@ XS(XS_Mob_IsBlind) { if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsBlind(THIS)"); { - Mob* THIS; + Mob *THIS; bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob*, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - + RETVAL = THIS->IsBlind(); ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); @@ -8453,23 +7977,22 @@ XS(XS_Mob_SeeInvisible) { if (items != 1) Perl_croak(aTHX_ "Usage: Mob::SeeInvisible(THIS)"); { - Mob* THIS; + Mob *THIS; uint8 RETVAL; dXSTARG; - + if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob*, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - + RETVAL = THIS->SeeInvisible(); XSprePUSH; - PUSHu((UV)RETVAL); + PUSHu((UV) RETVAL); } XSRETURN(1); } @@ -8480,18 +8003,17 @@ XS(XS_Mob_SeeInvisibleUndead) { if (items != 1) Perl_croak(aTHX_ "Usage: Mob::SeeInvisibleUndead(THIS)"); { - Mob* THIS; + Mob *THIS; bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob*, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - + RETVAL = THIS->SeeInvisibleUndead(); ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); @@ -8505,18 +8027,17 @@ XS(XS_Mob_SeeHide) { if (items != 1) Perl_croak(aTHX_ "Usage: Mob::SeeHide(THIS)"); { - Mob* THIS; + Mob *THIS; bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob*, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - + RETVAL = THIS->SeeHide(); ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); @@ -8530,18 +8051,17 @@ XS(XS_Mob_SeeImprovedHide) { if (items != 1) Perl_croak(aTHX_ "Usage: Mob::SeeImprovedHide(THIS)"); { - Mob* THIS; + Mob *THIS; bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob*, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - + RETVAL = THIS->SeeImprovedHide(); ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); @@ -8555,23 +8075,22 @@ XS(XS_Mob_GetNimbusEffect1) { if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetNimbusEffect1(THIS)"); { - Mob* THIS; + Mob *THIS; uint8 RETVAL; dXSTARG; - + if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob*, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - + RETVAL = THIS->GetNimbusEffect1(); XSprePUSH; - PUSHu((UV)RETVAL); + PUSHu((UV) RETVAL); } XSRETURN(1); } @@ -8582,23 +8101,22 @@ XS(XS_Mob_GetNimbusEffect2) { if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetNimbusEffect2(THIS)"); { - Mob* THIS; + Mob *THIS; uint8 RETVAL; dXSTARG; - + if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob*, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - + RETVAL = THIS->GetNimbusEffect2(); XSprePUSH; - PUSHu((UV)RETVAL); + PUSHu((UV) RETVAL); } XSRETURN(1); } @@ -8609,23 +8127,22 @@ XS(XS_Mob_GetNimbusEffect3) { if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetNimbusEffect3(THIS)"); { - Mob* THIS; + Mob *THIS; uint8 RETVAL; dXSTARG; - + if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob*, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - + RETVAL = THIS->GetNimbusEffect3(); XSprePUSH; - PUSHu((UV)RETVAL); + PUSHu((UV) RETVAL); } XSRETURN(1); } @@ -8636,18 +8153,17 @@ XS(XS_Mob_IsTargetable) { if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsTargetable(THIS)"); { - Mob* THIS; + Mob *THIS; bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob*, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - + RETVAL = THIS->IsTargetable(); ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); @@ -8661,18 +8177,17 @@ XS(XS_Mob_HasShieldEquiped) { if (items != 1) Perl_croak(aTHX_ "Usage: Mob::HasShieldEquiped(THIS)"); { - Mob* THIS; + Mob *THIS; bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob*, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - + RETVAL = THIS->HasShieldEquiped(); ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); @@ -8686,18 +8201,17 @@ XS(XS_Mob_HasTwoHandBluntEquiped) { if (items != 1) Perl_croak(aTHX_ "Usage: Mob::HasTwoHandBluntEquiped(THIS)"); { - Mob* THIS; + Mob *THIS; bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob*, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - + RETVAL = THIS->HasTwoHandBluntEquiped(); ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); @@ -8711,18 +8225,17 @@ XS(XS_Mob_HasTwoHanderEquipped) { if (items != 1) Perl_croak(aTHX_ "Usage: Mob::HasTwoHanderEquipped(THIS)"); { - Mob* THIS; + Mob *THIS; bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob*, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - + RETVAL = THIS->HasTwoHanderEquipped(); ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); @@ -8736,24 +8249,23 @@ XS(XS_Mob_GetHerosForgeModel) { if (items != 2) Perl_croak(aTHX_ "Usage: Mob::GetHerosForgeModel(THIS, uint8 material_slot)"); { - Mob* THIS; + Mob *THIS; int32 RETVAL; - uint8 material_slot = (uint8)SvUV(ST(1)); + uint8 material_slot = (uint8) SvUV(ST(1)); dXSTARG; - + if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob*, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - + RETVAL = THIS->GetHerosForgeModel(material_slot); XSprePUSH; - PUSHi((IV)RETVAL); + PUSHi((IV) RETVAL); } XSRETURN(1); } @@ -8764,24 +8276,23 @@ XS(XS_Mob_IsEliteMaterialItem) { if (items != 2) Perl_croak(aTHX_ "Usage: Mob::IsEliteMaterialItem(THIS, uint8 material_slot)"); { - Mob* THIS; + Mob *THIS; uint32 RETVAL; - uint8 material_slot = (uint8)SvUV(ST(1)); + uint8 material_slot = (uint8) SvUV(ST(1)); dXSTARG; - + if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob*, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - + RETVAL = THIS->IsEliteMaterialItem(material_slot); XSprePUSH; - PUSHu((UV)RETVAL); + PUSHu((UV) RETVAL); } XSRETURN(1); } @@ -8792,23 +8303,22 @@ XS(XS_Mob_GetBaseSize) { if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetBaseSize(THIS)"); { - Mob* THIS; + Mob *THIS; float RETVAL; dXSTARG; - + if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob*, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - + RETVAL = THIS->GetBaseSize(); XSprePUSH; - PUSHn((double)RETVAL); + PUSHn((double) RETVAL); } XSRETURN(1); } @@ -8819,18 +8329,17 @@ XS(XS_Mob_HasOwner) { if (items != 1) Perl_croak(aTHX_ "Usage: Mob::HasOwner(THIS)"); { - Mob* THIS; + Mob *THIS; bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob*, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - + RETVAL = THIS->HasOwner(); ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); @@ -8844,18 +8353,17 @@ XS(XS_Mob_IsPet) { if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsPet(THIS)"); { - Mob* THIS; + Mob *THIS; bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob*, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - + RETVAL = THIS->IsPet(); ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); @@ -8869,18 +8377,17 @@ XS(XS_Mob_HasPet) { if (items != 1) Perl_croak(aTHX_ "Usage: Mob::HasPet(THIS)"); { - Mob* THIS; + Mob *THIS; bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob*, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - + RETVAL = THIS->HasPet(); ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); @@ -8894,18 +8401,17 @@ XS(XS_Mob_IsSilenced) { if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsSilenced(THIS)"); { - Mob* THIS; + Mob *THIS; bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob*, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - + RETVAL = THIS->IsSilenced(); ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); @@ -8919,18 +8425,17 @@ XS(XS_Mob_IsAmnesiad) { if (items != 1) Perl_croak(aTHX_ "Usage: Mob::IsAmnesiad(THIS)"); { - Mob* THIS; + Mob *THIS; bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob*, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - + RETVAL = THIS->IsAmnesiad(); ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); @@ -8944,23 +8449,22 @@ XS(XS_Mob_GetMeleeMitigation) { if (items != 1) Perl_croak(aTHX_ "Usage: Mob::GetMeleeMitigation(THIS)"); { - Mob* THIS; + Mob *THIS; int32 RETVAL; dXSTARG; - + if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); + IV tmp = SvIV((SV *) SvRV(ST(0))); THIS = INT2PTR(Mob*, tmp); - } - else + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - + RETVAL = THIS->GetMeleeMitigation(); XSprePUSH; - PUSHi((IV)RETVAL); + PUSHi((IV) RETVAL); } XSRETURN(1); } @@ -8971,23 +8475,22 @@ XS(XS_Mob_TryMoveAlong) { if (items < 3 || items > 4) Perl_croak(aTHX_ "Usage: Mob::TryMoveAlong(THIS, float distance, float angle, bool send)"); { - Mob* THIS; - float distance = (float)SvNV(ST(1)); - float angle = (float)SvNV(ST(2)); - bool send = true; + Mob *THIS; + float distance = (float) SvNV(ST(1)); + float angle = (float) SvNV(ST(2)); + bool send = true; if (sv_derived_from(ST(0), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Mob"); - - if(THIS == nullptr) + + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items == 4) - send = (bool)SvTRUE(ST(3)); + send = (bool) SvTRUE(ST(3)); THIS->TryMoveAlong(distance, angle, send); } @@ -8998,336 +8501,335 @@ XS(XS_Mob_TryMoveAlong) { extern "C" #endif XS(boot_Mob); /* prototype to pass -Wmissing-prototypes */ -XS(boot_Mob) -{ +XS(boot_Mob) { dXSARGS; char file[256]; strncpy(file, __FILE__, 256); file[255] = 0; - if(items != 1) + if (items != 1) fprintf(stderr, "boot_quest does not take any arguments."); char buf[128]; //add the strcpy stuff to get rid of const warnings.... - XS_VERSION_BOOTCHECK ; + XS_VERSION_BOOTCHECK; - newXSproto(strcpy(buf, "IsClient"), XS_Mob_IsClient, file, "$"); - newXSproto(strcpy(buf, "IsNPC"), XS_Mob_IsNPC, file, "$"); - newXSproto(strcpy(buf, "IsMob"), XS_Mob_IsMob, file, "$"); - newXSproto(strcpy(buf, "IsCorpse"), XS_Mob_IsCorpse, file, "$"); - newXSproto(strcpy(buf, "IsPlayerCorpse"), XS_Mob_IsPlayerCorpse, file, "$"); - newXSproto(strcpy(buf, "IsNPCCorpse"), XS_Mob_IsNPCCorpse, file, "$"); - newXSproto(strcpy(buf, "IsObject"), XS_Mob_IsObject, file, "$"); - 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, "CastToClient"), XS_Mob_CastToClient, file, "$"); - newXSproto(strcpy(buf, "CastToNPC"), XS_Mob_CastToNPC, file, "$"); - newXSproto(strcpy(buf, "CastToMob"), XS_Mob_CastToMob, file, "$"); - newXSproto(strcpy(buf, "CastToCorpse"), XS_Mob_CastToCorpse, file, "$"); - newXSproto(strcpy(buf, "GetID"), XS_Mob_GetID, file, "$"); - newXSproto(strcpy(buf, "GetName"), XS_Mob_GetName, file, "$"); - newXSproto(strcpy(buf, "Depop"), XS_Mob_Depop, file, "$;$"); - newXSproto(strcpy(buf, "RogueAssassinate"), XS_Mob_RogueAssassinate, file, "$$"); - newXSproto(strcpy(buf, "BehindMob"), XS_Mob_BehindMob, file, "$;$$$"); - newXSproto(strcpy(buf, "SetLevel"), XS_Mob_SetLevel, file, "$$;$"); - newXSproto(strcpy(buf, "GetSkill"), XS_Mob_GetSkill, file, "$$"); - newXSproto(strcpy(buf, "SendWearChange"), XS_Mob_SendWearChange, file, "$$"); - newXSproto(strcpy(buf, "GetEquipment"), XS_Mob_GetEquipment, file, "$$"); - newXSproto(strcpy(buf, "GetEquipmentMaterial"), XS_Mob_GetEquipmentMaterial, file, "$$"); - newXSproto(strcpy(buf, "GetEquipmentColor"), XS_Mob_GetEquipmentColor, file, "$$"); - newXSproto(strcpy(buf, "GetArmorTint"), XS_Mob_GetArmorTint, file, "$$"); - newXSproto(strcpy(buf, "IsMoving"), XS_Mob_IsMoving, file, "$"); - newXSproto(strcpy(buf, "GoToBind"), XS_Mob_GoToBind, file, "$"); - newXSproto(strcpy(buf, "Gate"), XS_Mob_Gate, file, "$"); - newXSproto(strcpy(buf, "Attack"), XS_Mob_Attack, file, "$$;$$"); - newXSproto(strcpy(buf, "Damage"), XS_Mob_Damage, file, "$$$$$;$$$"); - newXSproto(strcpy(buf, "RangedAttack"), XS_Mob_RangedAttack, file, "$$"); - newXSproto(strcpy(buf, "ThrowingAttack"), XS_Mob_ThrowingAttack, file, "$$"); - newXSproto(strcpy(buf, "Heal"), XS_Mob_Heal, file, "$"); - newXSproto(strcpy(buf, "HealDamage"), XS_Mob_HealDamage, file, "$$;$"); - newXSproto(strcpy(buf, "SetMaxHP"), XS_Mob_SetMaxHP, file, "$"); - newXSproto(strcpy(buf, "GetLevelCon"), XS_Mob_GetLevelCon, file, "$$"); - newXSproto(strcpy(buf, "SetHP"), XS_Mob_SetHP, file, "$$"); - newXSproto(strcpy(buf, "DoAnim"), XS_Mob_DoAnim, file, "$$;$"); - newXSproto(strcpy(buf, "ChangeSize"), XS_Mob_ChangeSize, file, "$$;$"); - newXSproto(strcpy(buf, "GMMove"), XS_Mob_GMMove, file, "$$$$;$"); - newXSproto(strcpy(buf, "SendPosUpdate"), XS_Mob_SendPosUpdate, file, "$;$"); - newXSproto(strcpy(buf, "SendPosition"), XS_Mob_SendPosition, file, "$"); - newXSproto(strcpy(buf, "HasProcs"), XS_Mob_HasProcs, file, "$"); - newXSproto(strcpy(buf, "IsInvisible"), XS_Mob_IsInvisible, file, "$;$"); - newXSproto(strcpy(buf, "SetInvisible"), XS_Mob_SetInvisible, file, "$$"); - newXSproto(strcpy(buf, "FindBuff"), XS_Mob_FindBuff, file, "$$"); - newXSproto(strcpy(buf, "FindType"), XS_Mob_FindType, file, "$$;$$"); - newXSproto(strcpy(buf, "GetBuffSlotFromType"), XS_Mob_GetBuffSlotFromType, file, "$$"); - newXSproto(strcpy(buf, "MakePet"), XS_Mob_MakePet, file, "$$$;$"); - newXSproto(strcpy(buf, "GetBaseRace"), XS_Mob_GetBaseRace, file, "$"); - newXSproto(strcpy(buf, "GetBaseGender"), XS_Mob_GetBaseGender, file, "$"); - newXSproto(strcpy(buf, "GetDeity"), XS_Mob_GetDeity, file, "$"); - newXSproto(strcpy(buf, "GetRace"), XS_Mob_GetRace, file, "$"); - newXSproto(strcpy(buf, "GetGender"), XS_Mob_GetGender, file, "$"); - newXSproto(strcpy(buf, "GetTexture"), XS_Mob_GetTexture, file, "$"); - newXSproto(strcpy(buf, "GetHelmTexture"), XS_Mob_GetHelmTexture, file, "$"); - newXSproto(strcpy(buf, "GetHairColor"), XS_Mob_GetHairColor, file, "$"); - newXSproto(strcpy(buf, "GetBeardColor"), XS_Mob_GetBeardColor, file, "$"); - newXSproto(strcpy(buf, "GetEyeColor1"), XS_Mob_GetEyeColor1, file, "$"); - newXSproto(strcpy(buf, "GetEyeColor2"), XS_Mob_GetEyeColor2, file, "$"); - newXSproto(strcpy(buf, "GetHairStyle"), XS_Mob_GetHairStyle, file, "$"); - newXSproto(strcpy(buf, "GetLuclinFace"), XS_Mob_GetLuclinFace, file, "$"); - newXSproto(strcpy(buf, "GetBeard"), XS_Mob_GetBeard, file, "$"); - newXSproto(strcpy(buf, "GetDrakkinHeritage"), XS_Mob_GetDrakkinHeritage, file, "$"); - newXSproto(strcpy(buf, "GetDrakkinTattoo"), XS_Mob_GetDrakkinTattoo, file, "$"); - newXSproto(strcpy(buf, "GetDrakkinDetails"), XS_Mob_GetDrakkinDetails, file, "$"); - newXSproto(strcpy(buf, "GetClass"), XS_Mob_GetClass, file, "$"); - newXSproto(strcpy(buf, "GetLevel"), XS_Mob_GetLevel, file, "$"); - newXSproto(strcpy(buf, "GetCleanName"), XS_Mob_GetCleanName, file, "$"); - newXSproto(strcpy(buf, "GetTarget"), XS_Mob_GetTarget, file, "$"); - newXSproto(strcpy(buf, "SetTarget"), XS_Mob_SetTarget, file, "$$"); - newXSproto(strcpy(buf, "GetHPRatio"), XS_Mob_GetHPRatio, file, "$"); - newXSproto(strcpy(buf, "IsWarriorClass"), XS_Mob_IsWarriorClass, file, "$"); - newXSproto(strcpy(buf, "GetHP"), XS_Mob_GetHP, file, "$"); - newXSproto(strcpy(buf, "GetMaxHP"), XS_Mob_GetMaxHP, file, "$"); - newXSproto(strcpy(buf, "GetItemHPBonuses"), XS_Mob_GetItemHPBonuses, file, "$"); - newXSproto(strcpy(buf, "GetSpellHPBonuses"), XS_Mob_GetSpellHPBonuses, file, "$"); - newXSproto(strcpy(buf, "GetSpellIDFromSlot"), XS_Mob_GetSpellIDFromSlot, file, "$$"); - newXSproto(strcpy(buf, "GetWalkspeed"), XS_Mob_GetWalkspeed, file, "$"); - newXSproto(strcpy(buf, "GetRunspeed"), XS_Mob_GetRunspeed, file, "$"); - newXSproto(strcpy(buf, "GetCasterLevel"), XS_Mob_GetCasterLevel, file, "$$"); - newXSproto(strcpy(buf, "GetMaxMana"), XS_Mob_GetMaxMana, file, "$"); - newXSproto(strcpy(buf, "GetMana"), XS_Mob_GetMana, file, "$"); - newXSproto(strcpy(buf, "SetMana"), XS_Mob_SetMana, file, "$$"); - newXSproto(strcpy(buf, "GetManaRatio"), XS_Mob_GetManaRatio, file, "$"); - newXSproto(strcpy(buf, "GetAC"), XS_Mob_GetAC, file, "$"); - newXSproto(strcpy(buf, "GetATK"), XS_Mob_GetATK, file, "$"); - newXSproto(strcpy(buf, "GetSTR"), XS_Mob_GetSTR, file, "$"); - newXSproto(strcpy(buf, "GetSTA"), XS_Mob_GetSTA, file, "$"); - newXSproto(strcpy(buf, "GetDEX"), XS_Mob_GetDEX, file, "$"); - newXSproto(strcpy(buf, "GetAGI"), XS_Mob_GetAGI, file, "$"); - newXSproto(strcpy(buf, "GetINT"), XS_Mob_GetINT, file, "$"); - newXSproto(strcpy(buf, "GetWIS"), XS_Mob_GetWIS, file, "$"); - newXSproto(strcpy(buf, "GetCHA"), XS_Mob_GetCHA, file, "$"); - newXSproto(strcpy(buf, "GetMR"), XS_Mob_GetMR, file, "$"); - newXSproto(strcpy(buf, "GetFR"), XS_Mob_GetFR, file, "$"); - newXSproto(strcpy(buf, "GetDR"), XS_Mob_GetDR, file, "$"); - newXSproto(strcpy(buf, "GetPR"), XS_Mob_GetPR, file, "$"); - newXSproto(strcpy(buf, "GetCR"), XS_Mob_GetCR, file, "$"); - newXSproto(strcpy(buf, "GetCorruption"), XS_Mob_GetCorruption, file, "$"); - newXSproto(strcpy(buf, "GetPhR"), XS_Mob_GetPhR, file, "$"); - newXSproto(strcpy(buf, "GetMaxSTR"), XS_Mob_GetMaxSTR, file, "$"); - newXSproto(strcpy(buf, "GetMaxSTA"), XS_Mob_GetMaxSTA, file, "$"); - newXSproto(strcpy(buf, "GetMaxDEX"), XS_Mob_GetMaxDEX, file, "$"); - newXSproto(strcpy(buf, "GetMaxAGI"), XS_Mob_GetMaxAGI, file, "$"); - newXSproto(strcpy(buf, "GetMaxINT"), XS_Mob_GetMaxINT, file, "$"); - newXSproto(strcpy(buf, "GetMaxWIS"), XS_Mob_GetMaxWIS, file, "$"); - newXSproto(strcpy(buf, "GetMaxCHA"), XS_Mob_GetMaxCHA, file, "$"); - newXSproto(strcpy(buf, "GetActSpellRange"), XS_Mob_GetActSpellRange, file, "$$$"); - newXSproto(strcpy(buf, "GetActSpellDamage"), XS_Mob_GetActSpellDamage, file, "$$$"); - newXSproto(strcpy(buf, "GetActSpellHealing"), XS_Mob_GetActSpellHealing, file, "$$$"); - newXSproto(strcpy(buf, "GetActSpellCost"), XS_Mob_GetActSpellCost, file, "$$$"); - newXSproto(strcpy(buf, "GetActSpellDuration"), XS_Mob_GetActSpellDuration, file, "$$$"); - newXSproto(strcpy(buf, "GetActSpellCasttime"), XS_Mob_GetActSpellCasttime, file, "$$$"); - newXSproto(strcpy(buf, "ResistSpell"), XS_Mob_ResistSpell, file, "$$$$"); - newXSproto(strcpy(buf, "GetSpecializeSkillValue"), XS_Mob_GetSpecializeSkillValue, file, "$$"); - newXSproto(strcpy(buf, "GetNPCTypeID"), XS_Mob_GetNPCTypeID, file, "$"); - newXSproto(strcpy(buf, "IsTargeted"), XS_Mob_IsTargeted, file, "$"); - newXSproto(strcpy(buf, "GetX"), XS_Mob_GetX, file, "$"); - newXSproto(strcpy(buf, "GetY"), XS_Mob_GetY, file, "$"); - newXSproto(strcpy(buf, "GetZ"), XS_Mob_GetZ, file, "$"); - newXSproto(strcpy(buf, "GetHeading"), XS_Mob_GetHeading, file, "$"); - newXSproto(strcpy(buf, "GetWaypointX"), XS_Mob_GetWaypointX, file, "$"); - newXSproto(strcpy(buf, "GetWaypointY"), XS_Mob_GetWaypointY, file, "$"); - newXSproto(strcpy(buf, "GetWaypointZ"), XS_Mob_GetWaypointZ, file, "$"); - newXSproto(strcpy(buf, "GetWaypointH"), XS_Mob_GetWaypointH, file, "$"); - newXSproto(strcpy(buf, "GetWaypointPause"), XS_Mob_GetWaypointPause, file, "$"); - newXSproto(strcpy(buf, "GetWaypointID"), XS_Mob_GetWaypointID, file, "$"); - newXSproto(strcpy(buf, "SetCurrentWP"), XS_Mob_SetCurrentWP, file, "$$"); - newXSproto(strcpy(buf, "GetSize"), XS_Mob_GetSize, file, "$"); - newXSproto(strcpy(buf, "SetFollowID"), XS_Mob_SetFollowID, file, "$$"); - newXSproto(strcpy(buf, "GetFollowID"), XS_Mob_GetFollowID, file, "$"); - newXSproto(strcpy(buf, "Message"), XS_Mob_Message, file, "$$$;@"); - newXSproto(strcpy(buf, "Message_StringID"), XS_Mob_Message_StringID, file, "$$$;$"); - newXSproto(strcpy(buf, "Say"), XS_Mob_Say, file, "$$;@"); - newXSproto(strcpy(buf, "Shout"), XS_Mob_Shout, file, "$$;@"); - newXSproto(strcpy(buf, "Emote"), XS_Mob_Emote, file, "$$;@"); - newXSproto(strcpy(buf, "InterruptSpell"), XS_Mob_InterruptSpell, file, "$;$"); - newXSproto(strcpy(buf, "CastSpell"), XS_Mob_CastSpell, file, "$$$;$$$"); - newXSproto(strcpy(buf, "SpellFinished"), XS_Mob_SpellFinished, file, "$$;$$"); - newXSproto(strcpy(buf, "IsImmuneToSpell"), XS_Mob_IsImmuneToSpell, file, "$$$"); - newXSproto(strcpy(buf, "BuffFadeBySpellID"), XS_Mob_BuffFadeBySpellID, file, "$$"); - newXSproto(strcpy(buf, "BuffFadeByEffect"), XS_Mob_BuffFadeByEffect, file, "$$;$"); - newXSproto(strcpy(buf, "BuffFadeAll"), XS_Mob_BuffFadeAll, file, "$"); - newXSproto(strcpy(buf, "BuffFadeBySlot"), XS_Mob_BuffFadeBySlot, file, "$$;$"); - newXSproto(strcpy(buf, "CanBuffStack"), XS_Mob_CanBuffStack, file, "$$$;$"); - newXSproto(strcpy(buf, "IsCasting"), XS_Mob_IsCasting, file, "$"); - newXSproto(strcpy(buf, "CastingSpellID"), XS_Mob_CastingSpellID, file, "$"); - newXSproto(strcpy(buf, "SetAppearance"), XS_Mob_SetAppearance, file, "$$;$"); - newXSproto(strcpy(buf, "GetAppearance"), XS_Mob_GetAppearance, file, "$"); - newXSproto(strcpy(buf, "GetRunAnimSpeed"), XS_Mob_GetRunAnimSpeed, file, "$"); - newXSproto(strcpy(buf, "SetRunAnimSpeed"), XS_Mob_SetRunAnimSpeed, file, "$$"); - newXSproto(strcpy(buf, "SetPetID"), XS_Mob_SetPetID, file, "$$"); - newXSproto(strcpy(buf, "GetPetID"), XS_Mob_GetPetID, file, "$"); - newXSproto(strcpy(buf, "SetOwnerID"), XS_Mob_SetOwnerID, file, "$$"); - newXSproto(strcpy(buf, "GetOwnerID"), XS_Mob_GetOwnerID, file, "$"); - newXSproto(strcpy(buf, "GetPetType"), XS_Mob_GetPetType, file, "$"); - newXSproto(strcpy(buf, "GetBodyType"), XS_Mob_GetBodyType, file, "$"); - newXSproto(strcpy(buf, "Stun"), XS_Mob_Stun, file, "$$"); - newXSproto(strcpy(buf, "Spin"), XS_Mob_Spin, file, "$"); - newXSproto(strcpy(buf, "Kill"), XS_Mob_Kill, file, "$"); - newXSproto(strcpy(buf, "SetInvul"), XS_Mob_SetInvul, file, "$$"); - newXSproto(strcpy(buf, "GetInvul"), XS_Mob_GetInvul, file, "$"); - newXSproto(strcpy(buf, "SetExtraHaste"), XS_Mob_SetExtraHaste, file, "$$"); - newXSproto(strcpy(buf, "GetHaste"), XS_Mob_GetHaste, file, "$"); - newXSproto(strcpy(buf, "GetHandToHandDamage"), XS_Mob_GetHandToHandDamage, file, "$"); - newXSproto(strcpy(buf, "CanThisClassDoubleAttack"), XS_Mob_CanThisClassDoubleAttack, file, "$"); - newXSproto(strcpy(buf, "CanThisClassDualWield"), XS_Mob_CanThisClassDualWield, file, "$"); - newXSproto(strcpy(buf, "CanThisClassRiposte"), XS_Mob_CanThisClassRiposte, file, "$"); - newXSproto(strcpy(buf, "CanThisClassDodge"), XS_Mob_CanThisClassDodge, file, "$"); - newXSproto(strcpy(buf, "CanThisClassParry"), XS_Mob_CanThisClassParry, file, "$"); - newXSproto(strcpy(buf, "GetHandToHandDelay"), XS_Mob_GetHandToHandDelay, file, "$"); - newXSproto(strcpy(buf, "GetClassLevelFactor"), XS_Mob_GetClassLevelFactor, file, "$"); - newXSproto(strcpy(buf, "Mesmerize"), XS_Mob_Mesmerize, file, "$"); - newXSproto(strcpy(buf, "IsMezzed"), XS_Mob_IsMezzed, file, "$"); - newXSproto(strcpy(buf, "IsStunned"), XS_Mob_IsStunned, file, "$"); - newXSproto(strcpy(buf, "StartEnrage"), XS_Mob_StartEnrage, file, "$"); - newXSproto(strcpy(buf, "IsEnraged"), XS_Mob_IsEnraged, file, "$"); - newXSproto(strcpy(buf, "GetReverseFactionCon"), XS_Mob_GetReverseFactionCon, file, "$$"); - newXSproto(strcpy(buf, "IsAIControlled"), XS_Mob_IsAIControlled, file, "$"); - newXSproto(strcpy(buf, "GetAggroRange"), XS_Mob_GetAggroRange, file, "$"); - newXSproto(strcpy(buf, "GetAssistRange"), XS_Mob_GetAssistRange, file, "$"); - newXSproto(strcpy(buf, "SetPetOrder"), XS_Mob_SetPetOrder, file, "$$"); - newXSproto(strcpy(buf, "GetPetOrder"), XS_Mob_GetPetOrder, file, "$"); - newXSproto(strcpy(buf, "IsRoamer"), XS_Mob_IsRoamer, file, "$"); - newXSproto(strcpy(buf, "IsRooted"), XS_Mob_IsRooted, file, "$"); - newXSproto(strcpy(buf, "AddToHateList"), XS_Mob_AddToHateList, file, "$$;$$$$$"); - newXSproto(strcpy(buf, "SetHate"), XS_Mob_SetHate, file, "$$;$$"); - newXSproto(strcpy(buf, "HalveAggro"), XS_Mob_HalveAggro, file, "$$"); - newXSproto(strcpy(buf, "DoubleAggro"), XS_Mob_DoubleAggro, file, "$$"); - newXSproto(strcpy(buf, "GetHateAmount"), XS_Mob_GetHateAmount, file, "$$;$"); - newXSproto(strcpy(buf, "GetDamageAmount"), XS_Mob_GetDamageAmount, file, "$$"); - newXSproto(strcpy(buf, "GetHateTop"), XS_Mob_GetHateTop, file, "$"); - newXSproto(strcpy(buf, "GetHateDamageTop"), XS_Mob_GetHateDamageTop, file, "$$"); - newXSproto(strcpy(buf, "GetHateRandom"), XS_Mob_GetHateRandom, file, "$"); - newXSproto(strcpy(buf, "IsEngaged"), XS_Mob_IsEngaged, file, "$"); - newXSproto(strcpy(buf, "HateSummon"), XS_Mob_HateSummon, file, "$"); - newXSproto(strcpy(buf, "FaceTarget"), XS_Mob_FaceTarget, file, "$;$$"); - newXSproto(strcpy(buf, "SetHeading"), XS_Mob_SetHeading, file, "$$"); - newXSproto(strcpy(buf, "WipeHateList"), XS_Mob_WipeHateList, file, "$"); - newXSproto(strcpy(buf, "CheckAggro"), XS_Mob_CheckAggro, file, "$$"); - newXSproto(strcpy(buf, "CalculateHeadingToTarget"), XS_Mob_CalculateHeadingToTarget, file, "$$$"); - newXSproto(strcpy(buf, "CalculateNewPosition"), XS_Mob_CalculateNewPosition, file, "$$$$$;$"); - newXSproto(strcpy(buf, "CalculateDistance"), XS_Mob_CalculateDistance, file, "$$$$"); - newXSproto(strcpy(buf, "SendTo"), XS_Mob_SendTo, file, "$$$$"); - newXSproto(strcpy(buf, "SendToFixZ"), XS_Mob_SendToFixZ, file, "$$$$"); - newXSproto(strcpy(buf, "NPCSpecialAttacks"), XS_Mob_NPCSpecialAttacks, file, "$$$;$$"); - newXSproto(strcpy(buf, "DontHealMeBefore"), XS_Mob_DontHealMeBefore, file, "$"); - newXSproto(strcpy(buf, "DontBuffMeBefore"), XS_Mob_DontBuffMeBefore, file, "$"); - newXSproto(strcpy(buf, "DontDotMeBefore"), XS_Mob_DontDotMeBefore, file, "$"); - newXSproto(strcpy(buf, "DontRootMeBefore"), XS_Mob_DontRootMeBefore, file, "$"); - newXSproto(strcpy(buf, "DontSnareMeBefore"), XS_Mob_DontSnareMeBefore, file, "$"); - newXSproto(strcpy(buf, "GetResist"), XS_Mob_GetResist, file, "$$"); - newXSproto(strcpy(buf, "GetShieldTarget"), XS_Mob_GetShieldTarget, file, "$"); - newXSproto(strcpy(buf, "SetShieldTarget"), XS_Mob_SetShieldTarget, file, "$$"); - newXSproto(strcpy(buf, "Charmed"), XS_Mob_Charmed, file, "$"); - newXSproto(strcpy(buf, "GetLevelHP"), XS_Mob_GetLevelHP, file, "$$"); - newXSproto(strcpy(buf, "GetZoneID"), XS_Mob_GetZoneID, file, "$"); - newXSproto(strcpy(buf, "CheckAggroAmount"), XS_Mob_CheckAggroAmount, file, "$$"); - newXSproto(strcpy(buf, "CheckHealAggroAmount"), XS_Mob_CheckHealAggroAmount, file, "$$"); - newXSproto(strcpy(buf, "GetAA"), XS_Mob_GetAA, file, "$$"); - newXSproto(strcpy(buf, "GetAAByAAID"), XS_Mob_GetAAByAAID, file, "$$"); - newXSproto(strcpy(buf, "SetAA"), XS_Mob_SetAA, file, "$$$;$"); - newXSproto(strcpy(buf, "DivineAura"), XS_Mob_DivineAura, file, "$"); - newXSproto(strcpy(buf, "AddFeignMemory"), XS_Mob_AddFeignMemory, file, "$$"); - newXSproto(strcpy(buf, "RemoveFromFeignMemory"), XS_Mob_RemoveFromFeignMemory, file, "$$"); - newXSproto(strcpy(buf, "ClearFeignMemory"), XS_Mob_ClearFeignMemory, file, "$"); - newXSproto(strcpy(buf, "SetOOCRegen"), XS_Mob_SetOOCRegen, file, "$$"); - newXSproto(strcpy(buf, "GetEntityVariable"), XS_Mob_GetEntityVariable, file, "$$"); - newXSproto(strcpy(buf, "SetEntityVariable"), XS_Mob_SetEntityVariable, file, "$$$"); - newXSproto(strcpy(buf, "EntityVariableExists"), XS_Mob_EntityVariableExists, file, "$$"); - newXSproto(strcpy(buf, "GetHateList"), XS_Mob_GetHateList, file, "$"); - newXSproto(strcpy(buf, "SignalClient"), XS_Mob_SignalClient, file, "$$$"); - newXSproto(strcpy(buf, "CombatRange"), XS_Mob_CombatRange, file, "$$"); - newXSproto(strcpy(buf, "DoSpecialAttackDamage"), XS_Mob_DoSpecialAttackDamage, file, "$$$$;$$"); - newXSproto(strcpy(buf, "CheckLoS"), XS_Mob_CheckLoS, file, "$$"); - newXSproto(strcpy(buf, "CheckLoSToLoc"), XS_Mob_CheckLoSToLoc, file, "$$$$;$"); - newXSproto(strcpy(buf, "FindGroundZ"), XS_Mob_FindGroundZ, file, "$$$;$"); - newXSproto(strcpy(buf, "ProjectileAnim"), XS_Mob_ProjectileAnim, file, "$$$;$$$$$$"); - newXSproto(strcpy(buf, "HasNPCSpecialAtk"), XS_Mob_HasNPCSpecialAtk, file, "$$"); - newXSproto(strcpy(buf, "SendAppearanceEffect"), XS_Mob_SendAppearanceEffect, file, "$$;$$$$"); - newXSproto(strcpy(buf, "SetFlyMode"), XS_Mob_SetFlyMode, file, "$$"); - newXSproto(strcpy(buf, "SetTexture"), XS_Mob_SetTexture, file, "$$"); - newXSproto(strcpy(buf, "SetRace"), XS_Mob_SetRace, file, "$$"); - newXSproto(strcpy(buf, "SetGender"), XS_Mob_SetGender, file, "$$"); - newXSproto(strcpy(buf, "SendIllusion"), XS_Mob_SendIllusion, file, "$$;$$$$$$$$$$$$"); - newXSproto(strcpy(buf, "MakeTempPet"), XS_Mob_MakeTempPet, file, "$$;$$$$"); - newXSproto(strcpy(buf, "TypesTempPet"), XS_Mob_TypesTempPet, file, "$$;$$$$$"); - newXSproto(strcpy(buf, "CameraEffect"), XS_Mob_CameraEffect, file, "$$;$$$"); - newXSproto(strcpy(buf, "SpellEffect"), XS_Mob_SpellEffect, file, "$$;$$$$$$"); - newXSproto(strcpy(buf, "TempName"), XS_Mob_TempName, file, "$:$"); - newXSproto(strcpy(buf, "GetItemStat"), XS_Mob_GetItemStat, file, "$$$"); - newXSproto(strcpy(buf, "GetGlobal"), XS_Mob_GetGlobal, file, "$$"); - newXSproto(strcpy(buf, "SetGlobal"), XS_Mob_SetGlobal, file, "$$$$$;$"); - newXSproto(strcpy(buf, "TarGlobal"), XS_Mob_TarGlobal, file, "$$$$$$$"); - newXSproto(strcpy(buf, "DelGlobal"), XS_Mob_DelGlobal, file, "$$"); - newXSproto(strcpy(buf, "SetSlotTint"), XS_Mob_SetSlotTint, file, "$$$$$"); - newXSproto(strcpy(buf, "WearChange"), XS_Mob_WearChange, file, "$$$;$$"); - newXSproto(strcpy(buf, "DoKnockback"), XS_Mob_DoKnockback, file, "$$$$"); - newXSproto(strcpy(buf, "RemoveNimbusEffect"), XS_Mob_RemoveNimbusEffect, file, "$$"); - newXSproto(strcpy(buf, "IsRunning"), XS_Mob_IsRunning, file, "$"); - newXSproto(strcpy(buf, "SetRunning"), XS_Mob_SetRunning, file, "$$"); - newXSproto(strcpy(buf, "SetBodyType"), XS_Mob_SetBodyType, file, "$$;$"); - newXSproto(strcpy(buf, "SetDeltas"), XS_Mob_SetDeltas, file, "$$$$$"); - newXSproto(strcpy(buf, "SetLD"), XS_Mob_SetLD, file, "$$"); - newXSproto(strcpy(buf, "SetTargetDestSteps"), XS_Mob_SetTargetDestSteps, file, "$$"); - newXSproto(strcpy(buf, "SetTargetable"), XS_Mob_SetTargetable, file, "$$"); - newXSproto(strcpy(buf, "MakeTempPet"), XS_Mob_MakeTempPet, file, "$$;$$$$"); - newXSproto(strcpy(buf, "ModSkillDmgTaken"), XS_Mob_ModSkillDmgTaken, file, "$$$"); - newXSproto(strcpy(buf, "GetModSkillDmgTaken"), XS_Mob_GetModSkillDmgTaken, file, "$$"); - newXSproto(strcpy(buf, "GetSkillDmgTaken"), XS_Mob_GetSkillDmgTaken, file, "$$"); - newXSproto(strcpy(buf, "SetAllowBeneficial"), XS_Mob_SetAllowBeneficial, file, "$$"); - newXSproto(strcpy(buf, "GetAllowBeneficial"), XS_Mob_GetAllowBeneficial, file, "$$"); - newXSproto(strcpy(buf, "IsBeneficialAllowed"), XS_Mob_IsBeneficialAllowed, file, "$$"); - newXSproto(strcpy(buf, "ModVulnerability"), XS_Mob_ModVulnerability, file, "$$$"); - newXSproto(strcpy(buf, "GetModVulnerability"), XS_Mob_GetModVulnerability, file, "$$"); - newXSproto(strcpy(buf, "DoMeleeSkillAttackDmg"), XS_Mob_DoMeleeSkillAttackDmg, file, "$$$$$$$"); - newXSproto(strcpy(buf, "DoArcheryAttackDmg"), XS_Mob_DoArcheryAttackDmg, file, "$$$$$$$"); - newXSproto(strcpy(buf, "DoThrowingAttackDmg"), XS_Mob_DoThrowingAttackDmg, file, "$$$$$$$"); - newXSproto(strcpy(buf, "SetDisableMelee"), XS_Mob_SetDisableMelee, file, "$$"); - newXSproto(strcpy(buf, "IsMeleeDisabled"), XS_Mob_IsMeleeDisabled, file, "$"); - newXSproto(strcpy(buf, "SetFlurryChance"), XS_Mob_SetFlurryChance, file, "$$"); - newXSproto(strcpy(buf, "GetFlurryChance"), XS_Mob_GetFlurryChance, file, "$"); - newXSproto(strcpy(buf, "GetSpellStat"), XS_Mob_GetSpellStat, file, "$$$$"); - newXSproto(strcpy(buf, "GetSpecialAbility"), XS_Mob_GetSpecialAbility, file, "$$"); - newXSproto(strcpy(buf, "GetSpecialAbilityParam"), XS_Mob_GetSpecialAbilityParam, file, "$$$"); - newXSproto(strcpy(buf, "SetSpecialAbility"), XS_Mob_SetSpecialAbility, file, "$$$"); - newXSproto(strcpy(buf, "SetSpecialAbilityParam"), XS_Mob_SetSpecialAbilityParam, file, "$$$$"); - newXSproto(strcpy(buf, "ClearSpecialAbilities"), XS_Mob_ClearSpecialAbilities, file, "$"); - newXSproto(strcpy(buf, "ProcessSpecialAbilities"), XS_Mob_ProcessSpecialAbilities, file, "$$"); - newXSproto(strcpy(buf, "CanClassEquipItem"), XS_Mob_CanClassEquipItem, file, "$$"); - newXSproto(strcpy(buf, "IsFeared"), XS_Mob_IsFeared, file, "$"); - newXSproto(strcpy(buf, "IsBlind"), XS_Mob_IsBlind, file, "$"); - newXSproto(strcpy(buf, "SeeInvisible"), XS_Mob_SeeInvisible, file, "$"); - newXSproto(strcpy(buf, "SeeInvisibleUndead"), XS_Mob_SeeInvisibleUndead, file, "$"); - newXSproto(strcpy(buf, "SeeHide"), XS_Mob_SeeHide, file, "$"); - newXSproto(strcpy(buf, "SeeImprovedHide"), XS_Mob_SeeImprovedHide, file, "$"); - newXSproto(strcpy(buf, "GetNimbusEffect1"), XS_Mob_GetNimbusEffect1, file, "$"); - newXSproto(strcpy(buf, "GetNimbusEffect2"), XS_Mob_GetNimbusEffect2, file, "$"); - newXSproto(strcpy(buf, "GetNimbusEffect3"), XS_Mob_GetNimbusEffect3, file, "$"); - newXSproto(strcpy(buf, "IsTargetable"), XS_Mob_IsTargetable, file, "$"); - newXSproto(strcpy(buf, "HasShieldEquiped"), XS_Mob_HasShieldEquiped, file, "$"); - newXSproto(strcpy(buf, "HasTwoHandBluntEquiped"), XS_Mob_HasTwoHandBluntEquiped, file, "$"); - newXSproto(strcpy(buf, "HasTwoHanderEquipped"), XS_Mob_HasTwoHanderEquipped, file, "$"); - newXSproto(strcpy(buf, "GetHerosForgeModel"), XS_Mob_GetHerosForgeModel, file, "$$"); - newXSproto(strcpy(buf, "IsEliteMaterialItem"), XS_Mob_IsEliteMaterialItem, file, "$$"); - newXSproto(strcpy(buf, "GetBaseSize"), XS_Mob_GetBaseSize, file, "$"); - newXSproto(strcpy(buf, "HasOwner"), XS_Mob_HasOwner, file, "$"); - newXSproto(strcpy(buf, "IsPet"), XS_Mob_IsPet, file, "$"); - newXSproto(strcpy(buf, "HasPet"), XS_Mob_HasPet, file, "$"); - newXSproto(strcpy(buf, "IsSilenced"), XS_Mob_IsSilenced, file, "$"); - newXSproto(strcpy(buf, "IsAmnesiad"), XS_Mob_IsAmnesiad, file, "$"); - newXSproto(strcpy(buf, "GetMeleeMitigation"), XS_Mob_GetMeleeMitigation, file, "$"); - newXSproto(strcpy(buf, "TryMoveAlong"), XS_Mob_TryMoveAlong, file, "$$$;$"); + newXSproto(strcpy(buf, "IsClient"), XS_Mob_IsClient, file, "$"); + newXSproto(strcpy(buf, "IsNPC"), XS_Mob_IsNPC, file, "$"); + newXSproto(strcpy(buf, "IsMob"), XS_Mob_IsMob, file, "$"); + newXSproto(strcpy(buf, "IsCorpse"), XS_Mob_IsCorpse, file, "$"); + newXSproto(strcpy(buf, "IsPlayerCorpse"), XS_Mob_IsPlayerCorpse, file, "$"); + newXSproto(strcpy(buf, "IsNPCCorpse"), XS_Mob_IsNPCCorpse, file, "$"); + newXSproto(strcpy(buf, "IsObject"), XS_Mob_IsObject, file, "$"); + 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, "CastToClient"), XS_Mob_CastToClient, file, "$"); + newXSproto(strcpy(buf, "CastToNPC"), XS_Mob_CastToNPC, file, "$"); + newXSproto(strcpy(buf, "CastToMob"), XS_Mob_CastToMob, file, "$"); + newXSproto(strcpy(buf, "CastToCorpse"), XS_Mob_CastToCorpse, file, "$"); + newXSproto(strcpy(buf, "GetID"), XS_Mob_GetID, file, "$"); + newXSproto(strcpy(buf, "GetName"), XS_Mob_GetName, file, "$"); + newXSproto(strcpy(buf, "Depop"), XS_Mob_Depop, file, "$;$"); + newXSproto(strcpy(buf, "RogueAssassinate"), XS_Mob_RogueAssassinate, file, "$$"); + newXSproto(strcpy(buf, "BehindMob"), XS_Mob_BehindMob, file, "$;$$$"); + newXSproto(strcpy(buf, "SetLevel"), XS_Mob_SetLevel, file, "$$;$"); + newXSproto(strcpy(buf, "GetSkill"), XS_Mob_GetSkill, file, "$$"); + newXSproto(strcpy(buf, "SendWearChange"), XS_Mob_SendWearChange, file, "$$"); + newXSproto(strcpy(buf, "GetEquipment"), XS_Mob_GetEquipment, file, "$$"); + newXSproto(strcpy(buf, "GetEquipmentMaterial"), XS_Mob_GetEquipmentMaterial, file, "$$"); + newXSproto(strcpy(buf, "GetEquipmentColor"), XS_Mob_GetEquipmentColor, file, "$$"); + newXSproto(strcpy(buf, "GetArmorTint"), XS_Mob_GetArmorTint, file, "$$"); + newXSproto(strcpy(buf, "IsMoving"), XS_Mob_IsMoving, file, "$"); + newXSproto(strcpy(buf, "GoToBind"), XS_Mob_GoToBind, file, "$"); + newXSproto(strcpy(buf, "Gate"), XS_Mob_Gate, file, "$"); + newXSproto(strcpy(buf, "Attack"), XS_Mob_Attack, file, "$$;$$"); + newXSproto(strcpy(buf, "Damage"), XS_Mob_Damage, file, "$$$$$;$$$"); + newXSproto(strcpy(buf, "RangedAttack"), XS_Mob_RangedAttack, file, "$$"); + newXSproto(strcpy(buf, "ThrowingAttack"), XS_Mob_ThrowingAttack, file, "$$"); + newXSproto(strcpy(buf, "Heal"), XS_Mob_Heal, file, "$"); + newXSproto(strcpy(buf, "HealDamage"), XS_Mob_HealDamage, file, "$$;$"); + newXSproto(strcpy(buf, "SetMaxHP"), XS_Mob_SetMaxHP, file, "$"); + newXSproto(strcpy(buf, "GetLevelCon"), XS_Mob_GetLevelCon, file, "$$"); + newXSproto(strcpy(buf, "SetHP"), XS_Mob_SetHP, file, "$$"); + newXSproto(strcpy(buf, "DoAnim"), XS_Mob_DoAnim, file, "$$;$"); + newXSproto(strcpy(buf, "ChangeSize"), XS_Mob_ChangeSize, file, "$$;$"); + newXSproto(strcpy(buf, "GMMove"), XS_Mob_GMMove, file, "$$$$;$"); + newXSproto(strcpy(buf, "SendPosUpdate"), XS_Mob_SendPosUpdate, file, "$;$"); + newXSproto(strcpy(buf, "SendPosition"), XS_Mob_SendPosition, file, "$"); + newXSproto(strcpy(buf, "HasProcs"), XS_Mob_HasProcs, file, "$"); + newXSproto(strcpy(buf, "IsInvisible"), XS_Mob_IsInvisible, file, "$;$"); + newXSproto(strcpy(buf, "SetInvisible"), XS_Mob_SetInvisible, file, "$$"); + newXSproto(strcpy(buf, "FindBuff"), XS_Mob_FindBuff, file, "$$"); + newXSproto(strcpy(buf, "FindType"), XS_Mob_FindType, file, "$$;$$"); + newXSproto(strcpy(buf, "GetBuffSlotFromType"), XS_Mob_GetBuffSlotFromType, file, "$$"); + newXSproto(strcpy(buf, "MakePet"), XS_Mob_MakePet, file, "$$$;$"); + newXSproto(strcpy(buf, "GetBaseRace"), XS_Mob_GetBaseRace, file, "$"); + newXSproto(strcpy(buf, "GetBaseGender"), XS_Mob_GetBaseGender, file, "$"); + newXSproto(strcpy(buf, "GetDeity"), XS_Mob_GetDeity, file, "$"); + newXSproto(strcpy(buf, "GetRace"), XS_Mob_GetRace, file, "$"); + newXSproto(strcpy(buf, "GetGender"), XS_Mob_GetGender, file, "$"); + newXSproto(strcpy(buf, "GetTexture"), XS_Mob_GetTexture, file, "$"); + newXSproto(strcpy(buf, "GetHelmTexture"), XS_Mob_GetHelmTexture, file, "$"); + newXSproto(strcpy(buf, "GetHairColor"), XS_Mob_GetHairColor, file, "$"); + newXSproto(strcpy(buf, "GetBeardColor"), XS_Mob_GetBeardColor, file, "$"); + newXSproto(strcpy(buf, "GetEyeColor1"), XS_Mob_GetEyeColor1, file, "$"); + newXSproto(strcpy(buf, "GetEyeColor2"), XS_Mob_GetEyeColor2, file, "$"); + newXSproto(strcpy(buf, "GetHairStyle"), XS_Mob_GetHairStyle, file, "$"); + newXSproto(strcpy(buf, "GetLuclinFace"), XS_Mob_GetLuclinFace, file, "$"); + newXSproto(strcpy(buf, "GetBeard"), XS_Mob_GetBeard, file, "$"); + newXSproto(strcpy(buf, "GetDrakkinHeritage"), XS_Mob_GetDrakkinHeritage, file, "$"); + newXSproto(strcpy(buf, "GetDrakkinTattoo"), XS_Mob_GetDrakkinTattoo, file, "$"); + newXSproto(strcpy(buf, "GetDrakkinDetails"), XS_Mob_GetDrakkinDetails, file, "$"); + newXSproto(strcpy(buf, "GetClass"), XS_Mob_GetClass, file, "$"); + newXSproto(strcpy(buf, "GetLevel"), XS_Mob_GetLevel, file, "$"); + newXSproto(strcpy(buf, "GetCleanName"), XS_Mob_GetCleanName, file, "$"); + newXSproto(strcpy(buf, "GetTarget"), XS_Mob_GetTarget, file, "$"); + newXSproto(strcpy(buf, "SetTarget"), XS_Mob_SetTarget, file, "$$"); + newXSproto(strcpy(buf, "GetHPRatio"), XS_Mob_GetHPRatio, file, "$"); + newXSproto(strcpy(buf, "IsWarriorClass"), XS_Mob_IsWarriorClass, file, "$"); + newXSproto(strcpy(buf, "GetHP"), XS_Mob_GetHP, file, "$"); + newXSproto(strcpy(buf, "GetMaxHP"), XS_Mob_GetMaxHP, file, "$"); + newXSproto(strcpy(buf, "GetItemHPBonuses"), XS_Mob_GetItemHPBonuses, file, "$"); + newXSproto(strcpy(buf, "GetSpellHPBonuses"), XS_Mob_GetSpellHPBonuses, file, "$"); + newXSproto(strcpy(buf, "GetSpellIDFromSlot"), XS_Mob_GetSpellIDFromSlot, file, "$$"); + newXSproto(strcpy(buf, "GetWalkspeed"), XS_Mob_GetWalkspeed, file, "$"); + newXSproto(strcpy(buf, "GetRunspeed"), XS_Mob_GetRunspeed, file, "$"); + newXSproto(strcpy(buf, "GetCasterLevel"), XS_Mob_GetCasterLevel, file, "$$"); + newXSproto(strcpy(buf, "GetMaxMana"), XS_Mob_GetMaxMana, file, "$"); + newXSproto(strcpy(buf, "GetMana"), XS_Mob_GetMana, file, "$"); + newXSproto(strcpy(buf, "SetMana"), XS_Mob_SetMana, file, "$$"); + newXSproto(strcpy(buf, "GetManaRatio"), XS_Mob_GetManaRatio, file, "$"); + newXSproto(strcpy(buf, "GetAC"), XS_Mob_GetAC, file, "$"); + newXSproto(strcpy(buf, "GetATK"), XS_Mob_GetATK, file, "$"); + newXSproto(strcpy(buf, "GetSTR"), XS_Mob_GetSTR, file, "$"); + newXSproto(strcpy(buf, "GetSTA"), XS_Mob_GetSTA, file, "$"); + newXSproto(strcpy(buf, "GetDEX"), XS_Mob_GetDEX, file, "$"); + newXSproto(strcpy(buf, "GetAGI"), XS_Mob_GetAGI, file, "$"); + newXSproto(strcpy(buf, "GetINT"), XS_Mob_GetINT, file, "$"); + newXSproto(strcpy(buf, "GetWIS"), XS_Mob_GetWIS, file, "$"); + newXSproto(strcpy(buf, "GetCHA"), XS_Mob_GetCHA, file, "$"); + newXSproto(strcpy(buf, "GetMR"), XS_Mob_GetMR, file, "$"); + newXSproto(strcpy(buf, "GetFR"), XS_Mob_GetFR, file, "$"); + newXSproto(strcpy(buf, "GetDR"), XS_Mob_GetDR, file, "$"); + newXSproto(strcpy(buf, "GetPR"), XS_Mob_GetPR, file, "$"); + newXSproto(strcpy(buf, "GetCR"), XS_Mob_GetCR, file, "$"); + newXSproto(strcpy(buf, "GetCorruption"), XS_Mob_GetCorruption, file, "$"); + newXSproto(strcpy(buf, "GetPhR"), XS_Mob_GetPhR, file, "$"); + newXSproto(strcpy(buf, "GetMaxSTR"), XS_Mob_GetMaxSTR, file, "$"); + newXSproto(strcpy(buf, "GetMaxSTA"), XS_Mob_GetMaxSTA, file, "$"); + newXSproto(strcpy(buf, "GetMaxDEX"), XS_Mob_GetMaxDEX, file, "$"); + newXSproto(strcpy(buf, "GetMaxAGI"), XS_Mob_GetMaxAGI, file, "$"); + newXSproto(strcpy(buf, "GetMaxINT"), XS_Mob_GetMaxINT, file, "$"); + newXSproto(strcpy(buf, "GetMaxWIS"), XS_Mob_GetMaxWIS, file, "$"); + newXSproto(strcpy(buf, "GetMaxCHA"), XS_Mob_GetMaxCHA, file, "$"); + newXSproto(strcpy(buf, "GetActSpellRange"), XS_Mob_GetActSpellRange, file, "$$$"); + newXSproto(strcpy(buf, "GetActSpellDamage"), XS_Mob_GetActSpellDamage, file, "$$$"); + newXSproto(strcpy(buf, "GetActSpellHealing"), XS_Mob_GetActSpellHealing, file, "$$$"); + newXSproto(strcpy(buf, "GetActSpellCost"), XS_Mob_GetActSpellCost, file, "$$$"); + newXSproto(strcpy(buf, "GetActSpellDuration"), XS_Mob_GetActSpellDuration, file, "$$$"); + newXSproto(strcpy(buf, "GetActSpellCasttime"), XS_Mob_GetActSpellCasttime, file, "$$$"); + newXSproto(strcpy(buf, "ResistSpell"), XS_Mob_ResistSpell, file, "$$$$"); + newXSproto(strcpy(buf, "GetSpecializeSkillValue"), XS_Mob_GetSpecializeSkillValue, file, "$$"); + newXSproto(strcpy(buf, "GetNPCTypeID"), XS_Mob_GetNPCTypeID, file, "$"); + newXSproto(strcpy(buf, "IsTargeted"), XS_Mob_IsTargeted, file, "$"); + newXSproto(strcpy(buf, "GetX"), XS_Mob_GetX, file, "$"); + newXSproto(strcpy(buf, "GetY"), XS_Mob_GetY, file, "$"); + newXSproto(strcpy(buf, "GetZ"), XS_Mob_GetZ, file, "$"); + newXSproto(strcpy(buf, "GetHeading"), XS_Mob_GetHeading, file, "$"); + newXSproto(strcpy(buf, "GetWaypointX"), XS_Mob_GetWaypointX, file, "$"); + newXSproto(strcpy(buf, "GetWaypointY"), XS_Mob_GetWaypointY, file, "$"); + newXSproto(strcpy(buf, "GetWaypointZ"), XS_Mob_GetWaypointZ, file, "$"); + newXSproto(strcpy(buf, "GetWaypointH"), XS_Mob_GetWaypointH, file, "$"); + newXSproto(strcpy(buf, "GetWaypointPause"), XS_Mob_GetWaypointPause, file, "$"); + newXSproto(strcpy(buf, "GetWaypointID"), XS_Mob_GetWaypointID, file, "$"); + newXSproto(strcpy(buf, "SetCurrentWP"), XS_Mob_SetCurrentWP, file, "$$"); + newXSproto(strcpy(buf, "GetSize"), XS_Mob_GetSize, file, "$"); + newXSproto(strcpy(buf, "SetFollowID"), XS_Mob_SetFollowID, file, "$$"); + newXSproto(strcpy(buf, "GetFollowID"), XS_Mob_GetFollowID, file, "$"); + newXSproto(strcpy(buf, "Message"), XS_Mob_Message, file, "$$$;@"); + newXSproto(strcpy(buf, "Message_StringID"), XS_Mob_Message_StringID, file, "$$$;$"); + newXSproto(strcpy(buf, "Say"), XS_Mob_Say, file, "$$;@"); + newXSproto(strcpy(buf, "Shout"), XS_Mob_Shout, file, "$$;@"); + newXSproto(strcpy(buf, "Emote"), XS_Mob_Emote, file, "$$;@"); + newXSproto(strcpy(buf, "InterruptSpell"), XS_Mob_InterruptSpell, file, "$;$"); + newXSproto(strcpy(buf, "CastSpell"), XS_Mob_CastSpell, file, "$$$;$$$"); + newXSproto(strcpy(buf, "SpellFinished"), XS_Mob_SpellFinished, file, "$$;$$"); + newXSproto(strcpy(buf, "IsImmuneToSpell"), XS_Mob_IsImmuneToSpell, file, "$$$"); + newXSproto(strcpy(buf, "BuffFadeBySpellID"), XS_Mob_BuffFadeBySpellID, file, "$$"); + newXSproto(strcpy(buf, "BuffFadeByEffect"), XS_Mob_BuffFadeByEffect, file, "$$;$"); + newXSproto(strcpy(buf, "BuffFadeAll"), XS_Mob_BuffFadeAll, file, "$"); + newXSproto(strcpy(buf, "BuffFadeBySlot"), XS_Mob_BuffFadeBySlot, file, "$$;$"); + newXSproto(strcpy(buf, "CanBuffStack"), XS_Mob_CanBuffStack, file, "$$$;$"); + newXSproto(strcpy(buf, "IsCasting"), XS_Mob_IsCasting, file, "$"); + newXSproto(strcpy(buf, "CastingSpellID"), XS_Mob_CastingSpellID, file, "$"); + newXSproto(strcpy(buf, "SetAppearance"), XS_Mob_SetAppearance, file, "$$;$"); + newXSproto(strcpy(buf, "GetAppearance"), XS_Mob_GetAppearance, file, "$"); + newXSproto(strcpy(buf, "GetRunAnimSpeed"), XS_Mob_GetRunAnimSpeed, file, "$"); + newXSproto(strcpy(buf, "SetRunAnimSpeed"), XS_Mob_SetRunAnimSpeed, file, "$$"); + newXSproto(strcpy(buf, "SetPetID"), XS_Mob_SetPetID, file, "$$"); + newXSproto(strcpy(buf, "GetPetID"), XS_Mob_GetPetID, file, "$"); + newXSproto(strcpy(buf, "SetOwnerID"), XS_Mob_SetOwnerID, file, "$$"); + newXSproto(strcpy(buf, "GetOwnerID"), XS_Mob_GetOwnerID, file, "$"); + newXSproto(strcpy(buf, "GetPetType"), XS_Mob_GetPetType, file, "$"); + newXSproto(strcpy(buf, "GetBodyType"), XS_Mob_GetBodyType, file, "$"); + newXSproto(strcpy(buf, "Stun"), XS_Mob_Stun, file, "$$"); + newXSproto(strcpy(buf, "Spin"), XS_Mob_Spin, file, "$"); + newXSproto(strcpy(buf, "Kill"), XS_Mob_Kill, file, "$"); + newXSproto(strcpy(buf, "SetInvul"), XS_Mob_SetInvul, file, "$$"); + newXSproto(strcpy(buf, "GetInvul"), XS_Mob_GetInvul, file, "$"); + newXSproto(strcpy(buf, "SetExtraHaste"), XS_Mob_SetExtraHaste, file, "$$"); + newXSproto(strcpy(buf, "GetHaste"), XS_Mob_GetHaste, file, "$"); + newXSproto(strcpy(buf, "GetHandToHandDamage"), XS_Mob_GetHandToHandDamage, file, "$"); + newXSproto(strcpy(buf, "CanThisClassDoubleAttack"), XS_Mob_CanThisClassDoubleAttack, file, "$"); + newXSproto(strcpy(buf, "CanThisClassDualWield"), XS_Mob_CanThisClassDualWield, file, "$"); + newXSproto(strcpy(buf, "CanThisClassRiposte"), XS_Mob_CanThisClassRiposte, file, "$"); + newXSproto(strcpy(buf, "CanThisClassDodge"), XS_Mob_CanThisClassDodge, file, "$"); + newXSproto(strcpy(buf, "CanThisClassParry"), XS_Mob_CanThisClassParry, file, "$"); + newXSproto(strcpy(buf, "GetHandToHandDelay"), XS_Mob_GetHandToHandDelay, file, "$"); + newXSproto(strcpy(buf, "GetClassLevelFactor"), XS_Mob_GetClassLevelFactor, file, "$"); + newXSproto(strcpy(buf, "Mesmerize"), XS_Mob_Mesmerize, file, "$"); + newXSproto(strcpy(buf, "IsMezzed"), XS_Mob_IsMezzed, file, "$"); + newXSproto(strcpy(buf, "IsStunned"), XS_Mob_IsStunned, file, "$"); + newXSproto(strcpy(buf, "StartEnrage"), XS_Mob_StartEnrage, file, "$"); + newXSproto(strcpy(buf, "IsEnraged"), XS_Mob_IsEnraged, file, "$"); + newXSproto(strcpy(buf, "GetReverseFactionCon"), XS_Mob_GetReverseFactionCon, file, "$$"); + newXSproto(strcpy(buf, "IsAIControlled"), XS_Mob_IsAIControlled, file, "$"); + newXSproto(strcpy(buf, "GetAggroRange"), XS_Mob_GetAggroRange, file, "$"); + newXSproto(strcpy(buf, "GetAssistRange"), XS_Mob_GetAssistRange, file, "$"); + newXSproto(strcpy(buf, "SetPetOrder"), XS_Mob_SetPetOrder, file, "$$"); + newXSproto(strcpy(buf, "GetPetOrder"), XS_Mob_GetPetOrder, file, "$"); + newXSproto(strcpy(buf, "IsRoamer"), XS_Mob_IsRoamer, file, "$"); + newXSproto(strcpy(buf, "IsRooted"), XS_Mob_IsRooted, file, "$"); + newXSproto(strcpy(buf, "AddToHateList"), XS_Mob_AddToHateList, file, "$$;$$$$$"); + newXSproto(strcpy(buf, "SetHate"), XS_Mob_SetHate, file, "$$;$$"); + newXSproto(strcpy(buf, "HalveAggro"), XS_Mob_HalveAggro, file, "$$"); + newXSproto(strcpy(buf, "DoubleAggro"), XS_Mob_DoubleAggro, file, "$$"); + newXSproto(strcpy(buf, "GetHateAmount"), XS_Mob_GetHateAmount, file, "$$;$"); + newXSproto(strcpy(buf, "GetDamageAmount"), XS_Mob_GetDamageAmount, file, "$$"); + newXSproto(strcpy(buf, "GetHateTop"), XS_Mob_GetHateTop, file, "$"); + newXSproto(strcpy(buf, "GetHateDamageTop"), XS_Mob_GetHateDamageTop, file, "$$"); + newXSproto(strcpy(buf, "GetHateRandom"), XS_Mob_GetHateRandom, file, "$"); + newXSproto(strcpy(buf, "IsEngaged"), XS_Mob_IsEngaged, file, "$"); + newXSproto(strcpy(buf, "HateSummon"), XS_Mob_HateSummon, file, "$"); + newXSproto(strcpy(buf, "FaceTarget"), XS_Mob_FaceTarget, file, "$;$$"); + newXSproto(strcpy(buf, "SetHeading"), XS_Mob_SetHeading, file, "$$"); + newXSproto(strcpy(buf, "WipeHateList"), XS_Mob_WipeHateList, file, "$"); + newXSproto(strcpy(buf, "CheckAggro"), XS_Mob_CheckAggro, file, "$$"); + newXSproto(strcpy(buf, "CalculateHeadingToTarget"), XS_Mob_CalculateHeadingToTarget, file, "$$$"); + newXSproto(strcpy(buf, "CalculateNewPosition"), XS_Mob_CalculateNewPosition, file, "$$$$$;$"); + newXSproto(strcpy(buf, "CalculateDistance"), XS_Mob_CalculateDistance, file, "$$$$"); + newXSproto(strcpy(buf, "SendTo"), XS_Mob_SendTo, file, "$$$$"); + newXSproto(strcpy(buf, "SendToFixZ"), XS_Mob_SendToFixZ, file, "$$$$"); + newXSproto(strcpy(buf, "NPCSpecialAttacks"), XS_Mob_NPCSpecialAttacks, file, "$$$;$$"); + newXSproto(strcpy(buf, "DontHealMeBefore"), XS_Mob_DontHealMeBefore, file, "$"); + newXSproto(strcpy(buf, "DontBuffMeBefore"), XS_Mob_DontBuffMeBefore, file, "$"); + newXSproto(strcpy(buf, "DontDotMeBefore"), XS_Mob_DontDotMeBefore, file, "$"); + newXSproto(strcpy(buf, "DontRootMeBefore"), XS_Mob_DontRootMeBefore, file, "$"); + newXSproto(strcpy(buf, "DontSnareMeBefore"), XS_Mob_DontSnareMeBefore, file, "$"); + newXSproto(strcpy(buf, "GetResist"), XS_Mob_GetResist, file, "$$"); + newXSproto(strcpy(buf, "GetShieldTarget"), XS_Mob_GetShieldTarget, file, "$"); + newXSproto(strcpy(buf, "SetShieldTarget"), XS_Mob_SetShieldTarget, file, "$$"); + newXSproto(strcpy(buf, "Charmed"), XS_Mob_Charmed, file, "$"); + newXSproto(strcpy(buf, "GetLevelHP"), XS_Mob_GetLevelHP, file, "$$"); + newXSproto(strcpy(buf, "GetZoneID"), XS_Mob_GetZoneID, file, "$"); + newXSproto(strcpy(buf, "CheckAggroAmount"), XS_Mob_CheckAggroAmount, file, "$$"); + newXSproto(strcpy(buf, "CheckHealAggroAmount"), XS_Mob_CheckHealAggroAmount, file, "$$"); + newXSproto(strcpy(buf, "GetAA"), XS_Mob_GetAA, file, "$$"); + newXSproto(strcpy(buf, "GetAAByAAID"), XS_Mob_GetAAByAAID, file, "$$"); + newXSproto(strcpy(buf, "SetAA"), XS_Mob_SetAA, file, "$$$;$"); + newXSproto(strcpy(buf, "DivineAura"), XS_Mob_DivineAura, file, "$"); + newXSproto(strcpy(buf, "AddFeignMemory"), XS_Mob_AddFeignMemory, file, "$$"); + newXSproto(strcpy(buf, "RemoveFromFeignMemory"), XS_Mob_RemoveFromFeignMemory, file, "$$"); + newXSproto(strcpy(buf, "ClearFeignMemory"), XS_Mob_ClearFeignMemory, file, "$"); + newXSproto(strcpy(buf, "SetOOCRegen"), XS_Mob_SetOOCRegen, file, "$$"); + newXSproto(strcpy(buf, "GetEntityVariable"), XS_Mob_GetEntityVariable, file, "$$"); + newXSproto(strcpy(buf, "SetEntityVariable"), XS_Mob_SetEntityVariable, file, "$$$"); + newXSproto(strcpy(buf, "EntityVariableExists"), XS_Mob_EntityVariableExists, file, "$$"); + newXSproto(strcpy(buf, "GetHateList"), XS_Mob_GetHateList, file, "$"); + newXSproto(strcpy(buf, "SignalClient"), XS_Mob_SignalClient, file, "$$$"); + newXSproto(strcpy(buf, "CombatRange"), XS_Mob_CombatRange, file, "$$"); + newXSproto(strcpy(buf, "DoSpecialAttackDamage"), XS_Mob_DoSpecialAttackDamage, file, "$$$$;$$"); + newXSproto(strcpy(buf, "CheckLoS"), XS_Mob_CheckLoS, file, "$$"); + newXSproto(strcpy(buf, "CheckLoSToLoc"), XS_Mob_CheckLoSToLoc, file, "$$$$;$"); + newXSproto(strcpy(buf, "FindGroundZ"), XS_Mob_FindGroundZ, file, "$$$;$"); + newXSproto(strcpy(buf, "ProjectileAnim"), XS_Mob_ProjectileAnim, file, "$$$;$$$$$$"); + newXSproto(strcpy(buf, "HasNPCSpecialAtk"), XS_Mob_HasNPCSpecialAtk, file, "$$"); + newXSproto(strcpy(buf, "SendAppearanceEffect"), XS_Mob_SendAppearanceEffect, file, "$$;$$$$"); + newXSproto(strcpy(buf, "SetFlyMode"), XS_Mob_SetFlyMode, file, "$$"); + newXSproto(strcpy(buf, "SetTexture"), XS_Mob_SetTexture, file, "$$"); + newXSproto(strcpy(buf, "SetRace"), XS_Mob_SetRace, file, "$$"); + newXSproto(strcpy(buf, "SetGender"), XS_Mob_SetGender, file, "$$"); + newXSproto(strcpy(buf, "SendIllusion"), XS_Mob_SendIllusion, file, "$$;$$$$$$$$$$$$"); + newXSproto(strcpy(buf, "MakeTempPet"), XS_Mob_MakeTempPet, file, "$$;$$$$"); + newXSproto(strcpy(buf, "TypesTempPet"), XS_Mob_TypesTempPet, file, "$$;$$$$$"); + newXSproto(strcpy(buf, "CameraEffect"), XS_Mob_CameraEffect, file, "$$;$$$"); + newXSproto(strcpy(buf, "SpellEffect"), XS_Mob_SpellEffect, file, "$$;$$$$$$"); + newXSproto(strcpy(buf, "TempName"), XS_Mob_TempName, file, "$:$"); + newXSproto(strcpy(buf, "GetItemStat"), XS_Mob_GetItemStat, file, "$$$"); + newXSproto(strcpy(buf, "GetGlobal"), XS_Mob_GetGlobal, file, "$$"); + newXSproto(strcpy(buf, "SetGlobal"), XS_Mob_SetGlobal, file, "$$$$$;$"); + newXSproto(strcpy(buf, "TarGlobal"), XS_Mob_TarGlobal, file, "$$$$$$$"); + newXSproto(strcpy(buf, "DelGlobal"), XS_Mob_DelGlobal, file, "$$"); + newXSproto(strcpy(buf, "SetSlotTint"), XS_Mob_SetSlotTint, file, "$$$$$"); + newXSproto(strcpy(buf, "WearChange"), XS_Mob_WearChange, file, "$$$;$$"); + newXSproto(strcpy(buf, "DoKnockback"), XS_Mob_DoKnockback, file, "$$$$"); + newXSproto(strcpy(buf, "RemoveNimbusEffect"), XS_Mob_RemoveNimbusEffect, file, "$$"); + newXSproto(strcpy(buf, "IsRunning"), XS_Mob_IsRunning, file, "$"); + newXSproto(strcpy(buf, "SetRunning"), XS_Mob_SetRunning, file, "$$"); + newXSproto(strcpy(buf, "SetBodyType"), XS_Mob_SetBodyType, file, "$$;$"); + newXSproto(strcpy(buf, "SetDeltas"), XS_Mob_SetDeltas, file, "$$$$$"); + newXSproto(strcpy(buf, "SetLD"), XS_Mob_SetLD, file, "$$"); + newXSproto(strcpy(buf, "SetTargetDestSteps"), XS_Mob_SetTargetDestSteps, file, "$$"); + newXSproto(strcpy(buf, "SetTargetable"), XS_Mob_SetTargetable, file, "$$"); + newXSproto(strcpy(buf, "MakeTempPet"), XS_Mob_MakeTempPet, file, "$$;$$$$"); + newXSproto(strcpy(buf, "ModSkillDmgTaken"), XS_Mob_ModSkillDmgTaken, file, "$$$"); + newXSproto(strcpy(buf, "GetModSkillDmgTaken"), XS_Mob_GetModSkillDmgTaken, file, "$$"); + newXSproto(strcpy(buf, "GetSkillDmgTaken"), XS_Mob_GetSkillDmgTaken, file, "$$"); + newXSproto(strcpy(buf, "SetAllowBeneficial"), XS_Mob_SetAllowBeneficial, file, "$$"); + newXSproto(strcpy(buf, "GetAllowBeneficial"), XS_Mob_GetAllowBeneficial, file, "$$"); + newXSproto(strcpy(buf, "IsBeneficialAllowed"), XS_Mob_IsBeneficialAllowed, file, "$$"); + newXSproto(strcpy(buf, "ModVulnerability"), XS_Mob_ModVulnerability, file, "$$$"); + newXSproto(strcpy(buf, "GetModVulnerability"), XS_Mob_GetModVulnerability, file, "$$"); + newXSproto(strcpy(buf, "DoMeleeSkillAttackDmg"), XS_Mob_DoMeleeSkillAttackDmg, file, "$$$$$$$"); + newXSproto(strcpy(buf, "DoArcheryAttackDmg"), XS_Mob_DoArcheryAttackDmg, file, "$$$$$$$"); + newXSproto(strcpy(buf, "DoThrowingAttackDmg"), XS_Mob_DoThrowingAttackDmg, file, "$$$$$$$"); + newXSproto(strcpy(buf, "SetDisableMelee"), XS_Mob_SetDisableMelee, file, "$$"); + newXSproto(strcpy(buf, "IsMeleeDisabled"), XS_Mob_IsMeleeDisabled, file, "$"); + newXSproto(strcpy(buf, "SetFlurryChance"), XS_Mob_SetFlurryChance, file, "$$"); + newXSproto(strcpy(buf, "GetFlurryChance"), XS_Mob_GetFlurryChance, file, "$"); + newXSproto(strcpy(buf, "GetSpellStat"), XS_Mob_GetSpellStat, file, "$$$$"); + newXSproto(strcpy(buf, "GetSpecialAbility"), XS_Mob_GetSpecialAbility, file, "$$"); + newXSproto(strcpy(buf, "GetSpecialAbilityParam"), XS_Mob_GetSpecialAbilityParam, file, "$$$"); + newXSproto(strcpy(buf, "SetSpecialAbility"), XS_Mob_SetSpecialAbility, file, "$$$"); + newXSproto(strcpy(buf, "SetSpecialAbilityParam"), XS_Mob_SetSpecialAbilityParam, file, "$$$$"); + newXSproto(strcpy(buf, "ClearSpecialAbilities"), XS_Mob_ClearSpecialAbilities, file, "$"); + newXSproto(strcpy(buf, "ProcessSpecialAbilities"), XS_Mob_ProcessSpecialAbilities, file, "$$"); + newXSproto(strcpy(buf, "CanClassEquipItem"), XS_Mob_CanClassEquipItem, file, "$$"); + newXSproto(strcpy(buf, "IsFeared"), XS_Mob_IsFeared, file, "$"); + newXSproto(strcpy(buf, "IsBlind"), XS_Mob_IsBlind, file, "$"); + newXSproto(strcpy(buf, "SeeInvisible"), XS_Mob_SeeInvisible, file, "$"); + newXSproto(strcpy(buf, "SeeInvisibleUndead"), XS_Mob_SeeInvisibleUndead, file, "$"); + newXSproto(strcpy(buf, "SeeHide"), XS_Mob_SeeHide, file, "$"); + newXSproto(strcpy(buf, "SeeImprovedHide"), XS_Mob_SeeImprovedHide, file, "$"); + newXSproto(strcpy(buf, "GetNimbusEffect1"), XS_Mob_GetNimbusEffect1, file, "$"); + newXSproto(strcpy(buf, "GetNimbusEffect2"), XS_Mob_GetNimbusEffect2, file, "$"); + newXSproto(strcpy(buf, "GetNimbusEffect3"), XS_Mob_GetNimbusEffect3, file, "$"); + newXSproto(strcpy(buf, "IsTargetable"), XS_Mob_IsTargetable, file, "$"); + newXSproto(strcpy(buf, "HasShieldEquiped"), XS_Mob_HasShieldEquiped, file, "$"); + newXSproto(strcpy(buf, "HasTwoHandBluntEquiped"), XS_Mob_HasTwoHandBluntEquiped, file, "$"); + newXSproto(strcpy(buf, "HasTwoHanderEquipped"), XS_Mob_HasTwoHanderEquipped, file, "$"); + newXSproto(strcpy(buf, "GetHerosForgeModel"), XS_Mob_GetHerosForgeModel, file, "$$"); + newXSproto(strcpy(buf, "IsEliteMaterialItem"), XS_Mob_IsEliteMaterialItem, file, "$$"); + newXSproto(strcpy(buf, "GetBaseSize"), XS_Mob_GetBaseSize, file, "$"); + newXSproto(strcpy(buf, "HasOwner"), XS_Mob_HasOwner, file, "$"); + newXSproto(strcpy(buf, "IsPet"), XS_Mob_IsPet, file, "$"); + newXSproto(strcpy(buf, "HasPet"), XS_Mob_HasPet, file, "$"); + newXSproto(strcpy(buf, "IsSilenced"), XS_Mob_IsSilenced, file, "$"); + newXSproto(strcpy(buf, "IsAmnesiad"), XS_Mob_IsAmnesiad, file, "$"); + newXSproto(strcpy(buf, "GetMeleeMitigation"), XS_Mob_GetMeleeMitigation, file, "$"); + newXSproto(strcpy(buf, "TryMoveAlong"), XS_Mob_TryMoveAlong, file, "$$$;$"); XSRETURN_YES; } From 332a3d6c6a5e13d92c27796fa2fdbabf7fcadb9b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 19:30:52 -0500 Subject: [PATCH 06/33] Add "mob" to perl-doc-parser.pl --- utils/scripts/perl-doc-parser.pl | 37 +++++++++++++++++++++++++++++--- zone/perl_mob.cpp | 2 +- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/utils/scripts/perl-doc-parser.pl b/utils/scripts/perl-doc-parser.pl index e64ea85d6..1a3f20d6f 100755 --- a/utils/scripts/perl-doc-parser.pl +++ b/utils/scripts/perl-doc-parser.pl @@ -1,6 +1,21 @@ use File::Find; use Data::Dumper; +sub usage() { + print "Usage:\n"; + print " --client - Prints methods for just client class methods\n"; + print " --mob - Prints methods for just mob class methods\n"; + print " --all - Prints methods for all classes\n"; + exit(1); +} + +if($#ARGV < 0) { + usage(); +} + +my $export = $ARGV[0]; +$export=~s/--//g; + my @files; my $start_dir = "zone/"; find( @@ -14,6 +29,13 @@ for my $file (@files) { next; } + #::: If we are specifying a specific class type, skip everything else + if ($export ne "all" && $export ne "") { + if ($file!~/$export/i) { + next; + } + } + @methods = (); #::: Open File @@ -23,10 +45,19 @@ for my $file (@files) { chomp; $line = $_; - if ($line=~/Client::/i) { + if ($line=~/Client::|Mob::/i && $line=~/_croak/i) { - $split_key = "Client::"; - $object_prefix = "\$client->"; + #::: Client export + if ($export=~/all|client/i) { + $split_key = "Client::"; + $object_prefix = "\$client->"; + } + + #::: Mob export + if ($export=~/all|mob/i) { + $split_key = "Mob::"; + $object_prefix = "\$mob->"; + } #::: Split on croak usage @data = split($split_key, $line); diff --git a/zone/perl_mob.cpp b/zone/perl_mob.cpp index c295da59c..0a6275169 100644 --- a/zone/perl_mob.cpp +++ b/zone/perl_mob.cpp @@ -7183,7 +7183,7 @@ XS(XS_Mob_IsRunning); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_IsRunning) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: Mob:::IsRunning(THIS)"); + Perl_croak(aTHX_ "Usage: Mob::IsRunning(THIS)"); { Mob *THIS; bool RETVAL; From 2010d1ba83033e89441acd71195cc57158f1848d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 19:36:35 -0500 Subject: [PATCH 07/33] Update usage docs for perl_player_corpse --- zone/perl_player_corpse.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/zone/perl_player_corpse.cpp b/zone/perl_player_corpse.cpp index a417284c8..c16a05d57 100644 --- a/zone/perl_player_corpse.cpp +++ b/zone/perl_player_corpse.cpp @@ -245,7 +245,7 @@ XS(XS_Corpse_SetDecayTimer) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Corpse::SetDecayTimer(THIS, decaytime)"); + Perl_croak(aTHX_ "Usage: Corpse::SetDecayTimer(THIS, uint32 decay_time)"); { Corpse * THIS; uint32 decaytime = (uint32)SvUV(ST(1)); @@ -295,7 +295,7 @@ XS(XS_Corpse_AddItem) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ "Usage: Corpse::AddItem(THIS, itemnum, charges, slot= 0)"); + Perl_croak(aTHX_ "Usage: Corpse::AddItem(THIS, uint32 item_id, uint16 charges, [unt16 slot = 0])"); { Corpse * THIS; uint32 itemnum = (uint32)SvUV(ST(1)); @@ -354,7 +354,7 @@ XS(XS_Corpse_RemoveItem) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Corpse::RemoveItem(THIS, lootslot)"); + Perl_croak(aTHX_ "Usage: Corpse::RemoveItem(THIS, uint16 loot_slot)"); { Corpse * THIS; uint16 lootslot = (uint16)SvUV(ST(1)); @@ -378,7 +378,7 @@ XS(XS_Corpse_SetCash) { dXSARGS; if (items != 5) - Perl_croak(aTHX_ "Usage: Corpse::SetCash(THIS, in_copper, in_silver, in_gold, in_platinum)"); + Perl_croak(aTHX_ "Usage: Corpse::SetCash(THIS, uint16 copper, uint16 silver, uint16 gold, uint16 platinum)"); { Corpse * THIS; uint16 in_copper = (uint16)SvUV(ST(1)); @@ -581,7 +581,7 @@ XS(XS_Corpse_Summon) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Corpse::Summon(THIS, client, spell)"); + Perl_croak(aTHX_ "Usage: Corpse::Summon(THIS, Client* client, bool is_spell)"); { Corpse * THIS; Client* client; @@ -615,7 +615,7 @@ XS(XS_Corpse_CastRezz) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Corpse::CastRezz(THIS, spellid, Caster)"); + Perl_croak(aTHX_ "Usage: Corpse::CastRezz(THIS, uint16 spell_id, [Mob* caster = nullptr])"); { Corpse * THIS; uint16 spellid = (uint16)SvUV(ST(1)); @@ -672,7 +672,7 @@ XS(XS_Corpse_CanMobLoot) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Corpse::CanMobLoot(THIS, charid)"); + Perl_croak(aTHX_ "Usage: Corpse::CanMobLoot(THIS, int character_id)"); { Corpse * THIS; bool RETVAL; @@ -699,7 +699,7 @@ XS(XS_Corpse_AllowMobLoot) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Corpse::AllowMobLoot(THIS, them, slot)"); + Perl_croak(aTHX_ "Usage: Corpse::AllowMobLoot(THIS, Mob* them, uint8 slot)"); { Corpse * THIS; Mob * them; @@ -733,7 +733,7 @@ XS(XS_Corpse_AddLooter) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Corpse::AddLooter(THIS, who)"); + Perl_croak(aTHX_ "Usage: Corpse::AddLooter(THIS, Mob* who)"); { Corpse * THIS; Mob * who; From 88ed2e64bbc500f0d9effb2bfc23c7e232c01225 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 19:36:47 -0500 Subject: [PATCH 08/33] perl_player_corpse.cpp formatting --- zone/perl_player_corpse.cpp | 592 +++++++++++++++++------------------- 1 file changed, 272 insertions(+), 320 deletions(-) diff --git a/zone/perl_player_corpse.cpp b/zone/perl_player_corpse.cpp index c16a05d57..69be0f48c 100644 --- a/zone/perl_player_corpse.cpp +++ b/zone/perl_player_corpse.cpp @@ -26,7 +26,9 @@ */ #include "../common/features.h" + #ifdef EMBPERL_XS_CLASSES + #include "../common/global_define.h" #include "embperl.h" @@ -42,73 +44,69 @@ XS(XS_Corpse_GetCharID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_GetCharID) -{ +XS(XS_Corpse_GetCharID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Corpse::GetCharID(THIS)"); { - Corpse * THIS; - uint32 RETVAL; + Corpse *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCharID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Corpse_GetDecayTime); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_GetDecayTime) -{ +XS(XS_Corpse_GetDecayTime) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Corpse::GetDecayTime(THIS)"); { - Corpse * THIS; - uint32 RETVAL; + Corpse *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDecayTime(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Corpse_Lock); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_Lock) -{ +XS(XS_Corpse_Lock) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Corpse::Lock(THIS)"); { - Corpse * THIS; + Corpse *THIS; if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Lock(); @@ -117,21 +115,19 @@ XS(XS_Corpse_Lock) } XS(XS_Corpse_UnLock); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_UnLock) -{ +XS(XS_Corpse_UnLock) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Corpse::UnLock(THIS)"); { - Corpse * THIS; + Corpse *THIS; if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->UnLock(); @@ -140,22 +136,20 @@ XS(XS_Corpse_UnLock) } XS(XS_Corpse_IsLocked); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_IsLocked) -{ +XS(XS_Corpse_IsLocked) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Corpse::IsLocked(THIS)"); { - Corpse * THIS; - bool RETVAL; + Corpse *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsLocked(); @@ -166,21 +160,19 @@ XS(XS_Corpse_IsLocked) } XS(XS_Corpse_ResetLooter); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_ResetLooter) -{ +XS(XS_Corpse_ResetLooter) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Corpse::ResetLooter(THIS)"); { - Corpse * THIS; + Corpse *THIS; if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ResetLooter(); @@ -189,74 +181,71 @@ XS(XS_Corpse_ResetLooter) } XS(XS_Corpse_GetDBID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_GetDBID) -{ +XS(XS_Corpse_GetDBID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Corpse::GetDBID(THIS)"); { - Corpse * THIS; - uint32 RETVAL; + Corpse *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCorpseDBID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Corpse_GetOwnerName); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_GetOwnerName) -{ +XS(XS_Corpse_GetOwnerName) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Corpse::GetOwnerName(THIS)"); { - Corpse * THIS; - char * RETVAL; + Corpse *THIS; + char *RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetOwnerName(); - sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; + sv_setpv(TARG, RETVAL); + XSprePUSH; + PUSHTARG; } XSRETURN(1); } XS(XS_Corpse_SetDecayTimer); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_SetDecayTimer) -{ +XS(XS_Corpse_SetDecayTimer) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Corpse::SetDecayTimer(THIS, uint32 decay_time)"); { - Corpse * THIS; - uint32 decaytime = (uint32)SvUV(ST(1)); + Corpse *THIS; + uint32 decaytime = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetDecayTimer(decaytime); @@ -265,22 +254,20 @@ XS(XS_Corpse_SetDecayTimer) } XS(XS_Corpse_IsEmpty); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_IsEmpty) -{ +XS(XS_Corpse_IsEmpty) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Corpse::IsEmpty(THIS)"); { - Corpse * THIS; - bool RETVAL; + Corpse *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsEmpty(); @@ -291,30 +278,28 @@ XS(XS_Corpse_IsEmpty) } XS(XS_Corpse_AddItem); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_AddItem) -{ +XS(XS_Corpse_AddItem) { dXSARGS; if (items < 3 || items > 4) Perl_croak(aTHX_ "Usage: Corpse::AddItem(THIS, uint32 item_id, uint16 charges, [unt16 slot = 0])"); { - Corpse * THIS; - uint32 itemnum = (uint32)SvUV(ST(1)); - uint16 charges = (uint16)SvUV(ST(2)); - int16 slot; + Corpse *THIS; + uint32 itemnum = (uint32) SvUV(ST(1)); + uint16 charges = (uint16) SvUV(ST(2)); + int16 slot; if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 4) slot = 0; else { - slot = (int16)SvIV(ST(3)); + slot = (int16) SvIV(ST(3)); } THIS->AddItem(itemnum, charges, slot); @@ -323,49 +308,46 @@ XS(XS_Corpse_AddItem) } XS(XS_Corpse_GetWornItem); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_GetWornItem) -{ +XS(XS_Corpse_GetWornItem) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Corpse::GetWornItem(THIS, equipSlot)"); { - Corpse * THIS; - uint32 RETVAL; + Corpse *THIS; + uint32 RETVAL; dXSTARG; - int16 equipSlot = (int16)SvIV(ST(1)); + int16 equipSlot = (int16) SvIV(ST(1)); if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetWornItem(equipSlot); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Corpse_RemoveItem); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_RemoveItem) -{ +XS(XS_Corpse_RemoveItem) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Corpse::RemoveItem(THIS, uint16 loot_slot)"); { - Corpse * THIS; - uint16 lootslot = (uint16)SvUV(ST(1)); + Corpse *THIS; + uint16 lootslot = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveItem(lootslot); @@ -374,25 +356,23 @@ XS(XS_Corpse_RemoveItem) } XS(XS_Corpse_SetCash); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_SetCash) -{ +XS(XS_Corpse_SetCash) { dXSARGS; if (items != 5) Perl_croak(aTHX_ "Usage: Corpse::SetCash(THIS, uint16 copper, uint16 silver, uint16 gold, uint16 platinum)"); { - Corpse * THIS; - uint16 in_copper = (uint16)SvUV(ST(1)); - uint16 in_silver = (uint16)SvUV(ST(2)); - uint16 in_gold = (uint16)SvUV(ST(3)); - uint16 in_platinum = (uint16)SvUV(ST(4)); + Corpse *THIS; + uint16 in_copper = (uint16) SvUV(ST(1)); + uint16 in_silver = (uint16) SvUV(ST(2)); + uint16 in_gold = (uint16) SvUV(ST(3)); + uint16 in_platinum = (uint16) SvUV(ST(4)); if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetCash(in_copper, in_silver, in_gold, in_platinum); @@ -401,21 +381,19 @@ XS(XS_Corpse_SetCash) } XS(XS_Corpse_RemoveCash); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_RemoveCash) -{ +XS(XS_Corpse_RemoveCash) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Corpse::RemoveCash(THIS)"); { - Corpse * THIS; + Corpse *THIS; if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveCash(); @@ -424,47 +402,44 @@ XS(XS_Corpse_RemoveCash) } XS(XS_Corpse_CountItems); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_CountItems) -{ +XS(XS_Corpse_CountItems) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Corpse::CountItems(THIS)"); { - Corpse * THIS; - uint32 RETVAL; + Corpse *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CountItems(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Corpse_Delete); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_Delete) -{ +XS(XS_Corpse_Delete) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Corpse::Delete(THIS)"); { - Corpse * THIS; + Corpse *THIS; if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Delete(); @@ -473,136 +448,129 @@ XS(XS_Corpse_Delete) } XS(XS_Corpse_GetCopper); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_GetCopper) -{ +XS(XS_Corpse_GetCopper) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Corpse::GetCopper(THIS)"); { - Corpse * THIS; - uint32 RETVAL; + Corpse *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCopper(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Corpse_GetSilver); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_GetSilver) -{ +XS(XS_Corpse_GetSilver) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Corpse::GetSilver(THIS)"); { - Corpse * THIS; - uint32 RETVAL; + Corpse *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSilver(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Corpse_GetGold); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_GetGold) -{ +XS(XS_Corpse_GetGold) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Corpse::GetGold(THIS)"); { - Corpse * THIS; - uint32 RETVAL; + Corpse *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGold(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Corpse_GetPlatinum); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_GetPlatinum) -{ +XS(XS_Corpse_GetPlatinum) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Corpse::GetPlatinum(THIS)"); { - Corpse * THIS; - uint32 RETVAL; + Corpse *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPlatinum(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Corpse_Summon); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_Summon) -{ +XS(XS_Corpse_Summon) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Corpse::Summon(THIS, Client* client, bool is_spell)"); { - Corpse * THIS; - Client* client; - bool spell = (bool)SvTRUE(ST(2)); + Corpse *THIS; + Client *client; + bool spell = (bool) SvTRUE(ST(2)); if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - client = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + client = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "client is not of type Client"); - if(client == nullptr) + if (client == nullptr) Perl_croak(aTHX_ "client is nullptr, avoiding crash."); THIS->Summon(client, spell, true); @@ -611,32 +579,29 @@ XS(XS_Corpse_Summon) } XS(XS_Corpse_CastRezz); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_CastRezz) -{ +XS(XS_Corpse_CastRezz) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Corpse::CastRezz(THIS, uint16 spell_id, [Mob* caster = nullptr])"); { - Corpse * THIS; - uint16 spellid = (uint16)SvUV(ST(1)); - Mob* Caster; + Corpse *THIS; + uint16 spellid = (uint16) SvUV(ST(1)); + Mob *Caster; if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(2), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(2))); - Caster = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(2))); + Caster = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "Caster is not of type Mob"); - if(Caster == nullptr) + if (Caster == nullptr) Perl_croak(aTHX_ "Caster is nullptr, avoiding crash."); THIS->CastRezz(spellid, Caster); @@ -645,21 +610,19 @@ XS(XS_Corpse_CastRezz) } XS(XS_Corpse_CompleteRezz); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_CompleteRezz) -{ +XS(XS_Corpse_CompleteRezz) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Corpse::CompleteRezz(THIS)"); { - Corpse * THIS; + Corpse *THIS; if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->CompleteResurrection(); @@ -668,59 +631,54 @@ XS(XS_Corpse_CompleteRezz) } XS(XS_Corpse_CanMobLoot); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_CanMobLoot) -{ +XS(XS_Corpse_CanMobLoot) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Corpse::CanMobLoot(THIS, int character_id)"); { - Corpse * THIS; - bool RETVAL; - int charid = (int)SvIV(ST(1)); + Corpse *THIS; + bool RETVAL; + int charid = (int) SvIV(ST(1)); if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CanPlayerLoot(charid); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Corpse_AllowMobLoot); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_AllowMobLoot) -{ +XS(XS_Corpse_AllowMobLoot) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Corpse::AllowMobLoot(THIS, Mob* them, uint8 slot)"); { - Corpse * THIS; - Mob * them; - uint8 slot = (uint8)SvUV(ST(2)); + Corpse *THIS; + Mob *them; + uint8 slot = (uint8) SvUV(ST(2)); if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - them = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + them = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "them is not of type Mob"); - if(them == nullptr) + if (them == nullptr) Perl_croak(aTHX_ "them is nullptr, avoiding crash."); THIS->AllowPlayerLoot(them, slot); @@ -729,31 +687,28 @@ XS(XS_Corpse_AllowMobLoot) } XS(XS_Corpse_AddLooter); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_AddLooter) -{ +XS(XS_Corpse_AddLooter) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Corpse::AddLooter(THIS, Mob* who)"); { - Corpse * THIS; - Mob * who; + Corpse *THIS; + Mob *who; if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - who = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + who = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "who is not of type Mob"); - if(who == nullptr) + if (who == nullptr) Perl_croak(aTHX_ "who is nullptr, avoiding crash."); THIS->AddLooter(who); @@ -762,22 +717,20 @@ XS(XS_Corpse_AddLooter) } XS(XS_Corpse_IsRezzed); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_IsRezzed) -{ +XS(XS_Corpse_IsRezzed) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Corpse::IsRezzed(THIS)"); { - Corpse * THIS; - bool RETVAL; + Corpse *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Corpse")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Corpse *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsRezzed(); @@ -791,49 +744,48 @@ XS(XS_Corpse_IsRezzed) extern "C" #endif XS(boot_Corpse); /* prototype to pass -Wmissing-prototypes */ -XS(boot_Corpse) -{ +XS(boot_Corpse) { dXSARGS; char file[256]; strncpy(file, __FILE__, 256); file[255] = 0; - if(items != 1) + if (items != 1) fprintf(stderr, "boot_quest does not take any arguments."); char buf[128]; //add the strcpy stuff to get rid of const warnings.... - XS_VERSION_BOOTCHECK ; + XS_VERSION_BOOTCHECK; - newXSproto(strcpy(buf, "GetCharID"), XS_Corpse_GetCharID, file, "$"); - newXSproto(strcpy(buf, "GetDecayTime"), XS_Corpse_GetDecayTime, file, "$"); - newXSproto(strcpy(buf, "Lock"), XS_Corpse_Lock, file, "$"); - newXSproto(strcpy(buf, "UnLock"), XS_Corpse_UnLock, file, "$"); - newXSproto(strcpy(buf, "IsLocked"), XS_Corpse_IsLocked, file, "$"); - newXSproto(strcpy(buf, "ResetLooter"), XS_Corpse_ResetLooter, file, "$"); - newXSproto(strcpy(buf, "GetDBID"), XS_Corpse_GetDBID, file, "$"); - newXSproto(strcpy(buf, "GetOwnerName"), XS_Corpse_GetOwnerName, file, "$"); - newXSproto(strcpy(buf, "SetDecayTimer"), XS_Corpse_SetDecayTimer, file, "$$"); - newXSproto(strcpy(buf, "IsEmpty"), XS_Corpse_IsEmpty, file, "$"); - newXSproto(strcpy(buf, "AddItem"), XS_Corpse_AddItem, file, "$$$;$"); - newXSproto(strcpy(buf, "GetWornItem"), XS_Corpse_GetWornItem, file, "$$"); - newXSproto(strcpy(buf, "RemoveItem"), XS_Corpse_RemoveItem, file, "$$"); - newXSproto(strcpy(buf, "SetCash"), XS_Corpse_SetCash, file, "$$$$$"); - newXSproto(strcpy(buf, "RemoveCash"), XS_Corpse_RemoveCash, file, "$"); - newXSproto(strcpy(buf, "CountItems"), XS_Corpse_CountItems, file, "$"); - newXSproto(strcpy(buf, "Delete"), XS_Corpse_Delete, file, "$"); - newXSproto(strcpy(buf, "GetCopper"), XS_Corpse_GetCopper, file, "$"); - newXSproto(strcpy(buf, "GetSilver"), XS_Corpse_GetSilver, file, "$"); - newXSproto(strcpy(buf, "GetGold"), XS_Corpse_GetGold, file, "$"); - newXSproto(strcpy(buf, "GetPlatinum"), XS_Corpse_GetPlatinum, file, "$"); - newXSproto(strcpy(buf, "Summon"), XS_Corpse_Summon, file, "$$$"); - newXSproto(strcpy(buf, "CastRezz"), XS_Corpse_CastRezz, file, "$$$"); - newXSproto(strcpy(buf, "CompleteRezz"), XS_Corpse_CompleteRezz, file, "$"); - newXSproto(strcpy(buf, "CanMobLoot"), XS_Corpse_CanMobLoot, file, "$$"); - newXSproto(strcpy(buf, "AllowMobLoot"), XS_Corpse_AllowMobLoot, file, "$$$"); - newXSproto(strcpy(buf, "AddLooter"), XS_Corpse_AddLooter, file, "$$"); - newXSproto(strcpy(buf, "IsRezzed"), XS_Corpse_IsRezzed, file, "$"); + newXSproto(strcpy(buf, "GetCharID"), XS_Corpse_GetCharID, file, "$"); + newXSproto(strcpy(buf, "GetDecayTime"), XS_Corpse_GetDecayTime, file, "$"); + newXSproto(strcpy(buf, "Lock"), XS_Corpse_Lock, file, "$"); + newXSproto(strcpy(buf, "UnLock"), XS_Corpse_UnLock, file, "$"); + newXSproto(strcpy(buf, "IsLocked"), XS_Corpse_IsLocked, file, "$"); + newXSproto(strcpy(buf, "ResetLooter"), XS_Corpse_ResetLooter, file, "$"); + newXSproto(strcpy(buf, "GetDBID"), XS_Corpse_GetDBID, file, "$"); + newXSproto(strcpy(buf, "GetOwnerName"), XS_Corpse_GetOwnerName, file, "$"); + newXSproto(strcpy(buf, "SetDecayTimer"), XS_Corpse_SetDecayTimer, file, "$$"); + newXSproto(strcpy(buf, "IsEmpty"), XS_Corpse_IsEmpty, file, "$"); + newXSproto(strcpy(buf, "AddItem"), XS_Corpse_AddItem, file, "$$$;$"); + newXSproto(strcpy(buf, "GetWornItem"), XS_Corpse_GetWornItem, file, "$$"); + newXSproto(strcpy(buf, "RemoveItem"), XS_Corpse_RemoveItem, file, "$$"); + newXSproto(strcpy(buf, "SetCash"), XS_Corpse_SetCash, file, "$$$$$"); + newXSproto(strcpy(buf, "RemoveCash"), XS_Corpse_RemoveCash, file, "$"); + newXSproto(strcpy(buf, "CountItems"), XS_Corpse_CountItems, file, "$"); + newXSproto(strcpy(buf, "Delete"), XS_Corpse_Delete, file, "$"); + newXSproto(strcpy(buf, "GetCopper"), XS_Corpse_GetCopper, file, "$"); + newXSproto(strcpy(buf, "GetSilver"), XS_Corpse_GetSilver, file, "$"); + newXSproto(strcpy(buf, "GetGold"), XS_Corpse_GetGold, file, "$"); + newXSproto(strcpy(buf, "GetPlatinum"), XS_Corpse_GetPlatinum, file, "$"); + newXSproto(strcpy(buf, "Summon"), XS_Corpse_Summon, file, "$$$"); + newXSproto(strcpy(buf, "CastRezz"), XS_Corpse_CastRezz, file, "$$$"); + newXSproto(strcpy(buf, "CompleteRezz"), XS_Corpse_CompleteRezz, file, "$"); + newXSproto(strcpy(buf, "CanMobLoot"), XS_Corpse_CanMobLoot, file, "$$"); + newXSproto(strcpy(buf, "AllowMobLoot"), XS_Corpse_AllowMobLoot, file, "$$$"); + newXSproto(strcpy(buf, "AddLooter"), XS_Corpse_AddLooter, file, "$$"); + newXSproto(strcpy(buf, "IsRezzed"), XS_Corpse_IsRezzed, file, "$"); XSRETURN_YES; } From b87e355db3009ef14845a63f4dfc034967dee96e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 19:36:57 -0500 Subject: [PATCH 09/33] Add corpse to perl-doc-parser.pl --- utils/scripts/perl-doc-parser.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/utils/scripts/perl-doc-parser.pl b/utils/scripts/perl-doc-parser.pl index 1a3f20d6f..d54e39ebc 100755 --- a/utils/scripts/perl-doc-parser.pl +++ b/utils/scripts/perl-doc-parser.pl @@ -5,6 +5,7 @@ sub usage() { print "Usage:\n"; print " --client - Prints methods for just client class methods\n"; print " --mob - Prints methods for just mob class methods\n"; + print " --corpse - Prints methods for just corpse class methods\n"; print " --all - Prints methods for all classes\n"; exit(1); } @@ -45,7 +46,7 @@ for my $file (@files) { chomp; $line = $_; - if ($line=~/Client::|Mob::/i && $line=~/_croak/i) { + if ($line=~/Client::|Mob::|Corpse::/i && $line=~/_croak/i) { #::: Client export if ($export=~/all|client/i) { @@ -59,6 +60,12 @@ for my $file (@files) { $object_prefix = "\$mob->"; } + #::: Corpse export + if ($export=~/all|corpse/i) { + $split_key = "Corpse::"; + $object_prefix = "\$corpse->"; + } + #::: Split on croak usage @data = split($split_key, $line); $usage = trim($data[1]); From 979e54daa75df917f6d6b79a57504f1528ae02f6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 19:49:21 -0500 Subject: [PATCH 10/33] Update usage croak docs perl_entity.cpp --- zone/perl_entity.cpp | 62 ++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/zone/perl_entity.cpp b/zone/perl_entity.cpp index eafc5c822..1397702f4 100644 --- a/zone/perl_entity.cpp +++ b/zone/perl_entity.cpp @@ -263,7 +263,7 @@ XS(XS_EntityList_GetClientByAccID) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: EntityList::GetClientByAccID(THIS, accid)"); + Perl_croak(aTHX_ "Usage: EntityList::GetClientByAccID(THIS, uint32 account_id)"); { EntityList * THIS; Client * RETVAL; @@ -290,7 +290,7 @@ XS(XS_EntityList_GetClientByID) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: EntityList::GetClientByID(THIS, id)"); + Perl_croak(aTHX_ "Usage: EntityList::GetClientByID(THIS, uint16 client_id)"); { EntityList * THIS; Client * RETVAL; @@ -317,7 +317,7 @@ XS(XS_EntityList_GetClientByCharID) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: EntityList::GetClientByCharID(THIS, iCharID)"); + Perl_croak(aTHX_ "Usage: EntityList::GetClientByCharID(THIS, uint32 character_id)"); { EntityList * THIS; Client * RETVAL; @@ -344,7 +344,7 @@ XS(XS_EntityList_GetClientByWID) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: EntityList::GetClientByWID(THIS, iWID)"); + Perl_croak(aTHX_ "Usage: EntityList::GetClientByWID(THIS, uint32 wid)"); { EntityList * THIS; Client * RETVAL; @@ -371,7 +371,7 @@ XS(XS_EntityList_GetObjectByDBID) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: EntityList::GetObjectByDBID(THIS, id)"); + Perl_croak(aTHX_ "Usage: EntityList::GetObjectByDBID(THIS, uint32 database_id)"); { EntityList * THIS; Object * RETVAL; @@ -398,7 +398,7 @@ XS(XS_EntityList_GetObjectByID) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: EntityList::GetObjectByID(THIS, id)"); + Perl_croak(aTHX_ "Usage: EntityList::GetObjectByID(THIS, uint32 entity_id)"); { EntityList * THIS; Object * RETVAL; @@ -425,7 +425,7 @@ XS(XS_EntityList_GetDoorsByDBID) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: EntityList::GetDoorsByDBID(THIS, id)"); + Perl_croak(aTHX_ "Usage: EntityList::GetDoorsByDBID(THIS, uint32 database_id)"); { EntityList * THIS; Doors * RETVAL; @@ -452,7 +452,7 @@ XS(XS_EntityList_GetDoorsByDoorID) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: EntityList::GetDoorsByDoorID(THIS, id)"); + Perl_croak(aTHX_ "Usage: EntityList::GetDoorsByDoorID(THIS, uint32 door_id)"); { EntityList * THIS; Doors * RETVAL; @@ -479,7 +479,7 @@ XS(XS_EntityList_GetDoorsByID) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: EntityList::GetDoorsByID(THIS, id)"); + Perl_croak(aTHX_ "Usage: EntityList::GetDoorsByID(THIS, uint32 entity_id)"); { EntityList * THIS; Doors * RETVAL; @@ -506,7 +506,7 @@ XS(XS_EntityList_FindDoor) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: EntityList::FindDoor(THIS, id)"); + Perl_croak(aTHX_ "Usage: EntityList::FindDoor(THIS, uint32 door_id)"); { EntityList * THIS; Doors * RETVAL; @@ -533,7 +533,7 @@ XS(XS_EntityList_GetGroupByMob) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: EntityList::GetGroupByMob(THIS, mob)"); + Perl_croak(aTHX_ "Usage: EntityList::GetGroupByMob(THIS, Mob* mob)"); { EntityList * THIS; Group * RETVAL; @@ -569,7 +569,7 @@ XS(XS_EntityList_GetGroupByClient) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: EntityList::GetGroupByClient(THIS, client)"); + Perl_croak(aTHX_ "Usage: EntityList::GetGroupByClient(THIS, Client* client)"); { EntityList * THIS; Group * RETVAL; @@ -835,7 +835,7 @@ XS(XS_EntityList_CanAddHateForMob) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: EntityList::CanAddHateForMob(THIS, p)"); + Perl_croak(aTHX_ "Usage: EntityList::CanAddHateForMob(THIS, Mob* target)"); { EntityList * THIS; bool RETVAL; @@ -1294,7 +1294,7 @@ XS(XS_EntityList_Message) { dXSARGS; if (items < 4) - Perl_croak(aTHX_ "Usage: EntityList::Message(THIS, to_guilddbid, type, message, ...)"); + Perl_croak(aTHX_ "Usage: EntityList::Message(THIS, uint32 guild_id, uint32 emote_color_type, string message)"); { EntityList * THIS; uint32 to_guilddbid = (uint32)SvUV(ST(1)); @@ -1320,7 +1320,7 @@ XS(XS_EntityList_MessageStatus) { dXSARGS; if (items < 5) - Perl_croak(aTHX_ "Usage: EntityList::MessageStatus(THIS, to_guilddbid, to_minstatus, type, message, ...)"); + Perl_croak(aTHX_ "Usage: EntityList::MessageStatus(THIS, uint32 guild_id, uint32 emote_color_type, string message)"); { EntityList * THIS; uint32 to_guilddbid = (uint32)SvUV(ST(1)); @@ -1347,7 +1347,7 @@ XS(XS_EntityList_MessageClose) { dXSARGS; if (items < 6) - Perl_croak(aTHX_ "Usage: EntityList::MessageClose(THIS, sender, skipsender, dist, type, message, ...)"); + Perl_croak(aTHX_ "Usage: EntityList::MessageClose(THIS, Mob* sender, bool skip_sender, float distance, uint32 emote_color_type, string message)"); { EntityList * THIS; Mob* sender; @@ -1384,7 +1384,7 @@ XS(XS_EntityList_RemoveFromTargets) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: EntityList::RemoveFromTargets(THIS, mob)"); + Perl_croak(aTHX_ "Usage: EntityList::RemoveFromTargets(THIS, Mob* target)"); { EntityList * THIS; Mob* mob; @@ -1417,7 +1417,7 @@ XS(XS_EntityList_ReplaceWithTarget) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: EntityList::ReplaceWithTarget(THIS, pOldMob, pNewTarget)"); + Perl_croak(aTHX_ "Usage: EntityList::ReplaceWithTarget(THIS, Mob* old_mob, Mob* new_target)"); { EntityList * THIS; Mob* pOldMob; @@ -1460,7 +1460,7 @@ XS(XS_EntityList_OpenDoorsNear) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: EntityList::OpenDoorsNear(THIS, opener)"); + Perl_croak(aTHX_ "Usage: EntityList::OpenDoorsNear(THIS, NPC* opener)"); { EntityList * THIS; NPC* opener; @@ -1493,7 +1493,7 @@ XS(XS_EntityList_MakeNameUnique) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: EntityList::MakeNameUnique(THIS, name)"); + Perl_croak(aTHX_ "Usage: EntityList::MakeNameUnique(THIS, string name)"); { EntityList * THIS; char * RETVAL; @@ -1520,7 +1520,7 @@ XS(XS_EntityList_RemoveNumbers) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: EntityList::RemoveNumbers(CLASS, name)"); + Perl_croak(aTHX_ "Usage: EntityListDeprecated::RemoveNumbers(CLASS, name)"); { char * RETVAL; dXSTARG; @@ -1537,7 +1537,7 @@ XS(XS_EntityList_SignalMobsByNPCID) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: EntityList::SignalMobsByNPCID(THIS, npc_type, signal_id)"); + Perl_croak(aTHX_ "Usage: EntityList::SignalMobsByNPCID(THIS, uint32 npc_type_id, int signal_id)"); { EntityList * THIS; uint32 npc_type = (uint32)SvUV(ST(1)); @@ -1562,7 +1562,7 @@ XS(XS_EntityList_RemoveEntity) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: EntityList::RemoveEntity(THIS, id)"); + Perl_croak(aTHX_ "Usage: EntityList::RemoveEntity(THIS, uint16 id)"); { EntityList * THIS; uint16 id = (uint16)SvUV(ST(1)); @@ -1638,7 +1638,7 @@ XS(XS_EntityList_HalveAggro) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: EntityList::HalveAggro(THIS, who)"); + Perl_croak(aTHX_ "Usage: EntityList::HalveAggro(THIS, Mob* target)"); { EntityList * THIS; Mob* who; @@ -1671,7 +1671,7 @@ XS(XS_EntityList_DoubleAggro) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: EntityList::DoubleAggro(THIS, who)"); + Perl_croak(aTHX_ "Usage: EntityList::DoubleAggro(THIS, *Mob target)"); { EntityList * THIS; Mob* who; @@ -1704,7 +1704,7 @@ XS(XS_EntityList_ClearFeignAggro) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: EntityList::ClearFeignAggro(THIS, targ)"); + Perl_croak(aTHX_ "Usage: EntityList::ClearFeignAggro(THIS, Mob* target)"); { EntityList * THIS; Mob* targ; @@ -1737,7 +1737,7 @@ XS(XS_EntityList_Fighting) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: EntityList::Fighting(THIS, targ)"); + Perl_croak(aTHX_ "Usage: EntityList::Fighting(THIS, Mob* target)"); { EntityList * THIS; bool RETVAL; @@ -1773,7 +1773,7 @@ XS(XS_EntityList_RemoveFromHateLists) { dXSARGS; if (items < 2 || items > 3) - Perl_croak(aTHX_ "Usage: EntityList::RemoveFromHateLists(THIS, mob, settoone= false)"); + Perl_croak(aTHX_ "Usage: EntityList::RemoveFromHateLists(THIS, Mob* mob, [bool set_to_one = false])"); { EntityList * THIS; Mob* mob; @@ -1813,7 +1813,7 @@ XS(XS_EntityList_MessageGroup) { dXSARGS; if (items < 5) - Perl_croak(aTHX_ "Usage: EntityList::MessageGroup(THIS, sender, skipclose, type, message, ...)"); + Perl_croak(aTHX_ "Usage: EntityList::MessageGroup(THIS, Mob* sender, bool skip_close, uint32 emote_color_type, string message)"); { EntityList * THIS; Mob* sender; @@ -1849,7 +1849,7 @@ XS(XS_EntityList_GetRandomClient) { dXSARGS; if ((items < 5) || (items > 6)) - Perl_croak(aTHX_ "Usage: EntityList::GetRandomClient(THIS, x, y, z, distance, excludeclient = nullptr)"); + Perl_croak(aTHX_ "Usage: EntityList::GetRandomClient(THIS, float x, float y, float z, float distance, [Client* exclude_client = nullptr])"); { EntityList *THIS; Client *RETVAL, *c = nullptr; @@ -2109,7 +2109,7 @@ XS(XS_EntityList_SignalAllClients) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: EntityList::SignalAllClients(THIS, data)"); + Perl_croak(aTHX_ "Usage: EntityList::SignalAllClients(THIS, uint32 data)"); { EntityList *THIS; uint32 data = (uint32)SvUV(ST(1)); From a6c1314e3ef9e2ef7db3a57ca3c518b4809fe661 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 19:49:31 -0500 Subject: [PATCH 11/33] perl_entity.cpp formatting --- zone/perl_entity.cpp | 1667 +++++++++++++++++++----------------------- 1 file changed, 756 insertions(+), 911 deletions(-) diff --git a/zone/perl_entity.cpp b/zone/perl_entity.cpp index 1397702f4..6653983a0 100644 --- a/zone/perl_entity.cpp +++ b/zone/perl_entity.cpp @@ -26,7 +26,9 @@ */ #include "../common/features.h" + #ifdef EMBPERL_XS_CLASSES + #include "../common/global_define.h" #include #include "embperl.h" @@ -43,786 +45,726 @@ XS(XS_EntityList_GetMobID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetMobID) -{ +XS(XS_EntityList_GetMobID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetMobID(THIS, id)"); { - EntityList * THIS; - Mob * RETVAL; - uint16 id = (uint16)SvUV(ST(1)); + EntityList *THIS; + Mob *RETVAL; + uint16 id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMobID(id); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Mob", (void*)RETVAL); + sv_setref_pv(ST(0), "Mob", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetMob); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetMob) -{ +XS(XS_EntityList_GetMob) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetMob(THIS, name)"); { - EntityList * THIS; - Mob * RETVAL; - char* name = (char *)SvPV_nolen(ST(1)); + EntityList *THIS; + Mob *RETVAL; + char *name = (char *) SvPV_nolen(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMob(name); - ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Mob", (void*)RETVAL); + ST(0) = sv_newmortal(); + sv_setref_pv(ST(0), "Mob", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetMobByID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetMobByID) -{ +XS(XS_EntityList_GetMobByID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetMobByID(THIS, id)"); { - EntityList * THIS; - Mob * RETVAL; - uint16 id = (uint16)SvUV(ST(1)); + EntityList *THIS; + Mob *RETVAL; + uint16 id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMob(id); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Mob", (void*)RETVAL); + sv_setref_pv(ST(0), "Mob", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetMobByNpcTypeID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetMobByNpcTypeID) -{ +XS(XS_EntityList_GetMobByNpcTypeID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetMobByNpcTypeID(THIS, get_id)"); { - EntityList * THIS; - Mob * RETVAL; - uint32 get_id = (uint32)SvUV(ST(1)); + EntityList *THIS; + Mob *RETVAL; + uint32 get_id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMobByNpcTypeID(get_id); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Mob", (void*)RETVAL); + sv_setref_pv(ST(0), "Mob", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_IsMobSpawnedByNpcTypeID); /* prototype pass -Wmissing-prototypes */ -XS(XS_EntityList_IsMobSpawnedByNpcTypeID) -{ +XS(XS_EntityList_IsMobSpawnedByNpcTypeID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::ValidMobByNpcTypeID(THIS, get_id)"); { - EntityList * THIS; - bool RETVAL; - uint32 get_id = (uint32)SvUV(ST(1)); + EntityList *THIS; + bool RETVAL; + uint32 get_id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsMobSpawnedByNpcTypeID(get_id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_EntityList_GetNPCByID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetNPCByID) -{ +XS(XS_EntityList_GetNPCByID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetNPCByID(THIS, id)"); { - EntityList * THIS; - NPC * RETVAL; - uint16 id = (uint16)SvUV(ST(1)); + EntityList *THIS; + NPC *RETVAL; + uint16 id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetNPCByID(id); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "NPC", (void*)RETVAL); + sv_setref_pv(ST(0), "NPC", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetNPCByNPCTypeID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetNPCByNPCTypeID) -{ +XS(XS_EntityList_GetNPCByNPCTypeID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetNPCByNPCTypeID(THIS, npc_id)"); { - EntityList * THIS; - NPC * RETVAL; - uint32 npc_id = (uint32)SvUV(ST(1)); + EntityList *THIS; + NPC *RETVAL; + uint32 npc_id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetNPCByNPCTypeID(npc_id); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "NPC", (void*)RETVAL); + sv_setref_pv(ST(0), "NPC", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetClientByName); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetClientByName) -{ +XS(XS_EntityList_GetClientByName) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetClientByName(THIS, name)"); { - EntityList * THIS; - Client * RETVAL; - char * name = (char *)SvPV_nolen(ST(1)); + EntityList *THIS; + Client *RETVAL; + char *name = (char *) SvPV_nolen(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetClientByName(name); - ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Client", (void*)RETVAL); + ST(0) = sv_newmortal(); + sv_setref_pv(ST(0), "Client", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetClientByAccID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetClientByAccID) -{ +XS(XS_EntityList_GetClientByAccID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetClientByAccID(THIS, uint32 account_id)"); { - EntityList * THIS; - Client * RETVAL; - uint32 accid = (uint32)SvUV(ST(1)); + EntityList *THIS; + Client *RETVAL; + uint32 accid = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetClientByAccID(accid); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Client", (void*)RETVAL); + sv_setref_pv(ST(0), "Client", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetClientByID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetClientByID) -{ +XS(XS_EntityList_GetClientByID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetClientByID(THIS, uint16 client_id)"); { - EntityList * THIS; - Client * RETVAL; - uint16 id = (uint16)SvUV(ST(1)); + EntityList *THIS; + Client *RETVAL; + uint16 id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetClientByID(id); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Client", (void*)RETVAL); + sv_setref_pv(ST(0), "Client", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetClientByCharID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetClientByCharID) -{ +XS(XS_EntityList_GetClientByCharID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetClientByCharID(THIS, uint32 character_id)"); { - EntityList * THIS; - Client * RETVAL; - uint32 iCharID = (uint32)SvUV(ST(1)); + EntityList *THIS; + Client *RETVAL; + uint32 iCharID = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetClientByCharID(iCharID); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Client", (void*)RETVAL); + sv_setref_pv(ST(0), "Client", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetClientByWID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetClientByWID) -{ +XS(XS_EntityList_GetClientByWID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetClientByWID(THIS, uint32 wid)"); { - EntityList * THIS; - Client * RETVAL; - uint32 iWID = (uint32)SvUV(ST(1)); + EntityList *THIS; + Client *RETVAL; + uint32 iWID = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetClientByWID(iWID); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Client", (void*)RETVAL); + sv_setref_pv(ST(0), "Client", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetObjectByDBID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetObjectByDBID) -{ +XS(XS_EntityList_GetObjectByDBID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetObjectByDBID(THIS, uint32 database_id)"); { - EntityList * THIS; - Object * RETVAL; - uint32 id = (uint32)SvUV(ST(1)); + EntityList *THIS; + Object *RETVAL; + uint32 id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetObjectByDBID(id); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Object", (void*)RETVAL); + sv_setref_pv(ST(0), "Object", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetObjectByID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetObjectByID) -{ +XS(XS_EntityList_GetObjectByID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetObjectByID(THIS, uint32 entity_id)"); { - EntityList * THIS; - Object * RETVAL; - uint32 id = (uint32)SvUV(ST(1)); + EntityList *THIS; + Object *RETVAL; + uint32 id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetObjectByID(id); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Object", (void*)RETVAL); + sv_setref_pv(ST(0), "Object", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetDoorsByDBID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetDoorsByDBID) -{ +XS(XS_EntityList_GetDoorsByDBID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetDoorsByDBID(THIS, uint32 database_id)"); { - EntityList * THIS; - Doors * RETVAL; - uint32 id = (uint32)SvUV(ST(1)); + EntityList *THIS; + Doors *RETVAL; + uint32 id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDoorsByDBID(id); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Doors", (void*)RETVAL); + sv_setref_pv(ST(0), "Doors", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetDoorsByDoorID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetDoorsByDoorID) -{ +XS(XS_EntityList_GetDoorsByDoorID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetDoorsByDoorID(THIS, uint32 door_id)"); { - EntityList * THIS; - Doors * RETVAL; - uint32 id = (uint32)SvUV(ST(1)); + EntityList *THIS; + Doors *RETVAL; + uint32 id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDoorsByDoorID(id); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Doors", (void*)RETVAL); + sv_setref_pv(ST(0), "Doors", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetDoorsByID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetDoorsByID) -{ +XS(XS_EntityList_GetDoorsByID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetDoorsByID(THIS, uint32 entity_id)"); { - EntityList * THIS; - Doors * RETVAL; - uint32 id = (uint32)SvUV(ST(1)); + EntityList *THIS; + Doors *RETVAL; + uint32 id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDoorsByID(id); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Doors", (void*)RETVAL); + sv_setref_pv(ST(0), "Doors", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_FindDoor); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_FindDoor) -{ +XS(XS_EntityList_FindDoor) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::FindDoor(THIS, uint32 door_id)"); { - EntityList * THIS; - Doors * RETVAL; - uint32 id = (uint32)SvUV(ST(1)); + EntityList *THIS; + Doors *RETVAL; + uint32 id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->FindDoor(id); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Doors", (void*)RETVAL); + sv_setref_pv(ST(0), "Doors", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetGroupByMob); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetGroupByMob) -{ +XS(XS_EntityList_GetGroupByMob) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetGroupByMob(THIS, Mob* mob)"); { - EntityList * THIS; - Group * RETVAL; - Mob* mob; + EntityList *THIS; + Group *RETVAL; + Mob *mob; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - mob = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + mob = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "mob is not of type Mob"); - if(mob == nullptr) + if (mob == nullptr) Perl_croak(aTHX_ "mob is nullptr, avoiding crash."); RETVAL = THIS->GetGroupByMob(mob); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Group", (void*)RETVAL); + sv_setref_pv(ST(0), "Group", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetGroupByClient); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetGroupByClient) -{ +XS(XS_EntityList_GetGroupByClient) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetGroupByClient(THIS, Client* client)"); { - EntityList * THIS; - Group * RETVAL; - Client* client; + EntityList *THIS; + Group *RETVAL; + Client *client; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - client = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + client = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "client is not of type Client"); - if(client == nullptr) + if (client == nullptr) Perl_croak(aTHX_ "client is nullptr, avoiding crash."); RETVAL = THIS->GetGroupByClient(client); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Group", (void*)RETVAL); + sv_setref_pv(ST(0), "Group", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetGroupByID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetGroupByID) -{ +XS(XS_EntityList_GetGroupByID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetGroupByID(THIS, id)"); { - EntityList * THIS; - Group * RETVAL; - uint32 id = (uint32)SvUV(ST(1)); + EntityList *THIS; + Group *RETVAL; + uint32 id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGroupByID(id); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Group", (void*)RETVAL); + sv_setref_pv(ST(0), "Group", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetGroupByLeaderName); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetGroupByLeaderName) -{ +XS(XS_EntityList_GetGroupByLeaderName) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetGroupByLeaderName(THIS, leader)"); { - EntityList * THIS; - Group * RETVAL; - char* leader = (char *)SvPV_nolen(ST(1)); + EntityList *THIS; + Group *RETVAL; + char *leader = (char *) SvPV_nolen(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGroupByLeaderName(leader); - ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Group", (void*)RETVAL); + ST(0) = sv_newmortal(); + sv_setref_pv(ST(0), "Group", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetRaidByID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetRaidByID) -{ +XS(XS_EntityList_GetRaidByID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetRaidByID(THIS, id)"); { - EntityList * THIS; - Raid * RETVAL; - uint32 id = (uint32)SvUV(ST(1)); + EntityList *THIS; + Raid *RETVAL; + uint32 id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetRaidByID(id); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Raid", (void*)RETVAL); + sv_setref_pv(ST(0), "Raid", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetRaidByClient); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetRaidByClient) -{ +XS(XS_EntityList_GetRaidByClient) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetRaidByClient(THIS, client)"); { - EntityList * THIS; - Raid * RETVAL; - Client* client; + EntityList *THIS; + Raid *RETVAL; + Client *client; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - client = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + client = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "client is not of type Client"); - if(client == nullptr) + if (client == nullptr) Perl_croak(aTHX_ "client is nullptr, avoiding crash."); RETVAL = THIS->GetRaidByClient(client); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Raid", (void*)RETVAL); + sv_setref_pv(ST(0), "Raid", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetCorpseByOwner); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetCorpseByOwner) -{ +XS(XS_EntityList_GetCorpseByOwner) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetCorpseByOwner(THIS, client)"); { - EntityList * THIS; - Corpse * RETVAL; - Client* client; + EntityList *THIS; + Corpse *RETVAL; + Client *client; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - client = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + client = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "client is not of type Client"); - if(client == nullptr) + if (client == nullptr) Perl_croak(aTHX_ "client is nullptr, avoiding crash."); RETVAL = THIS->GetCorpseByOwner(client); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Corpse", (void*)RETVAL); + sv_setref_pv(ST(0), "Corpse", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetCorpseByID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetCorpseByID) -{ +XS(XS_EntityList_GetCorpseByID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetCorpseByID(THIS, id)"); { - EntityList * THIS; - Corpse * RETVAL; - uint16 id = (uint16)SvUV(ST(1)); + EntityList *THIS; + Corpse *RETVAL; + uint16 id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCorpseByID(id); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Corpse", (void*)RETVAL); + sv_setref_pv(ST(0), "Corpse", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetCorpseByName); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetCorpseByName) -{ +XS(XS_EntityList_GetCorpseByName) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::GetCorpseByName(THIS, name)"); { - EntityList * THIS; - Corpse * RETVAL; - char* name = (char *)SvPV_nolen(ST(1)); + EntityList *THIS; + Corpse *RETVAL; + char *name = (char *) SvPV_nolen(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCorpseByName(name); - ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Corpse", (void*)RETVAL); + ST(0) = sv_newmortal(); + sv_setref_pv(ST(0), "Corpse", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_ClearClientPetitionQueue); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_ClearClientPetitionQueue) -{ +XS(XS_EntityList_ClearClientPetitionQueue) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: EntityList::ClearClientPetitionQueue(THIS)"); { - EntityList * THIS; + EntityList *THIS; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ClearClientPetitionQueue(); @@ -831,32 +773,29 @@ XS(XS_EntityList_ClearClientPetitionQueue) } XS(XS_EntityList_CanAddHateForMob); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_CanAddHateForMob) -{ +XS(XS_EntityList_CanAddHateForMob) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::CanAddHateForMob(THIS, Mob* target)"); { - EntityList * THIS; - bool RETVAL; - Mob * p; + EntityList *THIS; + bool RETVAL; + Mob *p; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - p = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + p = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "p is not of type Mob"); - if(p == nullptr) + if (p == nullptr) Perl_croak(aTHX_ "p is nullptr, avoiding crash."); RETVAL = THIS->CanAddHateForMob(p); @@ -867,21 +806,19 @@ XS(XS_EntityList_CanAddHateForMob) } XS(XS_EntityList_Clear); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_Clear) -{ +XS(XS_EntityList_Clear) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: EntityList::Clear(THIS)"); { - EntityList * THIS; + EntityList *THIS; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Clear(); @@ -890,237 +827,219 @@ XS(XS_EntityList_Clear) } XS(XS_EntityList_RemoveMob); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_RemoveMob) -{ +XS(XS_EntityList_RemoveMob) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::RemoveMob(THIS, delete_id)"); { - EntityList * THIS; - bool RETVAL; - uint16 delete_id = (uint16)SvUV(ST(1)); + EntityList *THIS; + bool RETVAL; + uint16 delete_id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveMob(delete_id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_EntityList_RemoveClient); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_RemoveClient) -{ +XS(XS_EntityList_RemoveClient) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::RemoveClient(THIS, delete_id)"); { - EntityList * THIS; - bool RETVAL; - uint16 delete_id = (uint16)SvUV(ST(1)); + EntityList *THIS; + bool RETVAL; + uint16 delete_id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveClient(delete_id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_EntityList_RemoveNPC); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_RemoveNPC) -{ +XS(XS_EntityList_RemoveNPC) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::RemoveNPC(THIS, delete_id)"); { - EntityList * THIS; - bool RETVAL; - uint16 delete_id = (uint16)SvUV(ST(1)); + EntityList *THIS; + bool RETVAL; + uint16 delete_id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveNPC(delete_id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_EntityList_RemoveGroup); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_RemoveGroup) -{ +XS(XS_EntityList_RemoveGroup) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::RemoveGroup(THIS, delete_id)"); { - EntityList * THIS; - bool RETVAL; - uint32 delete_id = (uint32)SvUV(ST(1)); + EntityList *THIS; + bool RETVAL; + uint32 delete_id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveGroup(delete_id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_EntityList_RemoveCorpse); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_RemoveCorpse) -{ +XS(XS_EntityList_RemoveCorpse) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::RemoveCorpse(THIS, delete_id)"); { - EntityList * THIS; - bool RETVAL; - uint16 delete_id = (uint16)SvUV(ST(1)); + EntityList *THIS; + bool RETVAL; + uint16 delete_id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveCorpse(delete_id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_EntityList_RemoveDoor); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_RemoveDoor) -{ +XS(XS_EntityList_RemoveDoor) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::RemoveDoor(THIS, delete_id)"); { - EntityList * THIS; - bool RETVAL; - uint16 delete_id = (uint16)SvUV(ST(1)); + EntityList *THIS; + bool RETVAL; + uint16 delete_id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveDoor(delete_id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_EntityList_RemoveTrap); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_RemoveTrap) -{ +XS(XS_EntityList_RemoveTrap) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::RemoveTrap(THIS, delete_id)"); { - EntityList * THIS; - bool RETVAL; - uint16 delete_id = (uint16)SvUV(ST(1)); + EntityList *THIS; + bool RETVAL; + uint16 delete_id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveTrap(delete_id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_EntityList_RemoveObject); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_RemoveObject) -{ +XS(XS_EntityList_RemoveObject) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::RemoveObject(THIS, delete_id)"); { - EntityList * THIS; - bool RETVAL; - uint16 delete_id = (uint16)SvUV(ST(1)); + EntityList *THIS; + bool RETVAL; + uint16 delete_id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveObject(delete_id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_EntityList_RemoveAllMobs); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_RemoveAllMobs) -{ +XS(XS_EntityList_RemoveAllMobs) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: EntityList::RemoveAllMobs(THIS)"); { - EntityList * THIS; + EntityList *THIS; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveAllMobs(); @@ -1129,21 +1048,19 @@ XS(XS_EntityList_RemoveAllMobs) } XS(XS_EntityList_RemoveAllClients); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_RemoveAllClients) -{ +XS(XS_EntityList_RemoveAllClients) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: EntityList::RemoveAllClients(THIS)"); { - EntityList * THIS; + EntityList *THIS; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveAllClients(); @@ -1152,21 +1069,19 @@ XS(XS_EntityList_RemoveAllClients) } XS(XS_EntityList_RemoveAllNPCs); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_RemoveAllNPCs) -{ +XS(XS_EntityList_RemoveAllNPCs) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: EntityList::RemoveAllNPCs(THIS)"); { - EntityList * THIS; + EntityList *THIS; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveAllNPCs(); @@ -1175,21 +1090,19 @@ XS(XS_EntityList_RemoveAllNPCs) } XS(XS_EntityList_RemoveAllGroups); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_RemoveAllGroups) -{ +XS(XS_EntityList_RemoveAllGroups) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: EntityList::RemoveAllGroups(THIS)"); { - EntityList * THIS; + EntityList *THIS; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveAllGroups(); @@ -1198,21 +1111,19 @@ XS(XS_EntityList_RemoveAllGroups) } XS(XS_EntityList_RemoveAllCorpses); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_RemoveAllCorpses) -{ +XS(XS_EntityList_RemoveAllCorpses) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: EntityList::RemoveAllCorpses(THIS)"); { - EntityList * THIS; + EntityList *THIS; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveAllCorpses(); @@ -1221,21 +1132,19 @@ XS(XS_EntityList_RemoveAllCorpses) } XS(XS_EntityList_RemoveAllDoors); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_RemoveAllDoors) -{ +XS(XS_EntityList_RemoveAllDoors) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: EntityList::RemoveAllDoors(THIS)"); { - EntityList * THIS; + EntityList *THIS; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveAllDoors(); @@ -1244,21 +1153,19 @@ XS(XS_EntityList_RemoveAllDoors) } XS(XS_EntityList_RemoveAllTraps); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_RemoveAllTraps) -{ +XS(XS_EntityList_RemoveAllTraps) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: EntityList::RemoveAllTraps(THIS)"); { - EntityList * THIS; + EntityList *THIS; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveAllTraps(); @@ -1267,21 +1174,19 @@ XS(XS_EntityList_RemoveAllTraps) } XS(XS_EntityList_RemoveAllObjects); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_RemoveAllObjects) -{ +XS(XS_EntityList_RemoveAllObjects) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: EntityList::RemoveAllObjects(THIS)"); { - EntityList * THIS; + EntityList *THIS; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveAllObjects(); @@ -1290,24 +1195,22 @@ XS(XS_EntityList_RemoveAllObjects) } XS(XS_EntityList_Message); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_Message) -{ +XS(XS_EntityList_Message) { dXSARGS; if (items < 4) Perl_croak(aTHX_ "Usage: EntityList::Message(THIS, uint32 guild_id, uint32 emote_color_type, string message)"); { - EntityList * THIS; - uint32 to_guilddbid = (uint32)SvUV(ST(1)); - uint32 type = (uint32)SvUV(ST(2)); - char* message = (char *)SvPV_nolen(ST(3)); + EntityList *THIS; + uint32 to_guilddbid = (uint32) SvUV(ST(1)); + uint32 type = (uint32) SvUV(ST(2)); + char *message = (char *) SvPV_nolen(ST(3)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Message(to_guilddbid, type, message); @@ -1316,25 +1219,24 @@ XS(XS_EntityList_Message) } XS(XS_EntityList_MessageStatus); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_MessageStatus) -{ +XS(XS_EntityList_MessageStatus) { dXSARGS; if (items < 5) - Perl_croak(aTHX_ "Usage: EntityList::MessageStatus(THIS, uint32 guild_id, uint32 emote_color_type, string message)"); + Perl_croak(aTHX_ + "Usage: EntityList::MessageStatus(THIS, uint32 guild_id, uint32 emote_color_type, string message)"); { - EntityList * THIS; - uint32 to_guilddbid = (uint32)SvUV(ST(1)); - int to_minstatus = (int)SvIV(ST(2)); - uint32 type = (uint32)SvUV(ST(3)); - char* message = (char *)SvPV_nolen(ST(4)); + EntityList *THIS; + uint32 to_guilddbid = (uint32) SvUV(ST(1)); + int to_minstatus = (int) SvIV(ST(2)); + uint32 type = (uint32) SvUV(ST(3)); + char *message = (char *) SvPV_nolen(ST(4)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->MessageStatus(to_guilddbid, to_minstatus, type, message); @@ -1343,35 +1245,33 @@ XS(XS_EntityList_MessageStatus) } XS(XS_EntityList_MessageClose); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_MessageClose) -{ +XS(XS_EntityList_MessageClose) { dXSARGS; if (items < 6) - Perl_croak(aTHX_ "Usage: EntityList::MessageClose(THIS, Mob* sender, bool skip_sender, float distance, uint32 emote_color_type, string message)"); + Perl_croak(aTHX_ + "Usage: EntityList::MessageClose(THIS, Mob* sender, bool skip_sender, float distance, uint32 emote_color_type, string message)"); { - EntityList * THIS; - Mob* sender; - bool skipsender = (bool)SvTRUE(ST(2)); - float dist = (float)SvNV(ST(3)); - uint32 type = (uint32)SvUV(ST(4)); - char* message = (char *)SvPV_nolen(ST(5)); + EntityList *THIS; + Mob *sender; + bool skipsender = (bool) SvTRUE(ST(2)); + float dist = (float) SvNV(ST(3)); + uint32 type = (uint32) SvUV(ST(4)); + char *message = (char *) SvPV_nolen(ST(5)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - sender = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + sender = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "sender is not of type Mob"); - if(sender == nullptr) + if (sender == nullptr) Perl_croak(aTHX_ "sender is nullptr, avoiding crash."); THIS->MessageClose(sender, skipsender, dist, type, message); @@ -1380,31 +1280,28 @@ XS(XS_EntityList_MessageClose) } XS(XS_EntityList_RemoveFromTargets); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_RemoveFromTargets) -{ +XS(XS_EntityList_RemoveFromTargets) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::RemoveFromTargets(THIS, Mob* target)"); { - EntityList * THIS; - Mob* mob; + EntityList *THIS; + Mob *mob; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - mob = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + mob = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "mob is not of type Mob"); - if(mob == nullptr) + if (mob == nullptr) Perl_croak(aTHX_ "mob is nullptr, avoiding crash."); THIS->RemoveFromTargets(mob); @@ -1413,41 +1310,37 @@ XS(XS_EntityList_RemoveFromTargets) } XS(XS_EntityList_ReplaceWithTarget); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_ReplaceWithTarget) -{ +XS(XS_EntityList_ReplaceWithTarget) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: EntityList::ReplaceWithTarget(THIS, Mob* old_mob, Mob* new_target)"); { - EntityList * THIS; - Mob* pOldMob; - Mob* pNewTarget; + EntityList *THIS; + Mob *pOldMob; + Mob *pNewTarget; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - pOldMob = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + pOldMob = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "pOldMob is not of type Mob"); - if(pOldMob == nullptr) + if (pOldMob == nullptr) Perl_croak(aTHX_ "pOldMob is nullptr, avoiding crash."); if (sv_derived_from(ST(2), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(2))); - pNewTarget = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(2))); + pNewTarget = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "pNewTarget is not of type Mob"); - if(pNewTarget == nullptr) + if (pNewTarget == nullptr) Perl_croak(aTHX_ "pNewTarget is nullptr, avoiding crash."); THIS->ReplaceWithTarget(pOldMob, pNewTarget); @@ -1456,31 +1349,28 @@ XS(XS_EntityList_ReplaceWithTarget) } XS(XS_EntityList_OpenDoorsNear); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_OpenDoorsNear) -{ +XS(XS_EntityList_OpenDoorsNear) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::OpenDoorsNear(THIS, NPC* opener)"); { - EntityList * THIS; - NPC* opener; + EntityList *THIS; + NPC *opener; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - opener = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + opener = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "opener is not of type NPC"); - if(opener == nullptr) + if (opener == nullptr) Perl_croak(aTHX_ "opener is nullptr, avoiding crash."); THIS->OpenDoorsNear(opener); @@ -1489,67 +1379,66 @@ XS(XS_EntityList_OpenDoorsNear) } XS(XS_EntityList_MakeNameUnique); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_MakeNameUnique) -{ +XS(XS_EntityList_MakeNameUnique) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::MakeNameUnique(THIS, string name)"); { - EntityList * THIS; - char * RETVAL; + EntityList *THIS; + char *RETVAL; dXSTARG; - char* name = (char *)SvPV_nolen(ST(1)); + char *name = (char *) SvPV_nolen(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->MakeNameUnique(name); - sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; + sv_setpv(TARG, RETVAL); + XSprePUSH; + PUSHTARG; } XSRETURN(1); } XS(XS_EntityList_RemoveNumbers); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_RemoveNumbers) -{ +XS(XS_EntityList_RemoveNumbers) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityListDeprecated::RemoveNumbers(CLASS, name)"); { - char * RETVAL; + char *RETVAL; dXSTARG; - char* name = (char *)SvPV_nolen(ST(1)); + char *name = (char *) SvPV_nolen(ST(1)); RETVAL = EntityList::RemoveNumbers(name); - sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; + sv_setpv(TARG, RETVAL); + XSprePUSH; + PUSHTARG; } XSRETURN(1); } XS(XS_EntityList_SignalMobsByNPCID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_SignalMobsByNPCID) -{ +XS(XS_EntityList_SignalMobsByNPCID) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: EntityList::SignalMobsByNPCID(THIS, uint32 npc_type_id, int signal_id)"); { - EntityList * THIS; - uint32 npc_type = (uint32)SvUV(ST(1)); - int signal_id = (int)SvIV(ST(2)); + EntityList *THIS; + uint32 npc_type = (uint32) SvUV(ST(1)); + int signal_id = (int) SvIV(ST(2)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SignalMobsByNPCID(npc_type, signal_id); @@ -1558,22 +1447,20 @@ XS(XS_EntityList_SignalMobsByNPCID) } XS(XS_EntityList_RemoveEntity); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_RemoveEntity) -{ +XS(XS_EntityList_RemoveEntity) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::RemoveEntity(THIS, uint16 id)"); { - EntityList * THIS; - uint16 id = (uint16)SvUV(ST(1)); + EntityList *THIS; + uint16 id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveEntity(id); @@ -1582,83 +1469,78 @@ XS(XS_EntityList_RemoveEntity) } XS(XS_EntityList_DeleteNPCCorpses); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_DeleteNPCCorpses) -{ +XS(XS_EntityList_DeleteNPCCorpses) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: EntityList::DeleteNPCCorpses(THIS)"); { - EntityList * THIS; - int32 RETVAL; + EntityList *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->DeleteNPCCorpses(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_EntityList_DeletePlayerCorpses); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_DeletePlayerCorpses) -{ +XS(XS_EntityList_DeletePlayerCorpses) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: EntityList::DeletePlayerCorpses(THIS)"); { - EntityList * THIS; - int32 RETVAL; + EntityList *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->DeletePlayerCorpses(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_EntityList_HalveAggro); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_HalveAggro) -{ +XS(XS_EntityList_HalveAggro) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::HalveAggro(THIS, Mob* target)"); { - EntityList * THIS; - Mob* who; + EntityList *THIS; + Mob *who; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - who = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + who = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "who is not of type Mob"); - if(who == nullptr) + if (who == nullptr) Perl_croak(aTHX_ "who is nullptr, avoiding crash."); THIS->HalveAggro(who); @@ -1667,31 +1549,28 @@ XS(XS_EntityList_HalveAggro) } XS(XS_EntityList_DoubleAggro); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_DoubleAggro) -{ +XS(XS_EntityList_DoubleAggro) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::DoubleAggro(THIS, *Mob target)"); { - EntityList * THIS; - Mob* who; + EntityList *THIS; + Mob *who; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - who = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + who = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "who is not of type Mob"); - if(who == nullptr) + if (who == nullptr) Perl_croak(aTHX_ "who is nullptr, avoiding crash."); THIS->DoubleAggro(who); @@ -1700,31 +1579,28 @@ XS(XS_EntityList_DoubleAggro) } XS(XS_EntityList_ClearFeignAggro); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_ClearFeignAggro) -{ +XS(XS_EntityList_ClearFeignAggro) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::ClearFeignAggro(THIS, Mob* target)"); { - EntityList * THIS; - Mob* targ; + EntityList *THIS; + Mob *targ; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - targ = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + targ = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "targ is not of type Mob"); - if(targ == nullptr) + if (targ == nullptr) Perl_croak(aTHX_ "targ is nullptr, avoiding crash."); THIS->ClearFeignAggro(targ); @@ -1733,32 +1609,29 @@ XS(XS_EntityList_ClearFeignAggro) } XS(XS_EntityList_Fighting); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_Fighting) -{ +XS(XS_EntityList_Fighting) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::Fighting(THIS, Mob* target)"); { - EntityList * THIS; - bool RETVAL; - Mob* targ; + EntityList *THIS; + bool RETVAL; + Mob *targ; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - targ = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + targ = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "targ is not of type Mob"); - if(targ == nullptr) + if (targ == nullptr) Perl_croak(aTHX_ "targ is nullptr, avoiding crash."); RETVAL = THIS->Fighting(targ); @@ -1769,38 +1642,35 @@ XS(XS_EntityList_Fighting) } XS(XS_EntityList_RemoveFromHateLists); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_RemoveFromHateLists) -{ +XS(XS_EntityList_RemoveFromHateLists) { dXSARGS; if (items < 2 || items > 3) Perl_croak(aTHX_ "Usage: EntityList::RemoveFromHateLists(THIS, Mob* mob, [bool set_to_one = false])"); { - EntityList * THIS; - Mob* mob; - bool settoone; + EntityList *THIS; + Mob *mob; + bool settoone; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - mob = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + mob = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "mob is not of type Mob"); - if(mob == nullptr) + if (mob == nullptr) Perl_croak(aTHX_ "mob is nullptr, avoiding crash."); if (items < 3) settoone = false; else { - settoone = (bool)SvTRUE(ST(2)); + settoone = (bool) SvTRUE(ST(2)); } THIS->RemoveFromHateLists(mob, settoone); @@ -1809,34 +1679,32 @@ XS(XS_EntityList_RemoveFromHateLists) } XS(XS_EntityList_MessageGroup); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_MessageGroup) -{ +XS(XS_EntityList_MessageGroup) { dXSARGS; if (items < 5) - Perl_croak(aTHX_ "Usage: EntityList::MessageGroup(THIS, Mob* sender, bool skip_close, uint32 emote_color_type, string message)"); + Perl_croak(aTHX_ + "Usage: EntityList::MessageGroup(THIS, Mob* sender, bool skip_close, uint32 emote_color_type, string message)"); { - EntityList * THIS; - Mob* sender; - bool skipclose = (bool)SvTRUE(ST(2)); - uint32 type = (uint32)SvUV(ST(3)); - char* message = (char *)SvPV_nolen(ST(4)); + EntityList *THIS; + Mob *sender; + bool skipclose = (bool) SvTRUE(ST(2)); + uint32 type = (uint32) SvUV(ST(3)); + char *message = (char *) SvPV_nolen(ST(4)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - sender = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + sender = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "sender is not of type Mob"); - if(sender == nullptr) + if (sender == nullptr) Perl_croak(aTHX_ "sender is nullptr, avoiding crash."); THIS->MessageGroup(sender, skipclose, type, message); @@ -1845,46 +1713,43 @@ XS(XS_EntityList_MessageGroup) } XS(XS_EntityList_GetRandomClient); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetRandomClient) -{ +XS(XS_EntityList_GetRandomClient) { dXSARGS; if ((items < 5) || (items > 6)) - Perl_croak(aTHX_ "Usage: EntityList::GetRandomClient(THIS, float x, float y, float z, float distance, [Client* exclude_client = nullptr])"); + Perl_croak(aTHX_ + "Usage: EntityList::GetRandomClient(THIS, float x, float y, float z, float distance, [Client* exclude_client = nullptr])"); { EntityList *THIS; - Client *RETVAL, *c = nullptr; - float x = (float)SvNV(ST(1)); - float y = (float)SvNV(ST(2)); - float z = (float)SvNV(ST(3)); - float d = (float)SvNV(ST(4)); + Client *RETVAL, *c = nullptr; + float x = (float) SvNV(ST(1)); + float y = (float) SvNV(ST(2)); + float z = (float) SvNV(ST(3)); + float d = (float) SvNV(ST(4)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - if(items == 6) - { + if (items == 6) { if (sv_derived_from(ST(5), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(5))); - c = INT2PTR(Client *,tmp); + IV tmp = SvIV((SV *) SvRV(ST(5))); + c = INT2PTR(Client *, tmp); } } - RETVAL = entity_list.GetRandomClient(glm::vec3(x, y, z), d * d, c); - ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Client", (void*)RETVAL); + RETVAL = entity_list.GetRandomClient(glm::vec3(x, y, z), d * d, c); + ST(0) = sv_newmortal(); + sv_setref_pv(ST(0), "Client", (void *) RETVAL); } XSRETURN(1); } XS(XS_EntityList_GetMobList); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetMobList) -{ +XS(XS_EntityList_GetMobList) { dXSARGS; int num_mobs = 0; if (items != 1) @@ -1893,24 +1758,22 @@ XS(XS_EntityList_GetMobList) EntityList *THIS; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - std::list mob_list; + std::list mob_list; entity_list.GetMobList(mob_list); auto iter = mob_list.begin(); - while(iter != mob_list.end()) - { + while (iter != mob_list.end()) { Mob *entry = (*iter); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Mob", (void*)entry); + sv_setref_pv(ST(0), "Mob", (void *) entry); XPUSHs(ST(0)); num_mobs++; iter++; @@ -1920,8 +1783,7 @@ XS(XS_EntityList_GetMobList) } XS(XS_EntityList_GetClientList); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetClientList) -{ +XS(XS_EntityList_GetClientList) { dXSARGS; int num_clients = 0; if (items != 1) @@ -1930,24 +1792,22 @@ XS(XS_EntityList_GetClientList) EntityList *THIS; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - std::list client_list; + std::list client_list; entity_list.GetClientList(client_list); auto iter = client_list.begin(); - while(iter != client_list.end()) - { + while (iter != client_list.end()) { Client *entry = (*iter); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Client", (void*)entry); + sv_setref_pv(ST(0), "Client", (void *) entry); XPUSHs(ST(0)); num_clients++; iter++; @@ -1957,8 +1817,7 @@ XS(XS_EntityList_GetClientList) } XS(XS_EntityList_GetNPCList); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetNPCList) -{ +XS(XS_EntityList_GetNPCList) { dXSARGS; int num_npcs = 0; if (items != 1) @@ -1967,24 +1826,22 @@ XS(XS_EntityList_GetNPCList) EntityList *THIS; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - std::list npc_list; + std::list npc_list; entity_list.GetNPCList(npc_list); auto iter = npc_list.begin(); - while(iter != npc_list.end()) - { + while (iter != npc_list.end()) { NPC *entry = (*iter); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "NPC", (void*)entry); + sv_setref_pv(ST(0), "NPC", (void *) entry); XPUSHs(ST(0)); num_npcs++; iter++; @@ -1994,8 +1851,7 @@ XS(XS_EntityList_GetNPCList) } XS(XS_EntityList_GetCorpseList); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetCorpseList) -{ +XS(XS_EntityList_GetCorpseList) { dXSARGS; int num_corpses = 0; if (items != 1) @@ -2004,24 +1860,22 @@ XS(XS_EntityList_GetCorpseList) EntityList *THIS; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - std::list corpse_list; + std::list corpse_list; entity_list.GetCorpseList(corpse_list); auto iter = corpse_list.begin(); - while(iter != corpse_list.end()) - { + while (iter != corpse_list.end()) { Corpse *entry = (*iter); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Corpse", (void*)entry); + sv_setref_pv(ST(0), "Corpse", (void *) entry); XPUSHs(ST(0)); num_corpses++; iter++; @@ -2031,8 +1885,7 @@ XS(XS_EntityList_GetCorpseList) } XS(XS_EntityList_GetObjectList); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetObjectList) -{ +XS(XS_EntityList_GetObjectList) { dXSARGS; int num_objects = 0; if (items != 1) @@ -2041,24 +1894,22 @@ XS(XS_EntityList_GetObjectList) EntityList *THIS; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - std::list object_list; + std::list object_list; entity_list.GetObjectList(object_list); auto iter = object_list.begin(); - while(iter != object_list.end()) - { + while (iter != object_list.end()) { Object *entry = (*iter); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Object", (void*)entry); + sv_setref_pv(ST(0), "Object", (void *) entry); XPUSHs(ST(0)); num_objects++; iter++; @@ -2068,8 +1919,7 @@ XS(XS_EntityList_GetObjectList) } XS(XS_EntityList_GetDoorsList); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_GetDoorsList) -{ +XS(XS_EntityList_GetDoorsList) { dXSARGS; int num_objects = 0; if (items != 1) @@ -2078,24 +1928,22 @@ XS(XS_EntityList_GetDoorsList) EntityList *THIS; if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - std::list door_list; + std::list door_list; entity_list.GetDoorsList(door_list); auto iter = door_list.begin(); - while(iter != door_list.end()) - { + while (iter != door_list.end()) { Doors *entry = (*iter); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Doors", (void*)entry); + sv_setref_pv(ST(0), "Doors", (void *) entry); XPUSHs(ST(0)); num_objects++; iter++; @@ -2105,23 +1953,21 @@ XS(XS_EntityList_GetDoorsList) } XS(XS_EntityList_SignalAllClients); /* prototype to pass -Wmissing-prototypes */ -XS(XS_EntityList_SignalAllClients) -{ +XS(XS_EntityList_SignalAllClients) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: EntityList::SignalAllClients(THIS, uint32 data)"); { EntityList *THIS; - uint32 data = (uint32)SvUV(ST(1)); + uint32 data = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EntityList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EntityList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); entity_list.SignalAllClients(data); @@ -2133,14 +1979,13 @@ XS(XS_EntityList_SignalAllClients) extern "C" #endif XS(boot_EntityList); /* prototype to pass -Wmissing-prototypes */ -XS(boot_EntityList) -{ +XS(boot_EntityList) { dXSARGS; char file[256]; strncpy(file, __FILE__, 256); file[255] = 0; - if(items != 1) + if (items != 1) fprintf(stderr, "boot_quest does not take any arguments."); char buf[128]; @@ -2148,80 +1993,80 @@ XS(boot_EntityList) - XS_VERSION_BOOTCHECK ; + XS_VERSION_BOOTCHECK; - newXSproto(strcpy(buf, "GetMobID"), XS_EntityList_GetMobID, file, "$$"); - newXSproto(strcpy(buf, "GetMob"), XS_EntityList_GetMob, file, "$$"); - newXSproto(strcpy(buf, "GetMobByID"), XS_EntityList_GetMobByID, file, "$$"); - newXSproto(strcpy(buf, "GetMobByNpcTypeID"), XS_EntityList_GetMobByNpcTypeID, file, "$$"); - newXSproto(strcpy(buf, "IsMobSpawnedByNpcTypeID"), XS_EntityList_IsMobSpawnedByNpcTypeID, file, "$$"); - newXSproto(strcpy(buf, "GetNPCByID"), XS_EntityList_GetNPCByID, file, "$$"); - newXSproto(strcpy(buf, "GetNPCByNPCTypeID"), XS_EntityList_GetNPCByNPCTypeID, file, "$$"); - newXSproto(strcpy(buf, "GetClientByName"), XS_EntityList_GetClientByName, file, "$$"); - newXSproto(strcpy(buf, "GetClientByAccID"), XS_EntityList_GetClientByAccID, file, "$$"); - newXSproto(strcpy(buf, "GetClientByID"), XS_EntityList_GetClientByID, file, "$$"); - newXSproto(strcpy(buf, "GetClientByCharID"), XS_EntityList_GetClientByCharID, file, "$$"); - newXSproto(strcpy(buf, "GetClientByWID"), XS_EntityList_GetClientByWID, file, "$$"); - newXSproto(strcpy(buf, "GetObjectByID"), XS_EntityList_GetObjectByID, file, "$"); - newXSproto(strcpy(buf, "GetObjectByDBID"), XS_EntityList_GetObjectByDBID, file, "$"); - newXSproto(strcpy(buf, "GetDoorsByID"), XS_EntityList_GetDoorsByID, file, "$$"); - newXSproto(strcpy(buf, "GetDoorsByDBID"), XS_EntityList_GetDoorsByDBID, file, "$$"); - newXSproto(strcpy(buf, "GetDoorsByDoorID"), XS_EntityList_GetDoorsByDoorID, file, "$$"); - newXSproto(strcpy(buf, "FindDoor"), XS_EntityList_FindDoor, file, "$$"); - newXSproto(strcpy(buf, "GetGroupByMob"), XS_EntityList_GetGroupByMob, file, "$$"); - newXSproto(strcpy(buf, "GetGroupByClient"), XS_EntityList_GetGroupByClient, file, "$$"); - newXSproto(strcpy(buf, "GetGroupByID"), XS_EntityList_GetGroupByID, file, "$$"); - newXSproto(strcpy(buf, "GetGroupByLeaderName"), XS_EntityList_GetGroupByLeaderName, file, "$$"); - newXSproto(strcpy(buf, "GetRaidByID"), XS_EntityList_GetRaidByID, file, "$$"); - newXSproto(strcpy(buf, "GetRaidByClient"), XS_EntityList_GetRaidByClient, file, "$$"); - newXSproto(strcpy(buf, "GetCorpseByOwner"), XS_EntityList_GetCorpseByOwner, file, "$$"); - newXSproto(strcpy(buf, "GetCorpseByID"), XS_EntityList_GetCorpseByID, file, "$$"); - newXSproto(strcpy(buf, "GetCorpseByName"), XS_EntityList_GetCorpseByName, file, "$$"); - newXSproto(strcpy(buf, "ClearClientPetitionQueue"), XS_EntityList_ClearClientPetitionQueue, file, "$"); - newXSproto(strcpy(buf, "CanAddHateForMob"), XS_EntityList_CanAddHateForMob, file, "$$"); - newXSproto(strcpy(buf, "Clear"), XS_EntityList_Clear, file, "$"); - newXSproto(strcpy(buf, "RemoveMob"), XS_EntityList_RemoveMob, file, "$$"); - newXSproto(strcpy(buf, "RemoveClient"), XS_EntityList_RemoveClient, file, "$$"); - newXSproto(strcpy(buf, "RemoveNPC"), XS_EntityList_RemoveNPC, file, "$$"); - newXSproto(strcpy(buf, "RemoveGroup"), XS_EntityList_RemoveGroup, file, "$$"); - newXSproto(strcpy(buf, "RemoveCorpse"), XS_EntityList_RemoveCorpse, file, "$$"); - newXSproto(strcpy(buf, "RemoveDoor"), XS_EntityList_RemoveDoor, file, "$$"); - newXSproto(strcpy(buf, "RemoveTrap"), XS_EntityList_RemoveTrap, file, "$$"); - newXSproto(strcpy(buf, "RemoveObject"), XS_EntityList_RemoveObject, file, "$$"); - newXSproto(strcpy(buf, "RemoveAllMobs"), XS_EntityList_RemoveAllMobs, file, "$"); - newXSproto(strcpy(buf, "RemoveAllClients"), XS_EntityList_RemoveAllClients, file, "$"); - newXSproto(strcpy(buf, "RemoveAllNPCs"), XS_EntityList_RemoveAllNPCs, file, "$"); - newXSproto(strcpy(buf, "RemoveAllGroups"), XS_EntityList_RemoveAllGroups, file, "$"); - newXSproto(strcpy(buf, "RemoveAllCorpses"), XS_EntityList_RemoveAllCorpses, file, "$"); - newXSproto(strcpy(buf, "RemoveAllDoors"), XS_EntityList_RemoveAllDoors, file, "$"); - newXSproto(strcpy(buf, "RemoveAllTraps"), XS_EntityList_RemoveAllTraps, file, "$"); - newXSproto(strcpy(buf, "RemoveAllObjects"), XS_EntityList_RemoveAllObjects, file, "$"); - newXSproto(strcpy(buf, "Message"), XS_EntityList_Message, file, "$$$$;@"); - newXSproto(strcpy(buf, "MessageStatus"), XS_EntityList_MessageStatus, file, "$$$$$;@"); - newXSproto(strcpy(buf, "MessageClose"), XS_EntityList_MessageClose, file, "$$$$$$;@"); - newXSproto(strcpy(buf, "RemoveFromTargets"), XS_EntityList_RemoveFromTargets, file, "$$"); - newXSproto(strcpy(buf, "ReplaceWithTarget"), XS_EntityList_ReplaceWithTarget, file, "$$$"); - newXSproto(strcpy(buf, "OpenDoorsNear"), XS_EntityList_OpenDoorsNear, file, "$$"); - newXSproto(strcpy(buf, "MakeNameUnique"), XS_EntityList_MakeNameUnique, file, "$$"); - newXSproto(strcpy(buf, "RemoveNumbers"), XS_EntityList_RemoveNumbers, file, "$$"); - newXSproto(strcpy(buf, "SignalMobsByNPCID"), XS_EntityList_SignalMobsByNPCID, file, "$$$"); - newXSproto(strcpy(buf, "RemoveEntity"), XS_EntityList_RemoveEntity, file, "$$"); - newXSproto(strcpy(buf, "DeleteNPCCorpses"), XS_EntityList_DeleteNPCCorpses, file, "$"); - newXSproto(strcpy(buf, "DeletePlayerCorpses"), XS_EntityList_DeletePlayerCorpses, file, "$"); - newXSproto(strcpy(buf, "HalveAggro"), XS_EntityList_HalveAggro, file, "$$"); - newXSproto(strcpy(buf, "DoubleAggro"), XS_EntityList_DoubleAggro, file, "$$"); - newXSproto(strcpy(buf, "ClearFeignAggro"), XS_EntityList_ClearFeignAggro, file, "$$"); - newXSproto(strcpy(buf, "Fighting"), XS_EntityList_Fighting, file, "$$"); - newXSproto(strcpy(buf, "RemoveFromHateLists"), XS_EntityList_RemoveFromHateLists, file, "$$;$"); - newXSproto(strcpy(buf, "MessageGroup"), XS_EntityList_MessageGroup, file, "$$$$$;@"); - newXSproto(strcpy(buf, "GetRandomClient"), XS_EntityList_GetRandomClient, file, "$$$$$;$"); - newXSproto(strcpy(buf, "GetMobList"), XS_EntityList_GetMobList, file, "$"); - newXSproto(strcpy(buf, "GetClientList"), XS_EntityList_GetClientList, file, "$"); - newXSproto(strcpy(buf, "GetNPCList"), XS_EntityList_GetNPCList, file, "$"); - newXSproto(strcpy(buf, "GetCorpseList"), XS_EntityList_GetCorpseList, file, "$"); - newXSproto(strcpy(buf, "GetObjectList"), XS_EntityList_GetObjectList, file, "$"); - newXSproto(strcpy(buf, "GetDoorsList"), XS_EntityList_GetDoorsList, file, "$"); - newXSproto(strcpy(buf, "SignalAllClients"), XS_EntityList_SignalAllClients, file, "$$"); + newXSproto(strcpy(buf, "GetMobID"), XS_EntityList_GetMobID, file, "$$"); + newXSproto(strcpy(buf, "GetMob"), XS_EntityList_GetMob, file, "$$"); + newXSproto(strcpy(buf, "GetMobByID"), XS_EntityList_GetMobByID, file, "$$"); + newXSproto(strcpy(buf, "GetMobByNpcTypeID"), XS_EntityList_GetMobByNpcTypeID, file, "$$"); + newXSproto(strcpy(buf, "IsMobSpawnedByNpcTypeID"), XS_EntityList_IsMobSpawnedByNpcTypeID, file, "$$"); + newXSproto(strcpy(buf, "GetNPCByID"), XS_EntityList_GetNPCByID, file, "$$"); + newXSproto(strcpy(buf, "GetNPCByNPCTypeID"), XS_EntityList_GetNPCByNPCTypeID, file, "$$"); + newXSproto(strcpy(buf, "GetClientByName"), XS_EntityList_GetClientByName, file, "$$"); + newXSproto(strcpy(buf, "GetClientByAccID"), XS_EntityList_GetClientByAccID, file, "$$"); + newXSproto(strcpy(buf, "GetClientByID"), XS_EntityList_GetClientByID, file, "$$"); + newXSproto(strcpy(buf, "GetClientByCharID"), XS_EntityList_GetClientByCharID, file, "$$"); + newXSproto(strcpy(buf, "GetClientByWID"), XS_EntityList_GetClientByWID, file, "$$"); + newXSproto(strcpy(buf, "GetObjectByID"), XS_EntityList_GetObjectByID, file, "$"); + newXSproto(strcpy(buf, "GetObjectByDBID"), XS_EntityList_GetObjectByDBID, file, "$"); + newXSproto(strcpy(buf, "GetDoorsByID"), XS_EntityList_GetDoorsByID, file, "$$"); + newXSproto(strcpy(buf, "GetDoorsByDBID"), XS_EntityList_GetDoorsByDBID, file, "$$"); + newXSproto(strcpy(buf, "GetDoorsByDoorID"), XS_EntityList_GetDoorsByDoorID, file, "$$"); + newXSproto(strcpy(buf, "FindDoor"), XS_EntityList_FindDoor, file, "$$"); + newXSproto(strcpy(buf, "GetGroupByMob"), XS_EntityList_GetGroupByMob, file, "$$"); + newXSproto(strcpy(buf, "GetGroupByClient"), XS_EntityList_GetGroupByClient, file, "$$"); + newXSproto(strcpy(buf, "GetGroupByID"), XS_EntityList_GetGroupByID, file, "$$"); + newXSproto(strcpy(buf, "GetGroupByLeaderName"), XS_EntityList_GetGroupByLeaderName, file, "$$"); + newXSproto(strcpy(buf, "GetRaidByID"), XS_EntityList_GetRaidByID, file, "$$"); + newXSproto(strcpy(buf, "GetRaidByClient"), XS_EntityList_GetRaidByClient, file, "$$"); + newXSproto(strcpy(buf, "GetCorpseByOwner"), XS_EntityList_GetCorpseByOwner, file, "$$"); + newXSproto(strcpy(buf, "GetCorpseByID"), XS_EntityList_GetCorpseByID, file, "$$"); + newXSproto(strcpy(buf, "GetCorpseByName"), XS_EntityList_GetCorpseByName, file, "$$"); + newXSproto(strcpy(buf, "ClearClientPetitionQueue"), XS_EntityList_ClearClientPetitionQueue, file, "$"); + newXSproto(strcpy(buf, "CanAddHateForMob"), XS_EntityList_CanAddHateForMob, file, "$$"); + newXSproto(strcpy(buf, "Clear"), XS_EntityList_Clear, file, "$"); + newXSproto(strcpy(buf, "RemoveMob"), XS_EntityList_RemoveMob, file, "$$"); + newXSproto(strcpy(buf, "RemoveClient"), XS_EntityList_RemoveClient, file, "$$"); + newXSproto(strcpy(buf, "RemoveNPC"), XS_EntityList_RemoveNPC, file, "$$"); + newXSproto(strcpy(buf, "RemoveGroup"), XS_EntityList_RemoveGroup, file, "$$"); + newXSproto(strcpy(buf, "RemoveCorpse"), XS_EntityList_RemoveCorpse, file, "$$"); + newXSproto(strcpy(buf, "RemoveDoor"), XS_EntityList_RemoveDoor, file, "$$"); + newXSproto(strcpy(buf, "RemoveTrap"), XS_EntityList_RemoveTrap, file, "$$"); + newXSproto(strcpy(buf, "RemoveObject"), XS_EntityList_RemoveObject, file, "$$"); + newXSproto(strcpy(buf, "RemoveAllMobs"), XS_EntityList_RemoveAllMobs, file, "$"); + newXSproto(strcpy(buf, "RemoveAllClients"), XS_EntityList_RemoveAllClients, file, "$"); + newXSproto(strcpy(buf, "RemoveAllNPCs"), XS_EntityList_RemoveAllNPCs, file, "$"); + newXSproto(strcpy(buf, "RemoveAllGroups"), XS_EntityList_RemoveAllGroups, file, "$"); + newXSproto(strcpy(buf, "RemoveAllCorpses"), XS_EntityList_RemoveAllCorpses, file, "$"); + newXSproto(strcpy(buf, "RemoveAllDoors"), XS_EntityList_RemoveAllDoors, file, "$"); + newXSproto(strcpy(buf, "RemoveAllTraps"), XS_EntityList_RemoveAllTraps, file, "$"); + newXSproto(strcpy(buf, "RemoveAllObjects"), XS_EntityList_RemoveAllObjects, file, "$"); + newXSproto(strcpy(buf, "Message"), XS_EntityList_Message, file, "$$$$;@"); + newXSproto(strcpy(buf, "MessageStatus"), XS_EntityList_MessageStatus, file, "$$$$$;@"); + newXSproto(strcpy(buf, "MessageClose"), XS_EntityList_MessageClose, file, "$$$$$$;@"); + newXSproto(strcpy(buf, "RemoveFromTargets"), XS_EntityList_RemoveFromTargets, file, "$$"); + newXSproto(strcpy(buf, "ReplaceWithTarget"), XS_EntityList_ReplaceWithTarget, file, "$$$"); + newXSproto(strcpy(buf, "OpenDoorsNear"), XS_EntityList_OpenDoorsNear, file, "$$"); + newXSproto(strcpy(buf, "MakeNameUnique"), XS_EntityList_MakeNameUnique, file, "$$"); + newXSproto(strcpy(buf, "RemoveNumbers"), XS_EntityList_RemoveNumbers, file, "$$"); + newXSproto(strcpy(buf, "SignalMobsByNPCID"), XS_EntityList_SignalMobsByNPCID, file, "$$$"); + newXSproto(strcpy(buf, "RemoveEntity"), XS_EntityList_RemoveEntity, file, "$$"); + newXSproto(strcpy(buf, "DeleteNPCCorpses"), XS_EntityList_DeleteNPCCorpses, file, "$"); + newXSproto(strcpy(buf, "DeletePlayerCorpses"), XS_EntityList_DeletePlayerCorpses, file, "$"); + newXSproto(strcpy(buf, "HalveAggro"), XS_EntityList_HalveAggro, file, "$$"); + newXSproto(strcpy(buf, "DoubleAggro"), XS_EntityList_DoubleAggro, file, "$$"); + newXSproto(strcpy(buf, "ClearFeignAggro"), XS_EntityList_ClearFeignAggro, file, "$$"); + newXSproto(strcpy(buf, "Fighting"), XS_EntityList_Fighting, file, "$$"); + newXSproto(strcpy(buf, "RemoveFromHateLists"), XS_EntityList_RemoveFromHateLists, file, "$$;$"); + newXSproto(strcpy(buf, "MessageGroup"), XS_EntityList_MessageGroup, file, "$$$$$;@"); + newXSproto(strcpy(buf, "GetRandomClient"), XS_EntityList_GetRandomClient, file, "$$$$$;$"); + newXSproto(strcpy(buf, "GetMobList"), XS_EntityList_GetMobList, file, "$"); + newXSproto(strcpy(buf, "GetClientList"), XS_EntityList_GetClientList, file, "$"); + newXSproto(strcpy(buf, "GetNPCList"), XS_EntityList_GetNPCList, file, "$"); + newXSproto(strcpy(buf, "GetCorpseList"), XS_EntityList_GetCorpseList, file, "$"); + newXSproto(strcpy(buf, "GetObjectList"), XS_EntityList_GetObjectList, file, "$"); + newXSproto(strcpy(buf, "GetDoorsList"), XS_EntityList_GetDoorsList, file, "$"); + newXSproto(strcpy(buf, "SignalAllClients"), XS_EntityList_SignalAllClients, file, "$$"); XSRETURN_YES; } From 26ed80bdda4b861246cc5dd565b8c5668d94ef20 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 19:49:52 -0500 Subject: [PATCH 12/33] Add --entity to perl-doc-parser.pl --- utils/scripts/perl-doc-parser.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/utils/scripts/perl-doc-parser.pl b/utils/scripts/perl-doc-parser.pl index d54e39ebc..80f72982c 100755 --- a/utils/scripts/perl-doc-parser.pl +++ b/utils/scripts/perl-doc-parser.pl @@ -5,6 +5,7 @@ sub usage() { print "Usage:\n"; print " --client - Prints methods for just client class methods\n"; print " --mob - Prints methods for just mob class methods\n"; + print " --entity - Prints methods for just entity class methods\n"; print " --corpse - Prints methods for just corpse class methods\n"; print " --all - Prints methods for all classes\n"; exit(1); @@ -46,7 +47,7 @@ for my $file (@files) { chomp; $line = $_; - if ($line=~/Client::|Mob::|Corpse::/i && $line=~/_croak/i) { + if ($line=~/Client::|Mob::|Corpse::|EntityList::/i && $line=~/_croak/i) { #::: Client export if ($export=~/all|client/i) { @@ -66,6 +67,12 @@ for my $file (@files) { $object_prefix = "\$corpse->"; } + #::: Entity export + if ($export=~/all|entity/i) { + $split_key = "EntityList::"; + $object_prefix = "\$entity_list->"; + } + #::: Split on croak usage @data = split($split_key, $line); $usage = trim($data[1]); From 2bab945c340d8368e68645d75dfa6eeed93cc58b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 19:50:56 -0500 Subject: [PATCH 13/33] perl_entity.cpp formatting --- zone/perl_entity.cpp | 176 +++++++++++++++++++++---------------------- 1 file changed, 88 insertions(+), 88 deletions(-) diff --git a/zone/perl_entity.cpp b/zone/perl_entity.cpp index 6653983a0..a38852b9c 100644 --- a/zone/perl_entity.cpp +++ b/zone/perl_entity.cpp @@ -52,7 +52,7 @@ XS(XS_EntityList_GetMobID) { { EntityList *THIS; Mob *RETVAL; - uint16 id = (uint16) SvUV(ST(1)); + uint16 id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -63,7 +63,7 @@ XS(XS_EntityList_GetMobID) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMobID(id); - ST(0) = sv_newmortal(); + ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Mob", (void *) RETVAL); } XSRETURN(1); @@ -102,7 +102,7 @@ XS(XS_EntityList_GetMobByID) { { EntityList *THIS; Mob *RETVAL; - uint16 id = (uint16) SvUV(ST(1)); + uint16 id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -113,7 +113,7 @@ XS(XS_EntityList_GetMobByID) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMob(id); - ST(0) = sv_newmortal(); + ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Mob", (void *) RETVAL); } XSRETURN(1); @@ -127,7 +127,7 @@ XS(XS_EntityList_GetMobByNpcTypeID) { { EntityList *THIS; Mob *RETVAL; - uint32 get_id = (uint32) SvUV(ST(1)); + uint32 get_id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -138,7 +138,7 @@ XS(XS_EntityList_GetMobByNpcTypeID) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMobByNpcTypeID(get_id); - ST(0) = sv_newmortal(); + ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Mob", (void *) RETVAL); } XSRETURN(1); @@ -151,8 +151,8 @@ XS(XS_EntityList_IsMobSpawnedByNpcTypeID) { Perl_croak(aTHX_ "Usage: EntityList::ValidMobByNpcTypeID(THIS, get_id)"); { EntityList *THIS; - bool RETVAL; - uint32 get_id = (uint32) SvUV(ST(1)); + bool RETVAL; + uint32 get_id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -163,7 +163,7 @@ XS(XS_EntityList_IsMobSpawnedByNpcTypeID) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsMobSpawnedByNpcTypeID(get_id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); @@ -177,7 +177,7 @@ XS(XS_EntityList_GetNPCByID) { { EntityList *THIS; NPC *RETVAL; - uint16 id = (uint16) SvUV(ST(1)); + uint16 id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -188,7 +188,7 @@ XS(XS_EntityList_GetNPCByID) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetNPCByID(id); - ST(0) = sv_newmortal(); + ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "NPC", (void *) RETVAL); } XSRETURN(1); @@ -202,7 +202,7 @@ XS(XS_EntityList_GetNPCByNPCTypeID) { { EntityList *THIS; NPC *RETVAL; - uint32 npc_id = (uint32) SvUV(ST(1)); + uint32 npc_id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -213,7 +213,7 @@ XS(XS_EntityList_GetNPCByNPCTypeID) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetNPCByNPCTypeID(npc_id); - ST(0) = sv_newmortal(); + ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "NPC", (void *) RETVAL); } XSRETURN(1); @@ -252,7 +252,7 @@ XS(XS_EntityList_GetClientByAccID) { { EntityList *THIS; Client *RETVAL; - uint32 accid = (uint32) SvUV(ST(1)); + uint32 accid = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -263,7 +263,7 @@ XS(XS_EntityList_GetClientByAccID) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetClientByAccID(accid); - ST(0) = sv_newmortal(); + ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Client", (void *) RETVAL); } XSRETURN(1); @@ -277,7 +277,7 @@ XS(XS_EntityList_GetClientByID) { { EntityList *THIS; Client *RETVAL; - uint16 id = (uint16) SvUV(ST(1)); + uint16 id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -288,7 +288,7 @@ XS(XS_EntityList_GetClientByID) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetClientByID(id); - ST(0) = sv_newmortal(); + ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Client", (void *) RETVAL); } XSRETURN(1); @@ -302,7 +302,7 @@ XS(XS_EntityList_GetClientByCharID) { { EntityList *THIS; Client *RETVAL; - uint32 iCharID = (uint32) SvUV(ST(1)); + uint32 iCharID = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -313,7 +313,7 @@ XS(XS_EntityList_GetClientByCharID) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetClientByCharID(iCharID); - ST(0) = sv_newmortal(); + ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Client", (void *) RETVAL); } XSRETURN(1); @@ -327,7 +327,7 @@ XS(XS_EntityList_GetClientByWID) { { EntityList *THIS; Client *RETVAL; - uint32 iWID = (uint32) SvUV(ST(1)); + uint32 iWID = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -338,7 +338,7 @@ XS(XS_EntityList_GetClientByWID) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetClientByWID(iWID); - ST(0) = sv_newmortal(); + ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Client", (void *) RETVAL); } XSRETURN(1); @@ -352,7 +352,7 @@ XS(XS_EntityList_GetObjectByDBID) { { EntityList *THIS; Object *RETVAL; - uint32 id = (uint32) SvUV(ST(1)); + uint32 id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -363,7 +363,7 @@ XS(XS_EntityList_GetObjectByDBID) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetObjectByDBID(id); - ST(0) = sv_newmortal(); + ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Object", (void *) RETVAL); } XSRETURN(1); @@ -377,7 +377,7 @@ XS(XS_EntityList_GetObjectByID) { { EntityList *THIS; Object *RETVAL; - uint32 id = (uint32) SvUV(ST(1)); + uint32 id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -388,7 +388,7 @@ XS(XS_EntityList_GetObjectByID) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetObjectByID(id); - ST(0) = sv_newmortal(); + ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Object", (void *) RETVAL); } XSRETURN(1); @@ -402,7 +402,7 @@ XS(XS_EntityList_GetDoorsByDBID) { { EntityList *THIS; Doors *RETVAL; - uint32 id = (uint32) SvUV(ST(1)); + uint32 id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -413,7 +413,7 @@ XS(XS_EntityList_GetDoorsByDBID) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDoorsByDBID(id); - ST(0) = sv_newmortal(); + ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Doors", (void *) RETVAL); } XSRETURN(1); @@ -427,7 +427,7 @@ XS(XS_EntityList_GetDoorsByDoorID) { { EntityList *THIS; Doors *RETVAL; - uint32 id = (uint32) SvUV(ST(1)); + uint32 id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -438,7 +438,7 @@ XS(XS_EntityList_GetDoorsByDoorID) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDoorsByDoorID(id); - ST(0) = sv_newmortal(); + ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Doors", (void *) RETVAL); } XSRETURN(1); @@ -452,7 +452,7 @@ XS(XS_EntityList_GetDoorsByID) { { EntityList *THIS; Doors *RETVAL; - uint32 id = (uint32) SvUV(ST(1)); + uint32 id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -463,7 +463,7 @@ XS(XS_EntityList_GetDoorsByID) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDoorsByID(id); - ST(0) = sv_newmortal(); + ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Doors", (void *) RETVAL); } XSRETURN(1); @@ -477,7 +477,7 @@ XS(XS_EntityList_FindDoor) { { EntityList *THIS; Doors *RETVAL; - uint32 id = (uint32) SvUV(ST(1)); + uint32 id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -488,7 +488,7 @@ XS(XS_EntityList_FindDoor) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->FindDoor(id); - ST(0) = sv_newmortal(); + ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Doors", (void *) RETVAL); } XSRETURN(1); @@ -568,7 +568,7 @@ XS(XS_EntityList_GetGroupByID) { { EntityList *THIS; Group *RETVAL; - uint32 id = (uint32) SvUV(ST(1)); + uint32 id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -579,7 +579,7 @@ XS(XS_EntityList_GetGroupByID) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGroupByID(id); - ST(0) = sv_newmortal(); + ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Group", (void *) RETVAL); } XSRETURN(1); @@ -618,7 +618,7 @@ XS(XS_EntityList_GetRaidByID) { { EntityList *THIS; Raid *RETVAL; - uint32 id = (uint32) SvUV(ST(1)); + uint32 id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -629,7 +629,7 @@ XS(XS_EntityList_GetRaidByID) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetRaidByID(id); - ST(0) = sv_newmortal(); + ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Raid", (void *) RETVAL); } XSRETURN(1); @@ -709,7 +709,7 @@ XS(XS_EntityList_GetCorpseByID) { { EntityList *THIS; Corpse *RETVAL; - uint16 id = (uint16) SvUV(ST(1)); + uint16 id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -720,7 +720,7 @@ XS(XS_EntityList_GetCorpseByID) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCorpseByID(id); - ST(0) = sv_newmortal(); + ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Corpse", (void *) RETVAL); } XSRETURN(1); @@ -779,8 +779,8 @@ XS(XS_EntityList_CanAddHateForMob) { Perl_croak(aTHX_ "Usage: EntityList::CanAddHateForMob(THIS, Mob* target)"); { EntityList *THIS; - bool RETVAL; - Mob *p; + bool RETVAL; + Mob *p; if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -833,8 +833,8 @@ XS(XS_EntityList_RemoveMob) { Perl_croak(aTHX_ "Usage: EntityList::RemoveMob(THIS, delete_id)"); { EntityList *THIS; - bool RETVAL; - uint16 delete_id = (uint16) SvUV(ST(1)); + bool RETVAL; + uint16 delete_id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -845,7 +845,7 @@ XS(XS_EntityList_RemoveMob) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveMob(delete_id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); @@ -858,8 +858,8 @@ XS(XS_EntityList_RemoveClient) { Perl_croak(aTHX_ "Usage: EntityList::RemoveClient(THIS, delete_id)"); { EntityList *THIS; - bool RETVAL; - uint16 delete_id = (uint16) SvUV(ST(1)); + bool RETVAL; + uint16 delete_id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -870,7 +870,7 @@ XS(XS_EntityList_RemoveClient) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveClient(delete_id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); @@ -883,8 +883,8 @@ XS(XS_EntityList_RemoveNPC) { Perl_croak(aTHX_ "Usage: EntityList::RemoveNPC(THIS, delete_id)"); { EntityList *THIS; - bool RETVAL; - uint16 delete_id = (uint16) SvUV(ST(1)); + bool RETVAL; + uint16 delete_id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -895,7 +895,7 @@ XS(XS_EntityList_RemoveNPC) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveNPC(delete_id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); @@ -908,8 +908,8 @@ XS(XS_EntityList_RemoveGroup) { Perl_croak(aTHX_ "Usage: EntityList::RemoveGroup(THIS, delete_id)"); { EntityList *THIS; - bool RETVAL; - uint32 delete_id = (uint32) SvUV(ST(1)); + bool RETVAL; + uint32 delete_id = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -920,7 +920,7 @@ XS(XS_EntityList_RemoveGroup) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveGroup(delete_id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); @@ -933,8 +933,8 @@ XS(XS_EntityList_RemoveCorpse) { Perl_croak(aTHX_ "Usage: EntityList::RemoveCorpse(THIS, delete_id)"); { EntityList *THIS; - bool RETVAL; - uint16 delete_id = (uint16) SvUV(ST(1)); + bool RETVAL; + uint16 delete_id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -945,7 +945,7 @@ XS(XS_EntityList_RemoveCorpse) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveCorpse(delete_id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); @@ -958,8 +958,8 @@ XS(XS_EntityList_RemoveDoor) { Perl_croak(aTHX_ "Usage: EntityList::RemoveDoor(THIS, delete_id)"); { EntityList *THIS; - bool RETVAL; - uint16 delete_id = (uint16) SvUV(ST(1)); + bool RETVAL; + uint16 delete_id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -970,7 +970,7 @@ XS(XS_EntityList_RemoveDoor) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveDoor(delete_id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); @@ -983,8 +983,8 @@ XS(XS_EntityList_RemoveTrap) { Perl_croak(aTHX_ "Usage: EntityList::RemoveTrap(THIS, delete_id)"); { EntityList *THIS; - bool RETVAL; - uint16 delete_id = (uint16) SvUV(ST(1)); + bool RETVAL; + uint16 delete_id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -995,7 +995,7 @@ XS(XS_EntityList_RemoveTrap) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveTrap(delete_id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); @@ -1008,8 +1008,8 @@ XS(XS_EntityList_RemoveObject) { Perl_croak(aTHX_ "Usage: EntityList::RemoveObject(THIS, delete_id)"); { EntityList *THIS; - bool RETVAL; - uint16 delete_id = (uint16) SvUV(ST(1)); + bool RETVAL; + uint16 delete_id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -1020,7 +1020,7 @@ XS(XS_EntityList_RemoveObject) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveObject(delete_id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); @@ -1201,9 +1201,9 @@ XS(XS_EntityList_Message) { Perl_croak(aTHX_ "Usage: EntityList::Message(THIS, uint32 guild_id, uint32 emote_color_type, string message)"); { EntityList *THIS; - uint32 to_guilddbid = (uint32) SvUV(ST(1)); - uint32 type = (uint32) SvUV(ST(2)); - char *message = (char *) SvPV_nolen(ST(3)); + uint32 to_guilddbid = (uint32) SvUV(ST(1)); + uint32 type = (uint32) SvUV(ST(2)); + char *message = (char *) SvPV_nolen(ST(3)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -1226,10 +1226,10 @@ XS(XS_EntityList_MessageStatus) { "Usage: EntityList::MessageStatus(THIS, uint32 guild_id, uint32 emote_color_type, string message)"); { EntityList *THIS; - uint32 to_guilddbid = (uint32) SvUV(ST(1)); - int to_minstatus = (int) SvIV(ST(2)); - uint32 type = (uint32) SvUV(ST(3)); - char *message = (char *) SvPV_nolen(ST(4)); + uint32 to_guilddbid = (uint32) SvUV(ST(1)); + int to_minstatus = (int) SvIV(ST(2)); + uint32 type = (uint32) SvUV(ST(3)); + char *message = (char *) SvPV_nolen(ST(4)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -1253,10 +1253,10 @@ XS(XS_EntityList_MessageClose) { { EntityList *THIS; Mob *sender; - bool skipsender = (bool) SvTRUE(ST(2)); - float dist = (float) SvNV(ST(3)); - uint32 type = (uint32) SvUV(ST(4)); - char *message = (char *) SvPV_nolen(ST(5)); + bool skipsender = (bool) SvTRUE(ST(2)); + float dist = (float) SvNV(ST(3)); + uint32 type = (uint32) SvUV(ST(4)); + char *message = (char *) SvPV_nolen(ST(5)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -1387,7 +1387,7 @@ XS(XS_EntityList_MakeNameUnique) { EntityList *THIS; char *RETVAL; dXSTARG; - char *name = (char *) SvPV_nolen(ST(1)); + char *name = (char *) SvPV_nolen(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -1430,8 +1430,8 @@ XS(XS_EntityList_SignalMobsByNPCID) { Perl_croak(aTHX_ "Usage: EntityList::SignalMobsByNPCID(THIS, uint32 npc_type_id, int signal_id)"); { EntityList *THIS; - uint32 npc_type = (uint32) SvUV(ST(1)); - int signal_id = (int) SvIV(ST(2)); + uint32 npc_type = (uint32) SvUV(ST(1)); + int signal_id = (int) SvIV(ST(2)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -1453,7 +1453,7 @@ XS(XS_EntityList_RemoveEntity) { Perl_croak(aTHX_ "Usage: EntityList::RemoveEntity(THIS, uint16 id)"); { EntityList *THIS; - uint16 id = (uint16) SvUV(ST(1)); + uint16 id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -1475,7 +1475,7 @@ XS(XS_EntityList_DeleteNPCCorpses) { Perl_croak(aTHX_ "Usage: EntityList::DeleteNPCCorpses(THIS)"); { EntityList *THIS; - int32 RETVAL; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "EntityList")) { @@ -1500,7 +1500,7 @@ XS(XS_EntityList_DeletePlayerCorpses) { Perl_croak(aTHX_ "Usage: EntityList::DeletePlayerCorpses(THIS)"); { EntityList *THIS; - int32 RETVAL; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "EntityList")) { @@ -1615,8 +1615,8 @@ XS(XS_EntityList_Fighting) { Perl_croak(aTHX_ "Usage: EntityList::Fighting(THIS, Mob* target)"); { EntityList *THIS; - bool RETVAL; - Mob *targ; + bool RETVAL; + Mob *targ; if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -1649,7 +1649,7 @@ XS(XS_EntityList_RemoveFromHateLists) { { EntityList *THIS; Mob *mob; - bool settoone; + bool settoone; if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -1687,9 +1687,9 @@ XS(XS_EntityList_MessageGroup) { { EntityList *THIS; Mob *sender; - bool skipclose = (bool) SvTRUE(ST(2)); - uint32 type = (uint32) SvUV(ST(3)); - char *message = (char *) SvPV_nolen(ST(4)); + bool skipclose = (bool) SvTRUE(ST(2)); + uint32 type = (uint32) SvUV(ST(3)); + char *message = (char *) SvPV_nolen(ST(4)); if (sv_derived_from(ST(0), "EntityList")) { IV tmp = SvIV((SV *) SvRV(ST(0))); From 4a036116dd8dee83facb03fc1899ca9f2f055e97 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 19:55:50 -0500 Subject: [PATCH 14/33] Update perl_doors.cpp usage doc --- zone/perl_doors.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/zone/perl_doors.cpp b/zone/perl_doors.cpp index 0024f877e..27eacb701 100644 --- a/zone/perl_doors.cpp +++ b/zone/perl_doors.cpp @@ -305,7 +305,7 @@ XS(XS_Doors_GetNoKeyring) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Doors::GetNoKeyring(THIS, type)"); + Perl_croak(aTHX_ "Usage: Doors::GetNoKeyring(THIS, uint8 type)"); { Doors * THIS; uint8 type = (uint8)SvUV(ST(1)); @@ -383,7 +383,7 @@ XS(XS_Doors_SetOpenType) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Doors::SetOpenType(THIS, type)"); + Perl_croak(aTHX_ "Usage: Doors::SetOpenType(THIS, uint32 open_type)"); { Doors * THIS; uint32 type = (uint32)SvUV(ST(1)); @@ -407,7 +407,7 @@ XS(XS_Doors_SetLockpick) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Doors::SetLockpick(THIS, type)"); + Perl_croak(aTHX_ "Usage: Doors::SetLockpick(THIS, uint32 lockpick_type)"); { Doors * THIS; uint32 type = (uint32)SvUV(ST(1)); @@ -431,7 +431,7 @@ XS(XS_Doors_SetKeyItem) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Doors::SetKeyItem(THIS, type)"); + Perl_croak(aTHX_ "Usage: Doors::SetKeyItem(THIS, uint32 key_item_id)"); { Doors * THIS; uint32 type = (uint32)SvUV(ST(1)); @@ -455,7 +455,7 @@ XS(XS_Doors_SetNoKeyring) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Doors::SetNoKeyring(THIS, type)"); + Perl_croak(aTHX_ "Usage: Doors::SetNoKeyring(THIS, uint8 no_key_ring)"); { Doors * THIS; uint8 type = (uint8)SvUV(ST(1)); @@ -479,7 +479,7 @@ XS(XS_Doors_SetIncline) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Doors::SetIncline(THIS, type)"); + Perl_croak(aTHX_ "Usage: Doors::SetIncline(THIS, uint32 incline)"); { Doors * THIS; uint32 type = (uint32)SvUV(ST(1)); @@ -503,7 +503,7 @@ XS(XS_Doors_SetSize) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Doors::SetSize(THIS, size)"); + Perl_croak(aTHX_ "Usage: Doors::SetSize(THIS, uint32 size)"); { Doors * THIS; uint32 type = (uint32)SvUV(ST(1)); @@ -527,7 +527,7 @@ XS(XS_Doors_SetLocation) { dXSARGS; if (items != 4) - Perl_croak(aTHX_ "Usage: Doors::SetLocation(THIS, x, y, z)"); + Perl_croak(aTHX_ "Usage: Doors::SetLocation(THIS, float x, float y, float z)"); { Doors * THIS; float x = (float)SvNV(ST(1)); @@ -553,7 +553,7 @@ XS(XS_Doors_SetX) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Doors::SetX(THIS, XPos)"); + Perl_croak(aTHX_ "Usage: Doors::SetX(THIS, float x)"); { Doors * THIS; float x = (float)SvNV(ST(1)); @@ -578,7 +578,7 @@ XS(XS_Doors_SetY) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Doors::SetY(THIS, YPos)"); + Perl_croak(aTHX_ "Usage: Doors::SetY(THIS, float y)"); { Doors * THIS; float y = (float)SvNV(ST(1)); @@ -604,7 +604,7 @@ XS(XS_Doors_SetZ) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Doors::SetZ(THIS, ZPos)"); + Perl_croak(aTHX_ "Usage: Doors::SetZ(THIS, float z)"); { Doors * THIS; float z = (float)SvNV(ST(1)); @@ -630,7 +630,7 @@ XS(XS_Doors_SetHeading) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Doors::SetHeading(THIS, heading)"); + Perl_croak(aTHX_ "Usage: Doors::SetHeading(THIS, float heading)"); { Doors * THIS; float heading = (float)SvNV(ST(1)); @@ -656,7 +656,7 @@ XS(XS_Doors_SetModelName) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: Doors::SetModelName(THIS, name)"); + Perl_croak(aTHX_ "Usage: Doors::SetModelName(THIS, string name)"); { Doors * THIS; char * name = nullptr; From 86c9b6b079f87340dfd2d811766d42adfcbe4a00 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 19:56:02 -0500 Subject: [PATCH 15/33] perl_doors.cpp formatting --- zone/perl_doors.cpp | 553 ++++++++++++++++++++------------------------ 1 file changed, 256 insertions(+), 297 deletions(-) diff --git a/zone/perl_doors.cpp b/zone/perl_doors.cpp index 27eacb701..8c4f4ea98 100644 --- a/zone/perl_doors.cpp +++ b/zone/perl_doors.cpp @@ -26,7 +26,9 @@ */ #include "../common/features.h" + #ifdef EMBPERL_XS_CLASSES + #include "../common/global_define.h" #include "embperl.h" @@ -41,282 +43,270 @@ #endif XS(XS_Doors_GetDoorDBID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_GetDoorDBID) -{ +XS(XS_Doors_GetDoorDBID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Doors::GetDoorDBID(THIS)"); { - Doors * THIS; - uint32 RETVAL; + Doors *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDoorDBID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Doors_GetDoorID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_GetDoorID) -{ +XS(XS_Doors_GetDoorID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Doors::GetDoorID(THIS)"); { - Doors * THIS; - uint32 RETVAL; + Doors *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDoorID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Doors_GetID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_GetID) -{ +XS(XS_Doors_GetID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Doors::GetID(THIS)"); { - Doors * THIS; - uint16 RETVAL; + Doors *THIS; + uint16 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEntityID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Doors_GetX); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_GetX) -{ +XS(XS_Doors_GetX) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Doors::GetX(THIS)"); { - Doors * THIS; - float RETVAL; + Doors *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPosition().x; - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Doors_GetY); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_GetY) -{ +XS(XS_Doors_GetY) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Doors::GetY(THIS)"); { - Doors * THIS; - float RETVAL; + Doors *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPosition().y; - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Doors_GetZ); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_GetZ) -{ +XS(XS_Doors_GetZ) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Doors::GetZ(THIS)"); { - Doors * THIS; - float RETVAL; + Doors *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPosition().z; - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Doors_GetHeading); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_GetHeading) -{ +XS(XS_Doors_GetHeading) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Doors::GetHeading(THIS)"); { - Doors * THIS; - float RETVAL; + Doors *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPosition().w; - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Doors_GetOpenType); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_GetOpenType) -{ +XS(XS_Doors_GetOpenType) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Doors::GetOpenType(THIS)"); { - Doors * THIS; - uint32 RETVAL; + Doors *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetOpenType(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Doors_GetLockpick); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_GetLockpick) -{ +XS(XS_Doors_GetLockpick) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Doors::GetLockpick(THIS)"); { - Doors * THIS; - uint32 RETVAL; + Doors *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLockpick(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Doors_GetKeyItem); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_GetKeyItem) -{ +XS(XS_Doors_GetKeyItem) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Doors::GetKeyItem(THIS)"); { - Doors * THIS; - uint32 RETVAL; + Doors *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetKeyItem(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Doors_GetNoKeyring); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_GetNoKeyring) -{ +XS(XS_Doors_GetNoKeyring) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Doors::GetNoKeyring(THIS, uint8 type)"); { - Doors * THIS; - uint8 type = (uint8)SvUV(ST(1)); + Doors *THIS; + uint8 type = (uint8) SvUV(ST(1)); if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->GetNoKeyring(); @@ -325,76 +315,71 @@ XS(XS_Doors_GetNoKeyring) } XS(XS_Doors_GetIncline); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_GetIncline) -{ +XS(XS_Doors_GetIncline) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Doors::GetIncline(THIS)"); { - Doors * THIS; - uint32 RETVAL; + Doors *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetIncline(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Doors_GetSize); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_GetSize) -{ +XS(XS_Doors_GetSize) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Doors::GetIncline(THIS)"); { - Doors * THIS; - uint32 RETVAL; + Doors *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSize(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } - XS(XS_Doors_SetOpenType); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_SetOpenType) -{ +XS(XS_Doors_SetOpenType) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Doors::SetOpenType(THIS, uint32 open_type)"); { - Doors * THIS; - uint32 type = (uint32)SvUV(ST(1)); + Doors *THIS; + uint32 type = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetOpenType(type); @@ -403,22 +388,20 @@ XS(XS_Doors_SetOpenType) } XS(XS_Doors_SetLockpick); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_SetLockpick) -{ +XS(XS_Doors_SetLockpick) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Doors::SetLockpick(THIS, uint32 lockpick_type)"); { - Doors * THIS; - uint32 type = (uint32)SvUV(ST(1)); + Doors *THIS; + uint32 type = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetLockpick(type); @@ -427,22 +410,20 @@ XS(XS_Doors_SetLockpick) } XS(XS_Doors_SetKeyItem); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_SetKeyItem) -{ +XS(XS_Doors_SetKeyItem) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Doors::SetKeyItem(THIS, uint32 key_item_id)"); { - Doors * THIS; - uint32 type = (uint32)SvUV(ST(1)); + Doors *THIS; + uint32 type = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetKeyItem(type); @@ -451,22 +432,20 @@ XS(XS_Doors_SetKeyItem) } XS(XS_Doors_SetNoKeyring); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_SetNoKeyring) -{ +XS(XS_Doors_SetNoKeyring) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Doors::SetNoKeyring(THIS, uint8 no_key_ring)"); { - Doors * THIS; - uint8 type = (uint8)SvUV(ST(1)); + Doors *THIS; + uint8 type = (uint8) SvUV(ST(1)); if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetNoKeyring(type); @@ -475,22 +454,20 @@ XS(XS_Doors_SetNoKeyring) } XS(XS_Doors_SetIncline); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_SetIncline) -{ +XS(XS_Doors_SetIncline) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Doors::SetIncline(THIS, uint32 incline)"); { - Doors * THIS; - uint32 type = (uint32)SvUV(ST(1)); + Doors *THIS; + uint32 type = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetIncline(type); @@ -499,22 +476,20 @@ XS(XS_Doors_SetIncline) } XS(XS_Doors_SetSize); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_SetSize) -{ +XS(XS_Doors_SetSize) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Doors::SetSize(THIS, uint32 size)"); { - Doors * THIS; - uint32 type = (uint32)SvUV(ST(1)); + Doors *THIS; + uint32 type = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSize(type); @@ -523,24 +498,22 @@ XS(XS_Doors_SetSize) } XS(XS_Doors_SetLocation); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_SetLocation) -{ +XS(XS_Doors_SetLocation) { dXSARGS; if (items != 4) Perl_croak(aTHX_ "Usage: Doors::SetLocation(THIS, float x, float y, float z)"); { - Doors * THIS; - float x = (float)SvNV(ST(1)); - float y = (float)SvNV(ST(2)); - float z = (float)SvNV(ST(3)); + Doors *THIS; + float x = (float) SvNV(ST(1)); + float y = (float) SvNV(ST(2)); + float z = (float) SvNV(ST(3)); if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetLocation(x, y, z); @@ -549,175 +522,163 @@ XS(XS_Doors_SetLocation) } XS(XS_Doors_SetX); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_SetX) -{ +XS(XS_Doors_SetX) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Doors::SetX(THIS, float x)"); { - Doors * THIS; - float x = (float)SvNV(ST(1)); + Doors *THIS; + float x = (float) SvNV(ST(1)); if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - auto position = THIS->GetPosition(); - position.x = x; + auto position = THIS->GetPosition(); + position.x = x; THIS->SetPosition(position); } XSRETURN_EMPTY; } XS(XS_Doors_SetY); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_SetY) -{ +XS(XS_Doors_SetY) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Doors::SetY(THIS, float y)"); { - Doors * THIS; - float y = (float)SvNV(ST(1)); + Doors *THIS; + float y = (float) SvNV(ST(1)); if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - auto position = THIS->GetPosition(); - position.y = y; + auto position = THIS->GetPosition(); + position.y = y; THIS->SetPosition(position); } XSRETURN_EMPTY; } XS(XS_Doors_SetZ); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_SetZ) -{ +XS(XS_Doors_SetZ) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Doors::SetZ(THIS, float z)"); { - Doors * THIS; - float z = (float)SvNV(ST(1)); + Doors *THIS; + float z = (float) SvNV(ST(1)); if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); auto position = THIS->GetPosition(); - position.z = z; + position.z = z; THIS->SetPosition(position); } XSRETURN_EMPTY; } XS(XS_Doors_SetHeading); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_SetHeading) -{ +XS(XS_Doors_SetHeading) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Doors::SetHeading(THIS, float heading)"); { - Doors * THIS; - float heading = (float)SvNV(ST(1)); + Doors *THIS; + float heading = (float) SvNV(ST(1)); if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); auto position = THIS->GetPosition(); - position.w = heading; + position.w = heading; THIS->SetPosition(position); } XSRETURN_EMPTY; } XS(XS_Doors_SetModelName); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_SetModelName) -{ +XS(XS_Doors_SetModelName) { dXSARGS; if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: Doors::SetModelName(THIS, string name)"); { - Doors * THIS; - char * name = nullptr; + Doors *THIS; + char *name = nullptr; if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - if (items > 1) { name = (char *)SvPV_nolen(ST(1)); } + if (items > 1) { name = (char *) SvPV_nolen(ST(1)); } THIS->SetDoorName(name); } XSRETURN_EMPTY; } XS(XS_Doors_GetModelName); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_GetModelName) -{ +XS(XS_Doors_GetModelName) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Doors::GetModelName(THIS)"); { - Doors * THIS; - Const_char * RETVAL; + Doors *THIS; + Const_char *RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDoorName(); - sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; + sv_setpv(TARG, RETVAL); + XSprePUSH; + PUSHTARG; } XSRETURN(1); } XS(XS_Doors_CreateDatabaseEntry); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Doors_CreateDatabaseEntry) -{ +XS(XS_Doors_CreateDatabaseEntry) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Doors::InsertDoor(THIS)"); { - Doors * THIS; + Doors *THIS; if (sv_derived_from(ST(0), "Doors")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Doors *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Doors *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->CreateDatabaseEntry(); @@ -726,52 +687,50 @@ XS(XS_Doors_CreateDatabaseEntry) } - #ifdef __cplusplus extern "C" #endif XS(boot_Doors); /* prototype to pass -Wmissing-prototypes */ -XS(boot_Doors) -{ +XS(boot_Doors) { dXSARGS; char file[256]; strncpy(file, __FILE__, 256); file[255] = 0; - if(items != 1) + if (items != 1) fprintf(stderr, "boot_quest does not take any arguments."); char buf[128]; //add the strcpy stuff to get rid of const warnings.... - XS_VERSION_BOOTCHECK ; - newXSproto(strcpy(buf, "GetID"),XS_Doors_GetID, file, "$"); - newXSproto(strcpy(buf, "SetModelName"),XS_Doors_SetModelName, file, "$$"); - newXSproto(strcpy(buf, "GetModelName"),XS_Doors_GetModelName, file, "$"); - newXSproto(strcpy(buf, "GetX"),XS_Doors_GetX, file, "$"); - newXSproto(strcpy(buf, "GetY"),XS_Doors_GetY, file, "$"); - newXSproto(strcpy(buf, "GetZ"),XS_Doors_GetZ, file, "$"); - newXSproto(strcpy(buf, "GetHeading"),XS_Doors_GetHeading, file, "$"); - newXSproto(strcpy(buf, "SetX"),XS_Doors_SetX, file, "$$"); - newXSproto(strcpy(buf, "SetY"),XS_Doors_SetY, file, "$$"); - newXSproto(strcpy(buf, "SetZ"),XS_Doors_SetZ, file, "$$"); - newXSproto(strcpy(buf, "SetHeading"),XS_Doors_SetHeading, file, "$$"); - newXSproto(strcpy(buf, "SetLocation"),XS_Doors_SetLocation, file, "$$$$"); - newXSproto(strcpy(buf, "GetDoorDBID"),XS_Doors_GetDoorDBID, file, "$"); - newXSproto(strcpy(buf, "GetDoorID"),XS_Doors_GetDoorID, file, "$"); - newXSproto(strcpy(buf, "SetSize"),XS_Doors_SetSize, file, "$$"); - newXSproto(strcpy(buf, "GetSize"),XS_Doors_GetSize, file, "$"); - newXSproto(strcpy(buf, "SetIncline"),XS_Doors_SetIncline, file, "$$"); - newXSproto(strcpy(buf, "GetIncline"),XS_Doors_GetIncline, file, "$"); - newXSproto(strcpy(buf, "SetOpenType"),XS_Doors_SetOpenType, file, "$$"); - newXSproto(strcpy(buf, "GetOpenType"),XS_Doors_GetOpenType, file, "$"); - newXSproto(strcpy(buf, "SetLockPick"),XS_Doors_SetLockpick, file, "$$"); - newXSproto(strcpy(buf, "GetLockPick"),XS_Doors_GetLockpick, file, "$"); - newXSproto(strcpy(buf, "SetKeyItem"),XS_Doors_SetKeyItem, file, "$$"); - newXSproto(strcpy(buf, "GetKeyItem"),XS_Doors_GetKeyItem, file, "$"); - newXSproto(strcpy(buf, "SetNoKeyring"),XS_Doors_SetNoKeyring, file, "$$"); - newXSproto(strcpy(buf, "GetNoKeyring"),XS_Doors_GetNoKeyring, file, "$"); - newXSproto(strcpy(buf, "CreateDatabaseEntry"),XS_Doors_CreateDatabaseEntry, file, "$"); + XS_VERSION_BOOTCHECK; + newXSproto(strcpy(buf, "GetID"), XS_Doors_GetID, file, "$"); + newXSproto(strcpy(buf, "SetModelName"), XS_Doors_SetModelName, file, "$$"); + newXSproto(strcpy(buf, "GetModelName"), XS_Doors_GetModelName, file, "$"); + newXSproto(strcpy(buf, "GetX"), XS_Doors_GetX, file, "$"); + newXSproto(strcpy(buf, "GetY"), XS_Doors_GetY, file, "$"); + newXSproto(strcpy(buf, "GetZ"), XS_Doors_GetZ, file, "$"); + newXSproto(strcpy(buf, "GetHeading"), XS_Doors_GetHeading, file, "$"); + newXSproto(strcpy(buf, "SetX"), XS_Doors_SetX, file, "$$"); + newXSproto(strcpy(buf, "SetY"), XS_Doors_SetY, file, "$$"); + newXSproto(strcpy(buf, "SetZ"), XS_Doors_SetZ, file, "$$"); + newXSproto(strcpy(buf, "SetHeading"), XS_Doors_SetHeading, file, "$$"); + newXSproto(strcpy(buf, "SetLocation"), XS_Doors_SetLocation, file, "$$$$"); + newXSproto(strcpy(buf, "GetDoorDBID"), XS_Doors_GetDoorDBID, file, "$"); + newXSproto(strcpy(buf, "GetDoorID"), XS_Doors_GetDoorID, file, "$"); + newXSproto(strcpy(buf, "SetSize"), XS_Doors_SetSize, file, "$$"); + newXSproto(strcpy(buf, "GetSize"), XS_Doors_GetSize, file, "$"); + newXSproto(strcpy(buf, "SetIncline"), XS_Doors_SetIncline, file, "$$"); + newXSproto(strcpy(buf, "GetIncline"), XS_Doors_GetIncline, file, "$"); + newXSproto(strcpy(buf, "SetOpenType"), XS_Doors_SetOpenType, file, "$$"); + newXSproto(strcpy(buf, "GetOpenType"), XS_Doors_GetOpenType, file, "$"); + newXSproto(strcpy(buf, "SetLockPick"), XS_Doors_SetLockpick, file, "$$"); + newXSproto(strcpy(buf, "GetLockPick"), XS_Doors_GetLockpick, file, "$"); + newXSproto(strcpy(buf, "SetKeyItem"), XS_Doors_SetKeyItem, file, "$$"); + newXSproto(strcpy(buf, "GetKeyItem"), XS_Doors_GetKeyItem, file, "$"); + newXSproto(strcpy(buf, "SetNoKeyring"), XS_Doors_SetNoKeyring, file, "$$"); + newXSproto(strcpy(buf, "GetNoKeyring"), XS_Doors_GetNoKeyring, file, "$"); + newXSproto(strcpy(buf, "CreateDatabaseEntry"), XS_Doors_CreateDatabaseEntry, file, "$"); XSRETURN_YES; } #endif //EMBPERL_XS_CLASSES From ef39395580a5d307c6f92a9619008c648426978a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 19:56:11 -0500 Subject: [PATCH 16/33] Add Doors to perl-doc-parser.pl --- utils/scripts/perl-doc-parser.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/utils/scripts/perl-doc-parser.pl b/utils/scripts/perl-doc-parser.pl index 80f72982c..98baf0b73 100755 --- a/utils/scripts/perl-doc-parser.pl +++ b/utils/scripts/perl-doc-parser.pl @@ -6,6 +6,7 @@ sub usage() { print " --client - Prints methods for just client class methods\n"; print " --mob - Prints methods for just mob class methods\n"; print " --entity - Prints methods for just entity class methods\n"; + print " --door - Prints methods for just door class methods\n"; print " --corpse - Prints methods for just corpse class methods\n"; print " --all - Prints methods for all classes\n"; exit(1); @@ -47,7 +48,7 @@ for my $file (@files) { chomp; $line = $_; - if ($line=~/Client::|Mob::|Corpse::|EntityList::/i && $line=~/_croak/i) { + if ($line=~/Client::|Mob::|Corpse::|EntityList::|Doors::/i && $line=~/_croak/i) { #::: Client export if ($export=~/all|client/i) { @@ -73,6 +74,12 @@ for my $file (@files) { $object_prefix = "\$entity_list->"; } + #::: Doors export + if ($export=~/all|door/i) { + $split_key = "Doors::"; + $object_prefix = "\$door->"; + } + #::: Split on croak usage @data = split($split_key, $line); $usage = trim($data[1]); From 782c5ebc7532fcd47ea1008ff5e5625723506162 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 20:00:52 -0500 Subject: [PATCH 17/33] Add group to perl-doc-parser.pl - update usage docs for perl_groups.cpp --- utils/scripts/perl-doc-parser.pl | 9 ++++++++- zone/perl_groups.cpp | 22 +++++++++++----------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/utils/scripts/perl-doc-parser.pl b/utils/scripts/perl-doc-parser.pl index 98baf0b73..0bc01b6c5 100755 --- a/utils/scripts/perl-doc-parser.pl +++ b/utils/scripts/perl-doc-parser.pl @@ -7,6 +7,7 @@ sub usage() { print " --mob - Prints methods for just mob class methods\n"; print " --entity - Prints methods for just entity class methods\n"; print " --door - Prints methods for just door class methods\n"; + print " --group - Prints methods for just group class methods\n"; print " --corpse - Prints methods for just corpse class methods\n"; print " --all - Prints methods for all classes\n"; exit(1); @@ -48,7 +49,7 @@ for my $file (@files) { chomp; $line = $_; - if ($line=~/Client::|Mob::|Corpse::|EntityList::|Doors::/i && $line=~/_croak/i) { + if ($line=~/Client::|Mob::|Corpse::|EntityList::|Doors::|Group::/i && $line=~/_croak/i) { #::: Client export if ($export=~/all|client/i) { @@ -80,6 +81,12 @@ for my $file (@files) { $object_prefix = "\$door->"; } + #::: Group export + if ($export=~/all|group/i) { + $split_key = "Group::"; + $object_prefix = "\$group->"; + } + #::: Split on croak usage @data = split($split_key, $line); $usage = trim($data[1]); diff --git a/zone/perl_groups.cpp b/zone/perl_groups.cpp index e264b7d7a..fbc0355dd 100644 --- a/zone/perl_groups.cpp +++ b/zone/perl_groups.cpp @@ -105,7 +105,7 @@ XS(XS_Group_CastGroupSpell) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Group::CastGroupSpell(THIS, caster, spellid)"); + Perl_croak(aTHX_ "Usage: Group::CastGroupSpell(THIS, Mob* caster, uint16 spell_id)"); { Group * THIS; Mob* caster; @@ -139,7 +139,7 @@ XS(XS_Group_SplitExp) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Group::SplitExp(THIS, exp, other)"); + Perl_croak(aTHX_ "Usage: Group::SplitExp(THIS, uint32 exp, Mob* other)"); { Group * THIS; uint32 exp = (uint32)SvUV(ST(1)); @@ -173,7 +173,7 @@ XS(XS_Group_GroupMessage) { dXSARGS; if ((items != 3) && (items != 4)) // the 3 item version is kept for backwards compatability - Perl_croak(aTHX_ "Usage: Group::GroupMessage(THIS, sender, language, message)"); + Perl_croak(aTHX_ "Usage: Group::GroupMessage(THIS, Mob* sender, uint8 language, string message)"); { Group * THIS; Mob* sender; @@ -218,7 +218,7 @@ XS(XS_Group_GetTotalGroupDamage) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Group::GetTotalGroupDamage(THIS, other)"); + Perl_croak(aTHX_ "Usage: Group::GetTotalGroupDamage(THIS, Mob* other)"); { Group * THIS; uint32 RETVAL; @@ -254,7 +254,7 @@ XS(XS_Group_SplitMoney) { dXSARGS; if (items != 5) - Perl_croak(aTHX_ "Usage: Group::SplitMoney(THIS, copper, silver, gold, platinum)"); + Perl_croak(aTHX_ "Usage: Group::SplitMoney(THIS, uint32 copper, uint32 silver, uint32 gold, uint32 platinum)"); { Group * THIS; uint32 copper = (uint32)SvUV(ST(1)); @@ -281,7 +281,7 @@ XS(XS_Group_SetLeader) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Group::SetLeader(THIS, newleader)"); + Perl_croak(aTHX_ "Usage: Group::SetLeader(THIS, Mob* new_leader)"); { Group * THIS; Mob* newleader; @@ -366,7 +366,7 @@ XS(XS_Group_SendHPPacketsTo) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Group::SendHPPacketsTo(THIS, newmember)"); + Perl_croak(aTHX_ "Usage: Group::SendHPPacketsTo(THIS, Mob* new_member)"); { Group * THIS; Mob* newmember; @@ -399,7 +399,7 @@ XS(XS_Group_SendHPPacketsFrom) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Group::SendHPPacketsFrom(THIS, newmember)"); + Perl_croak(aTHX_ "Usage: Group::SendHPPacketsFrom(THIS, Mob* new_member)"); { Group * THIS; Mob* newmember; @@ -432,7 +432,7 @@ XS(XS_Group_IsLeader) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Group::IsLeader(THIS, leadertest)"); + Perl_croak(aTHX_ "Usage: Group::IsLeader(THIS, Mob* target)"); { Group * THIS; bool RETVAL; @@ -520,7 +520,7 @@ XS(XS_Group_TeleportGroup) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ "Usage: Group::TeleportGroup(THIS, sender, zoneID, x, y, z, heading)"); + Perl_croak(aTHX_ "Usage: Group::TeleportGroup(THIS, Mob* sender, uint32 zone_id, float x, float y, float z, float heading)"); { Group * THIS; Mob* sender; @@ -584,7 +584,7 @@ XS(XS_Group_GetMember) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Group::GetMember(THIS, index)"); + Perl_croak(aTHX_ "Usage: Group::GetMember(THIS, int group_index)"); { Group * THIS; Mob* member; From cf6a9d6b2a982f9ec3385051cee2a5cc8ff390a9 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 20:01:03 -0500 Subject: [PATCH 18/33] perl_groups.cpp formatting --- zone/perl_groups.cpp | 495 ++++++++++++++++++++----------------------- 1 file changed, 228 insertions(+), 267 deletions(-) diff --git a/zone/perl_groups.cpp b/zone/perl_groups.cpp index fbc0355dd..0eaf8f45e 100644 --- a/zone/perl_groups.cpp +++ b/zone/perl_groups.cpp @@ -26,7 +26,9 @@ */ #include "../common/features.h" + #ifdef EMBPERL_XS_CLASSES + #include "../common/global_define.h" #include "embperl.h" @@ -42,21 +44,19 @@ XS(XS_Group_DisbandGroup); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Group_DisbandGroup) -{ +XS(XS_Group_DisbandGroup) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Group::DisbandGroup(THIS)"); { - Group * THIS; + Group *THIS; if (sv_derived_from(ST(0), "Group")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Group *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Group *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->DisbandGroup(); @@ -65,32 +65,29 @@ XS(XS_Group_DisbandGroup) } XS(XS_Group_IsGroupMember); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Group_IsGroupMember) -{ +XS(XS_Group_IsGroupMember) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Group::IsGroupMember(THIS, client)"); { - Group * THIS; - bool RETVAL; - Mob* client; + Group *THIS; + bool RETVAL; + Mob *client; if (sv_derived_from(ST(0), "Group")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Group *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Group *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - client = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + client = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "client is not of type Mob"); - if(client == nullptr) + if (client == nullptr) Perl_croak(aTHX_ "client is nullptr, avoiding crash."); RETVAL = THIS->IsGroupMember(client); @@ -101,32 +98,29 @@ XS(XS_Group_IsGroupMember) } XS(XS_Group_CastGroupSpell); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Group_CastGroupSpell) -{ +XS(XS_Group_CastGroupSpell) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Group::CastGroupSpell(THIS, Mob* caster, uint16 spell_id)"); { - Group * THIS; - Mob* caster; - uint16 spellid = (uint16)SvUV(ST(2)); + Group *THIS; + Mob *caster; + uint16 spellid = (uint16) SvUV(ST(2)); if (sv_derived_from(ST(0), "Group")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Group *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Group *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - caster = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + caster = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "caster is not of type Mob"); - if(caster == nullptr) + if (caster == nullptr) Perl_croak(aTHX_ "caster is nullptr, avoiding crash."); THIS->CastGroupSpell(caster, spellid); @@ -135,32 +129,29 @@ XS(XS_Group_CastGroupSpell) } XS(XS_Group_SplitExp); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Group_SplitExp) -{ +XS(XS_Group_SplitExp) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Group::SplitExp(THIS, uint32 exp, Mob* other)"); { - Group * THIS; - uint32 exp = (uint32)SvUV(ST(1)); - Mob* other; + Group *THIS; + uint32 exp = (uint32) SvUV(ST(1)); + Mob *other; if (sv_derived_from(ST(0), "Group")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Group *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Group *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(2), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(2))); - other = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(2))); + other = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == nullptr) + if (other == nullptr) Perl_croak(aTHX_ "other is nullptr, avoiding crash."); THIS->SplitExp(exp, other); @@ -169,106 +160,98 @@ XS(XS_Group_SplitExp) } XS(XS_Group_GroupMessage); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Group_GroupMessage) -{ +XS(XS_Group_GroupMessage) { dXSARGS; - if ((items != 3) && (items != 4)) // the 3 item version is kept for backwards compatability + if ((items != 3) && (items != 4)) // the 3 item version is kept for backwards compatability Perl_croak(aTHX_ "Usage: Group::GroupMessage(THIS, Mob* sender, uint8 language, string message)"); { - Group * THIS; - Mob* sender; - uint8 language; - char* message; + Group *THIS; + Mob *sender; + uint8 language; + char *message; if (sv_derived_from(ST(0), "Group")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Group *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Group *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - sender = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + sender = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "sender is not of type Mob"); - if(sender == nullptr) + if (sender == nullptr) Perl_croak(aTHX_ "sender is nullptr, avoiding crash."); if (items == 4) { - language = (uint8)SvUV(ST(2)); + language = (uint8) SvUV(ST(2)); if ((language >= MAX_PP_LANGUAGE) || (language < 0)) language = 0; - message = (char *)SvPV_nolen(ST(3)); + message = (char *) SvPV_nolen(ST(3)); THIS->GroupMessage(sender, language, 100, message); - } - else { // if no language is specificed, send it in common - message = (char *)SvPV_nolen(ST(2)); - THIS->GroupMessage(sender,0, 100, message); + } else { // if no language is specificed, send it in common + message = (char *) SvPV_nolen(ST(2)); + THIS->GroupMessage(sender, 0, 100, message); } } XSRETURN_EMPTY; } XS(XS_Group_GetTotalGroupDamage); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Group_GetTotalGroupDamage) -{ +XS(XS_Group_GetTotalGroupDamage) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Group::GetTotalGroupDamage(THIS, Mob* other)"); { - Group * THIS; - uint32 RETVAL; + Group *THIS; + uint32 RETVAL; dXSTARG; - Mob* other; + Mob *other; if (sv_derived_from(ST(0), "Group")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Group *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Group *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - other = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + other = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == nullptr) + if (other == nullptr) Perl_croak(aTHX_ "other is nullptr, avoiding crash."); RETVAL = THIS->GetTotalGroupDamage(other); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Group_SplitMoney); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Group_SplitMoney) -{ +XS(XS_Group_SplitMoney) { dXSARGS; if (items != 5) Perl_croak(aTHX_ "Usage: Group::SplitMoney(THIS, uint32 copper, uint32 silver, uint32 gold, uint32 platinum)"); { - Group * THIS; - uint32 copper = (uint32)SvUV(ST(1)); - uint32 silver = (uint32)SvUV(ST(2)); - uint32 gold = (uint32)SvUV(ST(3)); - uint32 platinum = (uint32)SvUV(ST(4)); + Group *THIS; + uint32 copper = (uint32) SvUV(ST(1)); + uint32 silver = (uint32) SvUV(ST(2)); + uint32 gold = (uint32) SvUV(ST(3)); + uint32 platinum = (uint32) SvUV(ST(4)); if (sv_derived_from(ST(0), "Group")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Group *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Group *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SplitMoney(copper, silver, gold, platinum); @@ -277,31 +260,28 @@ XS(XS_Group_SplitMoney) } XS(XS_Group_SetLeader); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Group_SetLeader) -{ +XS(XS_Group_SetLeader) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Group::SetLeader(THIS, Mob* new_leader)"); { - Group * THIS; - Mob* newleader; + Group *THIS; + Mob *newleader; if (sv_derived_from(ST(0), "Group")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Group *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Group *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - newleader = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + newleader = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "newleader is not of type Mob"); - if(newleader == nullptr) + if (newleader == nullptr) Perl_croak(aTHX_ "newleader is nullptr, avoiding crash."); THIS->SetLeader(newleader); @@ -310,83 +290,78 @@ XS(XS_Group_SetLeader) } XS(XS_Group_GetLeader); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Group_GetLeader) -{ +XS(XS_Group_GetLeader) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Group::GetLeader(THIS)"); { - Group * THIS; - Mob * RETVAL; + Group *THIS; + Mob *RETVAL; if (sv_derived_from(ST(0), "Group")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Group *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Group *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLeader(); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Mob", (void*)RETVAL); + sv_setref_pv(ST(0), "Mob", (void *) RETVAL); } XSRETURN(1); } XS(XS_Group_GetLeaderName); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Group_GetLeaderName) -{ +XS(XS_Group_GetLeaderName) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Group::GetLeaderName(THIS)"); { - Group * THIS; - const char * RETVAL; + Group *THIS; + const char *RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Group")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Group *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Group *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLeaderName(); - sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; + sv_setpv(TARG, RETVAL); + XSprePUSH; + PUSHTARG; } XSRETURN(1); } XS(XS_Group_SendHPPacketsTo); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Group_SendHPPacketsTo) -{ +XS(XS_Group_SendHPPacketsTo) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Group::SendHPPacketsTo(THIS, Mob* new_member)"); { - Group * THIS; - Mob* newmember; + Group *THIS; + Mob *newmember; if (sv_derived_from(ST(0), "Group")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Group *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Group *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - newmember = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + newmember = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "newmember is not of type Mob"); - if(newmember == nullptr) + if (newmember == nullptr) Perl_croak(aTHX_ "newmember is nullptr, avoiding crash."); THIS->SendHPManaEndPacketsTo(newmember); @@ -395,31 +370,28 @@ XS(XS_Group_SendHPPacketsTo) } XS(XS_Group_SendHPPacketsFrom); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Group_SendHPPacketsFrom) -{ +XS(XS_Group_SendHPPacketsFrom) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Group::SendHPPacketsFrom(THIS, Mob* new_member)"); { - Group * THIS; - Mob* newmember; + Group *THIS; + Mob *newmember; if (sv_derived_from(ST(0), "Group")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Group *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Group *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - newmember = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + newmember = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "newmember is not of type Mob"); - if(newmember == nullptr) + if (newmember == nullptr) Perl_croak(aTHX_ "newmember is nullptr, avoiding crash."); THIS->SendHPPacketsFrom(newmember); @@ -428,32 +400,29 @@ XS(XS_Group_SendHPPacketsFrom) } XS(XS_Group_IsLeader); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Group_IsLeader) -{ +XS(XS_Group_IsLeader) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Group::IsLeader(THIS, Mob* target)"); { - Group * THIS; - bool RETVAL; - Mob* leadertest; + Group *THIS; + bool RETVAL; + Mob *leadertest; if (sv_derived_from(ST(0), "Group")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Group *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Group *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - leadertest = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + leadertest = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "leadertest is not of type Mob"); - if(leadertest == nullptr) + if (leadertest == nullptr) Perl_croak(aTHX_ "leadertest is nullptr, avoiding crash."); RETVAL = THIS->IsLeader(leadertest); @@ -464,88 +433,84 @@ XS(XS_Group_IsLeader) } XS(XS_Group_GroupCount); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Group_GroupCount) -{ +XS(XS_Group_GroupCount) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Group::GroupCount(THIS)"); { - Group * THIS; - uint8 RETVAL; + Group *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Group")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Group *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Group *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GroupCount(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Group_GetHighestLevel); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Group_GetHighestLevel) -{ +XS(XS_Group_GetHighestLevel) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Group::GetHighestLevel(THIS)"); { - Group * THIS; - uint32 RETVAL; + Group *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Group")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Group *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Group *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHighestLevel(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Group_TeleportGroup); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Group_TeleportGroup) -{ +XS(XS_Group_TeleportGroup) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ "Usage: Group::TeleportGroup(THIS, Mob* sender, uint32 zone_id, float x, float y, float z, float heading)"); + Perl_croak(aTHX_ + "Usage: Group::TeleportGroup(THIS, Mob* sender, uint32 zone_id, float x, float y, float z, float heading)"); { - Group * THIS; - Mob* sender; - uint32 zoneID = (uint32)SvUV(ST(2)); - float x = (float)SvNV(ST(3)); - float y = (float)SvNV(ST(4)); - float z = (float)SvNV(ST(5)); - float heading = (float)SvNV(ST(6)); + Group *THIS; + Mob *sender; + uint32 zoneID = (uint32) SvUV(ST(2)); + float x = (float) SvNV(ST(3)); + float y = (float) SvNV(ST(4)); + float z = (float) SvNV(ST(5)); + float heading = (float) SvNV(ST(6)); if (sv_derived_from(ST(0), "Group")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Group *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Group *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - sender = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + sender = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "sender is not of type Mob"); - if(sender == nullptr) + if (sender == nullptr) Perl_croak(aTHX_ "sender is nullptr, avoiding crash."); THIS->TeleportGroup(sender, zoneID, 0, x, y, z, heading); @@ -554,63 +519,60 @@ XS(XS_Group_TeleportGroup) } XS(XS_Group_GetID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Group_GetID) -{ +XS(XS_Group_GetID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Group::GetID(THIS)"); { - Group * THIS; - uint32 RETVAL; + Group *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Group")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Group *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Group *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Group_GetMember); -XS(XS_Group_GetMember) -{ +XS(XS_Group_GetMember) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Group::GetMember(THIS, int group_index)"); { - Group * THIS; - Mob* member; - Client* RETVAL = nullptr; + Group *THIS; + Mob *member; + Client *RETVAL = nullptr; dXSTARG; if (sv_derived_from(ST(0), "Group")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Group *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Group *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - int index = (int)SvUV(ST(1)); + int index = (int) SvUV(ST(1)); if (index < 0 || index > 5) RETVAL = nullptr; else { - member = THIS->members[index]; + member = THIS->members[index]; if (member != nullptr) RETVAL = member->CastToClient(); } - ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Client", (void*)RETVAL); + ST(0) = sv_newmortal(); + sv_setref_pv(ST(0), "Client", (void *) RETVAL); } XSRETURN(1); } @@ -619,39 +581,38 @@ XS(XS_Group_GetMember) extern "C" #endif XS(boot_Group); /* prototype to pass -Wmissing-prototypes */ -XS(boot_Group) -{ +XS(boot_Group) { dXSARGS; char file[256]; strncpy(file, __FILE__, 256); file[255] = 0; - if(items != 1) + if (items != 1) fprintf(stderr, "boot_quest does not take any arguments."); char buf[128]; //add the strcpy stuff to get rid of const warnings.... - XS_VERSION_BOOTCHECK ; + XS_VERSION_BOOTCHECK; - newXSproto(strcpy(buf, "DisbandGroup"), XS_Group_DisbandGroup, file, "$"); - newXSproto(strcpy(buf, "IsGroupMember"), XS_Group_IsGroupMember, file, "$$"); - newXSproto(strcpy(buf, "CastGroupSpell"), XS_Group_CastGroupSpell, file, "$$$"); - newXSproto(strcpy(buf, "SplitExp"), XS_Group_SplitExp, file, "$$$"); - newXSproto(strcpy(buf, "GroupMessage"), XS_Group_GroupMessage, file, "$$$"); - newXSproto(strcpy(buf, "GetTotalGroupDamage"), XS_Group_GetTotalGroupDamage, file, "$$"); - newXSproto(strcpy(buf, "SplitMoney"), XS_Group_SplitMoney, file, "$$$$$"); - newXSproto(strcpy(buf, "SetLeader"), XS_Group_SetLeader, file, "$$"); - newXSproto(strcpy(buf, "GetLeader"), XS_Group_GetLeader, file, "$"); - newXSproto(strcpy(buf, "GetLeaderName"), XS_Group_GetLeaderName, file, "$"); - newXSproto(strcpy(buf, "SendHPPacketsTo"), XS_Group_SendHPPacketsTo, file, "$$"); - newXSproto(strcpy(buf, "SendHPPacketsFrom"), XS_Group_SendHPPacketsFrom, file, "$$"); - newXSproto(strcpy(buf, "IsLeader"), XS_Group_IsLeader, file, "$$"); - newXSproto(strcpy(buf, "GroupCount"), XS_Group_GroupCount, file, "$"); - newXSproto(strcpy(buf, "GetHighestLevel"), XS_Group_GetHighestLevel, file, "$"); - newXSproto(strcpy(buf, "TeleportGroup"), XS_Group_TeleportGroup, file, "$$$$$$$"); - newXSproto(strcpy(buf, "GetID"), XS_Group_GetID, file, "$"); - newXSproto(strcpy(buf, "GetMember"), XS_Group_GetMember, file, "$$"); + newXSproto(strcpy(buf, "DisbandGroup"), XS_Group_DisbandGroup, file, "$"); + newXSproto(strcpy(buf, "IsGroupMember"), XS_Group_IsGroupMember, file, "$$"); + newXSproto(strcpy(buf, "CastGroupSpell"), XS_Group_CastGroupSpell, file, "$$$"); + newXSproto(strcpy(buf, "SplitExp"), XS_Group_SplitExp, file, "$$$"); + newXSproto(strcpy(buf, "GroupMessage"), XS_Group_GroupMessage, file, "$$$"); + newXSproto(strcpy(buf, "GetTotalGroupDamage"), XS_Group_GetTotalGroupDamage, file, "$$"); + newXSproto(strcpy(buf, "SplitMoney"), XS_Group_SplitMoney, file, "$$$$$"); + newXSproto(strcpy(buf, "SetLeader"), XS_Group_SetLeader, file, "$$"); + newXSproto(strcpy(buf, "GetLeader"), XS_Group_GetLeader, file, "$"); + newXSproto(strcpy(buf, "GetLeaderName"), XS_Group_GetLeaderName, file, "$"); + newXSproto(strcpy(buf, "SendHPPacketsTo"), XS_Group_SendHPPacketsTo, file, "$$"); + newXSproto(strcpy(buf, "SendHPPacketsFrom"), XS_Group_SendHPPacketsFrom, file, "$$"); + newXSproto(strcpy(buf, "IsLeader"), XS_Group_IsLeader, file, "$$"); + newXSproto(strcpy(buf, "GroupCount"), XS_Group_GroupCount, file, "$"); + newXSproto(strcpy(buf, "GetHighestLevel"), XS_Group_GetHighestLevel, file, "$"); + newXSproto(strcpy(buf, "TeleportGroup"), XS_Group_TeleportGroup, file, "$$$$$$$"); + newXSproto(strcpy(buf, "GetID"), XS_Group_GetID, file, "$"); + newXSproto(strcpy(buf, "GetMember"), XS_Group_GetMember, file, "$$"); XSRETURN_YES; } From 465071c2cfda6f72ed8958082e620c7018b76d86 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 20:02:53 -0500 Subject: [PATCH 19/33] More perl_groups.cpp formatting --- zone/perl_groups.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/zone/perl_groups.cpp b/zone/perl_groups.cpp index 0eaf8f45e..33ed9689d 100644 --- a/zone/perl_groups.cpp +++ b/zone/perl_groups.cpp @@ -71,8 +71,8 @@ XS(XS_Group_IsGroupMember) { Perl_croak(aTHX_ "Usage: Group::IsGroupMember(THIS, client)"); { Group *THIS; - bool RETVAL; - Mob *client; + bool RETVAL; + Mob *client; if (sv_derived_from(ST(0), "Group")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -103,8 +103,8 @@ XS(XS_Group_CastGroupSpell) { if (items != 3) Perl_croak(aTHX_ "Usage: Group::CastGroupSpell(THIS, Mob* caster, uint16 spell_id)"); { - Group *THIS; - Mob *caster; + Group *THIS; + Mob *caster; uint16 spellid = (uint16) SvUV(ST(2)); if (sv_derived_from(ST(0), "Group")) { @@ -134,9 +134,9 @@ XS(XS_Group_SplitExp) { if (items != 3) Perl_croak(aTHX_ "Usage: Group::SplitExp(THIS, uint32 exp, Mob* other)"); { - Group *THIS; + Group *THIS; uint32 exp = (uint32) SvUV(ST(1)); - Mob *other; + Mob *other; if (sv_derived_from(ST(0), "Group")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -168,7 +168,7 @@ XS(XS_Group_GroupMessage) { Group *THIS; Mob *sender; uint8 language; - char *message; + char *message; if (sv_derived_from(ST(0), "Group")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -206,10 +206,10 @@ XS(XS_Group_GetTotalGroupDamage) { if (items != 2) Perl_croak(aTHX_ "Usage: Group::GetTotalGroupDamage(THIS, Mob* other)"); { - Group *THIS; + Group *THIS; uint32 RETVAL; dXSTARG; - Mob *other; + Mob *other; if (sv_derived_from(ST(0), "Group")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -240,7 +240,7 @@ XS(XS_Group_SplitMoney) { if (items != 5) Perl_croak(aTHX_ "Usage: Group::SplitMoney(THIS, uint32 copper, uint32 silver, uint32 gold, uint32 platinum)"); { - Group *THIS; + Group *THIS; uint32 copper = (uint32) SvUV(ST(1)); uint32 silver = (uint32) SvUV(ST(2)); uint32 gold = (uint32) SvUV(ST(3)); @@ -406,8 +406,8 @@ XS(XS_Group_IsLeader) { Perl_croak(aTHX_ "Usage: Group::IsLeader(THIS, Mob* target)"); { Group *THIS; - bool RETVAL; - Mob *leadertest; + bool RETVAL; + Mob *leadertest; if (sv_derived_from(ST(0), "Group")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -463,7 +463,7 @@ XS(XS_Group_GetHighestLevel) { if (items != 1) Perl_croak(aTHX_ "Usage: Group::GetHighestLevel(THIS)"); { - Group *THIS; + Group *THIS; uint32 RETVAL; dXSTARG; @@ -489,8 +489,8 @@ XS(XS_Group_TeleportGroup) { Perl_croak(aTHX_ "Usage: Group::TeleportGroup(THIS, Mob* sender, uint32 zone_id, float x, float y, float z, float heading)"); { - Group *THIS; - Mob *sender; + Group *THIS; + Mob *sender; uint32 zoneID = (uint32) SvUV(ST(2)); float x = (float) SvNV(ST(3)); float y = (float) SvNV(ST(4)); @@ -524,7 +524,7 @@ XS(XS_Group_GetID) { if (items != 1) Perl_croak(aTHX_ "Usage: Group::GetID(THIS)"); { - Group *THIS; + Group *THIS; uint32 RETVAL; dXSTARG; From 6faaff31be1422fdc398c152d6478eee4ef96bdd Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 20:04:53 -0500 Subject: [PATCH 20/33] Add --hateentry to perl-doc-parser.pl - format perl_hateentry.cpp --- utils/scripts/perl-doc-parser.pl | 9 ++++- zone/perl_hateentry.cpp | 69 +++++++++++++++----------------- 2 files changed, 41 insertions(+), 37 deletions(-) diff --git a/utils/scripts/perl-doc-parser.pl b/utils/scripts/perl-doc-parser.pl index 0bc01b6c5..79d0ba821 100755 --- a/utils/scripts/perl-doc-parser.pl +++ b/utils/scripts/perl-doc-parser.pl @@ -9,6 +9,7 @@ sub usage() { print " --door - Prints methods for just door class methods\n"; print " --group - Prints methods for just group class methods\n"; print " --corpse - Prints methods for just corpse class methods\n"; + print " --hateentry - Prints methods for just hateentry class methods\n"; print " --all - Prints methods for all classes\n"; exit(1); } @@ -49,7 +50,7 @@ for my $file (@files) { chomp; $line = $_; - if ($line=~/Client::|Mob::|Corpse::|EntityList::|Doors::|Group::/i && $line=~/_croak/i) { + if ($line=~/Client::|Mob::|Corpse::|EntityList::|Doors::|Group::|HateEntry::/i && $line=~/_croak/i) { #::: Client export if ($export=~/all|client/i) { @@ -87,6 +88,12 @@ for my $file (@files) { $object_prefix = "\$group->"; } + #::: Hateentry export + if ($export=~/all|hateentry/i) { + $split_key = "HateEntry::"; + $object_prefix = "\$hate_entry->"; + } + #::: Split on croak usage @data = split($split_key, $line); $usage = trim($data[1]); diff --git a/zone/perl_hateentry.cpp b/zone/perl_hateentry.cpp index 7c346a748..85b5d67dd 100644 --- a/zone/perl_hateentry.cpp +++ b/zone/perl_hateentry.cpp @@ -18,7 +18,9 @@ #include "../common/features.h" #include "client.h" + #ifdef EMBPERL_XS_CLASSES + #include "../common/global_define.h" #include "embperl.h" @@ -29,84 +31,80 @@ #include "../common/linked_list.h" #include "hate_list.h" -#ifdef THIS /* this macro seems to leak out on some systems */ +#ifdef THIS /* this macro seems to leak out on some systems */ #undef THIS #endif XS(XS_HateEntry_GetEnt); /* prototype to pass -Wmissing-prototypes */ -XS(XS_HateEntry_GetEnt) -{ +XS(XS_HateEntry_GetEnt) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: HateEntry::GetData(THIS)"); { - struct_HateList * THIS; - Mob * RETVAL; + struct_HateList *THIS; + Mob *RETVAL; if (sv_derived_from(ST(0), "HateEntry")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(struct_HateList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(struct_HateList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type tHateEntry"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->entity_on_hatelist; ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Mob", (void*)RETVAL); + sv_setref_pv(ST(0), "Mob", (void *) RETVAL); } XSRETURN(1); } XS(XS_HateEntry_GetHate); /* prototype to pass -Wmissing-prototypes */ -XS(XS_HateEntry_GetHate) -{ +XS(XS_HateEntry_GetHate) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: HateEntry::GetHate(THIS)"); { - struct_HateList * THIS; + struct_HateList *THIS; int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "HateEntry")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(struct_HateList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(struct_HateList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type tHateEntry"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->stored_hate_amount; - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_HateEntry_GetDamage); /* prototype to pass -Wmissing-prototypes */ -XS(XS_HateEntry_GetDamage) -{ +XS(XS_HateEntry_GetDamage) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: HateEntry::GetDamage(THIS)"); { - struct_HateList * THIS; + struct_HateList *THIS; int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "HateEntry")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(struct_HateList *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(struct_HateList *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type tHateEntry"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->hatelist_damage; - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } @@ -116,24 +114,23 @@ extern "C" #endif XS(boot_HateEntry); -XS(boot_HateEntry) -{ +XS(boot_HateEntry) { dXSARGS; char file[256]; strncpy(file, __FILE__, 256); file[255] = 0; - if(items != 1) + if (items != 1) fprintf(stderr, "boot_quest does not take any arguments."); char buf[128]; //add the strcpy stuff to get rid of const warnings.... - XS_VERSION_BOOTCHECK ; + XS_VERSION_BOOTCHECK; - newXSproto(strcpy(buf, "GetEnt"), XS_HateEntry_GetEnt, file, "$"); - newXSproto(strcpy(buf, "GetDamage"), XS_HateEntry_GetDamage, file, "$"); - newXSproto(strcpy(buf, "GetHate"), XS_HateEntry_GetHate, file, "$"); + newXSproto(strcpy(buf, "GetEnt"), XS_HateEntry_GetEnt, file, "$"); + newXSproto(strcpy(buf, "GetDamage"), XS_HateEntry_GetDamage, file, "$"); + newXSproto(strcpy(buf, "GetHate"), XS_HateEntry_GetHate, file, "$"); XSRETURN_YES; } From 880285afa618d419d7da08a93efd8eabea1ecc60 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 20:20:09 -0500 Subject: [PATCH 21/33] Add --npc to perl-doc-parser.pl and update usage docs in perl_npc.cpp --- utils/scripts/perl-doc-parser.pl | 9 ++- zone/perl_npc.cpp | 96 ++++++++++++++++---------------- 2 files changed, 56 insertions(+), 49 deletions(-) diff --git a/utils/scripts/perl-doc-parser.pl b/utils/scripts/perl-doc-parser.pl index 79d0ba821..e5de41102 100755 --- a/utils/scripts/perl-doc-parser.pl +++ b/utils/scripts/perl-doc-parser.pl @@ -5,6 +5,7 @@ sub usage() { print "Usage:\n"; print " --client - Prints methods for just client class methods\n"; print " --mob - Prints methods for just mob class methods\n"; + print " --npc - Prints methods for just npc class methods\n"; print " --entity - Prints methods for just entity class methods\n"; print " --door - Prints methods for just door class methods\n"; print " --group - Prints methods for just group class methods\n"; @@ -50,7 +51,7 @@ for my $file (@files) { chomp; $line = $_; - if ($line=~/Client::|Mob::|Corpse::|EntityList::|Doors::|Group::|HateEntry::/i && $line=~/_croak/i) { + if ($line=~/Client::|Mob::|Corpse::|EntityList::|Doors::|Group::|HateEntry::|NPC::/i && $line=~/_croak/i) { #::: Client export if ($export=~/all|client/i) { @@ -64,6 +65,12 @@ for my $file (@files) { $object_prefix = "\$mob->"; } + #::: NPC export + if ($export=~/all|npc/i) { + $split_key = "NPC::"; + $object_prefix = "\$npc->"; + } + #::: Corpse export if ($export=~/all|corpse/i) { $split_key = "Corpse::"; diff --git a/zone/perl_npc.cpp b/zone/perl_npc.cpp index eef7b1717..acff193e6 100644 --- a/zone/perl_npc.cpp +++ b/zone/perl_npc.cpp @@ -48,7 +48,7 @@ XS(XS_NPC_SignalNPC) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::SignalNPC(THIS, _signal_id)"); + Perl_croak(aTHX_ "Usage: NPC::SignalNPC(THIS, int signal_id)"); { NPC * THIS; int _signal_id = (int)SvIV(ST(1)); @@ -72,7 +72,7 @@ XS(XS_NPC_CheckNPCFactionAlly) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::CheckNPCFactionAlly(THIS, other_faction)"); + Perl_croak(aTHX_ "Usage: NPC::CheckNPCFactionAlly(THIS, int32 faction_id)"); { NPC * THIS; FACTION_VALUE RETVAL; @@ -99,7 +99,7 @@ XS(XS_NPC_AddItem) { dXSARGS; if (items < 2 || items > 10) - Perl_croak(aTHX_ "Usage: NPC::AddItem(THIS, itemid, charges = 0, equipitem = true, aug1 = 0, aug2 = 0, aug3 = 0, aug4 = 0, aug5 = 0, aug6 = 0)"); + Perl_croak(aTHX_ "Usage: NPC::AddItem(THIS, uint32 item_id, [uint16 charges = 0], [bool equip_item = true], [uint32 aug1 = 0], [uint32 aug2 = 0], [uint32 aug3 = 0], [uint32 aug4 = 0], [uint32 aug5 = 0], [uint32 aug6 = 0])"); { NPC * THIS; uint32 itemid = (uint32)SvUV(ST(1)); @@ -148,7 +148,7 @@ XS(XS_NPC_AddLootTable) { dXSARGS; if (items < 1) - Perl_croak(aTHX_ "Usage: NPC::AddLootTable(THIS, [loottable_id])"); + Perl_croak(aTHX_ "Usage: NPC::AddLootTable(THIS, [uint32 loottable_id])"); { NPC * THIS; @@ -181,7 +181,7 @@ XS(XS_NPC_RemoveItem) { dXSARGS; if (items < 2 || items > 4) - Perl_croak(aTHX_ "Usage: NPC::RemoveItem(THIS, item_id, quantity= 0, slot= 0)"); + Perl_croak(aTHX_ "Usage: NPC::RemoveItem(THIS, uint32 item_id, [uint16 quantity = 0], [uint16 slot_id = 0])"); { NPC * THIS; uint32 item_id = (uint32)SvUV(ST(1)); @@ -242,7 +242,7 @@ XS(XS_NPC_AddCash) { dXSARGS; if (items != 5) - Perl_croak(aTHX_ "Usage: NPC::AddCash(THIS, in_copper, in_silver, in_gold, in_platinum)"); + Perl_croak(aTHX_ "Usage: NPC::AddCash(THIS, uint16 copper, uint16 silver, uint16 gold, uint16 platinum)"); { NPC * THIS; uint16 in_copper = (uint16)SvUV(ST(1)); @@ -448,7 +448,7 @@ XS(XS_NPC_SetCopper) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::SetCopper(THIS, amt)"); + Perl_croak(aTHX_ "Usage: NPC::SetCopper(THIS, uint32 copper_amount)"); { NPC * THIS; uint32 amt = (uint32)SvUV(ST(1)); @@ -472,7 +472,7 @@ XS(XS_NPC_SetSilver) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::SetSilver(THIS, amt)"); + Perl_croak(aTHX_ "Usage: NPC::SetSilver(THIS, uint32 silver_amount)"); { NPC * THIS; uint32 amt = (uint32)SvUV(ST(1)); @@ -496,7 +496,7 @@ XS(XS_NPC_SetGold) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::SetGold(THIS, amt)"); + Perl_croak(aTHX_ "Usage: NPC::SetGold(THIS, uint32 gold_amount)"); { NPC * THIS; uint32 amt = (uint32)SvUV(ST(1)); @@ -520,7 +520,7 @@ XS(XS_NPC_SetPlatinum) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::SetPlatinum(THIS, amt)"); + Perl_croak(aTHX_ "Usage: NPC::SetPlatinum(THIS, uint32 platinum_amount)"); { NPC * THIS; uint32 amt = (uint32)SvUV(ST(1)); @@ -544,7 +544,7 @@ XS(XS_NPC_SetGrid) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::SetGrid(THIS, grid_)"); + Perl_croak(aTHX_ "Usage: NPC::SetGrid(THIS, int32 grid_id)"); { NPC * THIS; int32 grid_ = (int32)SvIV(ST(1)); @@ -568,7 +568,7 @@ XS(XS_NPC_SetSaveWaypoint) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::SetSaveWaypoint(THIS, waypoint)"); + Perl_croak(aTHX_ "Usage: NPC::SetSaveWaypoint(THIS, uint16 waypoint)"); { NPC * THIS; uint16 waypoint = (uint16)SvUV(ST(1)); @@ -592,7 +592,7 @@ XS(XS_NPC_SetSp2) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::SetSp2(THIS, sg2)"); + Perl_croak(aTHX_ "Usage: NPC::SetSp2(THIS, uint32 set_spawn_group_id)"); { NPC * THIS; uint32 sg2 = (uint32)SvUV(ST(1)); @@ -746,7 +746,7 @@ XS(XS_NPC_GetNPCHate) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::GetNPCHate(THIS, in_ent)"); + Perl_croak(aTHX_ "Usage: NPC::GetNPCHate(THIS, Mob* entity)"); { NPC * THIS; int32 RETVAL; @@ -782,7 +782,7 @@ XS(XS_NPC_IsOnHatelist) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::IsOnHatelist(THIS, p)"); + Perl_croak(aTHX_ "Usage: NPC::IsOnHatelist(THIS, Mob* target)"); { NPC * THIS; bool RETVAL; @@ -818,7 +818,7 @@ XS(XS_NPC_RemoveFromHateList) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::RemoveFromHateList(THIS, ent)"); + Perl_croak(aTHX_ "Usage: NPC::RemoveFromHateList(THIS, Mob* target)"); { NPC * THIS; Mob* ent; @@ -854,7 +854,7 @@ XS(XS_NPC_SetNPCFactionID) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::SetNPCFactionID(THIS, in)"); + Perl_croak(aTHX_ "Usage: NPC::SetNPCFactionID(THIS, int32 faction_id)"); { NPC * THIS; int32 in = (int32)SvIV(ST(1)); @@ -983,7 +983,7 @@ XS(XS_NPC_SetPetSpellID) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::SetPetSpellID(THIS, amt)"); + Perl_croak(aTHX_ "Usage: NPC::SetPetSpellID(THIS, uint16 amount)"); { NPC * THIS; uint16 amt = (uint16)SvUV(ST(1)); @@ -1007,7 +1007,7 @@ XS(XS_NPC_GetMaxDamage) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::GetMaxDamage(THIS, tlevel)"); + Perl_croak(aTHX_ "Usage: NPC::GetMaxDamage(THIS, uint8 target_level)"); { NPC * THIS; uint32 RETVAL; @@ -1034,10 +1034,10 @@ XS(XS_NPC_SetTaunting) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::SetTaunting(THIS, tog)"); + Perl_croak(aTHX_ "Usage: NPC::SetTaunting(THIS, bool toggle)"); { NPC * THIS; - bool tog = (bool)SvTRUE(ST(1)); + bool toggle = (bool)SvTRUE(ST(1)); if (sv_derived_from(ST(0), "NPC")) { IV tmp = SvIV((SV*)SvRV(ST(0))); @@ -1048,7 +1048,7 @@ XS(XS_NPC_SetTaunting) if(THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - THIS->SetTaunting(tog); + THIS->SetTaunting(toggle); } XSRETURN_EMPTY; } @@ -1058,7 +1058,7 @@ XS(XS_NPC_PickPocket) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::PickPocket(THIS, thief)"); + Perl_croak(aTHX_ "Usage: NPC::PickPocket(THIS, Client* thief)"); { NPC * THIS; Client* thief; @@ -1091,7 +1091,7 @@ XS(XS_NPC_StartSwarmTimer) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::StartSwarmTimer(THIS, duration)"); + Perl_croak(aTHX_ "Usage: NPC::StartSwarmTimer(THIS, uint32 duration)"); { NPC * THIS; uint32 duration = (uint32)SvUV(ST(1)); @@ -1115,7 +1115,7 @@ XS(XS_NPC_DoClassAttacks) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::DoClassAttacks(THIS, target)"); + Perl_croak(aTHX_ "Usage: NPC::DoClassAttacks(THIS, Mob* target)"); { NPC * THIS; Mob * target; @@ -1174,7 +1174,7 @@ XS(XS_NPC_DisplayWaypointInfo) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::DisplayWaypointInfo(THIS, to)"); + Perl_croak(aTHX_ "Usage: NPC::DisplayWaypointInfo(THIS, Client* target)"); { NPC * THIS; Client * to; @@ -1230,7 +1230,7 @@ XS(XS_NPC_AssignWaypoints) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::AssignWaypoints(THIS, grid)"); + Perl_croak(aTHX_ "Usage: NPC::AssignWaypoints(THIS, uint32 grid_id)"); { NPC * THIS; uint32 grid = (uint32)SvUV(ST(1)); @@ -1277,7 +1277,7 @@ XS(XS_NPC_UpdateWaypoint) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::UpdateWaypoint(THIS, wp_index)"); + Perl_croak(aTHX_ "Usage: NPC::UpdateWaypoint(THIS, int wp_index)"); { NPC * THIS; int wp_index = (int)SvIV(ST(1)); @@ -1347,7 +1347,7 @@ XS(XS_NPC_PauseWandering) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::PauseWandering(THIS, pausetime)"); + Perl_croak(aTHX_ "Usage: NPC::PauseWandering(THIS, int pause_time)"); { NPC * THIS; int pausetime = (int)SvIV(ST(1)); @@ -1371,7 +1371,7 @@ XS(XS_NPC_MoveTo) { dXSARGS; if (items != 4 && items != 5 && items != 6) - Perl_croak(aTHX_ "Usage: NPC::MoveTo(THIS, mtx, mty, mtz, [mth, saveguard?])"); + Perl_croak(aTHX_ "Usage: NPC::MoveTo(THIS, float x, float y, float z, [float heading], [bool save_guard_location = false])"); { NPC * THIS; float mtx = (float)SvNV(ST(1)); @@ -1433,7 +1433,7 @@ XS(XS_NPC_SaveGuardSpot) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: NPC::SaveGuardSpot(THIS, iClearGuardSpot= false)"); + Perl_croak(aTHX_ "Usage: NPC::SaveGuardSpot(THIS, [bool clear_guard_spot = false])"); { NPC * THIS; bool iClearGuardSpot; @@ -1489,7 +1489,7 @@ XS(XS_NPC_AI_SetRoambox) { dXSARGS; if (items < 6 || items > 8) - Perl_croak(aTHX_ "Usage: NPC::AI_SetRoambox(THIS, iDist, iMaxX, iMinX, iMaxY, iMinY, iDelay= 2500, iMinDelay= 2500)"); + Perl_croak(aTHX_ "Usage: NPC::AI_SetRoambox(THIS, float distance, float max_x, float min_x, float max_y, float min_y, [uint32 max_delay = 2500], [uint32 min_delay = 2500])"); { NPC * THIS; float iDist = (float)SvNV(ST(1)); @@ -1773,7 +1773,7 @@ XS(XS_NPC_SetPrimSkill) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::SetPrimSkill(THIS, skill_id)"); + Perl_croak(aTHX_ "Usage: NPC::SetPrimSkill(THIS, int skill_id)"); { NPC * THIS; int skill_id = (int)SvIV(ST(1)); @@ -1797,7 +1797,7 @@ XS(XS_NPC_SetSecSkill) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::SetSecSkill(THIS, skill_id)"); + Perl_croak(aTHX_ "Usage: NPC::SetSecSkill(THIS, int skill_id)"); { NPC * THIS; int skill_id = (int)SvIV(ST(1)); @@ -1925,7 +1925,7 @@ XS(XS_NPC_SetSwarmTarget) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::SetSwarmTarget(THIS, target_id)"); + Perl_croak(aTHX_ "Usage: NPC::SetSwarmTarget(THIS, int target_id)"); { NPC * THIS; int target_id = (int)SvIV(ST(1)); @@ -1949,7 +1949,7 @@ XS(XS_NPC_ModifyNPCStat) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: NPC::ModifyNPCStat(THIS, identifier, newValue)"); + Perl_croak(aTHX_ "Usage: NPC::ModifyNPCStat(THIS, string key, string value)"); { NPC * THIS; Const_char * identifier = (Const_char *)SvPV_nolen(ST(1)); @@ -1974,7 +1974,7 @@ XS(XS_NPC_AddSpellToNPCList) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ "Usage: NPC::AddAISpell(THIS, priority, spell_id, type, mana_cost, recast_delay, resist_adjust)"); + Perl_croak(aTHX_ "Usage: NPC::AddAISpell(THIS, int priority, int spell_id, int type, int mana_cost, int recast_delay, int resist_adjust)"); { NPC * THIS; int priority = (int)SvIV(ST(1)); @@ -2003,7 +2003,7 @@ XS(XS_NPC_RemoveSpellFromNPCList) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::RemoveAISpell(THIS, spell_id)"); + Perl_croak(aTHX_ "Usage: NPC::RemoveAISpell(THIS, int spell_id)"); { NPC * THIS; int spell_id = (int)SvIV(ST(1)); @@ -2027,7 +2027,7 @@ XS(XS_NPC_SetSpellFocusDMG) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::SetSpellFocusDMG(THIS, NewSpellFocusDMG)"); + Perl_croak(aTHX_ "Usage: NPC::SetSpellFocusDMG(THIS, int new_spell_focus_dmg)"); { NPC * THIS; int32 NewSpellFocusDMG = (int32)SvIV(ST(1)); @@ -2077,7 +2077,7 @@ XS(XS_NPC_SetSpellFocusHeal) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::SetSpellFocusHeal(THIS, NewSpellFocusHeal)"); + Perl_croak(aTHX_ "Usage: NPC::SetSpellFocusHeal(THIS, int32 new_spell_focus_heal)"); { NPC * THIS; int32 NewSpellFocusHeal = (int32)SvIV(ST(1)); @@ -2308,7 +2308,7 @@ XS(XS_NPC_AddMeleeProc); XS(XS_NPC_AddMeleeProc) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: NPC::AddMeleeProc(THIS,spellid,chance)"); + Perl_croak(aTHX_ "Usage: NPC::AddMeleeProc(THIS, int spell_id, int chance)"); { NPC * THIS; int spell_id = (int)SvIV(ST(1)); @@ -2333,7 +2333,7 @@ XS(XS_NPC_AddRangedProc); XS(XS_NPC_AddRangedProc) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: NPC::AddRangedProc(THIS,spellid,chance)"); + Perl_croak(aTHX_ "Usage: NPC::AddRangedProc(THIS, int spell_id, int chance)"); { NPC * THIS; int spell_id = (int)SvIV(ST(1)); @@ -2358,7 +2358,7 @@ XS(XS_NPC_AddDefensiveProc); XS(XS_NPC_AddDefensiveProc) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: NPC::AddDefensiveProc(THIS,spellid,chance)"); + Perl_croak(aTHX_ "Usage: NPC::AddDefensiveProc(THIS, int spell_id, int chance)"); { NPC * THIS; int spell_id = (int)SvIV(ST(1)); @@ -2383,7 +2383,7 @@ XS(XS_NPC_RemoveMeleeProc); XS(XS_NPC_RemoveMeleeProc) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::RemoveMeleeProc(THIS,spellid)"); + Perl_croak(aTHX_ "Usage: NPC::RemoveMeleeProc(THIS, int spell_id)"); { NPC * THIS; int spell_id = (int)SvIV(ST(1)); @@ -2407,7 +2407,7 @@ XS(XS_NPC_RemoveRangedProc); XS(XS_NPC_RemoveRangedProc) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::RemoveRangedProc(THIS,spellid)"); + Perl_croak(aTHX_ "Usage: NPC::RemoveRangedProc(THIS, int spell_id)"); { NPC * THIS; int spell_id = (int)SvIV(ST(1)); @@ -2431,7 +2431,7 @@ XS(XS_NPC_RemoveDefensiveProc); XS(XS_NPC_RemoveDefensiveProc) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: NPC::RemoveDefensiveProc(THIS,spellid)"); + Perl_croak(aTHX_ "Usage: NPC::RemoveDefensiveProc(THIS, int spell_id)"); { NPC * THIS; int spell_id = (int)SvIV(ST(1)); @@ -2456,7 +2456,7 @@ XS(XS_NPC_ChangeLastName) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: Mob::ChangeLastName(THIS, name)"); + Perl_croak(aTHX_ "Usage: NPC::ChangeLastName(THIS, string name)"); { NPC * THIS; char * name = nullptr; @@ -2482,7 +2482,7 @@ XS(XS_NPC_ClearLastName) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: Mob::ClearLastName(THIS)"); + Perl_croak(aTHX_ "Usage: NPC::ClearLastName(THIS)"); { NPC * THIS; From d079feeb66d95728767f00e437ced7345c56b48b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 20:20:40 -0500 Subject: [PATCH 22/33] perl_npc.cpp formatting --- zone/perl_npc.cpp | 1969 +++++++++++++++++++++------------------------ 1 file changed, 911 insertions(+), 1058 deletions(-) diff --git a/zone/perl_npc.cpp b/zone/perl_npc.cpp index acff193e6..1eaddf3a2 100644 --- a/zone/perl_npc.cpp +++ b/zone/perl_npc.cpp @@ -26,7 +26,9 @@ */ #include "../common/features.h" + #ifdef EMBPERL_XS_CLASSES + #include "../common/global_define.h" #include "embperl.h" @@ -44,22 +46,20 @@ typedef const char Const_char; XS(XS_NPC_SignalNPC); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_SignalNPC) -{ +XS(XS_NPC_SignalNPC) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::SignalNPC(THIS, int signal_id)"); { - NPC * THIS; - int _signal_id = (int)SvIV(ST(1)); + NPC *THIS; + int _signal_id = (int) SvIV(ST(1)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SignalNPC(_signal_id); @@ -68,75 +68,73 @@ XS(XS_NPC_SignalNPC) } XS(XS_NPC_CheckNPCFactionAlly); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_CheckNPCFactionAlly) -{ +XS(XS_NPC_CheckNPCFactionAlly) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::CheckNPCFactionAlly(THIS, int32 faction_id)"); { - NPC * THIS; - FACTION_VALUE RETVAL; + NPC *THIS; + FACTION_VALUE RETVAL; dXSTARG; - int32 other_faction = (int32)SvIV(ST(1)); + int32 other_faction = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CheckNPCFactionAlly(other_faction); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_NPC_AddItem); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_AddItem) -{ +XS(XS_NPC_AddItem) { dXSARGS; if (items < 2 || items > 10) - Perl_croak(aTHX_ "Usage: NPC::AddItem(THIS, uint32 item_id, [uint16 charges = 0], [bool equip_item = true], [uint32 aug1 = 0], [uint32 aug2 = 0], [uint32 aug3 = 0], [uint32 aug4 = 0], [uint32 aug5 = 0], [uint32 aug6 = 0])"); + Perl_croak(aTHX_ + "Usage: NPC::AddItem(THIS, uint32 item_id, [uint16 charges = 0], [bool equip_item = true], [uint32 aug1 = 0], [uint32 aug2 = 0], [uint32 aug3 = 0], [uint32 aug4 = 0], [uint32 aug5 = 0], [uint32 aug6 = 0])"); { - NPC * THIS; - uint32 itemid = (uint32)SvUV(ST(1)); - uint16 charges = 0; - bool equipitem = true; - uint32 aug1 = 0; - uint32 aug2 = 0; - uint32 aug3 = 0; - uint32 aug4 = 0; - uint32 aug5 = 0; - uint32 aug6 = 0; + NPC *THIS; + uint32 itemid = (uint32) SvUV(ST(1)); + uint16 charges = 0; + bool equipitem = true; + uint32 aug1 = 0; + uint32 aug2 = 0; + uint32 aug3 = 0; + uint32 aug4 = 0; + uint32 aug5 = 0; + uint32 aug6 = 0; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 2) - charges = (uint16)SvUV(ST(2)); + charges = (uint16) SvUV(ST(2)); if (items > 3) - equipitem = (bool)SvTRUE(ST(3)); + equipitem = (bool) SvTRUE(ST(3)); if (items > 4) - aug1 = (uint32)SvUV(ST(4)); + aug1 = (uint32) SvUV(ST(4)); if (items > 5) - aug2 = (uint32)SvUV(ST(5)); + aug2 = (uint32) SvUV(ST(5)); if (items > 6) - aug3 = (uint32)SvUV(ST(6)); + aug3 = (uint32) SvUV(ST(6)); if (items > 7) - aug4 = (uint32)SvUV(ST(7)); + aug4 = (uint32) SvUV(ST(7)); if (items > 8) - aug5 = (uint32)SvUV(ST(8)); + aug5 = (uint32) SvUV(ST(8)); if (items > 9) - aug6 = (uint32)SvUV(ST(9)); + aug6 = (uint32) SvUV(ST(9)); THIS->AddItem(itemid, charges, equipitem, aug1, aug2, aug3, aug4, aug5, aug6); } @@ -144,32 +142,27 @@ XS(XS_NPC_AddItem) } XS(XS_NPC_AddLootTable); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_AddLootTable) -{ +XS(XS_NPC_AddLootTable) { dXSARGS; if (items < 1) Perl_croak(aTHX_ "Usage: NPC::AddLootTable(THIS, [uint32 loottable_id])"); { - NPC * THIS; + NPC *THIS; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); uint32 loottable_id = 0; - if(items > 1) - { - loottable_id = (uint32)SvUV(ST(1)); + if (items > 1) { + loottable_id = (uint32) SvUV(ST(1)); THIS->AddLootTable(loottable_id); - } - else - { + } else { THIS->AddLootTable(); } } @@ -177,36 +170,34 @@ XS(XS_NPC_AddLootTable) } XS(XS_NPC_RemoveItem); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_RemoveItem) -{ +XS(XS_NPC_RemoveItem) { dXSARGS; if (items < 2 || items > 4) Perl_croak(aTHX_ "Usage: NPC::RemoveItem(THIS, uint32 item_id, [uint16 quantity = 0], [uint16 slot_id = 0])"); { - NPC * THIS; - uint32 item_id = (uint32)SvUV(ST(1)); - uint16 quantity; - uint16 slot; + NPC *THIS; + uint32 item_id = (uint32) SvUV(ST(1)); + uint16 quantity; + uint16 slot; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) quantity = 0; else { - quantity = (uint16)SvUV(ST(2)); + quantity = (uint16) SvUV(ST(2)); } if (items < 4) slot = 0; else { - slot = (uint16)SvUV(ST(3)); + slot = (uint16) SvUV(ST(3)); } THIS->RemoveItem(item_id, quantity, slot); @@ -215,21 +206,19 @@ XS(XS_NPC_RemoveItem) } XS(XS_NPC_ClearItemList); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_ClearItemList) -{ +XS(XS_NPC_ClearItemList) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::ClearItemList(THIS)"); { - NPC * THIS; + NPC *THIS; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ClearItemList(); @@ -238,25 +227,23 @@ XS(XS_NPC_ClearItemList) } XS(XS_NPC_AddCash); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_AddCash) -{ +XS(XS_NPC_AddCash) { dXSARGS; if (items != 5) Perl_croak(aTHX_ "Usage: NPC::AddCash(THIS, uint16 copper, uint16 silver, uint16 gold, uint16 platinum)"); { - NPC * THIS; - uint16 in_copper = (uint16)SvUV(ST(1)); - uint16 in_silver = (uint16)SvUV(ST(2)); - uint16 in_gold = (uint16)SvUV(ST(3)); - uint16 in_platinum = (uint16)SvUV(ST(4)); + NPC *THIS; + uint16 in_copper = (uint16) SvUV(ST(1)); + uint16 in_silver = (uint16) SvUV(ST(2)); + uint16 in_gold = (uint16) SvUV(ST(3)); + uint16 in_platinum = (uint16) SvUV(ST(4)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->AddCash(in_copper, in_silver, in_gold, in_platinum); @@ -265,21 +252,19 @@ XS(XS_NPC_AddCash) } XS(XS_NPC_RemoveCash); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_RemoveCash) -{ +XS(XS_NPC_RemoveCash) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::RemoveCash(THIS)"); { - NPC * THIS; + NPC *THIS; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveCash(); @@ -288,178 +273,170 @@ XS(XS_NPC_RemoveCash) } XS(XS_NPC_CountLoot); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_CountLoot) -{ +XS(XS_NPC_CountLoot) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::CountLoot(THIS)"); { - NPC * THIS; - uint32 RETVAL; + NPC *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CountLoot(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetLoottableID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetLoottableID) -{ +XS(XS_NPC_GetLoottableID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetLoottableID(THIS)"); { - NPC * THIS; - uint32 RETVAL; + NPC *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLoottableID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetCopper); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetCopper) -{ +XS(XS_NPC_GetCopper) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetCopper(THIS)"); { - NPC * THIS; - uint32 RETVAL; + NPC *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCopper(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetSilver); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetSilver) -{ +XS(XS_NPC_GetSilver) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetSilver(THIS)"); { - NPC * THIS; - uint32 RETVAL; + NPC *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSilver(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetGold); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetGold) -{ +XS(XS_NPC_GetGold) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetGold(THIS)"); { - NPC * THIS; - uint32 RETVAL; + NPC *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGold(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetPlatinum); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetPlatinum) -{ +XS(XS_NPC_GetPlatinum) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetPlatinum(THIS)"); { - NPC * THIS; - uint32 RETVAL; + NPC *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPlatinum(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_NPC_SetCopper); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_SetCopper) -{ +XS(XS_NPC_SetCopper) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::SetCopper(THIS, uint32 copper_amount)"); { - NPC * THIS; - uint32 amt = (uint32)SvUV(ST(1)); + NPC *THIS; + uint32 amt = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetCopper(amt); @@ -468,22 +445,20 @@ XS(XS_NPC_SetCopper) } XS(XS_NPC_SetSilver); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_SetSilver) -{ +XS(XS_NPC_SetSilver) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::SetSilver(THIS, uint32 silver_amount)"); { - NPC * THIS; - uint32 amt = (uint32)SvUV(ST(1)); + NPC *THIS; + uint32 amt = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSilver(amt); @@ -492,22 +467,20 @@ XS(XS_NPC_SetSilver) } XS(XS_NPC_SetGold); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_SetGold) -{ +XS(XS_NPC_SetGold) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::SetGold(THIS, uint32 gold_amount)"); { - NPC * THIS; - uint32 amt = (uint32)SvUV(ST(1)); + NPC *THIS; + uint32 amt = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetGold(amt); @@ -516,22 +489,20 @@ XS(XS_NPC_SetGold) } XS(XS_NPC_SetPlatinum); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_SetPlatinum) -{ +XS(XS_NPC_SetPlatinum) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::SetPlatinum(THIS, uint32 platinum_amount)"); { - NPC * THIS; - uint32 amt = (uint32)SvUV(ST(1)); + NPC *THIS; + uint32 amt = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetPlatinum(amt); @@ -540,22 +511,20 @@ XS(XS_NPC_SetPlatinum) } XS(XS_NPC_SetGrid); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_SetGrid) -{ +XS(XS_NPC_SetGrid) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::SetGrid(THIS, int32 grid_id)"); { - NPC * THIS; - int32 grid_ = (int32)SvIV(ST(1)); + NPC *THIS; + int32 grid_ = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetGrid(grid_); @@ -564,22 +533,20 @@ XS(XS_NPC_SetGrid) } XS(XS_NPC_SetSaveWaypoint); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_SetSaveWaypoint) -{ +XS(XS_NPC_SetSaveWaypoint) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::SetSaveWaypoint(THIS, uint16 waypoint)"); { - NPC * THIS; - uint16 waypoint = (uint16)SvUV(ST(1)); + NPC *THIS; + uint16 waypoint = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSaveWaypoint(waypoint); @@ -588,22 +555,20 @@ XS(XS_NPC_SetSaveWaypoint) } XS(XS_NPC_SetSp2); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_SetSp2) -{ +XS(XS_NPC_SetSp2) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::SetSp2(THIS, uint32 set_spawn_group_id)"); { - NPC * THIS; - uint32 sg2 = (uint32)SvUV(ST(1)); + NPC *THIS; + uint32 sg2 = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSp2(sg2); @@ -612,198 +577,188 @@ XS(XS_NPC_SetSp2) } XS(XS_NPC_GetWaypointMax); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetWaypointMax) -{ +XS(XS_NPC_GetWaypointMax) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetWaypointMax(THIS)"); { - NPC * THIS; - uint16 RETVAL; + NPC *THIS; + uint16 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetWaypointMax(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetGrid); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetGrid) -{ +XS(XS_NPC_GetGrid) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetGrid(THIS)"); { - NPC * THIS; - int32 RETVAL; + NPC *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGrid(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetSp2); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetSp2) -{ +XS(XS_NPC_GetSp2) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetSp2(THIS)"); { - NPC * THIS; - uint32 RETVAL; + NPC *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSp2(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetNPCFactionID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetNPCFactionID) -{ +XS(XS_NPC_GetNPCFactionID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetNPCFactionID(THIS)"); { - NPC * THIS; - int32 RETVAL; + NPC *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetNPCFactionID(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetPrimaryFaction); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetPrimaryFaction) -{ +XS(XS_NPC_GetPrimaryFaction) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetPrimaryFaction(THIS)"); { - NPC * THIS; - int32 RETVAL; + NPC *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPrimaryFaction(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetNPCHate); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetNPCHate) -{ +XS(XS_NPC_GetNPCHate) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::GetNPCHate(THIS, Mob* entity)"); { - NPC * THIS; - int32 RETVAL; + NPC *THIS; + int32 RETVAL; dXSTARG; - Mob* in_ent; + Mob *in_ent; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - in_ent = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + in_ent = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "in_ent is not of type Mob"); - if(in_ent == nullptr) + if (in_ent == nullptr) Perl_croak(aTHX_ "in_ent is nullptr, avoiding crash."); RETVAL = THIS->GetNPCHate(in_ent); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_NPC_IsOnHatelist); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_IsOnHatelist) -{ +XS(XS_NPC_IsOnHatelist) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::IsOnHatelist(THIS, Mob* target)"); { - NPC * THIS; - bool RETVAL; - Mob* p; + NPC *THIS; + bool RETVAL; + Mob *p; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - p = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + p = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "p is not of type Mob"); - if(p == nullptr) + if (p == nullptr) Perl_croak(aTHX_ "p is nullptr, avoiding crash."); RETVAL = THIS->IsOnHatelist(p); @@ -814,31 +769,28 @@ XS(XS_NPC_IsOnHatelist) } XS(XS_NPC_RemoveFromHateList); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_RemoveFromHateList) -{ +XS(XS_NPC_RemoveFromHateList) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::RemoveFromHateList(THIS, Mob* target)"); { - NPC * THIS; - Mob* ent; + NPC *THIS; + Mob *ent; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - ent = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + ent = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "ent is not of type Mob"); - if(ent == nullptr) + if (ent == nullptr) Perl_croak(aTHX_ "ent is nullptr, avoiding crash."); THIS->RemoveFromHateList(ent); @@ -848,24 +800,21 @@ XS(XS_NPC_RemoveFromHateList) } - XS(XS_NPC_SetNPCFactionID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_SetNPCFactionID) -{ +XS(XS_NPC_SetNPCFactionID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::SetNPCFactionID(THIS, int32 faction_id)"); { - NPC * THIS; - int32 in = (int32)SvIV(ST(1)); + NPC *THIS; + int32 in = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetNPCFactionID(in); @@ -874,75 +823,71 @@ XS(XS_NPC_SetNPCFactionID) } XS(XS_NPC_GetMaxDMG); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetMaxDMG) -{ +XS(XS_NPC_GetMaxDMG) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetMaxDMG(THIS)"); { - NPC * THIS; - uint32 RETVAL; + NPC *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxDMG(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetMinDMG); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetMinDMG) -{ +XS(XS_NPC_GetMinDMG) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetMinDMG(THIS)"); { - NPC * THIS; - uint32 RETVAL; + NPC *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMinDMG(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_NPC_IsAnimal); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_IsAnimal) -{ +XS(XS_NPC_IsAnimal) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::IsAnimal(THIS)"); { - NPC * THIS; - bool RETVAL; + NPC *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsAnimal(); @@ -953,48 +898,45 @@ XS(XS_NPC_IsAnimal) } XS(XS_NPC_GetPetSpellID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetPetSpellID) -{ +XS(XS_NPC_GetPetSpellID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetPetSpellID(THIS)"); { - NPC * THIS; - uint16 RETVAL; + NPC *THIS; + uint16 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPetSpellID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_NPC_SetPetSpellID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_SetPetSpellID) -{ +XS(XS_NPC_SetPetSpellID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::SetPetSpellID(THIS, uint16 amount)"); { - NPC * THIS; - uint16 amt = (uint16)SvUV(ST(1)); + NPC *THIS; + uint16 amt = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetPetSpellID(amt); @@ -1003,49 +945,46 @@ XS(XS_NPC_SetPetSpellID) } XS(XS_NPC_GetMaxDamage); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetMaxDamage) -{ +XS(XS_NPC_GetMaxDamage) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::GetMaxDamage(THIS, uint8 target_level)"); { - NPC * THIS; - uint32 RETVAL; + NPC *THIS; + uint32 RETVAL; dXSTARG; - uint8 tlevel = (uint8)SvUV(ST(1)); + uint8 tlevel = (uint8) SvUV(ST(1)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxDamage(tlevel); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_NPC_SetTaunting); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_SetTaunting) -{ +XS(XS_NPC_SetTaunting) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::SetTaunting(THIS, bool toggle)"); { - NPC * THIS; - bool toggle = (bool)SvTRUE(ST(1)); + NPC *THIS; + bool toggle = (bool) SvTRUE(ST(1)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetTaunting(toggle); @@ -1054,31 +993,28 @@ XS(XS_NPC_SetTaunting) } XS(XS_NPC_PickPocket); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_PickPocket) -{ +XS(XS_NPC_PickPocket) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::PickPocket(THIS, Client* thief)"); { - NPC * THIS; - Client* thief; + NPC *THIS; + Client *thief; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - thief = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + thief = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "thief is not of type Client"); - if(thief == nullptr) + if (thief == nullptr) Perl_croak(aTHX_ "thief is nullptr, avoiding crash."); THIS->PickPocket(thief); @@ -1087,22 +1023,20 @@ XS(XS_NPC_PickPocket) } XS(XS_NPC_StartSwarmTimer); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_StartSwarmTimer) -{ +XS(XS_NPC_StartSwarmTimer) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::StartSwarmTimer(THIS, uint32 duration)"); { - NPC * THIS; - uint32 duration = (uint32)SvUV(ST(1)); + NPC *THIS; + uint32 duration = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->StartSwarmTimer(duration); @@ -1111,31 +1045,28 @@ XS(XS_NPC_StartSwarmTimer) } XS(XS_NPC_DoClassAttacks); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_DoClassAttacks) -{ +XS(XS_NPC_DoClassAttacks) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::DoClassAttacks(THIS, Mob* target)"); { - NPC * THIS; - Mob * target; + NPC *THIS; + Mob *target; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - target = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + target = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "target is not of type Mob"); - if(target == nullptr) + if (target == nullptr) Perl_croak(aTHX_ "target is nullptr, avoiding crash."); THIS->DoClassAttacks(target); @@ -1144,57 +1075,53 @@ XS(XS_NPC_DoClassAttacks) } XS(XS_NPC_GetMaxWp); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetMaxWp) -{ +XS(XS_NPC_GetMaxWp) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetMaxWp(THIS)"); { - NPC * THIS; - int RETVAL; + NPC *THIS; + int RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxWp(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_NPC_DisplayWaypointInfo); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_DisplayWaypointInfo) -{ +XS(XS_NPC_DisplayWaypointInfo) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::DisplayWaypointInfo(THIS, Client* target)"); { - NPC * THIS; - Client * to; + NPC *THIS; + Client *to; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Client")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - to = INT2PTR(Client *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + to = INT2PTR(Client *, tmp); + } else Perl_croak(aTHX_ "to is not of type Client"); - if(to == nullptr) + if (to == nullptr) Perl_croak(aTHX_ "to is nullptr, avoiding crash."); THIS->DisplayWaypointInfo(to); @@ -1203,21 +1130,19 @@ XS(XS_NPC_DisplayWaypointInfo) } XS(XS_NPC_CalculateNewWaypoint); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_CalculateNewWaypoint) -{ +XS(XS_NPC_CalculateNewWaypoint) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::CalculateNewWaypoint(THIS)"); { - NPC * THIS; + NPC *THIS; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->CalculateNewWaypoint(); @@ -1226,22 +1151,20 @@ XS(XS_NPC_CalculateNewWaypoint) } XS(XS_NPC_AssignWaypoints); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_AssignWaypoints) -{ +XS(XS_NPC_AssignWaypoints) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::AssignWaypoints(THIS, uint32 grid_id)"); { - NPC * THIS; - uint32 grid = (uint32)SvUV(ST(1)); + NPC *THIS; + uint32 grid = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->AssignWaypoints(grid); @@ -1250,21 +1173,19 @@ XS(XS_NPC_AssignWaypoints) } XS(XS_NPC_SetWaypointPause); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_SetWaypointPause) -{ +XS(XS_NPC_SetWaypointPause) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::SetWaypointPause(THIS)"); { - NPC * THIS; + NPC *THIS; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetWaypointPause(); @@ -1273,22 +1194,20 @@ XS(XS_NPC_SetWaypointPause) } XS(XS_NPC_UpdateWaypoint); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_UpdateWaypoint) -{ +XS(XS_NPC_UpdateWaypoint) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::UpdateWaypoint(THIS, int wp_index)"); { - NPC * THIS; - int wp_index = (int)SvIV(ST(1)); + NPC *THIS; + int wp_index = (int) SvIV(ST(1)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->UpdateWaypoint(wp_index); @@ -1297,21 +1216,19 @@ XS(XS_NPC_UpdateWaypoint) } XS(XS_NPC_StopWandering); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_StopWandering) -{ +XS(XS_NPC_StopWandering) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::StopWandering(THIS)"); { - NPC * THIS; + NPC *THIS; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->StopWandering(); @@ -1320,21 +1237,19 @@ XS(XS_NPC_StopWandering) } XS(XS_NPC_ResumeWandering); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_ResumeWandering) -{ +XS(XS_NPC_ResumeWandering) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::ResumeWandering(THIS)"); { - NPC * THIS; + NPC *THIS; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ResumeWandering(); @@ -1343,22 +1258,20 @@ XS(XS_NPC_ResumeWandering) } XS(XS_NPC_PauseWandering); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_PauseWandering) -{ +XS(XS_NPC_PauseWandering) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::PauseWandering(THIS, int pause_time)"); { - NPC * THIS; - int pausetime = (int)SvIV(ST(1)); + NPC *THIS; + int pausetime = (int) SvIV(ST(1)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->PauseWandering(pausetime); @@ -1367,60 +1280,57 @@ XS(XS_NPC_PauseWandering) } XS(XS_NPC_MoveTo); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_MoveTo) -{ +XS(XS_NPC_MoveTo) { dXSARGS; if (items != 4 && items != 5 && items != 6) - Perl_croak(aTHX_ "Usage: NPC::MoveTo(THIS, float x, float y, float z, [float heading], [bool save_guard_location = false])"); + Perl_croak(aTHX_ + "Usage: NPC::MoveTo(THIS, float x, float y, float z, [float heading], [bool save_guard_location = false])"); { - NPC * THIS; - float mtx = (float)SvNV(ST(1)); - float mty = (float)SvNV(ST(2)); - float mtz = (float)SvNV(ST(3)); - float mth; - bool saveguard; + NPC *THIS; + float mtx = (float) SvNV(ST(1)); + float mty = (float) SvNV(ST(2)); + float mtz = (float) SvNV(ST(3)); + float mth; + bool saveguard; - if(items > 4) - mth = (float)SvNV(ST(4)); + if (items > 4) + mth = (float) SvNV(ST(4)); else mth = 0; - if(items > 5) - saveguard = (bool)SvTRUE(ST(5)); + if (items > 5) + saveguard = (bool) SvTRUE(ST(5)); else saveguard = false; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - auto position = glm::vec4(mtx, mty, mtz, mth); + auto position = glm::vec4(mtx, mty, mtz, mth); THIS->MoveTo(position, saveguard); } XSRETURN_EMPTY; } XS(XS_NPC_NextGuardPosition); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_NextGuardPosition) -{ +XS(XS_NPC_NextGuardPosition) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::NextGuardPosition(THIS)"); { - NPC * THIS; + NPC *THIS; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->NextGuardPosition(); @@ -1429,28 +1339,26 @@ XS(XS_NPC_NextGuardPosition) } XS(XS_NPC_SaveGuardSpot); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_SaveGuardSpot) -{ +XS(XS_NPC_SaveGuardSpot) { dXSARGS; if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: NPC::SaveGuardSpot(THIS, [bool clear_guard_spot = false])"); { - NPC * THIS; - bool iClearGuardSpot; + NPC *THIS; + bool iClearGuardSpot; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) iClearGuardSpot = false; else { - iClearGuardSpot = (bool)SvTRUE(ST(1)); + iClearGuardSpot = (bool) SvTRUE(ST(1)); } THIS->SaveGuardSpot(iClearGuardSpot); @@ -1459,22 +1367,20 @@ XS(XS_NPC_SaveGuardSpot) } XS(XS_NPC_IsGuarding); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_IsGuarding) -{ +XS(XS_NPC_IsGuarding) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::IsGuarding(THIS)"); { - NPC * THIS; - bool RETVAL; + NPC *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsGuarding(); @@ -1485,41 +1391,38 @@ XS(XS_NPC_IsGuarding) } XS(XS_NPC_AI_SetRoambox); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_AI_SetRoambox) -{ +XS(XS_NPC_AI_SetRoambox) { dXSARGS; if (items < 6 || items > 8) - Perl_croak(aTHX_ "Usage: NPC::AI_SetRoambox(THIS, float distance, float max_x, float min_x, float max_y, float min_y, [uint32 max_delay = 2500], [uint32 min_delay = 2500])"); + Perl_croak(aTHX_ + "Usage: NPC::AI_SetRoambox(THIS, float distance, float max_x, float min_x, float max_y, float min_y, [uint32 max_delay = 2500], [uint32 min_delay = 2500])"); { - NPC * THIS; - float iDist = (float)SvNV(ST(1)); - float iMaxX = (float)SvNV(ST(2)); - float iMinX = (float)SvNV(ST(3)); - float iMaxY = (float)SvNV(ST(4)); - float iMinY = (float)SvNV(ST(5)); - uint32 iDelay; - uint32 iMinDelay; + NPC *THIS; + float iDist = (float) SvNV(ST(1)); + float iMaxX = (float) SvNV(ST(2)); + float iMinX = (float) SvNV(ST(3)); + float iMaxY = (float) SvNV(ST(4)); + float iMinY = (float) SvNV(ST(5)); + uint32 iDelay; + uint32 iMinDelay; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - if (items < 7){ + if (items < 7) { iMinDelay = 2500; - iDelay = 2500; - } - else if (items < 8){ + iDelay = 2500; + } else if (items < 8) { iMinDelay = 2500; - iDelay = (uint32)SvUV(ST(6)); - } - else { - iDelay = (uint32)SvUV(ST(6)); - iMinDelay = (uint32)SvUV(ST(7)); + iDelay = (uint32) SvUV(ST(6)); + } else { + iDelay = (uint32) SvUV(ST(6)); + iMinDelay = (uint32) SvUV(ST(7)); } THIS->AI_SetRoambox(iDist, iMaxX, iMinX, iMaxY, iMinY, iDelay, iMinDelay); @@ -1528,263 +1431,252 @@ XS(XS_NPC_AI_SetRoambox) } XS(XS_NPC_GetNPCSpellsID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetNPCSpellsID) -{ +XS(XS_NPC_GetNPCSpellsID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetNPCSpellsID(THIS)"); { - NPC * THIS; - uint32 RETVAL; + NPC *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetNPCSpellsID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetSpawnPointID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetSpawnPointID) -{ +XS(XS_NPC_GetSpawnPointID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetSpawnPointID(THIS)"); { - NPC * THIS; - uint32 RETVAL; + NPC *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSpawnPointID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetSpawnPointX); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetSpawnPointX) -{ +XS(XS_NPC_GetSpawnPointX) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetSpawnPointX(THIS)"); { - NPC * THIS; - float RETVAL; + NPC *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSpawnPoint().x; - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetSpawnPointY); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetSpawnPointY) -{ +XS(XS_NPC_GetSpawnPointY) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetSpawnPointY(THIS)"); { - NPC * THIS; - float RETVAL; + NPC *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSpawnPoint().y; - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetSpawnPointZ); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetSpawnPointZ) -{ +XS(XS_NPC_GetSpawnPointZ) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetSpawnPointZ(THIS)"); { - NPC * THIS; - float RETVAL; + NPC *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSpawnPoint().z; - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetSpawnPointH); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetSpawnPointH) -{ +XS(XS_NPC_GetSpawnPointH) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetSpawnPointH(THIS)"); { - NPC * THIS; - float RETVAL; + NPC *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSpawnPoint().w; - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetGuardPointX); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetGuardPointX) -{ +XS(XS_NPC_GetGuardPointX) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetGuardPointX(THIS)"); { - NPC * THIS; - float RETVAL; + NPC *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGuardPoint().x; - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetGuardPointY); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetGuardPointY) -{ +XS(XS_NPC_GetGuardPointY) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetGuardPointY(THIS)"); { - NPC * THIS; - float RETVAL; + NPC *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGuardPoint().y; - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetGuardPointZ); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetGuardPointZ) -{ +XS(XS_NPC_GetGuardPointZ) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetGuardPointZ(THIS)"); { - NPC * THIS; - float RETVAL; + NPC *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGuardPoint().z; - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_NPC_SetPrimSkill); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_SetPrimSkill) -{ +XS(XS_NPC_SetPrimSkill) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::SetPrimSkill(THIS, int skill_id)"); { - NPC * THIS; - int skill_id = (int)SvIV(ST(1)); + NPC *THIS; + int skill_id = (int) SvIV(ST(1)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetPrimSkill(skill_id); @@ -1793,22 +1685,20 @@ XS(XS_NPC_SetPrimSkill) } XS(XS_NPC_SetSecSkill); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_SetSecSkill) -{ +XS(XS_NPC_SetSecSkill) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::SetSecSkill(THIS, int skill_id)"); { - NPC * THIS; - int skill_id = (int)SvIV(ST(1)); + NPC *THIS; + int skill_id = (int) SvIV(ST(1)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSecSkill(skill_id); @@ -1817,126 +1707,120 @@ XS(XS_NPC_SetSecSkill) } XS(XS_NPC_GetPrimSkill); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetPrimSkill) -{ +XS(XS_NPC_GetPrimSkill) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetPrimSkill(THIS)"); { - NPC * THIS; - uint32 RETVAL; + NPC *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPrimSkill(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetSecSkill); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetSecSkill) -{ +XS(XS_NPC_GetSecSkill) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetSecSkill(THIS)"); { - NPC * THIS; - uint32 RETVAL; + NPC *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSecSkill(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetSwarmOwner); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetSwarmOwner) -{ +XS(XS_NPC_GetSwarmOwner) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetSwarmOwner(THIS)"); { - NPC * THIS; - uint32 RETVAL; + NPC *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSwarmOwner(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetSwarmTarget); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetSwarmTarget) -{ +XS(XS_NPC_GetSwarmTarget) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetSwarmTarget(THIS)"); { - NPC * THIS; - uint32 RETVAL; + NPC *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSwarmTarget(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_NPC_SetSwarmTarget); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_SetSwarmTarget) -{ +XS(XS_NPC_SetSwarmTarget) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::SetSwarmTarget(THIS, int target_id)"); { - NPC * THIS; - int target_id = (int)SvIV(ST(1)); + NPC *THIS; + int target_id = (int) SvIV(ST(1)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSwarmTarget(target_id); @@ -1945,23 +1829,21 @@ XS(XS_NPC_SetSwarmTarget) } XS(XS_NPC_ModifyNPCStat); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_ModifyNPCStat) -{ +XS(XS_NPC_ModifyNPCStat) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: NPC::ModifyNPCStat(THIS, string key, string value)"); { - NPC * THIS; - Const_char * identifier = (Const_char *)SvPV_nolen(ST(1)); - Const_char * newValue = (Const_char *)SvPV_nolen(ST(2)); + NPC *THIS; + Const_char *identifier = (Const_char *) SvPV_nolen(ST(1)); + Const_char *newValue = (Const_char *) SvPV_nolen(ST(2)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ModifyNPCStat(identifier, newValue); @@ -1970,27 +1852,26 @@ XS(XS_NPC_ModifyNPCStat) } XS(XS_NPC_AddSpellToNPCList); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_AddSpellToNPCList) -{ +XS(XS_NPC_AddSpellToNPCList) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ "Usage: NPC::AddAISpell(THIS, int priority, int spell_id, int type, int mana_cost, int recast_delay, int resist_adjust)"); + Perl_croak(aTHX_ + "Usage: NPC::AddAISpell(THIS, int priority, int spell_id, int type, int mana_cost, int recast_delay, int resist_adjust)"); { - NPC * THIS; - int priority = (int)SvIV(ST(1)); - int spell_id = (int)SvIV(ST(2)); - int type = (int)SvIV(ST(3)); - int mana_cost = (int)SvIV(ST(4)); - int recast_delay = (int)SvIV(ST(5)); - int resist_adjust = (int)SvIV(ST(6)); + NPC *THIS; + int priority = (int) SvIV(ST(1)); + int spell_id = (int) SvIV(ST(2)); + int type = (int) SvIV(ST(3)); + int mana_cost = (int) SvIV(ST(4)); + int recast_delay = (int) SvIV(ST(5)); + int resist_adjust = (int) SvIV(ST(6)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->AddSpellToNPCList(priority, spell_id, type, mana_cost, recast_delay, resist_adjust, 0, 0); @@ -1999,22 +1880,20 @@ XS(XS_NPC_AddSpellToNPCList) } XS(XS_NPC_RemoveSpellFromNPCList); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_RemoveSpellFromNPCList) -{ +XS(XS_NPC_RemoveSpellFromNPCList) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::RemoveAISpell(THIS, int spell_id)"); { - NPC * THIS; - int spell_id = (int)SvIV(ST(1)); + NPC *THIS; + int spell_id = (int) SvIV(ST(1)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveSpellFromNPCList(spell_id); @@ -2023,22 +1902,20 @@ XS(XS_NPC_RemoveSpellFromNPCList) } XS(XS_NPC_SetSpellFocusDMG); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_SetSpellFocusDMG) -{ +XS(XS_NPC_SetSpellFocusDMG) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::SetSpellFocusDMG(THIS, int new_spell_focus_dmg)"); { - NPC * THIS; - int32 NewSpellFocusDMG = (int32)SvIV(ST(1)); + NPC *THIS; + int32 NewSpellFocusDMG = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSpellFocusDMG(NewSpellFocusDMG); @@ -2047,48 +1924,45 @@ XS(XS_NPC_SetSpellFocusDMG) } XS(XS_NPC_GetSpellFocusDMG); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetSpellFocusDMG) -{ +XS(XS_NPC_GetSpellFocusDMG) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetSpellFocusDMG(THIS)"); { - NPC * THIS; - int32 RETVAL; + NPC *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSpellFocusDMG(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_NPC_SetSpellFocusHeal); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_SetSpellFocusHeal) -{ +XS(XS_NPC_SetSpellFocusHeal) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: NPC::SetSpellFocusHeal(THIS, int32 new_spell_focus_heal)"); { - NPC * THIS; - int32 NewSpellFocusHeal = (int32)SvIV(ST(1)); + NPC *THIS; + int32 NewSpellFocusHeal = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSpellFocusHeal(NewSpellFocusHeal); @@ -2097,209 +1971,201 @@ XS(XS_NPC_SetSpellFocusHeal) } XS(XS_NPC_GetSpellFocusHeal); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetSpellFocusHeal) -{ +XS(XS_NPC_GetSpellFocusHeal) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetSpellFocusHeal(THIS)"); { - NPC * THIS; - int32 RETVAL; + NPC *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSpellFocusHeal(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetSlowMitigation); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetSlowMitigation) -{ +XS(XS_NPC_GetSlowMitigation) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetSlowMitigation(THIS)"); { - NPC * THIS; - float RETVAL; + NPC *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSlowMitigation(); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetAttackSpeed); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetAttackSpeed) -{ +XS(XS_NPC_GetAttackSpeed) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetAttackSpeed(THIS)"); { - NPC * THIS; - float RETVAL; + NPC *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAttackSpeed(); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetAttackDelay); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetAttackDelay) -{ +XS(XS_NPC_GetAttackDelay) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetAttackDelay(THIS)"); { - NPC * THIS; - float RETVAL; + NPC *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAttackDelay(); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetAccuracyRating); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetAccuracyRating) -{ +XS(XS_NPC_GetAccuracyRating) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetAccuracyRating(THIS)"); { - NPC * THIS; - int32 RETVAL; + NPC *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAccuracyRating(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetAvoidanceRating); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetAvoidanceRating) -{ +XS(XS_NPC_GetAvoidanceRating) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetAvoidanceyRating(THIS)"); { - NPC * THIS; - int32 RETVAL; + NPC *THIS; + int32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAvoidanceRating(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetSpawnKillCount); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetSpawnKillCount) -{ +XS(XS_NPC_GetSpawnKillCount) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetSpawnKillCount(THIS)"); { - NPC * THIS; - uint32 RETVAL; + NPC *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) + if (THIS == NULL) Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); RETVAL = THIS->GetSpawnKillCount(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_NPC_GetScore); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetScore) -{ +XS(XS_NPC_GetScore) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetScore(THIS)"); { - NPC * THIS; - int RETVAL; + NPC *THIS; + int RETVAL; dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) + if (THIS == NULL) Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); RETVAL = THIS->GetScore(); - XSprePUSH; PUSHi((UV)RETVAL); + XSprePUSH; + PUSHi((UV) RETVAL); } XSRETURN(1); } @@ -2310,18 +2176,17 @@ XS(XS_NPC_AddMeleeProc) { if (items != 3) Perl_croak(aTHX_ "Usage: NPC::AddMeleeProc(THIS, int spell_id, int chance)"); { - NPC * THIS; - int spell_id = (int)SvIV(ST(1)); - int chance = (int)SvIV(ST(2)); + NPC *THIS; + int spell_id = (int) SvIV(ST(1)); + int chance = (int) SvIV(ST(2)); dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) + if (THIS == NULL) Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); THIS->AddProcToWeapon(spell_id, true, chance); @@ -2335,21 +2200,20 @@ XS(XS_NPC_AddRangedProc) { if (items != 3) Perl_croak(aTHX_ "Usage: NPC::AddRangedProc(THIS, int spell_id, int chance)"); { - NPC * THIS; - int spell_id = (int)SvIV(ST(1)); - int chance = (int)SvIV(ST(2)); + NPC *THIS; + int spell_id = (int) SvIV(ST(1)); + int chance = (int) SvIV(ST(2)); dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) + if (THIS == NULL) Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); - THIS->AddRangedProc(spell_id,chance); + THIS->AddRangedProc(spell_id, chance); } XSRETURN_EMPTY; } @@ -2360,21 +2224,20 @@ XS(XS_NPC_AddDefensiveProc) { if (items != 3) Perl_croak(aTHX_ "Usage: NPC::AddDefensiveProc(THIS, int spell_id, int chance)"); { - NPC * THIS; - int spell_id = (int)SvIV(ST(1)); - int chance = (int)SvIV(ST(2)); + NPC *THIS; + int spell_id = (int) SvIV(ST(1)); + int chance = (int) SvIV(ST(2)); dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) + if (THIS == NULL) Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); - THIS->AddDefensiveProc(spell_id,chance); + THIS->AddDefensiveProc(spell_id, chance); } XSRETURN_EMPTY; } @@ -2385,17 +2248,16 @@ XS(XS_NPC_RemoveMeleeProc) { if (items != 2) Perl_croak(aTHX_ "Usage: NPC::RemoveMeleeProc(THIS, int spell_id)"); { - NPC * THIS; - int spell_id = (int)SvIV(ST(1)); + NPC *THIS; + int spell_id = (int) SvIV(ST(1)); dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) + if (THIS == NULL) Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); THIS->RemoveProcFromWeapon(spell_id, false); @@ -2409,17 +2271,16 @@ XS(XS_NPC_RemoveRangedProc) { if (items != 2) Perl_croak(aTHX_ "Usage: NPC::RemoveRangedProc(THIS, int spell_id)"); { - NPC * THIS; - int spell_id = (int)SvIV(ST(1)); + NPC *THIS; + int spell_id = (int) SvIV(ST(1)); dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) + if (THIS == NULL) Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); THIS->RemoveRangedProc(spell_id, false); @@ -2433,17 +2294,16 @@ XS(XS_NPC_RemoveDefensiveProc) { if (items != 2) Perl_croak(aTHX_ "Usage: NPC::RemoveDefensiveProc(THIS, int spell_id)"); { - NPC * THIS; - int spell_id = (int)SvIV(ST(1)); + NPC *THIS; + int spell_id = (int) SvIV(ST(1)); dXSTARG; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) + if (THIS == NULL) Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); THIS->RemoveDefensiveProc(spell_id, false); @@ -2452,25 +2312,23 @@ XS(XS_NPC_RemoveDefensiveProc) { } XS(XS_NPC_ChangeLastName); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_ChangeLastName) -{ +XS(XS_NPC_ChangeLastName) { dXSARGS; if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: NPC::ChangeLastName(THIS, string name)"); { - NPC * THIS; - char * name = nullptr; + NPC *THIS; + char *name = nullptr; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - if (items > 1) { name = (char *)SvPV_nolen(ST(1)); } + if (items > 1) { name = (char *) SvPV_nolen(ST(1)); } THIS->ChangeLastName(name); } @@ -2478,21 +2336,19 @@ XS(XS_NPC_ChangeLastName) } XS(XS_NPC_ClearLastName); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_ClearLastName) -{ +XS(XS_NPC_ClearLastName) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::ClearLastName(THIS)"); { - NPC * THIS; + NPC *THIS; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ClearLastName(); @@ -2501,22 +2357,20 @@ XS(XS_NPC_ClearLastName) } XS(XS_NPC_GetCombatState); /* prototype to pass -Wmissing-prototypes */ -XS(XS_NPC_GetCombatState) -{ +XS(XS_NPC_GetCombatState) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: NPC::GetCombatState(THIS)"); { - NPC * THIS; - bool RETVAL; + NPC *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "NPC")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(NPC *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(NPC *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCombatEvent(); @@ -2530,114 +2384,113 @@ XS(XS_NPC_GetCombatState) extern "C" #endif XS(boot_NPC); /* prototype to pass -Wmissing-prototypes */ -XS(boot_NPC) -{ +XS(boot_NPC) { dXSARGS; char file[256]; strncpy(file, __FILE__, 256); file[255] = 0; - if(items != 1) + if (items != 1) fprintf(stderr, "boot_quest does not take any arguments."); char buf[128]; //add the strcpy stuff to get rid of const warnings.... - XS_VERSION_BOOTCHECK ; + XS_VERSION_BOOTCHECK; - newXSproto(strcpy(buf, "SignalNPC"), XS_NPC_SignalNPC, file, "$$"); - newXSproto(strcpy(buf, "CheckNPCFactionAlly"), XS_NPC_CheckNPCFactionAlly, file, "$$"); - newXSproto(strcpy(buf, "AddItem"), XS_NPC_AddItem, file, "$$;$$$$$$$$"); - newXSproto(strcpy(buf, "AddLootTable"), XS_NPC_AddLootTable, file, "$"); - newXSproto(strcpy(buf, "RemoveItem"), XS_NPC_RemoveItem, file, "$$;$$"); - newXSproto(strcpy(buf, "ClearItemList"), XS_NPC_ClearItemList, file, "$"); - newXSproto(strcpy(buf, "AddCash"), XS_NPC_AddCash, file, "$$$$$"); - newXSproto(strcpy(buf, "RemoveCash"), XS_NPC_RemoveCash, file, "$"); - newXSproto(strcpy(buf, "CountLoot"), XS_NPC_CountLoot, file, "$"); - newXSproto(strcpy(buf, "GetLoottableID"), XS_NPC_GetLoottableID, file, "$"); - newXSproto(strcpy(buf, "GetCopper"), XS_NPC_GetCopper, file, "$"); - newXSproto(strcpy(buf, "GetSilver"), XS_NPC_GetSilver, file, "$"); - newXSproto(strcpy(buf, "GetGold"), XS_NPC_GetGold, file, "$"); - newXSproto(strcpy(buf, "GetPlatinum"), XS_NPC_GetPlatinum, file, "$"); - newXSproto(strcpy(buf, "SetCopper"), XS_NPC_SetCopper, file, "$$"); - newXSproto(strcpy(buf, "SetSilver"), XS_NPC_SetSilver, file, "$$"); - newXSproto(strcpy(buf, "SetGold"), XS_NPC_SetGold, file, "$$"); - newXSproto(strcpy(buf, "SetPlatinum"), XS_NPC_SetPlatinum, file, "$$"); - newXSproto(strcpy(buf, "SetGrid"), XS_NPC_SetGrid, file, "$$"); - newXSproto(strcpy(buf, "SetSaveWaypoint"), XS_NPC_SetSaveWaypoint, file, "$$"); - newXSproto(strcpy(buf, "SetSp2"), XS_NPC_SetSp2, file, "$$"); - newXSproto(strcpy(buf, "GetWaypointMax"), XS_NPC_GetWaypointMax, file, "$"); - newXSproto(strcpy(buf, "GetGrid"), XS_NPC_GetGrid, file, "$"); - newXSproto(strcpy(buf, "GetSp2"), XS_NPC_GetSp2, file, "$"); - newXSproto(strcpy(buf, "GetNPCFactionID"), XS_NPC_GetNPCFactionID, file, "$"); - newXSproto(strcpy(buf, "GetPrimaryFaction"), XS_NPC_GetPrimaryFaction, file, "$"); - newXSproto(strcpy(buf, "GetNPCHate"), XS_NPC_GetNPCHate, file, "$$"); - newXSproto(strcpy(buf, "IsOnHatelist"), XS_NPC_IsOnHatelist, file, "$$"); - newXSproto(strcpy(buf, "RemoveFromHateList"), XS_NPC_RemoveFromHateList, file, "$$"); - newXSproto(strcpy(buf, "SetNPCFactionID"), XS_NPC_SetNPCFactionID, file, "$$"); - newXSproto(strcpy(buf, "GetMaxDMG"), XS_NPC_GetMaxDMG, file, "$"); - newXSproto(strcpy(buf, "GetMinDMG"), XS_NPC_GetMinDMG, file, "$"); - newXSproto(strcpy(buf, "IsAnimal"), XS_NPC_IsAnimal, file, "$"); - newXSproto(strcpy(buf, "GetPetSpellID"), XS_NPC_GetPetSpellID, file, "$"); - newXSproto(strcpy(buf, "SetPetSpellID"), XS_NPC_SetPetSpellID, file, "$$"); - newXSproto(strcpy(buf, "GetMaxDamage"), XS_NPC_GetMaxDamage, file, "$$"); - newXSproto(strcpy(buf, "SetTaunting"), XS_NPC_SetTaunting, file, "$$"); - newXSproto(strcpy(buf, "PickPocket"), XS_NPC_PickPocket, file, "$$"); - newXSproto(strcpy(buf, "StartSwarmTimer"), XS_NPC_StartSwarmTimer, file, "$$"); - newXSproto(strcpy(buf, "DoClassAttacks"), XS_NPC_DoClassAttacks, file, "$$"); - newXSproto(strcpy(buf, "GetMaxWp"), XS_NPC_GetMaxWp, file, "$"); - newXSproto(strcpy(buf, "DisplayWaypointInfo"), XS_NPC_DisplayWaypointInfo, file, "$$"); - newXSproto(strcpy(buf, "CalculateNewWaypoint"), XS_NPC_CalculateNewWaypoint, file, "$"); - newXSproto(strcpy(buf, "AssignWaypoints"), XS_NPC_AssignWaypoints, file, "$$"); - newXSproto(strcpy(buf, "SetWaypointPause"), XS_NPC_SetWaypointPause, file, "$"); - newXSproto(strcpy(buf, "UpdateWaypoint"), XS_NPC_UpdateWaypoint, file, "$$"); - newXSproto(strcpy(buf, "StopWandering"), XS_NPC_StopWandering, file, "$"); - newXSproto(strcpy(buf, "ResumeWandering"), XS_NPC_ResumeWandering, file, "$"); - newXSproto(strcpy(buf, "PauseWandering"), XS_NPC_PauseWandering, file, "$$"); - newXSproto(strcpy(buf, "MoveTo"), XS_NPC_MoveTo, file, "$$$$"); - newXSproto(strcpy(buf, "NextGuardPosition"), XS_NPC_NextGuardPosition, file, "$"); - newXSproto(strcpy(buf, "SaveGuardSpot"), XS_NPC_SaveGuardSpot, file, "$;$"); - newXSproto(strcpy(buf, "IsGuarding"), XS_NPC_IsGuarding, file, "$"); - newXSproto(strcpy(buf, "AI_SetRoambox"), XS_NPC_AI_SetRoambox, file, "$$$$$$;$$"); - newXSproto(strcpy(buf, "GetNPCSpellsID"), XS_NPC_GetNPCSpellsID, file, "$"); - newXSproto(strcpy(buf, "GetSpawnPointID"), XS_NPC_GetSpawnPointID, file, "$"); - newXSproto(strcpy(buf, "GetSpawnPointX"), XS_NPC_GetSpawnPointX, file, "$"); - newXSproto(strcpy(buf, "GetSpawnPointY"), XS_NPC_GetSpawnPointY, file, "$"); - newXSproto(strcpy(buf, "GetSpawnPointZ"), XS_NPC_GetSpawnPointZ, file, "$"); - newXSproto(strcpy(buf, "GetSpawnPointH"), XS_NPC_GetSpawnPointH, file, "$"); - newXSproto(strcpy(buf, "GetGuardPointX"), XS_NPC_GetGuardPointX, file, "$"); - newXSproto(strcpy(buf, "GetGuardPointY"), XS_NPC_GetGuardPointY, file, "$"); - newXSproto(strcpy(buf, "GetGuardPointZ"), XS_NPC_GetGuardPointZ, file, "$"); - newXSproto(strcpy(buf, "SetPrimSkill"), XS_NPC_SetPrimSkill, file, "$$"); - newXSproto(strcpy(buf, "SetSecSkill"), XS_NPC_SetSecSkill, file, "$$"); - newXSproto(strcpy(buf, "GetPrimSkill"), XS_NPC_GetPrimSkill, file, "$"); - newXSproto(strcpy(buf, "GetSecSkill"), XS_NPC_GetSecSkill, file, "$"); - newXSproto(strcpy(buf, "GetSwarmOwner"), XS_NPC_GetSwarmOwner, file, "$"); - newXSproto(strcpy(buf, "GetSwarmTarget"), XS_NPC_GetSwarmTarget, file, "$"); - newXSproto(strcpy(buf, "SetSwarmTarget"), XS_NPC_SetSwarmTarget, file, "$$"); - newXSproto(strcpy(buf, "ModifyNPCStat"), XS_NPC_ModifyNPCStat, file, "$$$"); - newXSproto(strcpy(buf, "AddAISpell"), XS_NPC_AddSpellToNPCList, file, "$$$$$$$"); - newXSproto(strcpy(buf, "RemoveAISpell"), XS_NPC_RemoveSpellFromNPCList, file, "$$"); - newXSproto(strcpy(buf, "SetSpellFocusDMG"), XS_NPC_SetSpellFocusDMG, file, "$$"); - newXSproto(strcpy(buf, "SetSpellFocusHeal"), XS_NPC_SetSpellFocusHeal, file, "$$"); - newXSproto(strcpy(buf, "GetSpellFocusDMG"), XS_NPC_GetSpellFocusDMG, file, "$"); - newXSproto(strcpy(buf, "GetSpellFocusHeal"), XS_NPC_GetSpellFocusHeal, file, "$"); - newXSproto(strcpy(buf, "GetSlowMitigation"), XS_NPC_GetSlowMitigation, file, "$"); - newXSproto(strcpy(buf, "GetAttackSpeed"), XS_NPC_GetAttackSpeed, file, "$"); - newXSproto(strcpy(buf, "GetAttackDelay"), XS_NPC_GetAttackDelay, file, "$"); - newXSproto(strcpy(buf, "GetAccuracyRating"), XS_NPC_GetAccuracyRating, file, "$"); - newXSproto(strcpy(buf, "GetAvoidanceRating"), XS_NPC_GetAvoidanceRating, file, "$"); - newXSproto(strcpy(buf, "GetSpawnKillCount"), XS_NPC_GetSpawnKillCount, file, "$"); - newXSproto(strcpy(buf, "GetScore"), XS_NPC_GetScore, file, "$"); - newXSproto(strcpy(buf, "AddMeleeProc"), XS_NPC_AddMeleeProc, file, "$$$"); - newXSproto(strcpy(buf, "AddRangedProc"), XS_NPC_AddRangedProc, file, "$$$"); - newXSproto(strcpy(buf, "AddDefensiveProc"), XS_NPC_AddDefensiveProc, file, "$$$"); - newXSproto(strcpy(buf, "RemoveMeleeProc"), XS_NPC_RemoveMeleeProc, file, "$$"); - newXSproto(strcpy(buf, "RemoveRangedProc"), XS_NPC_RemoveRangedProc, file, "$$"); - newXSproto(strcpy(buf, "RemoveDefensiveProc"), XS_NPC_RemoveDefensiveProc, file, "$$"); - newXSproto(strcpy(buf, "ChangeLastName"), XS_NPC_ChangeLastName, file, "$:$"); - newXSproto(strcpy(buf, "ClearLastName"), XS_NPC_ClearLastName, file, "$"); - newXSproto(strcpy(buf, "GetCombatState"), XS_NPC_GetCombatState, file, "$"); + newXSproto(strcpy(buf, "SignalNPC"), XS_NPC_SignalNPC, file, "$$"); + newXSproto(strcpy(buf, "CheckNPCFactionAlly"), XS_NPC_CheckNPCFactionAlly, file, "$$"); + newXSproto(strcpy(buf, "AddItem"), XS_NPC_AddItem, file, "$$;$$$$$$$$"); + newXSproto(strcpy(buf, "AddLootTable"), XS_NPC_AddLootTable, file, "$"); + newXSproto(strcpy(buf, "RemoveItem"), XS_NPC_RemoveItem, file, "$$;$$"); + newXSproto(strcpy(buf, "ClearItemList"), XS_NPC_ClearItemList, file, "$"); + newXSproto(strcpy(buf, "AddCash"), XS_NPC_AddCash, file, "$$$$$"); + newXSproto(strcpy(buf, "RemoveCash"), XS_NPC_RemoveCash, file, "$"); + newXSproto(strcpy(buf, "CountLoot"), XS_NPC_CountLoot, file, "$"); + newXSproto(strcpy(buf, "GetLoottableID"), XS_NPC_GetLoottableID, file, "$"); + newXSproto(strcpy(buf, "GetCopper"), XS_NPC_GetCopper, file, "$"); + newXSproto(strcpy(buf, "GetSilver"), XS_NPC_GetSilver, file, "$"); + newXSproto(strcpy(buf, "GetGold"), XS_NPC_GetGold, file, "$"); + newXSproto(strcpy(buf, "GetPlatinum"), XS_NPC_GetPlatinum, file, "$"); + newXSproto(strcpy(buf, "SetCopper"), XS_NPC_SetCopper, file, "$$"); + newXSproto(strcpy(buf, "SetSilver"), XS_NPC_SetSilver, file, "$$"); + newXSproto(strcpy(buf, "SetGold"), XS_NPC_SetGold, file, "$$"); + newXSproto(strcpy(buf, "SetPlatinum"), XS_NPC_SetPlatinum, file, "$$"); + newXSproto(strcpy(buf, "SetGrid"), XS_NPC_SetGrid, file, "$$"); + newXSproto(strcpy(buf, "SetSaveWaypoint"), XS_NPC_SetSaveWaypoint, file, "$$"); + newXSproto(strcpy(buf, "SetSp2"), XS_NPC_SetSp2, file, "$$"); + newXSproto(strcpy(buf, "GetWaypointMax"), XS_NPC_GetWaypointMax, file, "$"); + newXSproto(strcpy(buf, "GetGrid"), XS_NPC_GetGrid, file, "$"); + newXSproto(strcpy(buf, "GetSp2"), XS_NPC_GetSp2, file, "$"); + newXSproto(strcpy(buf, "GetNPCFactionID"), XS_NPC_GetNPCFactionID, file, "$"); + newXSproto(strcpy(buf, "GetPrimaryFaction"), XS_NPC_GetPrimaryFaction, file, "$"); + newXSproto(strcpy(buf, "GetNPCHate"), XS_NPC_GetNPCHate, file, "$$"); + newXSproto(strcpy(buf, "IsOnHatelist"), XS_NPC_IsOnHatelist, file, "$$"); + newXSproto(strcpy(buf, "RemoveFromHateList"), XS_NPC_RemoveFromHateList, file, "$$"); + newXSproto(strcpy(buf, "SetNPCFactionID"), XS_NPC_SetNPCFactionID, file, "$$"); + newXSproto(strcpy(buf, "GetMaxDMG"), XS_NPC_GetMaxDMG, file, "$"); + newXSproto(strcpy(buf, "GetMinDMG"), XS_NPC_GetMinDMG, file, "$"); + newXSproto(strcpy(buf, "IsAnimal"), XS_NPC_IsAnimal, file, "$"); + newXSproto(strcpy(buf, "GetPetSpellID"), XS_NPC_GetPetSpellID, file, "$"); + newXSproto(strcpy(buf, "SetPetSpellID"), XS_NPC_SetPetSpellID, file, "$$"); + newXSproto(strcpy(buf, "GetMaxDamage"), XS_NPC_GetMaxDamage, file, "$$"); + newXSproto(strcpy(buf, "SetTaunting"), XS_NPC_SetTaunting, file, "$$"); + newXSproto(strcpy(buf, "PickPocket"), XS_NPC_PickPocket, file, "$$"); + newXSproto(strcpy(buf, "StartSwarmTimer"), XS_NPC_StartSwarmTimer, file, "$$"); + newXSproto(strcpy(buf, "DoClassAttacks"), XS_NPC_DoClassAttacks, file, "$$"); + newXSproto(strcpy(buf, "GetMaxWp"), XS_NPC_GetMaxWp, file, "$"); + newXSproto(strcpy(buf, "DisplayWaypointInfo"), XS_NPC_DisplayWaypointInfo, file, "$$"); + newXSproto(strcpy(buf, "CalculateNewWaypoint"), XS_NPC_CalculateNewWaypoint, file, "$"); + newXSproto(strcpy(buf, "AssignWaypoints"), XS_NPC_AssignWaypoints, file, "$$"); + newXSproto(strcpy(buf, "SetWaypointPause"), XS_NPC_SetWaypointPause, file, "$"); + newXSproto(strcpy(buf, "UpdateWaypoint"), XS_NPC_UpdateWaypoint, file, "$$"); + newXSproto(strcpy(buf, "StopWandering"), XS_NPC_StopWandering, file, "$"); + newXSproto(strcpy(buf, "ResumeWandering"), XS_NPC_ResumeWandering, file, "$"); + newXSproto(strcpy(buf, "PauseWandering"), XS_NPC_PauseWandering, file, "$$"); + newXSproto(strcpy(buf, "MoveTo"), XS_NPC_MoveTo, file, "$$$$"); + newXSproto(strcpy(buf, "NextGuardPosition"), XS_NPC_NextGuardPosition, file, "$"); + newXSproto(strcpy(buf, "SaveGuardSpot"), XS_NPC_SaveGuardSpot, file, "$;$"); + newXSproto(strcpy(buf, "IsGuarding"), XS_NPC_IsGuarding, file, "$"); + newXSproto(strcpy(buf, "AI_SetRoambox"), XS_NPC_AI_SetRoambox, file, "$$$$$$;$$"); + newXSproto(strcpy(buf, "GetNPCSpellsID"), XS_NPC_GetNPCSpellsID, file, "$"); + newXSproto(strcpy(buf, "GetSpawnPointID"), XS_NPC_GetSpawnPointID, file, "$"); + newXSproto(strcpy(buf, "GetSpawnPointX"), XS_NPC_GetSpawnPointX, file, "$"); + newXSproto(strcpy(buf, "GetSpawnPointY"), XS_NPC_GetSpawnPointY, file, "$"); + newXSproto(strcpy(buf, "GetSpawnPointZ"), XS_NPC_GetSpawnPointZ, file, "$"); + newXSproto(strcpy(buf, "GetSpawnPointH"), XS_NPC_GetSpawnPointH, file, "$"); + newXSproto(strcpy(buf, "GetGuardPointX"), XS_NPC_GetGuardPointX, file, "$"); + newXSproto(strcpy(buf, "GetGuardPointY"), XS_NPC_GetGuardPointY, file, "$"); + newXSproto(strcpy(buf, "GetGuardPointZ"), XS_NPC_GetGuardPointZ, file, "$"); + newXSproto(strcpy(buf, "SetPrimSkill"), XS_NPC_SetPrimSkill, file, "$$"); + newXSproto(strcpy(buf, "SetSecSkill"), XS_NPC_SetSecSkill, file, "$$"); + newXSproto(strcpy(buf, "GetPrimSkill"), XS_NPC_GetPrimSkill, file, "$"); + newXSproto(strcpy(buf, "GetSecSkill"), XS_NPC_GetSecSkill, file, "$"); + newXSproto(strcpy(buf, "GetSwarmOwner"), XS_NPC_GetSwarmOwner, file, "$"); + newXSproto(strcpy(buf, "GetSwarmTarget"), XS_NPC_GetSwarmTarget, file, "$"); + newXSproto(strcpy(buf, "SetSwarmTarget"), XS_NPC_SetSwarmTarget, file, "$$"); + newXSproto(strcpy(buf, "ModifyNPCStat"), XS_NPC_ModifyNPCStat, file, "$$$"); + newXSproto(strcpy(buf, "AddAISpell"), XS_NPC_AddSpellToNPCList, file, "$$$$$$$"); + newXSproto(strcpy(buf, "RemoveAISpell"), XS_NPC_RemoveSpellFromNPCList, file, "$$"); + newXSproto(strcpy(buf, "SetSpellFocusDMG"), XS_NPC_SetSpellFocusDMG, file, "$$"); + newXSproto(strcpy(buf, "SetSpellFocusHeal"), XS_NPC_SetSpellFocusHeal, file, "$$"); + newXSproto(strcpy(buf, "GetSpellFocusDMG"), XS_NPC_GetSpellFocusDMG, file, "$"); + newXSproto(strcpy(buf, "GetSpellFocusHeal"), XS_NPC_GetSpellFocusHeal, file, "$"); + newXSproto(strcpy(buf, "GetSlowMitigation"), XS_NPC_GetSlowMitigation, file, "$"); + newXSproto(strcpy(buf, "GetAttackSpeed"), XS_NPC_GetAttackSpeed, file, "$"); + newXSproto(strcpy(buf, "GetAttackDelay"), XS_NPC_GetAttackDelay, file, "$"); + newXSproto(strcpy(buf, "GetAccuracyRating"), XS_NPC_GetAccuracyRating, file, "$"); + newXSproto(strcpy(buf, "GetAvoidanceRating"), XS_NPC_GetAvoidanceRating, file, "$"); + newXSproto(strcpy(buf, "GetSpawnKillCount"), XS_NPC_GetSpawnKillCount, file, "$"); + newXSproto(strcpy(buf, "GetScore"), XS_NPC_GetScore, file, "$"); + newXSproto(strcpy(buf, "AddMeleeProc"), XS_NPC_AddMeleeProc, file, "$$$"); + newXSproto(strcpy(buf, "AddRangedProc"), XS_NPC_AddRangedProc, file, "$$$"); + newXSproto(strcpy(buf, "AddDefensiveProc"), XS_NPC_AddDefensiveProc, file, "$$$"); + newXSproto(strcpy(buf, "RemoveMeleeProc"), XS_NPC_RemoveMeleeProc, file, "$$"); + newXSproto(strcpy(buf, "RemoveRangedProc"), XS_NPC_RemoveRangedProc, file, "$$"); + newXSproto(strcpy(buf, "RemoveDefensiveProc"), XS_NPC_RemoveDefensiveProc, file, "$$"); + newXSproto(strcpy(buf, "ChangeLastName"), XS_NPC_ChangeLastName, file, "$:$"); + newXSproto(strcpy(buf, "ClearLastName"), XS_NPC_ClearLastName, file, "$"); + newXSproto(strcpy(buf, "GetCombatState"), XS_NPC_GetCombatState, file, "$"); XSRETURN_YES; } From ed377159938d51308fdbfb12960debb6ce349fa4 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 20:29:00 -0500 Subject: [PATCH 23/33] Add --objet to perl-doc-parser.pl and update usage doc for perl_object.cpp --- utils/scripts/perl-doc-parser.pl | 9 +++++++- zone/perl_object.cpp | 38 ++++++++++++++++---------------- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/utils/scripts/perl-doc-parser.pl b/utils/scripts/perl-doc-parser.pl index e5de41102..6a0d6f61e 100755 --- a/utils/scripts/perl-doc-parser.pl +++ b/utils/scripts/perl-doc-parser.pl @@ -8,6 +8,7 @@ sub usage() { print " --npc - Prints methods for just npc class methods\n"; print " --entity - Prints methods for just entity class methods\n"; print " --door - Prints methods for just door class methods\n"; + print " --object - Prints methods for just object class methods\n"; print " --group - Prints methods for just group class methods\n"; print " --corpse - Prints methods for just corpse class methods\n"; print " --hateentry - Prints methods for just hateentry class methods\n"; @@ -51,7 +52,7 @@ for my $file (@files) { chomp; $line = $_; - if ($line=~/Client::|Mob::|Corpse::|EntityList::|Doors::|Group::|HateEntry::|NPC::/i && $line=~/_croak/i) { + if ($line=~/Client::|Mob::|Corpse::|EntityList::|Doors::|Group::|HateEntry::|NPC::|Object::/i && $line=~/_croak/i) { #::: Client export if ($export=~/all|client/i) { @@ -89,6 +90,12 @@ for my $file (@files) { $object_prefix = "\$door->"; } + #::: Object export + if ($export=~/all|object/i) { + $split_key = "Object::"; + $object_prefix = "\$object->"; + } + #::: Group export if ($export=~/all|group/i) { $split_key = "Group::"; diff --git a/zone/perl_object.cpp b/zone/perl_object.cpp index f8fc9a4ee..c5a3991e7 100644 --- a/zone/perl_object.cpp +++ b/zone/perl_object.cpp @@ -97,7 +97,7 @@ XS(XS_Object_Delete) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: Object::Delete(THIS, reset_state=false)"); + Perl_croak(aTHX_ "Usage: Object::Delete(THIS, [bool reset_state = false])"); { Object * THIS; bool reset_state; @@ -150,7 +150,7 @@ XS(XS_Object_DeleteItem) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Object::DeleteItem(THIS, index)"); + Perl_croak(aTHX_ "Usage: Object::DeleteItem(THIS, uint8 index)"); { Object * THIS; uint8 index = (uint8)SvUV(ST(1)); @@ -228,7 +228,7 @@ XS(XS_Object_SetID) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Object::SetID(THIS, set_id)"); + Perl_croak(aTHX_ "Usage: Object::SetID(THIS, uint16 id)"); { Object * THIS; uint16 set_id = (uint16)SvUV(ST(1)); @@ -487,7 +487,7 @@ XS(XS_Object_SetType) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Object::SetType(THIS, type)"); + Perl_croak(aTHX_ "Usage: Object::SetType(THIS, uint32 type)"); { Object * THIS; uint32 type = (uint32)SvUV(ST(1)); @@ -539,7 +539,7 @@ XS(XS_Object_SetIcon) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Object::SetIcon(THIS, icon)"); + Perl_croak(aTHX_ "Usage: Object::SetIcon(THIS, uint32 icon)"); { Object * THIS; uint32 icon = (uint32)SvUV(ST(1)); @@ -591,7 +591,7 @@ XS(XS_Object_SetItemID) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Object::SetItemID(THIS, itemid)"); + Perl_croak(aTHX_ "Usage: Object::SetItemID(THIS, uint32 item_id)"); { Object * THIS; uint32 itemid = (uint32)SvUV(ST(1)); @@ -615,7 +615,7 @@ XS(XS_Object_SetLocation) { dXSARGS; if (items != 4) - Perl_croak(aTHX_ "Usage: Object::SetLocation(THIS, x, y, z)"); + Perl_croak(aTHX_ "Usage: Object::SetLocation(THIS, float x, float y, float z)"); { Object * THIS; float x = (float)SvNV(ST(1)); @@ -641,7 +641,7 @@ XS(XS_Object_SetX) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Object::SetX(THIS, XPos)"); + Perl_croak(aTHX_ "Usage: Object::SetX(THIS, float x)"); { Object * THIS; float pos = (float)SvNV(ST(1)); @@ -665,7 +665,7 @@ XS(XS_Object_SetY) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Object::SetY(THIS, YPos)"); + Perl_croak(aTHX_ "Usage: Object::SetY(THIS, float y)"); { Object * THIS; float pos = (float)SvNV(ST(1)); @@ -689,7 +689,7 @@ XS(XS_Object_SetZ) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Object::SetZ(THIS, ZPos)"); + Perl_croak(aTHX_ "Usage: Object::SetZ(THIS, float z)"); { Object * THIS; float pos = (float)SvNV(ST(1)); @@ -713,7 +713,7 @@ XS(XS_Object_SetHeading) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Object::SetHeading(THIS, heading)"); + Perl_croak(aTHX_ "Usage: Object::SetHeading(THIS, float heading)"); { Object * THIS; float heading = (float)SvNV(ST(1)); @@ -737,7 +737,7 @@ XS(XS_Object_SetModelName) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: Object::SetModelName(THIS, name)"); + Perl_croak(aTHX_ "Usage: Object::SetModelName(THIS, string name)"); { Object * THIS; char * name = nullptr; @@ -835,7 +835,7 @@ XS(XS_Object_GetEntityVariable) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Object::GetEntityVariable(THIS, id)"); + Perl_croak(aTHX_ "Usage: Object::GetEntityVariable(THIS, string key)"); { Object * THIS; Const_char *id = SvPV_nolen(ST(1)); @@ -862,7 +862,7 @@ XS(XS_Object_EntityVariableExists) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Object::EntityVariableExists(THIS, id)"); + Perl_croak(aTHX_ "Usage: Object::EntityVariableExists(THIS, string key)"); { Object * THIS; Const_char *id = SvPV_nolen(ST(1)); @@ -889,7 +889,7 @@ XS(XS_Object_SetEntityVariable) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Object::SetEntityVariable(THIS, id, var)"); + Perl_croak(aTHX_ "Usage: Object::SetEntityVariable(THIS, string key, string var)"); { Object * THIS; Const_char *id = SvPV_nolen(ST(1)); @@ -941,7 +941,7 @@ XS(XS_Object_SetSolidType) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Object::SetSolidType(THIS, type)"); + Perl_croak(aTHX_ "Usage: Object::SetSolidType(THIS, uint16 type)"); { Object * THIS; uint16 type = (uint16)SvUV(ST(1)); @@ -992,7 +992,7 @@ XS(XS_Object_SetSize) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Object::SetSize(THIS, type)"); + Perl_croak(aTHX_ "Usage: Object::SetSize(THIS, float size)"); { Object * THIS; float size = (float)SvNV(ST(1)); @@ -1016,7 +1016,7 @@ XS(XS_Object_SetTiltX) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Object::SetTiltX(THIS, pos)"); + Perl_croak(aTHX_ "Usage: Object::SetTiltX(THIS, float tilt_x)"); { Object * THIS; float pos = (float)SvNV(ST(1)); @@ -1040,7 +1040,7 @@ XS(XS_Object_SetTiltY) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Object::SetTiltY(THIS, pos)"); + Perl_croak(aTHX_ "Usage: Object::SetTiltY(THIS, float tilt_y)"); { Object * THIS; float pos = (float)SvNV(ST(1)); From 5b05987e27720cba44d5e979067d86131b9e9be9 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 20:29:09 -0500 Subject: [PATCH 24/33] perl_object.cpp formatting --- zone/perl_object.cpp | 812 ++++++++++++++++++++----------------------- 1 file changed, 373 insertions(+), 439 deletions(-) diff --git a/zone/perl_object.cpp b/zone/perl_object.cpp index c5a3991e7..062c2c0a3 100644 --- a/zone/perl_object.cpp +++ b/zone/perl_object.cpp @@ -26,7 +26,9 @@ */ #include "../common/features.h" + #ifdef EMBPERL_XS_CLASSES + #include "../common/global_define.h" #include "embperl.h" @@ -41,22 +43,20 @@ #endif XS(XS_Object_IsGroundSpawn); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_IsGroundSpawn) -{ +XS(XS_Object_IsGroundSpawn) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Object::IsGroundSpawn(THIS)"); { - Object * THIS; - bool RETVAL; + Object *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsGroundSpawn(); @@ -67,23 +67,20 @@ XS(XS_Object_IsGroundSpawn) } - XS(XS_Object_Close); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_Close) -{ +XS(XS_Object_Close) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Object::Close(THIS)"); { - Object * THIS; + Object *THIS; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Close(); @@ -93,28 +90,26 @@ XS(XS_Object_Close) XS(XS_Object_Delete); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_Delete) -{ +XS(XS_Object_Delete) { dXSARGS; if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: Object::Delete(THIS, [bool reset_state = false])"); { - Object * THIS; - bool reset_state; + Object *THIS; + bool reset_state; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) reset_state = false; else { - reset_state = (bool)SvTRUE(ST(1)); + reset_state = (bool) SvTRUE(ST(1)); } THIS->Delete(reset_state); @@ -122,21 +117,19 @@ XS(XS_Object_Delete) XSRETURN_EMPTY; } XS(XS_Object_StartDecay); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_StartDecay) -{ +XS(XS_Object_StartDecay) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Object::StartDecay(THIS)"); { - Object * THIS; + Object *THIS; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->StartDecay(); @@ -146,22 +139,20 @@ XS(XS_Object_StartDecay) XS(XS_Object_DeleteItem); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_DeleteItem) -{ +XS(XS_Object_DeleteItem) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Object::DeleteItem(THIS, uint8 index)"); { - Object * THIS; - uint8 index = (uint8)SvUV(ST(1)); + Object *THIS; + uint8 index = (uint8) SvUV(ST(1)); if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->DeleteItem(index); @@ -170,22 +161,20 @@ XS(XS_Object_DeleteItem) } XS(XS_Object_IsObject); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_IsObject) -{ +XS(XS_Object_IsObject) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Object::IsObject(THIS)"); { - Object * THIS; - bool RETVAL; + Object *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsObject(); @@ -197,22 +186,20 @@ XS(XS_Object_IsObject) XS(XS_Object_Save); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_Save) -{ +XS(XS_Object_Save) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Object::Save(THIS)"); { - Object * THIS; - bool RETVAL; + Object *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->Save(); @@ -224,22 +211,20 @@ XS(XS_Object_Save) XS(XS_Object_SetID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_SetID) -{ +XS(XS_Object_SetID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Object::SetID(THIS, uint16 id)"); { - Object * THIS; - uint16 set_id = (uint16)SvUV(ST(1)); + Object *THIS; + uint16 set_id = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetID(set_id); @@ -249,21 +234,19 @@ XS(XS_Object_SetID) XS(XS_Object_ClearUser); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_ClearUser) -{ +XS(XS_Object_ClearUser) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Object::ClearUser(THIS)"); { - Object * THIS; + Object *THIS; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ClearUser(); @@ -273,232 +256,222 @@ XS(XS_Object_ClearUser) XS(XS_Object_GetDBID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_GetDBID) -{ +XS(XS_Object_GetDBID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Object::GetDBID(THIS)"); { - Object * THIS; - uint32 RETVAL; + Object *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDBID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Object_GetID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_GetID) -{ +XS(XS_Object_GetID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Object::GetID(THIS)"); { - Object * THIS; - uint16 RETVAL; + Object *THIS; + uint16 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Object_GetX); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_GetX) -{ +XS(XS_Object_GetX) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Object::GetX(THIS)"); { - Object * THIS; - float RETVAL; + Object *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetX(); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Object_GetY); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_GetY) -{ +XS(XS_Object_GetY) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Object::GetY(THIS)"); { - Object * THIS; - float RETVAL; + Object *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetY(); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Object_GetZ); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_GetZ) -{ +XS(XS_Object_GetZ) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Object::GetZ(THIS)"); { - Object * THIS; - float RETVAL; + Object *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetZ(); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Object_GetHeading); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_GetHeading) -{ +XS(XS_Object_GetHeading) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Object::GetHeading(THIS)"); { - Object * THIS; - float RETVAL; + Object *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHeadingData(); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Object_VarSave); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_VarSave) -{ +XS(XS_Object_VarSave) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Object::VarSave(THIS)"); { - Object * THIS; - uint32 RETVAL; + Object *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->VarSave(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Object_GetType); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_GetType) -{ +XS(XS_Object_GetType) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Object::GetType(THIS)"); { - Object * THIS; - uint32 RETVAL; + Object *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetType(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Object_SetType); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_SetType) -{ +XS(XS_Object_SetType) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Object::SetType(THIS, uint32 type)"); { - Object * THIS; - uint32 type = (uint32)SvUV(ST(1)); + Object *THIS; + uint32 type = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetType(type); @@ -508,49 +481,46 @@ XS(XS_Object_SetType) XS(XS_Object_GetIcon); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_GetIcon) -{ +XS(XS_Object_GetIcon) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Object::GetIcon(THIS)"); { - Object * THIS; - uint32 RETVAL; + Object *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetIcon(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Object_SetIcon); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_SetIcon) -{ +XS(XS_Object_SetIcon) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Object::SetIcon(THIS, uint32 icon)"); { - Object * THIS; - uint32 icon = (uint32)SvUV(ST(1)); + Object *THIS; + uint32 icon = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetIcon(icon); @@ -560,49 +530,46 @@ XS(XS_Object_SetIcon) XS(XS_Object_GetItemID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_GetItemID) -{ +XS(XS_Object_GetItemID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Object::GetItemID(THIS)"); { - Object * THIS; - uint32 RETVAL; + Object *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetItemID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Object_SetItemID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_SetItemID) -{ +XS(XS_Object_SetItemID) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Object::SetItemID(THIS, uint32 item_id)"); { - Object * THIS; - uint32 itemid = (uint32)SvUV(ST(1)); + Object *THIS; + uint32 itemid = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetItemID(itemid); @@ -611,24 +578,22 @@ XS(XS_Object_SetItemID) } XS(XS_Object_SetLocation); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_SetLocation) -{ +XS(XS_Object_SetLocation) { dXSARGS; if (items != 4) Perl_croak(aTHX_ "Usage: Object::SetLocation(THIS, float x, float y, float z)"); { - Object * THIS; - float x = (float)SvNV(ST(1)); - float y = (float)SvNV(ST(2)); - float z = (float)SvNV(ST(3)); + Object *THIS; + float x = (float) SvNV(ST(1)); + float y = (float) SvNV(ST(2)); + float z = (float) SvNV(ST(3)); if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetLocation(x, y, z); @@ -637,22 +602,20 @@ XS(XS_Object_SetLocation) } XS(XS_Object_SetX); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_SetX) -{ +XS(XS_Object_SetX) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Object::SetX(THIS, float x)"); { - Object * THIS; - float pos = (float)SvNV(ST(1)); + Object *THIS; + float pos = (float) SvNV(ST(1)); if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetX(pos); @@ -661,22 +624,20 @@ XS(XS_Object_SetX) } XS(XS_Object_SetY); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_SetY) -{ +XS(XS_Object_SetY) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Object::SetY(THIS, float y)"); { - Object * THIS; - float pos = (float)SvNV(ST(1)); + Object *THIS; + float pos = (float) SvNV(ST(1)); if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetY(pos); @@ -685,22 +646,20 @@ XS(XS_Object_SetY) } XS(XS_Object_SetZ); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_SetZ) -{ +XS(XS_Object_SetZ) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Object::SetZ(THIS, float z)"); { - Object * THIS; - float pos = (float)SvNV(ST(1)); + Object *THIS; + float pos = (float) SvNV(ST(1)); if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetZ(pos); @@ -709,22 +668,20 @@ XS(XS_Object_SetZ) } XS(XS_Object_SetHeading); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_SetHeading) -{ +XS(XS_Object_SetHeading) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Object::SetHeading(THIS, float heading)"); { - Object * THIS; - float heading = (float)SvNV(ST(1)); + Object *THIS; + float heading = (float) SvNV(ST(1)); if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetHeading(heading); @@ -733,73 +690,69 @@ XS(XS_Object_SetHeading) } XS(XS_Object_SetModelName); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_SetModelName) -{ +XS(XS_Object_SetModelName) { dXSARGS; if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: Object::SetModelName(THIS, string name)"); { - Object * THIS; - char * name = nullptr; + Object *THIS; + char *name = nullptr; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - if (items > 1) { name = (char *)SvPV_nolen(ST(1)); } + if (items > 1) { name = (char *) SvPV_nolen(ST(1)); } THIS->SetModelName(name); } XSRETURN_EMPTY; } XS(XS_Object_GetModelName); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_GetModelName) -{ +XS(XS_Object_GetModelName) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Object::GetModelName(THIS)"); { - Object * THIS; - Const_char * RETVAL; + Object *THIS; + Const_char *RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetModelName(); - sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; + sv_setpv(TARG, RETVAL); + XSprePUSH; + PUSHTARG; } XSRETURN(1); } XS(XS_Object_Repop); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_Repop) -{ +XS(XS_Object_Repop) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Object::Repop(THIS)"); { - Object * THIS; + Object *THIS; dXSTARG; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Repop(); } @@ -807,22 +760,20 @@ XS(XS_Object_Repop) } XS(XS_Object_Depop); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_Depop) -{ +XS(XS_Object_Depop) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Object::Depop(THIS)"); { - Object * THIS; + Object *THIS; dXSTARG; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Depop(); } @@ -831,50 +782,48 @@ XS(XS_Object_Depop) XS(XS_Object_GetEntityVariable); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_GetEntityVariable) -{ +XS(XS_Object_GetEntityVariable) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Object::GetEntityVariable(THIS, string key)"); { - Object * THIS; + Object *THIS; Const_char *id = SvPV_nolen(ST(1)); - Const_char * RETVAL; + Const_char *RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEntityVariable(id); - sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; + sv_setpv(TARG, RETVAL); + XSprePUSH; + PUSHTARG; } XSRETURN(1); } XS(XS_Object_EntityVariableExists); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_EntityVariableExists) -{ +XS(XS_Object_EntityVariableExists) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Object::EntityVariableExists(THIS, string key)"); { - Object * THIS; + Object *THIS; Const_char *id = SvPV_nolen(ST(1)); - bool RETVAL; + bool RETVAL; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->EntityVariableExists(id); @@ -885,23 +834,21 @@ XS(XS_Object_EntityVariableExists) } XS(XS_Object_SetEntityVariable); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_SetEntityVariable) -{ +XS(XS_Object_SetEntityVariable) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Object::SetEntityVariable(THIS, string key, string var)"); { - Object * THIS; + Object *THIS; Const_char *id = SvPV_nolen(ST(1)); - const char * var = (const char *)SvPV_nolen(ST(2)); + const char *var = (const char *) SvPV_nolen(ST(2)); if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetEntityVariable(id, var); @@ -910,49 +857,46 @@ XS(XS_Object_SetEntityVariable) } XS(XS_Object_GetSolidType); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_GetSolidType) -{ +XS(XS_Object_GetSolidType) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Object::GetSolidType(THIS)"); { - Object * THIS; - uint16 RETVAL; + Object *THIS; + uint16 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSolidType(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Object_SetSolidType); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_SetSolidType) -{ +XS(XS_Object_SetSolidType) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Object::SetSolidType(THIS, uint16 type)"); { - Object * THIS; - uint16 type = (uint16)SvUV(ST(1)); + Object *THIS; + uint16 type = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSolidType(type); @@ -961,49 +905,46 @@ XS(XS_Object_SetSolidType) } XS(XS_Object_GetSize); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_GetSize) -{ +XS(XS_Object_GetSize) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Object::GetSize(THIS)"); { - Object * THIS; - float RETVAL; + Object *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSize(); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Object_SetSize); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_SetSize) -{ +XS(XS_Object_SetSize) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Object::SetSize(THIS, float size)"); { - Object * THIS; - float size = (float)SvNV(ST(1)); + Object *THIS; + float size = (float) SvNV(ST(1)); if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSize(size); @@ -1012,22 +953,20 @@ XS(XS_Object_SetSize) } XS(XS_Object_SetTiltX); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_SetTiltX) -{ +XS(XS_Object_SetTiltX) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Object::SetTiltX(THIS, float tilt_x)"); { - Object * THIS; - float pos = (float)SvNV(ST(1)); + Object *THIS; + float pos = (float) SvNV(ST(1)); if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetTiltX(pos); @@ -1036,22 +975,20 @@ XS(XS_Object_SetTiltX) } XS(XS_Object_SetTiltY); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_SetTiltY) -{ +XS(XS_Object_SetTiltY) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Object::SetTiltY(THIS, float tilt_y)"); { - Object * THIS; - float pos = (float)SvNV(ST(1)); + Object *THIS; + float pos = (float) SvNV(ST(1)); if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetTiltY(pos); @@ -1060,53 +997,51 @@ XS(XS_Object_SetTiltY) } XS(XS_Object_GetTiltX); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_GetTiltX) -{ +XS(XS_Object_GetTiltX) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Object::GetSize(THIS)"); { - Object * THIS; - float RETVAL; + Object *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetTiltX(); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } XS(XS_Object_GetTiltY); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Object_GetTiltY) -{ +XS(XS_Object_GetTiltY) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Object::GetSize(THIS)"); { - Object * THIS; - float RETVAL; + Object *THIS; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Object")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Object *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Object *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetTiltY(); - XSprePUSH; PUSHn((double)RETVAL); + XSprePUSH; + PUSHn((double) RETVAL); } XSRETURN(1); } @@ -1115,61 +1050,60 @@ XS(XS_Object_GetTiltY) extern "C" #endif XS(boot_Object); /* prototype to pass -Wmissing-prototypes */ -XS(boot_Object) -{ +XS(boot_Object) { dXSARGS; char file[256]; strncpy(file, __FILE__, 256); file[255] = 0; - if(items != 1) + if (items != 1) fprintf(stderr, "boot_quest does not take any arguments."); char buf[128]; //add the strcpy stuff to get rid of const warnings.... - XS_VERSION_BOOTCHECK ; - newXSproto(strcpy(buf, "Depop"),XS_Object_Depop, file, "$"); - newXSproto(strcpy(buf, "Repop"),XS_Object_Repop, file, "$"); - newXSproto(strcpy(buf, "SetModelName"),XS_Object_SetModelName, file, "$$"); - newXSproto(strcpy(buf, "GetModelName"),XS_Object_GetModelName, file, "$"); - newXSproto(strcpy(buf, "GetX"),XS_Object_GetX, file, "$"); - newXSproto(strcpy(buf, "GetY"),XS_Object_GetY, file, "$"); - newXSproto(strcpy(buf, "GetZ"),XS_Object_GetZ, file, "$"); - newXSproto(strcpy(buf, "GetHeading"),XS_Object_GetHeading, file, "$"); - newXSproto(strcpy(buf, "SetX"),XS_Object_SetX, file, "$$"); - newXSproto(strcpy(buf, "SetY"),XS_Object_SetY, file, "$$"); - newXSproto(strcpy(buf, "SetZ"),XS_Object_SetZ, file, "$$"); - newXSproto(strcpy(buf, "SetHeading"),XS_Object_SetHeading, file, "$$"); - newXSproto(strcpy(buf, "SetLocation"),XS_Object_SetLocation, file, "$$$$"); - newXSproto(strcpy(buf, "SetItemID"),XS_Object_SetItemID, file, "$$"); - newXSproto(strcpy(buf, "GetItemID"),XS_Object_GetItemID, file, "$"); - newXSproto(strcpy(buf, "SetIcon"),XS_Object_SetIcon, file, "$$"); - newXSproto(strcpy(buf, "GetIcon"),XS_Object_GetIcon, file, "$"); - newXSproto(strcpy(buf, "SetType"),XS_Object_SetType, file, "$$"); - newXSproto(strcpy(buf, "GetType"),XS_Object_GetType, file, "$"); - newXSproto(strcpy(buf, "GetDBID"),XS_Object_GetDBID, file, "$"); - newXSproto(strcpy(buf, "ClearUser"),XS_Object_ClearUser, file, "$"); - newXSproto(strcpy(buf, "SetID"),XS_Object_SetID, file, "$$"); - newXSproto(strcpy(buf, "GetID"),XS_Object_GetID, file, "$"); - newXSproto(strcpy(buf, "Save"),XS_Object_Save, file, "$"); - newXSproto(strcpy(buf, "VarSave"),XS_Object_VarSave, file, "$"); - newXSproto(strcpy(buf, "DeleteItem"),XS_Object_DeleteItem, file, "$$"); - newXSproto(strcpy(buf, "StartDecay"),XS_Object_StartDecay, file, "$$"); - newXSproto(strcpy(buf, "Delete"),XS_Object_Delete, file, "$$"); - newXSproto(strcpy(buf, "IsGroundSpawn"),XS_Object_IsGroundSpawn, file, "$"); - newXSproto(strcpy(buf, "Close"),XS_Object_Close, file, "$"); - newXSproto(strcpy(buf, "GetEntityVariable"), XS_Object_GetEntityVariable, file, "$$"); - newXSproto(strcpy(buf, "SetEntityVariable"), XS_Object_SetEntityVariable, file, "$$$"); - newXSproto(strcpy(buf, "EntityVariableExists"), XS_Object_EntityVariableExists, file, "$$"); - newXSproto(strcpy(buf, "SetSolidType"),XS_Object_SetSolidType, file, "$$"); - newXSproto(strcpy(buf, "GetSolidType"),XS_Object_GetSolidType, file, "$"); - newXSproto(strcpy(buf, "SetSize"),XS_Object_SetSize, file, "$$"); - newXSproto(strcpy(buf, "GetSize"),XS_Object_GetSize, file, "$"); - newXSproto(strcpy(buf, "SetTiltX"),XS_Object_SetTiltX, file, "$$"); - newXSproto(strcpy(buf, "SetTiltY"),XS_Object_SetTiltY, file, "$"); - newXSproto(strcpy(buf, "GetTiltX"),XS_Object_GetTiltX, file, "$$"); - newXSproto(strcpy(buf, "GetTiltY"),XS_Object_GetTiltY, file, "$"); + XS_VERSION_BOOTCHECK; + newXSproto(strcpy(buf, "Depop"), XS_Object_Depop, file, "$"); + newXSproto(strcpy(buf, "Repop"), XS_Object_Repop, file, "$"); + newXSproto(strcpy(buf, "SetModelName"), XS_Object_SetModelName, file, "$$"); + newXSproto(strcpy(buf, "GetModelName"), XS_Object_GetModelName, file, "$"); + newXSproto(strcpy(buf, "GetX"), XS_Object_GetX, file, "$"); + newXSproto(strcpy(buf, "GetY"), XS_Object_GetY, file, "$"); + newXSproto(strcpy(buf, "GetZ"), XS_Object_GetZ, file, "$"); + newXSproto(strcpy(buf, "GetHeading"), XS_Object_GetHeading, file, "$"); + newXSproto(strcpy(buf, "SetX"), XS_Object_SetX, file, "$$"); + newXSproto(strcpy(buf, "SetY"), XS_Object_SetY, file, "$$"); + newXSproto(strcpy(buf, "SetZ"), XS_Object_SetZ, file, "$$"); + newXSproto(strcpy(buf, "SetHeading"), XS_Object_SetHeading, file, "$$"); + newXSproto(strcpy(buf, "SetLocation"), XS_Object_SetLocation, file, "$$$$"); + newXSproto(strcpy(buf, "SetItemID"), XS_Object_SetItemID, file, "$$"); + newXSproto(strcpy(buf, "GetItemID"), XS_Object_GetItemID, file, "$"); + newXSproto(strcpy(buf, "SetIcon"), XS_Object_SetIcon, file, "$$"); + newXSproto(strcpy(buf, "GetIcon"), XS_Object_GetIcon, file, "$"); + newXSproto(strcpy(buf, "SetType"), XS_Object_SetType, file, "$$"); + newXSproto(strcpy(buf, "GetType"), XS_Object_GetType, file, "$"); + newXSproto(strcpy(buf, "GetDBID"), XS_Object_GetDBID, file, "$"); + newXSproto(strcpy(buf, "ClearUser"), XS_Object_ClearUser, file, "$"); + newXSproto(strcpy(buf, "SetID"), XS_Object_SetID, file, "$$"); + newXSproto(strcpy(buf, "GetID"), XS_Object_GetID, file, "$"); + newXSproto(strcpy(buf, "Save"), XS_Object_Save, file, "$"); + newXSproto(strcpy(buf, "VarSave"), XS_Object_VarSave, file, "$"); + newXSproto(strcpy(buf, "DeleteItem"), XS_Object_DeleteItem, file, "$$"); + newXSproto(strcpy(buf, "StartDecay"), XS_Object_StartDecay, file, "$$"); + newXSproto(strcpy(buf, "Delete"), XS_Object_Delete, file, "$$"); + newXSproto(strcpy(buf, "IsGroundSpawn"), XS_Object_IsGroundSpawn, file, "$"); + newXSproto(strcpy(buf, "Close"), XS_Object_Close, file, "$"); + newXSproto(strcpy(buf, "GetEntityVariable"), XS_Object_GetEntityVariable, file, "$$"); + newXSproto(strcpy(buf, "SetEntityVariable"), XS_Object_SetEntityVariable, file, "$$$"); + newXSproto(strcpy(buf, "EntityVariableExists"), XS_Object_EntityVariableExists, file, "$$"); + newXSproto(strcpy(buf, "SetSolidType"), XS_Object_SetSolidType, file, "$$"); + newXSproto(strcpy(buf, "GetSolidType"), XS_Object_GetSolidType, file, "$"); + newXSproto(strcpy(buf, "SetSize"), XS_Object_SetSize, file, "$$"); + newXSproto(strcpy(buf, "GetSize"), XS_Object_GetSize, file, "$"); + newXSproto(strcpy(buf, "SetTiltX"), XS_Object_SetTiltX, file, "$$"); + newXSproto(strcpy(buf, "SetTiltY"), XS_Object_SetTiltY, file, "$"); + newXSproto(strcpy(buf, "GetTiltX"), XS_Object_GetTiltX, file, "$$"); + newXSproto(strcpy(buf, "GetTiltY"), XS_Object_GetTiltY, file, "$"); XSRETURN_YES; } #endif //EMBPERL_XS_CLASSES From d331114f71ff0e760eef6f4a04550ab961bc039b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 20:29:44 -0500 Subject: [PATCH 25/33] Format perl_object.cpp --- zone/perl_object.cpp | 54 ++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/zone/perl_object.cpp b/zone/perl_object.cpp index 062c2c0a3..df2589de4 100644 --- a/zone/perl_object.cpp +++ b/zone/perl_object.cpp @@ -49,7 +49,7 @@ XS(XS_Object_IsGroundSpawn) { Perl_croak(aTHX_ "Usage: Object::IsGroundSpawn(THIS)"); { Object *THIS; - bool RETVAL; + bool RETVAL; if (sv_derived_from(ST(0), "Object")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -96,7 +96,7 @@ XS(XS_Object_Delete) { Perl_croak(aTHX_ "Usage: Object::Delete(THIS, [bool reset_state = false])"); { Object *THIS; - bool reset_state; + bool reset_state; if (sv_derived_from(ST(0), "Object")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -145,7 +145,7 @@ XS(XS_Object_DeleteItem) { Perl_croak(aTHX_ "Usage: Object::DeleteItem(THIS, uint8 index)"); { Object *THIS; - uint8 index = (uint8) SvUV(ST(1)); + uint8 index = (uint8) SvUV(ST(1)); if (sv_derived_from(ST(0), "Object")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -167,7 +167,7 @@ XS(XS_Object_IsObject) { Perl_croak(aTHX_ "Usage: Object::IsObject(THIS)"); { Object *THIS; - bool RETVAL; + bool RETVAL; if (sv_derived_from(ST(0), "Object")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -192,7 +192,7 @@ XS(XS_Object_Save) { Perl_croak(aTHX_ "Usage: Object::Save(THIS)"); { Object *THIS; - bool RETVAL; + bool RETVAL; if (sv_derived_from(ST(0), "Object")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -312,7 +312,7 @@ XS(XS_Object_GetX) { Perl_croak(aTHX_ "Usage: Object::GetX(THIS)"); { Object *THIS; - float RETVAL; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Object")) { @@ -337,7 +337,7 @@ XS(XS_Object_GetY) { Perl_croak(aTHX_ "Usage: Object::GetY(THIS)"); { Object *THIS; - float RETVAL; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Object")) { @@ -362,7 +362,7 @@ XS(XS_Object_GetZ) { Perl_croak(aTHX_ "Usage: Object::GetZ(THIS)"); { Object *THIS; - float RETVAL; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Object")) { @@ -387,7 +387,7 @@ XS(XS_Object_GetHeading) { Perl_croak(aTHX_ "Usage: Object::GetHeading(THIS)"); { Object *THIS; - float RETVAL; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Object")) { @@ -584,9 +584,9 @@ XS(XS_Object_SetLocation) { Perl_croak(aTHX_ "Usage: Object::SetLocation(THIS, float x, float y, float z)"); { Object *THIS; - float x = (float) SvNV(ST(1)); - float y = (float) SvNV(ST(2)); - float z = (float) SvNV(ST(3)); + float x = (float) SvNV(ST(1)); + float y = (float) SvNV(ST(2)); + float z = (float) SvNV(ST(3)); if (sv_derived_from(ST(0), "Object")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -608,7 +608,7 @@ XS(XS_Object_SetX) { Perl_croak(aTHX_ "Usage: Object::SetX(THIS, float x)"); { Object *THIS; - float pos = (float) SvNV(ST(1)); + float pos = (float) SvNV(ST(1)); if (sv_derived_from(ST(0), "Object")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -630,7 +630,7 @@ XS(XS_Object_SetY) { Perl_croak(aTHX_ "Usage: Object::SetY(THIS, float y)"); { Object *THIS; - float pos = (float) SvNV(ST(1)); + float pos = (float) SvNV(ST(1)); if (sv_derived_from(ST(0), "Object")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -652,7 +652,7 @@ XS(XS_Object_SetZ) { Perl_croak(aTHX_ "Usage: Object::SetZ(THIS, float z)"); { Object *THIS; - float pos = (float) SvNV(ST(1)); + float pos = (float) SvNV(ST(1)); if (sv_derived_from(ST(0), "Object")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -674,7 +674,7 @@ XS(XS_Object_SetHeading) { Perl_croak(aTHX_ "Usage: Object::SetHeading(THIS, float heading)"); { Object *THIS; - float heading = (float) SvNV(ST(1)); + float heading = (float) SvNV(ST(1)); if (sv_derived_from(ST(0), "Object")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -787,7 +787,7 @@ XS(XS_Object_GetEntityVariable) { if (items != 2) Perl_croak(aTHX_ "Usage: Object::GetEntityVariable(THIS, string key)"); { - Object *THIS; + Object *THIS; Const_char *id = SvPV_nolen(ST(1)); Const_char *RETVAL; dXSTARG; @@ -814,7 +814,7 @@ XS(XS_Object_EntityVariableExists) { if (items != 2) Perl_croak(aTHX_ "Usage: Object::EntityVariableExists(THIS, string key)"); { - Object *THIS; + Object *THIS; Const_char *id = SvPV_nolen(ST(1)); bool RETVAL; @@ -827,7 +827,7 @@ XS(XS_Object_EntityVariableExists) { Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->EntityVariableExists(id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); @@ -839,8 +839,8 @@ XS(XS_Object_SetEntityVariable) { if (items != 3) Perl_croak(aTHX_ "Usage: Object::SetEntityVariable(THIS, string key, string var)"); { - Object *THIS; - Const_char *id = SvPV_nolen(ST(1)); + Object *THIS; + Const_char *id = SvPV_nolen(ST(1)); const char *var = (const char *) SvPV_nolen(ST(2)); if (sv_derived_from(ST(0), "Object")) { @@ -911,7 +911,7 @@ XS(XS_Object_GetSize) { Perl_croak(aTHX_ "Usage: Object::GetSize(THIS)"); { Object *THIS; - float RETVAL; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Object")) { @@ -937,7 +937,7 @@ XS(XS_Object_SetSize) { Perl_croak(aTHX_ "Usage: Object::SetSize(THIS, float size)"); { Object *THIS; - float size = (float) SvNV(ST(1)); + float size = (float) SvNV(ST(1)); if (sv_derived_from(ST(0), "Object")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -959,7 +959,7 @@ XS(XS_Object_SetTiltX) { Perl_croak(aTHX_ "Usage: Object::SetTiltX(THIS, float tilt_x)"); { Object *THIS; - float pos = (float) SvNV(ST(1)); + float pos = (float) SvNV(ST(1)); if (sv_derived_from(ST(0), "Object")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -981,7 +981,7 @@ XS(XS_Object_SetTiltY) { Perl_croak(aTHX_ "Usage: Object::SetTiltY(THIS, float tilt_y)"); { Object *THIS; - float pos = (float) SvNV(ST(1)); + float pos = (float) SvNV(ST(1)); if (sv_derived_from(ST(0), "Object")) { IV tmp = SvIV((SV *) SvRV(ST(0))); @@ -1003,7 +1003,7 @@ XS(XS_Object_GetTiltX) { Perl_croak(aTHX_ "Usage: Object::GetSize(THIS)"); { Object *THIS; - float RETVAL; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Object")) { @@ -1028,7 +1028,7 @@ XS(XS_Object_GetTiltY) { Perl_croak(aTHX_ "Usage: Object::GetSize(THIS)"); { Object *THIS; - float RETVAL; + float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Object")) { From 57c1cd0be41b8a9587da01d7463948baaffd2b63 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 20:39:07 -0500 Subject: [PATCH 26/33] Add --raid to perl-doc-parser.pl and update usage docs for perl_raids.cpp --- utils/scripts/perl-doc-parser.pl | 9 ++++++++- zone/perl_raids.cpp | 28 ++++++++++++++-------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/utils/scripts/perl-doc-parser.pl b/utils/scripts/perl-doc-parser.pl index 6a0d6f61e..715286f38 100755 --- a/utils/scripts/perl-doc-parser.pl +++ b/utils/scripts/perl-doc-parser.pl @@ -10,6 +10,7 @@ sub usage() { print " --door - Prints methods for just door class methods\n"; print " --object - Prints methods for just object class methods\n"; print " --group - Prints methods for just group class methods\n"; + print " --raid - Prints methods for just raid class methods\n"; print " --corpse - Prints methods for just corpse class methods\n"; print " --hateentry - Prints methods for just hateentry class methods\n"; print " --all - Prints methods for all classes\n"; @@ -52,7 +53,7 @@ for my $file (@files) { chomp; $line = $_; - if ($line=~/Client::|Mob::|Corpse::|EntityList::|Doors::|Group::|HateEntry::|NPC::|Object::/i && $line=~/_croak/i) { + if ($line=~/Client::|Mob::|Corpse::|EntityList::|Doors::|Group::|HateEntry::|NPC::|Object::|Raid::/i && $line=~/_croak/i) { #::: Client export if ($export=~/all|client/i) { @@ -102,6 +103,12 @@ for my $file (@files) { $object_prefix = "\$group->"; } + #::: Raid export + if ($export=~/all|raid/i) { + $split_key = "Raid::"; + $object_prefix = "\$raid->"; + } + #::: Hateentry export if ($export=~/all|hateentry/i) { $split_key = "HateEntry::"; diff --git a/zone/perl_raids.cpp b/zone/perl_raids.cpp index 60d94600a..26964658c 100644 --- a/zone/perl_raids.cpp +++ b/zone/perl_raids.cpp @@ -47,7 +47,7 @@ XS(XS_Raid_IsRaidMember) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Raid::IsRaidMember(THIS, name)"); + Perl_croak(aTHX_ "Usage: Raid::IsRaidMember(THIS, string name)"); { Raid * THIS; bool RETVAL; @@ -74,7 +74,7 @@ XS(XS_Raid_CastGroupSpell) { dXSARGS; if (items != 4) - Perl_croak(aTHX_ "Usage: Raid::CastGroupSpell(THIS, caster, spellid, gid)"); + Perl_croak(aTHX_ "Usage: Raid::CastGroupSpell(THIS, Mob* caster, uint16 spell_id, uint32 group_id)"); { Raid * THIS; Mob* caster; @@ -109,7 +109,7 @@ XS(XS_Raid_GroupCount) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Raid::GroupCount(THIS, gid)"); + Perl_croak(aTHX_ "Usage: Raid::GroupCount(THIS, uint32 group_id)"); { Raid * THIS; uint8 RETVAL; @@ -162,7 +162,7 @@ XS(XS_Raid_GetGroup) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Raid::GetGroup(THIS, name)"); + Perl_croak(aTHX_ "Usage: Raid::GetGroup(THIS, string name)"); { Raid * THIS; uint32 RETVAL; @@ -189,7 +189,7 @@ XS(XS_Raid_SplitExp) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Raid::SplitExp(THIS, exp, other)"); + Perl_croak(aTHX_ "Usage: Raid::SplitExp(THIS, uint32 experience, [Mob* other = nullptr])"); { Raid * THIS; uint32 exp = (uint32)SvUV(ST(1)); @@ -223,7 +223,7 @@ XS(XS_Raid_GetTotalRaidDamage) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Raid::GetTotalRaidDamage(THIS, other)"); + Perl_croak(aTHX_ "Usage: Raid::GetTotalRaidDamage(THIS, [Mob* other = nullptr])"); { Raid * THIS; uint32 RETVAL; @@ -259,7 +259,7 @@ XS(XS_Raid_SplitMoney) { dXSARGS; if (items != 5) - Perl_croak(aTHX_ "Usage: Raid::SplitMoney(THIS, copper, silver, gold, platinum)"); + Perl_croak(aTHX_ "Usage: Raid::SplitMoney(THIS, uint32 copper, uint32 silver, uint32 gold, uint32 platinum)"); { Raid * THIS; uint32 copper = (uint32)SvUV(ST(1)); @@ -286,7 +286,7 @@ XS(XS_Raid_BalanceHP) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Raid::BalanceHP(THIS, penalty, gid)"); + Perl_croak(aTHX_ "Usage: Raid::BalanceHP(THIS, int32 penalty, uint32 group_id)"); { Raid * THIS; int32 penalty = (int32)SvUV(ST(1)); @@ -311,7 +311,7 @@ XS(XS_Raid_IsLeader) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Raid::IsLeader(THIS, name)"); + Perl_croak(aTHX_ "Usage: Raid::IsLeader(THIS, string name)"); { Raid * THIS; bool RETVAL; @@ -338,7 +338,7 @@ XS(XS_Raid_IsGroupLeader) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Raid::IsGroupLeader(THIS, who)"); + Perl_croak(aTHX_ "Usage: Raid::IsGroupLeader(THIS, string name)"); { Raid * THIS; bool RETVAL; @@ -417,7 +417,7 @@ XS(XS_Raid_GetClientByIndex) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Raid::GetClientByIndex(THIS, index)"); + Perl_croak(aTHX_ "Usage: Raid::GetClientByIndex(THIS, uint16 raid_indez)"); { Raid * THIS; Client * RETVAL; @@ -444,7 +444,7 @@ XS(XS_Raid_TeleportGroup) { dXSARGS; if (items != 8) - Perl_croak(aTHX_ "Usage: Raid::TeleportGroup(THIS, sender, zoneID, x, y, z, heading, gid)"); + Perl_croak(aTHX_ "Usage: Raid::TeleportGroup(THIS, Mob* sender, uint32 zone_id, float x, float y, float z, float heading, uint32 group_id)"); { Raid * THIS; Mob* sender; @@ -483,7 +483,7 @@ XS(XS_Raid_TeleportRaid) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ "Usage: Raid::TeleportRaid(THIS, sender, zoneID, x, y, z, heading)"); + Perl_croak(aTHX_ "Usage: Raid::TeleportRaid(THIS, Mob* sender, uint32 zone_id, float x, float y, float z, float heading)"); { Raid * THIS; Mob* sender; @@ -547,7 +547,7 @@ XS(XS_Raid_GetMember) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Raid::GetMember(THIS, index)"); + Perl_croak(aTHX_ "Usage: Raid::GetMember(THIS, int raid_index)"); { Raid * THIS; Client* RETVAL = nullptr; From 94aa271a84f183e3a6a58194eacb6e840da98db7 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 20:39:21 -0500 Subject: [PATCH 27/33] perl_raids.cpp formatting --- zone/perl_raids.cpp | 473 +++++++++++++++++++++----------------------- 1 file changed, 221 insertions(+), 252 deletions(-) diff --git a/zone/perl_raids.cpp b/zone/perl_raids.cpp index 26964658c..f5b91448e 100644 --- a/zone/perl_raids.cpp +++ b/zone/perl_raids.cpp @@ -26,7 +26,9 @@ */ #include "../common/features.h" + #ifdef EMBPERL_XS_CLASSES + #include "../common/global_define.h" #include "embperl.h" @@ -43,60 +45,55 @@ XS(XS_Raid_IsRaidMember); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Raid_IsRaidMember) -{ +XS(XS_Raid_IsRaidMember) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Raid::IsRaidMember(THIS, string name)"); { - Raid * THIS; - bool RETVAL; - const char* name = (char *)SvPV_nolen(ST(1)); + Raid *THIS; + bool RETVAL; + const char *name = (char *) SvPV_nolen(ST(1)); if (sv_derived_from(ST(0), "Raid")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Raid *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Raid *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsRaidMember(name); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Raid_CastGroupSpell); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Raid_CastGroupSpell) -{ +XS(XS_Raid_CastGroupSpell) { dXSARGS; if (items != 4) Perl_croak(aTHX_ "Usage: Raid::CastGroupSpell(THIS, Mob* caster, uint16 spell_id, uint32 group_id)"); { - Raid * THIS; - Mob* caster; - uint16 spellid = (uint16)SvUV(ST(2)); - uint32 gid = (uint32)SvUV(ST(3)); + Raid *THIS; + Mob *caster; + uint16 spellid = (uint16) SvUV(ST(2)); + uint32 gid = (uint32) SvUV(ST(3)); if (sv_derived_from(ST(0), "Raid")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Raid *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Raid *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - caster = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + caster = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "caster is not of type Mob"); - if(caster == nullptr) + if (caster == nullptr) Perl_croak(aTHX_ "caster is nullptr, avoiding crash."); THIS->CastGroupSpell(caster, spellid, gid); @@ -105,112 +102,106 @@ XS(XS_Raid_CastGroupSpell) } XS(XS_Raid_GroupCount); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Raid_GroupCount) -{ +XS(XS_Raid_GroupCount) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Raid::GroupCount(THIS, uint32 group_id)"); { - Raid * THIS; - uint8 RETVAL; + Raid *THIS; + uint8 RETVAL; dXSTARG; - uint32 gid = (uint32)SvUV(ST(1)); + uint32 gid = (uint32) SvUV(ST(1)); if (sv_derived_from(ST(0), "Raid")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Raid *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Raid *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GroupCount(gid); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Raid_RaidCount); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Raid_RaidCount) -{ +XS(XS_Raid_RaidCount) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Raid::RaidCount(THIS)"); { - Raid * THIS; - uint8 RETVAL; + Raid *THIS; + uint8 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Raid")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Raid *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Raid *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RaidCount(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Raid_GetGroup); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Raid_GetGroup) -{ +XS(XS_Raid_GetGroup) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Raid::GetGroup(THIS, string name)"); { - Raid * THIS; - uint32 RETVAL; + Raid *THIS; + uint32 RETVAL; dXSTARG; - const char* name = (char *)SvPV_nolen(ST(1)); + const char *name = (char *) SvPV_nolen(ST(1)); if (sv_derived_from(ST(0), "Raid")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Raid *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Raid *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGroup(name); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Raid_SplitExp); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Raid_SplitExp) -{ +XS(XS_Raid_SplitExp) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Raid::SplitExp(THIS, uint32 experience, [Mob* other = nullptr])"); { - Raid * THIS; - uint32 exp = (uint32)SvUV(ST(1)); - Mob* other; + Raid *THIS; + uint32 exp = (uint32) SvUV(ST(1)); + Mob *other; if (sv_derived_from(ST(0), "Raid")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Raid *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Raid *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(2), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(2))); - other = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(2))); + other = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == nullptr) + if (other == nullptr) Perl_croak(aTHX_ "other is nullptr, avoiding crash."); THIS->SplitExp(exp, other); @@ -219,61 +210,57 @@ XS(XS_Raid_SplitExp) } XS(XS_Raid_GetTotalRaidDamage); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Raid_GetTotalRaidDamage) -{ +XS(XS_Raid_GetTotalRaidDamage) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Raid::GetTotalRaidDamage(THIS, [Mob* other = nullptr])"); { - Raid * THIS; - uint32 RETVAL; + Raid *THIS; + uint32 RETVAL; dXSTARG; - Mob* other; + Mob *other; if (sv_derived_from(ST(0), "Raid")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Raid *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Raid *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - other = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + other = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == nullptr) + if (other == nullptr) Perl_croak(aTHX_ "other is nullptr, avoiding crash."); RETVAL = THIS->GetTotalRaidDamage(other); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Raid_SplitMoney); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Raid_SplitMoney) -{ +XS(XS_Raid_SplitMoney) { dXSARGS; if (items != 5) Perl_croak(aTHX_ "Usage: Raid::SplitMoney(THIS, uint32 copper, uint32 silver, uint32 gold, uint32 platinum)"); { - Raid * THIS; - uint32 copper = (uint32)SvUV(ST(1)); - uint32 silver = (uint32)SvUV(ST(2)); - uint32 gold = (uint32)SvUV(ST(3)); - uint32 platinum = (uint32)SvUV(ST(4)); + Raid *THIS; + uint32 copper = (uint32) SvUV(ST(1)); + uint32 silver = (uint32) SvUV(ST(2)); + uint32 gold = (uint32) SvUV(ST(3)); + uint32 platinum = (uint32) SvUV(ST(4)); if (sv_derived_from(ST(0), "Raid")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Raid *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Raid *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SplitMoney(copper, silver, gold, platinum); @@ -282,23 +269,21 @@ XS(XS_Raid_SplitMoney) } XS(XS_Raid_BalanceHP); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Raid_BalanceHP) -{ +XS(XS_Raid_BalanceHP) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: Raid::BalanceHP(THIS, int32 penalty, uint32 group_id)"); { - Raid * THIS; - int32 penalty = (int32)SvUV(ST(1)); - uint32 gid = (uint32)SvUV(ST(2)); + Raid *THIS; + int32 penalty = (int32) SvUV(ST(1)); + uint32 gid = (uint32) SvUV(ST(2)); if (sv_derived_from(ST(0), "Raid")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Raid *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Raid *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->BalanceHP(penalty, gid); @@ -307,170 +292,160 @@ XS(XS_Raid_BalanceHP) } XS(XS_Raid_IsLeader); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Raid_IsLeader) -{ +XS(XS_Raid_IsLeader) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Raid::IsLeader(THIS, string name)"); { - Raid * THIS; - bool RETVAL; - const char* name = (char *)SvPV_nolen(ST(1)); + Raid *THIS; + bool RETVAL; + const char *name = (char *) SvPV_nolen(ST(1)); if (sv_derived_from(ST(0), "Raid")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Raid *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Raid *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsLeader(name); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Raid_IsGroupLeader); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Raid_IsGroupLeader) -{ +XS(XS_Raid_IsGroupLeader) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Raid::IsGroupLeader(THIS, string name)"); { - Raid * THIS; - bool RETVAL; - const char* who = (char *)SvPV_nolen(ST(1)); + Raid *THIS; + bool RETVAL; + const char *who = (char *) SvPV_nolen(ST(1)); if (sv_derived_from(ST(0), "Raid")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Raid *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Raid *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsGroupLeader(who); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_Raid_GetHighestLevel); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Raid_GetHighestLevel) -{ +XS(XS_Raid_GetHighestLevel) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Raid::GetHighestLevel(THIS)"); { - Raid * THIS; - uint32 RETVAL; + Raid *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Raid")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Raid *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Raid *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHighestLevel(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Raid_GetLowestLevel); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Raid_GetLowestLevel) -{ +XS(XS_Raid_GetLowestLevel) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Raid::GetLowestLevel(THIS)"); { - Raid * THIS; - uint32 RETVAL; + Raid *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Raid")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Raid *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Raid *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLowestLevel(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Raid_GetClientByIndex); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Raid_GetClientByIndex) -{ +XS(XS_Raid_GetClientByIndex) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Raid::GetClientByIndex(THIS, uint16 raid_indez)"); { - Raid * THIS; - Client * RETVAL; - uint16 index = (uint16)SvUV(ST(1)); + Raid *THIS; + Client *RETVAL; + uint16 index = (uint16) SvUV(ST(1)); if (sv_derived_from(ST(0), "Raid")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Raid *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Raid *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetClientByIndex(index); - ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Client", (void*)RETVAL); + ST(0) = sv_newmortal(); + sv_setref_pv(ST(0), "Client", (void *) RETVAL); } XSRETURN(1); } XS(XS_Raid_TeleportGroup); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Raid_TeleportGroup) -{ +XS(XS_Raid_TeleportGroup) { dXSARGS; if (items != 8) - Perl_croak(aTHX_ "Usage: Raid::TeleportGroup(THIS, Mob* sender, uint32 zone_id, float x, float y, float z, float heading, uint32 group_id)"); + Perl_croak(aTHX_ + "Usage: Raid::TeleportGroup(THIS, Mob* sender, uint32 zone_id, float x, float y, float z, float heading, uint32 group_id)"); { - Raid * THIS; - Mob* sender; - uint32 zoneID = (uint32)SvUV(ST(2)); - float x = (float)SvNV(ST(3)); - float y = (float)SvNV(ST(4)); - float z = (float)SvNV(ST(5)); - float heading = (float)SvNV(ST(6)); - uint32 gid = (uint32)SvUV(ST(7)); + Raid *THIS; + Mob *sender; + uint32 zoneID = (uint32) SvUV(ST(2)); + float x = (float) SvNV(ST(3)); + float y = (float) SvNV(ST(4)); + float z = (float) SvNV(ST(5)); + float heading = (float) SvNV(ST(6)); + uint32 gid = (uint32) SvUV(ST(7)); if (sv_derived_from(ST(0), "Raid")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Raid *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Raid *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - sender = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + sender = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "sender is not of type Mob"); - if(sender == nullptr) + if (sender == nullptr) Perl_croak(aTHX_ "sender is nullptr, avoiding crash."); THIS->TeleportGroup(sender, zoneID, 0, x, y, z, heading, gid); @@ -479,36 +454,34 @@ XS(XS_Raid_TeleportGroup) } XS(XS_Raid_TeleportRaid); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Raid_TeleportRaid) -{ +XS(XS_Raid_TeleportRaid) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ "Usage: Raid::TeleportRaid(THIS, Mob* sender, uint32 zone_id, float x, float y, float z, float heading)"); + Perl_croak(aTHX_ + "Usage: Raid::TeleportRaid(THIS, Mob* sender, uint32 zone_id, float x, float y, float z, float heading)"); { - Raid * THIS; - Mob* sender; - uint32 zoneID = (uint32)SvUV(ST(2)); - float x = (float)SvNV(ST(3)); - float y = (float)SvNV(ST(4)); - float z = (float)SvNV(ST(5)); - float heading = (float)SvNV(ST(6)); + Raid *THIS; + Mob *sender; + uint32 zoneID = (uint32) SvUV(ST(2)); + float x = (float) SvNV(ST(3)); + float y = (float) SvNV(ST(4)); + float z = (float) SvNV(ST(5)); + float heading = (float) SvNV(ST(6)); if (sv_derived_from(ST(0), "Raid")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Raid *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Raid *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { - IV tmp = SvIV((SV*)SvRV(ST(1))); - sender = INT2PTR(Mob *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(1))); + sender = INT2PTR(Mob *, tmp); + } else Perl_croak(aTHX_ "sender is not of type Mob"); - if(sender == nullptr) + if (sender == nullptr) Perl_croak(aTHX_ "sender is nullptr, avoiding crash."); THIS->TeleportRaid(sender, zoneID, 0, x, y, z, heading); @@ -517,61 +490,58 @@ XS(XS_Raid_TeleportRaid) } XS(XS_Raid_GetID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Raid_GetID) -{ +XS(XS_Raid_GetID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Raid::GetID(THIS)"); { - Raid * THIS; - uint32 RETVAL; + Raid *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Raid")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Raid *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Raid *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetID(); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } XSRETURN(1); } XS(XS_Raid_GetMember); -XS(XS_Raid_GetMember) -{ +XS(XS_Raid_GetMember) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Raid::GetMember(THIS, int raid_index)"); { - Raid * THIS; - Client* RETVAL = nullptr; + Raid *THIS; + Client *RETVAL = nullptr; dXSTARG; if (sv_derived_from(ST(0), "Raid")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(Raid *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(Raid *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - int index = (int)SvUV(ST(1)); + int index = (int) SvUV(ST(1)); if (index < 0 || index > 71) RETVAL = nullptr; else { - if(THIS->members[index].member != nullptr) + if (THIS->members[index].member != nullptr) RETVAL = THIS->members[index].member->CastToClient(); } - ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "Client", (void*)RETVAL); + ST(0) = sv_newmortal(); + sv_setref_pv(ST(0), "Client", (void *) RETVAL); } XSRETURN(1); } @@ -580,39 +550,38 @@ XS(XS_Raid_GetMember) extern "C" #endif XS(boot_Raid); /* prototype to pass -Wmissing-prototypes */ -XS(boot_Raid) -{ +XS(boot_Raid) { dXSARGS; char file[256]; strncpy(file, __FILE__, 256); file[255] = 0; - if(items != 1) + if (items != 1) fprintf(stderr, "boot_quest does not take any arguments."); char buf[128]; //add the strcpy stuff to get rid of const warnings.... - XS_VERSION_BOOTCHECK ; + XS_VERSION_BOOTCHECK; - newXSproto(strcpy(buf, "IsRaidMember"), XS_Raid_IsRaidMember, file, "$$"); - newXSproto(strcpy(buf, "CastGroupSpell"), XS_Raid_CastGroupSpell, file, "$$$$"); - newXSproto(strcpy(buf, "GroupCount"), XS_Raid_GroupCount, file, "$$"); - newXSproto(strcpy(buf, "RaidCount"), XS_Raid_RaidCount, file, "$"); - newXSproto(strcpy(buf, "GetGroup"), XS_Raid_GetGroup, file, "$$"); - newXSproto(strcpy(buf, "SplitExp"), XS_Raid_SplitExp, file, "$$$"); - newXSproto(strcpy(buf, "GetTotalRaidDamage"), XS_Raid_GetTotalRaidDamage, file, "$$"); - newXSproto(strcpy(buf, "SplitMoney"), XS_Raid_SplitMoney, file, "$$$$$"); - newXSproto(strcpy(buf, "BalanceHP"), XS_Raid_BalanceHP, file, "$$$"); - newXSproto(strcpy(buf, "IsLeader"), XS_Raid_IsLeader, file, "$$"); - newXSproto(strcpy(buf, "IsGroupLeader"), XS_Raid_IsGroupLeader, file, "$$"); - newXSproto(strcpy(buf, "GetHighestLevel"), XS_Raid_GetHighestLevel, file, "$"); - newXSproto(strcpy(buf, "GetLowestLevel"), XS_Raid_GetLowestLevel, file, "$"); - newXSproto(strcpy(buf, "GetClientByIndex"), XS_Raid_GetClientByIndex, file, "$$"); - newXSproto(strcpy(buf, "TeleportGroup"), XS_Raid_TeleportGroup, file, "$$$$$$$$"); - newXSproto(strcpy(buf, "TeleportRaid"), XS_Raid_TeleportRaid, file, "$$$$$$$"); - newXSproto(strcpy(buf, "GetID"), XS_Raid_GetID, file, "$"); - newXSproto(strcpy(buf, "GetMember"), XS_Raid_GetMember, file, "$$"); + newXSproto(strcpy(buf, "IsRaidMember"), XS_Raid_IsRaidMember, file, "$$"); + newXSproto(strcpy(buf, "CastGroupSpell"), XS_Raid_CastGroupSpell, file, "$$$$"); + newXSproto(strcpy(buf, "GroupCount"), XS_Raid_GroupCount, file, "$$"); + newXSproto(strcpy(buf, "RaidCount"), XS_Raid_RaidCount, file, "$"); + newXSproto(strcpy(buf, "GetGroup"), XS_Raid_GetGroup, file, "$$"); + newXSproto(strcpy(buf, "SplitExp"), XS_Raid_SplitExp, file, "$$$"); + newXSproto(strcpy(buf, "GetTotalRaidDamage"), XS_Raid_GetTotalRaidDamage, file, "$$"); + newXSproto(strcpy(buf, "SplitMoney"), XS_Raid_SplitMoney, file, "$$$$$"); + newXSproto(strcpy(buf, "BalanceHP"), XS_Raid_BalanceHP, file, "$$$"); + newXSproto(strcpy(buf, "IsLeader"), XS_Raid_IsLeader, file, "$$"); + newXSproto(strcpy(buf, "IsGroupLeader"), XS_Raid_IsGroupLeader, file, "$$"); + newXSproto(strcpy(buf, "GetHighestLevel"), XS_Raid_GetHighestLevel, file, "$"); + newXSproto(strcpy(buf, "GetLowestLevel"), XS_Raid_GetLowestLevel, file, "$"); + newXSproto(strcpy(buf, "GetClientByIndex"), XS_Raid_GetClientByIndex, file, "$$"); + newXSproto(strcpy(buf, "TeleportGroup"), XS_Raid_TeleportGroup, file, "$$$$$$$$"); + newXSproto(strcpy(buf, "TeleportRaid"), XS_Raid_TeleportRaid, file, "$$$$$$$"); + newXSproto(strcpy(buf, "GetID"), XS_Raid_GetID, file, "$"); + newXSproto(strcpy(buf, "GetMember"), XS_Raid_GetMember, file, "$$"); XSRETURN_YES; } From 9e03d762115ebd19c7669d1040317ddde9c6ad88 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 20:45:24 -0500 Subject: [PATCH 28/33] perl-doc-parser.pl fix --all option --- utils/scripts/perl-doc-parser.pl | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/utils/scripts/perl-doc-parser.pl b/utils/scripts/perl-doc-parser.pl index 715286f38..3ffdeb3b8 100755 --- a/utils/scripts/perl-doc-parser.pl +++ b/utils/scripts/perl-doc-parser.pl @@ -10,7 +10,7 @@ sub usage() { print " --door - Prints methods for just door class methods\n"; print " --object - Prints methods for just object class methods\n"; print " --group - Prints methods for just group class methods\n"; - print " --raid - Prints methods for just raid class methods\n"; + print " --raid - Prints methods for just raid class methods\n"; print " --corpse - Prints methods for just corpse class methods\n"; print " --hateentry - Prints methods for just hateentry class methods\n"; print " --all - Prints methods for all classes\n"; @@ -47,7 +47,7 @@ for my $file (@files) { @methods = (); #::: Open File - print "Opening '" . $file . "'\n"; + print "\nOpening '" . $file . "'\n"; open (FILE, $file); while () { chomp; @@ -56,61 +56,61 @@ for my $file (@files) { if ($line=~/Client::|Mob::|Corpse::|EntityList::|Doors::|Group::|HateEntry::|NPC::|Object::|Raid::/i && $line=~/_croak/i) { #::: Client export - if ($export=~/all|client/i) { + if ($export=~/all|client/i && $line=~/Client::/i) { $split_key = "Client::"; $object_prefix = "\$client->"; } #::: Mob export - if ($export=~/all|mob/i) { + if ($export=~/all|mob/i && $line=~/Mob::/i) { $split_key = "Mob::"; $object_prefix = "\$mob->"; } #::: NPC export - if ($export=~/all|npc/i) { + if ($export=~/all|npc/i && $line=~/NPC::/i) { $split_key = "NPC::"; $object_prefix = "\$npc->"; } #::: Corpse export - if ($export=~/all|corpse/i) { + if ($export=~/all|corpse/i && $line=~/Corpse::/i) { $split_key = "Corpse::"; $object_prefix = "\$corpse->"; } #::: Entity export - if ($export=~/all|entity/i) { + if ($export=~/all|entity/i && $line=~/EntityList::/i) { $split_key = "EntityList::"; $object_prefix = "\$entity_list->"; } #::: Doors export - if ($export=~/all|door/i) { + if ($export=~/all|door/i && $line=~/Doors::/i) { $split_key = "Doors::"; $object_prefix = "\$door->"; } #::: Object export - if ($export=~/all|object/i) { + if ($export=~/all|object/i && $line=~/Object::/i) { $split_key = "Object::"; $object_prefix = "\$object->"; } #::: Group export - if ($export=~/all|group/i) { + if ($export=~/all|group/i && $line=~/Group::/i) { $split_key = "Group::"; $object_prefix = "\$group->"; } #::: Raid export - if ($export=~/all|raid/i) { + if ($export=~/all|raid/i && $line=~/Raid::/i) { $split_key = "Raid::"; $object_prefix = "\$raid->"; } #::: Hateentry export - if ($export=~/all|hateentry/i) { + if ($export=~/all|hateentry/i && $line=~/HateEntry::/i) { $split_key = "HateEntry::"; $object_prefix = "\$hate_entry->"; } From 595138679d0acfc2010375685d8dbb61b7f044a6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 20:52:56 -0500 Subject: [PATCH 29/33] add --questitem to perl-doc-parser.pl - format and add usage doc to perl_questitem.cpp --- utils/scripts/perl-doc-parser.pl | 11 +- zone/perl_questitem.cpp | 192 +++++++++++++++---------------- 2 files changed, 101 insertions(+), 102 deletions(-) diff --git a/utils/scripts/perl-doc-parser.pl b/utils/scripts/perl-doc-parser.pl index 3ffdeb3b8..8f5f5ac7e 100755 --- a/utils/scripts/perl-doc-parser.pl +++ b/utils/scripts/perl-doc-parser.pl @@ -11,6 +11,7 @@ sub usage() { print " --object - Prints methods for just object class methods\n"; print " --group - Prints methods for just group class methods\n"; print " --raid - Prints methods for just raid class methods\n"; + print " --questitem - Prints methods for just questitem class methods\n"; print " --corpse - Prints methods for just corpse class methods\n"; print " --hateentry - Prints methods for just hateentry class methods\n"; print " --all - Prints methods for all classes\n"; @@ -45,6 +46,8 @@ for my $file (@files) { } @methods = (); + $split_key = ""; + $object_prefix = ""; #::: Open File print "\nOpening '" . $file . "'\n"; @@ -53,7 +56,7 @@ for my $file (@files) { chomp; $line = $_; - if ($line=~/Client::|Mob::|Corpse::|EntityList::|Doors::|Group::|HateEntry::|NPC::|Object::|Raid::/i && $line=~/_croak/i) { + if ($line=~/Perl_croak/i && $line=~/Usa/i && $line=~/::/i) { #::: Client export if ($export=~/all|client/i && $line=~/Client::/i) { @@ -115,6 +118,12 @@ for my $file (@files) { $object_prefix = "\$hate_entry->"; } + #::: Hateentry export + if ($export=~/all|questitem/i && $line=~/QuestItem::/i) { + $split_key = "QuestItem::"; + $object_prefix = "\$quest_item->"; + } + #::: Split on croak usage @data = split($split_key, $line); $usage = trim($data[1]); diff --git a/zone/perl_questitem.cpp b/zone/perl_questitem.cpp index 742a00814..6d728e65e 100644 --- a/zone/perl_questitem.cpp +++ b/zone/perl_questitem.cpp @@ -18,7 +18,9 @@ #include "../common/features.h" #include "client.h" + #ifdef EMBPERL_XS_CLASSES + #include "../common/global_define.h" #include "embperl.h" @@ -28,7 +30,7 @@ #include "../common/item_instance.h" -#ifdef THIS /* this macro seems to leak out on some systems */ +#ifdef THIS /* this macro seems to leak out on some systems */ #undef THIS #endif @@ -38,76 +40,73 @@ XS(XS_QuestItem_GetName) { if (items != 1) Perl_croak(aTHX_ "Usage: QuestItem::GetName(THIS)"); { - EQEmu::ItemInstance * THIS; - Const_char * RETVAL; + EQEmu::ItemInstance *THIS; + Const_char *RETVAL; dXSTARG; if (sv_derived_from(ST(0), "QuestItem")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EQEmu::ItemInstance *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EQEmu::ItemInstance *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EQEmu::ItemInstance"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetItem()->Name; - sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; + sv_setpv(TARG, RETVAL); + XSprePUSH; + PUSHTARG; } XSRETURN(1); } XS(XS_QuestItem_SetScale); -XS(XS_QuestItem_SetScale) -{ +XS(XS_QuestItem_SetScale) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: QuestItem::SetScale(THIS, scale factor)"); + Perl_croak(aTHX_ "Usage: QuestItem::SetScale(THIS, float scale_multiplier)"); { - EQEmu::ItemInstance * THIS; - float Mult; + EQEmu::ItemInstance *THIS; + float Mult; if (sv_derived_from(ST(0), "QuestItem")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EQEmu::ItemInstance *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EQEmu::ItemInstance *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EQEmu::ItemInstance"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - Mult = (float)SvNV(ST(1)); + Mult = (float) SvNV(ST(1)); - if(THIS->IsScaling()) { - THIS->SetExp((int)(Mult*10000+.5)); + if (THIS->IsScaling()) { + THIS->SetExp((int) (Mult * 10000 + .5)); } } XSRETURN_EMPTY; } XS(XS_QuestItem_ItemSay); -XS(XS_QuestItem_ItemSay) -{ +XS(XS_QuestItem_ItemSay) { dXSARGS; if (items != 2 && items != 3) - Perl_croak(aTHX_ "Usage: QuestItem::ItemSay(THIS, text [, language])"); + Perl_croak(aTHX_ "Usage: QuestItem::ItemSay(THIS, string text [int language_id])"); { - EQEmu::ItemInstance* THIS; - Const_char* text; - int lang = 0; + EQEmu::ItemInstance *THIS; + Const_char *text; + int lang = 0; if (sv_derived_from(ST(0), "QuestItem")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EQEmu::ItemInstance *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EQEmu::ItemInstance *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EQEmu::ItemInstance"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - text = SvPV_nolen(ST(1)); - if(items == 3) - lang = (int)SvUV(ST(2)); + text = SvPV_nolen(ST(1)); + if (items == 3) + lang = (int) SvUV(ST(2)); quest_manager.GetInitiator()->ChannelMessageSend(THIS->GetItem()->Name, 0, 8, lang, 100, text); } @@ -115,49 +114,45 @@ XS(XS_QuestItem_ItemSay) } XS(XS_QuestItem_IsType); /* prototype to pass -Wmissing-prototypes */ -XS(XS_QuestItem_IsType) -{ +XS(XS_QuestItem_IsType) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: QuestItem::IsType(THIS, type)"); { - EQEmu::ItemInstance* THIS; - bool RETVAL; - uint32 type = (int32)SvIV(ST(1)); + EQEmu::ItemInstance *THIS; + bool RETVAL; + uint32 type = (int32) SvIV(ST(1)); if (sv_derived_from(ST(0), "QuestItem")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EQEmu::ItemInstance *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EQEmu::ItemInstance *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EQEmu::ItemInstance"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - RETVAL = THIS->IsType((EQEmu::item::ItemClass)type); - ST(0) = boolSV(RETVAL); + RETVAL = THIS->IsType((EQEmu::item::ItemClass) type); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_QuestItem_IsAttuned); /* prototype to pass -Wmissing-prototypes */ -XS(XS_QuestItem_IsAttuned) -{ +XS(XS_QuestItem_IsAttuned) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: QuestItem::IsAttuned(THIS)"); { - EQEmu::ItemInstance* THIS; - bool RETVAL; + EQEmu::ItemInstance *THIS; + bool RETVAL; if (sv_derived_from(ST(0), "QuestItem")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EQEmu::ItemInstance *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EQEmu::ItemInstance *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EQEmu::ItemInstance"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsAttuned(); @@ -168,80 +163,76 @@ XS(XS_QuestItem_IsAttuned) } XS(XS_QuestItem_GetCharges); /* prototype to pass -Wmissing-prototypes */ -XS(XS_QuestItem_GetCharges) -{ +XS(XS_QuestItem_GetCharges) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: QuestItem::GetCharges(THIS)"); { - EQEmu::ItemInstance* THIS; - int16 RETVAL; + EQEmu::ItemInstance *THIS; + int16 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "QuestItem")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EQEmu::ItemInstance *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EQEmu::ItemInstance *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EQEmu::ItemInstance"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCharges(); - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } XS(XS_QuestItem_GetAugment); /* prototype to pass -Wmissing-prototypes */ -XS(XS_QuestItem_GetAugment) -{ +XS(XS_QuestItem_GetAugment) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: QuestItem::GetAugment(THIS, augment_id)"); + Perl_croak(aTHX_ "Usage: QuestItem::GetAugment(THIS, int16 slot_id)"); { - EQEmu::ItemInstance* THIS; - int16 slot_id = (int16)SvIV(ST(1)); - EQEmu::ItemInstance* RETVAL; + EQEmu::ItemInstance *THIS; + int16 slot_id = (int16) SvIV(ST(1)); + EQEmu::ItemInstance *RETVAL; if (sv_derived_from(ST(0), "QuestItem")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EQEmu::ItemInstance *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EQEmu::ItemInstance *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EQEmu::ItemInstance"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAugment(slot_id); ST(0) = sv_newmortal(); - sv_setref_pv(ST(0), "QuestItem", (void*)RETVAL); + sv_setref_pv(ST(0), "QuestItem", (void *) RETVAL); } XSRETURN(1); } XS(XS_QuestItem_GetID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_QuestItem_GetID) -{ +XS(XS_QuestItem_GetID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: QuestItem::GetID(THIS)"); { - EQEmu::ItemInstance* THIS; - uint32 RETVAL; + EQEmu::ItemInstance *THIS; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "QuestItem")) { - IV tmp = SvIV((SV*)SvRV(ST(0))); - THIS = INT2PTR(EQEmu::ItemInstance *,tmp); - } - else + IV tmp = SvIV((SV *) SvRV(ST(0))); + THIS = INT2PTR(EQEmu::ItemInstance *, tmp); + } else Perl_croak(aTHX_ "THIS is not of type EQEmu::ItemInstance"); - if(THIS == nullptr) + if (THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetItem()->ID; - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); } XSRETURN(1); } @@ -251,29 +242,28 @@ extern "C" #endif XS(boot_QuestItem); -XS(boot_QuestItem) -{ +XS(boot_QuestItem) { dXSARGS; char file[256]; strncpy(file, __FILE__, 256); file[255] = 0; - if(items != 1) + if (items != 1) fprintf(stderr, "boot_quest does not take any arguments."); char buf[128]; //add the strcpy stuff to get rid of const warnings.... - XS_VERSION_BOOTCHECK ; + XS_VERSION_BOOTCHECK; - newXSproto(strcpy(buf, "GetName"), XS_QuestItem_GetName, file, "$"); - newXSproto(strcpy(buf, "SetScale"), XS_QuestItem_SetScale, file, "$"); - newXSproto(strcpy(buf, "ItemSay"), XS_QuestItem_ItemSay, file, "$"); - newXSproto(strcpy(buf, "IsType"), XS_QuestItem_IsType, file, "$$"); - newXSproto(strcpy(buf, "IsAttuned"), XS_QuestItem_IsAttuned, file, "$"); - newXSproto(strcpy(buf, "GetCharges"), XS_QuestItem_GetCharges, file, "$"); - newXSproto(strcpy(buf, "GetAugment"), XS_QuestItem_GetAugment, file, "$$"); - newXSproto(strcpy(buf, "GetID"), XS_QuestItem_GetID, file, "$"); + newXSproto(strcpy(buf, "GetName"), XS_QuestItem_GetName, file, "$"); + newXSproto(strcpy(buf, "SetScale"), XS_QuestItem_SetScale, file, "$"); + newXSproto(strcpy(buf, "ItemSay"), XS_QuestItem_ItemSay, file, "$"); + newXSproto(strcpy(buf, "IsType"), XS_QuestItem_IsType, file, "$$"); + newXSproto(strcpy(buf, "IsAttuned"), XS_QuestItem_IsAttuned, file, "$"); + newXSproto(strcpy(buf, "GetCharges"), XS_QuestItem_GetCharges, file, "$"); + newXSproto(strcpy(buf, "GetAugment"), XS_QuestItem_GetAugment, file, "$$"); + newXSproto(strcpy(buf, "GetID"), XS_QuestItem_GetID, file, "$"); XSRETURN_YES; } From 5b6f9d3bfb89efbd960abca9aede621be3f86324 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 21:47:34 -0500 Subject: [PATCH 30/33] Add --quest to perl-doc-parser.pl and update usage doc in embparser_api.cpp for quest:: --- utils/scripts/perl-doc-parser.pl | 21 +- zone/embparser_api.cpp | 430 +++++++++++++++---------------- 2 files changed, 231 insertions(+), 220 deletions(-) diff --git a/utils/scripts/perl-doc-parser.pl b/utils/scripts/perl-doc-parser.pl index 8f5f5ac7e..295ba96a4 100755 --- a/utils/scripts/perl-doc-parser.pl +++ b/utils/scripts/perl-doc-parser.pl @@ -14,6 +14,7 @@ sub usage() { print " --questitem - Prints methods for just questitem class methods\n"; print " --corpse - Prints methods for just corpse class methods\n"; print " --hateentry - Prints methods for just hateentry class methods\n"; + print " --quest - Prints methods for just quest class methods\n"; print " --all - Prints methods for all classes\n"; exit(1); } @@ -25,6 +26,12 @@ if($#ARGV < 0) { my $export = $ARGV[0]; $export=~s/--//g; +my $export_file_search = $export; + +if ($export eq "quest") { + $export_file_search = "embparser_api"; +} + my @files; my $start_dir = "zone/"; find( @@ -34,13 +41,13 @@ find( for my $file (@files) { #::: Skip non Perl files - if($file!~/perl_/i){ + if($file!~/perl_|embparser_api/i){ next; } #::: If we are specifying a specific class type, skip everything else if ($export ne "all" && $export ne "") { - if ($file!~/$export/i) { + if ($file!~/$export_file_search/i) { next; } } @@ -56,7 +63,7 @@ for my $file (@files) { chomp; $line = $_; - if ($line=~/Perl_croak/i && $line=~/Usa/i && $line=~/::/i) { + if ($line=~/Perl_croak/i && $line=~/Usa/i && $line=~/::/i && $line!~/::new/i) { #::: Client export if ($export=~/all|client/i && $line=~/Client::/i) { @@ -118,12 +125,18 @@ for my $file (@files) { $object_prefix = "\$hate_entry->"; } - #::: Hateentry export + #::: Questitem export if ($export=~/all|questitem/i && $line=~/QuestItem::/i) { $split_key = "QuestItem::"; $object_prefix = "\$quest_item->"; } + #::: Quest:: exports + if ($export=~/all|quest/i && $line=~/quest::/i) { + $split_key = "quest::"; + $object_prefix = "\quest::"; + } + #::: Split on croak usage @data = split($split_key, $line); $usage = trim($data[1]); diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index 54c136c55..0f160f152 100644 --- a/zone/embparser_api.cpp +++ b/zone/embparser_api.cpp @@ -54,7 +54,7 @@ XS(XS_Client_new) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: Client::new()"); + Perl_croak(aTHX_ "Usage: quest::Client::new()"); { Client * RETVAL; @@ -72,7 +72,7 @@ XS(XS_NPC_new) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: NPC::new()"); + Perl_croak(aTHX_ "Usage: quest::NPC::new()"); { NPC * RETVAL; @@ -90,7 +90,7 @@ XS(XS_EntityList_new) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: EntityList::new()"); + Perl_croak(aTHX_ "Usage: quest::EntityList::new()"); { EntityList * RETVAL; @@ -108,7 +108,7 @@ XS(XS_QuestItem_new) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: QuestItem::new()"); + Perl_croak(aTHX_ "Usage: quest::QuestItem::new()"); EQEmu::ItemInstance* RETVAL; @@ -126,7 +126,7 @@ XS(XS_MobList_new) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: MobList::new()"); + Perl_croak(aTHX_ "Usage: quest::MobList::new()"); ListElement* RETVAL; @@ -146,7 +146,7 @@ XS(XS__echo) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: echo(color_id, message)"); + Perl_croak(aTHX_ "Usage: quest::echo(int emote_color_id, string message)"); quest_manager.echo(SvUV(ST(0)), SvPV_nolen(ST(1))); @@ -162,7 +162,7 @@ XS(XS__say) { else if (items == 2) quest_manager.say(SvPV_nolen(ST(0)), (int)SvIV(ST(1))); else - Perl_croak(aTHX_ "Usage: say(message [, language_id])"); + Perl_croak(aTHX_ "Usage: quest::say(string message, int language_id])"); XSRETURN_EMPTY; } @@ -172,7 +172,7 @@ XS(XS__me) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: %s(message)", "me"); + Perl_croak(aTHX_ "Usage: quest::me(string message)"); quest_manager.me(SvPV_nolen(ST(0))); @@ -188,7 +188,7 @@ XS(XS__summonitem) else if(items == 2) quest_manager.summonitem(SvUV(ST(0)), SvUV(ST(1))); else - Perl_croak(aTHX_ "Usage: summonitem(item_id, [charges])"); + Perl_croak(aTHX_ "Usage: quest::summonitem(int item_id, [int charges])"); XSRETURN_EMPTY; } @@ -197,7 +197,7 @@ XS(XS__write) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: write(file, message)"); + Perl_croak(aTHX_ "Usage: quest::write(string file_name, string message)"); char * file = (char *)SvPV_nolen(ST(0)); char * message = (char *)SvPV_nolen(ST(1)); @@ -212,7 +212,7 @@ XS(XS__spawn) { dXSARGS; if (items != 6) - Perl_croak(aTHX_ "Usage: spawn(npc_type_id, grid_id, int_unused, x, y, z)"); + Perl_croak(aTHX_ "Usage: quest::spawn(int npc_type_id, int grid_id, int int_unused, float x, float y, float z)"); uint16 RETVAL; dXSTARG; @@ -234,7 +234,7 @@ XS(XS__spawn2) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ "Usage: spawn2(npc_type_id, grid_id, int_unused, x, y, z, heading)"); + Perl_croak(aTHX_ "Usage: quest::spawn2(int npc_type_id, int grid_id, int int_unused, float x, float y, float z, float heading)"); uint16 RETVAL; dXSTARG; @@ -256,7 +256,7 @@ XS(XS__unique_spawn) { dXSARGS; if (items != 6 && items != 7) - Perl_croak(aTHX_ "Usage: unique_spawn(npc_type_id, grid_id, int_unused, x, y, z, [heading])"); + Perl_croak(aTHX_ "Usage: quest::unique_spawn(int npc_type_id, int grid_id, int int_unused, float x, float y, float z, [float heading])"); uint16 RETVAL; dXSTARG; @@ -284,7 +284,7 @@ XS(XS__spawn_from_spawn2) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: spawn_from_spawn2(spawn2_id)"); + Perl_croak(aTHX_ "Usage: quest::spawn_from_spawn2(int spawn2_id)"); uint16 RETVAL; dXSTARG; @@ -304,7 +304,7 @@ XS(XS__enable_spawn2) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: enable_spawn2(spawn2_id)"); + Perl_croak(aTHX_ "Usage: quest::enable_spawn2(int spawn2_id)"); int spawn2_id = (int)SvIV(ST(0)); @@ -317,7 +317,7 @@ XS(XS__disable_spawn2) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: disable_spawn2(spawn2_id)"); + Perl_croak(aTHX_ "Usage: quest::disable_spawn2(int spawn2_id)"); int spawn2_id = (int)SvIV(ST(0)); @@ -330,7 +330,7 @@ XS(XS__setstat) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: setstat(stat_id, int_value)"); + Perl_croak(aTHX_ "Usage: quest::setstat(stat_id, int_value)"); int stat_id = (int)SvIV(ST(0)); int int_value = (int)SvIV(ST(1)); @@ -345,7 +345,7 @@ XS(XS__incstat) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: incstat(stat_id, int_value)"); + Perl_croak(aTHX_ "Usage: quest::incstat(int stat_id, int value)"); int stat_id = (int)SvIV(ST(0)); int int_value = (int)SvIV(ST(1)); @@ -360,7 +360,7 @@ XS(XS__castspell) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: castspell(spell_id, target_id)"); + Perl_croak(aTHX_ "Usage: quest::castspell(int spell_id, int target_id)"); int spell_id = (int)SvIV(ST(0)); int target_id = (int)SvIV(ST(1)); @@ -375,7 +375,7 @@ XS(XS__selfcast) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: selfcast(spell_id)"); + Perl_croak(aTHX_ "Usage: quest::selfcast(int spell_id)"); int spell_id = (int)SvIV(ST(0)); @@ -389,7 +389,7 @@ XS(XS__addloot) { dXSARGS; if(items < 1 || items > 3) - Perl_croak(aTHX_ "Usage: addloot(item_id, charges = 0, equipitem = true)"); + Perl_croak(aTHX_ "Usage: quest::addloot(uint32 item_id, uint16 charges = 0, [bool equip_item = true])"); uint32 item_id = (uint32)SvUV(ST(0)); uint16 charges = 0; @@ -410,7 +410,7 @@ XS(XS__zone) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: zone(zone_name)"); + Perl_croak(aTHX_ "Usage: quest::zone(string zone_name)"); char * zone_name = (char *)SvPV_nolen(ST(0)); @@ -424,7 +424,7 @@ XS(XS__settimer) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: settimer(timer_name, seconds)"); + Perl_croak(aTHX_ "Usage: quest::settimer(string timer_name, int seconds)"); char * timer_name = (char *)SvPV_nolen(ST(0)); int seconds = (int)SvIV(ST(1)); @@ -439,7 +439,7 @@ XS(XS__settimerMS) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: settimerMS(timer_name, milliseconds)"); + Perl_croak(aTHX_ "Usage: quest::settimerMS(string timer_name, int milliseconds)"); char * timer_name = (char *)SvPV_nolen(ST(0)); int milliseconds = (int)SvIV(ST(1)); @@ -454,7 +454,7 @@ XS(XS__stoptimer) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: stoptimer(timer_name)"); + Perl_croak(aTHX_ "Usage: quest::stoptimer(string timer_name)"); char * timer_name = (char *)SvPV_nolen(ST(0)); @@ -468,7 +468,7 @@ XS(XS__stopalltimers) { dXSARGS; if (items != 0) - Perl_croak(aTHX_ "Usage: stopalltimers()"); + Perl_croak(aTHX_ "Usage: quest::stopalltimers()"); quest_manager.stopalltimers(); @@ -480,7 +480,7 @@ XS(XS__emote) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: emote(message)"); + Perl_croak(aTHX_ "Usage: quest::emote(string message)"); char * message = (char *)SvPV_nolen(ST(0)); @@ -494,7 +494,7 @@ XS(XS__shout) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: shout(message)"); + Perl_croak(aTHX_ "Usage: quest::shout(string message)"); char * message = (char *)SvPV_nolen(ST(0)); @@ -508,7 +508,7 @@ XS(XS__shout2) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: shout2(message)"); + Perl_croak(aTHX_ "Usage: quest::shout2(string message)"); char * message = (char *)SvPV_nolen(ST(0)); @@ -522,7 +522,7 @@ XS(XS__gmsay) { dXSARGS; if ((items < 1) || (items > 5)) - Perl_croak(aTHX_ "Usage: gmsay(message, color_id, send_to_world)"); + Perl_croak(aTHX_ "Usage: quest::gmsay(string message, [int color_id], [bool send_to_world = 0])"); char * message = (char *)SvPV_nolen(ST(0)); int color_id = 7; @@ -554,7 +554,7 @@ XS(XS__depop) { dXSARGS; if (items < 0 || items > 1) - Perl_croak(aTHX_ "Usage: depop(npc_type_id = 0)"); + Perl_croak(aTHX_ "Usage: quest::depop(int npc_type_id = 0)"); int npc_type_id; @@ -574,7 +574,7 @@ XS(XS__depop_withtimer) { dXSARGS; if (items < 0 || items > 1) - Perl_croak(aTHX_ "Usage: depop_withtimer(npc_type_id= 0)"); + Perl_croak(aTHX_ "Usage: quest::depop_withtimer(int npc_type_id = 0)"); int npc_type_id; @@ -594,7 +594,7 @@ XS(XS__depopall) { dXSARGS; if (items < 0 || items > 1) - Perl_croak(aTHX_ "Usage: depopall(npc_type_id= 0)"); + Perl_croak(aTHX_ "Usage: quest::depopall(int npc_type_id = 0)"); int npc_type_id; @@ -614,7 +614,7 @@ XS(XS__settarget) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: settarget(target_enum, target_id)"); + Perl_croak(aTHX_ "Usage: quest::settarget(string target_enum ['npc_type', 'entity'], int target_id)"); char * target_enum = (char *)SvPV_nolen(ST(0)); int target_id = (int)SvIV(ST(1)); @@ -629,7 +629,7 @@ XS(XS__follow) { dXSARGS; if (items != 1 && items != 2) - Perl_croak(aTHX_ "Usage: follow(entity_id, [distance])"); + Perl_croak(aTHX_ "Usage: quest::follow(int entity_id, [int distance = 10])"); int entity_id = (int)SvIV(ST(0)); int distance; @@ -649,7 +649,7 @@ XS(XS__sfollow) { dXSARGS; if (items != 0) - Perl_croak(aTHX_ "Usage: sfollow()"); + Perl_croak(aTHX_ "Usage: quest::sfollow()"); quest_manager.sfollow(); @@ -662,7 +662,7 @@ XS(XS__changedeity) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: changedeity(diety_id)"); + Perl_croak(aTHX_ "Usage: quest::changedeity(int deity_id)"); int diety_id = (int)SvIV(ST(0)); @@ -676,7 +676,7 @@ XS(XS__exp) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: exp(amt)"); + Perl_croak(aTHX_ "Usage: quest::exp(int amount)"); int amt = (int)SvIV(ST(0)); @@ -690,7 +690,7 @@ XS(XS__level) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: level(newlevel)"); + Perl_croak(aTHX_ "Usage: quest::level(int new_level)"); int newlevel = (int)SvIV(ST(0)); @@ -704,7 +704,7 @@ XS(XS__traindisc) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: traindisc(discipline_tome_item_id)"); + Perl_croak(aTHX_ "Usage: quest::traindisc(int tome_item_id)"); int discipline_tome_item_id = (int)SvIV(ST(0)); @@ -718,7 +718,7 @@ XS(XS__isdisctome) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: isdisctome(item_id)"); + Perl_croak(aTHX_ "Usage: quest::isdisctome(int item_id)"); bool RETVAL; int item_id = (int)SvIV(ST(0)); @@ -735,7 +735,7 @@ XS(XS__safemove) { dXSARGS; if (items != 0) - Perl_croak(aTHX_ "Usage: safemove()"); + Perl_croak(aTHX_ "Usage: quest::safemove()"); quest_manager.safemove(); @@ -748,7 +748,7 @@ XS(XS__rain) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: rain(weather)"); + Perl_croak(aTHX_ "Usage: quest::rain(int weather)"); int weather = (int)SvIV(ST(0)); @@ -762,7 +762,7 @@ XS(XS__snow) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: snow(weather)"); + Perl_croak(aTHX_ "Usage: quest::snow(int weather)"); int weather = (int)SvIV(ST(0)); @@ -776,7 +776,7 @@ XS(XS__surname) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: surname(name)"); + Perl_croak(aTHX_ "Usage: quest::surname(string name)"); char * name = (char *)SvPV_nolen(ST(0)); @@ -790,7 +790,7 @@ XS(XS__permaclass) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: permaclass(class_id)"); + Perl_croak(aTHX_ "Usage: quest::permaclass(int class_id)"); int class_id = (int)SvIV(ST(0)); @@ -804,7 +804,7 @@ XS(XS__permarace) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: permarace(race_id)"); + Perl_croak(aTHX_ "Usage: quest::permarace(int race_id)"); int race_id = (int)SvIV(ST(0)); @@ -818,7 +818,7 @@ XS(XS__permagender) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: permagender(gender_id)"); + Perl_croak(aTHX_ "Usage: quest::permagender(int gender_id)"); int gender_id = (int)SvIV(ST(0)); @@ -832,7 +832,7 @@ XS(XS__scribespells) { dXSARGS; if (items < 1) - Perl_croak(aTHX_ "Usage: scribespells(max_level, min_level = 1)"); + Perl_croak(aTHX_ "Usage: quest::scribespells(int max_level, [int min_level = 1])"); uint16 RETVAL; dXSTARG; @@ -854,7 +854,7 @@ XS(XS__traindiscs) { dXSARGS; if (items < 1) - Perl_croak(aTHX_ "Usage: traindiscs(max_level, min_level = 1)"); + Perl_croak(aTHX_ "Usage: quest::traindiscs(int max_level, [int min_level = 1])"); uint16 RETVAL; dXSTARG; @@ -876,7 +876,7 @@ XS(XS__unscribespells) { dXSARGS; if (items != 0) - Perl_croak(aTHX_ "Usage: unscribespells()"); + Perl_croak(aTHX_ "Usage: quest::unscribespells()"); quest_manager.unscribespells(); @@ -889,7 +889,7 @@ XS(XS__untraindiscs) { dXSARGS; if (items != 0) - Perl_croak(aTHX_ "Usage: untraindiscs()"); + Perl_croak(aTHX_ "Usage: quest::untraindiscs()"); quest_manager.untraindiscs(); @@ -902,7 +902,7 @@ XS(XS__givecash) { dXSARGS; if (items != 4) - Perl_croak(aTHX_ "Usage: givecash(copper, silver, gold, platinum)"); + Perl_croak(aTHX_ "Usage: quest::givecash(int copper, int silver, int gold, int platinum)"); int copper = (int)SvIV(ST(0)); int silver = (int)SvIV(ST(1)); @@ -919,7 +919,7 @@ XS(XS__pvp) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: pvp(mode)"); + Perl_croak(aTHX_ "Usage: quest::pvp(string mode [on|off])"); char * mode = (char *)SvPV_nolen(ST(0)); @@ -933,7 +933,7 @@ XS(XS__movepc) { dXSARGS; if (items != 4 && items != 5) - Perl_croak(aTHX_ "Usage: movepc(zone_id, x, y, z [,heading])"); + Perl_croak(aTHX_ "Usage: quest::movepc(int zone_id, float x, float y, float z [float heading])"); int zone_id = (int)SvIV(ST(0)); float x = (float)SvNV(ST(1)); @@ -957,7 +957,7 @@ XS(XS__gmmove) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: gmmove(x, y, z)"); + Perl_croak(aTHX_ "Usage: quest::gmmove(float x, float y, float z)"); float x = (float)SvNV(ST(0)); float y = (float)SvNV(ST(1)); @@ -973,7 +973,7 @@ XS(XS__movegrp) { dXSARGS; if (items != 4) - Perl_croak(aTHX_ "Usage: movegrp(zone_id, x, y, z)"); + Perl_croak(aTHX_ "Usage: quest::movegrp(int zone_id, float x, float y, float z)"); int zone_id = (int)SvIV(ST(0)); float x = (float)SvNV(ST(1)); @@ -990,7 +990,7 @@ XS(XS__doanim) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: doanim(anim_id)"); + Perl_croak(aTHX_ "Usage: quest::doanim(int animation_id)"); int anim_id = (int)SvIV(ST(0)); @@ -1004,7 +1004,7 @@ XS(XS__addskill) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: addskill(skill_id, int_value)"); + Perl_croak(aTHX_ "Usage: quest::addskill(int skill_id, int value)"); int skill_id = (int)SvIV(ST(0)); int int_value = (int)SvIV(ST(1)); @@ -1019,7 +1019,7 @@ XS(XS__setlanguage) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: setlanguage(skill_id, int_value)"); + Perl_croak(aTHX_ "Usage: quest::setlanguage(int skill_id, int value)"); int skill_id = (int)SvIV(ST(0)); int int_value = (int)SvIV(ST(1)); @@ -1034,7 +1034,7 @@ XS(XS__setskill) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: setskill(skill_id, int_value)"); + Perl_croak(aTHX_ "Usage: quest::setskill(int skill_id, int value)"); int skill_id = (int)SvIV(ST(0)); int int_value = (int)SvIV(ST(1)); @@ -1049,7 +1049,7 @@ XS(XS__setallskill) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: setallskill(int_value)"); + Perl_croak(aTHX_ "Usage: quest::setallskill(int value)"); int int_value = (int)SvIV(ST(0)); @@ -1063,7 +1063,7 @@ XS(XS__attack) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: attack(client_name)"); + Perl_croak(aTHX_ "Usage: quest::attack(string client_name)"); char * client_name = (char *)SvPV_nolen(ST(0)); @@ -1077,7 +1077,7 @@ XS(XS__attacknpc) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: attacknpc(npc_entity_id)"); + Perl_croak(aTHX_ "Usage: quest::attacknpc(int npc_entity_id)"); int npc_entity_id = (int)SvIV(ST(0)); @@ -1091,7 +1091,7 @@ XS(XS__attacknpctype) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: attacknpctype(npc_type_id)"); + Perl_croak(aTHX_ "Usage: quest::attacknpctype(int npc_type_id)"); int npc_type_id = (int)SvIV(ST(0)); @@ -1105,7 +1105,7 @@ XS(XS__save) { dXSARGS; if (items != 0) - Perl_croak(aTHX_ "Usage: save()"); + Perl_croak(aTHX_ "Usage: quest::save()"); quest_manager.save(); @@ -1118,7 +1118,7 @@ XS(XS__faction) { dXSARGS; if (items < 2 || items > 3) - Perl_croak(aTHX_ "Usage: faction(faction_id, int_value, temp)"); + Perl_croak(aTHX_ "Usage: quest::faction(int faction_id, int value, [int temp = 0])"); int faction_id = (int)SvIV(ST(0)); int int_value = (int)SvIV(ST(1)); @@ -1139,7 +1139,7 @@ XS(XS__setsky) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: setsky(new_sky)"); + Perl_croak(aTHX_ "Usage: quest::setsky(uint8 sky)"); unsigned char new_sky = (unsigned char)SvUV(ST(0)); @@ -1153,7 +1153,7 @@ XS(XS__setguild) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: setguild(new_guild_id, guild_rank_id)"); + Perl_croak(aTHX_ "Usage: quest::setguild(int guild_id, int guild_rank_id)"); unsigned long new_guild_id = (unsigned long)SvUV(ST(0)); int guild_rank_id = (int)SvIV(ST(1)); @@ -1168,7 +1168,7 @@ XS(XS__createguild) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: createguild(guild_name, leader_name)"); + Perl_croak(aTHX_ "Usage: quest::createguild(string guild_name, string leader_name)"); char * guild_name = (char *)SvPV_nolen(ST(0)); char * leader_name = (char *)SvPV_nolen(ST(1)); @@ -1183,7 +1183,7 @@ XS(XS__settime) { dXSARGS; if (items < 2) - Perl_croak(aTHX_ "Usage: settime(new_hour, new_min, [update_world = true])"); + Perl_croak(aTHX_ "Usage: quest::settime(int new_hour, int new_min, [bool update_world = true])"); if (items == 2){ int new_hour = (int)SvIV(ST(0)); @@ -1211,7 +1211,7 @@ XS(XS__itemlink) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: itemlink(item_id)"); + Perl_croak(aTHX_ "Usage: quest::itemlink(int item_id)"); int item_id = (int)SvIV(ST(0)); @@ -1235,7 +1235,7 @@ XS(XS__signalwith) int wait = (int)SvIV(ST(2)); quest_manager.signalwith(npc_id, signal_id, wait); } else { - Perl_croak(aTHX_ "Usage: signalwith(npc_id,signal_id[,wait_ms])"); + Perl_croak(aTHX_ "Usage: quest::signalwith(int npc_id, int signal_id, [int wait_ms])"); } XSRETURN_EMPTY; @@ -1254,7 +1254,7 @@ XS(XS__signal) int wait = (int)SvIV(ST(1)); quest_manager.signal(npc_id, wait); } else { - Perl_croak(aTHX_ "Usage: signal(npc_id[,wait_ms])"); + Perl_croak(aTHX_ "Usage: quest::signal(int npc_id, [int wait_ms])"); } XSRETURN_EMPTY; @@ -1265,7 +1265,7 @@ XS(XS__setglobal) { dXSARGS; if (items != 4) - Perl_croak(aTHX_ "Usage: setglobal(key, str_value, options, duration)"); + Perl_croak(aTHX_ "Usage: quest::setglobal(stirng key, string value, int options, string duration)"); char * key = (char *)SvPV_nolen(ST(0)); char * str_value = (char *)SvPV_nolen(ST(1)); @@ -1282,7 +1282,7 @@ XS(XS__targlobal) { dXSARGS; if (items != 6) - Perl_croak(aTHX_ "Usage: targlobal(key, str_value, duration, npc_id, char_id, zone_id)"); + Perl_croak(aTHX_ "Usage: quest::targlobal(stirng key, string value, string duration, int npc_id, int chararacter_id, int zone_id)"); char * key = (char *)SvPV_nolen(ST(0)); char * str_value = (char *)SvPV_nolen(ST(1)); @@ -1301,7 +1301,7 @@ XS(XS__delglobal) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: delglobal(key)"); + Perl_croak(aTHX_ "Usage: quest::delglobal(string key)"); char * key = (char *)SvPV_nolen(ST(0)); @@ -1315,7 +1315,7 @@ XS(XS__ding) { dXSARGS; if (items != 0) - Perl_croak(aTHX_ "Usage: ding()"); + Perl_croak(aTHX_ "Usage: quest::ding()"); quest_manager.ding(); @@ -1328,7 +1328,7 @@ XS(XS__rebind) { dXSARGS; if (items != 4) - Perl_croak(aTHX_ "Usage: rebind(zone_id, x, y, z)"); + Perl_croak(aTHX_ "Usage: quest::rebind(int zone_id, float x, float y, float z)"); int zone_id = (int)SvIV(ST(0)); auto location = glm::vec3((float)SvNV(ST(1)),(float)SvNV(ST(2)),(float)SvNV(ST(3))); @@ -1343,7 +1343,7 @@ XS(XS__start) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: start(wp)"); + Perl_croak(aTHX_ "Usage: quest::start(int waypoint)"); int wp = (int)SvIV(ST(0)); @@ -1357,7 +1357,7 @@ XS(XS__stop) { dXSARGS; if (items != 0) - Perl_croak(aTHX_ "Usage: stop()"); + Perl_croak(aTHX_ "Usage: quest::stop()"); quest_manager.stop(); @@ -1370,7 +1370,7 @@ XS(XS__pause) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: pause(duration)"); + Perl_croak(aTHX_ "Usage: quest::pause(int duration-ms)"); int duration = (int)SvIV(ST(0)); @@ -1384,7 +1384,7 @@ XS(XS__moveto) { dXSARGS; if (items != 3 && items != 4 && items != 5) - Perl_croak(aTHX_ "Usage: moveto(x, y, z, [heading], [saveguard?])"); + Perl_croak(aTHX_ "Usage: quest::moveto(float x, float y, float z, [float heading], [bool save_guard_location])"); float x = (float)SvNV(ST(0)); float y = (float)SvNV(ST(1)); @@ -1412,7 +1412,7 @@ XS(XS__resume) { dXSARGS; if (items != 0) - Perl_croak(aTHX_ "Usage: resume()"); + Perl_croak(aTHX_ "Usage: quest::resume()"); quest_manager.resume(); @@ -1425,7 +1425,7 @@ XS(XS__addldonpoints) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: addldonpoints(points, theme_id)"); + Perl_croak(aTHX_ "Usage: quest::addldonpoints(int points, int theme_id)"); long points = (long)SvIV(ST(0)); unsigned long theme_id = (unsigned long)SvUV(ST(1)); @@ -1440,7 +1440,7 @@ XS(XS__addldonwin) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: addldonwin(wins, theme_id)"); + Perl_croak(aTHX_ "Usage: quest::addldonwin(int wins, int theme_id)"); long wins = (long)SvIV(ST(0)); unsigned long theme_id = (unsigned long)SvUV(ST(1)); @@ -1455,7 +1455,7 @@ XS(XS__addldonloss) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: addldonloss(losses, theme_id)"); + Perl_croak(aTHX_ "Usage: quest::addldonloss(int losses, int theme_id)"); long losses = (long)SvIV(ST(0)); unsigned long theme_id = (unsigned long)SvUV(ST(1)); @@ -1470,7 +1470,7 @@ XS(XS__setnexthpevent) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: setnexthpevent(at)"); + Perl_croak(aTHX_ "Usage: quest::setnexthpevent(int at_mob_percentage)"); int at = (int)SvIV(ST(0)); @@ -1484,7 +1484,7 @@ XS(XS__setnextinchpevent) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: setnextinchpevent(at)"); + Perl_croak(aTHX_ "Usage: quest::setnextinchpevent(int at_mob_percentage)"); int at = (int)SvIV(ST(0)); @@ -1498,7 +1498,7 @@ XS(XS__sethp) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: sethp(percentage)"); + Perl_croak(aTHX_ "Usage: quest::sethp(int mob_health_percentage [0-100])"); int hpperc = (int)SvIV(ST(0)); @@ -1512,7 +1512,7 @@ XS(XS__respawn) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: respawn(npc_type_id, grid_id)"); + Perl_croak(aTHX_ "Usage: quest::respawn(int npc_type_id, int grid_id)"); int npc_type_id = (int)SvIV(ST(0)); int grid_id = (int)SvIV(ST(1)); @@ -1527,7 +1527,7 @@ XS(XS__ChooseRandom) { dXSARGS; if (items < 1) - Perl_croak(aTHX_ "Usage: ChooseRandom(... list ...)"); + Perl_croak(aTHX_ "Usage: quest::ChooseRandom(option1, option2, option3, option4, option5...[no limit])"); int index = zone->random.Int(0, items-1); @@ -1543,7 +1543,7 @@ XS(XS__set_proximity) { dXSARGS; if (items != 4 && items != 6 && items != 7) - Perl_croak(aTHX_ "Usage: set_proximity(min_x, max_x, min_y, max_y [, min_z, max_z], [say])"); + Perl_croak(aTHX_ "Usage: quest::set_proximity(float min_x, float max_x, float min_y, float max_y, [float min_z], [float max_z], [say])"); float min_x = (float)SvNV(ST(0)); float max_x = (float)SvNV(ST(1)); @@ -1569,7 +1569,7 @@ XS(XS__clear_proximity) { dXSARGS; if (items != 0) - Perl_croak(aTHX_ "Usage: clear_proximity()"); + Perl_croak(aTHX_ "Usage: quest::clear_proximity()"); quest_manager.clear_proximity(); @@ -1581,7 +1581,7 @@ XS(XS__enable_proximity_say) { dXSARGS; if (items != 0) - Perl_croak(aTHX_ "Usage: enable_proximity_say()"); + Perl_croak(aTHX_ "Usage: quest::enable_proximity_say()"); quest_manager.enable_proximity_say(); @@ -1593,7 +1593,7 @@ XS(XS__disable_proximity_say) { dXSARGS; if (items != 0) - Perl_croak(aTHX_ "Usage: disable_proximity_say()"); + Perl_croak(aTHX_ "Usage: quest::disable_proximity_say()"); quest_manager.disable_proximity_say(); @@ -1605,7 +1605,7 @@ XS(XS__setanim) //Cisyouc: mob->setappearance() addition { dXSARGS; if(items != 2) - Perl_croak(aTHX_ "Usage: quest::setanim(npc_type_id, anim_num);"); + Perl_croak(aTHX_ "Usage: quest::setanim(int npc_type_id, int appearance_number[0-4]);"); quest_manager.setanim(SvUV(ST(0)), SvUV(ST(1))); @@ -1617,7 +1617,7 @@ XS(XS__showgrid) { dXSARGS; if(items != 1) - Perl_croak(aTHX_ "Usage: quest::showgrid(grid_id);"); + Perl_croak(aTHX_ "Usage: quest::showgrid(int grid_id);"); quest_manager.showgrid(SvUV(ST(0))); @@ -1629,7 +1629,7 @@ XS(XS__spawn_condition) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ "Usage: spawn_condition(zone_short, [instance_id], condition_id, int_value)"); + Perl_croak(aTHX_ "Usage: quest::spawn_condition(string zone_short, [int instance_id], uint16 condition_id, int16 value)"); if(items == 3) { @@ -1656,7 +1656,7 @@ XS(XS__get_spawn_condition) { dXSARGS; if (items < 2 || items > 3) - Perl_croak(aTHX_ "Usage: get_spawn_condition(zone_short, [instance_id], condition_id)"); + Perl_croak(aTHX_ "Usage: quest::get_spawn_condition(string zone_short, [int instance_id], int condition_id)"); if(items == 2) { @@ -1692,7 +1692,7 @@ XS(XS__toggle_spawn_event) { dXSARGS; if (items != 4) - Perl_croak(aTHX_ "Usage: toggle_spawn_event(event_id, is_enabled, is_strict, reset_base)"); + Perl_croak(aTHX_ "Usage: quest::toggle_spawn_event(uint32 event_id, [bool is_enabled = false], [bool is_strict = false], [bool reset_base = false])"); uint32 event_id = (int)SvIV(ST(0)); bool is_enabled = ((int)SvIV(ST(1))) == 0?false:true; @@ -1709,7 +1709,7 @@ XS(XS__has_zone_flag) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: has_zone_flag(zone_id)"); + Perl_croak(aTHX_ "Usage: quest::has_zone_flag(uint32 zone_id)"); int16 RETVAL; dXSTARG; @@ -1728,7 +1728,7 @@ XS(XS__set_zone_flag) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: set_zone_flag(zone_id)"); + Perl_croak(aTHX_ "Usage: quest::set_zone_flag(uint32 zone_id)"); uint32 zone_id = (int)SvIV(ST(0)); @@ -1742,7 +1742,7 @@ XS(XS__clear_zone_flag) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: clear_zone_flag(zone_id)"); + Perl_croak(aTHX_ "Usage: quest::clear_zone_flag(uint32 zone_id)"); uint32 zone_id = (int)SvIV(ST(0)); @@ -1756,7 +1756,7 @@ XS(XS__summonburiedplayercorpse) { dXSARGS; if (items != 5) - Perl_croak(aTHX_ "Usage: summonburiedplayercorpse(char_id,dest_x,dest_y,dest_z,dest_heading)"); + Perl_croak(aTHX_ "Usage: quest::summonburiedplayercorpse(uint32 char_id, float dest_x, float dest_y, float dest_z, float dest_heading)"); bool RETVAL; uint32 char_id = (int)SvIV(ST(0)); @@ -1774,7 +1774,7 @@ XS(XS__summonallplayercorpses) { dXSARGS; if (items != 5) - Perl_croak(aTHX_ "Usage: summonallplayercorpses(char_id,dest_x,dest_y,dest_z,dest_heading)"); + Perl_croak(aTHX_ "Usage: quest::summonallplayercorpses(int char_id, float dest_x, float dest_y, float dest_z, float dest_heading)"); bool RETVAL; uint32 char_id = (int)SvIV(ST(0)); @@ -1792,7 +1792,7 @@ XS(XS__getplayerburiedcorpsecount) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: getplayerburiedcorpsecount(char_id)"); + Perl_croak(aTHX_ "Usage: quest::getplayerburiedcorpsecount(int character_id)"); uint32 RETVAL; dXSTARG; @@ -1810,7 +1810,7 @@ XS(XS__buryplayercorpse) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: buryplayercorpse(char_id)"); + Perl_croak(aTHX_ "Usage: quest::buryplayercorpse(int character_id)"); uint32 RETVAL; dXSTARG; @@ -1828,7 +1828,7 @@ XS(XS__forcedooropen) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: forcedooropen(door_id, [alt_mode=0])"); + Perl_croak(aTHX_ "Usage: quest::forcedooropen(int door_id, [int alt_mode=0])"); if (items == 1) { @@ -1854,7 +1854,7 @@ XS(XS__forcedoorclose) { dXSARGS; if (items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: forcedoorclose(door_id, [alt_mode=0])"); + Perl_croak(aTHX_ "Usage: quest::forcedoorclose(int door_id, [bool alt_mode = 0])"); if (items == 1) { @@ -1880,7 +1880,7 @@ XS(XS__toggledoorstate) { dXSARGS; if (items !=1) - Perl_croak(aTHX_ "Usage: toggledoorstate(door_id)"); + Perl_croak(aTHX_ "Usage: quest::toggledoorstate(int door_id)"); uint32 door_id = (int)SvIV(ST(0)); @@ -1894,7 +1894,7 @@ XS(XS__isdooropen) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: isdooropen(door_id)"); + Perl_croak(aTHX_ "Usage: quest::isdooropen(int door_id)"); bool RETVAL; dXSTARG; @@ -1912,7 +1912,7 @@ XS(XS__depopzone) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: depopzone(StartSpawnStatus)"); + Perl_croak(aTHX_ "Usage: quest::depopzone([bool start_spawn_status = false])"); bool StartSpawnStatus = ((int)SvIV(ST(0))) == 0?false:true; @@ -1926,7 +1926,7 @@ XS(XS__repopzone) { dXSARGS; if (items != 0) - Perl_croak(aTHX_ "Usage: repopzone()"); + Perl_croak(aTHX_ "Usage: quest::repopzone()"); quest_manager.repopzone(); @@ -1938,7 +1938,7 @@ XS(XS__npcrace) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: npcrace(race_id)"); + Perl_croak(aTHX_ "Usage: quest::npcrace(int race_id)"); int race_id = (int)SvIV(ST(0)); @@ -1952,7 +1952,7 @@ XS(XS__npcgender) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: npcgender(gender_id)"); + Perl_croak(aTHX_ "Usage: quest::npcgender(int gender_id)"); int gender_id= (int)SvIV(ST(0)); @@ -1966,7 +1966,7 @@ XS(XS__npcsize) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: npcsize(size)"); + Perl_croak(aTHX_ "Usage: quest::npcsize(int size)"); int size = (int)SvIV(ST(0)); @@ -1980,7 +1980,7 @@ XS(XS__npctexture) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: npctexture(texture_id)"); + Perl_croak(aTHX_ "Usage: quest::npctexture(int texture_id)"); int texture_id = (int)SvIV(ST(0)); @@ -1994,7 +1994,7 @@ XS(XS__playerrace) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: playerrace(race_id)"); + Perl_croak(aTHX_ "Usage: quest::playerrace(int race_id)"); int race_id = (int)SvIV(ST(0)); @@ -2008,7 +2008,7 @@ XS(XS__playergender) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: playergender(gender_id)"); + Perl_croak(aTHX_ "Usage: quest::playergender(int gender_id)"); int gender_id= (int)SvIV(ST(0)); @@ -2022,7 +2022,7 @@ XS(XS__playersize) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: playersize(newsize)"); + Perl_croak(aTHX_ "Usage: quest::playersize(int newsize)"); int newsize = (int)SvIV(ST(0)); @@ -2036,7 +2036,7 @@ XS(XS__playertexture) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: playertexture(texture_id)"); + Perl_croak(aTHX_ "Usage: quest::playertexture(int texture_id)"); int texture_id = (int)SvIV(ST(0)); @@ -2050,7 +2050,7 @@ XS(XS__playerfeature) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: playerfeature(str_value, int_value)"); + Perl_croak(aTHX_ "Usage: quest::playerfeature(string feature [race|gender|texture|helm|haircolor|beardcolor|eyecolor1|eyecolor2|hair|face|beard|heritage|tatoo|details|size], int setting)"); char * str_value = (char *)SvPV_nolen(ST(0)); int int_value = (int)SvIV(ST(1)); @@ -2065,7 +2065,7 @@ XS(XS__npcfeature) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: npcfeature(str_value, int_value)"); + Perl_croak(aTHX_ "Usage: quest::npcfeature(string feature [race|gender|texture|helm|haircolor|beardcolor|eyecolor1|eyecolor2|hair|face|beard|heritage|tatoo|details|size], int value)"); char * str_value = (char *)SvPV_nolen(ST(0)); int int_value = (int)SvIV(ST(1)); @@ -2125,7 +2125,7 @@ XS(XS__createBot) if(items != 6) { - Perl_croak(aTHX_ "Usage: createBot(firstname, lastname, level, race_id, class_id, gender_id)"); + Perl_croak(aTHX_ "Usage: quest::createBot(string first_name, string last_name, int level, int race_id, int class_id, int gender_id)"); } char *firstname = (char *)SvPV_nolen(ST(0)); @@ -2153,7 +2153,7 @@ XS(XS__taskselector) } quest_manager.taskselector(items, tasks); } else { - Perl_croak(aTHX_ "Usage: taskselector(task_id1, task_id2, ..., task_id%i)", MAXCHOOSERENTRIES); + Perl_croak(aTHX_ "Usage: quest::taskselector(int task_id, 2, 3, 4, 5 [up to 40])"); } XSRETURN_EMPTY; @@ -2166,7 +2166,7 @@ XS(XS__task_setselector) int task_setid = (int)SvIV(ST(0)); quest_manager.tasksetselector(task_setid); } else { - Perl_croak(aTHX_ "Usage: task_setselector(task_setid)"); + Perl_croak(aTHX_ "Usage: quest::task_setselector(int task_set_id)"); } XSRETURN_EMPTY; @@ -2182,7 +2182,7 @@ XS(XS__enabletask) } quest_manager.enabletask(items, tasks); } else { - Perl_croak(aTHX_ "Usage: enabletask(task_id1, task_id2, ..., task_id10"); + Perl_croak(aTHX_ "Usage: quest::enabletask(int task_id, 2, 3, [up to 10])"); } XSRETURN_EMPTY; @@ -2198,7 +2198,7 @@ XS(XS__disabletask) } quest_manager.disabletask(items, tasks); } else { - Perl_croak(aTHX_ "Usage: disabletask(task_id1, task_id2, ..., task_id10"); + Perl_croak(aTHX_ "Usage: quest::disabletask(int task_id, 2, 3, [up to 10])"); } XSRETURN_EMPTY; @@ -2215,7 +2215,7 @@ XS(XS__istaskenabled) unsigned int task_id = (int)SvIV(ST(0)); RETVAL = quest_manager.istaskenabled(task_id); } else { - Perl_croak(aTHX_ "Usage: istaskenabled(task_id)"); + Perl_croak(aTHX_ "Usage: quest::istaskenabled(int task_id)"); } XSprePUSH; PUSHu((IV)RETVAL); @@ -2233,7 +2233,7 @@ XS(XS__istaskactive) unsigned int task_id = (int)SvIV(ST(0)); RETVAL = quest_manager.istaskactive(task_id); } else { - Perl_croak(aTHX_ "Usage: istaskactive(task_id)"); + Perl_croak(aTHX_ "Usage: quest::istaskactive(int task_id)"); } XSprePUSH; PUSHu((IV)RETVAL); @@ -2252,7 +2252,7 @@ XS(XS__istaskactivityactive) unsigned int activity_id = (int)SvIV(ST(1)); RETVAL = quest_manager.istaskactivityactive(task_id, activity_id); } else { - Perl_croak(aTHX_ "Usage: istaskactivityactive(task_id, activity_id)"); + Perl_croak(aTHX_ "Usage: quest::istaskactivityactive(int task_id, int activity_id)"); } XSprePUSH; PUSHu((IV)RETVAL); @@ -2272,7 +2272,7 @@ XS(XS__gettaskactivitydonecount) RETVAL = quest_manager.gettaskactivitydonecount(task_id, activity_id); XSprePUSH; PUSHu((UV)RETVAL); } else { - Perl_croak(aTHX_ "Usage: gettaskactivitydonecount(task_id, activity_id)"); + Perl_croak(aTHX_ "Usage: quest::gettaskactivitydonecount(int task_id, int activity_id)"); } XSRETURN(1); @@ -2298,7 +2298,7 @@ XS(XS__updatetaskactivity) } quest_manager.updatetaskactivity(task_id, activity_id, count, ignore_quest_update); } else { - Perl_croak(aTHX_ "Usage: updatetaskactivity(task_id, activity_id, [count], [ignore_quest_update])"); + Perl_croak(aTHX_ "Usage: quest::updatetaskactivity(int task_id, int activity_id, [int count], [bool ignore_quest_update = false])"); } XSRETURN_EMPTY; @@ -2316,7 +2316,7 @@ XS(XS__resettaskactivity) quest_manager.resettaskactivity(task_id, activity_id); } else { - Perl_croak(aTHX_ "Usage: resettaskactivity(task_id, activity_id)"); + Perl_croak(aTHX_ "Usage: quest::resettaskactivity(int task_id, int activity_id)"); } XSRETURN_EMPTY; @@ -2331,7 +2331,7 @@ XS(XS__taskexploredarea) explore_id = (int)SvIV(ST(0)); quest_manager.taskexploredarea(explore_id); } else { - Perl_croak(aTHX_ "Usage: taskexplorearea(explore_id)"); + Perl_croak(aTHX_ "Usage: quest::taskexplorearea(int explore_id)"); } XSRETURN_EMPTY; @@ -2354,7 +2354,7 @@ XS(XS__assigntask) } quest_manager.assigntask(task_id, enforce_level_requirement); } else { - Perl_croak(aTHX_ "Usage: assigntask(task_id, enforce_level_requirement)"); + Perl_croak(aTHX_ "Usage: quest::assigntask(int task_id, [bool enforce_level_requirement = false])"); } XSRETURN_EMPTY; @@ -2369,7 +2369,7 @@ XS(XS__failtask) task_id = (int)SvIV(ST(0)); quest_manager.failtask(task_id); } else { - Perl_croak(aTHX_ "Usage: failtask(task_id)"); + Perl_croak(aTHX_ "Usage: quest::failtask(int task_id)"); } XSRETURN_EMPTY; @@ -2386,7 +2386,7 @@ XS(XS__tasktimeleft) unsigned int task_id = (int)SvIV(ST(0)); RETVAL = quest_manager.tasktimeleft(task_id); } else { - Perl_croak(aTHX_ "Usage: tasktimeleft(task_id)"); + Perl_croak(aTHX_ "Usage: quest::tasktimeleft(int task_id)"); } XSprePUSH; PUSHi((IV)RETVAL); @@ -2405,7 +2405,7 @@ XS(XS__istaskcompleted) unsigned int task_id = (int)SvIV(ST(0)); RETVAL = quest_manager.istaskcompleted(task_id); } else { - Perl_croak(aTHX_ "Usage: istaskcompleted(task_id)"); + Perl_croak(aTHX_ "Usage: quest::istaskcompleted(int task_id)"); } XSprePUSH; PUSHi((IV)RETVAL); @@ -2424,7 +2424,7 @@ XS(XS__enabledtaskcount) unsigned int task_set = (int)SvIV(ST(0)); RETVAL = quest_manager.enabledtaskcount(task_set); } else { - Perl_croak(aTHX_ "Usage: enabledtaskcount(task_set)"); + Perl_croak(aTHX_ "Usage: quest::enabledtaskcount(int task_set)"); } XSprePUSH; PUSHi((IV)RETVAL); @@ -2443,7 +2443,7 @@ XS(XS__firsttaskinset) unsigned int task_set = (int)SvIV(ST(0)); RETVAL = quest_manager.firsttaskinset(task_set); } else { - Perl_croak(aTHX_ "Usage: firsttaskinset(task_set)"); + Perl_croak(aTHX_ "Usage: quest::firsttaskinset(int task_set)"); } XSprePUSH; PUSHi((IV)RETVAL); @@ -2462,7 +2462,7 @@ XS(XS__lasttaskinset) unsigned int task_set = (int)SvIV(ST(0)); RETVAL = quest_manager.lasttaskinset(task_set); } else { - Perl_croak(aTHX_ "Usage: lasttaskinset(task_set)"); + Perl_croak(aTHX_ "Usage: quest::lasttaskinset(int task_set)"); } XSprePUSH; PUSHi((IV)RETVAL); @@ -2482,7 +2482,7 @@ XS(XS__nexttaskinset) unsigned int task_id = (int)SvIV(ST(1)); RETVAL = quest_manager.nexttaskinset(task_set, task_id); } else { - Perl_croak(aTHX_ "Usage: nexttaskinset(task_set, task_id)"); + Perl_croak(aTHX_ "Usage: quest::nexttaskinset(int task_set, int task_id)"); } XSprePUSH; PUSHi((IV)RETVAL); @@ -2499,7 +2499,7 @@ XS(XS__activespeaktask) if(items == 0) { RETVAL = quest_manager.activespeaktask(); } else { - Perl_croak(aTHX_ "Usage: activespeaktask()"); + Perl_croak(aTHX_ "Usage: quest::activespeaktask()"); } XSprePUSH; PUSHi((IV)RETVAL); @@ -2518,7 +2518,7 @@ XS(XS__activespeakactivity) unsigned int task_id = (int)SvIV(ST(0)); RETVAL = quest_manager.activespeakactivity(task_id); } else { - Perl_croak(aTHX_ "Usage: activespeakactivity(task_id)"); + Perl_croak(aTHX_ "Usage: quest::activespeakactivity(int task_id)"); } XSprePUSH; PUSHi((IV)RETVAL); @@ -2537,7 +2537,7 @@ XS(XS__activetasksinset) unsigned int task_set = (int)SvIV(ST(0)); RETVAL = quest_manager.activetasksinset(task_set); } else { - Perl_croak(aTHX_ "Usage: activetasksinset(task_set)"); + Perl_croak(aTHX_ "Usage: quest::activetasksinset(int task_set)"); } XSprePUSH; PUSHi((IV)RETVAL); @@ -2556,7 +2556,7 @@ XS(XS__completedtasksinset) unsigned int task_set = (int)SvIV(ST(0)); RETVAL = quest_manager.completedtasksinset(task_set); } else { - Perl_croak(aTHX_ "Usage: completedtasksinset(task_set)"); + Perl_croak(aTHX_ "Usage: quest::completedtasksinset(int task_set)"); } XSprePUSH; PUSHi((IV)RETVAL); @@ -2576,7 +2576,7 @@ XS(XS__istaskappropriate) unsigned int task = (int)SvIV(ST(0)); RETVAL = quest_manager.istaskappropriate(task); } else { - Perl_croak(aTHX_ "Usage: istaskaappropriate(task)"); + Perl_croak(aTHX_ "Usage: quest::istaskaappropriate(int task_id)"); } XSprePUSH; PUSHu((IV)RETVAL); @@ -2592,7 +2592,7 @@ XS(XS__istaskappropriate) int duration = 0; if((items < 2) || (items > 5)) - Perl_croak(aTHX_ "Usage: popup(window_title, message, popup_id, buttons, duration)"); + Perl_croak(aTHX_ "Usage: quest::popup(string window_title, string message, int popup_id, int buttons, int duration)"); if(items >= 3) popup_id = (int)SvIV(ST(2)); @@ -2613,7 +2613,7 @@ XS(XS__clearspawntimers) { dXSARGS; if (items != 0) - Perl_croak(aTHX_ "Usage: clearspawntimers()"); + Perl_croak(aTHX_ "Usage: quest::clearspawntimers()"); quest_manager.clearspawntimers(); @@ -2625,7 +2625,7 @@ XS(XS__ze) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: ze(channel_id, message)"); + Perl_croak(aTHX_ "Usage: quest::ze(int emote_color_id, string message)"); int channel_id = (int)SvIV(ST(0)); char * message = (char *)SvPV_nolen(ST(1)); @@ -2640,7 +2640,7 @@ XS(XS__we) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: we(channel_id, message)"); + Perl_croak(aTHX_ "Usage: quest::we(int emote_color_id, string message)"); int channel_id = (int)SvIV(ST(0)); char * message = (char *)SvPV_nolen(ST(1)); @@ -2655,7 +2655,7 @@ XS(XS__getlevel) { dXSARGS; if (items > 1) - Perl_croak(aTHX_ "Usage: getlevel(type)"); + Perl_croak(aTHX_ "Usage: quest::getlevel(int type)"); int RETVAL; dXSTARG; @@ -2677,7 +2677,7 @@ XS(XS__CreateGroundObject) { dXSARGS; if (items != 5 && items != 6) - Perl_croak(aTHX_ "Usage: creategroundobject(item_id, x, y, z, heading, [decay_time])"); + Perl_croak(aTHX_ "Usage: quest::creategroundobject(int item_id, float x, float y, float z, float heading, [uint32 decay_time-ms = 300000])"); int item_id = (int)SvIV(ST(0)); float x = (float)SvNV(ST(1)); @@ -2701,7 +2701,7 @@ XS(XS__CreateGroundObjectFromModel) { dXSARGS; if (items < 5 || items > 7) - Perl_croak(aTHX_ "Usage: creategroundobjectfrommodel(modelname, x, y, z, heading, [object_type], [decay_time])"); + Perl_croak(aTHX_ "Usage: quest::creategroundobjectfrommodel(string model_name, float x, float y, float z, float heading, [int object_type], [uint32 decay_time-ms = 300000])"); char * modelname = (char *)SvPV_nolen(ST(0)); float x = (float)SvNV(ST(1)); @@ -2727,7 +2727,7 @@ XS(XS__CreateDoor) { dXSARGS; if (items < 5 || items > 7) - Perl_croak(aTHX_ "Usage: createdoor(modelname, x, y, z, heading, [object_type], [size])"); + Perl_croak(aTHX_ "Usage: quest::createdoor(string model_name, float x, float y, float z, float heading, [int object_type = 58], [int size = 100])"); char * modelname = (char *)SvPV_nolen(ST(0)); float x = (float)SvNV(ST(1)); @@ -2753,7 +2753,7 @@ XS(XS__ModifyNPCStat) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: ModifyNPCStat(stat_id, str_value)"); + Perl_croak(aTHX_ "Usage: quest::ModifyNPCStat(string key, string value)"); quest_manager.ModifyNPCStat(SvPV_nolen(ST(0)), SvPV_nolen(ST(1))); @@ -2765,7 +2765,7 @@ XS(XS__collectitems) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: collectitems(item_id, remove_item)"); + Perl_croak(aTHX_ "Usage: quest::collectitems(int item_id, [bool remove_item = true])"); uint32 item_id = (int)SvIV(ST(0)); bool remove_item = ((int)SvIV(ST(1))) == 0?false:true; @@ -2781,7 +2781,7 @@ XS(XS__UpdateSpawnTimer) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: UpdateSpawnTimer(spawn2_id, updated_time_till_repop)"); + Perl_croak(aTHX_ "Usage: quest::UpdateSpawnTimer(uint32 spawn2_id, uint32 updated_time_till_repop)"); uint32 spawn2_id = (int)SvIV(ST(0)); uint32 updated_time_till_repop = (int)SvIV(ST(1)); @@ -2795,7 +2795,7 @@ XS(XS__MerchantSetItem); XS(XS__MerchantSetItem) { dXSARGS; if (items != 2 && items != 3) - Perl_croak(aTHX_ "Usage: MerchantSetItem(npc_id, item_id [, quantity])"); + Perl_croak(aTHX_ "Usage: quest::MerchantSetItem(uint32 npc_id, uint32 item_id, [uint32 quantity])"); uint32 npc_id = (int)SvUV(ST(0)); uint32 item_id = (int)SvUV(ST(1)); @@ -2812,7 +2812,7 @@ XS(XS__MerchantCountItem); XS(XS__MerchantCountItem) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: MerchantCountItem(npc_id, item_id)"); + Perl_croak(aTHX_ "Usage: quest::MerchantCountItem(uint32 npc_id, uint32 item_id)"); uint32 npc_id = (int)SvUV(ST(0)); uint32 item_id = (int)SvUV(ST(1)); @@ -2825,7 +2825,7 @@ XS(XS__varlink); XS(XS__varlink) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: varlink(item_id)"); + Perl_croak(aTHX_ "Usage: quest::varlink(uint32 item_id)"); dXSTARG; Const_char * RETVAL; @@ -2843,7 +2843,7 @@ XS(XS__CreateInstance); XS(XS__CreateInstance) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: CreateInstance(zone_name, version, duration)"); + Perl_croak(aTHX_ "Usage: quest::CreateInstance(string zone_name, uint16 version, uint32 duration)"); char * zone = (char *)SvPV_nolen(ST(0)); uint16 version = (int)SvUV(ST(1)); @@ -2857,7 +2857,7 @@ XS(XS__DestroyInstance); XS(XS__DestroyInstance) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: DestroyInstance(id)"); + Perl_croak(aTHX_ "Usage: quest::DestroyInstance(int id)"); uint16 id = (int)SvUV(ST(0)); quest_manager.DestroyInstance(id); @@ -2869,7 +2869,7 @@ XS(XS__UpdateInstanceTimer); XS(XS__UpdateInstanceTimer) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: UpdateInstanceTimer(instance_id, duration)"); + Perl_croak(aTHX_ "Usage: quest::UpdateInstanceTimer(int16 instance_id, uint32 duration)"); uint16 instance_id = (uint16)SvUV(ST(0)); uint32 duration = (uint32)SvUV(ST(1)); @@ -2882,7 +2882,7 @@ XS(XS__GetInstanceTimer); XS(XS__GetInstanceTimer) { dXSARGS; if (items != 0) - Perl_croak(aTHX_ "Usage: GetInstanceTimer()"); + Perl_croak(aTHX_ "Usage: quest::GetInstanceTimer()"); uint32 timer = quest_manager.GetInstanceTimer(); @@ -2893,7 +2893,7 @@ XS(XS__GetInstanceTimerByID); XS(XS__GetInstanceTimerByID) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: GetInstanceTimerByID(instance_id)"); + Perl_croak(aTHX_ "Usage: quest::GetInstanceTimerByID(uint16 instance_id)"); uint16 instance_id = (uint16)SvUV(ST(0)); uint32 timer = quest_manager.GetInstanceTimerByID(instance_id); @@ -2905,7 +2905,7 @@ XS(XS__GetInstanceID); XS(XS__GetInstanceID) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: GetInstanceID(zone_name, version)"); + Perl_croak(aTHX_ "Usage: quest::GetInstanceID(string zone_name, uint16 version)"); char * zone = (char *)SvPV_nolen(ST(0)); uint16 version = (int)SvUV(ST(1)); @@ -2918,7 +2918,7 @@ XS(XS__GetCharactersInInstance); XS(XS__GetCharactersInInstance) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: GetCharactersInInstance(instance_id)"); + Perl_croak(aTHX_ "Usage: quest::GetCharactersInInstance(uint16 instance_id)"); dXSTARG; Const_char * RETVAL; @@ -2958,7 +2958,7 @@ XS(XS__AssignToInstance); XS(XS__AssignToInstance) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: AssignToInstance(instance_id)"); + Perl_croak(aTHX_ "Usage: quest::AssignToInstance(uint16 instance_id)"); uint16 instance_id = (int)SvUV(ST(0)); quest_manager.AssignToInstance(instance_id); @@ -2970,7 +2970,7 @@ XS(XS__AssignGroupToInstance); XS(XS__AssignGroupToInstance) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: AssignGroupToInstance(instance_id)"); + Perl_croak(aTHX_ "Usage: quest::AssignGroupToInstance(uint16 instance_id)"); uint16 instance_id = (int)SvUV(ST(0)); quest_manager.AssignGroupToInstance(instance_id); @@ -2982,7 +2982,7 @@ XS(XS__AssignRaidToInstance); XS(XS__AssignRaidToInstance) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: AssignRaidToInstance(instance_id)"); + Perl_croak(aTHX_ "Usage: quest::AssignRaidToInstance(uint16 instance_id)"); uint16 instance_id = (int)SvUV(ST(0)); quest_manager.AssignRaidToInstance(instance_id); @@ -2994,7 +2994,7 @@ XS(XS__RemoveFromInstance); XS(XS__RemoveFromInstance) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: RemoveFromInstance(instance_id)"); + Perl_croak(aTHX_ "Usage: quest::RemoveFromInstance(uint16 instance_id)"); uint16 instance_id = (int)SvUV(ST(0)); quest_manager.RemoveFromInstance(instance_id); @@ -3006,7 +3006,7 @@ XS(XS__RemoveAllFromInstance); XS(XS__RemoveAllFromInstance) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: RemoveAllFromInstance(instance_id)"); + Perl_croak(aTHX_ "Usage: quest::RemoveAllFromInstance(uint16 instance_id)"); uint16 instance_id = (int)SvUV(ST(0)); quest_manager.RemoveAllFromInstance(instance_id); @@ -3019,7 +3019,7 @@ XS(XS__MovePCInstance) { dXSARGS; if (items != 5 && items != 6) - Perl_croak(aTHX_ "Usage: MovePCInstance(zone_id, instance_id, x, y, z [,heading])"); + Perl_croak(aTHX_ "Usage: quest::MovePCInstance(int zone_id, int instance_id, float x, float y, float z, [float heading])"); int zone_id = (int)SvIV(ST(0)); int instanceid = (int)SvIV(ST(1)); @@ -3044,7 +3044,7 @@ XS(XS__FlagInstanceByGroupLeader); XS(XS__FlagInstanceByGroupLeader) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: FlagInstanceByGroupLeader(zone, version)"); + Perl_croak(aTHX_ "Usage: quest::FlagInstanceByGroupLeader(uint32 zone, uint16 version)"); uint32 zone = (int)SvUV(ST(0)); uint16 version = (int)SvUV(ST(1)); @@ -3057,7 +3057,7 @@ XS(XS__FlagInstanceByRaidLeader); XS(XS__FlagInstanceByRaidLeader) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: FlagInstanceByRaidLeader(zone, version)"); + Perl_croak(aTHX_ "Usage: quest::FlagInstanceByRaidLeader(uint32 zone, uint16 version)"); uint32 zone = (int)SvUV(ST(0)); uint16 version = (int)SvUV(ST(1)); @@ -3070,7 +3070,7 @@ XS(XS__saylink); XS(XS__saylink) { dXSARGS; if (items < 1 || items > 3) - Perl_croak(aTHX_ "Usage: saylink(message, [silent?], [link_name])"); + Perl_croak(aTHX_ "Usage: quest::saylink(string message, [bool silent = false], [link_name = message])"); dXSTARG; Const_char * RETVAL; @@ -3095,7 +3095,7 @@ XS(XS__getguildnamebyid); XS(XS__getguildnamebyid) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: getguildnamebyid(guild_id)"); + Perl_croak(aTHX_ "Usage: quest::getguildnamebyid(uint32 guild_id)"); dXSTARG; Const_char * RETVAL; @@ -3112,7 +3112,7 @@ XS(XS__SetRunning) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: SetRunning(val)"); + Perl_croak(aTHX_ "Usage: quest::SetRunning(bool is_running)"); bool val = ((int)SvIV(ST(0))) == 0?false:true; @@ -3126,7 +3126,7 @@ XS(XS__IsRunning) { dXSARGS; if (items >= 1) - Perl_croak(aTHX_ "Usage: IsRunning()"); + Perl_croak(aTHX_ "Usage: quest::IsRunning()"); bool RETVAL; dXSTARG; @@ -3143,7 +3143,7 @@ XS(XS__IsEffectInSpell) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: IsEffectInSpell(spell_id, effect_id)"); + Perl_croak(aTHX_ "Usage: quest::IsEffectInSpell(uint32 spell_id, uint32 effect_id)"); uint32 spell_id = (uint32)SvUV(ST(0)); uint32 effect_id = (uint32)SvUV(ST(1)); @@ -3162,7 +3162,7 @@ XS(XS__IsBeneficialSpell) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: IsBeneficialSpell(spell_id)"); + Perl_croak(aTHX_ "Usage: quest::IsBeneficialSpell(uint32 spell_id)"); uint32 spell_id = (uint32)SvUV(ST(0)); bool RETVAL; @@ -3180,7 +3180,7 @@ XS(XS__GetSpellResistType) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: GetSpellResistType(spell_id)"); + Perl_croak(aTHX_ "Usage: quest::GetSpellResistType(uint32 spell_id)"); uint32 spell_id = (uint32)SvUV(ST(0)); int32 spell_val = 0; @@ -3195,7 +3195,7 @@ XS(XS__GetSpellTargetType) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: GetSpellTargetType(spell_id)"); + Perl_croak(aTHX_ "Usage: quest::GetSpellTargetType(uint32 spell_id)"); uint32 spell_id = (uint32)SvUV(ST(0)); int32 spell_val = 0; @@ -3209,7 +3209,7 @@ XS(XS__FlyMode); XS(XS__FlyMode) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: FlyMode([0/1/2])"); + Perl_croak(aTHX_ "Usage: quest::FlyMode(uint8 mode [0-3])"); uint8 flymode = (int)SvUV(ST(0)); quest_manager.FlyMode(flymode); @@ -3221,7 +3221,7 @@ XS(XS_FactionValue); XS(XS_FactionValue) { dXSARGS; if (items != 0) - Perl_croak(aTHX_ "Usage: factionvalue()"); + Perl_croak(aTHX_ "Usage: quest::factionvalue()"); uint8 fac = quest_manager.FactionValue(); XSRETURN_UV(fac); @@ -3232,7 +3232,7 @@ XS(XS__enabletitle) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: enabletitle(titleset)"); + Perl_croak(aTHX_ "Usage: quest::enabletitle(int title_set_id)"); int titleset = (int)SvIV(ST(0)); @@ -3246,7 +3246,7 @@ XS(XS__checktitle) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: checktitle(titleset)"); + Perl_croak(aTHX_ "Usage: quest::checktitle(int title_set_id)"); bool RETVAL; int titleset = (int)SvIV(ST(0)); @@ -3263,7 +3263,7 @@ XS(XS__removetitle) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: removetitle(titleset)"); + Perl_croak(aTHX_ "Usage: quest::removetitle(int title_set_id)"); int titleset = (int)SvIV(ST(0)); @@ -3277,7 +3277,7 @@ XS(XS__wearchange) { dXSARGS; if (items < 2) - Perl_croak(aTHX_ "Usage: wearchange(slot, texture_id, [hero_forge_model_id], [elite_material_id])"); + Perl_croak(aTHX_ "Usage: quest::wearchange(uint8 slot, uint16 texture_id, [uint32 hero_forge_model_id = 0], [uint32 elite_material_id = 0])"); uint8 slot = (int)SvUV(ST(0)); uint16 texture_id = (int)SvUV(ST(1)); @@ -3301,7 +3301,7 @@ XS(XS__voicetell) { dXSARGS; if (items != 4) - Perl_croak(aTHX_ "Usage: voicetell(client_name, macro_id, race_id, gender_id)"); + Perl_croak(aTHX_ "Usage: quest::voicetell(string client_name, int macro_id, int ace_id, int gender_id)"); char * client_name = (char *)SvPV_nolen(ST(0)); int macro_id = (int)SvIV(ST(1)); @@ -3318,7 +3318,7 @@ XS(XS__LearnRecipe) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: LearnRecipe(recipe_id)"); + Perl_croak(aTHX_ "Usage: quest::LearnRecipe(int recipe_id)"); uint32 recipe_id = (uint32)SvIV(ST(0)); @@ -3332,7 +3332,7 @@ XS(XS__SendMail) { dXSARGS; if (items != 4) - Perl_croak(aTHX_ "Usage: SendMail(to, from, subject, message)"); + Perl_croak(aTHX_ "Usage: quest::SendMail(stirng to, string from, string subject, string message)"); char *to = (char *)SvPV_nolen(ST(0)); char *from = (char *)SvPV_nolen(ST(1)); @@ -3349,7 +3349,7 @@ XS(XS__GetZoneID) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: GetZoneID(zone)"); + Perl_croak(aTHX_ "Usage: quest::GetZoneID(string zone)"); char *zone = (char *)SvPV_nolen(ST(0)); int32 id = quest_manager.GetZoneID(zone); @@ -3362,7 +3362,7 @@ XS(XS__GetZoneLongName) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: GetZoneLongName(zone)"); + Perl_croak(aTHX_ "Usage: quest::GetZoneLongName(string zone)"); dXSTARG; char *zone = (char *)SvPV_nolen(ST(0)); Const_char* RETVAL = quest_manager.GetZoneLongName(zone); @@ -3376,7 +3376,7 @@ XS(XS__GetTimeSeconds) { dXSARGS; if (items != 0) - Perl_croak(aTHX_ "Usage: GetTimeSeconds()"); + Perl_croak(aTHX_ "Usage: quest::GetTimeSeconds()"); uint32 seconds = 0; dXSTARG; @@ -3391,14 +3391,14 @@ XS(XS__crosszonesignalclientbycharid) dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: crosszonesignalclientbycharid(char_id, int_value)"); + Perl_croak(aTHX_ "Usage: quest::crosszonesignalclientbycharid(int character_id, int value)"); if (items == 2) { int char_id = (int)SvIV(ST(0)); uint32 int_value = (uint32)SvIV(ST(1)); quest_manager.CrossZoneSignalPlayerByCharID(char_id, int_value); } else { - Perl_croak(aTHX_ "Usage: crosszonesignalclientbycharid(char_id, int_value)"); + Perl_croak(aTHX_ "Usage: quest::crosszonesignalclientbycharid(int character_id, int value)"); } XSRETURN_EMPTY; @@ -3410,14 +3410,14 @@ XS(XS__crosszonesignalclientbyname) dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: crosszonesignalclientbycharid(name, int_value)"); + Perl_croak(aTHX_ "Usage: quest::crosszonesignalclientbycharid(string name, int value)"); if (items == 2) { char *name = (char *)SvPV_nolen(ST(0)); uint32 int_value = (uint32)SvIV(ST(1)); quest_manager.CrossZoneSignalPlayerByName(name, int_value); } else { - Perl_croak(aTHX_ "Usage: crosszonesignalclientbycharid(name, int_value)"); + Perl_croak(aTHX_ "Usage: quest::crosszonesignalclientbycharid(string name, int value)"); } XSRETURN_EMPTY; @@ -3430,15 +3430,13 @@ XS(XS__crosszonemessageplayerbyname) dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: crosszonemessageplayerbyname(channel_id, name, message)"); + Perl_croak(aTHX_ "Usage: quest::crosszonemessageplayerbyname(int channel_id, string name, string message)"); if (items == 3) { uint32 channel_id = (uint32)SvIV(ST(0)); char *name = (char *)SvPV_nolen(ST(1)); char *message = (char *)SvPV_nolen(ST(2)); quest_manager.CrossZoneMessagePlayerByName(channel_id, name, message); - } else { - Perl_croak(aTHX_ "Usage: crosszonemessageplayerbyname(channel_id, name, message)"); } XSRETURN_EMPTY; @@ -3451,7 +3449,7 @@ XS(XS__enablerecipe) bool success = false; if (items != 1) { - Perl_croak(aTHX_ "Usage: enablerecipe(recipe_id)"); + Perl_croak(aTHX_ "Usage: quest::enablerecipe(int recipe_id)"); } else { uint32 recipe_id = (uint32)SvIV(ST(0)); @@ -3471,7 +3469,7 @@ XS(XS__disablerecipe) bool success = false; if (items != 1) { - Perl_croak(aTHX_ "Usage: disablerecipe(recipe_id)"); + Perl_croak(aTHX_ "Usage: quest::disablerecipe(int recipe_id)"); } else { uint32 recipe_id = (uint32)SvIV(ST(0)); @@ -3490,7 +3488,7 @@ XS(XS__clear_npctype_cache) dXSARGS; if (items != 1) { - Perl_croak(aTHX_ "Usage: clear_npctype_cache(npc_type_id)"); + Perl_croak(aTHX_ "Usage: quest::clear_npctype_cache(int npc_type_id)"); } else { int32 npc_type_id = (int32)SvIV(ST(0)); @@ -3515,7 +3513,7 @@ XS(XS__qs_send_query) { dXSARGS; if (items != 1){ - Perl_croak(aTHX_ "Usage: qs_send_query(query)"); + Perl_croak(aTHX_ "Usage: quest::qs_send_query(string query)"); } else{ // char *Query = (char *)SvPV_nolen(ST(0)); @@ -3530,7 +3528,7 @@ XS(XS__qs_player_event) { dXSARGS; if (items != 2){ - Perl_croak(aTHX_ "Usage: qs_player_event(char_id, message)"); + Perl_croak(aTHX_ "Usage: quest::qs_player_event(int character_id, string message)"); } else{ int char_id = (int)SvIV(ST(0)); @@ -3546,7 +3544,7 @@ XS(XS__crosszonesetentityvariablebynpctypeid) dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: crosszonesetentityvariablebynpctypeid(npc_type_id, key, str_value)"); + Perl_croak(aTHX_ "Usage: quest::crosszonesetentityvariablebynpctypeid(int npc_type_id, string key, string value)"); if (items == 3) { uint32 npc_type_id = (uint32)SvIV(ST(0)); @@ -3564,7 +3562,7 @@ XS(XS__crosszonesetentityvariablebyclientname) dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: crosszonesetentityvariablebyclientname(client_name, key, str_value)"); + Perl_croak(aTHX_ "Usage: quest::crosszonesetentityvariablebyclientname(string client_name, string key, string value)"); if (items == 3) { const char *client_name = (const char *)SvPV_nolen(ST(0)); @@ -3582,7 +3580,7 @@ XS(XS__crosszonesignalnpcbynpctypeid) dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: crosszonesignalnpcbynpctypeid(npc_type_id, int_value)"); + Perl_croak(aTHX_ "Usage: quest::crosszonesignalnpcbynpctypeid(uint32 npc_type_id, uint32 value)"); if (items == 2) { uint32 npc_type_id = (uint32)SvIV(ST(0)); @@ -3598,7 +3596,7 @@ XS(XS__worldwidemarquee) { dXSARGS; if (items != 6) - Perl_croak(aTHX_ "Usage: worldwidemarquee(color_id, priority, fade_in, fade_out, duration, message)"); + Perl_croak(aTHX_ "Usage: quest::worldwidemarquee(uint32 color_id, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, string message)"); if (items == 6) { uint32 color_id = (uint32)SvIV(ST(0)); @@ -3618,7 +3616,7 @@ XS(XS__debug) { dXSARGS; if (items != 1 && items != 2){ - Perl_croak(aTHX_ "Usage: debug(message, [debug_level])"); + Perl_croak(aTHX_ "Usage: quest::debug(string message, [uint8 debug_level = 1 [1-3]])"); } else{ std::string log_message = (std::string)SvPV_nolen(ST(0)); @@ -3647,7 +3645,7 @@ XS(XS__UpdateZoneHeader); XS(XS__UpdateZoneHeader) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: UpdateZoneHeader(key, str_value)"); + Perl_croak(aTHX_ "Usage: quest::UpdateZoneHeader(string key, string value)"); std::string key = (std::string)SvPV_nolen(ST(0)); std::string str_value = (std::string)SvPV_nolen(ST(1)); From 1c5f0fba4f37ba1b69a6f8c567a4e72702c33734 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 1 Jul 2018 21:48:18 -0500 Subject: [PATCH 31/33] embparser_api.cpp formatting --- zone/embparser_api.cpp | 2364 +++++++++++++++++++--------------------- 1 file changed, 1105 insertions(+), 1259 deletions(-) diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index 0f160f152..04b2882d2 100644 --- a/zone/embparser_api.cpp +++ b/zone/embparser_api.cpp @@ -32,8 +32,8 @@ #include "questmgr.h" #include "zone.h" -extern Zone* zone; -extern QueryServ* QServ; +extern Zone *zone; +extern QueryServ *QServ; /* @@ -50,90 +50,85 @@ SvPV_nolen == string with no length restriction //Any creation of new Client objects gets the current quest Client XS(XS_Client_new); -XS(XS_Client_new) -{ +XS(XS_Client_new) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::Client::new()"); { - Client * RETVAL; + Client *RETVAL; RETVAL = quest_manager.GetInitiator(); ST(0) = sv_newmortal(); - if(RETVAL) - sv_setref_pv(ST(0), "Client", (void*)RETVAL); + if (RETVAL) + sv_setref_pv(ST(0), "Client", (void *) RETVAL); } XSRETURN(1); } //Any creation of new NPC objects gets the current quest NPC XS(XS_NPC_new); -XS(XS_NPC_new) -{ +XS(XS_NPC_new) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::NPC::new()"); { - NPC * RETVAL; + NPC *RETVAL; RETVAL = quest_manager.GetNPC(); ST(0) = sv_newmortal(); - if(RETVAL) - sv_setref_pv(ST(0), "NPC", (void*)RETVAL); + if (RETVAL) + sv_setref_pv(ST(0), "NPC", (void *) RETVAL); } XSRETURN(1); } //Any creation of new NPC objects gets the current quest NPC XS(XS_EntityList_new); -XS(XS_EntityList_new) -{ +XS(XS_EntityList_new) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::EntityList::new()"); { - EntityList * RETVAL; + EntityList *RETVAL; RETVAL = &entity_list; ST(0) = sv_newmortal(); - if(RETVAL) - sv_setref_pv(ST(0), "EntityList", (void*)RETVAL); + if (RETVAL) + sv_setref_pv(ST(0), "EntityList", (void *) RETVAL); } XSRETURN(1); } //Any creation of new quest items gets the current quest item XS(XS_QuestItem_new); -XS(XS_QuestItem_new) -{ +XS(XS_QuestItem_new) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::QuestItem::new()"); - EQEmu::ItemInstance* RETVAL; + EQEmu::ItemInstance *RETVAL; RETVAL = quest_manager.GetQuestItem(); ST(0) = sv_newmortal(); - if(RETVAL) - sv_setref_pv(ST(0), "QuestItem", (void*)RETVAL); + if (RETVAL) + sv_setref_pv(ST(0), "QuestItem", (void *) RETVAL); XSRETURN(1); } //Any creation of new quest items gets the current quest item XS(XS_MobList_new); -XS(XS_MobList_new) -{ +XS(XS_MobList_new) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::MobList::new()"); - ListElement* RETVAL; + ListElement *RETVAL; RETVAL = nullptr; ST(0) = sv_newmortal(); - if(RETVAL) - sv_setref_pv(ST(0), "MobList", (void*)RETVAL); + if (RETVAL) + sv_setref_pv(ST(0), "MobList", (void *) RETVAL); XSRETURN(1); } @@ -145,8 +140,8 @@ XS(XS__echo); // prototype to pass -Wmissing-prototypes XS(XS__echo) { dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: quest::echo(int emote_color_id, string message)"); + if (items != 2) + Perl_croak(aTHX_ "Usage: quest::echo(int emote_color_id, string message)"); quest_manager.echo(SvUV(ST(0)), SvPV_nolen(ST(1))); @@ -160,7 +155,7 @@ XS(XS__say) { if (items == 1) quest_manager.say(SvPV_nolen(ST(0))); else if (items == 2) - quest_manager.say(SvPV_nolen(ST(0)), (int)SvIV(ST(1))); + quest_manager.say(SvPV_nolen(ST(0)), (int) SvIV(ST(1))); else Perl_croak(aTHX_ "Usage: quest::say(string message, int language_id])"); @@ -180,12 +175,11 @@ XS(XS__me) { } XS(XS__summonitem); // prototype to pass -Wmissing-prototypes -XS(XS__summonitem) -{ +XS(XS__summonitem) { dXSARGS; if (items == 1) quest_manager.summonitem(SvUV(ST(0))); - else if(items == 2) + else if (items == 2) quest_manager.summonitem(SvUV(ST(0)), SvUV(ST(1))); else Perl_croak(aTHX_ "Usage: quest::summonitem(int item_id, [int charges])"); @@ -193,14 +187,13 @@ XS(XS__summonitem) } XS(XS__write); -XS(XS__write) -{ +XS(XS__write) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::write(string file_name, string message)"); - char * file = (char *)SvPV_nolen(ST(0)); - char * message = (char *)SvPV_nolen(ST(1)); + char *file = (char *) SvPV_nolen(ST(0)); + char *message = (char *) SvPV_nolen(ST(1)); quest_manager.write(file, message); @@ -208,132 +201,132 @@ XS(XS__write) } XS(XS__spawn); -XS(XS__spawn) -{ +XS(XS__spawn) { dXSARGS; if (items != 6) - Perl_croak(aTHX_ "Usage: quest::spawn(int npc_type_id, int grid_id, int int_unused, float x, float y, float z)"); + Perl_croak(aTHX_ + "Usage: quest::spawn(int npc_type_id, int grid_id, int int_unused, float x, float y, float z)"); - uint16 RETVAL; + uint16 RETVAL; dXSTARG; - int npc_type_id = (int)SvIV(ST(0)); - int grid_id = (int)SvIV(ST(1)); - int int_unused = (int)SvIV(ST(2)); - auto position = glm::vec4((float)SvNV(ST(3)), (float)SvNV(ST(4)), (float)SvNV(ST(5)), 0.0f); + int npc_type_id = (int) SvIV(ST(0)); + int grid_id = (int) SvIV(ST(1)); + int int_unused = (int) SvIV(ST(2)); + auto position = glm::vec4((float) SvNV(ST(3)), (float) SvNV(ST(4)), (float) SvNV(ST(5)), 0.0f); Mob *r = quest_manager.spawn2(npc_type_id, grid_id, int_unused, position); RETVAL = (r != nullptr) ? r->GetID() : 0; - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); XSRETURN(1); } XS(XS__spawn2); -XS(XS__spawn2) -{ +XS(XS__spawn2) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ "Usage: quest::spawn2(int npc_type_id, int grid_id, int int_unused, float x, float y, float z, float heading)"); + Perl_croak(aTHX_ + "Usage: quest::spawn2(int npc_type_id, int grid_id, int int_unused, float x, float y, float z, float heading)"); - uint16 RETVAL; + uint16 RETVAL; dXSTARG; - int npc_type_id = (int)SvIV(ST(0)); - int grid_id = (int)SvIV(ST(1)); - int int_unused = (int)SvIV(ST(2)); - auto position = glm::vec4((float)SvNV(ST(3)), (float)SvNV(ST(4)), (float)SvNV(ST(5)), (float)SvNV(ST(6))); + int npc_type_id = (int) SvIV(ST(0)); + int grid_id = (int) SvIV(ST(1)); + int int_unused = (int) SvIV(ST(2)); + auto position = glm::vec4((float) SvNV(ST(3)), (float) SvNV(ST(4)), (float) SvNV(ST(5)), (float) SvNV(ST(6))); Mob *r = quest_manager.spawn2(npc_type_id, grid_id, int_unused, position); RETVAL = (r != nullptr) ? r->GetID() : 0; - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); XSRETURN(1); } XS(XS__unique_spawn); -XS(XS__unique_spawn) -{ +XS(XS__unique_spawn) { dXSARGS; if (items != 6 && items != 7) - Perl_croak(aTHX_ "Usage: quest::unique_spawn(int npc_type_id, int grid_id, int int_unused, float x, float y, float z, [float heading])"); + Perl_croak(aTHX_ + "Usage: quest::unique_spawn(int npc_type_id, int grid_id, int int_unused, float x, float y, float z, [float heading])"); - uint16 RETVAL; + uint16 RETVAL; dXSTARG; - int npc_type_id = (int)SvIV(ST(0)); - int grid_id = (int)SvIV(ST(1)); - int int_unused = (int)SvIV(ST(2)); - float x = (float)SvNV(ST(3)); - float y = (float)SvNV(ST(4)); - float z = (float)SvNV(ST(5)); - float heading = 0; - if(items == 7) - heading = (float)SvNV(ST(6)); + int npc_type_id = (int) SvIV(ST(0)); + int grid_id = (int) SvIV(ST(1)); + int int_unused = (int) SvIV(ST(2)); + float x = (float) SvNV(ST(3)); + float y = (float) SvNV(ST(4)); + float z = (float) SvNV(ST(5)); + float heading = 0; + if (items == 7) + heading = (float) SvNV(ST(6)); - Mob *r = quest_manager.unique_spawn(npc_type_id, grid_id, int_unused, glm::vec4(x, y, z, heading)); + Mob *r = quest_manager.unique_spawn(npc_type_id, grid_id, int_unused, glm::vec4(x, y, z, heading)); RETVAL = (r != nullptr) ? r->GetID() : 0; - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); XSRETURN(1); } XS(XS__spawn_from_spawn2); -XS(XS__spawn_from_spawn2) -{ +XS(XS__spawn_from_spawn2) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::spawn_from_spawn2(int spawn2_id)"); - uint16 RETVAL; + uint16 RETVAL; dXSTARG; - int spawn2_id = (int)SvIV(ST(0)); + int spawn2_id = (int) SvIV(ST(0)); - Mob *r = quest_manager.spawn_from_spawn2(spawn2_id); + Mob *r = quest_manager.spawn_from_spawn2(spawn2_id); RETVAL = (r != nullptr) ? r->GetID() : 0; - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); XSRETURN(1); } XS(XS__enable_spawn2); -XS(XS__enable_spawn2) -{ +XS(XS__enable_spawn2) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::enable_spawn2(int spawn2_id)"); - int spawn2_id = (int)SvIV(ST(0)); + int spawn2_id = (int) SvIV(ST(0)); quest_manager.enable_spawn2(spawn2_id); XSRETURN_EMPTY; } XS(XS__disable_spawn2); -XS(XS__disable_spawn2) -{ +XS(XS__disable_spawn2) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::disable_spawn2(int spawn2_id)"); - int spawn2_id = (int)SvIV(ST(0)); + int spawn2_id = (int) SvIV(ST(0)); quest_manager.disable_spawn2(spawn2_id); XSRETURN_EMPTY; } XS(XS__setstat); -XS(XS__setstat) -{ +XS(XS__setstat) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::setstat(stat_id, int_value)"); - int stat_id = (int)SvIV(ST(0)); - int int_value = (int)SvIV(ST(1)); + int stat_id = (int) SvIV(ST(0)); + int int_value = (int) SvIV(ST(1)); quest_manager.setstat(stat_id, int_value); @@ -341,14 +334,13 @@ XS(XS__setstat) } XS(XS__incstat); //old setstat command aza -XS(XS__incstat) -{ +XS(XS__incstat) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::incstat(int stat_id, int value)"); - int stat_id = (int)SvIV(ST(0)); - int int_value = (int)SvIV(ST(1)); + int stat_id = (int) SvIV(ST(0)); + int int_value = (int) SvIV(ST(1)); quest_manager.incstat(stat_id, int_value); @@ -356,14 +348,13 @@ XS(XS__incstat) } XS(XS__castspell); -XS(XS__castspell) -{ +XS(XS__castspell) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::castspell(int spell_id, int target_id)"); - int spell_id = (int)SvIV(ST(0)); - int target_id = (int)SvIV(ST(1)); + int spell_id = (int) SvIV(ST(0)); + int target_id = (int) SvIV(ST(1)); quest_manager.castspell(spell_id, target_id); @@ -371,13 +362,12 @@ XS(XS__castspell) } XS(XS__selfcast); -XS(XS__selfcast) -{ +XS(XS__selfcast) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::selfcast(int spell_id)"); - int spell_id = (int)SvIV(ST(0)); + int spell_id = (int) SvIV(ST(0)); quest_manager.selfcast(spell_id); @@ -385,20 +375,19 @@ XS(XS__selfcast) } XS(XS__addloot); -XS(XS__addloot) -{ +XS(XS__addloot) { dXSARGS; - if(items < 1 || items > 3) + if (items < 1 || items > 3) Perl_croak(aTHX_ "Usage: quest::addloot(uint32 item_id, uint16 charges = 0, [bool equip_item = true])"); - uint32 item_id = (uint32)SvUV(ST(0)); - uint16 charges = 0; - bool equipitem = true; + uint32 item_id = (uint32) SvUV(ST(0)); + uint16 charges = 0; + bool equipitem = true; if (items > 1) - charges = (uint16)SvUV(ST(1)); + charges = (uint16) SvUV(ST(1)); if (items > 2) - equipitem = (bool)SvTRUE(ST(2)); + equipitem = (bool) SvTRUE(ST(2)); quest_manager.addloot(item_id, charges, equipitem); @@ -406,13 +395,12 @@ XS(XS__addloot) } XS(XS__zone); -XS(XS__zone) -{ +XS(XS__zone) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::zone(string zone_name)"); - char * zone_name = (char *)SvPV_nolen(ST(0)); + char *zone_name = (char *) SvPV_nolen(ST(0)); quest_manager.Zone(zone_name); @@ -420,14 +408,13 @@ XS(XS__zone) } XS(XS__settimer); -XS(XS__settimer) -{ +XS(XS__settimer) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::settimer(string timer_name, int seconds)"); - char * timer_name = (char *)SvPV_nolen(ST(0)); - int seconds = (int)SvIV(ST(1)); + char *timer_name = (char *) SvPV_nolen(ST(0)); + int seconds = (int) SvIV(ST(1)); quest_manager.settimer(timer_name, seconds); @@ -435,14 +422,13 @@ XS(XS__settimer) } XS(XS__settimerMS); -XS(XS__settimerMS) -{ +XS(XS__settimerMS) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::settimerMS(string timer_name, int milliseconds)"); - char * timer_name = (char *)SvPV_nolen(ST(0)); - int milliseconds = (int)SvIV(ST(1)); + char *timer_name = (char *) SvPV_nolen(ST(0)); + int milliseconds = (int) SvIV(ST(1)); quest_manager.settimerMS(timer_name, milliseconds); @@ -450,13 +436,12 @@ XS(XS__settimerMS) } XS(XS__stoptimer); -XS(XS__stoptimer) -{ +XS(XS__stoptimer) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::stoptimer(string timer_name)"); - char * timer_name = (char *)SvPV_nolen(ST(0)); + char *timer_name = (char *) SvPV_nolen(ST(0)); quest_manager.stoptimer(timer_name); @@ -464,8 +449,7 @@ XS(XS__stoptimer) } XS(XS__stopalltimers); -XS(XS__stopalltimers) -{ +XS(XS__stopalltimers) { dXSARGS; if (items != 0) Perl_croak(aTHX_ "Usage: quest::stopalltimers()"); @@ -476,13 +460,12 @@ XS(XS__stopalltimers) } XS(XS__emote); -XS(XS__emote) -{ +XS(XS__emote) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::emote(string message)"); - char * message = (char *)SvPV_nolen(ST(0)); + char *message = (char *) SvPV_nolen(ST(0)); quest_manager.emote(message); @@ -490,13 +473,12 @@ XS(XS__emote) } XS(XS__shout); -XS(XS__shout) -{ +XS(XS__shout) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::shout(string message)"); - char * message = (char *)SvPV_nolen(ST(0)); + char *message = (char *) SvPV_nolen(ST(0)); quest_manager.shout(message); @@ -504,13 +486,12 @@ XS(XS__shout) } XS(XS__shout2); -XS(XS__shout2) -{ +XS(XS__shout2) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::shout2(string message)"); - char * message = (char *)SvPV_nolen(ST(0)); + char *message = (char *) SvPV_nolen(ST(0)); quest_manager.shout2(message); @@ -518,31 +499,30 @@ XS(XS__shout2) } XS(XS__gmsay); -XS(XS__gmsay) -{ +XS(XS__gmsay) { dXSARGS; if ((items < 1) || (items > 5)) Perl_croak(aTHX_ "Usage: quest::gmsay(string message, [int color_id], [bool send_to_world = 0])"); - char * message = (char *)SvPV_nolen(ST(0)); - int color_id = 7; - bool send_to_world = 0; - uint32 to_guilddbid = 0; - uint16 to_minstatus = 80; + char *message = (char *) SvPV_nolen(ST(0)); + int color_id = 7; + bool send_to_world = 0; + uint32 to_guilddbid = 0; + uint16 to_minstatus = 80; if (items > 1) { - color_id = (int)SvIV(ST(1)); + color_id = (int) SvIV(ST(1)); } if (items > 2) { - send_to_world = ((int)SvIV(ST(2))) == 0?false:true; + send_to_world = ((int) SvIV(ST(2))) == 0 ? false : true; } if (items > 3) - to_guilddbid = (int)SvUV(ST(3)); + to_guilddbid = (int) SvUV(ST(3)); if (items > 4) - to_minstatus = (int)SvUV(ST(4)); + to_minstatus = (int) SvUV(ST(4)); quest_manager.gmsay(message, color_id, send_to_world, to_guilddbid, to_minstatus); @@ -550,18 +530,17 @@ XS(XS__gmsay) } XS(XS__depop); -XS(XS__depop) -{ +XS(XS__depop) { dXSARGS; if (items < 0 || items > 1) Perl_croak(aTHX_ "Usage: quest::depop(int npc_type_id = 0)"); - int npc_type_id; + int npc_type_id; if (items < 1) npc_type_id = 0; else - npc_type_id = (int)SvIV(ST(0)); + npc_type_id = (int) SvIV(ST(0)); quest_manager.depop(npc_type_id); @@ -570,18 +549,17 @@ XS(XS__depop) } XS(XS__depop_withtimer); -XS(XS__depop_withtimer) -{ +XS(XS__depop_withtimer) { dXSARGS; if (items < 0 || items > 1) Perl_croak(aTHX_ "Usage: quest::depop_withtimer(int npc_type_id = 0)"); - int npc_type_id; + int npc_type_id; if (items < 1) npc_type_id = 0; else - npc_type_id = (int)SvIV(ST(0)); + npc_type_id = (int) SvIV(ST(0)); quest_manager.depop_withtimer(npc_type_id); @@ -590,18 +568,17 @@ XS(XS__depop_withtimer) } XS(XS__depopall); -XS(XS__depopall) -{ +XS(XS__depopall) { dXSARGS; if (items < 0 || items > 1) Perl_croak(aTHX_ "Usage: quest::depopall(int npc_type_id = 0)"); - int npc_type_id; + int npc_type_id; if (items < 1) npc_type_id = 0; else - npc_type_id = (int)SvIV(ST(0)); + npc_type_id = (int) SvIV(ST(0)); quest_manager.depopall(npc_type_id); @@ -610,14 +587,13 @@ XS(XS__depopall) } XS(XS__settarget); -XS(XS__settarget) -{ +XS(XS__settarget) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::settarget(string target_enum ['npc_type', 'entity'], int target_id)"); - char * target_enum = (char *)SvPV_nolen(ST(0)); - int target_id = (int)SvIV(ST(1)); + char *target_enum = (char *) SvPV_nolen(ST(0)); + int target_id = (int) SvIV(ST(1)); quest_manager.settarget(target_enum, target_id); @@ -625,17 +601,16 @@ XS(XS__settarget) } XS(XS__follow); -XS(XS__follow) -{ +XS(XS__follow) { dXSARGS; if (items != 1 && items != 2) Perl_croak(aTHX_ "Usage: quest::follow(int entity_id, [int distance = 10])"); - int entity_id = (int)SvIV(ST(0)); - int distance; + int entity_id = (int) SvIV(ST(0)); + int distance; if (items == 2) - distance = (int)SvIV(ST(1)); + distance = (int) SvIV(ST(1)); else distance = 10; @@ -645,8 +620,7 @@ XS(XS__follow) } XS(XS__sfollow); -XS(XS__sfollow) -{ +XS(XS__sfollow) { dXSARGS; if (items != 0) Perl_croak(aTHX_ "Usage: quest::sfollow()"); @@ -658,13 +632,12 @@ XS(XS__sfollow) } XS(XS__changedeity); -XS(XS__changedeity) -{ +XS(XS__changedeity) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::changedeity(int deity_id)"); - int diety_id = (int)SvIV(ST(0)); + int diety_id = (int) SvIV(ST(0)); quest_manager.changedeity(diety_id); @@ -672,13 +645,12 @@ XS(XS__changedeity) } XS(XS__exp); -XS(XS__exp) -{ +XS(XS__exp) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::exp(int amount)"); - int amt = (int)SvIV(ST(0)); + int amt = (int) SvIV(ST(0)); quest_manager.exp(amt); @@ -686,13 +658,12 @@ XS(XS__exp) } XS(XS__level); -XS(XS__level) -{ +XS(XS__level) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::level(int new_level)"); - int newlevel = (int)SvIV(ST(0)); + int newlevel = (int) SvIV(ST(0)); quest_manager.level(newlevel); @@ -700,13 +671,12 @@ XS(XS__level) } XS(XS__traindisc); -XS(XS__traindisc) -{ +XS(XS__traindisc) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::traindisc(int tome_item_id)"); - int discipline_tome_item_id = (int)SvIV(ST(0)); + int discipline_tome_item_id = (int) SvIV(ST(0)); quest_manager.traindisc(discipline_tome_item_id); @@ -714,25 +684,23 @@ XS(XS__traindisc) } XS(XS__isdisctome); -XS(XS__isdisctome) -{ +XS(XS__isdisctome) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::isdisctome(int item_id)"); bool RETVAL; - int item_id = (int)SvIV(ST(0)); + int item_id = (int) SvIV(ST(0)); RETVAL = quest_manager.isdisctome(item_id); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); XSRETURN(1); } XS(XS__safemove); -XS(XS__safemove) -{ +XS(XS__safemove) { dXSARGS; if (items != 0) Perl_croak(aTHX_ "Usage: quest::safemove()"); @@ -744,13 +712,12 @@ XS(XS__safemove) } XS(XS__rain); -XS(XS__rain) -{ +XS(XS__rain) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::rain(int weather)"); - int weather = (int)SvIV(ST(0)); + int weather = (int) SvIV(ST(0)); quest_manager.rain(weather); @@ -758,13 +725,12 @@ XS(XS__rain) } XS(XS__snow); -XS(XS__snow) -{ +XS(XS__snow) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::snow(int weather)"); - int weather = (int)SvIV(ST(0)); + int weather = (int) SvIV(ST(0)); quest_manager.snow(weather); @@ -772,13 +738,12 @@ XS(XS__snow) } XS(XS__surname); -XS(XS__surname) -{ +XS(XS__surname) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::surname(string name)"); - char * name = (char *)SvPV_nolen(ST(0)); + char *name = (char *) SvPV_nolen(ST(0)); quest_manager.surname(name); @@ -786,13 +751,12 @@ XS(XS__surname) } XS(XS__permaclass); -XS(XS__permaclass) -{ +XS(XS__permaclass) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::permaclass(int class_id)"); - int class_id = (int)SvIV(ST(0)); + int class_id = (int) SvIV(ST(0)); quest_manager.permaclass(class_id); @@ -800,13 +764,12 @@ XS(XS__permaclass) } XS(XS__permarace); -XS(XS__permarace) -{ +XS(XS__permarace) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::permarace(int race_id)"); - int race_id = (int)SvIV(ST(0)); + int race_id = (int) SvIV(ST(0)); quest_manager.permarace(race_id); @@ -814,13 +777,12 @@ XS(XS__permarace) } XS(XS__permagender); -XS(XS__permagender) -{ +XS(XS__permagender) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::permagender(int gender_id)"); - int gender_id = (int)SvIV(ST(0)); + int gender_id = (int) SvIV(ST(0)); quest_manager.permagender(gender_id); @@ -828,52 +790,51 @@ XS(XS__permagender) } XS(XS__scribespells); -XS(XS__scribespells) -{ +XS(XS__scribespells) { dXSARGS; if (items < 1) Perl_croak(aTHX_ "Usage: quest::scribespells(int max_level, [int min_level = 1])"); - uint16 RETVAL; + uint16 RETVAL; dXSTARG; - uint8 max_level = (uint8)SvIV(ST(0)); - uint8 min_level = (uint8)SvIV(ST(1)); + uint8 max_level = (uint8) SvIV(ST(0)); + uint8 min_level = (uint8) SvIV(ST(1)); if (min_level) RETVAL = quest_manager.scribespells(max_level, min_level); else RETVAL = quest_manager.scribespells(max_level); - XSprePUSH; PUSHu((IV)RETVAL); + XSprePUSH; + PUSHu((IV) RETVAL); XSRETURN(1); } XS(XS__traindiscs); -XS(XS__traindiscs) -{ +XS(XS__traindiscs) { dXSARGS; if (items < 1) Perl_croak(aTHX_ "Usage: quest::traindiscs(int max_level, [int min_level = 1])"); - uint16 RETVAL; + uint16 RETVAL; dXSTARG; - uint8 max_level = (uint8)SvIV(ST(0)); - uint8 min_level = (uint8)SvIV(ST(1)); + uint8 max_level = (uint8) SvIV(ST(0)); + uint8 min_level = (uint8) SvIV(ST(1)); if (min_level) RETVAL = quest_manager.traindiscs(max_level, min_level); else RETVAL = quest_manager.traindiscs(max_level); - XSprePUSH; PUSHu((IV)RETVAL); + XSprePUSH; + PUSHu((IV) RETVAL); XSRETURN(1); } XS(XS__unscribespells); -XS(XS__unscribespells) -{ +XS(XS__unscribespells) { dXSARGS; if (items != 0) Perl_croak(aTHX_ "Usage: quest::unscribespells()"); @@ -885,8 +846,7 @@ XS(XS__unscribespells) } XS(XS__untraindiscs); -XS(XS__untraindiscs) -{ +XS(XS__untraindiscs) { dXSARGS; if (items != 0) Perl_croak(aTHX_ "Usage: quest::untraindiscs()"); @@ -898,16 +858,15 @@ XS(XS__untraindiscs) } XS(XS__givecash); -XS(XS__givecash) -{ +XS(XS__givecash) { dXSARGS; if (items != 4) Perl_croak(aTHX_ "Usage: quest::givecash(int copper, int silver, int gold, int platinum)"); - int copper = (int)SvIV(ST(0)); - int silver = (int)SvIV(ST(1)); - int gold = (int)SvIV(ST(2)); - int platinum = (int)SvIV(ST(3)); + int copper = (int) SvIV(ST(0)); + int silver = (int) SvIV(ST(1)); + int gold = (int) SvIV(ST(2)); + int platinum = (int) SvIV(ST(3)); quest_manager.givecash(copper, silver, gold, platinum); @@ -915,13 +874,12 @@ XS(XS__givecash) } XS(XS__pvp); -XS(XS__pvp) -{ +XS(XS__pvp) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::pvp(string mode [on|off])"); - char * mode = (char *)SvPV_nolen(ST(0)); + char *mode = (char *) SvPV_nolen(ST(0)); quest_manager.pvp(mode); @@ -929,39 +887,37 @@ XS(XS__pvp) } XS(XS__movepc); -XS(XS__movepc) -{ +XS(XS__movepc) { dXSARGS; if (items != 4 && items != 5) Perl_croak(aTHX_ "Usage: quest::movepc(int zone_id, float x, float y, float z [float heading])"); - int zone_id = (int)SvIV(ST(0)); - float x = (float)SvNV(ST(1)); - float y = (float)SvNV(ST(2)); - float z = (float)SvNV(ST(3)); + int zone_id = (int) SvIV(ST(0)); + float x = (float) SvNV(ST(1)); + float y = (float) SvNV(ST(2)); + float z = (float) SvNV(ST(3)); if (items == 4) - quest_manager.movepc(zone_id, x, y, z, 0.0f); + quest_manager.movepc(zone_id, x, y, z, 0.0f); else { - float heading = (float)SvNV(ST(4)); - quest_manager.movepc(zone_id, x, y, z, heading); + float heading = (float) SvNV(ST(4)); + quest_manager.movepc(zone_id, x, y, z, heading); } XSRETURN_EMPTY; } XS(XS__gmmove); -XS(XS__gmmove) -{ +XS(XS__gmmove) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: quest::gmmove(float x, float y, float z)"); - float x = (float)SvNV(ST(0)); - float y = (float)SvNV(ST(1)); - float z = (float)SvNV(ST(2)); + float x = (float) SvNV(ST(0)); + float y = (float) SvNV(ST(1)); + float z = (float) SvNV(ST(2)); quest_manager.gmmove(x, y, z); @@ -969,16 +925,15 @@ XS(XS__gmmove) } XS(XS__movegrp); -XS(XS__movegrp) -{ +XS(XS__movegrp) { dXSARGS; if (items != 4) Perl_croak(aTHX_ "Usage: quest::movegrp(int zone_id, float x, float y, float z)"); - int zone_id = (int)SvIV(ST(0)); - float x = (float)SvNV(ST(1)); - float y = (float)SvNV(ST(2)); - float z = (float)SvNV(ST(3)); + int zone_id = (int) SvIV(ST(0)); + float x = (float) SvNV(ST(1)); + float y = (float) SvNV(ST(2)); + float z = (float) SvNV(ST(3)); quest_manager.movegrp(zone_id, x, y, z); @@ -986,13 +941,12 @@ XS(XS__movegrp) } XS(XS__doanim); -XS(XS__doanim) -{ +XS(XS__doanim) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::doanim(int animation_id)"); - int anim_id = (int)SvIV(ST(0)); + int anim_id = (int) SvIV(ST(0)); quest_manager.doanim(anim_id); @@ -1000,14 +954,13 @@ XS(XS__doanim) } XS(XS__addskill); -XS(XS__addskill) -{ +XS(XS__addskill) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::addskill(int skill_id, int value)"); - int skill_id = (int)SvIV(ST(0)); - int int_value = (int)SvIV(ST(1)); + int skill_id = (int) SvIV(ST(0)); + int int_value = (int) SvIV(ST(1)); quest_manager.addskill(skill_id, int_value); @@ -1015,14 +968,13 @@ XS(XS__addskill) } XS(XS__setlanguage); -XS(XS__setlanguage) -{ +XS(XS__setlanguage) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::setlanguage(int skill_id, int value)"); - int skill_id = (int)SvIV(ST(0)); - int int_value = (int)SvIV(ST(1)); + int skill_id = (int) SvIV(ST(0)); + int int_value = (int) SvIV(ST(1)); quest_manager.setlanguage(skill_id, int_value); @@ -1030,14 +982,13 @@ XS(XS__setlanguage) } XS(XS__setskill); -XS(XS__setskill) -{ +XS(XS__setskill) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::setskill(int skill_id, int value)"); - int skill_id = (int)SvIV(ST(0)); - int int_value = (int)SvIV(ST(1)); + int skill_id = (int) SvIV(ST(0)); + int int_value = (int) SvIV(ST(1)); quest_manager.setskill(skill_id, int_value); @@ -1045,13 +996,12 @@ XS(XS__setskill) } XS(XS__setallskill); -XS(XS__setallskill) -{ +XS(XS__setallskill) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::setallskill(int value)"); - int int_value = (int)SvIV(ST(0)); + int int_value = (int) SvIV(ST(0)); quest_manager.setallskill(int_value); @@ -1059,13 +1009,12 @@ XS(XS__setallskill) } XS(XS__attack); -XS(XS__attack) -{ +XS(XS__attack) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::attack(string client_name)"); - char * client_name = (char *)SvPV_nolen(ST(0)); + char *client_name = (char *) SvPV_nolen(ST(0)); quest_manager.attack(client_name); @@ -1073,13 +1022,12 @@ XS(XS__attack) } XS(XS__attacknpc); -XS(XS__attacknpc) -{ +XS(XS__attacknpc) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::attacknpc(int npc_entity_id)"); - int npc_entity_id = (int)SvIV(ST(0)); + int npc_entity_id = (int) SvIV(ST(0)); quest_manager.attacknpc(npc_entity_id); @@ -1087,13 +1035,12 @@ XS(XS__attacknpc) } XS(XS__attacknpctype); -XS(XS__attacknpctype) -{ +XS(XS__attacknpctype) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::attacknpctype(int npc_type_id)"); - int npc_type_id = (int)SvIV(ST(0)); + int npc_type_id = (int) SvIV(ST(0)); quest_manager.attacknpctype(npc_type_id); @@ -1101,8 +1048,7 @@ XS(XS__attacknpctype) } XS(XS__save); -XS(XS__save) -{ +XS(XS__save) { dXSARGS; if (items != 0) Perl_croak(aTHX_ "Usage: quest::save()"); @@ -1114,20 +1060,19 @@ XS(XS__save) } XS(XS__faction); -XS(XS__faction) -{ +XS(XS__faction) { dXSARGS; if (items < 2 || items > 3) Perl_croak(aTHX_ "Usage: quest::faction(int faction_id, int value, [int temp = 0])"); - int faction_id = (int)SvIV(ST(0)); - int int_value = (int)SvIV(ST(1)); + int faction_id = (int) SvIV(ST(0)); + int int_value = (int) SvIV(ST(1)); int temp; - if(items == 2) + if (items == 2) temp = 0; else - temp = (int)SvIV(ST(2)); + temp = (int) SvIV(ST(2)); quest_manager.faction(faction_id, int_value, temp); @@ -1135,13 +1080,12 @@ XS(XS__faction) } XS(XS__setsky); -XS(XS__setsky) -{ +XS(XS__setsky) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::setsky(uint8 sky)"); - unsigned char new_sky = (unsigned char)SvUV(ST(0)); + unsigned char new_sky = (unsigned char) SvUV(ST(0)); quest_manager.setsky(new_sky); @@ -1149,14 +1093,13 @@ XS(XS__setsky) } XS(XS__setguild); -XS(XS__setguild) -{ +XS(XS__setguild) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::setguild(int guild_id, int guild_rank_id)"); - unsigned long new_guild_id = (unsigned long)SvUV(ST(0)); - int guild_rank_id = (int)SvIV(ST(1)); + unsigned long new_guild_id = (unsigned long) SvUV(ST(0)); + int guild_rank_id = (int) SvIV(ST(1)); quest_manager.setguild(new_guild_id, guild_rank_id); @@ -1164,14 +1107,13 @@ XS(XS__setguild) } XS(XS__createguild); -XS(XS__createguild) -{ +XS(XS__createguild) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::createguild(string guild_name, string leader_name)"); - char * guild_name = (char *)SvPV_nolen(ST(0)); - char * leader_name = (char *)SvPV_nolen(ST(1)); + char *guild_name = (char *) SvPV_nolen(ST(0)); + char *leader_name = (char *) SvPV_nolen(ST(1)); quest_manager.CreateGuild(guild_name, leader_name); @@ -1179,26 +1121,23 @@ XS(XS__createguild) } XS(XS__settime); -XS(XS__settime) -{ +XS(XS__settime) { dXSARGS; if (items < 2) Perl_croak(aTHX_ "Usage: quest::settime(int new_hour, int new_min, [bool update_world = true])"); - if (items == 2){ - int new_hour = (int)SvIV(ST(0)); - int new_min = (int)SvIV(ST(1)); + if (items == 2) { + int new_hour = (int) SvIV(ST(0)); + int new_min = (int) SvIV(ST(1)); quest_manager.settime(new_hour, new_min, true); - } - else if (items == 3){ - int new_hour = (int)SvIV(ST(0)); - int new_min = (int)SvIV(ST(1)); + } else if (items == 3) { + int new_hour = (int) SvIV(ST(0)); + int new_min = (int) SvIV(ST(1)); - int update_world = (int)SvIV(ST(2)); - if (update_world == 1){ + int update_world = (int) SvIV(ST(2)); + if (update_world == 1) { quest_manager.settime(new_hour, new_min, true); - } - else{ + } else { quest_manager.settime(new_hour, new_min, false); } } @@ -1207,13 +1146,12 @@ XS(XS__settime) } XS(XS__itemlink); -XS(XS__itemlink) -{ +XS(XS__itemlink) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::itemlink(int item_id)"); - int item_id = (int)SvIV(ST(0)); + int item_id = (int) SvIV(ST(0)); quest_manager.itemlink(item_id); @@ -1221,18 +1159,17 @@ XS(XS__itemlink) } XS(XS__signalwith); -XS(XS__signalwith) -{ +XS(XS__signalwith) { dXSARGS; if (items == 2) { - int npc_id = (int)SvIV(ST(0)); - int signal_id = (int)SvIV(ST(1)); + int npc_id = (int) SvIV(ST(0)); + int signal_id = (int) SvIV(ST(1)); quest_manager.signalwith(npc_id, signal_id); - } else if(items == 3) { - int npc_id = (int)SvIV(ST(0)); - int signal_id = (int)SvIV(ST(1)); - int wait = (int)SvIV(ST(2)); + } else if (items == 3) { + int npc_id = (int) SvIV(ST(0)); + int signal_id = (int) SvIV(ST(1)); + int wait = (int) SvIV(ST(2)); quest_manager.signalwith(npc_id, signal_id, wait); } else { Perl_croak(aTHX_ "Usage: quest::signalwith(int npc_id, int signal_id, [int wait_ms])"); @@ -1242,16 +1179,15 @@ XS(XS__signalwith) } XS(XS__signal); -XS(XS__signal) -{ +XS(XS__signal) { dXSARGS; if (items == 1) { - int npc_id = (int)SvIV(ST(0)); + int npc_id = (int) SvIV(ST(0)); quest_manager.signal(npc_id); - } else if(items == 2) { - int npc_id = (int)SvIV(ST(0)); - int wait = (int)SvIV(ST(1)); + } else if (items == 2) { + int npc_id = (int) SvIV(ST(0)); + int wait = (int) SvIV(ST(1)); quest_manager.signal(npc_id, wait); } else { Perl_croak(aTHX_ "Usage: quest::signal(int npc_id, [int wait_ms])"); @@ -1261,16 +1197,15 @@ XS(XS__signal) } XS(XS__setglobal); -XS(XS__setglobal) -{ +XS(XS__setglobal) { dXSARGS; if (items != 4) Perl_croak(aTHX_ "Usage: quest::setglobal(stirng key, string value, int options, string duration)"); - char * key = (char *)SvPV_nolen(ST(0)); - char * str_value = (char *)SvPV_nolen(ST(1)); - int options = (int)SvIV(ST(2)); - char * duration = (char *)SvPV_nolen(ST(3)); + char *key = (char *) SvPV_nolen(ST(0)); + char *str_value = (char *) SvPV_nolen(ST(1)); + int options = (int) SvIV(ST(2)); + char *duration = (char *) SvPV_nolen(ST(3)); quest_manager.setglobal(key, str_value, options, duration); @@ -1278,18 +1213,18 @@ XS(XS__setglobal) } XS(XS__targlobal); -XS(XS__targlobal) -{ +XS(XS__targlobal) { dXSARGS; if (items != 6) - Perl_croak(aTHX_ "Usage: quest::targlobal(stirng key, string value, string duration, int npc_id, int chararacter_id, int zone_id)"); + Perl_croak(aTHX_ + "Usage: quest::targlobal(stirng key, string value, string duration, int npc_id, int chararacter_id, int zone_id)"); - char * key = (char *)SvPV_nolen(ST(0)); - char * str_value = (char *)SvPV_nolen(ST(1)); - char * duration = (char *)SvPV_nolen(ST(2)); - int npc_id = (int)SvIV(ST(3)); - int char_id = (int)SvIV(ST(4)); - int zone_id = (int)SvIV(ST(5)); + char *key = (char *) SvPV_nolen(ST(0)); + char *str_value = (char *) SvPV_nolen(ST(1)); + char *duration = (char *) SvPV_nolen(ST(2)); + int npc_id = (int) SvIV(ST(3)); + int char_id = (int) SvIV(ST(4)); + int zone_id = (int) SvIV(ST(5)); quest_manager.targlobal(key, str_value, duration, npc_id, char_id, zone_id); @@ -1297,13 +1232,12 @@ XS(XS__targlobal) } XS(XS__delglobal); -XS(XS__delglobal) -{ +XS(XS__delglobal) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::delglobal(string key)"); - char * key = (char *)SvPV_nolen(ST(0)); + char *key = (char *) SvPV_nolen(ST(0)); quest_manager.delglobal(key); @@ -1311,8 +1245,7 @@ XS(XS__delglobal) } XS(XS__ding); -XS(XS__ding) -{ +XS(XS__ding) { dXSARGS; if (items != 0) Perl_croak(aTHX_ "Usage: quest::ding()"); @@ -1324,14 +1257,13 @@ XS(XS__ding) } XS(XS__rebind); -XS(XS__rebind) -{ +XS(XS__rebind) { dXSARGS; if (items != 4) Perl_croak(aTHX_ "Usage: quest::rebind(int zone_id, float x, float y, float z)"); - int zone_id = (int)SvIV(ST(0)); - auto location = glm::vec3((float)SvNV(ST(1)),(float)SvNV(ST(2)),(float)SvNV(ST(3))); + int zone_id = (int) SvIV(ST(0)); + auto location = glm::vec3((float) SvNV(ST(1)), (float) SvNV(ST(2)), (float) SvNV(ST(3))); quest_manager.rebind(zone_id, location); @@ -1339,13 +1271,12 @@ XS(XS__rebind) } XS(XS__start); -XS(XS__start) -{ +XS(XS__start) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::start(int waypoint)"); - int wp = (int)SvIV(ST(0)); + int wp = (int) SvIV(ST(0)); quest_manager.start(wp); @@ -1353,8 +1284,7 @@ XS(XS__start) } XS(XS__stop); -XS(XS__stop) -{ +XS(XS__stop) { dXSARGS; if (items != 0) Perl_croak(aTHX_ "Usage: quest::stop()"); @@ -1366,13 +1296,12 @@ XS(XS__stop) } XS(XS__pause); -XS(XS__pause) -{ +XS(XS__pause) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::pause(int duration-ms)"); - int duration = (int)SvIV(ST(0)); + int duration = (int) SvIV(ST(0)); quest_manager.pause(duration); @@ -1380,25 +1309,25 @@ XS(XS__pause) } XS(XS__moveto); -XS(XS__moveto) -{ +XS(XS__moveto) { dXSARGS; if (items != 3 && items != 4 && items != 5) - Perl_croak(aTHX_ "Usage: quest::moveto(float x, float y, float z, [float heading], [bool save_guard_location])"); + Perl_croak(aTHX_ + "Usage: quest::moveto(float x, float y, float z, [float heading], [bool save_guard_location])"); - float x = (float)SvNV(ST(0)); - float y = (float)SvNV(ST(1)); - float z = (float)SvNV(ST(2)); - float h; - bool saveguard; + float x = (float) SvNV(ST(0)); + float y = (float) SvNV(ST(1)); + float z = (float) SvNV(ST(2)); + float h; + bool saveguard; - if(items > 3) - h = (float)SvNV(ST(3)); + if (items > 3) + h = (float) SvNV(ST(3)); else h = 0; - if(items > 4) - saveguard = (bool)SvTRUE(ST(4)); + if (items > 4) + saveguard = (bool) SvTRUE(ST(4)); else saveguard = false; @@ -1408,8 +1337,7 @@ XS(XS__moveto) } XS(XS__resume); -XS(XS__resume) -{ +XS(XS__resume) { dXSARGS; if (items != 0) Perl_croak(aTHX_ "Usage: quest::resume()"); @@ -1421,14 +1349,13 @@ XS(XS__resume) } XS(XS__addldonpoints); -XS(XS__addldonpoints) -{ +XS(XS__addldonpoints) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::addldonpoints(int points, int theme_id)"); - long points = (long)SvIV(ST(0)); - unsigned long theme_id = (unsigned long)SvUV(ST(1)); + long points = (long) SvIV(ST(0)); + unsigned long theme_id = (unsigned long) SvUV(ST(1)); quest_manager.addldonpoints(points, theme_id); @@ -1436,14 +1363,13 @@ XS(XS__addldonpoints) } XS(XS__addldonwin); -XS(XS__addldonwin) -{ +XS(XS__addldonwin) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::addldonwin(int wins, int theme_id)"); - long wins = (long)SvIV(ST(0)); - unsigned long theme_id = (unsigned long)SvUV(ST(1)); + long wins = (long) SvIV(ST(0)); + unsigned long theme_id = (unsigned long) SvUV(ST(1)); quest_manager.addldonwin(wins, theme_id); @@ -1451,14 +1377,13 @@ XS(XS__addldonwin) } XS(XS__addldonloss); -XS(XS__addldonloss) -{ +XS(XS__addldonloss) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::addldonloss(int losses, int theme_id)"); - long losses = (long)SvIV(ST(0)); - unsigned long theme_id = (unsigned long)SvUV(ST(1)); + long losses = (long) SvIV(ST(0)); + unsigned long theme_id = (unsigned long) SvUV(ST(1)); quest_manager.addldonloss(losses, theme_id); @@ -1466,13 +1391,12 @@ XS(XS__addldonloss) } XS(XS__setnexthpevent); -XS(XS__setnexthpevent) -{ +XS(XS__setnexthpevent) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::setnexthpevent(int at_mob_percentage)"); - int at = (int)SvIV(ST(0)); + int at = (int) SvIV(ST(0)); quest_manager.setnexthpevent(at); @@ -1480,13 +1404,12 @@ XS(XS__setnexthpevent) } XS(XS__setnextinchpevent); -XS(XS__setnextinchpevent) -{ +XS(XS__setnextinchpevent) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::setnextinchpevent(int at_mob_percentage)"); - int at = (int)SvIV(ST(0)); + int at = (int) SvIV(ST(0)); quest_manager.setnextinchpevent(at); @@ -1494,13 +1417,12 @@ XS(XS__setnextinchpevent) } XS(XS__sethp); -XS(XS__sethp) -{ +XS(XS__sethp) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::sethp(int mob_health_percentage [0-100])"); - int hpperc = (int)SvIV(ST(0)); + int hpperc = (int) SvIV(ST(0)); quest_manager.sethp(hpperc); @@ -1508,14 +1430,13 @@ XS(XS__sethp) } XS(XS__respawn); -XS(XS__respawn) -{ +XS(XS__respawn) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::respawn(int npc_type_id, int grid_id)"); - int npc_type_id = (int)SvIV(ST(0)); - int grid_id = (int)SvIV(ST(1)); + int npc_type_id = (int) SvIV(ST(0)); + int grid_id = (int) SvIV(ST(1)); quest_manager.respawn(npc_type_id, grid_id); @@ -1523,41 +1444,40 @@ XS(XS__respawn) } XS(XS__ChooseRandom); -XS(XS__ChooseRandom) -{ +XS(XS__ChooseRandom) { dXSARGS; if (items < 1) Perl_croak(aTHX_ "Usage: quest::ChooseRandom(option1, option2, option3, option4, option5...[no limit])"); - int index = zone->random.Int(0, items-1); + int index = zone->random.Int(0, items - 1); SV *tmp = ST(0); - ST(0) = ST(index); + ST(0) = ST(index); ST(index) = tmp; - XSRETURN(1); //return 1 element from the stack (ST(0)) + XSRETURN(1); //return 1 element from the stack (ST(0)) } XS(XS__set_proximity); -XS(XS__set_proximity) -{ +XS(XS__set_proximity) { dXSARGS; if (items != 4 && items != 6 && items != 7) - Perl_croak(aTHX_ "Usage: quest::set_proximity(float min_x, float max_x, float min_y, float max_y, [float min_z], [float max_z], [say])"); + Perl_croak(aTHX_ + "Usage: quest::set_proximity(float min_x, float max_x, float min_y, float max_y, [float min_z], [float max_z], [say])"); - float min_x = (float)SvNV(ST(0)); - float max_x = (float)SvNV(ST(1)); - float min_y = (float)SvNV(ST(2)); - float max_y = (float)SvNV(ST(3)); + float min_x = (float) SvNV(ST(0)); + float max_x = (float) SvNV(ST(1)); + float min_y = (float) SvNV(ST(2)); + float max_y = (float) SvNV(ST(3)); - if(items == 4) + if (items == 4) quest_manager.set_proximity(min_x, max_x, min_y, max_y); else { - float min_z = (float)SvNV(ST(4)); - float max_z = (float)SvNV(ST(5)); - bool bSay = false; + float min_z = (float) SvNV(ST(4)); + float max_z = (float) SvNV(ST(5)); + bool bSay = false; if (items == 7) - bSay = (bool)SvTRUE(ST(6)); + bSay = (bool) SvTRUE(ST(6)); quest_manager.set_proximity(min_x, max_x, min_y, max_y, min_z, max_z, bSay); } @@ -1565,8 +1485,7 @@ XS(XS__set_proximity) } XS(XS__clear_proximity); -XS(XS__clear_proximity) -{ +XS(XS__clear_proximity) { dXSARGS; if (items != 0) Perl_croak(aTHX_ "Usage: quest::clear_proximity()"); @@ -1577,8 +1496,7 @@ XS(XS__clear_proximity) } XS(XS__enable_proximity_say); -XS(XS__enable_proximity_say) -{ +XS(XS__enable_proximity_say) { dXSARGS; if (items != 0) Perl_croak(aTHX_ "Usage: quest::enable_proximity_say()"); @@ -1589,8 +1507,7 @@ XS(XS__enable_proximity_say) } XS(XS__disable_proximity_say); -XS(XS__disable_proximity_say) -{ +XS(XS__disable_proximity_say) { dXSARGS; if (items != 0) Perl_croak(aTHX_ "Usage: quest::disable_proximity_say()"); @@ -1604,7 +1521,7 @@ XS(XS__setanim); XS(XS__setanim) //Cisyouc: mob->setappearance() addition { dXSARGS; - if(items != 2) + if (items != 2) Perl_croak(aTHX_ "Usage: quest::setanim(int npc_type_id, int appearance_number[0-4]);"); quest_manager.setanim(SvUV(ST(0)), SvUV(ST(1))); @@ -1613,10 +1530,9 @@ XS(XS__setanim) //Cisyouc: mob->setappearance() addition } XS(XS__showgrid); -XS(XS__showgrid) -{ +XS(XS__showgrid) { dXSARGS; - if(items != 1) + if (items != 1) Perl_croak(aTHX_ "Usage: quest::showgrid(int grid_id);"); quest_manager.showgrid(SvUV(ST(0))); @@ -1625,26 +1541,23 @@ XS(XS__showgrid) } XS(XS__spawn_condition); -XS(XS__spawn_condition) -{ +XS(XS__spawn_condition) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ "Usage: quest::spawn_condition(string zone_short, [int instance_id], uint16 condition_id, int16 value)"); + Perl_croak(aTHX_ + "Usage: quest::spawn_condition(string zone_short, [int instance_id], uint16 condition_id, int16 value)"); - if(items == 3) - { - char * zone_short = (char *)SvPV_nolen(ST(0)); - uint16 condition_id = (int)SvUV(ST(1)); - int16 int_value = (int)SvIV(ST(2)); + if (items == 3) { + char *zone_short = (char *) SvPV_nolen(ST(0)); + uint16 condition_id = (int) SvUV(ST(1)); + int16 int_value = (int) SvIV(ST(2)); quest_manager.spawn_condition(zone_short, zone->GetInstanceID(), condition_id, int_value); - } - else - { - char * zone_short = (char *)SvPV_nolen(ST(0)); - uint32 instance_id = (int)SvUV(ST(1)); - uint16 condition_id = (int)SvUV(ST(2)); - int16 int_value = (int)SvIV(ST(3)); + } else { + char *zone_short = (char *) SvPV_nolen(ST(0)); + uint32 instance_id = (int) SvUV(ST(1)); + uint16 condition_id = (int) SvUV(ST(2)); + int16 int_value = (int) SvIV(ST(3)); quest_manager.spawn_condition(zone_short, instance_id, condition_id, int_value); } @@ -1652,52 +1565,50 @@ XS(XS__spawn_condition) } XS(XS__get_spawn_condition); -XS(XS__get_spawn_condition) -{ +XS(XS__get_spawn_condition) { dXSARGS; if (items < 2 || items > 3) Perl_croak(aTHX_ "Usage: quest::get_spawn_condition(string zone_short, [int instance_id], int condition_id)"); - if(items == 2) - { - int16 RETVAL; + if (items == 2) { + int16 RETVAL; dXSTARG; - char * zone_short = (char *)SvPV_nolen(ST(0)); - uint16 cond_id = (int)SvIV(ST(1)); + char *zone_short = (char *) SvPV_nolen(ST(0)); + uint16 cond_id = (int) SvIV(ST(1)); RETVAL = quest_manager.get_spawn_condition(zone_short, zone->GetInstanceID(), cond_id); - XSprePUSH; PUSHu((IV)RETVAL); + XSprePUSH; + PUSHu((IV) RETVAL); XSRETURN(1); - } - else - { - int16 RETVAL; + } else { + int16 RETVAL; dXSTARG; - char * zone_short = (char *)SvPV_nolen(ST(0)); - uint16 instance_id = (int)SvIV(ST(1)); - uint16 cond_id = (int)SvIV(ST(2)); + char *zone_short = (char *) SvPV_nolen(ST(0)); + uint16 instance_id = (int) SvIV(ST(1)); + uint16 cond_id = (int) SvIV(ST(2)); RETVAL = quest_manager.get_spawn_condition(zone_short, instance_id, cond_id); - XSprePUSH; PUSHu((IV)RETVAL); + XSprePUSH; + PUSHu((IV) RETVAL); XSRETURN(1); } } XS(XS__toggle_spawn_event); -XS(XS__toggle_spawn_event) -{ +XS(XS__toggle_spawn_event) { dXSARGS; if (items != 4) - Perl_croak(aTHX_ "Usage: quest::toggle_spawn_event(uint32 event_id, [bool is_enabled = false], [bool is_strict = false], [bool reset_base = false])"); + Perl_croak(aTHX_ + "Usage: quest::toggle_spawn_event(uint32 event_id, [bool is_enabled = false], [bool is_strict = false], [bool reset_base = false])"); - uint32 event_id = (int)SvIV(ST(0)); - bool is_enabled = ((int)SvIV(ST(1))) == 0?false:true; - bool is_strict = ((int)SvIV(ST(2))) == 0?false:true; - bool reset_base = ((int)SvIV(ST(3))) == 0?false:true; + uint32 event_id = (int) SvIV(ST(0)); + bool is_enabled = ((int) SvIV(ST(1))) == 0 ? false : true; + bool is_strict = ((int) SvIV(ST(2))) == 0 ? false : true; + bool reset_base = ((int) SvIV(ST(3))) == 0 ? false : true; quest_manager.toggle_spawn_event(event_id, is_enabled, is_strict, reset_base); @@ -1705,32 +1616,31 @@ XS(XS__toggle_spawn_event) } XS(XS__has_zone_flag); -XS(XS__has_zone_flag) -{ +XS(XS__has_zone_flag) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::has_zone_flag(uint32 zone_id)"); - int16 RETVAL; + int16 RETVAL; dXSTARG; - uint32 zone_id = (int)SvIV(ST(0)); + uint32 zone_id = (int) SvIV(ST(0)); RETVAL = quest_manager.has_zone_flag(zone_id); - XSprePUSH; PUSHu((IV)RETVAL); + XSprePUSH; + PUSHu((IV) RETVAL); XSRETURN(1); } XS(XS__set_zone_flag); -XS(XS__set_zone_flag) -{ +XS(XS__set_zone_flag) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::set_zone_flag(uint32 zone_id)"); - uint32 zone_id = (int)SvIV(ST(0)); + uint32 zone_id = (int) SvIV(ST(0)); quest_manager.set_zone_flag(zone_id); @@ -1738,13 +1648,12 @@ XS(XS__set_zone_flag) } XS(XS__clear_zone_flag); -XS(XS__clear_zone_flag) -{ +XS(XS__clear_zone_flag) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::clear_zone_flag(uint32 zone_id)"); - uint32 zone_id = (int)SvIV(ST(0)); + uint32 zone_id = (int) SvIV(ST(0)); quest_manager.clear_zone_flag(zone_id); @@ -1752,137 +1661,128 @@ XS(XS__clear_zone_flag) } XS(XS__summonburiedplayercorpse); -XS(XS__summonburiedplayercorpse) -{ +XS(XS__summonburiedplayercorpse) { dXSARGS; if (items != 5) - Perl_croak(aTHX_ "Usage: quest::summonburiedplayercorpse(uint32 char_id, float dest_x, float dest_y, float dest_z, float dest_heading)"); + Perl_croak(aTHX_ + "Usage: quest::summonburiedplayercorpse(uint32 char_id, float dest_x, float dest_y, float dest_z, float dest_heading)"); - bool RETVAL; - uint32 char_id = (int)SvIV(ST(0)); - auto position = glm::vec4((float)SvIV(ST(1)), (float)SvIV(ST(2)), (float)SvIV(ST(3)),(float)SvIV(ST(4))); + bool RETVAL; + uint32 char_id = (int) SvIV(ST(0)); + auto position = glm::vec4((float) SvIV(ST(1)), (float) SvIV(ST(2)), (float) SvIV(ST(3)), (float) SvIV(ST(4))); RETVAL = quest_manager.summonburiedplayercorpse(char_id, position); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); XSRETURN(1); } XS(XS__summonallplayercorpses); -XS(XS__summonallplayercorpses) -{ +XS(XS__summonallplayercorpses) { dXSARGS; if (items != 5) - Perl_croak(aTHX_ "Usage: quest::summonallplayercorpses(int char_id, float dest_x, float dest_y, float dest_z, float dest_heading)"); + Perl_croak(aTHX_ + "Usage: quest::summonallplayercorpses(int char_id, float dest_x, float dest_y, float dest_z, float dest_heading)"); - bool RETVAL; - uint32 char_id = (int)SvIV(ST(0)); - auto position = glm::vec4((float)SvIV(ST(1)),(float)SvIV(ST(2)),(float)SvIV(ST(3)),(float)SvIV(ST(4))); + bool RETVAL; + uint32 char_id = (int) SvIV(ST(0)); + auto position = glm::vec4((float) SvIV(ST(1)), (float) SvIV(ST(2)), (float) SvIV(ST(3)), (float) SvIV(ST(4))); RETVAL = quest_manager.summonallplayercorpses(char_id, position); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); XSRETURN(1); } XS(XS__getplayerburiedcorpsecount); -XS(XS__getplayerburiedcorpsecount) -{ +XS(XS__getplayerburiedcorpsecount) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::getplayerburiedcorpsecount(int character_id)"); - uint32 RETVAL; + uint32 RETVAL; dXSTARG; - uint32 char_id = (int)SvIV(ST(0)); + uint32 char_id = (int) SvIV(ST(0)); RETVAL = quest_manager.getplayerburiedcorpsecount(char_id); - XSprePUSH; PUSHu((IV)RETVAL); + XSprePUSH; + PUSHu((IV) RETVAL); XSRETURN(1); } XS(XS__buryplayercorpse); -XS(XS__buryplayercorpse) -{ +XS(XS__buryplayercorpse) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::buryplayercorpse(int character_id)"); - uint32 RETVAL; + uint32 RETVAL; dXSTARG; - uint32 char_id = (int)SvIV(ST(0)); + uint32 char_id = (int) SvIV(ST(0)); RETVAL = quest_manager.buryplayercorpse(char_id); - XSprePUSH; PUSHu((IV)RETVAL); + XSprePUSH; + PUSHu((IV) RETVAL); XSRETURN(1); } XS(XS__forcedooropen); -XS(XS__forcedooropen) -{ +XS(XS__forcedooropen) { dXSARGS; if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: quest::forcedooropen(int door_id, [int alt_mode=0])"); - if (items == 1) - { - uint32 door_id = (int)SvIV(ST(0)); + if (items == 1) { + uint32 door_id = (int) SvIV(ST(0)); - quest_manager.forcedooropen(door_id, false); + quest_manager.forcedooropen(door_id, false); - XSRETURN_EMPTY; - } - else - { - uint32 door_id = (int)SvIV(ST(0)); - bool alt_mode = (int)SvIV(ST(1)) == 0?false:true; + XSRETURN_EMPTY; + } else { + uint32 door_id = (int) SvIV(ST(0)); + bool alt_mode = (int) SvIV(ST(1)) == 0 ? false : true; - quest_manager.forcedooropen(door_id, alt_mode); + quest_manager.forcedooropen(door_id, alt_mode); - XSRETURN_EMPTY; + XSRETURN_EMPTY; } } XS(XS__forcedoorclose); -XS(XS__forcedoorclose) -{ +XS(XS__forcedoorclose) { dXSARGS; if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: quest::forcedoorclose(int door_id, [bool alt_mode = 0])"); - if (items == 1) - { - uint32 door_id = (int)SvIV(ST(0)); + if (items == 1) { + uint32 door_id = (int) SvIV(ST(0)); - quest_manager.forcedoorclose(door_id, false); + quest_manager.forcedoorclose(door_id, false); - XSRETURN_EMPTY; - } - else - { - uint32 door_id = (int)SvIV(ST(0)); - bool alt_mode = (int)SvIV(ST(1)) == 0?false:true; + XSRETURN_EMPTY; + } else { + uint32 door_id = (int) SvIV(ST(0)); + bool alt_mode = (int) SvIV(ST(1)) == 0 ? false : true; - quest_manager.forcedoorclose(door_id, alt_mode); + quest_manager.forcedoorclose(door_id, alt_mode); - XSRETURN_EMPTY; + XSRETURN_EMPTY; } } XS(XS__toggledoorstate); -XS(XS__toggledoorstate) -{ +XS(XS__toggledoorstate) { dXSARGS; - if (items !=1) - Perl_croak(aTHX_ "Usage: quest::toggledoorstate(int door_id)"); + if (items != 1) + Perl_croak(aTHX_ "Usage: quest::toggledoorstate(int door_id)"); - uint32 door_id = (int)SvIV(ST(0)); + uint32 door_id = (int) SvIV(ST(0)); quest_manager.toggledoorstate(door_id); @@ -1890,31 +1790,30 @@ XS(XS__toggledoorstate) } XS(XS__isdooropen); -XS(XS__isdooropen) -{ +XS(XS__isdooropen) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::isdooropen(int door_id)"); - bool RETVAL; + bool RETVAL; dXSTARG; - uint32 door_id = (int)SvIV(ST(0)); + uint32 door_id = (int) SvIV(ST(0)); RETVAL = quest_manager.isdooropen(door_id); - XSprePUSH; PUSHu((IV)RETVAL); + XSprePUSH; + PUSHu((IV) RETVAL); XSRETURN(1); } XS(XS__depopzone); -XS(XS__depopzone) -{ +XS(XS__depopzone) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::depopzone([bool start_spawn_status = false])"); - bool StartSpawnStatus = ((int)SvIV(ST(0))) == 0?false:true; + bool StartSpawnStatus = ((int) SvIV(ST(0))) == 0 ? false : true; quest_manager.depopzone(StartSpawnStatus); @@ -1922,8 +1821,7 @@ XS(XS__depopzone) } XS(XS__repopzone); -XS(XS__repopzone) -{ +XS(XS__repopzone) { dXSARGS; if (items != 0) Perl_croak(aTHX_ "Usage: quest::repopzone()"); @@ -1934,13 +1832,12 @@ XS(XS__repopzone) } XS(XS__npcrace); -XS(XS__npcrace) -{ +XS(XS__npcrace) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::npcrace(int race_id)"); - int race_id = (int)SvIV(ST(0)); + int race_id = (int) SvIV(ST(0)); quest_manager.npcrace(race_id); @@ -1948,13 +1845,12 @@ XS(XS__npcrace) } XS(XS__npcgender); -XS(XS__npcgender) -{ +XS(XS__npcgender) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::npcgender(int gender_id)"); - int gender_id= (int)SvIV(ST(0)); + int gender_id = (int) SvIV(ST(0)); quest_manager.npcgender(gender_id); @@ -1962,13 +1858,12 @@ XS(XS__npcgender) } XS(XS__npcsize); -XS(XS__npcsize) -{ +XS(XS__npcsize) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::npcsize(int size)"); - int size = (int)SvIV(ST(0)); + int size = (int) SvIV(ST(0)); quest_manager.npcsize(size); @@ -1976,13 +1871,12 @@ XS(XS__npcsize) } XS(XS__npctexture); -XS(XS__npctexture) -{ +XS(XS__npctexture) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::npctexture(int texture_id)"); - int texture_id = (int)SvIV(ST(0)); + int texture_id = (int) SvIV(ST(0)); quest_manager.npctexture(texture_id); @@ -1990,13 +1884,12 @@ XS(XS__npctexture) } XS(XS__playerrace); -XS(XS__playerrace) -{ +XS(XS__playerrace) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::playerrace(int race_id)"); - int race_id = (int)SvIV(ST(0)); + int race_id = (int) SvIV(ST(0)); quest_manager.playerrace(race_id); @@ -2004,13 +1897,12 @@ XS(XS__playerrace) } XS(XS__playergender); -XS(XS__playergender) -{ +XS(XS__playergender) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::playergender(int gender_id)"); - int gender_id= (int)SvIV(ST(0)); + int gender_id = (int) SvIV(ST(0)); quest_manager.playergender(gender_id); @@ -2018,13 +1910,12 @@ XS(XS__playergender) } XS(XS__playersize); -XS(XS__playersize) -{ +XS(XS__playersize) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::playersize(int newsize)"); - int newsize = (int)SvIV(ST(0)); + int newsize = (int) SvIV(ST(0)); quest_manager.playersize(newsize); @@ -2032,13 +1923,12 @@ XS(XS__playersize) } XS(XS__playertexture); -XS(XS__playertexture) -{ +XS(XS__playertexture) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::playertexture(int texture_id)"); - int texture_id = (int)SvIV(ST(0)); + int texture_id = (int) SvIV(ST(0)); quest_manager.playertexture(texture_id); @@ -2046,14 +1936,14 @@ XS(XS__playertexture) } XS(XS__playerfeature); -XS(XS__playerfeature) -{ +XS(XS__playerfeature) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: quest::playerfeature(string feature [race|gender|texture|helm|haircolor|beardcolor|eyecolor1|eyecolor2|hair|face|beard|heritage|tatoo|details|size], int setting)"); + Perl_croak(aTHX_ + "Usage: quest::playerfeature(string feature [race|gender|texture|helm|haircolor|beardcolor|eyecolor1|eyecolor2|hair|face|beard|heritage|tatoo|details|size], int setting)"); - char * str_value = (char *)SvPV_nolen(ST(0)); - int int_value = (int)SvIV(ST(1)); + char *str_value = (char *) SvPV_nolen(ST(0)); + int int_value = (int) SvIV(ST(1)); quest_manager.playerfeature(str_value, int_value); @@ -2061,14 +1951,14 @@ XS(XS__playerfeature) } XS(XS__npcfeature); -XS(XS__npcfeature) -{ +XS(XS__npcfeature) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: quest::npcfeature(string feature [race|gender|texture|helm|haircolor|beardcolor|eyecolor1|eyecolor2|hair|face|beard|heritage|tatoo|details|size], int value)"); + Perl_croak(aTHX_ + "Usage: quest::npcfeature(string feature [race|gender|texture|helm|haircolor|beardcolor|eyecolor1|eyecolor2|hair|face|beard|heritage|tatoo|details|size], int value)"); - char * str_value = (char *)SvPV_nolen(ST(0)); - int int_value = (int)SvIV(ST(1)); + char *str_value = (char *) SvPV_nolen(ST(0)); + int int_value = (int) SvIV(ST(1)); quest_manager.npcfeature(str_value, int_value); @@ -2143,13 +2033,12 @@ XS(XS__createBot) #endif //BOTS XS(XS__taskselector); -XS(XS__taskselector) -{ +XS(XS__taskselector) { dXSARGS; - if((items >= 1) && (items <=MAXCHOOSERENTRIES)) { - int tasks[MAXCHOOSERENTRIES]; - for(int i=0; i< items; i++) { - tasks[i] = (int)SvIV(ST(i)); + if ((items >= 1) && (items <= MAXCHOOSERENTRIES)) { + int tasks[MAXCHOOSERENTRIES]; + for (int i = 0; i < items; i++) { + tasks[i] = (int) SvIV(ST(i)); } quest_manager.taskselector(items, tasks); } else { @@ -2159,11 +2048,10 @@ XS(XS__taskselector) XSRETURN_EMPTY; } XS(XS__task_setselector); -XS(XS__task_setselector) -{ +XS(XS__task_setselector) { dXSARGS; - if(items == 1) { - int task_setid = (int)SvIV(ST(0)); + if (items == 1) { + int task_setid = (int) SvIV(ST(0)); quest_manager.tasksetselector(task_setid); } else { Perl_croak(aTHX_ "Usage: quest::task_setselector(int task_set_id)"); @@ -2172,13 +2060,12 @@ XS(XS__task_setselector) XSRETURN_EMPTY; } XS(XS__enabletask); -XS(XS__enabletask) -{ +XS(XS__enabletask) { dXSARGS; - if((items >= 1) && (items <=10)) { - int tasks[10]; - for(int i=0; i< items; i++) { - tasks[i] = (int)SvIV(ST(i)); + if ((items >= 1) && (items <= 10)) { + int tasks[10]; + for (int i = 0; i < items; i++) { + tasks[i] = (int) SvIV(ST(i)); } quest_manager.enabletask(items, tasks); } else { @@ -2188,13 +2075,12 @@ XS(XS__enabletask) XSRETURN_EMPTY; } XS(XS__disabletask); -XS(XS__disabletask) -{ +XS(XS__disabletask) { dXSARGS; - if((items >= 1) && (items <=10)) { - int tasks[10]; - for(int i=0; i< items; i++) { - tasks[i] = (int)SvIV(ST(i)); + if ((items >= 1) && (items <= 10)) { + int tasks[10]; + for (int i = 0; i < items; i++) { + tasks[i] = (int) SvIV(ST(i)); } quest_manager.disabletask(items, tasks); } else { @@ -2205,72 +2091,72 @@ XS(XS__disabletask) } XS(XS__istaskenabled); -XS(XS__istaskenabled) -{ +XS(XS__istaskenabled) { dXSARGS; - bool RETVAL; + bool RETVAL; dXSTARG; - if(items == 1) { - unsigned int task_id = (int)SvIV(ST(0)); + if (items == 1) { + unsigned int task_id = (int) SvIV(ST(0)); RETVAL = quest_manager.istaskenabled(task_id); } else { Perl_croak(aTHX_ "Usage: quest::istaskenabled(int task_id)"); } - XSprePUSH; PUSHu((IV)RETVAL); + XSprePUSH; + PUSHu((IV) RETVAL); XSRETURN(1); } XS(XS__istaskactive); -XS(XS__istaskactive) -{ +XS(XS__istaskactive) { dXSARGS; - bool RETVAL; + bool RETVAL; dXSTARG; - if(items == 1) { - unsigned int task_id = (int)SvIV(ST(0)); + if (items == 1) { + unsigned int task_id = (int) SvIV(ST(0)); RETVAL = quest_manager.istaskactive(task_id); } else { Perl_croak(aTHX_ "Usage: quest::istaskactive(int task_id)"); } - XSprePUSH; PUSHu((IV)RETVAL); + XSprePUSH; + PUSHu((IV) RETVAL); XSRETURN(1); } XS(XS__istaskactivityactive); -XS(XS__istaskactivityactive) -{ +XS(XS__istaskactivityactive) { dXSARGS; - bool RETVAL; + bool RETVAL; dXSTARG; - if(items == 2) { - unsigned int task_id = (int)SvIV(ST(0)); - unsigned int activity_id = (int)SvIV(ST(1)); + if (items == 2) { + unsigned int task_id = (int) SvIV(ST(0)); + unsigned int activity_id = (int) SvIV(ST(1)); RETVAL = quest_manager.istaskactivityactive(task_id, activity_id); } else { Perl_croak(aTHX_ "Usage: quest::istaskactivityactive(int task_id, int activity_id)"); } - XSprePUSH; PUSHu((IV)RETVAL); + XSprePUSH; + PUSHu((IV) RETVAL); XSRETURN(1); } XS(XS__gettaskactivitydonecount); -XS(XS__gettaskactivitydonecount) -{ +XS(XS__gettaskactivitydonecount) { dXSARGS; - uint32 RETVAL; + uint32 RETVAL; dXSTARG; - if(items == 2) { - unsigned int task_id = (int)SvIV(ST(0)); - unsigned int activity_id = (int)SvIV(ST(1)); + if (items == 2) { + unsigned int task_id = (int) SvIV(ST(0)); + unsigned int activity_id = (int) SvIV(ST(1)); RETVAL = quest_manager.gettaskactivitydonecount(task_id, activity_id); - XSprePUSH; PUSHu((UV)RETVAL); + XSprePUSH; + PUSHu((UV) RETVAL); } else { Perl_croak(aTHX_ "Usage: quest::gettaskactivitydonecount(int task_id, int activity_id)"); } @@ -2278,40 +2164,38 @@ XS(XS__gettaskactivitydonecount) XSRETURN(1); } XS(XS__updatetaskactivity); -XS(XS__updatetaskactivity) -{ +XS(XS__updatetaskactivity) { dXSARGS; unsigned int task_id, activity_id; - int count = 1; - bool ignore_quest_update = false; - if(items == 2) { - task_id = (int)SvIV(ST(0)); - activity_id = (int)SvIV(ST(1)); + int count = 1; + bool ignore_quest_update = false; + if (items == 2) { + task_id = (int) SvIV(ST(0)); + activity_id = (int) SvIV(ST(1)); quest_manager.updatetaskactivity(task_id, activity_id, count, false); - } - else if (items == 3 || items == 4) { - task_id = (int)SvIV(ST(0)); - activity_id = (int)SvIV(ST(1)); - count = (int)SvIV(ST(2)); - if (items == 4){ - bool ignore_quest_update = (bool)SvTRUE(ST(3)); + } else if (items == 3 || items == 4) { + task_id = (int) SvIV(ST(0)); + activity_id = (int) SvIV(ST(1)); + count = (int) SvIV(ST(2)); + if (items == 4) { + bool ignore_quest_update = (bool) SvTRUE(ST(3)); } quest_manager.updatetaskactivity(task_id, activity_id, count, ignore_quest_update); } else { - Perl_croak(aTHX_ "Usage: quest::updatetaskactivity(int task_id, int activity_id, [int count], [bool ignore_quest_update = false])"); + Perl_croak(aTHX_ + "Usage: quest::updatetaskactivity(int task_id, int activity_id, [int count], [bool ignore_quest_update = false])"); } XSRETURN_EMPTY; } XS(XS__resettaskactivity); -XS(XS__resettaskactivity) -{ +XS(XS__resettaskactivity) { dXSARGS; unsigned int task, activity; - if(items == 2) { - int task_id = (int)SvIV(ST(0)); - int activity_id = (int)SvIV(ST(1)); + if (items == 2) { + int task_id = (int) SvIV(ST(0)); + int activity_id = (int) SvIV(ST(1)); quest_manager.resettaskactivity(task_id, activity_id); @@ -2323,12 +2207,11 @@ XS(XS__resettaskactivity) } XS(XS__taskexploredarea); -XS(XS__taskexploredarea) -{ +XS(XS__taskexploredarea) { dXSARGS; unsigned int explore_id; - if(items == 1) { - explore_id = (int)SvIV(ST(0)); + if (items == 1) { + explore_id = (int) SvIV(ST(0)); quest_manager.taskexploredarea(explore_id); } else { Perl_croak(aTHX_ "Usage: quest::taskexplorearea(int explore_id)"); @@ -2338,17 +2221,14 @@ XS(XS__taskexploredarea) } XS(XS__assigntask); -XS(XS__assigntask) -{ +XS(XS__assigntask) { dXSARGS; unsigned int task_id; - bool enforce_level_requirement = false; - if(items == 1 || items == 2) { - task_id = (int)SvIV(ST(0)); - if (items == 2) - { - if ((int)SvIV(ST(1)) == 1) - { + bool enforce_level_requirement = false; + if (items == 1 || items == 2) { + task_id = (int) SvIV(ST(0)); + if (items == 2) { + if ((int) SvIV(ST(1)) == 1) { enforce_level_requirement = true; } } @@ -2361,12 +2241,11 @@ XS(XS__assigntask) } XS(XS__failtask); -XS(XS__failtask) -{ +XS(XS__failtask) { dXSARGS; unsigned int task_id; - if(items == 1) { - task_id = (int)SvIV(ST(0)); + if (items == 1) { + task_id = (int) SvIV(ST(0)); quest_manager.failtask(task_id); } else { Perl_croak(aTHX_ "Usage: quest::failtask(int task_id)"); @@ -2376,241 +2255,241 @@ XS(XS__failtask) } XS(XS__tasktimeleft); -XS(XS__tasktimeleft) -{ +XS(XS__tasktimeleft) { dXSARGS; - int RETVAL; + int RETVAL; dXSTARG; - if(items == 1) { - unsigned int task_id = (int)SvIV(ST(0)); + if (items == 1) { + unsigned int task_id = (int) SvIV(ST(0)); RETVAL = quest_manager.tasktimeleft(task_id); } else { Perl_croak(aTHX_ "Usage: quest::tasktimeleft(int task_id)"); } - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); XSRETURN(1); } XS(XS__istaskcompleted); -XS(XS__istaskcompleted) -{ +XS(XS__istaskcompleted) { dXSARGS; - int RETVAL; + int RETVAL; dXSTARG; - if(items == 1) { - unsigned int task_id = (int)SvIV(ST(0)); + if (items == 1) { + unsigned int task_id = (int) SvIV(ST(0)); RETVAL = quest_manager.istaskcompleted(task_id); } else { Perl_croak(aTHX_ "Usage: quest::istaskcompleted(int task_id)"); } - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); XSRETURN(1); } XS(XS__enabledtaskcount); -XS(XS__enabledtaskcount) -{ +XS(XS__enabledtaskcount) { dXSARGS; - int RETVAL; + int RETVAL; dXSTARG; - if(items == 1) { - unsigned int task_set = (int)SvIV(ST(0)); + if (items == 1) { + unsigned int task_set = (int) SvIV(ST(0)); RETVAL = quest_manager.enabledtaskcount(task_set); } else { Perl_croak(aTHX_ "Usage: quest::enabledtaskcount(int task_set)"); } - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); XSRETURN(1); } XS(XS__firsttaskinset); -XS(XS__firsttaskinset) -{ +XS(XS__firsttaskinset) { dXSARGS; - int RETVAL; + int RETVAL; dXSTARG; - if(items == 1) { - unsigned int task_set = (int)SvIV(ST(0)); + if (items == 1) { + unsigned int task_set = (int) SvIV(ST(0)); RETVAL = quest_manager.firsttaskinset(task_set); } else { Perl_croak(aTHX_ "Usage: quest::firsttaskinset(int task_set)"); } - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); XSRETURN(1); } XS(XS__lasttaskinset); -XS(XS__lasttaskinset) -{ +XS(XS__lasttaskinset) { dXSARGS; - int RETVAL; + int RETVAL; dXSTARG; - if(items == 1) { - unsigned int task_set = (int)SvIV(ST(0)); + if (items == 1) { + unsigned int task_set = (int) SvIV(ST(0)); RETVAL = quest_manager.lasttaskinset(task_set); } else { Perl_croak(aTHX_ "Usage: quest::lasttaskinset(int task_set)"); } - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); XSRETURN(1); } XS(XS__nexttaskinset); -XS(XS__nexttaskinset) -{ +XS(XS__nexttaskinset) { dXSARGS; - int RETVAL; + int RETVAL; dXSTARG; - if(items == 2) { - unsigned int task_set = (int)SvIV(ST(0)); - unsigned int task_id = (int)SvIV(ST(1)); + if (items == 2) { + unsigned int task_set = (int) SvIV(ST(0)); + unsigned int task_id = (int) SvIV(ST(1)); RETVAL = quest_manager.nexttaskinset(task_set, task_id); } else { Perl_croak(aTHX_ "Usage: quest::nexttaskinset(int task_set, int task_id)"); } - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); XSRETURN(1); } XS(XS__activespeaktask); -XS(XS__activespeaktask) -{ +XS(XS__activespeaktask) { dXSARGS; - int RETVAL; + int RETVAL; dXSTARG; - if(items == 0) { + if (items == 0) { RETVAL = quest_manager.activespeaktask(); } else { Perl_croak(aTHX_ "Usage: quest::activespeaktask()"); } - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); XSRETURN(1); } XS(XS__activespeakactivity); -XS(XS__activespeakactivity) -{ +XS(XS__activespeakactivity) { dXSARGS; - int RETVAL; + int RETVAL; dXSTARG; - if(items == 1) { - unsigned int task_id = (int)SvIV(ST(0)); + if (items == 1) { + unsigned int task_id = (int) SvIV(ST(0)); RETVAL = quest_manager.activespeakactivity(task_id); } else { Perl_croak(aTHX_ "Usage: quest::activespeakactivity(int task_id)"); } - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); XSRETURN(1); } XS(XS__activetasksinset); -XS(XS__activetasksinset) -{ +XS(XS__activetasksinset) { dXSARGS; - int RETVAL; + int RETVAL; dXSTARG; - if(items == 1) { - unsigned int task_set = (int)SvIV(ST(0)); + if (items == 1) { + unsigned int task_set = (int) SvIV(ST(0)); RETVAL = quest_manager.activetasksinset(task_set); } else { Perl_croak(aTHX_ "Usage: quest::activetasksinset(int task_set)"); } - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); XSRETURN(1); } XS(XS__completedtasksinset); -XS(XS__completedtasksinset) -{ +XS(XS__completedtasksinset) { dXSARGS; - int RETVAL; + int RETVAL; dXSTARG; - if(items == 1) { - unsigned int task_set = (int)SvIV(ST(0)); + if (items == 1) { + unsigned int task_set = (int) SvIV(ST(0)); RETVAL = quest_manager.completedtasksinset(task_set); } else { Perl_croak(aTHX_ "Usage: quest::completedtasksinset(int task_set)"); } - XSprePUSH; PUSHi((IV)RETVAL); + XSprePUSH; + PUSHi((IV) RETVAL); XSRETURN(1); } XS(XS__istaskappropriate); -XS(XS__istaskappropriate) -{ +XS(XS__istaskappropriate) { dXSARGS; - bool RETVAL; + bool RETVAL; dXSTARG; - if(items == 1) { - unsigned int task = (int)SvIV(ST(0)); + if (items == 1) { + unsigned int task = (int) SvIV(ST(0)); RETVAL = quest_manager.istaskappropriate(task); } else { Perl_croak(aTHX_ "Usage: quest::istaskaappropriate(int task_id)"); } - XSprePUSH; PUSHu((IV)RETVAL); + XSprePUSH; + PUSHu((IV) RETVAL); XSRETURN(1); } - XS(XS__popup); // prototype to pass -Wmissing-prototypes - XS(XS__popup) { - dXSARGS; +XS(XS__popup); // prototype to pass -Wmissing-prototypes +XS(XS__popup) { + dXSARGS; int popup_id = 0; - int buttons = 0; + int buttons = 0; int duration = 0; - if((items < 2) || (items > 5)) - Perl_croak(aTHX_ "Usage: quest::popup(string window_title, string message, int popup_id, int buttons, int duration)"); + if ((items < 2) || (items > 5)) + Perl_croak(aTHX_ + "Usage: quest::popup(string window_title, string message, int popup_id, int buttons, int duration)"); - if(items >= 3) - popup_id = (int)SvIV(ST(2)); + if (items >= 3) + popup_id = (int) SvIV(ST(2)); - if(items >= 4) - buttons = (int)SvIV(ST(3)); + if (items >= 4) + buttons = (int) SvIV(ST(3)); - if(items == 5) - duration = (int)SvIV(ST(4)); + if (items == 5) + duration = (int) SvIV(ST(4)); - quest_manager.popup(SvPV_nolen(ST(0)), SvPV_nolen(ST(1)), popup_id, buttons, duration); + quest_manager.popup(SvPV_nolen(ST(0)), SvPV_nolen(ST(1)), popup_id, buttons, duration); - XSRETURN_EMPTY; + XSRETURN_EMPTY; } XS(XS__clearspawntimers); -XS(XS__clearspawntimers) -{ +XS(XS__clearspawntimers) { dXSARGS; if (items != 0) Perl_croak(aTHX_ "Usage: quest::clearspawntimers()"); @@ -2621,14 +2500,13 @@ XS(XS__clearspawntimers) } XS(XS__ze); -XS(XS__ze) -{ +XS(XS__ze) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::ze(int emote_color_id, string message)"); - int channel_id = (int)SvIV(ST(0)); - char * message = (char *)SvPV_nolen(ST(1)); + int channel_id = (int) SvIV(ST(0)); + char *message = (char *) SvPV_nolen(ST(1)); quest_manager.ze(channel_id, message); @@ -2636,14 +2514,13 @@ XS(XS__ze) } XS(XS__we); -XS(XS__we) -{ +XS(XS__we) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::we(int emote_color_id, string message)"); - int channel_id = (int)SvIV(ST(0)); - char * message = (char *)SvPV_nolen(ST(1)); + int channel_id = (int) SvIV(ST(0)); + char *message = (char *) SvPV_nolen(ST(1)); quest_manager.we(channel_id, message); @@ -2651,45 +2528,45 @@ XS(XS__we) } XS(XS__getlevel); -XS(XS__getlevel) -{ +XS(XS__getlevel) { dXSARGS; if (items > 1) Perl_croak(aTHX_ "Usage: quest::getlevel(int type)"); - int RETVAL; + int RETVAL; dXSTARG; - int type; + int type; if (items == 1) - type = (int)SvIV(ST(0)); + type = (int) SvIV(ST(0)); else type = 0; RETVAL = quest_manager.getlevel(type); - XSprePUSH; PUSHu((IV)RETVAL); + XSprePUSH; + PUSHu((IV) RETVAL); XSRETURN(1); } XS(XS__CreateGroundObject); -XS(XS__CreateGroundObject) -{ +XS(XS__CreateGroundObject) { dXSARGS; if (items != 5 && items != 6) - Perl_croak(aTHX_ "Usage: quest::creategroundobject(int item_id, float x, float y, float z, float heading, [uint32 decay_time-ms = 300000])"); + Perl_croak(aTHX_ + "Usage: quest::creategroundobject(int item_id, float x, float y, float z, float heading, [uint32 decay_time-ms = 300000])"); - int item_id = (int)SvIV(ST(0)); - float x = (float)SvNV(ST(1)); - float y = (float)SvNV(ST(2)); - float z = (float)SvNV(ST(3)); - float heading = (float)SvNV(ST(4)); - uint16 id = 0; + int item_id = (int) SvIV(ST(0)); + float x = (float) SvNV(ST(1)); + float y = (float) SvNV(ST(2)); + float z = (float) SvNV(ST(3)); + float heading = (float) SvNV(ST(4)); + uint16 id = 0; - if(items == 5) + if (items == 5) id = quest_manager.CreateGroundObject(item_id, glm::vec4(x, y, z, heading)); - else{ - uint32 decay_time = (uint32)SvIV(ST(5)); + else { + uint32 decay_time = (uint32) SvIV(ST(5)); id = quest_manager.CreateGroundObject(item_id, glm::vec4(x, y, z, heading), decay_time); } @@ -2697,60 +2574,59 @@ XS(XS__CreateGroundObject) } XS(XS__CreateGroundObjectFromModel); -XS(XS__CreateGroundObjectFromModel) -{ +XS(XS__CreateGroundObjectFromModel) { dXSARGS; if (items < 5 || items > 7) - Perl_croak(aTHX_ "Usage: quest::creategroundobjectfrommodel(string model_name, float x, float y, float z, float heading, [int object_type], [uint32 decay_time-ms = 300000])"); + Perl_croak(aTHX_ + "Usage: quest::creategroundobjectfrommodel(string model_name, float x, float y, float z, float heading, [int object_type], [uint32 decay_time-ms = 300000])"); - char * modelname = (char *)SvPV_nolen(ST(0)); - float x = (float)SvNV(ST(1)); - float y = (float)SvNV(ST(2)); - float z = (float)SvNV(ST(3)); - float heading = (float)SvNV(ST(4)); + char *modelname = (char *) SvPV_nolen(ST(0)); + float x = (float) SvNV(ST(1)); + float y = (float) SvNV(ST(2)); + float z = (float) SvNV(ST(3)); + float heading = (float) SvNV(ST(4)); uint32 object_type = 0; - uint32 decay_time = 0; - uint16 id = 0; + uint32 decay_time = 0; + uint16 id = 0; if (items > 5) - object_type = (uint32)SvIV(ST(5)); + object_type = (uint32) SvIV(ST(5)); if (items > 6) - decay_time = (uint32)SvIV(ST(6)); + decay_time = (uint32) SvIV(ST(6)); id = quest_manager.CreateGroundObjectFromModel(modelname, glm::vec4(x, y, z, heading), object_type, decay_time); XSRETURN_IV(id); } XS(XS__CreateDoor); -XS(XS__CreateDoor) -{ +XS(XS__CreateDoor) { dXSARGS; if (items < 5 || items > 7) - Perl_croak(aTHX_ "Usage: quest::createdoor(string model_name, float x, float y, float z, float heading, [int object_type = 58], [int size = 100])"); + Perl_croak(aTHX_ + "Usage: quest::createdoor(string model_name, float x, float y, float z, float heading, [int object_type = 58], [int size = 100])"); - char * modelname = (char *)SvPV_nolen(ST(0)); - float x = (float)SvNV(ST(1)); - float y = (float)SvNV(ST(2)); - float z = (float)SvNV(ST(3)); - float heading = (float)SvNV(ST(4)); + char *modelname = (char *) SvPV_nolen(ST(0)); + float x = (float) SvNV(ST(1)); + float y = (float) SvNV(ST(2)); + float z = (float) SvNV(ST(3)); + float heading = (float) SvNV(ST(4)); uint32 object_type = 58; - uint32 size = 100; - uint16 id = 0; + uint32 size = 100; + uint16 id = 0; if (items > 5) - object_type = (uint32)SvIV(ST(5)); + object_type = (uint32) SvIV(ST(5)); if (items > 6) - size = (uint32)SvIV(ST(6)); + size = (uint32) SvIV(ST(6)); id = quest_manager.CreateDoor(modelname, x, y, z, heading, object_type, size); XSRETURN_IV(id); } XS(XS__ModifyNPCStat); -XS(XS__ModifyNPCStat) -{ +XS(XS__ModifyNPCStat) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::ModifyNPCStat(string key, string value)"); @@ -2761,30 +2637,28 @@ XS(XS__ModifyNPCStat) } XS(XS__collectitems); -XS(XS__collectitems) -{ +XS(XS__collectitems) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::collectitems(int item_id, [bool remove_item = true])"); - uint32 item_id = (int)SvIV(ST(0)); - bool remove_item = ((int)SvIV(ST(1))) == 0?false:true; + uint32 item_id = (int) SvIV(ST(0)); + bool remove_item = ((int) SvIV(ST(1))) == 0 ? false : true; int quantity = - quest_manager.collectitems(item_id, remove_item); + quest_manager.collectitems(item_id, remove_item); XSRETURN_IV(quantity); } XS(XS__UpdateSpawnTimer); -XS(XS__UpdateSpawnTimer) -{ +XS(XS__UpdateSpawnTimer) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::UpdateSpawnTimer(uint32 spawn2_id, uint32 updated_time_till_repop)"); - uint32 spawn2_id = (int)SvIV(ST(0)); - uint32 updated_time_till_repop = (int)SvIV(ST(1)); + uint32 spawn2_id = (int) SvIV(ST(0)); + uint32 updated_time_till_repop = (int) SvIV(ST(1)); quest_manager.UpdateSpawnTimer(spawn2_id, updated_time_till_repop); @@ -2797,11 +2671,11 @@ XS(XS__MerchantSetItem) { if (items != 2 && items != 3) Perl_croak(aTHX_ "Usage: quest::MerchantSetItem(uint32 npc_id, uint32 item_id, [uint32 quantity])"); - uint32 npc_id = (int)SvUV(ST(0)); - uint32 item_id = (int)SvUV(ST(1)); + uint32 npc_id = (int) SvUV(ST(0)); + uint32 item_id = (int) SvUV(ST(1)); uint32 quantity = 0; if (items == 3) - quantity = (int)SvUV(ST(2)); + quantity = (int) SvUV(ST(2)); quest_manager.MerchantSetItem(npc_id, item_id, quantity); @@ -2814,8 +2688,8 @@ XS(XS__MerchantCountItem) { if (items != 2) Perl_croak(aTHX_ "Usage: quest::MerchantCountItem(uint32 npc_id, uint32 item_id)"); - uint32 npc_id = (int)SvUV(ST(0)); - uint32 item_id = (int)SvUV(ST(1)); + uint32 npc_id = (int) SvUV(ST(0)); + uint32 item_id = (int) SvUV(ST(1)); uint32 quantity = quest_manager.MerchantCountItem(npc_id, item_id); XSRETURN_UV(quantity); @@ -2828,14 +2702,16 @@ XS(XS__varlink) { Perl_croak(aTHX_ "Usage: quest::varlink(uint32 item_id)"); dXSTARG; - Const_char * RETVAL; - char text[250]; - uint32 item_id; - item_id = (int)SvUV(ST(0)); + Const_char *RETVAL; + char text[250]; + uint32 item_id; + item_id = (int) SvUV(ST(0)); RETVAL = quest_manager.varlink(text, item_id); - sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; + sv_setpv(TARG, RETVAL); + XSprePUSH; + PUSHTARG; XSRETURN(1); } @@ -2845,10 +2721,10 @@ XS(XS__CreateInstance) { if (items != 3) Perl_croak(aTHX_ "Usage: quest::CreateInstance(string zone_name, uint16 version, uint32 duration)"); - char * zone = (char *)SvPV_nolen(ST(0)); - uint16 version = (int)SvUV(ST(1)); - uint32 duration = (int)SvUV(ST(2)); - uint32 id = quest_manager.CreateInstance(zone, version, duration); + char *zone = (char *) SvPV_nolen(ST(0)); + uint16 version = (int) SvUV(ST(1)); + uint32 duration = (int) SvUV(ST(2)); + uint32 id = quest_manager.CreateInstance(zone, version, duration); XSRETURN_UV(id); } @@ -2859,7 +2735,7 @@ XS(XS__DestroyInstance) { if (items != 1) Perl_croak(aTHX_ "Usage: quest::DestroyInstance(int id)"); - uint16 id = (int)SvUV(ST(0)); + uint16 id = (int) SvUV(ST(0)); quest_manager.DestroyInstance(id); XSRETURN_EMPTY; @@ -2871,8 +2747,8 @@ XS(XS__UpdateInstanceTimer) { if (items != 2) Perl_croak(aTHX_ "Usage: quest::UpdateInstanceTimer(int16 instance_id, uint32 duration)"); - uint16 instance_id = (uint16)SvUV(ST(0)); - uint32 duration = (uint32)SvUV(ST(1)); + uint16 instance_id = (uint16) SvUV(ST(0)); + uint32 duration = (uint32) SvUV(ST(1)); quest_manager.UpdateInstanceTimer(instance_id, duration); XSRETURN_EMPTY; @@ -2883,9 +2759,9 @@ XS(XS__GetInstanceTimer) { dXSARGS; if (items != 0) Perl_croak(aTHX_ "Usage: quest::GetInstanceTimer()"); - + uint32 timer = quest_manager.GetInstanceTimer(); - + XSRETURN_UV(timer); } @@ -2894,10 +2770,10 @@ XS(XS__GetInstanceTimerByID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::GetInstanceTimerByID(uint16 instance_id)"); - - uint16 instance_id = (uint16)SvUV(ST(0)); - uint32 timer = quest_manager.GetInstanceTimerByID(instance_id); - + + uint16 instance_id = (uint16) SvUV(ST(0)); + uint32 timer = quest_manager.GetInstanceTimerByID(instance_id); + XSRETURN_UV(timer); } @@ -2907,9 +2783,9 @@ XS(XS__GetInstanceID) { if (items != 2) Perl_croak(aTHX_ "Usage: quest::GetInstanceID(string zone_name, uint16 version)"); - char * zone = (char *)SvPV_nolen(ST(0)); - uint16 version = (int)SvUV(ST(1)); - uint16 id = quest_manager.GetInstanceID(zone, version); + char *zone = (char *) SvPV_nolen(ST(0)); + uint16 version = (int) SvUV(ST(1)); + uint16 id = quest_manager.GetInstanceID(zone, version); XSRETURN_UV(id); } @@ -2921,20 +2797,18 @@ XS(XS__GetCharactersInInstance) { Perl_croak(aTHX_ "Usage: quest::GetCharactersInInstance(uint16 instance_id)"); dXSTARG; - Const_char * RETVAL; - uint16 instance_id = (int)SvUV(ST(0)); + Const_char *RETVAL; + uint16 instance_id = (int) SvUV(ST(0)); std::list char_id_list; - std::string char_id_string; + std::string char_id_string; database.GetCharactersInInstance(instance_id, char_id_list); - if (char_id_list.size() > 0) - { + if (char_id_list.size() > 0) { char_id_string = itoa(char_id_list.size()); char_id_string += " player(s) in instance: "; auto iter = char_id_list.begin(); - while (iter != char_id_list.end()) - { + while (iter != char_id_list.end()) { char char_name[64]; database.GetCharName(*iter, char_name); char_id_string += char_name; @@ -2945,12 +2819,13 @@ XS(XS__GetCharactersInInstance) { if (iter != char_id_list.end()) char_id_string += ", "; } - RETVAL = char_id_string.c_str(); - } - else + RETVAL = char_id_string.c_str(); + } else RETVAL = "No players in that instance."; - sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; + sv_setpv(TARG, RETVAL); + XSprePUSH; + PUSHTARG; XSRETURN(1); } @@ -2960,7 +2835,7 @@ XS(XS__AssignToInstance) { if (items != 1) Perl_croak(aTHX_ "Usage: quest::AssignToInstance(uint16 instance_id)"); - uint16 instance_id = (int)SvUV(ST(0)); + uint16 instance_id = (int) SvUV(ST(0)); quest_manager.AssignToInstance(instance_id); XSRETURN_EMPTY; @@ -2972,7 +2847,7 @@ XS(XS__AssignGroupToInstance) { if (items != 1) Perl_croak(aTHX_ "Usage: quest::AssignGroupToInstance(uint16 instance_id)"); - uint16 instance_id = (int)SvUV(ST(0)); + uint16 instance_id = (int) SvUV(ST(0)); quest_manager.AssignGroupToInstance(instance_id); XSRETURN_EMPTY; @@ -2984,7 +2859,7 @@ XS(XS__AssignRaidToInstance) { if (items != 1) Perl_croak(aTHX_ "Usage: quest::AssignRaidToInstance(uint16 instance_id)"); - uint16 instance_id = (int)SvUV(ST(0)); + uint16 instance_id = (int) SvUV(ST(0)); quest_manager.AssignRaidToInstance(instance_id); XSRETURN_EMPTY; @@ -2996,7 +2871,7 @@ XS(XS__RemoveFromInstance) { if (items != 1) Perl_croak(aTHX_ "Usage: quest::RemoveFromInstance(uint16 instance_id)"); - uint16 instance_id = (int)SvUV(ST(0)); + uint16 instance_id = (int) SvUV(ST(0)); quest_manager.RemoveFromInstance(instance_id); XSRETURN_EMPTY; @@ -3008,32 +2883,29 @@ XS(XS__RemoveAllFromInstance) { if (items != 1) Perl_croak(aTHX_ "Usage: quest::RemoveAllFromInstance(uint16 instance_id)"); - uint16 instance_id = (int)SvUV(ST(0)); + uint16 instance_id = (int) SvUV(ST(0)); quest_manager.RemoveAllFromInstance(instance_id); XSRETURN_EMPTY; } XS(XS__MovePCInstance); -XS(XS__MovePCInstance) -{ +XS(XS__MovePCInstance) { dXSARGS; if (items != 5 && items != 6) - Perl_croak(aTHX_ "Usage: quest::MovePCInstance(int zone_id, int instance_id, float x, float y, float z, [float heading])"); + Perl_croak(aTHX_ + "Usage: quest::MovePCInstance(int zone_id, int instance_id, float x, float y, float z, [float heading])"); - int zone_id = (int)SvIV(ST(0)); - int instanceid = (int)SvIV(ST(1)); - float x = (float)SvNV(ST(2)); - float y = (float)SvNV(ST(3)); - float z = (float)SvNV(ST(4)); + int zone_id = (int) SvIV(ST(0)); + int instanceid = (int) SvIV(ST(1)); + float x = (float) SvNV(ST(2)); + float y = (float) SvNV(ST(3)); + float z = (float) SvNV(ST(4)); - if (items == 4) - { + if (items == 4) { quest_manager.MovePCInstance(zone_id, instanceid, glm::vec4(x, y, z, 0.0f)); - } - else - { - float heading = (float)SvNV(ST(5)); + } else { + float heading = (float) SvNV(ST(5)); quest_manager.MovePCInstance(zone_id, instanceid, glm::vec4(x, y, z, heading)); } @@ -3046,8 +2918,8 @@ XS(XS__FlagInstanceByGroupLeader) { if (items != 2) Perl_croak(aTHX_ "Usage: quest::FlagInstanceByGroupLeader(uint32 zone, uint16 version)"); - uint32 zone = (int)SvUV(ST(0)); - uint16 version = (int)SvUV(ST(1)); + uint32 zone = (int) SvUV(ST(0)); + uint16 version = (int) SvUV(ST(1)); quest_manager.FlagInstanceByGroupLeader(zone, version); XSRETURN_EMPTY; @@ -3059,8 +2931,8 @@ XS(XS__FlagInstanceByRaidLeader) { if (items != 2) Perl_croak(aTHX_ "Usage: quest::FlagInstanceByRaidLeader(uint32 zone, uint16 version)"); - uint32 zone = (int)SvUV(ST(0)); - uint16 version = (int)SvUV(ST(1)); + uint32 zone = (int) SvUV(ST(0)); + uint16 version = (int) SvUV(ST(1)); quest_manager.FlagInstanceByRaidLeader(zone, version); XSRETURN_EMPTY; @@ -3073,21 +2945,23 @@ XS(XS__saylink) { Perl_croak(aTHX_ "Usage: quest::saylink(string message, [bool silent = false], [link_name = message])"); dXSTARG; - Const_char * RETVAL; - char message[250]; - char link_name[250]; - bool silent = false; - strcpy(message,(char *)SvPV_nolen(ST(0))); - if(items >= 2) { - silent = ((int)SvIV(ST(1))) == 0 ? false : true; + Const_char *RETVAL; + char message[250]; + char link_name[250]; + bool silent = false; + strcpy(message, (char *) SvPV_nolen(ST(0))); + if (items >= 2) { + silent = ((int) SvIV(ST(1))) == 0 ? false : true; } if (items == 3) - strcpy(link_name,(char *)SvPV_nolen(ST(2))); + strcpy(link_name, (char *) SvPV_nolen(ST(2))); else - strcpy(link_name,message); + strcpy(link_name, message); RETVAL = quest_manager.saylink(message, silent, link_name); - sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; + sv_setpv(TARG, RETVAL); + XSprePUSH; + PUSHTARG; XSRETURN(1); } @@ -3098,23 +2972,24 @@ XS(XS__getguildnamebyid) { Perl_croak(aTHX_ "Usage: quest::getguildnamebyid(uint32 guild_id)"); dXSTARG; - Const_char * RETVAL; - uint32 guild_id = (int)SvUV(ST(0)); + Const_char *RETVAL; + uint32 guild_id = (int) SvUV(ST(0)); RETVAL = quest_manager.getguildnamebyid(guild_id); - sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; + sv_setpv(TARG, RETVAL); + XSprePUSH; + PUSHTARG; XSRETURN(1); } XS(XS__SetRunning); -XS(XS__SetRunning) -{ +XS(XS__SetRunning) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::SetRunning(bool is_running)"); - bool val = ((int)SvIV(ST(0))) == 0?false:true; + bool val = ((int) SvIV(ST(0))) == 0 ? false : true; quest_manager.SetRunning(val); @@ -3122,68 +2997,67 @@ XS(XS__SetRunning) } XS(XS__IsRunning); -XS(XS__IsRunning) -{ +XS(XS__IsRunning) { dXSARGS; if (items >= 1) Perl_croak(aTHX_ "Usage: quest::IsRunning()"); - bool RETVAL; + bool RETVAL; dXSTARG; RETVAL = quest_manager.IsRunning(); - XSprePUSH; PUSHu((IV)RETVAL); + XSprePUSH; + PUSHu((IV) RETVAL); XSRETURN(1); } XS(XS__IsEffectInSpell); -XS(XS__IsEffectInSpell) -{ +XS(XS__IsEffectInSpell) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::IsEffectInSpell(uint32 spell_id, uint32 effect_id)"); - uint32 spell_id = (uint32)SvUV(ST(0)); - uint32 effect_id = (uint32)SvUV(ST(1)); - bool RETVAL; + uint32 spell_id = (uint32) SvUV(ST(0)); + uint32 effect_id = (uint32) SvUV(ST(1)); + bool RETVAL; dXSTARG; RETVAL = IsEffectInSpell(spell_id, effect_id); - XSprePUSH; PUSHu((IV)RETVAL); + XSprePUSH; + PUSHu((IV) RETVAL); XSRETURN(1); } XS(XS__IsBeneficialSpell); -XS(XS__IsBeneficialSpell) -{ +XS(XS__IsBeneficialSpell) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::IsBeneficialSpell(uint32 spell_id)"); - uint32 spell_id = (uint32)SvUV(ST(0)); - bool RETVAL; + uint32 spell_id = (uint32) SvUV(ST(0)); + bool RETVAL; dXSTARG; RETVAL = BeneficialSpell(spell_id); - XSprePUSH; PUSHu((IV)RETVAL); + XSprePUSH; + PUSHu((IV) RETVAL); XSRETURN(1); } XS(XS__GetSpellResistType); -XS(XS__GetSpellResistType) -{ +XS(XS__GetSpellResistType) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::GetSpellResistType(uint32 spell_id)"); - uint32 spell_id = (uint32)SvUV(ST(0)); - int32 spell_val = 0; + uint32 spell_id = (uint32) SvUV(ST(0)); + int32 spell_val = 0; dXSTARG; spell_val = GetSpellResistType(spell_id); @@ -3191,14 +3065,13 @@ XS(XS__GetSpellResistType) } XS(XS__GetSpellTargetType); -XS(XS__GetSpellTargetType) -{ +XS(XS__GetSpellTargetType) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::GetSpellTargetType(uint32 spell_id)"); - uint32 spell_id = (uint32)SvUV(ST(0)); - int32 spell_val = 0; + uint32 spell_id = (uint32) SvUV(ST(0)); + int32 spell_val = 0; dXSTARG; spell_val = GetSpellTargetType(spell_id); @@ -3211,7 +3084,7 @@ XS(XS__FlyMode) { if (items != 1) Perl_croak(aTHX_ "Usage: quest::FlyMode(uint8 mode [0-3])"); - uint8 flymode = (int)SvUV(ST(0)); + uint8 flymode = (int) SvUV(ST(0)); quest_manager.FlyMode(flymode); XSRETURN_EMPTY; @@ -3228,68 +3101,65 @@ XS(XS_FactionValue) { } XS(XS__enabletitle); -XS(XS__enabletitle) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: quest::enabletitle(int title_set_id)"); +XS(XS__enabletitle) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: quest::enabletitle(int title_set_id)"); - int titleset = (int)SvIV(ST(0)); + int titleset = (int) SvIV(ST(0)); - quest_manager.enabletitle(titleset); + quest_manager.enabletitle(titleset); - XSRETURN_EMPTY; + XSRETURN_EMPTY; } XS(XS__checktitle); -XS(XS__checktitle) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: quest::checktitle(int title_set_id)"); +XS(XS__checktitle) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: quest::checktitle(int title_set_id)"); - bool RETVAL; - int titleset = (int)SvIV(ST(0)); + bool RETVAL; + int titleset = (int) SvIV(ST(0)); - RETVAL = quest_manager.checktitle(titleset); + RETVAL = quest_manager.checktitle(titleset); - ST(0) = boolSV(RETVAL); + ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); XSRETURN(1); } XS(XS__removetitle); -XS(XS__removetitle) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: quest::removetitle(int title_set_id)"); +XS(XS__removetitle) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: quest::removetitle(int title_set_id)"); - int titleset = (int)SvIV(ST(0)); + int titleset = (int) SvIV(ST(0)); - quest_manager.removetitle(titleset); + quest_manager.removetitle(titleset); - XSRETURN_EMPTY; + XSRETURN_EMPTY; } XS(XS__wearchange); -XS(XS__wearchange) -{ +XS(XS__wearchange) { dXSARGS; if (items < 2) - Perl_croak(aTHX_ "Usage: quest::wearchange(uint8 slot, uint16 texture_id, [uint32 hero_forge_model_id = 0], [uint32 elite_material_id = 0])"); + Perl_croak(aTHX_ + "Usage: quest::wearchange(uint8 slot, uint16 texture_id, [uint32 hero_forge_model_id = 0], [uint32 elite_material_id = 0])"); - uint8 slot = (int)SvUV(ST(0)); - uint16 texture_id = (int)SvUV(ST(1)); + uint8 slot = (int) SvUV(ST(0)); + uint16 texture_id = (int) SvUV(ST(1)); - uint32 hero_forge_model_id= 0; - uint32 elite_material_id = 0; + uint32 hero_forge_model_id = 0; + uint32 elite_material_id = 0; if (items > 2) - hero_forge_model_id= (int)SvUV(ST(2)); + hero_forge_model_id = (int) SvUV(ST(2)); if (items > 3) - elite_material_id = (int)SvUV(ST(3)); + elite_material_id = (int) SvUV(ST(3)); quest_manager.wearchange(slot, texture_id, hero_forge_model_id, elite_material_id); @@ -3297,16 +3167,15 @@ XS(XS__wearchange) } XS(XS__voicetell); -XS(XS__voicetell) -{ +XS(XS__voicetell) { dXSARGS; if (items != 4) Perl_croak(aTHX_ "Usage: quest::voicetell(string client_name, int macro_id, int ace_id, int gender_id)"); - char * client_name = (char *)SvPV_nolen(ST(0)); - int macro_id = (int)SvIV(ST(1)); - int race_id = (int)SvIV(ST(2)); - int gender_id = (int)SvIV(ST(3)); + char *client_name = (char *) SvPV_nolen(ST(0)); + int macro_id = (int) SvIV(ST(1)); + int race_id = (int) SvIV(ST(2)); + int gender_id = (int) SvIV(ST(3)); quest_manager.voicetell(client_name, macro_id, race_id, gender_id); @@ -3314,13 +3183,12 @@ XS(XS__voicetell) } XS(XS__LearnRecipe); -XS(XS__LearnRecipe) -{ +XS(XS__LearnRecipe) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::LearnRecipe(int recipe_id)"); - uint32 recipe_id = (uint32)SvIV(ST(0)); + uint32 recipe_id = (uint32) SvIV(ST(0)); quest_manager.LearnRecipe(recipe_id); @@ -3328,16 +3196,15 @@ XS(XS__LearnRecipe) } XS(XS__SendMail); -XS(XS__SendMail) -{ +XS(XS__SendMail) { dXSARGS; if (items != 4) Perl_croak(aTHX_ "Usage: quest::SendMail(stirng to, string from, string subject, string message)"); - char *to = (char *)SvPV_nolen(ST(0)); - char *from = (char *)SvPV_nolen(ST(1)); - char *subject = (char *)SvPV_nolen(ST(2)); - char *message = (char *)SvPV_nolen(ST(3)); + char *to = (char *) SvPV_nolen(ST(0)); + char *from = (char *) SvPV_nolen(ST(1)); + char *subject = (char *) SvPV_nolen(ST(2)); + char *message = (char *) SvPV_nolen(ST(3)); quest_manager.SendMail(to, from, subject, message); @@ -3345,40 +3212,39 @@ XS(XS__SendMail) } XS(XS__GetZoneID); -XS(XS__GetZoneID) -{ +XS(XS__GetZoneID) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::GetZoneID(string zone)"); - char *zone = (char *)SvPV_nolen(ST(0)); - int32 id = quest_manager.GetZoneID(zone); + char *zone = (char *) SvPV_nolen(ST(0)); + int32 id = quest_manager.GetZoneID(zone); XSRETURN_IV(id); } XS(XS__GetZoneLongName); -XS(XS__GetZoneLongName) -{ +XS(XS__GetZoneLongName) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: quest::GetZoneLongName(string zone)"); dXSTARG; - char *zone = (char *)SvPV_nolen(ST(0)); - Const_char* RETVAL = quest_manager.GetZoneLongName(zone); + char *zone = (char *) SvPV_nolen(ST(0)); + Const_char *RETVAL = quest_manager.GetZoneLongName(zone); - sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; + sv_setpv(TARG, RETVAL); + XSprePUSH; + PUSHTARG; XSRETURN(1); } XS(XS__GetTimeSeconds); -XS(XS__GetTimeSeconds) -{ +XS(XS__GetTimeSeconds) { dXSARGS; if (items != 0) Perl_croak(aTHX_ "Usage: quest::GetTimeSeconds()"); - uint32 seconds = 0; + uint32 seconds = 0; dXSTARG; seconds = Timer::GetTimeSeconds(); @@ -3386,16 +3252,15 @@ XS(XS__GetTimeSeconds) } XS(XS__crosszonesignalclientbycharid); -XS(XS__crosszonesignalclientbycharid) -{ +XS(XS__crosszonesignalclientbycharid) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::crosszonesignalclientbycharid(int character_id, int value)"); if (items == 2) { - int char_id = (int)SvIV(ST(0)); - uint32 int_value = (uint32)SvIV(ST(1)); + int char_id = (int) SvIV(ST(0)); + uint32 int_value = (uint32) SvIV(ST(1)); quest_manager.CrossZoneSignalPlayerByCharID(char_id, int_value); } else { Perl_croak(aTHX_ "Usage: quest::crosszonesignalclientbycharid(int character_id, int value)"); @@ -3405,16 +3270,15 @@ XS(XS__crosszonesignalclientbycharid) } XS(XS__crosszonesignalclientbyname); -XS(XS__crosszonesignalclientbyname) -{ +XS(XS__crosszonesignalclientbyname) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::crosszonesignalclientbycharid(string name, int value)"); if (items == 2) { - char *name = (char *)SvPV_nolen(ST(0)); - uint32 int_value = (uint32)SvIV(ST(1)); + char *name = (char *) SvPV_nolen(ST(0)); + uint32 int_value = (uint32) SvIV(ST(1)); quest_manager.CrossZoneSignalPlayerByName(name, int_value); } else { Perl_croak(aTHX_ "Usage: quest::crosszonesignalclientbycharid(string name, int value)"); @@ -3425,17 +3289,16 @@ XS(XS__crosszonesignalclientbyname) XS(XS__crosszonemessageplayerbyname); -XS(XS__crosszonemessageplayerbyname) -{ +XS(XS__crosszonemessageplayerbyname) { dXSARGS; if (items != 3) Perl_croak(aTHX_ "Usage: quest::crosszonemessageplayerbyname(int channel_id, string name, string message)"); if (items == 3) { - uint32 channel_id = (uint32)SvIV(ST(0)); - char *name = (char *)SvPV_nolen(ST(1)); - char *message = (char *)SvPV_nolen(ST(2)); + uint32 channel_id = (uint32) SvIV(ST(0)); + char *name = (char *) SvPV_nolen(ST(1)); + char *message = (char *) SvPV_nolen(ST(2)); quest_manager.CrossZoneMessagePlayerByName(channel_id, name, message); } @@ -3443,16 +3306,14 @@ XS(XS__crosszonemessageplayerbyname) } XS(XS__enablerecipe); -XS(XS__enablerecipe) -{ +XS(XS__enablerecipe) { dXSARGS; bool success = false; if (items != 1) { Perl_croak(aTHX_ "Usage: quest::enablerecipe(int recipe_id)"); - } - else { - uint32 recipe_id = (uint32)SvIV(ST(0)); + } else { + uint32 recipe_id = (uint32) SvIV(ST(0)); success = quest_manager.EnableRecipe(recipe_id); } if (!success) { @@ -3463,16 +3324,14 @@ XS(XS__enablerecipe) } XS(XS__disablerecipe); -XS(XS__disablerecipe) -{ +XS(XS__disablerecipe) { dXSARGS; bool success = false; if (items != 1) { Perl_croak(aTHX_ "Usage: quest::disablerecipe(int recipe_id)"); - } - else { - uint32 recipe_id = (uint32)SvIV(ST(0)); + } else { + uint32 recipe_id = (uint32) SvIV(ST(0)); success = quest_manager.DisableRecipe(recipe_id); } if (!success) { @@ -3483,15 +3342,13 @@ XS(XS__disablerecipe) } XS(XS__clear_npctype_cache); -XS(XS__clear_npctype_cache) -{ +XS(XS__clear_npctype_cache) { dXSARGS; if (items != 1) { Perl_croak(aTHX_ "Usage: quest::clear_npctype_cache(int npc_type_id)"); - } - else { - int32 npc_type_id = (int32)SvIV(ST(0)); + } else { + int32 npc_type_id = (int32) SvIV(ST(0)); quest_manager.ClearNPCTypeCache(npc_type_id); } @@ -3499,8 +3356,7 @@ XS(XS__clear_npctype_cache) } XS(XS__reloadzonestaticdata); -XS(XS__reloadzonestaticdata) -{ +XS(XS__reloadzonestaticdata) { dXSARGS; quest_manager.ReloadZoneStaticData(); @@ -3509,47 +3365,43 @@ XS(XS__reloadzonestaticdata) } XS(XS__qs_send_query); -XS(XS__qs_send_query) -{ +XS(XS__qs_send_query) { dXSARGS; - if (items != 1){ + if (items != 1) { Perl_croak(aTHX_ "Usage: quest::qs_send_query(string query)"); - } - else{ + } else { // char *Query = (char *)SvPV_nolen(ST(0)); - std::string Query = (std::string)SvPV_nolen(ST(0)); + std::string Query = (std::string) SvPV_nolen(ST(0)); QServ->SendQuery(Query); } XSRETURN_EMPTY; } XS(XS__qs_player_event); -XS(XS__qs_player_event) -{ +XS(XS__qs_player_event) { dXSARGS; - if (items != 2){ + if (items != 2) { Perl_croak(aTHX_ "Usage: quest::qs_player_event(int character_id, string message)"); - } - else{ - int char_id = (int)SvIV(ST(0)); - std::string message = (std::string)SvPV_nolen(ST(1)); + } else { + int char_id = (int) SvIV(ST(0)); + std::string message = (std::string) SvPV_nolen(ST(1)); QServ->PlayerLogEvent(Player_Log_Quest, char_id, message); } XSRETURN_EMPTY; } XS(XS__crosszonesetentityvariablebynpctypeid); -XS(XS__crosszonesetentityvariablebynpctypeid) -{ +XS(XS__crosszonesetentityvariablebynpctypeid) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: quest::crosszonesetentityvariablebynpctypeid(int npc_type_id, string key, string value)"); + Perl_croak(aTHX_ + "Usage: quest::crosszonesetentityvariablebynpctypeid(int npc_type_id, string key, string value)"); if (items == 3) { - uint32 npc_type_id = (uint32)SvIV(ST(0)); - const char *key = (const char *)SvPV_nolen(ST(1)); - const char *str_value = (const char *)SvPV_nolen(ST(2)); + uint32 npc_type_id = (uint32) SvIV(ST(0)); + const char *key = (const char *) SvPV_nolen(ST(1)); + const char *str_value = (const char *) SvPV_nolen(ST(2)); quest_manager.CrossZoneSetEntityVariableByNPCTypeID(npc_type_id, key, str_value); } @@ -3557,17 +3409,17 @@ XS(XS__crosszonesetentityvariablebynpctypeid) } XS(XS__crosszonesetentityvariablebyclientname); -XS(XS__crosszonesetentityvariablebyclientname) -{ +XS(XS__crosszonesetentityvariablebyclientname) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: quest::crosszonesetentityvariablebyclientname(string client_name, string key, string value)"); + Perl_croak(aTHX_ + "Usage: quest::crosszonesetentityvariablebyclientname(string client_name, string key, string value)"); if (items == 3) { - const char *client_name = (const char *)SvPV_nolen(ST(0)); - const char *key = (const char *)SvPV_nolen(ST(1)); - const char *str_value = (const char *)SvPV_nolen(ST(2)); + const char *client_name = (const char *) SvPV_nolen(ST(0)); + const char *key = (const char *) SvPV_nolen(ST(1)); + const char *str_value = (const char *) SvPV_nolen(ST(2)); quest_manager.CrossZoneSetEntityVariableByClientName(client_name, key, str_value); } @@ -3575,16 +3427,15 @@ XS(XS__crosszonesetentityvariablebyclientname) } XS(XS__crosszonesignalnpcbynpctypeid); -XS(XS__crosszonesignalnpcbynpctypeid) -{ +XS(XS__crosszonesignalnpcbynpctypeid) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::crosszonesignalnpcbynpctypeid(uint32 npc_type_id, uint32 value)"); if (items == 2) { - uint32 npc_type_id = (uint32)SvIV(ST(0)); - uint32 int_value = (uint32)SvIV(ST(1)); + uint32 npc_type_id = (uint32) SvIV(ST(0)); + uint32 int_value = (uint32) SvIV(ST(1)); quest_manager.CrossZoneSignalNPCByNPCTypeID(npc_type_id, int_value); } @@ -3592,49 +3443,45 @@ XS(XS__crosszonesignalnpcbynpctypeid) } XS(XS__worldwidemarquee); -XS(XS__worldwidemarquee) -{ +XS(XS__worldwidemarquee) { dXSARGS; if (items != 6) - Perl_croak(aTHX_ "Usage: quest::worldwidemarquee(uint32 color_id, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, string message)"); - + Perl_croak(aTHX_ + "Usage: quest::worldwidemarquee(uint32 color_id, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, string message)"); + if (items == 6) { - uint32 color_id = (uint32)SvIV(ST(0)); - uint32 priority = (uint32)SvIV(ST(1)); - uint32 fade_in = (uint32)SvIV(ST(2)); - uint32 fade_out = (uint32)SvIV(ST(3)); - uint32 duration = (uint32)SvIV(ST(4)); - char* message = (char *)SvPV_nolen(ST(5)); + uint32 color_id = (uint32) SvIV(ST(0)); + uint32 priority = (uint32) SvIV(ST(1)); + uint32 fade_in = (uint32) SvIV(ST(2)); + uint32 fade_out = (uint32) SvIV(ST(3)); + uint32 duration = (uint32) SvIV(ST(4)); + char *message = (char *) SvPV_nolen(ST(5)); quest_manager.WorldWideMarquee(color_id, priority, fade_in, fade_out, duration, message); } - + XSRETURN_EMPTY; } XS(XS__debug); -XS(XS__debug) -{ +XS(XS__debug) { dXSARGS; - if (items != 1 && items != 2){ + if (items != 1 && items != 2) { Perl_croak(aTHX_ "Usage: quest::debug(string message, [uint8 debug_level = 1 [1-3]])"); - } - else{ - std::string log_message = (std::string)SvPV_nolen(ST(0)); - uint8 debug_level = 1; + } else { + std::string log_message = (std::string) SvPV_nolen(ST(0)); + uint8 debug_level = 1; if (items == 2) - debug_level = (uint8)SvIV(ST(1)); + debug_level = (uint8) SvIV(ST(1)); if (debug_level > Logs::Detail) return; - if (debug_level == Logs::General){ + if (debug_level == Logs::General) { Log(Logs::General, Logs::QuestDebug, log_message); - } - else if (debug_level == Logs::Moderate){ + } else if (debug_level == Logs::Moderate) { Log(Logs::Moderate, Logs::QuestDebug, log_message); - } - else if (debug_level == Logs::Detail){ + } else if (debug_level == Logs::Detail) { Log(Logs::Detail, Logs::QuestDebug, log_message); } } @@ -3646,11 +3493,11 @@ XS(XS__UpdateZoneHeader) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: quest::UpdateZoneHeader(string key, string value)"); - - std::string key = (std::string)SvPV_nolen(ST(0)); - std::string str_value = (std::string)SvPV_nolen(ST(1)); + + std::string key = (std::string) SvPV_nolen(ST(0)); + std::string str_value = (std::string) SvPV_nolen(ST(1)); quest_manager.UpdateZoneHeader(key, str_value); - + XSRETURN_EMPTY; } @@ -3660,21 +3507,20 @@ This is the callback perl will look for to setup the quest package's XSUBs */ EXTERN_C XS(boot_quest); // prototype to pass -Wmissing-prototypes -EXTERN_C XS(boot_quest) -{ +EXTERN_C XS(boot_quest) { dXSARGS; char file[256]; strncpy(file, __FILE__, 256); file[255] = '\0'; - if(items != 1) + if (items != 1) Log(Logs::General, Logs::Error, "boot_quest does not take any arguments."); - char buf[128]; //shouldent have any function names longer than this. + char buf[128]; //shouldent have any function names longer than this. //add the strcpy stuff to get rid of const warnings.... - XS_VERSION_BOOTCHECK ; + XS_VERSION_BOOTCHECK; #ifdef BOTS newXS(strcpy(buf, "botquest"), XS__botquest, file); @@ -3683,216 +3529,216 @@ EXTERN_C XS(boot_quest) newXS(strcpy(buf, "createBot"), XS__createBot, file); #endif //BOTS - newXS(strcpy(buf, "AssignGroupToInstance"), XS__AssignGroupToInstance, file); - newXS(strcpy(buf, "AssignRaidToInstance"), XS__AssignRaidToInstance, file); - newXS(strcpy(buf, "AssignToInstance"), XS__AssignToInstance, file); - newXS(strcpy(buf, "ChooseRandom"), XS__ChooseRandom, file); - newXS(strcpy(buf, "CreateInstance"), XS__CreateInstance, file); - newXS(strcpy(buf, "DestroyInstance"), XS__DestroyInstance, file); - newXS(strcpy(buf, "UpdateInstanceTimer"), XS__UpdateInstanceTimer, file); - newXS(strcpy(buf, "GetInstanceTimer"), XS__GetInstanceTimer, file); - newXS(strcpy(buf, "GetInstanceTimerByID"), XS__GetInstanceTimerByID, file); - newXS(strcpy(buf, "FlagInstanceByGroupLeader"), XS__FlagInstanceByGroupLeader, file); - newXS(strcpy(buf, "FlagInstanceByRaidLeader"), XS__FlagInstanceByRaidLeader, file); - newXS(strcpy(buf, "FlyMode"), XS__FlyMode, file); - newXS(strcpy(buf, "GetCharactersInInstance"), XS__GetCharactersInInstance, file); - newXS(strcpy(buf, "GetInstanceID"), XS__GetInstanceID, file); - newXS(strcpy(buf, "GetSpellResistType"), XS__GetSpellResistType, file); - newXS(strcpy(buf, "GetSpellTargetType"), XS__GetSpellTargetType, file); - newXS(strcpy(buf, "GetTimeSeconds"), XS__GetTimeSeconds, file); - newXS(strcpy(buf, "GetZoneID"), XS__GetZoneID, file); - newXS(strcpy(buf, "GetZoneLongName"), XS__GetZoneLongName, file); - newXS(strcpy(buf, "IsBeneficialSpell"), XS__IsBeneficialSpell, file); - newXS(strcpy(buf, "IsEffectInSpell"), XS__IsEffectInSpell, file); - newXS(strcpy(buf, "IsRunning"), XS__IsRunning, file); - newXS(strcpy(buf, "LearnRecipe"), XS__LearnRecipe, file); - newXS(strcpy(buf, "MerchantCountItem"), XS__MerchantCountItem, file); - newXS(strcpy(buf, "MerchantSetItem"), XS__MerchantSetItem, file); - newXS(strcpy(buf, "MovePCInstance"), XS__MovePCInstance, file); - newXS(strcpy(buf, "RemoveAllFromInstance"), XS__RemoveAllFromInstance, file); - newXS(strcpy(buf, "RemoveFromInstance"), XS__RemoveFromInstance, file); - newXS(strcpy(buf, "SendMail"), XS__SendMail, file); - newXS(strcpy(buf, "SetRunning"), XS__SetRunning, file); - newXS(strcpy(buf, "activespeakactivity"), XS__activespeakactivity, file); - newXS(strcpy(buf, "activespeaktask"), XS__activespeaktask, file); - newXS(strcpy(buf, "activetasksinset"), XS__activetasksinset, file); - newXS(strcpy(buf, "addldonloss"), XS__addldonpoints, file); - newXS(strcpy(buf, "addldonpoints"), XS__addldonpoints, file); - newXS(strcpy(buf, "addldonwin"), XS__addldonpoints, file); - newXS(strcpy(buf, "addloot"), XS__addloot, file); - newXS(strcpy(buf, "addskill"), XS__addskill, file); - newXS(strcpy(buf, "assigntask"), XS__assigntask, file); - newXS(strcpy(buf, "attack"), XS__attack, file); - newXS(strcpy(buf, "attacknpc"), XS__attacknpc, file); - newXS(strcpy(buf, "attacknpctype"), XS__attacknpctype, file); - newXS(strcpy(buf, "buryplayercorpse"), XS__buryplayercorpse, file); - newXS(strcpy(buf, "castspell"), XS__castspell, file); - newXS(strcpy(buf, "changedeity"), XS__changedeity, file); - newXS(strcpy(buf, "checktitle"), XS__checktitle, file); - newXS(strcpy(buf, "clear_npctype_cache"), XS__clear_npctype_cache, file); - newXS(strcpy(buf, "clear_proximity"), XS__clear_proximity, file); - newXS(strcpy(buf, "clear_zone_flag"), XS__clear_zone_flag, file); - newXS(strcpy(buf, "clearspawntimers"), XS__clearspawntimers, file); - newXS(strcpy(buf, "collectitems"), XS__collectitems, file); - newXS(strcpy(buf, "completedtasksinset"), XS__completedtasksinset, file); - newXS(strcpy(buf, "createdoor"), XS__CreateDoor, file); - newXS(strcpy(buf, "creategroundobject"), XS__CreateGroundObject, file); - newXS(strcpy(buf, "creategroundobjectfrommodel"), XS__CreateGroundObjectFromModel, file); - newXS(strcpy(buf, "createguild"), XS__createguild, file); - newXS(strcpy(buf, "crosszonemessageplayerbyname"), XS__crosszonemessageplayerbyname, file); - newXS(strcpy(buf, "crosszonesetentityvariablebynpctypeid"), XS__crosszonesetentityvariablebynpctypeid, file); - newXS(strcpy(buf, "crosszonesetentityvariablebyclientname"), XS__crosszonesetentityvariablebyclientname, file); - newXS(strcpy(buf, "crosszonesignalclientbycharid"), XS__crosszonesignalclientbycharid, file); - newXS(strcpy(buf, "crosszonesignalclientbyname"), XS__crosszonesignalclientbyname, file); - newXS(strcpy(buf, "crosszonesignalnpcbynpctypeid"), XS__crosszonesignalnpcbynpctypeid, file); - newXS(strcpy(buf, "worldwidemarquee"), XS__worldwidemarquee, file); - newXS(strcpy(buf, "debug"), XS__debug, file); - newXS(strcpy(buf, "delglobal"), XS__delglobal, file); - newXS(strcpy(buf, "depop"), XS__depop, file); - newXS(strcpy(buf, "depop_withtimer"), XS__depop_withtimer, file); - newXS(strcpy(buf, "depopall"), XS__depopall, file); - newXS(strcpy(buf, "depopzone"), XS__depopzone, file); - newXS(strcpy(buf, "ding"), XS__ding, file); - newXS(strcpy(buf, "disable_proximity_say"), XS__disable_proximity_say, file); - newXS(strcpy(buf, "disable_spawn2"), XS__disable_spawn2, file); - newXS(strcpy(buf, "disablerecipe"), XS__disablerecipe, file); - newXS(strcpy(buf, "disabletask"), XS__disabletask, file); - newXS(strcpy(buf, "doanim"), XS__doanim, file); - newXS(strcpy(buf, "echo"), XS__echo, file); - newXS(strcpy(buf, "emote"), XS__emote, file); - newXS(strcpy(buf, "enable_proximity_say"), XS__enable_proximity_say, file); - newXS(strcpy(buf, "enable_spawn2"), XS__enable_spawn2, file); - newXS(strcpy(buf, "enabledtaskcount"), XS__enabledtaskcount, file); - newXS(strcpy(buf, "enablerecipe"), XS__enablerecipe, file); - newXS(strcpy(buf, "enabletask"), XS__enabletask, file); - newXS(strcpy(buf, "enabletitle"), XS__enabletitle, file); - newXS(strcpy(buf, "exp"), XS__exp, file); - newXS(strcpy(buf, "faction"), XS__faction, file); - newXS(strcpy(buf, "factionvalue"), XS_FactionValue, file); - newXS(strcpy(buf, "failtask"), XS__failtask, file); - newXS(strcpy(buf, "firsttaskinset"), XS__firsttaskinset, file); - newXS(strcpy(buf, "follow"), XS__follow, file); - newXS(strcpy(buf, "forcedoorclose"), XS__forcedoorclose, file); - newXS(strcpy(buf, "forcedooropen"), XS__forcedooropen, file); - newXS(strcpy(buf, "getItemName"), XS_qc_getItemName, file); - newXS(strcpy(buf, "get_spawn_condition"), XS__get_spawn_condition, file); - newXS(strcpy(buf, "getguildnamebyid"), XS__getguildnamebyid, file); - newXS(strcpy(buf, "getlevel"), XS__getlevel, file); - newXS(strcpy(buf, "getplayerburiedcorpsecount"), XS__getplayerburiedcorpsecount, file); - newXS(strcpy(buf, "gettaskactivitydonecount"), XS__gettaskactivitydonecount, file); - newXS(strcpy(buf, "givecash"), XS__givecash, file); - newXS(strcpy(buf, "gmmove"), XS__gmmove, file); - newXS(strcpy(buf, "gmsay"), XS__gmsay, file); - newXS(strcpy(buf, "has_zone_flag"), XS__has_zone_flag, file); - newXS(strcpy(buf, "incstat"), XS__incstat, file); - newXS(strcpy(buf, "isdisctome"), XS__isdisctome, file); - newXS(strcpy(buf, "isdooropen"), XS__isdooropen, file); - newXS(strcpy(buf, "istaskactive"), XS__istaskactive, file); - newXS(strcpy(buf, "istaskactivityactive"), XS__istaskactivityactive, file); - newXS(strcpy(buf, "istaskappropriate"), XS__istaskappropriate, file); - newXS(strcpy(buf, "istaskcompleted"), XS__istaskcompleted, file); - newXS(strcpy(buf, "istaskenabled"), XS__istaskenabled, file); - newXS(strcpy(buf, "itemlink"), XS__itemlink, file); - newXS(strcpy(buf, "lasttaskinset"), XS__lasttaskinset, file); - newXS(strcpy(buf, "level"), XS__level, file); - newXS(strcpy(buf, "me"), XS__me, file); - newXS(strcpy(buf, "modifynpcstat"), XS__ModifyNPCStat, file); - newXS(strcpy(buf, "movegrp"), XS__movegrp, file); - newXS(strcpy(buf, "movepc"), XS__movepc, file); - newXS(strcpy(buf, "moveto"), XS__moveto, file); - newXS(strcpy(buf, "nexttaskinset"), XS__nexttaskinset, file); - newXS(strcpy(buf, "npcfeature"), XS__npcfeature, file); - newXS(strcpy(buf, "npcgender"), XS__npcgender, file); - newXS(strcpy(buf, "npcrace"), XS__npcrace, file); - newXS(strcpy(buf, "npcsize"), XS__npcsize, file); - newXS(strcpy(buf, "npctexture"), XS__npctexture, file); - newXS(strcpy(buf, "pause"), XS__pause, file); - newXS(strcpy(buf, "permaclass"), XS__permaclass, file); - newXS(strcpy(buf, "permagender"), XS__permagender, file); - newXS(strcpy(buf, "permarace"), XS__permarace, file); - newXS(strcpy(buf, "playerfeature"), XS__playerfeature, file); - newXS(strcpy(buf, "playergender"), XS__playergender, file); - newXS(strcpy(buf, "playerrace"), XS__playerrace, file); - newXS(strcpy(buf, "playersize"), XS__playersize, file); - newXS(strcpy(buf, "playertexture"), XS__playertexture, file); - newXS(strcpy(buf, "popup"), XS__popup, file); - newXS(strcpy(buf, "pvp"), XS__pvp, file); - newXS(strcpy(buf, "qs_player_event"), XS__qs_player_event, file); - newXS(strcpy(buf, "qs_send_query"), XS__qs_send_query, file); - newXS(strcpy(buf, "rain"), XS__rain, file); - newXS(strcpy(buf, "rebind"), XS__rebind, file); - newXS(strcpy(buf, "reloadzonestaticdata"), XS__reloadzonestaticdata, file); - newXS(strcpy(buf, "removetitle"), XS__removetitle, file); - newXS(strcpy(buf, "repopzone"), XS__repopzone, file); - newXS(strcpy(buf, "resettaskactivity"), XS__resettaskactivity, file); - newXS(strcpy(buf, "respawn"), XS__respawn, file); - newXS(strcpy(buf, "resume"), XS__resume, file); - newXS(strcpy(buf, "safemove"), XS__safemove, file); - newXS(strcpy(buf, "save"), XS__save, file); - newXS(strcpy(buf, "say"), XS__say, file); - newXS(strcpy(buf, "saylink"), XS__saylink, file); - newXS(strcpy(buf, "scribespells"), XS__scribespells, file); - newXS(strcpy(buf, "selfcast"), XS__selfcast, file); - newXS(strcpy(buf, "set_proximity"), XS__set_proximity, file); - newXS(strcpy(buf, "set_zone_flag"), XS__set_zone_flag, file); - newXS(strcpy(buf, "setallskill"), XS__setallskill, file); - newXS(strcpy(buf, "setanim"), XS__setanim, file); - newXS(strcpy(buf, "setglobal"), XS__setglobal, file); - newXS(strcpy(buf, "setguild"), XS__setguild, file); - newXS(strcpy(buf, "sethp"), XS__sethp, file); - newXS(strcpy(buf, "setlanguage"), XS__setlanguage, file); - newXS(strcpy(buf, "setnexthpevent"), XS__setnexthpevent, file); - newXS(strcpy(buf, "setnextinchpevent"), XS__setnextinchpevent, file); - newXS(strcpy(buf, "setskill"), XS__setskill, file); - newXS(strcpy(buf, "setsky"), XS__setsky, file); - newXS(strcpy(buf, "setstat"), XS__setstat, file); - newXS(strcpy(buf, "settarget"), XS__settarget, file); - newXS(strcpy(buf, "settime"), XS__settime, file); - newXS(strcpy(buf, "settimer"), XS__settimer, file); - newXS(strcpy(buf, "settimerMS"), XS__settimerMS, file); - newXS(strcpy(buf, "sfollow"), XS__sfollow, file); - newXS(strcpy(buf, "shout"), XS__shout, file); - newXS(strcpy(buf, "shout2"), XS__shout2, file); - newXS(strcpy(buf, "showgrid"), XS__showgrid, file); - newXS(strcpy(buf, "signal"), XS__signal, file); - newXS(strcpy(buf, "signalwith"), XS__signalwith, file); - newXS(strcpy(buf, "snow"), XS__snow, file); - newXS(strcpy(buf, "spawn"), XS__spawn, file); - newXS(strcpy(buf, "spawn2"), XS__spawn2, file); - newXS(strcpy(buf, "spawn_condition"), XS__spawn_condition, file); - newXS(strcpy(buf, "spawn_from_spawn2"), XS__spawn_from_spawn2, file); - newXS(strcpy(buf, "start"), XS__start, file); - newXS(strcpy(buf, "stop"), XS__stop, file); - newXS(strcpy(buf, "stopalltimers"), XS__stopalltimers, file); - newXS(strcpy(buf, "stoptimer"), XS__stoptimer, file); - newXS(strcpy(buf, "summonallplayercorpses"), XS__summonallplayercorpses, file); - newXS(strcpy(buf, "summonburiedplayercorpse"), XS__summonburiedplayercorpse, file); - newXS(strcpy(buf, "summonitem"), XS__summonitem, file); - newXS(strcpy(buf, "surname"), XS__surname, file); - newXS(strcpy(buf, "targlobal"), XS__targlobal, file); - newXS(strcpy(buf, "taskexploredarea"), XS__taskexploredarea, file); - newXS(strcpy(buf, "taskselector"), XS__taskselector, file); - newXS(strcpy(buf, "task_setselector"), XS__task_setselector, file); - newXS(strcpy(buf, "tasktimeleft"), XS__tasktimeleft, file); - newXS(strcpy(buf, "toggle_spawn_event"), XS__toggle_spawn_event, file); - newXS(strcpy(buf, "toggledoorstate"), XS__toggledoorstate, file); - newXS(strcpy(buf, "traindisc"), XS__traindisc, file); - newXS(strcpy(buf, "traindiscs"), XS__traindiscs, file); - newXS(strcpy(buf, "unique_spawn"), XS__unique_spawn, file); - newXS(strcpy(buf, "unscribespells"), XS__unscribespells, file); - newXS(strcpy(buf, "untraindiscs"), XS__untraindiscs, file); - newXS(strcpy(buf, "updatespawntimer"), XS__UpdateSpawnTimer, file); - newXS(strcpy(buf, "updatetaskactivity"), XS__updatetaskactivity, file); - newXS(strcpy(buf, "UpdateZoneHeader"), XS__UpdateZoneHeader, file); - newXS(strcpy(buf, "varlink"), XS__varlink, file); - newXS(strcpy(buf, "voicetell"), XS__voicetell, file); - newXS(strcpy(buf, "we"), XS__we, file); - newXS(strcpy(buf, "wearchange"), XS__wearchange, file); - newXS(strcpy(buf, "write"), XS__write, file); - newXS(strcpy(buf, "ze"), XS__ze, file); - newXS(strcpy(buf, "zone"), XS__zone, file); + newXS(strcpy(buf, "AssignGroupToInstance"), XS__AssignGroupToInstance, file); + newXS(strcpy(buf, "AssignRaidToInstance"), XS__AssignRaidToInstance, file); + newXS(strcpy(buf, "AssignToInstance"), XS__AssignToInstance, file); + newXS(strcpy(buf, "ChooseRandom"), XS__ChooseRandom, file); + newXS(strcpy(buf, "CreateInstance"), XS__CreateInstance, file); + newXS(strcpy(buf, "DestroyInstance"), XS__DestroyInstance, file); + newXS(strcpy(buf, "UpdateInstanceTimer"), XS__UpdateInstanceTimer, file); + newXS(strcpy(buf, "GetInstanceTimer"), XS__GetInstanceTimer, file); + newXS(strcpy(buf, "GetInstanceTimerByID"), XS__GetInstanceTimerByID, file); + newXS(strcpy(buf, "FlagInstanceByGroupLeader"), XS__FlagInstanceByGroupLeader, file); + newXS(strcpy(buf, "FlagInstanceByRaidLeader"), XS__FlagInstanceByRaidLeader, file); + newXS(strcpy(buf, "FlyMode"), XS__FlyMode, file); + newXS(strcpy(buf, "GetCharactersInInstance"), XS__GetCharactersInInstance, file); + newXS(strcpy(buf, "GetInstanceID"), XS__GetInstanceID, file); + newXS(strcpy(buf, "GetSpellResistType"), XS__GetSpellResistType, file); + newXS(strcpy(buf, "GetSpellTargetType"), XS__GetSpellTargetType, file); + newXS(strcpy(buf, "GetTimeSeconds"), XS__GetTimeSeconds, file); + newXS(strcpy(buf, "GetZoneID"), XS__GetZoneID, file); + newXS(strcpy(buf, "GetZoneLongName"), XS__GetZoneLongName, file); + newXS(strcpy(buf, "IsBeneficialSpell"), XS__IsBeneficialSpell, file); + newXS(strcpy(buf, "IsEffectInSpell"), XS__IsEffectInSpell, file); + newXS(strcpy(buf, "IsRunning"), XS__IsRunning, file); + newXS(strcpy(buf, "LearnRecipe"), XS__LearnRecipe, file); + newXS(strcpy(buf, "MerchantCountItem"), XS__MerchantCountItem, file); + newXS(strcpy(buf, "MerchantSetItem"), XS__MerchantSetItem, file); + newXS(strcpy(buf, "MovePCInstance"), XS__MovePCInstance, file); + newXS(strcpy(buf, "RemoveAllFromInstance"), XS__RemoveAllFromInstance, file); + newXS(strcpy(buf, "RemoveFromInstance"), XS__RemoveFromInstance, file); + newXS(strcpy(buf, "SendMail"), XS__SendMail, file); + newXS(strcpy(buf, "SetRunning"), XS__SetRunning, file); + newXS(strcpy(buf, "activespeakactivity"), XS__activespeakactivity, file); + newXS(strcpy(buf, "activespeaktask"), XS__activespeaktask, file); + newXS(strcpy(buf, "activetasksinset"), XS__activetasksinset, file); + newXS(strcpy(buf, "addldonloss"), XS__addldonpoints, file); + newXS(strcpy(buf, "addldonpoints"), XS__addldonpoints, file); + newXS(strcpy(buf, "addldonwin"), XS__addldonpoints, file); + newXS(strcpy(buf, "addloot"), XS__addloot, file); + newXS(strcpy(buf, "addskill"), XS__addskill, file); + newXS(strcpy(buf, "assigntask"), XS__assigntask, file); + newXS(strcpy(buf, "attack"), XS__attack, file); + newXS(strcpy(buf, "attacknpc"), XS__attacknpc, file); + newXS(strcpy(buf, "attacknpctype"), XS__attacknpctype, file); + newXS(strcpy(buf, "buryplayercorpse"), XS__buryplayercorpse, file); + newXS(strcpy(buf, "castspell"), XS__castspell, file); + newXS(strcpy(buf, "changedeity"), XS__changedeity, file); + newXS(strcpy(buf, "checktitle"), XS__checktitle, file); + newXS(strcpy(buf, "clear_npctype_cache"), XS__clear_npctype_cache, file); + newXS(strcpy(buf, "clear_proximity"), XS__clear_proximity, file); + newXS(strcpy(buf, "clear_zone_flag"), XS__clear_zone_flag, file); + newXS(strcpy(buf, "clearspawntimers"), XS__clearspawntimers, file); + newXS(strcpy(buf, "collectitems"), XS__collectitems, file); + newXS(strcpy(buf, "completedtasksinset"), XS__completedtasksinset, file); + newXS(strcpy(buf, "createdoor"), XS__CreateDoor, file); + newXS(strcpy(buf, "creategroundobject"), XS__CreateGroundObject, file); + newXS(strcpy(buf, "creategroundobjectfrommodel"), XS__CreateGroundObjectFromModel, file); + newXS(strcpy(buf, "createguild"), XS__createguild, file); + newXS(strcpy(buf, "crosszonemessageplayerbyname"), XS__crosszonemessageplayerbyname, file); + newXS(strcpy(buf, "crosszonesetentityvariablebynpctypeid"), XS__crosszonesetentityvariablebynpctypeid, file); + newXS(strcpy(buf, "crosszonesetentityvariablebyclientname"), XS__crosszonesetentityvariablebyclientname, file); + newXS(strcpy(buf, "crosszonesignalclientbycharid"), XS__crosszonesignalclientbycharid, file); + newXS(strcpy(buf, "crosszonesignalclientbyname"), XS__crosszonesignalclientbyname, file); + newXS(strcpy(buf, "crosszonesignalnpcbynpctypeid"), XS__crosszonesignalnpcbynpctypeid, file); + newXS(strcpy(buf, "worldwidemarquee"), XS__worldwidemarquee, file); + newXS(strcpy(buf, "debug"), XS__debug, file); + newXS(strcpy(buf, "delglobal"), XS__delglobal, file); + newXS(strcpy(buf, "depop"), XS__depop, file); + newXS(strcpy(buf, "depop_withtimer"), XS__depop_withtimer, file); + newXS(strcpy(buf, "depopall"), XS__depopall, file); + newXS(strcpy(buf, "depopzone"), XS__depopzone, file); + newXS(strcpy(buf, "ding"), XS__ding, file); + newXS(strcpy(buf, "disable_proximity_say"), XS__disable_proximity_say, file); + newXS(strcpy(buf, "disable_spawn2"), XS__disable_spawn2, file); + newXS(strcpy(buf, "disablerecipe"), XS__disablerecipe, file); + newXS(strcpy(buf, "disabletask"), XS__disabletask, file); + newXS(strcpy(buf, "doanim"), XS__doanim, file); + newXS(strcpy(buf, "echo"), XS__echo, file); + newXS(strcpy(buf, "emote"), XS__emote, file); + newXS(strcpy(buf, "enable_proximity_say"), XS__enable_proximity_say, file); + newXS(strcpy(buf, "enable_spawn2"), XS__enable_spawn2, file); + newXS(strcpy(buf, "enabledtaskcount"), XS__enabledtaskcount, file); + newXS(strcpy(buf, "enablerecipe"), XS__enablerecipe, file); + newXS(strcpy(buf, "enabletask"), XS__enabletask, file); + newXS(strcpy(buf, "enabletitle"), XS__enabletitle, file); + newXS(strcpy(buf, "exp"), XS__exp, file); + newXS(strcpy(buf, "faction"), XS__faction, file); + newXS(strcpy(buf, "factionvalue"), XS_FactionValue, file); + newXS(strcpy(buf, "failtask"), XS__failtask, file); + newXS(strcpy(buf, "firsttaskinset"), XS__firsttaskinset, file); + newXS(strcpy(buf, "follow"), XS__follow, file); + newXS(strcpy(buf, "forcedoorclose"), XS__forcedoorclose, file); + newXS(strcpy(buf, "forcedooropen"), XS__forcedooropen, file); + newXS(strcpy(buf, "getItemName"), XS_qc_getItemName, file); + newXS(strcpy(buf, "get_spawn_condition"), XS__get_spawn_condition, file); + newXS(strcpy(buf, "getguildnamebyid"), XS__getguildnamebyid, file); + newXS(strcpy(buf, "getlevel"), XS__getlevel, file); + newXS(strcpy(buf, "getplayerburiedcorpsecount"), XS__getplayerburiedcorpsecount, file); + newXS(strcpy(buf, "gettaskactivitydonecount"), XS__gettaskactivitydonecount, file); + newXS(strcpy(buf, "givecash"), XS__givecash, file); + newXS(strcpy(buf, "gmmove"), XS__gmmove, file); + newXS(strcpy(buf, "gmsay"), XS__gmsay, file); + newXS(strcpy(buf, "has_zone_flag"), XS__has_zone_flag, file); + newXS(strcpy(buf, "incstat"), XS__incstat, file); + newXS(strcpy(buf, "isdisctome"), XS__isdisctome, file); + newXS(strcpy(buf, "isdooropen"), XS__isdooropen, file); + newXS(strcpy(buf, "istaskactive"), XS__istaskactive, file); + newXS(strcpy(buf, "istaskactivityactive"), XS__istaskactivityactive, file); + newXS(strcpy(buf, "istaskappropriate"), XS__istaskappropriate, file); + newXS(strcpy(buf, "istaskcompleted"), XS__istaskcompleted, file); + newXS(strcpy(buf, "istaskenabled"), XS__istaskenabled, file); + newXS(strcpy(buf, "itemlink"), XS__itemlink, file); + newXS(strcpy(buf, "lasttaskinset"), XS__lasttaskinset, file); + newXS(strcpy(buf, "level"), XS__level, file); + newXS(strcpy(buf, "me"), XS__me, file); + newXS(strcpy(buf, "modifynpcstat"), XS__ModifyNPCStat, file); + newXS(strcpy(buf, "movegrp"), XS__movegrp, file); + newXS(strcpy(buf, "movepc"), XS__movepc, file); + newXS(strcpy(buf, "moveto"), XS__moveto, file); + newXS(strcpy(buf, "nexttaskinset"), XS__nexttaskinset, file); + newXS(strcpy(buf, "npcfeature"), XS__npcfeature, file); + newXS(strcpy(buf, "npcgender"), XS__npcgender, file); + newXS(strcpy(buf, "npcrace"), XS__npcrace, file); + newXS(strcpy(buf, "npcsize"), XS__npcsize, file); + newXS(strcpy(buf, "npctexture"), XS__npctexture, file); + newXS(strcpy(buf, "pause"), XS__pause, file); + newXS(strcpy(buf, "permaclass"), XS__permaclass, file); + newXS(strcpy(buf, "permagender"), XS__permagender, file); + newXS(strcpy(buf, "permarace"), XS__permarace, file); + newXS(strcpy(buf, "playerfeature"), XS__playerfeature, file); + newXS(strcpy(buf, "playergender"), XS__playergender, file); + newXS(strcpy(buf, "playerrace"), XS__playerrace, file); + newXS(strcpy(buf, "playersize"), XS__playersize, file); + newXS(strcpy(buf, "playertexture"), XS__playertexture, file); + newXS(strcpy(buf, "popup"), XS__popup, file); + newXS(strcpy(buf, "pvp"), XS__pvp, file); + newXS(strcpy(buf, "qs_player_event"), XS__qs_player_event, file); + newXS(strcpy(buf, "qs_send_query"), XS__qs_send_query, file); + newXS(strcpy(buf, "rain"), XS__rain, file); + newXS(strcpy(buf, "rebind"), XS__rebind, file); + newXS(strcpy(buf, "reloadzonestaticdata"), XS__reloadzonestaticdata, file); + newXS(strcpy(buf, "removetitle"), XS__removetitle, file); + newXS(strcpy(buf, "repopzone"), XS__repopzone, file); + newXS(strcpy(buf, "resettaskactivity"), XS__resettaskactivity, file); + newXS(strcpy(buf, "respawn"), XS__respawn, file); + newXS(strcpy(buf, "resume"), XS__resume, file); + newXS(strcpy(buf, "safemove"), XS__safemove, file); + newXS(strcpy(buf, "save"), XS__save, file); + newXS(strcpy(buf, "say"), XS__say, file); + newXS(strcpy(buf, "saylink"), XS__saylink, file); + newXS(strcpy(buf, "scribespells"), XS__scribespells, file); + newXS(strcpy(buf, "selfcast"), XS__selfcast, file); + newXS(strcpy(buf, "set_proximity"), XS__set_proximity, file); + newXS(strcpy(buf, "set_zone_flag"), XS__set_zone_flag, file); + newXS(strcpy(buf, "setallskill"), XS__setallskill, file); + newXS(strcpy(buf, "setanim"), XS__setanim, file); + newXS(strcpy(buf, "setglobal"), XS__setglobal, file); + newXS(strcpy(buf, "setguild"), XS__setguild, file); + newXS(strcpy(buf, "sethp"), XS__sethp, file); + newXS(strcpy(buf, "setlanguage"), XS__setlanguage, file); + newXS(strcpy(buf, "setnexthpevent"), XS__setnexthpevent, file); + newXS(strcpy(buf, "setnextinchpevent"), XS__setnextinchpevent, file); + newXS(strcpy(buf, "setskill"), XS__setskill, file); + newXS(strcpy(buf, "setsky"), XS__setsky, file); + newXS(strcpy(buf, "setstat"), XS__setstat, file); + newXS(strcpy(buf, "settarget"), XS__settarget, file); + newXS(strcpy(buf, "settime"), XS__settime, file); + newXS(strcpy(buf, "settimer"), XS__settimer, file); + newXS(strcpy(buf, "settimerMS"), XS__settimerMS, file); + newXS(strcpy(buf, "sfollow"), XS__sfollow, file); + newXS(strcpy(buf, "shout"), XS__shout, file); + newXS(strcpy(buf, "shout2"), XS__shout2, file); + newXS(strcpy(buf, "showgrid"), XS__showgrid, file); + newXS(strcpy(buf, "signal"), XS__signal, file); + newXS(strcpy(buf, "signalwith"), XS__signalwith, file); + newXS(strcpy(buf, "snow"), XS__snow, file); + newXS(strcpy(buf, "spawn"), XS__spawn, file); + newXS(strcpy(buf, "spawn2"), XS__spawn2, file); + newXS(strcpy(buf, "spawn_condition"), XS__spawn_condition, file); + newXS(strcpy(buf, "spawn_from_spawn2"), XS__spawn_from_spawn2, file); + newXS(strcpy(buf, "start"), XS__start, file); + newXS(strcpy(buf, "stop"), XS__stop, file); + newXS(strcpy(buf, "stopalltimers"), XS__stopalltimers, file); + newXS(strcpy(buf, "stoptimer"), XS__stoptimer, file); + newXS(strcpy(buf, "summonallplayercorpses"), XS__summonallplayercorpses, file); + newXS(strcpy(buf, "summonburiedplayercorpse"), XS__summonburiedplayercorpse, file); + newXS(strcpy(buf, "summonitem"), XS__summonitem, file); + newXS(strcpy(buf, "surname"), XS__surname, file); + newXS(strcpy(buf, "targlobal"), XS__targlobal, file); + newXS(strcpy(buf, "taskexploredarea"), XS__taskexploredarea, file); + newXS(strcpy(buf, "taskselector"), XS__taskselector, file); + newXS(strcpy(buf, "task_setselector"), XS__task_setselector, file); + newXS(strcpy(buf, "tasktimeleft"), XS__tasktimeleft, file); + newXS(strcpy(buf, "toggle_spawn_event"), XS__toggle_spawn_event, file); + newXS(strcpy(buf, "toggledoorstate"), XS__toggledoorstate, file); + newXS(strcpy(buf, "traindisc"), XS__traindisc, file); + newXS(strcpy(buf, "traindiscs"), XS__traindiscs, file); + newXS(strcpy(buf, "unique_spawn"), XS__unique_spawn, file); + newXS(strcpy(buf, "unscribespells"), XS__unscribespells, file); + newXS(strcpy(buf, "untraindiscs"), XS__untraindiscs, file); + newXS(strcpy(buf, "updatespawntimer"), XS__UpdateSpawnTimer, file); + newXS(strcpy(buf, "updatetaskactivity"), XS__updatetaskactivity, file); + newXS(strcpy(buf, "UpdateZoneHeader"), XS__UpdateZoneHeader, file); + newXS(strcpy(buf, "varlink"), XS__varlink, file); + newXS(strcpy(buf, "voicetell"), XS__voicetell, file); + newXS(strcpy(buf, "we"), XS__we, file); + newXS(strcpy(buf, "wearchange"), XS__wearchange, file); + newXS(strcpy(buf, "write"), XS__write, file); + newXS(strcpy(buf, "ze"), XS__ze, file); + newXS(strcpy(buf, "zone"), XS__zone, file); - XSRETURN_YES; + XSRETURN_YES; } #endif From 3443d8eb25598e5ae4609bca5343ea0e6783e667 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 2 Jul 2018 01:03:02 -0500 Subject: [PATCH 32/33] Upload lua-doc-parser.pl --- utils/scripts/lua-doc-parser.pl | 225 +++++++++++++++++++++++++++++++ utils/scripts/perl-doc-parser.pl | 6 + zone/lua_client.cpp | 6 +- 3 files changed, 233 insertions(+), 4 deletions(-) create mode 100644 utils/scripts/lua-doc-parser.pl diff --git a/utils/scripts/lua-doc-parser.pl b/utils/scripts/lua-doc-parser.pl new file mode 100644 index 000000000..4a9e9862d --- /dev/null +++ b/utils/scripts/lua-doc-parser.pl @@ -0,0 +1,225 @@ +#!/usr/bin/perl + +# Author: Akkadius +# @file: lua-doc-parser.pl +# @description: Script meant to parse the source code to build the LUA API list + +use File::Find; +use Data::Dumper; + +sub usage() { + print "Usage:\n"; + print " --client - Prints methods for just client class methods\n"; + print " --mob - Prints methods for just mob class methods\n"; + print " --npc - Prints methods for just npc class methods\n"; + print " --entity - Prints methods for just entity class methods\n"; + print " --entity_list - Prints methods for just entity_list class methods\n"; + print " --door - Prints methods for just door class methods\n"; + print " --object - Prints methods for just object class methods\n"; + print " --group - Prints methods for just group class methods\n"; + print " --raid - Prints methods for just raid class methods\n"; + print " --item - Prints methods for just item class methods\n"; + print " --iteminst - Prints methods for just iteminst class methods\n"; + print " --inventory - Prints methods for just inventory class methods\n"; + print " --corpse - Prints methods for just corpse class methods\n"; + print " --hate_entry - Prints methods for just hate_entry class methods\n"; + print " --quest - Prints methods for just quest class methods\n"; + print " --spell - Prints methods for just spell class methods\n"; + print " --spawn - Prints methods for just spawn class methods\n"; + print " --packet - Prints methods for just packet class methods\n"; + print " --stat_bonuses - Prints methods for just stat_bonuses class methods\n"; + print " --all - Prints methods for all classes\n"; + exit(1); +} + +if($#ARGV < 0) { + usage(); +} + +my $export = $ARGV[0]; +$export=~s/--//g; + +my $export_file_search = $export; + +if ($export eq "quest") { + $export_file_search = "lua_general"; +} + +my @files; +my $start_dir = "zone/"; +find( + sub { push @files, $File::Find::name unless -d; }, + $start_dir +); +for my $file (@files) { + + #::: Skip non lua.cpp files + if($file!~/lua_/i || $file!~/cpp/i){ + next; + } + + #::: If we are specifying a specific class type, skip everything else + if ($export ne "all" && $export ne "") { + if ($file!~/$export_file_search\.cpp/i) { + next; + } + } + + @methods = (); + $split_key = ""; + $object_prefix = ""; + + #::: Client Export + if ($export=~/all|client/i && $file=~/_client/i) { + $split_key = "Client::"; + $object_prefix = "client:"; + } + + #::: Mob Export + if ($export=~/all|mob/i && $file=~/_mob/i) { + $split_key = "Mob::"; + $object_prefix = "mob:"; + } + + #::: NPC Export + if ($export=~/all|npc/i && $file=~/_npc/i) { + $split_key = "NPC::"; + $object_prefix = "npc:"; + } + + #::: Object Export + if ($export=~/all|object/i && $file=~/_object/i) { + $split_key = "Object::"; + $object_prefix = "object:"; + } + + #::: Door Export + if ($export=~/all|door/i && $file=~/_door/i) { + $split_key = "Door::"; + $object_prefix = "door:"; + } + + #::: Entity Export + if ($export=~/all|entity/i && $file=~/_entity/i) { + $split_key = "Entity::"; + $object_prefix = "entity:"; + } + + #::: Entity List Export + if ($export=~/all|entity_list/i && $file=~/_entity_list/i) { + $split_key = "EntityList::"; + $object_prefix = "entity_list:"; + } + + #::: Group + if ($export=~/all|group/i && $file=~/_group/i) { + $split_key = "Group::"; + $object_prefix = "group:"; + } + + #::: Raid + if ($export=~/all|raid/i && $file=~/_raid/i) { + $split_key = "Raid::"; + $object_prefix = "raid:"; + } + + #::: Corpse + if ($export=~/all|corpse/i && $file=~/_corpse/i) { + $split_key = "Corpse::"; + $object_prefix = "corpse:"; + } + + #::: Hateentry + if ($export=~/all|hate_entry/i && $file=~/_hate_entry/i) { + $split_key = "HateEntry::"; + $object_prefix = "hate_entry:"; + } + + #::: Spell + if ($export=~/all|spell/i && $file=~/_spell/i) { + $split_key = "Spell::"; + $object_prefix = "spell:"; + } + + #::: Spawn + if ($export=~/all|spawn/i && $file=~/_spawn/i) { + $split_key = "Spawn::"; + $object_prefix = "spawn:"; + } + + #::: StatBonuses + if ($export=~/all|stat_bonuses/i && $file=~/stat_bonuses/i) { + $split_key = "StatBonuses::"; + $object_prefix = "statbonuses:"; + } + + #::: Item + if ($export=~/all|item/i && $file=~/_item/i) { + $split_key = "Item::"; + $object_prefix = "item:"; + } + + #::: ItemInst + if ($export=~/all|iteminst/i && $file=~/_iteminst/i) { + $split_key = "ItemInst::"; + $object_prefix = "iteminst:"; + } + + #::: Inventory + if ($export=~/all|inventory/i && $file=~/_inventory/i) { + $split_key = "Inventory::"; + $object_prefix = "inventory:"; + } + + #::: Packet + if ($export=~/all|packet/i && $file=~/_packet/i) { + $split_key = "Packet::"; + $object_prefix = "packet:"; + } + + #::: Quest + if ($export=~/all|quest/i && $file=~/lua_general/i) { + $split_key = " lua_"; + $object_prefix = "eq."; + } + + #::: Open File + print "\nOpening '" . $file . "'\n"; + + if ($split_key eq "") { + next; + } + + open (FILE, $file); + while () { + chomp; + $line = $_; + + @data = split(" ", $line); + + if ((lc(substr($data[1], 0, 4)) eq "lua_") && $line!~/luabind/i && $line!~/return |#ifdef|struct /i) { + #::: Get return type + $return_type = trim($data[0]); + + @method_split = split($split_key, $line); + @method_end = split("{", $method_split[1]); + + $method = $object_prefix . trim($method_end[0]) . "; -- " . $return_type . "\n"; + + push @methods, $method; + } + } + + @methods = sort @methods; + foreach $method (@methods) { + print $method; + } +} + +#::: Trim Whitespaces +sub trim { + my $string = $_[0]; + $string =~ s/^\s+//; + $string =~ s/\s+$//; + return $string; +} \ No newline at end of file diff --git a/utils/scripts/perl-doc-parser.pl b/utils/scripts/perl-doc-parser.pl index 295ba96a4..30cf6e116 100755 --- a/utils/scripts/perl-doc-parser.pl +++ b/utils/scripts/perl-doc-parser.pl @@ -1,3 +1,9 @@ +#!/usr/bin/perl + +# Author: Akkadius +# @file: perl-doc-parser.pl +# @description: Script meant to parse the source code to build the Perl API list + use File::Find; use Data::Dumper; diff --git a/zone/lua_client.cpp b/zone/lua_client.cpp index 45ea8472e..7a8d954d8 100644 --- a/zone/lua_client.cpp +++ b/zone/lua_client.cpp @@ -725,14 +725,12 @@ void Lua_Client::SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug self->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5); } -void Lua_Client::SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, - bool attuned) { +void Lua_Client::SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, bool attuned) { Lua_Safe_Call_Void(); self->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, 0, attuned); } -void Lua_Client::SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, - bool attuned, int to_slot) { +void Lua_Client::SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, bool attuned, int to_slot) { Lua_Safe_Call_Void(); self->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, 0, attuned, to_slot); } From 2d7267cb4e612a9d5b835a1385d339946f7c95be Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 2 Jul 2018 01:15:00 -0500 Subject: [PATCH 33/33] Add file export to lua-api.md --- utils/scripts/lua-doc-parser.pl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/utils/scripts/lua-doc-parser.pl b/utils/scripts/lua-doc-parser.pl index 4a9e9862d..a5608944a 100644 --- a/utils/scripts/lua-doc-parser.pl +++ b/utils/scripts/lua-doc-parser.pl @@ -36,6 +36,10 @@ if($#ARGV < 0) { usage(); } +#::: Open File +my $filename = 'lua-api.md'; +open(my $fh, '>', $filename) or die "Could not open file '$filename' $!"; + my $export = $ARGV[0]; $export=~s/--//g; @@ -210,12 +214,24 @@ for my $file (@files) { } } + #::: Header + $header = $split_key; + $header =~s/:://g; + + print $fh "# " . $header . "\n"; + print $fh "```lua\n"; + @methods = sort @methods; foreach $method (@methods) { + print $fh $method; print $method; } + + print $fh "```\n\n"; } +close $fh; + #::: Trim Whitespaces sub trim { my $string = $_[0];