• 🏆 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] Need help with a spell

Status
Not open for further replies.
Level 8
Joined
Aug 19, 2007
Messages
294
When you cast the spell, the caster and the target should chance place.
This my my work, but it only teleport the caster to the target.
  • Switch Place
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Switch Place
    • Actions
      • Unit - Create 1 Dummy unit - Switch Place for Neutral Passive at (Position of (Casting unit)) facing Default building facing degrees
      • Unit - Move (Casting unit) instantly to (Position of (Target unit of ability being cast))
      • Unit - Move (Target unit of ability being cast) instantly to (Position of (Last created unit))
      • Unit - Kill (Last created unit)
I hope you will help me
 
Level 12
Joined
Jul 27, 2008
Messages
1,181
Better use a global for the transfer, such as:
  • Switch Place
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to Switch Place
  • Actions
    • Set Position_1 = Position of (Casting unit)
    • Set Position_2 = Position of (Target unit of Ability being cast)
    • Unit - Move (Casting unit) instantly to (Position_1)
    • Unit - Move (Target unit of ability being cast) instantly to (Position_2)
    • Custom Script: call RemoveLocation(udg_Position_1)
    • Custom Script: call RemoveLocation(udg_Position_2)
You need 2 global location variables, Position_1 and Position_2.
 
Last edited:
Level 8
Joined
Aug 19, 2007
Messages
294
I think you mean this:
  • Switch Place
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Switch Place
    • Actions
      • Set Posion_1 = (Position of (Casting unit))
      • Set Posion_2 = (Position of (Target unit of ability being cast))
      • Unit - Move (Casting unit) instantly to Posion_2
      • Unit - Move (Target unit of ability being cast) instantly to Posion_1
      • Custom script: call RemoveLocation(udg_Posion_1)
      • Custom script: call RemoveLocation(udg_Posion_2)
But it still wont work, only the casting unit are going to tele.

EDIT: Now it works, thx for your time.
 
Last edited:
Status
Not open for further replies.
Top