Spellpack Hero: Warlock

Sim

Forum Administrator
Staff member
Reaction score
534
Shortening your triggers with loops should be your number 1 priority ;)
 

Monsterous

In the Shadows, Lurking.
Reaction score
99
Update!

Shortened Perish DRAMATICALLY and fixed 5 leaks (i had the wrong custom script point hehe). Added Darkchaoself's custom script (Thanks :D). Shortened Infernal Meteor trigger.

Managed to shave off 0.8kb :)

Edit: Shortened Summon trigger quite a bit, eradicated 1.2kb :D
Re-uploaded Map.
 

NapaHero

Back from the dead...
Reaction score
43
God, this hole trigger could be shorter with loops:

Code:
Start Change
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Demonic Attunement 
    Actions
        Set Demon_Attune_Point = (Position of (Triggering unit))
        Set Demon_Attune_SE_Offset_Points[1] = (Demon_Attune_Point offset by (0.00, 180.00))
        Set Demon_Attune_SE_Offset_Points[2] = (Demon_Attune_Point offset by (90.00, 90.00))
        Set Demon_Attune_SE_Offset_Points[3] = (Demon_Attune_Point offset by (180.00, 0.00))
        Set Demon_Attune_SE_Offset_Points[4] = (Demon_Attune_Point offset by (-90.00, 90.00))
        Set Demon_Attune_SE_Offset_Points[5] = (Demon_Attune_Point offset by (-180.00, 0.00))
        Set Demon_Attune_SE_Offset_Points[6] = (Demon_Attune_Point offset by (-90.00, -90.00))
        Set Demon_Attune_SE_Offset_Points[7] = (Demon_Attune_Point offset by (0.00, -180.00))
        Set Demon_Attune_SE_Offset_Points[8] = (Demon_Attune_Point offset by (90.00, -90.00))
        Unit - Create 1 Demonic Attunement Dummy for (Owner of (Triggering unit)) at Demon_Attune_SE_Offset_Points[1] facing Default building facing degrees
        Unit Group - Add (Last created unit) to Demon_Attune_Unit_Group
        Unit - Create 1 Demonic Attunement Dummy for (Owner of (Triggering unit)) at Demon_Attune_SE_Offset_Points[2] facing Default building facing degrees
        Unit Group - Add (Last created unit) to Demon_Attune_Unit_Group
        Unit - Create 1 Demonic Attunement Dummy for (Owner of (Triggering unit)) at Demon_Attune_SE_Offset_Points[3] facing Default building facing degrees
        Unit Group - Add (Last created unit) to Demon_Attune_Unit_Group
        Unit - Create 1 Demonic Attunement Dummy for (Owner of (Triggering unit)) at Demon_Attune_SE_Offset_Points[4] facing Default building facing degrees
        Unit Group - Add (Last created unit) to Demon_Attune_Unit_Group
        Unit - Create 1 Demonic Attunement Dummy for (Owner of (Triggering unit)) at Demon_Attune_SE_Offset_Points[5] facing Default building facing degrees
        Unit Group - Add (Last created unit) to Demon_Attune_Unit_Group
        Unit - Create 1 Demonic Attunement Dummy for (Owner of (Triggering unit)) at Demon_Attune_SE_Offset_Points[6] facing Default building facing degrees
        Unit Group - Add (Last created unit) to Demon_Attune_Unit_Group
        Unit - Create 1 Demonic Attunement Dummy for (Owner of (Triggering unit)) at Demon_Attune_SE_Offset_Points[7] facing Default building facing degrees
        Unit Group - Add (Last created unit) to Demon_Attune_Unit_Group
        Unit - Create 1 Demonic Attunement Dummy for (Owner of (Triggering unit)) at Demon_Attune_SE_Offset_Points[8] facing Default building facing degrees
        Unit Group - Add (Last created unit) to Demon_Attune_Unit_Group
        Wait 1.00 seconds
        Unit Group - Pick every unit in Demon_Attune_Unit_Group and do (Actions)
            Loop - Actions
                Unit - Remove (Picked unit) from the game
        Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Undead\ReplenishMana\ReplenishManaCaster.mdl
        Special Effect - Destroy (Last created special effect)
        Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\NightElf\BattleRoar\RoarCaster.mdl
        Special Effect - Destroy (Last created special effect)
        Custom script:   call DestroyGroup (udg_Demon_Attune_Unit_Group)
        Custom script:   call RemoveLocation (udg_Demon_Attune_Point)
        Custom script:   call RemoveLocation (udg_Demon_Attune_SE_Offset_Points[1])
        Custom script:   call RemoveLocation (udg_Demon_Attune_SE_Offset_Points[2])
        Custom script:   call RemoveLocation (udg_Demon_Attune_SE_Offset_Points[3])
        Custom script:   call RemoveLocation (udg_Demon_Attune_SE_Offset_Points[4])
        Custom script:   call RemoveLocation (udg_Demon_Attune_SE_Offset_Points[5])
        Custom script:   call RemoveLocation (udg_Demon_Attune_SE_Offset_Points[6])
        Custom script:   call RemoveLocation (udg_Demon_Attune_SE_Offset_Points[7])
        Custom script:   call RemoveLocation (udg_Demon_Attune_SE_Offset_Points[8])
 

Sim

Forum Administrator
Staff member
Reaction score
534
For each (Integer A) from 1 to 8, do (Actions)
Loop - Actions
...
(Outside from the loop): wait 1.00 seconds
For each (Integer A) from 1 to 8, do (Actions)
Loop - Actions
clean leaks...
 

Kenoriga

Ultra Cool Member
Reaction score
34
I roughly guess that you can set the arrays first, then from 1 to 8, create the units, and remove locations...
 

vypur85

Hibernate
Reaction score
803
Code:
For each (Integer A) from 1 to 8 do:
  Loop
      Unit - Create 1 Demonic Attunement Dummy for (Owner of (Triggering unit)) at Demon_Attune_SE_Offset_Points[Integer A] facing Default building facing degrees
      Unit Group - Add (Last created unit) to Demon_Attune_Unit_Group

Like that, i guess.

Im sure there is a way to put the point variable into the loop as well, but kinda lazy to figure the formula :p.

Code:
Set Demon_Attune_SE_Offset_Points[Index] = (Demon_Attune_Point offset by (??*??, ??*??))
 
General chit-chat
Help Users

      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