// TMW2/LOF Script.
// Author:
// Jesusalva
// Description:
// Part from the EPISODE and the Well Quest
// TODO: Walking NPC, clothes, etc;
019-1-1,41,24,0 script Miler NPC_PLAYER,{
.@q=getq(LoFQuest_EPISODE);
.@w=getq(NivalisQuest_Well);
// Force players upon Cordo quest
if (!THIEF_RANK && !MERC_RANK)
goto L_Rejected;
mesn;
if (MERC_RANK)
mesq l("Hello, @@.", mercrank());
else
mesq l("Hello, @@.", thiefrank());
mes "";
menu
l("Hello."), -,
rif(.@w == 1, l("I need help.")), L_Well,
rif(.@q == 3 && countitem(HerbalTea), l("The Doctor sent you some tea.")), L_Doctor,
rif(.@q == 5 && countitem(PresentBox), l("I have a present box to you open.")), L_Box,
rif(.@q == 4, l("So, could I help you?")), L_Quest;
close;
// Well Quest Subplot
L_Well:
mes "";
mesn;
mesq l("What's the problem?");
next;
select
l("Someone fell into the well.");
mes "";
mesn;
mesq l("Ho! I'll help them!");
getexp (BaseLevel * 111), 0;
setq NivalisQuest_Well, 2;
close;
// Well Quest Subplot
L_Doctor:
mes "";
delitem HerbalTea, 1;
getexp 111, 11;
setq LoFQuest_EPISODE, 4;
mesn;
mesq l("Many thanks, the Doctor always know what's best for you."); // you or your health? Are you sure?
next;
mesn;
mesq l("Lemme just fetch a small something for you....");
next;
mesn;
mesq l("Oh dear, oh dear, where could I have possibly left it?!");
close;
// Not on Cordo quest
L_Rejected:
mesn;
mesq l("Hey, did you know there are two mouboos which constantly fight against themselves?!");
next;
mesn;
mesq l("One claims to be a constable and teach people to sell high and buy low.");
mesq l("The other one claims to be a dangerous bandit and to teach how to steal from monsters!");
next;
mesn;
mesq l("Well, I heard you needed to have some Job levels to sign up with them, and couldn't resign later.");
mesq l("But it is a so silly fight, that whoever you join with shouldn't do much difference.");
next;
mesn;
mesq l("Anyway, I heard both were disciples from Cordo-whatever, a powerful person from LoF Village.");
mesq l("I think you should get initiated on any side before speaking to me again.");
close;
// Main Quest
L_Quest:
mes "";
mesn;
mesq l("I lost the precious ring they gave me as a gift... Who could have taken it...?");
next;
mesn;
mesq l("...Of course. It was THEM. It gotta to be them!");
next;
mesn strcharinfo(0);
select l("'Them' whom?");
mes "";
mesn;
mesq l("They came in the night, always taking what does not belong to them.... The SLIMES!");
next;
mesn;
mesq l("The ones around here are specially nasty. They steal stuff and seal them on 'present boxes', just to amuse as people try to open those...");
next;
mesn;
mesq l("...But worry not, I have the right screwdriver for the job. So, are you up to bring me some Present Boxes?");
next;
mesn strcharinfo(0);
select
l("Yes, I'll help you."),
l("Nah, not now. Slimes ruin your clothes, after all.");
mes "";
if (@menu == 2) {
mesn;
mesq l("Ah, I see, I imagine you'll wear something different then... But please come back.");
close;
}
setq LoFQuest_EPISODE, 5, 0;
mesn;
mesq l("Great, just bring me several boxes, once one of them have the ring I'm looking for.");
close;
// Loop
L_Box:
inventoryplace NPCEyes, 1;
.@q2=getq2(LoFQuest_EPISODE);
delitem PresentBox, 1;
setq2 LoFQuest_EPISODE, .@q2+1;
mesn;
mesc l("@@ uses his screwdriver and open the sealed gift box like a pro.", .name$);
if (.@q2 >= 70)
goto L_Success;
mesc l("But the box was empty.");
// Try again!
if (countitem(PresentBox)) {
mesn;
mesq l("You have more boxes. Wanna try again?");
if (askyesno() == ASK_YES)
goto L_Box;
}
close;
// Quest Complete
L_Success:
setq LoFQuest_EPISODE, 6, 0;
mesc l("His golden ring pops right out of it.");
next;
mesn;
mesq l("Many thanks. I couldn't live without it. Please come back later.");
close;
OnInit:
.@npcId = getnpcid(0, .name$);
setunitdata(.@npcId, UDT_HEADTOP, KnitHat);
setunitdata(.@npcId, UDT_HEADMIDDLE, CreasedShirt);
setunitdata(.@npcId, UDT_HEADBOTTOM, NPCEyes);
setunitdata(.@npcId, UDT_WEAPON, JeansShorts);
setunitdata(.@npcId, UDT_HAIRSTYLE, rand(2,15));
setunitdata(.@npcId, UDT_HAIRCOLOR, rand(4,14));
.sex = G_MALE;
.distance = 5;
end;
}