• 🏆 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] Moving Illusions

Status
Not open for further replies.
Level 4
Joined
Aug 22, 2008
Messages
100
Ok so I am making a omnislash like ability but all of your current illusions will omnislash aswell. It works fine for the main hero but when I use the ability all of the illusions instantly dissapears.

Another problem I have is getting the casting unit to have no collision while flying around but thats not important at the moment.

(Dont bother telling me there is about a thousand leaks in this trigger, Il fix that later)

  • Spiraling Death Blossom
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Spiraling Death Blosom
    • Actions
      • Set SDBCaster[0] = (Triggering unit)
      • Special Effect - Create a special effect attached to the hand,left of SDBCaster[0] using Abilities\Spells\Human\Banish\BanishTarget.mdl
      • Set SDBSpecialEffect[1] = (Last created special effect)
      • Special Effect - Create a special effect attached to the hand,right of SDBCaster[0] using Abilities\Spells\Human\Banish\BanishTarget.mdl
      • Set SDBSpecialEffect[2] = (Last created special effect)
      • Unit - Add Death Blossom (Neutral Hostile) to SDBCaster[0]
      • Unit - Set level of Death Blossom (Neutral Hostile) for SDBCaster[0] to (Level of Spiraling Death Blosom for SDBCaster[0])
      • Set SDBCasterPoint[0] = (Position of SDBCaster[0])
      • Set SDBPoint[0] = (Position of (Target unit of ability being cast))
      • Set SDBAngle[0] = (Angle from SDBPoint[0] to SDBCasterPoint[0])
      • Unit - Turn collision for SDBCaster[0] Off
      • Unit - Move SDBCaster[0] instantly to (SDBPoint[0] offset by 100.00 towards SDBAngle[0] degrees), facing SDBPoint[0]
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Unit - Turn collision for AODIllussion[(Integer A)] Off
          • Set SDBAngle[(Integer A)] = (SDBAngle[(Integer A)] + (60.00 x (Real((Integer A)))))
          • Unit - Move AODIllussion[(Integer A)] instantly to (SDBPoint[(Integer A)] offset by 100.00 towards SDBAngle[(Integer A)] degrees), facing SDBPoint[0]
      • Wait 1.00 seconds
      • Trigger - Run SDBLoop <gen> (checking conditions)
      • Wait 1.00 seconds
      • Trigger - Run SDBLoop <gen> (checking conditions)
      • Wait 1.00 seconds
      • Trigger - Run SDBLoop <gen> (checking conditions)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Spiraling Death Blosom for SDBCaster[0]) Greater than or equal to 2
        • Then - Actions
          • Wait 1.00 seconds
          • Trigger - Run SDBLoop <gen> (checking conditions)
          • Wait 1.00 seconds
          • Trigger - Run SDBLoop <gen> (checking conditions)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Spiraling Death Blosom for SDBCaster[0]) Greater than or equal to 3
            • Then - Actions
              • Wait 1.00 seconds
              • Trigger - Run SDBLoop <gen> (checking conditions)
              • Wait 1.00 seconds
              • Trigger - Run SDBLoop <gen> (checking conditions)
            • Else - Actions
        • Else - Actions
      • Unit - Turn collision for AODIllussion[(Integer A)] On
      • Unit - Turn collision for SDBCaster[0] On
      • Unit - Remove Death Blossom (Neutral Hostile) from SDBCaster[0]
      • For each (Integer A) from 1 to 2, do (Actions)
        • Loop - Actions
          • Special Effect - Destroy SDBSpecialEffect[(Integer A)]
  • SDBLoop
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SDBCaster[0] is alive) Equal to True
        • Then - Actions
          • Set SDBCasterPoint[0] = (Position of SDBCaster[0])
          • Set SDBTarget[0] = (Random unit from (Units within 600.00 of (Position of SDBCaster[0]) matching (((Matching unit) belongs to an enemy of (Owner of SDBCaster[0])) Equal to True)))
          • Set SDBPoint[0] = (Position of SDBTarget[0])
          • Unit - Move SDBCaster[0] instantly to (SDBPoint[0] offset by 256.00 towards (Random angle) degrees), facing SDBPoint[0]
          • Unit - Order SDBCaster[0] to Attack SDBTarget[0]
        • Else - Actions
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (AODIllussion[(Integer A)] is alive) Equal to True
            • Then - Actions
              • Unit - Turn collision for AODIllussion[(Integer A)] Off
              • Set SDBCasterPoint[(Integer A)] = (Position of AODIllussion[(Integer A)])
              • Set SDBTarget[(Integer A)] = (Random unit from (Units within 600.00 of (Position of AODIllussion[(Integer A)]) matching (((Matching unit) belongs to an enemy of (Owner of SDBCaster[0])) Equal to True)))
              • Set SDBPoint[(Integer A)] = (Position of SDBTarget[(Integer A)])
              • Unit - Move AODIllussion[(Integer A)] instantly to (SDBPoint[(Integer A)] offset by 256.00 towards (Random angle) degrees), facing SDBPoint[(Integer A)]
              • Unit - Order SDBCaster[(Integer A)] to Attack SDBTarget[(Integer A)]
            • Else - Actions
The following abilities are working fine but maybe there is something here that is failing when the Omnislash is triggered.

  • Army of Darkness
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Army of Darkness for (Attacking unit)) Greater than 0
    • Actions
      • Set AODAttacker = (Attacking unit)
      • Set AODPoint = (Position of AODAttacker)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • AODLivingIllusions Less than (Level of Army of Darkness for AODAttacker)
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (AODAttacker is an illusion) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random integer number between 1 and 100) Less than or equal to 5
                • Then - Actions
                  • Trigger - Turn on AODIllusionAdder <gen>
                  • Unit - Create 1 AODDummy for (Owner of AODAttacker) at AODPoint facing Default building facing degrees
                  • Unit - Set level of AODIllusions for (Last created unit) to 1
                  • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                  • Custom script: call IssueTargetOrderById( GetLastCreatedUnit(), 852274, udg_AODAttacker )
                  • Unit - Order (Last created unit) to Human Priest - Inner Fire AODAttacker
                  • Wait 1.00 seconds
                  • Trigger - Turn off AODIllusionAdder <gen>
                • Else - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random integer number between 1 and 100) Less than or equal to 20
                • Then - Actions
                  • Trigger - Turn on AODIllusionAdder <gen>
                  • Unit - Create 1 AODDummy for (Owner of AODAttacker) at AODPoint facing Default building facing degrees
                  • Unit - Set level of AODIllusions for (Last created unit) to 1
                  • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                  • Custom script: call IssueTargetOrderById( GetLastCreatedUnit(), 852274, udg_AODAttacker )
                  • Unit - Order (Last created unit) to Human Priest - Inner Fire AODAttacker
                  • Wait 1.00 seconds
                  • Trigger - Turn off AODIllusionAdder <gen>
                • Else - Actions
        • Else - Actions
  • AODIllusionAdder
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • ((Summoned unit) is an illusion) Equal to True
    • Actions
      • Animation - Change (Summoned unit)'s vertex coloring to (10.00%, 10.00%, 10.00%) with 50.00% transparency
      • Animation - Change AODAttacker's vertex coloring to (10.00%, 10.00%, 10.00%) with 50.00% transparency
      • Set AODLivingIllusions = (AODLivingIllusions + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AODIllusionAlive[1] Equal to False
        • Then - Actions
          • Set AODIllussion[1] = (Summoned unit)
          • Set AODIllusionAlive[1] = True
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • AODIllusionAlive[2] Equal to False
            • Then - Actions
              • Set AODIllussion[2] = (Summoned unit)
              • Set AODIllusionAlive[2] = True
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • AODIllusionAlive[3] Equal to False
                • Then - Actions
                  • Set AODIllussion[3] = (Summoned unit)
                  • Set AODIllusionAlive[3] = True
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • AODIllusionAlive[4] Equal to False
                    • Then - Actions
                      • Set AODIllussion[4] = (Summoned unit)
                      • Set AODIllusionAlive[4] = True
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • AODIllusionAlive[5] Equal to False
                        • Then - Actions
                          • Set AODIllussion[5] = (Summoned unit)
                          • Set AODIllusionAlive[5] = True
                        • Else - Actions
  • AODIllusionRemover
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dying unit) Equal to AODIllussion[(Integer A)]
            • Then - Actions
              • Set AODLivingIllusions = (AODLivingIllusions - 1)
              • Set AODIllusionAlive[(Integer A)] = False
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AODLivingIllusions Equal to 0
        • Then - Actions
          • Animation - Change AODAttacker's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
        • Else - Actions
Ask me if you need more data.

Edit: After further investigating I found out that illusions created during the ability will use the ability (which was intended) but all of the illusions you have when activating the ability will still dissapear.

Edit2: I am so stupid... is there any way to remove a thread? I wasnt setting a point for the Illusions to move to :/ If there is no way to delete a thread you could entertain yourself with helping me with the collision problem.
 
Status
Not open for further replies.
Top