diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-07-01 00:35:29 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-07-01 00:35:29 -0300 |
commit | 66b36e79ce5ee8f8e461b52a5247e3cad5a16b94 (patch) | |
tree | 81ba70cd6fd1cb822f88372013037149aff5b4e1 /npc | |
parent | 16d013d97b6383d12eec631703f73922bc1c8f8d (diff) | |
download | serverdata-66b36e79ce5ee8f8e461b52a5247e3cad5a16b94.tar.gz serverdata-66b36e79ce5ee8f8e461b52a5247e3cad5a16b94.tar.bz2 serverdata-66b36e79ce5ee8f8e461b52a5247e3cad5a16b94.tar.xz serverdata-66b36e79ce5ee8f8e461b52a5247e3cad5a16b94.zip |
Remove direct calls to mlearn()
Diffstat (limited to 'npc')
-rw-r--r-- | npc/027-1/luca.txt | 38 | ||||
-rw-r--r-- | npc/027-1/saves.txt | 46 | ||||
-rw-r--r-- | npc/027-2/colin.txt | 52 |
3 files changed, 18 insertions, 118 deletions
diff --git a/npc/027-1/luca.txt b/npc/027-1/luca.txt index 477f48f7d..d61f47a03 100644 --- a/npc/027-1/luca.txt +++ b/npc/027-1/luca.txt @@ -32,38 +32,14 @@ l("Cancel"), 0; mes ""; - switch (@menuret) { - case SM_BASH: - if (!mlearn(SM_BASH, 10, 1, FluoPowder, 3)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case MC_MAMMONITE: - if (!mlearn(MC_MAMMONITE, 10, 1, FluoPowder, 3)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case AC_SHOWER: - if (!mlearn(AC_SHOWER, 10, 3, FluoPowder, 3)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case KN_AUTOCOUNTER: - if (!mlearn(KN_AUTOCOUNTER, 5, 2, FluoPowder, 3)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case ASC_METEORASSAULT: - if (!mlearn(ASC_METEORASSAULT, 3, 2, FluoPowder, 3)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case SN_SHARPSHOOTING: - if (!mlearn(SN_SHARPSHOOTING, 1, 3, FluoPowder, 3)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - default: - if (@menuret) - Exception("ERROR skill not implemented", RB_DEFAULT|RB_SPEECH); - else - closeclientdialog; - break; + // Handle result + if (@menuret) { + if (!learn_magic(@menuret)) + mesc l("You do not meet all requisites for this skill."), 1; + } else { + closeclientdialog; } + } while (@menuret); close; diff --git a/npc/027-1/saves.txt b/npc/027-1/saves.txt index 4cb146f4f..2a9eaa52f 100644 --- a/npc/027-1/saves.txt +++ b/npc/027-1/saves.txt @@ -35,46 +35,14 @@ l("Cancel"), 0; mes ""; - switch (@menuret) { - case TMW2_FIRSTAID: - if (!mlearn(TMW2_FIRSTAID, 4, 1, SpellBookPage, 1)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case TMW2_SAGE: - if (!mlearn(TMW2_SAGE, 5, 1, SpellBookPage, 1)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case HW_MAGICPOWER: - if (!mlearn(HW_MAGICPOWER, 5, 1, SpellBookPage, 1)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case SM_PROVOKE: - if (!mlearn(SM_PROVOKE, 1, 1, SpellBookPage, 1)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case EVOL_AREA_PROVOKE: - if (!mlearn(EVOL_AREA_PROVOKE, 10, 2, SpellBookPage, 1)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case TMW2_HEALING: - if (!mlearn(TMW2_HEALING, 1, 2, SpellBookPage, 1)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case SN_WINDWALK: - if (!mlearn(SN_WINDWALK, 3, 3, SpellBookPage, 1)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case CR_TRUST: - if (!mlearn(CR_TRUST, 2, 3, SpellBookPage, 1)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - default: - if (@menuret) - Exception("ERROR skill not implemented", RB_DEFAULT|RB_SPEECH); - else - closeclientdialog; - break; + // Handle result + if (@menuret) { + if (!learn_magic(@menuret)) + mesc l("You do not meet all requisites for this skill."), 1; + } else { + closeclientdialog; } + } while (@menuret); close; diff --git a/npc/027-2/colin.txt b/npc/027-2/colin.txt index 62a59126a..8ab524dbb 100644 --- a/npc/027-2/colin.txt +++ b/npc/027-2/colin.txt @@ -25,15 +25,6 @@ mesc l("Frost Nova - Freeze everything in a range"); mesc l("Note: You can exchange 1 @@ for 3 @@", getitemlink(GemPowder), getitemlink(Quill)), 1; menuint - l("Fireball"), MG_FIREBALL, - l("Holy Light"), AL_HOLYLIGHT, - l("Magic Strike"), MG_SOULSTRIKE, - l("Napalm Beat"), MG_NAPALMBEAT, - l("Frost Diver"), MG_FROSTDIVER, - l("Fire Walk"), SO_FIREWALK, - l("Frost Nova"), WZ_FROSTNOVA, - rif(getskilllv(MG_SOULSTRIKE), l("Lightining Bolt")), MG_LIGHTNINGBOLT, - //l("Nilfheim"), TMW2_NILFHEIM, rif(countitem(GemPowder), l("Exchange Gempowder for Quill")), -1, l("Cancel"), 0; mes ""; @@ -44,47 +35,12 @@ delitem GemPowder, 1; getitem Quill, 3; break; - case MG_FIREBALL: - if (!mlearn(MG_FIREBALL, 5, 1, Quill, 1)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case AL_HOLYLIGHT: - if (!mlearn(AL_HOLYLIGHT, 1, 1, Quill, 1)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case MG_SOULSTRIKE: - if (!mlearn(MG_SOULSTRIKE, 10, 1, Quill, 1)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case MG_NAPALMBEAT: - if (!mlearn(MG_NAPALMBEAT, 5, 2, Quill, 1)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case MG_FROSTDIVER: - if (!mlearn(MG_FROSTDIVER, 7, 2, Quill, 1)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case SO_FIREWALK: - if (!mlearn(SO_FIREWALK, 2, 2, Lockpicks, 1)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case WZ_FROSTNOVA: - if (!mlearn(WZ_FROSTNOVA, 4, 3, Quill, 1)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case MG_LIGHTNINGBOLT: - if (!mlearn(MG_LIGHTNINGBOLT, 4, 1, Quill, 1)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case TMW2_NILFHEIM: - if (!mlearn(TMW2_NILFHEIM, 1, 5, Quill, 1)) - mesc l("You do not meet all requisites for this skill."), 1; + case 0: + closeclientdialog; break; default: - if (@menuret) - Exception("ERROR skill not implemented", RB_DEFAULT|RB_SPEECH); - else - closeclientdialog; + if (!learn_magic(@menuret)) + mesc l("You do not meet all requisites for this skill."), 1; break; } } while (@menuret); |