• 🏆 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!

Burning Eye by Klingo v1.03

  • Like
Reactions: FeelMyRash
-Burning Eye-

Create a burning eye on the ground. Every one sec a fire geyser apear in the middle of the eye and deal some damage in a certain Aoe during 5 sec:
Level 1: 50 damage per geyser and aoe of 250. Level 2: 60 damage per geyser and aoe of 300. Level 3: 70 damage per geyser and aoe of 350.


  • Burning Eye Init
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Burning Eye
    • Actions
      • -------- This is a part of MUI and recycling index --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • B Equal to 0
        • Then - Actions
          • -------- Opening periodic trigger , really important --------
          • -------- ------------------------------------------------------------------------------------------------ --------
          • Trigger - Turn on Burning Eye Periodic <gen>
        • Else - Actions
      • Set B = (B + 1)
      • Set C = (C + 1)
      • -------- ------------------------------------------------------------------------------------------------ --------
      • -------- set the caster --------
      • Set BECaster[C] = (Triggering unit)
      • -------- ------------------------------------------------------------------------------------------------ --------
      • -------- set who is the owner of the caster --------
      • Set BEPlayer[C] = (Owner of BECaster[C])
      • -------- ------------------------------------------------------------------------------------------------ --------
      • -------- set the target point --------
      • Set BETargetPoint[C] = (Target point of ability being cast)
      • -------- ------------------------------------------------------------------------------------------------ --------
      • -------- This is damage , you can change the value like you want --------
      • Set BEDamage[C] = (40.00 + (10.00 x (Real((Level of Burning Eye for BECaster[C])))))
      • -------- ------------------------------------------------------------------------------------------------ --------
      • -------- This is the aoe of the damage , you can change the value to --------
      • Set BEAoe[C] = (200.00 + (50.00 x (Real((Level of Burning Eye for BECaster[C])))))
      • -------- ------------------------------------------------------------------------------------------------ --------
      • -------- This is how many time a geyser will apear --------
      • Set BETime[C] = 5.00
      • -------- ------------------------------------------------------------------------------------------------ --------
      • -------- Well as it said in unit's name , it just there to save a location... --------
      • -------- ------------------------------------------------------------------------------------------------ --------
      • Unit - Create 1 Burning Eye[JustToSaveALocation] for BEPlayer[C] at BETargetPoint[C] facing BETargetPoint[C]
      • Set BERandomGuy[C] = (Last created unit)
      • Unit Group - Add BERandomGuy[C] to BEHummmGroup[C]
      • -------- ------------------------------------------------------------------------------------------------ --------
      • -------- This is the loop that make the oval --------
      • For each (Integer A) from 0 to 11, do (Actions)
        • Loop - Actions
          • -------- This point is require to make the oval --------
          • -------- You can Change the value "600.00" to make the oval large or small --------
          • -------- You can Change the value "300.00" to make the oval tall or small --------
          • Set BEOvalPoint = (BETargetPoint[C] offset by ((600.00 x (Sin(((Real((Integer A))) x 30.00)))), (300.00 x (Cos(((Real((Integer A))) x 30.00))))))
          • -------- ------------------------------------------------------------------------------------------------ --------
          • -------- Here we create the unit that will make the oval --------
          • Unit - Create 1 Burning Eye[Side] for BEPlayer[C] at BEOvalPoint facing BEOvalPoint
          • -------- ------------------------------------------------------------------------------------------------ --------
          • -------- Store the unit into a variable --------
          • Set BEOval = (Last created unit)
          • -------- ------------------------------------------------------------------------------------------------ --------
          • -------- this will make the oval disapear after 5 seconds --------
          • Unit - Add a 5.00 second Generic expiration timer to BEOval
          • -------- ------------------------------------------------------------------------------------------------ --------
          • -------- Clearing Leaks --------
          • Custom script: call RemoveLocation(udg_BEOvalPoint)
          • -------- ------------------------------------------------------------------------------------------------ --------
      • -------- ------------------------------------------------------------------------------------------------ --------
      • -------- This loop is to make the circle in the oval --------
      • For each (Integer B) from 1 to 20, do (Actions)
        • Loop - Actions
          • -------- This point is require to make circle --------
          • -------- You can change the value"200.00" to make a bigger or smaller circle --------
          • Set BECirclePoint = (BETargetPoint[C] offset by 200.00 towards (360.00 x ((Real((Integer B))) / 20.00)) degrees)
          • -------- ------------------------------------------------------------------------------------------------ --------
          • -------- Here we create the unit that will make the circle --------
          • Unit - Create 1 Burning Eye[Side] for BEPlayer[C] at BECirclePoint facing BECirclePoint
          • -------- ------------------------------------------------------------------------------------------------ --------
          • -------- Store the unit into a variable --------
          • Set BECircle = (Last created unit)
          • -------- ------------------------------------------------------------------------------------------------ --------
          • -------- This will make the circle disapear after 5 sec --------
          • Unit - Add a 5.00 second Generic expiration timer to BECircle
          • -------- ------------------------------------------------------------------------------------------------ --------
          • -------- Clearing Leaks --------
          • Custom script: call RemoveLocation(udg_BECirclePoint)
          • -------- ------------------------------------------------------------------------------------------------ --------
      • Custom script: call RemoveLocation(udg_BETargetPoint[udg_C])
  • Burning Eye Periodic
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to C, do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in BEHummmGroup[A] and do (Actions)
            • Loop - Actions
              • -------- This timer is require to end the trigger --------
              • Set BETime[A] = (BETime[A] - 1.00)
              • Set BERandomGuy[A] = (Picked unit)
              • Set BELocGuy[A] = (Position of BERandomGuy[A])
              • For each (Integer A) from 1 to 10, do (Actions)
                • Loop - Actions
                  • -------- set how far the geyser will go in the air --------
                  • -------- You can Change the value "50" to make a geyser taller or smaller --------
                  • Set BEFly = (Real(((Integer A) x 50)))
                  • -------- ------------------------------------------------------------------------------------------------ --------
                  • -------- Here we create the dummy that will make the geyser --------
                  • Unit - Create 1 Burning Eye[Geyser] for BEPlayer[A] at BELocGuy[A] facing BELocGuy[A]
                  • -------- ------------------------------------------------------------------------------------------------ --------
                  • -------- Store the Geyser unit into a variable --------
                  • Set BEGeyser[A] = (Last created unit)
                  • -------- ------------------------------------------------------------------------------------------------ --------
                  • -------- set his position , will be good when we'll do damage --------
                  • Set BEGeyserPoint[A] = (Position of BEGeyser[A])
                  • -------- ------------------------------------------------------------------------------------------------ --------
                  • -------- Now we are making the geyser --------
                  • Animation - Change BEGeyser[A] flying height to BEFly at 0.00
                  • -------- ------------------------------------------------------------------------------------------------ --------
                  • -------- This will make the geyser die after 1 sec --------
                  • Unit - Add a 1.00 second Generic expiration timer to BEGeyser[A]
                  • -------- ------------------------------------------------------------------------------------------------ --------
                  • -------- Clearing Leaks --------
                  • Custom script: call RemoveLocation(udg_BEGeyserPoint[udg_A])
                  • -------- ------------------------------------------------------------------------------------------------ --------
              • Set BEDamageGroup = (Units within BEAoe[A] of BELocGuy[A] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and (((Matching unit) belongs to an enemy of BEPlayer[A]) Equal to True))))
              • Unit Group - Pick every unit in BEDamageGroup and do (Actions)
                • Loop - Actions
                  • -------- Here we store the picked unit into a variable --------
                  • Set BETarget = (Picked unit)
                  • -------- ------------------------------------------------------------------------------------------------ --------
                  • -------- This action is damage --------
                  • Unit - Cause BECaster[A] to damage BETarget, dealing BEDamage[A] damage of attack type Spells and damage type Normal
                  • -------- ------------------------------------------------------------------------------------------------ --------
              • -------- Clearing Leaks --------
              • Custom script: call DestroyGroup(udg_BEDamageGroup)
              • Custom script: call RemoveLocation(udg_BELocGuy[udg_A])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BETime[A] Less than or equal to 0.00
                • Then - Actions
                  • -------- All Actions below are required for recycling index --------
                  • Unit Group - Remove BERandomGuy[A] from BEHummmGroup[A]
                  • Unit - Remove BERandomGuy[A] from the game
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (BEHummmGroup[A] is empty) Equal to True
                    • Then - Actions
                      • Set B = (B - 1)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • B Equal to 0
                        • Then - Actions
                          • Set C = 0
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                    • Else - Actions
                • Else - Actions

Give credits if you use it


A special thanks Skrik for the creep respawn system.


Changelog
v1.00: uploading
v1.01: Cleared some leaks
v1.02: Turn off periodic when it's finish
v1.03: Reworked the whole code

Keywords:
Oval, Circle, Eye, Fire, Burning, Burn, Flame, Geyser, Klingo.
Contents

Klingo's Burning Eye (Map)

Reviews
Hanky: Leakless and MUI. Looks okay after updating. Approved! Just as hint: You could improve the indexing.

Moderator

M

Moderator

Hanky:
Leakless and MUI. Looks okay after updating. Approved!

Just as hint: You could improve the indexing.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,180
Set BEGeyserPoint[BEIndex[2]] = (Position of BEGeyser[BEIndex[2]])

This leaks as it is run in a loop 10 times under BEIndex[2] being constant (not changing) and the asigned location is not removed until the end of the loop, resulting in 9 location leaks. Every handle you create must be destroyed if you no longer need it (or it no longer affects the game).

Why are you using static indicies so much (eg BEIndex[2]])... The whole point of arrays are to provide dynamic indicies so you defeat their purpose using static ones. Rather just use a normal variable in this situation as it is faster to reference (no offset finding required etc).

This system does not recycle indexes, it only just restricts their range to a seemingly random number.

Do you really run code every one second? What is the point of doing that if no spells are active, you tell me.

Obviously as it is GUI it leaks handle indicies and is not very efficent but you can not be blamed for that.
 
Top