Spell Log Swap

Zaraf

New Member
Reaction score
22
Log Swap

MUI: Yes.
Leakless: Yes
Lagless: Yes.
Jass/GUI: GUI

Spell Description: Teleports the pseudo ninja a short distance away, while leaving a log in his wake. The log then entices all enemies around it to attack it. Enemy AI controlled heroes, however, are not fooled by the clever ploy, and continue to chase after pseudo ninja. The log takes only 1 damager per hit, regardless of how strong the attacker is. After either 10 seconds, or losing all its HP (whichever comes first), the log vanishes.

The GUI:
Trigger:
  • Log Swap Options
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- This sets the base range that will provoke creeps to attack the log --------
      • Set RangeBase = 400.00
      • -------- This sets the amount of range that will be multiplied by the level of the skill to increase the range of provoke per level --------
      • Set RangeMultiplier = 100.00
      • -------- This sets the multiplier per level of how much HP the log will have --------
      • Set LogHPMultiplier = 3.00
      • -------- This sets the number of seconds the log will last before automatically dying --------
      • Set LogExpirationTimer = 10.00

Trigger:
  • Log Swap
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to (==) Log Swap
    • Actions
      • -------- The log is created in the spot that the caster was before teleporting. --------
      • Set tempPoint = (Position of (Casting unit))
      • Unit - Create 1 Log for (Owner of (Casting unit)) at tempPoint facing (Random angle) degrees
      • Custom script: call RemoveLocation (udg_tempPoint)
      • Set Log2 = (Last created unit)
      • -------- Causes the log to die after a given amount of time automatically --------
      • Unit - Add a LogExpirationTimer second Generic expiration timer to Log2
      • -------- Sets the amount of HP that the log has --------
      • Unit - Set life of Log2 to (LogHPMultiplier x (Real((Level of Log Swap for (Casting unit)))))
      • -------- The log provokes all enemies within the specified range to attack the log --------
      • Set tempPoint = (Position of Log2)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within (RangeBase + ((Real((Level of Log Swap for (Casting unit)))) x RangeMultiplier)) of (Position of Log2) matching (((Owner of (Matching unit)) is an enemy of (Owner of (Casting unit))) Equal to (==) True)) and do (Actions)
        • Loop - Actions
          • -------- However, Heroes are not fooled by the log, thus they ignore the log and head straight for the caster --------
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ((Picked unit) is A Hero) Equal to (==) False
              • Then - Actions
                • Unit - Order (Picked unit) to Attack Log[(Player number of (Owner of (Casting unit)))]
              • Else - Actions
                • Unit - Order (Picked unit) to Attack (Casting unit)
      • Custom script: call RemoveLocation (udg_tempPoint)

Trigger:
  • Log Swap Log Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to (==) Log
    • Actions
      • Wait 0.30 seconds
      • Set tempPoint = (Position of (Dying unit))
      • Special Effect - Create a special effect at tempPoint using Objects\Spawnmodels\Other\ToonBoom\ToonBoom.mdl
      • Special Effect - Destroy (Last created special effect)
      • Sound - Play ToonExplosion <gen> at 100.00% volume, located at tempPoint with Z offset 0.00
      • Custom script: call RemoveLocation (udg_tempPoint)

Screenshot:
logswap.jpg
The screenshot doesn't do it justice....you gotta try it out :) It's a fun little spell. Also, it's 10 levels because I made this originally for my map. But that's something that can easily be changed.

This is my first spell submission, so please be gentle :)

EDIT: Fixed MUI problem by removing the turn on/turn off triggers. Fixed leaks (I hope it's all of them.)
 

Attachments

  • LogSwap.jpg
    LogSwap.jpg
    163.1 KB · Views: 238
  • Log_Swap_by_Zaraf_v1.0.w3x
    28.9 KB · Views: 193

Dinowc

don't expect anything, prepare for everything
Reaction score
223
it's not MUI and it's definitely not leakless...

the spell itself is pretty simple though
 

Zaraf

New Member
Reaction score
22
Hmmm....I don't understand how it's not MUI. I made sure that every action that specified variable for a specific player was within an array, and triggered via casting unit (so depending on who cast it, they would trigger all of the results).

As for leaks, I thought I caught them, but I guess not. Can you please show me the leaking portions. Thanks.
 

phyrex1an

Staff Member and irregular helper
Reaction score
446
The reason it isn't MUI is because you turn on/off the Log Swap Log Dies trigger. The Log array isn't needed btw since you do not have any waits.

Here are some leaks:
Code:
Log Swap
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to (==) Log Swap 
    Actions
        Trigger - Turn on Log Swap Log Dies <gen>
        -------- The log is created in the spot that the caster was before teleporting. --------
        Unit - Create 1 Log for (Owner of (Casting unit)) at [B](Position of (Casting unit))[/B] facing (Random angle) degrees
        Set Log[(Player number of (Owner of (Casting unit)))] = (Last created unit)
        -------- Causes the log to die after a given amount of time automatically --------
        Unit - Add a LogExpirationTimer second Generic expiration timer to Log[(Player number of (Owner of (Casting unit)))]
        -------- Sets the amount of HP that the log has --------
        Unit - Set life of Log[(Player number of (Owner of (Casting unit)))] to (LogHPMultiplier x (Real((Level of Log Swap  for (Casting unit)))))
        -------- The log provokes all enemies within the specified range to attack the log --------
        Unit Group - Pick every unit in [B](Units within (RangeBase + ((Real((Level of Log Swap  for (Casting unit)))) x RangeMultiplier)) of [U](Position of Log[(Player number of (Owner of (Casting unit)))])[/U] matching (((Owner of (Matching unit)) is an enemy of (Owner of (Casting unit))) Equal to (==) Tr[/B] and do (Actions)
            Loop - Actions
                -------- However, Heroes are not fooled by the log, thus they ignore the log and head straight for the caster --------
                 Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is A Hero) Equal to (==) False
                    Then - Actions
                        Unit - Order (Picked unit) to Attack Log[(Player number of (Owner of (Casting unit)))]
                    Else - Actions
                        Unit - Order (Picked unit) to Attack (Casting unit)
        Custom script:   call DestroyGroup (udg_tempGroup)
Additionally the last line is completely useless as it is now since you never assign tempGroup.
Code:
Log Swap Log Dies
    Events
        Unit - A unit Dies
    Conditions
        (Unit-type of (Dying unit)) Equal to (==) Log
    Actions
        Wait 0.30 seconds
        Special Effect - Create a special effect at [B](Position of (Dying unit)) [/B]using Objects\Spawnmodels\Other\ToonBoom\ToonBoom.mdl
        Special Effect - Destroy (Last created special effect)
        Sound - Play ToonExplosion <gen> at 100.00% volume, located at [B](Position of (Dying unit))[/B] with Z offset 0.00
        Trigger - Turn off (This trigger)
 

Zaraf

New Member
Reaction score
22
Oh, I see now. Yeah, I suppose I can remove those turn on and turn off triggers.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top