- Joined
- Apr 24, 2008
- Messages
- 29
Hello, I am trying to make a chain lightning spell exactly like Blizzard's, only it is affected by a player's spell damage. Therefore I had to be able to make the spell with triggers in order to insert a damage bonus based on this.
Here is the script, completely in GUI:
The initial spell works, and it damages the correct number of units for the correct amount, the problem is that the actual Chain Lightning effect does not show for all units. It will usually show the effect to the first target, and sometimes the second target, but often there are gaps in the chain between the units.
Any help on this matter would be appreciated. I apologize if I left out any necessary information. Thank you in advance for any attempt on helping the matter.
Edit: Found a small error in the code and updated it.
Here is the script, completely in GUI:
-
Energy Chain Spell Enhanced
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to 080Energy Chain Level 2 (Neutral Hostile)
-
-
Actions
-
Set Caster = (Casting unit)
-
Set Target = (Target unit of ability being cast)
-
Set PlayerNumberInt = (Player number of (Owner of Caster))
-
Set PointArray[PlayerNumberInt] = (Position of Target)
-
Set TempGroupMUI[PlayerNumberInt] = (Units within 700.00 of PointArray[PlayerNumberInt] matching ((((Matching unit) belongs to an ally of (Owner of Caster)) Equal to False) and ((Matching unit) Not equal to Target)))
-
Set Target = (Target unit of ability being cast)
-
Unit - Cause Caster to damage Target, dealing (120.00 + (((SpellPower[PlayerNumberInt] / 75.00) x 80.00) x 1.00)) damage of attack type Spells and damage type Normal
-
For each (Integer A) from 1 to 4, do (Actions)
-
Loop - Actions
-
Custom script: call RemoveLocation (udg_PointArray[udg_PlayerNumberInt])
-
Set PointArray[PlayerNumberInt] = (Position of Target)
-
Unit - Create 1 DummyCaster for (Owner of Caster) at PointArray[PlayerNumberInt] facing Default building facing degrees
-
Set DummyCaster[PlayerNumberInt] = (Last created unit)
-
Unit - Add a 10.00 second Generic expiration timer to DummyCaster[PlayerNumberInt]
-
Unit - Add Energy Chain SFX to DummyCaster[PlayerNumberInt]
-
Set TempGroupMUI[PlayerNumberInt] = (Units within 500.00 of PointArray[PlayerNumberInt] matching (((Matching unit) belongs to an enemy of (Owner of Caster)) Equal to True))
-
Unit Group - Remove DummyCaster[PlayerNumberInt] from TempGroupMUI[PlayerNumberInt]
-
Unit Group - Remove Caster from TempGroupMUI[PlayerNumberInt]
-
Set Target = (Random unit from TempGroupMUI[PlayerNumberInt])
-
Unit - Order (Last created unit) to Orc Shadow Hunter - Healing Wave Target
-
Unit - Cause Caster to damage Target, dealing (120.00 + (((SpellPower[PlayerNumberInt] / 75.00) x 80.00) x 1.00)) damage of attack type Spells and damage type Normal
-
-
-
Custom script: call RemoveLocation (udg_PointArray[udg_PlayerNumberInt])
-
Custom script: call DestroyGroup (udg_TempGroupMUI[udg_PlayerNumberInt])
-
-
The initial spell works, and it damages the correct number of units for the correct amount, the problem is that the actual Chain Lightning effect does not show for all units. It will usually show the effect to the first target, and sometimes the second target, but often there are gaps in the chain between the units.
Any help on this matter would be appreciated. I apologize if I left out any necessary information. Thank you in advance for any attempt on helping the matter.
Edit: Found a small error in the code and updated it.
Last edited: