summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-11-12 23:22:48 +0000
committerJesusaves <cpntb1@ymail.com>2020-11-12 23:22:48 +0000
commit5838c6001f2bf57c9cbe5753d3a667ac5a8ab984 (patch)
tree74263f2ba8ebb78e826aad4cb4d13799e787b420
parente9b5eb877f1653054d6aa74ead4ae3b26d3f69f6 (diff)
parent212bb43e7d0f046b646f496641c49d15e309283e (diff)
downloadserverdata-5838c6001f2bf57c9cbe5753d3a667ac5a8ab984.tar.gz
serverdata-5838c6001f2bf57c9cbe5753d3a667ac5a8ab984.tar.bz2
serverdata-5838c6001f2bf57c9cbe5753d3a667ac5a8ab984.tar.xz
serverdata-5838c6001f2bf57c9cbe5753d3a667ac5a8ab984.zip
Merge branch 'livio/20201108_west_argaes' into 'master'
Add a couple quests for Captain Hal and Sergeant Ryan See merge request evol/serverdata!279
-rw-r--r--db/quest_db.conf32
-rw-r--r--npc/008-1-1/galimatia.txt608
-rw-r--r--npc/008-1-1/hal.txt128
-rw-r--r--npc/008-1-1/morcant.txt8
-rw-r--r--npc/008-1-1/soldiers.txt11
-rw-r--r--npc/008-1/_import.txt1
-rw-r--r--npc/008-1/sergeant-ryan.txt72
-rw-r--r--npc/008-2-32/thamas.txt12
-rw-r--r--npc/commands/debug-quest.txt7
-rw-r--r--npc/functions/libquest.txt104
-rw-r--r--npc/functions/quest-debug/061-General_Hal.txt30
-rw-r--r--npc/scripts.conf5
12 files changed, 638 insertions, 380 deletions
diff --git a/db/quest_db.conf b/db/quest_db.conf
index 88158915..6a0538f5 100644
--- a/db/quest_db.conf
+++ b/db/quest_db.conf
@@ -150,12 +150,12 @@ quest_db: (
Name: "ArtisQuests_MonaDad"
},
{
- Id: 33
- Name: "Artis_Legion_Progress"
+ Id: 33
+ Name: "Artis_Legion_Progress"
},
{
- Id: 34
- Name: "ArtisQuests_TrainingLegion"
+ Id: 34
+ Name: "ArtisQuests_TrainingLegion"
},
{
Id: 35
@@ -164,24 +164,24 @@ quest_db: (
// Argaes Quests (50~99)
{
- Id: 50
- Name: "HurnscaldQuests_Hinnak"
+ Id: 50
+ Name: "HurnscaldQuests_Hinnak"
},
{
- Id: 51
- Name: "HurnscaldQuests_Soup"
+ Id: 51
+ Name: "HurnscaldQuests_Soup"
},
{
- Id: 52
- Name: "HurnscaldQuests_Inspector"
+ Id: 52
+ Name: "HurnscaldQuests_Inspector"
},
{
- Id: 53
- Name: "HurnscaldQuests_ForestBow"
+ Id: 53
+ Name: "HurnscaldQuests_ForestBow"
},
{
- Id: 54
- Name: "HurnscaldQuests_WoodenShield"
+ Id: 54
+ Name: "HurnscaldQuests_WoodenShield"
},
{
Id: 55
@@ -207,6 +207,10 @@ quest_db: (
Id: 60
Name: "HurnscaldQuests_BloodDonor"
},
+{
+ Id: 61
+ Name: "General_CptHal"
+},
// Event and General Quests (100~149)
{
diff --git a/npc/008-1-1/galimatia.txt b/npc/008-1-1/galimatia.txt
index 29db843a..f5439978 100644
--- a/npc/008-1-1/galimatia.txt
+++ b/npc/008-1-1/galimatia.txt
@@ -9,40 +9,39 @@
// KEEP item_db.conf updated as well
function script usePurificationPotion {
- // Check quest status, if not in a quest provide default item behaviour
+ // Check quest status, if not in a quest provide default item behaviour
if (getq(ArgaesQuest_Galimatia) == 1) {
- // Do as requested by quest
- if (isin("008-1-1", 95, 45, 99, 48)) {
- setq(ArgaesQuest_Galimatia, 2);
- message strcharinfo(0), l("Done. Maybe it's time to ask Galimatia what to do now.");
- delitem PurificationPotion, 1;
- } else {
- message strcharinfo(0), l("Hmm... I'm sure that is not the right place to put it.");
- return true;
- }
- } else return false;
+ // Do as requested by quest
+ if (isin("008-1-1", 95, 45, 99, 48)) {
+ setq(ArgaesQuest_Galimatia, 2);
+ message strcharinfo(0), l("Done. Maybe it's time to ask Galimatia what to do now.");
+ delitem PurificationPotion, 1;
+ } else {
+ message strcharinfo(0), l("Hmm... I'm sure that is not the right place to put it.");
+ return true;
+ }
+ } else return false;
}
function script useFertilityPotion {
- // Check quest status, if not in a quest provide default item behaviour
+ // Check quest status, if not in a quest provide default item behaviour
if (getq(ArgaesQuest_Galimatia) == 3) {
- // Do as requested by quest
- if (isin("008-1-1", 95, 45, 99, 48)) {
- setq(ArgaesQuest_Galimatia, 4);
- message strcharinfo(0), l("All right! I've poured even this one..");
- delitem FertilityPotion, 1;
- } else {
- message strcharinfo(0), l("Hmm... This one is supposed to be poured where the other one were.");
- return true;
- }
- } else return false;
+ // Do as requested by quest
+ if (isin("008-1-1", 95, 45, 99, 48)) {
+ setq(ArgaesQuest_Galimatia, 4);
+ message strcharinfo(0), l("All right! I've poured even this one..");
+ delitem FertilityPotion, 1;
+ } else {
+ message strcharinfo(0), l("Hmm... This one is supposed to be poured where the other one were.");
+ return true;
+ }
+ } else return false;
}
// ------------------------------------
008-1-1,113,59,0 script Galimatia NPC_GALIMATIA,{
function advanceQuest;
- function printIngredients;
-
+ function NPCdemandsIngredients;
function QuestPart0;
function QuestPart1;
function QuestPart2;
@@ -52,149 +51,48 @@ function script useFertilityPotion {
function QuestPart6;
function galimatiaQuestDaily;
- switch(getq(ArgaesQuest_Galimatia)) {
- case 0: QuestPart0(); break;
- case 1: QuestPart1(); break;
- case 2: QuestPart2(); break;
- case 3: QuestPart3(); break;
- case 4: QuestPart4(); break;
- case 5: QuestPart5(); break;
- case 6: QuestPart6(); break;
+ switch(getq(ArgaesQuest_Galimatia)) {
+ case 0: QuestPart0(); break;
+ case 1: QuestPart1(); break;
+ case 2: QuestPart2(); break;
+ case 3: QuestPart3(); break;
+ case 4: QuestPart4(); break;
+ case 5: QuestPart5(); break;
+ case 6: QuestPart6(); break;
case 7: galimatiaQuestDaily(); break;
- default:
- mesq l("[Invalid quest status: %d, check script]", getq(ArgaesQuest_Galimatia));
- }
- close;
-
-// ----------------
-/*
- @brief Prints the list of quest ingredients on the NPC window
- @param Array with items IDs
- @param Array with relative amount required
- @returns nothing
-*/
-function printIngredients {
- for (.@i = 0; .@i < getarraysize(getarg(0)); .@i++) {
- mesf(" - %d %s", getelementofarray(getarg(1), .@i), getitemlink(getelementofarray(getarg(0), .@i)));
- }
- return;
-}
-
-/*
- @brief Checks if player has items required
- @param Array with required items IDs
- @param Array with relative amount required
- @returns false if player doesn't have required items
-*/
-function checkForItems {
- for (.@i = 0; .@i < getarraysize(getarg(0)); .@i++) {
- // If even a single thing is missing abort immediately
- if(getelementofarray(getarg(1), .@i) > countitem(getelementofarray(getarg(0), .@i))) {
- return false;
- }
- }
- return true;
-}
-
-/*
- @brief Craft an item from some other items. All input items got deleted.
- @param Array with required items IDs
- @param Array with relative amount required
- @param output item IDs
- @param output amount
- @returns 0 if successful, 1 if player lack ingredients, 2 if overburdened, 255 code error
-*/
-function craftFromPlayer {
- // Check input parameter amount
- if (getargcount() != 4) return 255;
-
- // Check item amounts
- if (!checkForItems(getarg(0), getarg(1))) return 1;
-
- // Check if player is able to carry output from crafting
- if (!checkweight(getarg(2), getarg(3))) return 2;
- else getitem(getarg(2), getarg(3));
-
- // Delete Items from player inventory
- for (.@i = getarrayindex(getarg(0)); .@i < getarraysize(getarg(0)); .@i++) {
- delitem(getelementofarray(getarg(0), .@i), getelementofarray(getarg(1), .@i));
- }
-
- return 0;
-}
+ default:
+ mesq l("[Invalid quest status! %d, check script]", getq(ArgaesQuest_Galimatia));
+ }
+ close;
-/*
- @brief Craft an item from some other items. All input items will be deleted in case of success.
- @param Array with required items IDs
- @param Array with relative amount required
- @param output item IDs
- @param output amount
- @param NPC question about ingredients
- @param NPC answer if successful
- @param NPC answer if player lacks ingredients
- @param NPC answer if player is overburdened
- @returns true if successful
-*/
-function NPCcrafting {
- speech
- getarg(4);
- if (askyesno() == ASK_NO) {
- mesq l("Come on, move!");
- close;
- } else {
- switch(craftFromPlayer(getarg(0), getarg(1), getarg(2), getarg(3))) {
- case 0:
- mesq getarg(5);
- return true;
- break;
-
- case 1:
- mesq getarg(6);
- // FIXME - Gather proper variables
- printIngredients(getarg(0), getarg(1));
- break;
-
- case 2:
- mesq getarg(7);
- break;
-
- case 255:
- mesq l("[BUG ENCOUNTERED] Dammit...");
- break;
-
- default:
- }
- }
- return false;
-}
// FIXME comment better
// Makes NPC to ask for ingredients
function NPCdemandsIngredients {
- mesq l("Fine. The land is healthy now but nothing will grow yet. This time I need you to get:");
- printIngredients(.REQ1_INGREDIENTS, .REQ1_INGREDIENTS_AMOUNT);
- mesq l("So making a %s will make things easier.", getitemlink(.REQ1_OUTPUT));
- if (NPCcrafting(
- .REQ0_INGREDIENTS, .REQ0_INGREDIENTS_AMOUNT,
- .REQ0_OUTPUT, .REQ0_OUTPUT_AMOUNT,
- l("Okay. Give me a second..."),
- l("Nope. You don't have enough ingredients for that."),
- l("I can't give you nothing if you don't leave some room for it!")
- )
- ) {
- advanceQuest();
- mesq l("You must now pour it over the land again in the same spot.");
- }
- close;
- return;
+ mesq l("Fine. The land is healthy now but nothing will grow yet. This time I need you to get:");
+ printIngredients(.REQ1_INGREDIENTS, .REQ1_INGREDIENTS_AMOUNT);
+ mesq l("So making a %s will make things easier.", getitemlink(.REQ1_OUTPUT));
+ if (NPCcrafting(
+ .REQ0_INGREDIENTS, .REQ0_INGREDIENTS_AMOUNT,
+ .REQ0_OUTPUT, .REQ0_OUTPUT_AMOUNT,
+ l("Okay. Give me a second..."),
+ l("Nope. You don't have enough ingredients for that."),
+ l("I can't give you nothing if you don't leave some room for it!")
+ )
+ ) {
+ advanceQuest();
+ mesq l("You must now pour it over the land again in the same spot.");
+ }
+ close;
+ return;
}
//-----------------
function advanceQuest {
- setq(ArgaesQuest_Galimatia, getq(ArgaesQuest_Galimatia) + 1);
- return;
+ setq(ArgaesQuest_Galimatia, getq(ArgaesQuest_Galimatia) + 1);
+ return;
}
/*
@@ -204,83 +102,83 @@ Galimatia needs to tend to other work and can’t get away, so she asks player f
*/
function QuestPart0 {
- speech
- l("Hello."),
- l("If only someone could help me to make my flowers bloom again."),
- l("I just dont know what to do. Perhaps all gets better when I stay here, whining and waiting. Please, leave me alone.");
+ speech
+ l("Hello."),
+ l("If only someone could help me to make my flowers bloom again."),
+ l("I just dont know what to do. Perhaps all gets better when I stay here, whining and waiting. Please, leave me alone.");
next;
- select(
- l("What about making some fertilizing-something?"),
- l("I don't have time to spend on flowers.")
- );
+ select(
+ l("What about making some fertilizing-something?"),
+ l("I don't have time to spend on flowers.")
+ );
mes "";
mesn;
- switch(@menu) {
- case 1:
- mesq l("All right! I need you to get:");
- printIngredients(.REQ0_INGREDIENTS, .REQ0_INGREDIENTS_AMOUNT);
- mesq l("So I can make a %s out of it.", getitemlink(.REQ0_OUTPUT));
- if (NPCcrafting(
- .REQ0_INGREDIENTS, .REQ0_INGREDIENTS_AMOUNT,
- .REQ0_OUTPUT, .REQ0_OUTPUT_AMOUNT,
- l("Have you got those things with you?"),
- l("Okay. Give me a second..."),
- l("Nope. You don't have enough ingredients for that."),
- l("I can't give you nothing if you don't leave some room for it!")
- )
- ) {
- advanceQuest();
- mesq l("You must now pour it over the land.");
- }
- close;
- break;
- default:
- // FIXME This got to be improved in other script parts as well
- mesq
- any(
- l("Gave up already?"),
- l("Okay..."),
- l("Go stay afk in TMW Legacy if you don't want to make yourself useful."),
- l("Hehe, hehe. Well, come back if you change your mind."
- )
- );
- close;
- }
- return;
+ switch(@menu) {
+ case 1:
+ mesq l("All right! I need you to get:");
+ printIngredients(.REQ0_INGREDIENTS, .REQ0_INGREDIENTS_AMOUNT);
+ mesq l("So I can make a %s out of it.", getitemlink(.REQ0_OUTPUT));
+ if (NPCcrafting(
+ .REQ0_INGREDIENTS, .REQ0_INGREDIENTS_AMOUNT,
+ .REQ0_OUTPUT, .REQ0_OUTPUT_AMOUNT,
+ l("Have you got those things with you?"),
+ l("Okay. Give me a second..."),
+ l("Nope. You don't have enough ingredients for that."),
+ l("I can't give you nothing if you don't leave some room for it!")
+ )
+ ) {
+ advanceQuest();
+ mesq l("You must now pour it over the land.");
+ }
+ close;
+ break;
+ default:
+ // FIXME This got to be improved in other script parts as well
+ mesq
+ any(
+ l("Gave up already?"),
+ l("Okay..."),
+ l("Go stay afk in TMW Legacy if you don't want to make yourself useful."),
+ l("Hehe, hehe. Well, come back if you change your mind."
+ )
+ );
+ close;
+ }
+ return;
}
/*
She made a Purification Potion out of ingredients to heal the land and gives it to the player and says it must be poured over the land (marked in some way. Like in the Orum and Waric follow-up quest).
*/
function QuestPart1 {
- if(checkForItems(.REQ0_OUTPUT, .REQ0_OUTPUT_AMOUNT)) {
- speech
- l("What's up? You want me to show how to open a bottle and pour its content on the ground?");
- } else {
- speech
- l("Why you don't have a %s with you? You need me to make another one?", getitemlink(.REQ0_OUTPUT));
- if (askyesno() == ASK_NO) {
- mesq l("Come on, stop wasting my time!");
- close;
- } else{
- if (NPCcrafting(
- .REQ0_INGREDIENTS, .REQ0_INGREDIENTS_AMOUNT,
- .REQ0_OUTPUT, .REQ0_OUTPUT_AMOUNT,
- l("Again, do you have what I need to make that?"),
- l("Here we go again..."),
- l("No! Have you already forgot what I need for it?"),
- l("You don't even have the space in your inventory to carry it!!! Oh, man you are a disaster...")
- )
- ) {
- // FIXME Put some messages about making again the potion so the NPC can look different and react like it was somewhat disturbed by player failure
- mesq l("Remember: you must pour it over the land.");
- }
- }
- }
- close;
- return;
+ if(checkForItems(.REQ0_OUTPUT, .REQ0_OUTPUT_AMOUNT)) {
+ speech
+ l("What's up? You want me to show how to open a bottle and pour its content on the ground?");
+ } else {
+ speech
+ l("Why you don't have a %s with you? You need me to make another one?", getitemlink(.REQ0_OUTPUT));
+ if (askyesno() == ASK_NO) {
+ mesq l("Come on, stop wasting my time!");
+ close;
+ } else{
+ if (NPCcrafting(
+ .REQ0_INGREDIENTS, .REQ0_INGREDIENTS_AMOUNT,
+ .REQ0_OUTPUT, .REQ0_OUTPUT_AMOUNT,
+ l("Again, do you have what I need to make that?"),
+ l("Here we go again..."),
+ l("No! Have you already forgot what I need for it?"),
+ l("You don't even have the space in your inventory to carry it!!! Oh, man you are a disaster...")
+ )
+ ) {
+ // FIXME Put some messages about making again the potion so the NPC can look different and react like it was somewhat disturbed by player failure
+ mesq l("Remember: you must pour it over the land.");
+ }
+ }
+ }
+ close;
+ return;
}
/*
@@ -290,54 +188,54 @@ If you weren't able to trash the potion, the land is now healed, but nothing gro
function QuestPart2 {
mesn;
- mesq l("Fine. The land is healthy now but nothing will grow yet. This time I need you to get:");
- printIngredients(.REQ1_INGREDIENTS, .REQ1_INGREDIENTS_AMOUNT);
- mesq l("So making a %s will make things easier.", getitemlink(.REQ1_OUTPUT));
- if (NPCcrafting(
- .REQ1_INGREDIENTS, .REQ1_INGREDIENTS_AMOUNT,
- .REQ1_OUTPUT, .REQ1_OUTPUT_AMOUNT,
- l("Have you got what we need?"),
- l("Here it is!"),
- l("No! You haven't!"),
- l("I can't give you nothing if you don't leave some room for it!")
- )
- ) {
- advanceQuest();
- mesq l("You must now pour it over the land again in the same spot.");
- }
- close;
- return;
+ mesq l("Fine. The land is healthy now but nothing will grow yet. This time I need you to get:");
+ printIngredients(.REQ1_INGREDIENTS, .REQ1_INGREDIENTS_AMOUNT);
+ mesq l("So making a %s will make things easier.", getitemlink(.REQ1_OUTPUT));
+ if (NPCcrafting(
+ .REQ1_INGREDIENTS, .REQ1_INGREDIENTS_AMOUNT,
+ .REQ1_OUTPUT, .REQ1_OUTPUT_AMOUNT,
+ l("Have you got what we need?"),
+ l("Here it is!"),
+ l("No! You haven't!"),
+ l("I can't give you nothing if you don't leave some room for it!")
+ )
+ ) {
+ advanceQuest();
+ mesq l("You must now pour it over the land again in the same spot.");
+ }
+ close;
+ return;
}
function QuestPart3 {
- if(checkForItems(.REQ1_OUTPUT, .REQ1_OUTPUT_AMOUNT)) {
- speech
- l("Come on pal, what's the matter?");
- } else {
- speech
- l("Got drunk with the %s? You need me to make another one?", getitemlink(.REQ1_OUTPUT));
- if (askyesno() == ASK_NO) {
+ if(checkForItems(.REQ1_OUTPUT, .REQ1_OUTPUT_AMOUNT)) {
+ speech
+ l("Come on pal, what's the matter?");
+ } else {
+ speech
+ l("Got drunk with the %s? You need me to make another one?", getitemlink(.REQ1_OUTPUT));
+ if (askyesno() == ASK_NO) {
mesn;
- mesq l("Come on, stop wasting my time!");
- close;
- } else{
- if (NPCcrafting(
- .REQ1_INGREDIENTS, .REQ1_INGREDIENTS_AMOUNT,
- .REQ1_OUTPUT, .REQ1_OUTPUT_AMOUNT,
- l("Again, do you have what I need to make that?"),
- l("Here we go again..."),
- l("No! Have you already forgot what I need for it?"),
- l("I can't give you nothing if you don't leave some room for it!")
- )
- ) {
- // FIXME Put some messages about making again the potion so the NPC can look different and react like it was somewhat disturbed by player failure
- mesq l("Remember: you must now pour it over the land.");
- }
- }
- }
- close;
- return;
+ mesq l("Come on, stop wasting my time!");
+ close;
+ } else{
+ if (NPCcrafting(
+ .REQ1_INGREDIENTS, .REQ1_INGREDIENTS_AMOUNT,
+ .REQ1_OUTPUT, .REQ1_OUTPUT_AMOUNT,
+ l("Again, do you have what I need to make that?"),
+ l("Here we go again..."),
+ l("No! Have you already forgot what I need for it?"),
+ l("I can't give you nothing if you don't leave some room for it!")
+ )
+ ) {
+ // FIXME Put some messages about making again the potion so the NPC can look different and react like it was somewhat disturbed by player failure
+ mesq l("Remember: you must now pour it over the land.");
+ }
+ }
+ }
+ close;
+ return;
}
/*
@@ -350,22 +248,22 @@ function QuestPart4 {
speech
l("Thanks for the help earlier. The soil is now fertile thanks to your efforts."),
l("Do you know Blossom? She is the flower girl. Bees won't come without flowers."),
- l("So, now I need %d %s.", .REQ2_INGREDIENTS_AMOUNT, getitemlink(.REQ2_INGREDIENTS));
+ l("So, now I need %d %s.", .REQ2_INGREDIENTS_AMOUNT, getitemlink(.REQ2_INGREDIENTS));
next;
- // We don't take player items without asking
+ // We don't take player items without asking
mesc l("Deliver items to Blossom?");
if (askyesno() == ASK_NO) close;
- if(checkForItems(.REQ2_INGREDIENTS, .REQ2_INGREDIENTS_AMOUNT)) {
- advanceQuest();
- speech
- l("Nice, gimme that!"),
+ if(checkForItems(.REQ2_INGREDIENTS, .REQ2_INGREDIENTS_AMOUNT)) {
+ advanceQuest();
+ speech
+ l("Nice, gimme that!"),
l("I'll go plant them. Now go, maybe I need your help again later.");
- } else {
- speech
- l("Go get some!");
- }
- close;
- return;
+ } else {
+ speech
+ l("Go get some!");
+ }
+ close;
+ return;
}
/*
@@ -378,25 +276,25 @@ Galimatia gives the player their reward: Player must select a simple Magic Wand
*/
function QuestPart5 {
- speech
- l("Nice job."),
+ speech
+ l("Nice job."),
l("I've heard bees are scared of fire, you know."),
- l("So, what do you want?"),
- l("A %s or a %s?", getitemlink(.QUESTPRIZES[0]) , getitemlink(.QUESTPRIZES[1]));
- select(
- l("I want the %s!", getitemname(.QUESTPRIZES[0])),
- l("A %s?!? Cool!!!", getitemname(.QUESTPRIZES[1]))
- );
- if (!checkweight(.QUESTPRIZES[@menu-1], .QUESTPRIZES_AMOUNT[@menu-1])) {
- mesq l("I can't give you a prize if you are overburdened. Make room in your inventory!");
- }
- else{
- getitem(.QUESTPRIZES[@menu-1], .QUESTPRIZES_AMOUNT[@menu-1]);
- advanceQuest();
- mesq l("Use those wisely and use safety glasses.");
- }
- close;
- return;
+ l("So, what do you want?"),
+ l("A %s or a %s?", getitemlink(.QUESTPRIZES[0]) , getitemlink(.QUESTPRIZES[1]));
+ select(
+ l("I want the %s!", getitemname(.QUESTPRIZES[0])),
+ l("A %s?!? Cool!!!", getitemname(.QUESTPRIZES[1]))
+ );
+ if (!checkweight(.QUESTPRIZES[@menu-1], .QUESTPRIZES_AMOUNT[@menu-1])) {
+ mesq l("I can't give you a prize if you are overburdened. Make room in your inventory!");
+ }
+ else{
+ getitem(.QUESTPRIZES[@menu-1], .QUESTPRIZES_AMOUNT[@menu-1]);
+ advanceQuest();
+ mesq l("Use those wisely and use safety glasses.");
+ }
+ close;
+ return;
}
/*
@@ -406,32 +304,32 @@ This enables the player to receive a Rose Hat. Fighting the flowers that were ju
function QuestPart6 {
mesn;
- mesq l("Hello again! Do you want me to exchange %d %s and %d GP for a %s?",
- .REQ3_INGREDIENTS_AMOUNT[0], getitemlink(.REQ3_INGREDIENTS[0]),
- .REQ3_COST, getitemlink(.REQ3_OUTPUT)
- );
- if (askyesno() == ASK_NO) {
- mesq l("As you wish.");
- close;
- } else {
- if(Zeny>=.REQ3_COST) {
- if(NPCcrafting(
- .REQ3_INGREDIENTS, .REQ3_INGREDIENTS_AMOUNT,
- .REQ3_OUTPUT, .REQ3_OUTPUT_AMOUNT,
- l("Do you have what I need?"),
- l("Have fun!"),
- l("Nope. I wont exchange for such less."),
- l("I can't give you nothing if you don't leave some room for it!")
- )) {
+ mesq l("Hello again! Do you want me to exchange %d %s and %d GP for a %s?",
+ .REQ3_INGREDIENTS_AMOUNT[0], getitemlink(.REQ3_INGREDIENTS[0]),
+ .REQ3_COST, getitemlink(.REQ3_OUTPUT)
+ );
+ if (askyesno() == ASK_NO) {
+ mesq l("As you wish.");
+ close;
+ } else {
+ if(Zeny>=.REQ3_COST) {
+ if(NPCcrafting(
+ .REQ3_INGREDIENTS, .REQ3_INGREDIENTS_AMOUNT,
+ .REQ3_OUTPUT, .REQ3_OUTPUT_AMOUNT,
+ l("Do you have what I need?"),
+ l("Have fun!"),
+ l("Nope. I wont exchange for such less."),
+ l("I can't give you nothing if you don't leave some room for it!")
+ )) {
Zeny-=(.REQ3_COST);
- advanceQuest();
- }
- } else {
- mesq l("Ain't working for free, pal!");
- }
- }
- close;
- return;
+ advanceQuest();
+ }
+ } else {
+ mesq l("Ain't working for free, pal!");
+ }
+ }
+ close;
+ return;
}
/*
@@ -445,32 +343,52 @@ function galimatiaQuestDaily {
}
OnInit:
- // NPC ITEM REQUESTS
- setarray(.REQ0_INGREDIENTS , BottleOfWater , PinkPetal );
- setarray(.REQ0_INGREDIENTS_AMOUNT , 1 , 5 );
- .REQ0_OUTPUT = PurificationPotion;
- .REQ0_OUTPUT_AMOUNT = 1 ;
-
- setarray(.REQ1_INGREDIENTS , BottleOfWater, MaggotSlime, MauveHerb);
- setarray(.REQ1_INGREDIENTS_AMOUNT , 1 , 10 , 5);
- .REQ1_OUTPUT = FertilityPotion;
- .REQ1_OUTPUT_AMOUNT = 1;
-
- setarray(.REQ2_INGREDIENTS , FlowerSeeds);
- setarray(.REQ2_INGREDIENTS_AMOUNT , 5);
-
- setarray(.QUESTPRIZES , TrainingWand , ManaTorch );
- setarray(.QUESTPRIZES_AMOUNT , 1 , 1 );
-
- setarray(.REQ3_INGREDIENTS , ABlueRose);
- setarray(.REQ3_INGREDIENTS_AMOUNT , 10 );
- .REQ3_COST = 1000;
- .REQ3_OUTPUT = RoseHat;
- .REQ3_OUTPUT_AMOUNT = 1;
-
- .bodytype = BODYTYPE_2;
- .distance = 4;
- end;
+ // NPC ITEM REQUESTS
+ setarray(.REQ0_INGREDIENTS,
+ BottleOfWater,
+ PinkPetal
+ );
+ setarray(.REQ0_INGREDIENTS_AMOUNT,
+ 1,
+ 5
+ );
+ .REQ0_OUTPUT = PurificationPotion;
+ .REQ0_OUTPUT_AMOUNT = 1 ;
+
+ setarray(.REQ1_INGREDIENTS,
+ BottleOfWater,
+ MaggotSlime,
+ MauveHerb
+ );
+ setarray(.REQ1_INGREDIENTS_AMOUNT,
+ 1,
+ 10,
+ 5
+ );
+ .REQ1_OUTPUT = FertilityPotion;
+ .REQ1_OUTPUT_AMOUNT = 1;
+
+ setarray(.REQ2_INGREDIENTS, FlowerSeeds);
+ setarray(.REQ2_INGREDIENTS_AMOUNT, 5);
+
+ setarray(.QUESTPRIZES,
+ TrainingWand,
+ ManaTorch
+ );
+ setarray(.QUESTPRIZES_AMOUNT,
+ 1,
+ 1
+ );
+
+ setarray(.REQ3_INGREDIENTS, ABlueRose);
+ setarray(.REQ3_INGREDIENTS_AMOUNT, 10);
+ .REQ3_COST = 1000;
+ .REQ3_OUTPUT = RoseHat;
+ .REQ3_OUTPUT_AMOUNT = 1;
+
+ .bodytype = BODYTYPE_2;
+ .distance = 4;
+ end;
}
// ------------------------------------
diff --git a/npc/008-1-1/hal.txt b/npc/008-1-1/hal.txt
index 175fa8c1..3797f29b 100644
--- a/npc/008-1-1/hal.txt
+++ b/npc/008-1-1/hal.txt
@@ -1,20 +1,132 @@
// Evol scripts.
// Author:
-// Micksha
+// Livio
+// Micksha
// Description:
-// Hal, a Captain of the Brotherhood.
+// Hal, former Captain of the Legion.
+// Following: https://gitlab.com/evol/evol-narrative/-/raw/e819b2a213802f6ded9f9b7efd18b09b0bc27570/Storylines/4.West%20Argaes.txt
// THIS IS A PLACEHOLDER!
008-1-1,58,27,0 script Hal NPC_HAL,{
- speech
- l("Hello!"),
- l("I was just having a nap, now WildX summons me to stand here! What a crap."),
- l("Please, ask elanore to !slap him for me when you see them.");
+// Private function declarations
+function advanceQuest;
+function advanceQuest {
+ setq(General_CptHal, getq(General_CptHal) + 1);
+ return;
+}
+
+function QuestPart0;
+function QuestPart1;
+function QuestPart2;
+function QuestPart3;
+function QuestPart4;
+function QuestPart5;
+
+ switch(getq(General_CptHal)) {
+ case 0: QuestPart0(); break;
+ case 1: QuestPart1(); break;
+ case 2: QuestPart2(); break;
+ case 3: QuestPart3(); break;
+ case 4: QuestPart4(); break;
+ case 5: QuestPart5(); break;
+ default:
+ mesq l("[Invalid quest status: %d, check script]", getq(General_CptHal));
+ }
close;
+// Haven't met Thamas? MOVE ALONG CITIZEN!!!
+function QuestPart0 {
+ speech l("MOVE ALONG CITIZEN!!!");
+// l("I was just having a nap, now WildX summons me to stand here! What a crap."),
+// l("Please, ask elanore to !slap him for me when you see them.");
+ close;
+}
+
+function QuestPart1 {
+ speech l("MOVE ALONG C...");
+ select l("Hey, hey... I've been talking with one of your comrades, Thamas.");
+ speech l("So what?");
+ select l("What's so special about a mission assigned to a picky soldier?");
+ mesq l("You see the soldiers staring each other and then at you.");
+ speech l("You think that I'm going to disclose that to you???");
+ select
+ l("I just want to earn something to make a living."),
+ l("Ah, so special mission is secret mission too? Sorry if I've bothered you.");
+
+ if (@menu==1) {
+ speech l("You look like anything but military personnel... Okay since the Brotherhood will discharge their quivers on us at the very first encounter I guess that we can make a good use of you.");
+ speech l("We cannot get close to Hurnscald in Legion uniforms so we may need you to get some supplies. However, stay away from Hurnscald if you can.");
+ speech l("Bring us some food supplies to help us feed the troops. We need:");
+ printIngredients(.REQ0_INGREDIENTS, .REQ0_INGREDIENTS_AMOUNT);
+ next;
+ advanceQuest();
+ }
+ speech l("Now, get out of my face.");
+ close;
+}
+
+function QuestPart2 {
+ if (checkForItems(.REQ0_INGREDIENTS, .REQ0_INGREDIENTS_AMOUNT)){
+ if (NPCcrafting(
+ .REQ0_INGREDIENTS, .REQ0_INGREDIENTS_AMOUNT,
+ .REQ0_OUTPUT, .REQ0_OUTPUT_AMOUNT,
+ l("Have you got those things with you?"),
+ l("Fine. Here is your reward."),
+ l("Go find those supplies! Don't waste my time!"),
+ l("Your inventory is full, make room if you want your reward!")
+ )
+ )
+ {
+ BaseExp += 15 * BaseLevel;
+ Zeny += 150;
+ getitem(.REQ0_OUTPUT, .REQ0_OUTPUT_AMOUNT);
+ advanceQuest();
+ speech l("Now I need you to explore the area looking for Sergeant Ryan. I'm not having any report from him since a lot of time.");
+ speech l("I want you to go find him. He should not be that far from here.");
+ }
+ }
+}
+
+function QuestPart3 {
+ speech l("Any luck finding Ryan?");
+ select l("Negative.");
+ speech l("Scout the zone better! He must be somewhere nearby.");
+ close;
+}
+
+function QuestPart4 {
+ speech l("So?");
+ select l("Found priv... Ehm, I've found Sergeant Ryan. He is hurt and cannot walk right now.");
+ speech l("I don't have enough men to send after Sergeant Ryan. Provide him some sort of support until he recovers.");
+ select l("Roger that. Private %s, over!", strcharinfo(PC_NAME));
+ close;
+}
+
+
+function QuestPart5 {
+ select l("Good news! Sgt.Ryan is fine now and is going to go on with his mission.");
+ speech l("Well done.");
+ next;
+ speech l("MOVE ALONG!!! I don't need you anymore.");
+ close;
+}
+
OnInit:
+ // NPC ITEM REQUESTS
+ setarray(.REQ0_INGREDIENTS,
+ MoubooSteak,
+ MoubooMilk,
+ Honey
+ );
+ setarray(.REQ0_INGREDIENTS_AMOUNT,
+ 5,
+ 5,
+ 1
+ );
+ .REQ0_OUTPUT = BottleOfWater;
+ .REQ0_OUTPUT_AMOUNT = 1 ;
+
.bodytype = BODYTYPE_2;
.distance = 4;
end;
-}
-
+} \ No newline at end of file
diff --git a/npc/008-1-1/morcant.txt b/npc/008-1-1/morcant.txt
index 166240e7..385cf824 100644
--- a/npc/008-1-1/morcant.txt
+++ b/npc/008-1-1/morcant.txt
@@ -9,8 +9,10 @@
speech
l("Hello."),
l("My name is Morcant. I am a Captain, a bit bored since this harbor is not frequented much."),
- l("I would like to offer you food and tell you stories, but.. have you ever heard of WildX? I won't need to say more, do I?");
-
+// l("I would like to offer you food and tell you stories, but.. have you ever heard of WildX? I won't need to say more, do I?");
+ l("The only floating ship I've seen so far was the one with Legion soldiers sent to scout around."),
+ l("It was my first time that I've met someone from Aemil."),
+ l("I don't like to see armed people lurking around but feel free to stay as long as you wish but don't cause trouble."),
next;
select
l("Not really but okay...?"),
@@ -22,7 +24,7 @@
{
case 2:
mesn;
- mesq l("Hohoho! That is a family's trade secret!");
+ mesq l("Hohoho! That is a family's trade secret!"); // Merry Christmas?
if (!getq(General_SmearedHands)) {
next;
mesn;
diff --git a/npc/008-1-1/soldiers.txt b/npc/008-1-1/soldiers.txt
index fef6951f..a1636409 100644
--- a/npc/008-1-1/soldiers.txt
+++ b/npc/008-1-1/soldiers.txt
@@ -2,10 +2,13 @@
// Author:
// Micksha
// Description:
-// Brotherhood Guards serving Hal.
+// Legion Guards serving Hal.
// THIS IS A PLACEHOLDER!
-008-1-1,62,28,0 script Soldier#1 NPC_RAIJIN_MALE_BROTHERHOOD,{
+
+// FIXME We better put some more random answers
+
+008-1-1,62,28,0 script Soldier#1 NPC_RAIJIN_FEMALE_LEGION_ARTIS,{
speech
l("Hi!"),
l("I am not allowed to talk to strangers.");
@@ -17,14 +20,14 @@ OnInit:
end;
}
-008-1-1,54,30,0 script Soldier#2 NPC_HUMAN_MALE_BROTHERHOOD,{
+008-1-1,54,30,0 script Soldier#2 NPC_HUMAN_MALE_LEGION_ARTIS,{
speech
l("Hi!"),
l("I am not allowed to talk to strangers.");
close;
OnInit:
- .bodytype = BODYTYPE_2;
+ .bodytype = BODYTYPE_1;
.distance = 4;
end;
}
diff --git a/npc/008-1/_import.txt b/npc/008-1/_import.txt
index 381dec5a..d7cdcec4 100644
--- a/npc/008-1/_import.txt
+++ b/npc/008-1/_import.txt
@@ -26,3 +26,4 @@
"npc/008-1/soul-menhir.txt",
"npc/008-1/voltain.txt",
"npc/008-1/wateranimation.txt",
+"npc/008-1/sergeant-ryan.txt",
diff --git a/npc/008-1/sergeant-ryan.txt b/npc/008-1/sergeant-ryan.txt
new file mode 100644
index 00000000..962effc0
--- /dev/null
+++ b/npc/008-1/sergeant-ryan.txt
@@ -0,0 +1,72 @@
+// Evol scripts.
+// Author:
+// Livio
+// Description:
+// Save Sergeant Ryan
+
+008-1,55,47,0 script Sergeant Ryan NPC_RAIJIN_MALE_BROTHERHOOD,{
+function advanceQuest;
+function advanceQuest {
+ setq(General_CptHal, getq(General_CptHal) + 1);
+ return;
+}
+
+ if (getq(General_CptHal)<=3) {
+ speech
+ l("Aaah!!! Dammit!!!"),
+ l("It hurts like hell, #@%!!!!"),
+ l("Go away, my comrades will be here soon!");
+ }
+ if (getq(General_CptHal)==3) {
+ select l("No. They won't because Hal sent me to look after you, Tom Hanks.");
+ speech l("Aaah!!! What?");
+ select l("You are hurt! Looks like I have to save private Ryan...");
+ speech l("I'm a Sergeant. I could teach you a lesson or two if it wasn't for my leg.");
+ select l("Does it hurts if I touch here?");
+ speech l("@#@%&#@*!!!");
+ select l("This leg is badly hurt! Let me look out for something to heal it.");
+ speech l("Grr... I'm so nuts that I want to get even first with damn wolverns.");
+ speech l("Bring me:");
+ printIngredients(.REQ0_INGREDIENTS, .REQ0_INGREDIENTS_AMOUNT);
+ next;
+ advanceQuest();
+ close;
+ }
+ if (getq(General_CptHal)==4) {
+ if (checkForItems(.REQ0_INGREDIENTS, .REQ0_INGREDIENTS_AMOUNT)) {
+ speech l("Yeah, finally!!!");
+ next;
+ BaseExp += 15 * BaseLevel;
+ Zeny += 50;
+ advanceQuest();
+ delitem(.REQ0_INGREDIENTS, .REQ0_INGREDIENTS_AMOUNT);
+ speech l("Go tell Hal that I'm fine and I will go on with the mission as soon as possible.");
+ } else {
+ speech l("What are you doing here?!? I need:");
+ printIngredients(.REQ0_INGREDIENTS, .REQ0_INGREDIENTS_AMOUNT);
+ speech l("Come on, kill those bastards!!! Wolverns must pay the price of tasting my damn leg!!!");
+ select l("Fine. But PETA is not going to be happy about it...");
+ speech l("@#@%&#@*!!!");
+ }
+ close;
+ }
+ if (getq(General_CptHal)>=5) {
+ speech l("Thanks! Now move, I have a mission to accomplish.");
+ }
+ close;
+
+OnInit:
+ // NPC ITEM REQUESTS
+ setarray(.REQ0_INGREDIENTS,
+ WolvernPelt,
+ BottleOfWater
+ );
+ setarray(.REQ0_INGREDIENTS_AMOUNT,
+ 1,
+ 1
+ );
+
+ .bodytype = BODYTYPE_2;
+ .distance = 4;
+ end;
+}
diff --git a/npc/008-2-32/thamas.txt b/npc/008-2-32/thamas.txt
index a860e562..3af725aa 100644
--- a/npc/008-2-32/thamas.txt
+++ b/npc/008-2-32/thamas.txt
@@ -9,15 +9,17 @@
speech
l("Hi there."),
l("I am a legion soldier who never talks much, until Jesusalva or WildX puts words in my mouth."),
+ l("However, I can't wait to see animals, er, uncivilized people of these woodlands."),
+ l("Meh, I'm still with stomach ache due to that stew Morcant is used to cook. Like as I'm not enough nervous about the special mission I've been assigned to."),
+ //l("I bet he uses squirrels to make that damn stew. Bleah."),
l("Until then, let me be quiet. Talk to you later.");
-
next;
select
l("Okay, sorry for disturbing."),
l("But you said you remember me!"),
l("What do you think about this stew?"),
l("Where are you from, though? You have an odd... behavior."),
- l("What is a legion soldier even doing here?"),
+ l("What is a legion soldier even doing here? A special mission?"),
l("Who are Jesusalva and WildX?");
mes "";
switch (@menu)
@@ -59,6 +61,12 @@
mesq l("Stop making questions which make no sense...");
break;
case 5:
+ mesn;
+ mesq l("I can't tell you. Captain Hal is in charge so ask him if you really care.");
+ next;
+ mesq l("You can find him to the clifftop behind Morcant's house.");
+ if(!getq(General_CptHal)) setq(General_CptHal,1); // Start Captain Hal quest
+ break;
case 6:
mesn;
mesq l("Honestly? I don't know.");
diff --git a/npc/commands/debug-quest.txt b/npc/commands/debug-quest.txt
index 40a6a8b6..580173d0 100644
--- a/npc/commands/debug-quest.txt
+++ b/npc/commands/debug-quest.txt
@@ -108,9 +108,9 @@ function script GlobalQuestDebug {
l("Inspector"), HurnscaldQuests_Inspector,
l("Forest bow"), HurnscaldQuests_ForestBow,
l("Wooden shield"), HurnscaldQuests_WoodenShield,
- "Kfahr",HurnscaldQuests_Kfahr,
- "Galimatia",ArgaesQuest_Galimatia,
- "Rossy",HurnscaldQuests_Rossy;
+ "Kfahr", HurnscaldQuests_Kfahr,
+ "Galimatia", ArgaesQuest_Galimatia,
+ "Rossy", HurnscaldQuests_Rossy;
switch (@menuret)
{
@@ -131,6 +131,7 @@ function script GlobalQuestDebug {
menuint
menuimage("actions/back", l("Go back")), -1,
+ "Hal", General_CptHal,
l("Cookies"), General_Cookies,
"Rumly", General_Rumly,
l("Narrator"), General_Narrator,
diff --git a/npc/functions/libquest.txt b/npc/functions/libquest.txt
new file mode 100644
index 00000000..4799eb1d
--- /dev/null
+++ b/npc/functions/libquest.txt
@@ -0,0 +1,104 @@
+// Evol scripts for simplified quest development.
+// Author:
+// Livio
+
+/*
+ @brief Prints the list of quest ingredients on the NPC window
+ @param Array with items IDs
+ @param Array with relative amount required
+ @returns nothing
+*/
+function script printIngredients {
+ for (.@i = 0; .@i < getarraysize(getarg(0)); .@i++) {
+ mesf(" - %d %s", getelementofarray(getarg(1), .@i), getitemlink(getelementofarray(getarg(0), .@i)));
+ }
+ return;
+}
+
+/*
+ @brief Checks if player has items required
+ @param Array with required items IDs
+ @param Array with relative amount required
+ @returns false if player doesn't have required items
+*/
+function script checkForItems {
+ for (.@i = 0; .@i < getarraysize(getarg(0)); .@i++) {
+ // If even a single thing is missing abort immediately
+ if(getelementofarray(getarg(1), .@i) > countitem(getelementofarray(getarg(0), .@i))) {
+ return false;
+ }
+ }
+ return true;
+}
+
+/*
+ @brief Craft an item from some other items. All input items got deleted.
+ @param Array with required items IDs
+ @param Array with relative amount required
+ @param output item IDs
+ @param output amount
+ @returns 0 if successful, 1 if player lack ingredients, 2 if overburdened, 255 code error
+*/
+function script craftFromPlayer {
+ // Check input parameter amount
+ if (getargcount() != 4) return 255;
+
+ // Check item amounts
+ if (!checkForItems(getarg(0), getarg(1))) return 1;
+
+ // Check if player is able to carry output from crafting
+ if (!checkweight(getarg(2), getarg(3))) return 2;
+ else getitem(getarg(2), getarg(3));
+
+ // Delete Items from player inventory
+ for (.@i = getarrayindex(getarg(0)); .@i < getarraysize(getarg(0)); .@i++) {
+ delitem(getelementofarray(getarg(0), .@i), getelementofarray(getarg(1), .@i));
+ }
+
+ return 0;
+}
+
+/*
+ @brief Craft an item from some other items. All input items will be deleted in case of success.
+ @param Array with required items IDs
+ @param Array with relative amount required
+ @param output item IDs
+ @param output amount
+ @param NPC question about ingredients
+ @param NPC answer if successful
+ @param NPC answer if player lacks ingredients
+ @param NPC answer if player is overburdened
+ @returns true if successful
+*/
+function script NPCcrafting {
+ speech
+ getarg(4);
+ if (askyesno() == ASK_NO) {
+ mesq l("Come on, move!");
+ close;
+ } else {
+ switch(craftFromPlayer(getarg(0), getarg(1), getarg(2), getarg(3))) {
+ case 0:
+ mesq getarg(5);
+ return true;
+ break;
+
+ case 1:
+ mesq getarg(6);
+ // FIXME - Gather proper variables
+ printIngredients(getarg(0), getarg(1));
+ break;
+
+ case 2:
+ mesq getarg(7);
+ break;
+
+ case 255:
+ mesq l("[BUG ENCOUNTERED] Dammit...");
+ break;
+
+ default:
+ }
+ }
+ return false;
+} \ No newline at end of file
diff --git a/npc/functions/quest-debug/061-General_Hal.txt b/npc/functions/quest-debug/061-General_Hal.txt
new file mode 100644
index 00000000..172108f4
--- /dev/null
+++ b/npc/functions/quest-debug/061-General_Hal.txt
@@ -0,0 +1,30 @@
+// Hal quest debug
+// Author:
+// Livio
+
+function script QuestDebug61 {
+ do
+ {
+ clear;
+ setnpcdialogtitle l("Quest debug");
+ mes "General_CptHal";
+ mes "---";
+ mes l("Quest state: @@", getq(General_CptHal));
+ next;
+
+ GenericQuestDebug General_CptHal,
+ l("[RESET QUEST] Does not have the quest"), 0,
+ l("Bothered to talk to Thamas"), 1,
+ l("Accepted to resupply Hal's Legion troop"), 2,
+ l("Looking for Sergeant Ryan"), 3,
+ l("Found Sergeant Ryan, looking for items"), 4,
+ l("Healed Sergeant Ryan"), 5;
+
+ if (@menuret < 0)
+ {
+ return;
+ }
+
+ } while (1);
+ return;
+} \ No newline at end of file
diff --git a/npc/scripts.conf b/npc/scripts.conf
index 8976c457..514339c2 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -68,8 +68,9 @@
"npc/functions/music.txt",
"npc/functions/casino.txt",
"npc/functions/daily.txt",
+"npc/functions/libquest.txt",
-// quest debug
+// Quest debug
"npc/functions/quest-debug/functions.txt",
// Drasil Island
@@ -122,6 +123,8 @@
"npc/functions/quest-debug/057-HurnscaldQuests_Kfahr.txt",
"npc/functions/quest-debug/058-ArgaesQuest_Galimatia.txt",
"npc/functions/quest-debug/059-HurnscaldQuests_Rossy.txt",
+// 60 busy for blood donation quest
+"npc/functions/quest-debug/061-General_Hal.txt",
// Event and General Quests
"npc/functions/quest-debug/100-General_Narrator.txt",