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

Spell O

Status
Not open for further replies.
Level 8
Joined
Sep 30, 2012
Messages
205
Hey I wanted to create a custom spell, which works kinda like the "Staff of Preservation" but could target enemy units as well, so they get ported back to their base (and not yours)

However i tried it with create "staff of preservation" and give it to dummy unit, and use it on the target unit of ability being cast.
Use item in slot one, or use item of type "Staff of Preservation" nor use dummy items seemed to work.
So now i tried with make item ability a unit ability and use it on the unit...
However thats not working either... but i'm unsure with the order id thingy..

Any thoughts? i would appreciate it! cheers

So yeah the triggers still contain the left overs of the "create item and give it to unit and all" and the wait also didn't helped... sometimes a wait 0 does the trick, not here... i know waits are bad..

wuups caption should have read spellorderid?!?

  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Chain Lightning *Recoil
        • Then - Actions
          • Set TempUnit = (Target unit of ability being cast)
          • Set TempPoint = (Position of TempUnit)
          • Set tempPlayer = (Owner of TempUnit)
          • Unit - Create 1 Templar for tempPlayer at TempPoint facing Default building facing degrees
          • Set TempUnit2 = (Last created unit)
          • Item - Create Staff of Preservation at TempPoint
          • Set DummyItem = (Last created item)
          • Hero - Give DummyItem to TempUnit2
          • Unit - Add Staff of Preservation to TempUnit2
          • Wait 1.00 seconds
          • Custom script: call IssueTargetOrderById(udg_TempUnit2,852568,udg_TempUnit)
          • Set TempUnit = No unit
          • Custom script: set udg_tempPlayer = null
          • Custom script: call RemoveLocation( udg_TempPoint )
          • Set DummyItem = No item
          • Unit - Add a 2.00 second Generic expiration timer to TempUnit2
          • Set TempUnit2 = No unit
        • Else - Actions
 
Level 8
Joined
Sep 30, 2012
Messages
205
don't really understand what you are getting at.
removed the wait and nope... not helping

  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Chain Lightning *Recoil
        • Then - Actions
          • Set TempUnit = (Target unit of ability being cast)
          • Set TempPoint = (Position of TempUnit)
          • Set tempPlayer = (Owner of TempUnit)
          • Unit - Create 1 Firelord Dummy DUMM for tempPlayer at TempPoint facing Default building facing degrees
          • Set TempUnit2 = (Last created unit)
          • Item - Create Staff of Preservation at TempPoint
          • Set DummyItem = (Last created item)
          • Hero - Give DummyItem to TempUnit2
          • Hero - Order TempUnit2 to use DummyItem on TempUnit
          • Set TempUnit = No unit
          • Custom script: set udg_tempPlayer = null
          • Custom script: call RemoveLocation( udg_TempPoint )
          • Set DummyItem = No item
          • Unit - Add a 2.00 second Generic expiration timer to TempUnit2
          • Set TempUnit2 = No unit
        • Else - Actions
my guess is that the problem is that the unit doesn't get the order in time, or an uncompromisable one

since the unit gets the item and all, but just decides to do nothing with it

do custom abilities still have the "original order id?" like if i copy the ability from staff of preservation, and make it a unit ability, does it still have the same orderid?
would that go like this?
  • Custom script: call IssueTargetOrderById(udg_TempUnit2,852568,udg_TempUnit)
 
Level 12
Joined
May 20, 2009
Messages
822
Use a dummy spell, like Holy Light with no healing/damage, or Channel with Target Unit

If unit starts the effect of an ability
Ability being cast equal to YourAbility
Create DummyUnit for Owner of Target Unit of Ability Being Cast at Position of Target Unit of Ability Being Cast
Order last created unit to windwalk
Order last created unit to Staff of Preservation Target Unit of Ability Being Cast
Add 1.00 second generic expiration timer to last created unit

Basically, Your Unit casts a spell on an ENEMY unit, and you create a DUMMY unit for the ENEMY that has the Staff of Preservation spell, then you order the dummy unit to target his friendly unit. Your dummy unit will have no attacks enabled, will have no model or shadow, will have Hide Minimap Preview = Yes, Animation - Cast Backswing and Animation - Cast Point = 0.00, will be invulnerable, and will have Windwalk.

The Windwalk ability will have to transition time = 0.00 so that way it will INSTANTLY become windwalked, which will entirely prevent any kind of pathing distraction.

This does: Make it completely invisible in all senses, in-game and on minimap, it will instantly cast abilities, it will NOT be an obstacle by other units which would mess up pathing, and will not distract or hurt other units other then by using the spell.

You have to do it like this because I don't think Staff of Preservation can actually be made to target enemy units.
 
Level 8
Joined
Sep 30, 2012
Messages
205
Well my dummy unit has locust, dummy.mdl, 0 collision size and is a flyer.
Other than that i already did it exactly as u said, but it isn't working.
The dummy unit belongs to the same player as the target, but still simply refuses to use the item..

I sometimes make dummies visible and clickable again to see if they get created, get the items and are theoretical able to use the item on the specific unit. Yes to all that. The problem really is something with uncompromisable order.

////////////////

Solved... Well other approach

  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Chain Lightning *Recoil
    • Actions
      • Set TempUnit = (Target unit of ability being cast)
      • Set tempPlayer = (Owner of TempUnit)
      • Set TempPoint2 = (Position of TempUnit)
      • Unit - Create 1 Lesser Dark Minion *Recoil Dummy for Neutral Passive at TempPoint2 facing Default building facing degrees
      • Set TempUnit3 = (Last created unit)
      • Unit - Add a 2.00 second Generic expiration timer to TempUnit3
      • Set TempUnit2 = (Random unit from (Units owned by tempPlayer matching (((Matching unit) is A town-hall-type unit) Equal to True)))
      • Set TempPoint = (Position of TempUnit2)
      • Unit - Move TempUnit instantly to TempPoint
      • Set TempUnit = No unit
      • Set TempUnit2 = No unit
      • Set TempUnit3 = No unit
      • Custom script: set udg_tempPlayer = null
      • Custom script: call RemoveLocation( udg_TempPoint2 )
      • Custom script: call RemoveLocation( udg_TempPoint )
 
Last edited:
Status
Not open for further replies.
Top