• 🏆 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!

[Solved] Help with Triple-Linked Crane Wings

Status
Not open for further replies.
Level 7
Joined
Apr 18, 2010
Messages
102
Hi, there seems to be a problem with the 2nd Cast of this Ability. When 2 Units cast it the same time, one of them doesnt move and attack his corresponding target. The spell tooltip is kinda like this: Caster throws swords to target direction, when it hits a target, the caster is then able to cast the 2nd stage of this ability which makes him rush to that target and attack it.

Here are the triggers:

Crane Wings Throw
  • Crane Wings Throw
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Crane Wings
    • Actions
      • -------- Indexing Start --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CW1_MUI_1 Equal to 0
        • Then - Actions
          • -------- If there are currently no instances running, we turn on the loop. --------
          • Trigger - Turn on Crane Wings Throw Loop <gen>
        • Else - Actions
      • -------- Increases the indexes --------
      • Set CW1_MUI_1 = (CW1_MUI_1 + 1)
      • -------- Start of Dynamic Indexing --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CW1_MUI_1 Greater than CW1_Max_Index
        • Then - Actions
          • -------- Indexing ~ ~ --------
          • Set CW1_MUI_2[CW1_MUI_1] = CW1_MUI_1
          • Set CW1_Max_Index = CW1_MUI_1
        • Else - Actions
      • -------- End of Dynamic Indexing --------
      • -------- Makes it easier and cleaner. --------
      • Set Temp = CW1_MUI_2[CW1_MUI_1]
      • -------- The MUI boolean --------
      • -------- Setting Caster --------
      • Set CW1_Caster[Temp] = (Triggering unit)
      • -------- Setting Player --------
      • Set CW1_Player[Temp] = (Owner of CW1_Caster[Temp])
      • -------- * * *Here you can change the Distance* * * --------
      • Set CW1_Distance = 500.00
      • -------- * * *Here you can change the Damage* * * --------
      • Set CW1_Damage[Temp] = (1.00 x (Real((Agility of CW1_Caster[Temp] (Include bonuses)))))
      • -------- Setting the Boolean False --------
      • Set CW1_Boolean[Temp] = False
      • -------- Setting Speed --------
      • Set CW1_Speed = (CW1_Distance / 16.00)
      • -------- Setting Traveled Distance --------
      • Set CW1_Traveled[Temp] = 0.00
      • -------- Setting Caster Location --------
      • Set CasterLoc = (Position of CW1_Caster[Temp])
      • -------- Setting Target Location --------
      • Set TargetLoc = (Target point of ability being cast)
      • -------- Setting Angle --------
      • Set CW1_Angle[Temp] = (Angle from CasterLoc to TargetLoc)
      • -------- Setting Dummy Location --------
      • Set DummyLoc = (CasterLoc offset by 25.00 towards CW1_Angle[Temp] degrees)
      • -------- Creating Dummy --------
      • Unit - Create 1 Crane Wings Dummy for CW1_Player[Temp] at DummyLoc facing CW1_Angle[Temp] degrees
      • Animation - Play (Last created unit)'s Spell Channel Two animation
      • -------- Setting Dummy --------
      • Set CW1_Dummy[Temp] = (Last created unit)
      • -------- * * *Here you can change the Animation speed of the Swords* * * --------
      • Animation - Change CW1_Dummy[Temp]'s animation speed to 175.00% of its original speed
      • -------- Creating Eye Candy for Swords --------
      • Special Effect - Create a special effect attached to the left hand of CW1_Dummy[Temp] using Abilities\Weapons\PhoenixMissile\Phoenix_Missile_mini.mdl
      • Set CW1_EyeCandy1[Temp] = (Last created special effect)
      • Special Effect - Create a special effect attached to the right hand of CW1_Dummy[Temp] using Abilities\Spells\Undead\AbsorbMana\AbsorbManaBirthMissile.mdl
      • Set CW1_EyeCandy2[Temp] = (Last created special effect)
      • -------- Removing Leaks --------
      • Custom script: call RemoveLocation(udg_CasterLoc)
      • Custom script: call RemoveLocation(udg_TargetLoc)
      • Custom script: call RemoveLocation(udg_DummyLoc)
Crane Wings Throw Loop
  • Crane Wings Throw Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer CW1_MUI_3) from 1 to CW1_MUI_1, do (Actions)
        • Loop - Actions
          • -------- Makes it easier to read and cleaner --------
          • Set Temp = CW1_MUI_2[CW1_MUI_3]
          • -------- Checks if Swords have reached max range --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CW1_Traveled[Temp] Less than CW1_Distance
            • Then - Actions
              • -------- Setting Locations --------
              • Set CasterLoc = (Position of CW1_Dummy[Temp])
              • Set TargetLoc = (CasterLoc offset by CW1_Speed towards CW1_Angle[Temp] degrees)
              • -------- Moving Swords --------
              • Unit - Move CW1_Dummy[Temp] instantly to TargetLoc
              • -------- Setting Traveled Distance --------
              • Set CW1_Traveled[Temp] = (CW1_Traveled[Temp] + CW1_Speed)
              • -------- Setting Target Group --------
              • Set Target_Group = (Units within (CW1_Speed x 2.00) of CasterLoc matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of CW1_Player[Temp]) Equal to True)))
              • -------- Checks if there are targets available --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in Target_Group) Greater than 0
                • Then - Actions
                  • -------- Setting Target --------
                  • Set CW1_Target[Temp] = (Random unit from Target_Group)
                  • -------- Damaging Target --------
                  • Unit - Cause CW1_Caster[Temp] to damage CW1_Target[Temp], dealing CW1_Damage[Temp] damage of attack type Spells and damage type Normal
                  • -------- Eye Candy --------
                  • Special Effect - Create a special effect attached to the chest of CW1_Target[Temp] using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • -------- Setting Traveled Distance to Max --------
                  • Set CW1_Traveled[Temp] = CW1_Distance
                  • -------- Hiding Crane Wings Throw from Caster --------
                  • Unit - Set level of Crane Wings for CW1_Caster[Temp] to 2
                  • -------- Adding Crane Wings Charge to Caster --------
                  • Unit - Add Crane Wings 2 to CW1_Caster[Temp]
                  • -------- * * *Here you can Set the Duration of the Next Ability* * * --------
                  • Set CW1_SkillDuration[Temp] = 1.00
                • Else - Actions
              • -------- Removing Leaks --------
              • Custom script: call RemoveLocation(udg_CasterLoc)
              • Custom script: call RemoveLocation(udg_TargetLoc)
              • Custom script: call DestroyGroup(udg_Target_Group)
            • Else - Actions
              • -------- Destroying Sword Eye Candies --------
              • Special Effect - Destroy CW1_EyeCandy1[Temp]
              • Special Effect - Destroy CW1_EyeCandy2[Temp]
              • -------- Removing the Swords --------
              • Unit - Add a 0.20 second Generic expiration timer to CW1_Dummy[Temp]
              • Animation - Change CW1_Dummy[Temp]'s animation speed to 0.00% of its original speed
              • -------- Checks if there is a target --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CW1_SkillDuration[Temp] Greater than 0.00
                • Then - Actions
                  • Set CW1_SkillDuration[Temp] = (CW1_SkillDuration[Temp] - 0.03)
                • Else - Actions
                  • -------- Removing Crane Wings Charge from Caster --------
                  • Unit - Remove Crane Wings 2 from CW1_Caster[Temp]
                  • -------- Showing Crane Wings Throw from Caster --------
                  • Unit - Set level of Crane Wings for CW1_Caster[Temp] to 1
                  • -------- Recycling all the Indexes --------
                  • Set CW1_MUI_2[CW1_MUI_3] = CW1_MUI_2[CW1_MUI_1]
                  • Set CW1_MUI_2[CW1_MUI_1] = Temp
                  • Set CW1_MUI_1 = (CW1_MUI_1 - 1)
                  • Set CW1_MUI_3 = (CW1_MUI_3 - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • CW1_MUI_1 Equal to 0
                    • Then - Actions
                      • -------- Turning off this trigger. Pointless to keep running --------
                      • Trigger - Turn off (This trigger)
                      • -------- -------------------------------------------------------- --------
                    • Else - Actions
Crane Wings Charge Loop
  • Crane Wings Charge
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Crane Wings 2
    • Actions
      • -------- Indexing Start --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CW2_MUI_1 Equal to 0
        • Then - Actions
          • -------- If there are currently no instances running, we turn on the loop. --------
          • Trigger - Turn on Crane Wings Charge Loop <gen>
        • Else - Actions
      • -------- Increases the indexes --------
      • Set CW2_MUI_1 = (CW2_MUI_1 + 1)
      • -------- Start of Dynamic Indexing --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CW2_MUI_1 Greater than CW2_Max_Index
        • Then - Actions
          • -------- Indexing ~ ~ --------
          • Set CW2_MUI_2[CW2_MUI_1] = CW2_MUI_1
          • Set CW2_Max_Index = CW2_MUI_1
        • Else - Actions
      • -------- End of Dynamic Indexing --------
      • -------- Makes it easier and cleaner. --------
      • Set Temp = CW2_MUI_2[CW1_MUI_1]
      • -------- Setting Caster --------
      • Set CW2_Caster[Temp] = (Triggering unit)
      • -------- Finding Target --------
      • For each (Integer CW1_MUI_3) from 1 to CW1_MUI_1, do (Actions)
        • Loop - Actions
          • -------- Makes it easier to read and cleaner --------
          • Set Temp3 = CW1_MUI_2[CW1_MUI_3]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CW2_Caster[Temp] Equal to CW1_Caster[Temp3]
            • Then - Actions
              • -------- Setting Target --------
              • Set CW2_Target[Temp] = CW1_Target[Temp3]
              • -------- Setting Ability Duration --------
              • Set CW1_SkillDuration[Temp3] = 5.00
            • Else - Actions
      • -------- Making Caster face target --------
      • Unit - Make CW2_Caster[Temp] face CW2_Target[Temp] over 0.00 seconds
      • -------- * * *Here you can set the Damage* * * --------
      • Set CW2_Damage[Temp] = (1.00 x (Real((Agility of CW2_Caster[Temp] (Include bonuses)))))
      • -------- * * *Here you can set the Speed* * * --------
      • Set CW2_Speed = 30.00
      • -------- * * *Here you can set the Animation Speed of Caster* * * --------
      • Animation - Change CW2_Caster[Temp]'s animation speed to 225.00% of its original speed
      • -------- * * *Here you can set the Number of Attacks* * * --------
      • Set CW2_Attacks[Temp] = 2
      • -------- * * *Here you can set the Delay between the Damage and the Attack --------
      • Set CW2_Delay[Temp] = 0.20
      • -------- * * *Here you can set the Duration of the Ability* * * --------
      • Set CW2_SkillDuration[Temp] = 1.00


Crane Wings Charge Loop
  • Crane Wings Charge Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer CW2_MUI_3) from 1 to CW2_MUI_1, do (Actions)
        • Loop - Actions
          • -------- Makes it easier to read and cleaner --------
          • Set Temp = CW2_MUI_2[CW2_MUI_3]
          • -------- Checks if Caster is Alive and still channelling --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (CW2_Caster[Temp] is alive) Equal to True
              • (CW2_Target[Temp] is alive) Equal to True
              • (Current order of CW2_Caster[Temp]) Equal to (Order(thunderclap))
            • Then - Actions
              • -------- Setting Locations of Caster and Target --------
              • Set CasterLoc = (Position of CW2_Caster[Temp])
              • Set TargetLoc = (Position of CW2_Target[Temp])
              • -------- Setting Angle --------
              • Set CW2_Angle = (Angle from CasterLoc to TargetLoc)
              • -------- Setting Distance --------
              • Set CW2_Distance = (Distance between CasterLoc and TargetLoc)
              • -------- Checking Distance of Points --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CW2_Distance Greater than 100.00
                • Then - Actions
                  • -------- Making Caster Face Target --------
                  • Unit - Make CW2_Caster[Temp] face CW2_Target[Temp] over 0.00 seconds
                  • -------- Setting Location for Motion --------
                  • Set DummyLoc = (CasterLoc offset by CW2_Speed towards CW2_Angle degrees)
                  • -------- Moving Caster --------
                  • Custom script: call SetUnitX(udg_CW2_Caster[udg_Temp], GetLocationX(udg_DummyLoc))
                  • Custom script: call SetUnitY(udg_CW2_Caster[udg_Temp], GetLocationY(udg_DummyLoc))
                  • -------- Removing Leaks --------
                  • Custom script: call RemoveLocation(udg_DummyLoc)
                • Else - Actions
                  • -------- Caster Attacks the Target --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • CW2_Attacks[Temp] Greater than 0
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • CW2_Delay[Temp] Equal to 0.20
                        • Then - Actions
                          • -------- Here you can set the Animation ID for the Attacks --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • CW2_Attacks[Temp] Equal to 2
                            • Then - Actions
                              • Custom script: call SetUnitAnimationByIndex(udg_CW2_Caster[udg_Temp], 4)
                            • Else - Actions
                              • Custom script: call SetUnitAnimationByIndex(udg_CW2_Caster[udg_Temp], 5)
                          • Set CW2_Delay[Temp] = (CW2_Delay[Temp] - 0.03)
                        • Else - Actions
                          • -------- Checking Delay for Damage --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • CW2_Delay[Temp] Greater than 0.00
                            • Then - Actions
                              • -------- Decreasing Delay --------
                              • Set CW2_Delay[Temp] = (CW2_Delay[Temp] - 0.03)
                            • Else - Actions
                              • -------- Dealing Damage --------
                              • Unit - Cause CW2_Caster[Temp] to damage CW2_Target[Temp], dealing CW2_Damage[Temp] damage of attack type Spells and damage type Normal
                              • -------- Decreasing number of Attacks --------
                              • Set CW2_Attacks[Temp] = (CW2_Attacks[Temp] - 1)
                              • -------- Resetting Delay for Animation --------
                              • Set CW2_Delay[Temp] = 0.20
                    • Else - Actions
                      • -------- Removing Crane Wings Charge Ability from Caster --------
                      • Unit - Remove Crane Wings 2 from CW2_Caster[Temp]
                      • -------- Adding Crane Wings Overedge to Caster --------
                      • Unit - Add Crane Wings 3 to CW2_Caster[Temp]
              • -------- Removing Leaks --------
              • Custom script: call RemoveLocation(udg_CasterLoc)
              • Custom script: call RemoveLocation(udg_TargetLoc)
            • Else - Actions
              • -------- Reseting Caster's Animation Speed --------
              • Animation - Change CW2_Caster[Temp]'s animation speed to 100.00% of its original speed
              • -------- Checks whether Caster has Overedge Ability --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Crane Wings 3 for CW2_Caster[Temp]) Greater than 0
                • Then - Actions
                  • -------- Checks Skill Duration --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • CW2_SkillDuration[Temp] Greater than 0.00
                    • Then - Actions
                      • Set CW2_SkillDuration[Temp] = (CW2_SkillDuration[Temp] - 0.03)
                    • Else - Actions
                      • -------- Removing Crane Wings Overedge Ability from Caster --------
                      • Unit - Remove Crane Wings 3 from CW2_Caster[Temp]
                      • -------- Showing Crane Wings Throw to Caster --------
                      • Unit - Set level of Crane Wings for CW2_Caster[Temp] to 1
                • Else - Actions
                  • -------- Recycling all the Indexes --------
                  • Set CW2_MUI_2[CW2_MUI_3] = CW2_MUI_2[CW2_MUI_1]
                  • Set CW2_MUI_2[CW2_MUI_1] = Temp
                  • Set CW2_MUI_1 = (CW2_MUI_1 - 1)
                  • Set CW2_MUI_3 = (CW2_MUI_3 - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • CW2_MUI_1 Equal to 0
                    • Then - Actions
                      • -------- Turning off this trigger. Pointless to keep running --------
                      • Trigger - Turn off (This trigger)
                      • -------- -------------------------------------------------------- --------
                    • Else - Actions

I test the MUI-bility of the trigger by automatically ordering another copy of the unit to cast the same ability.. Also if someone can tell me an easier way of doing this, IE getting the target unit from the first spell to be used in the 2nd spell, Id appreciate that much =D. Also theres still a third activation for this spell.


Some Explantion for the Variables

CW#_SkillDuration - is the seconds of availabilty of the next spell..

BTW the whole point of increasing that whenever the next spell is casted is to keep that ability, since the next spell is channelled. Really trying to not rely on Pauses =D
 
Last edited by a moderator:
So it only bugs out on Crane Wings 2, correct? i.e. when two people cast Crane Wings 2, one of the spells messes up? Try having two units cast Crane Wings 1 and see if you get similar results.

Also, what is this line for:
  • Set CW1_SkillDuration[Temp3] = 5.00
I'm curious why you would need to set the duration for Crane Wings 1 in the start of Crane Wings 2.

I haven't looked too deeply into the code yet since I don't have a full understanding of the way your spell should work from Cast #1 to Cast #2.

As for the overall design, I might be able to give you some suggestions if you explain it a little more. :) Does Crane Wings 2 completely replace the ability when Crane Wings 1 finishes? Or are these all separate moves? (perhaps you can make a test map so we can see) I'm sure there is an easier way, and restructuring the spell's code could make your life easier later on.
 
Level 7
Joined
Apr 18, 2010
Messages
102
Fixed it.... Heres how I did it if anyone is wondering (it may help on how chained abilities are triggered)

  • Triple Linked Crane Wings Throw
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Crane Wings
    • Actions
      • -------- First Cast --------
      • -------- Indexing Start --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TLCW_MUI_1 Equal to 0
        • Then - Actions
          • -------- If there are currently no instances running, we turn on the loop. --------
          • Trigger - Turn on Triple Linked Crane Wings Loop <gen>
        • Else - Actions
      • -------- Increases the indexes --------
      • Set TLCW_MUI_1 = (TLCW_MUI_1 + 1)
      • -------- Start of Dynamic Indexing --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TLCW_MUI_1 Greater than TLCW_MaxIndex
        • Then - Actions
          • -------- Indexing ~ ~ --------
          • Set TLCW_MUI_2[TLCW_MUI_1] = TLCW_MUI_1
          • Set TLCW_MaxIndex = TLCW_MUI_1
        • Else - Actions
      • -------- End of Dynamic Indexing --------
      • -------- Makes it easier and cleaner. --------
      • Set Temp = TLCW_MUI_2[TLCW_MUI_1]
      • -------- Setting Stage of Cast --------
      • Set TLCW_Stage[Temp] = 1
      • -------- Setting Caster --------
      • Set TLCW_Caster[Temp] = (Triggering unit)
      • -------- Setting Player --------
      • Set TLCW_Player[Temp] = (Owner of TLCW_Caster[Temp])
      • -------- Setting Caster's Location --------
      • Set CasterLoc = (Position of TLCW_Caster[Temp])
      • -------- Setting Target's Location --------
      • Set TargetLoc = (Target point of ability being cast)
      • -------- Setting Angle --------
      • Set TLCW_Angle[Temp] = (Angle from CasterLoc to TargetLoc)
      • -------- Setting Dummy Spawning Location --------
      • Set DummyLoc = (CasterLoc offset by 68.00 towards TLCW_Angle[Temp] degrees)
      • -------- Creating Swords --------
      • Unit - Create 1 Crane Wings Dummy for TLCW_Player[Temp] at DummyLoc facing TLCW_Angle[Temp] degrees
      • Set TLCW_Dummy[Temp] = (Last created unit)
      • -------- Creating Eye Candy for Swords --------
      • Special Effect - Create a special effect attached to the hand left of TLCW_Dummy[Temp] using Abilities\Weapons\PhoenixMissile\Phoenix_Missile_mini.mdl
      • Set TLCW_SwordEffectLeft[Temp] = (Last created special effect)
      • Special Effect - Create a special effect attached to the hand right of TLCW_Dummy[Temp] using Abilities\Spells\Undead\AbsorbMana\AbsorbManaBirthMissile.mdl
      • Set TLCW_SwordEffectRight[Temp] = (Last created special effect)
      • -------- Setting Traveled Distance --------
      • Set TLCW_Travel[Temp] = 0.00
      • -------- * * *Here you can set the Distance the Swords Travel* * * --------
      • Set TLCW_Range[Temp] = 500.00
      • -------- * * *Here you can set the Speed at which the Sword Travels --------
      • Set TLCW_Speed[Temp] = (TLCW_Range[Temp] / 16.00)
      • -------- * * *Here you can set the Damage the Swords will deal* * * --------
      • Set TLCW_Damage[Temp] = ((Real((Intelligence of TLCW_Caster[Temp] (Include bonuses)))) x 1.00)
      • -------- * * *Here you can set the Animation Speed of the Swords* * * --------
      • Animation - Change TLCW_Dummy[Temp]'s animation speed to 200.00% of its original speed
      • -------- * * *Here you can set the Animation of the Swords* * * --------
      • Animation - Play TLCW_Dummy[Temp]'s Spell Channel Two animation
      • -------- * * * *Here you can set the Skill Activation Window* * * --------
      • Set TLCW_Activation[Temp] = 0.50
      • -------- Removing Leaks --------
      • Custom script: call RemoveLocation(udg_CasterLoc)
      • Custom script: call RemoveLocation(udg_TargetLoc)
      • Custom script: call RemoveLocation(udg_DummyLoc)

  • Triple Linked Crane Wings Charge
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Crane Wings 2
    • Actions
      • -------- Second Cast --------
      • -------- Instead of Indexing, we Find the Caster among the Indexes --------
      • For each (Integer TLCW_MUI_3) from 1 to TLCW_MUI_1, do (Actions)
        • Loop - Actions
          • -------- Makes it easier to read and cleaner --------
          • Set Temp = TLCW_MUI_2[TLCW_MUI_3]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to TLCW_Caster[Temp]
            • Then - Actions
              • -------- ==== Setting Variables for Stage 2 ==== --------
              • -------- Setting Stage of Spell --------
              • Set TLCW_Stage[Temp] = 2
              • -------- * * * *Here you can set the Damage* * * --------
              • Set TLCW_Damage[Temp] = ((Real((Intelligence of TLCW_Caster[Temp] (Include bonuses)))) x 1.50)
              • -------- * * * *Here you can set the Animation Speed of the Caster* * * --------
              • Animation - Change TLCW_Caster[Temp]'s animation speed to 150.00% of its original speed
              • -------- * * * *Here you can set Delay between the Attack Animation and Damage* * * --------
              • Set TLCW_Delay[Temp] = 0.45
              • -------- * * * *Here you can set the Speed* * * --------
              • Set TLCW_Speed[Temp] = 30.00
              • -------- * * * *Here you can set the Skill Activation Window* * * --------
              • Set TLCW_Activation[Temp] = 0.50
              • -------- Creating Eye Candy --------
              • Special Effect - Create a special effect attached to the hand left of TLCW_Caster[Temp] using Abilities\Weapons\PhoenixMissile\Phoenix_Missile_mini.mdl
              • Set TLCW_SwordEffectLeft[Temp] = (Last created special effect)
              • Special Effect - Create a special effect attached to the hand right of TLCW_Caster[Temp] using Abilities\Spells\Undead\AbsorbMana\AbsorbManaBirthMissile.mdl
              • Set TLCW_SwordEffectRight[Temp] = (Last created special effect)
            • Else - Actions
And the Loop Trigger =D

  • Triple Linked Crane Wings Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer TLCW_MUI_3) from 1 to TLCW_MUI_1, do (Actions)
        • Loop - Actions
          • -------- Makes it easier to read and cleaner --------
          • Set Temp = TLCW_MUI_2[TLCW_MUI_3]
          • -------- Checks for Stages --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TLCW_Stage[Temp] Equal to 1
            • Then - Actions
              • -------- =Sword Throw Stage= --------
              • -------- Checking for Distance --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • TLCW_Travel[Temp] Less than TLCW_Range[Temp]
                • Then - Actions
                  • -------- Setting Current Dummy Location --------
                  • Set CasterLoc = (Position of TLCW_Dummy[Temp])
                  • -------- Setting Next Dummy Location --------
                  • Set TargetLoc = (CasterLoc offset by TLCW_Speed[Temp] towards TLCW_Angle[Temp] degrees)
                  • -------- Moving Swords --------
                  • Unit - Move TLCW_Dummy[Temp] instantly to TargetLoc
                  • -------- Setting Traveled Distance --------
                  • Set TLCW_Travel[Temp] = (TLCW_Travel[Temp] + TLCW_Speed[Temp])
                  • -------- Setting Group --------
                  • Set Target_Group = (Units within (TLCW_Speed[Temp] x 2.00) of CasterLoc matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of TLCW_Player[Temp]) Equal to True)))
                  • -------- Checking if there is an available target --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in Target_Group) Greater than 0
                    • Then - Actions
                      • -------- Setting Target --------
                      • Set TLCW_Target[Temp] = (Random unit from Target_Group)
                      • -------- Dealing Damage --------
                      • Unit - Cause TLCW_Caster[Temp] to damage TLCW_Target[Temp], dealing TLCW_Damage[Temp] damage of attack type Spells and damage type Normal
                      • -------- Stunning the Target --------
                      • Unit - Create 1 Dummy Caster for TLCW_Player[Temp] at TargetLoc facing Default building facing degrees
                      • Unit - Add Triple Linked Crane Wings Stun to (Last created unit)
                      • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt TLCW_Target[Temp]
                      • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
                      • -------- Creating Eye Candy --------
                      • Special Effect - Create a special effect attached to the chest of TLCW_Target[Temp] using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • -------- Hiding Crane Wings Throw from Caster --------
                      • Unit - Set level of Crane Wings for TLCW_Caster[Temp] to 2
                      • -------- Adding Crane Wings Charge to Caster --------
                      • Unit - Add Crane Wings 2 to TLCW_Caster[Temp]
                      • -------- Setting Traveled Distance to Max --------
                      • Set TLCW_Travel[Temp] = TLCW_Range[Temp]
                    • Else - Actions
                  • -------- Removing Leaks --------
                  • Custom script: call RemoveLocation(udg_CasterLoc)
                  • Custom script: call RemoveLocation(udg_TargetLoc)
                  • Custom script: call DestroyGroup(udg_Target_Group)
                • Else - Actions
                  • -------- Destroying Swords --------
                  • Animation - Change TLCW_Dummy[Temp]'s animation speed to 0.00% of its original speed
                  • Special Effect - Destroy TLCW_SwordEffectLeft[Temp]
                  • Special Effect - Destroy TLCW_SwordEffectRight[Temp]
                  • Unit - Add a 0.30 second Generic expiration timer to TLCW_Dummy[Temp]
                  • -------- Checking if Caster has Crane Wings Charge Ability --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Crane Wings 2 for TLCW_Caster[Temp]) Greater than 0
                    • Then - Actions
                      • -------- Caster has it, therefore Check for Skill Activation Window --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • TLCW_Activation[Temp] Greater than 0.00
                        • Then - Actions
                          • -------- Reducing Activation Window --------
                          • Set TLCW_Activation[Temp] = (TLCW_Activation[Temp] - 0.03)
                        • Else - Actions
                          • -------- Removing Ability --------
                          • Unit - Remove Crane Wings 2 from TLCW_Caster[Temp]
                          • -------- Showing Triple Linked Crane Wings Throw for Caster --------
                          • Unit - Set level of Crane Wings for TLCW_Caster[Temp] to 1
                    • Else - Actions
                      • -------- Recycling all the Indexes --------
                      • Set TLCW_MUI_2[TLCW_MUI_3] = TLCW_MUI_2[TLCW_MUI_1]
                      • Set TLCW_MUI_2[TLCW_MUI_1] = Temp
                      • Set TLCW_MUI_1 = (TLCW_MUI_1 - 1)
                      • Set TLCW_MUI_3 = (TLCW_MUI_3 - 1)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • TLCW_MUI_1 Equal to 0
                        • Then - Actions
                          • -------- Turning off this trigger. Pointless to keep running --------
                          • Trigger - Turn off (This trigger)
                          • -------- -------------------------------------------------------- --------
                        • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TLCW_Stage[Temp] Equal to 2
            • Then - Actions
              • -------- Setting Locations --------
              • Set CasterLoc = (Position of TLCW_Caster[Temp])
              • Set TargetLoc = (Position of TLCW_Target[Temp])
              • -------- Setting Distance --------
              • Set TLCW_Range[Temp] = (Distance between CasterLoc and TargetLoc)
              • -------- Checking Distance --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (TLCW_Caster[Temp] is alive) Equal to True
                  • (TLCW_Target[Temp] is alive) Equal to True
                  • (Current order of TLCW_Caster[Temp]) Equal to (Order(thunderclap))
                  • TLCW_Range[Temp] Greater than 100.00
                • Then - Actions
                  • -------- Setting Angle Between Caster and Target --------
                  • Set TLCW_Angle[Temp] = (Angle from CasterLoc to TargetLoc)
                  • -------- Setting Travel Location --------
                  • Set DummyLoc = (CasterLoc offset by TLCW_Speed[Temp] towards TLCW_Angle[Temp] degrees)
                  • -------- Makes Caster face Target --------
                  • Unit - Make TLCW_Caster[Temp] face TLCW_Angle[Temp] over 0.00 seconds
                  • -------- Moving Caster to Dummy Location (Next Location) --------
                  • Custom script: call SetUnitX(udg_TLCW_Caster[udg_Temp], GetLocationX(udg_DummyLoc))
                  • Custom script: call SetUnitY(udg_TLCW_Caster[udg_Temp], GetLocationY(udg_DummyLoc))
                • Else - Actions
                  • -------- Checking Conditions --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (TLCW_Caster[Temp] is alive) Equal to True
                      • (TLCW_Target[Temp] is alive) Equal to True
                      • (Current order of TLCW_Caster[Temp]) Equal to (Order(thunderclap))
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • TLCW_Delay[Temp] Equal to 0.45
                        • Then - Actions
                          • -------- * * *Here you can set the Attack Animation of the Caster* * * --------
                          • Animation - Play TLCW_Caster[Temp]'s Attack Slam animation
                          • -------- Reducing Delay --------
                          • Set TLCW_Delay[Temp] = (TLCW_Delay[Temp] - 0.03)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • TLCW_Delay[Temp] Greater than 0.00
                            • Then - Actions
                              • -------- Reducing Delay --------
                              • Set TLCW_Delay[Temp] = (TLCW_Delay[Temp] - 0.03)
                            • Else - Actions
                              • -------- Dealing Damage --------
                              • Unit - Cause TLCW_Caster[Temp] to damage TLCW_Target[Temp], dealing TLCW_Damage[Temp] damage of attack type Spells and damage type Normal
                              • -------- Creating Eye Candy --------
                              • Special Effect - Create a special effect attached to the chest of TLCW_Target[Temp] using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
                              • Special Effect - Destroy (Last created special effect)
                              • -------- Removing Crane Wings Charge from Caster --------
                              • Unit - Remove Crane Wings 2 from TLCW_Caster[Temp]
                              • -------- Adding Crane Wings Overedge to Caster --------
                              • Unit - Add Crane Wings 3 to TLCW_Caster[Temp]
                              • -------- Stunning the Target --------
                              • Unit - Create 1 Dummy Caster for TLCW_Player[Temp] at TargetLoc facing Default building facing degrees
                              • Unit - Add Triple Linked Crane Wings Stun 2 to (Last created unit)
                              • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt TLCW_Target[Temp]
                              • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
                    • Else - Actions
                      • -------- Removing Leaks --------
                      • Custom script: call RemoveLocation(udg_CasterLoc)
                      • Custom script: call RemoveLocation(udg_TargetLoc)
                      • Custom script: call RemoveLocation(udg_DummyLoc)
                      • -------- Removing Eye Candy --------
                      • Special Effect - Destroy TLCW_SwordEffectLeft[Temp]
                      • Special Effect - Destroy TLCW_SwordEffectRight[Temp]
                      • -------- Resetting Animation Speed of Caster --------
                      • Animation - Change TLCW_Caster[Temp]'s animation speed to 100.00% of its original speed
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Level of Crane Wings 3 for TLCW_Caster[Temp]) Greater than 0
                        • Then - Actions
                          • -------- Caster has it, therefore Check for Skill Activation Window --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • TLCW_Activation[Temp] Greater than 0.00
                            • Then - Actions
                              • -------- Reducing Activation Window --------
                              • Set TLCW_Activation[Temp] = (TLCW_Activation[Temp] - 0.03)
                            • Else - Actions
                              • -------- Removing Ability --------
                              • Unit - Remove Crane Wings 3 from TLCW_Caster[Temp]
                              • -------- Showing Triple Linked Crane Wings Throw for Caster --------
                              • Unit - Set level of Crane Wings for TLCW_Caster[Temp] to 1
                        • Else - Actions
                          • Unit - Remove Crane Wings 2 from TLCW_Caster[Temp]
                          • Unit - Remove Crane Wings 3 from TLCW_Caster[Temp]
                          • Unit - Set level of Crane Wings for TLCW_Caster[Temp] to 1
                          • -------- Recycling all the Indexes --------
                          • Set TLCW_MUI_2[TLCW_MUI_3] = TLCW_MUI_2[TLCW_MUI_1]
                          • Set TLCW_MUI_2[TLCW_MUI_1] = Temp
                          • Set TLCW_MUI_1 = (TLCW_MUI_1 - 1)
                          • Set TLCW_MUI_3 = (TLCW_MUI_3 - 1)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • TLCW_MUI_1 Equal to 0
                            • Then - Actions
                              • -------- Turning off this trigger. Pointless to keep running --------
                              • Trigger - Turn off (This trigger)
                              • -------- -------------------------------------------------------- --------
                            • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TLCW_Stage[Temp] Equal to 3
            • Then - Actions
              • -------- Checks if Caster is Alive --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (TLCW_Caster[Temp] is alive) Equal to True
                • Then - Actions
                  • -------- We Can Proceed. Checks for the Delay to move --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • TLCW_Delay[Temp] Greater than 0.00
                    • Then - Actions
                      • -------- Reducing Delay --------
                      • Set TLCW_Delay[Temp] = (TLCW_Delay[Temp] - 0.03)
                    • Else - Actions
                • Else - Actions
            • Else - Actions
Currently working on the Overedge cast of the ability, but same principles apply. just use "STAGES" in order to distinguish the nth cast of the ability...
 
Level 7
Joined
Apr 18, 2010
Messages
102
Fixed

Fixed it. The spell is no longer a 3 part spell though.. Its hard to balance it that way... Spell is Leakless and MUI =)



Close this thread if possible. thanks for the help.
 

Attachments

  • Triple Linked Crane Wings.gif
    Triple Linked Crane Wings.gif
    2.6 MB · Views: 156
Status
Not open for further replies.
Top