Moderator
M
Moderator
Winter wrath v1.01b | Reviewed by Maker | 6th Oct 2013 | ||||
| APPROVED | ||||
|
|
Winter Wrath Configuration

Events


Map initialization

Conditions

Actions


-------- Creating the hashtable --------


Table de hachage - Create a hashtable


Set WW_Hashtable = (Last created hashtable)


-------- Setting the "handle" dummy type --------


Set WW_Handle_Type = Handle (Winter wrath)


-------- Setting the "pillar" dummy type --------


Set WW_Pillar_Type = Dummy 2 (Winter wrath)


-------- Setting the "orb" dummy type --------


Set WW_Orbs_Type = Dummy (Winter wrath)


-------- Setting how far of the pillar the orbs can go --------


Set WW_Distance_Base = 800.00


Set WW_Distance_Level = 200.00


-------- Setting how fast the orbs are moving --------


Set WW_Speed_Base = 15.00


Set WW_Speed_Level = 5.00


-------- Setting how fast the orbs rotate --------


Set WW_Rotation_Base = 1.00


Set WW_Rotation_Level = 1.00


-------- Setting the amount of damage an unit takes when she collide with an orb --------


Set WW_Damage_Base = 200.00


Set WW_Damage_Level = 100.00


-------- Setting which kind of damage the units will take --------


Set WW_Damage_Type = Glace


Set WW_Attack_Type = Magie


-------- Setting the caster ability --------


Set WW_Ability = Winter wrath


-------- Setting how close to the orbs the units must be to be damaged --------


Set WW_Range_Base = 90.00


Set WW_Range_Level = 0.00


-------- Setting the amount of orbs --------


Set WW_DummyAmount_Base = 8


Set WW_DummyAmount_Level = 1


-------- Setting how long the spell last --------


Set WW_Duration_Base = 7.00


Set WW_Duration_Level = 3.00


-------- Setting the effect when the spell end --------


Set WW_EndEffect = Abilities\Weapons\FrostWyrmMissile\FrostWyrmMissile.mdl


-------- Setting the other end effect --------


Set WW_EndEffect2 = Abilities\Spells\Undead\FreezingBreath\FreezingBreathMissile.mdl


-------- Setting the the effect when an unit is damaged --------


Set WW_Damage_Effect = Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl


-------- Setting the the sound when the pillar disappears --------


Set WW_Sound = FrostNovaTarget1 <gen>
Winter Wrath Cast

Events


Unit - A unit Initiate the effect of an ability

Conditions


(Ability being cast) Equal to WW_Ability

Actions


-------- setting all integer to 0 to ensure there won't be any bugs --------


Set WW_LoopA = 0


Set WW_TmpInteger = 0


Set WW_TmpInteger2 = 0


-------- Setting the caster --------


Set WW_TmpCaster = (Triggering unit)


Set WW_TmpOwner = (Triggering player)


-------- Setting the location of the caster --------


Set WW_TmpPoint = (Position of WW_TmpCaster)


-------- Creating the handle dummy --------


Unit - Create 1 WW_Handle_Type for WW_TmpOwner at WW_TmpPoint facing Orientation default build facing degrees


Set WW_TmpHandle = (Last created unit)


-------- Saving the handle of the caster --------


Hashtable - Save Handle OfWW_TmpCaster as (Key Caster) of (Key WW_TmpHandle) in WW_Hashtable


-------- Setting the integers --------


Set WW_TmpInteger = (Level of WW_Ability for WW_TmpCaster)


Set WW_TmpInteger2 = (WW_DummyAmount_Base + (WW_DummyAmount_Level x WW_TmpInteger))


-------- Saving the integers --------


Hashtable - Save WW_TmpInteger2 as (Key OrbAmount) of (Key WW_TmpHandle) in WW_Hashtable


Hashtable - Save WW_TmpInteger as (Key Abilitylevel) of (Key WW_TmpHandle) in WW_Hashtable


-------- Adding the handle dummy to the group so the spell is MUI --------


Unitgroup - Add (Last created unit) to WW_FC_Group


-------- Setting the target point of the ability --------


Set WW_TmpPoint2 = (Target point of ability being cast)


-------- Creating the pillar and saving him --------


Unit - Create 1 WW_Pillar_Type for (Owner of WW_TmpCaster) at WW_TmpPoint2 facing default building facing degrees


Hashtable - Save Handle Of(Last created unit) as (Key Pillar) of (Key WW_TmpHandle) in WW_Hashtable


-------- The range --------


Set WW_TmpReal = (WW_Range_Base + (WW_Range_Level x (Real((Load (Key Abilitylevel) of (Key WW_TmpHandle) from WW_Hashtable)))))


Hashtable - Save WW_TmpReal as (Key Range) of (Key WW_TmpHandle) in WW_Hashtable


-------- Angle + creating the orbs --------


Set WW_TmpReal = ((Angle from WW_TmpPoint to WW_TmpPoint2) - (360.00 / (Real((Load (Key OrbAmount) of (Key WW_TmpHandle) from WW_Hashtable)))))


For each (Integer WW_LoopA) from 1 to WW_TmpInteger2, do (Actions)



Loop - Actions




Set WW_TmpInteger = (WW_LoopA + ((WW_TmpInteger2 x 2) + 1))




Set WW_TmpReal = (WW_TmpReal + (360.00 / (Real(WW_TmpInteger2))))




Unit - Create 1 WW_Orbs_Type for WW_TmpOwner at WW_TmpPoint2 facing WW_TmpReal degrees




Custom script: set udg_WW_TmpTrigger = CreateTrigger( )




Hashtable - Save Handle OfWW_TmpTrigger as WW_TmpInteger of (Key WW_TmpHandle) in WW_Hashtable




Custom script: call TriggerAddCondition( LoadTriggerHandle( udg_WW_Hashtable, GetHandleId(udg_WW_TmpHandle), udg_WW_TmpInteger ), Condition( function WW_TT_Group ) )




Custom script: call TriggerRegisterUnitInRange( LoadTriggerHandle( udg_WW_Hashtable, GetHandleId(udg_WW_TmpHandle), udg_WW_TmpInteger ), GetLastCreatedUnit(), LoadReal( udg_WW_Hashtable, GetHandleId(udg_WW_TmpHandle), StringHash("Range") ), null )




Hashtable - Save Handle Of(Last created unit) as WW_LoopA of (Key WW_TmpHandle) in WW_Hashtable




Hashtable - Save WW_TmpReal as (WW_LoopA + (Load (Key OrbAmount) of (Key WW_TmpHandle) from WW_Hashtable)) of (Key WW_TmpHandle) in WW_Hashtable


-------- The distance --------


Set WW_TmpReal = (WW_Distance_Base + (WW_Distance_Level x (Real((Load (Key Abilitylevel) of (Key WW_TmpHandle) from WW_Hashtable)))))


Hashtable - Save WW_TmpReal as (Key MaxDistance) of (Key WW_TmpHandle) in WW_Hashtable


-------- The duration --------


Set WW_TmpReal = (WW_Duration_Base + (WW_Duration_Level x (Real((Load (Key Abilitylevel) of (Key WW_TmpHandle) from WW_Hashtable)))))


Hashtable - Save WW_TmpReal as (Key Duration) of (Key WW_TmpHandle) in WW_Hashtable


-------- The damage --------


Set WW_TmpReal = (WW_Damage_Base + (WW_Damage_Level x (Real((Load (Key Abilitylevel) of (Key WW_TmpHandle) from WW_Hashtable)))))


Hashtable - Save WW_TmpReal as (Key Damage) of (Key WW_TmpHandle) in WW_Hashtable


-------- The speed --------


Set WW_TmpReal = (WW_Speed_Base + (WW_Speed_Level x (Real((Load (Key Abilitylevel) of (Key WW_TmpHandle) from WW_Hashtable)))))


Hashtable - Save WW_TmpReal as (Key Speed) of (Key WW_TmpHandle) in WW_Hashtable


-------- The rotation --------


Set WW_TmpReal = (WW_Rotation_Base + (WW_Rotation_Level x (Real((Load (Key Abilitylevel) of (Key WW_TmpHandle) from WW_Hashtable)))))


Hashtable - Save WW_TmpReal as (Key Rotation) of (Key WW_TmpHandle) in WW_Hashtable


-------- the distance --------


Hashtable - Save 0.00 as (Key Distance) of (Key WW_TmpHandle) in WW_Hashtable


-------- the boolean --------


Hashtable - Save FALSE as (Key Return) of (Key WW_TmpHandle) in WW_Hashtable


-------- turning on the loop --------


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



If - Conditions




(Winter Wrath Loop <gen> is on) Equal to FALSE



Then - Actions




Trigger - Turn on Winter Wrath Loop <gen>



Else - Actions


-------- clearing the leaks --------


Custom script: call RemoveLocation( udg_WW_TmpPoint )


Custom script: call RemoveLocation( udg_WW_TmpPoint2 )


Custom script: set udg_WW_TmpHandle = null
Winter Wrath Loop

Events


Timer - Every 0.03 seconds of game time

Conditions

Actions


Unitgroup - Pick every unit in WW_FC_Group and do (Actions)



Loop - Actions




Set WW_TmpHandle2 = (Picked unit)




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





If - Conditions






(Load (Key Duration) of (Key WW_TmpHandle2) from WW_Hashtable) Greater than 0.00





Then - Actions






Set WW_TmpReal = ((Load (Key Duration) of (Key WW_TmpHandle2) from WW_Hashtable) - 0.03)






Table de hachage - Save WW_TmpReal as (Key Duration) of (Key WW_TmpHandle2) in WW_Hashtable






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







If - Conditions








(Load (Key Distance) of (Key WW_TmpHandle2) from WW_Hashtable) Lesser than (Load (Key MaxDistance) of (Key WW_TmpHandle2) from WW_Hashtable)








(Load (Key Return) of (Key WW_TmpHandle2) from WW_Hashtable) Equal to FALSE







Then - Actions








Set WW_TmpReal = ((Load (Key Distance) of (Key WW_TmpHandle2) from WW_Hashtable) + (Load (Key Speed) of (Key WW_TmpHandle2) from WW_Hashtable))








Hashtable - Save WW_TmpReal as (Key Distance) of (Key WW_TmpHandle2) in WW_Hashtable








Set WW_TmpPoint = (Position of (Load (Key Pillar) of (Key WW_TmpHandle2) in WW_Hashtable))








Set WW_TmpInteger = (Load (Key OrbAmount) of (Key WW_TmpHandle2) from WW_Hashtable)








For each (Integer WW_LoopA) from 1 to (Load (Key OrbAmount) of (Key WW_TmpHandle2) from WW_Hashtable), do (Actions)









Loop - Actions










Set WW_TmpReal = ((Load (WW_LoopA + WW_TmpInteger) of (Key WW_TmpHandle2) from WW_Hashtable) + (Load (Key Rotation) of (Key WW_TmpHandle2) from WW_Hashtable))










Hashtable - Save WW_TmpReal as (WW_LoopA + (Load (Key OrbAmount) of (Key WW_TmpHandle2) from WW_Hashtable)) of (Key WW_TmpHandle2) in WW_Hashtable










Set WW_TmpPoint2 = (Position of (Load WW_LoopA of (Key WW_TmpHandle2) in WW_Hashtable))










Set WW_TmpPoint3 = (WW_TmpPoint offset by (Load (Key Distance) of (Key WW_TmpHandle2) from WW_Hashtable) towards (Load (WW_LoopA + (Load (Key OrbAmount) of (Key WW_TmpHandle2) from WW_Hashtable)) of (Key WW_TmpHandle2) from WW_Hashtable) degrees)










Set WW_TmpX = (X of WW_TmpPoint3)










Set WW_TmpY = (Y of WW_TmpPoint3)










Custom script: call SetUnitX( LoadUnitHandle( udg_WW_Hashtable, GetHandleId( udg_WW_TmpHandle2 ), udg_WW_LoopA ), udg_WW_TmpX )










Custom script: call SetUnitY( LoadUnitHandle( udg_WW_Hashtable, GetHandleId( udg_WW_TmpHandle2 ), udg_WW_LoopA ), udg_WW_TmpY )










Custom script: call RemoveLocation( udg_WW_TmpPoint2 )










Custom script: call RemoveLocation( udg_WW_TmpPoint3 )








Custom script: call RemoveLocation( udg_WW_TmpPoint )







Else - Actions








Hashtable - Save TRUE as (Key Return) of (Key WW_TmpHandle2) in WW_Hashtable








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









If - Conditions










(Load (Key Distance) of (Key WW_TmpHandle2) from WW_Hashtable) Greater than 0.00










(Load (Key Return) of (Key WW_TmpHandle2) from WW_Hashtable) Equal to TRUE









Then - Actions










Set WW_TmpReal = ((Load (Key Distance) of (Key WW_TmpHandle2) from WW_Hashtable) - (Load (Key Speed) of (Key WW_TmpHandle2) from WW_Hashtable))










Hashtable - Save WW_TmpReal as (Key Distance) of (Key WW_TmpHandle2) in WW_Hashtable










Set WW_TmpPoint = (Position of (Load (Key Pillar) of (Key WW_TmpHandle2) in WW_Hashtable))










Set WW_TmpInteger = (Load (Key OrbAmount) of (Key WW_TmpHandle2) from WW_Hashtable)










For each (Integer WW_LoopA) from 1 to (Load (Key OrbAmount) of (Key WW_TmpHandle2) from WW_Hashtable), do (Actions)











Loop - Actions












Set WW_TmpReal = ((Load (WW_LoopA + WW_TmpInteger) of (Key WW_TmpHandle2) from WW_Hashtable) + (Load (Key Rotation) of (Key WW_TmpHandle2) from WW_Hashtable))












Hashtable - Save WW_TmpReal as (WW_LoopA + (Load (Key OrbAmount) of (Key WW_TmpHandle2) from WW_Hashtable)) of (Key WW_TmpHandle2) in WW_Hashtable












Set WW_TmpPoint2 = (Position of (Load WW_LoopA of (Key WW_TmpHandle2) in WW_Hashtable))












Set WW_TmpPoint3 = (WW_TmpPoint offset by (Load (Key Distance) of (Key WW_TmpHandle2) from WW_Hashtable) towards (Load (WW_LoopA + (Load (Key OrbAmount) of (Key WW_TmpHandle2) from WW_Hashtable)) of (Key (Picked unit)) from WW_Hashtable) degrees)












Set WW_TmpX = (X of WW_TmpPoint3)












Set WW_TmpY = (Y of WW_TmpPoint3)












Custom script: call SetUnitX( LoadUnitHandle( udg_WW_Hashtable, GetHandleId( udg_WW_TmpHandle2 ), udg_WW_LoopA ), udg_WW_TmpX )












Custom script: call SetUnitY( LoadUnitHandle( udg_WW_Hashtable, GetHandleId( udg_WW_TmpHandle2 ), udg_WW_LoopA ), udg_WW_TmpY )












Custom script: call RemoveLocation( udg_WW_TmpPoint2 )












Custom script: call RemoveLocation( udg_WW_TmpPoint3 )










Custom script: call RemoveLocation( udg_WW_TmpPoint )









Else - Actions










Hashtable - Save FALSE as (Key Return) of (Key WW_TmpHandle2) in WW_Hashtable





Else - Actions






For each (Integer WW_LoopA) from 1 to (Load (Key OrbAmount) of (Key WW_TmpHandle2) from WW_Hashtable), do (Actions)







Loop - Actions








Set WW_TmpPoint = (Position of (Load WW_LoopA of (Key WW_TmpHandle2) in WW_Hashtable))








Set WW_TmpInteger2 = (Load (Key Orbamount) of (Key WW_TmpHandle2) from WW_Hashtable)








Set WW_TmpInteger = (WW_LoopA + ((WW_TmpInteger2 x 2) + 1))








Custom script: call DestroyTrigger( LoadTriggerHandle( udg_WW_Hashtable, GetHandleId(udg_WW_TmpHandle2), udg_WW_TmpInteger ) )








Unit - Remove (Load WW_LoopA of (Key WW_TmpHandle2) in WW_Hashtable) from the game








Set WW_TmpX = (X of WW_TmpPoint)








Set WW_TmpY = (Y of WW_TmpPoint)








Custom script: call DestroyEffect(AddSpecialEffect( udg_WW_EndEffect, udg_WW_TmpX, udg_WW_TmpY ) )








Custom script: call DestroyEffect(AddSpecialEffect( udg_WW_EndEffect2, udg_WW_TmpX, udg_WW_TmpY ) )








Custom script: call RemoveLocation( udg_WW_TmpPoint )






Set WW_TmpPoint = (Position of (Load (Key Pillar) of (Key WW_TmpHandle2) in WW_Hashtable))






Set WW_TmpX = (X of WW_TmpPoint)






Set WW_TmpY = (Y of WW_TmpPoint)






Unit - Remove (Load (Key Pillar) of (Key WW_TmpHandle2) in WW_Hashtable) from the game






Sound - Play WW_Sound at 100.00% volume, located at WW_TmpPoint with Z offset 0.00






Sound - Destroy WW_Sound






Custom script: call DestroyEffect(AddSpecialEffect( udg_WW_EndEffect, udg_WW_TmpX, udg_WW_TmpY ) )






Custom script: call DestroyEffect(AddSpecialEffect( udg_WW_EndEffect2, udg_WW_TmpX, udg_WW_TmpY ) )






Set WW_TmpUnits = (Picked unit)






Unitgroup - Remove WW_TmpUnits from WW_FC_Group






Unit - Remove WW_TmpUnits from the game






Hashtable - Clear all child hashtables of child (Key WW_TmpHandle2) in WW_Hashtable






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







If - Conditions








(Number of units in WW_FC_Group) Equal to 0







Then - Actions








Trigger - Turn off (This trigger)







Else - Actions






Custom script: call RemoveLocation( udg_WW_TmpPoint )






Custom script: set udg_WW_TmpUnits = null






Custom script: set udg_WW_TmpHandle2 = null
function WW_TT_Checkingifenemy takes nothing returns boolean
return IsUnitEnemy(GetTriggerUnit(), GetOwningPlayer(LoadUnitHandle( udg_WW_Hashtable, GetHandleId(GetEnumUnit()), StringHash("Caster") )))
endfunction
function WW_TT_Damageenemies takes nothing returns nothing
local weapontype udg_WW_Weapon_Type = WEAPON_TYPE_METAL_LIGHT_SLICE
if WW_TT_Checkingifenemy() == true then
call UnitDamageTarget( LoadUnitHandle( udg_WW_Hashtable, GetHandleId(GetEnumUnit()), StringHash("Caster") ), GetTriggerUnit(), LoadReal( udg_WW_Hashtable, GetHandleId(GetEnumUnit()), StringHash("Damage") ), true, false, udg_WW_Attack_Type, udg_WW_Damage_Type, udg_WW_Weapon_Type )
set udg_WW_TmpX = GetUnitX( GetTriggerUnit( ) )
set udg_WW_TmpY = GetUnitY( GetTriggerUnit( ) )
call DestroyEffect(AddSpecialEffect( udg_WW_Damage_Effect, udg_WW_TmpX, udg_WW_TmpY ) )
else
endif
endfunction
function WW_TT_Group takes nothing returns nothing
call ForGroup( udg_WW_Group, function WW_TT_Damageenemies )
endfunction