• 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 One Spell Require Another

Status
Not open for further replies.
Level 12
Joined
Dec 13, 2008
Messages
1,049
Hello everyone. I am having trouble figuring out how to make a spell's potential to be cast dependent upon the presence of another spell. For example, I only want my spell Shadowbolt (based off of Firebolt) able to be cast when Shadowform (based off of the Spiritwalker Ethereal Form ability) is cast. As of right now, Shadowform can only be cast once the 'Adept Training' upgrade has been researched, and Shadowbolt can only be cast once the 'Master Training' upgrade has been researched.

If you need any more information, let me know, thanks!
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
You can

a) Initially disable the ability for the player and enable it when the other spell is cast
  • Player - Enable/Disable *ability* for 'Player*
This is not a good solution if the player can have more than one unit with that ability.

b) Add/remove the ability at appropriate times
  • Untitled Trigger 090
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to *Abil 1*
    • Actions
      • Unit - Add *Abil 2* to (Triggering unit)
You can use a passive dummy ability to take the place of the real ability when it is not castable.

c) Disallow the ability from being cast
  • Untitled Trigger 090
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to *Ability 1*
      • *Ability 2 is not cast*
    • Actions
      • *Display error message*
      • Unit - Pause (Triggering unit)
      • Unit - Order (Triggering unit) to Stop
      • Unit - Unpause (Triggering unit)
 
Level 12
Joined
Dec 13, 2008
Messages
1,049
Do you think option (c) is the best option? It seems the most streamlined to me and it gives the potential to let the player know why they cannot cast the spell yet.
If this is the case, how would I make it so that the 'ethereal' spellcaster is not restricted by this requirement?
 
Status
Not open for further replies.
Top