Moderator
M
Moderator
08:05, 26th Jul 2013
Magtheridon96: Approved.
Magtheridon96: Approved.
FB Initial

Events


Map initialization

Conditions

Actions


-------- Do Not Change --------


Hashtable - Create a hashtable


Set FB_HA = (Last created hashtable)


-------- Do Not Change --------


-------- Please Re-Set these Values when importing --------


Set FB_Ability = Freezing Bow


Set FB_Dummy_Ability = Dummy Ability


Set FB_Dummies[1] = Freezing Bow Dummy 1


Set FB_Dummies[2] = Freezing Bow Dummy 2


Set FB_Dummies[3] = Freezing Bow Dummy 3


-------- Please Re-Set these Values when importing --------


-------- Random splitting set to true makes arrows split randomly, if set to false, arrows will split in a symetrique way --------


Set FB_Random_Splitting = True


-------- Effects --------


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


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


Set FB_Fx_Missile = Abilities\Spells\Other\FrostArrows\NagaColdArrowMissile.mdl


-------- AoE of the Spell --------


Set FB_AoE[1] = 150.00


Set FB_AoE[2] = 300.00


Set FB_AoE[3] = 450.00


-------- Primary Target Damage --------


Set FB_Dmg[1] = 100.00


Set FB_Dmg[2] = 150.00


Set FB_Dmg[3] = 200.00


-------- Primary Missile Speed --------


Set FB_MissileSpeed[1] = 1500.00


Set FB_MissileSpeed[2] = 1500.00


Set FB_MissileSpeed[3] = 1500.00


-------- AoE of damage and slow of spreading arrows --------


Set FB_SpreadAoE[1] = 175.00


Set FB_SpreadAoE[2] = 175.00


Set FB_SpreadAoE[3] = 175.00


-------- Amount of arrows spreaded --------


Set FB_Spread_Arrows[1] = 5


Set FB_Spread_Arrows[2] = 15


Set FB_Spread_Arrows[3] = 25


-------- Spread arrows damage --------


Set FB_SpreadDmg[1] = 25.00


Set FB_SpreadDmg[2] = 50.00


Set FB_SpreadDmg[3] = 75.00


-------- Spread Arrows Missile Speed --------


Set FB_SpreadMissileSpeed[1] = 750.00


Set FB_SpreadMissileSpeed[2] = 750.00


Set FB_SpreadMissileSpeed[3] = 750.00
FB Cast

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to FB_Ability

Actions


Set Unit = (Triggering unit)


Set x = (Level of FB_Ability for Unit)


Set loc = (Position of Unit)


Set Unit1 = (Target unit of ability being cast)


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



If - Conditions




Unit1 Not equal to No unit



Then - Actions




Set loc1 = (Position of Unit1)




Unit - Create 1 FB_Dummies[1] for (Triggering player) at loc facing (Angle from loc to loc1) degrees




Set Unit2 = (Last created unit)




Special Effect - Create a special effect attached to the origin of Unit2 using FB_Fx_Missile




Custom script: set udg_Key = GetHandleId(udg_Unit2)




Set y = (Default flying height of Unit1)




Animation - Change Unit2 flying height to (y + 65.00) at (y / ((Distance between loc and loc1) / (0.75 x FB_MissileSpeed[x])))




Hashtable - Save Handle OfUnit1 as 1 of Key in FB_HA




Hashtable - Save Unit as 3 of Key in FB_HA



Else - Actions




Set loc1 = (Target point of ability being cast)




Unit - Create 1 FB_Dummies[1] for (Triggering player) at loc facing (Angle from loc to loc1) degrees




Set Unit2 = (Last created unit)




Special Effect - Create a special effect attached to the origin of Unit2 using FB_Fx_Missile




Custom script: set udg_Key = GetHandleId(udg_Unit2)




Hashtable - Save (X of loc1) as 1 of Key in FB_HA




Hashtable - Save (Y of loc1) as 2 of Key in FB_HA




Hashtable - Save Point as 3 of Key in FB_HA


Hashtable - Save Handle Of(Last created special effect) as 4 of Key in FB_HA


Hashtable - Save x as 0 of Key in FB_HA


Unit Group - Add Unit2 to FB_Group


Set Unit = No unit


Set Unit1 = No unit


Set Unit2 = No unit


Custom script: call RemoveLocation(udg_loc)


Custom script: call RemoveLocation(udg_loc1)


Trigger - Turn on FB Loop <gen>
FB Loop

Events


Time - Every 0.03 seconds of game time

Conditions

Actions


Unit Group - Pick every unit in FB_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 FB_HA)




Set loc = (Position of Unit)




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





If - Conditions






(Unit-type of Unit) Equal to FB_Dummies[1]





Then - Actions






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







If - Conditions








(Load 3 of Key from FB_HA) Equal to Unit







Then - Actions








Set Unit1 = (Load 1 of Key in FB_HA)








Set loc1 = (Position of Unit1)








Set loc2 = (loc offset by (FB_MissileSpeed[x] x 0.03) towards (Angle from loc to loc1) degrees)








Unit - Move Unit instantly to loc2, facing loc1








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









If - Conditions










Or - Any (Conditions) are true











Conditions












(Distance between loc1 and loc2) Less than or equal to 65.00












(Unit1 is dead) Equal to True









Then - Actions










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











Loop - Actions












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













If - Conditions














FB_Random_Splitting Equal to True













Then - Actions














Set loc3 = (loc2 offset by (Random real number between 100.00 and FB_AoE[x]) towards (Random angle) degrees)













Else - Actions














Set loc3 = (loc2 offset by ((FB_AoE[x] / (Real(FB_Spread_Arrows[x]))) x (Real(x2))) towards ((450.00 / (Real(FB_Spread_Arrows[x]))) x (Real(x2))) degrees)












Unit - Create 1 FB_Dummies[2] for (Owner of Unit) at loc2 facing (Angle from loc to loc3) degrees












Set Unit2 = (Last created unit)












Custom script: set udg_Key1 = GetHandleId(udg_Unit2)












Special Effect - Create a special effect attached to the origin of Unit2 using FB_Fx_Missile












Hashtable - Save Handle Of(Last created special effect) as 4 of Key1 in FB_HA












Set y = (Current flying height of Unit)












Animation - Change Unit2 flying height to y at 0.00












Animation - Change Unit2 flying height to 0.00 at (y / ((Distance between loc2 and loc3) / (0.80 x FB_SpreadMissileSpeed[x])))












Unit Group - Add Unit2 to FB_Group












Hashtable - Save x as 0 of Key1 in FB_HA












Hashtable - Save (Distance between loc2 and loc3) as 1 of Key1 in FB_HA












Hashtable - Save (Angle from loc2 to loc3) as 2 of Key1 in FB_HA












Custom script: call RemoveLocation(udg_loc3)












Set Unit2 = No unit










Special Effect - Create a special effect at loc1 using FB_Fx_Blow










Special Effect - Destroy (Last created special effect)










Special Effect - Destroy (Load 4 of Key in FB_HA)










Unit - Cause Unit to damage Unit1, dealing FB_Dmg[x] damage of attack type Spells and damage type Magic










Unit - Kill Unit










Unit Group - Remove Unit from FB_Group










Hashtable - Clear all child hashtables of child Key in FB_HA










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











If - Conditions












(FB_Group is empty) Equal to True











Then - Actions












Trigger - Turn off (This trigger)











Else - Actions









Else - Actions








Set Unit1 = No unit








Custom script: call RemoveLocation(udg_loc1)








Custom script: call RemoveLocation(udg_loc2)







Else - Actions








Set loc1 = (Point((Load 1 of Key from FB_HA), (Load 2 of Key from FB_HA)))








Set loc2 = (loc offset by (FB_MissileSpeed[x] x 0.03) towards (Angle from loc to loc1) degrees)








Unit - Move Unit instantly to loc2, facing loc1








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









If - Conditions










(Distance between loc1 and loc2) Less than or equal to 65.00









Then - Actions










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











Loop - Actions












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













If - Conditions














FB_Random_Splitting Equal to True













Then - Actions














Set loc3 = (loc2 offset by (Random real number between 100.00 and FB_AoE[x]) towards (Random angle) degrees)













Else - Actions














Set loc3 = (loc2 offset by ((FB_AoE[x] / (Real(FB_Spread_Arrows[x]))) x (Real(x2))) towards ((450.00 / (Real(FB_Spread_Arrows[x]))) x (Real(x2))) degrees)












Unit - Create 1 FB_Dummies[2] for (Owner of Unit) at loc2 facing (Angle from loc to loc3) degrees












Set Unit2 = (Last created unit)












Custom script: set udg_Key1 = GetHandleId(udg_Unit2)












Special Effect - Create a special effect attached to the origin of Unit2 using FB_Fx_Missile












Hashtable - Save Handle Of(Last created special effect) as 4 of Key1 in FB_HA












Set y = (Current flying height of Unit)












Animation - Change Unit2 flying height to y at 0.00












Animation - Change Unit2 flying height to 0.00 at (y / ((Distance between loc2 and loc3) / (0.80 x FB_SpreadMissileSpeed[x])))












Unit Group - Add Unit2 to FB_Group












Hashtable - Save x as 0 of Key1 in FB_HA












Hashtable - Save (Distance between loc2 and loc3) as 1 of Key1 in FB_HA












Hashtable - Save (Angle from loc2 to loc3) as 2 of Key1 in FB_HA












Custom script: call RemoveLocation(udg_loc3)












Set Unit2 = No unit










Set UGroup = (Units within 100.00 of loc1 matching (((((Matching unit) is A structure) Equal to False) and (((Matching unit) is dead) Equal to False)) and ((((Matching unit) is Magic Immune) Equal to False) and (((Matching unit) belongs to an ally of (Owner of Unit)) Equa










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










Custom script: call DestroyGroup(udg_UGroup)










Special Effect - Destroy (Load 4 of Key in FB_HA)










Special Effect - Create a special effect at loc1 using FB_Fx_Blow










Special Effect - Destroy (Last created special effect)










Unit - Kill Unit










Unit Group - Remove Unit from FB_Group










Hashtable - Clear all child hashtables of child Key in FB_HA










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











If - Conditions












(FB_Group is empty) Equal to True











Then - Actions












Trigger - Turn off (This trigger)











Else - Actions









Else - Actions








Custom script: call RemoveLocation(udg_loc1)








Custom script: call RemoveLocation(udg_loc2)





Else - Actions






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







If - Conditions








(Unit-type of Unit) Equal to FB_Dummies[2]







Then - Actions








Set y = (Load 1 of Key from FB_HA)








Set y = (y - (FB_SpreadMissileSpeed[x] x 0.03))








Hashtable - Save y as 1 of Key in FB_HA








Set loc1 = (loc offset by 15.00 towards (Load 2 of Key from FB_HA) degrees)








Set loc2 = (loc offset by (FB_SpreadMissileSpeed[x] x 0.03) towards (Angle from loc to loc1) degrees)








Unit - Move Unit instantly to loc2








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









If - Conditions










y Less than or equal to 0.00









Then - Actions










Special Effect - Destroy (Load 4 of Key in FB_HA)










Unit - Create 1 FB_Dummies[3] for (Owner of Unit) at loc2 facing Default building facing degrees










Set Unit2 = (Last created unit)










Unit - Add FB_Dummy_Ability to Unit2










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










Set UGroup = (Units within FB_SpreadAoE[x] of loc2 matching (((Matching unit) is dead) Equal to False))










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











Loop - Actions












Set Unit1 = (Picked unit)












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













If - Conditions














(Unit1 is A structure) Equal to False














(Unit1 belongs to an ally of (Owner of Unit)) Equal to False














(Unit1 is Magic Immune) Equal to False













Then - Actions














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














Special Effect - Destroy (Last created special effect)














Unit - Order Unit2 to Undead Necromancer - Cripple Unit1














Unit - Cause Unit to damage Unit1, dealing FB_SpreadDmg[x] damage of attack type Spells and damage type Magic













Else - Actions












Set Unit1 = No unit










Custom script: call DestroyGroup(udg_UGroup)










Unit - Kill Unit










Unit Group - Remove Unit from FB_Group










Hashtable - Clear all child hashtables of child Key in FB_HA










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











If - Conditions












(FB_Group is empty) Equal to True











Then - Actions












Trigger - Turn off (This trigger)











Else - Actions









Else - Actions








Custom script: call RemoveLocation(udg_loc1)








Custom script: call RemoveLocation(udg_loc2)







Else - Actions




Set Unit = No unit




Custom script: call RemoveLocation(udg_loc)
V. 1.0Uploaded at Hive
V. 1.1*Fixed the Ability Condition which didn't use the variable ability
*Changed the Key set to GetHandleId()
*Added the Possibility of choosing whether the Spell is Point Target or Unit Target
V. 1.2*Now the target type is taken automatically instead of needing to be set manually
*Now Point - Target spell will damage units in 100 AoE with the primary damage
*Minor Lines change
V. 1.3
*Now you can choose whether the arrows will split randomly or not
*Now if an arrow's unit target is dead before the arrow hits him, instead of just killing the arrow, the arrow will split in it's place
*Made the Picking Units more "readable"
*Some Trigger Fixes
V. 1.4Triggers' Optimization
V. 1.5*Trigger Improvements
*Now the missile Fx can be directly changed for all missiles from the initial trigger
*Added a How to Import in a Trigger Comment
Note that the Spell Requires to have the dummy.mdx file