// TMW2 Script
// Author:
// TMW Org.
// Jesusalva
// Description:
// Part of Anwar Field quest
// movement: 0 a c k b r f i b d m a o p b q g a h l b j n b f s
// loc: a93.84 b95.83 c84.60 d 93.64 e 87.78 f 94.80 g89.82 H105.78 I130.73 J109.69 K117.64 L114
004-1,107,67,0 script Anwar NPC_RAIJIN,{
.@q=getq(TulimsharQuest_AnwarField);
if (BaseLevel < 18) goto L_Weak;
if (.@q > 10) goto L_Complete;
if (.@q == 10) goto L_SecondReward;
if (.@q == 9) goto L_FirstReward;
if (.@q == 8) goto L_SecondTry;
if (.@q == 7) goto L_AnwarField;
if (.@q == 6) goto L_FirstTry;
if (.@q == 5) goto L_TryIt;
if (.@q >= 1) goto L_FirstTry;
mesn;
mesq l("Hi. Could you perhaps be interested in doing some small errand for me?");
menu
l("Sure!"),L_Sure,
l("I'm busy, sorry."),L_Close;
L_Complete:
mesn;
mesq l("Thanks for saving Tulimshar from a famine. I'll be forever grateful.");
next;
mesn;
mesq l("Dealing with elves is too bothersome to me.");
close;
L_AnwarField:
mesn;
mesq l("My crops! Hurry up, and talk to Eomie!!");
close;
L_Sure:
mes "";
mesn;
mesq l("Great! Eomie, the girl on Tulimshar's magic academy, is an alchemist. She probably makes fertilizers.");
next;
mesn;
mesq l("This farm is dying due constant monster attacks, and without them, Tulimshar might face a famine.");
next;
mesn;
mesq l("Please, talk to her. Maybe she understands the direness of the situation and help... But you know. Elves.");
setq TulimsharQuest_AnwarField, 1;
close;
L_FirstTry:
mesn;
mesq l("Good luck getting the fertilizer from Eomie! Many elves simply refuse to cooperate until it affects them directly.");
close;
L_TryIt:
.@q2=getq2(TulimsharQuest_AnwarField);
mesn;
mesq l("You've brought me fertilizer! Let me see if it works...");
next;
setq2 TulimsharQuest_AnwarField, .@q2+1;
// Fail chances are 100% - 12% per attempt
if (rand(0,100) < 100-(.@q2*12)) {
setq1 TulimsharQuest_AnwarField, 6;
mesc l("Nothing happens.");
next;
mesn;
mesq l("Uh... Something should happen, right? Can you get another one?");
} else {
setq1 TulimsharQuest_AnwarField, 7;
mesc l("Evil worms crawl from earth and starts devouring the plants!");
next;
mesn;
mesq l("Uh... That should not happen, right? RIGHT?");
next;
mesn;
mesq l("Don't just stand here! Go fetch help, NOW!!");
}
close;
L_SecondTry:
mesn strcharinfo(0);
mesq l("Here is the bug bomb! Eomie just gave me. Hurry up!");
next;
getexp 20, 0;
specialeffect(51);
setq TulimsharQuest_AnwarField, 9;
mesn;
mesq l("Thanks God... The crops are safe. Not only that, but the fertilizer works!");
next;
mesn;
mesq l("Ah, that was tiresome... I'll go make a reward for them, talk to me again later.");
close;
L_FirstReward:
mesn;
mesq l("Here are two @@. Please deliver it to them. I hope they'll like it.", getitemlink(TortugaShell));
setq TulimsharQuest_AnwarField, 10, 0;
getitembound(TortugaShell, 2, 4); // Prevent accidental item loss
close;
L_SecondReward:
.@q2=getq2(TulimsharQuest_AnwarField);
if (.@q2 < 3){
mesn;
mesq l("Please deliver the two @@ to Tinris and Eomie, and then I'll give you something for your help.", getitemlink(TortugaShell));
close;
}
setq TulimsharQuest_AnwarField, 11, 0;
getitem2(CottonTrousers, 1, 1, 0, 0, OrangeDye, 0,0,0); // EXPERIMENTAL, required for Inspector Quest
getexp 100, 0;
mesn;
mesq l("Many thanks for your help! Here, take this. I'm sure it can be very useful later. It always is.");
close;
L_Weak:
hello;
end;
L_Close:
close;
OnInit:
.@npcId = getnpcid(0, .name$);
//setunitdata(.@npcId, UDT_HEADTOP, 2929); // TODO: This NPC is an Elf and therefore, CANNOT use NPCEyes.
setunitdata(.@npcId, UDT_HEADMIDDLE, ArtisTankTop);
setunitdata(.@npcId, UDT_HEADBOTTOM, CottonTrousers);
setunitdata(.@npcId, UDT_WEAPON, DeepBlackBoots); // Boots
setunitdata(.@npcId, UDT_HAIRSTYLE, 6);
setunitdata(.@npcId, UDT_HAIRCOLOR, 14);
.sex = G_MALE;
.distance = 4;
end;
}