diff options
author | Livio Recchia <recchialivio@libero.it> | 2020-11-08 20:07:10 +0100 |
---|---|---|
committer | Livio Recchia <recchialivio@libero.it> | 2020-11-08 20:07:10 +0100 |
commit | efdcedc2c2242652400d0138dc6a1d2f149634d3 (patch) | |
tree | d1d2debc7f0a33f3ae603addfdba1e99f0ea649a | |
parent | cdf4a10e1ce9f65bf34e5b22df3540a48d3d173b (diff) | |
download | serverdata-efdcedc2c2242652400d0138dc6a1d2f149634d3.tar.gz serverdata-efdcedc2c2242652400d0138dc6a1d2f149634d3.tar.bz2 serverdata-efdcedc2c2242652400d0138dc6a1d2f149634d3.tar.xz serverdata-efdcedc2c2242652400d0138dc6a1d2f149634d3.zip |
Implementing first steps of incomplete Hal quest
-rw-r--r-- | npc/008-1-1/hal.txt | 124 | ||||
-rw-r--r-- | npc/008-1-1/morcant.txt | 8 | ||||
-rw-r--r-- | npc/008-2-32/thamas.txt | 12 | ||||
-rw-r--r-- | npc/scripts.conf | 1 |
4 files changed, 136 insertions, 9 deletions
diff --git a/npc/008-1-1/hal.txt b/npc/008-1-1/hal.txt index 175fa8c1..7217ae4b 100644 --- a/npc/008-1-1/hal.txt +++ b/npc/008-1-1/hal.txt @@ -6,13 +6,129 @@ // 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 printIngredients; + +function QuestPart0; +function QuestPart1; +function QuestPart2; + +// ----------------------------------- + +/* + @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; +} + +function advanceQuest { + setq(General_CptHal, getq(General_CptHal) + 1); + return; +} +// --- MAIN FUNCTIONS --- + + 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; + case 6: QuestPart6(); break; + case 7: galimatiaQuestDaily(); 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. Bring to us:"); + 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)){ + // Check if player is able to carry reward + if (!checkweight(.REQ0_OUTPUT, .REQ0_OUTPUT_AMOUNT)){ + speech l("Your inventory is full, make room if you want your reward."); + } + else { + speech l("Fine. Here is your reward."); + BaseExp += 15 * BaseLevel; + Zeny += 150; + getitem(.REQ0_OUTPUT, .REQ0_OUTPUT_AMOUNT); + advanceQuest(); + } + } else { + speech l("Go get me:"); + printIngredients(.REQ0_INGREDIENTS, .REQ0_INGREDIENTS_AMOUNT); + speech l("Don't waste my time, citizen!"); + } +} + + +function QuestPart3 { + speech l("MOVE ALONG!!! I'm done with you!"); + close; +} OnInit: + // NPC ITEM REQUESTS + setarray(.REQ0_INGREDIENTS , BottleOfWater , PinkPetal ); + setarray(.REQ0_INGREDIENTS_AMOUNT , 1 , 5 ); + .REQ0_OUTPUT = PurificationPotion; + .REQ0_OUTPUT_AMOUNT = 1 ; + .bodytype = BODYTYPE_2; .distance = 4; end; 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-2-32/thamas.txt b/npc/008-2-32/thamas.txt index a860e562..f6bdf28f 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/scripts.conf b/npc/scripts.conf index 8976c457..c862ff83 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -122,6 +122,7 @@ "npc/functions/quest-debug/057-HurnscaldQuests_Kfahr.txt", "npc/functions/quest-debug/058-ArgaesQuest_Galimatia.txt", "npc/functions/quest-debug/059-HurnscaldQuests_Rossy.txt", +"npc/functions/quest-debug/060-General_Hal.txt" // Event and General Quests "npc/functions/quest-debug/100-General_Narrator.txt", |