- Joined
- Aug 18, 2013
- Messages
- 71
Hey guys, I'm working on some DOTS (1 AOE, 1 Single target stackable) and was hoping if anyone could proofread my code and tell me what is wrong.
-
SufferingPriest Catch
-

Events
-


Unit - A unit Begins casting an ability
-
-

Conditions
-


Or - Any (Conditions) are true
-



Conditions
-




(Ability being cast) Equal to Affliction
-




(Ability being cast) Equal to Agonize
-
-
-
-

Actions
-


Custom script: local unit u
-


Set Gen_MIndex = (Gen_MIndex + 1)
-


Set Gen_Caster[Gen_MIndex] = (Casting unit)
-


Set Gen_AbilLevel[Gen_MIndex] = (Level of (Ability being cast) for (Casting unit))
-


Set Gen_Player[Gen_MIndex] = (Owner of (Casting unit))
-


Set Gen_Abil[Gen_MIndex] = (Ability being cast)
-


-------- Code --------
-


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



If - Conditions
-




(Ability being cast) Equal to Affliction
-
-



Then - Actions
-




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





If - Conditions
-






(Gen_TargetU[Gen_MIndex] has buff Affliction ) Equal to False
-
-





Then - Actions
-






Unit - Create 1 Dummy for Gen_Player[Gen_MIndex] at (Position of (Casting unit)) facing Default building facing degrees
-






Custom script: set u = GetLastCreatedUnit()
-






Unit - Add ApplyAfflictionBuff to (Last created unit)
-






Unit - Order (Last created unit) to Undead Necromancer - Cripple Gen_TargetU[Gen_MIndex]
-






Wait 0.50 seconds
-






Custom script: set udg_TempUnit = u
-






Unit - Remove TempUnit from the game
-






Custom script: set udg_TempUnit = null
-






Custom script: set u = null
-






Game - Display to (All players) the text: -debug EOF Afflicti...
-
-





Else - Actions
-
-




Set Gen_TargetG[Gen_MIndex] = (Units within 500.00 of (Target point of ability being cast) matching (((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True))
-




Set Gen_Damage[Gen_MIndex] = ((15.00 + (15.00 x (Real((Level of (Ability being cast) for (Casting unit)))))) + (Real((Intelligence of (Casting unit) (Include bonuses)))))
-




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





If - Conditions
-





Then - Actions
-






Custom script: set udg_Gen_Damage[udg_Gen_MIndex] = udg_Gen_Damage[udg_Gen_MIndex] + I2R(GetHeroInt(udg_Gen_Caster[udg_Gen_MIndex],true))
-
-





Else - Actions
-
-
-



Else - Actions
-
-


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



If - Conditions
-




(Ability being cast) Equal to Agonize
-
-



Then - Actions
-




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





If - Conditions
-






(Gen_TargetU[Gen_MIndex] has buff Agonize Stack # 1 ) Equal to True
-
-





Then - Actions
-






Unit - Remove Agonize Stack # 1 buff from Gen_TargetU[Gen_MIndex]
-






Unit - Create 1 Dummy for Gen_Player[Gen_MIndex] at (Position of (Casting unit)) facing Default building facing degrees
-






Custom script: set u = GetLastCreatedUnit()
-






Unit - Add ApplyAgonizeBuff2 to (Last created unit)
-






Unit - Order (Last created unit) to Undead Necromancer - Cripple Gen_TargetU[Gen_MIndex]
-
-





Else - Actions
-






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







If - Conditions
-








(Gen_TargetU[Gen_MIndex] has buff Agonize Stack # 2 ) Equal to True
-
-







Then - Actions
-








Unit - Remove Agonize Stack # 2 buff from Gen_TargetU[Gen_MIndex]
-








Unit - Create 1 Dummy for Gen_Player[Gen_MIndex] at (Position of (Casting unit)) facing Default building facing degrees
-








Custom script: set u = GetLastCreatedUnit()
-








Unit - Add ApplyAgonizeBuff3 to (Last created unit)
-








Unit - Order (Last created unit) to Undead Necromancer - Cripple Gen_TargetU[Gen_MIndex]
-
-







Else - Actions
-








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









If - Conditions
-










(Gen_TargetU[Gen_MIndex] has buff Agonize Stack # 3 ) Equal to True
-
-









Then - Actions
-










Unit - Create 1 Dummy for Gen_Player[Gen_MIndex] at (Position of (Casting unit)) facing Default building facing degrees
-










Custom script: set u = GetLastCreatedUnit()
-










Unit - Add ApplyAgonizeBuff3 to (Last created unit)
-










Unit - Order (Last created unit) to Undead Necromancer - Cripple Gen_TargetU[Gen_MIndex]
-
-









Else - Actions
-










Unit - Create 1 Dummy for Gen_Player[Gen_MIndex] at (Position of (Casting unit)) facing Default building facing degrees
-










Custom script: set u = GetLastCreatedUnit()
-










Unit - Add ApplyAgonizeBuff1 to (Last created unit)
-










Unit - Order (Last created unit) to Undead Necromancer - Cripple Gen_TargetU[Gen_MIndex]
-
-
-








Unit - Create 1 Dummy for Gen_Player[Gen_MIndex] at (Position of (Casting unit)) facing Default building facing degrees
-








Custom script: set u = GetLastCreatedUnit()
-








Unit - Add ApplyAgonizeBuff1 to (Last created unit)
-








Unit - Order (Last created unit) to Undead Necromancer - Cripple Gen_TargetU[Gen_MIndex]
-
-
-
-
-




Wait 0.50 seconds
-




Custom script: set udg_TempUnit = u
-




Unit - Remove TempUnit from the game
-




Custom script: set udg_TempUnit = null
-




Custom script: set u = null
-




Set Gen_TargetU[Gen_MIndex] = (Target unit of ability being cast)
-




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





If - Conditions
-






Gen_AbilLevel[Gen_MIndex] Equal to 1
-
-





Then - Actions
-






Set Gen_Damage[Gen_MIndex] = (30.00 + ((Real((Intelligence of Gen_Caster[Gen_MIndex] (Include bonuses)))) x 0.30))
-
-





Else - Actions
-






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







If - Conditions
-








Gen_AbilLevel[Gen_MIndex] Equal to 2
-
-







Then - Actions
-








Set Gen_Damage[Gen_MIndex] = (40.00 + ((Real((Intelligence of Gen_Caster[Gen_MIndex] (Include bonuses)))) x 0.45))
-
-







Else - Actions
-








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









If - Conditions
-










Gen_AbilLevel[Gen_MIndex] Equal to 3
-
-









Then - Actions
-










Set Gen_Damage[Gen_MIndex] = (55.00 + ((Real((Intelligence of Gen_Caster[Gen_MIndex] (Include bonuses)))) x 0.60))
-
-









Else - Actions
-










Set Gen_Damage[Gen_MIndex] = (67.50 + ((Real((Intelligence of Gen_Caster[Gen_MIndex] (Include bonuses)))) x 0.70))
-
-
-
-
-
-
-




Wait 0.50 seconds
-




Custom script: set udg_TempUnit = GetLastCreatedUnit()
-




Unit - Remove TempUnit from the game
-




Custom script: set udg_TempUnit = null
-




Custom script: set u = null
-




Game - Display to (All players) the text: -debug EOF Agonize ...
-
-



Else - Actions
-
-


-------- END --------
-


Game - Display to (All players) the text: -Suffering Priest d...
-


Set Gen_Counter[Gen_MIndex] = 0
-


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



If - Conditions
-




Gen_MIndex Equal to 1
-
-



Then - Actions
-




-------- Hero-SP-Affliction --------
-




Trigger - Turn on SufferingPriest Loop <gen>
-
-



Else - Actions
-
-
-
-
SufferingPriest Loop
-

Events
-


Time - Every 1.00 seconds of game time
-
-

Conditions
-

Actions
-


For each (Integer Gen_CIndex) from 1 to Gen_MIndex, do (Actions)
-



Loop - Actions
-




Set Gen_Counter[Gen_CIndex] = (Gen_Counter[Gen_CIndex] + 1)
-




Game - Display to (All players) the text: (-debug counter = + (String(Gen_Counter[Gen_CIndex])))
-




Unit - Create 1 Dummy for Gen_Player[Gen_CIndex] at (Position of Gen_Caster[Gen_CIndex]) facing Default building facing degrees
-




Set Gen_Dummy[Gen_CIndex] = (Last created unit)
-




-------- Affliction --------
-




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





If - Conditions
-






Gen_Abil[Gen_CIndex] Equal to Affliction
-






Gen_Counter[Gen_CIndex] Less than 6
-
-





Then - Actions
-






Game - Display to (All players) the text: -Affliction Debug
-






Unit Group - Pick every unit in Gen_TargetG[Gen_CIndex] and do (Actions)
-







Loop - Actions
-








Unit - Cause Gen_Dummy[Gen_CIndex] to damage (Picked unit), dealing Gen_Damage[Gen_CIndex] damage of attack type Spells and damage type Normal
-
-
-
-





Else - Actions
-






Unit Group - Pick every unit in Gen_TargetG[Gen_CIndex] and do (Actions)
-







Loop - Actions
-








Unit - Remove Affliction buff from Gen_TargetU[Gen_CIndex]
-
-
-






-------- Cleanup below --------
-






Unit - Remove Gen_Dummy[Gen_CIndex] from the game
-






Custom script: set udg_Gen_Abil[udg_Gen_CIndex] = 0
-






Custom script: set udg_Gen_Dummy[udg_Gen_CIndex] = null
-






Set Gen_Caster[Gen_CIndex] = Gen_Caster[Gen_MIndex]
-






Set Gen_Counter[Gen_CIndex] = Gen_Counter[Gen_MIndex]
-






Set Gen_MIndex = (Gen_MIndex - 1)
-






Set Gen_CIndex = (Gen_CIndex - 1)
-
-
-




-------- Agonize --------
-




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





If - Conditions
-






Gen_Abil[Gen_CIndex] Equal to Agonize
-






Gen_Counter[Gen_CIndex] Less than 9
-
-





Then - Actions
-






Game - Display to (All players) the text: -agonize Debug
-






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







If - Conditions
-








(Gen_TargetU[Gen_CIndex] has buff Agonize Stack # 1 ) Equal to True
-
-







Then - Actions
-








Unit - Cause Gen_Dummy[Gen_CIndex] to damage Gen_TargetU[Gen_CIndex], dealing Gen_Damage[Gen_CIndex] damage of attack type Spells and damage type Normal
-
-







Else - Actions
-








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









If - Conditions
-










(Gen_TargetU[Gen_CIndex] has buff Agonize Stack # 2 ) Equal to True
-
-









Then - Actions
-










Unit - Cause Gen_Dummy[Gen_CIndex] to damage Gen_TargetU[Gen_CIndex], dealing Gen_Damage[Gen_CIndex] damage of attack type Spells and damage type Normal
-










Unit - Cause Gen_Dummy[Gen_CIndex] to damage Gen_TargetU[Gen_CIndex], dealing Gen_Damage[Gen_CIndex] damage of attack type Spells and damage type Normal
-
-









Else - Actions
-










Unit - Cause Gen_Dummy[Gen_CIndex] to damage Gen_TargetU[Gen_CIndex], dealing Gen_Damage[Gen_CIndex] damage of attack type Spells and damage type Normal
-










Unit - Cause Gen_Dummy[Gen_CIndex] to damage Gen_TargetU[Gen_CIndex], dealing Gen_Damage[Gen_CIndex] damage of attack type Spells and damage type Normal
-










Unit - Cause Gen_Dummy[Gen_CIndex] to damage Gen_TargetU[Gen_CIndex], dealing Gen_Damage[Gen_CIndex] damage of attack type Spells and damage type Normal
-
-
-
-
-
-





Else - Actions
-






Unit - Remove Agonize Stack # 1 buff from Gen_TargetU[Gen_CIndex]
-






Unit - Remove Agonize Stack # 2 buff from Gen_TargetU[Gen_CIndex]
-






Unit - Remove Agonize Stack # 3 buff from Gen_TargetU[Gen_CIndex]
-






-------- Cleanup below --------
-






Unit - Remove Gen_Dummy[Gen_CIndex] from the game
-






Custom script: set udg_Gen_Abil[udg_Gen_CIndex] = 0
-






Custom script: set udg_Gen_Dummy[udg_Gen_CIndex] = null
-






Set Gen_Caster[Gen_CIndex] = Gen_Caster[Gen_MIndex]
-






Set Gen_Counter[Gen_CIndex] = Gen_Counter[Gen_MIndex]
-






Set Gen_MIndex = (Gen_MIndex - 1)
-






Set Gen_CIndex = (Gen_CIndex - 1)
-
-
-




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





If - Conditions
-






Gen_MIndex Equal to 0
-
-





Then - Actions
-






Trigger - Turn off (This trigger)
-
-





Else - Actions
-
-
-
-
-
