• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Learn Spells in Spell Book

Status
Not open for further replies.
Level 6
Joined
Jul 23, 2018
Messages
243
Hello everyone, thank you for your time reading this thread.
I made a spell book ability with 3 spells for all levels. However, players can only have 1 ability at level 1 and 2 abilities at level 2 and so on. But, spells contained will not be in order, rather, players can choose the spell they want to have in current ability until ability is at max level. And I discovered something. If the hero spends 2 skill points on the ability then he won't be able to learn 2 spells because the triggers made him learn one at a time. Also, Learn Dispel Magic does not work
  • I included hotkeys so I have to disable them
  • Hero Learn
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Spell Book
    • Actions
      • Unit - For (Triggering unit), Ability Spell Book , Disable ability: True, Hide UI: True
      • Unit - Add Learn Spell Book to (Triggering unit)
      • Unit - Set level of Learn Spell Book for (Triggering unit) to (Level of Spell Book for (Triggering unit))
      • Unit - For (Triggering unit), Ability Entangling Roots (Custom), Disable ability: True, Hide UI: True
      • Unit - For (Triggering unit), Ability Dispel Magic (Custom), Disable ability: True, Hide UI: True
      • Unit - For (Triggering unit), Ability Roar (Custom), Disable ability: True, Hide UI: True
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Dummy Ability 1 for (Triggering unit)) Greater than 0
        • Then - Actions
          • Unit - For (Triggering unit), Ability Learn Entangling Roots , Disable ability: True, Hide UI: True
          • Unit - For (Triggering unit), Ability Entangling Roots (Custom), Disable ability: False, Hide UI: False
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Dummy Ability 2 for (Triggering unit)) Greater than 0
        • Then - Actions
          • Unit - For (Triggering unit), Ability Learn Dispel Magic (Custom, Disable ability: True, Hide UI: True
          • Unit - For (Triggering unit), Ability Dispel Magic (Custom), Disable ability: False, Hide UI: False
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Dummy Ability 3 for (Triggering unit)) Greater than 0
        • Then - Actions
          • Unit - For (Triggering unit), Ability Learn Roar , Disable ability: True, Hide UI: True
          • Unit - For (Triggering unit), Ability Roar (Custom), Disable ability: False, Hide UI: False
        • Else - Actions
  • S
  • Spell Learn
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Learn Entangling Roots
          • (Ability being cast) Equal to Learn Dispel Magic
          • (Ability being cast) Equal to Learn Roar
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Learn Entangling Roots
        • Then - Actions
          • Unit - For (Casting unit), Ability Entangling Roots (Custom), Disable ability: False, Hide UI: False
          • Unit - Add Dummy Ability 1 to (Casting unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Learn Dispel Magic
        • Then - Actions
          • -------- There's something wrong with this part and I don't know why --------
          • Unit - For (Casting unit), Ability Dispel Magic (Custom), Disable ability: False, Hide UI: False
          • Unit - Add Dummy Ability 2 to (Casting unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Learn Roar
        • Then - Actions
          • Unit - For (Casting unit), Ability Roar (Custom), Disable ability: False, Hide UI: False
          • Unit - Add Dummy Ability 3 to (Casting unit)
        • Else - Actions
      • Unit - Remove Learn Spell Book (Normal,Dummy) from (Casting unit)
      • Unit - For (Triggering unit), Ability Spell Book (Hero,Real), Disable ability: False, Hide UI: False
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is selected by (Owner of (Triggering unit))) Equal to True
        • Then - Actions
          • Selection - Remove (Triggering unit) from selection for (Owner of (Triggering unit))
          • Selection - Add (Triggering unit) to selection for (Owner of (Triggering unit))
        • Else - Actions

Ability


Learn Entangling Roots/Learn Dispel Magic/Learn Roar = Ability based on Channel for unhiding spells when unit casts them
Dummy Ability 1/2/3 = Ability based on Channel for detecting
Learn Spell Book = A spell book ability that contains spells that unlock spells in Spell Book (Hero,Real)
Spell Book (Hero,Real) = a spell book ability that contains the spells for casting​

 
Last edited:
Level 6
Joined
Jul 23, 2018
Messages
243
There are than 1 spell so it must be disabling an ability within a spell book rather than the spell book
In the triggers I mentioned, the player can prioritize the spells they want to learn like learning hero ability
 
There are than 1 spell so it must be disabling an ability within a spell book rather than the spell book
In the triggers I mentioned, the player can prioritize the spells they want to learn like learning hero ability
The method I discribed is not limited at all. You can add and remove any ability you want to the spellbook.
 
Simply by making a bunch of spell books with the same order id with dummy being the empty one?
Well, yes.

It works like this:
You have an enabled spellbook A for tooltip and icon that players can open.
You have a spellbook B that has the same order ID as spellbook A which has an ability C you want to add to spellbook A.
You add spellbook B to the unit.
You disable spellbook B.

You can add as many abilities to spellbook A as you want this way; you are only limited by the maximum number of displayed icons inside that spellbook.
 
Status
Not open for further replies.
Top