Help with Lightning effects for chain hex spell!
Hello! I'm trying to make a Chain Hex spell. Now I need help with removal of my lightning effects. The thing is, the lightning effect coming from the caster to the targeted unit is removed, whilst the lightning effect from targets to targets stays forever. Here, take a look at it :
Thanks in advance, Murre
Hello! I'm trying to make a Chain Hex spell. Now I need help with removal of my lightning effects. The thing is, the lightning effect coming from the caster to the targeted unit is removed, whilst the lightning effect from targets to targets stays forever. Here, take a look at it :
Trigger:
- Chain Hex
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Chain Hex
- Actions
- Hashtable - Create a hashtable
- Set Lightning_Hashtable = (Last created hashtable)
- Set ChainHex_TempPoint = (Position of (Target unit of ability being cast))
- Set ChainHex_Group = (Units within 300.00 of ChainHex_TempPoint matching ((((Matching unit) is dead) Equal to False) and (((Matching unit) belongs to an ally of (Owner of ChainHex_CasterUnit)) Equal to False)))
- Set ChainHex_CasterPoint = (Position of (Triggering unit))
- Set ChainHex_CasterUnit = (Triggering unit)
- Lightning - Create a Drain lightning effect from source ChainHex_CasterPoint to target ChainHex_TempPoint
- Hashtable - Save Handle Of(Last created lightning effect) as 19 of 95 in Lightning_Hashtable
- Countdown Timer - Start Lightning_Timer[1] as a One-shot timer that will expire in 0.50 seconds
- Unit Group - Pick every unit in ChainHex_Group and do (Actions)
- Loop - Actions
- Set ChainHex_TargetUnit = (Picked unit)
- Set ChainHex_TargetPoint = (Position of ChainHex_TargetUnit)
- Unit - Create 1 ChainHex Dummy for (Owner of ChainHex_CasterUnit) at ChainHex_TargetPoint facing Default building facing degrees
- Set ChainHex_DummyUnit = (Last created unit)
- Unit - Hide (Last created unit)
- Unit - Add DummyChainHex to ChainHex_DummyUnit
- Unit - Set level of DummyChainHex for ChainHex_DummyUnit to (Level of Chain Hex for ChainHex_CasterUnit)
- Unit - Order ChainHex_DummyUnit to Orc Shadow Hunter - Hex ChainHex_TargetUnit
- Lightning - Create a Drain lightning effect from source ChainHex_TempPoint to target ChainHex_TargetPoint
- Hashtable - Save Handle Of(Last created lightning effect) as 13 of 37 in Lightning_Hashtable
- Special Effect - Create a special effect attached to the origin of ChainHex_TargetUnit using Abilities\Spells\Human\Polymorph\PolyMorphTarget.mdl
- Special Effect - Destroy (Last created special effect)
- Countdown Timer - Start Lightning_Timer[2] as a One-shot timer that will expire in 0.50 seconds
- Loop - Actions
- Custom script: call RemoveLocation (udg_ChainHex_CasterPoint)
- Custom script: call RemoveLocation (udg_ChainHex_TargetPoint)
- Custom script: call RemoveLocation (udg_ChainHex_TempPoint)
- Custom script: call DestroyGroup (udg_ChainHex_Group)
- Unit Group - Pick every unit in ChainHex_Group and do (Actions)
- Events
Trigger:
- Remove Lightning
- Events
- Time - Lightning_Timer[1] expires
- Conditions
- Actions
- Lightning - Destroy (Load 19 of 95 in Lightning_Hashtable)
- Events
Trigger:
- Remove Lightning 2
- Events
- Time - Lightning_Timer[2] expires
- Conditions
- Actions
- Lightning - Destroy (Load 13 of 37 in Lightning_Hashtable)
- Events
Thanks in advance, Murre