[Commands] Cleanup #modifynpcstat Command. (#2499)

* [Commands] Cleanup #modifynpcstat Command.

Cleanup messages and logic,

Add map and loop through it to display all stats, can add to this in the future if we add more stuff modifiable by this command.

* Delete settings.json

* Update modifynpcstat.cpp

* Update modifynpcstat.cpp

* Update questmgr.h
This commit is contained in:
Kinglykrab
2022-10-29 21:22:07 -04:00
committed by GitHub
parent b512447448
commit dcbc9a358f
11 changed files with 288 additions and 192 deletions
+5 -5
View File
@@ -458,7 +458,7 @@ void Lua_NPC::SetSwarmTarget(int target) {
self->SetSwarmTarget(target);
}
void Lua_NPC::ModifyNPCStat(const char *stat, const char *value) {
void Lua_NPC::ModifyNPCStat(std::string stat, std::string value) {
Lua_Safe_Call_Void();
self->ModifyNPCStat(stat, value);
}
@@ -663,10 +663,10 @@ bool Lua_NPC::HasAISpellEffect(int spell_effect_id)
return self->HasAISpellEffect(spell_effect_id);
}
float Lua_NPC::GetNPCStat(const char* identifier)
float Lua_NPC::GetNPCStat(std::string stat)
{
Lua_Safe_Call_Real();
return self->GetNPCStat(identifier);
return self->GetNPCStat(stat);
}
bool Lua_NPC::IsRareSpawn()
@@ -736,7 +736,7 @@ luabind::scope lua_register_npc() {
.def("GetNPCHate", (int64(Lua_NPC::*)(Lua_Mob))&Lua_NPC::GetNPCHate)
.def("GetNPCSpellsID", (int(Lua_NPC::*)(void))&Lua_NPC::GetNPCSpellsID)
.def("GetNPCSpellsID", (int(Lua_NPC::*)(void))&Lua_NPC::GetNPCSpellsID)
.def("GetNPCStat", (float(Lua_NPC::*)(const char*))&Lua_NPC::GetNPCStat)
.def("GetNPCStat", (float(Lua_NPC::*)(std::string))&Lua_NPC::GetNPCStat)
.def("GetPetSpellID", (int(Lua_NPC::*)(void))&Lua_NPC::GetPetSpellID)
.def("GetPlatinum", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetPlatinum)
.def("GetPrimSkill", (int(Lua_NPC::*)(void))&Lua_NPC::GetPrimSkill)
@@ -769,7 +769,7 @@ luabind::scope lua_register_npc() {
.def("IsTaunting", (bool(Lua_NPC::*)(void))&Lua_NPC::IsTaunting)
.def("MerchantCloseShop", (void(Lua_NPC::*)(void))&Lua_NPC::MerchantCloseShop)
.def("MerchantOpenShop", (void(Lua_NPC::*)(void))&Lua_NPC::MerchantOpenShop)
.def("ModifyNPCStat", (void(Lua_NPC::*)(const char*,const char*))&Lua_NPC::ModifyNPCStat)
.def("ModifyNPCStat", (void(Lua_NPC::*)(std::string,std::string))&Lua_NPC::ModifyNPCStat)
.def("MoveTo", (void(Lua_NPC::*)(float,float,float,float,bool))&Lua_NPC::MoveTo)
.def("NextGuardPosition", (void(Lua_NPC::*)(void))&Lua_NPC::NextGuardPosition)
.def("PauseWandering", (void(Lua_NPC::*)(int))&Lua_NPC::PauseWandering)