summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-rw-r--r--npc/024-1/_import.txt1
-rw-r--r--npc/024-1/john.txt208
-rw-r--r--npc/functions/random-talk.txt3
-rw-r--r--npc/functions/util.txt6
4 files changed, 216 insertions, 2 deletions
diff --git a/npc/024-1/_import.txt b/npc/024-1/_import.txt
index 958396496..8b4f2df07 100644
--- a/npc/024-1/_import.txt
+++ b/npc/024-1/_import.txt
@@ -4,6 +4,7 @@
"npc/024-1/_warps.txt",
"npc/024-1/erlan.txt",
"npc/024-1/guard.txt",
+"npc/024-1/john.txt",
"npc/024-1/mapflags.txt",
"npc/024-1/meriel.txt",
"npc/024-1/rydel.txt",
diff --git a/npc/024-1/john.txt b/npc/024-1/john.txt
new file mode 100644
index 000000000..8fa2559e8
--- /dev/null
+++ b/npc/024-1/john.txt
@@ -0,0 +1,208 @@
+// TMW2 scripts.
+// Author:
+// Jesusalva
+// Description:
+// John H
+
+024-1,154,45,0 script Jhon Henryfield NPC_PLAYER,{
+ if (BaseLevel < 42) {
+ asleep();
+ end;
+ }
+ .@q=getq(FrostiaQuest_JhonH);
+
+ // Quest failed
+ if (.@q == 8) {
+ mesn;
+ mesq l("Go away creep, I HATE YOU!");
+ close;
+ }
+
+ if (!.@q) {
+ mesn;
+ mesc l("ZZZzzzz...");
+ mesc l("%s seems to be asleep... Maybe we can wake him up somehow?", .name$);
+ next;
+ do
+ {
+ select
+ l("Poke him"),
+ l("Attack him"),
+ l("Give him an item");
+ mes "";
+ if (@menu == 1) {
+ mesc l("No reply. We should try something else.");
+ next;
+ } else if (@menu == 2) {
+ mesn;
+ mesc l("*Opening eyes in a shock*");
+ mesq l("AAAAaaahhhhh!!!");
+ setq FrostiaQuest_JhonH, 8; // Quest failed
+ close;
+ } else {
+ mes "##B" + l("Drag and drop an item from your inventory.") + "##b";
+
+ .@give = requestitem();
+ if (.@give < 1) continue;
+ if (!countitem(.@give)) continue;
+ if (checkbound(.@give)) continue;
+ if (getiteminfo(.@give, ITEMINFO_TYPE) != IT_HEALING &&
+ getiteminfo(.@give, ITEMINFO_TYPE) != IT_USABLE) continue;
+ mesc l("Really give a %s to Jhon?", getitemlink(.@give));
+ mesc l("The item will be lost forever."), 1;
+ next;
+ if (askyesno() == ASK_NO) continue;
+ mes "";
+ delitem .@give, 1;
+ if (.@give == Coffee) {
+ setq FrostiaQuest_JhonH, 1;
+ .@q = 1;
+ getexp 250, 25;
+ mesn;
+ mesq l("Coffee! I'm awake now!");
+ next;
+ break;
+ } else {
+ mesc l("...No reaction...");
+ next;
+ }
+ }
+ } while (true);
+ }
+ ///////////////////////////
+ if (!.@q) close;
+ do
+ {
+ mesn;
+ mesq l("How can I help you, my friend?");
+ next;
+ select
+ l("Who are you?"),
+ rif(.@q >= 2 && countitem(Coffee), l("Do you want more coffee?")),
+ l("Nothing, thanks anyway.");
+ mes "";
+ switch (@menu) {
+ case 1:
+ mesn;
+ mesq l("Name is Jhon, and that's not a typo! I am an absolute coffee lover, and I travel to exotic places in search of the perfect brew.");
+ next;
+ mesn;
+ mesq l("Unfortunately, elves doesn't like to share coffee, so I thought in leaving but fell asleep. Oops!");
+ next;
+ mesn;
+ mesq l("If you have some coffee to me, I'll buy it of your hands.");
+ compareandsetq FrostiaQuest_JhonH, 2;
+ .@q = max(.@q, 2);
+ next;
+ break;
+ case 2:
+ mesc l("How much coffee you'll give Jhon?");
+ input .@c, 0, countitem(Coffee);
+ mes "";
+ .@c = min(.@c, countitem(Coffee));
+ if (.@c < 1) break;
+ delitem Coffee, .@c;
+ .@q2 = getq2(FrostiaQuest_JhonH) + .@c;
+ .@q3 = getq3(FrostiaQuest_JhonH);
+ setq2 FrostiaQuest_JhonH, .@q2;
+ .@xp = 250 + rand2(getiteminfo(Coffee, ITEMINFO_SELLPRICE) / 3);
+ .@gp = getiteminfo(Coffee, ITEMINFO_SELLPRICE) * 2 / 3; // 67% GP
+ Zeny += .@c * .@gp;
+ getexp .@c * .@xp, .@c * 25; // ~33% EXP + bonus
+ mesn;
+ mesq lg("Thanks, gal!", "Thanks, pal!");
+ next;
+ switch (.@q3) {
+ case 0:
+ if (.@q2 >= 1) {
+ inventoryplace Potatoz, 1;
+ getitem Potatoz, 1;
+ setq3 FrostiaQuest_JhonH, .@q3 + 1;
+ }
+ break;
+ case 1:
+ if (.@q2 >= 5) {
+ inventoryplace IcedBottle, 1;
+ getitem IcedBottle, 1;
+ setq3 FrostiaQuest_JhonH, .@q3 + 1;
+ }
+ break;
+ case 2:
+ if (.@q2 >= 10) {
+ inventoryplace ScrollBattlePlansA, 1;
+ getitem ScrollBattlePlansA, 1;
+ setq3 FrostiaQuest_JhonH, .@q3 + 1;
+ }
+ break;
+ case 3:
+ if (.@q2 >= 15) {
+ inventoryplace ScrollDefenseBlessA, 1;
+ getitem ScrollDefenseBlessA, 1;
+ setq3 FrostiaQuest_JhonH, .@q3 + 1;
+ }
+ break;
+ case 4:
+ if (.@q2 >= 20) {
+ inventoryplace ScrollSYeti, 1;
+ getitem ScrollSYeti, 1;
+ setq3 FrostiaQuest_JhonH, .@q3 + 1;
+ }
+ break;
+ case 5:
+ if (.@q2 >= 25) {
+ inventoryplace AlchemyBlueprintA, 1;
+ getitem AlchemyBlueprintA, 1;
+ setq3 FrostiaQuest_JhonH, .@q3 + 1;
+ }
+ break;
+ case 6:
+ if (.@q2 >= 30) {
+ inventoryplace AlchemyBlueprintB, 1;
+ getitem AlchemyBlueprintB, 1;
+ setq3 FrostiaQuest_JhonH, .@q3 + 1;
+ }
+ break;
+ case 7:
+ if (.@q2 >= 40) {
+ inventoryplace AlchemyBlueprintC, 1;
+ getitem AlchemyBlueprintC, 1;
+ setq3 FrostiaQuest_JhonH, .@q3 + 1;
+ }
+ break;
+ case 8:
+ if (.@q2 >= 50) {
+ inventoryplace AlchemyBlueprintD, 1;
+ getitem AlchemyBlueprintD, 1;
+ setq3 FrostiaQuest_JhonH, .@q3 + 1;
+ }
+ break;
+ }
+ // Item acquired?
+ if (getq3(FrostiaQuest_JhonH) != .@q3) {
+ mesn;
+ mesq l("Here, you can have this, token of my appreciation.");
+ next;
+ }
+ break;
+ default:
+ .@q = 12; break;
+ }
+ } while (.@q < 8);
+
+ closeclientdialog;
+ goodbye;
+ close;
+
+OnInit:
+ .@npcId = getnpcid(.name$);
+ setunitdata(.@npcId, UDT_HEADTOP, AFKCap);
+ setunitdata(.@npcId, UDT_HEADMIDDLE, SilkRobe); // TODO
+ setunitdata(.@npcId, UDT_WEAPON, DeepBlackBoots);
+ setunitdata(.@npcId, UDT_HAIRSTYLE, 22);
+ setunitdata(.@npcId, UDT_HAIRCOLOR, 5);
+ npcsit;
+
+ .sex = G_MALE;
+ .distance = 4;
+ end;
+}
diff --git a/npc/functions/random-talk.txt b/npc/functions/random-talk.txt
index 4040b0fae..44fa9b255 100644
--- a/npc/functions/random-talk.txt
+++ b/npc/functions/random-talk.txt
@@ -182,11 +182,12 @@ function script legiontalk {
}
function script asleep {
- switch(rand2(5)) {
+ switch(rand2(6)) {
case 0: npctalkonce(l("Zzzzzzzzz...")); break;
case 1: npctalkonce(l("Rrrr... Pchhhh...")); break;
case 2: npctalkonce(l("Ggrmm... Grmmmm...")); break;
case 3: npctalkonce(l("Hm... Shhhh...")); break;
+ case 4: npctalkonce(l("ZZZzzzz...")); break;
default: emotion(E_SLEEPY);
}
end;
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index 5f2cfac2d..67d14bbea 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -503,8 +503,12 @@ function script reputation {
if (getq(FrostiaQuest_Saevel) >= 2)
.@nr=.@nr+1;
+ // Jhon H's Quest (+1 rep)
+ if (getq(FrostiaQuest_JohnH) >= 1)
+ .@nr=.@nr+1;
+
// FROSTIA Magical Forumula
- .@nr=.@nr*100/10;
+ .@nr=.@nr*100/11;