• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

large gui triggered spell, inefficient?

Status
Not open for further replies.
Level 4
Joined
Feb 22, 2012
Messages
74
I am wondering if my spell is executed inefficiently, based on GUI standards.

It does work as intended, just looking for some optimizations.

Spell:
Flame Spear

Launches a projectile that explodes on contact with an enemy, or after reaching maximum range. The explosion deals 20-60 elemental damage to nearby enemies. Maximum damage is caused at greater range.

Affected enemies are ignited, causing them to suffer and additional 50% of the impact damage over 5 seconds.

Range: 2400
Radius: 260
Cooldown: 2

My biggest concern is the fact that this spell has 3 triggers, and 2 of them are periodic.

Here are the triggers

On Cast:
  • Flame Spear Cast
    • Events
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Cast Flame Spear
      • Set tempLoc[0] = (Position of (Triggering unit))
      • Set tempLoc[1] = (Target point of ability being cast)
      • Set tempReal[0] = (Angle from tempLoc[0] to tempLoc[1])
      • Custom script: call RemoveLocation(udg_tempLoc[1])
      • Set tempReal[1] = (sorFlameSpearSMin x intervalAbilityProjectile)
      • Set tempLoc[2] = (tempLoc[0] offset by tempReal[1] towards tempReal[0] degrees)
      • Custom script: call RemoveLocation(udg_tempLoc[0])
      • Unit - Create 1 sorFlameSpearMissle for (Owner of (Triggering unit)) at tempLoc[2] facing tempReal[0] degrees
      • Custom script: call RemoveLocation(udg_tempLoc[2])
      • Hashtable - Save Handle Of(Triggering unit) as (Key source) of (Key (Last created unit)) in sorFlameSpearHash
      • Hashtable - Save sorFlameSpearDMin as (Key damage) of (Key (Last created unit)) in sorFlameSpearHash
      • Hashtable - Save sorFlameSpearDMin as (Key mindamage) of (Key (Last created unit)) in sorFlameSpearHash
      • Hashtable - Save sorFlameSpearDMax as (Key maxdamage) of (Key (Last created unit)) in sorFlameSpearHash
      • Hashtable - Save (sorFlameSpearSMin x intervalAbilityProjectile) as (Key speed) of (Key (Last created unit)) in sorFlameSpearHash
      • Hashtable - Save sorFlameSpearSInc as (Key speedinc) of (Key (Last created unit)) in sorFlameSpearHash
      • Hashtable - Save 0.00 as (Key distance) of (Key (Last created unit)) in sorFlameSpearHash
      • Hashtable - Save tempReal[0] as (Key angle) of (Key (Last created unit)) in sorFlameSpearHash
      • Unit Group - Add (Last created unit) to sorFlameSpearMGroup
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Flame Spear Missle <gen> is on) Equal to False
        • Then - Actions
          • Game - Display to (All players) the text: Flame Spear - On
          • Trigger - Turn on Flame Spear Missle <gen>
        • Else - Actions
Projectile Travel: (here, I wonder if there is a better way to cap the damage)
  • Flame Spear Missle
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (sorFlameSpearMGroup is empty) Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: Flame Spear - Off
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Unit Group - Pick every unit in sorFlameSpearMGroup and do (Actions)
            • Loop - Actions
              • Set tempReal[0] = (Load (Key distance) of (Key (Picked unit)) from sorFlameSpearHash)
              • Set tempLoc[0] = (Position of (Picked unit))
              • Set tempGroup = (Units within sorFlameSpearCollision of tempLoc[0] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True))))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • tempReal[0] Greater than or equal to sorFlameSpearRange
                      • (tempGroup is empty) Equal to False
                • Then - Actions
                  • Custom script: call DestroyGroup(udg_tempGroup)
                  • Set tempInt[0] = (Key (Picked unit))
                  • Set tempReal[0] = (Load (Key damage) of tempInt[0] from sorFlameSpearHash)
                  • Floating Text - Create floating text that reads ((String((Integer(tempReal[0])))) + !) at tempLoc[0] with Z offset 100.00, using font size 22.00, color (100.00%, 33.00%, 0.00%), and 0.00% transparency
                  • Floating Text - Set the velocity of (Last created floating text) to 40.00 towards 90.00 degrees
                  • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
                  • Floating Text - Change the fading age of (Last created floating text) to 0.50 seconds
                  • Floating Text - Change (Last created floating text): Disable permanence
                  • Set tempGroup = (Units within sorFlameSpearRadius of tempLoc[0] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of (Load (Key source) of tempInt[0] in sorFlameSpea
                  • Unit Group - Pick every unit in tempGroup and do (Actions)
                    • Loop - Actions
                      • Unit - Cause (Load (Key source) of tempInt[0] in sorFlameSpearHash) to damage (Picked unit), dealing tempReal[0] damage of attack type ATElemental and damage type DTElemental
                      • Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Items\AIfb\AIfbSpecialArt.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Set tempLoc[1] = (Position of (Picked unit))
                      • Unit - Create 1 EffectDummy for (Owner of (Load (Key source) of tempInt[0] in sorFlameSpearHash)) at tempLoc[1] facing Default building facing degrees
                      • Custom script: call RemoveLocation(udg_tempLoc[1])
                      • Hashtable - Save Handle Of(Load (Key source) of tempInt[0] in sorFlameSpearHash) as (Key source) of (Key (Last created unit)) in sorIgniteHash
                      • Hashtable - Save Handle Of(Picked unit) as (Key target) of (Key (Last created unit)) in sorIgniteHash
                      • Hashtable - Save (((tempReal[0] x sorIgniteFactor) / sorIgniteDuration) x intervalAbilityEffects) as (Key damage) of (Key (Last created unit)) in sorIgniteHash
                      • Hashtable - Save sorIgniteDuration as (Key duration) of (Key (Last created unit)) in sorIgniteHash
                      • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\FlameStrike\FlameStrikeDamageTarget.mdl
                      • Hashtable - Save Handle Of(Last created special effect) as (Key effect0) of (Key (Last created unit)) in sorIgniteHash
                      • Unit Group - Add (Last created unit) to sorIgniteGroup
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Ignite Effects <gen> is on) Equal to False
                        • Then - Actions
                          • Game - Display to (All players) the text: Ignite - On
                          • Trigger - Turn on Ignite Effects <gen>
                        • Else - Actions
                      • Unit Group - Remove (Picked unit) from tempGroup
                  • Custom script: call DestroyGroup(udg_tempGroup)
                  • Unit Group - Remove (Picked unit) from sorFlameSpearMGroup
                  • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in sorFlameSpearHash
                  • Unit - Kill (Picked unit)
                • Else - Actions
                  • Custom script: call DestroyGroup(udg_tempGroup)
                  • Set tempLoc[1] = (tempLoc[0] offset by (Load (Key speed) of (Key (Picked unit)) from sorFlameSpearHash) towards (Load (Key angle) of (Key (Picked unit)) from sorFlameSpearHash) degrees)
                  • Unit - Move (Picked unit) instantly to tempLoc[1]
                  • Custom script: call RemoveLocation(udg_tempLoc[1])
                  • Hashtable - Save ((Load (Key distance) of (Key (Picked unit)) from sorFlameSpearHash) + (Load (Key speed) of (Key (Picked unit)) from sorFlameSpearHash)) as (Key distance) of (Key (Picked unit)) in sorFlameSpearHash
                  • Hashtable - Save ((Load (Key mindamage) of (Key (Picked unit)) from sorFlameSpearHash) + (((Load (Key maxdamage) of (Key (Picked unit)) from sorFlameSpearHash) - (Load (Key mindamage) of (Key (Picked unit)) from sorFlameSpearHash)) x ((Load (Key distance) of (Key (Picked unit as (Key damage) of (Key (Picked unit)) in sorFlameSpearHash
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Load (Key damage) of (Key (Picked unit)) from sorFlameSpearHash) Greater than (Load (Key maxdamage) of (Key (Picked unit)) from sorFlameSpearHash)
                    • Then - Actions
                      • Hashtable - Save (Load (Key maxdamage) of (Key (Picked unit)) from sorFlameSpearHash) as (Key damage) of (Key (Picked unit)) in sorFlameSpearHash
                    • Else - Actions
                  • Hashtable - Save ((Load (Key speed) of (Key (Picked unit)) from sorFlameSpearHash) + (Load (Key speedinc) of (Key (Picked unit)) from sorFlameSpearHash)) as (Key speed) of (Key (Picked unit)) in sorFlameSpearHash
              • Custom script: call RemoveLocation(udg_tempLoc[0])
Ignite:
  • Ignite Effects
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (sorIgniteGroup is empty) Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: Ignite - Off
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Unit Group - Pick every unit in sorIgniteGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Load (Key duration) of (Key (Picked unit)) from sorIgniteHash) Less than or equal to 0.00
                      • ((Load (Key target) of (Key (Picked unit)) in sorIgniteHash) is alive) Equal to False
                • Then - Actions
                  • Special Effect - Destroy (Load (Key effect0) of (Key (Picked unit)) in sorIgniteHash)
                  • Unit Group - Remove (Picked unit) from sorIgniteGroup
                  • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in sorIgniteHash
                  • Unit - Remove (Picked unit) from the game
                • Else - Actions
                  • Set tempUnit[0] = (Load (Key source) of (Key (Picked unit)) in sorIgniteHash)
                  • Unit - Cause tempUnit[0] to damage (Load (Key target) of (Key (Picked unit)) in sorIgniteHash), dealing (Load (Key damage) of (Key (Picked unit)) from sorIgniteHash) damage of attack type ATElemental and damage type DTElemental
                  • Custom script: set udg_tempUnit[0] = null
                  • Hashtable - Save ((Load (Key duration) of (Key (Picked unit)) from sorIgniteHash) - intervalAbilityEffects) as (Key duration) of (Key (Picked unit)) in sorIgniteHash
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
this really a long trigger to my tired eyes but i can give a tip, store last created unit to variable, because u use lastcreated unit in same trigger alot times, each time its a new function, but if u store to variable and use variable instead 10 function call then it is faster (i talk about hash when u use last created unit like key)

(sorIgniteGroup is empty) Equal to True

better to use a simple integer variable, and add +1 when a new unit cast thisability, and -1 when 1 effect is over because counting each time a group is useless action, i think

pick all unit in group inside the pick all unit in group...

use variable in use group and store there the picked unit

and everywhere in second pickall unit in group included in condition use that variable
example
  • Set tempReal[0] = (Load (Key distance) of (Key (Picked unit)) from sorFlameSpearHash)
    • Set tempLoc[0] = (Position of (Picked unit))
    • Set tempunit = Picked unit
    • Set tempGroup = (Units within sorFlameSpearCollision of tempLoc[0] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of (tempunit))) Equal to True))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • .............
  • Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of (tempunit)
i think u dont need array for this, why dont use simple variable?
  • Set tempInt[0] = (Key (Picked unit))
    • Set tempReal[0] = (Load (Key damage) of tempInt[0] from sorFlameSpearHash)
dont need to store the 1st picked unit to hash, if u store to a simple tempunit unit variable that enough and shorter ur code+less function call
overall each time when u use picked unit, owner of this that, then it is a useless function call, u can avoid with simple variables :)

same with player, just do a tempplayer variable if u use more time the this/that unit owner
 
Level 12
Joined
Aug 12, 2008
Messages
349
:O It's long ... Anyway, a lot has been check shadowvzs. So, I just could give a few more as I'm not good in hashtable too ><

IsaacNewbton said:
so a unit variable is faster than "triggering unit," "picked unit," "last created unit," etc?
Yes, storing it into variable make it much efficient.

And, try not to use arrayed variables. It consumes much more space, I think. Creating 2 simple variables are much better than creating one arrayed variable as an arrayed variables have a max space of index up to 8192 if I'm not mistaken. So, it definitely would consume more space and make it less efficient. Link to a comment by Magtheridon96.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
:O It's long ... Anyway, a lot has been check shadowvzs. So, I just could give a few more as I'm not good in hashtable too ><

Yes, storing it into variable make it much efficient.

And, try not to use arrayed variables. It consumes much more space, I think. Creating 2 simple variables are much better than creating one arrayed variable as an arrayed variables have a max space of index up to 8192 if I'm not mistaken. So, it definitely would consume more space and make it less efficient. Link to a comment by Magtheridon96.

ok acctually even arrays got 8192 max size but dont declared every index, example unit group array in default is null.

but i agree arrays slower a bit also made for different thing than just for store 2 thing to 2 index.
 
Level 4
Joined
Feb 22, 2012
Messages
74
I think I made a better trigger, here take a look

  • Flame Spear Cast
    • Events
    • Conditions
    • Actions
      • Set tempUnit0 = (Casting unit)
      • Set tempInteger0 = (Level of SOR - Elemental Mastery [Passive] for tempUnit0)
      • Set tempPlayer = (Owner of tempUnit0)
      • Set tempLoc0 = (Position of tempUnit0)
      • Set tempLoc1 = (Target point of ability being cast)
      • Set tempReal0 = (Angle from tempLoc0 to tempLoc1)
      • Custom script: call RemoveLocation(udg_tempLoc1)
      • Set tempLoc2 = (tempLoc0 offset by sorFlameCollision towards tempReal0 degrees)
      • Custom script: call RemoveLocation(udg_tempLoc0)
      • Unit - Create 1 SorFlameSpearMissle for tempPlayer at tempLoc2 facing tempReal0 degrees
      • Custom script: call RemoveLocation(udg_tempLoc2)
      • Unit Group - Add (Last created unit) to sorFlameMGroup
      • Set sorCountFlame = (sorCountFlame + 1)
      • Set tempInteger1 = (Key (Last created unit))
      • Hashtable - Save Handle OftempUnit0 as (Key source) of tempInteger1 in sorHashFlame
      • Hashtable - Save (1.00 + (sorFlameDmgLFactor x (Real((tempInteger0 - 1))))) as (Key multiplier) of tempInteger1 in sorHashFlame
      • Hashtable - Save tempReal0 as (Key angle) of tempInteger1 in sorHashFlame
      • Hashtable - Save sorFlameSpeedBase as (Key speed) of tempInteger1 in sorHashFlame
      • Hashtable - Save 0.00 as (Key distance) of tempInteger1 in sorHashFlame
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Flame Spear Missile <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Flame Spear Missile <gen>
        • Else - Actions
  • Flame Spear Missile
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • sorCountFlame Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Unit Group - Pick every unit in sorFlameMGroup and do (Actions)
            • Loop - Actions
              • Set tempUnit0 = (Picked unit)
              • Set tempLoc0 = (Position of tempUnit0)
              • Set tempPlayer = (Owner of tempUnit0)
              • Set tempInteger0 = (Key (Picked unit))
              • Set tempReal0 = (Load (Key distance) of tempInteger0 from sorHashFlame)
              • Set tempGroup = (Units within sorFlameCollision of tempLoc0 matching ((((Matching unit) belongs to an enemy of tempPlayer) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) is A structure) Equal to False))))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (tempGroup is empty) Equal to False
                      • tempReal0 Greater than or equal to sorFlameRange
                • Then - Actions
                  • Unit Group - Remove all units of tempGroup from tempGroup
                  • Custom script: call DestroyGroup(udg_tempGroup)
                  • Unit Group - Remove tempUnit0 from sorFlameMGroup
                  • Set sorCountFlame = (sorCountFlame - 1)
                  • Unit - Kill tempUnit0
                  • Set tempGroup = (Units within sorFlameRadius of tempLoc0 matching ((((Matching unit) belongs to an enemy of tempPlayer) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) is A structure) Equal to False))))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (tempGroup is empty) Equal to False
                    • Then - Actions
                      • Set tempReal1 = (sorFlameDmgMinBase + ((sorFlameDmgMaxBase - sorFlameDmgMinBase) x (tempReal0 / sorFlameScaleRange)))
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • tempReal1 Greater than sorFlameDmgMaxBase
                        • Then - Actions
                          • Set tempReal1 = sorFlameDmgMaxBase
                        • Else - Actions
                      • Set tempReal1 = (tempReal1 x (Load (Key multiplier) of tempInteger0 from sorHashFlame))
                      • Set tempUnit0 = (Load (Key source) of tempInteger0 in sorHashFlame)
                      • Floating Text - Create floating text that reads (String((Integer(tempReal1)))) at tempLoc0 with Z offset 80.00, using font size 22.00, color (100.00%, 50.00%, 0.00%), and 0.00% transparency
                      • Floating Text - Change (Last created floating text): Disable permanence
                      • Floating Text - Change the lifespan of (Last created floating text) to 1.40 seconds
                      • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
                      • Floating Text - Set the velocity of (Last created floating text) to 120.00 towards 90.00 degrees
                      • Unit Group - Pick every unit in tempGroup and do (Actions)
                        • Loop - Actions
                          • Set tempUnit1 = (Picked unit)
                          • Set tempReal2 = (tempReal1 x sorIgniteFactor)
                          • Unit - Cause tempUnit0 to damage tempUnit1, dealing tempReal1 damage of attack type ATElemental and damage type DTElemental
                          • Unit - Create 1 EffectDummy for tempPlayer at tempLoc0 facing Default building facing degrees
                          • Unit Group - Add (Last created unit) to sorIgniteGroup
                          • Set sorCountIgnite = (sorCountIgnite + 1)
                          • Set tempInteger1 = (Key (Last created unit))
                          • Hashtable - Save Handle OftempUnit0 as (Key source) of tempInteger1 in sorHashIgnite
                          • Hashtable - Save Handle OftempUnit1 as (Key target) of tempInteger1 in sorHashIgnite
                          • Hashtable - Save tempReal2 as (Key totaldamage) of tempInteger1 in sorHashIgnite
                          • Hashtable - Save ((tempReal2 / sorIgniteDuration) x intervalAbilityEffects) as (Key damage) of tempInteger1 in sorHashIgnite
                          • Hashtable - Save sorIgniteDuration as (Key duration) of tempInteger1 in sorHashIgnite
                          • Special Effect - Create a special effect attached to the origin of tempUnit1 using Abilities\Spells\Other\BreathOfFire\BreathOfFireDamage.mdl
                          • Hashtable - Save Handle Of(Last created special effect) as (Key effect0) of tempInteger1 in sorHashIgnite
                          • Unit Group - Remove tempUnit1 from tempGroup
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Ignite Effects <gen> is on) Equal to False
                        • Then - Actions
                          • Trigger - Turn on Ignite Effects <gen>
                        • Else - Actions
                    • Else - Actions
                  • Custom script: call DestroyGroup(udg_tempGroup)
                  • Hashtable - Clear all child hashtables of child tempInteger0 in sorHashFlame
                • Else - Actions
                  • Set tempReal1 = (Load (Key speed) of tempInteger0 from sorHashFlame)
                  • Set tempLoc1 = (tempLoc0 offset by tempReal1 towards (Load (Key angle) of tempInteger0 from sorHashFlame) degrees)
                  • Unit - Move tempUnit0 instantly to tempLoc1
                  • Hashtable - Save (tempReal0 + tempReal1) as (Key distance) of tempInteger0 in sorHashFlame
                  • Hashtable - Save (tempReal1 + sorFlameSpeedInc) as (Key speed) of tempInteger0 in sorHashFlame
                  • Custom script: call RemoveLocation(udg_tempLoc1)
                  • Unit Group - Remove all units of tempGroup from tempGroup
                  • Custom script: call DestroyGroup(udg_tempGroup)
              • Custom script: call RemoveLocation(udg_tempLoc0)
  • Ignite Effects
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • sorCountIgnite Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Unit Group - Pick every unit in sorIgniteGroup and do (Actions)
            • Loop - Actions
              • Set tempUnit0 = (Picked unit)
              • Set tempInteger0 = (Key (Picked unit))
              • Set tempUnit1 = (Load (Key target) of tempInteger0 in sorHashIgnite)
              • Set tempReal0 = (Load (Key duration) of tempInteger0 from sorHashIgnite)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • tempReal0 Less than or equal to 0.00
                      • (tempUnit1 is dead) Equal to True
                • Then - Actions
                  • Unit Group - Remove tempUnit0 from sorIgniteGroup
                  • Set sorCountIgnite = (sorCountIgnite - 1)
                  • Special Effect - Destroy (Load (Key effect0) of tempInteger0 in sorHashIgnite)
                  • Hashtable - Clear all child hashtables of child tempInteger0 in sorHashIgnite
                  • Unit - Remove tempUnit0 from the game
                • Else - Actions
                  • Set tempUnit0 = (Load (Key source) of tempInteger0 in sorHashIgnite)
                  • Set tempReal1 = (Load (Key damage) of tempInteger0 from sorHashIgnite)
                  • Unit - Cause tempUnit0 to damage tempUnit1, dealing tempReal1 damage of attack type ATElemental and damage type DTElemental
                  • Hashtable - Save (tempReal0 - intervalAbilityEffects) as (Key duration) of tempInteger0 in sorHashIgnite
              • Custom script: call RemoveLocation(udg_tempLoc0)

I know the following line is not used anywhere
  • Hashtable - Save tempReal2 as (Key totaldamage) of tempInteger1 in sorHashIgnite
It is for another spell that does an AOE if it is cast on an ignited unit, and the AOE damage is equal to a multiplier of the ignite's total damage


Now I am having some trouble thinking of a good way to do the following spells

A spell that "charges" (channel with no effect) for 4 seconds, and does damage on release based on the channel time. I am thinking can I just check the unit's current order over an interval of time to check if the spell is released?

And the spell that will explode an ignited unit. The spell will do the following:

- remove the ignite(s) from the target unit
- deal 150% of the total ignite damage to an AOE

Since the ignite is MUI, then the detonate will have to remove ALL ignite instances from the target and do 150% of the damage of all the ignites added up. So I need to account for multiple ignites being consumed. I would also like to address another difficulty with this. I want ignited units to have a buff on their status bar, a generic one (no numbers) and it is simple if ignite is NOT MUI, but in some cases the removal of an ignite will leave another ignite, so the buff just can't be applied/removed with every application of ignite (there may be multiple sorcerers igniting the same guy).

I am thinking I may have to add the ignited units to a group, just to check if they are already ignited when applying ignite to them. Also may need a hashtable for them to count how many ignites they have on them.
 
Status
Not open for further replies.
Top