Im making a spell called explosive shot, its supposed to keep track on how much damage the caster has done to the target in the next 5 seconds.
The problem is that it wont show the correct damage at all, and if i cast it on a unit that has been hit by it before, it will count the old damage as well.
Trigger:
- Explosive Shot Initial Cast
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Explosive Shot (Explosive Shot)
- Actions
- Set ExplosiveShotCaster_U = (Casting unit)
- Set ExplosiveShotTarget_U = (Target unit of ability being cast)
- Set ExplosiveShotDamage_Int = 0
- Countdown Timer - Start ExplosiveShot_Timer as a One-shot timer that will expire in 5.00 seconds
- Trigger - Add to Explosive Shot Damage <gen> the event (Unit - ExplosiveShotTarget_U Takes damage)
- Trigger - Turn on Explosive Shot Damage <gen>
- Events
Trigger:
- Explosive Shot Damage
- Events
- Conditions
- (Damage source) Equal to ExplosiveShotCaster_U
- Actions
- Set ExplosiveShotDamage_Int = (ExplosiveShotDamage_Int + (Integer((Damage taken))))
Trigger:
- Explosive Shot Turnoff
- Events
- Time - ExplosiveShot_Timer expires
- Conditions
- Actions
- Trigger - Turn off Explosive Shot Damage <gen>
- Floating Text - Create floating text that reads (String(ExplosiveShotDamage_Int)) above ExplosiveShotCaster_U with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
- Events
The problem is that it wont show the correct damage at all, and if i cast it on a unit that has been hit by it before, it will count the old damage as well.