Thunder Shot Setting

Events


Map initialization

Conditions

Actions


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


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


Set TS_Ability = Thunder Shot


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


-------- Determines the missile dummy --------


Set TS_MissileDummy = Missile Dummy


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


-------- Determines the missile spawn offset from caster position --------


Set TS_MissileSpawnOffset[1] = 50.00


Set TS_MissileSpawnOffset[2] = 50.00


Set TS_MissileSpawnOffset[3] = 50.00


Set TS_MissileSpawnOffset[4] = 50.00


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


-------- Determines the missile move speed --------


Set TS_MissileSpeed[1] = 50.00


Set TS_MissileSpeed[2] = 50.00


Set TS_MissileSpeed[3] = 50.00


Set TS_MissileSpeed[4] = 50.00


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


-------- Determines the minimum distance the missile can travel before it is considered as "End" (Impact the target) --------


Set TS_MinDistance = 50.00


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


-------- Determines the damage dealt to nearby enemy units --------


Set TS_Damage[1] = 100.00


Set TS_Damage[2] = 120.00


Set TS_Damage[3] = 140.00


Set TS_Damage[4] = 160.00


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


-------- Determines the attack-type --------


Set TS_AttackType = Spells


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


-------- Determines the damage-type --------


Set TS_DamageType = Lightning


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


-------- Determines the effect shows on damaged units --------


Set TS_DamagedEffect = Abilities\Weapons\FarseerMissile\FarseerMissile.mdl


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


-------- Determines the attachment point of the effect above --------


Set TS_DamagedEffectAttachment = chest


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


-------- Determines the damage radius/range --------


Set TS_Radius[1] = 400.00


Set TS_Radius[2] = 400.00


Set TS_Radius[3] = 400.00


Set TS_Radius[4] = 400.00


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


-------- Determines the explosion dummy. Note that this can have many variation that can make the spell more nice-looking --------


Set TS_ExplosionDummy[1] = Explosion 1


Set TS_ExplosionFadeRate[1] = 5.00


Set TS_ExplosionDummy[2] = Explosion 2


Set TS_ExplosionFadeRate[2] = 5.00


Set TS_ExplosionDummy[3] = Explosion 3


Set TS_ExplosionFadeRate[3] = 5.00


Set TS_ExplosionDummy[4] = Explosion 4


Set TS_ExplosionFadeRate[4] = 5.00


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


-------- Determines the explosion dummy variation number --------


Set TS_ExplosionDummyNum = 4


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


Set TS_OrgMinDistance = TS_MinDistance
Thunder Shot Cast

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to TS_Ability

Actions


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



If - Conditions




TS_MaxIndex Equal to 0



Then - Actions




Trigger - Turn on Thunder Shot Loop <gen>



Else - Actions


Set TS_MaxIndex = (TS_MaxIndex + 1)


Set TS_Caster[TS_MaxIndex] = (Triggering unit)


Set TS_Target[TS_MaxIndex] = (Target unit of ability being cast)


Set TS_Level[TS_MaxIndex] = (Level of TS_Ability for TS_Caster[TS_MaxIndex])


Set TS_TempLoc = (Position of TS_Caster[TS_MaxIndex])


Set TS_TempLoc2 = (Position of TS_Target[TS_MaxIndex])


Set TS_Angle = (Angle from TS_TempLoc to TS_TempLoc2)


Set TS_TempLoc3 = (TS_TempLoc offset by TS_MissileSpawnOffset[TS_Level[TS_MaxIndex]] towards TS_Angle degrees)


Unit - Create 1 TS_MissileDummy for (Triggering player) at TS_TempLoc3 facing TS_Angle degrees


Set TS_Missile[TS_MaxIndex] = (Last created unit)


Custom script: call RemoveLocation(udg_TS_TempLoc)


Custom script: call RemoveLocation(udg_TS_TempLoc2)


Custom script: call RemoveLocation(udg_TS_TempLoc3)
Thunder Shot Loop

Events


Time - Every 0.03 seconds of game time

Conditions

Actions


For each (Integer TS_Index) from 1 to TS_MaxIndex, do (Actions)



Loop - Actions




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





If - Conditions






(TS_Target[TS_Index] is dead) Equal to True





Then - Actions






Set TS_MinDistance = 1000000000.00





Else - Actions




Set TS_TempLoc = (Position of TS_Missile[TS_Index])




Set TS_TempLoc2 = (Position of TS_Target[TS_Index])




Set TS_Distance = (Distance between TS_TempLoc and TS_TempLoc2)




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





If - Conditions






TS_Distance Greater than TS_MinDistance





Then - Actions






Set TS_Angle = (Angle from TS_TempLoc to TS_TempLoc2)






Set TS_TempLoc3 = (TS_TempLoc offset by TS_MissileSpeed[TS_Level[TS_Index]] towards TS_Angle degrees)






Unit - Move TS_Missile[TS_Index] instantly to TS_TempLoc3, facing TS_Angle degrees






Custom script: call RemoveLocation(udg_TS_TempLoc3)





Else - Actions






Set TS_MinDistance = TS_OrgMinDistance






Set TS_Owner = (Owner of TS_Caster[TS_Index])






Set TS_TempGroup = (Units within TS_Radius[TS_Level[TS_Index]] of TS_TempLoc)






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







Loop - Actions








Set TS_PickedUnit = (Picked unit)








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









If - Conditions










(TS_PickedUnit is dead) Equal to False










(TS_PickedUnit is A structure) Equal to False










(TS_PickedUnit is Magic Immune) Equal to False










(TS_PickedUnit belongs to an ally of TS_Owner) Equal to False









Then - Actions










Unit - Cause TS_Caster[TS_Index] to damage TS_PickedUnit, dealing TS_Damage[TS_Level[TS_Index]] damage of attack type TS_AttackType and damage type TS_DamageType










Special Effect - Create a special effect attached to the TS_DamagedEffectAttachment of TS_PickedUnit using TS_DamagedEffect










Special Effect - Destroy (Last created special effect)









Else - Actions






Set TS_PickedUnit = No unit






Custom script: call DestroyGroup(udg_TS_TempGroup)






For each (Integer TS_Loop) from 1 to TS_ExplosionDummyNum, do (Actions)







Loop - Actions








Unit - Create 1 TS_ExplosionDummy[TS_Loop] for TS_Owner at TS_TempLoc facing 0.00 degrees








Set FSUnit = (Last created unit)








Set FSStartOpacity = 0.00








Set FSStart = 0.00








Set FSEnd = 100.00








Set FSSpeed = TS_ExplosionFadeRate[TS_Loop]








Set FSFadeIn = False








Set FSTinted = False








Set FSRed = 0.00








Set FSGreen = 0.00








Set FSBlue = 0.00








Trigger - Run FSAddUnit <gen> (ignoring conditions)






Custom script: set udg_TS_Owner=null






Unit - Kill TS_Missile[TS_Index]






Set TS_Caster[TS_Index] = TS_Caster[TS_MaxIndex]






Set TS_Level[TS_Index] = TS_Level[TS_MaxIndex]






Set TS_Missile[TS_Index] = TS_Missile[TS_MaxIndex]






Set TS_Target[TS_Index] = TS_Target[TS_MaxIndex]






Set TS_Caster[TS_MaxIndex] = No unit






Set TS_Missile[TS_MaxIndex] = No unit






Set TS_Target[TS_MaxIndex] = No unit






Set TS_Index = (TS_Index - 1)






Set TS_MaxIndex = (TS_MaxIndex - 1)






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







If - Conditions








TS_MaxIndex Equal to 0







Then - Actions








Trigger - Turn off (This trigger)







Else - Actions




Custom script: call RemoveLocation(udg_TS_TempLoc)




Custom script: call RemoveLocation(udg_TS_TempLoc2)