Solved! 
Edit: It seems Bribe's Damage Detection system is causing my spell to not work. Why is this and how can I fix it?
So I decided to trigger Chain Lightning because I wanted to modify an integer variable (StaticCounter) each time a unit is hit by the lightning. I can't seem to get the ability to work however. The special effect just plays at the same point, and the dummy isn't zapping any units. Here's my code:
Edit: It seems Bribe's Damage Detection system is causing my spell to not work. Why is this and how can I fix it?
So I decided to trigger Chain Lightning because I wanted to modify an integer variable (StaticCounter) each time a unit is hit by the lightning. I can't seem to get the ability to work however. The special effect just plays at the same point, and the dummy isn't zapping any units. Here's my code:
-
Chain Lightning
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Chain Lightning
-
-
Actions
-
Unit Group - Add (Target unit of ability being cast) to ChainLightningGroup
-
Set ChainLightningCaster = (Triggering unit)
-
Set ChainLightningPoint = (Position of (Target unit of ability being cast))
-
Set ChainLightningCounter = (ChainLightningCounter + 1)
-
Countdown Timer - Start ChainLightningTimer as a One-shot timer that will expire in 0.30 seconds
-
-
-
Chain Lightning Link
-
Events
-
Time - ChainLightningTimer expires
-
-
Conditions
-
Actions
-
Special Effect - Create a special effect at ChainLightningPoint using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
-
Special Effect - Destroy (Last created special effect)
-
Set TempUnitGroup = (Units within 375.00 of ChainLightningPoint matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) is in ChainLightningGroup) Equal to False)) and (((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True)))
-
Game - Display to (All players) for 5.00 seconds the text: (String((Number of units in TempUnitGroup)))
-
Set TempUnit = (Random unit from TempUnitGroup)
-
Game - Display to (All players) for 5.00 seconds the text: (Name of TempUnit)
-
Custom script: call DestroyGroup (udg_TempUnitGroup)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
TempUnit Not equal to No unit
-
ChainLightningJumpCounter Less than (7 + (Level of Chain Lightning for ChainLightningCaster))
-
-
Then - Actions
-
Set StaticCounter = (StaticCounter + 1)
-
Set ChainLightningJumpCounter = (ChainLightningJumpCounter + 1)
-
Unit Group - Add TempUnit to ChainLightningGroup
-
Unit - Create 1 Dummy Unit 5 for (Owner of ChainLightningCaster) at ChainLightningPoint facing Default building facing degrees
-
Unit - Set level of Chain Lightning (Dummy) for (Last created unit) to (Level of Chain Lightning for ChainLightningCaster)
-
Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
-
Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning TempUnit
-
Custom script: call RemoveLocation (udg_ChainLightningPoint)
-
Set ChainLightningPoint = (Position of TempUnit)
-
Countdown Timer - Start ChainLightningTimer as a One-shot timer that will expire in 0.30 seconds
-
-
Else - Actions
-
Game - Display to (All players) for 5.00 seconds the text: ELSE CONDITIONS MET
-
Custom script: call RemoveLocation (udg_ChainLightningPoint)
-
Unit Group - Remove all units from ChainLightningGroup
-
Set ChainLightningJumpCounter = 0
-
-
-
-
Last edited: