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

How to Change Spell Steal Interaction with Buffs?

Status
Not open for further replies.
Not sure if this can work?

  • Spell Steal
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Spell Steal
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) has buff Entangling Roots) Equal to True
        • Then - Actions
          • Unit - Remove Entangling Roots buff from (Target unit of ability being cast)
          • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
          • Unit - Add Entangling Roots (Neutral Hostile 1) to (Last created unit)
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Night Elf Keeper Of The Grove - Entangling Roots (Random unit from (Units within 600.00 of (Position of (Triggering unit)) matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is A flying unit) Equal to False) and ((((Matching uni
        • Else - Actions
The trigger is too long to be shown here, but basically you just make sure that the dummy unit doesn't try to cast entangling roots on a dead target and a target that can't be targeted with such spells (mechanical, magic immune, flying etc) and then checking if the target is an enemy of the owner of triggering unit (not shown in the trigger as it's too long).


Furthermore the target unit needs to have a steal-able negative buff so base an ability on cripple, remove all negative properties in the object editor and remove all art stuff from the effect. Also change the duration of the buff to reflect that of Entangling Roots. Then you change the icon and description of the effect. It will look like the unit has two buffs but that's the price you have to pay I guess. Then you use this trigger to apply the buff:

  • Entangling Roots
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Entangling Roots
    • Actions
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Cripple to (Last created unit)
      • Unit - Order (Last created unit) to Undead Necromancer - Cripple (Target unit of ability being cast)

The only negative thing about this is that the duration of entangling roots will not be transferred to the new unit. A new entangling roots will be cast with a new duration.

I am sure you can save the buff duration to a real, and then changing the buff duration on the new target to reflect the real variable by subtracting elapsed time (not tested or even checked) but that's more work than I care to do right now :p

Also remember to remove your leaks:

  • DummyRemoveLeaks
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Dummy
    • Actions
      • Unit - Remove (Triggering unit) from the game

Also remember to remove the point leaks (custom script).



Attaching a map with a working version.
 

Attachments

  • Test.w3x
    20.2 KB · Views: 21
Last edited:
Level 9
Joined
Jul 30, 2018
Messages
445
Ugh.. That feels awfully complicated. Just trigger it with hashtables. Base the ability on something that you know can be dispelled (like the suggested Cripple), then set the speed of unit to 0 upon cast. In the periodic event check if the unit still has the buff, if it has deal damage, if not set it's move speed to normal and remove the unit from the hashtable.

If you don't know how to use hashtables, there are great tutorials and they are really very simple.
 
Level 16
Joined
May 2, 2011
Messages
1,345
hmmm,

if the buff is transferred from unit A to unit B, is there a way to detect both units? or only Unit A will be detected? because I have to make sure that the buff is transferred to the correct unit.

random unit solution will prolly not suffice.

if I transfer Cripple From my unit to enemy unit...
 
Status
Not open for further replies.
Top