// TMW 2 Script
// Author:
// Jesusalva
// Micksha
// Description:
// Part of Kamelot Guild Dungeon
// TODO: Random guard (Tezer) on the cursed soldier statues (easter egg)
042-0,58,28,0 script King Arthur NPC_KING_ARTHUR,{
.@g=getcharid(2);
.@pos=getguildrole(.@g, getcharid(3));
if (.@pos > GPOS_VICELEADER) goto L_Refusal;
if (!$KAMELOT_COOLDOWN[.@g]) goto L_Tutorial;
if ($KAMELOT_QUEST[.@g] & 1) goto L_Progress;
goto L_Prologue;
L_Prologue:
mesn l("King Arthur the Micksha");
mes l("Hello Adventurer.");
next;
mesn l("King Arthur the Micksha");
mes l("So good you are here. We have a huge problem.");
next;
npctalk l("JAIL THEM!!");
mesn l("King Arthur the Corrupted");
mes col(l("JAIL THEM!!"), 9)+l(" -- No, wait!");
next;
select
l("What is going on here?"),
l("Your problems are not mine. By the way, you really should consider taking a shower."),
l("[TUTORIAL]"),
l("You are weird, I have to go, sorry.");
mes "";
switch (@menu) {
case 1:
goto L_Quest;
case 2:
if (any(true, true, true, true, false))
goto L_Smash;
else
goto L_Annoyed;
case 3:
goto L_Tutorial;
case 4:
if (!any(true, true, true, true, false))
goto L_Smash;
else
goto L_Annoyed;
}
close;
L_Quest:
mesn l("King Arthur the Micksha");
mes l("Something is happening down there.");
next;
npctalk l("GUARDS! GET THEM!");
mesn l("King Arthur the Corrupted");
mes l("It is so dangerous, and it... ")+col(l("GUARDS! GET THEM!"), 9);
next;
mesn l("King Arthur the Micksha");
mes l("You must be fast! The guards are also affected.");
next;
npctalk l("OFF WITH THEIR HEADS!");
mesn l("King Arthur the Corrupted");
mes col(l("OFF WITH THEIR HEADS!"), 9)+l(" Take this key, it opens the door behind my throne.");
next;
npctalk l("AFTER THEM!!");
mesn l("King Arthur the Corrupted");
mes l("Be careful! ")+col(l("AFTER THEM!!"), 9);
next;
// Be sure the quest only starts now, and destroy any eventual artifact
$KAMELOT_QUEST[.@g]=1;
if (!is_admin()) // FIXME: This should be unconditional
$KAMELOT_COOLDOWN[.@g] = gettimeparam(GETTIME_WEEKDAY);
mapannounce(getmap(), "##1KAMELOT CASTLE, GUILD DUNGEON: MISSION START!", bc_map);
mesc l(".:: KAMELOT CASTLE, THE GUILD DUNGEON ::."), 1;
mes "";
mes l("1. Investigate Kamelot Basements");
mes l("2. Free Kamelot from its curse!");
close;
//////////////////////////////////////////////////////////////////////////
// King manages to control himself
L_Annoyed:
npctalk l("Don't bore me.");
closeclientdialog;
close;
// King loses his coolness.
L_Smash:
npctalk l("MEEEEEERLIN!!! SMASH THEM!!");
maptimer(getmap(), 300, instance_npcname(.name$)+"::OnPreSmash");
closeclientdialog;
close;
OnPreSmash:
specialeffect FX_CUPID, AREA, getcharid(3);
addtimer(380, instance_npcname(.name$)+"::OnSmash");
end;
OnSmash:
percentheal -100, -100;
end;
//////////////////////////////////////////////////////////////////////////
L_Progress:
// TODO: Victory
// TODO: Cooldown | if ($KAMELOT_COOLDOWN[.@g] == gettimeparam(GETTIME_WEEKDAY))
npctalk l("What are you still doing here?! GO!!");
mes l("Read tutorial again?");
next;
if (askyesno() == ASK_YES) goto L_Tutorial;
close;
//////////////////////////////////////////////////////////////////////////
L_Tutorial:
// Update variable
if ($KAMELOT_COOLDOWN[.@g] != gettimeparam(GETTIME_WEEKDAY))
$KAMELOT_COOLDOWN[.@g]=gettimeparam(GETTIME_WEEKDAY)-1;
mes b(".:: KAMELOT CASTLE ::.");
mes "The Guild Dungeon of Kamelot Castle";
mes "";
mes l("Kamelot Castle is a GUILD DUNGEON which refreshes WEEKLY.");
mes l("Only the Guild Master and the Vice Leaders are capable of starting this quest.");
next;
mes l("An unlimited number of members can join.");
mes l("Once the quest is started, entrance will be closed.");
mes l("No one can go out during the quest, so ensure every guild member has proper equipment, potions, and time for this dungeon.");
next;
mes l("Additionally, for the optimal experience, ensure your party has at least the following members:");
mes "";
mes l("* Thief");
mes l("* Mage");
next;
mes b(".:: VICTORY REWARDS ::.");
mes l("Victory prizes include guild experience, guild money, and guild bound items.");
mes "";
mes b(".:: DEFEAT PENALTIES ::.");
mes l("If your guild is defeat during the quest, you'll need to wait the weekly cooldown to expire.");
mes "";
mes "----------------- by Lancelot";
next;
clear;
if ($KAMELOT_QUEST[.@g] & 1) goto L_Progress;
goto L_Prologue;
//////////////////////////////////////////////////////////////////////////
L_Refusal:
mesc l("This man is THE LEGENDARY KING ARTHUR!");
mes "";
mesc l("I better leave talking to him to the guild Vice Leaders and Master.");
close;
OnInit:
.distance=4;
.sex=G_MALE;
npcsit;
end;
OnInstanceInit:
.distance=4;
.sex=G_MALE;
npcsit;
end;
}
042-0,69,24,0 script #K042-0_69_24 NPC_HIDDEN,0,0,{
end;
OnTouch:
.@g=getcharid(2);
if ($KAMELOT_QUEST[.@g] & 1)
warp "042-1@"+.@g, 55, 99;
else
dispbottom l("The door is locked.");
end;
}