From 4d6d99d9117b1de60bb8ac1f55e2dcafdd3095c5 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Wed, 29 May 2019 16:53:40 -0300 Subject: We now have the functions to build the menu. Now we need to really build it. --- npc/craft/options.txt | 50 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 12 deletions(-) (limited to 'npc/craft') diff --git a/npc/craft/options.txt b/npc/craft/options.txt index 27ca1bc9e..d1384a21e 100644 --- a/npc/craft/options.txt +++ b/npc/craft/options.txt @@ -545,16 +545,6 @@ function script csysGUI_OptToogleMenu { } -// csysGUI_OptToogleMenu( cr ) -// Returns a Toogle Menu for option group (CR) -function script csysGUI_GroupOpt { - .@sk=getarg(0); - if (csysGUI_OptReq(.@sk)) - .@ms$="" - return ":"; -} - - // csysGUI_OptReq( cr ) // Return true if all requisites for Option were met function script csysGUI_OptReq { @@ -635,11 +625,47 @@ function script csysGUI_OptReq { // Return group option price and requisites function script csysGUI_OptPrice { .@sk=getarg(0); + .@lv=getd("CRAFTSYS["+.@sk+"]"); switch (.@sk) { + case CRGROUP_BASE: + return 1000*.@lv; + // Tier 1 + case CRGROUP_ATK: + case CRGROUP_DEF: + case CRGROUP_ACC: + case CRGROUP_EVD: + return 10000*.@lv; + // Tier 2 + case CRGROUP_REGEN: + case CRGROUP_SPEED: + case CRGROUP_DOUBLE: + case CRGROUP_MAXPC: + return 40000*.@lv; + // Tier 3 + case CRGROUP_SCRESIST: + case CRGROUP_SCINFLICT: + case CRGROUP_MANAUSE: + case CRGROUP_BOSSATK: + return 120000*.@lv; + // Final + case CRGROUP_FINAL: + return 200000*.@lv; + default: + return Exception("Invalid optprice group: "+.@cr); } - - return ":"; + return Exception("Definitely Invalid optprice group: "+.@cr); } +// csysGUI_GroupOpt( cr ) +// Returns the menu entry to learn the group skill. +// Cost is NOT taken as requisite, must check it later. +function script csysGUI_GroupOpt { + .@sk=getarg(0); + if (csysGUI_OptReq(.@sk)) { + .@ms$="Upgrade "+csysGUI_CRName(.@sk)+" for "+csysGUI_OptPrice(.@sk)+" Mobpt"; + } + return ""; +} + -- cgit v1.2.3-60-g2f50