# Flamethrower 0.2

The Fire Lord starts to unleash flames toward him, dealing damage to units on them. Also unleash bigs waves of flames that knockback and damage every units toward him and deals damage every second for 2 seconds.
|nLasts 5 seconds.

Level 1 - 10 damage each little flames, 20 damage each waves of flame, 3 damage per second.
Level 2 - 15 damage each little flames, 40 damage each waves of flame, 5 damage per second.
Level 3 - 20 damage each little flames, 60 damage each waves of flame, 7 damage per second.

===============================================================

• Flamethrower
• Events
• Unit - A unit Starts the effect of an ability
• Conditions
• (Ability being cast) Equal to Flamethrower
• Actions
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• FT_Index[0] Equal to 0
• Then - Actions
• Trigger - Turn on Flamethrower Loop <gen>
• Else - Actions
• -------- ----------------------------------------------------------------------------------------------------------------------------------------------- --------
• -------- Don't change anything except if u know exactly what you are doing --------
• -------- ----------------------------------------------------------------------------------------------------------------------------------------------- --------
• Set FT_Index[0] = (FT_Index[0] + 1)
• Set FT_Index[1] = (FT_Index[1] + 1)
• Set FT_Caster[FT_Index[0]] = (Triggering unit)
• Set FT_Angle = (Facing of FT_Caster[FT_Index[0]])
• Set FT_Level[FT_Index[0]] = (Level of (Ability being cast) for FT_Caster[FT_Index[0]])
• Set FT_Time[FT_Index[0]] = 5.52
• Set FT_Time_Intervale[FT_Index[0]] = 0.00
• Set FT_Run_Trigger[FT_Index[0]] = True
• -------- ----------------------------------------------------------------------------------------------------------------------------------------------- --------
• -------- Here you can change the knockback speed --------
• -------- ----------------------------------------------------------------------------------------------------------------------------------------------- --------
• Set FT_Knockback_Speed[FT_Index[0]] = 60.00
• -------- ----------------------------------------------------------------------------------------------------------------------------------------------- --------
• -------- Here you can change the damage done by the little flames --------
• -------- ----------------------------------------------------------------------------------------------------------------------------------------------- --------
• Set FT_Flame_Damage[FT_Index[0]] = (5.00 + ((Real(FT_Level[FT_Index[0]])) x 5.00))
• -------- ----------------------------------------------------------------------------------------------------------------------------------------------- --------
• -------- Damage of the Fire Wave and the Damage over time is changeable in the Object Editor. (Flamethrower_Dummy) --------
• -------- ----------------------------------------------------------------------------------------------------------------------------------------------- --------
[HIDDEN=''Flamethrower Loop]
• Flamethrower Loop
• Events
• Time - Every 0.04 seconds of game time
• Conditions
• Actions
• For each (Integer FT_Index[2]) from 1 to FT_Index[0], do (Actions)
• Loop - Actions
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• FT_Run_Trigger[FT_Index[2]] Equal to True
• Then - Actions
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• FT_Time[FT_Index[2]] Less than or equal to 0.00
• Then - Actions
• Set FT_Index[1] = (FT_Index[1] - 1)
• Set FT_Run_Trigger[FT_Index[2]] = False
• Custom script: call RemoveLocation(udg_FT_Caster_Position_KB[udg_FT_Index[2]])
• Custom script: call DestroyGroup(udg_FT_Group[udg_FT_Index[2]])
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• FT_Index[1] Equal to 0
• Then - Actions
• Set FT_Index[0] = 0
• -------- Turning the trigger off --------
• Trigger - Turn off Flamethrower Loop <gen>
• Else - Actions
• Else - Actions
• Set FT_Angle = (Facing of FT_Caster[FT_Index[2]])
• Set FT_Caster_Position = (Position of FT_Caster[FT_Index[2]])
• Set FT_Flame_Point = (FT_Caster_Position offset by (Random real number between 100.00 and 350.00) towards (Random real number between (FT_Angle - 30.00) and (FT_Angle + 30.00)) degrees)
• Set FT_Flame_Group = (Units within 50.00 of FT_Flame_Point matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and (((Owner of FT_Caster[FT_Index[2]]) is an enemy of (O
• -------- Damaging the group affected by the little flames. --------
• Unit Group - Pick every unit in FT_Flame_Group and do (Actions)
• Loop - Actions
• Unit - Cause FT_Caster[FT_Index[2]] to damage (Picked unit), dealing FT_Flame_Damage[FT_Index[2]] damage of attack type Spells and damage type Normal
• Custom script: call DestroyGroup(udg_FT_Flame_Group)
• Special Effect - Create a special effect at FT_Flame_Point using Abilities\Weapons\FireBallMissile\FireBallMissile.mdl
• Special Effect - Destroy (Last created special effect)
• Custom script: call RemoveLocation(udg_FT_Flame_Point)
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• FT_Time_Intervale[FT_Index[2]] Less than or equal to 0.00
• Then - Actions
• -------- Sending the Big Flame Wave --------
• Custom script: call RemoveLocation(udg_FT_Caster_Position_KB[udg_FT_Index[2]])
• Custom script: call DestroyGroup(udg_FT_Group[udg_FT_Index[2]])
• Set FT_Group_Point = (FT_Caster_Position offset by 350.00 towards FT_Angle degrees)
• Set FT_Group[FT_Index[2]] = (Units within 200.00 of FT_Group_Point matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and (((Owner of FT_Caster[FT_Index[2]]) is an enemy of (
• Custom script: call RemoveLocation(udg_FT_Group_Point)
• Set FT_Order_Point = (FT_Caster_Position offset by 50.00 towards FT_Angle degrees)
• Unit - Create 1 Dummy for (Owner of FT_Caster[FT_Index[2]]) at FT_Caster_Position facing Default building facing degrees
• Unit - Add Flamethrower_dummy to (Last created unit)
• Unit - Set level of Flamethrower_dummy for (Last created unit) to FT_Level[FT_Index[2]]
• Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Breath Of Fire FT_Order_Point
• Unit - Add a 1.10 second Generic expiration timer to (Last created unit)
• Custom script: call RemoveLocation(udg_FT_Order_Point)
• Set FT_Caster_Position_KB[FT_Index[2]] = (Position of FT_Caster[FT_Index[2]])
• Set FT_Knockback_Speed[FT_Index[0]] = 60.00
• Set FT_Time_Intervale[FT_Index[2]] = 0.52
• Else - Actions
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• And - All (Conditions) are true
• Conditions
• FT_Time_Intervale[FT_Index[2]] Less than or equal to 0.44
• FT_Time_Intervale[FT_Index[2]] Greater than or equal to 0.20
• Then - Actions
• -------- Knockbacking units. --------
• Set FT_Knockback_Speed[FT_Index[2]] = (Power(FT_Knockback_Speed[FT_Index[2]], 0.90))
• Unit Group - Pick every unit in FT_Group[FT_Index[2]] and do (Actions)
• Loop - Actions
• Set FT_Picked_Unit = (Picked unit)
• Set FT_Custom_Value = (Custom value of FT_Picked_Unit)
• Set FT_KB_Point[FT_Custom_Value] = (Position of FT_Picked_Unit)
• Set FT_Angle_KB[FT_Custom_Value] = (Angle from FT_Caster_Position to FT_KB_Point[FT_Custom_Value])
• Set FT_X = ((X of FT_KB_Point[FT_Custom_Value]) + (FT_Knockback_Speed[FT_Index[2]] x (Cos(FT_Angle_KB[FT_Custom_Value]))))
• Set FT_Y = ((Y of FT_KB_Point[FT_Custom_Value]) + (FT_Knockback_Speed[FT_Index[2]] x (Sin(FT_Angle_KB[FT_Custom_Value]))))
• Set FT_XY_Point[FT_Custom_Value] = (Point(FT_X, FT_Y))
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• (Terrain pathing at FT_XY_Point[FT_Custom_Value] of type Walkability is off) Equal to True
• Then - Actions
• Else - Actions
• Custom script: call SetUnitX(udg_FT_Picked_Unit, udg_FT_X)
• Custom script: call SetUnitY(udg_FT_Picked_Unit, udg_FT_Y)
• Custom script: call RemoveLocation(udg_FT_XY_Point[udg_FT_Custom_Value])
• Custom script: call RemoveLocation(udg_FT_KB_Point[udg_FT_Custom_Value])
• Else - Actions
• -------- ----------------------------------------------------------------------------------------------------------------------------------------------- --------
• Set FT_Time[FT_Index[2]] = (FT_Time[FT_Index[2]] - 0.04)
• Set FT_Time_Intervale[FT_Index[2]] = (FT_Time_Intervale[FT_Index[2]] - 0.04)
• Custom script: call RemoveLocation(udg_FT_Caster_Position)
• Else - Actions
[/HIDDEN]

Keywords:
Flamethrower, Flamme, Flame, Fire, Fire Lord.
Contents

# Flamethrower (Map)

Reviews
17:56, 7th Dec 2009 TriggerHappy: Review for Flamethrower The spell was pretty neat, but a little laggy upon cast. Also, is it only supposed to knockback units that are farther away? Anyways, it's decent enough. Status...

M

#### Moderator

17:56, 7th Dec 2009
TriggerHappy:

 Review for Flamethrower The spell was pretty neat, but a little laggy upon cast. Also, is it only supposed to knockback units that are farther away? Anyways, it's decent enough. Status Approved

#### DevilDuke1995

Level 7
testing

EDIT: weird but i think it functions normally and has no leaks but do u really need these lines
• Custom script: call RemoveLocation(udg_FT_Order_Point)
• Custom script: call RemoveLocation(udg_FT_Casting_Point)
in the first trigger?

#### kola

Level 29
oh oops.. at first, i created a dummy unit in the first trigger... so i needed to remove the points and everything... but i removed it... and forgot to remove these points removal..
k ty

**updating**

Fixed

#### BlackHawk

Level 4
Hehe nice idea ,

haven´t really checked code until now but i saw that you use call SetUnitX and call SetUnitY, of course these are nice functions but you have to keep in mind that they don´t check terrain pathing which mean units can be moved to positions where they can´t move for example on cliffs.

You should add an If/then/else function which checks if the new position is pathable before they get moved.

~BlackHawk

#### kola

Level 29
ah yeah.. forgot to add this.. thx dude.. going to fix it

Fixed.

#### D4RK_G4ND4LF

Level 19
Hehe nice idea ,

haven´t really checked code until now but i saw that you use call SetUnitX and call SetUnitY, of course these are nice functions but you have to keep in mind that they don´t check terrain pathing which mean units can be moved to positions where they can´t move for example on cliffs.

You should add an If/then/else function which checks if the new position is pathable before they get moved.

~BlackHawk

a good way to check the pathing properly is to
-hide all items around the target coords
-move 2 items to the target coord
-check if the first item got moved where you wanted it to
-check if the second item got bashed away from these coords
if that is true the coords are pathable

and you should also check if the coords are within the playable map area
units outside of the map will cause lag and probably disc or smthn

seems to be a good spell
didn't check the code properly though

#### kola

Level 29
hmm.. the Condition i added for the playable map thing no? cuz Boundary isnt walkable.
but k.. i'll do the items thingy

but hmm.. making 2 items for each units wont lag?

#### BlackHawk

Level 4
D4RK_G4ND4LF said:

a good way to check the pathing properly is to
-hide all items around the target coords
-move 2 items to the target coord
-check if the first item got moved where you wanted it to
-check if the second item got bashed away from these coords
if that is true the coords are pathable

Ah yes thats true, but i don´t think that it is that dangerous because doodads like a building or an obelisk counts as not pathable and when a tree stands on the position your unit gets ported beneath it when it moves next time.

But nevertheless you are right it could be tricky in some cases.

#### kola

Level 29
i think it would lag more than it would be usefull.
so i might no make it

#### Deaod

Level 14
Youve reinvented knocking units back for the hundredth time. Use an external library for that.
Also, youre destroying groups and using locations.

#### kola

Level 29
huh.. what is bad in destroying groups and using locations?????

#### Deaod

Level 14
errr, destroying groups leaks (recycling does leak less). And locations have no use other than for GetLocationZ. They just arent needed. Besides, not using locations will boost your efficiency.

#### D4RK_G4ND4LF

Level 19
kola said:
i think it would lag more than it would be usefull.
so i might no make it

I said MOVE
not create
of cause this would lag....

there is a fancy jass function to do it of cause

JASS:
``call SetItemPosition( udg_pathitem, udg_x, udg_y )``

Youve reinvented knocking units back for the hundredth time. Use an external library for that.
Also, youre destroying groups and using locations.

using a knockback system would be the easiest way (however most gui knockback systems around here suck 'cause they don't use SetUnitX/Y or the item path check so you could also make your own if you really want to)

#### Deaod

Level 14
When i was talking about an external knockback system, i wasnt thinking about a GUI one.

Level 7
Looks Nice

#### Jorka2099

Level 3
you can do so that they burned?

#### El'Dragon

Level 5
could u also add a cast animation like breaths out, that adds upon the unit when it casts this spell, that otherwise 9/10, if the animation comes then +1

Replies
13
Views
9K
Replies
3
Views
433
Replies
3
Views
575
Replies
0
Views
494
Replies
4
Views
2K