How to add spells to spell books has been know for ages, or at least sometime (no offense to anyone), I have even made a little amatuer system or what to call it for this.
"System"
The system is in JASS but jass is not needed for the adding part, this is how you do:
1. Create A Spell Book ability. Every unit that should use this ability is supposed to have it in the object editor. The Spell Book should be empty but with full ability support. (Max abilitys = 12 or whatever the maximum is and min abilities = 0)
2. For
each spell that should be added to the spell book, make a new spell book. Add one ability to each spell book but the one made in step 1. All spell books must have the same orderid / orderstring
3. Triggers !!
How you make this may be alittle different depending on your skill with the we, but this is the layout of the trigger:
With skill points:
Code:
Events
Unit - A unit Learns a skill
Conditions
(Learned Hero Skill) Equal to <Spell>
(Level of <Spell> for (Triggering unit)) Equal to 1
Actions
Unit - Remove <Spell> from (Triggering unit)
Unit - Add <Spell Book that holds the removed spell> to (Triggering unit)
With items (level):
Code:
Add or Level Shockwave
Events
Unit - A unit Acquires an item
Conditions
(Item-type of (Item being manipulated)) Equal to <Item that should give Spell)
Actions
// Do u want to remove the item?
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of <Spell> for (Triggering unit)) Equal to 0
Then - Actions
Unit - Add <Spell Book that holds Spell> to (Triggering unit)
Else - Actions
Unit - Set Level of <Spell> for (Triggering unit) to ((Level <Spell> for (Triggering unit)) + 1)
Also you have to dissable all spell books (but the one in step 1) for all players
Code:
Map Initialization
Events
Map initialization
Conditions
Actions
For each (Integer A) from 1 to 12, do (Actions)
Loop - Actions
Player - Disable <Spell Book 1> for (Player((Integer A)))
Player - Disable <Spell Book 2> for (Player((Integer A)))
A tips is to have a unit that haves ALL the spell books and remove that unit at map initialization, this is to prevent lag. Also this may bugg with morphing abilities, if you want it to not bugg you have to use jass
If you want something to look at: Find "vexorians 2 spell book experiments" (is that the name?) somewhere, I dont know if it is to be found anywhere now when wc3c is a little :nuts: