// TMW2/LoF scripts.
// Authors:
// TMW-LoF Team
// Jesusalva
// Description:
// Part Of Christmas Events
// SQuest_XmasCollector
// Status, Delivered Gifts, Current Year
// Status:
// 0 - Quest is unknown
// 1 - Quest is known
// 2 - Rewards Collected
022-1,65,53,0 script Gift Fanatic NPC_GNOME_C,{
// Start Event for the first time
if (gettime(GETTIME_MONTH) != JANUARY && getq3(SQuest_XmasCollector) < gettime(GETTIME_YEAR)) {
setq SQuest_XmasCollector, 1, 0, gettime(GETTIME_YEAR);
}
if (gettime(GETTIME_MONTH) == JANUARY && getq3(SQuest_XmasCollector) != gettime(GETTIME_YEAR)-1) {
setq SQuest_XmasCollector, 1, 0, gettime(GETTIME_YEAR)-1;
}
// Main Loop
if ($EVENT$ == "Christmas")
goto L_Main;
// Last year
if (getq3(SQuest_XmasCollector) == gettime(GETTIME_YEAR)-1)
goto L_Reward;
// Not on season
goto L_OutOfSeason;
L_OutOfSeason:
mesn;
mesq l("Hey, collect lots of @@ and give them to me on Christmas! Not now. On Christmas!", getitemlink(PresentBox));
close;
// The reward is actually just an extra bonus, there is nothing WOW to see here...
// Unless you reach the milestones: 200, 400, 800, 1600, 3200, 6400, 12800... gifts
// The maximum is 10 christmas boxes, or 102.400 gifts.
// There's a floor, though: Your Base Level. That determines the minimum amount
// before it starts counting. So in reality, you need 200~300 gifts to get prize.
L_Reward:
inventoryplace XmasGift, 10;
.@q=getq2(SQuest_XmasCollector);
.@q=max(1, .@q-BaseLevel);
.@gifts=min(10, log2(.@q/200))+1;
mesn;
mesq l("Hey, huge THANKS for the help! I love gifts! Here's your due reward!");
mesc l("Got @@ EXP, @@ JExp and @@ GP for helping out.", .@q*7, .@q, .@q*5);
getexp .@q*7, .@q;
Zeny=Zeny+(.@q*5);
getitem XmasGift, .@gifts;
setq SQuest_XmasCollector, 2, 0, 0;
close;
L_Main:
.@q=getq2(SQuest_XmasCollector);
mesn;
mesq l("I want @@! I want @@!!", getitemlink(PresentBox), getitemlink(PresentBox));
next;
.@price=(getiteminfo(PresentBox, ITEMINFO_SELLPRICE)+2);
mesn;
mesq l("I am willing to pay @@ GP for each you bring me! Do you want to give me ALL your @@?!", .@price, getitemlink(PresentBox));
next;
select
rif(countitem(PresentBox), l("Yes, of course!")),
l("Not now...");
mes "";
if (@menu == 1) {
.@qnt=countitem(PresentBox);
.@q+=.@qnt;
delitem PresentBox, .@qnt;
Zeny=Zeny+.@price*.@qnt;
getexp .@qnt*.@price, .@qnt;
setq2 SQuest_XmasCollector, .@q;
mesn;
mesc l("You just delivered %d %s to %s.",
.@qnt, getitemlink(PresentBox), .name$);
mesq l("Many, many thanks! Thus far, you delivered me @@ gift boxes!", .@q);
next;
}
mesn;
mesq l("Come back and give me more gifts!");
close;
OnInit:
.sex=G_OTHER;
.distance=5;
end;
}