Set the damage amount of a damage event.
In 1.31 PTR there’s currently 3 new damage events:
EVENT_UNIT_DAMAGED- old classic event for a specific unit;
EVENT_PLAYER_UNIT_DAMAGED- Same as 1, but for all units of a specific player on the map;
// This seems to work fine anyway: call TriggerRegisterAnyUnitEventBJ(gg_trg_a, EVENT_PLAYER_UNIT_DAMAGING)
EVENT_UNIT_DAMAGING- triggers before any armor, armor type and other resistances. Event for a specific unit like 1.
EVENT_PLAYER_UNIT_DAMAGING- triggers before any armor, armor type and other resistances. Useful to modify either damage amount, attack type or damage type before any reductions done by game.
1 and 2 - modify the damage after any reduction. 3 and 4 - changes damage before reduction. Amount you set will be reduced later according to target’s resistance, armor etc.
If set to <=0 during 3 or 4, then 1 or 2 will never fire. Misses don’t trigger any damage events. Set to 0.00 to completely block the damage. Set to negative value to heal the target instead of damaging.
GetEventDamageafter you set it with this function will return the value you set.
If you’ll call
UnitDamageTargetfrom within a trigger, which reacts to a damage event or triggered by one, it will cause infinite loop and game will crash, so you should handle such scenarios with additional logic.
- return type
- Source code
native BlzSetEventDamage takes real damage returns nothing