diff options
-rw-r--r-- | db/re/skill_db.conf | 9 | ||||
-rw-r--r-- | npc/003-0/trickmaster.txt | 36 | ||||
-rw-r--r-- | npc/functions/util.txt | 19 |
3 files changed, 55 insertions, 9 deletions
diff --git a/db/re/skill_db.conf b/db/re/skill_db.conf index 682cb9675..4cb9612e6 100644 --- a/db/re/skill_db.conf +++ b/db/re/skill_db.conf @@ -1735,6 +1735,9 @@ skill_db: ( Description: "Owl's Eye" MaxLevel: 20 NumberOfHits: 0 + SkillInfo: { + Quest: true + } }, { Id: 44 @@ -1742,6 +1745,9 @@ skill_db: ( Description: "Vulture's Eye" MaxLevel: 1 NumberOfHits: 0 + SkillInfo: { + Quest: true + } }, { Id: 45 @@ -1752,6 +1758,9 @@ skill_db: ( SkillType: { Self: true } + SkillInfo: { + Quest: true + } AttackType: "Weapon" DamageType: { NoDamage: true diff --git a/npc/003-0/trickmaster.txt b/npc/003-0/trickmaster.txt index fc6b1c29c..473ce2a84 100644 --- a/npc/003-0/trickmaster.txt +++ b/npc/003-0/trickmaster.txt @@ -7,13 +7,43 @@ 003-0,40,30,0 script Trickmaster NPC_BLACKALCHEMIST,{ if (!MAGIC_LVL) goto L_NoMagic; mesn; - mesq l("You are a noob."); - mesc l("You have @@/@@ magic skill points available", sk_maxpoints()-MAGIC_PTS, sk_maxpoints()); + mesc l("You have @@/@@ magic skill points available", sk_points(), sk_maxpoints()); + mesc l("If the \"Learn\" button doesn't works, it means you cannot learn/upgrade the skill in question (or it is a bug)."); + do { next; setskin "academy_trickster"; // TODO: Use a menuint with the skill ID - select ("freecast:Cancel"); + menuint + "freecast", SA_FREECAST, + "backslide", TF_BACKSLIDING, + "Cancel", 0; + mes ""; setskin ""; + + switch (@menuret) { + case TF_BACKSLIDING: + if (getskilllv(TF_BACKSLIDING) >= 1) { + mesc l("You've reached the maximum level for this skill."), 1; + break; + } + mesc l("To learn backsliding you'll need @@/@@ point(s).", 1, sk_points()); + mesc l("You'll also need the Trickmaster fee, 1x @@", getitemlink(Lockpicks)); + next; + if (askyesno() == ASK_YES) { + if (!sk_canlvup(Lockpicks, 1)) { + mesc l("Requisites not met"); + break; + } + delitem Lockpicks, 1; + sk_lvup(TF_BACKSLIDING, 1); + mesc l("Success!"); + } + break; + default: + mesc l("ERROR"); + break; + } + } while (@menuret); close; L_NoMagic: diff --git a/npc/functions/util.txt b/npc/functions/util.txt index 4e12e5fed..426219bb5 100644 --- a/npc/functions/util.txt +++ b/npc/functions/util.txt @@ -593,22 +593,29 @@ function script sk_maxpoints { return .@val; } +// Returns how many points you can allocate +function script sk_points { + return sk_maxpoints()-MAGIC_PTS; +} + // Returns true if a skill can be leveled up. -// TODO: Ideally, we would also check for skill max level... -// sk_canlvup( sk, {cost=1} ) +// sk_canlvup( item{, cost=1} ) function script sk_canlvup { - if (MAGIC_PTS+getarg(1,1) >= sk_maxpoints()) - return 1; - return 0; + return ( + countitem(getarg(0)) && + (MAGIC_PTS+getarg(1,1)) <= sk_maxpoints()); } // Level up a skill in 1 level // TODO: Return the point if leveling about Max Level -// sk_lvup( sk ) +// sk_lvup( sk{, cost=0} ) function script sk_lvup { .@lvl=getskilllv(getarg(0)); getexp 0, 50*(.@lvl+1); addtoskill(getarg(0),.@lvl+1,0); + if (getarg(1,0)) { + MAGIC_PTS+=getarg(1,0); + } return; } |