// 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, 1, 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) + rand2(.@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) {
.@i = any(LukPotionA, DexPotionA, IntPotionA, VitPotionA, AgiPotionA);
inventoryplace .@i, 1;
getitem .@i, 1;
setq3 FrostiaQuest_JhonH, .@q3 + 1;
}
break;
case 8:
if (.@q2 >= 50) {
inventoryplace AlchemyBlueprintC, 1;
getitem AlchemyBlueprintC, 1;
setq3 FrostiaQuest_JhonH, .@q3 + 1;
}
break;
case 9:
if (.@q2 >= 60) {
.@i = any(LukPotionC, DexPotionC, IntPotionC, VitPotionC, AgiPotionC, SacredLifePotion, SacredManaPotion);
inventoryplace .@i, 1;
getitem .@i, 1;
setq3 FrostiaQuest_JhonH, .@q3 + 1;
}
break;
case 10:
if (.@q2 >= 75) {
inventoryplace AlchemyBlueprintD, 1;
getitem AlchemyBlueprintD, 1;
setq3 FrostiaQuest_JhonH, .@q3 + 1;
}
break;
case 11:
if (.@q2 >= 90) {
inventoryplace AncientBlueprint, 1;
getitem AncientBlueprint, 1;
setq3 FrostiaQuest_JhonH, .@q3 + 1;
}
break;
case 12:
if (.@q2 >= 100) {
.@i = any(LukPotionB, DexPotionB, IntPotionB, VitPotionB, AgiPotionB, SacredLifePotion, SacredManaPotion, DodgePotion, PrecisionPotion, MoveSpeedPotion, StatusResetPotion, DeathPotion, PurificationPotion, NymphPoison, ElixirOfLife);
inventoryplace .@i, 1;
getitem .@i, 1;
setq3 FrostiaQuest_JhonH, .@q3 + 1;
}
break;
case 13:
if (.@q2 >= 120) {
.@i = any(LukPotionC, DexPotionC, IntPotionC, VitPotionC, AgiPotionC, SacredLifePotion, SacredManaPotion, DodgePotion, PrecisionPotion, MoveSpeedPotion, StatusResetPotion, DeathPotion, PurificationPotion, NymphPoison, ElixirOfLife);
inventoryplace .@i, 1;
getitem .@i, 1;
setq3 FrostiaQuest_JhonH, .@q3 + 1;
}
break;
case 14:
if (.@q2 >= 140) {
.@i = any(LukPotionC, DexPotionC, IntPotionC, VitPotionC, AgiPotionC, SacredLifePotion, SacredManaPotion, DodgePotion, PrecisionPotion, MoveSpeedPotion, StatusResetPotion, DeathPotion, PurificationPotion, NymphPoison, ElixirOfLife, SacredImmortalityPotion, Manapple);
inventoryplace .@i, 1;
getitem .@i, 1;
setq3 FrostiaQuest_JhonH, .@q3 + 1;
}
break;
case 15:
if (.@q2 >= 150) {
.@i = any(LukPotionC, DexPotionC, IntPotionC, VitPotionC, AgiPotionC, SacredLifePotion, SacredManaPotion, DodgePotion, PrecisionPotion, MoveSpeedPotion, StatusResetPotion, DeathPotion, PurificationPotion, NymphPoison, ElixirOfLife, SacredImmortalityPotion, AncientBlueprint, FrostiaWarpCrystal);
inventoryplace .@i, 1;
getitem .@i, 1;
setq3 FrostiaQuest_JhonH, .@q3 + 1;
}
break;
case 16:
if (.@q2 >= 175) {
.@i = any(LukPotionC, DexPotionC, IntPotionC, VitPotionC, AgiPotionC, SacredLifePotion, SacredManaPotion, DodgePotion, PrecisionPotion, MoveSpeedPotion, StatusResetPotion, NymphPoison, ElixirOfLife, SacredImmortalityPotion, AncientBlueprint, FrostiaWarpCrystal, ScrollCriticalFortuneA);
inventoryplace .@i, 1;
getitem .@i, 1;
setq3 FrostiaQuest_JhonH, .@q3 + 1;
}
break;
case 17:
if (.@q2 >= 200) {
.@i = any(LukPotionC, DexPotionC, IntPotionC, VitPotionC, AgiPotionC, SacredLifePotion, SacredManaPotion, ElixirOfLife, SacredImmortalityPotion, AncientBlueprint, FrostiaWarpCrystal, ScrollCriticalFortuneA, ScrollMagnusHealA, ScrollSWolvern);
inventoryplace .@i, 1;
getitem .@i, 1;
setq3 FrostiaQuest_JhonH, .@q3 + 1;
}
break;
case 18:
if (.@q2 >= 250) {
.@i = any(LukPotionC, DexPotionC, IntPotionC, VitPotionC, AgiPotionC, SacredLifePotion, SacredManaPotion, ElixirOfLife, SacredImmortalityPotion, AncientBlueprint, FrostiaWarpCrystal, ScrollCriticalFortuneA, ScrollMagnusHealA, ScrollSWolvern);
inventoryplace .@i, 1;
getitem .@i, 1;
setq3 FrostiaQuest_JhonH, .@q3 + 1;
}
break;
case 19:
if (.@q2 >= 300) {
.@i = any(LukPotionC, DexPotionC, IntPotionC, VitPotionC, AgiPotionC, SacredLifePotion, SacredManaPotion, SacredImmortalityPotion, AncientBlueprint, FrostiaWarpCrystal, ScrollCriticalFortuneA, ScrollMagnusHealA, ScrollSWolvern, GoldenApple);
inventoryplace .@i, 1;
getitem .@i, 1;
setq3 FrostiaQuest_JhonH, .@q3 + 1;
}
break;
case 20:
if (.@q2 >= 400) {
.@i = any(SacredImmortalityPotion, AncientBlueprint, FrostiaWarpCrystal, ScrollCriticalFortuneA, ScrollMagnusHealA, ScrollSWolvern, PirateTreasureMap, TimeFlask);
inventoryplace .@i, 1;
getitem .@i, 1;
setq3 FrostiaQuest_JhonH, .@q3 + 1;
}
break;
case 21:
if (.@q2 >= 450) {
.@i = any(ScrollCriticalFortuneB, ScrollBattlePlansB, ScrollDefenseBlessB, ScrollMagnusHealB, ScrollSDragon, GoldenApple);
inventoryplace .@i, 1;
getitem .@i, 1;
setq3 FrostiaQuest_JhonH, .@q3 + 1;
}
break;
case 22:
if (.@q2 >= 500) {
.@i = any(ScrollCriticalFortuneB, ScrollBattlePlansB, ScrollDefenseBlessB, ScrollMagnusHealB, ScrollSDragon, DivineApple);
inventoryplace .@i, 1;
getitem .@i, 1;
setq3 FrostiaQuest_JhonH, .@q3 + 1;
mesc l("You have reached the current reward limit for Jhon."), 1;
//mesc l("Futurely, Mylarin Dust and a Sunny Crystal will also be available."); // And a Mysterious Fruit + Platinum, just like Ryan
}
break;
// The Bitter Bullet: Contribute some to Ryan progress
// Erases partly the progress here
case 23:
// Tonori Delight is 50 gp and Coffee is 500 gp, but Coffee can
// be bought, so it is treated equally here
.@surplus = .@q2 - 500;
// Verify if Ryan is willing to accept or if Ryan has specials
.@ryan=getq2(HalinarzoQuest_LifeDelight);
if (.@ryan >= 99) break; // There's nothing else
if (.@ryan <= 20 ||
.@ryan == 29 ||
.@ryan == 39 ||
//.@ryan == 49 ||
//.@ryan == 50 ||
.@ryan == 59 ||
.@ryan == 69 ||
.@ryan == 79 ||
.@ryan == 89 ||
.@ryan >= 92) {
mesc l("I should talk to Ryan instead; no progress will be gained otherwise.");
next;
break;
}
// Calculate the amount Ryan would charge for next step
if (.@ryan < 40)
.@a=400+18*(.@ryan-24);
else if (.@ryan < 50)
.@a=670+10*(.@ryan-39);
else
.@a=780+(.@ryan*(.@ryan < 75 ? 1 : 2));
// Ryan is willing; however, we eliminate ALL THE SURPLUS
// Then we advance Ryan stage WITHOUT ANY REWARD.
if (.@surplus >= .@a) {
setq2 FrostiaQuest_JhonH, 500;
setq2 HalinarzoQuest_LifeDelight, .@ryan+1;
mesn;
mesq l("Oooh, thanks, thanks! I'll let my brother Ryan know how cool you are, he lives in Halinarzo and is a %s addict!", getitemlink(TonoriDelight));
}
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;
}