1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

The mysteries of the Spellbook

Discussion in 'Trigger (GUI) Editor Tutorials' started by Diablo-dk, Apr 27, 2007.

Thread Status:
Not open for further replies.
  1. Diablo-dk

    Diablo-dk

    Joined:
    Nov 10, 2004
    Messages:
    369
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    Spellbooks:

    This tutorial introduces you how the spellbook works.

    What is a spellbook?:
    A spell book is an item ability which is able to store many different abilities.
    The spellbook works for units aswell.

    It looks like any other normal active ability ingame.
    SS0.jpg
    But it isn't. Whenever you click on it, it will open something i would call a "skill tree".
    Looks like this:
    SS1.jpg
    Inside the "skill tree" there can be several abilities inside, and are all castable.
    notice the cancel button in the lower right corner, clicking it will simply exit the spellbook, allowing the unit to do other actions.

    Cool, but what can we use them for besides storing abilities?:
    Spellbooks brings up some really usefull and unique features.
    An example is passive spell icon hiding.

    You may have heard people answering something like this when someone asks how to hide a passive skill: "place the ability inside a disabled spellbook". (sounds kind of weird)

    As not everyone knows the trick of hiding passive icons(while still having their effects), i will explain it.

    Whenever you disable a spell, the icon will be hidden and the spell completly useless.
    No, that's not 100% correct, since whenever you disable something like a channeling spell, while the caster is already channeling it, he wont stop channeling.

    How is that related to spellbooks?:
    Well, later on it was discovered that if you disable a spellbook, the only thing that changed was that the icon was gone, and is unable to be opened. BUT, all passive abilities inside the spell book still works fine!

    This was a huge discovery.
    It was finnaly possible to hide passive skills completly while still having their effects.

    This is one of the most common known features of the spellbook.

    How do i make this stuff work then?:
    First of all, create a spellbook and call it something like "dummy" or whatever you want.

    Now, go look at the field called " Data - Spell List ".
    This is where you can edit what spells there should be in the spell book.
    Remove all abilities there, and place your passive skill(s) in there.

    After you've done that, go to the trigger editor and do following:
    • Events
    • Map initialization
    • Conditions
    • Actions
    • Player - Disable <Your spellbook ability here> for Player 1 (Red)
    • // Ofcourse do this for every player.

    Add the spellbook to the unit you want to have the passive skill(s).
    Now it suddenly got all the passive skills without any icon.

    How do i add other spells to a spell book with triggers?:
    There's a simple trick for doing that.
    I will start explaining what the field " Data - Base Order Id " is used for.

    If you have 2 spellbooks on one unit, where both spellbooks have the same Base Order Id, their spells will be shared in both spell books.
    If their Base Order Id is different, it wont happen.

    Back to the point how does this help me?:
    First of all, create a new spellbook ability with the same Base Order Id as the spellbook you want to add a new ability into.

    Add the skill which you want to transfer to the other spellbook inside the newly created spellbook.
    Disable it.
    • Player - Disable <spellbook> for Player 1 (Red)
    • // Do this for all players ofcourse.

    After you've done all this, add the disabled spell book to the unit that had the other spellbook and POOF! You succesfully transfered a new ability to the spellbook. (the ability can be removed again by removing the disabled spell book)

    How do i add learned spells to a spellbook then?
    I can make an example how to do that:
    Lets pretend we want to make shockwave go into a spell book whenever it is learned.

    Start off by making a new spellbook ability and call it Hero Skills(this is the spellbook where the abilities learned should be moved into)
    Set the maximum/minimum spells to 0, and shared spell cooldown to false.(remember to remove all spells too)

    Now, create a new spellbook(we call it shockwave Adition) with the same Base order id as the previous one, and put the shockwave ability into the newly created spellbook.

    Disable the Shockwave Adition ability
    • Player - Disable Shockwave Adition for Player 1 (Red)
    • // do this for all players ofcourse.


    Create a new trigger that looks like this:
    • Events
    • Unit - A unit Learns a skill
    • Conditions
    • (Learned Hero Skill) Equal to Shockwave
    • (Level of Shockwave for (Triggering Unit)) Equal to 1
    • Actions
    • Unit - Remove Shockwave from (Triggering unit)
    • Unit - Add Shockwave Adition (Triggering unit)

    And one more important thing.
    for heroes with morphing skills, make the shockwave ability and shockwave adition ability permanent for the unit.

    After you've done this it should work perfectly, as long as you do this for Every spell which should be transfered.


    Additonal Notes:
    A spellbook only have space for 11 abilities each.

    All these spellbook bugs was discovered by Vexorian(Thank you).

    The fields " Maximum Spells " and " Minimum Spells " are a bit strange.
    i usually set them both to 11, since in some cases it seems to bug when minimum is too low or something..(i am not quite sure about those fields)

    Some other examples of spellbook usage
    http://www.clancbs.com/downloads_seperate.php?id=348
    http://www.wc3campaigns.net/showthread.php?t=80186 In case of that you didn't quite understand how to add learned spells into a spellbook, this one shows how to do it.

    Also Attached a Demo Map
    View attachment Spellbooks.w3x
    Have fun with the mysteries of the spellbook.
     
    Last edited: May 8, 2007
  2. sonkan1

    sonkan1

    Joined:
    Jan 18, 2007
    Messages:
    333
    Resources:
    0
    Resources:
    0
    Use the spellbook as ability storer.

    Introduction: This tutorial is created to teach people how to use the spell book as an ability storer. This makes it possible to have more than 4-5 abilities, very useful when you have more than 10 levels for the hero to gain (and you don't have to make 4 abilities that will have more than 50 levels). The ability we are adding to the spell book is a Bash ability

    Stage1: Preparation.

    First you should prepare the abilities so they can be added to the spell book.

    1.First make a dummy spell book ability:
    step1sd7.jpg

    this is used to add the Bash ability to the spellbook. I call it Bash Addition.

    Second, you should make a spellbook to store the ability in.
    step2sb5.jpg

    Note: If you want a totally clean spellbook to start with don't add any spell to the spell list.

    Third, you should make a dummy tome. I'm using a tome of agility for this.
    step3tw2.jpg

    NOTE: if you choose to have a hero ability then uncheck the box saying it's a hero ability, else this will cause it to not show up in the spellbook.

    Step 2: Trigger it

    Now we come to the part were we use the stuff we prepared.
    To make this work we have to trigger the ability. I am creating a trigger that allows the ability to gain level if you get more than one tome of the same type.

    • Add or Level [COLOR="Red"]Bash [/COLOR]
      • Events
        • Unit - A unit Acquires an item
      • Conditions
        • (Item-type of (Item being manipulated)) Equal to Bash
      • Actions
        • --------It will increase the level of [COLOR="Red"]Bash[/COLOR] when you already have it --------
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Level of [COLOR="Red"]Bash[/COLOR] for (Triggering unit)) Equal to 0
          • Then - Actions
            • Unit - Add [COLOR="Orange"]Bash addition[/COLOR] to (Triggering unit)
          • Else - Actions
            • -------- Don't use Increase level of ability --------
            • -------- Because it can go beyond the limit --------
            • Unit - Set level of [COLOR="Red"]Bash[/COLOR] for (Triggering unit) to ((Level of [COLOR="Red"]Bash[/COLOR] for (Triggering unit)) + 1)


    Step 4, Cleaning it up.

    This may look all fine, but! It's not. When you do like this you will end up with several icons for every ability. To avoid that we will disable the ability, using a simple trigger.

    • Disable Bash Addition
      • Events
        • Unit - A unit Learns a skill
      • Conditions
        • (Learned Hero Skill) Equal to [COLOR="Orange"]Bash Addition[/COLOR]
      • Actions
        • Player - Disable [COLOR="orange"]Bash Addition[/COLOR] for Player 1 (Red)

    What have I done here? well I just disabled the Bash Addition , so it wont show 2 images. Thats all, now enjoy your mapping =)


    Now you can add the finished tome to a shop or to be dropped by a monster.
    TIP: Use lumber as payment for the ability, this makes it easier to set a price and restrict the payments (just because the hero needs to get a piece of lumber to purchase an ability).


    :grin: Happy Mapping.:grin:
     

    Attached Files:

    Last edited by a moderator: Jul 6, 2007
  3. Wolverabid

    Wolverabid

    Joined:
    Oct 23, 2006
    Messages:
    8,302
    Resources:
    5
    Tutorials:
    5
    Resources:
    5
    Tutorial Approved!

    [EDIT]

    ~ Use the spellbook as ability storer approved.

    ~ Two threads cleaned and merged.
     
    Last edited: Jul 13, 2007
Thread Status:
Not open for further replies.