- Joined
- Jan 30, 2013
- Messages
- 12,909
Set this to Awaiting Update, there's a bug with the math logic that caused the spell to not properly detect near-death state.
Judge Config

Events


Map initialization

Conditions

Actions


-------- Ability --------


Set Judge_Ability = Divine Judgement


-------- Area of effect --------


Set Judge_AoE[1] = 400.00


Set Judge_AoE[2] = 400.00


Set Judge_AoE[3] = 400.00


-------- Initial health percentage lost (max 100.00) --------


Set Judge_PercentDamage[1] = 20.00


Set Judge_PercentDamage[2] = 40.00


Set Judge_PercentDamage[3] = 60.00


-------- Initial effect : Attack Type --------


Set Judge_AttackType = Spells


-------- Initial effect : Damage Type --------


Set Judge_DamageType = Normal


-------- Heal rate per second --------


Set Judge_HPS[1] = 10.00


Set Judge_HPS[2] = 20.00


Set Judge_HPS[3] = 30.00


-------- Damage rate per second --------


Set Judge_DPS[1] = 10.00


Set Judge_DPS[2] = 20.00


Set Judge_DPS[3] = 30.00


-------- Effect duration --------


Set Judge_Duration[1] = 20.00


Set Judge_Duration[2] = 20.00


Set Judge_Duration[3] = 20.00


-------- Area blast SFX --------


Set Judge_ActiveSFX = Units\NightElf\Wisp\WispExplode.mdl


-------- Effect SFX --------


Set Judge_EffectSFX = Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl


-------- Looping SFX --------


Set Judge_LoopSFX = Abilities\Spells\Items\StaffOfSanctuary\Staff_Sanctuary_Target.mdl


-------- SFX Position (Looping and Effect only) --------


Set Judge_EffectPos = overhead


-------- END CONFIG --------


Set Judge_LOOPTIME = 0.03


Set Judge_LoopTrigger = Judge Loop <gen>


Trigger - Add to Judge_LoopTrigger the event (Time - Every Judge_LOOPTIME seconds of game time)


Hashtable - Create a hashtable


Set Judge_HASH = (Last created hashtable)


Set Judge_COUNT = 0


Set Judge_KEYDUR = 1


Set Judge_KEYLEVEL = 2


Set Judge_KEYDAMAGE = 3


Set Judge_KEYHEAL = 4
Judge Cast

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Judge_Ability

Actions


-------- Variables setup --------


Set Judge_Source = (Triggering unit)


Set Judge_Point = (Target point of ability being cast)


Set Judge_Level = (Level of Judge_Ability for Judge_Source)


Set Judge_Group = (Units within Judge_AoE[Judge_Level] of Judge_Point)


-------- Field SFX --------


Special Effect - Create a special effect at Judge_Point using Judge_ActiveSFX


Special Effect - Destroy (Last created special effect)


-------- Damage and Group Setup --------


Unit Group - Pick every unit in Judge_Group and do (Actions)



Loop - Actions




Set Judge_Victim = (Picked unit)




Set Judge_KEY = (Key (Picked unit))




-------- Insert conditions here --------




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





If - Conditions






(Judge_Victim is A structure) Equal to False






(Judge_Victim is Mechanical) Equal to False






(Judge_Victim is Magic Immune) Equal to False






(Judge_Victim is dead) Equal to False





Then - Actions






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







If - Conditions








(Judge_Victim is in Judge_MainGroup) Equal to False







Then - Actions








Set Judge_COUNT = (Judge_COUNT + 1)







Else - Actions






Unit - Cause Judge_Source to damage Judge_Victim, dealing ((Life of Judge_Victim) x (Judge_PercentDamage[Judge_Level] / 100.00)) damage of attack type Judge_AttackType and damage type Judge_DamageType






Special Effect - Create a special effect attached to the Judge_EffectPos of Judge_Victim using Judge_EffectSFX






Special Effect - Destroy (Last created special effect)






Unit Group - Add Judge_Victim to Judge_MainGroup






Hashtable - Save Judge_Duration[Judge_Level] as Judge_KEYDUR of Judge_KEY in Judge_HASH






Hashtable - Save Judge_Level as Judge_KEYLEVEL of Judge_KEY in Judge_HASH






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







If - Conditions








(Judge_Victim belongs to an ally of (Owner of Judge_Source)) Equal to True







Then - Actions








Hashtable - Save (Judge_HPS[Judge_Level] x Judge_LOOPTIME) as Judge_KEYHEAL of Judge_KEY in Judge_HASH








Hashtable - Save 0.00 as Judge_KEYDAMAGE of Judge_KEY in Judge_HASH







Else - Actions








Hashtable - Save (Judge_DPS[Judge_Level] x Judge_LOOPTIME) as Judge_KEYDAMAGE of Judge_KEY in Judge_HASH








Hashtable - Save 0.00 as Judge_KEYHEAL of Judge_KEY in Judge_HASH





Else - Actions


Custom script: call RemoveLocation(udg_Judge_Point)


Custom script: call DestroyGroup(udg_Judge_Group)


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



If - Conditions




Judge_COUNT Equal to 1



Then - Actions




Trigger - Turn on Judge_LoopTrigger



Else - Actions
Judge Loop

Events

Conditions

Actions


-------- DoT and HoT --------


Unit Group - Pick every unit in Judge_MainGroup and do (Actions)



Loop - Actions




Set Judge_Victim = (Picked unit)




Set Judge_KEY = (Key (Picked unit))




Set Judge_CurrentDuration = (Load Judge_KEYDUR of Judge_KEY from Judge_HASH)




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





If - Conditions






Judge_CurrentDuration Equal to Judge_Duration[(Load Judge_KEYLEVEL of Judge_KEY from Judge_HASH)]





Then - Actions






-------- For safety reason, I would go with this. I tried to avoid any instance of spell causing a SFX left-over --------






Special Effect - Destroy (Load Judge_KEYEFFECT of Judge_KEY in Judge_HASH)






Special Effect - Create a special effect attached to the Judge_EffectPos of Judge_Victim using Judge_LoopSFX






Hashtable - Save Handle Of(Last created special effect) as Judge_KEYEFFECT of Judge_KEY in Judge_HASH





Else - Actions




Set Judge_Modifier = ((Load Judge_KEYDAMAGE of Judge_KEY from Judge_HASH) - (Load Judge_KEYHEAL of Judge_KEY from Judge_HASH))




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





If - Conditions






Judge_Modifier Greater than or equal to ((Life of Judge_Victim) - 1.00)





Then - Actions






Unit - Set life of Judge_Victim to 1.00





Else - Actions






Unit - Set life of Judge_Victim to ((Life of Judge_Victim) - Judge_Modifier)




Unit - Set mana of Judge_Victim to ((Mana of Judge_Victim) - Judge_Modifier)




Set Judge_CurrentDuration = (Judge_CurrentDuration - Judge_LOOPTIME)




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





If - Conditions






Or - Any (Conditions) are true







Conditions








Judge_CurrentDuration Less than or equal to 0.00








(Judge_Victim is alive) Equal to False





Then - Actions






Special Effect - Destroy (Load Judge_KEYEFFECT of Judge_KEY in Judge_HASH)






Hashtable - Clear all child hashtables of child Judge_KEY in Judge_HASH






Unit Group - Remove Judge_Victim from Judge_MainGroup






Set Judge_COUNT = (Judge_COUNT - 1)






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







If - Conditions








Judge_COUNT Equal to 0







Then - Actions








Trigger - Turn off Judge_LoopTrigger







Else - Actions





Else - Actions






Hashtable - Save Judge_CurrentDuration as Judge_KEYDUR of Judge_KEY in Judge_HASH