From eb074c8e29521749639368f2d9fca4ab1e728b34 Mon Sep 17 00:00:00 2001 From: gumi Date: Tue, 9 Aug 2016 14:10:24 -0400 Subject: add Super Menu, add scripted MOTD, add MOTD config --- npc/commands/motd.txt | 182 ++++++++++++++++++++++++++++++++++++++++++++++++++ npc/commands/numa.txt | 49 ++++++++++++++ npc/scripts.conf | 2 + 3 files changed, 233 insertions(+) create mode 100644 npc/commands/motd.txt create mode 100644 npc/commands/numa.txt diff --git a/npc/commands/motd.txt b/npc/commands/motd.txt new file mode 100644 index 00000000..4bf3a11c --- /dev/null +++ b/npc/commands/motd.txt @@ -0,0 +1,182 @@ +function script displayMOTD { + .@size = getvariableofnpc(.size, "@motd"); + .@dsize = getvariableofnpc(.dsize, "@motd"); + + // generic MOTD + for (.@i = 0; .@i < .@size; ++.@i) + { + dispbottom $MOTD_Messages$[.@i]; + } + + // git stuff and such + if (debug) + { + for (.@i = 0; .@i < .@dsize; ++.@i) + { + dispbottom $Debug_Messages$[.@i]; // FIXME: send this to the Debug tab instead + } + } + return; +} + +function script MOTDConfig { + + function toggleMOTD { + $MOTD_Disabled = !($MOTD_Disabled); + // FIXME: log to GM log + } + + function addNewLine { + clear; + mes l("Please enter the new line."); + input .@s$; + .@s$ = strip(.@s$); + if (.@s$ != "") + { + .@size = getvariableofnpc(.size, "@motd"); + $MOTD_Messages$[.@size] = .@s$; + set getvariableofnpc(.size, "@motd"), getarraysize($MOTD_Messages$); + // FIXME: log to GM log + } + } + + function modifyLine { + + function removeLine { + .@l = getarg(0); + deletearray $MOTD_Messages$[.@l], 1; // remove and shift + mes l("Line @@ has been removed.", .@l); + set getvariableofnpc(.size, "@motd"), getarraysize($MOTD_Messages$); + // FIXME: log to GM log + } + + function moveUp { + .@l = getarg(0); + .@top$ = $MOTD_Messages$[.@l - 1]; + $MOTD_Messages$[.@l - 1] = $MOTD_Messages$[.@l]; + $MOTD_Messages$[.@l] = .@top$; + } + + function moveDown { + .@l = getarg(0); + .@bottom$ = $MOTD_Messages$[.@l + 1]; + $MOTD_Messages$[.@l + 1] = $MOTD_Messages$[.@l]; + $MOTD_Messages$[.@l] = .@bottom$; + } + + function editLine { + .@l = getarg(0); + clear; + mes l("Old line:"); + mes "---"; + mes $MOTD_Messages$[.@l]; + mes "---"; + mes ""; + mes l("Enter new line:"); + next; + input .@s$; + .@s$ = strip(.@s$); + if (.@s$ != "") + { + $MOTD_Messages$[.@l] = .@s$; + // FIXME: log to GM log + } + } + + .@max = (getarg(0) - 1); + + do + { + mes l("Enter line number:"); + next; + input .@n; + if ($MOTD_Messages$[.@n] != "") + { + clear; + mes l("line @@: @@", .@n, $MOTD_Messages$[.@n]); + next; + menuint + l("Modify another line"), 1, + l("Remove this line"), 2, + l("Modify this line"), 3, + rif(.@n > 0, l("Move this line up")), 4, + rif(.@n < .@max, l("Move this line down")), 5, + l("Return to main menu"), 6; + + switch (@menuret) + { + case 2: removeLine .@n; return; + case 3: editLine .@n; return; + case 4: moveUp .@n; return; + case 5: moveDown .@n; return; + case 6: return; + } + } + } while (1); + } + + do + { + clear; + setnpcdialogtitle l("MOTD Config"); + mes l("This menu allows you to modify the generic message that is sent to players on login."); + mes ""; + + mes "---"; + .@size = getvariableofnpc(.size, "@motd"); + for (.@i = 0; .@i < .@size; ++.@i) + { + mes l("line @@: @@", .@i, $MOTD_Messages$[.@i]); + } + if (.@size == 0) + { + mes "(" + l("no active MOTD") + ")"; + } + mes "---"; + .@d = $MOTD_Disabled; + mes l("Enabled: @@", (.@d ? l("no") : l("yes"))); + next; + + menuint + (.@d ? l("Enable") : l("Disable")), 1, + l("Add a new line"), 2, + rif(.@size, l("Modify or remove a line")), 3, + rif(.@size, l("Test MOTD")), 4, + rif(getarg(0,0), l("Return to Super Menu")), 5, + l("Close"), 6; + + switch (@menuret) + { + case 1: toggleMOTD; break; + case 2: addNewLine; break; + case 3: modifyLine .@size; break; + case 4: displayMOTD; break; + case 6: closedialog; end; + default: return; + } + } while (1); +} + + + + +- script @motd 32767,{ + end; + +OnCall: + MOTDConfig; + closedialog; + end; + +OnPCLoginEvent: + if ($MOTD_Disabled < 1) + { + displayMOTD; + } + end; + +OnInit: + .size = getarraysize($MOTD_Messages$); + .dsize = getarraysize($Debug_Messages$); + bindatcmd "motd", "@motd::OnCall", 3, 99, 0; +} diff --git a/npc/commands/numa.txt b/npc/commands/numa.txt new file mode 100644 index 00000000..0083a677 --- /dev/null +++ b/npc/commands/numa.txt @@ -0,0 +1,49 @@ +function script SuperMenu { + do + { + .@gid = getgroupid(); + clear; + setnpcdialogtitle l("Super Menu"); + mes l("This menu contains all options available to you, based on your access privileges."); + mes ""; + mes l("What do you want to access?"); + next; + menuint + rif(.@gid >= 3, l("Scheduled broadcasts")), 1, + rif(.@gid >= 3, l("MOTD")), 2, + rif(.@gid >= 4, l("Event management")), 3, + l("Debug"), 4, + l("Close"), 5; + + switch (@menuret) + { + //case 1: StoneBoard 1; break; + case 2: MOTDConfig 1; break; + //case 3: GlobalEventMenu 1; break; + //case 4: GlobalDebugMenu 1; break; + default: return; + } + } while (1); +} + + + +- script @numa 32767,{ + end; + +OnCall: + .@gid = getgroupid(); + + if (!debug && .@gid < 3) + { + dispbottom l("You do not have the required access privileges to use the Super Menu."); + end; + } + + SuperMenu; + closedialog; + end; + +OnInit: + bindatcmd "numa", "@numa::OnCall", 0, 99, 0; +} diff --git a/npc/scripts.conf b/npc/scripts.conf index 0dfb7b9e..425268fa 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -36,6 +36,8 @@ "npc/commands/music.txt", "npc/commands/warp.txt", "npc/commands/zeny.txt", +"npc: npc/commands/motd.txt", +"npc: npc/commands/numa.txt", // config script "npc/config/hairstyle_config.txt", -- cgit v1.2.3-70-g09d2 From aa4efeac07618fe54696b5fed26bb79c2d8df8d6 Mon Sep 17 00:00:00 2001 From: gumi Date: Wed, 10 Aug 2016 15:08:43 -0400 Subject: add action icons --- npc/commands/motd.txt | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/npc/commands/motd.txt b/npc/commands/motd.txt index 4bf3a11c..84b7d1b0 100644 --- a/npc/commands/motd.txt +++ b/npc/commands/motd.txt @@ -96,12 +96,12 @@ function script MOTDConfig { mes l("line @@: @@", .@n, $MOTD_Messages$[.@n]); next; menuint - l("Modify another line"), 1, - l("Remove this line"), 2, - l("Modify this line"), 3, - rif(.@n > 0, l("Move this line up")), 4, - rif(.@n < .@max, l("Move this line down")), 5, - l("Return to main menu"), 6; + menuimage("actions/back", l("Modify another line")), 1, + menuimage("actions/remove", l("Remove this line")), 2, + menuimage("actions/edit", l("Modify this line")), 3, + rif(.@n > 0, menuimage("actions/raise", l("Move this line up"))), 4, + rif(.@n < .@max, menuimage("actions/lower", l("Move this line down"))), 5, + menuimage("actions/home", l("Return to main menu")), 6; switch (@menuret) { @@ -119,7 +119,7 @@ function script MOTDConfig { { clear; setnpcdialogtitle l("MOTD Config"); - mes l("This menu allows you to modify the generic message that is sent to players on login."); + mes l("This menu allows you to modify the generic message that is sent to players when they log in."); mes ""; mes "---"; @@ -138,12 +138,12 @@ function script MOTDConfig { next; menuint - (.@d ? l("Enable") : l("Disable")), 1, - l("Add a new line"), 2, - rif(.@size, l("Modify or remove a line")), 3, - rif(.@size, l("Test MOTD")), 4, - rif(getarg(0,0), l("Return to Super Menu")), 5, - l("Close"), 6; + menuimage("actions/toggle", (.@d ? l("Enable") : l("Disable"))), 1, + menuimage("actions/add", l("Add a new line")), 2, + rif(.@size, menuimage("actions/manage", l("Modify, move, or remove a line"))), 3, + rif(.@size, menuimage("actions/test", l("Test MOTD"))), 4, + rif(getarg(0,0), menuimage("actions/home", l("Return to Super Menu"))), 5, + menuimage("actions/exit", l("Close")), 6; switch (@menuret) { @@ -159,7 +159,6 @@ function script MOTDConfig { - - script @motd 32767,{ end; -- cgit v1.2.3-70-g09d2 From 62a697d27a014ba0173256e124f65bbbfe9433d0 Mon Sep 17 00:00:00 2001 From: gumi Date: Thu, 11 Aug 2016 15:47:19 -0400 Subject: add placeholder event menu --- npc/commands/event.txt | 31 +++++++++++++++++++++++++++++++ npc/commands/numa.txt | 2 +- npc/scripts.conf | 5 +++-- 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 npc/commands/event.txt diff --git a/npc/commands/event.txt b/npc/commands/event.txt new file mode 100644 index 00000000..ed40c184 --- /dev/null +++ b/npc/commands/event.txt @@ -0,0 +1,31 @@ +function script GlobalEventMenu { + clear; + setnpcdialogtitle l("Event Management"); + mes l("This menu allows you to manage events and gives access to event-related tools."); + mes ""; + mes l("There is no event available right now."); + menuint + rif(getarg(0,0), menuimage("actions/home", l("Return to Super Menu"))), 1, + menuimage("actions/exit", l("Close")), 2; + + if (@menuret == 1) + { + return; + } + + closedialog; +} + + + +- script @event 32767,{ + end; + +OnCall: + GlobalEventMenu; + closedialog; + end; + +OnInit: + bindatcmd "event", "@event::OnCall", 4, 99, 0; +} diff --git a/npc/commands/numa.txt b/npc/commands/numa.txt index 0083a677..5ab58812 100644 --- a/npc/commands/numa.txt +++ b/npc/commands/numa.txt @@ -19,7 +19,7 @@ function script SuperMenu { { //case 1: StoneBoard 1; break; case 2: MOTDConfig 1; break; - //case 3: GlobalEventMenu 1; break; + case 3: GlobalEventMenu 1; break; //case 4: GlobalDebugMenu 1; break; default: return; } diff --git a/npc/scripts.conf b/npc/scripts.conf index 425268fa..c66cb1af 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -36,8 +36,9 @@ "npc/commands/music.txt", "npc/commands/warp.txt", "npc/commands/zeny.txt", -"npc: npc/commands/motd.txt", -"npc: npc/commands/numa.txt", +"npc/commands/motd.txt", +"npc/commands/event.txt", +"npc/commands/numa.txt", // config script "npc/config/hairstyle_config.txt", -- cgit v1.2.3-70-g09d2 From 981a1e7326f879ffecf0532d36b0bad0a0bdcecf Mon Sep 17 00:00:00 2001 From: gumi Date: Sat, 13 Aug 2016 11:32:42 -0400 Subject: add general debug menu --- npc/commands/debug.txt | 148 +++++++++++++++++++++++++++++++++++++++++++++++++ npc/commands/numa.txt | 2 +- npc/scripts.conf | 1 + 3 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 npc/commands/debug.txt diff --git a/npc/commands/debug.txt b/npc/commands/debug.txt new file mode 100644 index 00000000..abf5c721 --- /dev/null +++ b/npc/commands/debug.txt @@ -0,0 +1,148 @@ +function script GlobalDebugMenu { + function resetAll { + function doReset { + resetstatus; + resetskill; + resetlvl 1; + dispbottom l("Reset done!"); + if (getarg(0,0) == 3) + { + closedialog; + doevent "::OnGlobalQuestReset"; // executes in all quest npcs // FIXME: maybe have a `resetquest` buildin? + Zeny = 0; + #MerchantBank = 0; + getinventorylist; + for (.@o = 0; .@o < @inventorylist_count; ++.@o) + { + delitem @inventorylist_id[.@o], @inventorylist_amount[.@o]; + } + warp "000-0", 0, 0; // starting point + end; // script must end for doevent to execute + } + return; + } + clear; + setnpcdialogtitle l("Debug - Reset"); + mes l("What do you want to reset?"); + menuint + menuimage("actions/abort", l("Abort")), 1, + menuimage("actions/reset", l("Reset stats, skills, level")), 2, + menuimage("actions/nuke", l("Reset EVERYTHING")), 3, + menuimage("actions/back", l("Return to Debug menu")), 1, + menuimage("actions/exit", l("Close")), 4; + + switch (@menuret) + { + case 2: + case 3: doReset @menuret; + case 1: return; + } + + closedialog; + } + + function changeLevel { + clear; + setnpcdialogtitle l("Debug - Change level"); + mes l("To change your base level, use this command:"); + mes ""; + mes " " + col("@blvl <" + l("delta") + ">", 3); + next; + mes l("Example:"); + mes "@blvl 50"; + mes " " + l("Raises your base level by 50"); + mes "@blvl -50"; + mes " " + l("Reduces your base level by 50"); + next; + mes l("To change your job level, use this command:"); + mes ""; + mes " " + col("@jlvl <" + l("delta") + ">", 3); + next; + mes l("Example:"); + mes "@jlvl 50"; + mes " " + l("Raises your job level by 50"); + mes "@jlvl -50"; + mes " " + l("Reduces your job level by 50"); + next; + return; + } + function changeStats { + clear; + setnpcdialogtitle l("Debug - Change stats"); + mes l("To change your stats, use these commands:"); + mes ""; + mes " " + col("@str <" + l("delta") + ">", 3); + mes " " + col("@agi <" + l("delta") + ">", 3); + mes " " + col("@vit <" + l("delta") + ">", 3); + mes " " + col("@int <" + l("delta") + ">", 3); + mes " " + col("@dex <" + l("delta") + ">", 3); + mes " " + col("@luk <" + l("delta") + ">", 3); + next; + mes l("Example:"); + mes "@int 50"; + mes " " + l("Raises your Int by 50"); + mes "@int -50"; + mes " " + l("Reduces your Int by 50"); + next; + mes l("If you simply wish to get 99 in all stats:"); + mes ""; + mes " " + col("@allstats", 3); + next; + mes l("If you wish to reset your stats:"); + mes ""; + mes " " + col("@streset", 3); + next; + return; + } + do + { + clear; + setnpcdialogtitle l("Debug"); + mes l("This menu allows you to modify your account data."); + mes ""; + mes l("What do you want to do?"); + menuint + menuimage("actions/manage", l("Change my level")), 1, + menuimage("actions/manage", l("Change my stats")), 2, + menuimage("actions/manage", l("Change my skills")), 3, + menuimage("actions/manage", l("Change my appearance")), 4, + menuimage("actions/edit", l("Change my quests")), 5, + menuimage("actions/reset", l("Select a preset")), 6, + menuimage("actions/nuke", l("Reset")), 7, + rif(getarg(0,0), menuimage("actions/home", l("Return to Super Menu"))), 8, + menuimage("actions/exit", l("Close")), 9; + + .@c = getarg(0,0) ? 2 : 1; + + switch (@menuret) + { + case 1: changeLevel; break; + case 2: changeStats; break; + //case 3: GlobalSkillDebug .@c; break; + //case 4: BarberDebug .@c; break; + //case 5: changeQuests; break; + //case 6: DebugPresets; break; + case 7: resetAll; break; + case 8: return; + case 9: closedialog; end; + } + } while(1); +} + + + +- script @debug 32767,{ + end; + +OnCall: + if (!debug && getgroupid() < 99) + { + end; + } + GlobalDebugMenu; + closedialog; + end; + +OnInit: + bindatcmd "debug", "@debug::OnCall", 0, 99, 0; +} diff --git a/npc/commands/numa.txt b/npc/commands/numa.txt index 5ab58812..cd28c580 100644 --- a/npc/commands/numa.txt +++ b/npc/commands/numa.txt @@ -20,7 +20,7 @@ function script SuperMenu { //case 1: StoneBoard 1; break; case 2: MOTDConfig 1; break; case 3: GlobalEventMenu 1; break; - //case 4: GlobalDebugMenu 1; break; + case 4: GlobalDebugMenu 1; break; default: return; } } while (1); diff --git a/npc/scripts.conf b/npc/scripts.conf index c66cb1af..be68e3a0 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -38,6 +38,7 @@ "npc/commands/zeny.txt", "npc/commands/motd.txt", "npc/commands/event.txt", +"npc/commands/debug.txt", "npc/commands/numa.txt", // config script -- cgit v1.2.3-70-g09d2 From f0173b4dcba4cc8ab82a57e44e3b5176a1ad2def Mon Sep 17 00:00:00 2001 From: gumi Date: Sat, 13 Aug 2016 13:49:46 -0400 Subject: add skill debug --- npc/commands/debug-skill.txt | 85 ++++++++++++++++++++++++++++++++++++++++++++ npc/commands/debug.txt | 2 +- npc/scripts.conf | 1 + 3 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 npc/commands/debug-skill.txt diff --git a/npc/commands/debug-skill.txt b/npc/commands/debug-skill.txt new file mode 100644 index 00000000..f782e753 --- /dev/null +++ b/npc/commands/debug-skill.txt @@ -0,0 +1,85 @@ +function script GlobalSkillDebug { + + function modifySkill { + + function setSkill { + clear; + mes l("Enter desired skill level:"); + input .@y; + skill getarg(0,1), max(0, min(10, .@y)), 0; + return; + } + + setnpcdialogtitle l("Skill Debug - Modify Skill"); + .@k = getarg(0,1); + .@v = getskilllv(.@k); + menuint + menuimage("actions/abort", l("Abort")), 1, + rif(.@v > 0, menuimage("actions/remove", l("Remove this skill"))), 2, + rif(.@v < 10, menuimage("actions/raise", l("Raise this skill"))), 3, + rif(.@v > 0, menuimage("actions/lower", l("Lower this skill"))), 4, + menuimage("actions/edit", l("Set the level manually")), 5, + menuimage("actions/back", l("Return to skill debug menu")), 1, + menuimage("actions/exit", l("Close")), 6; + + switch (@menuret) + { + case 2: skill .@k, 0, 0; break; + case 3: skill .@k, min(10, .@v + 1), 0; break; + case 4: skill .@k, max(0, .@v - 1), 0; break; + case 5: setSkill .@k; break; + case 6: closedialog; end; + } + + return; + } + + do + { + clear; + setnpcdialogtitle l("Skill Debug"); + mes l("This menu allows you to change your skills."); + mes ""; + + mes "---"; + // FIXME: maybe get skills from an array or `getskilllist;` <= would need a `getskillinfo()` buildin though + mes "NV_BASIC: " + getskilllv(NV_BASIC); + mes "---"; + + mes ""; + mes l("Which skill do you wish to change?"); + next; + + menuint + "NV_BASIC", NV_BASIC, + rif(getarg(0,0), menuimage("actions/back", l("Return to Debug menu"))), 32766, + menuimage("actions/exit", l("Close")), 32767; + + switch (@menuret) + { + case 32766: return; + case 32767: closedialog; end; + } + + modifySkill @menuret; + + } while (1); +} + + + +- script @sdebug 32767,{ + end; + +OnCall: + if (!debug && getgroupid() < 99) + { + end; + } + GlobalSkillDebug; + closedialog; + end; + +OnInit: + bindatcmd "sdebug", "@sdebug::OnCall", 0, 99, 0; +} diff --git a/npc/commands/debug.txt b/npc/commands/debug.txt index abf5c721..54cb96fe 100644 --- a/npc/commands/debug.txt +++ b/npc/commands/debug.txt @@ -118,7 +118,7 @@ function script GlobalDebugMenu { { case 1: changeLevel; break; case 2: changeStats; break; - //case 3: GlobalSkillDebug .@c; break; + case 3: GlobalSkillDebug .@c; break; //case 4: BarberDebug .@c; break; //case 5: changeQuests; break; //case 6: DebugPresets; break; diff --git a/npc/scripts.conf b/npc/scripts.conf index be68e3a0..f0849238 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -38,6 +38,7 @@ "npc/commands/zeny.txt", "npc/commands/motd.txt", "npc/commands/event.txt", +"npc/commands/debug-skill.txt", "npc/commands/debug.txt", "npc/commands/numa.txt", -- cgit v1.2.3-70-g09d2 From b62f95d385518fa842638c03be678062518de647 Mon Sep 17 00:00:00 2001 From: gumi Date: Sat, 13 Aug 2016 14:28:22 -0400 Subject: add (broken) appearance debug --- npc/commands/debug-look.txt | 102 ++++++++++++++++++++++++++++++++++++++++++++ npc/commands/debug.txt | 2 +- npc/scripts.conf | 1 + 3 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 npc/commands/debug-look.txt diff --git a/npc/commands/debug-look.txt b/npc/commands/debug-look.txt new file mode 100644 index 00000000..85dea836 --- /dev/null +++ b/npc/commands/debug-look.txt @@ -0,0 +1,102 @@ +function script BarberDebug { + + function setGender { + //clear; + //setnpcdialogtitle l("Appearance Debug - Sex Change"); + //mes l("Please choose the desired gender:"); + //next; + //menuint + // l("Male"), G_MALE, + // l("Female"), G_FEMALE, + // l("Non-binary"), G_OTHER; + + //Sex = @menuret; // FIXME: make this work like in tmwAthena + //return; + + + // ^ Future code, Doesn't work yet + closedialog; + changecharsex; + } + function setStyle { + clear; + setnpcdialogtitle l("Appearance Debug - Barber"); + mes l("Please enter the desired hairstyle:"); + next; + input .@h; + setlook LOOK_HAIR, max(0, min(0x7F, .@h)); + return; + } + function setColor { + clear; + setnpcdialogtitle l("Appearance Debug - Barber"); + mes l("Please enter the desired hair color:"); + next; + input .@h; + setlook LOOK_HAIR_COLOR, max(0, min(0x7F, .@h)); + return; + } + function setRace { + clear; + setnpcdialogtitle l("Appearance Debug - Race"); + mes l("Please enter the desired race:"); + next; + input .@r; + jobchange max(0, min(0x7FFF, .@h)); + return; + } + + do + { + clear; + setnpcdialogtitle l("Appearance Debug"); + mes l("This menu allows you to customize your appearance."); + mes ""; + + mes "---"; + mes l("Gender") + ": " + Sex; + mes l("Hair style") + ": " + getlook (LOOK_HAIR); + mes l("Hair color") + ": " + getlook (LOOK_HAIR_COLOR); + mes l("Race") + ": " + Class; + mes "---"; + + mes ""; + mes l("What do you want to change?"); + next; + menuint + menuimage("actions/edit", l("Gender")), 1, + menuimage("actions/edit", l("Hair style")), 2, + menuimage("actions/edit", l("Hair color")), 3, + menuimage("actions/edit", l("Race")), 4, + rif(getarg(0,0), menuimage("actions/back", l("Return to Debug menu"))), 5, + menuimage("actions/exit", l("Close")), 6; + + switch (@menuret) + { + case 1: setGender; break; + case 2: setStyle; break; + case 3: setColor; break; + case 4: setRace; break; + case 5: return; + case 6: closedialog; end; + } + } while (1); +} + + + +- script @look 32767,{ + end; + +OnCall: + if (!debug && getgroupid() < 3) + { + end; + } + BarberDebug; + closedialog; + end; + +OnInit: + bindatcmd "look", "@look::OnCall", 0, 99, 0; +} diff --git a/npc/commands/debug.txt b/npc/commands/debug.txt index 54cb96fe..6f6f7c6a 100644 --- a/npc/commands/debug.txt +++ b/npc/commands/debug.txt @@ -119,7 +119,7 @@ function script GlobalDebugMenu { case 1: changeLevel; break; case 2: changeStats; break; case 3: GlobalSkillDebug .@c; break; - //case 4: BarberDebug .@c; break; + case 4: BarberDebug .@c; break; //case 5: changeQuests; break; //case 6: DebugPresets; break; case 7: resetAll; break; diff --git a/npc/scripts.conf b/npc/scripts.conf index f0849238..4ead9118 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -38,6 +38,7 @@ "npc/commands/zeny.txt", "npc/commands/motd.txt", "npc/commands/event.txt", +"npc/commands/debug-look.txt", "npc/commands/debug-skill.txt", "npc/commands/debug.txt", "npc/commands/numa.txt", -- cgit v1.2.3-70-g09d2 From 800fac9e311d7b817f9303b4a837da60fc54024c Mon Sep 17 00:00:00 2001 From: gumi Date: Sat, 13 Aug 2016 18:02:27 -0400 Subject: add test server help link (opens client-side help) --- npc/commands/debug.txt | 1 + npc/commands/motd.txt | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/npc/commands/debug.txt b/npc/commands/debug.txt index 6f6f7c6a..61088caf 100644 --- a/npc/commands/debug.txt +++ b/npc/commands/debug.txt @@ -145,4 +145,5 @@ OnCall: OnInit: bindatcmd "debug", "@debug::OnCall", 0, 99, 0; + // TODO / FIXME: add a @test command that opens the help window for test-server } diff --git a/npc/commands/motd.txt b/npc/commands/motd.txt index 84b7d1b0..b0bc4ebd 100644 --- a/npc/commands/motd.txt +++ b/npc/commands/motd.txt @@ -172,6 +172,10 @@ OnPCLoginEvent: { displayMOTD; } + if (debug) + { + dispbottom "##7<<##B @@?test-server|" + col(l("Click here for instructions on how to use the test server."),6) + "@@ ##7>>"; + } end; OnInit: -- cgit v1.2.3-70-g09d2 From ae65394b74712943664aff19c880f6ede07a035b Mon Sep 17 00:00:00 2001 From: gumi Date: Sat, 13 Aug 2016 21:03:00 -0400 Subject: add debug preset system --- npc/commands/debug-preset.txt | 149 ++++++++++++++++++++++++++++++++++++++++++ npc/commands/debug.txt | 8 +-- npc/scripts.conf | 1 + 3 files changed, 152 insertions(+), 6 deletions(-) create mode 100644 npc/commands/debug-preset.txt diff --git a/npc/commands/debug-preset.txt b/npc/commands/debug-preset.txt new file mode 100644 index 00000000..1012c71c --- /dev/null +++ b/npc/commands/debug-preset.txt @@ -0,0 +1,149 @@ +// Preset / routine system +// author: gumi +// description: allows to execute multiple commands in a single step +// to ease testing and debugging +// +// usage: @pre [options] [, ...] +// usage: DoRoutine "[options] [, ...]"; +// +// example: @pre -s a22 v14 +// resets all stats, gives 22 agi, gives 14 vit +// +// ^ actual documentation may come one day, when I feel like it +// *hides* + +function script DoRoutine { + .@routine$ = strip(getarg(0,"")); + .@m = explode(.@routine$[0], .@routine$, " "); // prep the base array + + if (charat(.@routine$[0], 0) == "-") + { + if (compare(.@routine$[0], "t")) + { + clearitem; + } + + if (compare(.@routine$[0], "k")) + { + resetskill; + } + + if (compare(.@routine$[0], "s")) + { + resetstatus; + } + + if (compare(.@routine$[0], "x")) + { + resetlvl 2; + } + + if (compare(.@routine$[0], "q")) + { + //doevent "::OnGlobalQuestReset"; // executes in all quest npcs // FIXME: maybe have a `resetquest` buildin? + // FIXME: ^ need a buildin that can run *right now* instead of on script end + } + + .@o = 1; + } + + for (.@i = (.@o ? 1 : 0); .@i < .@m; ++.@i) + { + .@type$ = charat(strip(.@routine$[.@i]), 0); + .@type = 0x7FFF; + if (.@type$ != "") + { + .@args = explode(.@args$, delchar(.@routine$[.@i], 0), ","); + .@a = atoi(.@args$[0]); + .@b = atoi(.@args$[1]); + .@c = atoi(.@args$[2]); + + for (.@l = 0; .@l < 36; ++.@l) + { + if ($@PresetCmds$[.@l] == .@type$) + { + .@type = .@l; + break; + } + } + // FIXME: ^ this whole for() loop could be removed if there was a ord() buildin + + switch (.@type) + { + case 0: statusup2 bAgi, max(1,min(99,.@a)) - readparam(bAgi); break; + case 2: jobchange max(0,min(6,.@a)); break; + case 3: statusup2 bDex, max(1,min(99,.@a)) - readparam(bDex); break; + case 4: equip max(1,min(32767,.@a)); break; + //case 6: break; <= gender + case 8: statusup2 bInt, max(1,min(99,.@a)) - readparam(bInt); break; + case 10: skill max(1,min(32767,.@a)), max(0,min(10,.@b)), max(0,min(2,.@c)); break; + case 11: statusup2 bLuk, max(1,min(99,.@a)) - readparam(bLuk); break; + //case 12: break; <= mercenary + case 15: makepet max(1002,min(32767,.@a)); break; + case 16: setq max(0,min(32767,.@a)), max(0,min(32767,.@b)); break; + case 18: statusup2 bStr, max(1,min(99,.@a)) - readparam(bStr); break; + case 19: getitem max(1,min(32767,.@a)), max(1,min(32767,.@b)); break; + case 21: statusup2 bVit, max(1,min(99,.@a)) - readparam(bVit); break; + case 22: warp .@args$[0], .@b, .@c; break; + case 23: BaseLevel = max(1,min(99,.@a)); break; // XXX: maybe also set BaseExp + case 24: JobLevel = max(1,min(255,.@a)); break; // XXX: maybe also set JobExp + case 25: Zeny = max(0,min(0x7FFFFFFE,.@a)); #MerchantBank = max(0,min(0x7FFFFFFF,.@b)); break; + } + } + } +} + +function script DebugPresets { + + if (getarg(0, "m") != "m") + { + DoRoutine getarg(0); + end; + } + + clear; + setnpcdialogtitle l("Debug Presets"); + mes l("This menu allows you to select debug presets."); + mes ""; + mes l("What preset do you want to use?"); + next; + // TODO: create presets and add them to a hash table, then dynamically build this menu + menuint + menuimage("actions/abort", l("Abort")), 1, + l("New player"), 2, + rif(getarg(0,"") == "m", menuimage("actions/back", l("Return to Debug menu"))), 1, + menuimage("actions/exit", l("Close")), 3; + + switch (@menuret) + { + case 1: return; + case 2: DoRoutine "-tksxq z w000-0"; break; + } + + closedialog; +} + + + +- script @pre 32767,{ + end; + +OnCall: + if (!debug && getgroupid() < 99) + { + end; + } + if (.@atcmd_parameters$[0] != "") + { + .@atcmd_parameters$[0] = implode(.@atcmd_parameters$[0], " "); + } + DebugPresets strip(.@atcmd_parameters$[0]); + closedialog; + end; + +OnInit: + setarray $@PresetCmds$[0], "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", + "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", + "y", "z", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9; + bindatcmd "pre", "@pre::OnCall", 0, 99, 0; +} diff --git a/npc/commands/debug.txt b/npc/commands/debug.txt index 61088caf..5af689b2 100644 --- a/npc/commands/debug.txt +++ b/npc/commands/debug.txt @@ -11,11 +11,7 @@ function script GlobalDebugMenu { doevent "::OnGlobalQuestReset"; // executes in all quest npcs // FIXME: maybe have a `resetquest` buildin? Zeny = 0; #MerchantBank = 0; - getinventorylist; - for (.@o = 0; .@o < @inventorylist_count; ++.@o) - { - delitem @inventorylist_id[.@o], @inventorylist_amount[.@o]; - } + clearitem; warp "000-0", 0, 0; // starting point end; // script must end for doevent to execute } @@ -121,7 +117,7 @@ function script GlobalDebugMenu { case 3: GlobalSkillDebug .@c; break; case 4: BarberDebug .@c; break; //case 5: changeQuests; break; - //case 6: DebugPresets; break; + case 6: DebugPresets "m"; break; case 7: resetAll; break; case 8: return; case 9: closedialog; end; diff --git a/npc/scripts.conf b/npc/scripts.conf index 4ead9118..9fe2fc07 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -40,6 +40,7 @@ "npc/commands/event.txt", "npc/commands/debug-look.txt", "npc/commands/debug-skill.txt", +"npc/commands/debug-preset.txt", "npc/commands/debug.txt", "npc/commands/numa.txt", -- cgit v1.2.3-70-g09d2 From 2fa3eebd17a78b617f767df46988ddefefb9f71e Mon Sep 17 00:00:00 2001 From: gumi Date: Sun, 14 Aug 2016 16:23:55 -0400 Subject: add scheduled broadcasts --- npc/commands/numa.txt | 2 +- npc/commands/scheduled-broadcasts.txt | 212 ++++++++++++++++++++++++++++++++++ npc/scripts.conf | 1 + 3 files changed, 214 insertions(+), 1 deletion(-) create mode 100644 npc/commands/scheduled-broadcasts.txt diff --git a/npc/commands/numa.txt b/npc/commands/numa.txt index cd28c580..f9fff699 100644 --- a/npc/commands/numa.txt +++ b/npc/commands/numa.txt @@ -17,7 +17,7 @@ function script SuperMenu { switch (@menuret) { - //case 1: StoneBoard 1; break; + case 1: StoneBoard 1; break; case 2: MOTDConfig 1; break; case 3: GlobalEventMenu 1; break; case 4: GlobalDebugMenu 1; break; diff --git a/npc/commands/scheduled-broadcasts.txt b/npc/commands/scheduled-broadcasts.txt new file mode 100644 index 00000000..e8c16d6e --- /dev/null +++ b/npc/commands/scheduled-broadcasts.txt @@ -0,0 +1,212 @@ +function script StoneBoard { + + function setMessage { + do + { + clear; + mes l("Please enter the message:"); + next; + input .@msg$; + .@msg$ = strip(.@msg$); + if (.@msg$ != "") + { + return .@msg$; + } + mes l("The message cannot be empty"); + next; + } while (1); + } + + function setInterval { + clear; + mes l("Please select the interval:"); + next; + menuint + l("Every 1 hour"), 1, + l("Every 3 hours"), 3, + l("Every 5 hours"), 5, + l("Every 6 hours"), 6, + l("Every 12 hours"), 12, + l("Every 24 hours"), 24, + l("Never (only on login)"), 0; + + return max(0, @menuret); + } + + function setMaxRep { + if (getarg(0,0) == 0) + { + return 0; + } + clear; + mes l("Repeat how many times?"); + next; + menuint + l("Send only once"), 1, + l("Send 2 times"), 2, + l("Send 3 times"), 3, + l("Send 5 times"), 5, + l("Send 10 times"), 10, + l("Send 20 times"), 20, + l("Send indefinitely"), 0; + + return max(0, @menuret); + } + + function setOnLogin { + if (getarg(0,0) == 0) + { + return 1; + } + clear; + mes l("Send this message also on login?"); + next; + menuint + l("No"), 0, + l("Yes"), 1; + + return max(0, @menuret); + } + + function newBroadcast { + do + { + setnpcdialogtitle l("Scheduled broadcasts - Create new"); + + // go through all steps + .@msg$ = setMessage(); + .@int = setInterval(); + .@max = setMaxRep(.@int); + .@login = setOnLogin(.@int); + + // recap + clear; + mes l("Message:"); + mes "---"; + mes .@msg$; + mes "---"; + if (.@int) + { + mes l("Interval: every @@ hour(s)", .@int); + mes l("Repeat: @@ times", .@max ? .@max : "∞"); + mes l("Sent on login: @@", .@login ? l("yes") : l("no")); + } + else + { + mes l("Interval: (none, only sent on login)"); + mes l("Sent on login: yes"); + } + + next; + menuint + menuimage("actions/cancel", l("Discard")), 1, + menuimage("actions/edit", l("Start over")), 2, + menuimage("actions/test", l("Start broadcasting")), 3, + menuimage("actions/test", l("Start broadcasting, and make an extra broadcast right now")), 4, + menuimage("actions/exit", l("Close")), 5; + + switch (@menuret) + { + case 3: + case 4: + stopnpctimer "@sched"; + $@SCHED_Opt[0] = .@login; + $@SCHED_Opt[1] = .@int; + $@SCHED_Opt[2] = 0; + $@SCHED_Opt[3] = .@max; + $@SCHED_Msg$ = .@msg$; + if (.@int) + { + initnpctimer "@sched"; + } + if (@menuret == 4) + { + announce $@SCHED_Msg$, bc_all; + } + case 1: return; + case 5: closedialog; end; + } + + } while(1); + } + + do + { + clear; + setnpcdialogtitle l("Scheduled broadcasts"); + mes l("This menu allows you to set the scheduled broadcast that is sent to all players at a specific interval."); + mes ""; + + .@a = $@SCHED_Msg$ != ""; // any active broadcast? + mes "---"; + mes .@a ? $@SCHED_Msg$ : "(" + l("no active broadcast") +")"; + mes "---"; + if (.@a) + { + mes l("Sent on login: @@", ($@SCHED_Opt[0] ? l("yes") : l("no"))); + if ($@SCHED_Opt[1]) + { + mes l("Interval: every @@ hour(s)", $@SCHED_Opt[1]); + //mes l("Next broadcast: "); // FIXME: (needs a HumanTime function) + } + else + { + mes l("Interval: (none, only sent on login)"); + mes l("Next broadcast: (never)"); + } + mes l("Sent: @@ times out of @@", $@SCHED_Opt[2], ($@SCHED_Opt[3] ? $@SCHED_Opt[3] : "∞")); + } + next; + + menuint + menuimage("actions/abort", l("Abort")), 5, + rif(.@a, menuimage("actions/test", l("Manually trigger the current broadcast"))), 2, + rif(.@a, menuimage("actions/remove", l("Stop broadcasting"))), 3, + rif(!(.@a), menuimage("actions/add", l("Set a new broadcast"))), 4, + rif(getarg(0,0), menuimage("actions/home", l("Return to Super Menu"))), 5, + menuimage("actions/exit", l("Close")), 6; + + switch (@menuret) + { + case 2: announce $@SCHED_Msg$, bc_all; break; + case 3: $@SCHED_Msg$ = ""; break; + case 4: newBroadcast; break; + case 6: closedialog; end; + default: return; + } + } while (1); +} + + + +- script @sched 32767,{ + end; + +OnTimer3600000: + stopnpctimer; + ++$@SCHED_Opt[2]; + if ($@SCHED_Msg$ != "") + { + announce $@SCHED_Msg$, bc_all; + if ($@SCHED_Opt[2] < $@SCHED_Opt[3] && $@SCHED_Opt[3] > 0) + { + initnpctimer; + } + } + end; + +OnCall: + StoneBoard; + closedialog; + end; + +OnPCLoginEvent: + if ($@SCHED_Opt[0] && $@SCHED_Msg$ != "") + { + announce $@SCHED_Msg$, bc_self; + } + end; + +OnInit: + bindatcmd "sched", "@sched::OnCall", 3, 99, 0; +} diff --git a/npc/scripts.conf b/npc/scripts.conf index 9fe2fc07..1efd1291 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -37,6 +37,7 @@ "npc/commands/warp.txt", "npc/commands/zeny.txt", "npc/commands/motd.txt", +"npc/commands/scheduled-broadcasts.txt", "npc/commands/event.txt", "npc/commands/debug-look.txt", "npc/commands/debug-skill.txt", -- cgit v1.2.3-70-g09d2 From 96036014cdb83abf6033af4570bac7e5ef9b6689 Mon Sep 17 00:00:00 2001 From: gumi Date: Mon, 15 Aug 2016 10:56:59 -0400 Subject: add quest debug --- npc/000-2-0/julia.txt | 505 +++++++++++---------- npc/commands/debug-quest.txt | 166 +++++++ npc/commands/debug.txt | 2 +- npc/functions/quest-debug/000-ShipQuests_Julia.txt | 26 ++ npc/functions/quest-debug/001-ShipQuests_Arpan.txt | 27 ++ npc/functions/quest-debug/002-ShipQuests_Alige.txt | 27 ++ npc/functions/quest-debug/003-ShipQuests_Peter.txt | 30 ++ npc/functions/quest-debug/004-ShipQuests_Nard.txt | 38 ++ npc/functions/quest-debug/005-ShipQuests_Knife.txt | 25 + .../quest-debug/006-ShipQuests_ArpanMoney.txt | 26 ++ npc/functions/quest-debug/007-ShipQuests_Door.txt | 25 + .../quest-debug/008-ShipQuests_Couwan.txt | 26 ++ .../quest-debug/009-ShipQuests_TreasureChest.txt | 25 + npc/functions/quest-debug/010-ShipQuests_Ale.txt | 25 + .../quest-debug/011-ShipQuests_Astapolos.txt | 25 + .../quest-debug/012-ShipQuests_Gulukan.txt | 25 + npc/functions/quest-debug/013-ShipQuests_Jalad.txt | 25 + .../quest-debug/014-ShipQuests_QMuller.txt | 25 + npc/functions/quest-debug/015-ShipQuests_Tibbo.txt | 25 + npc/functions/quest-debug/016-ShipQuests_Gugli.txt | 46 ++ .../quest-debug/017-ShipQuests_ChefGado.txt | 30 ++ npc/functions/quest-debug/018-General_Cookies.txt | 25 + .../quest-debug/019-ArtisQuests_LazyBrother.txt | 28 ++ .../quest-debug/020-ArtisQuests_Urchin.txt | 26 ++ .../quest-debug/021-ArtisQuests_CatchPiou.txt | 26 ++ .../quest-debug/022-ArtisQuests_Fishman.txt | 26 ++ .../quest-debug/023-ArtisQuests_QOnan.txt | 27 ++ npc/functions/quest-debug/026-General_Rumly.txt | 27 ++ .../quest-debug/027-ArtisQuests_Enora.txt | 35 ++ npc/functions/quest-debug/028-General_Narrator.txt | 25 + .../quest-debug/029-ArtisQuests_Fexil.txt | 27 ++ .../quest-debug/030-ArtisQuests_Lloyd.txt | 25 + npc/functions/quest-debug/031-General_Janus.txt | 31 ++ .../quest-debug/032-ArtisQuests_MonaDad.txt | 25 + npc/functions/quest-debug/functions.txt | 73 +++ npc/scripts.conf | 36 ++ 36 files changed, 1398 insertions(+), 238 deletions(-) create mode 100644 npc/commands/debug-quest.txt create mode 100644 npc/functions/quest-debug/000-ShipQuests_Julia.txt create mode 100644 npc/functions/quest-debug/001-ShipQuests_Arpan.txt create mode 100644 npc/functions/quest-debug/002-ShipQuests_Alige.txt create mode 100644 npc/functions/quest-debug/003-ShipQuests_Peter.txt create mode 100644 npc/functions/quest-debug/004-ShipQuests_Nard.txt create mode 100644 npc/functions/quest-debug/005-ShipQuests_Knife.txt create mode 100644 npc/functions/quest-debug/006-ShipQuests_ArpanMoney.txt create mode 100644 npc/functions/quest-debug/007-ShipQuests_Door.txt create mode 100644 npc/functions/quest-debug/008-ShipQuests_Couwan.txt create mode 100644 npc/functions/quest-debug/009-ShipQuests_TreasureChest.txt create mode 100644 npc/functions/quest-debug/010-ShipQuests_Ale.txt create mode 100644 npc/functions/quest-debug/011-ShipQuests_Astapolos.txt create mode 100644 npc/functions/quest-debug/012-ShipQuests_Gulukan.txt create mode 100644 npc/functions/quest-debug/013-ShipQuests_Jalad.txt create mode 100644 npc/functions/quest-debug/014-ShipQuests_QMuller.txt create mode 100644 npc/functions/quest-debug/015-ShipQuests_Tibbo.txt create mode 100644 npc/functions/quest-debug/016-ShipQuests_Gugli.txt create mode 100644 npc/functions/quest-debug/017-ShipQuests_ChefGado.txt create mode 100644 npc/functions/quest-debug/018-General_Cookies.txt create mode 100644 npc/functions/quest-debug/019-ArtisQuests_LazyBrother.txt create mode 100644 npc/functions/quest-debug/020-ArtisQuests_Urchin.txt create mode 100644 npc/functions/quest-debug/021-ArtisQuests_CatchPiou.txt create mode 100644 npc/functions/quest-debug/022-ArtisQuests_Fishman.txt create mode 100644 npc/functions/quest-debug/023-ArtisQuests_QOnan.txt create mode 100644 npc/functions/quest-debug/026-General_Rumly.txt create mode 100644 npc/functions/quest-debug/027-ArtisQuests_Enora.txt create mode 100644 npc/functions/quest-debug/028-General_Narrator.txt create mode 100644 npc/functions/quest-debug/029-ArtisQuests_Fexil.txt create mode 100644 npc/functions/quest-debug/030-ArtisQuests_Lloyd.txt create mode 100644 npc/functions/quest-debug/031-General_Janus.txt create mode 100644 npc/functions/quest-debug/032-ArtisQuests_MonaDad.txt create mode 100644 npc/functions/quest-debug/functions.txt diff --git a/npc/000-2-0/julia.txt b/npc/000-2-0/julia.txt index 3be81c53..e17d93da 100644 --- a/npc/000-2-0/julia.txt +++ b/npc/000-2-0/julia.txt @@ -33,6 +33,266 @@ // 25 Reward taken from the box. 000-2-0,27,24,0 script Julia NPC_JULIA,2,10,{ + + function ynMenu { + if (select(l("Yes, I do."), l("No, none.")) == 1) { + return; + } + closedialog; + } + + function poisonJulia { + mes ""; + mesn; + mesq l("Seems yummy! Let me taste it!"); + next; + mesq l("Hmmm, hm... *cough*, *cough*, *burp*, *cough*. What... What is that?!... *cough*, *burp*... Damn Gado... *cough*"); + if (countitem(PoisonedDish) > 0) delitem PoisonedDish, 1; + setq ShipQuests_ChefGado, 3; + close; + } + + function gotoSleep { + speech 5, + l("You already did enough for us, follow Nard's advice and get some rest."), + l("We are at half a day from our final destination, by the time that you wake up I'm sure that we will be there!"), + l("Do you have any other questions for me?"); + ynMenu; + return; + } + + function heardRumors { + mes ""; + mesn; + mesq l("You shouldn't believe every tale drunken sailors tell you."); + next; + + select + l("Let's say the person who told me about that is well respected on this ship and never drunk."); + + mes ""; + mesn; + mesq l("Hahaha! All sailors aboard this ship are always drunk... Well... Except... Wait, what?! Nard told you?!"); + next; + mesq l("Doesn't he like the way I'm taking care of his ship? Everything is clean and tidy with me, rightful lieutenant of La Johanne."); + next; + mesq l("I give tasks to every single sailor, all day long. That should make him happy!"); + next; + + select + l("Well... I don't think it is the best way to rule a ship. Think about it."), + l("In fact, everything seems to work perfectly under your guidance. Nard has made the right choice."); + + if (@menu == 1) + { + closedialog; + end; + } + + mes ""; + mesn; + mesq l("I'm glad you're on my side."); + next; + mesq l("Take this money as a reward for your nice words."); + + setq ShipQuests_ChefGado, 6; + Zeny += 100; + message strcharinfo(0), l("You receive @@ E!", 100); + getexp 8, 0; + close; + } + + function gotRegrets { + mes ""; + mesn; + mesq l("Why? And who should you bring it back to?"); + next; + + select + l("Ehm... He was really upset because of some past stories."); + + mes ""; + mesn; + mesq l("Gado! That coward lives in the past, I will ask Nard to punish him, again!"); + next; + mesq l("Take this money for your wise choice. But do not try it again. The open sea has been merciful with you once... Do not further tempt the fates!"); + + setq ShipQuests_ChefGado, 5; + Zeny += 200; + message strcharinfo(0), l("You receive @@ E!", 200); + getexp 15, 0; + close; + } + + function basicSkill { + mes ""; + mesn; + mesq l("Let me check into it..."); + next; + adddefaultskills; + mesq l("Here you go, everything is fixed."); + emotion E_HAPPY; + next; + mesq l("Do you have any other questions for me?"); + next; + ynMenu; + return; + } + + function chooseLang { + mes ""; + mesn; + mesq l("Of course! Tell me which language you speak and I will change the note on the ship board list."); + next; + + select + menuimage("flags/en", l("I speak English.") + " (English)"), + menuimage("flags/fr", l("I speak French.") + " (Français)"), + menuimage("flags/ru", l("I speak Russian.") + " (Русский)"), + menuimage("flags/es", l("I speak Spanish.") + " (Español)"), + menuimage("flags/pt_BR", l("I speak Portuguese.") + " (Português)"), + menuimage("flags/de", l("I speak German.") + " (Deutsch)"), + menuimage("flags/vls", l("I speak Flemish.") + " (Vlaams)"), + menuimage("flags/pl", l("I speak Polish.") + " (Polski)"), + menuimage("flags/it", l("I speak Italian.") + " (Italiano)"), + menuimage("flags/nl_BE", l("I speak Dutch.") + " (Nederlands)"), + menuimage("flags/ca", l("I speak Catalan.") + " (Català)"), + getarg(0, ""); + + .@lang = @menu-1; + if (.@lang < 0 || .@lang > 10) + { + mes ""; + mesn; + mesq l("No problem, do you have any other questions for me?"); + next; + ynMenu; + return; + } + Lang = .@lang; + + mes ""; + mesn; + mesq l("Ok, done."); + + if (getq(ShipQuests_Julia) == 2) + { + next; + mesq l("Do you have any other questions for me?"); + next; + ynMenu; + return; + } + + next; + mesq l("I'm sure that you've got some questions for me, feel free to ask them, but first I need to tell you the rules of proper social conduct on board."); + + mesq l("Here they are."); + next; + + narrator 0x4, + l("There is a paper with some rules written on it."), + l("1. ##BDo not bot##b, this means you are not allowed to perform any AFK (away from keyboard) activity, apart from standing idle."), + l("2. ##BDo not use offensive/rude language##b in the chats or in your character(s) name(s)."), + l("3. ##BDo not spam/flood other players.##b This includes chat spam and spam by trade requests."), + l("4. ##BSpeak only English in public areas.##b You can speak whatever language you want through whispers or whenever everyone in the area can speak said language."), + l("5. ##BDo not beg others##b for money, items or favours of any kind. If you want to ask for something, do it politely and only once. Try not to annoy other players."), + l("6. ##BFollow the [@@http://wiki.evolonline.org/rules/esc|ESC@@]##b (Evol Social Convention)."), + l("7. ##BDo not multibox.##b You are not allowed to engage in combat while controlling more than one character at a time."); + + mesn; + mesq l("Oh, and I almost forgot! Do not give the password of your room to anybody! I am the only one who has the other key and I won't ask for yours so keep it secret and try not to use the same password for any other room in the future."); + next; + mesq l("If you want to read this page again, there is a copy up on the left wall."); + next; + mesq l("I think I'm done with that now. Do you have any questions?"); + next; + + setq ShipQuests_Julia, 2; + return; + } + + function whereAmI { + mes ""; + mesn; + mesq l("You're on a ship, we're on our way to the commercial capital of Artis."); + next; + mesq l("We should be there in a few days, once we arrive, I will warn the Legion of Aemil about what happened, I'm sure they can help."); + next; + mesq l("But for now, you can relax on the ship, or visit the island we're docked at! Its a small island, but a good place to get some exercise and stretch your legs."); + next; + mesq l("Do you have any other questions for me?"); + next; + ynMenu; + return; + } + + function whatHappened { + mes ""; + mesn; + mesq l("We thought that you could help us understand this, all we know is that we found you cast in the sea, adrift on your raft."); + next; + mesq lg("You were in bad shape, you should be happy we found you before the sea killed you."); + next; + mesq l("Oh, and there was this inscription on your raft. It represents the Legion of Aemil, the largest and biggest guild of the whole new world. Does that make you remember anything, anything at all?"); + next; + + select + l("Sorry, but I can't tell you anything about that."), + l("Nothing, sorry."); + + mes ""; + mesn; + mesq l("No problem, do you have any other questions for me?"); + next; + ynMenu; + return; + } + + function readRules { + mes ""; + mesn; + mesq l("Of course, they are on the left wall, go have a look at them."); + next; + mesq l("Do you have any other questions for me?"); + next; + ynMenu; + return; + } + + function mainMenu { + do + { + menuint + rif(debug, menuaction(l("debug"))), 11, + rif(.@q3 == 5 && .@q4 < 1, l("What can I do now?")), 1, + rif(.@q3 == 3 && .@q2 == 0, l("I heard rumors about some old hostilities between you and Gado. Are they true?")), 2, + rif(.@q2 == 2 && countitem(PoisonedDish), l("Well... No wait, I have something for you but you shouldn't eat it... I'm taking it back to the kitchen.")), 3, + rif(.@q2 == 2 && countitem(PoisonedDish), l("I have brought you a tasty present for your delicate mouth.")), 4, + rif(getskilllv(NV_BASIC) < 6, l("Something is wrong with me, I can't smile nor sit.")), 5, + lg("I made a mistake, I would like to change my language."), 6, + l("Could you explain to me where I am?"), 7, + l("What happened to me?"), 8, + l("Can I read these rules again?"), 9, + l("Nothing, sorry."), 10; + + switch (@menuret) + { + case 1: gotoSleep; break; + case 2: heardRumors; break; + case 3: gotRegrets; break; + case 4: poisonJulia; break; + case 5: basicSkill; break; + case 6: chooseLang .@s$; break; + case 7: whereAmI; break; + case 8: whatHappened; break; + case 9: readRules; break; + case 10: closedialog; end; + case 11: QuestDebug0; closedialog; end; + } + } while (1); + } + mesn; mesq lg("Hello dear!"); next; @@ -43,21 +303,12 @@ .@q3 = getq(ShipQuests_Nard); .@q4 = getq(General_Narrator); .@s$ = l("I don't want to change my language, sorry."); + mainMenu; + +OnTouch: + .@q = getq(ShipQuests_Julia); + if (.@q > 1) end; -L_Menu: - menu - rif(.@q3 == 5 && .@q4 < 1, l("What can I do now?")), L_GotoSleep, - rif(.@q3 == 3 && .@q2 == 0, l("I heard rumors about some old hostilities between you and Gado. Are they true?")), L_Rumors, - rif(.@q2 == 2 && countitem(PoisonedDish), l("Well... No wait, I have something for you but you shouldn't eat it... I'm taking it back to the kitchen.")), L_Regret, - rif(.@q2 == 2 && countitem(PoisonedDish), l("I have brought you a tasty present for your delicate mouth.")), L_PoisonJulia, - rif(getskilllv(NV_BASIC) < 6, l("Something is wrong with me, I can't smile nor sit.")), L_BasicSkill, - lg("I made a mistake, I would like to change my language."), L_ChooseLang, - l("Could you explain to me where I am?"), L_WhereIam, - l("What happened to me?"), L_What, - l("Can I read these rules again?"), L_Rules, - l("Nothing, sorry."), L_Quit; - -L_First: checkclientversion; mesn; @@ -69,231 +320,11 @@ L_First: next; mesq lg("Could I ask you what your native language is? A sailor told me you're russian, but another one told me you're french... I'm a bit lost. I will register you on the ship boarding list just after that."); next; - .@s$ = ""; - goto L_ChooseLang; - - L_ChooseLang: - mes ""; - mesn; - mesq l("Of course! Tell me which language you speak and I will change the note on the ship board list."); - next; - - menu - menuimage("flags/en", l("I speak English.") + " (English)"), -, - menuimage("flags/fr", l("I speak French.") + " (Français)"), -, - menuimage("flags/ru", l("I speak Russian.") + " (Русский)"), -, - menuimage("flags/es", l("I speak Spanish.") + " (Español)"), -, - menuimage("flags/pt_BR", l("I speak Portuguese.") + " (Português)"), -, - menuimage("flags/de", l("I speak German.") + " (Deutsch)"), -, - menuimage("flags/vls", l("I speak Flemish.") + " (Vlaams)"), -, - menuimage("flags/pl", l("I speak Polish.") + " (Polski)"), -, - menuimage("flags/it", l("I speak Italian.") + " (Italiano)"), -, - menuimage("flags/nl_BE", l("I speak Dutch.") + " (Nederlands)"), -, - menuimage("flags/ca", l("I speak Catalan.") + " (Català)"), -, - .@s$, L_NoChanges; - .@lang = @menu-1; - if (.@lang < 0 || .@lang > 10) close; - Lang = .@lang; - - mes ""; - mesn; - mesq l("Ok, done."); - - .@q = getq(ShipQuests_Julia); - if (.@q == 2) goto L_NoRules; - - next; - mesq l("I'm sure that you've got some questions for me, feel free to ask them, but first I need to tell you the rules of proper social conduct on board."); - - mesq l("Here they are."); - next; - - mesn "Narrator"; - mes col(l("There is a paper with some rules written on it."), 9); - next; - mesq col(l("1. ##BDo not bot##b, this means you are not allowed to perform any AFK (away from keyboard) activity, apart from standing idle."), 9); - next; - mesq col(l("2. ##BDo not use offensive/rude language##b in the chats or in your character(s) name(s)."), 9); - next; - mesq col(l("3. ##BDo not spam/flood other players.##b This includes chat spam and spam by trade requests."), 9); - next; - mesq col(l("4. ##BSpeak only English in public areas.##b You can speak whatever language you want through whispers or whenever everyone in the area can speak said language."), 9); - next; - mesq col(l("5. ##BDo not beg others##b for money, items or favours of any kind. If you want to ask for something, do it politely and only once. Try not to annoy other players."), 9); - next; - mesq col(l("6. ##BFollow the [@@http://wiki.evolonline.org/rules/esc|ESC@@]##b (Evol Social Convention)."), 9); - next; - mesq col(l("7. ##BDo not multibox.##b You are not allowed to engage in combat while controlling more than one character at a time."), 9); - next; - - mesn; - mesq l("Oh, and I almost forgot! Do not give the password of your room to anybody! I am the only one who has the other key and I won't ask for yours so keep it secret and try not to use the same password for any other room in the future."); - next; - mesq l("If you want to read this page again, there is a copy up on the left wall."); - next; - mesq l("I think I'm done with that now. Do you have any questions?"); - next; - - setq ShipQuests_Julia, 2; - goto L_Menu; - -L_NoRules: - next; - mesq l("Do you have any other questions for me?"); - next; - - goto L_YNMenu; - -L_NoChanges: - mes ""; - mesn; - mesq l("No problem, do you have any other questions for me?"); - next; - -L_YNMenu: - menu - l("Yes, I do."), L_Menu, - l("No, none."), L_Quit; - -L_WhereIam: - mes ""; - mesn; - mesq l("You're on a ship, we're on our way to the commercial capital of Artis."); - next; - mesq l("We should be there in a few days, once we arrive, I will warn the Legion of Aemil about what happened, I'm sure they can help."); - next; - mesq l("But for now, you can relax on the ship, or visit the island we're docked at! Its a small island, but a good place to get some exercise and stretch your legs."); - next; - mesq l("Do you have any other questions for me?"); - next; - - goto L_YNMenu; - -L_What: - mes ""; - mesn; - mesq l("We thought that you could help us understand this, all we know is that we found you cast in the sea, adrift on your raft."); - next; - mesq lg("You were in bad shape, you should be happy we found you before the sea killed you."); - next; - mesq l("Oh, and there was this inscription on your raft. It represents the Legion of Aemil, the largest and biggest guild of the whole new world. Does that make you remember anything, anything at all?"); - next; - - menu - l("Sorry, but I can't tell you anything about that."), L_NoChanges, - l("Nothing, sorry."), L_NoChanges; - -L_Rules: - mes ""; - mesn; - mesq l("Of course, they are on the left wall, go have a look at them."); - next; - mesq l("Do you have any other questions for me?"); - next; - - goto L_YNMenu; - -OnTouch: - .@q = getq(ShipQuests_Julia); - if (.@q == 0 || .@q == 1) goto L_First; - - close; - -L_PoisonJulia: - mes ""; - mesn; - mesq l("Seems yummy! Let me taste it!"); - next; - mesq l("Hmmm, hm... *cough*, *cough*, *burp*, *cough*. What... What is that?!... *cough*, *burp*... Damn Gado... *cough*"); - if (countitem(PoisonedDish) > 0) delitem PoisonedDish, 1; - setq ShipQuests_ChefGado, 3; - - close; - -L_Regret: - mes ""; - mesn; - mesq l("Why? And who should you bring it back to?"); - next; - - select - l("Ehm... He was really upset because of some past stories."); - - mes ""; - mesn; - mesq l("Gado! That coward lives in the past, I will ask Nard to punish him, again!"); - next; - mesq l("Take this money for your wise choice. But do not try it again. The open sea has been merciful with you once... Do not further tempt the fates!"); - - setq ShipQuests_ChefGado, 5; - Zeny = Zeny + 200; - message strcharinfo(0), l("You receive @@ E!", 200); - getexp 15, 0; - - close; - -L_Rumors: - mes ""; - mesn; - mesq l("You shouldn't believe every tale drunken sailors tell you."); - next; - - select - l("Let's say the person who told me about that is well respected on this ship and never drunk."); - - mes ""; - mesn; - mesq l("Hahaha! All sailors aboard this ship are always drunk... Well... Except... Wait, what?! Nard told you?!"); - next; - mesq l("Doesn't he like the way I'm taking care of his ship? Everything is clean and tidy with me, rightful lieutenant of La Johanne."); - next; - mesq l("I give tasks to every single sailor, all day long. That should make him happy!"); - next; - - menu - l("Well... I don't think it is the best way to rule a ship. Think about it."), L_Quit, - l("In fact, everything seems to work perfectly under your guidance. Nard has made the right choice."), -; - - mes ""; - mesn; - mesq l("I'm glad you're on my side."); - next; - mesq l("Take this money as a reward for your nice words."); - - setq ShipQuests_ChefGado, 6; - Zeny = Zeny + 100; - message strcharinfo(0), l("You receive @@ E!", 100); - getexp 8, 0; - - close; - -L_BasicSkill: - mes ""; - mesn; - mesq l("Let me check into it..."); - next; - adddefaultskills; - mesq l("Here you go, everything is fixed."); - emotion E_HAPPY; - next; - mesq l("Do you have any other questions for me?"); - next; - - goto L_YNMenu; - -L_GotoSleep: - speech 5, - l("You already did enough for us, follow Nard's advice and get some rest."), - l("We are at half a day from our final destination, by the time that you wake up I'm sure that we will be there!"), - l("Do you have any other questions for me?"); - - goto L_YNMenu; + chooseLang ""; + mainMenu; + end; OnInit: .sex = G_FEMALE; .distance = 10; - end; - -L_Quit: - goodbye; } diff --git a/npc/commands/debug-quest.txt b/npc/commands/debug-quest.txt new file mode 100644 index 00000000..a7cb9fab --- /dev/null +++ b/npc/commands/debug-quest.txt @@ -0,0 +1,166 @@ +function script GlobalQuestDebug { + + function qDebugShip { + function qDebugGugli { + do + { + clear; + setnpcdialogtitle l("Quest debug") + " - " + l("Prologue") + " - Gugli"; + mes l("This menu gives access to quest debug menus for @@ quest subquests.", "Gugli"); + next; + mes l("Please select a quest:"); + + menuint + menuimage("actions/back", l("Go back")), 32766, + l("Gugli (main quest)"), 16, + "Ale", 10, + "Astapolos", 11, + "Gulukan", 12, + "Jalad", 13, + "QMuller", 14, + "Tibbo", 15, + menuimage("actions/exit", l("Close")), 32767; + + switch (@menuret) + { + case 32766: return; + case 32767: closedialog; end; + default: callfunc "QuestDebug" + @menuret; + } + } while (1); + } + + do + { + clear; + setnpcdialogtitle l("Quest debug") + " - " + l("Prologue"); + mes l("This menu gives access to quest debug menus for @@ quests.", l("Prologue")); + next; + mes l("Please select a quest:"); + + menuint + menuimage("actions/back", l("Go back")), 32766, + "Julia", 0, + "Arpan", 1, + "Alige", 2, + "Peter", 3, + "Nard", 4, + l("Knife"), 5, + l("Money"), 6, + l("Door"), 7, + "Couwan", 8, + l("Treasure Chest"), 9, + "Gugli", 16, + "Gado", 17, + menuimage("actions/exit", l("Close")), 32767; + + switch (@menuret) + { + case 16: qDebugGugli; break; + case 32766: return; + case 32767: closedialog; end; + default: callfunc "QuestDebug" + @menuret; + } + } while (1); + } + + function qDebugArtis { + do + { + clear; + setnpcdialogtitle l("Quest debug") + " - " + l("Artis"); + mes l("This menu gives access to quest debug menus for @@ quests.", "Artis"); + next; + mes l("Please select a quest:"); + + menuint + menuimage("actions/back", l("Go back")), 32766, + l("Lazy Brother"), 19, + l("Urchin"), 20, + l("Catching a piou"), 21, + "Eugene (" + l("fisherman") + ")", 22, + "Q'Onan", 23, + "Enora", 27, + "Fexil", 29, + "Lloyd", 30, + l("Mona's dad"), 32, + menuimage("actions/exit", l("Close")), 32767; + + switch (@menuret) + { + case 32766: return; + case 32767: closedialog; end; + default: callfunc "QuestDebug" + @menuret; + } + } while (1); + } + + function qDebugGeneral { + do + { + clear; + setnpcdialogtitle l("Quest debug") + " - " + l("Other"); + mes l("This menu gives access to quest debug menus for @@ quests.", strtolower(l("Other"))); + next; + mes l("Please select a quest:"); + + menuint + menuimage("actions/back", l("Go back")), 32766, + l("Cookies"), 18, + "Rumly", 26, + l("Narrator"), 28, + "Janus", 31, + menuimage("actions/exit", l("Close")), 32767; + + switch (@menuret) + { + case 32766: return; + case 32767: closedialog; end; + default: callfunc "QuestDebug" + @menuret; + } + } while (1); + } + + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes l("This menu gives access to all quest debug menus."); + next; + mes l("Please select a category:"); + + select + l("Prologue"), + "Artis", + l("Other"), + rif(getarg(0,0), menuimage("actions/back", l("Return to Debug menu"))), + menuimage("actions/exit", l("Close")); + + switch (@menu) + { + case 1: qDebugShip; break; + case 2: qDebugArtis; break; + case 3: qDebugGeneral; break; + case 4: return; + default: closedialog; end; + } + } while (1); +} + + + +- script @qdebug 32767,{ + end; + +OnCall: + if (!debug && getgroupid() < 1) + { + end; + } + GlobalQuestDebug; + closedialog; + end; + +OnInit: + bindatcmd "qdebug", "@qdebug::OnCall", 0, 99, 0; +} diff --git a/npc/commands/debug.txt b/npc/commands/debug.txt index 5af689b2..1a5cdec9 100644 --- a/npc/commands/debug.txt +++ b/npc/commands/debug.txt @@ -116,7 +116,7 @@ function script GlobalDebugMenu { case 2: changeStats; break; case 3: GlobalSkillDebug .@c; break; case 4: BarberDebug .@c; break; - //case 5: changeQuests; break; + case 5: GlobalQuestDebug .@c; break; case 6: DebugPresets "m"; break; case 7: resetAll; break; case 8: return; diff --git a/npc/functions/quest-debug/000-ShipQuests_Julia.txt b/npc/functions/quest-debug/000-ShipQuests_Julia.txt new file mode 100644 index 00000000..00e0120a --- /dev/null +++ b/npc/functions/quest-debug/000-ShipQuests_Julia.txt @@ -0,0 +1,26 @@ +// Julia quest debug +// Authors: +// gumi + +function script QuestDebug0 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ShipQuests_Julia"; + mes "---"; + mes l("Quest state: @@", getq(ShipQuests_Julia)); + next; + + GenericQuestDebug ShipQuests_Julia, + l("Does not have the quest"), 0, + l("Got the quest"), 1, + l("Completed"), 2; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/001-ShipQuests_Arpan.txt b/npc/functions/quest-debug/001-ShipQuests_Arpan.txt new file mode 100644 index 00000000..777d58b4 --- /dev/null +++ b/npc/functions/quest-debug/001-ShipQuests_Arpan.txt @@ -0,0 +1,27 @@ +// Arpan quest debug +// Authors: +// gumi + +function script QuestDebug1 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ShipQuests_Arpan"; + mes "---"; + mes l("Quest state: @@", getq(ShipQuests_Arpan)); + next; + + GenericQuestDebug ShipQuests_Arpan, + l("Arpan is waiting for you"), 0, + l("Arpan told you to open the chest"), 1, + l("You opened the chest"), 2, + l("Completed"), 3; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/002-ShipQuests_Alige.txt b/npc/functions/quest-debug/002-ShipQuests_Alige.txt new file mode 100644 index 00000000..abbd506d --- /dev/null +++ b/npc/functions/quest-debug/002-ShipQuests_Alige.txt @@ -0,0 +1,27 @@ +// Alige quest debug +// Authors: +// gumi + +function script QuestDebug2 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ShipQuests_Alige"; + mes "---"; + mes l("Quest state: @@", getq(ShipQuests_Alige)); + next; + + GenericQuestDebug ShipQuests_Alige, + l("Does not have the quest"), 0, + l("First encounter"), 1, + l("Alige asks for food"), 2, + l("Completed"), 3; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/003-ShipQuests_Peter.txt b/npc/functions/quest-debug/003-ShipQuests_Peter.txt new file mode 100644 index 00000000..f5d87abb --- /dev/null +++ b/npc/functions/quest-debug/003-ShipQuests_Peter.txt @@ -0,0 +1,30 @@ +// Peter quest debug +// Authors: +// gumi + +function script QuestDebug3 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ShipQuests_Peter"; + mes "---"; + mes l("Quest state: @@", getq(ShipQuests_Peter)); + next; + + GenericQuestDebug ShipQuests_Peter, + l("Does not have the quest"), 0, + l("Peter needs help"), 6, + l("Peter asks to kill rattos"), 1, + l("Killed rattos"), 2, + l("Got no reward"), 3, + l("Peter asks to kill rattos again"), 4, + l("Peter gave reward"), 5; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/004-ShipQuests_Nard.txt b/npc/functions/quest-debug/004-ShipQuests_Nard.txt new file mode 100644 index 00000000..3431fd23 --- /dev/null +++ b/npc/functions/quest-debug/004-ShipQuests_Nard.txt @@ -0,0 +1,38 @@ +// Nard quest debug +// Authors: +// gumi + +function script QuestDebug4 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ShipQuests_Nard"; + mes "---"; + mes l("Quest state: @@", getq(ShipQuests_Nard)); + mes "---"; + mes l("Subquests:"); + mes "ShipQuests_Gugli: " + getq(ShipQuests_Gugli); + mes "ShipQuests_ChefGado: " + getq(ShipQuests_ChefGado); + next; + + GenericQuestDebug ShipQuests_Nard, + l("Does not have the quest"), 0, + l("Nard asks to help crew"), 1, + menuimage("actions/manage", l("Debug Gugli quest")), 32700, + l("Completed Gugli's task"), 2, + l("Nard asks to solve conflict"), 3, + menuimage("actions/manage", l("Debug Gado quest")), 32701, + l("Solved conflict"), 4, + l("Official crew member"), 5, + l("Talked to narrator"), 6; + + switch (@menuret) + { + case 32700: callfunc "QuestDebug16"; break; + case 32701: callfunc "QuestDebug17"; break; + case 32766: return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/005-ShipQuests_Knife.txt b/npc/functions/quest-debug/005-ShipQuests_Knife.txt new file mode 100644 index 00000000..f192a126 --- /dev/null +++ b/npc/functions/quest-debug/005-ShipQuests_Knife.txt @@ -0,0 +1,25 @@ +// Knife quest debug +// Authors: +// gumi + +function script QuestDebug5 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ShipQuests_Knife"; + mes "---"; + mes l("Quest state: @@", getq(ShipQuests_Knife)); + next; + + GenericQuestDebug ShipQuests_Knife, + l("Does not have the quest"), 0, + l("Got the knife"), 1; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/006-ShipQuests_ArpanMoney.txt b/npc/functions/quest-debug/006-ShipQuests_ArpanMoney.txt new file mode 100644 index 00000000..0e00d0d9 --- /dev/null +++ b/npc/functions/quest-debug/006-ShipQuests_ArpanMoney.txt @@ -0,0 +1,26 @@ +// Money quest debug +// Authors: +// gumi + +function script QuestDebug6 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ShipQuests_ArpanMoney"; + mes "---"; + mes l("Quest state: @@", getq(ShipQuests_ArpanMoney)); + next; + + GenericQuestDebug ShipQuests_ArpanMoney, + l("Does not have the quest"), 0, + l("Elmo told about money"), 1, + l("Arpan gave money"), 2; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/007-ShipQuests_Door.txt b/npc/functions/quest-debug/007-ShipQuests_Door.txt new file mode 100644 index 00000000..bc29888e --- /dev/null +++ b/npc/functions/quest-debug/007-ShipQuests_Door.txt @@ -0,0 +1,25 @@ +// Door quest debug +// Authors: +// gumi + +function script QuestDebug7 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ShipQuests_Door"; + mes "---"; + mes l("Quest state: @@", getq(ShipQuests_Door)); + next; + + GenericQuestDebug ShipQuests_Door, + l("Does not have the quest"), 0, + l("Heard conversation"), 1; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/008-ShipQuests_Couwan.txt b/npc/functions/quest-debug/008-ShipQuests_Couwan.txt new file mode 100644 index 00000000..e9763a56 --- /dev/null +++ b/npc/functions/quest-debug/008-ShipQuests_Couwan.txt @@ -0,0 +1,26 @@ +// Couwan quest debug +// Authors: +// gumi + +function script QuestDebug8 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ShipQuests_Couwan"; + mes "---"; + mes l("Quest state: @@", getq(ShipQuests_Couwan)); + next; + + GenericQuestDebug ShipQuests_Couwan, + l("Does not have the quest"), 0, + l("Couwan asks to deliver box"), 1, + l("Delivered box, got reward"), 2; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/009-ShipQuests_TreasureChest.txt b/npc/functions/quest-debug/009-ShipQuests_TreasureChest.txt new file mode 100644 index 00000000..ea2e1dec --- /dev/null +++ b/npc/functions/quest-debug/009-ShipQuests_TreasureChest.txt @@ -0,0 +1,25 @@ +// Treasure chest quest debug +// Authors: +// gumi + +function script QuestDebug9 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ShipQuests_TreasureChest"; + mes "---"; + mes l("Quest state: @@", getq(ShipQuests_TreasureChest)); + next; + + GenericQuestDebug ShipQuests_TreasureChest, + l("Does not have the quest"), 0, + l("Opened treasure chest"), 1; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/010-ShipQuests_Ale.txt b/npc/functions/quest-debug/010-ShipQuests_Ale.txt new file mode 100644 index 00000000..67aed1fb --- /dev/null +++ b/npc/functions/quest-debug/010-ShipQuests_Ale.txt @@ -0,0 +1,25 @@ +// Part of Gugli quest debug +// Authors: +// gumi + +function script QuestDebug10 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ShipQuests_Ale"; + mes "---"; + mes l("Quest state: @@", getq(ShipQuests_Ale)); + next; + + GenericQuestDebug ShipQuests_Ale, + l("Does not have the quest"), 0, + l("Got the package"), 1; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/011-ShipQuests_Astapolos.txt b/npc/functions/quest-debug/011-ShipQuests_Astapolos.txt new file mode 100644 index 00000000..9e4d6e2b --- /dev/null +++ b/npc/functions/quest-debug/011-ShipQuests_Astapolos.txt @@ -0,0 +1,25 @@ +// Part of Gugli quest debug +// Authors: +// gumi + +function script QuestDebug11 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ShipQuests_Astapolos"; + mes "---"; + mes l("Quest state: @@", getq(ShipQuests_Astapolos)); + next; + + GenericQuestDebug ShipQuests_Astapolos, + l("Does not have the quest"), 0, + l("Got the package"), 1; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/012-ShipQuests_Gulukan.txt b/npc/functions/quest-debug/012-ShipQuests_Gulukan.txt new file mode 100644 index 00000000..878b536f --- /dev/null +++ b/npc/functions/quest-debug/012-ShipQuests_Gulukan.txt @@ -0,0 +1,25 @@ +// Part of Gugli quest debug +// Authors: +// gumi + +function script QuestDebug12 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ShipQuests_Gulukan"; + mes "---"; + mes l("Quest state: @@", getq(ShipQuests_Gulukan)); + next; + + GenericQuestDebug ShipQuests_Gulukan, + l("Does not have the quest"), 0, + l("Got the package"), 1; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/013-ShipQuests_Jalad.txt b/npc/functions/quest-debug/013-ShipQuests_Jalad.txt new file mode 100644 index 00000000..d5640411 --- /dev/null +++ b/npc/functions/quest-debug/013-ShipQuests_Jalad.txt @@ -0,0 +1,25 @@ +// Part of Gugli quest debug +// Authors: +// gumi + +function script QuestDebug13 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ShipQuests_Jalad"; + mes "---"; + mes l("Quest state: @@", getq(ShipQuests_Jalad)); + next; + + GenericQuestDebug ShipQuests_Jalad, + l("Does not have the quest"), 0, + l("Got the package"), 1; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/014-ShipQuests_QMuller.txt b/npc/functions/quest-debug/014-ShipQuests_QMuller.txt new file mode 100644 index 00000000..1f69efdd --- /dev/null +++ b/npc/functions/quest-debug/014-ShipQuests_QMuller.txt @@ -0,0 +1,25 @@ +// Part of Gugli quest debug +// Authors: +// gumi + +function script QuestDebug14 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ShipQuests_QMuller"; + mes "---"; + mes l("Quest state: @@", getq(ShipQuests_QMuller)); + next; + + GenericQuestDebug ShipQuests_QMuller, + l("Does not have the quest"), 0, + l("Got the package"), 1; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/015-ShipQuests_Tibbo.txt b/npc/functions/quest-debug/015-ShipQuests_Tibbo.txt new file mode 100644 index 00000000..f963a0f0 --- /dev/null +++ b/npc/functions/quest-debug/015-ShipQuests_Tibbo.txt @@ -0,0 +1,25 @@ +// Part of Gugli quest debug +// Authors: +// gumi + +function script QuestDebug15 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ShipQuests_Tibbo"; + mes "---"; + mes l("Quest state: @@", getq(ShipQuests_Tibbo)); + next; + + GenericQuestDebug ShipQuests_Tibbo, + l("Does not have the quest"), 0, + l("Got the package"), 1; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/016-ShipQuests_Gugli.txt b/npc/functions/quest-debug/016-ShipQuests_Gugli.txt new file mode 100644 index 00000000..70c5a441 --- /dev/null +++ b/npc/functions/quest-debug/016-ShipQuests_Gugli.txt @@ -0,0 +1,46 @@ +// Part of Gugli quest debug +// Authors: +// gumi + +function script QuestDebug16 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ShipQuests_Gugli"; + mes "---"; + mes l("Quest state: @@", getq(ShipQuests_Gugli)); + mes "---"; + mes l("Subquests:"); + mes "ShipQuests_Ale: " + getq(ShipQuests_Ale); + mes "ShipQuests_Astapolos: " + getq(ShipQuests_Astapolos); + mes "ShipQuests_Gulukan: " + getq(ShipQuests_Gulukan); + mes "ShipQuests_Jalad: " + getq(ShipQuests_Jalad); + mes "ShipQuests_QMuller: " + getq(ShipQuests_QMuller); + mes "ShipQuests_Tibbo: " + getq(ShipQuests_Tibbo); + next; + + GenericQuestDebug ShipQuests_Gugli, + l("Does not have the quest"), 0, + l("Gugli asks to collect packages"), 1, + menuimage("actions/manage", l("Reset subquests")), 32700, + menuimage("actions/manage", l("Set subquests as completed")), 32701, + l("Got reward from gugli"), 2; + + switch (@menuret) + { + case 0: + case 32700: + case 32701: + setq ShipQuests_Ale, (@menuret == 32701 ? 1 : 0); + setq ShipQuests_Astapolos, (@menuret == 32701 ? 1 : 0); + setq ShipQuests_Gulukan, (@menuret == 32701 ? 1 : 0); + setq ShipQuests_Jalad, (@menuret == 32701 ? 1 : 0); + setq ShipQuests_QMuller, (@menuret == 32701 ? 1 : 0); + setq ShipQuests_Tibbo, (@menuret == 32701 ? 1 : 0); + break; + case 32766: return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/017-ShipQuests_ChefGado.txt b/npc/functions/quest-debug/017-ShipQuests_ChefGado.txt new file mode 100644 index 00000000..8bf5ea6f --- /dev/null +++ b/npc/functions/quest-debug/017-ShipQuests_ChefGado.txt @@ -0,0 +1,30 @@ +// Gado quest debug +// Authors: +// gumi + +function script QuestDebug17 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ShipQuests_ChefGado"; + mes "---"; + mes l("Quest state: @@", getq(ShipQuests_ChefGado)); + next; + + GenericQuestDebug ShipQuests_ChefGado, + l("Does not have the quest"), 0, + l("Nard asks to solve conflict"), 1, + l("Got poison from Gado"), 2, + l("Poisoned Julia"), 3, + l("Completed, Gado wins"), 4, + l("Completed, Julia wins (returned poison)"), 5, + l("Completed, Julia wins"), 6; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/018-General_Cookies.txt b/npc/functions/quest-debug/018-General_Cookies.txt new file mode 100644 index 00000000..43bf44af --- /dev/null +++ b/npc/functions/quest-debug/018-General_Cookies.txt @@ -0,0 +1,25 @@ +// Cookie quest debug +// Authors: +// gumi + +function script QuestDebug18 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "General_Cookies"; + mes "---"; + mes l("Quest state: @@", getq(General_Cookies)); + next; + + GenericQuestDebug General_Cookies, + l("Does not have the quest"), 0, + l("Got a cookie"), 1; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/019-ArtisQuests_LazyBrother.txt b/npc/functions/quest-debug/019-ArtisQuests_LazyBrother.txt new file mode 100644 index 00000000..02d674b0 --- /dev/null +++ b/npc/functions/quest-debug/019-ArtisQuests_LazyBrother.txt @@ -0,0 +1,28 @@ +// Lazy brother quest debug +// Authors: +// gumi + +function script QuestDebug19 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ArtisQuests_LazyBrother"; + mes "---"; + mes l("Quest state: @@", getq(ArtisQuests_LazyBrother)); + next; + + GenericQuestDebug ArtisQuests_LazyBrother, + l("Does not have the quest"), 0, + l("Katja asked for help"), 1, + l("Found bobo, didn't tell Katja"), 2, + l("Told bobo to go home"), 3, + l("Katja gave reward"), 4; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/020-ArtisQuests_Urchin.txt b/npc/functions/quest-debug/020-ArtisQuests_Urchin.txt new file mode 100644 index 00000000..a7f73a5d --- /dev/null +++ b/npc/functions/quest-debug/020-ArtisQuests_Urchin.txt @@ -0,0 +1,26 @@ +// Urchin quest debug +// Authors: +// gumi + +function script QuestDebug20 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ArtisQuests_Urchin"; + mes "---"; + mes l("Quest state: @@", getq(ArtisQuests_Urchin)); + next; + + GenericQuestDebug ArtisQuests_Urchin, + l("Does not have the quest"), 0, + l("Moon needs @@", l("Croc Claw")), 1, + l("Found @@, got exp", l("Croc Claw")), 2; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/021-ArtisQuests_CatchPiou.txt b/npc/functions/quest-debug/021-ArtisQuests_CatchPiou.txt new file mode 100644 index 00000000..9548ef9b --- /dev/null +++ b/npc/functions/quest-debug/021-ArtisQuests_CatchPiou.txt @@ -0,0 +1,26 @@ +// Piou quest debug +// Authors: +// gumi + +function script QuestDebug21 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ArtisQuests_CatchPiou"; + mes "---"; + mes l("Quest state: @@", getq(ArtisQuests_CatchPiou)); + next; + + GenericQuestDebug ArtisQuests_CatchPiou, + l("Does not have the quest"), 0, + l("Salem asks to catch piou"), 1, + l("Returned piou to Salem"), 2; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/022-ArtisQuests_Fishman.txt b/npc/functions/quest-debug/022-ArtisQuests_Fishman.txt new file mode 100644 index 00000000..65c6ff44 --- /dev/null +++ b/npc/functions/quest-debug/022-ArtisQuests_Fishman.txt @@ -0,0 +1,26 @@ +// Eugene quest debug +// Authors: +// gumi + +function script QuestDebug22 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ArtisQuests_Fishman"; + mes "---"; + mes l("Quest state: @@", getq(ArtisQuests_Fishman)); + next; + + GenericQuestDebug ArtisQuests_Fishman, + l("Does not have the quest"), 0, + l("Eugene needs tentacles"), 1, + l("Gave tentacles, got reward"), 2; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/023-ArtisQuests_QOnan.txt b/npc/functions/quest-debug/023-ArtisQuests_QOnan.txt new file mode 100644 index 00000000..6028604c --- /dev/null +++ b/npc/functions/quest-debug/023-ArtisQuests_QOnan.txt @@ -0,0 +1,27 @@ +// Q'Onan quest debug +// Authors: +// gumi + +function script QuestDebug23 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ArtisQuests_QOnan"; + mes "---"; + mes l("Quest state: @@", getq(ArtisQuests_QOnan)); + next; + + GenericQuestDebug ArtisQuests_QOnan, + l("Does not have the quest"), 0, + l("Q'Onan asks to find chest"), 1, + l("Found the chest"), 2, + l("Gave to Q'Onan, got reward"), 3; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/026-General_Rumly.txt b/npc/functions/quest-debug/026-General_Rumly.txt new file mode 100644 index 00000000..ad245420 --- /dev/null +++ b/npc/functions/quest-debug/026-General_Rumly.txt @@ -0,0 +1,27 @@ +// Rumly quest debug +// Authors: +// gumi + +function script QuestDebug26 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "General_Rumly"; + mes "---"; + mes l("Quest state: @@", getq(General_Rumly)); + next; + + GenericQuestDebug General_Rumly, + l("Does not have the quest"), 0, + l("Rumly needs your help"), 1, + l("Rumly wants @@", l("Plushroom")), 2, + l("Gave @@ to Rumly", l("Plushroom")), 3; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/027-ArtisQuests_Enora.txt b/npc/functions/quest-debug/027-ArtisQuests_Enora.txt new file mode 100644 index 00000000..ef8c7d43 --- /dev/null +++ b/npc/functions/quest-debug/027-ArtisQuests_Enora.txt @@ -0,0 +1,35 @@ +// Newbie quest debug +// Authors: +// gumi + +function script QuestDebug27 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ArtisQuests_Enora"; + mes "---"; + mes l("Quest state: @@", getq(ArtisQuests_Enora)); + next; + + GenericQuestDebug ArtisQuests_Enora, + l("Does not have the quest"), 0, + l("Enora asks to visit Chelios"), 1, + l("Chelios asks to visit Lloyd"), 2, + l("Lloyd gave package"), 3, + l("Chelios made sword"), 4, + l("Enora asks to visit Resa"), 5, + l("Resa gave package"), 6, + l("Enora asks to visit Q'Pid"), 7, + l("Lost the riddle"), 8, + l("Ivan gave package"), 9, + l("Enora asks to kill fluffys"), 10, + l("Completed, got reward"), 11; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/028-General_Narrator.txt b/npc/functions/quest-debug/028-General_Narrator.txt new file mode 100644 index 00000000..e5c19c7f --- /dev/null +++ b/npc/functions/quest-debug/028-General_Narrator.txt @@ -0,0 +1,25 @@ +// Narrator debug +// Authors: +// gumi + +function script QuestDebug28 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "General_Narrator"; + mes "---"; + mes l("Quest state: @@", getq(General_Narrator)); + next; + + GenericQuestDebug General_Narrator, + l("Game introduction"), 0, + l("Visited Artis at least once"), 1; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/029-ArtisQuests_Fexil.txt b/npc/functions/quest-debug/029-ArtisQuests_Fexil.txt new file mode 100644 index 00000000..b8cf6283 --- /dev/null +++ b/npc/functions/quest-debug/029-ArtisQuests_Fexil.txt @@ -0,0 +1,27 @@ +// Fexil quest debug +// Authors: +// gumi + +function script QuestDebug29 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ArtisQuests_Fexil"; + mes "---"; + mes l("Quest state: @@", getq(ArtisQuests_Fexil)); + next; + + GenericQuestDebug ArtisQuests_Fexil, + l("Does not have the quest"), 0, + l("Lloyd gave pass"), 1, + l("Fexil needs help"), 2, + l("Fexil wants to buy fur"), 3; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/030-ArtisQuests_Lloyd.txt b/npc/functions/quest-debug/030-ArtisQuests_Lloyd.txt new file mode 100644 index 00000000..4ac85cc5 --- /dev/null +++ b/npc/functions/quest-debug/030-ArtisQuests_Lloyd.txt @@ -0,0 +1,25 @@ +// Lloyd quest debug +// Authors: +// gumi + +function script QuestDebug30 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ArtisQuests_Lloyd"; + mes "---"; + mes l("Quest state: @@", getq(ArtisQuests_Lloyd)); + next; + + GenericQuestDebug ArtisQuests_Lloyd, + l("Does not have the quest"), 0, + l("Registered"), 1; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/031-General_Janus.txt b/npc/functions/quest-debug/031-General_Janus.txt new file mode 100644 index 00000000..797e3357 --- /dev/null +++ b/npc/functions/quest-debug/031-General_Janus.txt @@ -0,0 +1,31 @@ +// Janus quest debug +// Authors: +// gumi + +function script QuestDebug31 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "General_Janus"; + mes "---"; + mes l("Quest state: @@", getq(General_Janus)); + next; + + GenericQuestDebug General_Janus, + l("Does not have the quest"), 0, + l("Talked to Janus"), 1, + l("Can create party"), 2, + l("Can create guild"), 3; + + switch (@menuret) + { + case 0: + case 1: skill NV_BASIC, min(6, getskilllv(NV_BASIC)), 0; break; + case 2: + case 3: skill NV_BASIC, max(7, getskilllv(NV_BASIC)), 0; break; + case 32766: return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/032-ArtisQuests_MonaDad.txt b/npc/functions/quest-debug/032-ArtisQuests_MonaDad.txt new file mode 100644 index 00000000..f1b142f9 --- /dev/null +++ b/npc/functions/quest-debug/032-ArtisQuests_MonaDad.txt @@ -0,0 +1,25 @@ +// Mona quest debug +// Authors: +// gumi + +function script QuestDebug32 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "ArtisQuests_MonaDad"; + mes "---"; + mes l("Quest state: @@", getq(ArtisQuests_MonaDad)); + next; + + GenericQuestDebug ArtisQuests_MonaDad, + l("Does not have the quest"), 0, + l("Mona's dad is missing"), 1; + + if (@menuret == 32766) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/functions.txt b/npc/functions/quest-debug/functions.txt new file mode 100644 index 00000000..c193f9f8 --- /dev/null +++ b/npc/functions/quest-debug/functions.txt @@ -0,0 +1,73 @@ +// generic quest debug functions + +function script GenericQuestDebug { + if (!debug) + { + select + menuimage("actions/back", l("Go back")), + menuimage("actions/exit", l("Close")); + + if (@menu == 1) + { + @menuret = 32766; + return 32766; + } + + closedialog; + end; + } + + mes l("Choose desired quest state:"); + + deletearray .@vals; + .@menustr$ = menuimage("actions/abort", l("Do nothing")) + ":"; + .@vals[0] = 32766; + .@cnt = 1; + + for (.@f = 1; .@f < getargcount(); .@f += 2) + { + if (getarg(.@f) != "") + { + .@qv = getarg(.@f + 1); + .@s$ = menuimage("actions/" + (.@qv ? "edit" : "reset"), "[" + .@qv + "] " + getarg(.@f)); + .@menustr$ += (.@qv >= 32700 ? getarg(.@f) : .@s$) + ":"; + .@vals[.@cnt] = .@qv; + ++.@cnt; + } + } + + if (getgroupid() >= 99) + { + .@menustr$ += menuimage("actions/nuke", l("Set state manually")) + ":"; + .@vals[.@cnt] = 32765; + ++.@cnt; + } + + .@menustr$ += menuimage("actions/exit", l("Close")); + .@vals[.@cnt] = 32767; + + @menu = 255; + @menuret = -1; + select(.@menustr$); + if (@menu == 255) + return -1; + + --@menu; + if (@menu < 0 || @menu >= getarraysize(.@vals)) + return -1; + + @menuret = .@vals[@menu]; + + switch (@menuret) + { + case 32765: input .@w; setq getarg(0,0), .@w; + case 32766: return 1; + case 32767: closedialog; end; + } + + if (@menuret < 32700) + { + setq getarg(0,0), @menuret; + } + return; +} diff --git a/npc/scripts.conf b/npc/scripts.conf index 1efd1291..bab98e83 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -32,6 +32,41 @@ "npc/functions/mouboofunc.txt", "npc/functions/string.txt", +// quest debug +"npc/functions/quest-debug/functions.txt", +"npc/functions/quest-debug/000-ShipQuests_Julia.txt", +"npc/functions/quest-debug/001-ShipQuests_Arpan.txt", +"npc/functions/quest-debug/002-ShipQuests_Alige.txt", +"npc/functions/quest-debug/003-ShipQuests_Peter.txt", +"npc/functions/quest-debug/004-ShipQuests_Nard.txt", +"npc/functions/quest-debug/005-ShipQuests_Knife.txt", +"npc/functions/quest-debug/006-ShipQuests_ArpanMoney.txt", +"npc/functions/quest-debug/007-ShipQuests_Door.txt", +"npc/functions/quest-debug/009-ShipQuests_TreasureChest.txt", +"npc/functions/quest-debug/010-ShipQuests_Ale.txt", +"npc/functions/quest-debug/011-ShipQuests_Astapolos.txt", +"npc/functions/quest-debug/012-ShipQuests_Gulukan.txt", +"npc/functions/quest-debug/013-ShipQuests_Jalad.txt", +"npc/functions/quest-debug/014-ShipQuests_QMuller.txt", +"npc/functions/quest-debug/015-ShipQuests_Tibbo.txt", +"npc/functions/quest-debug/016-ShipQuests_Gugli.txt", +"npc/functions/quest-debug/017-ShipQuests_ChefGado.txt", +"npc/functions/quest-debug/018-General_Cookies.txt", +"npc/functions/quest-debug/019-ArtisQuests_LazyBrother.txt", +"npc/functions/quest-debug/020-ArtisQuests_Urchin.txt", +"npc/functions/quest-debug/021-ArtisQuests_CatchPiou.txt", +"npc/functions/quest-debug/022-ArtisQuests_Fishman.txt", +"npc/functions/quest-debug/023-ArtisQuests_QOnan.txt", +// 24: quest removed (Halloween_VisitArtis) +// 25: quest removed (Halloween_BarrelQuest) +"npc/functions/quest-debug/026-General_Rumly.txt", +"npc/functions/quest-debug/027-ArtisQuests_Enora.txt", +"npc/functions/quest-debug/028-General_Narrator.txt", +"npc/functions/quest-debug/029-ArtisQuests_Fexil.txt", +"npc/functions/quest-debug/030-ArtisQuests_Lloyd.txt", +"npc/functions/quest-debug/031-General_Janus.txt", +"npc/functions/quest-debug/032-ArtisQuests_MonaDad.txt", + // custom atcommands "npc/commands/music.txt", "npc/commands/warp.txt", @@ -40,6 +75,7 @@ "npc/commands/scheduled-broadcasts.txt", "npc/commands/event.txt", "npc/commands/debug-look.txt", +"npc/commands/debug-quest.txt", "npc/commands/debug-skill.txt", "npc/commands/debug-preset.txt", "npc/commands/debug.txt", -- cgit v1.2.3-70-g09d2 From 3aaf8002319cdebd93f2292e6d18cb727c532550 Mon Sep 17 00:00:00 2001 From: gumi Date: Thu, 18 Aug 2016 13:08:31 -0400 Subject: add FuzzyTime functions (human-readable time) --- npc/commands/scheduled-broadcasts.txt | 21 +++-- npc/functions/time.txt | 143 ++++++++++++++++++++++++++++++++++ npc/scripts.conf | 1 + 3 files changed, 158 insertions(+), 7 deletions(-) create mode 100644 npc/functions/time.txt diff --git a/npc/commands/scheduled-broadcasts.txt b/npc/commands/scheduled-broadcasts.txt index e8c16d6e..b520f0b0 100644 --- a/npc/commands/scheduled-broadcasts.txt +++ b/npc/commands/scheduled-broadcasts.txt @@ -114,6 +114,7 @@ function script StoneBoard { $@SCHED_Opt[1] = .@int; $@SCHED_Opt[2] = 0; $@SCHED_Opt[3] = .@max; + $@SCHED_Opt[4] = 0; $@SCHED_Msg$ = .@msg$; if (.@int) { @@ -146,8 +147,9 @@ function script StoneBoard { mes l("Sent on login: @@", ($@SCHED_Opt[0] ? l("yes") : l("no"))); if ($@SCHED_Opt[1]) { + .@next = max(1, ((3600000 * ($@SCHED_Opt[1] - $@SCHED_Opt[4])) - getnpctimer(0))); mes l("Interval: every @@ hour(s)", $@SCHED_Opt[1]); - //mes l("Next broadcast: "); // FIXME: (needs a HumanTime function) + mes l("Next broadcast: @@", FuzzyTimeFromMs(.@next)); } else { @@ -183,14 +185,19 @@ function script StoneBoard { end; OnTimer3600000: - stopnpctimer; - ++$@SCHED_Opt[2]; - if ($@SCHED_Msg$ != "") + ++$@SCHED_Opt[4]; + if ($@SCHED_Opt[4] == ($@SCHED_Opt[1] - 1)) { - announce $@SCHED_Msg$, bc_all; - if ($@SCHED_Opt[2] < $@SCHED_Opt[3] && $@SCHED_Opt[3] > 0) + stopnpctimer; + ++$@SCHED_Opt[2]; + if ($@SCHED_Msg$ != "") { - initnpctimer; + announce $@SCHED_Msg$, bc_all; + $@SCHED_Opt[4] = 0; + if ($@SCHED_Opt[2] < $@SCHED_Opt[3] && $@SCHED_Opt[3] > 0) + { + initnpctimer; + } } } end; diff --git a/npc/functions/time.txt b/npc/functions/time.txt new file mode 100644 index 00000000..eb19d030 --- /dev/null +++ b/npc/functions/time.txt @@ -0,0 +1,143 @@ +// FuzzyTime( , ) +// gives time in a human-readable format +// +// is bitmasked: +// 1 do not show "ago" when in past +// 2 do not show "in" when in the future +// 4 show "from now" instead of "in" when in the future + +function script FuzzyTime { + .@now = gettimetick(2); + .@future = getarg(0, .@now); + .@options = getarg(1,0); + .@diff = max(.@future - .@now); + .@ret$ = ""; + .@past = 0; + .@s = 0; // for serial comma + + // define units + .@unit_second = 1; + .@unit_second$ = l("second"); + .@unit_seconds$ = l("seconds"); + + .@unit_minute = (.@unit_second * 60); + .@unit_minute$ = l("minute"); + .@unit_minutes$ = l("minutes"); + + .@unit_hour = (.@unit_minute * 60); + .@unit_hour$ = l("hour"); + .@unit_hours$ = l("hours"); + + .@unit_day = (.@unit_hour * 24); + .@unit_day$ = l("day"); + .@unit_days$ = l("days"); + + .@unit_year = (.@unit_day * 365); + .@unit_year$ = l("year"); + .@unit_years$ = l("years"); + + // check if in the past, or in the future + if (.@diff < 0) + { + .@diff *= -1; + .@past = 1; + } + + .@diff = max(1, .@diff); + + if (.@diff >= .@unit_year) + { + .@years = (.@diff / .@unit_year); + .@diff = (.@diff % .@unit_year); + .@ret$ += .@years + " " + getd(".@unit_year" + (.@years > 1 ? "s$" : "$")); + ++.@s; + } + + if (.@diff >= .@unit_day) + { + .@days = (.@diff / .@unit_day); + .@diff = (.@diff % .@unit_day); + + if (.@ret$ != "") + { + .@ret$ += .@diff > 0 ? ", " : l(", and "); + } + + .@ret$ += .@days + " " + getd(".@unit_day" + (.@days > 1 ? "s$" : "$")); + ++.@s; + } + + if (.@diff >= .@unit_hour) + { + .@hours = (.@diff / .@unit_hour); + .@diff = (.@diff % .@unit_hour); + + if (.@ret$ != "") + { + .@ret$ += .@diff > 0 ? ", " : (.@s >= 2 ? ", " : " ") + l("and "); + } + + .@ret$ += .@hours + " " + getd(".@unit_hour" + (.@hours > 1 ? "s$" : "$")); + ++.@s; + } + + if (.@diff >= .@unit_minute) + { + .@minutes = (.@diff / .@unit_minute); + .@diff = (.@diff % .@unit_minute); + + if (.@ret$ != "") + { + .@ret$ += .@diff > 0 ? ", " : (.@s >= 2 ? ", " : " ") + l("and "); + } + + .@ret$ += .@minutes + " " + getd(".@unit_minute" + (.@minutes > 1 ? "s$" : "$")); + ++.@s; + } + + if (.@diff >= .@unit_second) + { + .@seconds = (.@diff / .@unit_second); + .@diff = (.@diff % .@unit_second); + + if (.@ret$ != "") + { + .@ret$ += .@diff > 0 ? ", " : (.@s >= 2 ? ", " : " ") + l("and "); + } + + .@ret$ += .@seconds + " " + getd(".@unit_second" + (.@seconds > 1 ? "s$" : "$")); + ++.@s; + } + + if (.@past > 0 && !(.@options & 1)) + { + .@ret$ += l(" ago"); + } + + if (.@past < 1 && !(.@options & 2)) + { + .@ret$ = (.@options & 4) ? l("@@ from now", .@ret$) : l("in @@", .@ret$); + } + + return .@ret$; +} + +function script FuzzyTimeFromSeconds { + return FuzzyTime((gettimetick(2) + getarg(0,0)), getarg(1,0)); +} + +function script FuzzyTimeFromMs { + return FuzzyTimeFromSeconds((getarg(0,0) / 1000), getarg(1,0)); +} + +function script FuzzyTimeFromMinutes { + return FuzzyTimeFromSeconds((getarg(0,0) * 60), getarg(1,0)); +} + +function script FuzzyTimeFromHours { + return FuzzyTimeFromMinutes((getarg(0,0) * 60), getarg(1,0)); +} + +function script FuzzyTimeFromDays { + return FuzzyTimeFromHours((getarg(0,0) * 24), getarg(1,0)); +} diff --git a/npc/scripts.conf b/npc/scripts.conf index bab98e83..31de12c5 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -31,6 +31,7 @@ "npc/functions/fishing.txt", "npc/functions/mouboofunc.txt", "npc/functions/string.txt", +"npc/functions/time.txt", // quest debug "npc/functions/quest-debug/functions.txt", -- cgit v1.2.3-70-g09d2 From 5d7c9eb8b6f3175d7eb5afe28eb85519d1d2cd2d Mon Sep 17 00:00:00 2001 From: gumi Date: Thu, 18 Aug 2016 18:45:01 -0400 Subject: last minute changes --- db/constants.conf | 2 +- db/re/skill_db.conf | 9 ++ npc/000-2-0/julia.txt | 50 ++++----- npc/001-1/calypsan.txt | 26 +++-- npc/001-1/chelios.txt | 19 ++-- npc/001-1/enora.txt | 57 +++++------ npc/001-1/fexil.txt | 12 +-- npc/001-1/qonan.txt | 12 +-- npc/001-1/qpid.txt | 32 +++--- npc/001-1/rumly.txt | 114 ++++++++++----------- npc/001-1/salem.txt | 51 +++++---- npc/001-2-0/resa.txt | 19 ++-- npc/001-2-12/oscar.txt | 12 +-- npc/001-2-19/lloyd.txt | 33 +++--- npc/001-2-2/moon.txt | 10 +- npc/001-2-26/ivan.txt | 11 +- npc/001-2-41/edouard.txt | 16 +-- npc/001-2-9/janus.txt | 19 ++-- npc/commands/debug-look.txt | 40 ++++---- npc/commands/debug-preset.txt | 40 ++------ npc/commands/debug-quest.txt | 92 ++++++++--------- npc/commands/debug-skill.txt | 26 ++--- npc/commands/debug.txt | 50 ++++----- npc/commands/event.txt | 10 +- npc/commands/motd.txt | 36 +++---- npc/commands/numa.txt | 49 --------- npc/commands/scheduled-broadcasts.txt | 75 +++++++------- npc/commands/super-menu.txt | 69 +++++++++++++ npc/commands/warp.txt | 6 ++ npc/commands/zeny.txt | 6 ++ npc/functions/quest-debug/000-ShipQuests_Julia.txt | 2 +- npc/functions/quest-debug/001-ShipQuests_Arpan.txt | 2 +- npc/functions/quest-debug/002-ShipQuests_Alige.txt | 2 +- npc/functions/quest-debug/003-ShipQuests_Peter.txt | 2 +- npc/functions/quest-debug/004-ShipQuests_Nard.txt | 10 +- npc/functions/quest-debug/005-ShipQuests_Knife.txt | 2 +- .../quest-debug/006-ShipQuests_ArpanMoney.txt | 2 +- npc/functions/quest-debug/007-ShipQuests_Door.txt | 2 +- .../quest-debug/008-ShipQuests_Couwan.txt | 2 +- .../quest-debug/009-ShipQuests_TreasureChest.txt | 2 +- npc/functions/quest-debug/010-ShipQuests_Ale.txt | 2 +- .../quest-debug/011-ShipQuests_Astapolos.txt | 2 +- .../quest-debug/012-ShipQuests_Gulukan.txt | 2 +- npc/functions/quest-debug/013-ShipQuests_Jalad.txt | 2 +- .../quest-debug/014-ShipQuests_QMuller.txt | 2 +- npc/functions/quest-debug/015-ShipQuests_Tibbo.txt | 2 +- npc/functions/quest-debug/016-ShipQuests_Gugli.txt | 24 +++-- .../quest-debug/017-ShipQuests_ChefGado.txt | 2 +- npc/functions/quest-debug/018-General_Cookies.txt | 2 +- .../quest-debug/019-ArtisQuests_LazyBrother.txt | 2 +- .../quest-debug/020-ArtisQuests_Urchin.txt | 2 +- .../quest-debug/021-ArtisQuests_CatchPiou.txt | 2 +- .../quest-debug/022-ArtisQuests_Fishman.txt | 2 +- .../quest-debug/023-ArtisQuests_QOnan.txt | 2 +- npc/functions/quest-debug/026-General_Rumly.txt | 2 +- .../quest-debug/027-ArtisQuests_Enora.txt | 2 +- npc/functions/quest-debug/028-General_Narrator.txt | 2 +- .../quest-debug/029-ArtisQuests_Fexil.txt | 2 +- .../quest-debug/030-ArtisQuests_Lloyd.txt | 2 +- npc/functions/quest-debug/031-General_Janus.txt | 2 +- .../quest-debug/032-ArtisQuests_MonaDad.txt | 2 +- npc/functions/quest-debug/functions.txt | 31 ++---- npc/scripts.conf | 2 +- 63 files changed, 546 insertions(+), 582 deletions(-) delete mode 100644 npc/commands/numa.txt create mode 100644 npc/commands/super-menu.txt diff --git a/db/constants.conf b/db/constants.conf index a4224aa9..1ca76177 100644 --- a/db/constants.conf +++ b/db/constants.conf @@ -3613,7 +3613,7 @@ constants_db: { /* ==================================================== */ /** evol constants **/ - debug: 1 + debug: 0 comment__: "outdated constants. must be removed" // >>> diff --git a/db/re/skill_db.conf b/db/re/skill_db.conf index 8b4a237c..73e5ae82 100644 --- a/db/re/skill_db.conf +++ b/db/re/skill_db.conf @@ -37495,4 +37495,13 @@ skill_db: ( SPCost: 14 } }, +{ + Id: 20002 + Name: "EVOL_SUPER_MENU" + Description: "Super Menu" + MaxLevel: 1 + SkillType: { + Self: true + } +}, ) diff --git a/npc/000-2-0/julia.txt b/npc/000-2-0/julia.txt index e17d93da..8206a0b9 100644 --- a/npc/000-2-0/julia.txt +++ b/npc/000-2-0/julia.txt @@ -263,32 +263,32 @@ function mainMenu { do { - menuint - rif(debug, menuaction(l("debug"))), 11, - rif(.@q3 == 5 && .@q4 < 1, l("What can I do now?")), 1, - rif(.@q3 == 3 && .@q2 == 0, l("I heard rumors about some old hostilities between you and Gado. Are they true?")), 2, - rif(.@q2 == 2 && countitem(PoisonedDish), l("Well... No wait, I have something for you but you shouldn't eat it... I'm taking it back to the kitchen.")), 3, - rif(.@q2 == 2 && countitem(PoisonedDish), l("I have brought you a tasty present for your delicate mouth.")), 4, - rif(getskilllv(NV_BASIC) < 6, l("Something is wrong with me, I can't smile nor sit.")), 5, - lg("I made a mistake, I would like to change my language."), 6, - l("Could you explain to me where I am?"), 7, - l("What happened to me?"), 8, - l("Can I read these rules again?"), 9, - l("Nothing, sorry."), 10; - - switch (@menuret) + select + rif(debug, menuaction(l("debug"))), + rif(.@q3 == 5 && .@q4 < 1, l("What can I do now?")), + rif(.@q3 == 3 && .@q2 == 0, l("I heard rumors about some old hostilities between you and Gado. Are they true?")), + rif(.@q2 == 2 && countitem(PoisonedDish), l("Well... No wait, I have something for you but you shouldn't eat it... I'm taking it back to the kitchen.")), + rif(.@q2 == 2 && countitem(PoisonedDish), l("I have brought you a tasty present for your delicate mouth.")), + rif(getskilllv(NV_BASIC) < 6, l("Something is wrong with me, I can't smile nor sit.")), + lg("I made a mistake, I would like to change my language."), + l("Could you explain to me where I am?"), + l("What happened to me?"), + l("Can I read these rules again?"), + l("Nothing, sorry."); + + switch (@menu) { - case 1: gotoSleep; break; - case 2: heardRumors; break; - case 3: gotRegrets; break; - case 4: poisonJulia; break; - case 5: basicSkill; break; - case 6: chooseLang .@s$; break; - case 7: whereAmI; break; - case 8: whatHappened; break; - case 9: readRules; break; - case 10: closedialog; end; - case 11: QuestDebug0; closedialog; end; + case 2: gotoSleep; break; + case 3: heardRumors; break; + case 4: gotRegrets; break; + case 5: poisonJulia; break; + case 6: basicSkill; break; + case 7: chooseLang .@s$; break; + case 8: whereAmI; break; + case 9: whatHappened; break; + case 10: readRules; break; + case 1: QuestDebug0; + case 11: closedialog; end; } } while (1); } diff --git a/npc/001-1/calypsan.txt b/npc/001-1/calypsan.txt index d597e30e..88cd5267 100644 --- a/npc/001-1/calypsan.txt +++ b/npc/001-1/calypsan.txt @@ -61,16 +61,16 @@ do { - menuint - rif(.@fexil == 1, l("Have you seen Fexil?")), 0, - menuaction(l("Trade")), 1, - l("How do these dyes work?"), 2, - l("I want to make my own dyes."), 3, - menuaction(l("Quit")), 4; + select + rif(.@fexil == 1, l("Have you seen Fexil?")), + menuaction(l("Trade")), + l("How do these dyes work?"), + l("I want to make my own dyes."), + menuaction(l("Quit")); - switch (@menuret) + switch (@menu) { - case 0: + case 1: setcamnpc "Fexil#001-1"; speech 5, l("Oh yeye did, his store is just beside me!"), @@ -78,22 +78,20 @@ restorecam; break; - case 1: + case 2: sell_dye; close; - case 2: + case 3: explain_dyes; break; - case 3: + case 4: speech 5, l("Yoiis is not yet ready to make his own dyes."), l("But in the future I might be able to help you create some of your own."); break; - case 4: - break; } - } while (@menuret != 4); + } while (@menu != 5); closedialog; goodbye; diff --git a/npc/001-1/chelios.txt b/npc/001-1/chelios.txt index 1cebfdc7..2be8f87d 100644 --- a/npc/001-1/chelios.txt +++ b/npc/001-1/chelios.txt @@ -81,13 +81,14 @@ do { .@enora = getq (ArtisQuests_Enora); - menuint rif (.@enora == 1, lg("I came to retrieve a package for Enora.")), 1, - rif (.@enora == 3, l("I have your black iron.")), 2, - rif (.@enora >= 2, l("Where is the Merchant Guild?")), 3, - l("What is this building?"), 4, - menuaction(l("Quit")), 5; - - switch (@menuret) + select + rif (.@enora == 1, lg("I came to retrieve a package for Enora.")), + rif (.@enora == 3, l("I have your black iron.")), + rif (.@enora >= 2, l("Where is the Merchant Guild?")), + l("What is this building?"), + menuaction(l("Quit")); + + switch (@menu) { case 1: give_small_quest; @@ -101,10 +102,8 @@ case 4: blacksmith_house; break; - case 5: - break; } - } while (@menuret != 5); + } while (@menu != 5); closedialog; goodbye; diff --git a/npc/001-1/enora.txt b/npc/001-1/enora.txt index a6eab456..231ad613 100644 --- a/npc/001-1/enora.txt +++ b/npc/001-1/enora.txt @@ -369,35 +369,35 @@ do { .@q = getq(ArtisQuests_Enora); - menuint - rif(.@q == 0, l("She told me that you had some tasks for me.")), 0, - rif(.@q == 4 || .@q == 6 || .@q == 9, l("I have your package.")), 1, - rif(.@q == 8 && countitem(PiberriesInfusion) >= 5, l("I have your package.")), 2, - rif(.@q >= 10, l("I cleaned up the hill.")), 3, - rif(.@q >= 10, l("How many Fluffies did I kill on the hill?")), 4, - rif(.@q >= 1, l("Who is Don?")), 5, - rif(.@q >= 5, l("Where is the light armor shop?")), 6, - rif(.@q >= 7, l("Where is the market?")), 7, - rif(.@q >= 10, l("Where is the hill?")), 8, - rif(.@q >= 1, l("What is this \"legion\"?")), 9, - l("I wish I could remember something..."), 10, - rif(.@q != 0, l("Nothing.")), 11; - - switch (@menuret) + select + rif(.@q == 0, l("She told me that you had some tasks for me.")), + rif(.@q == 4 || .@q == 6 || .@q == 9, l("I have your package.")), + rif(.@q == 8 && countitem(PiberriesInfusion) >= 5, l("I have your package.")), + rif(.@q >= 10, l("I cleaned up the hill.")), + rif(.@q >= 10, l("How many Fluffies did I kill on the hill?")), + rif(.@q >= 1, l("Who is Don?")), + rif(.@q >= 5, l("Where is the light armor shop?")), + rif(.@q >= 7, l("Where is the market?")), + rif(.@q >= 10, l("Where is the hill?")), + rif(.@q >= 1, l("What is this \"legion\"?")), + l("I wish I could remember something..."), + rif(.@q != 0, l("Nothing.")); + + switch (@menu) { - case 0: + case 1: enora_first_quest; break; - case 1: + case 2: enora_quest_complete; break; - case 2: + case 3: enora_paid_potions; break; - case 3: + case 4: enora_hill_cleaned; break; - case 4: + case 5: speech 5, l("You killed @@ Fluffies.", ArtisFluffyKilled); if (ArtisFluffyKilled > 8) @@ -406,29 +406,28 @@ next; } break; - case 5: - enora_don; case 6: + enora_don; + case 7: enora_light_armor; break; - case 7: + case 8: enora_market; break; - case 8: + case 9: enora_hill; break; - case 9: + case 10: enora_legion; break; - case 10: + case 11: enora_memories; break; - case 11: + case 12: speech 5, l("Please come back anytime!"); - break; } - } while (@menuret != 11); + } while (@menu != 12); closedialog; goodbye; diff --git a/npc/001-1/fexil.txt b/npc/001-1/fexil.txt index 8684aa3c..807d54b4 100644 --- a/npc/001-1/fexil.txt +++ b/npc/001-1/fexil.txt @@ -76,13 +76,13 @@ .@fexil = getq(ArtisQuests_Fexil); - menuint - l("OK, let's trade."), 1, - rif(.@fexil == 2, l("Do you still need help?")), 2, - rif(.@fexil > 2 && countitem(FluffyFur) > 0, l("I have some fur for you.")), 3, - l("No. Sorry."), 4; + select + l("OK, let's trade."), + rif(.@fexil == 2, l("Do you still need help?")), + rif(.@fexil > 2 && countitem(FluffyFur) > 0, l("I have some fur for you.")), + l("No. Sorry."); - switch (@menuret) + switch (@menu) { case 1: closedialog; diff --git a/npc/001-1/qonan.txt b/npc/001-1/qonan.txt index 062dcf13..b237de07 100644 --- a/npc/001-1/qonan.txt +++ b/npc/001-1/qonan.txt @@ -44,13 +44,13 @@ l("I'm afraid to go there myself, but if you take the risk, you can have half of the loot."), l("So, what do you say?"); - menuint - l("I like money! Consider it done."), 0, - l("Too risky, I might end up in jail. Do it yourself."), 1; + select + l("I like money! Consider it done."), + l("Too risky, I might end up in jail. Do it yourself."); - switch(@menuret) + switch(@menu) { - case 0: + case 1: setq ArtisQuests_QOnan, 1; getrandompoint(178,26,182,29); npcdebug "Chest buriad at (" + .move__rand_x + "," + .move__rand_y + ")"; @@ -61,7 +61,7 @@ l("I hope to see you soon."); getitem IronShovel, 1; close; - case 1: + case 2: speech 3, l("Come on, don't be a coward!"), l("Anyway, let me know if you change your mind."); diff --git a/npc/001-1/qpid.txt b/npc/001-1/qpid.txt index 27f7517e..e6dd8021 100644 --- a/npc/001-1/qpid.txt +++ b/npc/001-1/qpid.txt @@ -171,39 +171,37 @@ { .@enora = getq(ArtisQuests_Enora); - menuint - rif (.@enora == 7, l("Enora wants her potions.")), 0, - menuaction(l("Trade")), 1, - rif (.@enora > 7, l("What was your riddle?")), 2, - l("How do you do your potions?"), 3, - l("What are you reading?"), 4, - menuaction(l("Quit")), 5; - - switch (@menuret) + select + rif (.@enora == 7, l("Enora wants her potions.")), + menuaction(l("Trade")), + rif (.@enora > 7, l("What was your riddle?")), + l("How do you do your potions?"), + l("What are you reading?"), + menuaction(l("Quit")); + + switch (@menu) { - case 0: + case 1: enora_quest; break; - case 1: + case 2: closedialog; shop "Store#Potion001-1"; close; - case 2: + case 3: riddle_enigma; break; - case 3: + case 4: alchemist_information; break; - case 4: + case 5: speech 5, l("It's a poem, about poems... Why are you asking that?"), l("Because I am an orc I can't read such things? That's rubbish."), l("I borrowed it from the library, you should try to cultivate yourself more instead of insinuate things about people you don't know!"); break; - case 5: - break; } - } while (@menuret != 5); + } while (@menu != 6); closedialog; goodbye; diff --git a/npc/001-1/rumly.txt b/npc/001-1/rumly.txt index f677b4ac..195a8aa6 100644 --- a/npc/001-1/rumly.txt +++ b/npc/001-1/rumly.txt @@ -27,20 +27,20 @@ L_Menu: .@visited = getq(General_Rumly); .@plush_count = lognbaselvl(1, 10); - menuint - l("Plushrooms you say?"), 0, - l("Who are you?"), 1, - rif(.@visited > 0, l("Can you reset my stats please?")), 2, - lg("You are weird, I have to go sorry."), 3; + select + l("Plushrooms you say?"), + l("Who are you?"), + rif(.@visited > 0, l("Can you reset my stats please?")), + lg("You are weird, I have to go sorry."); - switch (@menuret) + switch (@menu) { - case 0: + case 1: speech 5, l("Wind and grass is nice and cool, so juicy sweet..."), l("Our only wish to eat a plush, so juicy sweet..."); goto L_Menu; - case 1: + case 2: speech 5, lg("Why are you asking? And who are you too? I've never seen you around before..."), lg("Wait, are you one of those from the Legion of Aemil? I didn't do anything wrong, I promise!"), @@ -63,15 +63,15 @@ L_Menu: l("Bring me some of these plushrooms and I will show you how it works!"), l("Although the more powerful you are, the more plushrooms you will need."); - menuint - l("Sounds good!"), 0, - rif(countitem(Plushroom) >= .@plush_count, lg("I think I have enough plushrooms on me.")), 1, - l("We will talk about it later."), 2, - l("My stats are too good, I won't need it."), 3; + select + l("Sounds good!"), + rif(countitem(Plushroom) >= .@plush_count, lg("I think I have enough plushrooms on me.")), + l("We will talk about it later."), + l("My stats are too good, I won't need it."); - switch (@menuret) + switch (@menu) { - case 0: + case 1: if (.@visited < 2) { setq General_Rumly, 2; @@ -81,17 +81,17 @@ L_Menu: l("Great! Can't wait for some tasty mushrooms!"); goto L_Menu; - case 1: - goto L_ResetStats; case 2: - goto L_Later; + goto L_ResetStats; case 3: + goto L_Later; + case 4: goto L_Never; } - case 2: - goto L_ResetStats; case 3: + goto L_ResetStats; + case 4: if (.@visited < 2) goto L_Quit; .@rand = rand (2); @@ -139,55 +139,49 @@ L_ConfirmReset: speech 5, l("Let me just have a quick look at you. Hm... I will need @@ @@s to reset your stats.", .@plush_count, getitemlink(Plushroom)); - menuint - rif(countitem(Plushroom) >= .@plush_count, lg("Here, take as many as you need, I have plenty!")), 0, - rif(countitem(Plushroom) > 0 && countitem(Plushroom) < .@plush_count, lg("I don't have enough plushrooms...")), 1, - rif(countitem(Plushroom) == 0, lg("Oh no, I don't have any plushroom on me right now.")), 2, - lg("I have to go, sorry."), 3; + select + rif(countitem(Plushroom) >= .@plush_count, lg("Here, take as many as you need, I have plenty!")), + rif(countitem(Plushroom) > 0 && countitem(Plushroom) < .@plush_count, lg("I don't have enough plushrooms...")), + rif(countitem(Plushroom) == 0, lg("Oh no, I don't have any plushroom on me right now.")), + lg("I have to go, sorry."); - switch (@menuret) + if (@menu > 1) { - case 0: - delitem Plushroom, .@plush_count; + goto L_Later; + } - speech 5, - l("Thank you."), - l("Now stand still... It should not take much time..."); + delitem Plushroom, .@plush_count; - .@wasSP = StatusPoint; - resetstatus; - if (.@visited < 3) - { - setq General_Rumly, 3; - } - if (StatusPoint == .@wasSP) - { - speech 4, - l("It seems that you have no status points to reset!"), - lg("But the plushroom you brought was really awesome you know."), - lg("Come back when you will really need me. And bring more plushrooms with you!"); - } - else - { - speech 4, - l("Let's see... @@ of your status points have just been reset!", StatusPoint - .@wasSP), - l("Spend it wisely this time."), - lg("But you are welcome to reset your stats again if you bring me some more plushrooms!"); - } - goto L_Quit; - break; - case 1: - case 2: - case 3: - goto L_Later; - break; + speech 5, + l("Thank you."), + l("Now stand still... It should not take much time..."); + + .@wasSP = StatusPoint; + resetstatus; + if (.@visited < 3) + { + setq General_Rumly, 3; + } + if (StatusPoint == .@wasSP) + { + speech 4, + l("It seems that you have no status points to reset!"), + lg("But the plushroom you brought was really awesome you know."), + lg("Come back when you will really need me. And bring more plushrooms with you!"); + } + else + { + speech 4, + l("Let's see... @@ of your status points have just been reset!", StatusPoint - .@wasSP), + l("Spend it wisely this time."), + lg("But you are welcome to reset your stats again if you bring me some more plushrooms!"); } + goto L_Quit; + case 2: goto L_Later; - break; case 3: goto L_Never; - break; } L_Later: diff --git a/npc/001-1/salem.txt b/npc/001-1/salem.txt index e3b8cd74..3d6fd9c8 100644 --- a/npc/001-1/salem.txt +++ b/npc/001-1/salem.txt @@ -18,12 +18,13 @@ .@price = getarg(0); mesq l("The piou costs @@ E.", .@price); next; - menuint l("Alright, I'll take one."), 1, - l("I changed my mind."), 2; + select + l("Alright, I'll take one."), + l("I changed my mind."); mes ""; mesn; - if (@menuret == 2) + if (@menu == 2) return 4; if (Zeny < .@price) { @@ -107,23 +108,23 @@ L_SalemMenuShop: .@fexil = getq(ArtisQuests_Fexil); - menuint - l("What about those pious? They look so cute."), 0, - l("Let's trade."), 1, - rif(.@q != 0, l("I'd like to buy a piou.")), 2, - rif(.@fexil == 1, l("I'm looking for somebody named Fexil.")), 3, - menuaction(l("Quit")), 4; + select + l("What about those pious? They look so cute."), + l("Let's trade."), + rif(.@q != 0, l("I'd like to buy a piou.")), + rif(.@fexil == 1, l("I'm looking for somebody named Fexil.")), + menuaction(l("Quit")); - switch (@menuret) + switch (@menu) { - case 0: + case 1: goto L_AboutPious; break; - case 1: + case 2: closedialog; shop "Store#General001-1"; close; - case 2: + case 3: if (.@q == 2 && ArtisQuests_PiouDiscount) { speech 5, @@ -133,12 +134,10 @@ L_SalemMenuShop: if (!BuyPiou(@ArtisQuests_PiouPrice)) ArtisQuests_PiouDiscount = 0; break; - case 3: + case 4: speech 5, l("I think that I've seen this weakling wandering around the beach south from here this morning."); break; - case 5: - break; } closedialog; @@ -168,25 +167,21 @@ L_AboutPious: mesq l("If you catch the escaped piou and bring it back, I will give you a 90% discount on a piou."); next; - menuint rif (.@q == 0, l("Sounds like a good deal to me. I'll do it.")), 0, - rif (.@q == 1, l("I'm on my way! I will bring it back to you.")), 1, - l("I don't really have time to go chasing pious, let me just buy one at the regular price (30000 E)."), 2, - l("I don't want to buy a piou right now."), 3; + select + rif (.@q == 0, l("Sounds like a good deal to me. I'll do it.")), + rif (.@q == 1, l("I'm on my way! I will bring it back to you.")), + l("I don't really have time to go chasing pious, let me just buy one at the regular price (30000 E)."), + l("I don't want to buy a piou right now."); mes ""; mesn; - switch (@menuret) + switch (@menu) { - case 0: - goto L_QuestInfo; case 1: - break; - case 2: - BuyPiou @ArtisQuests_PiouPrice; - break; + goto L_QuestInfo; case 3: - break; + BuyPiou @ArtisQuests_PiouPrice; } closedialog; goodbye; diff --git a/npc/001-2-0/resa.txt b/npc/001-2-0/resa.txt index 778953de..4e46aba5 100644 --- a/npc/001-2-0/resa.txt +++ b/npc/001-2-0/resa.txt @@ -45,26 +45,27 @@ do { .@enora = getq (ArtisQuests_Enora); - menuint rif (.@enora == 5, lg("I came to retrieve a package for Enora.")), 0, - menuaction(l("Trade")), 1, - l("How can I improve my equipment?"), 2, - menuaction(l("Quit")), 3; + select + rif (.@enora == 5, lg("I came to retrieve a package for Enora.")), + menuaction(l("Trade")), + l("How can I improve my equipment?"), + menuaction(l("Quit")); - switch (@menuret) + switch (@menu) { - case 0: + case 1: enora_quest; closedialog; goodbye; close; - case 1: + case 2: closedialog; shop "Store#001-2-0"; close; - case 2: + case 3: explain_craft; break; - case 3: + case 4: closedialog; goodbye; close; diff --git a/npc/001-2-12/oscar.txt b/npc/001-2-12/oscar.txt index b604730a..a3247b84 100644 --- a/npc/001-2-12/oscar.txt +++ b/npc/001-2-12/oscar.txt @@ -113,12 +113,12 @@ do { - menuint - l("Could you bleach my clothes?"), 1, - l("Do you live here alone?"), 2, - menuaction(l("Quit")), 3; + select + l("Could you bleach my clothes?"), + l("Do you live here alone?"), + menuaction(l("Quit")); - switch (@menuret) + switch (@menu) { case 1: remove_cards_from_item(); @@ -131,7 +131,7 @@ break; } - } while (@menuret != 3); + } while (@menu != 3); closedialog; goodbye; diff --git a/npc/001-2-19/lloyd.txt b/npc/001-2-19/lloyd.txt index 6174b20b..6a6585cf 100644 --- a/npc/001-2-19/lloyd.txt +++ b/npc/001-2-19/lloyd.txt @@ -246,31 +246,32 @@ { .@enora = getq (ArtisQuests_Enora); - menuint rif (.@enora == 2, l("I'm searching some black iron ingots.")), 0, - l("I would like to store some items."), 1, - l("I would like to deposit some money."), 2, - l("What is this guild for?"), 3, - l("Does the guild has any work for me right now?"), 4, - l("Bye."), 5; - - switch (@menuret) + select + rif (.@enora == 2, l("I'm searching some black iron ingots.")), + l("I would like to store some items."), + l("I would like to deposit some money."), + l("What is this guild for?"), + l("Does the guild has any work for me right now?"), + l("Bye."); + + switch (@menu) { - case 0: + case 1: enora_quest; break; - case 1: + case 2: openstorage; closedialog; close; break; - case 2: + case 3: bank_account; break; - case 3: + case 4: mes ""; explain_guild; break; - case 4: + case 5: if (getq(ArtisQuests_Fexil) >= 1) { speech 5, @@ -281,15 +282,13 @@ paper_to_deliver; continue; - case 5: - break; } - if (@menuret != 5) + if (@menu != 6) { speech 5, l("Something else?"); } - } while (@menuret != 5); + } while (@menu != 6); closedialog; goodbye; diff --git a/npc/001-2-2/moon.txt b/npc/001-2-2/moon.txt index 4b5c44a3..4b974795 100644 --- a/npc/001-2-2/moon.txt +++ b/npc/001-2-2/moon.txt @@ -141,12 +141,12 @@ L_QuestStarted: mesq l("Do you have @@s for me?", getitemlink("CrocClaw")); next; - menuint - l("Check out this one."), 1, - l("I should put more effort into this."), 2, - l("Where can I find some Croc Claws?"), 3; + select + l("Check out this one."), + l("I should put more effort into this."), + l("Where can I find some Croc Claws?"); - switch (@menuret) + switch (@menu) { case 1: .@MustRepeat = CheckCrowClaw; diff --git a/npc/001-2-26/ivan.txt b/npc/001-2-26/ivan.txt index 93c82398..4cfb170d 100644 --- a/npc/001-2-26/ivan.txt +++ b/npc/001-2-26/ivan.txt @@ -59,11 +59,12 @@ speech 4, l("Yes what do you need?"); - menuint rif(.@enora == 8, l("The Legion needs some potions.")), 1, - rif(.@enora >= 8, l("Who are you?")), 2, - menuaction(l("Quit")), 3; + select + rif(.@enora == 8, l("The Legion needs some potions.")), + rif(.@enora >= 8, l("Who are you?")), + menuaction(l("Quit")); - switch (@menuret) + switch (@menu) { case 1: enora_quest; @@ -71,8 +72,6 @@ case 2: ivan_description; break; - case 3: - break; } closedialog; diff --git a/npc/001-2-41/edouard.txt b/npc/001-2-41/edouard.txt index 926c4758..ea7ce202 100644 --- a/npc/001-2-41/edouard.txt +++ b/npc/001-2-41/edouard.txt @@ -127,14 +127,14 @@ OnChair: do { - menuint - l("What is my current hairstyle and hair color?"), 1, - l("I'd like to get a different style."), 2, - l("Can you do something with my color?"), 3, - l("What's your story again?"), 4, - l("I'm fine for now, thank you."), 5; - - switch (@menuret) + select + l("What is my current hairstyle and hair color?"), + l("I'd like to get a different style."), + l("Can you do something with my color?"), + l("What's your story again?"), + l("I'm fine for now, thank you."); + + switch (@menu) { case 1: BarberSayStyle 3; diff --git a/npc/001-2-9/janus.txt b/npc/001-2-9/janus.txt index f7d865a8..78bc84db 100644 --- a/npc/001-2-9/janus.txt +++ b/npc/001-2-9/janus.txt @@ -133,13 +133,14 @@ setq General_Janus, 2; } - menuint rif (getq (General_Janus) == 1, l("I would like to create a party.")), 1, - rif (getq (General_Janus) == 2, l("I would like to create a guild.")), 2, - l("What service do you offer?"), 3, - l("Your name is Ianus or Janus?"), 4, - menuaction(l("Quit")), 5; - - switch (@menuret) + select + rif (getq (General_Janus) == 1, l("I would like to create a party.")), + rif (getq (General_Janus) == 2, l("I would like to create a guild.")), + l("What service do you offer?"), + l("Your name is Ianus or Janus?"), + menuaction(l("Quit")); + + switch (@menu) { case 1: create_party; @@ -153,10 +154,8 @@ case 4: janus_is_not_ianus; break; - case 5: - break; } - } while (@menuret != 5); + } while (@menu != 5); closedialog; goodbye; diff --git a/npc/commands/debug-look.txt b/npc/commands/debug-look.txt index 85dea836..3c4640c5 100644 --- a/npc/commands/debug-look.txt +++ b/npc/commands/debug-look.txt @@ -21,28 +21,31 @@ function script BarberDebug { function setStyle { clear; setnpcdialogtitle l("Appearance Debug - Barber"); - mes l("Please enter the desired hairstyle:"); + mes l("Hair style") + ": " + getlook (LOOK_HAIR); next; - input .@h; - setlook LOOK_HAIR, max(0, min(0x7F, .@h)); + mes l("Please enter the desired style") + " (1-255)"; + input .@h, 1, 0xFF; + setlook LOOK_HAIR, max(1, min(0xFF, .@h)); return; } function setColor { clear; setnpcdialogtitle l("Appearance Debug - Barber"); - mes l("Please enter the desired hair color:"); + mes l("Hair color") + ": " + getlook (LOOK_HAIR_COLOR); next; - input .@h; - setlook LOOK_HAIR_COLOR, max(0, min(0x7F, .@h)); + mes l("Please enter the desired color") + " (0-255)"; + input .@h, 0, 0xFF; + setlook LOOK_HAIR_COLOR, max(0, min(0xFF, .@h)); return; } function setRace { clear; setnpcdialogtitle l("Appearance Debug - Race"); - mes l("Please enter the desired race:"); + mes l("Race") + ": " + Class; next; - input .@r; - jobchange max(0, min(0x7FFF, .@h)); + mes l("Please enter the desired race") + " (0-32767)"; + input .@r, 0, 0x7FFF; + jobchange max(0, min(0x7FFF, .@r)); return; } @@ -60,25 +63,22 @@ function script BarberDebug { mes l("Race") + ": " + Class; mes "---"; - mes ""; - mes l("What do you want to change?"); next; - menuint - menuimage("actions/edit", l("Gender")), 1, - menuimage("actions/edit", l("Hair style")), 2, - menuimage("actions/edit", l("Hair color")), 3, - menuimage("actions/edit", l("Race")), 4, - rif(getarg(0,0), menuimage("actions/back", l("Return to Debug menu"))), 5, - menuimage("actions/exit", l("Close")), 6; + mes l("What do you want to change?"); + select + menuimage("actions/edit", l("Gender") + " [" + l("Requires logout") + "]"), + menuimage("actions/edit", l("Hair style")), + menuimage("actions/edit", l("Hair color")), + menuimage("actions/edit", l("Race")), + rif(getarg(0,0), menuimage("actions/back", l("Return to Debug menu"))); - switch (@menuret) + switch (@menu) { case 1: setGender; break; case 2: setStyle; break; case 3: setColor; break; case 4: setRace; break; case 5: return; - case 6: closedialog; end; } } while (1); } diff --git a/npc/commands/debug-preset.txt b/npc/commands/debug-preset.txt index 1012c71c..7b7b94fe 100644 --- a/npc/commands/debug-preset.txt +++ b/npc/commands/debug-preset.txt @@ -23,6 +23,11 @@ function script DoRoutine { clearitem; } + if (compare(.@routine$[0], "e")) + { + nude; + } + if (compare(.@routine$[0], "k")) { resetskill; @@ -91,40 +96,10 @@ function script DoRoutine { } } } -} -function script DebugPresets { - - if (getarg(0, "m") != "m") - { - DoRoutine getarg(0); - end; - } - - clear; - setnpcdialogtitle l("Debug Presets"); - mes l("This menu allows you to select debug presets."); - mes ""; - mes l("What preset do you want to use?"); - next; - // TODO: create presets and add them to a hash table, then dynamically build this menu - menuint - menuimage("actions/abort", l("Abort")), 1, - l("New player"), 2, - rif(getarg(0,"") == "m", menuimage("actions/back", l("Return to Debug menu"))), 1, - menuimage("actions/exit", l("Close")), 3; - - switch (@menuret) - { - case 1: return; - case 2: DoRoutine "-tksxq z w000-0"; break; - } - - closedialog; + return; } - - - script @pre 32767,{ end; @@ -137,8 +112,7 @@ OnCall: { .@atcmd_parameters$[0] = implode(.@atcmd_parameters$[0], " "); } - DebugPresets strip(.@atcmd_parameters$[0]); - closedialog; + DoRoutine strip(.@atcmd_parameters$[0]); end; OnInit: diff --git a/npc/commands/debug-quest.txt b/npc/commands/debug-quest.txt index a7cb9fab..208291f5 100644 --- a/npc/commands/debug-quest.txt +++ b/npc/commands/debug-quest.txt @@ -11,20 +11,18 @@ function script GlobalQuestDebug { mes l("Please select a quest:"); menuint - menuimage("actions/back", l("Go back")), 32766, - l("Gugli (main quest)"), 16, - "Ale", 10, - "Astapolos", 11, - "Gulukan", 12, - "Jalad", 13, - "QMuller", 14, - "Tibbo", 15, - menuimage("actions/exit", l("Close")), 32767; + menuimage("actions/back", l("Go back")), -1, + l("Gugli (main quest)"), ShipQuests_Gugli, + "Ale", ShipQuests_Ale, + "Astapolos", ShipQuests_Astapolos, + "Gulukan", ShipQuests_Gulukan, + "Jalad", ShipQuests_Jalad, + "Q'Muller", ShipQuests_QMuller, + "Tibbo", ShipQuests_Tibbo; switch (@menuret) { - case 32766: return; - case 32767: closedialog; end; + case -1: return; default: callfunc "QuestDebug" + @menuret; } } while (1); @@ -39,26 +37,24 @@ function script GlobalQuestDebug { mes l("Please select a quest:"); menuint - menuimage("actions/back", l("Go back")), 32766, - "Julia", 0, - "Arpan", 1, - "Alige", 2, - "Peter", 3, - "Nard", 4, - l("Knife"), 5, - l("Money"), 6, - l("Door"), 7, - "Couwan", 8, - l("Treasure Chest"), 9, - "Gugli", 16, - "Gado", 17, - menuimage("actions/exit", l("Close")), 32767; + menuimage("actions/back", l("Go back")), -1, + "Julia", ShipQuests_Julia, + "Arpan", ShipQuests_Arpan, + "Alige", ShipQuests_Alige, + "Peter", ShipQuests_Peter, + "Nard", ShipQuests_Nard, + l("Knife"), ShipQuests_Knife, + l("Money"), ShipQuests_ArpanMoney, + l("Door"), ShipQuests_Door, + "Couwan", ShipQuests_Couwan, + l("Treasure Chest"), ShipQuests_TreasureChest, + "Gugli", ShipQuests_Gugli, + "Gado", ShipQuests_ChefGado; switch (@menuret) { case 16: qDebugGugli; break; - case 32766: return; - case 32767: closedialog; end; + case -1: return; default: callfunc "QuestDebug" + @menuret; } } while (1); @@ -74,22 +70,20 @@ function script GlobalQuestDebug { mes l("Please select a quest:"); menuint - menuimage("actions/back", l("Go back")), 32766, - l("Lazy Brother"), 19, - l("Urchin"), 20, - l("Catching a piou"), 21, - "Eugene (" + l("fisherman") + ")", 22, - "Q'Onan", 23, - "Enora", 27, - "Fexil", 29, - "Lloyd", 30, - l("Mona's dad"), 32, - menuimage("actions/exit", l("Close")), 32767; + menuimage("actions/back", l("Go back")), , + l("Lazy Brother"), ArtisQuests_LazyBrother, + l("Urchin"), ArtisQuests_Urchin, + l("Catching a piou"), ArtisQuests_CatchPiou, + "Eugene (" + l("fisherman") + ")", ArtisQuests_Fishman, + "Q'Onan", ArtisQuests_QOnan, + "Enora", ArtisQuests_Enora, + "Fexil", ArtisQuests_Fexil, + "Lloyd", ArtisQuests_Lloyd, + l("Mona's dad"), ArtisQuests_MonaDad; switch (@menuret) { - case 32766: return; - case 32767: closedialog; end; + case -1: return; default: callfunc "QuestDebug" + @menuret; } } while (1); @@ -105,17 +99,15 @@ function script GlobalQuestDebug { mes l("Please select a quest:"); menuint - menuimage("actions/back", l("Go back")), 32766, - l("Cookies"), 18, - "Rumly", 26, - l("Narrator"), 28, - "Janus", 31, - menuimage("actions/exit", l("Close")), 32767; + menuimage("actions/back", l("Go back")), -1, + l("Cookies"), General_Cookies, + "Rumly", General_Rumly, + l("Narrator"), General_Narrator, + "Janus", General_Janus; switch (@menuret) { - case 32766: return; - case 32767: closedialog; end; + case -1: return; default: callfunc "QuestDebug" + @menuret; } } while (1); @@ -133,8 +125,7 @@ function script GlobalQuestDebug { l("Prologue"), "Artis", l("Other"), - rif(getarg(0,0), menuimage("actions/back", l("Return to Debug menu"))), - menuimage("actions/exit", l("Close")); + rif(getarg(0,0), menuimage("actions/back", l("Return to Debug menu"))); switch (@menu) { @@ -142,7 +133,6 @@ function script GlobalQuestDebug { case 2: qDebugArtis; break; case 3: qDebugGeneral; break; case 4: return; - default: closedialog; end; } } while (1); } diff --git a/npc/commands/debug-skill.txt b/npc/commands/debug-skill.txt index f782e753..187c4009 100644 --- a/npc/commands/debug-skill.txt +++ b/npc/commands/debug-skill.txt @@ -13,22 +13,20 @@ function script GlobalSkillDebug { setnpcdialogtitle l("Skill Debug - Modify Skill"); .@k = getarg(0,1); .@v = getskilllv(.@k); - menuint - menuimage("actions/abort", l("Abort")), 1, - rif(.@v > 0, menuimage("actions/remove", l("Remove this skill"))), 2, - rif(.@v < 10, menuimage("actions/raise", l("Raise this skill"))), 3, - rif(.@v > 0, menuimage("actions/lower", l("Lower this skill"))), 4, - menuimage("actions/edit", l("Set the level manually")), 5, - menuimage("actions/back", l("Return to skill debug menu")), 1, - menuimage("actions/exit", l("Close")), 6; - - switch (@menuret) + select + menuimage("actions/abort", l("Abort")), + rif(.@v > 0, menuimage("actions/remove", l("Remove this skill"))), + rif(.@v < 10, menuimage("actions/raise", l("Raise this skill"))), + rif(.@v > 0, menuimage("actions/lower", l("Lower this skill"))), + menuimage("actions/edit", l("Set the level manually")), + menuimage("actions/back", l("Return to skill debug menu")); + + switch (@menu) { case 2: skill .@k, 0, 0; break; case 3: skill .@k, min(10, .@v + 1), 0; break; case 4: skill .@k, max(0, .@v - 1), 0; break; case 5: setSkill .@k; break; - case 6: closedialog; end; } return; @@ -52,13 +50,11 @@ function script GlobalSkillDebug { menuint "NV_BASIC", NV_BASIC, - rif(getarg(0,0), menuimage("actions/back", l("Return to Debug menu"))), 32766, - menuimage("actions/exit", l("Close")), 32767; + rif(getarg(0,0), menuimage("actions/back", l("Return to Debug menu"))), -1; switch (@menuret) { - case 32766: return; - case 32767: closedialog; end; + case -1: return; } modifySkill @menuret; diff --git a/npc/commands/debug.txt b/npc/commands/debug.txt index 1a5cdec9..306bed56 100644 --- a/npc/commands/debug.txt +++ b/npc/commands/debug.txt @@ -20,21 +20,19 @@ function script GlobalDebugMenu { clear; setnpcdialogtitle l("Debug - Reset"); mes l("What do you want to reset?"); - menuint - menuimage("actions/abort", l("Abort")), 1, - menuimage("actions/reset", l("Reset stats, skills, level")), 2, - menuimage("actions/nuke", l("Reset EVERYTHING")), 3, - menuimage("actions/back", l("Return to Debug menu")), 1, - menuimage("actions/exit", l("Close")), 4; + select + menuimage("actions/abort", l("Abort")), + menuimage("actions/reset", l("Reset stats, skills, level")), + menuimage("actions/nuke", l("Reset EVERYTHING")), + menuimage("actions/back", l("Return to Debug menu")); - switch (@menuret) - { - case 2: - case 3: doReset @menuret; - case 1: return; - } + switch (@menu) + { + case 2: + case 3: doReset @menu; + } - closedialog; + return; } function changeLevel { @@ -97,30 +95,26 @@ function script GlobalDebugMenu { mes l("This menu allows you to modify your account data."); mes ""; mes l("What do you want to do?"); - menuint - menuimage("actions/manage", l("Change my level")), 1, - menuimage("actions/manage", l("Change my stats")), 2, - menuimage("actions/manage", l("Change my skills")), 3, - menuimage("actions/manage", l("Change my appearance")), 4, - menuimage("actions/edit", l("Change my quests")), 5, - menuimage("actions/reset", l("Select a preset")), 6, - menuimage("actions/nuke", l("Reset")), 7, - rif(getarg(0,0), menuimage("actions/home", l("Return to Super Menu"))), 8, - menuimage("actions/exit", l("Close")), 9; + select + menuimage("actions/manage", l("Change my level")), + menuimage("actions/manage", l("Change my stats")), + menuimage("actions/manage", l("Change my skills")), + menuimage("actions/manage", l("Change my appearance")), + menuimage("actions/edit", l("Change my quests")), + menuimage("actions/reset", l("Reset")), + rif(getarg(0,0), menuimage("actions/home", l("Return to Super Menu"))); .@c = getarg(0,0) ? 2 : 1; - switch (@menuret) + switch (@menu) { case 1: changeLevel; break; case 2: changeStats; break; case 3: GlobalSkillDebug .@c; break; case 4: BarberDebug .@c; break; case 5: GlobalQuestDebug .@c; break; - case 6: DebugPresets "m"; break; - case 7: resetAll; break; - case 8: return; - case 9: closedialog; end; + case 6: resetAll; break; + case 7: return; } } while(1); } diff --git a/npc/commands/event.txt b/npc/commands/event.txt index ed40c184..a01162e2 100644 --- a/npc/commands/event.txt +++ b/npc/commands/event.txt @@ -4,16 +4,14 @@ function script GlobalEventMenu { mes l("This menu allows you to manage events and gives access to event-related tools."); mes ""; mes l("There is no event available right now."); - menuint - rif(getarg(0,0), menuimage("actions/home", l("Return to Super Menu"))), 1, - menuimage("actions/exit", l("Close")), 2; - if (@menuret == 1) + if (getarg(0,0)) { - return; + select + menuimage("actions/home", l("Return to Super Menu")); } - closedialog; + return; } diff --git a/npc/commands/motd.txt b/npc/commands/motd.txt index b0bc4ebd..ff3e6b49 100644 --- a/npc/commands/motd.txt +++ b/npc/commands/motd.txt @@ -95,15 +95,15 @@ function script MOTDConfig { clear; mes l("line @@: @@", .@n, $MOTD_Messages$[.@n]); next; - menuint - menuimage("actions/back", l("Modify another line")), 1, - menuimage("actions/remove", l("Remove this line")), 2, - menuimage("actions/edit", l("Modify this line")), 3, - rif(.@n > 0, menuimage("actions/raise", l("Move this line up"))), 4, - rif(.@n < .@max, menuimage("actions/lower", l("Move this line down"))), 5, - menuimage("actions/home", l("Return to main menu")), 6; - - switch (@menuret) + select + menuimage("actions/back", l("Modify another line")), + menuimage("actions/remove", l("Remove this line")), + menuimage("actions/edit", l("Modify this line")), + rif(.@n > 0, menuimage("actions/raise", l("Move this line up"))), + rif(.@n < .@max, menuimage("actions/lower", l("Move this line down"))), + menuimage("actions/home", l("Return to main menu")); + + switch (@menu) { case 2: removeLine .@n; return; case 3: editLine .@n; return; @@ -137,21 +137,19 @@ function script MOTDConfig { mes l("Enabled: @@", (.@d ? l("no") : l("yes"))); next; - menuint - menuimage("actions/toggle", (.@d ? l("Enable") : l("Disable"))), 1, - menuimage("actions/add", l("Add a new line")), 2, - rif(.@size, menuimage("actions/manage", l("Modify, move, or remove a line"))), 3, - rif(.@size, menuimage("actions/test", l("Test MOTD"))), 4, - rif(getarg(0,0), menuimage("actions/home", l("Return to Super Menu"))), 5, - menuimage("actions/exit", l("Close")), 6; + select + menuimage("actions/toggle", (.@d ? l("Enable") : l("Disable"))), + menuimage("actions/add", l("Add a new line")), + rif(.@size, menuimage("actions/manage", l("Modify, move, or remove a line"))), + rif(.@size, menuimage("actions/test", l("Test MOTD"))), + rif(getarg(0,0), menuimage("actions/home", l("Return to Super Menu"))); - switch (@menuret) + switch (@menu) { case 1: toggleMOTD; break; case 2: addNewLine; break; case 3: modifyLine .@size; break; case 4: displayMOTD; break; - case 6: closedialog; end; default: return; } } while (1); @@ -174,7 +172,7 @@ OnPCLoginEvent: } if (debug) { - dispbottom "##7<<##B @@?test-server|" + col(l("Click here for instructions on how to use the test server."),6) + "@@ ##7>>"; + dispbottom "##7<<##B @@help://test-server|" + col(l("Click here for instructions on how to use the test server."),6) + "@@ ##7>>"; } end; diff --git a/npc/commands/numa.txt b/npc/commands/numa.txt deleted file mode 100644 index f9fff699..00000000 --- a/npc/commands/numa.txt +++ /dev/null @@ -1,49 +0,0 @@ -function script SuperMenu { - do - { - .@gid = getgroupid(); - clear; - setnpcdialogtitle l("Super Menu"); - mes l("This menu contains all options available to you, based on your access privileges."); - mes ""; - mes l("What do you want to access?"); - next; - menuint - rif(.@gid >= 3, l("Scheduled broadcasts")), 1, - rif(.@gid >= 3, l("MOTD")), 2, - rif(.@gid >= 4, l("Event management")), 3, - l("Debug"), 4, - l("Close"), 5; - - switch (@menuret) - { - case 1: StoneBoard 1; break; - case 2: MOTDConfig 1; break; - case 3: GlobalEventMenu 1; break; - case 4: GlobalDebugMenu 1; break; - default: return; - } - } while (1); -} - - - -- script @numa 32767,{ - end; - -OnCall: - .@gid = getgroupid(); - - if (!debug && .@gid < 3) - { - dispbottom l("You do not have the required access privileges to use the Super Menu."); - end; - } - - SuperMenu; - closedialog; - end; - -OnInit: - bindatcmd "numa", "@numa::OnCall", 0, 99, 0; -} diff --git a/npc/commands/scheduled-broadcasts.txt b/npc/commands/scheduled-broadcasts.txt index b520f0b0..51f1f6a6 100644 --- a/npc/commands/scheduled-broadcasts.txt +++ b/npc/commands/scheduled-broadcasts.txt @@ -30,7 +30,7 @@ function script StoneBoard { l("Every 24 hours"), 24, l("Never (only on login)"), 0; - return max(0, @menuret); + return @menuret; } function setMaxRep { @@ -50,7 +50,7 @@ function script StoneBoard { l("Send 20 times"), 20, l("Send indefinitely"), 0; - return max(0, @menuret); + return @menuret; } function setOnLogin { @@ -61,11 +61,11 @@ function script StoneBoard { clear; mes l("Send this message also on login?"); next; - menuint - l("No"), 0, - l("Yes"), 1; + select + l("No"), + l("Yes"); - return max(0, @menuret); + return (@menu - 1); } function newBroadcast { @@ -98,14 +98,13 @@ function script StoneBoard { } next; - menuint - menuimage("actions/cancel", l("Discard")), 1, - menuimage("actions/edit", l("Start over")), 2, - menuimage("actions/test", l("Start broadcasting")), 3, - menuimage("actions/test", l("Start broadcasting, and make an extra broadcast right now")), 4, - menuimage("actions/exit", l("Close")), 5; - - switch (@menuret) + select + menuimage("actions/cancel", l("Discard")), + menuimage("actions/edit", l("Start over")), + menuimage("actions/test", l("Start broadcasting")), + menuimage("actions/test", l("Start broadcasting, and make an extra broadcast right now")); + + switch (@menu) { case 3: case 4: @@ -120,12 +119,11 @@ function script StoneBoard { { initnpctimer "@sched"; } - if (@menuret == 4) + if (@menu == 4) { announce $@SCHED_Msg$, bc_all; } case 1: return; - case 5: closedialog; end; } } while(1); @@ -147,7 +145,7 @@ function script StoneBoard { mes l("Sent on login: @@", ($@SCHED_Opt[0] ? l("yes") : l("no"))); if ($@SCHED_Opt[1]) { - .@next = max(1, ((3600000 * ($@SCHED_Opt[1] - $@SCHED_Opt[4])) - getnpctimer(0))); + .@next = max(1, ((3600000 * ($@SCHED_Opt[1] - $@SCHED_Opt[4])) - getnpctimer(0, "@sched"))); mes l("Interval: every @@ hour(s)", $@SCHED_Opt[1]); mes l("Next broadcast: @@", FuzzyTimeFromMs(.@next)); } @@ -160,20 +158,18 @@ function script StoneBoard { } next; - menuint - menuimage("actions/abort", l("Abort")), 5, - rif(.@a, menuimage("actions/test", l("Manually trigger the current broadcast"))), 2, - rif(.@a, menuimage("actions/remove", l("Stop broadcasting"))), 3, - rif(!(.@a), menuimage("actions/add", l("Set a new broadcast"))), 4, - rif(getarg(0,0), menuimage("actions/home", l("Return to Super Menu"))), 5, - menuimage("actions/exit", l("Close")), 6; - - switch (@menuret) + select + menuimage("actions/abort", l("Abort")), + rif(.@a, menuimage("actions/test", l("Manually trigger the current broadcast"))), + rif(.@a, menuimage("actions/remove", l("Stop broadcasting"))), + rif(!(.@a), menuimage("actions/add", l("Set a new broadcast"))), + rif(getarg(0,0), menuimage("actions/home", l("Return to Super Menu"))); + + switch (@menu) { case 2: announce $@SCHED_Msg$, bc_all; break; case 3: $@SCHED_Msg$ = ""; break; case 4: newBroadcast; break; - case 6: closedialog; end; default: return; } } while (1); @@ -185,21 +181,26 @@ function script StoneBoard { end; OnTimer3600000: - ++$@SCHED_Opt[4]; - if ($@SCHED_Opt[4] == ($@SCHED_Opt[1] - 1)) + if ($@SCHED_Msg$ == "") + { + stopnpctimer; + end; + } + + ++$@SCHED_Opt[4]; // increase hours counter + if ($@SCHED_Opt[4] == $@SCHED_Opt[1]) { stopnpctimer; - ++$@SCHED_Opt[2]; - if ($@SCHED_Msg$ != "") + ++$@SCHED_Opt[2]; // increase total counter + announce $@SCHED_Msg$, bc_all; + $@SCHED_Opt[4] = 0; // reset hours counter + if ($@SCHED_Opt[2] >= $@SCHED_Opt[3] && $@SCHED_Opt[3] > 0) { - announce $@SCHED_Msg$, bc_all; - $@SCHED_Opt[4] = 0; - if ($@SCHED_Opt[2] < $@SCHED_Opt[3] && $@SCHED_Opt[3] > 0) - { - initnpctimer; - } + $@SCHED_Msg$ = ""; // reset message + end; } } + initnpctimer; end; OnCall: diff --git a/npc/commands/super-menu.txt b/npc/commands/super-menu.txt new file mode 100644 index 00000000..fede6e71 --- /dev/null +++ b/npc/commands/super-menu.txt @@ -0,0 +1,69 @@ +function script SuperMenu { + do + { + .@gid = getgroupid(); + + if (.@gid < 3) + { + GlobalDebugMenu; + return; + } + + clear; + setnpcdialogtitle l("Super Menu"); + mes l("This menu contains all options available to you, based on your access privileges."); + mes ""; + mes l("What do you want to access?"); + next; + select + l("Scheduled broadcasts"), + l("MOTD"), + rif(.@gid >= 4, l("Event management")), + l("Debug"); + + switch (@menu) + { + case 1: StoneBoard 1; break; + case 2: MOTDConfig 1; break; + case 3: GlobalEventMenu 1; break; + case 4: GlobalDebugMenu 1; break; + } + } while (1); +} + + + +- script @super 32767,{ + end; + +OnCall: + .@gid = getgroupid(); + + if (!debug && .@gid < 3) + { + dispbottom l("You do not have the required access privileges to use the Super Menu."); + end; + } + + SuperMenu; + closedialog; + end; + +OnPCLoginEvent: + .@debug_skill = getskilllv(EVOL_SUPER_MENU); + + if (.@debug_skill > 0 && !debug) + { + skill EVOL_SUPER_MENU, 0, 0; // remove debug skill + } + + else if (.@debug_skill < 1 && debug) + { + skill EVOL_SUPER_MENU, 1, 0; // give debug skill + } + end; + +OnInit: + bindatcmd "super", "@super::OnCall", 0, 99, 0; + bindatcmd "numa", "@super::OnCall", 0, 99, 0; // alias for those used to TMW's @numa +} diff --git a/npc/commands/warp.txt b/npc/commands/warp.txt index f8e25bc0..b4354d51 100644 --- a/npc/commands/warp.txt +++ b/npc/commands/warp.txt @@ -227,5 +227,11 @@ OnCall: end; OnInit: + if (debug > 0) + { + bindatcmd "w", "@w::OnCall", 0, 2, 0; + end; + } + bindatcmd "w", "@w::OnCall", 1, 2, 1; } diff --git a/npc/commands/zeny.txt b/npc/commands/zeny.txt index 560c7a94..2948a285 100644 --- a/npc/commands/zeny.txt +++ b/npc/commands/zeny.txt @@ -86,5 +86,11 @@ OnCall: end; OnInit: + if (debug > 0) + { + bindatcmd "esp", "@esp::OnCall", 0, 2, 0; + end; + } + bindatcmd "esp", "@esp::OnCall", 3, 99, 1; } diff --git a/npc/functions/quest-debug/000-ShipQuests_Julia.txt b/npc/functions/quest-debug/000-ShipQuests_Julia.txt index 00e0120a..17e36a69 100644 --- a/npc/functions/quest-debug/000-ShipQuests_Julia.txt +++ b/npc/functions/quest-debug/000-ShipQuests_Julia.txt @@ -17,7 +17,7 @@ function script QuestDebug0 { l("Got the quest"), 1, l("Completed"), 2; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/001-ShipQuests_Arpan.txt b/npc/functions/quest-debug/001-ShipQuests_Arpan.txt index 777d58b4..e0d7f5ac 100644 --- a/npc/functions/quest-debug/001-ShipQuests_Arpan.txt +++ b/npc/functions/quest-debug/001-ShipQuests_Arpan.txt @@ -18,7 +18,7 @@ function script QuestDebug1 { l("You opened the chest"), 2, l("Completed"), 3; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/002-ShipQuests_Alige.txt b/npc/functions/quest-debug/002-ShipQuests_Alige.txt index abbd506d..805cbcd1 100644 --- a/npc/functions/quest-debug/002-ShipQuests_Alige.txt +++ b/npc/functions/quest-debug/002-ShipQuests_Alige.txt @@ -18,7 +18,7 @@ function script QuestDebug2 { l("Alige asks for food"), 2, l("Completed"), 3; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/003-ShipQuests_Peter.txt b/npc/functions/quest-debug/003-ShipQuests_Peter.txt index f5d87abb..d65f3a42 100644 --- a/npc/functions/quest-debug/003-ShipQuests_Peter.txt +++ b/npc/functions/quest-debug/003-ShipQuests_Peter.txt @@ -21,7 +21,7 @@ function script QuestDebug3 { l("Peter asks to kill rattos again"), 4, l("Peter gave reward"), 5; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/004-ShipQuests_Nard.txt b/npc/functions/quest-debug/004-ShipQuests_Nard.txt index 3431fd23..b8c8eed9 100644 --- a/npc/functions/quest-debug/004-ShipQuests_Nard.txt +++ b/npc/functions/quest-debug/004-ShipQuests_Nard.txt @@ -19,19 +19,19 @@ function script QuestDebug4 { GenericQuestDebug ShipQuests_Nard, l("Does not have the quest"), 0, l("Nard asks to help crew"), 1, - menuimage("actions/manage", l("Debug Gugli quest")), 32700, + menuimage("actions/manage", l("Debug Gugli quest")), -1, l("Completed Gugli's task"), 2, l("Nard asks to solve conflict"), 3, - menuimage("actions/manage", l("Debug Gado quest")), 32701, + menuimage("actions/manage", l("Debug Gado quest")), -2, l("Solved conflict"), 4, l("Official crew member"), 5, l("Talked to narrator"), 6; switch (@menuret) { - case 32700: callfunc "QuestDebug16"; break; - case 32701: callfunc "QuestDebug17"; break; - case 32766: return; + case -1: callfunc "QuestDebug16"; break; + case -2: callfunc "QuestDebug17"; break; + default: if (@menuret < 0) return; } } while (1); diff --git a/npc/functions/quest-debug/005-ShipQuests_Knife.txt b/npc/functions/quest-debug/005-ShipQuests_Knife.txt index f192a126..6d2ca71b 100644 --- a/npc/functions/quest-debug/005-ShipQuests_Knife.txt +++ b/npc/functions/quest-debug/005-ShipQuests_Knife.txt @@ -16,7 +16,7 @@ function script QuestDebug5 { l("Does not have the quest"), 0, l("Got the knife"), 1; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/006-ShipQuests_ArpanMoney.txt b/npc/functions/quest-debug/006-ShipQuests_ArpanMoney.txt index 0e00d0d9..97961c1a 100644 --- a/npc/functions/quest-debug/006-ShipQuests_ArpanMoney.txt +++ b/npc/functions/quest-debug/006-ShipQuests_ArpanMoney.txt @@ -17,7 +17,7 @@ function script QuestDebug6 { l("Elmo told about money"), 1, l("Arpan gave money"), 2; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/007-ShipQuests_Door.txt b/npc/functions/quest-debug/007-ShipQuests_Door.txt index bc29888e..6a8cae01 100644 --- a/npc/functions/quest-debug/007-ShipQuests_Door.txt +++ b/npc/functions/quest-debug/007-ShipQuests_Door.txt @@ -16,7 +16,7 @@ function script QuestDebug7 { l("Does not have the quest"), 0, l("Heard conversation"), 1; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/008-ShipQuests_Couwan.txt b/npc/functions/quest-debug/008-ShipQuests_Couwan.txt index e9763a56..9ad2ca2c 100644 --- a/npc/functions/quest-debug/008-ShipQuests_Couwan.txt +++ b/npc/functions/quest-debug/008-ShipQuests_Couwan.txt @@ -17,7 +17,7 @@ function script QuestDebug8 { l("Couwan asks to deliver box"), 1, l("Delivered box, got reward"), 2; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/009-ShipQuests_TreasureChest.txt b/npc/functions/quest-debug/009-ShipQuests_TreasureChest.txt index ea2e1dec..e125bfa0 100644 --- a/npc/functions/quest-debug/009-ShipQuests_TreasureChest.txt +++ b/npc/functions/quest-debug/009-ShipQuests_TreasureChest.txt @@ -16,7 +16,7 @@ function script QuestDebug9 { l("Does not have the quest"), 0, l("Opened treasure chest"), 1; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/010-ShipQuests_Ale.txt b/npc/functions/quest-debug/010-ShipQuests_Ale.txt index 67aed1fb..8f3c7e46 100644 --- a/npc/functions/quest-debug/010-ShipQuests_Ale.txt +++ b/npc/functions/quest-debug/010-ShipQuests_Ale.txt @@ -16,7 +16,7 @@ function script QuestDebug10 { l("Does not have the quest"), 0, l("Got the package"), 1; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/011-ShipQuests_Astapolos.txt b/npc/functions/quest-debug/011-ShipQuests_Astapolos.txt index 9e4d6e2b..dc2d3ad9 100644 --- a/npc/functions/quest-debug/011-ShipQuests_Astapolos.txt +++ b/npc/functions/quest-debug/011-ShipQuests_Astapolos.txt @@ -16,7 +16,7 @@ function script QuestDebug11 { l("Does not have the quest"), 0, l("Got the package"), 1; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/012-ShipQuests_Gulukan.txt b/npc/functions/quest-debug/012-ShipQuests_Gulukan.txt index 878b536f..a491d8a0 100644 --- a/npc/functions/quest-debug/012-ShipQuests_Gulukan.txt +++ b/npc/functions/quest-debug/012-ShipQuests_Gulukan.txt @@ -16,7 +16,7 @@ function script QuestDebug12 { l("Does not have the quest"), 0, l("Got the package"), 1; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/013-ShipQuests_Jalad.txt b/npc/functions/quest-debug/013-ShipQuests_Jalad.txt index d5640411..2398583b 100644 --- a/npc/functions/quest-debug/013-ShipQuests_Jalad.txt +++ b/npc/functions/quest-debug/013-ShipQuests_Jalad.txt @@ -16,7 +16,7 @@ function script QuestDebug13 { l("Does not have the quest"), 0, l("Got the package"), 1; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/014-ShipQuests_QMuller.txt b/npc/functions/quest-debug/014-ShipQuests_QMuller.txt index 1f69efdd..f6db5b3a 100644 --- a/npc/functions/quest-debug/014-ShipQuests_QMuller.txt +++ b/npc/functions/quest-debug/014-ShipQuests_QMuller.txt @@ -16,7 +16,7 @@ function script QuestDebug14 { l("Does not have the quest"), 0, l("Got the package"), 1; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/015-ShipQuests_Tibbo.txt b/npc/functions/quest-debug/015-ShipQuests_Tibbo.txt index f963a0f0..e37fe97d 100644 --- a/npc/functions/quest-debug/015-ShipQuests_Tibbo.txt +++ b/npc/functions/quest-debug/015-ShipQuests_Tibbo.txt @@ -16,7 +16,7 @@ function script QuestDebug15 { l("Does not have the quest"), 0, l("Got the package"), 1; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/016-ShipQuests_Gugli.txt b/npc/functions/quest-debug/016-ShipQuests_Gugli.txt index 70c5a441..cf98ca6d 100644 --- a/npc/functions/quest-debug/016-ShipQuests_Gugli.txt +++ b/npc/functions/quest-debug/016-ShipQuests_Gugli.txt @@ -23,23 +23,25 @@ function script QuestDebug16 { GenericQuestDebug ShipQuests_Gugli, l("Does not have the quest"), 0, l("Gugli asks to collect packages"), 1, - menuimage("actions/manage", l("Reset subquests")), 32700, - menuimage("actions/manage", l("Set subquests as completed")), 32701, + menuimage("actions/manage", l("Reset subquests")), -1, + menuimage("actions/manage", l("Set subquests as completed")), -2, l("Got reward from gugli"), 2; switch (@menuret) { case 0: - case 32700: - case 32701: - setq ShipQuests_Ale, (@menuret == 32701 ? 1 : 0); - setq ShipQuests_Astapolos, (@menuret == 32701 ? 1 : 0); - setq ShipQuests_Gulukan, (@menuret == 32701 ? 1 : 0); - setq ShipQuests_Jalad, (@menuret == 32701 ? 1 : 0); - setq ShipQuests_QMuller, (@menuret == 32701 ? 1 : 0); - setq ShipQuests_Tibbo, (@menuret == 32701 ? 1 : 0); + case 2: + case -1: + case -2: + .@v = (@menuret == -2 || @menuret == 2); + setq ShipQuests_Ale, .@v; + setq ShipQuests_Astapolos, .@v; + setq ShipQuests_Gulukan, .@v; + setq ShipQuests_Jalad, .@v; + setq ShipQuests_QMuller, .@v; + setq ShipQuests_Tibbo, .@v; break; - case 32766: return; + default: if (@menuret < 0) return; } } while (1); diff --git a/npc/functions/quest-debug/017-ShipQuests_ChefGado.txt b/npc/functions/quest-debug/017-ShipQuests_ChefGado.txt index 8bf5ea6f..5191802e 100644 --- a/npc/functions/quest-debug/017-ShipQuests_ChefGado.txt +++ b/npc/functions/quest-debug/017-ShipQuests_ChefGado.txt @@ -21,7 +21,7 @@ function script QuestDebug17 { l("Completed, Julia wins (returned poison)"), 5, l("Completed, Julia wins"), 6; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/018-General_Cookies.txt b/npc/functions/quest-debug/018-General_Cookies.txt index 43bf44af..90be1282 100644 --- a/npc/functions/quest-debug/018-General_Cookies.txt +++ b/npc/functions/quest-debug/018-General_Cookies.txt @@ -16,7 +16,7 @@ function script QuestDebug18 { l("Does not have the quest"), 0, l("Got a cookie"), 1; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/019-ArtisQuests_LazyBrother.txt b/npc/functions/quest-debug/019-ArtisQuests_LazyBrother.txt index 02d674b0..d2ca14d5 100644 --- a/npc/functions/quest-debug/019-ArtisQuests_LazyBrother.txt +++ b/npc/functions/quest-debug/019-ArtisQuests_LazyBrother.txt @@ -19,7 +19,7 @@ function script QuestDebug19 { l("Told bobo to go home"), 3, l("Katja gave reward"), 4; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/020-ArtisQuests_Urchin.txt b/npc/functions/quest-debug/020-ArtisQuests_Urchin.txt index a7f73a5d..df85c261 100644 --- a/npc/functions/quest-debug/020-ArtisQuests_Urchin.txt +++ b/npc/functions/quest-debug/020-ArtisQuests_Urchin.txt @@ -17,7 +17,7 @@ function script QuestDebug20 { l("Moon needs @@", l("Croc Claw")), 1, l("Found @@, got exp", l("Croc Claw")), 2; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/021-ArtisQuests_CatchPiou.txt b/npc/functions/quest-debug/021-ArtisQuests_CatchPiou.txt index 9548ef9b..3393ad64 100644 --- a/npc/functions/quest-debug/021-ArtisQuests_CatchPiou.txt +++ b/npc/functions/quest-debug/021-ArtisQuests_CatchPiou.txt @@ -17,7 +17,7 @@ function script QuestDebug21 { l("Salem asks to catch piou"), 1, l("Returned piou to Salem"), 2; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/022-ArtisQuests_Fishman.txt b/npc/functions/quest-debug/022-ArtisQuests_Fishman.txt index 65c6ff44..a576bcdd 100644 --- a/npc/functions/quest-debug/022-ArtisQuests_Fishman.txt +++ b/npc/functions/quest-debug/022-ArtisQuests_Fishman.txt @@ -17,7 +17,7 @@ function script QuestDebug22 { l("Eugene needs tentacles"), 1, l("Gave tentacles, got reward"), 2; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/023-ArtisQuests_QOnan.txt b/npc/functions/quest-debug/023-ArtisQuests_QOnan.txt index 6028604c..22f8ff50 100644 --- a/npc/functions/quest-debug/023-ArtisQuests_QOnan.txt +++ b/npc/functions/quest-debug/023-ArtisQuests_QOnan.txt @@ -18,7 +18,7 @@ function script QuestDebug23 { l("Found the chest"), 2, l("Gave to Q'Onan, got reward"), 3; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/026-General_Rumly.txt b/npc/functions/quest-debug/026-General_Rumly.txt index ad245420..b4e90a59 100644 --- a/npc/functions/quest-debug/026-General_Rumly.txt +++ b/npc/functions/quest-debug/026-General_Rumly.txt @@ -18,7 +18,7 @@ function script QuestDebug26 { l("Rumly wants @@", l("Plushroom")), 2, l("Gave @@ to Rumly", l("Plushroom")), 3; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/027-ArtisQuests_Enora.txt b/npc/functions/quest-debug/027-ArtisQuests_Enora.txt index ef8c7d43..2f6805e1 100644 --- a/npc/functions/quest-debug/027-ArtisQuests_Enora.txt +++ b/npc/functions/quest-debug/027-ArtisQuests_Enora.txt @@ -26,7 +26,7 @@ function script QuestDebug27 { l("Enora asks to kill fluffys"), 10, l("Completed, got reward"), 11; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/028-General_Narrator.txt b/npc/functions/quest-debug/028-General_Narrator.txt index e5c19c7f..15596919 100644 --- a/npc/functions/quest-debug/028-General_Narrator.txt +++ b/npc/functions/quest-debug/028-General_Narrator.txt @@ -16,7 +16,7 @@ function script QuestDebug28 { l("Game introduction"), 0, l("Visited Artis at least once"), 1; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/029-ArtisQuests_Fexil.txt b/npc/functions/quest-debug/029-ArtisQuests_Fexil.txt index b8cf6283..b1a48c29 100644 --- a/npc/functions/quest-debug/029-ArtisQuests_Fexil.txt +++ b/npc/functions/quest-debug/029-ArtisQuests_Fexil.txt @@ -18,7 +18,7 @@ function script QuestDebug29 { l("Fexil needs help"), 2, l("Fexil wants to buy fur"), 3; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/030-ArtisQuests_Lloyd.txt b/npc/functions/quest-debug/030-ArtisQuests_Lloyd.txt index 4ac85cc5..a8e3a322 100644 --- a/npc/functions/quest-debug/030-ArtisQuests_Lloyd.txt +++ b/npc/functions/quest-debug/030-ArtisQuests_Lloyd.txt @@ -16,7 +16,7 @@ function script QuestDebug30 { l("Does not have the quest"), 0, l("Registered"), 1; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/031-General_Janus.txt b/npc/functions/quest-debug/031-General_Janus.txt index 797e3357..b5e62ecf 100644 --- a/npc/functions/quest-debug/031-General_Janus.txt +++ b/npc/functions/quest-debug/031-General_Janus.txt @@ -24,7 +24,7 @@ function script QuestDebug31 { case 1: skill NV_BASIC, min(6, getskilllv(NV_BASIC)), 0; break; case 2: case 3: skill NV_BASIC, max(7, getskilllv(NV_BASIC)), 0; break; - case 32766: return; + default: if (@menuret < 0) return; } } while (1); diff --git a/npc/functions/quest-debug/032-ArtisQuests_MonaDad.txt b/npc/functions/quest-debug/032-ArtisQuests_MonaDad.txt index f1b142f9..28e6020c 100644 --- a/npc/functions/quest-debug/032-ArtisQuests_MonaDad.txt +++ b/npc/functions/quest-debug/032-ArtisQuests_MonaDad.txt @@ -16,7 +16,7 @@ function script QuestDebug32 { l("Does not have the quest"), 0, l("Mona's dad is missing"), 1; - if (@menuret == 32766) + if (@menuret < 0) { return; } diff --git a/npc/functions/quest-debug/functions.txt b/npc/functions/quest-debug/functions.txt index c193f9f8..e0c0af9e 100644 --- a/npc/functions/quest-debug/functions.txt +++ b/npc/functions/quest-debug/functions.txt @@ -4,24 +4,17 @@ function script GenericQuestDebug { if (!debug) { select - menuimage("actions/back", l("Go back")), - menuimage("actions/exit", l("Close")); + menuimage("actions/back", l("Go back")); - if (@menu == 1) - { - @menuret = 32766; - return 32766; - } - - closedialog; - end; + @menuret = -0x7FFFFFFF; + return 1; } mes l("Choose desired quest state:"); deletearray .@vals; .@menustr$ = menuimage("actions/abort", l("Do nothing")) + ":"; - .@vals[0] = 32766; + .@vals[0] = -0x7FFFFFFF; .@cnt = 1; for (.@f = 1; .@f < getargcount(); .@f += 2) @@ -30,7 +23,7 @@ function script GenericQuestDebug { { .@qv = getarg(.@f + 1); .@s$ = menuimage("actions/" + (.@qv ? "edit" : "reset"), "[" + .@qv + "] " + getarg(.@f)); - .@menustr$ += (.@qv >= 32700 ? getarg(.@f) : .@s$) + ":"; + .@menustr$ += (.@qv < 0 ? getarg(.@f) : .@s$) + ":"; .@vals[.@cnt] = .@qv; ++.@cnt; } @@ -38,13 +31,10 @@ function script GenericQuestDebug { if (getgroupid() >= 99) { - .@menustr$ += menuimage("actions/nuke", l("Set state manually")) + ":"; - .@vals[.@cnt] = 32765; - ++.@cnt; + .@menustr$ += menuimage("actions/nuke", l("Set state manually")); + .@vals[.@cnt] = -0x7FFFFFFE; } - .@menustr$ += menuimage("actions/exit", l("Close")); - .@vals[.@cnt] = 32767; @menu = 255; @menuret = -1; @@ -60,12 +50,11 @@ function script GenericQuestDebug { switch (@menuret) { - case 32765: input .@w; setq getarg(0,0), .@w; - case 32766: return 1; - case 32767: closedialog; end; + case -0x7FFFFFFE: input @menuret; setq getarg(0,0), @menuret; + case -0x7FFFFFFF: return 1; } - if (@menuret < 32700) + if (@menuret >= 0) { setq getarg(0,0), @menuret; } diff --git a/npc/scripts.conf b/npc/scripts.conf index 31de12c5..cc5933fe 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -80,7 +80,7 @@ "npc/commands/debug-skill.txt", "npc/commands/debug-preset.txt", "npc/commands/debug.txt", -"npc/commands/numa.txt", +"npc/commands/super-menu.txt", // config script "npc/config/hairstyle_config.txt", -- cgit v1.2.3-70-g09d2