Set Max HP
Posted: Tue May 07, 2019 9:33 am
Regarding this prior post
https://www.eq2emulator.net/phpBB3/view ... xhp#p33640
Could someone please make this change. If we send a character sheet change, it fixes it.
LuaFunctions.cpp around 1273
https://www.eq2emulator.net/phpBB3/view ... xhp#p33640
Could someone please make this change. If we send a character sheet change, it fixes it.
LuaFunctions.cpp around 1273
Code: Select all
int EQ2Emu_lua_SetMaxHP(lua_State* state){
if(!lua_interface)
return 0;
Spawn* spawn = lua_interface->GetSpawn(state);
sint32 value = lua_interface->GetSInt32Value(state, 2);
lua_interface->ResetFunctionStack(state);
if (spawn && spawn->IsEntity() && value > 0)
((Entity*)spawn)->AddSpellBonus(0, ITEM_STAT_HEALTH, value - spawn->GetTotalHP());
if (spawn->IsPlayer())
((Player*)spawn)->SetCharSheetChanged(true);
return 0;
}