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

How to make a hero cast spells?

Status
Not open for further replies.
Level 6
Joined
Dec 27, 2006
Messages
100
Okay so i am making a boss which is a hero, i give him abilities and he doesn't use them, is there an option in WE which will make him cast them by himself?

I also realise there is the option of 'Order Unit to Mountain King - Thunderclap' and all that stuff but is there a way i can make a unit cast a custom spell? because i have made all these really fancy spells but i can't get the unit to actually use them.

Thanks in advance.

PS: While i'm here i'll ask this extra BONUS question: In my map i want to make it so that when a hero dies, a message pops up saying "(Owner of dying unit)'s hero has been killed!" and to delete the default message saying "Blabla the blabla (Level X) has been slain".
 
Level 7
Joined
Aug 29, 2007
Messages
336
You'll have to do it through triggers. And if you want the hero to cast a custom spell, just use the trigger "order unit to - [The ability you've based the custom spell on]"
Like if you've modified Thunderclap you can use "Order unit to - [Mountain King - Thunderclap]
 
Level 11
Joined
Feb 16, 2009
Messages
760
For question 1: with your custom spells check up the Order ID.
If it is for example thunderbolt, you must use Orer unit to Mountain King- Thunderbolt
For question 2: Look in gameplay conants or the other one in Advanced in terrain editor, there is the message probaly. Then make a trigger. If you want to include the hero's name and your own string, use the substring function
 
Level 6
Joined
Dec 27, 2006
Messages
100
For question 2: Look in gameplay conants or the other one in Advanced in terrain editor, there is the message probaly. Then make a trigger. If you want to include the hero's name and your own string, use the substring function

Yes i have created a trigger which says stuff, but i don't want the default message to appear, yet at the moment it comes us with "Error message missing!" AND the trigger stuff i put in, how do i completely remove the default message?
 
Level 6
Joined
Dec 27, 2006
Messages
100
But then it would look something like this right?

Code:
Revive Hero Message
    Events
        Unit - A unit Dies
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        Cinematic - Clear the screen of text messages for (All players)
        Wait 1.00 seconds
        Game - Display to (All players) the text: ((Name of (Owner of (Dying unit))) + 's hero has been killed!)
        Game - Display to (Player group((Owner of (Dying unit)))) the text: You have lost 500 gold
 
Level 12
Joined
Aug 22, 2008
Messages
911
[ t r i g g e r ]
(Trigger)
[ / t r i g g e r ]

And for the hero message I guess you'll have to do "Cinematic - Clear all messages for Owner of Triggering Unit" after the unit's death time has ended and then write your message.
Or option 2: Change it in the gameplay stuff. Don't remember exactly where.
 
Status
Not open for further replies.
Top