From 06c37f2568409d12ab97188b80902d6fe5d745b6 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Wed, 1 Jul 2020 00:27:01 -0300 Subject: Rewrite trickmaster, it doesn't needs to be so expensive --- npc/003-0/trickmaster.txt | 67 +++++++++++------------------------------------ 1 file changed, 15 insertions(+), 52 deletions(-) (limited to 'npc/003-0') diff --git a/npc/003-0/trickmaster.txt b/npc/003-0/trickmaster.txt index ffb09c7dd..ddabbacb6 100644 --- a/npc/003-0/trickmaster.txt +++ b/npc/003-0/trickmaster.txt @@ -19,61 +19,24 @@ l("Advanced Tricks"); mes ""; .@lv=@menu; - do { - // Display appropriate menu - if (.@lv == 1) - basicMagic(); - else if (.@lv == 2) - standardMagic(); - else if (.@lv == 3) - advancedMagic(); + do + { + // Display appropriate menu + if (.@lv == 1) + basicMagic(); + else if (.@lv == 2) + standardMagic(); + else if (.@lv == 3) + advancedMagic(); - // Handle result - switch (@menuret) { - case TMW2_MANABOMB: - if (!learn_magic(TMW2_MANABOMB)) + // Handle result + if (@menuret) { + if (!learn_magic(@menuret)) mesc l("You do not meet all requisites for this skill."), 1; - break; - case TF_BACKSLIDING: - if (!learn_magic(TF_BACKSLIDING)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case MG_FIREWALL: - if (!learn_magic(MG_FIREWALL)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case AC_VULTURE: - if (!learn_magic(AC_VULTURE)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case TMW2_FIRSTAID: - if (!learn_magic(TMW2_FIRSTAID)) - mesc l("You do not meet all requisites for this skill."), 1; - break; + } else { + closeclientdialog; + } - case SA_FREECAST: - if (!learn_magic(SA_FREECAST)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case ALL_FULL_THROTTLE: - if (!learn_magic(ALL_FULL_THROTTLE)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case GC_DARKILLUSION: - if (!learn_magic(GC_DARKILLUSION)) - mesc l("You do not meet all requisites for this skill."), 1; - break; - case NV_TRICKDEAD: - if (!learn_magic(NV_TRICKDEAD)) - 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; - } } while (@menuret); close; -- cgit v1.2.3-70-g09d2