But how could I create a global storage when the raid starts? Everything is via XML, I don't know how to tell a LUA script that a raid is active.onStepIn Script.
Check for a globalStorage when raid is triggered.. or check ferumbrus location using getSpectators
If it's the only ferumbrus that spawns / dies, then you can create a onSpawn function for ferumbrus, that changes the globalStorage, and an onDeath function that turns it back to -1.But how could I create a global storage when the raid starts? Everything is via XML, I don't know how to tell a LUA script that a raid is active.
Do you have an example of a script to run when there is the spawn of a monster?If it's the only ferumbrus that spawns / dies, then you can create a onSpawn function for ferumbrus, that changes the globalStorage, and an onDeath function that turns it back to -1.
Or use the second option of getSpectators
local ev = EventCallback
function ev.onSpawn(monster, position, startup, artificial)
if monster:getName() == "Ferumbras" then
Game.setStorageValue(key, value)
end
return true
end
ev:register(1)