forked from SecretsOTheP/EQMacEmu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlua_corpse.cpp
197 lines (163 loc) · 5.29 KB
/
lua_corpse.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
#ifdef LUA_EQEMU
#include "lua.hpp"
#include <luabind/luabind.hpp>
#include "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->GetCorpseDBID();
}
bool Lua_Corpse::IsRezzed() {
Lua_Safe_Call_Bool();
return self->IsRezzed();
}
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::MoveToGraveyard() {
Lua_Safe_Call_Void();
self->MoveToGraveyard();
}
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, int8 charges, int16 slot) {
Lua_Safe_Call_Void();
self->AddItem(itemnum, charges, slot);
}
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(const char* mobName) {
Lua_Safe_Call_Bool();
return self->CanPlayerLoot(mobName);
}
void Lua_Corpse::AllowMobLoot(Lua_Mob them, uint8 slot) {
Lua_Safe_Call_Void();
self->AllowPlayerLoot(them);
}
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() {
return luabind::class_<Lua_Corpse, Lua_Mob>("Corpse")
.def(luabind::constructor<>())
.property("null", &Lua_Corpse::Null)
.property("valid", &Lua_Corpse::Valid)
.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("MoveToGraveyard", (void(Lua_Corpse::*)(void))&Lua_Corpse::MoveToGraveyard)
.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::*)(const char*))&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);
}
#endif