• 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.

Please help checking my GUI

Status
Not open for further replies.
Level 5
Joined
Jan 3, 2008
Messages
164
Could someone please help me to see if the code below contains too many leaks and if you can please tell me how can they be corrected. Thanks in advance! :wink:

Warning, this code is an eye killer! lol

  • Electric Explosions lvl1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Electric Explosions
          • (Level of (Ability being cast) for (Casting unit)) Equal to 1
    • Actions
      • Set Chens_ability_tmppoint = (Target point of ability being cast)
      • Set Chens_ability_point[1] = (Chens_ability_tmppoint offset by (150.00, 0.00))
      • Set Chens_ability_point[2] = (Chens_ability_tmppoint offset by (100.00, 100.00))
      • Set Chens_ability_point[3] = (Chens_ability_tmppoint offset by (0.00, 150.00))
      • Set Chens_ability_point[4] = (Chens_ability_tmppoint offset by (-100.00, 100.00))
      • Set Chens_ability_point[5] = (Chens_ability_tmppoint offset by (-150.00, 0.00))
      • Set Chens_ability_point[6] = (Chens_ability_tmppoint offset by (-100.00, -100.00))
      • Set Chens_ability_point[7] = (Chens_ability_tmppoint offset by (0.00, -150.00))
      • Set Chens_ability_point[8] = (Chens_ability_tmppoint offset by (100.00, -100.00))
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect at Chens_ability_point[(Integer A)] using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
          • Set Chens_ability[(Integer A)] = (Last created special effect)
          • Set Chens_ability_unit_group[(Integer A)] = (Units within 200.00 of Chens_ability_point[(Integer A)] matching (((Matching unit) belongs to an ally of (Owner of (Casting unit))) Equal to False))
          • Unit Group - Pick every unit in Chens_ability_unit_group[(Integer A)] and do (Actions)
            • Loop - Actions
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 50.00)
          • Wait 0.26 seconds
          • Special Effect - Destroy Chens_ability[(Integer A)]
          • Custom script: call DestroyEffect(udg_Chens_ability[GetForLoopIndexA()])
          • Custom script: call DestroyGroup(udg_Chens_ability_unit_group[GetForLoopIndexA()])
          • Custom script: call RemoveLocation (udg_Chens_ability_point[GetForLoopIndexA()])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer A) Equal to 8
            • Then - Actions
              • Custom script: call RemoveLocation (udg_Chens_ability_tmppoint)
            • Else - Actions
              • Do nothing
Ok, I have used the code that Squiggy has suggested, but I have implemented some changes to it ^^ thanks guys.. I hope there aren't any more mistakes in the code..
 
Last edited:
Level 7
Joined
Jul 12, 2008
Messages
295
o_O trigger too long... Can't check all out... Thanks for the warning... Anyways use A unit starts the effects of an ability instead of begins casting an ability
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
I made it shorter lawlz
  • Something
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Random
    • Actions
      • Set tmppoint = Target point of ability being cast
      • Set Chens_ability_point[1] = (tmppoint offset by (150.00, 0.00))
      • Set Chens_ability_point[2] = (tmppoint offset by (100.00, 100.00))
      • Set Chens_ability_point[3] = (tmppoint offset by (0.00, 150.00))
      • Set Chens_ability_point[4] = (tmppoint offset by (-100.00, 100.00))
      • Set Chens_ability_point[5] = (tmppoint offset by (-150.00, 0.00))
      • Set Chens_ability_point[6] = (tmppoint offset by (-100.00, -100.00))
      • Set Chens_ability_point[7] = (tmppoint offset by (0.00, -150.00))
      • Set Chens_ability_point[8] = (tmppoint offset by (100.00, -100.00))
      • For each Integer A from 1 to 8 do:
        • Special Effect - Create a special effect at Chens_ability_point[Integer A] using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
        • Set Chens_ability[Integer A] = (Last created special effect)
        • Custom script: set bj_wantDestroyGroup = true
        • Unit Group - Pick every unit in (Units within 200.00 of Chens_ability_point[Integer A] matching (((Matching unit) belongs to an ally of (Owner of (Triggering Unit))) Equal to False)) and do (Actions)
          • Loop - Actions
            • If (((Picked unit) belongs to an ally of (Owner of (Triggering unit))) Equal to False) then do (Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 20.00)) else do (Do nothing)
        • Wait 0.26 seconds
        • Special Effect - Destroy Chens_ability[Integer A]
        • Custom script: call DestroyEffect(udg_Chens_ability[GetForLoopIndexA()])
      • Custom script: call RemoveLocation (udg_Chens_ability_point[1])
      • Custom script: call RemoveLocation (udg_Chens_ability_point[2])
      • Custom script: call RemoveLocation (udg_Chens_ability_point[3])
      • Custom script: call RemoveLocation (udg_Chens_ability_point[4])
      • Custom script: call RemoveLocation (udg_Chens_ability_point[5])
      • Custom script: call RemoveLocation (udg_Chens_ability_point[6])
      • Custom script: call RemoveLocation (udg_Chens_ability_point[7])
      • Custom script: call RemoveLocation (udg_Chens_ability_point[8])
      • Custom script: cal lRemoveLoaction (udg_tmppoint)
 
Last edited:
Status
Not open for further replies.
Top