// TMW2 scripts.
// Authors:
// Jesusalva
// Description:
// Protect Halinarzo
009-1,71,24,0 script Lieutenant Jacob NPC_PLAYER,{
// The Monster King guild have a special menu
if (strcharinfo(2) == "Monster King") goto L_MKControl;
mesn;
mesq l("Halt! Beyond this gate, is the Great River and the Eternal Swamps.");
next;
mesn;
mesq l("Was not it only flooded constantly, the graveyard is not too far. If you stray away from the path, you'll get lost.");
next;
.@fd=!(getmapmask("011-3")&1024); // .@fd - is flooded?
if (!.@fd && $GAME_STORYLINE >= 1) {
mesn;
// There's a limit on how much info I can send with @@
mesq l("Various people already went missing, including GMs. This is why if you plan to cross, ") + b(l("You won't be allowed to walk sideways, except to avoid a monster or two."));
mesc l("If you try to walk west or east too much, you'll hit an \"invisible wall\" to prevent you from getting lost.");
next;
select
l("I'm fine, thanks."),
l("My equipment is good, let me through!");
mes "";
if (@menu == 2 && $HURNS_LIBDATE) {
.@palgal$=lg("gal", "pal");
if (BaseLevel < 20) {
mesn;
mesq l("It might be, but your level isn't. Sorry @@. No going to Hurnscald before level 20.", .@palgal$);
close;
}
if (reputation("Halin") < 1) {
mesn;
mesq l("It might be, but I never heard of you before. Sorry @@, I can't let just anyone go through. It would be a disservice to see you get stuck and die.", .@palgal$);
close;
}
warp "011-3", 37, 219;
closedialog;
close;
} else if (!$HURNS_LIBDATE) {
mesn;
mesq l("No. Hurnscald is besieged and it would be too dangerous to let you go alone. You should talk to %s, instead.", b("Saulc GM"));
}
} else {
mesn;
mesq l("In fact, it is flooded at the moment. Come back later.");
next;
}
if (GHQUEST)
GHQ_Assign(Snake, "Halinarzo");
close;
L_MKControl:
mesn;
mes l("Oh noes! You've found the Halinarzo control panel!");
next;
select
l("Abort"),
l("Initiate a siege");
mes "";
if (@menu == 2) {
doevent "Lieutenant Jacob::OnStartSiege";
closedialog;
}
close;
OnMKSiege:
$@SIEGE_ABORTED = false;
OnStartSiege:
kamibroadcast(col("WARNING! WARNING! Monster Army is moving towards Halinarzo!!",1));
do_siege("009-1", "010-2", "HALIN", TP_TULIM, .name$, .siegetime);
initnpctimer;
end;
// Timers
OnTimer5000:
.siegetime+=5;
do_siege("009-1", "010-2", "HALIN", TP_TULIM, .name$, .siegetime);
switch (.siegetime) {
case 0:
disablenpc "Sawis";
break;
// Monster Army arrives in town
case 60:
disablenpc "Fisherman";
disablenpc "Charles, Trader King";
disablenpc "Lynn The Traveler";
disablenpc "Enliven Reva Foxhound";
disablenpc "Ryan";
disablenpc "Bella, the Scholar";
disablenpc "Book Keeper";
disablenpc "Yumi";
disablenpc "Halinarzo's Nurse";
disablenpc "Joaquim";
disablenpc "Alvasus";
disablenpc "Luanna";
break;
// Monster Army deployed in town
case 90:
disablenpc "Dang Rostra";
disablenpc "Kevin";
disablenpc "Barzil";
break;
// Monster army have withdrawn completly
case MK_SIEGE_DURATION:
.siegetime=0;
announce(("Halinarzo siege is over!"), bc_all);
enablenpc "Sawis";
enablenpc "Fisherman";
enablenpc "Charles, Trader King";
enablenpc "Lynn The Traveler";
enablenpc "Enliven Reva Foxhound";
enablenpc "Ryan";
enablenpc "Bella, the Scholar";
enablenpc "Book Keeper";
enablenpc "Yumi";
enablenpc "Halinarzo's Nurse";
enablenpc "Joaquim";
enablenpc "Alvasus";
enablenpc "Luanna";
enablenpc "Dang Rostra";
enablenpc "Kevin";
enablenpc "Barzil";
stopnpctimer;
end;
break;
}
// Loop again
initnpctimer;
end;
OnInit:
.siegetime=0;
.sex = G_MALE;
.distance = 4;
// Check items.xml for info about this.
.@npcId = getnpcid();
setunitdata(.@npcId, UDT_HEADTOP, BullHelmet);
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, 12);
setunitdata(.@npcId, UDT_HAIRCOLOR, 15);
end;
}
// Handle Guard's logic
function script HaliGuardHandler {
legiontalk;
return;
}
009-1,100,30,0 script Guard Corina NPC_GUARD2,{
HaliGuardHandler();
end;
OnInit:
.sex = G_OTHER;
.distance = 5;
end;
}
009-1,111,48,0 script Guard Jhon NPC_GUARD1,{
HaliGuardHandler();
end;
OnInit:
.sex = G_OTHER;
.distance = 5;
end;
}
009-1,41,56,0 script Guard Laurie NPC_GUARD2,{
HaliGuardHandler();
end;
OnInit:
.sex = G_OTHER;
.distance = 5;
end;
}
009-1,62,74,0 script Guard Amy NPC_GUARD2,{
HaliGuardHandler();
end;
OnInit:
.sex = G_OTHER;
.distance = 5;
end;
}