diff options
author | Reid <reidyaro@gmail.com> | 2016-09-03 00:57:21 +0000 |
---|---|---|
committer | Reid <reidyaro@gmail.com> | 2016-09-03 00:57:21 +0000 |
commit | 1e110f19856b30dbc2b6a75f608f076a74080321 (patch) | |
tree | f917e542caacec1361a237b2ee25ef184dcbcc9b | |
parent | 124ac1561042fdbd5b1f6b1df72893d997ac274c (diff) | |
parent | 5d7c9eb8b6f3175d7eb5afe28eb85519d1d2cd2d (diff) | |
download | serverdata-1e110f19856b30dbc2b6a75f608f076a74080321.tar.gz serverdata-1e110f19856b30dbc2b6a75f608f076a74080321.tar.bz2 serverdata-1e110f19856b30dbc2b6a75f608f076a74080321.tar.xz serverdata-1e110f19856b30dbc2b6a75f608f076a74080321.zip |
Merge branch 'debug' into 'master'
Super Menu
Still WIP, will contain:
* Scheduled Broadcasts `(done)`
* MOTD config `(done)`
* Event management `(done)`
* Global debug
* Stat debug `(done)`
* Skill debug `(done)`
* Appearance debug `(done)`
* Quest debug `(done)`
* Presets `(done)`
See merge request !37
63 files changed, 2710 insertions, 469 deletions
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 3be81c53..8206a0b9 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 + { + 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 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); + } + 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/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 new file mode 100644 index 00000000..3c4640c5 --- /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("Hair style") + ": " + getlook (LOOK_HAIR); + next; + 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("Hair color") + ": " + getlook (LOOK_HAIR_COLOR); + next; + 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("Race") + ": " + Class; + next; + mes l("Please enter the desired race") + " (0-32767)"; + input .@r, 0, 0x7FFF; + jobchange max(0, min(0x7FFF, .@r)); + 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 "---"; + + next; + 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 (@menu) + { + case 1: setGender; break; + case 2: setStyle; break; + case 3: setColor; break; + case 4: setRace; break; + case 5: return; + } + } 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-preset.txt b/npc/commands/debug-preset.txt new file mode 100644 index 00000000..7b7b94fe --- /dev/null +++ b/npc/commands/debug-preset.txt @@ -0,0 +1,123 @@ +// Preset / routine system +// author: gumi +// description: allows to execute multiple commands in a single step +// to ease testing and debugging +// +// usage: @pre [options] <instruction>[, <instruction>...] +// usage: DoRoutine "[options] <instruction>[, <instruction>...]"; +// +// 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], "e")) + { + nude; + } + + 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; + } + } + } + + return; +} + +- script @pre 32767,{ + end; + +OnCall: + if (!debug && getgroupid() < 99) + { + end; + } + if (.@atcmd_parameters$[0] != "") + { + .@atcmd_parameters$[0] = implode(.@atcmd_parameters$[0], " "); + } + DoRoutine strip(.@atcmd_parameters$[0]); + 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-quest.txt b/npc/commands/debug-quest.txt new file mode 100644 index 00000000..208291f5 --- /dev/null +++ b/npc/commands/debug-quest.txt @@ -0,0 +1,156 @@ +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")), -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 -1: return; + 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")), -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 -1: return; + 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")), , + 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 -1: return; + 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")), -1, + l("Cookies"), General_Cookies, + "Rumly", General_Rumly, + l("Narrator"), General_Narrator, + "Janus", General_Janus; + + switch (@menuret) + { + case -1: return; + 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"))); + + switch (@menu) + { + case 1: qDebugShip; break; + case 2: qDebugArtis; break; + case 3: qDebugGeneral; break; + case 4: return; + } + } 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-skill.txt b/npc/commands/debug-skill.txt new file mode 100644 index 00000000..187c4009 --- /dev/null +++ b/npc/commands/debug-skill.txt @@ -0,0 +1,81 @@ +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); + 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; + } + + 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"))), -1; + + switch (@menuret) + { + case -1: return; + } + + 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 new file mode 100644 index 00000000..306bed56 --- /dev/null +++ b/npc/commands/debug.txt @@ -0,0 +1,139 @@ +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; + clearitem; + 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?"); + 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 (@menu) + { + case 2: + case 3: doReset @menu; + } + + return; + } + + 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?"); + 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 (@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: resetAll; break; + case 7: return; + } + } while(1); +} + + + +- script @debug 32767,{ + end; + +OnCall: + if (!debug && getgroupid() < 99) + { + end; + } + GlobalDebugMenu; + closedialog; + end; + +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/event.txt b/npc/commands/event.txt new file mode 100644 index 00000000..a01162e2 --- /dev/null +++ b/npc/commands/event.txt @@ -0,0 +1,29 @@ +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."); + + if (getarg(0,0)) + { + select + menuimage("actions/home", l("Return to Super Menu")); + } + + return; +} + + + +- script @event 32767,{ + end; + +OnCall: + GlobalEventMenu; + closedialog; + end; + +OnInit: + bindatcmd "event", "@event::OnCall", 4, 99, 0; +} diff --git a/npc/commands/motd.txt b/npc/commands/motd.txt new file mode 100644 index 00000000..ff3e6b49 --- /dev/null +++ b/npc/commands/motd.txt @@ -0,0 +1,183 @@ +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; + 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; + 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 when they log in."); + 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; + + 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 (@menu) + { + case 1: toggleMOTD; break; + case 2: addNewLine; break; + case 3: modifyLine .@size; break; + case 4: displayMOTD; break; + default: return; + } + } while (1); +} + + + +- script @motd 32767,{ + end; + +OnCall: + MOTDConfig; + closedialog; + end; + +OnPCLoginEvent: + if ($MOTD_Disabled < 1) + { + displayMOTD; + } + if (debug) + { + dispbottom "##7<<##B @@help://test-server|" + col(l("Click here for instructions on how to use the test server."),6) + "@@ ##7>>"; + } + end; + +OnInit: + .size = getarraysize($MOTD_Messages$); + .dsize = getarraysize($Debug_Messages$); + bindatcmd "motd", "@motd::OnCall", 3, 99, 0; +} diff --git a/npc/commands/scheduled-broadcasts.txt b/npc/commands/scheduled-broadcasts.txt new file mode 100644 index 00000000..51f1f6a6 --- /dev/null +++ b/npc/commands/scheduled-broadcasts.txt @@ -0,0 +1,220 @@ +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 @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 @menuret; + } + + function setOnLogin { + if (getarg(0,0) == 0) + { + return 1; + } + clear; + mes l("Send this message also on login?"); + next; + select + l("No"), + l("Yes"); + + return (@menu - 1); + } + + 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; + 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: + stopnpctimer "@sched"; + $@SCHED_Opt[0] = .@login; + $@SCHED_Opt[1] = .@int; + $@SCHED_Opt[2] = 0; + $@SCHED_Opt[3] = .@max; + $@SCHED_Opt[4] = 0; + $@SCHED_Msg$ = .@msg$; + if (.@int) + { + initnpctimer "@sched"; + } + if (@menu == 4) + { + announce $@SCHED_Msg$, bc_all; + } + case 1: return; + } + + } 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]) + { + .@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)); + } + 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; + + 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; + default: return; + } + } while (1); +} + + + +- script @sched 32767,{ + end; + +OnTimer3600000: + if ($@SCHED_Msg$ == "") + { + stopnpctimer; + end; + } + + ++$@SCHED_Opt[4]; // increase hours counter + if ($@SCHED_Opt[4] == $@SCHED_Opt[1]) + { + stopnpctimer; + ++$@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) + { + $@SCHED_Msg$ = ""; // reset message + end; + } + } + 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/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 new file mode 100644 index 00000000..17e36a69 --- /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 < 0) + { + 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..e0d7f5ac --- /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 < 0) + { + 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..805cbcd1 --- /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 < 0) + { + 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..d65f3a42 --- /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 < 0) + { + 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..b8c8eed9 --- /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")), -1, + l("Completed Gugli's task"), 2, + l("Nard asks to solve conflict"), 3, + 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 -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 new file mode 100644 index 00000000..6d2ca71b --- /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 < 0) + { + 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..97961c1a --- /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 < 0) + { + 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..6a8cae01 --- /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 < 0) + { + 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..9ad2ca2c --- /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 < 0) + { + 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..e125bfa0 --- /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 < 0) + { + 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..8f3c7e46 --- /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 < 0) + { + 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..dc2d3ad9 --- /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 < 0) + { + 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..a491d8a0 --- /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 < 0) + { + 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..2398583b --- /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 < 0) + { + 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..f6db5b3a --- /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 < 0) + { + 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..e37fe97d --- /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 < 0) + { + 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..cf98ca6d --- /dev/null +++ b/npc/functions/quest-debug/016-ShipQuests_Gugli.txt @@ -0,0 +1,48 @@ +// 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")), -1, + menuimage("actions/manage", l("Set subquests as completed")), -2, + l("Got reward from gugli"), 2; + + switch (@menuret) + { + case 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; + 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 new file mode 100644 index 00000000..5191802e --- /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 < 0) + { + 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..90be1282 --- /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 < 0) + { + 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..d2ca14d5 --- /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 < 0) + { + 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..df85c261 --- /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 < 0) + { + 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..3393ad64 --- /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 < 0) + { + 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..a576bcdd --- /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 < 0) + { + 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..22f8ff50 --- /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 < 0) + { + 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..b4e90a59 --- /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 < 0) + { + 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..2f6805e1 --- /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 < 0) + { + 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..15596919 --- /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 < 0) + { + 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..b1a48c29 --- /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 < 0) + { + 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..a8e3a322 --- /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 < 0) + { + 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..b5e62ecf --- /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; + 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 new file mode 100644 index 00000000..28e6020c --- /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 < 0) + { + 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..e0c0af9e --- /dev/null +++ b/npc/functions/quest-debug/functions.txt @@ -0,0 +1,62 @@ +// generic quest debug functions + +function script GenericQuestDebug { + if (!debug) + { + select + menuimage("actions/back", l("Go back")); + + @menuret = -0x7FFFFFFF; + return 1; + } + + mes l("Choose desired quest state:"); + + deletearray .@vals; + .@menustr$ = menuimage("actions/abort", l("Do nothing")) + ":"; + .@vals[0] = -0x7FFFFFFF; + .@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 < 0 ? getarg(.@f) : .@s$) + ":"; + .@vals[.@cnt] = .@qv; + ++.@cnt; + } + } + + if (getgroupid() >= 99) + { + .@menustr$ += menuimage("actions/nuke", l("Set state manually")); + .@vals[.@cnt] = -0x7FFFFFFE; + } + + + @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 -0x7FFFFFFE: input @menuret; setq getarg(0,0), @menuret; + case -0x7FFFFFFF: return 1; + } + + if (@menuret >= 0) + { + setq getarg(0,0), @menuret; + } + return; +} 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( <unix timestamp>, <options> ) +// gives time in a human-readable format +// +// <options> 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 0dfb7b9e..cc5933fe 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -31,11 +31,56 @@ "npc/functions/fishing.txt", "npc/functions/mouboofunc.txt", "npc/functions/string.txt", +"npc/functions/time.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", "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-quest.txt", +"npc/commands/debug-skill.txt", +"npc/commands/debug-preset.txt", +"npc/commands/debug.txt", +"npc/commands/super-menu.txt", // config script "npc/config/hairstyle_config.txt", |