Hello guys,
there is a few items on my OTS that increase your max HP and MP value, but when you wear any of that items, fuction getCreatureMax[Health/Mana] return your current maxHP (with those items).
Can someone fix[?] that? It must return your maxHP/MP value without any buffs.
Mine function in cpp, using tfs 0.3.6
Please, help
there is a few items on my OTS that increase your max HP and MP value, but when you wear any of that items, fuction getCreatureMax[Health/Mana] return your current maxHP (with those items).
Can someone fix[?] that? It must return your maxHP/MP value without any buffs.
Mine function in cpp, using tfs 0.3.6
Code:
int32_t LuaScriptInterface::luaGetCreatureMaxHealth(lua_State* L)
{
//getCreatureMaxHealth(cid)
ScriptEnviroment* env = getEnv();
if(Creature* creature = env->getCreatureByUID(popNumber(L)))
lua_pushnumber(L, creature->getMaxHealth());
else
{
errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND));
lua_pushboolean(L, false);
}
return 1;
}
Please, help