Moderator
M
Moderator
|
Spinning Ward Init

Events


Map initialization

Conditions

Actions


-------- --------------------------- --------


-------- Configuration --------


-------- --------------------------- --------


-------- Determines the ability --------


Set SW_Ability = Spinning Ward


-------- Determines the dummy unit-type --------


Set SW_DummyType = Spinning Ward Dummy


-------- Determines the Area of Effect where the ward will spread the ball missiles --------


Set SW_AoE[1] = 600.00


Set SW_AoE[2] = 600.00


Set SW_AoE[3] = 600.00


-------- Determines the first missile model --------


Set SW_MissileModel = Abilities\Weapons\AncestralGuardianMissile\AncestralGuardianMissile.mdl


-------- Determines the missile scale size --------


Set SW_MissileScale = 0.80


-------- Determines the missile flying arc height --------


Set SW_MissileArcHeight = 0.40


-------- Determines the missile travel time --------


Set SW_MissileTravelTime[1] = 1.00


Set SW_MissileTravelTime[2] = 1.00


Set SW_MissileTravelTime[3] = 1.00


-------- Determines the ward model --------


Set SW_WardModel = units\orc\SerpentWard\SerpentWard.mdl


-------- Determines the ward scale size --------


Set SW_WardScale = 1.00


-------- Determines the ward flying height --------


Set SW_WardHeight = -10.00


-------- Determines the ward duration --------


Set SW_WardDuration[1] = 8.00


Set SW_WardDuration[2] = 8.00


Set SW_WardDuration[3] = 8.00


-------- Determines spinning speed --------


Set SW_WardSpinSpeed[1] = 15.00


Set SW_WardSpinSpeed[2] = 15.00


Set SW_WardSpinSpeed[3] = 15.00


-------- Spin clockwise? --------


Set SW_WardSpinClockwise = False


-------- Determines the effect when the ward explode. Note: Can be more than one --------


Set SW_WardExEffect[1] = Abilities\Spells\Orc\AncestralSpirit\AncestralSpiritCaster.mdl


Set SW_WardExEffect[2] = Abilities\Spells\NightElf\BattleRoar\RoarCaster.mdl


Set SW_WardExEffect[3] = Units\NightElf\Wisp\WispExplode.mdl


Set SW_WardExEffect[4] = Abilities\Spells\Other\Volcano\VolcanoDeath.mdl


-------- Determines how many effects will be created --------


Set SW_WardExNumber = 4


-------- Determines the ward explosion damage --------


Set SW_WardExDamage[1] = 100.00


Set SW_WardExDamage[2] = 150.00


Set SW_WardExDamage[3] = 200.00


-------- Determines the ward explosion radius --------


Set SW_WardExRadius[1] = 300.00


Set SW_WardExRadius[2] = 300.00


Set SW_WardExRadius[3] = 300.00


-------- Determines the number of ball missiles will be spreaded when the ward explode --------


Set SW_WardExBallNumber[1] = 20


Set SW_WardExBallNumber[2] = 20


Set SW_WardExBallNumber[3] = 20


-------- Determines the orb missiles model used as the spinning effect that spins around the ward --------


Set SW_OrbModel = Abilities\Weapons\PhoenixMissile\Phoenix_Missile_mini.mdl


-------- Determines the orb missiles scale size --------


Set SW_OrbScale = 1.00


-------- Determines the orb missiles minimum flying height --------


Set SW_OrbMinHeight = 10.00


-------- Determines the orb missiles maximum flying height --------


Set SW_OrbMaxHeight = 100.00


-------- Determines the orb missiles spinning offset from the ward position --------


Set SW_OrbOffset = 30.00


-------- Determines the number of the orb missiles spinning around the ward --------


Set SW_OrbNumber[1] = 8


Set SW_OrbNumber[2] = 8


Set SW_OrbNumber[3] = 8


-------- Determines the ball missiles model --------


Set SW_BallModel = Abilities\Weapons\SerpentWardMissile\SerpentWardMissile.mdl


-------- Determines the ball missiles scale size --------


Set SW_BallScale = 1.00


-------- Determines the ball missiles flying arc height --------


Set SW_BallArcHeight = 0.50


-------- Determines the ball missiles minimum spread distance --------


Set SW_BallMinDistance = 100.00


-------- Determines the ball missiles spawn interval --------


Set SW_BallSpawnInterval = 0.06


-------- Determines the ball missiles move speed --------


Set SW_BallSpeed[1] = 20.00


Set SW_BallSpeed[2] = 20.00


Set SW_BallSpeed[3] = 20.00


-------- Determines the ball missiles explosion effect. Note: Can be more than one --------


Set SW_BallExEffect[1] = Abilities\Spells\Human\Feedback\SpellBreakerAttack.mdl


Set SW_BallExEffect[2] = Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl


Set SW_BallExEffect[3] = Abilities\Weapons\AncestralGuardianMissile\AncestralGuardianMissile.mdl


Set SW_BallExEffect[4] = Abilities\Weapons\VengeanceMissile\VengeanceMissile.mdl


-------- Determines how many ball missiles explosion effects will be created --------


Set SW_BallExNumber = 4


-------- Determines the ball missiles explosion damage --------


Set SW_BallExDamage[1] = 50.00


Set SW_BallExDamage[2] = 70.00


Set SW_BallExDamage[3] = 90.00


-------- Determines the ball missiles explosion radius --------


Set SW_BallExRadius[1] = 100.00


Set SW_BallExRadius[2] = 100.00


Set SW_BallExRadius[3] = 100.00


-------- Allow damaging flying units? --------


Set SW_DamageFlying = False


-------- Allow damaging ally units? --------


Set SW_DamageAlly = False


-------- Allow damaging magic immune units? --------


Set SW_DamageMagicImmnune = False


-------- Allow destroying trees? --------


Set SW_DestroyTrees = True


-------- Determines the spell update interval. Note: The lower the value, the lagger will be --------


Set SW_Interval = 0.03


-------- --------------------------- --------


-------- End of Configuration --------


-------- --------------------------- --------


Trigger - Turn off Spinning Ward Loop <gen>


Trigger - Add to Spinning Ward Loop <gen> the event (Time - Every SW_Interval seconds of game time)


Custom script: set udg_SW_X[101] = GetRectMinX(bj_mapInitialPlayableArea)


Custom script: set udg_SW_Y[101] = GetRectMinY(bj_mapInitialPlayableArea)


Custom script: set udg_SW_X[102] = GetRectMaxX(bj_mapInitialPlayableArea)


Custom script: set udg_SW_Y[102] = GetRectMaxY(bj_mapInitialPlayableArea)


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



If - Conditions




SW_WardSpinClockwise Equal to True



Then - Actions




Set SW_Rotator = -90.00




For each (Integer SW_Index) from 1 to 3, do (Actions)





Loop - Actions






Custom script: set udg_SW_OrbSpinSpeed[udg_SW_Index] = -(udg_SW_WardSpinSpeed[udg_SW_Index] * 0.01747)



Else - Actions




Set SW_Rotator = 90.00




For each (Integer SW_Index) from 1 to 3, do (Actions)





Loop - Actions






Custom script: set udg_SW_OrbSpinSpeed[udg_SW_Index] = udg_SW_WardSpinSpeed[udg_SW_Index] * 0.01747


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



If - Conditions




SW_DestroyTrees Equal to True



Then - Actions




Custom script: set udg_SW_HarvestOrder = OrderId("harvest")




Custom script: set udg_SW_Harvester = CreateUnit(Player(15), 'hpea', 0, 0, 0)




Custom script: call UnitAddAbility(udg_SW_Harvester, 'Aloc')




Unit - Hide SW_Harvester



Else - Actions


Game - Preload SW_MissileModel


Game - Preload SW_MissileModel


Game - Preload SW_WardModel


Game - Preload SW_OrbModel


Game - Preload SW_BallModel


For each (Integer SW_Index) from 1 to SW_WardExNumber, do (Actions)



Loop - Actions




Game - Preload SW_WardExEffect[SW_Index]


For each (Integer SW_Index) from 1 to SW_BallExNumber, do (Actions)



Loop - Actions




Game - Preload SW_BallExEffect[SW_Index]
Spinning Ward Cast

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to SW_Ability

Actions


Set SW_MaxIndex = (SW_MaxIndex + 1)


Set SW_Caster[SW_MaxIndex] = (Triggering unit)


Set SW_Owner[SW_MaxIndex] = (Triggering player)


Set SW_Level[SW_MaxIndex] = (Level of SW_Ability for SW_Caster[SW_MaxIndex])


Custom script: set udg_SW_X[1] = GetUnitX(udg_SW_Caster[udg_SW_MaxIndex])


Custom script: set udg_SW_Y[1] = GetUnitY(udg_SW_Caster[udg_SW_MaxIndex])


Custom script: set udg_SW_X[2] = GetSpellTargetX() - udg_SW_X[1]


Custom script: set udg_SW_Y[2] = GetSpellTargetY() - udg_SW_Y[1]


Custom script: set udg_SW_Angle[udg_SW_MaxIndex] = Atan2(udg_SW_Y[2], udg_SW_X[2])


Custom script: set udg_SW_Dummy[udg_SW_MaxIndex] = CreateUnit(udg_SW_Owner[udg_SW_MaxIndex], udg_SW_DummyType, udg_SW_X[1], udg_SW_Y[1], udg_SW_Angle[udg_SW_MaxIndex] * 57.29582)


Special Effect - Create a special effect attached to the origin of SW_Dummy[SW_MaxIndex] using SW_MissileModel


Set SW_AttachedModel[SW_MaxIndex] = (Last created special effect)


Custom script: call SetUnitScale(udg_SW_Dummy[udg_SW_MaxIndex], udg_SW_MissileScale, 0, 0)


Custom script: set udg_SW_MaxDistance[udg_SW_MaxIndex] = SquareRoot(udg_SW_X[2] * udg_SW_X[2] + udg_SW_Y[2] * udg_SW_Y[2])


Set SW_Distance[SW_MaxIndex] = 0.00


Set SW_MaxHeight[SW_MaxIndex] = (SW_MaxDistance[SW_MaxIndex] x SW_MissileArcHeight)


Set SW_Speed[SW_MaxIndex] = (SW_MaxDistance[SW_MaxIndex] / (SW_MissileTravelTime[SW_Level[SW_MaxIndex]] / SW_Interval))


Set SW_Stage[SW_MaxIndex] = 4


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



If - Conditions




SW_MaxIndex Equal to 1



Then - Actions




Trigger - Turn on Spinning Ward Loop <gen>



Else - Actions
Spinning Ward Loop

Events

Conditions

Actions


For each (Integer SW_Index) from 1 to SW_MaxIndex, do (Actions)



Loop - Actions




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





If - Conditions






SW_Stage[SW_Index] Equal to 1





Then - Actions






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







If - Conditions








SW_Distance[SW_Index] Less than SW_MaxDistance[SW_Index]







Then - Actions








Set SW_Distance[SW_Index] = (SW_Distance[SW_Index] + SW_BallSpeed[SW_Level[SW_Index]])








Custom script: set udg_SW_X[1] = udg_SW_SourceX[udg_SW_Index] + udg_SW_Distance[udg_SW_Index] * Cos(udg_SW_Angle[udg_SW_Index])








Custom script: set udg_SW_Y[1] = udg_SW_SourceY[udg_SW_Index] + udg_SW_Distance[udg_SW_Index] * Sin(udg_SW_Angle[udg_SW_Index])








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









If - Conditions










SW_X[1] Greater than SW_X[101]










SW_Y[1] Greater than SW_Y[101]










SW_X[1] Less than SW_X[102]










SW_Y[1] Less than SW_Y[102]









Then - Actions










Custom script: call SetUnitX(udg_SW_Dummy[udg_SW_Index], udg_SW_X[1])










Custom script: call SetUnitY(udg_SW_Dummy[udg_SW_Index], udg_SW_Y[1])









Else - Actions








Custom script: set udg_SW_MaxHeight[0] = (((4.00 * udg_SW_MaxHeight[udg_SW_Index]) / udg_SW_MaxDistance[udg_SW_Index]) * ((udg_SW_MaxDistance[udg_SW_Index] - udg_SW_Distance[udg_SW_Index]) * (udg_SW_Distance[udg_SW_Index] / udg_SW_MaxDistance[udg_SW_Index])))








Animation - Change SW_Dummy[SW_Index] flying height to SW_MaxHeight[0] at 0.00







Else - Actions








Custom script: set udg_SW_X[1] = GetUnitX(udg_SW_Dummy[udg_SW_Index])








Custom script: set udg_SW_Y[1] = GetUnitY(udg_SW_Dummy[udg_SW_Index])








For each (Integer SW_Loop) from 1 to SW_BallExNumber, do (Actions)









Loop - Actions










Custom script: call DestroyEffect(AddSpecialEffect(udg_SW_BallExEffect[udg_SW_Loop], udg_SW_X[1], udg_SW_Y[1]))








Set SW_TempLoc = (Point(SW_X[1], SW_Y[1]))








Custom script: set bj_wantDestroyGroup = true








Unit Group - Pick every unit in (Units within SW_BallExRadius[SW_Level[SW_Index]] of SW_TempLoc) and do (Actions)









Loop - Actions










Set SW_PickedUnit = (Picked unit)










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











If - Conditions












(SW_PickedUnit is A flying unit) Equal to SW_DamageFlying












(SW_PickedUnit is Magic Immune) Equal to SW_DamageMagicImmnune












(SW_PickedUnit belongs to an ally of SW_Owner[SW_Index]) Equal to SW_DamageAlly












(SW_PickedUnit is dead) Equal to False











Then - Actions












Unit - Cause SW_Caster[SW_Index] to damage SW_PickedUnit, dealing SW_BallExDamage[SW_Level[SW_Index]] damage of attack type SW_AttackType and damage type SW_DamageType











Else - Actions








Custom script: call RemoveLocation(udg_SW_TempLoc)








Special Effect - Destroy SW_AttachedModel[SW_Index]








Unit - Kill SW_Dummy[SW_Index]








Set SW_Stage[SW_Index] = 5





Else - Actions






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







If - Conditions








SW_Stage[SW_Index] Equal to 2







Then - Actions








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









If - Conditions










SW_RealTimer[SW_Index] Greater than 0.00









Then - Actions










Set SW_Angle[SW_Index] = (SW_Angle[SW_Index] + SW_OrbSpinSpeed[SW_Level[SW_Index]])










Custom script: set udg_SW_X[1] = udg_SW_SourceX[udg_SW_Index] + udg_SW_OrbOffset * Cos(udg_SW_Angle[udg_SW_Index])










Custom script: set udg_SW_Y[1] = udg_SW_SourceY[udg_SW_Index] + udg_SW_OrbOffset * Sin(udg_SW_Angle[udg_SW_Index])










Custom script: call SetUnitX(udg_SW_Dummy[udg_SW_Index], udg_SW_X[1])










Custom script: call SetUnitY(udg_SW_Dummy[udg_SW_Index], udg_SW_Y[1])










Set SW_RealTimer[SW_Index] = (SW_RealTimer[SW_Index] - SW_Interval)









Else - Actions










Special Effect - Destroy SW_AttachedModel[SW_Index]










Unit - Kill SW_Dummy[SW_Index]










Set SW_Stage[SW_Index] = 5







Else - Actions








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









If - Conditions










SW_Stage[SW_Index] Equal to 3









Then - Actions










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











If - Conditions












SW_RealTimer[SW_Index] Greater than 0.00











Then - Actions












Set SW_Angle[SW_Index] = (SW_Angle[SW_Index] + SW_Rotator)












Special Effect - Destroy SW_AttachedModel[SW_Index]












Unit - Kill SW_Dummy[SW_Index]












Custom script: set udg_SW_Dummy[udg_SW_Index] = CreateUnit(udg_SW_Owner[udg_SW_Index], udg_SW_DummyType, udg_SW_SourceX[udg_SW_Index], udg_SW_SourceY[udg_SW_Index], udg_SW_Angle[udg_SW_Index])












Special Effect - Create a special effect attached to the origin of SW_Dummy[SW_Index] using SW_WardModel












Set SW_AttachedModel[SW_Index] = (Last created special effect)












Custom script: call SetUnitScale(udg_SW_Dummy[udg_SW_Index], udg_SW_WardScale, 0, 0)












Animation - Change SW_Dummy[SW_Index] flying height to SW_WardHeight at 0.00












Set SW_RealTimer2[SW_Index] = (SW_RealTimer2[SW_Index] - SW_Interval)












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













If - Conditions














SW_RealTimer2[SW_Index] Less than or equal to 0.00













Then - Actions














Set SW_MaxIndex = (SW_MaxIndex + 1)














Custom script: set udg_SW_Dummy[udg_SW_MaxIndex] = CreateUnit(udg_SW_Owner[udg_SW_Index], udg_SW_DummyType, udg_SW_SourceX[udg_SW_Index], udg_SW_SourceY[udg_SW_Index], udg_SW_Angle[udg_SW_Index] * 57.29582)














Special Effect - Create a special effect attached to the origin of SW_Dummy[SW_MaxIndex] using SW_BallModel














Set SW_AttachedModel[SW_MaxIndex] = (Last created special effect)














Custom script: call SetUnitScale(udg_SW_Dummy[udg_SW_MaxIndex], udg_SW_BallScale, 0, 0)














Set SW_Caster[SW_MaxIndex] = SW_Caster[SW_Index]














Set SW_Owner[SW_MaxIndex] = SW_Owner[SW_Index]














Set SW_Level[SW_MaxIndex] = SW_Level[SW_Index]














Set SW_MaxDistance[SW_MaxIndex] = (Random real number between SW_BallMinDistance and SW_AoE[SW_Level[SW_MaxIndex]])














Set SW_Distance[SW_MaxIndex] = 0.00














Set SW_MaxHeight[SW_MaxIndex] = (SW_MaxDistance[SW_MaxIndex] x SW_BallArcHeight)














Set SW_Angle[SW_MaxIndex] = SW_Angle[SW_Index]














Set SW_SourceX[SW_MaxIndex] = SW_SourceX[SW_Index]














Set SW_SourceY[SW_MaxIndex] = SW_SourceY[SW_Index]














Set SW_Stage[SW_MaxIndex] = 1














Set SW_RealTimer2[SW_Index] = SW_BallSpawnInterval













Else - Actions












Set SW_RealTimer[SW_Index] = (SW_RealTimer[SW_Index] - SW_Interval)











Else - Actions












For each (Integer SW_Loop) from 1 to SW_WardExNumber, do (Actions)













Loop - Actions














Custom script: call DestroyEffect(AddSpecialEffect(udg_SW_WardExEffect[udg_SW_Loop], udg_SW_SourceX[udg_SW_Index], udg_SW_SourceY[udg_SW_Index]))












Set SW_TempLoc = (Point(SW_SourceX[SW_Index], SW_SourceY[SW_Index]))












Custom script: set bj_wantDestroyGroup = true












Unit Group - Pick every unit in (Units within SW_WardExRadius[SW_Level[SW_Index]] of SW_TempLoc) and do (Actions)













Loop - Actions














Set SW_PickedUnit = (Picked unit)














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















If - Conditions
















(SW_PickedUnit is A flying unit) Equal to SW_DamageFlying
















(SW_PickedUnit is Magic Immune) Equal to SW_DamageMagicImmnune
















(SW_PickedUnit belongs to an ally of SW_Owner[SW_Index]) Equal to SW_DamageAlly
















(SW_PickedUnit is dead) Equal to False















Then - Actions
















Unit - Cause SW_Caster[SW_Index] to damage SW_PickedUnit, dealing SW_WardExDamage[SW_Level[SW_Index]] damage of attack type SW_AttackType and damage type SW_DamageType















Else - Actions












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













If - Conditions














SW_DestroyTrees Equal to True













Then - Actions














Destructible - Pick every destructible within SW_WardExRadius[SW_Level[SW_Index]] of SW_TempLoc and do (Actions)















Loop - Actions
















Set SW_PickedDest = (Picked destructible)
















Custom script: call IssueTargetOrderById(udg_SW_Harvester, udg_SW_HarvestOrder, udg_SW_PickedDest)
















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

















If - Conditions


















(SW_PickedDest is dead) Equal to False


















(Current order of SW_Harvester) Equal to SW_HarvestOrder

















Then - Actions


















Destructible - Kill SW_PickedDest

















Else - Actions














Unit - Order SW_Harvester to Stop













Else - Actions












Custom script: call RemoveLocation(udg_SW_TempLoc)












Set SW_Angle[0] = (Random real number between 0.00 and 360.00)












Set SW_Gap = (360.00 / (Real(SW_WardExBallNumber[SW_Level[SW_Index]])))












For each (Integer SW_Loop) from 1 to SW_WardExBallNumber[SW_Level[SW_Index]], do (Actions)













Loop - Actions














Set SW_MaxIndex = (SW_MaxIndex + 1)














Set SW_Angle[0] = (SW_Angle[0] + SW_Gap)














Custom script: set udg_SW_Angle[udg_SW_MaxIndex] = udg_SW_Angle[0] * 0.01747














Custom script: set udg_SW_Dummy[udg_SW_MaxIndex] = CreateUnit(udg_SW_Owner[udg_SW_Index], udg_SW_DummyType, udg_SW_SourceX[udg_SW_Index], udg_SW_SourceY[udg_SW_Index], udg_SW_Angle[0])














Special Effect - Create a special effect attached to the origin of SW_Dummy[SW_MaxIndex] using SW_BallModel














Set SW_AttachedModel[SW_MaxIndex] = (Last created special effect)














Custom script: call SetUnitScale(udg_SW_Dummy[udg_SW_MaxIndex], udg_SW_BallScale, 0, 0)














Set SW_Caster[SW_MaxIndex] = SW_Caster[SW_Index]














Set SW_Owner[SW_MaxIndex] = SW_Owner[SW_Index]














Set SW_Level[SW_MaxIndex] = SW_Level[SW_Index]














Set SW_MaxDistance[SW_MaxIndex] = (Random real number between SW_BallMinDistance and SW_AoE[SW_Level[SW_MaxIndex]])














Set SW_Distance[SW_MaxIndex] = 0.00














Set SW_MaxHeight[SW_MaxIndex] = (SW_MaxDistance[SW_MaxIndex] x SW_BallArcHeight)














Set SW_SourceX[SW_MaxIndex] = SW_SourceX[SW_Index]














Set SW_SourceY[SW_MaxIndex] = SW_SourceY[SW_Index]














Set SW_Stage[SW_MaxIndex] = 1












Special Effect - Destroy SW_AttachedModel[SW_Index]












Unit - Kill SW_Dummy[SW_Index]












Set SW_Stage[SW_Index] = 5









Else - Actions










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











If - Conditions












SW_Stage[SW_Index] Equal to 4











Then - Actions












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













If - Conditions














SW_Distance[SW_Index] Less than SW_MaxDistance[SW_Index]













Then - Actions














Custom script: set udg_SW_X[1] = GetUnitX(udg_SW_Dummy[udg_SW_Index]) + udg_SW_Speed[udg_SW_Index] * Cos(udg_SW_Angle[udg_SW_Index])














Custom script: set udg_SW_Y[1] = GetUnitY(udg_SW_Dummy[udg_SW_Index]) + udg_SW_Speed[udg_SW_Index] * Sin(udg_SW_Angle[udg_SW_Index])














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















If - Conditions
















SW_X[1] Greater than SW_X[101]
















SW_Y[1] Greater than SW_Y[101]
















SW_X[1] Less than SW_X[102]
















SW_Y[1] Less than SW_Y[102]















Then - Actions
















Custom script: call SetUnitX(udg_SW_Dummy[udg_SW_Index], udg_SW_X[1])
















Custom script: call SetUnitY(udg_SW_Dummy[udg_SW_Index], udg_SW_Y[1])















Else - Actions














Set SW_Distance[SW_Index] = (SW_Distance[SW_Index] + SW_Speed[SW_Index])














Custom script: set udg_SW_MaxHeight[0] = (((4.00 * udg_SW_MaxHeight[udg_SW_Index]) / udg_SW_MaxDistance[udg_SW_Index]) * ((udg_SW_MaxDistance[udg_SW_Index] - udg_SW_Distance[udg_SW_Index]) * (udg_SW_Distance[udg_SW_Index] / udg_SW_MaxDistance[udg_SW_Index])))














Animation - Change SW_Dummy[SW_Index] flying height to SW_MaxHeight[0] at 0.00













Else - Actions














Special Effect - Destroy SW_AttachedModel[SW_Index]














Special Effect - Create a special effect attached to the origin of SW_Dummy[SW_Index] using SW_WardModel














Set SW_AttachedModel[SW_Index] = (Last created special effect)














Custom script: call SetUnitScale(udg_SW_Dummy[udg_SW_Index], udg_SW_WardScale, 0, 0)














Animation - Change SW_Dummy[SW_Index] flying height to SW_WardHeight at 0.00














Custom script: set udg_SW_Angle[udg_SW_Index] = udg_SW_Angle[udg_SW_Index] * 57.29582














Custom script: set udg_SW_SourceX[udg_SW_Index] = GetUnitX(udg_SW_Dummy[udg_SW_Index])














Custom script: set udg_SW_SourceY[udg_SW_Index] = GetUnitY(udg_SW_Dummy[udg_SW_Index])














Set SW_RealTimer[SW_Index] = SW_WardDuration[SW_Level[SW_Index]]














Set SW_RealTimer2[SW_Index] = SW_BallSpawnInterval














Set SW_Stage[SW_Index] = 3














Set SW_Angle[0] = (Random real number between 0.00 and 360.00)














Set SW_Gap = (360.00 / (Real(SW_OrbNumber[SW_Level[SW_Index]])))














For each (Integer SW_Loop) from 1 to SW_OrbNumber[SW_Level[SW_Index]], do (Actions)















Loop - Actions
















Set SW_MaxIndex = (SW_MaxIndex + 1)
















Set SW_Angle[0] = (SW_Angle[0] + SW_Gap)
















Custom script: set udg_SW_Angle[udg_SW_MaxIndex] = udg_SW_Angle[0] * 0.01747
















Custom script: set udg_SW_X[1] = udg_SW_SourceX[udg_SW_Index] + udg_SW_OrbOffset * Cos(udg_SW_Angle[udg_SW_MaxIndex])
















Custom script: set udg_SW_Y[1] = udg_SW_SourceY[udg_SW_Index] + udg_SW_OrbOffset * Sin(udg_SW_Angle[udg_SW_MaxIndex])
















Custom script: set udg_SW_Dummy[udg_SW_MaxIndex] = CreateUnit(udg_SW_Owner[udg_SW_Index], udg_SW_DummyType, udg_SW_X[1], udg_SW_Y[1], udg_SW_Angle[0])
















Special Effect - Create a special effect attached to the origin of SW_Dummy[SW_MaxIndex] using SW_OrbModel
















Set SW_AttachedModel[SW_MaxIndex] = (Last created special effect)
















Custom script: call SetUnitScale(udg_SW_Dummy[udg_SW_MaxIndex], udg_SW_OrbScale, 0, 0)
















Animation - Change SW_Dummy[SW_MaxIndex] flying height to (Random real number between SW_OrbMinHeight and SW_OrbMaxHeight) at 0.00
















Set SW_Level[SW_MaxIndex] = SW_Level[SW_Index]
















Set SW_RealTimer[SW_MaxIndex] = SW_RealTimer[SW_Index]
















Set SW_SourceX[SW_MaxIndex] = SW_SourceX[SW_Index]
















Set SW_SourceY[SW_MaxIndex] = SW_SourceY[SW_Index]
















Set SW_Stage[SW_MaxIndex] = 2











Else - Actions












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













If - Conditions














SW_Stage[SW_Index] Equal to 5













Then - Actions














Set SW_Angle[SW_Index] = SW_Angle[SW_MaxIndex]














Set SW_AttachedModel[SW_Index] = SW_AttachedModel[SW_MaxIndex]














Set SW_Caster[SW_Index] = SW_Caster[SW_MaxIndex]














Set SW_Distance[SW_Index] = SW_Distance[SW_MaxIndex]














Set SW_Dummy[SW_Index] = SW_Dummy[SW_MaxIndex]














Set SW_Level[SW_Index] = SW_Level[SW_MaxIndex]














Set SW_MaxDistance[SW_Index] = SW_MaxDistance[SW_MaxIndex]














Set SW_MaxHeight[SW_Index] = SW_MaxHeight[SW_MaxIndex]














Set SW_Owner[SW_Index] = SW_Owner[SW_MaxIndex]














Set SW_RealTimer[SW_Index] = SW_RealTimer[SW_MaxIndex]














Set SW_RealTimer2[SW_Index] = SW_RealTimer2[SW_MaxIndex]














Set SW_SourceX[SW_Index] = SW_SourceX[SW_MaxIndex]














Set SW_SourceY[SW_Index] = SW_SourceY[SW_MaxIndex]














Set SW_Speed[SW_Index] = SW_Speed[SW_MaxIndex]














Set SW_Stage[SW_Index] = SW_Stage[SW_MaxIndex]














Set SW_Index = (SW_Index - 1)














Set SW_MaxIndex = (SW_MaxIndex - 1)














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















If - Conditions
















SW_MaxIndex Equal to 0















Then - Actions
















Trigger - Turn off (This trigger)















Else - Actions













Else - Actions
/****************************************************************************
* *
* Spinning Ward v1.0 *
* by Ofel *
* *
*****************************************************************************
* *
* + Requirements: *
* - None. *
* *
* + How to import? *
* - Open File --> Preferences... Enable the "Automatically create *
* unknown variables while pasting trigger data". *
* - Export dummy.mdx from Import Manager (F12) and import it to your *
* map. *
* - Copy Spinning Ward ability in Object Editor (F6). *
* - Copy Spinning Ward Dummy unit in Object Editor (F6). *
* - Copy all Spinning Ward triggers. Tips: Just copy the category. *
* *
* When pasting the triggers, some trigger actions will may be disabled, *
* so make sure to enable it. Also, don't forget to configure SW_Ability *
* and SW_DummyType in the Spinning Ward Init trigger. *
* *
* If you any question or suggestion about this spell, contact me by *
* sending Private Message (PM) or leave Visitor Message (VM), but you'll *
* need to register on The Hive Workshop first. *
* *
*****************************************************************************
* *
* + Requested by: *
* - None. *
* *
* + Inspired by: *
* - Serpent Ward spell. *
* - Volcano spell. *
* *
* + Credits: *
* - Vexorian: dummy.mdx model. *
* *
* + Changelog: *
* - v1.0: Initial version. *
* *
****************************************************************************/