diff --git a/common/spdat.h b/common/spdat.h index 4b02ad7e2..c2445a89a 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -603,103 +603,103 @@ typedef enum { // struct SPDat_Spell_Struct { -/* 000 */ int id; // not used -/* 001 */ char name[64]; // Name of the spell -/* 002 */ char player_1[32]; // "PLAYER_1" -/* 003 */ char teleport_zone[64]; // Teleport zone, pet name summoned, or item summoned -/* 004 */ char you_cast[64]; // Message when you cast -/* 005 */ char other_casts[64]; // Message when other casts -/* 006 */ char cast_on_you[64]; // Message when spell is cast on you -/* 007 */ char cast_on_other[64]; // Message when spell is cast on someone else -/* 008 */ char spell_fades[64]; // Spell fades -/* 009 */ float range; -/* 010 */ float aoerange; -/* 011 */ float pushback; -/* 012 */ float pushup; -/* 013 */ uint32 cast_time; // Cast time -/* 014 */ uint32 recovery_time; // Recovery time -/* 015 */ uint32 recast_time; // Recast same spell time -/* 016 */ uint32 buffdurationformula; -/* 017 */ uint32 buffduration; -/* 018 */ uint32 AEDuration; // sentinel, rain of something -/* 019 */ uint16 mana; // Mana Used -/* 020 */ int base[EFFECT_COUNT]; //various purposes -/* 032 */ int base2[EFFECT_COUNT]; //various purposes -/* 044 */ int16 max[EFFECT_COUNT]; +/* 000 */ int id; // not used +/* 001 */ char name[64]; // Name of the spell +/* 002 */ char player_1[32]; // "PLAYER_1" +/* 003 */ char teleport_zone[64]; // Teleport zone, pet name summoned, or item summoned +/* 004 */ char you_cast[64]; // Message when you cast +/* 005 */ char other_casts[64]; // Message when other casts +/* 006 */ char cast_on_you[64]; // Message when spell is cast on you +/* 007 */ char cast_on_other[64]; // Message when spell is cast on someone else +/* 008 */ char spell_fades[64]; // Spell fades +/* 009 */ float range; +/* 010 */ float aoerange; +/* 011 */ float pushback; +/* 012 */ float pushup; +/* 013 */ uint32 cast_time; // Cast time +/* 014 */ uint32 recovery_time; // Recovery time +/* 015 */ uint32 recast_time; // Recast same spell time +/* 016 */ uint32 buffdurationformula; +/* 017 */ uint32 buffduration; +/* 018 */ uint32 AEDuration; // sentinel, rain of something +/* 019 */ uint16 mana; // Mana Used +/* 020 */ int base[EFFECT_COUNT]; //various purposes +/* 032 */ int base2[EFFECT_COUNT]; //various purposes +/* 044 */ int16 max[EFFECT_COUNT]; /* 056 */ //uint16 icon; // Spell icon /* 057 */ //uint16 memicon; // Icon on membarthing -/* 058 */ int32 components[4]; // reagents -/* 062 */ int component_counts[4]; // amount of regents used -/* 066 */ int NoexpendReagent[4]; // focus items (Need but not used; Flame Lick has a Fire Beetle Eye focus.) +/* 058 */ int32 components[4]; // reagents +/* 062 */ int component_counts[4]; // amount of regents used +/* 066 */ int NoexpendReagent[4]; // focus items (Need but not used; Flame Lick has a Fire Beetle Eye focus.) // If it is a number between 1-4 it means components[number] is a focus and not to expend it // If it is a valid itemid it means this item is a focus as well -/* 070 */ uint16 formula[EFFECT_COUNT]; // Spell's value formula +/* 070 */ uint16 formula[EFFECT_COUNT]; // Spell's value formula /* 082 */ //int LightType; // probaly another effecttype flag /* 083 */ int8 goodEffect; //0=detrimental, 1=Beneficial, 2=Beneficial, Group Only -/* 084 */ int Activated; // probaly another effecttype flag -/* 085 */ int resisttype; -/* 086 */ int effectid[EFFECT_COUNT]; // Spell's effects -/* 098 */ SpellTargetType targettype; // Spell's Target -/* 099 */ int basediff; // base difficulty fizzle adjustment -/* 100 */ SkillType skill; +/* 084 */ int Activated; // probably another effecttype flag +/* 085 */ int resisttype; +/* 086 */ int effectid[EFFECT_COUNT]; // Spell's effects +/* 098 */ SpellTargetType targettype; // Spell's Target +/* 099 */ int basediff; // base difficulty fizzle adjustment +/* 100 */ SkillType skill; /* 101 */ int8 zonetype; // 01=Outdoors, 02=dungeons, ff=Any /* 102 */ int8 EnvironmentType; /* 103 */ int8 TimeOfDay; -/* 104 */ uint8 classes[PLAYER_CLASS_COUNT]; // Classes, and their min levels -/* 120 */ uint8 CastingAnim; +/* 104 */ uint8 classes[PLAYER_CLASS_COUNT]; // Classes, and their min levels +/* 120 */ uint8 CastingAnim; /* 121 */ //uint8 TargetAnim; /* 122 */ //uint32 TravelType; -/* 123 */ uint16 SpellAffectIndex; +/* 123 */ uint16 SpellAffectIndex; /* 124 */ int8 disallow_sit; // 124: high-end Yaulp spells (V, VI, VII, VIII [Rk 1, 2, & 3], & Gallenite's Bark of Fury /* 125 */ // 125: Words of the Skeptic -/* 126 */ int8 deities[16]; // Deity check. 201 - 216 per http://www.eqemulator.net/wiki/wikka.php?wakka=DeityList +/* 126 */ int8 deities[16]; // Deity check. 201 - 216 per http://www.eqemulator.net/wiki/wikka.php?wakka=DeityList // -1: Restrict to Deity; 1: Restrict to Deity, but only used on non-Live (Test Server "Blessing of ...") spells; 0: Don't restrict /* 142 */ // 142: between 0 & 100 // 143: always set to 0 /* 144 */ //int16 new_icon // Spell icon used by the client in uifiles/default/spells??.tga, both for spell gems & buff window. Looks to depreciate icon & memicon /* 145 */ //int16 spellanim; // Doesn't look like it's the same as #doanim, so not sure what this is -/* 146 */ int8 uninterruptable; // Looks like anything != 0 is uninterruptable. Values are mostly -1, 0, & 1 (Fetid Breath = 90?) -/* 147 */ int16 ResistDiff; +/* 146 */ int8 uninterruptable; // Looks like anything != 0 is uninterruptable. Values are mostly -1, 0, & 1 (Fetid Breath = 90?) +/* 147 */ int16 ResistDiff; /* 148 */ //int dot_stacking_exempt; /* 149 */ //int deletable; /* 150 */ uint16 RecourseLink; /* 151 */ // 151: -1, 0, or 1 // 152 & 153: all set to 0 -/* 154 */ int8 short_buff_box; // != 0, goes to short buff box. -/* 155 */ int descnum; // eqstr of description of spell +/* 154 */ int8 short_buff_box; // != 0, goes to short buff box. +/* 155 */ int descnum; // eqstr of description of spell /* 156 */ //int typedescnum; // eqstr of type description -/* 157 */ int effectdescnum; // eqstr of effect description +/* 157 */ int effectdescnum; // eqstr of effect description /* 158 */ -/* 162 */ int bonushate; +/* 162 */ int bonushate; /* 163 */ -/* 166 */ int EndurCost; +/* 166 */ int EndurCost; /* 167 */ int8 EndurTimerIndex; /* 168 */ //int IsDisciplineBuff; //Will goto the combat window when cast /* 169 */ -/* 173 */ int HateAdded; -/* 174 */ int EndurUpkeep; +/* 173 */ int HateAdded; +/* 174 */ int EndurUpkeep; /* 175 */ -/* 176 */ int numhits; -/* 177 */ int pvpresistbase; -/* 178 */ int pvpresistcalc; -/* 179 */ int pvpresistcap; -/* 180 */ int spell_category; +/* 176 */ int numhits; +/* 177 */ int pvpresistbase; +/* 178 */ int pvpresistcalc; +/* 179 */ int pvpresistcap; +/* 180 */ int spell_category; /* 181 */ /* 185 */ int8 can_mgb; // 0=no, -1 or 1 = yes -/* 186 */ int dispel_flag; -/* 189 */ int MinResist; -/* 190 */ int MaxResist; +/* 186 */ int dispel_flag; +/* 189 */ int MinResist; +/* 190 */ int MaxResist; /* 191 */ uint8 viral_targets; /* 192 */ uint8 viral_timer; -/* 193 */ int NimbusEffect; -/* 194 */ float directional_start; -/* 195 */ float directional_end; -/* 207 */ int spellgroup; -/* 209 */ int powerful_flag; // Need more investigation to figure out what to call this, for now we know -1 makes charm spells not break before their duration is complete, it does alot more though -/* 211 */ int CastRestriction; //Various restriction categories for spells most seem targetable race related but have also seen others for instance only castable if target hp 20% or lower or only if target out of combat -/* 212 */ bool AllowRest; +/* 193 */ int NimbusEffect; +/* 194 */ float directional_start; +/* 195 */ float directional_end; +/* 207 */ int spellgroup; +/* 209 */ int powerful_flag; // Need more investigation to figure out what to call this, for now we know -1 makes charm spells not break before their duration is complete, it does alot more though +/* 211 */ int CastRestriction; //Various restriction categories for spells most seem targetable race related but have also seen others for instance only castable if target hp 20% or lower or only if target out of combat +/* 212 */ bool AllowRest; /* 219 */ //int maxtargets; // not in DB yet, is used for beam and ring spells for target # limits - uint8 DamageShieldType; // This field does not exist in spells_us.txt + uint8 DamageShieldType; // This field does not exist in spells_us.txt }; extern const SPDat_Spell_Struct* spells; diff --git a/zone/CMakeLists.txt b/zone/CMakeLists.txt index 46f03c570..cbfacb814 100644 --- a/zone/CMakeLists.txt +++ b/zone/CMakeLists.txt @@ -31,16 +31,22 @@ SET(zone_sources horse.cpp inventory.cpp loottables.cpp + lua_corpse.cpp lua_client.cpp + lua_door.cpp lua_entity.cpp + lua_entity_list.cpp lua_general.cpp + lua_group.cpp lua_hate_entry.cpp lua_item.cpp lua_iteminst.cpp lua_mob.cpp lua_npc.cpp + lua_object.cpp lua_parser.cpp lua_parser_events.cpp + lua_raid.cpp lua_spell.cpp embperl.cpp embxs.cpp @@ -134,10 +140,12 @@ SET(zone_headers hate_list.h horse.h lua_client.h + lua_corpse.h lua_entity.h + lua_entity_list.h lua_general.h + lua_group.h lua_hate_entry.h - lua_hate_list.h lua_item.h lua_iteminst.h lua_mob.h @@ -145,6 +153,7 @@ SET(zone_headers lua_parser.h lua_parser_events.h lua_ptr.h + lua_raid.h lua_spell.h map.h masterentity.h diff --git a/zone/entity.cpp b/zone/entity.cpp index fc29314ce..62df187cf 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -2104,7 +2104,7 @@ Group* EntityList::GetGroupByMob(Mob* mob) return 0; } -Group* EntityList::GetGroupByLeaderName(char* leader){ +Group* EntityList::GetGroupByLeaderName(const char* leader){ std::list::iterator iterator; iterator = group_list.begin(); diff --git a/zone/entity.h b/zone/entity.h index c646317e8..492501bb0 100644 --- a/zone/entity.h +++ b/zone/entity.h @@ -151,7 +151,7 @@ public: Group* GetGroupByMob(Mob* mob); Group* GetGroupByClient(Client* client); Group* GetGroupByID(uint32 id); - Group* GetGroupByLeaderName(char* leader); + Group* GetGroupByLeaderName(const char* leader); Raid* GetRaidByMob(Mob* mob); Raid* GetRaidByClient(Client* client); Raid* GetRaidByID(uint32 id); diff --git a/zone/lua_client.cpp b/zone/lua_client.cpp index 8c5121434..f46603b7f 100644 --- a/zone/lua_client.cpp +++ b/zone/lua_client.cpp @@ -9,6 +9,8 @@ #include "lua_npc.h" #include "lua_item.h" #include "lua_iteminst.h" +#include "lua_group.h" +#include "lua_raid.h" #include "../common/item.h" struct InventoryWhere { }; @@ -881,7 +883,7 @@ int Lua_Client::GetLDoNLossesTheme(int theme) { } Lua_ItemInst Lua_Client::GetItemAt(int slot) { - Lua_Safe_Call_ItemInst(); + Lua_Safe_Call_Class(Lua_ItemInst); return Lua_ItemInst(self->GetInv().GetItem(slot)); } @@ -1150,6 +1152,16 @@ std::string Lua_Client::GetAccountFlag(std::string flag) { return self->GetAccountFlag(flag); } +Lua_Group Lua_Client::GetGroup() { + Lua_Safe_Call_Class(Lua_Group); + return Lua_Group(self->GetGroup()); +} + +Lua_Raid Lua_Client::GetRaid() { + Lua_Safe_Call_Class(Lua_Raid); + return Lua_Raid(self->GetRaid()); +} + luabind::scope lua_register_client() { return luabind::class_("Client") .def(luabind::constructor<>()) @@ -1379,7 +1391,9 @@ luabind::scope lua_register_client() { .def("SendWebLink", (void(Lua_Client::*)(const char *))&Lua_Client::SendWebLink) .def("HasSpellScribed", (bool(Lua_Client::*)(int))&Lua_Client::HasSpellScribed) .def("SetAccountFlag", (void(Lua_Client::*)(std::string,std::string))&Lua_Client::SetAccountFlag) - .def("GetAccountFlag", (std::string(Lua_Client::*)(std::string))&Lua_Client::GetAccountFlag); + .def("GetAccountFlag", (std::string(Lua_Client::*)(std::string))&Lua_Client::GetAccountFlag) + .def("GetGroup", (Lua_Group(Lua_Client::*)(void))&Lua_Client::GetGroup) + .def("GetRaid", (Lua_Raid(Lua_Client::*)(void))&Lua_Client::GetRaid); } luabind::scope lua_register_inventory_where() { diff --git a/zone/lua_client.h b/zone/lua_client.h index d642b152b..0c8d17e9a 100644 --- a/zone/lua_client.h +++ b/zone/lua_client.h @@ -5,6 +5,8 @@ #include "lua_mob.h" class Client; +class Lua_Group; +class Lua_Raid; namespace luabind { struct scope; @@ -259,12 +261,8 @@ public: bool HasSpellScribed(int spell_id); void SetAccountFlag(std::string flag, std::string val); std::string GetAccountFlag(std::string flag); - - /* - //unsup features Lua_Group GetGroup(); Lua_Raid GetRaid(); - */ }; #endif diff --git a/zone/lua_corpse.cpp b/zone/lua_corpse.cpp new file mode 100644 index 000000000..50a39c3cb --- /dev/null +++ b/zone/lua_corpse.cpp @@ -0,0 +1,17 @@ +#ifdef LUA_EQEMU + +#include "lua.hpp" +#include +#include + +#include "masterentity.h" +#include "lua_corpse.h" + +luabind::scope lua_register_corpse() { + return luabind::class_("Corpse") + .def(luabind::constructor<>()) + .property("null", &Lua_Corpse::Null) + .property("valid", &Lua_Corpse::Valid); +} + +#endif diff --git a/zone/lua_corpse.h b/zone/lua_corpse.h new file mode 100644 index 000000000..ae4aef9bf --- /dev/null +++ b/zone/lua_corpse.h @@ -0,0 +1,34 @@ +#ifndef EQEMU_LUA_CORPSE_H +#define EQEMU_LUA_CORPSE_H +#ifdef LUA_EQEMU + +#include "lua_mob.h" + +class Corpse; + +namespace luabind { + struct scope; +} + +luabind::scope lua_register_corpse(); + +class Lua_Corpse : public Lua_Mob +{ + typedef Corpse NativeType; +public: + Lua_Corpse() { } + Lua_Corpse(Corpse *d) { SetLuaPtrData(d); } + virtual ~Lua_Corpse() { } + + operator Corpse*() { + void *d = GetLuaPtrData(); + if(d) { + return reinterpret_cast(d); + } + + return nullptr; + } +}; + +#endif +#endif diff --git a/zone/lua_door.cpp b/zone/lua_door.cpp new file mode 100644 index 000000000..10b0fc6e7 --- /dev/null +++ b/zone/lua_door.cpp @@ -0,0 +1,17 @@ +#ifdef LUA_EQEMU + +#include "lua.hpp" +#include +#include + +#include "masterentity.h" +#include "lua_door.h" + +luabind::scope lua_register_door() { + return luabind::class_("Door") + .def(luabind::constructor<>()) + .property("null", &Lua_Door::Null) + .property("valid", &Lua_Door::Valid); +} + +#endif diff --git a/zone/lua_door.h b/zone/lua_door.h new file mode 100644 index 000000000..03e118f2a --- /dev/null +++ b/zone/lua_door.h @@ -0,0 +1,34 @@ +#ifndef EQEMU_LUA_DOOR_H +#define EQEMU_LUA_DOOR_H +#ifdef LUA_EQEMU + +#include "lua_entity.h" + +class Doors; + +namespace luabind { + struct scope; +} + +luabind::scope lua_register_door(); + +class Lua_Door : public Lua_Entity +{ + typedef Doors NativeType; +public: + Lua_Door() { } + Lua_Door(Doors *d) { SetLuaPtrData(d); } + virtual ~Lua_Door() { } + + operator Doors*() { + void *d = GetLuaPtrData(); + if(d) { + return reinterpret_cast(d); + } + + return nullptr; + } +}; + +#endif +#endif diff --git a/zone/lua_entity.cpp b/zone/lua_entity.cpp index 0923a6f8f..86e7e02c3 100644 --- a/zone/lua_entity.cpp +++ b/zone/lua_entity.cpp @@ -9,6 +9,9 @@ #include "lua_mob.h" #include "lua_client.h" #include "lua_npc.h" +#include "lua_corpse.h" +#include "lua_object.h" +#include "lua_door.h" bool Lua_Entity::IsClient() { Lua_Safe_Call_Bool(); @@ -88,6 +91,24 @@ Lua_Mob Lua_Entity::CastToMob() { return Lua_Mob(m); } +Lua_Corpse Lua_Entity::CastToCorpse() { + void *d = GetLuaPtrData(); + Corpse *m = reinterpret_cast(d); + return Lua_Corpse(m); +} + +Lua_Object Lua_Entity::CastToObject() { + void *d = GetLuaPtrData(); + Object *m = reinterpret_cast(d); + return Lua_Object(m); +} + +Lua_Door Lua_Entity::CastToDoor() { + void *d = GetLuaPtrData(); + Doors *m = reinterpret_cast(d); + return Lua_Door(m); +} + luabind::scope lua_register_entity() { return luabind::class_("Entity") .def(luabind::constructor<>()) @@ -107,7 +128,10 @@ luabind::scope lua_register_entity() { .def("GetID", &Lua_Entity::GetID) .def("CastToClient", &Lua_Entity::CastToClient) .def("CastToNPC", &Lua_Entity::CastToNPC) - .def("CastToMob", &Lua_Entity::CastToMob); + .def("CastToMob", &Lua_Entity::CastToMob) + .def("CastToCorpse", &Lua_Entity::CastToCorpse) + .def("CastToObject", &Lua_Entity::CastToObject) + .def("CastToDoor", &Lua_Entity::CastToDoor); } #endif diff --git a/zone/lua_entity.h b/zone/lua_entity.h index 984d5245f..b66a0cc56 100644 --- a/zone/lua_entity.h +++ b/zone/lua_entity.h @@ -11,6 +11,9 @@ class Lua_Mob; struct Lua_HateList; class Lua_Item; class Lua_ItemInst; +class Lua_Corpse; +class Lua_Object; +class Lua_Door; namespace luabind { struct scope; @@ -51,12 +54,9 @@ public: Lua_Client CastToClient(); Lua_NPC CastToNPC(); Lua_Mob CastToMob(); - //Lua_Merc CastToMerc(); - //Lua_Corpse CastToCorpse(); - //Lua_Object CastToObject(); - //Lua_Doors CastToDoors(); - //Lua_Trap CastToTrap(); - //Lua_Beacon CastToBeacon(); + Lua_Corpse CastToCorpse(); + Lua_Object CastToObject(); + Lua_Door CastToDoor(); }; #endif diff --git a/zone/lua_entity_list.cpp b/zone/lua_entity_list.cpp new file mode 100644 index 000000000..fda2f3124 --- /dev/null +++ b/zone/lua_entity_list.cpp @@ -0,0 +1,477 @@ +#ifdef LUA_EQEMU + +#include "lua.hpp" +#include +#include +#include + +#include "masterentity.h" +#include "lua_entity_list.h" +#include "lua_entity.h" +#include "lua_mob.h" +#include "lua_client.h" +#include "lua_npc.h" +#include "lua_object.h" +#include "lua_door.h" +#include "lua_corpse.h" +#include "lua_group.h" +#include "lua_raid.h" + +struct Lua_Mob_List { + std::vector entries; +}; + +struct Lua_NPC_List { + std::vector entries; +}; + +struct Lua_Client_List { + std::vector entries; +}; + +struct Lua_Corpse_List { + std::vector entries; +}; + +struct Lua_Object_List { + std::vector entries; +}; + +struct Lua_Doors_List { + std::vector entries; +}; + +Lua_Mob Lua_EntityList::GetMobID(int id) { + Lua_Safe_Call_Class(Lua_Mob); + return Lua_Mob(self->GetMobID(id)); +} + +Lua_Mob Lua_EntityList::GetMob(const char *name) { + Lua_Safe_Call_Class(Lua_Mob); + return Lua_Mob(self->GetMob(name)); +} + +Lua_Mob Lua_EntityList::GetMob(int id) { + Lua_Safe_Call_Class(Lua_Mob); + return Lua_Mob(self->GetMob(id)); +} + +Lua_Mob Lua_EntityList::GetMobByNpcTypeID(int npc_type) { + Lua_Safe_Call_Class(Lua_Mob); + return Lua_Mob(self->GetMobByNpcTypeID(npc_type)); +} + +Lua_NPC Lua_EntityList::GetNPCByID(int id) { + Lua_Safe_Call_Class(Lua_NPC); + return Lua_NPC(self->GetNPCByID(id)); +} + +Lua_NPC Lua_EntityList::GetNPCByNPCTypeID(int npc_type) { + Lua_Safe_Call_Class(Lua_NPC); + return Lua_NPC(self->GetNPCByNPCTypeID(npc_type)); +} + +Lua_Client Lua_EntityList::GetClientByName(const char *name) { + Lua_Safe_Call_Class(Lua_Client); + return Lua_Client(self->GetClientByName(name)); +} + +Lua_Client Lua_EntityList::GetClientByAccID(uint32 acct_id) { + Lua_Safe_Call_Class(Lua_Client); + return Lua_Client(self->GetClientByAccID(acct_id)); +} + +Lua_Client Lua_EntityList::GetClientByID(int id) { + Lua_Safe_Call_Class(Lua_Client); + return Lua_Client(self->GetClientByID(id)); +} + +Lua_Client Lua_EntityList::GetClientByCharID(uint32 char_id) { + Lua_Safe_Call_Class(Lua_Client); + return Lua_Client(self->GetClientByCharID(char_id)); +} + +Lua_Client Lua_EntityList::GetClientByWID(uint32 wid) { + Lua_Safe_Call_Class(Lua_Client); + return Lua_Client(self->GetClientByWID(wid)); +} + +Lua_Object Lua_EntityList::GetObjectByID(int id) { + Lua_Safe_Call_Class(Lua_Object); + return Lua_Object(self->GetObjectByID(id)); +} + +Lua_Object Lua_EntityList::GetObjectByDBID(uint32 db_id) { + Lua_Safe_Call_Class(Lua_Object); + return Lua_Object(self->GetObjectByDBID(db_id)); +} + +Lua_Door Lua_EntityList::GetDoorsByID(int id) { + Lua_Safe_Call_Class(Lua_Door); + return Lua_Door(self->GetDoorsByID(id)); +} + +Lua_Door Lua_EntityList::GetDoorsByDBID(uint32 db_id) { + Lua_Safe_Call_Class(Lua_Door); + return Lua_Door(self->GetDoorsByDBID(db_id)); +} + +Lua_Door Lua_EntityList::GetDoorsByDoorID(uint32 door_id) { + Lua_Safe_Call_Class(Lua_Door); + return Lua_Door(self->GetDoorsByDoorID(door_id)); +} + +Lua_Door Lua_EntityList::FindDoor(uint32 id) { + Lua_Safe_Call_Class(Lua_Door); + return Lua_Door(self->FindDoor(id)); +} + +Lua_Group Lua_EntityList::GetGroupByMob(Lua_Mob mob) { + Lua_Safe_Call_Class(Lua_Group); + return Lua_Group(self->GetGroupByMob(mob)); +} + +Lua_Group Lua_EntityList::GetGroupByClient(Lua_Client client) { + Lua_Safe_Call_Class(Lua_Group); + return Lua_Group(self->GetGroupByClient(client)); +} + +Lua_Group Lua_EntityList::GetGroupByID(int id) { + Lua_Safe_Call_Class(Lua_Group); + return Lua_Group(self->GetGroupByID(id)); +} + +Lua_Group Lua_EntityList::GetGroupByLeaderName(const char *name) { + Lua_Safe_Call_Class(Lua_Group); + return Lua_Group(self->GetGroupByLeaderName(name)); +} + +Lua_Raid Lua_EntityList::GetRaidByID(int id) { + Lua_Safe_Call_Class(Lua_Raid); + return Lua_Raid(self->GetRaidByID(id)); +} + +Lua_Raid Lua_EntityList::GetRaidByClient(Lua_Client client) { + Lua_Safe_Call_Class(Lua_Raid); + return Lua_Raid(self->GetRaidByClient(client)); +} + +Lua_Corpse Lua_EntityList::GetCorpseByOwner(Lua_Client client) { + Lua_Safe_Call_Class(Lua_Corpse); + return Lua_Corpse(self->GetCorpseByOwner(client)); +} + +Lua_Corpse Lua_EntityList::GetCorpseByID(int id) { + Lua_Safe_Call_Class(Lua_Corpse); + return Lua_Corpse(self->GetCorpseByID(id)); +} + +Lua_Corpse Lua_EntityList::GetCorpseByName(const char *name) { + Lua_Safe_Call_Class(Lua_Corpse); + return Lua_Corpse(self->GetCorpseByName(name)); +} + +void Lua_EntityList::ClearClientPetitionQueue() { + Lua_Safe_Call_Void(); + self->ClearClientPetitionQueue(); +} + +bool Lua_EntityList::CanAddHateForMob(Lua_Mob p) { + Lua_Safe_Call_Bool(); + return self->CanAddHateForMob(p); +} + +void Lua_EntityList::Message(uint32 guild_dbid, uint32 type, const char *message) { + Lua_Safe_Call_Void(); + self->Message(guild_dbid, type, message); +} + +void Lua_EntityList::MessageStatus(uint32 guild_dbid, int min_status, uint32 type, const char *message) { + Lua_Safe_Call_Void(); + self->MessageStatus(guild_dbid, min_status, type, message); +} + +void Lua_EntityList::MessageClose(Lua_Mob sender, bool skip_sender, float dist, uint32 type, const char *message) { + Lua_Safe_Call_Void(); + self->MessageClose(sender, skip_sender, dist, type, message); +} + +void Lua_EntityList::RemoveFromTargets(Lua_Mob mob) { + Lua_Safe_Call_Void(); + self->RemoveFromTargets(mob); +} + +void Lua_EntityList::ReplaceWithTarget(Lua_Mob target, Lua_Mob new_target) { + Lua_Safe_Call_Void(); + self->ReplaceWithTarget(target, new_target); +} + +void Lua_EntityList::OpenDoorsNear(Lua_NPC opener) { + Lua_Safe_Call_Void(); + self->OpenDoorsNear(opener); +} + +std::string Lua_EntityList::MakeNameUnique(const char *name) { + Lua_Safe_Call_String(); + + char t_name[64]; + strncpy(t_name, name, 64); + return self->MakeNameUnique(t_name); +} + +std::string Lua_EntityList::RemoveNumbers(const char *name) { + Lua_Safe_Call_String(); + + char t_name[64]; + strncpy(t_name, name, 64); + return self->RemoveNumbers(t_name); +} + +void Lua_EntityList::SignalMobsByNPCID(uint32 npc_id, int signal) { + Lua_Safe_Call_Void(); + self->SignalMobsByNPCID(npc_id, signal); +} + +int Lua_EntityList::DeleteNPCCorpses() { + Lua_Safe_Call_Int(); + return self->DeleteNPCCorpses(); +} + +int Lua_EntityList::DeletePlayerCorpses() { + Lua_Safe_Call_Int(); + return self->DeletePlayerCorpses(); +} + +void Lua_EntityList::HalveAggro(Lua_Mob who) { + Lua_Safe_Call_Void(); + self->HalveAggro(who); +} + +void Lua_EntityList::DoubleAggro(Lua_Mob who) { + Lua_Safe_Call_Void(); + self->DoubleAggro(who); +} + +void Lua_EntityList::ClearFeignAggro(Lua_Mob who) { + Lua_Safe_Call_Void(); + self->ClearFeignAggro(who); +} + +bool Lua_EntityList::Fighting(Lua_Mob who) { + Lua_Safe_Call_Bool(); + return self->Fighting(who); +} + +void Lua_EntityList::RemoveFromHateLists(Lua_Mob who) { + Lua_Safe_Call_Void(); + self->RemoveFromHateLists(who); +} + +void Lua_EntityList::RemoveFromHateLists(Lua_Mob who, bool set_to_one) { + Lua_Safe_Call_Void(); + self->RemoveFromHateLists(who, set_to_one); +} + +void Lua_EntityList::MessageGroup(Lua_Mob who, bool skip_close, uint32 type, const char *message) { + Lua_Safe_Call_Void(); + self->MessageGroup(who, skip_close, type, message); +} + +Lua_Client Lua_EntityList::GetRandomClient(float x, float y, float z, float dist) { + Lua_Safe_Call_Class(Lua_Client); + return self->GetRandomClient(x, y, z, dist); +} + +Lua_Client Lua_EntityList::GetRandomClient(float x, float y, float z, float dist, Lua_Client exclude) { + Lua_Safe_Call_Class(Lua_Client); + return self->GetRandomClient(x, y, z, dist, exclude); +} + +Lua_Mob_List Lua_EntityList::GetMobList() { + Lua_Safe_Call_Class(Lua_Mob_List); + Lua_Mob_List ret; + std::list t_list; + self->GetMobList(t_list); + + auto iter = t_list.begin(); + while(iter != t_list.end()) { + ret.entries.push_back(Lua_Mob(*iter)); + ++iter; + } + + return ret; +} + +Lua_Client_List Lua_EntityList::GetClientList() { + Lua_Safe_Call_Class(Lua_Client_List); + Lua_Client_List ret; + std::list t_list; + self->GetClientList(t_list); + + auto iter = t_list.begin(); + while(iter != t_list.end()) { + ret.entries.push_back(Lua_Client(*iter)); + ++iter; + } + + return ret; +} + +Lua_NPC_List Lua_EntityList::GetNPCList() { + Lua_Safe_Call_Class(Lua_NPC_List); + Lua_NPC_List ret; + std::list t_list; + self->GetNPCList(t_list); + + auto iter = t_list.begin(); + while(iter != t_list.end()) { + ret.entries.push_back(Lua_NPC(*iter)); + ++iter; + } + + return ret; +} + +Lua_Corpse_List Lua_EntityList::GetCorpseList() { + Lua_Safe_Call_Class(Lua_Corpse_List); + Lua_Corpse_List ret; + std::list t_list; + self->GetCorpseList(t_list); + + auto iter = t_list.begin(); + while(iter != t_list.end()) { + ret.entries.push_back(Lua_Corpse(*iter)); + ++iter; + } + + return ret; +} + +Lua_Object_List Lua_EntityList::GetObjectList() { + Lua_Safe_Call_Class(Lua_Object_List); + Lua_Object_List ret; + std::list t_list; + self->GetObjectList(t_list); + + auto iter = t_list.begin(); + while(iter != t_list.end()) { + ret.entries.push_back(Lua_Object(*iter)); + ++iter; + } + + return ret; +} + +Lua_Doors_List Lua_EntityList::GetDoorsList() { + Lua_Safe_Call_Class(Lua_Doors_List); + Lua_Doors_List ret; + std::list t_list; + self->GetDoorsList(t_list); + + auto iter = t_list.begin(); + while(iter != t_list.end()) { + ret.entries.push_back(Lua_Door(*iter)); + ++iter; + } + + return ret; +} + +void Lua_EntityList::SignalAllClients(int signal) { + Lua_Safe_Call_Void(); + self->SignalAllClients(signal); +} + +luabind::scope lua_register_entity_list() { + return luabind::class_("EntityList") + .def(luabind::constructor<>()) + .property("null", &Lua_EntityList::Null) + .property("valid", &Lua_EntityList::Valid) + .def("GetMobID", (Lua_Mob(Lua_EntityList::*)(int))&Lua_EntityList::GetMobID) + .def("GetMob", (Lua_Mob(Lua_EntityList::*)(const char*))&Lua_EntityList::GetMob) + .def("GetMob", (Lua_Mob(Lua_EntityList::*)(int))&Lua_EntityList::GetMob) + .def("GetMobByNpcTypeID", (Lua_Mob(Lua_EntityList::*)(int))&Lua_EntityList::GetMobByNpcTypeID) + .def("GetNPCByID", (Lua_NPC(Lua_EntityList::*)(int))&Lua_EntityList::GetNPCByID) + .def("GetNPCByNPCTypeID", (Lua_NPC(Lua_EntityList::*)(int))&Lua_EntityList::GetNPCByNPCTypeID) + .def("GetClientByName", (Lua_Client(Lua_EntityList::*)(const char*))&Lua_EntityList::GetClientByName) + .def("GetClientByAccID", (Lua_Client(Lua_EntityList::*)(uint32))&Lua_EntityList::GetClientByAccID) + .def("GetClientByID", (Lua_Client(Lua_EntityList::*)(int))&Lua_EntityList::GetClientByID) + .def("GetClientByCharID", (Lua_Client(Lua_EntityList::*)(uint32))&Lua_EntityList::GetClientByCharID) + .def("GetClientByWID", (Lua_Client(Lua_EntityList::*)(uint32))&Lua_EntityList::GetClientByWID) + .def("GetObjectByID", (Lua_Object(Lua_EntityList::*)(int))&Lua_EntityList::GetObjectByID) + .def("GetObjectByDBID", (Lua_Object(Lua_EntityList::*)(uint32))&Lua_EntityList::GetObjectByDBID) + .def("GetDoorsByID", (Lua_Door(Lua_EntityList::*)(int))&Lua_EntityList::GetDoorsByID) + .def("GetDoorsByDBID", (Lua_Door(Lua_EntityList::*)(uint32))&Lua_EntityList::GetDoorsByDBID) + .def("GetDoorsByDoorID", (Lua_Door(Lua_EntityList::*)(uint32))&Lua_EntityList::GetDoorsByDoorID) + .def("FindDoor", (Lua_Door(Lua_EntityList::*)(uint32))&Lua_EntityList::FindDoor) + .def("GetGroupByMob", (Lua_Group(Lua_EntityList::*)(Lua_Mob))&Lua_EntityList::GetGroupByMob) + .def("GetGroupByClient", (Lua_Group(Lua_EntityList::*)(Lua_Client))&Lua_EntityList::GetGroupByClient) + .def("GetGroupByID", (Lua_Group(Lua_EntityList::*)(int))&Lua_EntityList::GetGroupByID) + .def("GetGroupByLeaderName", (Lua_Group(Lua_EntityList::*)(const char*))&Lua_EntityList::GetGroupByLeaderName) + .def("GetRaidByID", (Lua_Raid(Lua_EntityList::*)(int))&Lua_EntityList::GetRaidByID) + .def("GetRaidByClient", (Lua_Raid(Lua_EntityList::*)(Lua_Client))&Lua_EntityList::GetRaidByClient) + .def("GetCorpseByOwner", (Lua_Corpse(Lua_EntityList::*)(Lua_Client))&Lua_EntityList::GetCorpseByOwner) + .def("GetCorpseByID", (Lua_Corpse(Lua_EntityList::*)(int))&Lua_EntityList::GetCorpseByID) + .def("GetCorpseByName", (Lua_Corpse(Lua_EntityList::*)(const char*))&Lua_EntityList::GetCorpseByName) + .def("ClearClientPetitionQueue", (void(Lua_EntityList::*)(void))&Lua_EntityList::ClearClientPetitionQueue) + .def("CanAddHateForMob", (bool(Lua_EntityList::*)(Lua_Mob))&Lua_EntityList::CanAddHateForMob) + .def("Message", (void(Lua_EntityList::*)(uint32,uint32,const char*))&Lua_EntityList::Message) + .def("MessageStatus", (void(Lua_EntityList::*)(uint32,uint32,uint32,const char*))&Lua_EntityList::MessageStatus) + .def("MessageClose", (void(Lua_EntityList::*)(Lua_Mob,bool,float,uint32,const char*))&Lua_EntityList::MessageClose) + .def("RemoveFromTargets", (void(Lua_EntityList::*)(Lua_Mob))&Lua_EntityList::RemoveFromTargets) + .def("ReplaceWithTarget", (void(Lua_EntityList::*)(Lua_Mob,Lua_Mob))&Lua_EntityList::ReplaceWithTarget) + .def("OpenDoorsNear", (void(Lua_EntityList::*)(Lua_NPC))&Lua_EntityList::OpenDoorsNear) + .def("MakeNameUnique", (std::string(Lua_EntityList::*)(const char*))&Lua_EntityList::MakeNameUnique) + .def("RemoveNumbers", (std::string(Lua_EntityList::*)(const char*))&Lua_EntityList::RemoveNumbers) + .def("SignalMobsByNPCID", (void(Lua_EntityList::*)(uint32,int))&Lua_EntityList::SignalMobsByNPCID) + .def("DeleteNPCCorpses", (int(Lua_EntityList::*)(void))&Lua_EntityList::DeleteNPCCorpses) + .def("DeletePlayerCorpses", (int(Lua_EntityList::*)(void))&Lua_EntityList::DeletePlayerCorpses) + .def("HalveAggro", (void(Lua_EntityList::*)(Lua_Mob))&Lua_EntityList::HalveAggro) + .def("DoubleAggro", (void(Lua_EntityList::*)(Lua_Mob))&Lua_EntityList::DoubleAggro) + .def("ClearFeignAggro", (void(Lua_EntityList::*)(Lua_Mob))&Lua_EntityList::ClearFeignAggro) + .def("Fighting", (bool(Lua_EntityList::*)(Lua_Mob))&Lua_EntityList::Fighting) + .def("RemoveFromHateLists", (void(Lua_EntityList::*)(Lua_Mob))&Lua_EntityList::RemoveFromHateLists) + .def("RemoveFromHateLists", (void(Lua_EntityList::*)(Lua_Mob,bool))&Lua_EntityList::RemoveFromHateLists) + .def("MessageGroup", (void(Lua_EntityList::*)(Lua_Mob,bool,uint32,const char*))&Lua_EntityList::MessageGroup) + .def("GetRandomClient", (Lua_Client(Lua_EntityList::*)(float,float,float,float))&Lua_EntityList::GetRandomClient) + .def("GetRandomClient", (Lua_Client(Lua_EntityList::*)(float,float,float,float,Lua_Client))&Lua_EntityList::GetRandomClient) + .def("GetMobList", (Lua_Mob_List(Lua_EntityList::*)(void))&Lua_EntityList::GetMobList) + .def("GetClientList", (Lua_Client_List(Lua_EntityList::*)(void))&Lua_EntityList::GetClientList) + .def("GetNPCList", (Lua_NPC_List(Lua_EntityList::*)(void))&Lua_EntityList::GetNPCList) + .def("GetCorpseList", (Lua_Corpse_List(Lua_EntityList::*)(void))&Lua_EntityList::GetCorpseList) + .def("GetObjectList", (Lua_Object_List(Lua_EntityList::*)(void))&Lua_EntityList::GetObjectList) + .def("GetDoorsList", (Lua_Doors_List(Lua_EntityList::*)(void))&Lua_EntityList::GetDoorsList) + .def("SignalAllClients", (void(Lua_EntityList::*)(int))&Lua_EntityList::SignalAllClients); +} + +luabind::scope lua_register_mob_list() { + return luabind::class_("MobList") + .def_readwrite("entries", &Lua_Mob_List::entries, luabind::return_stl_iterator); +} + +luabind::scope lua_register_client_list() { + return luabind::class_("ClientList") + .def_readwrite("entries", &Lua_Client_List::entries, luabind::return_stl_iterator); +} + +luabind::scope lua_register_npc_list() { + return luabind::class_("NPCList") + .def_readwrite("entries", &Lua_NPC_List::entries, luabind::return_stl_iterator); +} + +luabind::scope lua_register_corpse_list() { + return luabind::class_("CorpseList") + .def_readwrite("entries", &Lua_Corpse_List::entries, luabind::return_stl_iterator); +} + +luabind::scope lua_register_object_list() { + return luabind::class_("ObjectList") + .def_readwrite("entries", &Lua_Object_List::entries, luabind::return_stl_iterator); +} + +luabind::scope lua_register_door_list() { + return luabind::class_("DoorList") + .def_readwrite("entries", &Lua_Doors_List::entries, luabind::return_stl_iterator); +} + +#endif diff --git a/zone/lua_entity_list.h b/zone/lua_entity_list.h new file mode 100644 index 000000000..43455be1f --- /dev/null +++ b/zone/lua_entity_list.h @@ -0,0 +1,110 @@ +#ifndef EQEMU_LUA_ENTITY_LIST_H +#define EQEMU_LUA_ENTITY_LIST_H +#ifdef LUA_EQEMU + +#include "lua_ptr.h" + +class EntityList; +class Lua_Mob; +class Lua_Client; +class Lua_NPC; +class Lua_Door; +class Lua_Corpse; +class Lua_Object; +class Lua_Group; +class Lua_Raid; +struct Lua_Mob_List; +struct Lua_Client_List; +struct Lua_NPC_List; +struct Lua_Corpse_List; +struct Lua_Object_List; +struct Lua_Doors_List; + +namespace luabind { + struct scope; +} + +luabind::scope lua_register_entity_list(); +luabind::scope lua_register_mob_list(); +luabind::scope lua_register_client_list(); +luabind::scope lua_register_npc_list(); +luabind::scope lua_register_corpse_list(); +luabind::scope lua_register_object_list(); +luabind::scope lua_register_door_list(); + +class Lua_EntityList : public Lua_Ptr +{ + typedef EntityList NativeType; +public: + Lua_EntityList() { } + Lua_EntityList(EntityList *d) : Lua_Ptr(d) { } + virtual ~Lua_EntityList() { } + + operator EntityList*() { + void *d = GetLuaPtrData(); + if(d) { + return reinterpret_cast(d); + } + + return nullptr; + } + + Lua_Mob GetMobID(int id); + Lua_Mob GetMob(const char *name); + Lua_Mob GetMob(int id); + Lua_Mob GetMobByNpcTypeID(int npc_type); + Lua_NPC GetNPCByID(int id); + Lua_NPC GetNPCByNPCTypeID(int npc_type); + Lua_Client GetClientByName(const char *name); + Lua_Client GetClientByAccID(uint32 acct_id); + Lua_Client GetClientByID(int id); + Lua_Client GetClientByCharID(uint32 char_id); + Lua_Client GetClientByWID(uint32 wid); + Lua_Object GetObjectByID(int id); + Lua_Object GetObjectByDBID(uint32 db_id); + Lua_Door GetDoorsByID(int id); + Lua_Door GetDoorsByDBID(uint32 db_id); + Lua_Door GetDoorsByDoorID(uint32 door_id); + Lua_Door FindDoor(uint32 id); + Lua_Group GetGroupByMob(Lua_Mob mob); + Lua_Group GetGroupByClient(Lua_Client client); + Lua_Group GetGroupByID(int id); + Lua_Group GetGroupByLeaderName(const char *name); + Lua_Raid GetRaidByID(int id); + Lua_Raid GetRaidByClient(Lua_Client client); + Lua_Corpse GetCorpseByOwner(Lua_Client client); + Lua_Corpse GetCorpseByID(int id); + Lua_Corpse GetCorpseByName(const char *name); + void ClearClientPetitionQueue(); + bool CanAddHateForMob(Lua_Mob p); + void Message(uint32 guild_dbid, uint32 type, const char *message); + void MessageStatus(uint32 guild_dbid, int min_status, uint32 type, const char *message); + void MessageClose(Lua_Mob sender, bool skip_sender, float dist, uint32 type, const char *message); + void RemoveFromTargets(Lua_Mob mob); + void ReplaceWithTarget(Lua_Mob target, Lua_Mob new_target); + void OpenDoorsNear(Lua_NPC opener); + std::string MakeNameUnique(const char *name); + std::string RemoveNumbers(const char *name); + void SignalMobsByNPCID(uint32 npc_id, int signal); + int DeleteNPCCorpses(); + int DeletePlayerCorpses(); + void HalveAggro(Lua_Mob who); + void DoubleAggro(Lua_Mob who); + void ClearFeignAggro(Lua_Mob who); + bool Fighting(Lua_Mob who); + void RemoveFromHateLists(Lua_Mob who); + void RemoveFromHateLists(Lua_Mob who, bool set_to_one); + void MessageGroup(Lua_Mob who, bool skip_close, uint32 type, const char *message); + Lua_Client GetRandomClient(float x, float y, float z, float dist); + Lua_Client GetRandomClient(float x, float y, float z, float dist, Lua_Client exclude); + Lua_Mob_List GetMobList(); + Lua_Client_List GetClientList(); + Lua_NPC_List GetNPCList(); + Lua_Corpse_List GetCorpseList(); + Lua_Object_List GetObjectList(); + Lua_Doors_List GetDoorsList(); + void SignalAllClients(int signal); +}; + +#endif +#endif diff --git a/zone/lua_group.cpp b/zone/lua_group.cpp new file mode 100644 index 000000000..ac5d464d4 --- /dev/null +++ b/zone/lua_group.cpp @@ -0,0 +1,22 @@ +#ifdef LUA_EQEMU + +#include "lua.hpp" +#include +#include + +#include "groups.h" +#include "masterentity.h" +#include "lua_group.h" +#include "lua_entity.h" +#include "lua_mob.h" +#include "lua_client.h" +#include "lua_npc.h" + +luabind::scope lua_register_group() { + return luabind::class_("Group") + .def(luabind::constructor<>()) + .property("null", &Lua_Group::Null) + .property("valid", &Lua_Group::Valid); +} + +#endif diff --git a/zone/lua_group.h b/zone/lua_group.h new file mode 100644 index 000000000..bc2e1b962 --- /dev/null +++ b/zone/lua_group.h @@ -0,0 +1,34 @@ +#ifndef EQEMU_LUA_GROUP_H +#define EQEMU_LUA_GROUP_H +#ifdef LUA_EQEMU + +#include "lua_ptr.h" + +class Group; + +namespace luabind { + struct scope; +} + +luabind::scope lua_register_group(); + +class Lua_Group : public Lua_Ptr +{ + typedef Group NativeType; +public: + Lua_Group() { } + Lua_Group(Group *d) : Lua_Ptr(d) { } + virtual ~Lua_Group() { } + + operator Group*() { + void *d = GetLuaPtrData(); + if(d) { + return reinterpret_cast(d); + } + + return nullptr; + } +}; + +#endif +#endif diff --git a/zone/lua_hate_entry.cpp b/zone/lua_hate_entry.cpp index 9c723d67b..10f9b41e8 100644 --- a/zone/lua_hate_entry.cpp +++ b/zone/lua_hate_entry.cpp @@ -9,10 +9,14 @@ #include "hate_list.h" #include "lua_mob.h" #include "lua_hate_entry.h" -#include "lua_hate_list.h" + +struct Lua_HateList +{ + std::vector entries; +}; Lua_Mob Lua_HateEntry::GetEnt() { - Lua_Safe_Call_Mob(); + Lua_Safe_Call_Class(Lua_Mob); return Lua_Mob(self->ent); } diff --git a/zone/lua_item.cpp b/zone/lua_item.cpp index bb5b0856d..b0fedd159 100644 --- a/zone/lua_item.cpp +++ b/zone/lua_item.cpp @@ -477,79 +477,34 @@ uint32 Lua_Item::GetAugType() { return self->AugType; } -int Lua_Item::GetAugSlotType1() { +int Lua_Item::GetAugSlotType(int i) { Lua_Safe_Call_Int(); - return self->AugSlotType[1]; + + if(i >= 5 || i < 0) { + return 0; + } + + return self->AugSlotType[i]; } -int Lua_Item::GetAugSlotType2() { +int Lua_Item::GetAugSlotVisible(int i) { Lua_Safe_Call_Int(); - return self->AugSlotType[2]; + + if(i >= 5 || i < 0) { + return 0; + } + + return self->AugSlotVisible[i]; } -int Lua_Item::GetAugSlotType3() { +int Lua_Item::GetAugSlotUnk2(int i) { Lua_Safe_Call_Int(); - return self->AugSlotType[3]; -} -int Lua_Item::GetAugSlotType4() { - Lua_Safe_Call_Int(); - return self->AugSlotType[4]; -} + if(i >= 5 || i < 0) { + return 0; + } -int Lua_Item::GetAugSlotType5() { - Lua_Safe_Call_Int(); - return self->AugSlotType[5]; -} - -int Lua_Item::GetAugSlotVisible1() { - Lua_Safe_Call_Int(); - return self->AugSlotVisible[1]; -} - -int Lua_Item::GetAugSlotVisible2() { - Lua_Safe_Call_Int(); - return self->AugSlotVisible[2]; -} - -int Lua_Item::GetAugSlotVisible3() { - Lua_Safe_Call_Int(); - return self->AugSlotVisible[3]; -} - -int Lua_Item::GetAugSlotVisible4() { - Lua_Safe_Call_Int(); - return self->AugSlotVisible[4]; -} - -int Lua_Item::GetAugSlotVisible5() { - Lua_Safe_Call_Int(); - return self->AugSlotVisible[5]; -} - -int Lua_Item::GetAugSlotUnk21() { - Lua_Safe_Call_Int(); - return self->AugSlotUnk2[1]; -} - -int Lua_Item::GetAugSlotUnk22() { - Lua_Safe_Call_Int(); - return self->AugSlotUnk2[2]; -} - -int Lua_Item::GetAugSlotUnk23() { - Lua_Safe_Call_Int(); - return self->AugSlotUnk2[3]; -} - -int Lua_Item::GetAugSlotUnk24() { - Lua_Safe_Call_Int(); - return self->AugSlotUnk2[4]; -} - -int Lua_Item::GetAugSlotUnk25() { - Lua_Safe_Call_Int(); - return self->AugSlotUnk2[5]; + return self->AugSlotUnk2[i]; } uint32 Lua_Item::GetLDoNTheme() { @@ -951,195 +906,183 @@ luabind::scope lua_register_item() { return luabind::class_("Item") .def(luabind::constructor<>()) .def(luabind::constructor()) - .property("null", &Lua_Item::Null) - .property("valid", &Lua_Item::Valid) - .property("MinStatus", &Lua_Item::GetMinStatus) - .property("ItemClass", &Lua_Item::GetItemClass) - .property("Name", &Lua_Item::GetName) - .property("Lore", &Lua_Item::GetLore) - .property("IDFile", &Lua_Item::GetIDFile) - .property("ID", &Lua_Item::GetID) - .property("Weight", &Lua_Item::GetWeight) - .property("NoRent", &Lua_Item::GetNoRent) - .property("NoDrop", &Lua_Item::GetNoDrop) - .property("Size", &Lua_Item::GetSize) - .property("Slots", &Lua_Item::GetSlots) - .property("Price", &Lua_Item::GetPrice) - .property("Icon", &Lua_Item::GetIcon) - .property("LoreGroup", &Lua_Item::GetLoreGroup) - .property("LoreFlag", &Lua_Item::GetLoreFlag) - .property("PendingLoreFlag", &Lua_Item::GetPendingLoreFlag) - .property("ArtifactFlag", &Lua_Item::GetArtifactFlag) - .property("SummonedFlag", &Lua_Item::GetSummonedFlag) - .property("FVNoDrop", &Lua_Item::GetFVNoDrop) - .property("Favor", &Lua_Item::GetFavor) - .property("GuildFavor", &Lua_Item::GetGuildFavor) - .property("PointType", &Lua_Item::GetPointType) - .property("BagType", &Lua_Item::GetBagType) - .property("BagSlots", &Lua_Item::GetBagSlots) - .property("BagSize", &Lua_Item::GetBagSize) - .property("BagWR", &Lua_Item::GetBagWR) - .property("BenefitFlag", &Lua_Item::GetBenefitFlag) - .property("Tradeskills", &Lua_Item::GetTradeskills) - .property("CR", &Lua_Item::GetCR) - .property("DR", &Lua_Item::GetDR) - .property("PR", &Lua_Item::GetPR) - .property("MR", &Lua_Item::GetMR) - .property("FR", &Lua_Item::GetFR) - .property("AStr", &Lua_Item::GetAStr) - .property("ASta", &Lua_Item::GetASta) - .property("AAgi", &Lua_Item::GetAAgi) - .property("ADex", &Lua_Item::GetADex) - .property("ACha", &Lua_Item::GetACha) - .property("AInt", &Lua_Item::GetAInt) - .property("AWis", &Lua_Item::GetAWis) - .property("HP", &Lua_Item::GetHP) - .property("Mana", &Lua_Item::GetMana) - .property("AC", &Lua_Item::GetAC) - .property("Deity", &Lua_Item::GetDeity) - .property("SkillModValue", &Lua_Item::GetSkillModValue) - .property("SkillModType", &Lua_Item::GetSkillModType) - .property("BaneDmgRace", &Lua_Item::GetBaneDmgRace) - .property("BaneDmgAmt", &Lua_Item::GetBaneDmgAmt) - .property("BaneDmgBody", &Lua_Item::GetBaneDmgBody) - .property("Magic", &Lua_Item::GetMagic) - .property("CastTime_", &Lua_Item::GetCastTime_) - .property("ReqLevel", &Lua_Item::GetReqLevel) - .property("BardType", &Lua_Item::GetBardType) - .property("BardValue", &Lua_Item::GetBardValue) - .property("Light", &Lua_Item::GetLight) - .property("Delay", &Lua_Item::GetDelay) - .property("RecLevel", &Lua_Item::GetRecLevel) - .property("RecSkill", &Lua_Item::GetRecSkill) - .property("ElemDmgType", &Lua_Item::GetElemDmgType) - .property("ElemDmgAmt", &Lua_Item::GetElemDmgAmt) - .property("Range", &Lua_Item::GetRange) - .property("Damage", &Lua_Item::GetDamage) - .property("Color", &Lua_Item::GetColor) - .property("Classes", &Lua_Item::GetClasses) - .property("Races", &Lua_Item::GetRaces) - .property("MaxCharges", &Lua_Item::GetMaxCharges) - .property("ItemType", &Lua_Item::GetItemType) - .property("Material", &Lua_Item::GetMaterial) - .property("SellRate", &Lua_Item::GetSellRate) - .property("Fulfilment", &Lua_Item::GetFulfilment) - .property("CastTime", &Lua_Item::GetCastTime) - .property("EliteMaterial", &Lua_Item::GetEliteMaterial) - .property("ProcRate", &Lua_Item::GetProcRate) - .property("CombatEffects", &Lua_Item::GetCombatEffects) - .property("Shielding", &Lua_Item::GetShielding) - .property("StunResist", &Lua_Item::GetStunResist) - .property("StrikeThrough", &Lua_Item::GetStrikeThrough) - .property("ExtraDmgSkill", &Lua_Item::GetExtraDmgSkill) - .property("ExtraDmgAmt", &Lua_Item::GetExtraDmgAmt) - .property("SpellShield", &Lua_Item::GetSpellShield) - .property("Avoidance", &Lua_Item::GetAvoidance) - .property("Accuracy", &Lua_Item::GetAccuracy) - .property("CharmFileID", &Lua_Item::GetCharmFileID) - .property("FactionMod1", &Lua_Item::GetFactionMod1) - .property("FactionMod2", &Lua_Item::GetFactionMod2) - .property("FactionMod3", &Lua_Item::GetFactionMod3) - .property("FactionMod4", &Lua_Item::GetFactionMod4) - .property("FactionAmt1", &Lua_Item::GetFactionAmt1) - .property("FactionAmt2", &Lua_Item::GetFactionAmt2) - .property("FactionAmt3", &Lua_Item::GetFactionAmt3) - .property("FactionAmt4", &Lua_Item::GetFactionAmt4) - .property("CharmFile", &Lua_Item::GetCharmFile) - .property("AugType", &Lua_Item::GetAugType) - .property("AugSlotType1", &Lua_Item::GetAugSlotType1) - .property("AugSlotType2", &Lua_Item::GetAugSlotType2) - .property("AugSlotType3", &Lua_Item::GetAugSlotType3) - .property("AugSlotType4", &Lua_Item::GetAugSlotType4) - .property("AugSlotType5", &Lua_Item::GetAugSlotType5) - .property("AugSlotVisible1", &Lua_Item::GetAugSlotVisible1) - .property("AugSlotVisible2", &Lua_Item::GetAugSlotVisible2) - .property("AugSlotVisible3", &Lua_Item::GetAugSlotVisible3) - .property("AugSlotVisible4", &Lua_Item::GetAugSlotVisible4) - .property("AugSlotVisible5", &Lua_Item::GetAugSlotVisible5) - .property("AugSlotUnk21", &Lua_Item::GetAugSlotUnk21) - .property("AugSlotUnk22", &Lua_Item::GetAugSlotUnk22) - .property("AugSlotUnk23", &Lua_Item::GetAugSlotUnk23) - .property("AugSlotUnk24", &Lua_Item::GetAugSlotUnk24) - .property("AugSlotUnk25", &Lua_Item::GetAugSlotUnk25) - .property("LDoNTheme", &Lua_Item::GetLDoNTheme) - .property("LDoNPrice", &Lua_Item::GetLDoNPrice) - .property("LDoNSold", &Lua_Item::GetLDoNSold) - .property("BaneDmgRaceAmt", &Lua_Item::GetBaneDmgRaceAmt) - .property("AugRestrict", &Lua_Item::GetAugRestrict) - .property("Endur", &Lua_Item::GetEndur) - .property("DotShielding", &Lua_Item::GetDotShielding) - .property("Attack", &Lua_Item::GetAttack) - .property("Regen", &Lua_Item::GetRegen) - .property("ManaRegen", &Lua_Item::GetManaRegen) - .property("EnduranceRegen", &Lua_Item::GetEnduranceRegen) - .property("Haste", &Lua_Item::GetHaste) - .property("DamageShield", &Lua_Item::GetDamageShield) - .property("RecastDelay", &Lua_Item::GetRecastDelay) - .property("RecastType", &Lua_Item::GetRecastType) - .property("AugDistiller", &Lua_Item::GetAugDistiller) - .property("Attuneable", &Lua_Item::GetAttuneable) - .property("NoPet", &Lua_Item::GetNoPet) - .property("PotionBelt", &Lua_Item::GetPotionBelt) - .property("Stackable", &Lua_Item::GetStackable) - .property("NoTransfer", &Lua_Item::GetNoTransfer) - .property("QuestItemFlag", &Lua_Item::GetQuestItemFlag) - .property("StackSize", &Lua_Item::GetStackSize) - .property("PotionBeltSlots", &Lua_Item::GetPotionBeltSlots) - .property("Click_Effect", &Lua_Item::GetClick_Effect) - .property("Click_Type", &Lua_Item::GetClick_Type) - .property("Click_Level", &Lua_Item::GetClick_Level) - .property("Click_Level2", &Lua_Item::GetClick_Level2) - .property("Proc_Effect", &Lua_Item::GetProc_Effect) - .property("Proc_Type", &Lua_Item::GetProc_Type) - .property("Proc_Level", &Lua_Item::GetProc_Level) - .property("Proc_Level2", &Lua_Item::GetProc_Level2) - .property("Worn_Effect", &Lua_Item::GetWorn_Effect) - .property("Worn_Type", &Lua_Item::GetWorn_Type) - .property("Worn_Level", &Lua_Item::GetWorn_Level) - .property("Worn_Level2", &Lua_Item::GetWorn_Level2) - .property("Focus_Effect", &Lua_Item::GetFocus_Effect) - .property("Focus_Type", &Lua_Item::GetFocus_Type) - .property("Focus_Level", &Lua_Item::GetFocus_Level) - .property("Focus_Level2", &Lua_Item::GetFocus_Level2) - .property("Scroll_Effect", &Lua_Item::GetScroll_Effect) - .property("Scroll_Type", &Lua_Item::GetScroll_Type) - .property("Scroll_Level", &Lua_Item::GetScroll_Level) - .property("Scroll_Level2", &Lua_Item::GetScroll_Level2) - .property("Bard_Effect", &Lua_Item::GetBard_Effect) - .property("Bard_Type", &Lua_Item::GetBard_Type) - .property("Bard_Level", &Lua_Item::GetBard_Level) - .property("Bard_Level2", &Lua_Item::GetBard_Level2) - .property("Book", &Lua_Item::GetBook) - .property("BookType", &Lua_Item::GetBookType) - .property("Filename", &Lua_Item::GetFilename) - .property("SVCorruption", &Lua_Item::GetSVCorruption) - .property("Purity", &Lua_Item::GetPurity) - .property("BackstabDmg", &Lua_Item::GetBackstabDmg) - .property("DSMitigation", &Lua_Item::GetDSMitigation) - .property("HeroicStr", &Lua_Item::GetHeroicStr) - .property("HeroicInt", &Lua_Item::GetHeroicInt) - .property("HeroicWis", &Lua_Item::GetHeroicWis) - .property("HeroicAgi", &Lua_Item::GetHeroicAgi) - .property("HeroicDex", &Lua_Item::GetHeroicDex) - .property("HeroicSta", &Lua_Item::GetHeroicSta) - .property("HeroicCha", &Lua_Item::GetHeroicCha) - .property("HeroicMR", &Lua_Item::GetHeroicMR) - .property("HeroicFR", &Lua_Item::GetHeroicFR) - .property("HeroicCR", &Lua_Item::GetHeroicCR) - .property("HeroicDR", &Lua_Item::GetHeroicDR) - .property("HeroicPR", &Lua_Item::GetHeroicPR) - .property("HeroicSVCorrup", &Lua_Item::GetHeroicSVCorrup) - .property("HealAmt", &Lua_Item::GetHealAmt) - .property("SpellDmg", &Lua_Item::GetSpellDmg) - .property("LDoNSellBackRate", &Lua_Item::GetLDoNSellBackRate) - .property("ScriptFileID", &Lua_Item::GetScriptFileID) - .property("ExpendableArrow", &Lua_Item::GetExpendableArrow) - .property("Clairvoyance", &Lua_Item::GetClairvoyance) - .property("ClickName", &Lua_Item::GetClickName) - .property("ProcName", &Lua_Item::GetProcName) - .property("WornName", &Lua_Item::GetWornName) - .property("FocusName", &Lua_Item::GetFocusName) - .property("ScrollName", &Lua_Item::GetScrollName); + .def("null", &Lua_Item::Null) + .def("valid", &Lua_Item::Valid) + .def("MinStatus", &Lua_Item::GetMinStatus) + .def("ItemClass", &Lua_Item::GetItemClass) + .def("Name", &Lua_Item::GetName) + .def("Lore", &Lua_Item::GetLore) + .def("IDFile", &Lua_Item::GetIDFile) + .def("ID", &Lua_Item::GetID) + .def("Weight", &Lua_Item::GetWeight) + .def("NoRent", &Lua_Item::GetNoRent) + .def("NoDrop", &Lua_Item::GetNoDrop) + .def("Size", &Lua_Item::GetSize) + .def("Slots", &Lua_Item::GetSlots) + .def("Price", &Lua_Item::GetPrice) + .def("Icon", &Lua_Item::GetIcon) + .def("LoreGroup", &Lua_Item::GetLoreGroup) + .def("LoreFlag", &Lua_Item::GetLoreFlag) + .def("PendingLoreFlag", &Lua_Item::GetPendingLoreFlag) + .def("ArtifactFlag", &Lua_Item::GetArtifactFlag) + .def("SummonedFlag", &Lua_Item::GetSummonedFlag) + .def("FVNoDrop", &Lua_Item::GetFVNoDrop) + .def("Favor", &Lua_Item::GetFavor) + .def("GuildFavor", &Lua_Item::GetGuildFavor) + .def("PointType", &Lua_Item::GetPointType) + .def("BagType", &Lua_Item::GetBagType) + .def("BagSlots", &Lua_Item::GetBagSlots) + .def("BagSize", &Lua_Item::GetBagSize) + .def("BagWR", &Lua_Item::GetBagWR) + .def("BenefitFlag", &Lua_Item::GetBenefitFlag) + .def("Tradeskills", &Lua_Item::GetTradeskills) + .def("CR", &Lua_Item::GetCR) + .def("DR", &Lua_Item::GetDR) + .def("PR", &Lua_Item::GetPR) + .def("MR", &Lua_Item::GetMR) + .def("FR", &Lua_Item::GetFR) + .def("AStr", &Lua_Item::GetAStr) + .def("ASta", &Lua_Item::GetASta) + .def("AAgi", &Lua_Item::GetAAgi) + .def("ADex", &Lua_Item::GetADex) + .def("ACha", &Lua_Item::GetACha) + .def("AInt", &Lua_Item::GetAInt) + .def("AWis", &Lua_Item::GetAWis) + .def("HP", &Lua_Item::GetHP) + .def("Mana", &Lua_Item::GetMana) + .def("AC", &Lua_Item::GetAC) + .def("Deity", &Lua_Item::GetDeity) + .def("SkillModValue", &Lua_Item::GetSkillModValue) + .def("SkillModType", &Lua_Item::GetSkillModType) + .def("BaneDmgRace", &Lua_Item::GetBaneDmgRace) + .def("BaneDmgAmt", &Lua_Item::GetBaneDmgAmt) + .def("BaneDmgBody", &Lua_Item::GetBaneDmgBody) + .def("Magic", &Lua_Item::GetMagic) + .def("CastTime_", &Lua_Item::GetCastTime_) + .def("ReqLevel", &Lua_Item::GetReqLevel) + .def("BardType", &Lua_Item::GetBardType) + .def("BardValue", &Lua_Item::GetBardValue) + .def("Light", &Lua_Item::GetLight) + .def("Delay", &Lua_Item::GetDelay) + .def("RecLevel", &Lua_Item::GetRecLevel) + .def("RecSkill", &Lua_Item::GetRecSkill) + .def("ElemDmgType", &Lua_Item::GetElemDmgType) + .def("ElemDmgAmt", &Lua_Item::GetElemDmgAmt) + .def("Range", &Lua_Item::GetRange) + .def("Damage", &Lua_Item::GetDamage) + .def("Color", &Lua_Item::GetColor) + .def("Classes", &Lua_Item::GetClasses) + .def("Races", &Lua_Item::GetRaces) + .def("MaxCharges", &Lua_Item::GetMaxCharges) + .def("ItemType", &Lua_Item::GetItemType) + .def("Material", &Lua_Item::GetMaterial) + .def("SellRate", &Lua_Item::GetSellRate) + .def("Fulfilment", &Lua_Item::GetFulfilment) + .def("CastTime", &Lua_Item::GetCastTime) + .def("EliteMaterial", &Lua_Item::GetEliteMaterial) + .def("ProcRate", &Lua_Item::GetProcRate) + .def("CombatEffects", &Lua_Item::GetCombatEffects) + .def("Shielding", &Lua_Item::GetShielding) + .def("StunResist", &Lua_Item::GetStunResist) + .def("StrikeThrough", &Lua_Item::GetStrikeThrough) + .def("ExtraDmgSkill", &Lua_Item::GetExtraDmgSkill) + .def("ExtraDmgAmt", &Lua_Item::GetExtraDmgAmt) + .def("SpellShield", &Lua_Item::GetSpellShield) + .def("Avoidance", &Lua_Item::GetAvoidance) + .def("Accuracy", &Lua_Item::GetAccuracy) + .def("CharmFileID", &Lua_Item::GetCharmFileID) + .def("FactionMod1", &Lua_Item::GetFactionMod1) + .def("FactionMod2", &Lua_Item::GetFactionMod2) + .def("FactionMod3", &Lua_Item::GetFactionMod3) + .def("FactionMod4", &Lua_Item::GetFactionMod4) + .def("FactionAmt1", &Lua_Item::GetFactionAmt1) + .def("FactionAmt2", &Lua_Item::GetFactionAmt2) + .def("FactionAmt3", &Lua_Item::GetFactionAmt3) + .def("FactionAmt4", &Lua_Item::GetFactionAmt4) + .def("CharmFile", &Lua_Item::GetCharmFile) + .def("AugType", &Lua_Item::GetAugType) + .def("AugSlotType", &Lua_Item::GetAugSlotType) + .def("AugSlotVisible", &Lua_Item::GetAugSlotVisible) + .def("AugSlotUnk2", &Lua_Item::GetAugSlotUnk2) + .def("LDoNTheme", &Lua_Item::GetLDoNTheme) + .def("LDoNPrice", &Lua_Item::GetLDoNPrice) + .def("LDoNSold", &Lua_Item::GetLDoNSold) + .def("BaneDmgRaceAmt", &Lua_Item::GetBaneDmgRaceAmt) + .def("AugRestrict", &Lua_Item::GetAugRestrict) + .def("Endur", &Lua_Item::GetEndur) + .def("DotShielding", &Lua_Item::GetDotShielding) + .def("Attack", &Lua_Item::GetAttack) + .def("Regen", &Lua_Item::GetRegen) + .def("ManaRegen", &Lua_Item::GetManaRegen) + .def("EnduranceRegen", &Lua_Item::GetEnduranceRegen) + .def("Haste", &Lua_Item::GetHaste) + .def("DamageShield", &Lua_Item::GetDamageShield) + .def("RecastDelay", &Lua_Item::GetRecastDelay) + .def("RecastType", &Lua_Item::GetRecastType) + .def("AugDistiller", &Lua_Item::GetAugDistiller) + .def("Attuneable", &Lua_Item::GetAttuneable) + .def("NoPet", &Lua_Item::GetNoPet) + .def("PotionBelt", &Lua_Item::GetPotionBelt) + .def("Stackable", &Lua_Item::GetStackable) + .def("NoTransfer", &Lua_Item::GetNoTransfer) + .def("QuestItemFlag", &Lua_Item::GetQuestItemFlag) + .def("StackSize", &Lua_Item::GetStackSize) + .def("PotionBeltSlots", &Lua_Item::GetPotionBeltSlots) + .def("Click_Effect", &Lua_Item::GetClick_Effect) + .def("Click_Type", &Lua_Item::GetClick_Type) + .def("Click_Level", &Lua_Item::GetClick_Level) + .def("Click_Level2", &Lua_Item::GetClick_Level2) + .def("Proc_Effect", &Lua_Item::GetProc_Effect) + .def("Proc_Type", &Lua_Item::GetProc_Type) + .def("Proc_Level", &Lua_Item::GetProc_Level) + .def("Proc_Level2", &Lua_Item::GetProc_Level2) + .def("Worn_Effect", &Lua_Item::GetWorn_Effect) + .def("Worn_Type", &Lua_Item::GetWorn_Type) + .def("Worn_Level", &Lua_Item::GetWorn_Level) + .def("Worn_Level2", &Lua_Item::GetWorn_Level2) + .def("Focus_Effect", &Lua_Item::GetFocus_Effect) + .def("Focus_Type", &Lua_Item::GetFocus_Type) + .def("Focus_Level", &Lua_Item::GetFocus_Level) + .def("Focus_Level2", &Lua_Item::GetFocus_Level2) + .def("Scroll_Effect", &Lua_Item::GetScroll_Effect) + .def("Scroll_Type", &Lua_Item::GetScroll_Type) + .def("Scroll_Level", &Lua_Item::GetScroll_Level) + .def("Scroll_Level2", &Lua_Item::GetScroll_Level2) + .def("Bard_Effect", &Lua_Item::GetBard_Effect) + .def("Bard_Type", &Lua_Item::GetBard_Type) + .def("Bard_Level", &Lua_Item::GetBard_Level) + .def("Bard_Level2", &Lua_Item::GetBard_Level2) + .def("Book", &Lua_Item::GetBook) + .def("BookType", &Lua_Item::GetBookType) + .def("Filename", &Lua_Item::GetFilename) + .def("SVCorruption", &Lua_Item::GetSVCorruption) + .def("Purity", &Lua_Item::GetPurity) + .def("BackstabDmg", &Lua_Item::GetBackstabDmg) + .def("DSMitigation", &Lua_Item::GetDSMitigation) + .def("HeroicStr", &Lua_Item::GetHeroicStr) + .def("HeroicInt", &Lua_Item::GetHeroicInt) + .def("HeroicWis", &Lua_Item::GetHeroicWis) + .def("HeroicAgi", &Lua_Item::GetHeroicAgi) + .def("HeroicDex", &Lua_Item::GetHeroicDex) + .def("HeroicSta", &Lua_Item::GetHeroicSta) + .def("HeroicCha", &Lua_Item::GetHeroicCha) + .def("HeroicMR", &Lua_Item::GetHeroicMR) + .def("HeroicFR", &Lua_Item::GetHeroicFR) + .def("HeroicCR", &Lua_Item::GetHeroicCR) + .def("HeroicDR", &Lua_Item::GetHeroicDR) + .def("HeroicPR", &Lua_Item::GetHeroicPR) + .def("HeroicSVCorrup", &Lua_Item::GetHeroicSVCorrup) + .def("HealAmt", &Lua_Item::GetHealAmt) + .def("SpellDmg", &Lua_Item::GetSpellDmg) + .def("LDoNSellBackRate", &Lua_Item::GetLDoNSellBackRate) + .def("ScriptFileID", &Lua_Item::GetScriptFileID) + .def("ExpendableArrow", &Lua_Item::GetExpendableArrow) + .def("Clairvoyance", &Lua_Item::GetClairvoyance) + .def("ClickName", &Lua_Item::GetClickName) + .def("ProcName", &Lua_Item::GetProcName) + .def("WornName", &Lua_Item::GetWornName) + .def("FocusName", &Lua_Item::GetFocusName) + .def("ScrollName", &Lua_Item::GetScrollName); } #endif diff --git a/zone/lua_item.h b/zone/lua_item.h index ea7e9969b..d7d7b07e2 100644 --- a/zone/lua_item.h +++ b/zone/lua_item.h @@ -123,21 +123,9 @@ public: int GetFactionAmt4(); const char *GetCharmFile(); uint32 GetAugType(); - int GetAugSlotType1(); - int GetAugSlotType2(); - int GetAugSlotType3(); - int GetAugSlotType4(); - int GetAugSlotType5(); - int GetAugSlotVisible1(); - int GetAugSlotVisible2(); - int GetAugSlotVisible3(); - int GetAugSlotVisible4(); - int GetAugSlotVisible5(); - int GetAugSlotUnk21(); - int GetAugSlotUnk22(); - int GetAugSlotUnk23(); - int GetAugSlotUnk24(); - int GetAugSlotUnk25(); + int GetAugSlotType(int i); + int GetAugSlotVisible(int i); + int GetAugSlotUnk2(int i); uint32 GetLDoNTheme(); uint32 GetLDoNPrice(); uint32 GetLDoNSold(); diff --git a/zone/lua_iteminst.cpp b/zone/lua_iteminst.cpp index c6d3271cd..76ca18e16 100644 --- a/zone/lua_iteminst.cpp +++ b/zone/lua_iteminst.cpp @@ -44,12 +44,12 @@ bool Lua_ItemInst::IsExpendable() { } Lua_ItemInst Lua_ItemInst::GetItem(int slot) { - Lua_Safe_Call_ItemInst(); + Lua_Safe_Call_Class(Lua_ItemInst); return Lua_ItemInst(self->GetItem(slot)); } Lua_Item Lua_ItemInst::GetItem() { - Lua_Safe_Call_Item(); + Lua_Safe_Call_Class(Lua_Item); return Lua_Item(self->GetItem()); } @@ -59,7 +59,7 @@ void Lua_ItemInst::SetItem(Lua_Item item) { } Lua_Item Lua_ItemInst::GetUnscaledItem(int slot) { - Lua_Safe_Call_Item(); + Lua_Safe_Call_Class(Lua_Item); if(self->IsScaling()) { const EvoItemInst *ev = reinterpret_cast(self); return Lua_Item(ev->GetUnscaledItem()); @@ -78,7 +78,7 @@ int Lua_ItemInst::GetTotalItemCount() { } Lua_ItemInst Lua_ItemInst::GetAugment(int slot) { - Lua_Safe_Call_ItemInst(); + Lua_Safe_Call_Class(Lua_ItemInst); return self->GetAugment(slot); } diff --git a/zone/lua_mob.cpp b/zone/lua_mob.cpp index 76329689c..e0fd2cddc 100644 --- a/zone/lua_mob.cpp +++ b/zone/lua_mob.cpp @@ -353,7 +353,7 @@ const char *Lua_Mob::GetCleanName() { } Lua_Mob Lua_Mob::GetTarget() { - Lua_Safe_Call_Mob(); + Lua_Safe_Call_Class(Lua_Mob); return Lua_Mob(self->GetTarget()); } @@ -750,17 +750,17 @@ void Lua_Mob::SpellEffect(Lua_Mob caster, int spell_id, double partial) { } Lua_Mob Lua_Mob::GetPet() { - Lua_Safe_Call_Mob(); + Lua_Safe_Call_Class(Lua_Mob); return Lua_Mob(self->GetPet()); } Lua_Mob Lua_Mob::GetOwner() { - Lua_Safe_Call_Mob(); + Lua_Safe_Call_Class(Lua_Mob); return Lua_Mob(self->GetOwner()); } Lua_HateList Lua_Mob::GetHateList() { - Lua_Safe_Call_HateList(); + Lua_Safe_Call_Class(Lua_HateList); Lua_HateList ret; auto h_list = self->GetHateList(); @@ -775,17 +775,17 @@ Lua_HateList Lua_Mob::GetHateList() { } Lua_Mob Lua_Mob::GetHateTop() { - Lua_Safe_Call_Mob(); + Lua_Safe_Call_Class(Lua_Mob); return Lua_Mob(self->GetHateTop()); } Lua_Mob Lua_Mob::GetHateDamageTop(Lua_Mob other) { - Lua_Safe_Call_Mob(); + Lua_Safe_Call_Class(Lua_Mob); return Lua_Mob(self->GetHateDamageTop(other)); } Lua_Mob Lua_Mob::GetHateRandom() { - Lua_Safe_Call_Mob(); + Lua_Safe_Call_Class(Lua_Mob); return Lua_Mob(self->GetHateRandom()); } diff --git a/zone/lua_npc.cpp b/zone/lua_npc.cpp index df140bd4f..5ef7a0080 100644 --- a/zone/lua_npc.cpp +++ b/zone/lua_npc.cpp @@ -6,10 +6,522 @@ #include "masterentity.h" #include "lua_npc.h" +#include "lua_client.h" + +void Lua_NPC::Signal(int id) { + Lua_Safe_Call_Void(); + self->SignalNPC(id); +} + +int Lua_NPC::CheckNPCFactionAlly(int faction) { + Lua_Safe_Call_Int(); + return static_cast(self->CheckNPCFactionAlly(faction)); +} + +void Lua_NPC::AddItem(int item_id, int charges) { + Lua_Safe_Call_Void(); + self->AddItem(item_id, charges); +} + +void Lua_NPC::AddItem(int item_id, int charges, bool equip) { + Lua_Safe_Call_Void(); + self->AddItem(item_id, charges, equip); +} + +void Lua_NPC::AddLootTable() { + Lua_Safe_Call_Void(); + self->AddLootTable(); +} + +void Lua_NPC::AddLootTable(int id) { + Lua_Safe_Call_Void(); + self->AddLootTable(id); +} + +void Lua_NPC::RemoveItem(int item_id) { + Lua_Safe_Call_Void(); + self->RemoveItem(item_id); +} + +void Lua_NPC::RemoveItem(int item_id, int quantity) { + Lua_Safe_Call_Void(); + self->RemoveItem(item_id, quantity); +} + +void Lua_NPC::RemoveItem(int item_id, int quantity, int slot) { + Lua_Safe_Call_Void(); + self->RemoveItem(item_id, quantity, slot); +} + +void Lua_NPC::ClearItemList() { + Lua_Safe_Call_Void(); + self->ClearItemList(); +} + +void Lua_NPC::AddCash(int copper, int silver, int gold, int platinum) { + Lua_Safe_Call_Void(); + self->AddCash(copper, silver, gold, platinum); +} + +void Lua_NPC::RemoveCash() { + Lua_Safe_Call_Void(); + self->RemoveCash(); +} + +int Lua_NPC::CountLoot() { + Lua_Safe_Call_Int(); + return self->CountLoot(); +} + +int Lua_NPC::GetLoottableID() { + Lua_Safe_Call_Int(); + return self->GetLoottableID(); +} + +uint32 Lua_NPC::GetCopper() { + Lua_Safe_Call_Int(); + return self->GetCopper(); +} + +uint32 Lua_NPC::GetSilver() { + Lua_Safe_Call_Int(); + return self->GetSilver(); +} + +uint32 Lua_NPC::GetGold() { + Lua_Safe_Call_Int(); + return self->GetGold(); +} + +uint32 Lua_NPC::GetPlatinum() { + Lua_Safe_Call_Int(); + return self->GetPlatinum(); +} + +void Lua_NPC::SetCopper(uint32 amt) { + Lua_Safe_Call_Void(); + self->SetCopper(amt); +} + +void Lua_NPC::SetSilver(uint32 amt) { + Lua_Safe_Call_Void(); + self->SetSilver(amt); +} + +void Lua_NPC::SetGold(uint32 amt) { + Lua_Safe_Call_Void(); + self->SetGold(amt); +} + +void Lua_NPC::SetPlatinum(uint32 amt) { + Lua_Safe_Call_Void(); + self->SetPlatinum(amt); +} + +void Lua_NPC::SetGrid(int grid) { + Lua_Safe_Call_Void(); + self->SetGrid(grid); +} + +void Lua_NPC::SetSaveWaypoint(int wp) { + Lua_Safe_Call_Void(); + self->SetSaveWaypoint(wp); +} + +void Lua_NPC::SetSp2(int sg2) { + Lua_Safe_Call_Void(); + self->SetSp2(sg2); +} + +int Lua_NPC::GetWaypointMax() { + Lua_Safe_Call_Int(); + return self->GetWaypointMax(); +} + +int Lua_NPC::GetGrid() { + Lua_Safe_Call_Int(); + return self->GetGrid(); +} + +uint32 Lua_NPC::GetSp2() { + Lua_Safe_Call_Int(); + return self->GetSp2(); +} + +int Lua_NPC::GetNPCFactionID() { + Lua_Safe_Call_Int(); + return self->GetNPCFactionID(); +} + +int Lua_NPC::GetPrimaryFaction() { + Lua_Safe_Call_Int(); + return self->GetPrimaryFaction(); +} + +int Lua_NPC::GetNPCHate(Lua_Mob ent) { + Lua_Safe_Call_Int(); + return self->GetNPCHate(ent); +} + +bool Lua_NPC::IsOnHatelist(Lua_Mob ent) { + Lua_Safe_Call_Bool(); + return self->IsOnHatelist(ent); +} + +void Lua_NPC::SetNPCFactionID(int id) { + Lua_Safe_Call_Void(); + self->SetNPCFactionID(id); +} + +uint32 Lua_NPC::GetMaxDMG() { + Lua_Safe_Call_Int(); + return self->GetMaxDMG(); +} + +uint32 Lua_NPC::GetMinDMG() { + Lua_Safe_Call_Int(); + return self->GetMinDMG(); +} + +bool Lua_NPC::IsAnimal() { + Lua_Safe_Call_Bool(); + return self->IsAnimal(); +} + +int Lua_NPC::GetPetSpellID() { + Lua_Safe_Call_Int(); + return self->GetPetSpellID(); +} + +void Lua_NPC::SetPetSpellID(int id) { + Lua_Safe_Call_Void(); + self->SetPetSpellID(id); +} + +uint32 Lua_NPC::GetMaxDamage(int level) { + Lua_Safe_Call_Int(); + return self->GetMaxDamage(level); +} + +void Lua_NPC::SetTaunting(bool t) { + Lua_Safe_Call_Void(); + self->SetTaunting(t); +} + +void Lua_NPC::PickPocket(Lua_Client thief) { + Lua_Safe_Call_Void(); + self->PickPocket(thief); +} + +void Lua_NPC::StartSwarmTimer(uint32 duration) { + Lua_Safe_Call_Void(); + self->StartSwarmTimer(duration); +} + +void Lua_NPC::DoClassAttacks(Lua_Mob target) { + Lua_Safe_Call_Void(); + self->DoClassAttacks(target); +} + +int Lua_NPC::GetMaxWp() { + Lua_Safe_Call_Int(); + return self->GetMaxWp(); +} + +void Lua_NPC::DisplayWaypointInfo(Lua_Client to) { + Lua_Safe_Call_Void(); + self->DisplayWaypointInfo(to); +} + +void Lua_NPC::CalculateNewWaypoint() { + Lua_Safe_Call_Void(); + self->CalculateNewWaypoint(); +} + +void Lua_NPC::AssignWaypoints(int grid) { + Lua_Safe_Call_Void(); + self->AssignWaypoints(grid); +} + +void Lua_NPC::SetWaypointPause() { + Lua_Safe_Call_Void(); + self->SetWaypointPause(); +} + +void Lua_NPC::UpdateWaypoint(int wp) { + Lua_Safe_Call_Void(); + self->UpdateWaypoint(wp); +} + +void Lua_NPC::StopWandering() { + Lua_Safe_Call_Void(); + self->StopWandering(); +} + +void Lua_NPC::ResumeWandering() { + Lua_Safe_Call_Void(); + self->ResumeWandering(); +} + +void Lua_NPC::PauseWandering(int pause_time) { + Lua_Safe_Call_Void(); + self->PauseWandering(pause_time); +} + +void Lua_NPC::MoveTo(float x, float y, float z, float h, bool save) { + Lua_Safe_Call_Void(); + self->MoveTo(x, y, z, h, save); +} + +void Lua_NPC::NextGuardPosition() { + Lua_Safe_Call_Void(); + self->NextGuardPosition(); +} + +void Lua_NPC::SaveGuardSpot() { + Lua_Safe_Call_Void(); + self->SaveGuardSpot(); +} + +void Lua_NPC::SaveGuardSpot(bool clear) { + Lua_Safe_Call_Void(); + self->SaveGuardSpot(clear); +} + +bool Lua_NPC::IsGuarding() { + Lua_Safe_Call_Bool(); + return self->IsGuarding(); +} + +void Lua_NPC::AI_SetRoambox(float dist, float max_x, float min_x, float max_y, float min_y) { + Lua_Safe_Call_Void(); + self->AI_SetRoambox(dist, max_x, min_x, max_y, min_y); +} + +void Lua_NPC::AI_SetRoambox(float dist, float max_x, float min_x, float max_y, float min_y, uint32 delay) { + Lua_Safe_Call_Void(); + self->AI_SetRoambox(dist, max_x, min_x, max_y, min_y, delay); +} + +int Lua_NPC::GetNPCSpellsID() { + Lua_Safe_Call_Int(); + return self->GetNPCSpellsID(); +} + +int Lua_NPC::GetSpawnPointID() { + Lua_Safe_Call_Int(); + return self->GetSpawnPointID(); +} + +float Lua_NPC::GetSpawnPointX() { + Lua_Safe_Call_Real(); + return self->GetSpawnPointX(); +} + +float Lua_NPC::GetSpawnPointY() { + Lua_Safe_Call_Real(); + return self->GetSpawnPointY(); +} + +float Lua_NPC::GetSpawnPointZ() { + Lua_Safe_Call_Real(); + return self->GetSpawnPointZ(); +} + +float Lua_NPC::GetSpawnPointH() { + Lua_Safe_Call_Real(); + return self->GetSpawnPointH(); +} + +float Lua_NPC::GetGuardPointX() { + Lua_Safe_Call_Real(); + return self->GetGuardPointX(); +} + +float Lua_NPC::GetGuardPointY() { + Lua_Safe_Call_Real(); + return self->GetGuardPointY(); +} + +float Lua_NPC::GetGuardPointZ() { + Lua_Safe_Call_Real(); + return self->GetGuardPointZ(); +} + +void Lua_NPC::SetPrimSkill(int skill_id) { + Lua_Safe_Call_Void(); + self->SetPrimSkill(skill_id); +} + +void Lua_NPC::SetSecSkill(int skill_id) { + Lua_Safe_Call_Void(); + self->SetSecSkill(skill_id); +} + +int Lua_NPC::GetPrimSkill() { + Lua_Safe_Call_Int(); + return self->GetPrimSkill(); +} + +int Lua_NPC::GetSecSkill() { + Lua_Safe_Call_Int(); + return self->GetSecSkill(); +} + +int Lua_NPC::GetSwarmOwner() { + Lua_Safe_Call_Int(); + return self->GetSwarmOwner(); +} + +int Lua_NPC::GetSwarmTarget() { + Lua_Safe_Call_Int(); + return self->GetSwarmTarget(); +} + +void Lua_NPC::SetSwarmTarget(int target) { + Lua_Safe_Call_Void(); + self->SetSwarmTarget(target); +} + +void Lua_NPC::ModifyNPCStat(const char *stat, const char *value) { + Lua_Safe_Call_Void(); + self->ModifyNPCStat(stat, value); +} + +void Lua_NPC::AddAISpell(int priority, int spell_id, int type, int mana_cost, int recast_delay, int resist_adjust) { + Lua_Safe_Call_Void(); + self->AddSpellToNPCList(priority, spell_id, type, mana_cost, recast_delay, resist_adjust); +} + +void Lua_NPC::RemoveAISpell(int spell_id) { + Lua_Safe_Call_Void(); + self->RemoveSpellFromNPCList(spell_id); +} + +void Lua_NPC::SetSpellFocusDMG(int focus) { + Lua_Safe_Call_Void(); + self->SetSpellFocusDMG(focus); +} + +void Lua_NPC::SetSpellFocusHeal(int focus) { + Lua_Safe_Call_Void(); + self->SetSpellFocusHeal(focus); +} + +float Lua_NPC::GetSlowMitigation() { + Lua_Safe_Call_Real(); + return self->GetSlowMitigation(); +} + +float Lua_NPC::GetAttackSpeed() { + Lua_Safe_Call_Real(); + return self->GetAttackSpeed(); +} + +int Lua_NPC::GetAccuracyRating() { + Lua_Safe_Call_Int(); + return self->GetAccuracyRating(); +} + +int Lua_NPC::GetSpawnKillCount() { + Lua_Safe_Call_Int(); + return self->GetSpawnKillCount(); +} + +int Lua_NPC::GetScore() { + Lua_Safe_Call_Int(); + return self->GetScore(); +} + luabind::scope lua_register_npc() { return luabind::class_("NPC") - .def(luabind::constructor<>()); + .def(luabind::constructor<>()) + .def("Signal", (void(Lua_NPC::*)(int))&Lua_NPC::Signal) + .def("CheckNPCFactionAlly", (int(Lua_NPC::*)(int))&Lua_NPC::CheckNPCFactionAlly) + .def("AddItem", (void(Lua_NPC::*)(int,int))&Lua_NPC::AddItem) + .def("AddItem", (void(Lua_NPC::*)(int,int,bool))&Lua_NPC::AddItem) + .def("AddLootTable", (void(Lua_NPC::*)(void))&Lua_NPC::AddLootTable) + .def("AddLootTable", (void(Lua_NPC::*)(int))&Lua_NPC::AddLootTable) + .def("RemoveItem", (void(Lua_NPC::*)(int))&Lua_NPC::RemoveItem) + .def("RemoveItem", (void(Lua_NPC::*)(int,int))&Lua_NPC::RemoveItem) + .def("RemoveItem", (void(Lua_NPC::*)(int,int,int))&Lua_NPC::RemoveItem) + .def("ClearItemList", (void(Lua_NPC::*)(void))&Lua_NPC::ClearItemList) + .def("AddCash", (void(Lua_NPC::*)(int,int,int,int))&Lua_NPC::AddCash) + .def("RemoveCash", (void(Lua_NPC::*)(void))&Lua_NPC::RemoveCash) + .def("CountLoot", (int(Lua_NPC::*)(void))&Lua_NPC::CountLoot) + .def("GetLoottableID", (int(Lua_NPC::*)(void))&Lua_NPC::GetLoottableID) + .def("GetCopper", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetCopper) + .def("GetSilver", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetSilver) + .def("GetGold", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetGold) + .def("GetPlatinum", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetPlatinum) + .def("SetCopper", (void(Lua_NPC::*)(uint32))&Lua_NPC::SetCopper) + .def("SetSilver", (void(Lua_NPC::*)(uint32))&Lua_NPC::SetSilver) + .def("SetGold", (void(Lua_NPC::*)(uint32))&Lua_NPC::SetGold) + .def("SetPlatinum", (void(Lua_NPC::*)(uint32))&Lua_NPC::SetPlatinum) + .def("SetGrid", (void(Lua_NPC::*)(int))&Lua_NPC::SetGrid) + .def("SetSaveWaypoint", (void(Lua_NPC::*)(int))&Lua_NPC::SetSaveWaypoint) + .def("SetSp2", (void(Lua_NPC::*)(int))&Lua_NPC::SetSp2) + .def("GetWaypointMax", (int(Lua_NPC::*)(void))&Lua_NPC::GetWaypointMax) + .def("GetGrid", (int(Lua_NPC::*)(void))&Lua_NPC::GetGrid) + .def("GetSp2", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetSp2) + .def("GetNPCFactionID", (int(Lua_NPC::*)(void))&Lua_NPC::GetNPCFactionID) + .def("GetPrimaryFaction", (int(Lua_NPC::*)(void))&Lua_NPC::GetPrimaryFaction) + .def("GetNPCHate", (int(Lua_NPC::*)(Lua_Mob))&Lua_NPC::GetNPCHate) + .def("IsOnHatelist", (bool(Lua_NPC::*)(Lua_Mob))&Lua_NPC::IsOnHatelist) + .def("SetNPCFactionID", (void(Lua_NPC::*)(int))&Lua_NPC::SetNPCFactionID) + .def("GetMaxDMG", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetMaxDMG) + .def("GetMinDMG", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetMinDMG) + .def("IsAnimal", (bool(Lua_NPC::*)(void))&Lua_NPC::IsAnimal) + .def("GetPetSpellID", (int(Lua_NPC::*)(void))&Lua_NPC::GetPetSpellID) + .def("SetPetSpellID", (void(Lua_NPC::*)(int))&Lua_NPC::SetPetSpellID) + .def("GetMaxDamage", (uint32(Lua_NPC::*)(int))&Lua_NPC::GetMaxDamage) + .def("SetTaunting", (void(Lua_NPC::*)(bool))&Lua_NPC::SetTaunting) + .def("PickPocket", (void(Lua_NPC::*)(Lua_Client))&Lua_NPC::PickPocket) + .def("StartSwarmTimer", (void(Lua_NPC::*)(uint32))&Lua_NPC::StartSwarmTimer) + .def("DoClassAttacks", (void(Lua_NPC::*)(Lua_Mob))&Lua_NPC::DoClassAttacks) + .def("GetMaxWp", (int(Lua_NPC::*)(void))&Lua_NPC::GetMaxWp) + .def("DisplayWaypointInfo", (void(Lua_NPC::*)(Lua_Client))&Lua_NPC::DisplayWaypointInfo) + .def("CalculateNewWaypoint", (void(Lua_NPC::*)(void))&Lua_NPC::CalculateNewWaypoint) + .def("AssignWaypoints", (void(Lua_NPC::*)(int))&Lua_NPC::AssignWaypoints) + .def("SetWaypointPause", (void(Lua_NPC::*)(void))&Lua_NPC::SetWaypointPause) + .def("UpdateWaypoint", (void(Lua_NPC::*)(int))&Lua_NPC::UpdateWaypoint) + .def("StopWandering", (void(Lua_NPC::*)(void))&Lua_NPC::StopWandering) + .def("ResumeWandering", (void(Lua_NPC::*)(void))&Lua_NPC::ResumeWandering) + .def("PauseWandering", (void(Lua_NPC::*)(int))&Lua_NPC::PauseWandering) + .def("MoveTo", (void(Lua_NPC::*)(float,float,float,float,bool))&Lua_NPC::MoveTo) + .def("NextGuardPosition", (void(Lua_NPC::*)(void))&Lua_NPC::NextGuardPosition) + .def("SaveGuardSpot", (void(Lua_NPC::*)(void))&Lua_NPC::SaveGuardSpot) + .def("SaveGuardSpot", (void(Lua_NPC::*)(bool))&Lua_NPC::SaveGuardSpot) + .def("IsGuarding", (bool(Lua_NPC::*)(void))&Lua_NPC::IsGuarding) + .def("AI_SetRoambox", (void(Lua_NPC::*)(float,float,float,float,float))&Lua_NPC::AI_SetRoambox) + .def("AI_SetRoambox", (void(Lua_NPC::*)(float,float,float,float,float,uint32))&Lua_NPC::AI_SetRoambox) + .def("GetNPCSpellsID", (int(Lua_NPC::*)(void))&Lua_NPC::GetNPCSpellsID) + .def("GetSpawnPointID", (int(Lua_NPC::*)(void))&Lua_NPC::GetSpawnPointID) + .def("GetSpawnPointX", (float(Lua_NPC::*)(void))&Lua_NPC::GetSpawnPointX) + .def("GetSpawnPointY", (float(Lua_NPC::*)(void))&Lua_NPC::GetSpawnPointY) + .def("GetSpawnPointZ", (float(Lua_NPC::*)(void))&Lua_NPC::GetSpawnPointZ) + .def("GetSpawnPointH", (float(Lua_NPC::*)(void))&Lua_NPC::GetSpawnPointH) + .def("GetGuardPointX", (float(Lua_NPC::*)(void))&Lua_NPC::GetGuardPointX) + .def("GetGuardPointY", (float(Lua_NPC::*)(void))&Lua_NPC::GetGuardPointY) + .def("GetGuardPointZ", (float(Lua_NPC::*)(void))&Lua_NPC::GetGuardPointZ) + .def("SetPrimSkill", (void(Lua_NPC::*)(int))&Lua_NPC::SetPrimSkill) + .def("SetSecSkill", (void(Lua_NPC::*)(int))&Lua_NPC::SetSecSkill) + .def("GetPrimSkill", (int(Lua_NPC::*)(void))&Lua_NPC::GetPrimSkill) + .def("GetSecSkill", (int(Lua_NPC::*)(void))&Lua_NPC::GetSecSkill) + .def("GetSwarmOwner", (int(Lua_NPC::*)(void))&Lua_NPC::GetSwarmOwner) + .def("GetSwarmTarget", (int(Lua_NPC::*)(void))&Lua_NPC::GetSwarmTarget) + .def("SetSwarmTarget", (void(Lua_NPC::*)(int))&Lua_NPC::SetSwarmTarget) + .def("ModifyNPCStat", (void(Lua_NPC::*)(const char*,const char*))&Lua_NPC::ModifyNPCStat) + .def("AddAISpell", (void(Lua_NPC::*)(int,int,int,int,int,int))&Lua_NPC::AddAISpell) + .def("RemoveAISpell", (void(Lua_NPC::*)(int))&Lua_NPC::RemoveAISpell) + .def("SetSpellFocusDMG", (void(Lua_NPC::*)(int))&Lua_NPC::SetSpellFocusDMG) + .def("SetSpellFocusHeal", (void(Lua_NPC::*)(int))&Lua_NPC::SetSpellFocusHeal) + .def("GetSlowMitigation", (float(Lua_NPC::*)(void))&Lua_NPC::GetSlowMitigation) + .def("GetAttackSpeed", (float(Lua_NPC::*)(void))&Lua_NPC::GetAttackSpeed) + .def("GetAccuracyRating", (int(Lua_NPC::*)(void))&Lua_NPC::GetAccuracyRating) + .def("GetSpawnKillCount", (int(Lua_NPC::*)(void))&Lua_NPC::GetSpawnKillCount) + .def("GetScore", (int(Lua_NPC::*)(void))&Lua_NPC::GetScore); } #endif diff --git a/zone/lua_npc.h b/zone/lua_npc.h index 2e2254587..5ff56f63d 100644 --- a/zone/lua_npc.h +++ b/zone/lua_npc.h @@ -5,6 +5,10 @@ #include "lua_mob.h" class NPC; +class Lua_Mob; +class Lua_NPC; +class Lua_Client; + namespace luabind { struct scope; } @@ -27,6 +31,92 @@ public: return nullptr; } + + void Signal(int id); + int CheckNPCFactionAlly(int faction); + void AddItem(int item_id, int charges); + void AddItem(int item_id, int charges, bool equip); + void AddLootTable(); + void AddLootTable(int id); + void RemoveItem(int item_id); + void RemoveItem(int item_id, int quantity); + void RemoveItem(int item_id, int quantity, int slot); + void ClearItemList(); + void AddCash(int copper, int silver, int gold, int platinum); + void RemoveCash(); + int CountLoot(); + int GetLoottableID(); + uint32 GetCopper(); + uint32 GetSilver(); + uint32 GetGold(); + uint32 GetPlatinum(); + void SetCopper(uint32 amt); + void SetSilver(uint32 amt); + void SetGold(uint32 amt); + void SetPlatinum(uint32 amt); + void SetGrid(int grid); + void SetSaveWaypoint(int wp); + void SetSp2(int sg2); + int GetWaypointMax(); + int GetGrid(); + uint32 GetSp2(); + int GetNPCFactionID(); + int GetPrimaryFaction(); + int GetNPCHate(Lua_Mob ent); + bool IsOnHatelist(Lua_Mob ent); + void SetNPCFactionID(int id); + uint32 GetMaxDMG(); + uint32 GetMinDMG(); + bool IsAnimal(); + int GetPetSpellID(); + void SetPetSpellID(int id); + uint32 GetMaxDamage(int level); + void SetTaunting(bool t); + void PickPocket(Lua_Client thief); + void StartSwarmTimer(uint32 duration); + void DoClassAttacks(Lua_Mob target); + int GetMaxWp(); + void DisplayWaypointInfo(Lua_Client to); + void CalculateNewWaypoint(); + void AssignWaypoints(int grid); + void SetWaypointPause(); + void UpdateWaypoint(int wp); + void StopWandering(); + void ResumeWandering(); + void PauseWandering(int pause_time); + void MoveTo(float x, float y, float z, float h, bool save); + void NextGuardPosition(); + void SaveGuardSpot(); + void SaveGuardSpot(bool clear); + bool IsGuarding(); + void AI_SetRoambox(float dist, float max_x, float min_x, float max_y, float min_y); + void AI_SetRoambox(float dist, float max_x, float min_x, float max_y, float min_y, uint32 delay); + int GetNPCSpellsID(); + int GetSpawnPointID(); + float GetSpawnPointX(); + float GetSpawnPointY(); + float GetSpawnPointZ(); + float GetSpawnPointH(); + float GetGuardPointX(); + float GetGuardPointY(); + float GetGuardPointZ(); + void SetPrimSkill(int skill_id); + void SetSecSkill(int skill_id); + int GetPrimSkill(); + int GetSecSkill(); + int GetSwarmOwner(); + int GetSwarmTarget(); + void SetSwarmTarget(int target); + void ModifyNPCStat(const char *stat, const char *value); + void AddAISpell(int priority, int spell_id, int type, int mana_cost, int recast_delay, int resist_adjust); + void RemoveAISpell(int spell_id); + void SetSpellFocusDMG(int focus); + void SetSpellFocusHeal(int focus); + float GetSlowMitigation(); + float GetAttackSpeed(); + int GetAccuracyRating(); + int GetSpawnKillCount(); + int GetScore(); }; #endif diff --git a/zone/lua_object.cpp b/zone/lua_object.cpp new file mode 100644 index 000000000..9a7c45cd6 --- /dev/null +++ b/zone/lua_object.cpp @@ -0,0 +1,17 @@ +#ifdef LUA_EQEMU + +#include "lua.hpp" +#include +#include + +#include "masterentity.h" +#include "lua_object.h" + +luabind::scope lua_register_object() { + return luabind::class_("Object") + .def(luabind::constructor<>()) + .property("null", &Lua_Object::Null) + .property("valid", &Lua_Object::Valid); +} + +#endif diff --git a/zone/lua_object.h b/zone/lua_object.h new file mode 100644 index 000000000..d405ae169 --- /dev/null +++ b/zone/lua_object.h @@ -0,0 +1,34 @@ +#ifndef EQEMU_LUA_OBJECT_H +#define EQEMU_LUA_OBJECT_H +#ifdef LUA_EQEMU + +#include "lua_entity.h" + +class Object; + +namespace luabind { + struct scope; +} + +luabind::scope lua_register_object(); + +class Lua_Object : public Lua_Entity +{ + typedef Object NativeType; +public: + Lua_Object() { } + Lua_Object(Object *d) { SetLuaPtrData(d); } + virtual ~Lua_Object() { } + + operator Object*() { + void *d = GetLuaPtrData(); + if(d) { + return reinterpret_cast(d); + } + + return nullptr; + } +}; + +#endif +#endif diff --git a/zone/lua_parser.cpp b/zone/lua_parser.cpp index 556996e8b..117b8da47 100644 --- a/zone/lua_parser.cpp +++ b/zone/lua_parser.cpp @@ -17,10 +17,15 @@ #include "lua_iteminst.h" #include "lua_mob.h" #include "lua_hate_entry.h" -#include "lua_hate_list.h" #include "lua_client.h" #include "lua_npc.h" #include "lua_spell.h" +#include "lua_entity_list.h" +#include "lua_group.h" +#include "lua_raid.h" +#include "lua_corpse.h" +#include "lua_object.h" +#include "lua_door.h" #include "lua_general.h" #include "QGlobals.h" #include "questmgr.h" @@ -810,7 +815,19 @@ void LuaParser::MapFunctions(lua_State *L) { lua_register_item(), lua_register_spell(), lua_register_hate_entry(), - lua_register_hate_list() + lua_register_hate_list(), + lua_register_entity_list(), + lua_register_mob_list(), + lua_register_client_list(), + lua_register_npc_list(), + lua_register_corpse_list(), + lua_register_object_list(), + lua_register_door_list(), + lua_register_group(), + lua_register_raid(), + lua_register_corpse(), + lua_register_door(), + lua_register_object() ]; } catch(std::exception &ex) { @@ -944,6 +961,11 @@ void LuaParser::ExportZoneVariables() { return; } + Lua_EntityList l_entity_list(&entity_list); + luabind::object l_entity_list_o = luabind::object(L, l_entity_list); + l_entity_list_o.push(L); + lua_setfield(L, -2, "entity_list"); + lua_pushinteger(L, zone->GetZoneID()); lua_setfield(L, -2, "zone_id"); diff --git a/zone/lua_ptr.h b/zone/lua_ptr.h index f7382457f..11478f093 100644 --- a/zone/lua_ptr.h +++ b/zone/lua_ptr.h @@ -8,13 +8,7 @@ #define Lua_Safe_Call_Int() if(!d_) { return 0; } NativeType *self = reinterpret_cast(d_) #define Lua_Safe_Call_Real() if(!d_) { return 0.0; } NativeType *self = reinterpret_cast(d_) #define Lua_Safe_Call_String() if(!d_) { return ""; } NativeType *self = reinterpret_cast(d_) -#define Lua_Safe_Call_Entity() if(!d_) { return Lua_Entity(); } NativeType *self = reinterpret_cast(d_) -#define Lua_Safe_Call_Mob() if(!d_) { return Lua_Mob(); } NativeType *self = reinterpret_cast(d_) -#define Lua_Safe_Call_NPC() if(!d_) { return Lua_NPC(); } NativeType *self = reinterpret_cast(d_) -#define Lua_Safe_Call_Client() if(!d_) { return Lua_Client(); } NativeType *self = reinterpret_cast(d_) -#define Lua_Safe_Call_HateList() if(!d_) { return Lua_HateList(); } NativeType *self = reinterpret_cast(d_) -#define Lua_Safe_Call_Item() if(!d_) { return Lua_Item(); } NativeType *self = reinterpret_cast(d_) -#define Lua_Safe_Call_ItemInst() if(!d_) { return Lua_ItemInst(); } NativeType *self = reinterpret_cast(d_) +#define Lua_Safe_Call_Class(type) if(!d_) { return type(); } NativeType *self = reinterpret_cast(d_) template class Lua_Ptr diff --git a/zone/lua_raid.cpp b/zone/lua_raid.cpp new file mode 100644 index 000000000..b07138042 --- /dev/null +++ b/zone/lua_raid.cpp @@ -0,0 +1,22 @@ +#ifdef LUA_EQEMU + +#include "lua.hpp" +#include +#include + +#include "raid.h" +#include "masterentity.h" +#include "lua_raid.h" +#include "lua_entity.h" +#include "lua_mob.h" +#include "lua_client.h" +#include "lua_npc.h" + +luabind::scope lua_register_raid() { + return luabind::class_("Raid") + .def(luabind::constructor<>()) + .property("null", &Lua_Raid::Null) + .property("valid", &Lua_Raid::Valid); +} + +#endif diff --git a/zone/lua_raid.h b/zone/lua_raid.h new file mode 100644 index 000000000..be267426b --- /dev/null +++ b/zone/lua_raid.h @@ -0,0 +1,34 @@ +#ifndef EQEMU_LUA_RAID_H +#define EQEMU_LUA_RAID_H +#ifdef LUA_EQEMU + +#include "lua_ptr.h" + +class Raid; + +namespace luabind { + struct scope; +} + +luabind::scope lua_register_raid(); + +class Lua_Raid : public Lua_Ptr +{ + typedef Raid NativeType; +public: + Lua_Raid() { } + Lua_Raid(Raid *d) : Lua_Ptr(d) { } + virtual ~Lua_Raid() { } + + operator Raid*() { + void *d = GetLuaPtrData(); + if(d) { + return reinterpret_cast(d); + } + + return nullptr; + } +}; + +#endif +#endif diff --git a/zone/lua_spell.cpp b/zone/lua_spell.cpp index 0566f4eb2..f2535606c 100644 --- a/zone/lua_spell.cpp +++ b/zone/lua_spell.cpp @@ -6,11 +6,494 @@ #include "lua.hpp" #include +int Lua_Spell::GetID() { + Lua_Safe_Call_Int(); + return self->id; +} + +const char *Lua_Spell::GetName() { + Lua_Safe_Call_String(); + return self->name; +} + +const char *Lua_Spell::GetPlayer1() { + Lua_Safe_Call_String(); + return self->player_1; +} + +const char *Lua_Spell::GetTeleportZone() { + Lua_Safe_Call_String(); + return self->teleport_zone; +} + +const char *Lua_Spell::GetYouCast() { + Lua_Safe_Call_String(); + return self->you_cast; +} + +const char *Lua_Spell::GetOtherCasts() { + Lua_Safe_Call_String(); + return self->other_casts; +} + +const char *Lua_Spell::GetCastOnYou() { + Lua_Safe_Call_String(); + return self->cast_on_you; +} + +const char *Lua_Spell::GetCastOnOther() { + Lua_Safe_Call_String(); + return self->cast_on_other; +} + +const char *Lua_Spell::GetSpellFades() { + Lua_Safe_Call_String(); + return self->spell_fades; +} + +float Lua_Spell::GetRange() { + Lua_Safe_Call_Real(); + return self->range; +} + +float Lua_Spell::GetAoeRange() { + Lua_Safe_Call_Real(); + return self->aoerange; +} + +float Lua_Spell::GetPushBack() { + Lua_Safe_Call_Real(); + return self->pushback; +} + +float Lua_Spell::GetPushUp() { + Lua_Safe_Call_Real(); + return self->pushup; +} + +uint32 Lua_Spell::GetCastTime() { + Lua_Safe_Call_Int(); + return self->cast_time; +} + +uint32 Lua_Spell::GetRecoveryTime() { + Lua_Safe_Call_Int(); + return self->recovery_time; +} + +uint32 Lua_Spell::GetRecastTime() { + Lua_Safe_Call_Int(); + return self->recast_time; +} + +uint32 Lua_Spell::GetBuffdurationFormula() { + Lua_Safe_Call_Int(); + return self->buffdurationformula; +} + +uint32 Lua_Spell::GetBuffDuration() { + Lua_Safe_Call_Int(); + return self->buffduration; +} + +uint32 Lua_Spell::GetAEDuration() { + Lua_Safe_Call_Int(); + return self->AEDuration; +} + +int Lua_Spell::GetMana() { + Lua_Safe_Call_Int(); + return self->mana; +} + +int Lua_Spell::GetBase(int i) { + Lua_Safe_Call_Int(); + + if(i >= 12 || i < 0) { + return 0; + } + + return self->base[i]; +} + +int Lua_Spell::GetBase2(int i) { + Lua_Safe_Call_Int(); + + if(i >= 12 || i < 0) { + return 0; + } + + return self->base2[i]; +} + +int Lua_Spell::GetMax(int i) { + Lua_Safe_Call_Int(); + + if(i >= 12 || i < 0) { + return 0; + } + + return self->max[i]; +} + +int Lua_Spell::GetComponents(int i) { + Lua_Safe_Call_Int(); + + if(i >= 4 || i < 0) { + return 0; + } + + return self->components[i]; +} + +int Lua_Spell::GetComponentCounts(int i) { + Lua_Safe_Call_Int(); + + if(i >= 4 || i < 0) { + return 0; + } + + return self->component_counts[i]; +} + +int Lua_Spell::GetNoexpendReagent(int i) { + Lua_Safe_Call_Int(); + + if(i >= 4 || i < 0) { + return 0; + } + + return self->NoexpendReagent[i]; +} + +int Lua_Spell::GetFormula(int i) { + Lua_Safe_Call_Int(); + + if(i >= 12 || i < 0) { + return 0; + } + + return self->formula[i]; +} + +int Lua_Spell::GetGoodEffect() { + Lua_Safe_Call_Int(); + return self->goodEffect; +} + +int Lua_Spell::GetActivated() { + Lua_Safe_Call_Int(); + return self->Activated; +} + +int Lua_Spell::GetResistType() { + Lua_Safe_Call_Int(); + return self->resisttype; +} + +int Lua_Spell::GetEffectID(int i) { + Lua_Safe_Call_Int(); + + if(i >= 12 || i < 0) { + return 0; + } + + return self->effectid[i]; +} + +int Lua_Spell::GetTargetType() { + Lua_Safe_Call_Int(); + return self->targettype; +} + +int Lua_Spell::GetBaseDiff() { + Lua_Safe_Call_Int(); + return self->basediff; +} + +int Lua_Spell::GetSkill() { + Lua_Safe_Call_Int(); + return self->skill; +} + +int Lua_Spell::GetZoneType() { + Lua_Safe_Call_Int(); + return self->zonetype; +} + +int Lua_Spell::GetEnvironmentType() { + Lua_Safe_Call_Int(); + return self->EnvironmentType; +} + +int Lua_Spell::GetTimeOfDay() { + Lua_Safe_Call_Int(); + return self->TimeOfDay; +} + +int Lua_Spell::GetClasses(int i) { + Lua_Safe_Call_Int(); + + if(i >= 16 || i < 0) { + return 0; + } + + return self->classes[i]; +} + +int Lua_Spell::GetCastingAnim() { + Lua_Safe_Call_Int(); + return self->CastingAnim; +} + +int Lua_Spell::GetSpellAffectIndex() { + Lua_Safe_Call_Int(); + return self->SpellAffectIndex; +} + +int Lua_Spell::GetDisallowSit() { + Lua_Safe_Call_Int(); + return self->disallow_sit; +} + +int Lua_Spell::GetDeities(int i) { + Lua_Safe_Call_Int(); + + if(i >= 16 || i < 0) { + return 0; + } + + return self->deities[i]; +} + +int Lua_Spell::GetUninterruptable() { + Lua_Safe_Call_Int(); + return self->uninterruptable; +} + +int Lua_Spell::GetResistDiff() { + Lua_Safe_Call_Int(); + return self->ResistDiff; +} + +int Lua_Spell::GetRecourseLink() { + Lua_Safe_Call_Int(); + return self->RecourseLink; +} + +int Lua_Spell::GetShortBuffBox() { + Lua_Safe_Call_Int(); + return self->short_buff_box; +} + +int Lua_Spell::GetDescNum() { + Lua_Safe_Call_Int(); + return self->descnum; +} + +int Lua_Spell::GetEffectDescNum() { + Lua_Safe_Call_Int(); + return self->effectdescnum; +} + +int Lua_Spell::GetBonusHate() { + Lua_Safe_Call_Int(); + return self->bonushate; +} + +int Lua_Spell::GetEndurCost() { + Lua_Safe_Call_Int(); + return self->EndurCost; +} + +int Lua_Spell::GetEndurTimerIndex() { + Lua_Safe_Call_Int(); + return self->EndurUpkeep; +} + +int Lua_Spell::GetHateAdded() { + Lua_Safe_Call_Int(); + return self->HateAdded; +} + +int Lua_Spell::GetEndurUpkeep() { + Lua_Safe_Call_Int(); + return self->EndurUpkeep; +} + +int Lua_Spell::GetNumHits() { + Lua_Safe_Call_Int(); + return self->numhits; +} + +int Lua_Spell::GetPVPResistBase() { + Lua_Safe_Call_Int(); + return self->pvpresistbase; +} + +int Lua_Spell::GetPVPResistCalc() { + Lua_Safe_Call_Int(); + return self->pvpresistcalc; +} + +int Lua_Spell::GetPVPResistCap() { + Lua_Safe_Call_Int(); + return self->pvpresistcap; +} + +int Lua_Spell::GetSpellCategory() { + Lua_Safe_Call_Int(); + return self->spell_category; +} + +int Lua_Spell::GetCanMGB() { + Lua_Safe_Call_Int(); + return self->can_mgb; +} + +int Lua_Spell::GetDispelFlag() { + Lua_Safe_Call_Int(); + return self->dispel_flag; +} + +int Lua_Spell::GetMinResist() { + Lua_Safe_Call_Int(); + return self->MinResist; +} + +int Lua_Spell::GetMaxResist() { + Lua_Safe_Call_Int(); + return self->MaxResist; +} + +int Lua_Spell::GetViralTargets() { + Lua_Safe_Call_Int(); + return self->viral_targets; +} + +int Lua_Spell::GetViralTimer() { + Lua_Safe_Call_Int(); + return self->viral_timer; +} + +int Lua_Spell::GetNimbusEffect() { + Lua_Safe_Call_Int(); + return self->NimbusEffect; +} + +float Lua_Spell::GetDirectionalStart() { + Lua_Safe_Call_Real(); + return self->directional_start; +} + +float Lua_Spell::GetDirectionalEnd() { + Lua_Safe_Call_Real(); + return self->directional_end; +} + +int Lua_Spell::GetSpellGroup() { + Lua_Safe_Call_Int(); + return self->spellgroup; +} + +int Lua_Spell::GetPowerfulFlag() { + Lua_Safe_Call_Int(); + return self->powerful_flag; +} + +int Lua_Spell::GetCastRestriction() { + Lua_Safe_Call_Int(); + return self->CastRestriction; +} + +bool Lua_Spell::GetAllowRest() { + Lua_Safe_Call_Bool(); + return self->AllowRest; +} + +int Lua_Spell::GetDamageShieldType() { + Lua_Safe_Call_Int(); + return self->DamageShieldType; +} + + luabind::scope lua_register_spell() { return luabind::class_("Spell") .def(luabind::constructor<>()) .property("null", &Lua_Spell::Null) - .property("valid", &Lua_Spell::Valid); + .property("valid", &Lua_Spell::Valid) + .def("ID", &Lua_Spell::GetID) + .def("Name", &Lua_Spell::GetName) + .def("Player1", &Lua_Spell::GetPlayer1) + .def("TeleportZone", &Lua_Spell::GetTeleportZone) + .def("YouCast", &Lua_Spell::GetYouCast) + .def("OtherCasts", &Lua_Spell::GetOtherCasts) + .def("CastOnYou", &Lua_Spell::GetCastOnYou) + .def("CastOnOther", &Lua_Spell::GetCastOnOther) + .def("SpellFades", &Lua_Spell::GetSpellFades) + .def("Range", &Lua_Spell::GetRange) + .def("AoeRange", &Lua_Spell::GetAoeRange) + .def("PushBack", &Lua_Spell::GetPushBack) + .def("PushUp", &Lua_Spell::GetPushUp) + .def("CastTime", &Lua_Spell::GetCastTime) + .def("RecoveryTime", &Lua_Spell::GetRecoveryTime) + .def("RecastTime", &Lua_Spell::GetRecastTime) + .def("BuffdurationFormula", &Lua_Spell::GetBuffdurationFormula) + .def("BuffDuration", &Lua_Spell::GetBuffDuration) + .def("AEDuration", &Lua_Spell::GetAEDuration) + .def("Mana", &Lua_Spell::GetMana) + .def("Base", &Lua_Spell::GetBase) + .def("Base2", &Lua_Spell::GetBase2) + .def("Max", &Lua_Spell::GetMax) + .def("Components", &Lua_Spell::GetComponents) + .def("ComponentCounts", &Lua_Spell::GetComponentCounts) + .def("NoexpendReagent", &Lua_Spell::GetNoexpendReagent) + .def("Formula", &Lua_Spell::GetFormula) + .def("GoodEffect", &Lua_Spell::GetGoodEffect) + .def("Activated", &Lua_Spell::GetActivated) + .def("ResistType", &Lua_Spell::GetResistType) + .def("EffectID", &Lua_Spell::GetEffectID) + .def("TargetType", &Lua_Spell::GetTargetType) + .def("BaseDiff", &Lua_Spell::GetBaseDiff) + .def("Skill", &Lua_Spell::GetSkill) + .def("ZoneType", &Lua_Spell::GetZoneType) + .def("EnvironmentType", &Lua_Spell::GetEnvironmentType) + .def("TimeOfDay", &Lua_Spell::GetTimeOfDay) + .def("Classes", &Lua_Spell::GetClasses) + .def("CastingAnim", &Lua_Spell::GetCastingAnim) + .def("SpellAffectIndex", &Lua_Spell::GetSpellAffectIndex) + .def("DisallowSit", &Lua_Spell::GetDisallowSit) + .def("Deities", &Lua_Spell::GetDeities) + .def("Uninterruptable", &Lua_Spell::GetUninterruptable) + .def("ResistDiff", &Lua_Spell::GetResistDiff) + .def("RecourseLink", &Lua_Spell::GetRecourseLink) + .def("ShortBuffBox", &Lua_Spell::GetShortBuffBox) + .def("DescNum", &Lua_Spell::GetDescNum) + .def("EffectDescNum", &Lua_Spell::GetEffectDescNum) + .def("BonusHate", &Lua_Spell::GetBonusHate) + .def("EndurCost", &Lua_Spell::GetEndurCost) + .def("EndurTimerIndex", &Lua_Spell::GetEndurTimerIndex) + .def("HateAdded", &Lua_Spell::GetHateAdded) + .def("EndurUpkeep", &Lua_Spell::GetEndurUpkeep) + .def("NumHits", &Lua_Spell::GetNumHits) + .def("PVPResistBase", &Lua_Spell::GetPVPResistBase) + .def("PVPResistCalc", &Lua_Spell::GetPVPResistCalc) + .def("PVPResistCap", &Lua_Spell::GetPVPResistCap) + .def("SpellCategory", &Lua_Spell::GetSpellCategory) + .def("CanMGB", &Lua_Spell::GetCanMGB) + .def("DispelFlag", &Lua_Spell::GetDispelFlag) + .def("MinResist", &Lua_Spell::GetMinResist) + .def("MaxResist", &Lua_Spell::GetMaxResist) + .def("ViralTargets", &Lua_Spell::GetViralTargets) + .def("ViralTimer", &Lua_Spell::GetViralTimer) + .def("NimbusEffect", &Lua_Spell::GetNimbusEffect) + .def("DirectionalStart", &Lua_Spell::GetDirectionalStart) + .def("DirectionalEnd", &Lua_Spell::GetDirectionalEnd) + .def("SpellGroup", &Lua_Spell::GetSpellGroup) + .def("PowerfulFlag", &Lua_Spell::GetPowerfulFlag) + .def("CastRestriction", &Lua_Spell::GetCastRestriction) + .def("AllowRest", &Lua_Spell::GetAllowRest) + .def("DamageShieldType", &Lua_Spell::GetDamageShieldType); } #endif diff --git a/zone/lua_spell.h b/zone/lua_spell.h index d6f68409d..21b49340f 100644 --- a/zone/lua_spell.h +++ b/zone/lua_spell.h @@ -28,6 +28,79 @@ public: return nullptr; } + + int GetID(); + const char *GetName(); + const char *GetPlayer1(); + const char *GetTeleportZone(); + const char *GetYouCast(); + const char *GetOtherCasts(); + const char *GetCastOnYou(); + const char *GetCastOnOther(); + const char *GetSpellFades(); + float GetRange(); + float GetAoeRange(); + float GetPushBack(); + float GetPushUp(); + uint32 GetCastTime(); + uint32 GetRecoveryTime(); + uint32 GetRecastTime(); + uint32 GetBuffdurationFormula(); + uint32 GetBuffDuration(); + uint32 GetAEDuration(); + int GetMana(); + int GetBase(int i); + int GetBase2(int i); + int GetMax(int i); + int GetComponents(int i); + int GetComponentCounts(int i); + int GetNoexpendReagent(int i); + int GetFormula(int i); + int GetGoodEffect(); + int GetActivated(); + int GetResistType(); + int GetEffectID(int i); + int GetTargetType(); + int GetBaseDiff(); + int GetSkill(); + int GetZoneType(); + int GetEnvironmentType(); + int GetTimeOfDay(); + int GetClasses(int i); + int GetCastingAnim(); + int GetSpellAffectIndex(); + int GetDisallowSit(); + int GetDeities(int i); + int GetUninterruptable(); + int GetResistDiff(); + int GetRecourseLink(); + int GetShortBuffBox(); + int GetDescNum(); + int GetEffectDescNum(); + int GetBonusHate(); + int GetEndurCost(); + int GetEndurTimerIndex(); + int GetHateAdded(); + int GetEndurUpkeep(); + int GetNumHits(); + int GetPVPResistBase(); + int GetPVPResistCalc(); + int GetPVPResistCap(); + int GetSpellCategory(); + int GetCanMGB(); + int GetDispelFlag(); + int GetMinResist(); + int GetMaxResist(); + int GetViralTargets(); + int GetViralTimer(); + int GetNimbusEffect(); + float GetDirectionalStart(); + float GetDirectionalEnd(); + int GetSpellGroup(); + int GetPowerfulFlag(); + int GetCastRestriction(); + bool GetAllowRest(); + int GetDamageShieldType(); }; #endif