summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Hulka <sean.hulka@gmail.com>2020-01-14 20:27:39 -0300
committerJesusaves <cpntb1@ymail.com>2020-01-14 20:27:39 -0300
commit8d4105a03c463bf355db998117e6fd60481490b4 (patch)
tree104ad11eed017fe8666e3665817737e06fba2f82
parentd741325eff425cfffe82aeb954fb6d69b1752618 (diff)
downloadserverdata-8d4105a03c463bf355db998117e6fd60481490b4.tar.gz
serverdata-8d4105a03c463bf355db998117e6fd60481490b4.tar.bz2
serverdata-8d4105a03c463bf355db998117e6fd60481490b4.tar.xz
serverdata-8d4105a03c463bf355db998117e6fd60481490b4.zip
Duck Grand Hunter Quest
-rw-r--r--npc/003-1/sarah.txt120
-rw-r--r--npc/functions/mobhunter.txt6
2 files changed, 74 insertions, 52 deletions
diff --git a/npc/003-1/sarah.txt b/npc/003-1/sarah.txt
index c46a66c87..4cea8e71e 100644
--- a/npc/003-1/sarah.txt
+++ b/npc/003-1/sarah.txt
@@ -1,77 +1,96 @@
// TMW2 Script
// Author:
// Saulc
+// Jesusalva
+// DangerDuck
// Description:
// Random NPC without any purpose but to give SerfHat. Uh.
// TODO: Could be repeatable quest (eg. 60 GP for a cake every day, so you can have a 10 GP profit selling cakes)
003-1,90,144,0 script Sarah NPC_FEMALE,{
+ function quest_completed;
+ function quest_open;
+ function quest_started;
+ function AssignGHQ;
- function quest_completed {
- speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
- l("It was so tasty, I can't eat anything more... Thank you.");
- close;
- }
+ // Main Loop
+ do
+ {
+ .@q = getq(TulimsharQuest_Sarah);
+ if (.@q == 1)
+ quest_completed();
+ select
+ rif(!.@q, l("Hello, I'm new here! Can I help you?")),
+ menuaction(l("Quit"));
- function quest_open {
- if (countitem(.cake) >= 5) {
- speech S_FIRST_BLANK_LINE,
- l("You brought me 5 @@ ! Here is your @@, as promised.",getitemlink(.cake), getitemlink(.reward));
- delitem .cake,5;
- getitem .reward,1;
- getexp 80, 2;
- setq TulimsharQuest_Sarah, 1;
- close;
- } else {
- speech S_FIRST_BLANK_LINE,
- l("Sorry, that is not the cake I love.");
- close;
+ switch (@menu) {
+ case 1:
+ quest_started();
+ break;
}
- }
+ } while (@menu != 2);
- function quest_started {
- speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
- l("Oh, Welcome then.");
- speech S_LAST_NEXT,
- l("Can you bring me 5 pieces of Cherry Cake? Pretty please?");
- do
- {
- select
- l("Here they are!"),
- menuaction(l("Quit"));
+ closedialog;
+ goodbye;
+ close;
- switch (@menu) {
- case 1:
- quest_open;
- break;
- case 2:
- mesc l("Protip: @@ is dropped by @@. It is a tough monster, you might need some strategy to kill it. @@ can be bought in shops.", getitemlink(CherryCake), getmonsterlink(GiantMaggot));
- next;
- break;
- }
- } while (@menu != 2);
- }
+// Quest completed
+function quest_completed {
+ speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
+ l("It was so tasty, I can't eat anything more... Thank you.");
+ AssignGHQ();
+ return;
+}
+// Quest Core
+function quest_started {
+ speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
+ l("Oh, Welcome then.");
+ speech S_LAST_NEXT,
+ l("Can you bring me 5 pieces of Cherry Cake? Pretty please?");
do
{
- .@chest = getq(TulimsharQuest_Sarah);
- if (.@chest == 1)
- goto quest_completed;
select
- rif(.@chest == 0,
- l("Hello, I'm new here! Can I help you?")),
+ l("Here they are!"),
menuaction(l("Quit"));
switch (@menu) {
case 1:
- quest_started;
+ quest_open();
+ break;
+ case 2:
+ mesc l("Protip: @@ is dropped by @@. It is a tough monster, you might need some strategy to kill it. @@ can be bought in shops.", getitemlink(CherryCake), getmonsterlink(GiantMaggot));
+ mesc l("%s can also be obtained from %s, at a lower drop rate.", getitemlink(CherryCake), getmonsterlink(Duck));
+ next;
break;
}
} while (@menu != 2);
+ return;
+}
- closedialog;
- goodbye;
- close;
+// Quest check
+function quest_open {
+ if (countitem(CherryCake) >= 5) {
+ speech S_FIRST_BLANK_LINE,
+ l("You brought me 5 @@ ! Here is your @@, as promised.",getitemlink(CherryCake), getitemlink(SerfHat));
+ delitem CherryCake,5;
+ getitem SerfHat,1;
+ getexp 80, 2;
+ setq TulimsharQuest_Sarah, 1;
+ close;
+ } else {
+ speech S_FIRST_BLANK_LINE,
+ l("Sorry, that is not the cake I love.");
+ close;
+ }
+ return;
+}
+
+// Grand Hunter Quest (post-quest)
+function AssignGHQ {
+ GHQ_Assign(Duck, "Holiday");
+ end;
+}
OnInit:
.@npcId = getnpcid(.name$);
@@ -82,9 +101,6 @@ OnInit:
setunitdata(.@npcId, UDT_HAIRSTYLE, 19);
setunitdata(.@npcId, UDT_HAIRCOLOR, 16);
- .cake = CherryCake;
- .reward = SerfHat;
-
.sex = G_FEMALE;
.distance = 5;
end;
diff --git a/npc/functions/mobhunter.txt b/npc/functions/mobhunter.txt
index 11681a998..ce68ec0e5 100644
--- a/npc/functions/mobhunter.txt
+++ b/npc/functions/mobhunter.txt
@@ -29,6 +29,9 @@ function script GHQ_GetQuestIDByMonsterID {
case MountainSnake:
return 8;
break;
+ case Duck:
+ return 9;
+ break;
default:
return Exception("GHQ GQID: Invalid ID: "+getarg(0), RB_DEFAULT^RB_PLEASEREPORT|RB_ISFATAL);
break;
@@ -63,6 +66,9 @@ function script GHQ_GetMonsterIDByQuestID {
case 8:
return MountainSnake;
break;
+ case 9:
+ return Duck;
+ break;
default:
return Exception("GHQ GMID: Invalid ID: "+getarg(0), RB_DEFAULT^RB_PLEASEREPORT|RB_ISFATAL);
break;