- Joined
- Nov 20, 2007
- Messages
- 660
Hello guys, i tryed to make a Death Coil by using triggers (Missle System) but i have a problem with indexing system. Missles stuck when i start spamming Death Coil. +rep for peoples who can help me 
PROBLEM STATUS : SOLVED
Peoples who helped me:
-InfinateAnswers
Update : I started testing and i guess there is a problem with recycling, still testing
Update : Problem found : i forget to add "Missle" to recycling
, but the spell is still bugged (Triggers refreshed)
Update : Observation ! when missle hit the target, if there is other missle launched it will stop
Update : Triggers Refresh (Some changes)
Update : The problem is next : if you launch 2,3,4,...,n missles, when the first missle touch the target, all missles STOP
Update : Problem fixed, triggers reloaded and rep given

-
Death Coil
-

Events
-


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

Conditions
-


(Ability being cast) Equal to Death Coil (DK)
-
-

Actions
-


Set DK_DC_Index[2] = (DK_DC_Index[2] + 1)
-


Set DK_DC_Index[3] = (DK_DC_Index[3] + 1)
-


Set DK_DC_Caster[DK_DC_Index[2]] = (Casting unit)
-


Set DK_DC_Target[DK_DC_Index[2]] = (Target unit of ability being cast)
-


Set DK_DC_Missle_Distance[DK_DC_Index[2]] = (Distance between (Position of DK_DC_Missle[DK_DC_Index[2]]) and (Position of DK_DC_Target[DK_DC_Index[2]]))
-


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



If - Conditions
-




(DK_DC_Target[DK_DC_Index[2]] belongs to an ally of (Owner of DK_DC_Caster[DK_DC_Index[2]])) Equal to True
-
-



Then - Actions
-




Set DK_DC_Heal[DK_DC_Index[2]] = (2.00 x Hero_Attack_Power[(Player number of (Owner of DK_DC_Caster[DK_DC_Index[2]]))])
-
-



Else - Actions
-




Set DK_DC_Damage[DK_DC_Index[2]] = (400.00 + Hero_Attack_Power[(Player number of (Owner of DK_DC_Caster[DK_DC_Index[2]]))])
-
-
-


Set Spells_Crit_Chance = (Random real number between 1.00 and 100.00)
-


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



If - Conditions
-




Spells_Crit_Chance Less than or equal to Hero_Critical_Strike[(Player number of (Owner of DK_DC_Caster[DK_DC_Index[2]]))]
-
-



Then - Actions
-




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





If - Conditions
-






DK_DC_Damage[DK_DC_Index[2]] Greater than 0.00
-
-





Then - Actions
-






Set DK_DC_Damage[DK_DC_Index[2]] = (DK_DC_Damage[DK_DC_Index[2]] x 2.00)
-
-





Else - Actions
-






Set DK_DC_Heal[DK_DC_Index[2]] = (DK_DC_Heal[DK_DC_Index[2]] x 2.00)
-
-
-
-



Else - Actions
-
-


Set DK_DC_Leak_Point = ((Position of DK_DC_Caster[DK_DC_Index[2]]) offset by 150.00 towards (Facing of DK_DC_Caster[DK_DC_Index[2]]) degrees)
-


Unit - Create 1 Death Coil (Missle) for (Owner of DK_DC_Caster[DK_DC_Index[2]]) at DK_DC_Leak_Point facing (Angle from (Position of DK_DC_Caster[DK_DC_Index[2]]) to (Position of DK_DC_Target[DK_DC_Index[2]])) degrees
-


Set DK_DC_Missle[DK_DC_Index[2]] = (Last created unit)
-


Custom script: call RemoveLocation (udg_DK_DC_Leak_Point)
-


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



If - Conditions
-




DK_DC_Index[3] Equal to 1
-
-



Then - Actions
-




Trigger - Turn on Death Coil Move <gen>
-
-



Else - Actions
-
-
-
-
Death Coil Move
-

Events
-


Time - Every 0.03 seconds of game time
-
-

Conditions
-

Actions
-


For each (Integer DK_DC_Index[1]) from 1 to DK_DC_Index[2], do (Actions)
-



Loop - Actions
-




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





If - Conditions
-






DK_DC_Missle_Distance[DK_DC_Index[1]] Greater than or equal to 100.00
-
-





Then - Actions
-






Set DK_DC_Leak_Point = ((Position of DK_DC_Missle[DK_DC_Index[1]]) offset by 30.00 towards (Angle from (Position of DK_DC_Missle[DK_DC_Index[1]]) to (Position of DK_DC_Target[DK_DC_Index[1]])) degrees)
-






Unit - Move DK_DC_Missle[DK_DC_Index[1]] instantly to DK_DC_Leak_Point, facing (Angle from (Position of DK_DC_Missle[DK_DC_Index[1]]) to (Position of DK_DC_Target[DK_DC_Index[1]])) degrees
-






Set DK_DC_Missle_Distance[DK_DC_Index[1]] = (Distance between (Position of DK_DC_Missle[DK_DC_Index[1]]) and (Position of DK_DC_Target[DK_DC_Index[1]]))
-
-





Else - Actions
-






Unit - Remove DK_DC_Missle[DK_DC_Index[1]] from the game
-






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







If - Conditions
-








DK_DC_Damage[DK_DC_Index[1]] Greater than 0.00
-
-







Then - Actions
-








Unit - Cause DK_DC_Caster[DK_DC_Index[1]] to damage DK_DC_Target[DK_DC_Index[1]], dealing DK_DC_Damage[DK_DC_Index[1]] damage of attack type Spells and damage type Normal
-
-







Else - Actions
-








Unit - Set life of DK_DC_Target[DK_DC_Index[1]] to ((Life of DK_DC_Target[DK_DC_Index[1]]) + DK_DC_Heal[DK_DC_Index[1]])
-
-
-






Set SDD_Unit = DK_DC_Target[DK_DC_Index[1]]
-






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







If - Conditions
-








DK_DC_Damage[DK_DC_Index[1]] Greater than 0.00
-
-







Then - Actions
-








Set SDD_Text = (String(DK_DC_Damage[DK_DC_Index[1]]))
-








Set SDD_Text_Color = |cffffcc00
-
-







Else - Actions
-








Set SDD_Text = (String(DK_DC_Heal[DK_DC_Index[1]]))
-








Set SDD_Text_Color = |cff66ff00
-
-
-






Trigger - Run Spell Damage Display <gen> (ignoring conditions)
-






Set DK_DC_Caster[DK_DC_Index[1]] = DK_DC_Caster[DK_DC_Index[2]]
-






Set DK_DC_Target[DK_DC_Index[1]] = DK_DC_Target[DK_DC_Index[2]]
-






Set DK_DC_Missle[DK_DC_Index[1]] = DK_DC_Missle[DK_DC_Index[2]]
-






Set DK_DC_Missle_Distance[DK_DC_Index[1]] = DK_DC_Missle_Distance[DK_DC_Index[2]]
-






Set DK_DC_Damage[DK_DC_Index[1]] = DK_DC_Damage[DK_DC_Index[2]]
-






Set DK_DC_Heal[DK_DC_Index[1]] = DK_DC_Heal[DK_DC_Index[2]]
-






Set DK_DC_Index[2] = (DK_DC_Index[2] - 1)
-






Set DK_DC_Index[3] = (DK_DC_Index[3] - 1)
-
-
-




Custom script: call RemoveLocation (udg_DK_DC_Leak_Point)
-




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





If - Conditions
-






DK_DC_Index[3] Equal to 0
-
-





Then - Actions
-






Trigger - Turn off (This trigger)
-
-





Else - Actions
-
-
-
-
-
PROBLEM STATUS : SOLVED
Peoples who helped me:
-InfinateAnswers
Update : I started testing and i guess there is a problem with recycling, still testing
Update : Problem found : i forget to add "Missle" to recycling
Update : Observation ! when missle hit the target, if there is other missle launched it will stop
Update : Triggers Refresh (Some changes)
Update : The problem is next : if you launch 2,3,4,...,n missles, when the first missle touch the target, all missles STOP
Update : Problem fixed, triggers reloaded and rep given
Attachments
Last edited:






