• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Spell] Remove My Leaks

Status
Not open for further replies.
Level 4
Joined
Mar 24, 2012
Messages
24

Help!!! Please show me how do I make my trigger from making my map so lag as this spell trigger is executed more often!! Maybe my spell trigger leaks somewhere in it...

Ok, this is the casting trigger (initiator)...

  • Shocking Hell cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shocking Hell
    • Actions
      • Set A_Count = (A_Count + 1)
      • Set A_Integer = (A_Integer + 1)
      • Set A_Loop = (A_Loop + 1)
      • Set A_Counted[A_Loop] = 0
      • Set A_CU[A_Loop] = (Casting unit)
      • Set A_CUO[A_Loop] = (Owner of A_CU[A_Loop])
      • Set A_MLevel[A_Loop] = (Level of (Ability being cast) for A_CU[A_Loop])
      • Set A_ImpactDamage[A_Loop] = (200.00 + (50.00 x (Real(A_MLevel[A_Loop]))))
      • Set Real = (800.00 + (400.00 x (Real(A_MLevel[A_Loop]))))
      • Set A_ImpactCountdown[A_Loop] = 1.00
      • Set A_TravelCountdown[A_Loop] = (A_ImpactCountdown[A_Loop] + (Real / 350.00))
      • Set A_MissileSpeed[A_Loop] = (350.00 x 0.03)
      • Set P = (Target point of ability being cast)
      • Set A_Angle[A_Loop] = (Angle from (Position of A_CU[A_Loop]) to P)
      • Unit - Create 1 Dummy (shocking hell) for A_CUO[A_Loop] at (P offset by -350.00 towards A_Angle[A_Loop] degrees) facing A_Angle[A_Loop] degrees
      • Animation - Change (Last created unit) flying height to 25.00 at 1000.00
      • Set A_DummyMissile[A_Loop] = (Last created unit)
      • Set A_ImpactCheck[A_Loop] = 0
      • Set A_AlreadyChecked[A_Loop] = 0
      • Set Real = (Real / 10.00)
      • Set A_DPS[A_Loop] = (Real x 0.03)
      • Custom script: call RemoveLocation (udg_P)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Shocking Hell loop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Shocking Hell loop <gen>
        • Else - Actions
          • Do nothing
and now this is the looping trigger...

  • Shocking Hell loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A_Integer) from 1 to A_Loop, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • A_Counted[A_Integer] Equal to 0
            • Then - Actions
              • Set P = ((Position of A_DummyMissile[A_Integer]) offset by A_MissileSpeed[A_Integer] towards A_Angle[A_Integer] degrees)
              • Unit - Move A_DummyMissile[A_Integer] instantly to P
              • Custom script: call RemoveLocation (udg_P)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • A_ImpactCountdown[A_Integer] Less than or equal to 0.00
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • A_ImpactCheck[A_Integer] Equal to 0
                    • Then - Actions
                      • Set A_ImpactCheck[A_Integer] = 1
                      • Trigger - Run Shocking Hell loop 2 <gen> (checking conditions)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • A_TravelCountdown[A_Integer] Greater than 0.00
                        • Then - Actions
                          • Set P = (Position of A_DummyMissile[A_Integer])
                          • Set A_HitGroup[A_Integer] = (Units within 300.00 of P matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of A_CUO[A_Integer]) Equal to True))))
                          • Unit Group - Pick every unit in A_HitGroup[A_Integer] and do (Unit - Cause A_CU[A_Integer] to damage (Picked unit), dealing A_DPS[A_Integer] damage of attack type Hero and damage type Magic)
                          • Custom script: call RemoveLocation (udg_P)
                          • Custom script: call DestroyGroup (udg_A_HitGroup[udg_A_Integer])
                        • Else - Actions
                          • Set A_Counted[A_Integer] = 1
                          • Set A_Count = (A_Count - 1)
                          • Unit - Add a 0.10 second Water Elemental expiration timer to A_DummyMissile[A_Integer]
                          • Custom script: set udg_A_DummyMissile[udg_A_Integer] = null
                          • Custom script: set udg_A_HitGroup[udg_A_Integer] = null
                          • Custom script: set udg_A_CU[udg_A_Integer] = null
                          • Custom script: set udg_A_CUO[udg_A_Integer] = null
                • Else - Actions
                  • Do nothing
              • Set A_ImpactCountdown[A_Integer] = (A_ImpactCountdown[A_Integer] - 0.03)
              • Set A_TravelCountdown[A_Integer] = (A_TravelCountdown[A_Integer] - 0.03)
              • Game - Display to (All players) for 0.03 seconds the text: (|cffffcc00 + (String(A_ImpactCountdown[A_Integer])))
              • Game - Display to (All players) for 0.03 seconds the text: (|cff00ff00 + (String(A_TravelCountdown[A_Integer])))
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • A_Count Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                  • Set A_Count = 0
                  • Set A_Integer = 0
                  • Set A_Loop = 0
                • Else - Actions
                  • Do nothing
Help!!!!! :goblin_boom: :thumbs_down:
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Position of... leaks
  • Set A_Angle[A_Loop] = (Angle from (Position of A_CU[A_Loop]) to P)
The offset point leaks
  • Unit - Create 1 Dummy (shocking hell) for A_CUO[A_Loop] at (P offset by -350.00 towards A_Angle[A_Loop] degrees) facing...
Position of... leaks
  • Set P = ((Position of A_DummyMissile[A_Integer]) offset by...
You can remove the Do nothing actions
 
Level 4
Joined
Mar 24, 2012
Messages
24
Okay....
But i'm still a Worldedit rookie, so my questions are:

1. In the A_Angle variable, should I put a "P"(Point) for position of casting unit and another "P2"(Point) for target point of ability being cast?
2. Wat exactly happen if i put "Do Nothing" and didn't put "Do Nothing"

:goblin_cry::gg:
 
Status
Not open for further replies.
Top