xAnaMorphine
Active Member
- Reaction score
- 43
Hey,
I want a creep to cast a spell with a random chance when attacked on the unit who is being targeted by the creep.
Imagine 3 units attack the creep. Unit 1 is being attacked by the creep, while firing the trigger it might happen that Unit 2 or 3 attack and Unit 1 has his "attack-cooldown".
So I came up with this (ignore that there are no chances for spells because I only got 1 at the time and that spell should be cast at 100%)
I want a creep to cast a spell with a random chance when attacked on the unit who is being targeted by the creep.
Imagine 3 units attack the creep. Unit 1 is being attacked by the creep, while firing the trigger it might happen that Unit 2 or 3 attack and Unit 1 has his "attack-cooldown".
So I came up with this (ignore that there are no chances for spells because I only got 1 at the time and that spell should be cast at 100%)
Trigger:
- Creep Poison
- Events
- Unit - A unit Is attacked
- Conditions
- (Unit-type of (Attacked unit)) Equal to Creep
- (Life of (Attacked unit)) Less than 50
- Actions
- Set TEMP_UnitGroup = (Units in Area <gen> matching ((Matching unit) Equal to (Attacking unit)))
- Unit - Order (Attacked unit) to Night Elf Warden - Shadow Strike (Random unit from TEMP_UnitGroup)
- Custom script: call DestroyGroup(udg_TEMP_UnitGroup)
- Events