• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

How to Make One Spell Require Another

Status
Not open for further replies.
Level 11
Joined
Dec 13, 2008
Messages
1,047
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,240
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 11
Joined
Dec 13, 2008
Messages
1,047
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?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Make it replace it temporarily.

If a hero ability, that the hero has in object editor, is removed during the game, then the hero can still learn it back.

If the hero learns the ability while the unit has the dummy ability, you need to remove the learned ability and level up the dummy ability.
 
Status
Not open for further replies.
Top