mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 05:21:29 +00:00
Lua corpse API
This commit is contained in:
parent
55a964267e
commit
ff091e940c
@ -5,10 +5,185 @@
|
|||||||
|
|
||||||
#include "corpse.h"
|
#include "corpse.h"
|
||||||
#include "lua_corpse.h"
|
#include "lua_corpse.h"
|
||||||
|
#include "lua_client.h"
|
||||||
|
|
||||||
|
uint32 Lua_Corpse::GetCharID() {
|
||||||
|
Lua_Safe_Call_Int();
|
||||||
|
return self->GetCharID();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 Lua_Corpse::GetDecayTime() {
|
||||||
|
Lua_Safe_Call_Int();
|
||||||
|
return self->GetDecayTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Lua_Corpse::Lock() {
|
||||||
|
Lua_Safe_Call_Void();
|
||||||
|
self->Lock();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Lua_Corpse::UnLock() {
|
||||||
|
Lua_Safe_Call_Void();
|
||||||
|
self->UnLock();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Lua_Corpse::IsLocked() {
|
||||||
|
Lua_Safe_Call_Bool();
|
||||||
|
return self->IsLocked();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Lua_Corpse::ResetLooter() {
|
||||||
|
Lua_Safe_Call_Void();
|
||||||
|
self->ResetLooter();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 Lua_Corpse::GetDBID() {
|
||||||
|
Lua_Safe_Call_Int();
|
||||||
|
return self->GetDBID();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Lua_Corpse::IsRezzed() {
|
||||||
|
Lua_Safe_Call_Bool();
|
||||||
|
return self->Rezzed();
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* Lua_Corpse::GetOwnerName() {
|
||||||
|
Lua_Safe_Call_String();
|
||||||
|
return self->GetOwnerName();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Lua_Corpse::Save() {
|
||||||
|
Lua_Safe_Call_Bool();
|
||||||
|
return self->Save();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Lua_Corpse::Delete() {
|
||||||
|
Lua_Safe_Call_Void();
|
||||||
|
self->Delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Lua_Corpse::Bury() {
|
||||||
|
Lua_Safe_Call_Void();
|
||||||
|
self->Bury();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Lua_Corpse::Depop() {
|
||||||
|
Lua_Safe_Call_Void();
|
||||||
|
self->Depop();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 Lua_Corpse::CountItems() {
|
||||||
|
Lua_Safe_Call_Int();
|
||||||
|
return self->CountItems();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Lua_Corpse::AddItem(uint32 itemnum, uint16 charges, int16 slot, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5) {
|
||||||
|
Lua_Safe_Call_Void();
|
||||||
|
self->AddItem(itemnum, charges, slot, aug1, aug2, aug3, aug4, aug5);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 Lua_Corpse::GetWornItem(int16 equipSlot) {
|
||||||
|
Lua_Safe_Call_Int();
|
||||||
|
return self->GetWornItem(equipSlot);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Lua_Corpse::RemoveItem(uint16 lootslot) {
|
||||||
|
Lua_Safe_Call_Void();
|
||||||
|
self->RemoveItem(lootslot);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Lua_Corpse::SetCash(uint32 copper, uint32 silver, uint32 gold, uint32 platinum) {
|
||||||
|
Lua_Safe_Call_Void();
|
||||||
|
self->SetCash(copper, silver, gold, platinum);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Lua_Corpse::RemoveCash() {
|
||||||
|
Lua_Safe_Call_Void();
|
||||||
|
self->RemoveCash();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Lua_Corpse::IsEmpty() {
|
||||||
|
Lua_Safe_Call_Bool();
|
||||||
|
return self->IsEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Lua_Corpse::SetDecayTimer(uint32 decaytime) {
|
||||||
|
Lua_Safe_Call_Void();
|
||||||
|
self->SetDecayTimer(decaytime);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Lua_Corpse::CanMobLoot(int charid) {
|
||||||
|
Lua_Safe_Call_Bool();
|
||||||
|
return self->CanMobLoot(charid);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Lua_Corpse::AllowMobLoot(Lua_Mob them, uint8 slot) {
|
||||||
|
Lua_Safe_Call_Void();
|
||||||
|
self->AllowMobLoot(them, slot);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Lua_Corpse::Summon(Lua_Client client, bool spell, bool checkdistance) {
|
||||||
|
Lua_Safe_Call_Bool();
|
||||||
|
return self->Summon(client, spell, checkdistance);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 Lua_Corpse::GetCopper() {
|
||||||
|
Lua_Safe_Call_Int();
|
||||||
|
return self->GetCopper();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 Lua_Corpse::GetSilver() {
|
||||||
|
Lua_Safe_Call_Int();
|
||||||
|
return self->GetSilver();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 Lua_Corpse::GetGold() {
|
||||||
|
Lua_Safe_Call_Int();
|
||||||
|
return self->GetGold();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 Lua_Corpse::GetPlatinum() {
|
||||||
|
Lua_Safe_Call_Int();
|
||||||
|
return self->GetPlatinum();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Lua_Corpse::AddLooter(Lua_Mob who) {
|
||||||
|
Lua_Safe_Call_Void();
|
||||||
|
self->AddLooter(who);
|
||||||
|
}
|
||||||
|
|
||||||
luabind::scope lua_register_corpse() {
|
luabind::scope lua_register_corpse() {
|
||||||
return luabind::class_<Lua_Corpse, Lua_Mob>("Corpse")
|
return luabind::class_<Lua_Corpse, Lua_Mob>("Corpse")
|
||||||
.def(luabind::constructor<>())
|
.def(luabind::constructor<>())
|
||||||
|
.def("GetCharID", (uint32(Lua_Corpse::*)(void))&Lua_Corpse::GetCharID)
|
||||||
|
.def("GetDecayTime", (uint32(Lua_Corpse::*)(void))&Lua_Corpse::GetDecayTime)
|
||||||
|
.def("Lock", (void(Lua_Corpse::*)(void))&Lua_Corpse::Lock)
|
||||||
|
.def("UnLock", (void(Lua_Corpse::*)(void))&Lua_Corpse::UnLock)
|
||||||
|
.def("IsLocked", (bool(Lua_Corpse::*)(void))&Lua_Corpse::IsLocked)
|
||||||
|
.def("ResetLooter", (void(Lua_Corpse::*)(void))&Lua_Corpse::ResetLooter)
|
||||||
|
.def("GetDBID", (uint32(Lua_Corpse::*)(void))&Lua_Corpse::GetDBID)
|
||||||
|
.def("IsRezzed", (bool(Lua_Corpse::*)(void))&Lua_Corpse::IsRezzed)
|
||||||
|
.def("GetOwnerName", (const char *(Lua_Corpse::*)(void))&Lua_Corpse::GetOwnerName)
|
||||||
|
.def("Save", (bool(Lua_Corpse::*)(void))&Lua_Corpse::Save)
|
||||||
|
.def("Delete", (void(Lua_Corpse::*)(void))&Lua_Corpse::Delete)
|
||||||
|
.def("Bury", (void(Lua_Corpse::*)(void))&Lua_Corpse::Bury)
|
||||||
|
.def("Depop", (void(Lua_Corpse::*)(void))&Lua_Corpse::Depop)
|
||||||
|
.def("CountItems", (uint32(Lua_Corpse::*)(void))&Lua_Corpse::CountItems)
|
||||||
|
.def("AddItem", (void(Lua_Corpse::*)(uint32, uint16, int16, uint32, uint32, uint32, uint32, uint32))&Lua_Corpse::AddItem)
|
||||||
|
.def("GetWornItem", (uint32(Lua_Corpse::*)(int16))&Lua_Corpse::GetWornItem)
|
||||||
|
.def("RemoveItem", (void(Lua_Corpse::*)(uint16))&Lua_Corpse::RemoveItem)
|
||||||
|
.def("SetCash", (void(Lua_Corpse::*)(uint32, uint32, uint32, uint32))&Lua_Corpse::SetCash)
|
||||||
|
.def("RemoveCash", (void(Lua_Corpse::*)(void))&Lua_Corpse::RemoveCash)
|
||||||
|
.def("IsEmpty", (bool(Lua_Corpse::*)(void))&Lua_Corpse::IsEmpty)
|
||||||
|
.def("SetDecayTimer", (void(Lua_Corpse::*)(uint32))&Lua_Corpse::SetDecayTimer)
|
||||||
|
.def("CanMobLoot", (bool(Lua_Corpse::*)(int))&Lua_Corpse::CanMobLoot)
|
||||||
|
.def("AllowMobLoot", (void(Lua_Corpse::*)(Lua_Mob, uint8))&Lua_Corpse::AllowMobLoot)
|
||||||
|
.def("Summon", (bool(Lua_Corpse::*)(Lua_Client, bool, bool))&Lua_Corpse::Summon)
|
||||||
|
.def("GetCopper", (uint32(Lua_Corpse::*)(void))&Lua_Corpse::GetCopper)
|
||||||
|
.def("GetSilver", (uint32(Lua_Corpse::*)(void))&Lua_Corpse::GetSilver)
|
||||||
|
.def("GetGold", (uint32(Lua_Corpse::*)(void))&Lua_Corpse::GetGold)
|
||||||
|
.def("GetPlatinum", (uint32(Lua_Corpse::*)(void))&Lua_Corpse::GetPlatinum)
|
||||||
|
.def("AddLooter", (void(Lua_Corpse::*)(Lua_Mob))&Lua_Corpse::AddLooter)
|
||||||
.property("null", &Lua_Corpse::Null)
|
.property("null", &Lua_Corpse::Null)
|
||||||
.property("valid", &Lua_Corpse::Valid);
|
.property("valid", &Lua_Corpse::Valid);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
#include "lua_mob.h"
|
#include "lua_mob.h"
|
||||||
|
|
||||||
class Corpse;
|
class Corpse;
|
||||||
|
class Lua_Client;
|
||||||
|
|
||||||
namespace luabind {
|
namespace luabind {
|
||||||
struct scope;
|
struct scope;
|
||||||
@ -28,6 +29,36 @@ public:
|
|||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32 GetCharID();
|
||||||
|
uint32 GetDecayTime();
|
||||||
|
void Lock();
|
||||||
|
void UnLock();
|
||||||
|
bool IsLocked();
|
||||||
|
void ResetLooter();
|
||||||
|
uint32 GetDBID();
|
||||||
|
bool IsRezzed();
|
||||||
|
const char *GetOwnerName();
|
||||||
|
bool Save();
|
||||||
|
void Delete();
|
||||||
|
void Bury();
|
||||||
|
void Depop();
|
||||||
|
uint32 CountItems();
|
||||||
|
void AddItem(uint32 itemnum, uint16 charges, int16 slot, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5);
|
||||||
|
uint32 GetWornItem(int16 equipSlot);
|
||||||
|
void RemoveItem(uint16 lootslot);
|
||||||
|
void SetCash(uint32 copper, uint32 silver, uint32 gold, uint32 platinum);
|
||||||
|
void RemoveCash();
|
||||||
|
bool IsEmpty();
|
||||||
|
void SetDecayTimer(uint32 decaytime);
|
||||||
|
bool CanMobLoot(int charid);
|
||||||
|
void AllowMobLoot(Lua_Mob them, uint8 slot);
|
||||||
|
bool Summon(Lua_Client client, bool spell, bool checkdistance);
|
||||||
|
uint32 GetCopper();
|
||||||
|
uint32 GetSilver();
|
||||||
|
uint32 GetGold();
|
||||||
|
uint32 GetPlatinum();
|
||||||
|
void AddLooter(Lua_Mob who);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user