Remove this leak

The-Shadows

New Member
Reaction score
12
Ok i have a problem to remove a location leak

There are two triggers

Code:
Shuriken 1
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Throw Shuriken 
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Charges remaining in (Item carried by (Triggering unit) in slot 1)) Greater than 0
            Then - Actions
                If (MUI[1] Less than or equal to 100) then do (Set MUI[1] = (MUI[1] + 1)) else do (Set MUI[1] = 1)
                -------- ------------------------------------------------------ --------
                Set MUI_Damage[MUI[1]] = (Real((Strength of (Triggering unit) (Include bonuses))))
                Set MUI_Speed[MUI[1]] = (Real((Agility of (Triggering unit) (Include bonuses))))
                Set MUI_Distance[MUI[1]] = (Real((Intelligence of (Triggering unit) (Include bonuses))))
                -------- ------------------------------------------------------ --------
                Set MUI_Caster[MUI[1]] = (Casting unit)
                Set TempPoint[1] = (Position of (Triggering unit))
                Set TempPoint[2] = (Target point of ability being cast)
                Set TempPoint[3] = (TempPoint[1] offset by 10.00 towards (Angle from TempPoint[1] to TempPoint[2]) degrees)
                -------- ------------------------------------------------------ --------
                Set [COLOR="Red"]MUI_Point[MUI[1]][/COLOR] = (Target point of ability being cast)
                Unit - Set the custom value of (Triggering unit) to MUI[1]
                Unit - Create 1 Throw Shuriken (Dummy Unit) for (Owner of (Triggering unit)) at TempPoint[3] facing 0.00 degrees
                Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                -------- ------------------------------------------------------ --------
                Unit - Create 1 Weapon_Dummy[(Random integer number between 1 and 9)] for (Owner of (Triggering unit)) at TempPoint[3] facing ((Angle from TempPoint[1] to TempPoint[2]) + 0.00) degrees
                Item - Set charges remaining in (Item carried by (Triggering unit) of type Weapon[1]) to ((Charges remaining in (Item carried by (Triggering unit) of type Weapon[1])) - 1)
                If ((Charges remaining in (Item carried by (Triggering unit) of type Weapon[1])) Equal to 0) then do (Item - Remove (Item carried by (Triggering unit) of type Weapon[1])) else do (Do nothing)
                Set MUI_Shuriken[MUI[1]] = (Last created unit)
                Unit - Set the custom value of (Last created unit) to MUI[1]
                Unit Group - Add (Last created unit) to TempGroup[1]
                -------- ------------------------------------------------------ --------
                Custom script:   call RemoveLocation(udg_TempPoint[1])
                Custom script:   call RemoveLocation(udg_TempPoint[2])
                Custom script:   call RemoveLocation(udg_TempPoint[3])
                -------- ------------------------------------------------------ --------
            Else - Actions
                Game - Display to (Player group((Owner of (Triggering unit)))) for 1.00 seconds the text: |cffFF5229Shuriken ...

Code:
Shuriken Combo
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Combo Shuriken 
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Charges remaining in (Item carried by (Triggering unit) of type Normal Shuriken)) Greater than 0
            Then - Actions
                Set MUI[2] = (Custom value of (Triggering unit))
                If (MUI[1] Less than or equal to 1000000000) then do (Set MUI[1] = (MUI[1] + 1)) else do (Set MUI[1] = 1)
                -------- ------------------------------------------------------ --------
                Set MUI_Damage[MUI[1]] = (Real((Strength of (Triggering unit) (Include bonuses))))
                Set MUI_Speed[MUI[1]] = (Real((Agility of (Triggering unit) (Include bonuses))))
                Set MUI_Distance[MUI[1]] = (Real((Intelligence of (Triggering unit) (Include bonuses))))
                -------- ------------------------------------------------------ --------
                Set MUI_Caster[MUI[1]] = (Casting unit)
                Set TempPoint[1] = (Position of (Triggering unit))
                Set TempPoint[2] = (TempPoint[1] offset by 10.00 towards (Angle from TempPoint[1] to MUI_Point[MUI[2]]) degrees)
                Unit - Create 1 Weapon_Dummy[(Random integer number between 1 and 9)] for (Owner of (Triggering unit)) at TempPoint[2] facing ((Angle from TempPoint[1] to [COLOR="Red"]MUI_Point[MUI[2]][/COLOR]) + (Random real number between -10.00 and 10.00)) degrees
                Set MUI_Shuriken[MUI[1]] = (Last created unit)
                Unit - Set the custom value of (Last created unit) to MUI[1]
                Unit Group - Add (Last created unit) to TempGroup[1]
                -------- ------------------------------------------------------ --------
                Custom script:   call RemoveLocation(udg_TempPoint[1])
                Custom script:   call RemoveLocation(udg_TempPoint[2])
                -------- ------------------------------------------------------ --------
                Item - Set charges remaining in (Item carried by (Triggering unit) of type Normal Shuriken) to ((Charges remaining in (Item carried by (Triggering unit) of type Normal Shuriken)) - 1)
                If ((Charges remaining in (Item carried by (Triggering unit) of type Normal Shuriken)) Equal to 0) then do (Item - Remove (Item carried by (Triggering unit) of type Normal Shuriken)) else do (Do nothing)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Charges remaining in (Item carried by (Triggering unit) of type Normal Shuriken)) Equal to 0
                    Then - Actions
                        Item - Remove (Item carried by (Triggering unit) of type Normal Shuriken)
                        Set TempGroup[5] = (Units owned by (Owner of (Triggering unit)) of type Shuriken (Dummy Unit))
                        Unit Group - Pick every unit in TempGroup[5] and do (Actions)
                            Loop - Actions
                                Unit - Remove (Picked unit) from the game
                        Custom script:   call RemoveLocation(udg_TempPoint[5])
                    Else - Actions
            Else - Actions

this is my shuriken system, the hero have two abilities which that is Throw Shuriken and Combo Shuriken. Combo Shuriken only can be used after you use the Throw Shuriken. Throw Shuriken has a second cooldown so at the time in a second where the Combo Shuriken is active, you must spam click Combo Shuriken to throw more shurikens without click on a location again(Automatically throwing at the Throw Shuriken's targeted location) in a second. I've tested that in a second if fast spamming clicking on the Combo Shuriken I can throw about more 4 maximum shurikens.
I tried to put wait a second and then remove the leak but it caused a bug.
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
why you use an integer as an array? you can take a loop or another tmppoint
(for loop in the [] set bj_forLoopAIndex)
 
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