diff options
author | Jesusaves <cpntb1@ymail.com> | 2022-10-14 18:28:47 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2022-10-14 18:28:47 -0300 |
commit | 01992b738bbaa6716c86514d24b13ce5fe1144a8 (patch) | |
tree | 8ff8ca1fa79b9b2f5fda98f1916f07ae4f70daae /npc | |
parent | 99833c5636c8e5fc4dba1dc90c2f70668853ca3b (diff) | |
parent | f403350fa89d3db9f51f085774286a30dff9f071 (diff) | |
download | serverdata-01992b738bbaa6716c86514d24b13ce5fe1144a8.tar.gz serverdata-01992b738bbaa6716c86514d24b13ce5fe1144a8.tar.bz2 serverdata-01992b738bbaa6716c86514d24b13ce5fe1144a8.tar.xz serverdata-01992b738bbaa6716c86514d24b13ce5fe1144a8.zip |
Merge remote-tracking branch 'livio/livio/20201117_libquest_fix'
Diffstat (limited to 'npc')
-rw-r--r-- | npc/008-1-1/galimatia.txt | 158 | ||||
-rw-r--r-- | npc/008-1-1/hal.txt | 35 | ||||
-rw-r--r-- | npc/functions/libquest.txt | 148 |
3 files changed, 158 insertions, 183 deletions
diff --git a/npc/008-1-1/galimatia.txt b/npc/008-1-1/galimatia.txt index 6b3bfabe..45824fd2 100644 --- a/npc/008-1-1/galimatia.txt +++ b/npc/008-1-1/galimatia.txt @@ -1,11 +1,11 @@ // Evol scripts. // Author: -// Micksha -// The other player I've forgot the name -// Livio +// Micksha +// The other player I've forgot the name +// Livio // Jesusalva // Description: -// Galimatia the beekeeper. +// Galimatia the beekeeper. // KEEP item_db.conf updated as well function script usePurificationPotion { @@ -17,6 +17,12 @@ function script usePurificationPotion { message strcharinfo(0), l("Done. Maybe it's time to ask Galimatia what to do now."); delitem PurificationPotion, 1; } else { + // FIXME Add more place checks + // Attempting pouring potion nearby Galimatia + //if (isin("008-1-1", 112, 57, 114, 60)) { npctalkonce(l("I said on the field, not on me fool!!!")); return true; } // FIXME Fails since doesn't recognize NPC + if (isin("008-1-1", 93, 52, 97, 56)){ message strcharinfo(0), l("The palm tree is fine, I guess... Nope. This is the wrong place."); return true; } + if (isin("008-1-1", 103, 58, 106, 58)){ message strcharinfo(0), l("Eh, better not. Her home will stink badly for weeks. That's a nasty joke..."); return true; } + if (isin("008-1-1", 97, 68, 103, 70)){ message strcharinfo(0), l("There are little plants already growing here. No, I should not pour it here."); return true; } message strcharinfo(0), l("Hmm... I'm sure that is not the right place to put it."); return true; } @@ -41,7 +47,6 @@ function script useFertilityPotion { // ------------------------------------ 008-1-1,113,59,0 script Galimatia NPC_GALIMATIA,{ function advanceQuest; - function NPCdemandsIngredients; function QuestPart0; function QuestPart1; function QuestPart2; @@ -65,29 +70,6 @@ function script useFertilityPotion { } close; - -// 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; -} - - //----------------- function advanceQuest { @@ -117,8 +99,7 @@ function QuestPart0 { switch(@menu) { case 1: - mesq l("All right! I need you to get:"); - printIngredients(.REQ0_INGREDIENTS, .REQ0_INGREDIENTS_AMOUNT); + mesq l("All right!"); mesq l("So I can make a %s out of it.", getitemlink(.REQ0_OUTPUT)); if (NPCcrafting( .REQ0_INGREDIENTS, .REQ0_INGREDIENTS_AMOUNT, @@ -126,7 +107,8 @@ function QuestPart0 { 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!") + l("I can't give you nothing if you don't leave some room for it!"), + l("Changed your mind? I was sure that you were willing to help me...") ) ) { advanceQuest(); @@ -159,22 +141,18 @@ function QuestPart1 { } 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."); - } + 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..."), + l("Come on, stop wasting my time!") + ) + ){ + // 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; @@ -188,16 +166,16 @@ 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)); + mesq l("Fine. The land is healthy now but nothing will grow yet."); + mesq l("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("Have you got what I 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!") + l("I can't give you nothing if you don't leave some room for it!"), + l("Come on, don't give up. We are already done with it.") ) ) { advanceQuest(); @@ -215,23 +193,18 @@ function QuestPart3 { } 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."); - } + 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!"), + l("Come on, stop wasting my time!") + ) + ) { + // 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; @@ -282,8 +255,8 @@ function QuestPart5 { 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])) + 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!"); @@ -304,29 +277,28 @@ 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!") - )) { - Zeny-=(.REQ3_COST); - advanceQuest(); - } - } else { - mesq l("Ain't working for free, pal!"); + if(Zeny>=.REQ3_COST) { + if(NPCcrafting( + .REQ3_INGREDIENTS, .REQ3_INGREDIENTS_AMOUNT, + .REQ3_OUTPUT, .REQ3_OUTPUT_AMOUNT, + 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) + ), + 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!"), + l("Ain't working for free, pal!") + ) + ){ + Zeny-=(.REQ3_COST); + advanceQuest(); } + } else { + mesq l("Hello! I will exchange %d %s and %d GP for a %s if only you had more money.", + .REQ3_INGREDIENTS_AMOUNT[0], getitemlink(.REQ3_INGREDIENTS[0]), + .REQ3_COST, getitemlink(.REQ3_OUTPUT) + ); } close; return; diff --git a/npc/008-1-1/hal.txt b/npc/008-1-1/hal.txt index 88b93a79..61572f8e 100644 --- a/npc/008-1-1/hal.txt +++ b/npc/008-1-1/hal.txt @@ -54,7 +54,7 @@ function QuestPart1 { 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("Hmm... 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); @@ -66,24 +66,23 @@ function QuestPart1 { } 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!") - ) + 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!"), + l("Hmpf... Civilians...") ) - { - 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."); - } + ) + { + 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."); } } diff --git a/npc/functions/libquest.txt b/npc/functions/libquest.txt index 4799eb1d..cb5996dc 100644 --- a/npc/functions/libquest.txt +++ b/npc/functions/libquest.txt @@ -3,102 +3,106 @@ // 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 + @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; + for (.@i = 0; .@i < getarraysize(getarg(0)); .@i++) { + mesf("%d/%d %s", countitem(getelementofarray(getarg(0), .@i)), 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 + @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; + 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 + @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 input parameter amount + if (getargcount() != 4) return 255; - // Check item amounts - if (!checkForItems(getarg(0), getarg(1))) return 1; + // 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)); + // 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)); - } + // 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; + 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 + @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 + @param NPC answer if player doesn't accept + @returns true if successful + @note returns false in case of wrong parameter count */ 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; + // Check input parameter amount + if (getargcount() != 9) return false; + speech getarg(4); + printIngredients(getarg(0), getarg(1)); + if (askyesno() == ASK_NO) { + mesq getarg(8); + 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); + case 1: + mesq getarg(6); // FIXME - Gather proper variables - printIngredients(getarg(0), getarg(1)); - break; + printIngredients(getarg(0), getarg(1)); + break; - case 2: - mesq getarg(7); - break; + case 2: + mesq getarg(7); + break; - case 255: - mesq l("[BUG ENCOUNTERED] Dammit..."); - break; + case 255: + mesq l("[BUG ENCOUNTERED] Dammit..."); + break; - default: - } - } - return false; + default: + } + } + return false; }
\ No newline at end of file |