• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] MUI not working properly with this spell

Status
Not open for further replies.
Level 11
Joined
Jun 26, 2014
Messages
497
Spell idea: Channel spell - when channeled the hero shoots out projectiles at the direction of a target enemy, each projectile deals damage to all enemies on it's path once. Bullets also poison the enemies by giving them slowing aura ability.
Bugs so far:
1. When one hero stops casting the ability, the other heroes continue casting it but the bullets stop going out.
2. Sometimes the spell will work properly for one player, but for another player the bullets will not deal any damage at all.
Triggers:
  • Ratatatataaaa
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Ratatatataaaa!
    • Actions
      • Set tempPoint[0] = (Position of (Casting unit))
      • Set spRataIndex = (spRataIndex + 1)
      • Set spRataMui = (spRataMui + 1)
      • Set spRataCaster[spRataMui] = (Casting unit)
      • Set spRataTarget[spRataMui] = (Target unit of ability being cast)
      • Set spRataDummy[spRataMui] = (Last created unit)
      • Sound - Play Ratatataaa <gen> at 100.00% volume, located at tempPoint[0] with Z offset 0.00
      • Trigger - Turn on Ratatatataaaa Cast Loop <gen>
      • Custom script: call RemoveLocation(udg_tempPoint[0])
  • Ratatatataaaa Cast Loop
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to spRataMui, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((spRataCaster[(Integer A)] is alive) Equal to True) and ((spRataTarget[(Integer A)] is alive) Equal to True)
            • Then - Actions
              • Set tempPoint[0] = (Position of spRataCaster[(Integer A)])
              • Set tempPoint[1] = (Position of spRataTarget[(Integer A)])
              • Unit - Make spRataCaster[(Integer A)] face (Angle from tempPoint[0] to tempPoint[1]) over 0.10 seconds
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between tempPoint[0] and tempPoint[1]) Greater than or equal to 700.00
                • Then - Actions
                  • Unit - Order spRataCaster[(Integer A)] to Stop
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Mana of spRataCaster[(Integer A)]) Less than (3.00 x (Real((Level of Ratatatataaaa! for spRataCaster[(Integer A)]))))
                    • Then - Actions
                      • Unit - Order spRataCaster[(Integer A)] to Stop
                    • Else - Actions
                      • Set spRataBulletIndex = (spRataBulletIndex + 1)
                      • Set spRataBulletMui = (spRataBulletMui + 1)
                      • Unit - Create 1 Stinky Bullet for (Owner of spRataCaster[(Integer A)]) at tempPoint[0] facing tempPoint[1]
                      • Unit - Add a 0.60 second Generic expiration timer to (Last created unit)
                      • Set spRataDummy[spRataBulletMui] = (Last created unit)
                      • Set spRataBulletCaster[spRataBulletMui] = spRataCaster[(Integer A)]
                      • Set spRataDamage[spRataBulletMui] = ((1.00 x (Real((Agility of spRataBulletCaster[spRataBulletMui] (Include bonuses))))) + (5.00 + (10.00 x (Real((Level of Ratatatataaaa! for spRataBulletCaster[spRataBulletMui]))))))
                      • Set spRataGroup[spRataBulletMui] = (Units owned by Player 1 (Red))
                      • Unit Group - Remove all units from spRataGroup[(Integer A)]
                      • Unit - Set mana of spRataCaster[(Integer A)] to ((Mana of spRataCaster[(Integer A)]) - (3.00 x (Real((Level of Ratatatataaaa! for spRataCaster[(Integer A)])))))
                      • Trigger - Turn on Ratatatataaaa Bullet Loop <gen>
              • Custom script: call RemoveLocation(udg_tempPoint[1])
              • Custom script: call RemoveLocation(udg_tempPoint[0])
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • spRataCaster[(Integer A)] Not equal to No unit
                • Then - Actions
                  • Unit - Order spRataCaster[(Integer A)] to Stop
                  • Set spRataCaster[(Integer A)] = No unit
                  • Set spRataIndex = (spRataIndex - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • spRataIndex Less than or equal to 0
                    • Then - Actions
                      • Set spRataIndex = 0
                      • Set spRataMui = 0
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
  • Ratatatataaaa Bullet Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to spRataBulletMui, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (spRataDummy[(Integer A)] is alive) Equal to True
            • Then - Actions
              • Set tempPoint[0] = (Position of spRataDummy[(Integer A)])
              • Set tempPoint[1] = (tempPoint[0] offset by 40.00 towards (Facing of spRataDummy[(Integer A)]) degrees)
              • Unit - Move spRataDummy[(Integer A)] instantly to tempPoint[1]
              • Set tempGroup[0] = (Units within 60.00 of tempPoint[1] matching ((((Matching unit) belongs to an enemy of (Owner of spRataDummy[(Integer A)])) Equal to True) and (((Matching unit) is alive) Equal to True)))
              • Unit Group - Pick every unit in tempGroup[0] and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is in spRataGroup[(Integer A)]) Equal to True
                    • Then - Actions
                    • Else - Actions
                      • Unit - Cause spRataBulletCaster[(Integer A)] to damage (Picked unit), dealing (0.20 x spRataDamage[(Integer A)]) damage of attack type Hero and damage type Normal
                      • Unit Group - Add (Picked unit) to spRataGroup[(Integer A)]
                      • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\Rifle\RifleImpact.mdl
                      • Special Effect - Destroy (Last created special effect)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (((Picked unit) is alive) Equal to True) and (((Picked unit) is in spSSgroup) Equal to False)
                    • Then - Actions
                      • Unit - Add Stinky's Secret Decoction (Slow) to (Picked unit)
                      • Unit Group - Add (Picked unit) to spSSgroup
                      • Trigger - Turn on Stinkys Special Buff Loop <gen>
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ((Picked unit) is alive) Equal to True
                        • Then - Actions
                          • Unit - Set level of Stinky's Secret Decoction (Slow) for (Picked unit) to 1
                        • Else - Actions
                          • Unit - Remove Stinky's Secret Decoction (Slow) from (Picked unit)
                          • Unit - Remove Stinky's Secret Decoction buff from (Picked unit)
                          • Unit Group - Remove (Picked unit) from spSSgroup
              • Custom script: call DestroyGroup(udg_tempGroup[0])
              • Custom script: call RemoveLocation(udg_tempPoint[1])
              • Custom script: call RemoveLocation(udg_tempPoint[0])
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • spRataDummy[(Integer A)] Not equal to No unit
                • Then - Actions
                  • Set spRataDummy[(Integer A)] = No unit
                  • Set spRataBulletIndex = (spRataBulletIndex - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • spRataBulletIndex Less than or equal to 0
                    • Then - Actions
                      • Set spRataBulletIndex = 0
                      • Set spRataBulletMui = 0
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
  • Ratatatataaaa Stop
    • Events
      • Unit - A unit Stops casting an ability
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Ratatatataaaa!
    • Actions
      • For each (Integer A) from 1 to spRataMui, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) Equal to spRataCaster[(Integer A)]) and (spRataCaster[(Integer A)] Not equal to No unit)
            • Then - Actions
              • Set spRataCaster[(Integer A)] = No unit
              • Set spRataIndex = (spRataIndex - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • spRataIndex Less than or equal to 0
                • Then - Actions
                  • Set spRataIndex = 0
                  • Set spRataMui = 0
                  • Trigger - Turn off Ratatatataaaa Cast Loop <gen>
                • Else - Actions
            • Else - Actions
 
Status
Not open for further replies.
Top