Trigger problem-almost freezes game

S

SilentDragon

Guest
Dwarf Drop - Catapults a dwarven tank into target location dealing damage and summoning dwarven riflemen.

Problem - 3-4 casts in gets kind of jerky
5+ capable of freezing game

Code:
Code:
Dwarf Drop
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Dwarf Drop 
    Actions
        Set Spell_DDrop_Caster = (Position of (Casting unit))
        Set Spell_DDrop_Pos = (Target point of ability being cast)
        Set Spell_DDrop_Avail = (Spell_DDrop_Max - Spell_DDrop_Current)
        Unit - Create 1 Dummy Caster (DD) for (Owner of (Casting unit)) at Spell_DDrop_Caster facing Spell_DDrop_Pos
        Unit - Order (Last created unit) to Attack Ground Spell_DDrop_Pos
        Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
        Sound - Play Catapult <gen> at 100.00% volume, located at Spell_DDrop_Caster with Z offset 0.00
        Wait 1.20 seconds
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Spell_DDrop_Avail Greater than or equal to 2
            Then - Actions
                Unit - Create 2 Spell_DDrop_Type for (Owner of (Casting unit)) at Spell_DDrop_Pos facing Default building facing degrees
                Set Spell_DDrop_Current = (Spell_DDrop_Current + 2)
                Sound - Play Dwready <gen> at 100.00% volume, located at Spell_DDrop_Pos with Z offset 0.00
                Custom script:   call RemoveLocation (udg_Spell_DDrop_Caster)
                Custom script:   call RemoveLocation (udg_Spell_DDrop_Pos)
                Skip remaining actions
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Spell_DDrop_Avail Equal to 0
            Then - Actions
                Unit - Create 3 Sheep Bomb for (Owner of (Casting unit)) at Spell_DDrop_Pos facing Default building facing degrees
            Else - Actions
                Unit - Create 1 Spell_DDrop_Type for (Owner of (Casting unit)) at Spell_DDrop_Pos facing Default building facing degrees
                Set Spell_DDrop_Current = (Spell_DDrop_Current + 1)
                Sound - Play Dwready <gen> at 100.00% volume, located at Spell_DDrop_Pos with Z offset 0.00
                Custom script:   call RemoveLocation (udg_Spell_DDrop_Caster)
                Custom script:   call RemoveLocation (udg_Spell_DDrop_Pos)

I downloaded the leak checker and it says it's leakless other than the two I have removed at end. I'm wondering if the sounds cause leaks? they are imported from the first warcraft game. other than that I have no idea how to fix, it used to be worse...(works the same wether if/then/elses are all one stream)

IMPORTANT FACTS:
-you have max of four that increases via another (perfectly fine) trigger by higher levels.
-current goes up on creation
-current goes down on death (nother perfectly fine trigger)
-I don't want dwarves to go away by anything but death

major thanks for ANY useful help I get
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top