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

spellbook question

Status
Not open for further replies.
Level 1
Joined
Jul 25, 2004
Messages
6
hello, i have a trigger problem. what i want this trigger to do is..when i buy an item such as for instance "cure" it will replace the old spellbook with a new one adding that skill to the new spellbook.
here is my trigger:

Events
Unit - A unit Sells an item (from shop)

Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (Buying unit)) Equal to Priest
(Item-type of (Sold Item)) Equal to Cure

Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Learned Hero Skill) Equal to Priest Spell Book 0
Then - Actions
Unit - Remove Priest Spell Book 0 from (Buying unit)
Unit - Add Priest Spell Book 1 to (Buying unit)
Item - Remove (Sold Item)
Else - Actions
Do nothing


Being spell book 0 has no skills in it and is the starting skill for the hero..as spell book 1 has the cure spell in it

help is appreciated, thanks
 
Level 9
Joined
Sep 8, 2004
Messages
633
this part is wrong:

{Learned Hero Skill) Equal to Priest Spell Book 0


This, because Learned Hero Skill refers to a hero skill learned in the event of the trigger. but that isn't what happens.
Find another condition, and it'll work.
(i think there's a condition: if skill level of (ability) is equal to lvl X. Not sure)
 
Level 4
Joined
Aug 31, 2004
Messages
106
There is an easier way to do it without having a different spell book for each new thing added. Have one spellbook with all the spells you can learn, and then disable the ones you don't want available yet for that player at the beginning of the game. Then, when you buy the item cure, just enable the cure spell for that player and it will start appearing in the spell book.
That won't work though if you're doing it for different units owned by the same player though.
 
Status
Not open for further replies.
Top