Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Lagc during the effect

Discussion in 'World Editor Help Zone' started by ZiGOR, Jun 16, 2016.

  1. ZiGOR

    ZiGOR

    Joined:
    Mar 17, 2012
    Messages:
    577
    Resources:
    2
    Maps:
    2
    Resources:
    2
    Hi there! I've seen this problem several times before, but solved it by changing the nature of the spell, but now it's impossible for me because I don't have any options.

    The spell I'm using is Shadow Strike based, but from time to time it starts to cause terrible lags and makes it impossible to play. And when unit that has this buff dies - lags stop.

    Maybe someone knows how to overcome this problem without changing the spell...

    Here are 3 triggers that are connected with this buff:
    1. When unit is attacked it recieves this buff (kind of poison):

    • Poisoned Weapon init
      • Events
        • Unit - A unit Is attacked
      • Conditions
        • And - All (Conditions) are true
          • Conditions
            • (Level of Poisoned Weapon for (Attacking unit)) Greater than 0
            • (Poisoned_Weapon_Target[Player_Number_Int] is A structure) Not equal to True
      • Actions
        • Set Player_Number_Int = (Player number of (Owner of (Triggering unit)))
        • Set Poisoned_Weapon_Owner[Player_Number_Int] = (Attacking unit)
        • Set Poisoned_Weapon_Target[Player_Number_Int] = (Triggering unit)
        • Set Poisoned_Weapon_Point[Player_Number_Int] = (Position of Poisoned_Weapon_Owner[Player_Number_Int])
        • Set Poisoned_Weapon_Damage[Player_Number_Int] = (((Real((Level of Poisoned Weapon for Poisoned_Weapon_Owner[Player_Number_Int]))) x 2.00) + 4.00)
        • Unit - Create 1 Regular Dummy for (Owner of Poisoned_Weapon_Owner[Player_Number_Int]) at Poisoned_Weapon_Point[Player_Number_Int] facing Default building facing degrees
        • Unit - Add a 0.20 second Generic expiration timer to (Last created unit)
        • Unit - Add Poisoned Weapon dummy to (Last created unit)
        • Unit - Set level of Poisoned Weapon dummy for (Last created unit) to (Level of Poisoned Weapon for Poisoned_Weapon_Owner[Player_Number_Int])
        • Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike Poisoned_Weapon_Target[Player_Number_Int]
        • Custom script: call RemoveLocation(udg_Poisoned_Weapon_Point[udg_Player_Number_Int])



    2. This trigger deals periodic damage to all units across the map that have this buff:

    • Poisoned Weapon loop
      • Events
        • Time - Every 0.50 seconds of game time
      • Conditions
      • Actions
        • For each (Integer A) from 1 to 12, do (Actions)
          • Loop - Actions
            • Set Poisoned_Weapon_Group[(Integer A)] = (Units owned by (Player((Integer A))) matching (((Matching unit) has buff Poisoned Weapon ) Equal to True))
            • Unit Group - Pick every unit in Poisoned_Weapon_Group[(Integer A)] and do (Actions)
              • Loop - Actions
                • Unit - Cause Poisoned_Weapon_Owner[(Integer A)] to damage Poisoned_Weapon_Target[(Integer A)], dealing (Poisoned_Weapon_Damage[Player_Number_Int] / 2.00) damage of attack type Chaos and damage type Poison
            • Custom script: call DestroyGroup(udg_Poisoned_Weapon_Group[GetForLoopIndexA()])



    3. This trigger puts the buff if the specific spell is used:

    • Penetrating Hit
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Penetrating Hit
      • Actions
        • Set Player_Number_Int = (Player number of (Owner of (Target unit of ability being cast)))
        • Set Penetrating_Hit_Caster[Player_Number_Int] = (Triggering unit)
        • Set Penetrating_Hit_Target[Player_Number_Int] = (Target unit of ability being cast)
        • Set Penetrating_Hit_Damage[Player_Number_Int] = ((Real((Strength of Penetrating_Hit_Caster[Player_Number_Int] (Include bonuses)))) x (((Real((Level of Penetrating Hit for Penetrating_Hit_Caster[Player_Number_Int]))) x 0.15) + 1.35))
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • And - All (Conditions) are true
              • Conditions
                • (Level of Poisoned Weapon for Penetrating_Hit_Caster[Player_Number_Int]) Greater than 0
                • (Penetrating_Hit_Target[Player_Number_Int] is A structure) Not equal to True
          • Then - Actions
            • Set Penetrating_Hit_Point[Player_Number_Int] = (Position of Penetrating_Hit_Target[Player_Number_Int])
            • Unit - Create 1 Regular Dummy for (Owner of Penetrating_Hit_Caster[Player_Number_Int]) at Penetrating_Hit_Point[Player_Number_Int] facing Default building facing degrees
            • Unit - Add a 0.20 second Generic expiration timer to (Last created unit)
            • Unit - Add Poisoned Weapon dummy to (Last created unit)
            • Unit - Set level of Poisoned Weapon dummy for (Last created unit) to (Level of Poisoned Weapon for Penetrating_Hit_Caster[Player_Number_Int])
            • Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike Penetrating_Hit_Target[Player_Number_Int]
            • Custom script: call RemoveLocation(udg_Penetrating_Hit_Point[udg_Player_Number_Int])
          • Else - Actions
        • Unit - Cause Penetrating_Hit_Caster[Player_Number_Int] to damage Penetrating_Hit_Target[Player_Number_Int], dealing Penetrating_Hit_Damage[Player_Number_Int] damage of attack type Pierce and damage type Normal



    Here are some spell properties (maybe something's wrong with the spell...):
    http://prntscr.com/bh7ejr
    http://prntscr.com/bh7eph
    http://prntscr.com/bh7eu3
    http://prntscr.com/bh7ewx
    http://prntscr.com/bh7f63
     
  2. Alright

    Alright

    Joined:
    May 20, 2014
    Messages:
    230
    Resources:
    0
    Resources:
    0
  3. ZiGOR

    ZiGOR

    Joined:
    Mar 17, 2012
    Messages:
    577
    Resources:
    2
    Maps:
    2
    Resources:
    2
  4. Kino

    Kino

    Joined:
    Oct 12, 2008
    Messages:
    1,714
    Resources:
    19
    Models:
    5
    Maps:
    14
    Resources:
    19
  5. ZiGOR

    ZiGOR

    Joined:
    Mar 17, 2012
    Messages:
    577
    Resources:
    2
    Maps:
    2
    Resources:
    2
    Yeah... those Blizzards :ogre_hurrhurr: