From 55a964267e9c5fe025e9a7239a1b535cd983fff1 Mon Sep 17 00:00:00 2001 From: KimLS Date: Sun, 2 Jun 2013 13:47:52 -0700 Subject: [PATCH] Raid/Group lua stuff, renamed corpses --- zone/AA.cpp | 2 +- zone/CMakeLists.txt | 8 +- zone/bot.h | 2 +- zone/{PlayerCorpse.cpp => corpse.cpp} | 0 zone/{PlayerCorpse.h => corpse.h} | 0 zone/entity.cpp | 1 - zone/lua_client.cpp | 4 +- zone/lua_corpse.cpp | 3 +- zone/lua_door.cpp | 2 +- zone/lua_entity.cpp | 3 +- zone/lua_entity_list.cpp | 1 - zone/lua_general.cpp | 1 - zone/lua_group.cpp | 109 ++++++++++++++++++++- zone/lua_group.h | 20 ++++ zone/lua_hate_entry.cpp | 2 +- zone/lua_hate_entry.h | 32 ------- zone/lua_hate_list.cpp | 69 ++++++++++++++ zone/lua_hate_list.h | 26 +++++ zone/lua_item.cpp | 1 - zone/lua_mob.cpp | 5 +- zone/lua_npc.cpp | 3 +- zone/lua_object.cpp | 3 +- zone/lua_parser.cpp | 2 +- zone/lua_raid.cpp | 132 +++++++++++++++++++++++++- zone/lua_raid.h | 24 +++++ zone/lua_spell.cpp | 6 +- zone/masterentity.h | 2 +- zone/perl_PlayerCorpse.cpp | 2 +- 28 files changed, 399 insertions(+), 66 deletions(-) rename zone/{PlayerCorpse.cpp => corpse.cpp} (100%) rename zone/{PlayerCorpse.h => corpse.h} (100%) delete mode 100644 zone/lua_hate_entry.h create mode 100644 zone/lua_hate_list.cpp diff --git a/zone/AA.cpp b/zone/AA.cpp index 7745e81f6..725219cd3 100644 --- a/zone/AA.cpp +++ b/zone/AA.cpp @@ -28,7 +28,7 @@ Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net) #include "object.h" #include "doors.h" #include "beacon.h" -#include "PlayerCorpse.h" +#include "corpse.h" #include "titles.h" #include "../common/races.h" #include "../common/classes.h" diff --git a/zone/CMakeLists.txt b/zone/CMakeLists.txt index cbfacb814..651f34055 100644 --- a/zone/CMakeLists.txt +++ b/zone/CMakeLists.txt @@ -14,6 +14,7 @@ SET(zone_sources client_packet.cpp client_process.cpp command.cpp + corpse.cpp doors.cpp effects.cpp embparser.cpp @@ -38,7 +39,7 @@ SET(zone_sources lua_entity_list.cpp lua_general.cpp lua_group.cpp - lua_hate_entry.cpp + lua_hate_list.cpp lua_item.cpp lua_iteminst.cpp lua_mob.cpp @@ -86,7 +87,6 @@ SET(zone_sources perlpacket.cpp petitions.cpp pets.cpp - PlayerCorpse.cpp QGlobals.cpp questmgr.cpp QuestParserCollection.cpp @@ -127,6 +127,7 @@ SET(zone_headers client_packet.h command.h common.h + corpse.h doors.h embparser.h embperl.h @@ -145,7 +146,7 @@ SET(zone_headers 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 @@ -169,7 +170,6 @@ SET(zone_headers perlpacket.h petitions.h pets.h - PlayerCorpse.h QGlobals.h QuestInterface.h questmgr.h diff --git a/zone/bot.h b/zone/bot.h index 4e657b369..1e6240373 100644 --- a/zone/bot.h +++ b/zone/bot.h @@ -8,7 +8,7 @@ #include "client.h" #include "pets.h" #include "groups.h" -#include "PlayerCorpse.h" +#include "corpse.h" #include "zonedb.h" #include "StringIDs.h" #include "../common/MiscFunctions.h" diff --git a/zone/PlayerCorpse.cpp b/zone/corpse.cpp similarity index 100% rename from zone/PlayerCorpse.cpp rename to zone/corpse.cpp diff --git a/zone/PlayerCorpse.h b/zone/corpse.h similarity index 100% rename from zone/PlayerCorpse.h rename to zone/corpse.h diff --git a/zone/entity.cpp b/zone/entity.cpp index 62df187cf..4aa53cec0 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -33,7 +33,6 @@ #include "net.h" #include "masterentity.h" #include "worldserver.h" -#include "PlayerCorpse.h" #include "../common/guilds.h" #include "../common/packet_dump.h" #include "../common/packet_functions.h" diff --git a/zone/lua_client.cpp b/zone/lua_client.cpp index f46603b7f..1c55c1504 100644 --- a/zone/lua_client.cpp +++ b/zone/lua_client.cpp @@ -2,16 +2,14 @@ #include "lua.hpp" #include -#include -#include "masterentity.h" +#include "client.h" #include "lua_client.h" #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 { }; diff --git a/zone/lua_corpse.cpp b/zone/lua_corpse.cpp index 50a39c3cb..409c842ab 100644 --- a/zone/lua_corpse.cpp +++ b/zone/lua_corpse.cpp @@ -2,9 +2,8 @@ #include "lua.hpp" #include -#include -#include "masterentity.h" +#include "corpse.h" #include "lua_corpse.h" luabind::scope lua_register_corpse() { diff --git a/zone/lua_door.cpp b/zone/lua_door.cpp index 10b0fc6e7..2db10ba7a 100644 --- a/zone/lua_door.cpp +++ b/zone/lua_door.cpp @@ -4,7 +4,7 @@ #include #include -#include "masterentity.h" +#include "doors.h" #include "lua_door.h" luabind::scope lua_register_door() { diff --git a/zone/lua_entity.cpp b/zone/lua_entity.cpp index 86e7e02c3..ea233af4b 100644 --- a/zone/lua_entity.cpp +++ b/zone/lua_entity.cpp @@ -2,9 +2,8 @@ #include "lua.hpp" #include -#include -#include "masterentity.h" +#include "entity.h" #include "lua_entity.h" #include "lua_mob.h" #include "lua_client.h" diff --git a/zone/lua_entity_list.cpp b/zone/lua_entity_list.cpp index fda2f3124..8308271eb 100644 --- a/zone/lua_entity_list.cpp +++ b/zone/lua_entity_list.cpp @@ -2,7 +2,6 @@ #include "lua.hpp" #include -#include #include #include "masterentity.h" diff --git a/zone/lua_general.cpp b/zone/lua_general.cpp index 13a3df2dc..052fd4f9a 100644 --- a/zone/lua_general.cpp +++ b/zone/lua_general.cpp @@ -2,7 +2,6 @@ #include "lua.hpp" #include -#include #include #include diff --git a/zone/lua_group.cpp b/zone/lua_group.cpp index ac5d464d4..23c12cae6 100644 --- a/zone/lua_group.cpp +++ b/zone/lua_group.cpp @@ -12,11 +12,118 @@ #include "lua_client.h" #include "lua_npc.h" +void Lua_Group::DisbandGroup() { + Lua_Safe_Call_Void(); + self->DisbandGroup(); +} + +bool Lua_Group::IsGroupMember(Lua_Mob mob) { + Lua_Safe_Call_Bool(); + return self->IsGroupMember(mob); +} + +void Lua_Group::CastGroupSpell(Lua_Mob caster, int spell_id) { + Lua_Safe_Call_Void(); + self->CastGroupSpell(caster, spell_id); +} + +void Lua_Group::SplitExp(uint32 exp, Lua_Mob other) { + Lua_Safe_Call_Void(); + self->SplitExp(exp, other); +} + +void Lua_Group::GroupMessage(Lua_Mob sender, int language, const char *message) { + Lua_Safe_Call_Void(); + self->GroupMessage(sender, language, 100, message); +} + +uint32 Lua_Group::GetTotalGroupDamage(Lua_Mob other) { + Lua_Safe_Call_Int(); + return self->GetTotalGroupDamage(other); +} + +void Lua_Group::SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum) { + Lua_Safe_Call_Void(); + self->SplitMoney(copper, silver, gold, platinum); +} + +void Lua_Group::SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum, Lua_Client splitter) { + Lua_Safe_Call_Void(); + self->SplitMoney(copper, silver, gold, platinum, splitter); +} + +void Lua_Group::SetLeader(Lua_Mob leader) { + Lua_Safe_Call_Void(); + self->SetLeader(leader); +} + +Lua_Mob Lua_Group::GetLeader() { + Lua_Safe_Call_Class(Lua_Mob); + return self->GetLeader(); +} + +const char *Lua_Group::GetLeaderName() { + Lua_Safe_Call_String(); + return self->GetLeaderName(); +} + +bool Lua_Group::IsLeader(Lua_Mob leader) { + Lua_Safe_Call_Bool(); + return self->IsLeader(leader); +} + +int Lua_Group::GroupCount() { + Lua_Safe_Call_Int(); + return self->GroupCount(); +} + +int Lua_Group::GetHighestLevel() { + Lua_Safe_Call_Int(); + return self->GetHighestLevel(); +} + +void Lua_Group::TeleportGroup(Lua_Mob sender, uint32 zone_id, uint32 instance_id, float x, float y, float z, float h) { + Lua_Safe_Call_Void(); + self->TeleportGroup(sender, zone_id, instance_id, x, y, z, h); +} + +int Lua_Group::GetID() { + Lua_Safe_Call_Int(); + return self->GetID(); +} + +Lua_Mob Lua_Group::GetMember(int index) { + Lua_Safe_Call_Class(Lua_Mob); + + if(index >= 6 || index < 0) { + return Lua_Mob(); + } + + return self->members[index]; +} + luabind::scope lua_register_group() { return luabind::class_("Group") .def(luabind::constructor<>()) .property("null", &Lua_Group::Null) - .property("valid", &Lua_Group::Valid); + .property("valid", &Lua_Group::Valid) + .def("DisbandGroup", (void(Lua_Group::*)(void))&Lua_Group::DisbandGroup) + .def("IsGroupMember", (bool(Lua_Group::*)(Lua_Mob))&Lua_Group::IsGroupMember) + .def("CastGroupSpell", (void(Lua_Group::*)(Lua_Mob,int))&Lua_Group::CastGroupSpell) + .def("SplitExp", (void(Lua_Group::*)(uint32,Lua_Mob))&Lua_Group::SplitExp) + .def("GroupMessage", (void(Lua_Group::*)(Lua_Mob,int,const char* message))&Lua_Group::GroupMessage) + .def("GetTotalGroupDamage", (uint32(Lua_Group::*)(Lua_Mob))&Lua_Group::GetTotalGroupDamage) + .def("SplitMoney", (void(Lua_Group::*)(uint32,uint32,uint32,uint32))&Lua_Group::SplitMoney) + .def("SplitMoney", (void(Lua_Group::*)(uint32,uint32,uint32,uint32,Lua_Client))&Lua_Group::SplitMoney) + .def("SetLeader", (void(Lua_Group::*)(Lua_Mob))&Lua_Group::SetLeader) + .def("GetLeader", (Lua_Mob(Lua_Group::*)(void))&Lua_Group::GetLeader) + .def("GetLeaderName", (const char*(Lua_Group::*)(void))&Lua_Group::GetLeaderName) + .def("IsLeader", (bool(Lua_Group::*)(Lua_Mob))&Lua_Group::IsLeader) + .def("GroupCount", (int(Lua_Group::*)(void))&Lua_Group::GroupCount) + .def("GetHighestLevel", (int(Lua_Group::*)(void))&Lua_Group::GetHighestLevel) + .def("TeleportGroup", (void(Lua_Group::*)(Lua_Mob,uint32,uint32,float,float,float,float))&Lua_Group::TeleportGroup) + .def("GetID", (int(Lua_Group::*)(void))&Lua_Group::GetID) + .def("GetMember", (Lua_Mob(Lua_Group::*)(int))&Lua_Group::GetMember); } #endif diff --git a/zone/lua_group.h b/zone/lua_group.h index bc2e1b962..baa926059 100644 --- a/zone/lua_group.h +++ b/zone/lua_group.h @@ -5,6 +5,8 @@ #include "lua_ptr.h" class Group; +class Lua_Mob; +class Lua_Client; namespace luabind { struct scope; @@ -28,6 +30,24 @@ public: return nullptr; } + + void DisbandGroup(); + bool IsGroupMember(Lua_Mob mob); + void CastGroupSpell(Lua_Mob caster, int spell_id); + void SplitExp(uint32 exp, Lua_Mob other); + void GroupMessage(Lua_Mob sender, int language, const char *message); + uint32 GetTotalGroupDamage(Lua_Mob other); + void SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum); + void SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum, Lua_Client splitter); + void SetLeader(Lua_Mob leader); + Lua_Mob GetLeader(); + const char *GetLeaderName(); + bool IsLeader(Lua_Mob leader); + int GroupCount(); + int GetHighestLevel(); + void TeleportGroup(Lua_Mob sender, uint32 zone_id, uint32 instance_id, float x, float y, float z, float h); + int GetID(); + Lua_Mob GetMember(int index); }; #endif diff --git a/zone/lua_hate_entry.cpp b/zone/lua_hate_entry.cpp index 10f9b41e8..14eed4a7f 100644 --- a/zone/lua_hate_entry.cpp +++ b/zone/lua_hate_entry.cpp @@ -8,7 +8,7 @@ #include "masterentity.h" #include "hate_list.h" #include "lua_mob.h" -#include "lua_hate_entry.h" +#include "lua_hate_list.h" struct Lua_HateList { diff --git a/zone/lua_hate_entry.h b/zone/lua_hate_entry.h deleted file mode 100644 index 78cafea85..000000000 --- a/zone/lua_hate_entry.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef EQEMU_LUA_HATE_ENTRY_H -#define EQEMU_LUA_HATE_ENTRY_H -#ifdef LUA_EQEMU - -#include "lua_ptr.h" - -class Lua_Mob; -struct tHateEntry; - -luabind::scope lua_register_hate_entry(); -luabind::scope lua_register_hate_list(); - -class Lua_HateEntry : public Lua_Ptr -{ - typedef tHateEntry NativeType; -public: - Lua_HateEntry() { } - Lua_HateEntry(tHateEntry *d) : Lua_Ptr(d) { } - virtual ~Lua_HateEntry() { } - - Lua_Mob GetEnt(); - void SetEnt(Lua_Mob e); - int GetDamage(); - void SetDamage(int value); - int GetHate(); - void SetHate(int value); - int GetFrenzy(); - void SetFrenzy(bool value); -}; - -#endif -#endif diff --git a/zone/lua_hate_list.cpp b/zone/lua_hate_list.cpp new file mode 100644 index 000000000..edca6ee11 --- /dev/null +++ b/zone/lua_hate_list.cpp @@ -0,0 +1,69 @@ +#ifdef LUA_EQEMU + +#include "lua.hpp" +#include +#include +#include + +#include "masterentity.h" +#include "hate_list.h" +#include "lua_mob.h" +#include "lua_hate_list.h" + +Lua_Mob Lua_HateEntry::GetEnt() { + Lua_Safe_Call_Class(Lua_Mob); + return Lua_Mob(self->ent); +} + +void Lua_HateEntry::SetEnt(Lua_Mob e) { + Lua_Safe_Call_Void(); + self->ent = e; +} + +int Lua_HateEntry::GetDamage() { + Lua_Safe_Call_Int(); + return self->damage; +} + +void Lua_HateEntry::SetDamage(int value) { + Lua_Safe_Call_Void(); + self->damage = value; +} + +int Lua_HateEntry::GetHate() { + Lua_Safe_Call_Int(); + return self->hate; +} + +void Lua_HateEntry::SetHate(int value) { + Lua_Safe_Call_Void(); + self->hate = value; +} + +int Lua_HateEntry::GetFrenzy() { + Lua_Safe_Call_Int(); + return self->bFrenzy; +} + +void Lua_HateEntry::SetFrenzy(bool value) { + Lua_Safe_Call_Void(); + self->bFrenzy = value; +} + +luabind::scope lua_register_hate_entry() { + + return luabind::class_("HateEntry") + .property("null", &Lua_HateEntry::Null) + .property("valid", &Lua_HateEntry::Valid) + .property("ent", &Lua_HateEntry::GetEnt, &Lua_HateEntry::SetEnt) + .property("damage", &Lua_HateEntry::GetDamage, &Lua_HateEntry::SetDamage) + .property("hate", &Lua_HateEntry::GetHate, &Lua_HateEntry::SetHate) + .property("frenzy", &Lua_HateEntry::GetFrenzy, &Lua_HateEntry::SetFrenzy); +} + +luabind::scope lua_register_hate_list() { + return luabind::class_("HateList") + .def_readwrite("entries", &Lua_HateList::entries, luabind::return_stl_iterator); +} + +#endif diff --git a/zone/lua_hate_list.h b/zone/lua_hate_list.h index e4eb347b1..d5a952fca 100644 --- a/zone/lua_hate_list.h +++ b/zone/lua_hate_list.h @@ -2,6 +2,32 @@ #define EQEMU_LUA_HATE_LIST_H #ifdef LUA_EQEMU +#include "lua_ptr.h" + +class Lua_Mob; +struct tHateEntry; + +luabind::scope lua_register_hate_entry(); +luabind::scope lua_register_hate_list(); + +class Lua_HateEntry : public Lua_Ptr +{ + typedef tHateEntry NativeType; +public: + Lua_HateEntry() { } + Lua_HateEntry(tHateEntry *d) : Lua_Ptr(d) { } + virtual ~Lua_HateEntry() { } + + Lua_Mob GetEnt(); + void SetEnt(Lua_Mob e); + int GetDamage(); + void SetDamage(int value); + int GetHate(); + void SetHate(int value); + int GetFrenzy(); + void SetFrenzy(bool value); +}; + struct Lua_HateList { std::vector entries; diff --git a/zone/lua_item.cpp b/zone/lua_item.cpp index b0fedd159..16254c52e 100644 --- a/zone/lua_item.cpp +++ b/zone/lua_item.cpp @@ -2,7 +2,6 @@ #include "lua.hpp" #include -#include #include "masterentity.h" #include "lua_item.h" diff --git a/zone/lua_mob.cpp b/zone/lua_mob.cpp index e0fd2cddc..f938c10c2 100644 --- a/zone/lua_mob.cpp +++ b/zone/lua_mob.cpp @@ -2,13 +2,12 @@ #include "lua.hpp" #include -#include -#include "masterentity.h" +#include "client.h" +#include "npc.h" #include "lua_item.h" #include "lua_iteminst.h" #include "lua_mob.h" -#include "lua_hate_entry.h" #include "lua_hate_list.h" #include "lua_client.h" diff --git a/zone/lua_npc.cpp b/zone/lua_npc.cpp index 5ef7a0080..184bf2a4a 100644 --- a/zone/lua_npc.cpp +++ b/zone/lua_npc.cpp @@ -2,9 +2,8 @@ #include "lua.hpp" #include -#include -#include "masterentity.h" +#include "npc.h" #include "lua_npc.h" #include "lua_client.h" diff --git a/zone/lua_object.cpp b/zone/lua_object.cpp index 9a7c45cd6..504b41eb7 100644 --- a/zone/lua_object.cpp +++ b/zone/lua_object.cpp @@ -2,9 +2,8 @@ #include "lua.hpp" #include -#include -#include "masterentity.h" +#include "object.h" #include "lua_object.h" luabind::scope lua_register_object() { diff --git a/zone/lua_parser.cpp b/zone/lua_parser.cpp index 117b8da47..183a7c725 100644 --- a/zone/lua_parser.cpp +++ b/zone/lua_parser.cpp @@ -16,7 +16,7 @@ #include "lua_item.h" #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" diff --git a/zone/lua_raid.cpp b/zone/lua_raid.cpp index b07138042..295fe0220 100644 --- a/zone/lua_raid.cpp +++ b/zone/lua_raid.cpp @@ -12,11 +12,141 @@ #include "lua_client.h" #include "lua_npc.h" +bool Lua_Raid::IsRaidMember(const char *name) { + Lua_Safe_Call_Bool(); + return self->IsRaidMember(name); +} + +void Lua_Raid::CastGroupSpell(Lua_Mob caster, int spell_id, uint32 group_id) { + Lua_Safe_Call_Void(); + self->CastGroupSpell(caster, spell_id, group_id); +} + +int Lua_Raid::GroupCount(uint32 group_id) { + Lua_Safe_Call_Int(); + return self->GroupCount(group_id); +} + +int Lua_Raid::RaidCount() { + Lua_Safe_Call_Int(); + return self->RaidCount(); +} + +uint32 Lua_Raid::GetGroup(const char *c) { + Lua_Safe_Call_Int(); + return self->GetGroup(c); +} + +uint32 Lua_Raid::GetGroup(Lua_Client c) { + Lua_Safe_Call_Int(); + return self->GetGroup(c); +} + +void Lua_Raid::SplitExp(uint32 exp, Lua_Mob other) { + Lua_Safe_Call_Void(); + self->SplitExp(exp, other); +} + +uint32 Lua_Raid::GetTotalRaidDamage(Lua_Mob other) { + Lua_Safe_Call_Int(); + return self->GetTotalRaidDamage(other); +} + +void Lua_Raid::SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum) { + Lua_Safe_Call_Void(); + self->SplitMoney(copper, silver, gold, platinum); +} + +void Lua_Raid::SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum, Lua_Client splitter) { + Lua_Safe_Call_Void(); + self->SplitMoney(copper, silver, gold, platinum, splitter); +} + +void Lua_Raid::BalanceHP(int penalty, uint32 group_id) { + Lua_Safe_Call_Void(); + self->BalanceHP(penalty, group_id); +} + +bool Lua_Raid::IsLeader(const char *c) { + Lua_Safe_Call_Bool(); + return self->IsLeader(c); +} + +bool Lua_Raid::IsLeader(Lua_Client c) { + Lua_Safe_Call_Bool(); + return self->IsLeader(c); +} + +bool Lua_Raid::IsGroupLeader(const char *name) { + Lua_Safe_Call_Bool(); + return self->IsGroupLeader(name); +} + +int Lua_Raid::GetHighestLevel() { + Lua_Safe_Call_Int(); + return self->GetHighestLevel(); +} + +int Lua_Raid::GetLowestLevel() { + Lua_Safe_Call_Int(); + return self->GetLowestLevel(); +} + +Lua_Client Lua_Raid::GetClientByIndex(int index) { + Lua_Safe_Call_Class(Lua_Client); + return self->GetClientByIndex(index); +} + +void Lua_Raid::TeleportGroup(Lua_Mob sender, uint32 zone_id, uint32 instance_id, float x, float y, float z, float h, uint32 group_id) { + Lua_Safe_Call_Void(); + self->TeleportGroup(sender, zone_id, instance_id, x, y, z, h, group_id); +} + +void Lua_Raid::TeleportRaid(Lua_Mob sender, uint32 zone_id, uint32 instance_id, float x, float y, float z, float h) { + Lua_Safe_Call_Void(); + self->TeleportRaid(sender, zone_id, instance_id, x, y, z, h); +} + +int Lua_Raid::GetID() { + Lua_Safe_Call_Int(); + return self->GetID(); +} + +Lua_Client Lua_Raid::GetMember(int index) { + Lua_Safe_Call_Class(Lua_Client); + + if(index >= 72 || index < 0) { + return Lua_Client(); + } + + return self->members[index].member; +} + + luabind::scope lua_register_raid() { return luabind::class_("Raid") .def(luabind::constructor<>()) .property("null", &Lua_Raid::Null) - .property("valid", &Lua_Raid::Valid); + .property("valid", &Lua_Raid::Valid) + .def("IsRaidMember", (bool(Lua_Raid::*)(const char*))&Lua_Raid::IsRaidMember) + .def("CastGroupSpell", (void(Lua_Raid::*)(Lua_Mob,int,uint32))&Lua_Raid::CastGroupSpell) + .def("GroupCount", (int(Lua_Raid::*)(uint32))&Lua_Raid::GroupCount) + .def("RaidCount", (int(Lua_Raid::*)(void))&Lua_Raid::RaidCount) + .def("GetGroup", (uint32(Lua_Raid::*)(const char*))&Lua_Raid::GetGroup) + .def("SplitExp", (void(Lua_Raid::*)(uint32,Lua_Mob))&Lua_Raid::SplitExp) + .def("GetTotalRaidDamage", (uint32(Lua_Raid::*)(Lua_Mob))&Lua_Raid::GetTotalRaidDamage) + .def("SplitMoney", (void(Lua_Raid::*)(uint32,uint32,uint32,uint32))&Lua_Raid::SplitMoney) + .def("SplitMoney", (void(Lua_Raid::*)(uint32,uint32,uint32,uint32,Lua_Client))&Lua_Raid::SplitMoney) + .def("BalanceHP", (void(Lua_Raid::*)(int,uint32))&Lua_Raid::BalanceHP) + .def("IsLeader", (bool(Lua_Raid::*)(const char*))&Lua_Raid::IsLeader) + .def("IsGroupLeader", (bool(Lua_Raid::*)(const char*))&Lua_Raid::IsGroupLeader) + .def("GetHighestLevel", (int(Lua_Raid::*)(void))&Lua_Raid::GetHighestLevel) + .def("GetLowestLevel", (int(Lua_Raid::*)(void))&Lua_Raid::GetLowestLevel) + .def("GetClientByIndex", (Lua_Client(Lua_Raid::*)(int))&Lua_Raid::GetClientByIndex) + .def("TeleportGroup", (int(Lua_Raid::*)(Lua_Mob,uint32,uint32,float,float,float,float,uint32))&Lua_Raid::TeleportGroup) + .def("TeleportRaid", (int(Lua_Raid::*)(Lua_Mob,uint32,uint32,float,float,float,float))&Lua_Raid::TeleportRaid) + .def("GetID", (int(Lua_Raid::*)(void))&Lua_Raid::GetID) + .def("GetMember", (Lua_Client(Lua_Raid::*)(int))&Lua_Raid::GetMember); } #endif diff --git a/zone/lua_raid.h b/zone/lua_raid.h index be267426b..9ca04f8f4 100644 --- a/zone/lua_raid.h +++ b/zone/lua_raid.h @@ -5,6 +5,8 @@ #include "lua_ptr.h" class Raid; +class Lua_Client; +class Lua_Mob; namespace luabind { struct scope; @@ -28,6 +30,28 @@ public: return nullptr; } + + bool IsRaidMember(const char *name); + void CastGroupSpell(Lua_Mob caster, int spell_id, uint32 group_id); + int GroupCount(uint32 group_id); + int RaidCount(); + uint32 GetGroup(const char *c); + uint32 GetGroup(Lua_Client c); + void SplitExp(uint32 exp, Lua_Mob other); + uint32 GetTotalRaidDamage(Lua_Mob other); + void SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum); + void SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum, Lua_Client splitter); + void BalanceHP(int penalty, uint32 group_id); + bool IsLeader(const char *c); + bool IsLeader(Lua_Client c); + bool IsGroupLeader(const char *name); + int GetHighestLevel(); + int GetLowestLevel(); + Lua_Client GetClientByIndex(int index); + void TeleportGroup(Lua_Mob sender, uint32 zone_id, uint32 instance_id, float x, float y, float z, float h, uint32 group_id); + void TeleportRaid(Lua_Mob sender, uint32 zone_id, uint32 instance_id, float x, float y, float z, float h); + int GetID(); + Lua_Client GetMember(int index); }; #endif diff --git a/zone/lua_spell.cpp b/zone/lua_spell.cpp index f2535606c..84fd6311c 100644 --- a/zone/lua_spell.cpp +++ b/zone/lua_spell.cpp @@ -1,11 +1,11 @@ #ifdef LUA_EQEMU -#include "../common/spdat.h" -#include "lua_spell.h" - #include "lua.hpp" #include +#include "../common/spdat.h" +#include "lua_spell.h" + int Lua_Spell::GetID() { Lua_Safe_Call_Int(); return self->id; diff --git a/zone/masterentity.h b/zone/masterentity.h index 3764028d4..8c238ed34 100644 --- a/zone/masterentity.h +++ b/zone/masterentity.h @@ -6,7 +6,7 @@ #include "raids.h" #include "client.h" #include "object.h" -#include "PlayerCorpse.h" +#include "corpse.h" #include "doors.h" #include "mob.h" #include "trap.h" diff --git a/zone/perl_PlayerCorpse.cpp b/zone/perl_PlayerCorpse.cpp index 7fedb85c2..366299ea2 100644 --- a/zone/perl_PlayerCorpse.cpp +++ b/zone/perl_PlayerCorpse.cpp @@ -34,7 +34,7 @@ #undef seed #endif -#include "PlayerCorpse.h" +#include "corpse.h" #ifdef THIS /* this macro seems to leak out on some systems */ #undef THIS