- Joined
- Sep 30, 2012
- Messages
- 205
Hey Since i wanted to know witch units get hit by my "chain lightning", i created my own "chain lightning trigger", well i used some stuff i found on the internet as core, since I'm a bit lazy - thats what i used: //www.thehelper.net/threads/chain-storm-bolt.28316/ - so thanks to -Lycan-.
Anyway i changed it a bit, since i wanted that each unit can only be hit once...
and there is my problem.. i add them to the Group: WoN_GroupAlready
and i check later if the new target is in that group, but it can still be hit again..
Any ideas?
thanks
Anyway i changed it a bit, since i wanted that each unit can only be hit once...
and there is my problem.. i add them to the Group: WoN_GroupAlready
and i check later if the new target is in that group, but it can still be hit again..
Any ideas?
-
WoN
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Chain Lightning
-
Actions
- Set WoN_Caster = (Triggering unit)
- Set WoN_Target = (Target unit of ability being cast)
- Unit Group - Add WoN_Target to WoN_AlreadyGroup
- Set WoN_Int = (Level of Chain Lightning for WoN_Caster)
- Set Loops = (WoN_Int + 2)
- Set WoN_Counter = 0
- Set WoN_Target_Loc = (Position of WoN_Target)
- Unit - Create 1 StormBoltDummyUnit for (Owner of WoN_Caster) at WoN_Target_Loc facing Default building facing degrees
- Set Dummy_Unit = (Last created unit)
- Unit - Add Chain Lightning (Neutral Hostile) to Dummy_Unit
- Custom script: call RemoveLocation(udg_WoN_Target_Loc)
-
For each (Integer A) from 1 to Loops, do (Actions)
-
Loop - Actions
- Set WoN_Counter = (WoN_Counter + 1)
- Set Dummy_Loc = (Position of Dummy_Unit)
- Set WoN_Group = (Units within 400.00 of Dummy_Loc matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) belongs to an enemy of (Owner of WoN_Caster)) Equal to True) and ((((Matching unit) is Magic Immune) Not equal to True) and ((((Matching un
- Set WoN_Final_Group = (Random 1 units from WoN_Group)
-
Unit Group - Pick every unit in WoN_Final_Group and do (Actions)
-
Loop - Actions
- Set Picked_Unit = (Picked unit)
- Set Picked_Unit_Loc = (Position of Picked_Unit)
- Unit Group - Add Picked_Unit to WoN_AlreadyGroup
- Unit - Order Dummy_Unit to Orc Far Seer - Chain Lightning Picked_Unit
- Unit - Cause WoN_Caster to damage Picked_Unit, dealing (((((Real(WoN_Int)) - 1.00) x 25.00) + 50.00) x (Power(1.20, (Real(WoN_Counter))))) damage of attack type Spells and damage type Plant
- Game - Display to (All players) the text: (String((((((Real(WoN_Int)) - 1.00) x 25.00) + 50.00) x (Power(1.20, (Real(WoN_Counter)))))))
-
Loop - Actions
- Unit - Move Dummy_Unit instantly to Picked_Unit_Loc
- Custom script: call RemoveLocation(udg_Dummy_Loc)
- Custom script: call DestroyGroup(udg_WoN_Group)
- Custom script: call DestroyGroup(udg_WoN_AlreadyGroup)
- Custom script: call DestroyGroup(udg_WoN_Final_Group)
- Custom script: call RemoveLocation(udg_Picked_Unit_Loc)
-
Loop - Actions
- Unit - Add a 2.00 second Generic expiration timer to Dummy_Unit
- Set WoN_Caster = No unit
- Set WoN_Target = No unit
- Set Picked_Unit = No unit
-
Events