• 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] Is my triggers good enoth?

Status
Not open for further replies.
Level 9
Joined
May 27, 2012
Messages
116
Well im not realy the best mapper in the world and i just wanna know how bad my triggers is.

  • FireBall Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to FireBall
    • Actions
      • Set FB_Max_Index = (FB_Max_Index + 1)
      • Set FB_Caster[FB_Max_Index] = (Triggering unit)
      • Set TempPoint[1] = (Position of FB_Caster[FB_Max_Index])
      • Set TempPoint[2] = (Target point of ability being cast)
      • Set FB_DMG[FB_Max_Index] = (4.00 x (Real((Intelligence of (Triggering unit) (Include bonuses)))))
      • Set FB_Range[FB_Max_Index] = (Distance between TempPoint[1] and TempPoint[2])
      • Set FB_Angel[FB_Max_Index] = (Angle from TempPoint[1] to TempPoint[2])
      • Set FB_Speed[FB_Max_Index] = 45.00
      • Unit - Create 1 Dummy_FireBall for Neutral Passive at TempPoint[1] facing FB_Angel[FB_Max_Index] degrees
      • Animation - Change FB_Ball[FB_Max_Index]'s animation speed to 300.00% of its original speed
      • Set FB_Ball[FB_Max_Index] = (Last created unit)
      • Unit - Turn collision for FB_Ball[FB_Max_Index] Off
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • FB_Max_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on FireBall Loop <gen>
        • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint[1])
      • Custom script: call RemoveLocation (udg_TempPoint[2])
  • IceBolt Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ice Bolt
    • Actions
      • Set FB_Max_Index = (FB_Max_Index + 1)
      • Set FB_Caster[FB_Max_Index] = (Triggering unit)
      • Set TempPoint[1] = (Position of FB_Caster[FB_Max_Index])
      • Set TempPoint[2] = (Target point of ability being cast)
      • Set FB_DMG[FB_Max_Index] = (4.00 x (Real((Intelligence of (Triggering unit) (Include bonuses)))))
      • Set FB_Range[FB_Max_Index] = (Distance between TempPoint[1] and TempPoint[2])
      • Set FB_Angel[FB_Max_Index] = (Angle from TempPoint[1] to TempPoint[2])
      • Set FB_Speed[FB_Max_Index] = 45.00
      • Unit - Create 1 Dummy_IceBolt for Neutral Passive at TempPoint[1] facing FB_Angel[FB_Max_Index] degrees
      • Animation - Change FB_Ball[FB_Max_Index]'s animation speed to 300.00% of its original speed
      • Set FB_Ball[FB_Max_Index] = (Last created unit)
      • Unit - Turn collision for FB_Ball[FB_Max_Index] Off
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • FB_Max_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on FireBall Loop <gen>
        • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint[1])
      • Custom script: call RemoveLocation (udg_TempPoint[2])
  • FireBall Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer FB_Index) from 1 to FB_Max_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • FB_Range[FB_Index] Greater than 0.00
            • Then - Actions
              • Set TempPoint[1] = (Position of FB_Ball[FB_Index])
              • Set TempUG[1] = (Units within 70.00 of TempPoint[1] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of FB_Caster[FB_Index])) Equal to True)))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in TempUG[1]) Greater than or equal to 1
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of FB_Ball[FB_Index]) Equal to Dummy_FireBall
                    • Then - Actions
                      • Special Effect - Create a special effect at TempPoint[1] using war3mapImported\FireGroundExplo.mdx
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of FB_Ball[FB_Index]) Equal to Dummy_IceBolt
                    • Then - Actions
                      • Special Effect - Create a special effect at TempPoint[1] using Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
                  • Set TempUG[2] = (Units within 200.00 of TempPoint[1] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of FB_Caster[FB_Index])) Equal to True)))
                  • Unit Group - Pick every unit in TempUG[2] and do (Actions)
                    • Loop - Actions
                      • Unit - Cause FB_Caster[FB_Index] to damage (Picked unit), dealing FB_DMG[FB_Index] damage of attack type Spells and damage type Fire
                  • Custom script: call DestroyGroup (udg_TempUG[2])
                  • -------- DeIndex --------
                  • Unit - Kill FB_Ball[FB_Index]
                  • Set FB_Angel[FB_Index] = FB_Angel[FB_Max_Index]
                  • Set FB_Angel[FB_Max_Index] = 0.00
                  • Set FB_Ball[FB_Index] = FB_Ball[FB_Max_Index]
                  • Set FB_Ball[FB_Max_Index] = No unit
                  • Set FB_Caster[FB_Index] = FB_Caster[FB_Max_Index]
                  • Set FB_Caster[FB_Max_Index] = No unit
                  • Set FB_DMG[FB_Index] = FB_DMG[FB_Max_Index]
                  • Set FB_DMG[FB_Max_Index] = 0.00
                  • Set FB_Range[FB_Index] = FB_Range[FB_Max_Index]
                  • Set FB_Range[FB_Max_Index] = 0.00
                  • Set FB_Speed[FB_Index] = FB_Speed[FB_Max_Index]
                  • Set FB_Speed[FB_Max_Index] = 0.00
                  • Set FB_Max_Index = (FB_Max_Index - 1)
                  • Set FB_Index = (FB_Index - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • FB_Max_Index Equal to 0
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
                  • Set FB_Range[FB_Index] = (FB_Range[FB_Index] - FB_Speed[FB_Index])
                  • Set TempPoint[2] = (TempPoint[1] offset by FB_Speed[FB_Index] towards FB_Angel[FB_Index] degrees)
                  • Unit - Move FB_Ball[FB_Index] instantly to TempPoint[2]
                  • Custom script: call RemoveLocation (udg_TempPoint[2])
              • Custom script: call DestroyGroup (udg_TempUG[1])
              • Custom script: call RemoveLocation (udg_TempPoint[1])
            • Else - Actions
              • Set TempPoint[1] = (Position of FB_Ball[FB_Index])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of FB_Ball[FB_Index]) Equal to Dummy_FireBall
                • Then - Actions
                  • Special Effect - Create a special effect at TempPoint[1] using war3mapImported\FireGroundExplo.mdx
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of FB_Ball[FB_Index]) Equal to Dummy_IceBolt
                • Then - Actions
                  • Special Effect - Create a special effect at TempPoint[1] using Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
              • Set TempUG[2] = (Units within 200.00 of TempPoint[1] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of FB_Caster[FB_Index])) Equal to True)))
              • Unit Group - Pick every unit in TempUG[2] and do (Actions)
                • Loop - Actions
                  • Unit - Cause FB_Caster[FB_Index] to damage (Picked unit), dealing FB_DMG[FB_Index] damage of attack type Spells and damage type Fire
              • Custom script: call DestroyGroup (udg_TempUG[2])
              • Custom script: call RemoveLocation (udg_TempPoint[1])
              • -------- DeIndex --------
              • Unit - Kill FB_Ball[FB_Index]
              • Set FB_Angel[FB_Index] = FB_Angel[FB_Max_Index]
              • Set FB_Angel[FB_Max_Index] = 0.00
              • Set FB_Ball[FB_Index] = FB_Ball[FB_Max_Index]
              • Set FB_Ball[FB_Max_Index] = No unit
              • Set FB_Caster[FB_Index] = FB_Caster[FB_Max_Index]
              • Set FB_Caster[FB_Max_Index] = No unit
              • Set FB_DMG[FB_Index] = FB_DMG[FB_Max_Index]
              • Set FB_DMG[FB_Max_Index] = 0.00
              • Set FB_Range[FB_Index] = FB_Range[FB_Max_Index]
              • Set FB_Range[FB_Max_Index] = 0.00
              • Set FB_Speed[FB_Index] = FB_Speed[FB_Max_Index]
              • Set FB_Speed[FB_Max_Index] = 0.00
              • Set FB_Max_Index = (FB_Max_Index - 1)
              • Set FB_Index = (FB_Index - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • FB_Max_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
  • Gravity Bolt
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sonic Bolt
    • Actions
      • Set GB_Index_Max = (GB_Index_Max + 1)
      • Set TempPoint[1] = (Position of (Triggering unit))
      • Set TempPoint[2] = (Target point of ability being cast)
      • Set GB_Caster[GB_Index_Max] = (Triggering unit)
      • Set GB_Dmg[GB_Index_Max] = (2.00 x (Real((Intelligence of (Triggering unit) (Include bonuses)))))
      • Set GB_Range[GB_Index_Max] = 800.00
      • Set GB_Angel[GB_Index_Max] = (Angle from TempPoint[1] to TempPoint[2])
      • Unit - Create 1 Dummy_GravityBolt for Neutral Passive at TempPoint[1] facing GB_Angel[GB_Index_Max] degrees
      • Unit - Turn collision for GB_Bolt[GB_Index_Max] Off
      • Set GB_Bolt[GB_Index_Max] = (Last created unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GB_Index_Max Equal to 1
        • Then - Actions
          • Trigger - Turn on Gravity Bolt Loop <gen>
        • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint[1])
      • Custom script: call RemoveLocation (udg_TempPoint[2])
  • Gravity Bolt Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer GB_Index) from 1 to GB_Index_Max, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • GB_Range[GB_Index] Greater than 0.00
            • Then - Actions
              • Set TempPoint[1] = (Position of GB_Bolt[GB_Index])
              • Set TempUG[1] = (Units within 70.00 of TempPoint[1] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of GB_Caster[GB_Index])) Equal to True)))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in TempUG[1]) Greater than or equal to 1
                • Then - Actions
                  • Set TempPoint[1] = (Position of GB_Bolt[GB_Index])
                  • Special Effect - Create a special effect at TempPoint[1] using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Set TempUG[2] = (Units within 200.00 of TempPoint[1] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of GB_Caster[GB_Index])) Equal to True)))
                  • Unit Group - Pick every unit in TempUG[2] and do (Actions)
                    • Loop - Actions
                      • Unit - Cause GB_Caster[GB_Index] to damage (Picked unit), dealing GB_Dmg[GB_Index] damage of attack type Spells and damage type Sonic
                      • -------- KB --------
                      • -------- ------------------------- --------
                      • Set CKBS_NewSFX = Abilities\Spells\Other\GeneralAuraTarget\GeneralAuraTarget.mdl
                      • Set CKBS_NewAngle = GB_Angel[GB_Index]
                      • Set CKBS_NewSpeed = 50.00
                      • Set CKBS_NewUnit = (Picked unit)
                      • Set CKBS_NewVerticalSpeed = 15.00
                      • Set CKBS_NewDestroyTrees = True
                      • Set CKBS_NewCollides = False
                      • Set CKBS_NewTransferKnockback = True
                      • Trigger - Run CKBS New <gen> (ignoring conditions)
                      • -------- ------------------------- --------
                  • Custom script: call RemoveLocation (udg_TempPoint[1])
                  • Custom script: call DestroyGroup (udg_TempUG[2])
                  • -------- DeIndex --------
                  • Unit - Kill GB_Bolt[GB_Index]
                  • Set GB_Angel[GB_Index] = GB_Angel[GB_Index_Max]
                  • Set GB_Angel[GB_Index_Max] = 0.00
                  • Set GB_Bolt[GB_Index] = GB_Bolt[GB_Index_Max]
                  • Set GB_Bolt[GB_Index_Max] = No unit
                  • Set GB_Caster[GB_Index] = GB_Caster[GB_Index_Max]
                  • Set GB_Caster[GB_Index_Max] = No unit
                  • Set GB_Dmg[GB_Index] = GB_Dmg[GB_Index_Max]
                  • Set GB_Dmg[GB_Index_Max] = 0.00
                  • Set GB_Range[GB_Index] = GB_Range[GB_Index_Max]
                  • Set GB_Range[GB_Index_Max] = 0.00
                  • Set GB_Index_Max = (GB_Index_Max - 1)
                  • Set GB_Index = (GB_Index - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • GB_Index_Max Equal to 0
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
                  • Set GB_Range[GB_Index] = (GB_Range[GB_Index] - 80.00)
                  • Set TempPoint[3] = (TempPoint[1] offset by 80.00 towards GB_Angel[GB_Index] degrees)
                  • Unit - Move GB_Bolt[GB_Index] instantly to TempPoint[3]
                  • Special Effect - Create a special effect at TempPoint[3] using Abilities\Spells\Orc\Purge\PurgeBuffTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Custom script: call RemoveLocation (udg_TempPoint[3])
              • Custom script: call DestroyGroup (udg_TempUG[1])
              • Custom script: call RemoveLocation (udg_TempPoint[1])
            • Else - Actions
              • Unit - Kill GB_Bolt[GB_Index]
              • -------- DeIndex --------
              • Set GB_Angel[GB_Index] = GB_Angel[GB_Index_Max]
              • Set GB_Angel[GB_Index_Max] = 0.00
              • Set GB_Bolt[GB_Index] = GB_Bolt[GB_Index_Max]
              • Set GB_Bolt[GB_Index_Max] = No unit
              • Set GB_Caster[GB_Index] = GB_Caster[GB_Index_Max]
              • Set GB_Caster[GB_Index_Max] = No unit
              • Set GB_Dmg[GB_Index] = GB_Dmg[GB_Index_Max]
              • Set GB_Dmg[GB_Index_Max] = 0.00
              • Set GB_Range[GB_Index] = GB_Range[GB_Index_Max]
              • Set GB_Range[GB_Index_Max] = 0.00
              • Set GB_Index_Max = (GB_Index_Max - 1)
              • Set GB_Index = (GB_Index - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • GB_Index_Max Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
  • DeepFreeze Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Deep Freeze
    • Actions
      • Set A_DF_Index_Max = (A_DF_Index_Max + 1)
      • Set A_DF_Caster[A_DF_Index_Max] = (Triggering unit)
      • Set A_DF_Time[A_DF_Index_Max] = 5.00
      • Set A_DF_Dmg[A_DF_Index_Max] = (0.03 x (Real((Intelligence of A_DF_Caster[A_DF_Index_Max] (Include bonuses)))))
      • Set A_DF_FU[A_DF_Index_Max] = (Units within 200.00 of TempPoint[1] matching (((Matching unit) is alive) Equal to True))
      • Set TempPoint[1] = (Target point of ability being cast)
      • Unit - Create 1 Dummy_Ice for Neutral Passive at TempPoint[1] facing (Random angle) degrees
      • Set A_DF_Dummy[A_DF_Index_Max] = (Last created unit)
      • Unit - Turn collision for A_DF_Dummy[A_DF_Index_Max] Off
      • Unit - Move A_DF_Dummy[A_DF_Index_Max] instantly to TempPoint[1]
      • Sound - Play DeepFreezSound <gen> at 100.00% volume, located at TempPoint[1] with Z offset 0.00
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • A_DF_Index_Max Equal to 1
        • Then - Actions
          • Trigger - Turn on DeepFreeze Loop <gen>
        • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint[1])
  • DeepFreeze Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A_DF_Index) from 1 to A_DF_Index_Max, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • A_DF_Time[A_DF_Index] Greater than 0.00
            • Then - Actions
              • Set A_DF_Time[A_DF_Index] = (A_DF_Time[A_DF_Index] - 0.03)
              • Set TempPoint[1] = (Position of A_DF_Dummy[A_DF_Index])
              • Set TempUG[1] = (Units within 200.00 of TempPoint[1] matching (((Matching unit) is alive) Equal to True))
              • Unit Group - Pick every unit in TempUG[1] and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is in A_DF_FU[A_DF_Index]) Equal to False
                    • Then - Actions
                      • Unit - Pause (Picked unit)
                      • Animation - Change (Picked unit)'s animation speed to 0.00% of its original speed
                      • Unit Group - Add (Picked unit) to A_DF_FU[A_DF_Index]
                    • Else - Actions
              • Unit Group - Pick every unit in A_DF_FU[A_DF_Index] and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is in TempUG[1]) Equal to True
                    • Then - Actions
                      • Unit - Cause A_DF_Caster[A_DF_Index] to damage (Picked unit), dealing A_DF_Dmg[A_DF_Index] damage of attack type Spells and damage type Cold
                    • Else - Actions
                      • Unit Group - Remove (Picked unit) from A_DF_FU[A_DF_Index]
                      • Unit - Unpause (Picked unit)
                      • Animation - Change (Picked unit)'s animation speed to 100.00% of its original speed
              • Custom script: call DestroyGroup (udg_TempUG[1])
              • Custom script: call RemoveLocation (udg_TempPoint[1])
            • Else - Actions
              • Unit - Kill A_DF_Dummy[A_DF_Index]
              • Unit Group - Pick every unit in A_DF_FU[A_DF_Index] and do (Actions)
                • Loop - Actions
                  • Unit Group - Remove (Picked unit) from A_DF_FU[A_DF_Index]
                  • Unit - Unpause (Picked unit)
                  • Animation - Change (Picked unit)'s animation speed to 100.00% of its original speed
              • Unit Group - Remove all units from A_DF_FU[A_DF_Index_Max]
              • Unit Group - Add all units of A_DF_FU[A_DF_Index_Max] to A_DF_FU[A_DF_Index]
              • Custom script: call DestroyGroup (udg_A_DF_FU[udg_A_DF_Index_Max])
              • Set A_DF_Caster[A_DF_Index] = A_DF_Caster[A_DF_Index_Max]
              • Set A_DF_Caster[A_DF_Index_Max] = No unit
              • Set A_DF_Dmg[A_DF_Index] = A_DF_Dmg[A_DF_Index_Max]
              • Set A_DF_Dmg[A_DF_Index_Max] = 0.00
              • Set A_DF_Dummy[A_DF_Index] = A_DF_Dummy[A_DF_Index_Max]
              • Set A_DF_Dummy[A_DF_Index_Max] = No unit
              • Set A_DF_Time[A_DF_Index] = A_DF_Time[A_DF_Index_Max]
              • Set A_DF_Time[A_DF_Index_Max] = 0.00
              • Set A_DF_Index_Max = (A_DF_Index_Max - 1)
              • Set A_DF_Index = (A_DF_Index - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • A_DF_Index_Max Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
Yes i do use a knockback system.
No wont make a attached map ^^.
Dont want to make it that easy to steal my spells.
 
No wont make a attached map ^^.
Dont want to make it that easy to steal my spells.
Still easy nonetheless.

Fireball:

Add Special Effect to the indexing so you wouldn't have to check what type of dummy and so you can use any dummy for that.

Also
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
    • (Number of units in TempUG[1]) Greater than or equal to 1
  • Then - Actions
  • Else - Actions
    • Set FB_Range[FB_Index] = (FB_Range[FB_Index] - FB_Speed[FB_Index])
    • Set TempPoint[2] = (TempPoint[1] offset by FB_Speed[FB_Index] towards FB_Angel[FB_Index] degrees)
    • Unit - Move FB_Ball[FB_Index] instantly to TempPoint[2]
    • Custom script: call RemoveLocation (udg_TempPoint[2])
Remove the actions in the 'Then'. Replace them all with two lines:
Set FB_Range[FB_Index] = 0
Set FB_Index = FB_Index - 1

^So of course, the spell ends without needing all those lines.
 
Status
Not open for further replies.
Top