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

Enchanted Owl 1.06

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
2nd spell!
make sure to read the comments in the trigger if use



Summons an owl scout which will move to the target location and mana burn nearby enemies 2.75 times per second for a short duration. Damage of each mana burn increases by 3 for every 15 intelligence the hero has.
Damage caps at 180.
Each level increases duration by 1 and mana burn damage by 6




  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Enchanted Owl
  • Actions
    • -------- Increase level of Mana burn for dummies for every X level of the main owl spell --------
    • -------- (Go to object editor to change damage of mana burn) --------
    • Set OWL_MBLevel_OwlLevel = 2
    • -------- Increase level of Mana burn for dummies for every X points of intelligence --------
    • -------- (Go to object editor to change damage of mana burn) --------
    • Set OWL_MB_Level_X_INT = 15
    • -------- Set Area of Effect of the spell. --------
    • Set OWL_AOE = 650.00
    • -------- Set duration of mana burning. 1 second = 2 --------
    • Set OWL_DurationBase = 8
    • Set OWL_DurationPerLevel = 2
    • -------- Set speed of Owl --------
    • Set OWL_Speed = 10.00
    • -------- Set how often mana burns are cast. Every 10 = 0.03 seconds --------
    • Set OWL_ManaBurnPeriod = 170
    • -------- ---------------------------------------------------------- --------
    • -------- ---------------------------------------------------------- --------
    • Set OWL_CastCountInt = (OWL_CastCountInt + 1)
    • Set OWL_Caster[OWL_CastCountInt] = (Triggering unit)
    • Set OWL_TargetPoint[OWL_CastCountInt] = (Target point of ability being cast)
    • Set OWL_CasterPoint = (Position of (Triggering unit))
    • Set OWL_Distance[OWL_CastCountInt] = (Distance between OWL_CasterPoint and OWL_TargetPoint[OWL_CastCountInt])
    • Unit - Create 1 Owl Dummy 1 for (Triggering player) at OWL_CasterPoint facing (Facing of (Triggering unit)) degrees
    • Set OWL_Dummy[OWL_CastCountInt] = (Last created unit)
    • Animation - Play OWL_Dummy[OWL_CastCountInt]'s birth animation
    • Unit Group - Add OWL_Dummy[OWL_CastCountInt] to OWL_UnitGroup
    • Unit Group - Add OWL_Dummy[OWL_CastCountInt] to OWL_UnitGroup3
    • Custom script: call RemoveLocation(udg_OWL_CasterPoint)
    • Trigger - Turn on Loop v101 <gen>
  • Events
    • Time - Every 0.03 seconds of game time
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Number of units in OWL_UnitGroup) Not equal to 0
      • Then - Actions
        • For each (Integer OWL_LoopInt) from 1 to OWL_CastCountInt, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (OWL_Dummy[OWL_LoopInt] is in OWL_UnitGroup) Equal to True
              • Then - Actions
                • Set OWL_TempPoint = (Position of OWL_Dummy[OWL_LoopInt])
                • Set OWL_MovePoint = (OWL_TempPoint offset by OWL_Speed towards (Facing of OWL_Dummy[OWL_LoopInt]) degrees)
                • Set OWL_Distance[OWL_LoopInt] = (OWL_Distance[OWL_LoopInt] - OWL_Speed)
                • Unit - Move OWL_Dummy[OWL_LoopInt] instantly to OWL_MovePoint, facing OWL_TargetPoint[OWL_LoopInt]
                • Custom script: call RemoveLocation(udg_OWL_TempPoint)
                • Custom script: call RemoveLocation(udg_OWL_MovePoint)
              • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (OWL_Dummy[OWL_LoopInt] is in OWL_UnitGroup) Equal to True
                • (Integer(OWL_Distance[OWL_LoopInt])) Less than or equal to 1
              • Then - Actions
                • Set OWL_ManaBurnCastCount[OWL_LoopInt] = 0
                • Unit Group - Remove OWL_Dummy[OWL_LoopInt] from OWL_UnitGroup
                • Unit Group - Add OWL_Dummy[OWL_LoopInt] to OWL_UnitGroup2
                • Set OWL_Point2 = (Position of OWL_Dummy[OWL_LoopInt])
                • Special Effect - Create a special effect at OWL_Point2 using Abilities\Spells\Items\AIim\AIimTarget.mdl
                • Special Effect - Destroy (Last created special effect)
                • Custom script: call RemoveLocation(udg_OWL_Point2)
                • Custom script: call RemoveLocation(udg_OWL_TargetPoint[udg_OWL_LoopInt])
                • Set OWL_Boolean[OWL_LoopInt] = True
              • Else - Actions
      • Else - Actions
    • Set OWL_Timing = (OWL_Timing + 10)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • OWL_Timing Equal to OWL_ManaBurnPeriod
      • Then - Actions
        • Set OWL_Timing = 0
        • For each (Integer OWL_LoopInt2) from 1 to OWL_CastCountInt, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • OWL_Boolean[OWL_LoopInt2] Equal to True
                • (OWL_Dummy[OWL_LoopInt2] is in OWL_UnitGroup) Equal to False
              • Then - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (OWL_Dummy[OWL_LoopInt2] is in OWL_UnitGroup2) Equal to True
                  • Then - Actions
                    • Set OWL_Point2 = (Position of OWL_Dummy[OWL_LoopInt2])
                    • Unit Group - Remove OWL_Dummy[OWL_LoopInt2] from OWL_UnitGroup2
                    • Unit - Add Mana Burn (OWL) to OWL_Dummy[OWL_LoopInt2]
                    • Unit - Set level of Mana Burn (OWL) for OWL_Dummy[OWL_LoopInt2] to (((Intelligence of OWL_Caster[OWL_LoopInt2] (Include bonuses)) / OWL_MB_Level_X_INT) + (0 + ((Level of Enchanted Owl for OWL_Caster[OWL_LoopInt2]) x OWL_MBLevel_OwlLevel)))
                    • Custom script: set bj_wantDestroyGroup = true
                    • Unit - Order OWL_Dummy[OWL_LoopInt2] to Night Elf Demon Hunter - Mana Burn (Random unit from (Units within OWL_AOE of OWL_Point2 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 ((((Owner of OWL_Dummy[OWL_LoopInt2])
                    • Animation - Play OWL_Dummy[OWL_LoopInt2]'s walk animation
                    • Set OWL_ManaBurnCastMax[OWL_LoopInt2] = (OWL_DurationBase + (OWL_DurationPerLevel x (Level of Enchanted Owl for OWL_Caster[OWL_LoopInt2])))
                    • Set OWL_ManaBurnCastCount[OWL_LoopInt2] = (OWL_ManaBurnCastCount[OWL_LoopInt2] + 1)
                    • Unit - Create 1 ManaBurn Dummy for (Owner of OWL_Dummy[OWL_LoopInt2]) at OWL_Point2 facing Default building facing degrees
                    • Unit - Add Mana Burn (OWL) to (Last created unit)
                    • Unit - Set level of Mana Burn (OWL) for (Last created unit) to (((Intelligence of OWL_Caster[OWL_LoopInt2] (Include bonuses)) / OWL_MB_Level_X_INT) + (0 + ((Level of Enchanted Owl for OWL_Caster[OWL_LoopInt2]) x OWL_MBLevel_OwlLevel)))
                    • Custom script: set bj_wantDestroyGroup = true
                    • Unit - Order (Last created unit) to Night Elf Demon Hunter - Mana Burn (Random unit from (Units within OWL_AOE of OWL_Point2 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 ((((Owner of OWL_Dummy[OWL_LoopInt2])
                    • Unit - Add a 1.30 second Generic expiration timer to (Last created unit)
                    • Custom script: call RemoveLocation(udg_OWL_Point2)
                  • Else - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (OWL_Dummy[OWL_LoopInt2] is in OWL_UnitGroup3) Equal to True
                      • Then - Actions
                        • Set OWL_Point2 = (Position of OWL_Dummy[OWL_LoopInt2])
                        • Custom script: set bj_wantDestroyGroup = true
                        • Unit - Order OWL_Dummy[OWL_LoopInt2] to Night Elf Demon Hunter - Mana Burn (Random unit from (Units within OWL_AOE of OWL_Point2 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 ((((Owner of OWL_Dummy[OWL_CastCountI
                        • Unit - Create 1 ManaBurn Dummy for (Owner of OWL_Dummy[OWL_LoopInt2]) at OWL_Point2 facing Default building facing degrees
                        • Unit - Add Mana Burn (OWL) to (Last created unit)
                        • Unit - Set level of Mana Burn (OWL) for (Last created unit) to (((Intelligence of OWL_Caster[OWL_LoopInt2] (Include bonuses)) / OWL_MB_Level_X_INT) + (0 + ((Level of Enchanted Owl for OWL_Caster[OWL_LoopInt2]) x OWL_MBLevel_OwlLevel)))
                        • Custom script: set bj_wantDestroyGroup = true
                        • Unit - Order (Last created unit) to Night Elf Demon Hunter - Mana Burn (Random unit from (Units within OWL_AOE of OWL_Point2 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 ((((Owner of OWL_Dummy[OWL_LoopInt2])
                        • Unit - Add a 1.30 second Generic expiration timer to (Last created unit)
                        • Set OWL_ManaBurnCastCount[OWL_LoopInt2] = (OWL_ManaBurnCastCount[OWL_LoopInt2] + 1)
                        • Custom script: call RemoveLocation(udg_OWL_Point2)
                      • Else - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • OWL_ManaBurnCastCount[OWL_LoopInt2] Equal to OWL_ManaBurnCastMax[OWL_LoopInt2]
                      • Then - Actions
                        • Unit Group - Remove OWL_Dummy[OWL_LoopInt2] from OWL_UnitGroup3
                        • Unit - Add a 1.30 second Generic expiration timer to OWL_Dummy[OWL_LoopInt2]
                      • Else - Actions
              • Else - Actions
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Number of units in OWL_UnitGroup3) Equal to 0
        • (Number of units in OWL_UnitGroup) Equal to 0
      • Then - Actions
        • Set OWL_CastCountInt = 0
        • Custom script: call RemoveLocation(udg_OWL_MovePoint)
        • Trigger - Turn off (This trigger)
      • Else - Actions


Im not sure if it is really 2.75 mana burns per second but i know it is between 2-3


v1.02
-removed leaks
-mana burns now stops exactly when owl dies
-combined 2 triggers into 1
-removed walk animation during when owl moves
-changed region stuff to distance stuff and removed move order
-added two new settings
v1.03
-removed a leak
v1.04
-changed to owner of triggering unit in 1st trigger (to make simpler?)
-removed the location leaks in unit order actions.
v1.05
-added temp point for moving
-moved the delete move point variable to end
-changed to triggering player
v1.06
-fixed the movepoint leak



thanks to Adiktuz and narogog for help

Keywords:
mana burn, mana, laser, owl, enchanted, green, evolution tag, coolyoshi
Contents

OWL Spell 1.06 (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. Moderator: Pharaoh_ Date: 04:18, 24th Apr 2012 You need to merge some of the actions in the loop trigger. Check if the dummy is in Owl_Group once and in the then branch check if...

Moderator

M

Moderator

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

160036-albums4747-picture55861.png

Moderator: Pharaoh_
Date: 04:18, 24th Apr 2012

Review
You need to merge some of the actions in the loop trigger. Check if the dummy is in Owl_Group once and in the then branch check if the Distance is Less than or Equal to 1. If it is, perform the actions, else do the other actions. I don't see any reason why you convert the distance variable to integer to make the check.
Certain variables are global, when they should be enhanced with an array (using the current index).
For readability, use unit group variables, when you pick the "random unit from units in random units matching...).

Bribe:

Instead of (Owner of (Triggering unit)) you should use (Triggering player). A lot more simple and executes faster in-game. It may surprise you that this works but it works.

To fix the leak you need to do this:

  • Set TempPoint = (Position of OWL_Dummy[OWL_LoopInt])
  • Set OWL_MovePoint = (TempPoint offset by OWL_Speed towards (Facing of OWL_Dummy[OWL_LoopInt]) degrees)
  • Custom script: call RemoveLocation(udg_TempPoint)
You don't need to convert this thing to an integer:

(Integer(OWL_Distance[OWL_LoopInt])) Less than or equal to 1

You can simply compare it to 1.00. This will save a little complexity.

I also recommend setting "OWL_Dummy[OWL_LoopInt2]" to a normal unit variable before repeat-referencing because it will improve readability and is a bit faster in-game.

Maker:
Leaks MovePoint in the looping trigger, and the looping trigger should be turned off when there are no active instances of the spell.
 
Animation - Play (Last created unit)'s birth animation
Set OWL_Dummy[OWL_CastCountInt] = (Last created unit)
Unit - Order (Last created unit) to Move To OWL_TargetPoint[OWL_CastCountInt]
Unit Group - Add (Last created unit) to OWL_UnitGroup
Unit Group - Add (Last created unit) to OWL_UnitGroup3

-->You set (Last created unit) to OWL_Dummy[OWL_CastCountInt], but you still use (Last created unit) on the next steps... it reduces performance, as (Last created unit), is a function call which is slower than a variable...

it should be like this:

Set OWL_Dummy[OWL_CastCountInt] = (Last created unit)
Animation - Play OWL_Dummy[OWL_CastCountInt]'s birth animation
Unit - Order OWL_Dummy[OWL_CastCountInt] to Move To OWL_TargetPoint[OWL_CastCountInt]
Unit Group - Add OWL_Dummy[OWL_CastCountInt] to OWL_UnitGroup
Unit Group - Add OWL_Dummy[OWL_CastCountInt] to OWL_UnitGroup3

You can remove rects(the GUI regions) with script, but I really dont suggest the way that you're doing this, (issuing move order)... its better if you just move the owl via the loop trigger, and save the distance from the initial point to the target point into a variable, and reduce it every second, if it becomes equal or less than 0, do the removal actions...

also the current set-up is pretty bad, because you can just combine those two timed loops... anyway, if you do the above suggestion, you will also end up with just one timed loop, so don't bother merging the current triggers...
 
Level 7
Joined
Apr 1, 2010
Messages
289
using two loops for one spell.......
well other then that
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • OWL_ManaBurnCastCount[OWL_LoopInt2] Equal to OWL_ManaBurnCastMax[OWL_LoopInt2]
    • Then - Actions
    • Unit Group - Remove OWL_Dummy[OWL_LoopInt2] from OWL_UnitGroup3
    • Unit - Add a 1.30 second Generic expiration timer to OWL_Dummy[OWL_LoopInt2]
    • Custom script: call RemoveLocation(udg_OWL_Point2)
why is the remove location inside of a if then else that it is not used in? i am pretty sure this will cause leaks.
 
Level 12
Joined
Apr 16, 2010
Messages
584
I think the idea is pretty good, but i would like to see in this spell is second owl! I mean create two owls; one burns mana second hitpoints. Would have more effects - cooler. And ofc do what Adiktuz said, till the leaks are cleared they will hunt you! Good luck! Oh and make the owl not move in line, it's kinda ugly, but a bit to the right then to the left.
To remove the group leaks before creating a group add this line: Custom script: set bj_wantDestroyGroup = true
 
Unacceptable
Bribe:

Instead of (Owner of OWL_Caster[OWL_CastCountInt]) you should use (Triggering player). A lot more simple.

This leaks (Position of OWL_Dummy[OWL_LoopInt]):

Set OWL_MovePoint = ((Position of OWL_Dummy[OWL_LoopInt]) offset by OWL_Speed towards (Facing of OWL_Dummy[OWL_LoopInt]) degrees)

This leaks a unit group and could be fixed by placing "bj_wantDestroyGroup = true" directly above it, and also leaks a location:

Unit - Order OWL_Dummy[OWL_LoopInt2] to Night Elf Demon Hunter - Mana Burn (Random unit from (Units within OWL_AOE o

And you do the same thing further down your script which needs to be leak-cleared as well.

Actually you do the same thing a lot... looks like you have a LOT of duplicate text in your loop trigger...

Needs a ton of work.


EPIC XD

Leaks are very important to clear though :/
If you ignore them, your maps will lag like hell :)
 
Level 8
Joined
Jul 25, 2009
Messages
194
Mod said:
Instead of (Owner of OWL_Caster[OWL_CastCountInt]) you should use (Triggering player). A lot more simple.

This leaks (Position of OWL_Dummy[OWL_LoopInt]):

Set OWL_MovePoint = ((Position of OWL_Dummy[OWL_LoopInt]) offset by OWL_Speed towards (Facing of OWL_Dummy[OWL_LoopInt]) degrees)

This leaks a unit group and could be fixed by placing "bj_wantDestroyGroup = true" directly above it, and also leaks a location:

Unit - Order OWL_Dummy[OWL_LoopInt2] to Night Elf Demon Hunter - Mana Burn (Random unit from (Units within OWL_AOE o


And you do the same thing further down your script which needs to be leak-cleared as well.

Actually you do the same thing a lot... looks like you have a LOT of duplicate text in your loop trigger...

Needs a ton of work.

I just changed the stuff you said in red.
-why is it better to use owner of triggering unit over the variable?
-I already had destroy group triggers so i guess you didnt see them..
-(Position of OWL_Dummy[OWL_LoopInt]) dosnt leak cuz i set it a variable and destroyed it

i hope its ok i reply here. I tried to message back to mod but it didnt work.
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
- ALL configurables must be put in an initialization trigger so that it will not run every time the spell is casted...
- Its better to use an index, instead of checking if unit group is empty...
  • (Number of units in OWL_UnitGroup) Not equal to 0
--->
  • IntegerIndex Greater than 0
- The Booleans in the loop is not indexed in the casting
- Use a loop group, not a single line
- 0.03 is too fast for playing animations, better to make an indexed real value=0, if it reaches 2, then play the animation and reset it to 0 in the loop
- It's highly recommended to use Hanky's Indexing system or Bribes UnitIndexer
 
Top