Fire Shield V1.2 [MUI]

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Fire Shield V1.2
Created by Destination9747

Description: The Firelord creates a great shield of fire around himself and every 0.03 sec it damages the enemies withing 200 range by 0.25, 0.5, 0.75, 1. Lasts 5, 7, 9, 11 seconds.
Number of rows increases per level
Cooldown: 20, 22, 24, 26
Mana Cost: 70, 85, 100, 115

Spell Created
Fixed memory leaks
Fixed memory leaks
Damages reduced
Added 2 integer variables for keys

  • Fire Shield Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set FISH_Damage[1] = 1.00
      • Set FISH_Damage[2] = 2.00
      • Set FISH_Damage[3] = 3.00
      • Set FISH_Damage[4] = 4.00
      • Set FISH_Time[1] = 5.00
      • Set FISH_Time[2] = 7.00
      • Set FISH_Time[3] = 9.00
      • Set FISH_Time[4] = 11.00
      • Set FISH_Row[1] = 1
      • Set FISH_Row[2] = 2
      • Set FISH_Row[3] = 3
      • Set FISH_Row[4] = 4
      • Set FISH_DamageType = Fire
      • Set FISH_AttackType = Spells
      • Set FISH_Ability = Fire Shield
      • Set FISH_Dummy_Type = FISH Dummy
      • -------- Hashtable Create --------
      • Hashtable - Create a hashtable
      • Set FISH_Hashtable = (Last created hashtable)
  • Fire Shield Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to FISH_Ability
    • Actions
      • Set FISH_Caster = (Triggering unit)
      • Set FISH_Key = (Key (Triggering unit))
      • Set FISH_UnitGroup_Count = (FISH_UnitGroup_Count + 1)
      • -------- Check if the spell is running --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Load 1 of (Key (Triggering unit)) in FISH_Hashtable)) Equal to FISH Dummy
        • Then - Actions
          • For each (Integer FISH_ForInteger) from 1 to 32, do (Actions)
            • Loop - Actions
              • Unit - Kill (Load FISH_ForInteger of (Key (Triggering unit)) in FISH_Hashtable)
          • Hashtable - Clear all child hashtables of child FISH_Key in FISH_Hashtable
          • Set FISH_UnitGroup_Count = (FISH_UnitGroup_Count - 1)
        • Else - Actions
      • -------- Setting Variables --------
      • Set FISH_INT_LOOP = 0
      • Set FISH_Dummy_Int = 0
      • Set FISH_Owner = (Owner of FISH_Caster)
      • Set FISH_Caster_Location = (Position of FISH_Caster)
      • Set FISH_Level = (Level of Fire Shield for FISH_Caster)
      • Set FISH_KeyTime = (Key Time)
      • For each (Integer FISH_ForInteger) from 1 to FISH_Row[FISH_Level], do (Actions)
        • Loop - Actions
          • For each (Integer FISH_ForInteger_Angle) from 1 to 8, do (Actions)
            • Loop - Actions
              • Set FISH_Dummy_Int = (FISH_Dummy_Int + 1)
              • Set FISH_Point = (FISH_Caster_Location offset by 100.00 towards (45.00 x (Real(FISH_ForInteger_Angle))) degrees)
              • Set FISH_Dummy_FaceAngle = (Angle from FISH_Point to FISH_Caster_Location)
              • Unit - Create 1 FISH_Dummy_Type for FISH_Owner at FISH_Caster_Location facing FISH_Dummy_FaceAngle degrees
              • Set FISH_Dummy = (Last created unit)
              • Hashtable - Save Handle OfFISH_Dummy as FISH_Dummy_Int of FISH_Key in FISH_Hashtable
              • Unit - Add Crow Form to FISH_Dummy
              • Unit - Remove Crow Form from FISH_Dummy
              • Unit - Turn collision for FISH_Dummy Off
              • Animation - Change FISH_Dummy flying height to (50.00 x (Real(FISH_ForInteger))) at 0.00
              • Unit - Move FISH_Dummy instantly to FISH_Point
              • Custom script: call RemoveLocation(udg_FISH_Point)
      • Hashtable - Save FISH_INT_LOOP as (Key INTLOOP) of FISH_Key in FISH_Hashtable
      • Hashtable - Save FISH_Time[FISH_Level] as FISH_KeyTime of FISH_Key in FISH_Hashtable
      • Unit Group - Add FISH_Caster to FISH_UnitGroup
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Fire Shield Loop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Fire Shield Loop <gen>
        • Else - Actions
      • -------- Memory Leaks --------
      • Custom script: call RemoveLocation(udg_FISH_Caster_Location)
  • Fire Shield Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in FISH_UnitGroup and do (Actions)
        • Loop - Actions
          • Set FISH_Caster = (Picked unit)
          • Set FISH_Key = (Key (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (FISH_Caster is alive) Equal to False
            • Then - Actions
              • Unit Group - Remove FISH_Caster from FISH_UnitGroup
              • Set FISH_UnitGroup_Count = (FISH_UnitGroup_Count - 1)
              • For each (Integer FISH_ForInteger) from 1 to 32, do (Actions)
                • Loop - Actions
                  • Unit - Kill (Load FISH_ForInteger of (Key (Picked unit)) in FISH_Hashtable)
              • Hashtable - Clear all child hashtables of child FISH_Key in FISH_Hashtable
            • Else - Actions
          • Set FISH_Caster_Location = (Position of FISH_Caster)
          • Set FISH_Level = (Level of Fire Shield for FISH_Caster)
          • Set FISH_INT_LOOP = (Load (Key INTLOOP) of (Key (Picked unit)) from FISH_Hashtable)
          • Set FISH_INT_LOOP = (FISH_INT_LOOP + 1)
          • Set FISH_Owner = (Owner of FISH_Caster)
          • Hashtable - Save FISH_INT_LOOP as (Key INTLOOP) of FISH_Key in FISH_Hashtable
          • Set FISH_KeyTime = (Key Time)
          • Set FISH_DamageGroup = (Units within 200.00 of FISH_Caster_Location matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of FISH_
          • Unit Group - Pick every unit in FISH_DamageGroup and do (Actions)
            • Loop - Actions
              • Unit - Cause FISH_Caster to damage (Picked unit), dealing FISH_Damage[FISH_Level] damage of attack type FISH_AttackType and damage type FISH_DamageType
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load FISH_KeyTime of FISH_Key from FISH_Hashtable) Greater than 0.00
            • Then - Actions
              • For each (Integer FISH_ForInteger) from FISH_INT_LOOP to (FISH_INT_LOOP + ((8 x FISH_Level) - 1)), do (Actions)
                • Loop - Actions
                  • Set FISH_Point = (FISH_Caster_Location offset by 100.00 towards (10.00 x ((Real(FISH_ForInteger)) + 1.00)) degrees)
                  • Set FISH_Dummy = (Load (FISH_ForInteger - (FISH_INT_LOOP - 1)) of (Key (Picked unit)) in FISH_Hashtable)
                  • Unit - Move FISH_Dummy instantly to FISH_Point
                  • Custom script: call RemoveLocation(udg_FISH_Point)
              • Hashtable - Save ((Load FISH_KeyTime of FISH_Key from FISH_Hashtable) - 0.03) as (Key Time) of FISH_Key in FISH_Hashtable
            • Else - Actions
              • Set FISH_UnitGroup_Count = (FISH_UnitGroup_Count - 1)
              • For each (Integer FISH_ForInteger) from FISH_INT_LOOP to (FISH_INT_LOOP + ((8 x FISH_Level) - 1)), do (Actions)
                • Loop - Actions
                  • Set FISH_Dummy = (Load (FISH_ForInteger - (FISH_INT_LOOP - 1)) of (Key (Picked unit)) in FISH_Hashtable)
                  • Unit - Kill FISH_Dummy
                  • Unit Group - Remove FISH_Caster from FISH_UnitGroup
              • Hashtable - Clear all child hashtables of child FISH_Key in FISH_Hashtable
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • FISH_UnitGroup_Count Equal to 0
        • Then - Actions
          • Custom script: call RemoveLocation(udg_FISH_Caster_Location)
          • Custom script: call DestroyGroup(udg_FISH_DamageGroup)
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • [/HIDDEN]
Keywords:
Fire, Shield, AOE, Area, Aura, of, effect, dps, damage, per, second, lord, firelord, ring
Contents

Fire Shield V1.2 (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. 20:57, 2nd Mar 2014 Magtheridon96: Review: Since you're storing (Key(Triggering unit)), you might as well use the variable FISH_Key instead of repeating the computation within...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.

20:57, 2nd Mar 2014
Magtheridon96:

Review:


  • Since you're storing (Key(Triggering unit)), you might as well use the variable FISH_Key instead of repeating the computation within the code blocks directly after. It saves computation time. 2 function calls become 1 variable lookup.
  • Don't use magic numbers. 100.00 should probably be configurable in there. The same applies to the other magic numbers. 8 and 45.00 should probably be configurable as well. Make 8 configurable, and instead of having 45.00, you would just have use 360.00/8 where 8 is not present as a constant literal, but as a variable the user can change in your setup trigger. Do the same for the other magic numbers like 50.00. Remember: magic numbers are evil.
  • Apply what I said about (Key(Triggering unit)) to (Key(Picked unit)) in the loop trigger.
  • You're not removing the FISH_Caster_Location correctly in the loop trigger. It's being leaked. You need to remove it regardless of whether FISH_UnitGroup_Count is 0 or not. You need to remove it in the same scope as its allocation. That's how you ensure 0 leaks.
 

Kazeon

Hosted Project: EC
Level 34
Joined
Oct 12, 2011
Messages
3,449
- you are not removing the leaks :)
- maybe you can store the FISH_Level and FISH_Owner at the cast event
- only turn on the loop when total unit in FISH_UnitGroup = 1, I mean just turn on it once
- at the Fire Shield cast trigger, change (Key (Triggering unit)) to (Key(FISH_Caster)). Put the FISH_Caster = Triggering unit at very top

just that for now
 
You should use Every 0.04 instead of 0.03, it will still look good and also save memory, i tested it and it needs only some little upgrades (leaks, bad hash saving, everything that said ..... , btw what a "name" :D) anyways, good idea nice graphic (don't know if it is yours), so 4/5 :)


Edit: if i could i will approve it :D except that leaks
Edit No.2: 5/5 all properly working and that 0.03 :D :D
  • Set FISH_DamageGroup = (Units within 200.00 of FISH_Caster_Location matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of FISH_
Instead of using matching unit use another ITE (i think that the matching unit has more bugs :/ but i am not sure), i don't know why but i prefer ITE's
 
Last edited:

Kazeon

Hosted Project: EC
Level 34
Joined
Oct 12, 2011
Messages
3,449
you removed the leaks almost totaly wrong my friend :p
let me make this easier for you..

- move call RemoveLocation(udg_FISH_Point) from the bottom into inside of the loop below the following action
  • Unit - Move FISH_Dummy instantly to FISH_Point
so it will become
  • Unit - Move FISH_Dummy instantly to FISH_Point
  • Custom script: call RemoveLocation(udg_FISH_Point)
- store (Key (FISH_Caster)) below
  • Set FISH_Caster = (Triggering unit)
=>
  • Set FISH_Caster = (Triggering unit)
  • Set FISH_Key = (Key (FISH_Caster))
then change all (Key(Triggering Unit)) in that trigger to FISH_Key
- change
  • Set FISH_Level = (Level of Fire Shield for FISH_Caster)
=>
  • Set FISH_Level = (Level of FISH_Ability for FISH_Caster)
and also inside the loop trigger too
- may be change the fly height rate to 0.0 is better
  • Animation - Change FISH_Dummy flying height to (50.00 x (Real(FISH_ForInteger))) at 0.00

- just like in the cast trigger. store (Key (Picked unit)) into a variable first
- change
  • Set FISH_DummyTime = (Load (Key Time) of (Key (Picked unit)) from FISH_Hashtable)
    • Set FISH_DummyTime = (FISH_DummyTime - 0.03)
    • Hashtable - Save FISH_DummyTime as (Key Time) of (Key (Picked unit)) in FISH_Hashtable
to
  • Set FISH_TimeKey = ( Key Time )
    • Hashtable - Save ( (Load FISH_TimeKey of FISH_PickedKey - 0.03) as FISH_TimeKey of FISH_PickedKey in FISH_Hashtable
- move
  • Custom script: call RemoveLocation(udg_FISH_Caster_Location)
  • Custom script: call DestroyGroup(udg_FISH_DamageGroup)
from the ITE
=>
  • Custom script: call DestroyGroup(udg_FISH_DamageGroup)
  • Custom script: call RemoveLocation(udg_FISH_Caster_Location)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • FISH_UnitGroup_Count Equal to 0
    • Then - Actions
      • Trigger - Turn off (This trigger)
    • Else - Actions
- move
  • Custom script: call RemoveLocation(udg_FISH_Point)
into the loop
=>
  • For each (Integer FISH_ForInteger) from FISH_INT_LOOP to (FISH_INT_LOOP + ((8 x FISH_Level) - 1)), do (Actions)
    • Loop - Actions
      • Set FISH_Point = (FISH_Caster_Location offset by 100.00 towards (10.00 x ((Real(FISH_ForInteger)) + 1.00)) degrees)
      • Set FISH_Dummy = (Load (FISH_ForInteger - (FISH_INT_LOOP - 1)) of (Key (Picked unit)) in FISH_Hashtable)
      • Unit - Move FISH_Dummy instantly to FISH_Point
      • Custom script: call RemoveLocation(udg_FISH_Point)

phew, I think just that for now
overall, I love the spell, it's so eye candy. just lacking a better coding :p
here some additional suggestions:
- change the tooltip
Learn Fire Shield [Level 1]
Learn Fire Shield [Level 2]
...
to
Fire Shield [Level 1]
Fire Shield [Level 2]​
- give damage delay so that user can configure the damage more freely. feels like that 4 damage per 0.03 is so hurt, so make it deals 4 damage per 0.1 second or anything else where the loop still run every 0.03 seconds.
- fix the follow through time
 
Top