Shadow
TH.net Regular
- Reaction score
- 23
I triggered a spell so once cast you hit 7 random units with 400 radius of you're hero Problem is I don't want the hero to hit the same unit twice I tried removing unit from unit group but didn't seem to do the trick.
Trigger:
- Ferocity Cast
- Events
- Unit - A unit Finishes casting an ability
- Conditions
- (Ability being cast) Equal to Ferocity
- Actions
- Set FerocityCaster = (Casting unit)
- Unit - Create 1 Ferocity Dummy for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
- Set FerocityDummy = (Last created unit)
- Set FerocityUnitGroup = (Units within 400.00 of (Position of FerocityCaster) matching (((Matching unit) Not equal to (Casting unit)) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of FerocityCaster)) Equal to True))))
- Trigger - Turn on Ferocity <gen>
- Trigger - Run Ferocity <gen> (checking conditions)
- Events
Trigger:
- Ferocity
- Events
- Conditions
- Actions
- For each (Integer A) from 1 to 8, do (Actions)
- Loop - Actions
- If ((FerocityRandomTarget is dead) Equal to True) then do (Unit Group - Remove FerocityRandomTarget from FerocityUnitGroup) else do (Do nothing)
- Unit Group - Pick every unit in (Random 1 units from FerocityUnitGroup) and do (Set FerocityRandomTarget = (Picked unit))
- Unit - Move FerocityCaster instantly to (Position of FerocityRandomTarget)
- Animation - Play FerocityCaster's attack 2 animation
- Special Effect - Create a special effect attached to the origin of FerocityRandomTarget using Objects\Spawnmodels\Human\HumanBlood\HumanBloodFootman.mdl
- Special Effect - Create a special effect attached to the origin of FerocityRandomTarget using Objects\Spawnmodels\Orc\OrcLargeDeathExplode\OrcLargeDeathExplode.mdl
- Unit - Cause FerocityCaster to damage FerocityRandomTarget, dealing 150.00 damage of attack type Spells and damage type Normal
- Special Effect - Create a special effect attached to the origin of FerocityRandomTarget using war3mapImported\DarkLightning.mdx
- Unit Group - Remove FerocityRandomTarget from FerocityUnitGroup
- Wait 0.40 seconds
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Integer A) Greater than or equal to 7) or ((FerocityUnitGroup is empty) Equal to True)
- Then - Actions
- Unit - Move FerocityCaster instantly to (Position of FerocityDummy)
- Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
- Wait 0.50 seconds
- Set FerocityRandomTarget = No unit
- Unit - Remove FerocityDummy from the game
- Trigger - Turn off (This trigger)
- Else - Actions
- If - Conditions
- For each (Integer A) from 1 to 8, do (Actions)