From acd03d6f8ce35fcd88455655756db196aa3e1ba0 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 19 Jul 2019 18:03:32 -0300 Subject: Prepare new utils for new skill point system --- npc/functions/util.txt | 34 ++++++++++++++++------------------ npc/guilds/logs.txt | 1 + npc/items/books.txt | 9 ++++++--- 3 files changed, 23 insertions(+), 21 deletions(-) (limited to 'npc') diff --git a/npc/functions/util.txt b/npc/functions/util.txt index 01ed71056..519c14f00 100644 --- a/npc/functions/util.txt +++ b/npc/functions/util.txt @@ -551,6 +551,7 @@ function script mstone { readparam(Sp) == readparam(MaxSp)); } +/* // Gets how many subclasses were actually filled // total_subclass( ) function script total_subclass { @@ -579,18 +580,22 @@ function script total_subclass { function script max_subclass { return (MAGIC_LVL/2); } - - -// Gets subclass current degree -// degree_subclass() -function script degree_subclass { - return (MAGIC_LVL/2)+(MAGIC_LVL%2); +*/ + +// Returns how many points you can use +function script sk_maxpoints { + // 2 points per magic level + .@val=(MAGIC_LVL)*2; + // 1 point per skill permit level + .@val+=getskilllv(TMW2_SKILLPERMIT); + return .@val; } -// Returns true if a skill can be leveled up, based on degree_subclass(). -// sk_canlvup( sk ) +// Returns true if a skill can be leveled up. +// Ideally, we would also check for skill max level... +// sk_canlvup( sk, {cost=1} ) function script sk_canlvup { - if (getskilllv(getarg(0)) <= degree_subclass()) + if (MAGIC_PTS+getarg(1,1) >= sk_maxpoints()) return 1; return 0; } @@ -604,15 +609,7 @@ function script sk_lvup { return; } -// Returns the intelligence cost based on skill level -// sk_intcost( sk ) -function script sk_intcost { - .@cost=(getskilllv(getarg(0))+1)*10; - if (readparam(bInt) >= .@cost) - return 1; - return 0; -} - +/* // Magic School Learning Interface // mlearn( skill, {item 1, amount 1}, {item 2, amount 2}... ) // returns false if cheater @@ -651,6 +648,7 @@ function script mlearn { return true; } +*/ // Returns a value defining your current magic control (affects success ratio, higher is better) // A value of '5' means perfect control, and a value of '0' means overwhelm. diff --git a/npc/guilds/logs.txt b/npc/guilds/logs.txt index a255eb566..f374c8800 100644 --- a/npc/guilds/logs.txt +++ b/npc/guilds/logs.txt @@ -116,6 +116,7 @@ guilds,47,39,0 script Guild Logs NPC_NO_SPRITE,{ if (@menu == 1 && $GUILD_BANK[.@gid] >= .@price) { $GUILD_BANK[.@gid]-=.@price; + // guildskill()? skill GD_EXTENSION, getskilllv(GD_EXTENSION)+1, 0; break; } diff --git a/npc/items/books.txt b/npc/items/books.txt index 23469db7b..b39120e2a 100644 --- a/npc/items/books.txt +++ b/npc/items/books.txt @@ -177,9 +177,9 @@ OnInit: mes ""; select - rif2(1, MAGIC_LVL >= 2, l("Ch 1 — Prologue")), + rif2(1, MAGIC_LVL, l("Ch 1 — Prologue")), rif2(2, MAGIC_EXP, l("Ch 2 — Mana Magic vs Common Magic")), - rif2(3, MAGIC_LVL >= 2, l("Ch 3 — Subclass")), + rif2(3, MAGIC_LVL, l("Ch 3 — Subclass")), rif2(4, true, l("Open Fishing Book")), rif2(5, true, l("Open Petcaring Book")), rif2(6, getq(NivalisQuest_BlueSageSlimes) >= 2, l("Open Recipe Book")), @@ -193,7 +193,7 @@ OnInit: l("Mana is something which existed since the being, but nobody knows much about."), l("This book will write itself, and reveal you the Secret Of Mana."), l("Give it time, increase your magic power, and you'll find out the truth."), - l("Your current maximum magic efficiency is @@. This book allows you many new possibilities.", MAGIC_LVL); + l("You are a @@º degree mage. This book allows you many new possibilities.", MAGIC_LVL); break; case 2: narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, @@ -239,6 +239,7 @@ OnInit: next; break; case 3: + /* mesc l("You currently have @@/@@ subclass(es).", total_subclass(),max_subclass()); if (MAGIC_SUBCLASS & CL_PALADIN) mesc lg("Paladin"); @@ -256,6 +257,8 @@ OnInit: mesc lg("Sage"); if (MAGIC_SUBCLASS & CL_PRIEST) mesc lg("Priest"); + */ + mesc l("DEPRECATED"); next; break; case 4: -- cgit v1.2.3-60-g2f50