Moderator
M
Moderator
12:00, 20th Feb 2010
TriggerHappy:
I didn't notice any leaks, it performed well and it's MUI.
TriggerHappy:
I didn't notice any leaks, it performed well and it's MUI.
HP Activation

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Hell's Portal

Actions


-------- This is to turn on the loop spell. --------


-------- This way we don't "Turn on" the spell twice if we have more than one player using the spell. --------


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



If - Conditions




HP_MUI Equal to 0



Then - Actions




Trigger - Turn on HP Loop <gen>



Else - Actions


-------- When the spell is activated, we add one to the amount of MUI. --------


-------- This keeps track of the number of participants --------


Set HP_MUI = (HP_MUI + 1)


Set HP_MUI_Total = (HP_MUI_Total + 1)


Set HP_Active[HP_MUI_Total] = True


-------- CUSTOMIZABLE --------


Set HP_Portal_AoE[HP_MUI_Total] = 600.00


Set HP_DPS_Amount[HP_MUI_Total] = 15.00


Set HP_Time_Amount[HP_MUI_Total] = 10.00


Set HP_Demon_Time_Amount[HP_MUI_Total] = 30.00


-------- END CUSTOMIZABLE --------


-------- Each time we trigger the spell, we turn the angle back to 0. --------


Set HP_Dummy_Angle = 0.00


-------- General Variables that we see all the time. --------


Set HP_Caster[HP_MUI_Total] = (Triggering unit)


Set HP_Portal_Point[HP_MUI_Total] = (Target point of ability being cast)


-------- The Timers for the amount of time the Portal will stay in game, that the Ring will stay in game and the demon itself. --------


Set HP_DPS_Timer[HP_MUI_Total] = ((Real((Level of Hell's Portal for HP_Caster[HP_MUI_Total]))) x HP_DPS_Amount[HP_MUI_Total])


Set HP_Portal_Timer[HP_MUI_Total] = ((Real((Level of Hell's Portal for HP_Caster[HP_MUI_Total]))) x HP_Time_Amount[HP_MUI_Total])


Set HP_Demon_Timer[HP_MUI_Total] = (30.00 + ((Real((Level of Hell's Portal for HP_Caster[HP_MUI_Total]))) x HP_Demon_Time_Amount[HP_MUI_Total]))


-------- Height of a dummy to be able to turn the portal horizontal. --------


Set HP_Height[HP_MUI_Total] = 60.00


Set HP_Dummy_Height_Point[HP_MUI_Total] = (HP_Portal_Point[HP_MUI_Total] offset by HP_Portal_Offset_Dist towards HP_Portal_Dummy_Angle degrees)


-------- Sine the Star has 5 corners, for each corner summon a dummy. --------


-------- This dummy sets down a position (Corner_Points) so we may attach the lightning effects. --------


For each (Integer HP_Dummy_Number_1) from 1 to 5, do (Actions)



Loop - Actions




Set HP_Dummy_Number_2 = (((HP_MUI_Total - 1) x 5) + HP_Dummy_Number_1)




Set HP_Corner_Points[HP_Dummy_Number_2] = (HP_Portal_Point[HP_MUI_Total] offset by HP_Portal_AoE[HP_MUI_Total] towards HP_Dummy_Angle degrees)




Unit - Create 1 Dummy for (Owner of HP_Caster[HP_MUI_Total]) at (HP_Corner_Points[HP_Dummy_Number_2] offset by 0.00 towards 0.00 degrees) facing 0.00 degrees




Unit - Add a 1.00 second Generic expiration timer to (Last created unit)




Set HP_Dummy_Point[HP_Dummy_Number_2] = (Position of (Last created unit))




Set HP_Dummy_Angle = (HP_Dummy_Angle + 72.00)


-------- This FOR is put in place to create the RING of the Lightning effects. --------


For each (Integer HP_Dummy_Number_1) from 1 to 5, do (Actions)



Loop - Actions




Set HP_Dummy_Number_2 = (((HP_MUI_Total - 1) x 5) + HP_Dummy_Number_1)




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





If - Conditions






HP_Dummy_Number_1 Less than 5





Then - Actions






Lightning - Create a Finger of Death lightning effect from source HP_Dummy_Point[HP_Dummy_Number_2] to target HP_Dummy_Point[(HP_Dummy_Number_2 + 1)]






Set HP_SFX_Lightning_Ring[HP_Dummy_Number_2] = (Last created lightning effect)





Else - Actions






-------- There is an ELSE, otherwise the Lightning effects would not attach at the right spot. --------






Lightning - Create a Finger of Death lightning effect from source HP_Dummy_Point[HP_Dummy_Number_2] to target HP_Dummy_Point[(HP_Dummy_Number_2 - 4)]






Set HP_SFX_Lightning_Ring1[HP_Dummy_Number_2] = (Last created lightning effect)


-------- This FOR is put in place to create the STAR of the Lightning effects. --------


For each (Integer HP_Dummy_Number_1) from 1 to 4, do (Actions)



Loop - Actions




Set HP_Dummy_Number_2 = (((HP_MUI_Total - 1) x 5) + HP_Dummy_Number_1)




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





If - Conditions






HP_Dummy_Number_1 Not equal to 4





Then - Actions






Lightning - Create a Finger of Death lightning effect from source HP_Dummy_Point[HP_Dummy_Number_2] to target HP_Dummy_Point[(HP_Dummy_Number_2 + 2)]






Set HP_SFX_Lightning_Star[HP_Dummy_Number_2] = (Last created lightning effect)





Else - Actions






-------- There is an ELSE, otherwise the Lightning effects would not attach at the right spot. --------






Lightning - Create a Finger of Death lightning effect from source HP_Dummy_Point[HP_Dummy_Number_2] to target HP_Dummy_Point[(HP_Dummy_Number_2 - 3)]






Set HP_SFX_Lightning_Star1[HP_Dummy_Number_2] = (Last created lightning effect)






Lightning - Create a Finger of Death lightning effect from source HP_Dummy_Point[(HP_Dummy_Number_2 + 1)] to target HP_Dummy_Point[(HP_Dummy_Number_2 - 2)]






Set HP_SFX_Lightning_Star2[HP_Dummy_Number_2] = (Last created lightning effect)


-------- This is the floating dummy in the air so the Portal may be Horizontal --------


-------- There are variables aferwards to determin the Position of the Unit. --------


Unit - Create 1 Dummy for (Owner of HP_Caster[HP_MUI_Total]) at HP_Dummy_Height_Point[HP_MUI_Total] facing Default building facing degrees


Set HP_Height_Unit[HP_MUI_Total] = (Last created unit)


Set HP_Height_Point[HP_MUI_Total] = (Position of HP_Height_Unit[HP_MUI_Total])


Animation - Change HP_Height_Unit[HP_MUI_Total] flying height to HP_Height[HP_MUI_Total] at 0.00


-------- We summon the Portal and change variables so it faces upwards. --------


Unit - Create 1 Dummy (Portal) for (Owner of HP_Caster[HP_MUI_Total]) at HP_Height_Point[HP_MUI_Total] facing Default building facing degrees


Set HP_Portal[HP_MUI_Total] = (Last created unit)


Special Effect - Create a special effect attached to the chest of HP_Portal[HP_MUI_Total] using Doodads\Cinematic\ShimmeringPortal\ShimmeringPortal.mdl


Set HP_SFX_Portal[HP_MUI_Total] = (Last created special effect)


Animation - Lock HP_Portal[HP_MUI_Total]'s Chest to face HP_Height_Unit[HP_MUI_Total], offset by (0.00, 0.00, 0.00)


Unit - Add a 0.01 second Generic expiration timer to HP_Height_Unit[HP_MUI_Total]
HP Loop

Events


Time - Every 1.00 seconds of game time

Conditions

Actions


-------- Starting off the loop at each 1 second, we start with a FOR for each player using this spell --------


For each (Integer HP_MUI_Current) from 1 to HP_MUI_Total, do (Actions)



Loop - Actions




-------- Make sure the spell is active, otherwise it will directly turn off the spell. --------




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





If - Conditions






HP_Active[HP_MUI_Current] Equal to True





Then - Actions






-------- If the Ring Timer is higher than 0... --------






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







If - Conditions








HP_Portal_Timer[HP_MUI_Current] Greater than 0.00







Then - Actions








-------- If the Time is equal to (Total Time - 7 seconds) --------








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









If - Conditions










HP_Portal_Timer[HP_MUI_Current] Equal to (HP_Time_Amount[HP_MUI_Current] - 7.00)









Then - Actions










For each (Integer HP_Dummy_Number_1) from 1 to 5, do (Actions)











Loop - Actions












-------- This creates a special Effect at each corner of the Star at the momentthe Demon Spawns --------












Set HP_Dummy_Number_2 = (((HP_MUI_Current - 1) x 5) + HP_Dummy_Number_1)












Special Effect - Create a special effect at HP_Corner_Points[HP_Dummy_Number_2] using Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl












Set HP_SFX_Summon_Demon_Ring[HP_Dummy_Number_2] = (Last created special effect)












Special Effect - Destroy HP_SFX_Summon_Demon_Ring[HP_Dummy_Number_2]










-------- This Creates the Demon as well as adds a nice special Effect --------










Special Effect - Create a special effect at HP_Portal_Point[HP_MUI_Current] using Abilities\Spells\Human\FlameStrike\FlameStrike1.mdl










Unit - Create 1 Infernal Demon for (Owner of HP_Caster[HP_MUI_Current]) at HP_Portal_Point[HP_MUI_Current] facing Default building facing degrees










Set HP_Demon_Unit[HP_MUI_Current] = (Last created unit)










-------- This adds a Timer to the Demon so he doesn't last the whole game. --------










Unit - Add a HP_Demon_Timer[HP_MUI_Current] second Generic expiration timer to HP_Demon_Unit[HP_MUI_Current]










Special Effect - Destroy (Last created special effect)









Else - Actions








-------- Checks what group of units are inside the Ring, and chooses them all. --------








Set HP_Target_Group[HP_MUI_Current] = (Units within HP_Portal_AoE[HP_MUI_Current] of HP_Portal_Point[HP_MUI_Current] matching (((Matching unit) belongs to an enemy of (Owner of HP_Caster[HP_MUI_Current])) Equal to True))








Unit Group - Pick every unit in HP_Target_Group[HP_MUI_Current] and do (Actions)









Loop - Actions










-------- It deals damage over time (each second) --------










Special Effect - Create a special effect attached to the chest of (Picked unit) using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl










Unit - Cause HP_Caster[HP_MUI_Current] to damage (Picked unit), dealing HP_DPS_Timer[HP_MUI_Current] damage of attack type Spells and damage type Unknown










Special Effect - Destroy (Last created special effect)








-------- Bring the Timer down 1 second --------








Set HP_Portal_Timer[HP_MUI_Current] = (HP_Portal_Timer[HP_MUI_Current] - 1.00)







Else - Actions








-------- If the Timer is lower than 0 seconds, we begin the recycling section of the spell --------








-------- We destroy the Portal --------








Special Effect - Destroy HP_SFX_Portal[HP_MUI_Current]








-------- We destroy ALL the Lightning effects --------








-------- We also remove a few Points using a bit of custom text that we wouldn't be able to remove with normal GUI. --------








For each (Integer HP_Dummy_Number_1) from 1 to 5, do (Actions)









Loop - Actions










Set HP_Dummy_Number_2 = (((HP_MUI_Current - 1) x 5) + HP_Dummy_Number_1)










Lightning - Destroy HP_SFX_Lightning_Ring[HP_Dummy_Number_2]










Lightning - Destroy HP_SFX_Lightning_Star[HP_Dummy_Number_2]










Lightning - Destroy HP_SFX_Lightning_Ring1[HP_Dummy_Number_2]










Lightning - Destroy HP_SFX_Lightning_Star1[HP_Dummy_Number_2]










Lightning - Destroy HP_SFX_Lightning_Star2[HP_Dummy_Number_2]










Custom script: call RemoveLocation (udg_HP_Corner_Points[udg_HP_Dummy_Number_2])










Custom script: call RemoveLocation (udg_HP_Dummy_Point[udg_HP_Dummy_Number_2])








-------- We add an expiration timer to Vexorian's Dummy. (Basically kill it) --------








Unit - Add a 0.01 second Generic expiration timer to HP_Portal[HP_MUI_Current]








-------- We also remove a few Points using a bit of custom text that we wouldn't be able to remove with normal GUI. --------








Custom script: call RemoveLocation (udg_HP_Portal_Point[udg_HP_MUI_Current])








Custom script: call RemoveLocation (udg_HP_Height_Point[udg_HP_MUI_Total])








Custom script: call RemoveLocation (udg_HP_Dummy_Height_Point[udg_HP_MUI_Total])








-------- Destroy the Unit group chosen when units are in the ring --------








Custom script: call DestroyGroup (udg_HP_Target_Group[udg_HP_MUI_Current])








-------- Substract one player from the group because he is done using the spell. --------








Set HP_MUI = (HP_MUI - 1)








Set HP_Active[HP_MUI_Current] = False








-------- If the amount of players is 0, it will turn off the spell instantly. --------








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









If - Conditions










HP_MUI Equal to 0









Then - Actions










Set HP_MUI_Total = 0










Trigger - Turn off (This trigger)









Else - Actions





Else - Actions