Hello. I'm trying to make a skill like strafe which amazon had in Diablo 2. Problem is, caster damages the units more than once and no matter what i just cant fix this. Any help will be appreciated. Thanks
Trigger:
- StrafeLearn
- Events
- Unit - A unit Learns a skill
- Conditions
- (Learned Hero Skill) Equal to Strafe
- Actions
- Set Strafe_Caster = (Triggering unit)
- Trigger - Add to Strafe <gen> the event (Unit - A unit Starts the effect of an ability)
- Events
Trigger:
- StrafeLevel
- Events
- Unit - A unit Learns a skill
- Conditions
- (Learned Hero Skill) Equal to Strafe
- Actions
- Set Strafe_Level = (Strafe_Level + 1)
- Events
Trigger:
- Strafe
- Events
- Conditions
- (Ability being cast) Equal to Strafe
- Actions
- Set Strafe_Caster = (Casting unit)
- Set Strafe_Caster_Pos = (Position of (Casting unit))
- Set Strafe_Damage = ((Real((Strength of Strafe_Caster (Include bonuses)))) + (((Real((Agility of Strafe_Caster (Include bonuses)))) x 0.25) x (Real(Strafe_Level))))
- Set Strafe_Group = (Random (4 + Strafe_Level) units from (Units within 800.00 of Strafe_Caster_Pos matching ((((Matching unit) is in Strafe_Group) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of Strafe_Caster)) Equal to True))))
- Unit Group - Pick every unit in Strafe_Group and do (Actions)
- Loop - Actions
- Trigger - Run StrafeCast <gen> (checking conditions)
- Loop - Actions
Trigger:
- StrafeCast
- Events
- Conditions
- ((Picked unit) is in Strafe_Group) Equal to True
- Actions
- Wait (Random real number between 0.00 and 0.90) seconds
- Unit - Create 1 Dummy for (Owner of Strafe_Caster) at Strafe_Caster_Pos facing (Position of (Picked unit))
- Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
- Unit - Add Strafe Dummy to (Last created unit)
- Unit - Set level of Strafe Dummy for (Last created unit) to Strafe_Level
- Unit - Make Strafe_Caster face (Picked unit) over 0.00 seconds
- Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
- Unit - Cause Strafe_Caster to damage (Picked unit), dealing Strafe_Damage damage of attack type Hero and damage type Normal
- Unit Group - Remove (Picked unit) from Strafe_Group