// TMW2 Scripts
// Author:
// Jesusalva
// Description:
// Tulimshar Guardhouse Taskmaster
003-10,41,63,0 script Kreist NPC_PLAYER,{
.@d=gettimeparam(GETTIME_DAYOFMONTH);
mesn l("Kreist, Taskmaster");
mesq l("Hello, and welcome to Tulimshar guard house.");
next;
mesn l("Kreist, Taskmaster");
mesq l("My name is @@ and I am the daily task master. Interested in keeping this world free from monsters, or to report back?", .name$);
next;
mesc l("Protip: All quests expire at 00:00 server time, be sure to finish AND report back before that!");
// Borrowed from Arkim Code
mesc l("Time remaining to report completion: ")+FuzzyTime($@ARKIM_TIMER+86400), 1;
select
l("I want a EASY task!"),
l("I want a MODERATE task!"),
l("I want a EXPERT task!"),
l("It was nice seeing you.");
mes "";
switch (@menu) {
case 1:
.@q1=getq(General_MobHunting1);
.@q2=getq2(General_MobHunting1);
.@q3=getq3(General_MobHunting1);
.@q=General_MobHunting1;
.@lv=3;
goto L_QuestMaster;
case 2:
.@q1=getq(General_MobHunting2);
.@q2=getq2(General_MobHunting2);
.@q3=getq3(General_MobHunting2);
.@q=General_MobHunting2;
.@lv=5;
goto L_QuestMaster;
case 3:
.@q1=getq(General_MobHunting3);
.@q2=getq2(General_MobHunting3);
.@q3=getq3(General_MobHunting3);
.@q=General_MobHunting3;
.@lv=12;
goto L_QuestMaster;
}
closeclientdialog;
goodbye();
close;
L_QuestMaster:
// It's a new day, so we must generate a new quest!
if (.@q1 != .@d) {
.@q1=.@d;
if (.@lv == 3) {
.@q2=any(Maggot, Scorpion, Croc, FireGoblin, CaveMaggot, Duck);
} else if (.@lv == 5) {
.@q2=any(GiantMaggot, CaveSnake, DesertBandit, Sarracenus, DesertLogHead, RedScorpion);
} else if (.@lv == 12) {
.@q2=any(BlackScorpion, Snake, MountainSnake);
} else {
Exception("Bad setting for GMH.LV: "+.@lv, RB_DEFAULT|RB_SPEECH|RB_ISFATAL);
}
setq .@q, .@q1, .@q2, 0;
}
// Maybe there is no monster to kill
if (!.@q2) {
mesn l("Kreist, Taskmaster");
mesq l("You've already completed this quest today. Try again tomorrow.");
close;
}
// Maybe you finished the quest?
if (.@q3 >= 50) {
mesn l("Kreist, Taskmaster");
mesq l("Good job, you've killed the @@ @@ and reported back in time!", 50, getmonsterlink(.@q2));
next;
inventoryplace MercBoxA, 1;
if (MERCENARY_DAILYQUEST == 100) {
inventoryplace BountyHunterHelmet, 1;
getitem BountyHunterHelmet, 1;
}
mesn l("Kreist, Taskmaster");
mesq l("It's not much of a reward, but doesn't it feels great to help others in need?! HAHAHA!");
.@overkill=.@q3-50;
Zeny+=.@lv*(42+MERCENARY_DAILYQUEST);
// Raise LV according to monster level
.@lv+=getmonsterinfo(MOB_LV, .@q2)+MERCENARY_DAILYQUEST*11/10;
getexp BaseLevel*.@lv, .@lv+.@overkill;
setq2 .@q, 0;
setq3 .@q, 0;
MERCENARY_DAILYQUEST+=1;
if (MERCENARY_DAILYQUEST % 5 == 0) {
getitem MercBoxA, 1;
}
close;
}
mesn l("Kreist, Taskmaster");
mesq l("So, please kill @@/@@ @@ for us and make the world a safer place!", .@q3, 50, getmonsterlink(.@q2));
close;
OnInit:
// Check items.xml for info about this.
.@npcId = getnpcid(.name$);
setunitdata(.@npcId, UDT_HEADTOP, WarlordHelmet);
setunitdata(.@npcId, UDT_HEADMIDDLE, LieutenantArmor);
setunitdata(.@npcId, UDT_HEADBOTTOM, RaidTrousers);
setunitdata(.@npcId, UDT_SHIELD, LousyMoccasins); // TODO FIXME: Display Boots
setunitdata(.@npcId, UDT_WEAPON, Backsword);
setunitdata(.@npcId, UDT_HAIRSTYLE, 7);
setunitdata(.@npcId, UDT_HAIRCOLOR, 15);
npcsit;
.sex = G_MALE;
.distance = 4;
end;
}
// What is with this stupidly long quest name?
function script Guardhouse_RandQuestCheck {
if (!playerattached())
return;
.@mobId=getarg(0, killedrid);
.@d=gettimeparam(GETTIME_DAYOFMONTH);
// Easy Task
if (getq(General_MobHunting1) == .@d &&
getq2(General_MobHunting1) == .@mobId) {
.@q3=getq3(General_MobHunting1)+1;
setq3 General_MobHunting1, .@q3;
if (!(.@q3 % 10))
dispbottom l("@@/@@ @@ killed", .@q3, 50, getmonsterlink(.@mobId));
}
// Medium Task
if (getq(General_MobHunting2) == .@d &&
getq2(General_MobHunting2) == .@mobId) {
.@q3=getq3(General_MobHunting2)+1;
setq3 General_MobHunting2, .@q3;
if (!(.@q3 % 10))
dispbottom l("@@/@@ @@ killed", .@q3, 50, getmonsterlink(.@mobId));
}
// Hard Task
if (getq(General_MobHunting3) == .@d &&
getq2(General_MobHunting3) == .@mobId) {
.@q3=getq3(General_MobHunting3)+1;
setq3 General_MobHunting3, .@q3;
if (!(.@q3 % 10))
dispbottom l("@@/@@ @@ killed", .@q3, 50, getmonsterlink(.@mobId));
}
// Frostia's Task
if (getq(General_MobHunting4) == .@d &&
getq2(General_MobHunting4) == .@mobId) {
.@q3=getq3(General_MobHunting4)+1;
setq3 General_MobHunting4, .@q3;
if (!(.@q3 % 10))
dispbottom l("@@/@@ @@ killed", .@q3, 50, getmonsterlink(.@mobId));
}
return;
}