• 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] Jump Spell damage after landing on target

Status
Not open for further replies.
Level 12
Joined
May 20, 2009
Messages
822
So, I'm using this and I was wondering how I make something like dealing damage only happen AFTER the unit using the spell lands on the target unit/point.

This is what I got:


  • Leap Strike Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Leap Strike
          • (Unit-type of (Triggering unit)) Equal to Grandmaster of Arms
        • Then - Actions
          • Set LeapStrikeMaxIndex = (LeapStrikeMaxIndex + 1)
          • Set LeapStrikeCaster[LeapStrikeMaxIndex] = (Triggering unit)
          • Set LeapStrikeTarget[LeapStrikeMaxIndex] = (Target unit of ability being cast)
          • Set LeapStrikePoint[LeapStrikeMaxIndex] = (Position of (Target unit of ability being cast))
        • Else - Actions
  • Leap Strike Calc
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • For each (Integer LeapStrikeInit) from 1 to LeapStrikeMaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • LeapStrikeVariablesSet[LeapStrikeInit] Equal to 0
            • Then - Actions
              • Set JDA_JumpHigh_Distance = 0.30
              • Set JDA_DestroyTrees_Dash = False
              • Set JDA_TargetPoint = LeapStrikePoint[LeapStrikeInit]
              • Set JDA_Unit = LeapStrikeCaster[LeapStrikeInit]
              • Set JDA_Speed = 50.00
              • Set JDA_Animation = none
              • Set JDA_SpecialEffect = none
              • Set JDA_AnimationSpeed = 0.60
              • Set LeapStrikeVariablesSet[LeapStrikeInit] = 1
              • Trigger - Run Jump System 1 <gen> (checking conditions)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current flying height of LeapStrikeCaster[LeapStrikeInit]) Less than or equal to 5.00
            • Then - Actions
              • Unit - Cause LeapStrikeCaster[LeapStrikeInit] to damage LeapStrikeTarget[LeapStrikeInit], dealing (Random real number between 10.00 and 20.00) damage of attack type Normal and damage type Normal
            • Else - Actions
          • Set LeapStrikeCaster[LeapStrikeInit] = LeapStrikeCaster[LeapStrikeMaxIndex]
          • Set LeapStrikeCaster[LeapStrikeMaxIndex] = No unit
          • Set LeapStrikeTarget[LeapStrikeInit] = LeapStrikeTarget[LeapStrikeMaxIndex]
          • Set LeapStrikeTarget[LeapStrikeMaxIndex] = No unit
          • Set LeapStrikePoint[LeapStrikeInit] = LeapStrikePoint[LeapStrikeMaxIndex]
          • Custom script: set udg_LeapStrikePoint[udg_LeapStrikeMaxIndex] = null
          • Set LeapStrikeVariablesSet[LeapStrikeInit] = LeapStrikeVariablesSet[LeapStrikeMaxIndex]
          • Set LeapStrikeVariablesSet[LeapStrikeMaxIndex] = 0
          • Set LeapStrikeMaxIndex = (LeapStrikeMaxIndex - 1)

Am I anywhere near right with this?
 
Level 12
Joined
May 20, 2009
Messages
822
Unfortunately, that does not help me get an EXACT timing. Especially since I don't want to modify the actual jump triggers, so that way I can use it for different jump spells just in case. (Like, one that doesn't do damage. Or a DASH spell [With no height])

Maybe I could check this variable
  • JD_ReachedDistance[JD_Integers[3]] Less than JD_Distances[JD_Integers[3]]
But I'm not really sure if that'll make it only happen as the unit lands. I'll give it a shot, though.
 
Level 12
Joined
May 20, 2009
Messages
822
I guess your saying I should do this? I guess this might work since it won't really fuck with the actual jump system...

  • Jump System 2
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer JD_Integers[3]) from 1 to JD_Integers[2], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (JD_Unit[JD_Integers[3]] is in JD_Group) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • JD_ReachedDistance[JD_Integers[3]] Less than JD_Distances[JD_Integers[3]]
                • Then - Actions
                  • Animation - Queue JD_Unit[JD_Integers[3]]'s JD_Animations[JD_Integers[3]] animation
                  • Set JD_TempPoint[1] = (Position of JD_Unit[JD_Integers[3]])
                  • Set JD_TempPoint[2] = (JD_TempPoint[1] offset by JD_SpeedUnits[JD_Integers[3]] towards JD_Angle[JD_Integers[3]] degrees)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • JD_TreesDestroy[JD_Integers[3]] Equal to True
                    • Then - Actions
                      • Destructible - Pick every destructible within 150.00 of JD_TempPoint[2] and do (Destructible - Kill (Picked destructible))
                    • Else - Actions
                  • Unit - Move JD_Unit[JD_Integers[3]] instantly to JD_TempPoint[2]
                  • Set JD_ReachedDistance[JD_Integers[3]] = (JD_ReachedDistance[JD_Integers[3]] + JD_SpeedUnits[JD_Integers[3]])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Random integer number between 1 and 5) Equal to 1
                    • Then - Actions
                      • Special Effect - Create a special effect attached to the chest of JD_Unit[JD_Integers[3]] using JD_Effect[JD_Integers[3]]
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
                  • Set JD_RealTimer[JD_Integers[3]] = (JD_RealTimer[JD_Integers[3]] + (180.00 / (JD_Distances[JD_Integers[3]] / JD_SpeedUnits[JD_Integers[3]])))
                  • Set JD_JumpHigh[JD_Integers[3]] = ((Sin(JD_RealTimer[JD_Integers[3]])) x JD_HighSettings[JD_Integers[3]])
                  • Animation - Change JD_Unit[JD_Integers[3]] flying height to JD_JumpHigh[JD_Integers[3]] at 1000000000.00
                  • Custom script: call RemoveLocation (udg_JD_TempPoint[1])
                  • Custom script: call RemoveLocation (udg_JD_TempPoint[2])
                • Else - Actions
                  • Unit - Turn collision for JD_Unit[JD_Integers[3]] On
                  • Unit Group - Remove JD_Unit[JD_Integers[3]] from JD_Group
                  • Animation - Change JD_Unit[JD_Integers[3]]'s animation speed to 100.00% of its original speed
                  • Animation - Reset JD_Unit[JD_Integers[3]]'s animation
                  • Set JD_RealTimer[JD_Integers[3]] = 0.00
                  • Set JD_Integers[1] = (JD_Integers[1] - 1)
                  • -------- Spell-Specific Code --------
                  • For each (Integer LeapStrikeInit) from 1 to LeapStrikeMaxIndex, do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions) \\\HERE!!!
                        • If - Conditions
                          • JD_Unit[JD_Integers[3]] Equal to LeapStrikeCaster[LeapStrikeInit]
                        • Then - Actions
                          • Unit - Cause LeapStrikeCaster[LeapStrikeInit] to damage LeapStrikeTarget[LeapStrikeInit], dealing (Random real number between 10.00 and 20.00) damage of attack type Normal and damage type Normal
                          • Set LeapStrikeCaster[LeapStrikeInit] = LeapStrikeCaster[LeapStrikeMaxIndex]
                          • Set LeapStrikeCaster[LeapStrikeMaxIndex] = No unit
                          • Set LeapStrikeTarget[LeapStrikeInit] = LeapStrikeTarget[LeapStrikeMaxIndex]
                          • Set LeapStrikeTarget[LeapStrikeMaxIndex] = No unit
                          • Set LeapStrikePoint[LeapStrikeInit] = LeapStrikePoint[LeapStrikeMaxIndex]
                          • Custom script: set udg_LeapStrikePoint[udg_LeapStrikeMaxIndex] = null
                          • Set LeapStrikeVariablesSet[LeapStrikeInit] = LeapStrikeVariablesSet[LeapStrikeMaxIndex]
                          • Set LeapStrikeVariablesSet[LeapStrikeMaxIndex] = 0
                          • Set LeapStrikeMaxIndex = (LeapStrikeMaxIndex - 1)
                        • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • JD_Integers[1] Equal to 0
                    • Then - Actions
                      • Set JD_Integers[2] = 0
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
            • Else - Actions
 
Level 12
Joined
May 20, 2009
Messages
822
Yeah, that works perfect. =)

I suppose one more thing would be nice, and that is getting sounds in there.

Would I simply do something similar, somewhere else in the trigger? So that way there's a "Leaping" sound and a "Landing" sound.

Maybe it would be right after
  • JD_ReachedDistance[JD_Integers[3]] Less than JD_Distances[JD_Integers[3]]
???

EDIT: And now that I think about it, I could simply make a few modifications to these triggers which would allow me to catch some of these specific moments, so that way I don't have to bloat this main trigger. (Simply adding a few extra variables that it sets, and I pick up on when these variables are set)
 
Level 12
Joined
May 20, 2009
Messages
822
I'll ask one more thing, and I'm doing this so I don't have to make another thread.

I need another system that does knockback. I tried searching for one under the spells category, but everything there either seemed unfinished/lacking, had negative reviews, or were full-on spells and not interchangeable systems. (Where I could just make any spell with them)
 
Status
Not open for further replies.
Top