You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summon a dummy monster (e.g. /summon training monk) that your wild monster (e.g. /m gaz'haragoth) can attack and observe for a while
Expected behaviour
The damage is applied as it was intended
Actual behaviour
If another spell is cast before combat:execute() is fired, the damage values will be wrong, which can result in no damage, wrong damage or even healing the target Here's a video
Technical explanation
The damage values are set here once the spell is casted, and then later fetched again here when combat:execute() is ran. If another spell is cast in the time frame of the addEvent delay, these values will be overwritten and result in an attack with incorrect damage values.
The text was updated successfully, but these errors were encountered:
The fundamental problem of addEvent is that the stored objects point to places in memory, but after 5 seconds the memory is different so it points to another thing than you meant. This is why addEvent either returns random values (in this case) or even crashes the server (if you try to addEvent with Creature/Player object).
The solution here is creating the combat object inside the delayed function and include min/max values in lua.
Before creating an issue, please ensure:
support matter (use https://otland.net/forums/support.16/ for support)
Steps to reproduce (include any configuration/script required to reproduce)
energy ue.lua
indata/spells/monster
with the following content/summon training monk
) that your wild monster (e.g./m gaz'haragoth
) can attack and observe for a whileExpected behaviour
The damage is applied as it was intended
Actual behaviour
If another spell is cast before
combat:execute()
is fired, the damage values will be wrong, which can result in no damage, wrong damage or even healing the targetHere's a video
Technical explanation
The damage values are set here once the spell is casted, and then later fetched again here when
combat:execute()
is ran. If another spell is cast in the time frame of the addEvent delay, these values will be overwritten and result in an attack with incorrect damage values.The text was updated successfully, but these errors were encountered: