Code:
int32_t LuaScriptInterface::luaDoCombatAreaHealth(lua_State* L)
{
//doCombatAreaHealth(cid, type, pos, area, min, max, effect)
MagicEffect_t effect = (MagicEffect_t)popNumber(L);
int32_t maxChange = (int32_t)popNumber(L), minChange = (int32_t)popNumber(L);
uint32_t areaId = popNumber(L);
PositionEx pos;
popPosition(L, pos);
CombatType_t combatType = (CombatType_t)popNumber(L);
uint32_t cid = popNumber(L);
ScriptEnviroment* env = getEnv();
Creature* creature = NULL;
if(cid)
{
if(!(creature = env->getCreatureByUID(cid)))
{
errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND));
lua_pushboolean(L, false);
return 1;
}
}
const CombatArea* area = env->getCombatArea(areaId);
if(area || !areaId)
{
CombatParams params;
params.combatType = combatType;
params.effects.impact = effect;
Combat::doCombatHealth(creature, pos, area, minChange, maxChange, params);
lua_pushboolean(L, true);
}
else
{
errorEx(getError(LUA_ERROR_AREA_NOT_FOUND));
lua_pushboolean(L, false);
}
return 1;
}
Please i need to add to this function a hitcolor
//doCombatAreaHealth(cid, type, pos, area, min, max, effect[, hitcolor])
please help.