- Joined
- Mar 24, 2011
- Messages
- 1,081
Greetings
I have been working on a custom chain lightning spell so I can use a heroes stats for the damage. The thing is that what I have done so far crashes the game after a few uses (~after 3 uses) which is highly undesireable as you can suggest.
I am not much into jass and I have no idea if the custom script is ok (I suppose it is as I have only edited a script from another post around) or I am doing something whrong on fundamental level in war3.
So can someone point out my mistake ? Or suggest a better way of creating the desired effect ?
Thats what I have done so far:
Regards, Nedio95
I have been working on a custom chain lightning spell so I can use a heroes stats for the damage. The thing is that what I have done so far crashes the game after a few uses (~after 3 uses) which is highly undesireable as you can suggest.
I am not much into jass and I have no idea if the custom script is ok (I suppose it is as I have only edited a script from another post around) or I am doing something whrong on fundamental level in war3.
So can someone point out my mistake ? Or suggest a better way of creating the desired effect ?
Thats what I have done so far:
-
Chain Lightning
-

Events
-


Unit - A unit Starts the effect of an ability
-
-

Conditions
-


(Ability being cast) Equal to Chain Lightning New Far Seer
-
-

Actions
-


Set CL_Caster = (Triggering unit)
-


Set CL_Owner = (Owner of CL_Caster)
-


Set CL_Target = (Target unit of ability being cast)
-


Set CL_Level = (Level of Chain Lightning New Far Seer for CL_Caster)
-


Set CL_Damage = (Real((CL_Level x (50 + (Intelligence of CL_Caster (Include bonuses))))))
-


Set CL_Count = (3 + CL_Level)
-


Set CL_Point = (Position of CL_Target)
-


Unit - Cause CL_Caster to damage CL_Target, dealing CL_Damage damage of attack type Spells and damage type Normal
-


Unit - Create 1 Chain Lightning for CL_Owner at CL_Point facing Default building facing degrees
-


Set Temp_Unit = (Last created unit)
-


Unit - Add a 1.00 second Generic expiration timer to Temp_Unit
-


Unit - Add Chain lightning dummy buff to Temp_Unit
-


Unit - Set level of Chain lightning dummy buff for Temp_Unit to CL_Level
-


Unit - Order Temp_Unit to Undead Banshee - Curse CL_Target
-


Trigger - Turn on CLLoop <gen>
-
-
-
CLLoop
-

Events
-


Time - Every 0.40 seconds of game time
-
-

Conditions
-

Actions
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




CL_Count Greater than 0
-
-



Then - Actions
-




Set TempGroup = (Units within 350.00 of CL_Point matching ((((Matching unit) has buff Lightning Strike ) Equal to False) and ((((Matching unit) belongs to an enemy of CL_Owner) Equal to True) and (((Matching unit) is alive) Equal to True))))
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Number of units in TempGroup) Greater than 0
-
-





Then - Actions
-






Set CL_Count = (CL_Count - 1)
-






Set CL_Target = (Random unit from TempGroup)
-






Set TempPoint = (Position of CL_Target)
-






Set CL_Damage = (0.85 x CL_Damage)
-






Unit - Cause CL_Caster to damage CL_Target, dealing CL_Damage damage of attack type Spells and damage type Normal
-






Lightning - Destroy CL_Light
-






Custom script: set udg_CL_Light = AddLightningEx("CLPB", true , GetLocationX(udg_CL_Point), GetLocationY(udg_CL_Point), GetLocationZ(udg_CL_Point) + 70, GetLocationX(udg_TempPoint), GetLocationY(udg_TempPoint), GetLocationZ(udg_TempPoint) + 70)
-






Custom script: call RemoveLocation(udg_CL_Point)
-






Set CL_Point = (Position of CL_Target)
-






Custom script: call RemoveLocation(udg_TempPoint)
-






Unit - Create 1 Chain Lightning for CL_Owner at CL_Point facing Default building facing degrees
-






Set Temp_Unit = (Last created unit)
-






Unit - Add a 1.00 second Generic expiration timer to Temp_Unit
-






Unit - Add Chain lightning dummy buff to Temp_Unit
-






Unit - Set level of Chain lightning dummy buff for Temp_Unit to CL_Level
-






Unit - Order Temp_Unit to Undead Banshee - Curse CL_Target
-
-





Else - Actions
-






Lightning - Destroy CL_Light
-






Custom script: call DestroyGroup(udg_TempGroup)
-






Custom script: call RemoveLocation(udg_CL_Point)
-






Custom script: call RemoveLocation(udg_TempPoint)
-






Trigger - Turn off (This trigger)
-
-
-
-



Else - Actions
-




Lightning - Destroy CL_Light
-




Custom script: call DestroyGroup(udg_TempGroup)
-




Custom script: call RemoveLocation(udg_CL_Point)
-




Custom script: call RemoveLocation(udg_TempPoint)
-




Trigger - Turn off (This trigger)
-
-
-
-



