summaryrefslogtreecommitdiff
path: root/npc/024-1/john.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-01-05 14:21:00 -0300
committerJesusaves <cpntb1@ymail.com>2022-01-05 14:21:00 -0300
commit72599e615cfc3f4df4b9c502c8fd91fcebfe3250 (patch)
tree498b524394e45ee9462ffac9c86eb97e9b0140d7 /npc/024-1/john.txt
parentea428820c96402613a8b8c6c88328b8bf34db1be (diff)
downloadserverdata-72599e615cfc3f4df4b9c502c8fd91fcebfe3250.tar.gz
serverdata-72599e615cfc3f4df4b9c502c8fd91fcebfe3250.tar.bz2
serverdata-72599e615cfc3f4df4b9c502c8fd91fcebfe3250.tar.xz
serverdata-72599e615cfc3f4df4b9c502c8fd91fcebfe3250.zip
Add Jhon H's Quest
Diffstat (limited to 'npc/024-1/john.txt')
-rw-r--r--npc/024-1/john.txt208
1 files changed, 208 insertions, 0 deletions
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;
+}