Added GetGlobal() support for all Mobs.

- Uses memory (no database hits)
- Allows entity-based quest global checks
This commit is contained in:
Kinglykrab
2015-06-01 22:20:41 -04:00
parent c3c6d18979
commit 9a5ff58213
5 changed files with 73 additions and 0 deletions
+6
View File
@@ -1631,6 +1631,11 @@ void Lua_Mob::TempName(const char *newname) {
self->TempName(newname);
}
std::string Lua_Mob::GetGlobal(const char *varname) {
Lua_Safe_Call_String();
return self->GetGlobal(varname);
}
void Lua_Mob::SetGlobal(const char *varname, const char *newvalue, int options, const char *duration) {
Lua_Safe_Call_Void();
self->SetGlobal(varname, newvalue, options, duration);
@@ -2120,6 +2125,7 @@ luabind::scope lua_register_mob() {
.def("SendSpellEffect", (void(Lua_Mob::*)(uint32,uint32,uint32,bool,uint32,bool,Lua_Client))&Lua_Mob::SendSpellEffect)
.def("TempName", (void(Lua_Mob::*)(void))&Lua_Mob::TempName)
.def("TempName", (void(Lua_Mob::*)(const char*))&Lua_Mob::TempName)
.def("GetGlobal", (std::string(Lua_Mob::*)(const char*))&Lua_Mob::GetGlobal)
.def("SetGlobal", (void(Lua_Mob::*)(const char*,const char*,int,const char*))&Lua_Mob::SetGlobal)
.def("SetGlobal", (void(Lua_Mob::*)(const char*,const char*,int,const char*,Lua_Mob))&Lua_Mob::SetGlobal)
.def("TarGlobal", (void(Lua_Mob::*)(const char*,const char*,const char*,int,int,int))&Lua_Mob::TarGlobal)