// TMW2 Scripts.
//
// TMW-BR Original Authors:
// Programmer: Adson Renato
// Texts: Arkanjo
// Review: Jesusalva
//
// Authors:
// Jesusalva
// Description:
// Stowaway hidden in a ship's hole. Contrabandist. Trade potions, dyes,
// food, water, and money for an item.
// In BR originals requested a four leaf clover to do luck magic, in order to not be caught.
// That would imply teaching a new skill, and I'm not felling like it, so I removed.
002-1,45,26,0 script Alige NPC_ALIGE,{
.@q=getq(ShipQuests_Alige);
if (.@q == 1) goto L_Return;
mesn;
mesq lg("Hey, dude! The guards are after me. I need your help, and I can reward you.");
next;
mesn strcharinfo(0);
menu
l("Guaaaards! Sailors! Help! We have a stowaway!"), L_Revolt,
l("Not right now, I'm busy."), L_Close,
l("Did you said reward?!"), L_GoGo;
L_Revolt:
message strcharinfo(0), l("Guaaaards! Sailors! Help! We have a stowaway!");
mesn;
mesq l("No, please don't! I have 3 kids to feed. They are looking for me for contraband. Please, let me go!");
close;
L_Close:
close;
L_GoGo:
mesn;
mesq l("Yes, I need to get out of here the earliest possible.");
next;
mesn strcharinfo(0);
mesq l("So tell me already what you need, and what is the reward!");
next;
// Stowaway hidden in a ship's hole. Contrabandist. Trade potions, dyes,
// food, water, and money for a hat.
mesn;
mes col("Alige hands you an old paper patch.",9);
next;
mesn l("Old Paper Patch");
mes l("* @@/30 @@", countitem(CactusPotion), getitemlink(CactusPotion));
mes l("* @@/12 @@", countitem(Bread), getitemlink(Bread));
mes l("* @@/12 @@", countitem(Cheese), getitemlink(Cheese));
mes l("* @@/8 @@", countitem(BottleOfTonoriWater), getitemlink(BottleOfTonoriWater));
mes l("* @@/6 @@", countitem(HastePotion), getitemlink(HastePotion));
mes l("* @@/6 @@", countitem(StrengthPotion), getitemlink(StrengthPotion));
mes l("* @@/2 @@", countitem(YellowCottonDye), getitemlink(YellowCottonDye));
mes l("* @@/2 @@", countitem(BlueCottonDye), getitemlink(BlueCottonDye));
mes l("* @@/7.500 GP", Zeny);
next;
// Temporary item. This four leaf amulet can be evolved: Bromenal < Iron < Golden < Crozenite
mesn;
mesq l("In exchange for your help, I'll give you a @@!", getitemlink(BromenalFourLeafAmulet));
menu
l("Of course I'll help you!"), L_Accept,
l("Have you got mad? That's too much, it's like you are trying to be perfect! No way I'll help you!"), L_Close;
L_Accept:
mesn;
mesq l("\"Many thanks! I'll be waiting for you, hiding on the ship's hold!\"");
next;
mesn strcharinfo(0);
mesq l("Could you first explain me why so many items?");
next;
mesn;
mesq l("Very well, listen to my plan!");
next;
mesn;
mesq l("The dyes are to disguise myself, I don't want to get caught. The potions are for safety, who knows what I'll face?");
next;
mesn;
mesq l("Water, Bread and Cheese are to eat, and money is always useful, you know.");
next;
mesn strcharinfo(0);
mesq l("You planned neatly. I'll be back.");
setq ShipQuests_Alige, 1;
close;
L_Return:
mesn;
mesq l("Hey, psst! Have you brought me what I asked for?");
next;
mesn strcharinfo(0);
menu
l("What I had to bring, again?"), L_Remember,
l("Yes, you can count it.", L_Check,
l("No... Not yet, sorry."), L_Close;
L_Remember:
mes "";
mes col("Alige hands you an old paper patch.",9);
next;
mesn l("Old Paper Patch");
mes l("* @@/30 @@", countitem(CactusPotion), getitemlink(CactusPotion));
mes l("* @@/12 @@", countitem(Bread), getitemlink(Bread));
mes l("* @@/12 @@", countitem(Cheese), getitemlink(Cheese));
mes l("* @@/8 @@", countitem(BottleOfTonoriWater), getitemlink(BottleOfTonoriWater));
mes l("* @@/6 @@", countitem(HastePotion), getitemlink(HastePotion));
mes l("* @@/6 @@", countitem(StrengthPotion), getitemlink(StrengthPotion));
mes l("* @@/2 @@", countitem(YellowCottonDye), getitemlink(YellowCottonDye));
mes l("* @@/2 @@", countitem(BlueCottonDye), getitemlink(BlueCottonDye));
mes l("* @@/7.500 GP", Zeny);
next;
// Temporary item. This four leaf amulet can be evolved: Bromenal < Iron < Golden < Crozenite
mesn;
mesq l("In exchange for your help, I'll give you a @@!", getitemlink(BromenalFourLeafAmulet));
close;
L_Check:
mesn;
mesq l("Wait. Don't give me anything yet. I lost my charm!");
mesq l("Wait until I get back!");
close;
L_Close:
close;
OnInit:
.sex = G_MALE;
.distance = 2;
// Preventive check against faulty update. Must be removed afterwards.
// UPDATE `quest` SET `count1` = '0' WHERE `quest`.`quest_id` = 2;
.@nb = query_sql("select `char_id` from `quest` WHERE (`count1`>=1 and `quest_id`=2) LIMIT 2", .@name$);
if (getarraysize(.@name$) > 0) {
debugmes "FATAL ERROR: Quest log not updated.";
debugmes "disabling Alige to prevent weirder bugs.";
debugmes "UPDATE `quest` SET `count1` = '0' WHERE `quest`.`quest_id` = 2";
disablenpc .name$;
}
end;
OnTouch:
if (getareausers() <= 1)
setnpcdir "Alige", 2; // 6
close;
OnUnTouch:
if (getareausers() == 0)
setnpcdir "Alige", 4; // 8
close;
}