Moderator
M
Moderator
12:34, 10th Jan 2013
Magtheridon96: Approved.
The 4/5 is for the Exceptional configuration.
Magtheridon96: Approved.
The 4/5 is for the Exceptional configuration.
| Summons a fireball that will move to targeted point, the fireball will split into several fireballs if hitting a unit or reach the distance. When splitting the fireball will causing damage to nearby enemy ground units in 200 AoE. LEVELS Level 1: 80 fireball damage, 3 fireballs, 50 splitted fireballs damage. Level 2: 90 fireball damage, 4 fireballs, 60 splitted fireballs damage. Level 3: 100 fireball damage, 5 fireballs, 70 splitted fireballs damage. |
Set FB_Spawn_Distance = 50.00
Animation - Change FB_TempUnit[2]'s size to (FB_Fireball_Scale[FB_Level]%, 0.00%, 0.00%) of its original size
Animation - Change FB_TempUnit[2]'s size to (FB_Fireballs_Scale[FB_Level]%, 0.00%, 0.00%) of its original size
Events

Map initialization
Conditions
Actions

-------- Determines the ability used as the Fire Blast ability --------

Set FB_Ability = Fire Blast

-------- Determines the ability used by dummy to create explosion effect --------

Set FB_DAbility = Flames Explosion

-------- Determines the dummy used as the model of fireballs --------

Set FB_Dummy_Type = Dummy

-------- Determines the range of damage when fireball explode --------

Set FB_Fireball_AoE[1] = 200.00

Set FB_Fireball_AoE[2] = 200.00

Set FB_Fireball_AoE[3] = 200.00

-------- Determines the collision of fireball --------

Set FB_Fireball_Collision[1] = 75.00

Set FB_Fireball_Collision[2] = 75.00

Set FB_Fireball_Collision[3] = 75.00

-------- Determines the damage caused by fireball --------

Set FB_Fireball_Damage[1] = 80.00

Set FB_Fireball_Damage[2] = 90.00

Set FB_Fireball_Damage[3] = 100.00

-------- Determines the speed of fireball --------

Set FB_Fireball_Speed[1] = 30.00

Set FB_Fireball_Speed[2] = 30.00

Set FB_Fireball_Speed[3] = 30.00

-------- Determines the scale size of fireball (%) --------

Set FB_Fireball_Scale[1] = 120.00

Set FB_Fireball_Scale[2] = 120.00

Set FB_Fireball_Scale[3] = 120.00

-------- Determines the fly height of fireball --------

Set FB_Fireball_Height[1] = 50.00

Set FB_Fireball_Height[2] = 50.00

Set FB_Fireball_Height[3] = 50.00

-------- Determines the type of explosion effect when fireball explode --------

Set FB_Fireball_Explosion_Type[1] = 2

Set FB_Fireball_Explosion_Type[2] = 2

Set FB_Fireball_Explosion_Type[3] = 2

-------- "True" the fireball will be able to hit nearby units --------

-------- "False" the fireball will be unable to hit nearby units --------

Set FB_Fireball_Hit = True

-------- Determines the damage range when splitted fireballs explode --------

Set FB_Fireballs_AoE[1] = 200.00

Set FB_Fireballs_AoE[2] = 200.00

Set FB_Fireballs_AoE[3] = 200.00

-------- Determines the collision of splitted fireballs --------

Set FB_Fireballs_Collision[1] = 50.00

Set FB_Fireballs_Collision[2] = 50.00

Set FB_Fireballs_Collision[3] = 50.00

-------- Determines the damage caused by splitted fireballs --------

Set FB_Fireballs_Damage[1] = 50.00

Set FB_Fireballs_Damage[2] = 60.00

Set FB_Fireballs_Damage[3] = 70.00

-------- Determines the distance for splitted fireballs --------

Set FB_Fireballs_Distance[1] = 500.00

Set FB_Fireballs_Distance[2] = 500.00

Set FB_Fireballs_Distance[3] = 500.00

-------- Determines the speed of splitted fireballs --------

Set FB_Fireballs_Speed[1] = 20.00

Set FB_Fireballs_Speed[2] = 20.00

Set FB_Fireballs_Speed[3] = 20.00

-------- Determines the scale size of splitted fireballs (%) --------

Set FB_Fireballs_Scale[1] = 100.00

Set FB_Fireballs_Scale[2] = 100.00

Set FB_Fireballs_Scale[3] = 100.00

-------- Determines the fly height of splitted fireballs --------

Set FB_Fireballs_Height[1] = 50.00

Set FB_Fireballs_Height[2] = 50.00

Set FB_Fireballs_Height[3] = 50.00

-------- Determines the type of explosion effect when splitted fireballs explode --------

Set FB_Fireballs_Explosion_Type[1] = 1

Set FB_Fireballs_Explosion_Type[2] = 1

Set FB_Fireballs_Explosion_Type[3] = 1

-------- Determines the number of splitted fireballs --------

Set FB_Fireballs_Number[1] = 3

Set FB_Fireballs_Number[2] = 4

Set FB_Fireballs_Number[3] = 5

-------- "True" the splitted fireballs will be able to hit nearby units --------

-------- "False" the splitted fireballs will be unable to hit nearby units --------

Set FB_Fireballs_Hit = True

-------- Determines the distance between the position of caster and fireballs spawn point --------

Set FB_Spawn_Distance = 50.00

-------- Determines the model of fireball --------

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

-------- Determines the other explosion effect when fireball explode --------

Set FB_Fireball_Effect = Abilities\Spells\Other\Doom\DoomDeath.mdl

-------- Determines the model of splitted fireballs --------

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

-------- Determines the other explosion effect when splitted fireballs explode --------

Set FB_Fireballs_Effect = Abilities\Spells\Other\Doom\DoomDeath.mdl

-------- "True" the fireballs will be able hit ally units --------

-------- "False" the fireballs will only hit enemy units --------

Set FB_Condition[1] = False

-------- "True" the fireballs will be able to hit flying units --------

-------- "False" the fireballs will only hit ground units --------

Set FB_Condition[2] = False

-------- "True" the fireballs will be able to hit magic immune units --------

-------- "False" the fireballs will be unable to hit magic immune units --------

Set FB_Condition[3] = False

-------- "True" the fireballs will killing nearby trees --------

-------- "False" the fireballs will not killing trees --------

Set FB_Kill_Trees = True

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

Set FB_Attack_Type = Chaos

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

Set FB_Damage_Type = Fire

-------- Determines the loop timer --------

Set FB_Interval = 0.03

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

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

-------- =========================================================================== --------

Custom script: set udg_FB_Hashtable = InitHashtable()

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

-------- Add the loop timer to loop trigger --------

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

Trigger - Add to FB Loop <gen> the event (Time - Every FB_Interval seconds of game time)

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

-------- Create Harvester to check a destructable if it is a tree --------

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

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

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

Custom script: call ShowUnit(udg_FB_Harvester, false)

Custom script: set udg_FB_Harvest_Order = "harvest"
Events

Unit - A unit Starts the effect of an ability
Conditions

(Ability being cast) Equal to FB_Ability
Actions

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

-------- Settings --------

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

Set FB_TempUnit[1] = (Triggering unit)

Set FB_Owner = (Triggering player)

Set FB_Level = (Level of FB_Ability for FB_TempUnit[1])

Set TempLoc = (Position of FB_TempUnit[1])

Set TempLoc2 = (Target point of ability being cast)

Set FB_Real[1] = (Distance between TempLoc and TempLoc2)

Set FB_Real[2] = (Angle from TempLoc to TempLoc2)

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

-------- Remove location leak --------

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

Custom script: call RemoveLocation(udg_TempLoc2)

Set TempLoc2 = (TempLoc offset by FB_Spawn_Distance towards FB_Real[2] degrees)

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

-------- Create the dummy --------

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

Custom script: set udg_FB_TempUnit[2] = CreateUnit(udg_FB_Owner, udg_FB_Dummy_Type, GetLocationX(udg_TempLoc2), GetLocationY(udg_TempLoc2), udg_FB_Real[2])

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

-------- Add the fireball model to dummy --------

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

Custom script: set udg_FB_SFX = AddSpecialEffectTarget(udg_FB_Fireball_Model, udg_FB_TempUnit[2], "origin")

Animation - Change FB_TempUnit[2]'s size to (FB_Fireball_Scale[FB_Level]%, 0.00%, 0.00%) of its original size

Animation - Change FB_TempUnit[2] flying height to FB_Fireball_Height[FB_Level] at 0.00

Custom script: set udg_FB_Real[2] = udg_FB_Real[2] * bj_DEGTORAD

Custom script: set udg_FB_Real[3] = Cos(udg_FB_Real[2])

Custom script: set udg_FB_Real[4] = Sin(udg_FB_Real[2])

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

-------- Get the handle id of dummy --------

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

Custom script: set udg_FB_Handle_Id = GetHandleId(udg_FB_TempUnit[2])

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

-------- Saving --------

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

Hashtable - Save Handle OfFB_Owner as (Key owner) of FB_Handle_Id in FB_Hashtable

Hashtable - Save FB_Level as (Key level) of FB_Handle_Id in FB_Hashtable

Hashtable - Save FB_Real[1] as (Key distance) of FB_Handle_Id in FB_Hashtable

Hashtable - Save FB_Real[3] as (Key cos) of FB_Handle_Id in FB_Hashtable

Hashtable - Save FB_Real[4] as (Key sin) of FB_Handle_Id in FB_Hashtable

Hashtable - Save FB_Fireball_AoE[FB_Level] as (Key aoe) of FB_Handle_Id in FB_Hashtable

Hashtable - Save FB_Fireball_Collision[FB_Level] as (Key collision) of FB_Handle_Id in FB_Hashtable

Hashtable - Save FB_Fireball_Damage[FB_Level] as (Key damage) of FB_Handle_Id in FB_Hashtable

Hashtable - Save FB_Fireball_Speed[FB_Level] as (Key speed) of FB_Handle_Id in FB_Hashtable

Hashtable - Save FB_Fireball_Hit as (Key hit) of FB_Handle_Id in FB_Hashtable

Hashtable - Save FB_Fireball_Explosion_Type[FB_Level] as (Key explosion) of FB_Handle_Id in FB_Hashtable

Hashtable - Save FB_Fireballs_Number[FB_Level] as (Key number) of FB_Handle_Id in FB_Hashtable

Hashtable - Save True as (Key split) of FB_Handle_Id in FB_Hashtable

Hashtable - Save Handle OfFB_SFX as (Key sfx) of FB_Handle_Id in FB_Hashtable

Hashtable - Save FB_Fireball_Effect as (Key effect) of FB_Handle_Id in FB_Hashtable

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

-------- Add the dummy to the main group, to allow them for moving --------

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

Unit Group - Add FB_TempUnit[2] to FB_Group

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

-------- Remove locations leaks --------

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

Custom script: call RemoveLocation(udg_TempLoc)

Custom script: call RemoveLocation(udg_TempLoc2)

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

-------- Turn on the loop trigger if it's currently off --------

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

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


If - Conditions



(FB Loop <gen> is on) Equal to False


Then - Actions



Trigger - Turn on FB Loop <gen>


Else - Actions
Events
Conditions
Actions

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


Loop - Actions



Set FB_TempUnit[1] = (Picked unit)



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



-------- Get the handle id --------



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



Custom script: set udg_FB_Handle_Id = GetHandleId(udg_FB_TempUnit[1])



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



-------- Load some saved values --------



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



Set FB_Level = (Load (Key level) of FB_Handle_Id from FB_Hashtable)



Set FB_Owner = (Load (Key owner) of FB_Handle_Id in FB_Hashtable)



Set FB_Real[1] = (Load (Key distance) of FB_Handle_Id from FB_Hashtable)



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




If - Conditions





FB_Real[1] Greater than 0.00




Then - Actions





Set FB_Real[2] = (Load (Key speed) of FB_Handle_Id from FB_Hashtable)





Set FB_Real[3] = (Load (Key cos) of FB_Handle_Id from FB_Hashtable)





Set FB_Real[4] = (Load (Key sin) of FB_Handle_Id from FB_Hashtable)





Custom script: set udg_FB_Real[5] = GetUnitX(udg_FB_TempUnit[1]) + udg_FB_Real[2] * udg_FB_Real[3]





Custom script: set udg_FB_Real[6] = GetUnitY(udg_FB_TempUnit[1]) + udg_FB_Real[2] * udg_FB_Real[4]





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





-------- Move the dummy --------





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





Custom script: call SetUnitX(udg_FB_TempUnit[1], udg_FB_Real[5])





Custom script: call SetUnitY(udg_FB_TempUnit[1], udg_FB_Real[6])





Hashtable - Save (FB_Real[1] - FB_Real[2]) as (Key distance) of FB_Handle_Id in FB_Hashtable





Set FB_Real[7] = (Load (Key collision) of FB_Handle_Id from FB_Hashtable)





Set FB_Condition[0] = (Load (Key hit) of FB_Handle_Id from FB_Hashtable)





Set TempLoc = (Point(FB_Real[5], FB_Real[6]))





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





-------- Checking nearby units --------





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





Custom script: set bj_wantDestroyGroup = true





Unit Group - Pick every unit in (Units within FB_Real[7] of TempLoc) and do (Actions)






Loop - Actions







Set FB_TempUnit[2] = (Picked unit)







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








If - Conditions









FB_Condition[0] Equal to True









(FB_TempUnit[1] is alive) Equal to True









(FB_TempUnit[2] is dead) Equal to False









(FB_TempUnit[2] belongs to an ally of FB_Owner) Equal to FB_Condition[1]









(FB_TempUnit[2] is A flying unit) Equal to FB_Condition[2]









(FB_TempUnit[2] is Magic Immune) Equal to FB_Condition[3]








Then - Actions









Hashtable - Save 0.00 as (Key distance) of FB_Handle_Id in FB_Hashtable








Else - Actions





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





-------- Kill nearby trees, but if the FB_Kill_Trees is "True" --------





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





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






If - Conditions







FB_Kill_Trees Equal to True






Then - Actions







Destructible - Pick every destructible within FB_Real[7] of TempLoc and do (Actions)








Loop - Actions









Set FB_Tree = (Picked destructible)









Custom script: call IssueTargetOrder(udg_FB_Harvester, udg_FB_Harvest_Order, udg_FB_Tree)









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










If - Conditions











(Current order of FB_Harvester) Equal to (Order(FB_Harvest_Order))











(FB_Tree is alive) Equal to True










Then - Actions











Destructible - Kill FB_Tree










Else - Actions









Unit - Order FB_Harvester to Stop






Else - Actions





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





-------- Remove location leak --------





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





Custom script: call RemoveLocation(udg_TempLoc)




Else - Actions





Set TempLoc = (Position of FB_TempUnit[1])





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





-------- Add the ability used to create explosion effect --------





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





Unit - Add FB_DAbility to FB_TempUnit[1]





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





-------- Set the type of explosion --------





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





Unit - Set level of FB_DAbility for FB_TempUnit[1] to (Load (Key explosion) of FB_Handle_Id from FB_Hashtable)





Unit - Order FB_TempUnit[1] to Human Mountain King - Thunder Clap





Set FB_Fireball_Effect = (Load (Key effect) of FB_Handle_Id from FB_Hashtable)





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





-------- Create the other explosion effect --------





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





Custom script: call DestroyEffect(AddSpecialEffectLoc(udg_FB_Fireball_Effect, udg_TempLoc))





Set FB_Real[2] = (Load (Key aoe) of FB_Handle_Id from FB_Hashtable)





Set FB_Real[3] = (Load (Key damage) of FB_Handle_Id from FB_Hashtable)





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





-------- Causing damage to nearby units in AoE --------





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





Custom script: set bj_wantDestroyGroup = true





Unit Group - Pick every unit in (Units within FB_Real[2] of TempLoc) and do (Actions)






Loop - Actions







Set FB_TempUnit[2] = (Picked unit)







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








If - Conditions









(FB_TempUnit[2] is dead) Equal to False









(FB_TempUnit[2] belongs to an ally of FB_Owner) Equal to FB_Condition[1]









(FB_TempUnit[2] is A flying unit) Equal to FB_Condition[2]









(FB_TempUnit[2] is Magic Immune) Equal to FB_Condition[3]








Then - Actions









Unit - Cause FB_TempUnit[1] to damage FB_TempUnit[2], dealing FB_Real[3] damage of attack type FB_Attack_Type and damage type FB_Damage_Type








Else - Actions





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





-------- Kill nearby trees, but if the FB_Kill_Trees is "True" --------





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





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






If - Conditions







FB_Kill_Trees Equal to True






Then - Actions







Destructible - Pick every destructible within FB_Real[2] of TempLoc and do (Actions)








Loop - Actions









Set FB_Tree = (Picked destructible)









Custom script: call IssueTargetOrder(udg_FB_Harvester, udg_FB_Harvest_Order, udg_FB_Tree)









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










If - Conditions











(Current order of FB_Harvester) Equal to (Order(FB_Harvest_Order))











(FB_Tree is alive) Equal to True










Then - Actions











Destructible - Kill FB_Tree










Else - Actions









Unit - Order FB_Harvester to Stop






Else - Actions





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





-------- This is for creating the split fireballs --------





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





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






If - Conditions







(Load (Key split) of FB_Handle_Id from FB_Hashtable) Equal to True






Then - Actions







Set FB_Fireballs_Number[0] = (Load (Key number) of FB_Handle_Id from FB_Hashtable)







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







-------- Create the split fireballs --------







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







Set FB_Real[4] = (Random angle)







For each (Integer FB_Loop) from 1 to FB_Fireballs_Number[0], do (Actions)








Loop - Actions









Set FB_Real[4] = (FB_Real[4] + (360.00 / (Real(FB_Fireballs_Number[0]))))









Set TempLoc2 = (TempLoc offset by FB_Real[2] towards FB_Real[4] degrees)









Custom script: set udg_FB_TempUnit[2] = CreateUnit(udg_FB_Owner, udg_FB_Dummy_Type, GetLocationX(udg_TempLoc2), GetLocationY(udg_TempLoc2), udg_FB_Real[4])









Custom script: set udg_FB_SFX = AddSpecialEffectTarget(udg_FB_Fireballs_Model, udg_FB_TempUnit[2], "origin")









Animation - Change FB_TempUnit[2]'s size to (FB_Fireballs_Scale[FB_Level]%, 0.00%, 0.00%) of its original size









Animation - Change FB_TempUnit[2] flying height to FB_Fireballs_Height[FB_Level] at 0.00









Custom script: set udg_FB_Real[5] = udg_FB_Real[4] * bj_DEGTORAD









Custom script: set udg_FB_Real[6] = Cos(udg_FB_Real[5])









Custom script: set udg_FB_Real[7] = Sin(udg_FB_Real[5])









Custom script: set udg_FB_Handle_Id = GetHandleId(udg_FB_TempUnit[2])









Hashtable - Save Handle OfFB_Owner as (Key owner) of FB_Handle_Id in FB_Hashtable









Hashtable - Save FB_Level as (Key level) of FB_Handle_Id in FB_Hashtable









Hashtable - Save FB_Fireballs_Distance[FB_Level] as (Key distance) of FB_Handle_Id in FB_Hashtable









Hashtable - Save FB_Real[6] as (Key cos) of FB_Handle_Id in FB_Hashtable









Hashtable - Save FB_Real[7] as (Key sin) of FB_Handle_Id in FB_Hashtable









Hashtable - Save FB_Fireballs_AoE[FB_Level] as (Key aoe) of FB_Handle_Id in FB_Hashtable









Hashtable - Save FB_Fireballs_Collision[FB_Level] as (Key collision) of FB_Handle_Id in FB_Hashtable









Hashtable - Save FB_Fireballs_Damage[FB_Level] as (Key damage) of FB_Handle_Id in FB_Hashtable









Hashtable - Save FB_Fireballs_Speed[FB_Level] as (Key speed) of FB_Handle_Id in FB_Hashtable









Hashtable - Save FB_Fireballs_Hit as (Key hit) of FB_Handle_Id in FB_Hashtable









Hashtable - Save FB_Fireballs_Explosion_Type[FB_Level] as (Key explosion) of FB_Handle_Id in FB_Hashtable









Hashtable - Save False as (Key split) of FB_Handle_Id in FB_Hashtable









Hashtable - Save Handle OfFB_SFX as (Key sfx) of FB_Handle_Id in FB_Hashtable









Hashtable - Save FB_Fireballs_Effect as (Key effect) of FB_Handle_Id in FB_Hashtable









Custom script: call RemoveLocation(udg_TempLoc2)









Unit Group - Add FB_TempUnit[2] to FB_Group







Custom script: set udg_FB_Handle_Id = GetHandleId(udg_FB_TempUnit[1])






Else - Actions





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





-------- Remove location leak --------





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





Custom script: call RemoveLocation(udg_TempLoc)





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





-------- Destroy special effect leak --------





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





Special Effect - Destroy (Load (Key sfx) of FB_Handle_Id in FB_Hashtable)





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





-------- The End --------





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





Hashtable - Clear all child hashtables of child FB_Handle_Id in FB_Hashtable





Unit Group - Remove FB_TempUnit[1] from FB_Group





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 FB Loop <gen>






Else - Actions