1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Trigger] Charge Knockback Spell

Discussion in 'Triggers & Scripts' started by ShadowBladeX, Apr 7, 2018.

  1. ShadowBladeX

    ShadowBladeX

    Joined:
    Apr 20, 2016
    Messages:
    206
    Resources:
    0
    Resources:
    0
    • Combo Initiation
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Kaneki Combo
      • Actions
        • -------- Set Vars --------
        • Set Combo_INDEX = (Combo_INDEX + 1)
        • Set Combo_MUI = (Combo_MUI + 1)
        • Set ComboOn[Combo_MUI] = True
        • Set ComboCaster[Combo_MUI] = (Casting unit)
        • Set ComboCasterPos = (Position of ComboCaster[Combo_MUI])
        • Set ComboTarget[Combo_MUI] = (Target unit of ability being cast)
        • Set ComboTargetPoint = (Position of ComboTarget[Combo_MUI])
        • Set ComboDistance[Combo_MUI] = ((Distance between ComboCasterPos and ComboTargetPoint) - 100.00)
        • Set ComboAngle[Combo_MUI] = (Angle from ComboCasterPos to ComboTargetPoint)
        • Set ComboDistanceMoved[Combo_MUI] = 0.00
        • Set ComboSpeed = (1200.00 x 0.03)
        • -------- End Vars --------
        • Unit - Pause ComboCaster[Combo_MUI]
        • Unit - Make ComboCaster[Combo_MUI] Invulnerable
        • Unit - Turn collision for ComboCaster[Combo_MUI] Off
        • Unit - Pause ComboTarget[Combo_MUI]
        • Custom script: call RemoveLocation(udg_ComboCasterPos)
        • Custom script: call RemoveLocation(udg_ComboTargetPoint)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Combo_INDEX Equal to 1
          • Then - Actions
            • Trigger - Turn on Combo Move <gen>
          • Else - Actions
    • Combo Move
      • Events
        • Time - Every 0.03 seconds of game time
      • Conditions
      • Actions
        • For each (Integer Combo_LOOP) from 1 to Combo_MUI, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ComboOn[Combo_LOOP] Equal to True
              • Then - Actions
                • Set ComboPos1 = (Position of ComboCaster[Combo_LOOP])
                • Set ComboPos2 = (ComboPos1 offset by ComboSpeed towards ComboAngle[Combo_LOOP] degrees)
                • Set Combo_MoveX[Combo_LOOP] = (X of ComboPos2)
                • Set Combo_MoveY[Combo_LOOP] = (Y of ComboPos2)
                • Set ComboDistanceMoved[Combo_LOOP] = (ComboDistanceMoved[Combo_LOOP] + ComboSpeed)
                • Custom script: call SetUnitX(udg_ComboCaster[udg_Combo_LOOP], udg_Combo_MoveX[udg_Combo_LOOP])
                • Custom script: call SetUnitY(udg_ComboCaster[udg_Combo_LOOP], udg_Combo_MoveY[udg_Combo_LOOP])
                • Animation - Play ComboCaster[Combo_LOOP]'s spell three animation
                • Custom script: call RemoveLocation(udg_ComboPos1)
                • Custom script: call RemoveLocation(udg_ComboPos2)
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • ComboDistanceMoved[Combo_LOOP] Greater than or equal to ComboDistance[Combo_LOOP]
                  • Then - Actions
                    • Set ComboOn[Combo_LOOP] = False
                    • Unit - Make ComboCaster[Combo_MUI] Invulnerable
                    • Animation - Play ComboCaster[Combo_LOOP]'s spell four animation
                    • Animation - Queue ComboCaster[Combo_LOOP]'s spell slam animation
                    • Unit - Turn collision for ComboCaster[Combo_MUI] On
                    • Unit - Create 1 Knockback Dummy for (Owner of ComboCaster[Combo_LOOP]) at (Position of ComboCaster[Combo_LOOP]) facing (Facing of ComboCaster[Combo_LOOP]) degrees
                    • Unit - Add Knockback to (Last created unit)
                    • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt ComboTarget[Combo_LOOP]
                  • Else - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (ComboTarget[Combo_LOOP] is dead) Equal to True
                      • Then - Actions
                        • -------- End of spell --------
                        • Unit - Turn collision for ComboCaster[Combo_MUI] On
                        • Set Combo_INDEX = (Combo_INDEX - 1)
                        • Set Combo_MUI = (Combo_MUI - 1)
                        • Set ComboOn[Combo_LOOP] = False
                        • Set ComboCaster[Combo_LOOP] = No unit
                        • Set ComboTarget[Combo_LOOP] = No unit
                        • Set ComboAngle[Combo_LOOP] = 0.00
                        • Set ComboDistance[Combo_LOOP] = 0.00
                        • Set ComboDistanceMoved[Combo_LOOP] = 0.00
                      • Else - Actions
                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • Combo_INDEX Equal to 0
                          • Then - Actions
                            • Trigger - Turn off (This trigger)
                          • Else - Actions
              • Else - Actions
    • Knockback Init
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Knockback
      • Actions
        • -------- Set Vars --------
        • Set Knockback_INDEX = (Combo_INDEX + 1)
        • Set Knockback_MUI = (Knockback_MUI + 1)
        • Set KnockbackCaster[Knockback_MUI] = (Target unit of issued order)
        • Set KnockbackTarget[Knockback_MUI] = (Target unit of ability being cast)
        • Set KnockbackAngle[Knockback_MUI] = (Facing of KnockbackCaster[Knockback_MUI])
        • Set KnockbackCasterPos[Knockback_MUI] = (Position of KnockbackCaster[Knockback_MUI])
        • Set KnockbackMaxDistance = 200.00
        • Set KnockbackSpeed = (500.00 x 0.03)
        • Set KnockbackOn[Knockback_MUI] = True
        • -------- End Vars --------
        • Unit - Turn collision for KnockbackTarget[Knockback_MUI] Off
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Knockback_INDEX Equal to 1
          • Then - Actions
            • Trigger - Turn on Knockback <gen>
          • Else - Actions
    • Knockback
      • Events
        • Time - Every 0.03 seconds of game time
      • Conditions
      • Actions
        • For each (Integer Knockback_LOOP) from 1 to Knockback_MUI, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • KnockbackOn[Knockback_LOOP] Equal to True
              • Then - Actions
                • Set KnockbackDistance[Knockback_LOOP] = (Distance between KnockbackCasterPos[Knockback_MUI] and (Position of KnockbackTarget[Knockback_MUI]))
                • Unit - Move KnockbackTarget[Knockback_LOOP] instantly to (ComboCasterPos offset by (KnockbackDistance[Knockback_LOOP] + KnockbackSpeed) towards KnockbackAngle[Knockback_LOOP] degrees)
                • Special Effect - Create a special effect at (Position of KnockbackTarget[Knockback_LOOP]) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
              • Else - Actions
    the problem here is that the dummy cast the knockback spell but doesn't move the target.
    I attached the map so that you van see what I mean
     

    Attached Files:

    Last edited: Apr 7, 2018
  2. nedio95

    nedio95

    Joined:
    Mar 24, 2011
    Messages:
    1,055
    Resources:
    1
    Spells:
    1
    Resources:
    1
    This is in the knockback loop trigger
    • Unit - Move KnockbackTarget[Knockback_LOOP] instantly to (ComboCasterPos offset by (KnockbackDistance[Knockback_LOOP] + KnockbackSpeed) towards KnockbackAngle[Knockback_LOOP] degrees)

    ComboCasterPos - What is this? Where did it come from? Shouldn't it be KnockbackCasterPos[Knockback_LOOP] instead? Or something around?


    Also, why have you split the spell in 4 parts, 2 would be more than enough...
     
  3. AGD

    AGD

    Joined:
    Mar 29, 2016
    Messages:
    397
    Resources:
    13
    Spells:
    7
    Tutorials:
    1
    JASS:
    5
    Resources:
    13
    Probably because of this?
    • set Knockback_INDEX = (Combo_INDEX + 1)
     
  4. ShadowBladeX

    ShadowBladeX

    Joined:
    Apr 20, 2016
    Messages:
    206
    Resources:
    0
    Resources:
    0
    Foe the spell delay and so that I will not get confused, but I optimized it now

    Yup, now I know why it won't work

    so this is my new update and in the last part where the character rapidly hits the enemy, the damage trigger doesn't work. It's killing my barin now please help me and check when there is a bug or leaks in it thanks.
     

    Attached Files: