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

Ordering my dummy to cast a spell

Status
Not open for further replies.
Level 5
Joined
Jun 28, 2008
Messages
127
How do I make my dummy unit cast a spell when the hero casts a spell. I have my hero casting thunder clap (holy nova is custom name) and I want my dummy to cast essence of blight (holy nova heal is custom name) at the same time.

Here is where i'm at so far.

  • Holy Nova
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Holy Nova
    • Actions
      • Set caster = (Triggering unit)
      • Unit - Create 1 Dummy Unit for (Owner of caster) at (Position of caster) facing (Facing of caster) degrees
      • Set dummy = (Last created unit)
      • Unit - Set level of Holy Nova Heal for dummy to (Level of Holy Nova for caster)
Thanks :thumbs_up:
 
Level 8
Joined
Aug 4, 2006
Messages
357
To make it work, you only need to add one more line. However, you have a point leak so I cleaned that up for you with some custom script.
  • Holy Nova
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Holy Nova
    • Actions
      • Set caster = (Triggering unit)
      • Set tempPoint = (Position of caster)
      • Unit - Create 1 Dummy Unit for (Owner of caster) at tempPoint facing (Facing of caster) degrees
      • Set dummy = (Last created unit)
      • Unit - Set level of Holy Nova Heal for dummy to (Level of Holy Nova for caster)
      • Unit - Order dummy to Undead Obsidian Statue - Essence of Blight
      • Custom script: call RemoveLocation(udg_tempPoint)
You need to make a point variable called tempPoint. If you want to know more about leaks, find out here: http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/basic-memory-leaks-5889/ among other places.
 
Level 5
Joined
Jun 28, 2008
Messages
127
@maskedpoptart - Thanks for the help, unfortunately it still doesn't work!

The dummy doesn't cast the spell I want him to (the essence of blight)... :(

Maybe there is another way to order a unit to cast a spell? Just guessing here lol

Thanks
 
Level 8
Joined
Aug 4, 2006
Messages
357
I'd suggest making the dummy visible for testing purposes. Do you see it spawn? Do you see it not cast the spell? Also, make sure the Text - Order String of your dummy's ability is "replenishlife" (order string for essence of blight). Keep in mind you may not see any units being healed if they are all at full health. I don't know what else could be the problem.
 
Status
Not open for further replies.
Top