• 🏆 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!

Force Pull Spell Please

Status
Not open for further replies.
Level 3
Joined
Aug 9, 2009
Messages
27
Working on a hero arena that happens to have yoda, and I would love to give him a force pull spell. What I would like to happen is:
- Have a single target for the spell
- The target gets pulled to the caster (preferably not instantly)
- The target is stunned for 3 seconds
- any animations that you think would look cool (not needed but would like)

Will give +rep and credit in the spell tooltip
 
Level 3
Joined
Aug 9, 2009
Messages
27
I'm not exactly sure how I could get the unit to be "pulled" in a straight line using that method
 
Level 7
Joined
May 3, 2007
Messages
210
Explain what you would like to happen better. Is Yoda channeling the spell? or is it an instant cast with just a velocity towards him instead of a teleport?

Another Life Drain could work yeah, but it would probably be better to use a single target stun like storm bolt for this one. I.e. what would happen in my mind:

Spell is cast : Unit is stunned and pulled : the duration in travel distance between the caster and the target is three seconds (3 second stun) : Unit is by Yoda.
 
Level 3
Joined
Aug 9, 2009
Messages
27
That's close but i was thinking more along the lines of the target is pulled and the travel duration is 1-2 sec and after the target reaches Yoda it is stunned for 3 seconds
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Let me know what you think of this (map attached) :

  • Pull Launch Multi
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Pull multi
    • Actions
      • -------- -------------------- --------
      • Set Temp_Unit_1 = (Triggering unit)
      • Set Pull_Caster_Pos = (Position of (Triggering unit))
      • -------- -------------------- --------
      • Set Temp_Group = (Units within 800.00 of Pull_Caster_Pos matching ((((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit))) Equal to True) and (((Matching unit) is A structure) Equal to False)))
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Set Temp_Loc_1 = (Position of (Picked unit))
          • -------- -------------------- --------
          • Set Temp_Integer_1 = (Level of Pull multi for (Triggering unit))
          • Set Temp_Real_1 = (Angle from Temp_Loc_1 to Pull_Caster_Pos)
          • Set Temp_Real_2 = (Distance between Temp_Loc_1 and Pull_Caster_Pos)
          • -------- Upper value for exponential and sinusoidal speed, lower for linear --------
          • Set Temp_Real_3 = 0.98
          • Set Temp_Real_3 = 15.00
          • -------- -------------------- --------
          • Unit Group - Add (Picked unit) to Pull_Group
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Other\Tornado\Tornado_Target.mdl
          • -------- -------------------- --------
          • Hashtable - Save Temp_Real_1 as (Key Angle) of (Key (Picked unit)) in Hash_Pull
          • Hashtable - Save Temp_Real_2 as (Key Dist) of (Key (Picked unit)) in Hash_Pull
          • Hashtable - Save Temp_Real_2 as (Key DistO) of (Key (Picked unit)) in Hash_Pull
          • Hashtable - Save Temp_Real_3 as (Key Speed) of (Key (Picked unit)) in Hash_Pull
          • Hashtable - Save Temp_Integer_1 as (Key level) of (Key (Picked unit)) in Hash_Pull
          • Hashtable - Save Handle OfTemp_Unit_1 as (Key caster) of (Key (Picked unit)) in Hash_Pull
          • Hashtable - Save Handle Of(Last created special effect) as (Key sfx) of (Key (Picked unit)) in Hash_Pull
          • Custom script: call RemoveLocation(udg_Temp_Loc_1)
      • -------- -------------------- --------
      • Custom script: call DestroyGroup(udg_Temp_Group)
      • Custom script: call RemoveLocation(udg_Temp_Loc_1)
      • Custom script: call RemoveLocation(udg_Pull_Caster_Pos)
      • -------- -------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Pull Loop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Pull Loop <gen>
          • Trigger - Turn on Pull Remove Dummy <gen>
        • Else - Actions


  • Pull Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Pull_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • -------- -------------------- --------
              • Set Temp_Unit_1 = (Load (Key caster) of (Key (Picked unit)) in Hash_Pull)
              • Set Temp_Real_1 = (Load (Key Angle) of (Key (Picked unit)) from Hash_Pull)
              • Set Temp_Real_2 = (Load (Key Dist) of (Key (Picked unit)) from Hash_Pull)
              • Set Temp_Real_3 = (Load (Key Speed) of (Key (Picked unit)) from Hash_Pull)
              • Set Temp_Real_4 = (Load (Key DistO) of (Key (Picked unit)) from Hash_Pull)
              • Set Temp_Integer_1 = (Load (Key level) of (Key (Picked unit)) from Hash_Pull)
              • -------- -------------------- --------
              • Set Temp_Loc_1 = (Position of (Picked unit))
              • -------- Sinusoidal speed --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Temp_Real_4 x 0.50) Less than or equal to (Temp_Real_2 + 64.00)
                • Then - Actions
                  • -------- First part --------
                  • Set Temp_Real_3 = (Temp_Real_2 x (0.04 + Temp_Real_3))
                  • Set Temp_Loc_2 = (Temp_Loc_1 offset by (Temp_Real_3 - Temp_Real_2) towards Temp_Real_1 degrees)
                  • Set Temp_Real_2 = (Temp_Real_2 - (Temp_Real_3 - Temp_Real_2))
                • Else - Actions
                  • -------- Second part --------
                  • Set Temp_Real_3 = (Temp_Real_2 x Temp_Real_3)
                  • Set Temp_Loc_2 = (Temp_Loc_1 offset by (Temp_Real_2 - Temp_Real_3) towards Temp_Real_1 degrees)
                  • Set Temp_Real_2 = (Temp_Real_2 - (Temp_Real_2 - Temp_Real_3))
              • -------- Exponential speed --------
              • Set Temp_Real_3 = (Temp_Real_2 x Temp_Real_3)
              • Set Temp_Loc_2 = (Temp_Loc_1 offset by (Temp_Real_2 - Temp_Real_3) towards Temp_Real_1 degrees)
              • Set Temp_Real_2 = (Temp_Real_2 - (Temp_Real_2 - Temp_Real_3))
              • -------- Linear speed --------
              • Set Temp_Loc_2 = (Temp_Loc_1 offset by Temp_Real_3 towards Temp_Real_1 degrees)
              • Set Temp_Real_2 = (Temp_Real_2 - Temp_Real_3)
              • -------- -------------------- --------
              • Unit - Move (Picked unit) instantly to Temp_Loc_2
              • Unit - Make (Picked unit) face ((Facing of (Picked unit)) - 180.00) over 0.30 seconds
              • -------- -------------------- --------
              • Unit - Cause Temp_Unit_1 to damage (Picked unit), dealing (5.00 x (Real(Temp_Integer_1))) damage of attack type Spells and damage type Normal
              • Unit - Set life of Temp_Unit_1 to ((Life of Temp_Unit_1) + ((Real(Temp_Integer_1)) x Pull_Health_Conversion))
              • -------- -------------------- --------
              • Set Pull_Loop_Light_SFX = (Load (Key light) of (Key (Picked unit)) in Hash_Pull)
              • Lightning - Destroy Pull_Loop_Light_SFX
              • Set Temp_Loc_4 = (Temp_Loc_2 offset by Temp_Real_2 towards Temp_Real_1 degrees)
              • Lightning - Create a Magic Leash lightning effect from source Temp_Loc_4 to target Temp_Loc_1
              • Custom script: call RemoveLocation(udg_Temp_Loc_4)
              • -------- -------------------- --------
              • Hashtable - Save Temp_Real_2 as (Key Dist) of (Key (Picked unit)) in Hash_Pull
              • Hashtable - Save Handle Of(Last created lightning effect) as (Key light) of (Key (Picked unit)) in Hash_Pull
              • -------- -------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Temp_Real_2 Less than or equal to 128.00
                • Then - Actions
                  • Unit Group - Remove (Picked unit) from Pull_Group
                  • -------- -------------------- --------
                  • Set Temp_Loc_3 = (Random point in PullLoc <gen>)
                  • Unit - Create 1 Footman for Neutral Passive at Temp_Loc_3 facing Temp_Loc_1
                  • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
                  • -------- -------------------- --------
                  • Set Pull_Stun_Stun_SFX = (Load (Key sfx) of (Key (Picked unit)) in Hash_Pull)
                  • Special Effect - Destroy Pull_Stun_Stun_SFX
                  • Set Pull_Loop_Light_SFX = (Load (Key light) of (Key (Picked unit)) in Hash_Pull)
                  • Lightning - Destroy Pull_Loop_Light_SFX
                  • -------- -------------------- --------
                  • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Hash_Pull
                  • -------- -------------------- --------
                  • Custom script: call RemoveLocation(udg_Temp_Loc_3)
                • Else - Actions
            • Else - Actions
              • Unit Group - Remove (Picked unit) from Pull_Group
              • -------- -------------------- --------
              • Set Pull_Stun_Stun_SFX = (Load (Key sfx) of (Key (Picked unit)) in Hash_Pull)
              • Special Effect - Destroy Pull_Stun_Stun_SFX
              • Set Pull_Loop_Light_SFX = (Load (Key light) of (Key (Picked unit)) in Hash_Pull)
              • Lightning - Destroy Pull_Loop_Light_SFX
              • -------- -------------------- --------
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Hash_Pull
          • Custom script: call RemoveLocation(udg_Temp_Loc_1)
          • Custom script: call RemoveLocation(udg_Temp_Loc_2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Pull_Group is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Trigger - Turn off Pull Remove Dummy <gen>
        • Else - Actions
  • Pull Remove Dummy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Storm Bolt Dummy
    • Actions
      • Wait 3.00 seconds
      • Unit - Remove (Triggering unit) from the game
There's some special effects, life gain for caster, damage to targets, units rotate when pulled and their pull movement speed first increases slowly, and at halfway to caster it begins to slow down etc.
 

Attachments

  • uusiuusitesti.w3x
    28.4 KB · Views: 42
Level 3
Joined
Aug 9, 2009
Messages
27
The pull single is perfect. Exactly what i needed. AMAZING. My map is finally getting somewhere. 2 Heroes down and only 22 more to go, although i don't think the spells for the rest should be as complicated, but you never know. I guess I'll just have to wait and see. (+rep for you by the way and credit in the spell tooltip)
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
You could add expiration timer instead of using wait for the stun.

I guess so, although using that still leaves a corpse of the unit if it is of certain unit type. I used the wait for something else, but cut it off, so that 3 seconds wait is kind of too long anyway :)

The pull single is perfect. Exactly what i needed. AMAZING. My map is finally getting somewhere. 2 Heroes down and only 22 more to go, although i don't think the spells for the rest should be as complicated, but you never know. I guess I'll just have to wait and see. (+rep for you by the way and credit in the spell tooltip)

I'm glad to hear that. Let me know if you want it to be adjusted in some way. Or if you need other spells.

EDIT: Updated the ability a bit. Now it updates the location of the caster if you move while you pull the target. You can now squeeze some extra damage out of it by moving after you cast the spell. Since the effect of the spell ends after the target gets pulled close enough, you can move away so it lasts longer and does more damage and heals you more. I've capped the damage, so the effect ends, you can't pull them forever =)

Test the old version, cast the ability and then move a bit right away, sideways or backwards. Then try the same with this new version. The difference is clear, and looks/feels cool if I say so myself =)

I might use this spell in my own campaign too...
 

Attachments

  • uusiuusitesti.w3x
    28.5 KB · Views: 38
Last edited:
Level 3
Joined
Aug 9, 2009
Messages
27
You're definitely right, the new version looks perfect when you move away.
Definitely an amazing spell, and if I need help with any others I know who to ask.
 
Status
Not open for further replies.
Top