• 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.

[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