Conflagration v1.11

This bundle is marked as approved. It works and satisfies the submission rules.
  • Like
Reactions: deepstrasz
A neat little spell I fixed together in about 2 hours. It was a request from a friend to create this spell, and I managed to make it exactly to his specification.

Spell Description:
Sets enemy units in an area on fire, causing them to suffer damage over time and run around in a frenzy. Units that are burning can spread the fire onto other nearby units, causing them to also burn for the remainder of the spell. The burn lasts a total of 10 seconds.
Rank 1: 8 damage per second.
Rank 2: 16 damage per second.
Rank 3: 24 damage per second.

Video:
http://www.wegame.com/watch/spell-conflagrate/
(May not work in Google Chrome Browser)

Notes:
- This spell is fully MUI, allowing any number of units or casters to instance this spell.
- This spell requires no buffs, and hence should not conflict with existing spells.
- Basic documentation provided in the spell triggers.
- Mana cost and cooldown can be set to anything you desire, but for testing are both 0.
- Fully written in GUI with Hashtable useage.
- Leakless.


  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set hashtable = (Last created hashtable)
      • -------- Here we're just creating the Hashtable. --------
      • Set ConflagrateDPHS = 4.00
      • -------- Set this value to what damage you want the spell to do per half second per rank of the spell. --------
      • -------- So for example, 4 DPHS will mean the spell does 8 damage per second at rank 1, 16 at rank 2, and 24 at rank 3. --------
  • Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Conflagration
    • Actions
      • Set point = (Target point of ability being cast)
      • -------- These special effects can be edited to whatever you desire. --------
      • Special Effect - Create a special effect at point using Abilities\Weapons\PhoenixMissile\Phoenix_Missile.mdl
      • Special Effect - Destroy (Last created special effect)
      • For each (Integer integer) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set point2 = (point offset by 150.00 towards (60.00 x (Real((integer)))) degrees)
          • Special Effect - Create a special effect at point2 using Abilities\Weapons\PhoenixMissile\Phoenix_Missile.mdl
          • Special Effect - Destroy (Last created special effect)
          • -------- As can these. --------
          • Custom script: call RemoveLocation(udg_point2)
      • -------- We define bj_wantDestroyGroup = true so that the group creation does not create leaks. --------
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 200.00 of point matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))) and do (Actions)
        • Loop - Actions
          • -------- Setting the movement speed to double causes the frenzied running appearence. --------
          • Unit - Set (Picked unit) movement speed to (2.00 x (Default movement speed of (Picked unit)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in group) Equal to True
            • Then - Actions
            • Else - Actions
              • -------- We only add a fire graphic if the unit isn't already on fire. --------
              • Unit Group - Add (Picked unit) to group
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Doodads\Cinematic\TownBurningFireEmitter\TownBurningFireEmitter.mdl
              • Hashtable - Save Handle Of(Last created special effect) as 3 of (Key (Picked unit)) in hashtable
          • -------- First we save the timer (10 seconds). --------
          • Hashtable - Save 10.00 as 0 of (Key (Picked unit)) in hashtable
          • -------- Then we save the damage source. --------
          • Hashtable - Save Handle Of(Triggering unit) as 1 of (Key (Picked unit)) in hashtable
          • -------- Then we save the damage per half second. --------
          • Hashtable - Save (ConflagrateDPHS x (Real((Level of Conflagration for (Triggering unit))))) as 2 of (Key (Picked unit)) in hashtable
          • -------- You can edit this in the intialisation trigger. --------
      • Custom script: call RemoveLocation(udg_point)
      • -------- Bye bye leaks! --------
  • Loop
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
      • (Number of units in group) Not equal to 0
    • Actions
      • -------- To reduce processing stress, this loop will not run when the group is empty. --------
      • Unit Group - Pick every unit in group and do (Actions)
        • Loop - Actions
          • Set handle = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • ((Picked unit) is dead) Equal to True
                  • (Load 0 of (Key (Picked unit)) from hashtable) Equal to 0.00
            • Then - Actions
              • -------- This clears up dead units as well as those that have had their burn timers run out. --------
              • Unit - Set (Picked unit) movement speed to (Default movement speed of (Picked unit))
              • Special Effect - Destroy (Load 3 of (Key (Picked unit)) in hashtable)
              • Unit Group - Remove (Picked unit) from group
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in hashtable
              • -------- We remove the unit from the group, destroy its fire effect and then clean up its hashtable entries. --------
            • Else - Actions
              • Hashtable - Save ((Load 0 of (Key (Picked unit)) from hashtable) - 0.50) as 0 of (Key (Picked unit)) in hashtable
              • Unit - Cause (Load 1 of (Key (Picked unit)) in hashtable) to damage (Picked unit), dealing (Load 2 of (Key (Picked unit)) from hashtable) damage of attack type Spells and damage type Fire
              • -------- Reduces the timer and deals damage. --------
              • Set point = (Position of (Picked unit))
              • Set point2 = (point offset by 600.00 towards (Random angle) degrees)
              • Unit - Order (Picked unit) to Move To point2
              • -------- This order causes the unit to run randomly around while it burns. --------
              • Custom script: call RemoveLocation(udg_point2)
              • -------- Again, we define bj_wantDestroyGroup = true --------
              • Custom script: set bj_wantDestroyGroup = true
              • -------- This unit group has a large amount of conditions, such as the unit must be alive, and not already on fire. --------
              • Unit Group - Pick every unit in (Units within 150.00 of point matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) is in group) Equal to False)) and (((Matching unit) belongs to an enemy of (Owner of (Load 1 of (Key handle) in hashtable))) Equal to True))) and do (Actions)
                • Loop - Actions
                  • -------- All of the units here have the same values saved as those that were initially cast upon in the Cast trigger. --------
                  • Unit - Set (Picked unit) movement speed to ((Default movement speed of (Picked unit)) x 2.00)
                  • Unit Group - Add (Picked unit) to group
                  • Special Effect - Create a special effect attached to the origin of (Picked unit) using Doodads\Cinematic\TownBurningFireEmitter\TownBurningFireEmitter.mdl
                  • -------- The difference being that this time we transfer the data from the unit that the fire was caught from. --------
                  • Hashtable - Save (Load 0 of (Key handle) from (Last created hashtable)) as 0 of (Key (Picked unit)) in hashtable
                  • Hashtable - Save Handle Of(Load 1 of (Key handle) in hashtable) as 1 of (Key (Picked unit)) in hashtable
                  • Hashtable - Save (Load 2 of (Key handle) from hashtable) as 2 of (Key (Picked unit)) in hashtable
                  • Hashtable - Save Handle Of(Last created special effect) as 3 of (Key (Picked unit)) in hashtable
                  • -------- This ensures that all the burned units take into account who the original caster was, and how much damage should be dealt. --------
              • Custom script: call RemoveLocation(udg_point)
              • -------- Get rid of leaks! --------


Keywords:
fire, damage over time, crowd control, chaos, burn, conflagrate, conflagration, fear
Contents

Conflagration v1.11 (Map)

Reviews
12:03, 17th Jun 2010 Hanky: I like your spell. But there are two things that I dislike. First of you should add a prefix to your spell variables and the second point is that the "loop" trigger is always active. But apart from those two things the...

Moderator

M

Moderator

12:03, 17th Jun 2010
Hanky:
I like your spell. But there are two things that I dislike. First of you should add a prefix to your spell variables and the second point is that the "loop" trigger is always active. But apart from those two things the spell is useful enough for an approval.
 
Level 10
Joined
Mar 30, 2009
Messages
255
hashtables... well coding seems fine, anyway: i heard that
  • Custom script: set bj_wantDestroyGroup = true
is slower than using
  • Set UnitGroup = (Units within 200.00 of point matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)))
  • Custom script: call DestroyGroup(udg_UnitGroup)
also: do not use IntegerA use an Integer Variable instead.
 
Level 14
Joined
Nov 23, 2008
Messages
512
i think bj_wantDestroyGroup=true is faster because the BJ is:
JASS:
function ForGroupBJ takes group whichGroup, code callback returns nothing
    // If the user wants the group destroyed, remember that fact and clear
    // the flag, in case it is used again in the callback.
    local boolean wantDestroy = bj_wantDestroyGroup
    set bj_wantDestroyGroup = false

    call ForGroup(whichGroup, callback)

    // If the user wants the group destroyed, do so now.
    if (wantDestroy) then
        call DestroyGroup(whichGroup)
    endif
endfunction

and you do a extra function for destroying it

else good spell/system
like swine flu
 
Level 14
Joined
Aug 31, 2009
Messages
762
Well, I guess I could change it, but I can't say I've ever experienced the problem you're describing. Two triggers have to be run simultaneously for their variables to affect each other when no waits are added (and the possibility of you casting the spell on the same quanta-second as another trigger is near infinitely impossible). By that logic, you would have to use a different Integer Variable or Real Variable or Group variable or whatever for each and every single trigger you have to avoid them interfering with each other. And I'm sure nobody does that.

Another thing - there's no such thing as a "For each (Variable) from 1 to 6" action so you'd have to personally add 6 different locations instead of using a loop with 1 action with a varying number (which just makes the trigger look messy). <---- Turned out to be wrong.

Lastly, this is all just part of the special effects. You could totally omit that loop as it's just for the fire explosion graphic.

Unless you can demonstrate to me an example where the Loop for Integer A malfunctions then I think I've already got this in a suitable form.
 
Last edited:
Level 10
Joined
Mar 30, 2009
Messages
255
  • For each (Integer Custom_Integer_Variable) from 1 to 10, do (Actions)
    • Loop - Actions
It`s global variable so it may bug if there is run second trigger with loop for each int A. But that`s really a big problem if there are waits in loop.
Umm well it`s better because even if you aren`t using there waits the person using this system may in other trigger do so, so it`d bug for that person.
in other words, when there are multiple triggers/loops with Integer A running at the same time, the triggers could bug.

to prevent any case of a bug, just dont use em :)

im only trying to help you :)
 
Top