Hi, how to in LUA or C++ get all spawned monsters and add random damage for each.
damage shouldn't be more than maxhealth
how to get all spawned monsters in lua?
I tried something like this
i set
and add in monster.lua
any hint ?
thank's
damage shouldn't be more than maxhealth
how to get all spawned monsters in lua?
I tried something like this
i set
Code:
<event class="Monster" method="onSpawn" enabled="1" />
Lua:
function Monster:onSpawn(position, startup, artificial)
if hasEventCallback(EVENT_CALLBACK_ONSPAWN) then
local condition = Condition(CONDITION_FIRE)
condition:setParameter(CONDITION_PARAM_DELAYED, true)
condition:addDamage(5, 3000, -25)
condition:addDamage(1, 5000, -666)
return EventCallback(EVENT_CALLBACK_ONSPAWN, self, position, startup, artificial)
else
return true
end
end
any hint ?
thank's
Last edited: