• 🏆 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!

General Help Request

Status
Not open for further replies.
Level 4
Joined
Mar 24, 2012
Messages
83
Just wondering how I'd go about a class system that centres around spellbooks.
I'd have units (trainers) that would sell the spellbooks (Classes) in the form of items; you'd then buy spells to add to the book once you've got it. If you already have a spellbook/class and you go to buy one, that class is removed and replaced with the new one.
For the general sake of convince spells are permanently researched/available once acquired. I'm just not too sure on how to do this through triggering. I tried to use three arrays to store the Shop Keepers, Spellbooks and Items to no avail. :[
 
Level 12
Joined
May 22, 2015
Messages
1,051
I think I may need more details.

Do you mean they are spellbooks as in the spellbook ability? (You'd have to open the spellbook and then choose a spell to cast and I don't know how easy it is to add to them)

or is it more like you wipe away all of their abilities and then just give them the class-specific ones that they have researched?

If it is the 1st one, I don't know how to do it.

If it is the second one, you can disable abilities for players (makes them disappear completely). You'd basically just disable all of the abilities for all classes when the player chooses a new class and then enable all abilities for the new class for that player. They'd require research to be used, so you can leave those alone and the correct abilities will be usable each time. This would mean that you see all of the abilities, but a bunch of them are greyed out (can't be used until research). Not sure if that is acceptable or not.

I don't know how else you would plan to set it up based on your description.
 
Level 21
Joined
Nov 4, 2013
Messages
2,017
So if I understood this well, every spell book represents a class and these spellbooks can be bough by trainers. If you buy one, you gain the spell book skill for the corresponding class. If you buy another one, the old one is replaced by the new one. If that's so, then the trigger would look like that (assuming that there are 3 classes):

  • Buy Spellbook
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Spell Book 1
        • Then - Actions
          • Item - Remove (Item carried by (Triggering unit) of type Spell Book 2
          • Item - Remove (Item carried by (Triggering unit) of type Spell Book 3
          • Unit - Add Class 2 Skill 1 to (Triggering unit) [Repeat this command for the rest of the skills]
          • Unit - Remove Class 1 Skill 1 from (Triggering unit) [Repeat this command for the rest of the skills]
          • Unit - Remove Class 3 Skill 1 from (Triggering unit) [Repeat this command for the rest of the skills]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Spell Book 2
        • Then - Actions
          • Item - Remove (Item carried by (Triggering unit) of type Spell Book 1
          • Item - Remove (Item carried by (Triggering unit) of type Spell Book 3
          • Unit - Add Class 2 Skill 1 to (Triggering unit) [Repeat this command for the rest of the skills]
          • Unit - Remove Class 1 Skill 1 from (Triggering unit) [Repeat this command for the rest of the skills]
          • Unit - Remove Class 3 Skill 1 from (Triggering unit) [Repeat this command for the rest of the skills]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Spell Book 3
        • Then - Actions
          • Item - Remove (Item carried by (Triggering unit) of type Spell Book 1
          • Item - Remove (Item carried by (Triggering unit) of type Spell Book 2
          • Unit - Add Class 3 Skill 1 to (Triggering unit) [Repeat this command for the rest of the skills]
          • Unit - Remove Class 1 Skill 1 from (Triggering unit) [Repeat this command for the rest of the skills]
          • Unit - Remove Class 2 Skill 1 from (Triggering unit) [Repeat this command for the rest of the skills]
        • Else - Actions
Notice that the spell book items should just be dummy items. To be clearer, the spell book item should do nothing so it should have no skills at all.
Evidently you'll have to create a separate trigger where you check that if the spell book is dropped (unless it is undroppable, that would be a relief), all skills are removed. That's how it would be:

  • Drop Spell Book
    • Events
      • Unit - A unit Loses an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Spell Book 1
        • Then - Actions
          • Unit - Remove Class 1 Skill 1 from (Triggering unit) [Repeat this command for the rest of the skills]
        • Else - Actions
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Spell Book 2
        • Then - Actions
          • Unit - Remove Class 2 Skill 1 from (Triggering unit) [Repeat this command for the rest of the skills]
        • Else - Actions
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Spell Book 3
        • Then - Actions
          • Unit - Remove Class 3 Skill 1 from (Triggering unit) [Repeat this command for the rest of the skills]
        • Else - Actions
 
Status
Not open for further replies.
Top