- Joined
- Dec 12, 2012
- Messages
- 96
I'm trying to create a trigger that whenever a unit is attacked by GS_Hero (Gold Stealer), the owner of the attacked unit loses gold equivalent to the damage taken by the unit. So far my trigger ain't working. I think it's the variable where I set Event Response - Damage Taken but I'm not so sure.
-
Events
- Unit - A unit Is attacked
-
Conditions
- (Attacking unit) Equal to GS_Hero
-
Actions
- Set GS_Attacker2 = GS_Hero
- Set GS_Receiver2 = (Attacked unit)
- Set GS_Owner = (Owner of GS_Receiver2)
- Set GS_Dmg_Rec = (Damage taken)
- Set GS_Dmg_Rec_int = (Integer(GS_Dmg_Rec))
- Player - Set GS_Owner Current gold to ((GS_Owner Current gold) - GS_Dmg_Rec_int)
- Floating Text - Create floating text that reads (- + ((String(GS_Dmg_Rec_int)) + Gold)) above GS_Receiver2 with Z offset -10.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 10.00% transparency
- Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
- Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds