Moderator
M
Moderator
21:28, 29th Jun 2013
Magtheridon96: Approved.
People could generally find this spell useful.
Magtheridon96: Approved.
People could generally find this spell useful.
MP Initialization

Events


Map initialization

Conditions

Actions


-------- Dummy Tree Check --------


Set loc = (Point(0.00, 0.00))


Unit - Create 1 Peasant for Neutral Passive at loc facing Default building facing degrees


Set HarvestDummy = (Last created unit)


Unit - Hide HarvestDummy


Custom script: call RemoveLocation(udg_loc)


-------- Setting --------


-------- Abilities - to re-set when importing --------


Set MeltingPhoenix_Ability = Melting Phoenixes


Set MP_FxAbility = Phoenix Fx


Set MP_PhoenixDummy = Phoenix Dummy


Set MP_PhoenixFx = Phoenix Fx


-------- Hashtable --------


Hashtable - Create a hashtable


Set MP_HA = (Last created hashtable)


-------- AoE Where the Phoenix will loop and where will damage finally --------


Set MP_AoE[1] = 300.00


Set MP_AoE[2] = 425.00


Set MP_AoE[3] = 550.00


-------- AoE Where the Phoenix will DPS enemy units --------


Set MP_DPS_AoE[1] = 225.00


Set MP_DPS_AoE[2] = 225.00


Set MP_DPS_AoE[3] = 225.00


-------- Damage dealt when the phoenix melts --------


Set MP_Damage[1] = 75.00


Set MP_Damage[2] = 150.00


Set MP_Damage[3] = 225.00


-------- Knockback Range --------


Set MP_KB_Range[1] = 200.00


Set MP_KB_Range[2] = 250.00


Set MP_KB_Range[3] = 300.00


-------- DPS that the phoenix deals to enemies while he is looping --------


Set MP_DPS[1] = 50.00


Set MP_DPS[2] = 75.00


Set MP_DPS[3] = 100.00


-------- Height, where the phoenix will stop his loop --------


Set MP_Height[1] = 500.00


Set MP_Height[2] = 500.00


Set MP_Height[3] = 500.00


-------- Duration after when will the phoenix stop looping --------


Set MP_Dur[1] = 3.00


Set MP_Dur[2] = 3.50


Set MP_Dur[3] = 4.00


-------- Number of loops till end --------


Set MP_Loops[1] = 2.00


Set MP_Loops[2] = 2.50


Set MP_Loops[3] = 3.00


-------- Knockback speed --------


Set MP_KBSpeed[1] = 950.00


Set MP_KBSpeed[2] = 950.00


Set MP_KBSpeed[3] = 950.00


-------- Amount of Phoenixs --------


Set MP_Phoenixes_Count[1] = 1


Set MP_Phoenixes_Count[2] = 2


Set MP_Phoenixes_Count[3] = 3


-------- Damage Type --------


Set MP_DT = Magic


-------- Burn Fx --------


Set MP_L_Fx = Abilities\Weapons\FireBallMissile\FireBallMissile.mdl


-------- Knockback Fx --------


Set MP_KB_Fx = Abilities\Weapons\DemolisherFireMissile\DemolisherFireMissile.mdl


-------- Destroy Trees? --------


Set MP_DestroyTree = True


-------- Knockbacks? --------


Set MP_Knockback = True


-------- Setting --------
MP Cast

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to MeltingPhoenix_Ability

Actions


Set x = (Level of MeltingPhoenix_Ability for (Triggering unit))


Set loc = (Target point of ability being cast)


For each (Integer x2) from 1 to MP_Phoenixes_Count[x], do (Actions)



Loop - Actions




Set loc1 = (loc offset by MP_AoE[x] towards ((360.00 / (Real(MP_Phoenixes_Count[x]))) x (Real(x2))) degrees)




Unit - Create 1 MP_PhoenixDummy for (Triggering player) at loc facing (((360.00 / (Real(MP_Phoenixes_Count[x]))) x (Real(x2))) + 90.00) degrees




Set Key = (Key (Last created unit))




Set Unit = (Last created unit)




Unit - Add MP_FxAbility to Unit




Custom script: call SetUnitX(udg_Unit, GetLocationX(udg_loc1))




Custom script: call SetUnitY(udg_Unit, GetLocationY(udg_loc1))




Animation - Change Unit's vertex coloring to (100.00%, 100.00%, 100.00%) with 35.00% transparency




Unit - Add a MP_Dur[x] second Generic expiration timer to Unit




Animation - Change Unit flying height to MP_Height[x] at (MP_Height[x] / MP_Dur[x])




Unit Group - Add Unit to MP_Group




Hashtable - Save x as 0 of Key in MP_HA




Hashtable - Save ((360.00 x 0.03) x (MP_Loops[x] / MP_Dur[x])) as 1 of Key in MP_HA




Hashtable - Save MP_AoE[x] as 2 of Key in MP_HA




Hashtable - Save (MP_DPS[x] / 0.03) as 3 of Key in MP_HA




Hashtable - Save ((360.00 / (Real(MP_Phoenixes_Count[x]))) x (Real(x2))) as 4 of Key in MP_HA




Hashtable - Save MP_AoE[x] as 5 of Key in MP_HA




Hashtable - Save MP_Dur[x] as 6 of Key in MP_HA




Custom script: call RemoveLocation(udg_loc1)


Hashtable - Save True as 7 of Key in MP_HA


Custom script: call RemoveLocation(udg_loc)


Trigger - Turn on MP Loop <gen>
MP Loop

Events


Time - Every 0.03 seconds of game time

Conditions

Actions


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



If - Conditions




(MP_Group is empty) Equal to False



Then - Actions




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





Loop - Actions






Set Unit = (Picked unit)






Custom script: set udg_Key = GetHandleId(udg_Unit)






Set x = (Load 0 of Key from MP_HA)






Set y2 = (Load 2 of Key from MP_HA)






Set y = (Load 4 of Key from MP_HA)






Set loc1 = (Position of Unit)






Set loc = (loc1 offset by y2 towards (y + 180.00) degrees)






Set y = (y + (Load 1 of Key from MP_HA))






Hashtable - Save y as 4 of Key in MP_HA






Set y2 = (y2 - ((Load 5 of Key from MP_HA) x (0.03 / (Load 6 of Key from MP_HA))))






Hashtable - Save y2 as 2 of Key in MP_HA






Set loc2 = (loc offset by y2 towards y degrees)






Unit - Make Unit face (y + 90.00) over 0.00 seconds






Custom script: call SetUnitX(udg_Unit, GetLocationX(udg_loc2))






Custom script: call SetUnitY(udg_Unit, GetLocationY(udg_loc2))






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







If - Conditions








MP_DestroyTree Equal to True







Then - Actions








Destructible - Pick every destructible within MP_DPS_AoE[x] of loc2 and do (Actions)









Loop - Actions










Unit - Order HarvestDummy to Harvest (Picked destructible)










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











If - Conditions












(Current order of HarvestDummy) Equal to (Order(harvest))











Then - Actions












Destructible - Kill (Picked destructible)











Else - Actions










Unit - Order HarvestDummy to Stop







Else - Actions






Set UGroup = (Units within MP_DPS_AoE[x] of loc2 matching ((((((Matching unit) is Mechanical) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of Unit)) Equal to True)) and (((Matching unit) is alive) Equal to True)) and (((Matching unit) is Magic Immun






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







Loop - Actions








Set Unit1 = (Picked unit)








Unit - Cause Unit to damage Unit1, dealing (MP_DPS[x] x 0.03) damage of attack type Spells and damage type MP_DT








Special Effect - Create a special effect attached to the origin of Unit1 using MP_L_Fx








Special Effect - Destroy (Last created special effect)






Custom script: call DestroyGroup(udg_UGroup)






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







If - Conditions








y2 Less than or equal to 0.00







Then - Actions








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









If - Conditions










(Load 7 of Key from MP_HA) Equal to True









Then - Actions










Unit - Create 1 MP_PhoenixFx for (Owner of Unit) at loc2 facing Default building facing degrees










Set Unit1 = (Last created unit)










Set y3 = (MP_AoE[x] / 1.70)










Animation - Change Unit1's size to (y3%, 0.00%, 0.00%) of its original size










Set UGroup = (Units within MP_AoE[x] of loc2 matching ((((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of Unit)) Equal to True)) and (((Matching unit) is alive) Equal to True)) and (((Matching unit) is Magic Immune)










Unit Group - Pick every unit in UGroup and do (Unit - Cause Unit1 to damage (Picked unit), dealing MP_Damage[x] damage of attack type Spells and damage type MP_DT)










Custom script: call DestroyGroup(udg_UGroup)










Unit - Kill Unit1










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











If - Conditions












MP_Knockback Equal to True











Then - Actions












Set UGroup = (Units within MP_AoE[x] of loc2 matching ((((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of Unit)) Equal to True)) and (((Matching unit) is alive) Equal to True)) and ((((Matching unit) is Magic Immune)












Unit Group - Add all units of UGroup to MPKB_Group












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













Loop - Actions














Set Unit1 = (Picked unit)














Set loc3 = (Position of Unit1)














Unit - Make Unit1 face loc over 0.00 seconds














Custom script: set udg_Key_1 = GetHandleId(udg_Unit1)














Hashtable - Save (Angle from loc2 to loc3) as 0 of Key_1 in MP_HA














Hashtable - Save MP_KB_Range[x] as 1 of Key_1 in MP_HA














Hashtable - Save MP_KBSpeed[x] as 2 of Key_1 in MP_HA














Custom script: call RemoveLocation(udg_loc3)











Else - Actions









Else - Actions








Hashtable - Clear all child hashtables of child Key in MP_HA








Unit Group - Remove Unit from MP_Group








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









If - Conditions










(MP_Group is empty) Equal to True










(MPKB_Group is empty) Equal to True









Then - Actions










Trigger - Turn off (This trigger)









Else - Actions







Else - Actions






Custom script: call RemoveLocation(udg_loc)






Custom script: call RemoveLocation(udg_loc1)






Custom script: call RemoveLocation(udg_loc2)



Else - Actions


-------- Knockback Loop --------


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



If - Conditions




(MPKB_Group is empty) Equal to False



Then - Actions




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





Loop - Actions






Set Unit = (Picked unit)






Custom script: set udg_Key = GetHandleId(udg_Unit)






Set loc = (Position of Unit)






Set loc1 = (loc offset by ((Load 2 of Key from MP_HA) x 0.03) towards (Load 0 of Key from MP_HA) degrees)






Set y = (Angle from loc1 to loc)






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







If - Conditions








(Terrain pathing at loc1 of type Walkability is off) Equal to False







Then - Actions








Custom script: call SetUnitX(udg_Unit, GetLocationX(udg_loc1))








Custom script: call SetUnitY(udg_Unit, GetLocationY(udg_loc1))







Else - Actions






Special Effect - Create a special effect at loc1 using MP_KB_Fx






Special Effect - Destroy (Last created special effect)






Set y2 = (Load 1 of Key from MP_HA)






Set y2 = (y2 - ((Load 2 of Key from MP_HA) x 0.03))






Hashtable - Save y2 as 1 of Key in MP_HA






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







If - Conditions








y2 Less than or equal to 0.00







Then - Actions








Unit Group - Remove Unit from MPKB_Group








Hashtable - Clear all child hashtables of child Key in MP_HA








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









If - Conditions










(MP_Group is empty) Equal to True










(MPKB_Group is empty) Equal to True









Then - Actions










Trigger - Turn off (This trigger)









Else - Actions







Else - Actions






Custom script: call RemoveLocation(udg_loc)






Custom script: call RemoveLocation(udg_loc1)



Else - Actions