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

looking for that specific tutorial for SpellBook LVLup

Status
Not open for further replies.
Level 16
Joined
May 2, 2011
Messages
1,345
Hello,

ive been messing around with spell books lately,


here is the link for the broken level up system tutorial that im looking for
http://www.thehelper.net/forums/showthread.php?t=110468

here is the link where the level up system was mentioned
How to: Make Spellbooks

and, while we are at it, here is what I did to level up my spell book, what do you think?

  • Trigger
    • Events
      • Unit - A unit owned by Player 4 (Purple) Starts the effect of an ability
    • Conditions
    • Actions
      • -------- 5 SKILLPOINTS --------
      • Set aaMaxLevels_temp = aaMaxLevels[5]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Ice Cube (SkillPoint)
        • Then - Actions
          • Unit - Increase level of Ice Cube for (Triggering unit)
          • Set aaSkillPoints = (aaSkillPoints - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Ice Cube for (Triggering unit)) Less than aaMaxLevels_temp
            • Then - Actions
            • Else - Actions
              • Player - Disable Ice Cube (SkillPoint) for Player 4 (Purple)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • aaSkillPoints Less than or equal to 0
            • Then - Actions
              • Player - Disable Learn New Spell for (Triggering player)
              • Selection - Remove (Triggering unit) from selection for (Triggering player)
              • Wait 0.01 seconds
              • Selection - Add (Triggering unit) to selection for (Triggering player)
            • Else - Actions
        • Else - Actions
      • -------- 4 SKILLPOINTS --------
      • Set aaMaxLevels_temp = aaMaxLevels[4]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Mass Healing (SkillPoint)
        • Then - Actions
          • Unit - Increase level of Healing Spray for (Triggering unit)
          • Set aaSkillPoints = (aaSkillPoints - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Healing Spray for (Triggering unit)) Less than aaMaxLevels_temp
            • Then - Actions
            • Else - Actions
              • Player - Disable Mass Healing (SkillPoint) for (Triggering player)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • aaSkillPoints Less than or equal to 0
            • Then - Actions
              • Player - Disable Learn New Spell for (Triggering player)
              • Selection - Remove (Triggering unit) from selection for (Triggering player)
              • Wait 0.01 seconds
              • Selection - Add (Triggering unit) to selection for (Triggering player)
            • Else - Actions
        • Else - Actions
      • -------- 3 SKILL POINTS --------
      • Set aaMaxLevels_temp = aaMaxLevels[3]
      • -------- FLAME STRIKE --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Flame Strike (SkillPoint)
        • Then - Actions
          • Unit - Increase level of Flame Strike for (Triggering unit)
          • Set aaSkillPoints = (aaSkillPoints - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Flame Strike for (Triggering unit)) Less than aaMaxLevels_temp
            • Then - Actions
            • Else - Actions
              • Player - Disable Flame Strike (SkillPoint) for (Triggering player)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • aaSkillPoints Less than or equal to 0
            • Then - Actions
              • Player - Disable Learn New Spell for (Triggering player)
              • Selection - Remove (Triggering unit) from selection for (Triggering player)
              • Wait 0.01 seconds
              • Selection - Add (Triggering unit) to selection for (Triggering player)
            • Else - Actions
        • Else - Actions
      • -------- RAIN OF FIRE --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Rain of Fire (SkillPoint)
        • Then - Actions
          • Unit - Increase level of Rain of Fire for (Triggering unit)
          • Set aaSkillPoints = (aaSkillPoints - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Rain of Fire for (Triggering unit)) Less than aaMaxLevels_temp
            • Then - Actions
            • Else - Actions
              • Player - Disable Rain of Fire (SkillPoint) for (Triggering player)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • aaSkillPoints Less than or equal to 0
            • Then - Actions
              • Player - Disable Learn New Spell for (Triggering player)
              • Selection - Remove (Triggering unit) from selection for (Triggering player)
              • Wait 0.01 seconds
              • Selection - Add (Triggering unit) to selection for (Triggering player)
            • Else - Actions
        • Else - Actions
      • -------- BLIZZARd --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Blizzard (SkillPoint)
        • Then - Actions
          • Unit - Increase level of Blizzard for (Triggering unit)
          • Set aaSkillPoints = (aaSkillPoints - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Blizzard for (Triggering unit)) Less than aaMaxLevels_temp
            • Then - Actions
            • Else - Actions
              • Player - Disable Blizzard (SkillPoint) for (Triggering player)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • aaSkillPoints Less than or equal to 0
            • Then - Actions
              • Player - Disable Learn New Spell for (Triggering player)
              • Selection - Remove (Triggering unit) from selection for (Triggering player)
              • Wait 0.01 seconds
              • Selection - Add (Triggering unit) to selection for (Triggering player)
            • Else - Actions
        • Else - Actions
      • -------- CRUSHING WAVE --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Crushing Wave (SkillPoint)
        • Then - Actions
          • Unit - Increase level of Crushing Wave for (Triggering unit)
          • Set aaSkillPoints = (aaSkillPoints - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Crushing Wave for (Triggering unit)) Less than aaMaxLevels_temp
            • Then - Actions
            • Else - Actions
              • Player - Disable Crushing Wave (SkillPoint) for (Triggering player)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • aaSkillPoints Less than or equal to 0
            • Then - Actions
              • Player - Disable Learn New Spell for (Triggering player)
              • Selection - Remove (Triggering unit) from selection for (Triggering player)
              • Wait 0.01 seconds
              • Selection - Add (Triggering unit) to selection for (Triggering player)
            • Else - Actions
        • Else - Actions
      • -------- FROST NOVA --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Frost Nova (SkillPoint)
        • Then - Actions
          • Unit - Increase level of Frost Nova for (Triggering unit)
          • Set aaSkillPoints = (aaSkillPoints - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Frost Nova for (Triggering unit)) Less than aaMaxLevels_temp
            • Then - Actions
            • Else - Actions
              • Player - Disable Frost Nova (SkillPoint) for (Triggering player)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • aaSkillPoints Less than or equal to 0
            • Then - Actions
              • Player - Disable Learn New Spell for (Triggering player)
              • Selection - Remove (Triggering unit) from selection for (Triggering player)
              • Wait 0.01 seconds
              • Selection - Add (Triggering unit) to selection for (Triggering player)
            • Else - Actions
        • Else - Actions
      • -------- 1 SKILL POINT --------
      • Set aaMaxLevels_temp = aaMaxLevels[1]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Fire Bolt (SkillPoint)
        • Then - Actions
          • Unit - Increase level of Firebolt (BM) for (Triggering unit)
          • Set aaSkillPoints = (aaSkillPoints - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Firebolt (BM) for (Triggering unit)) Less than aaMaxLevels_temp
            • Then - Actions
            • Else - Actions
              • Player - Disable Fire Bolt (SkillPoint) for (Triggering player)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • aaSkillPoints Less than or equal to 0
            • Then - Actions
              • Player - Disable Learn New Spell for (Triggering player)
              • Selection - Remove (Triggering unit) from selection for (Triggering player)
              • Wait 0.01 seconds
              • Selection - Add (Triggering unit) to selection for (Triggering player)
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Frost Bolt (SkillPoint)
        • Then - Actions
          • Unit - Increase level of Frost Bolt for (Triggering unit)
          • Set aaSkillPoints = (aaSkillPoints - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Frost Bolt for (Triggering unit)) Less than aaMaxLevels_temp
            • Then - Actions
            • Else - Actions
              • Player - Disable Frost Bolt (SkillPoint) for (Triggering player)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • aaSkillPoints Less than or equal to 0
            • Then - Actions
              • Player - Disable Learn New Spell for (Triggering player)
              • Selection - Remove (Triggering unit) from selection for (Triggering player)
              • Wait 0.01 seconds
              • Selection - Add (Triggering unit) to selection for (Triggering player)
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Inceneration (SkillPoint)
          • (Level of Inceneration for (Triggering unit)) Less than aaMaxLevels_temp
        • Then - Actions
          • Unit - Increase level of Inceneration for (Triggering unit)
          • Set aaSkillPoints = (aaSkillPoints - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • aaSkillPoints Less than or equal to 0
            • Then - Actions
              • Player - Disable Learn New Spell for (Triggering player)
              • Selection - Remove (Triggering unit) from selection for (Triggering player)
              • Wait 0.01 seconds
              • Selection - Add (Triggering unit) to selection for (Triggering player)
            • Else - Actions
        • Else - Actions
all what remains is to deselct the lvl up spell book when all points are spent.
 
Level 23
Joined
Jul 26, 2008
Messages
1,319
Level 16
Joined
May 2, 2011
Messages
1,345
Here are the top 4 results after a quick search regarding "Spellbook".

The mysteries of the Spellbook
[Spell] - Metamorphosis with Spellbook
[Spell] - Spell book
[General] - Spell Book How To add abilities or increase ability levels?

The last one even has the question you are asking (regarding levels) in the title. There is a lot of information on hiveworkshop you can gain by searching for past information.
hmmm

looks similar to my code...

but I was thinking if there was something more effecient than mine. this is quite tedious way to right; as you can see, the code is just so long, and for only 11 abilitites...
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
Back in the day the game had sort of a problem with If-blocks that have blank thens. I would suggest you invert your conditions and move the Else actions to Then actions. The way to simplify this code significantly is to use more array variables and instead of having a hardcoded check for each ability just to loop through them all and see which skill was used.
 
Level 16
Joined
May 2, 2011
Messages
1,345
Back in the day the game had sort of a problem with If-blocks that have blank thens. I would suggest you invert your conditions and move the Else actions to Then actions. The way to simplify this code significantly is to use more array variables and instead of having a hardcoded check for each ability just to loop through them all and see which skill was used.
what sort of bug?
does inserting (do nothing) in the blank thens solve it? on what patch is the bug? Thanks!
 
what sort of bug?
does inserting (do nothing) in the blank thens solve it? on what patch is the bug? Thanks!
That bug no longer exists, however, it is really bad practice to use an if/then/else statement for an if/then problem. Also, iterating through each possible spell on every spell cast is a recipe for disaster. You will introduce lag on every spell cast if you add too many spells. An alternative is GUI Spell Event. Also seeing is how each If/then/else statement is virtually identical, you can use scale-ability by simply increasing the triggering spell level.
 
Status
Not open for further replies.
Top