• 🏆 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] Pull Spell Help

Status
Not open for further replies.
Level 10
Joined
May 28, 2009
Messages
223
Hey! Here is my problem:

I wanted to make a hero ability in my map that pulls the enemy towards my hero,
damaging them on the way they are pulled.
I'm thinking like aerial shackles (in game :grin:) but instead of the target getting forced to the ground,
I wanted the target to get pulled to the hero,
in a sliding kind of way.
I tried to make a pull spell by looking at a knockback spell tutorial but failed :thumbs_down:.
My triggering knowledge isn't really good...

Hope someone can help me!
 
Last edited:
Level 6
Joined
Jul 24, 2008
Messages
180
You need 4 variables...

Caster - Point
Target - Point
Angle - Real
Distance - Real


  • Your Casting
  • Events
  • Conditions
  • Actions
    • Set Caster = (Position of (Casting Unit))
    • Set Target = (Position of (Target Unit of Ability Being Cast))
    • Set Angle = (Angle From (Caster) To (Target))
    • Set Distance = (Distance between (Caster) and (Target))
    • Trigger - Turn On (Trigger)
Your Movement
  • Events
    • Time - Every 0.10 seconds
  • Conditions
  • Actions
    • Unit - Move (Target) Instantly to (Target) offset by ((Distance)/10) towards (Angle) degrees
    • If -
      • (Distance) Equal To ((Distance between (Caster) and (Target))/10)
    • Then -
      • Trigger - Turn Off (This Trigger)
    • Else -
      • Set Distance = (Distance between (Caster) and (Target))
I think this should work. No time to test it.
 
Last edited:
Status
Not open for further replies.
Top