summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-rw-r--r--npc/042-2/boss.txt118
-rw-r--r--npc/042-3/jail.txt16
2 files changed, 125 insertions, 9 deletions
diff --git a/npc/042-2/boss.txt b/npc/042-2/boss.txt
index 7a3ef4599..3479b7f2c 100644
--- a/npc/042-2/boss.txt
+++ b/npc/042-2/boss.txt
@@ -16,6 +16,7 @@
OnTouch:
.@label$=instance_npcname(.name$)+"::OnKillBoss";
.@g=getcharid(2);
+ if (.@g < 1) percentheal -100, -100;
if (($KAMELOT_QUEST[.@g] & 4) && !mobcount(getmap(), .@label$)) {
warp "042-3@"+.@g, 58, 139;
} else {
@@ -191,6 +192,8 @@ OnKillMob:
OnKillBoss:
.@m$=instance_mapname("042-2");
+ .@n$=instance_npcname(.name$);
+ stopnpctimer;
setd("$@GTEMP_"+.@m$, 0);
setd("$@GTEMP_HP_"+.@m$, 0);
setd("$@GTEMP_PC_"+.@m$, 0);
@@ -214,11 +217,120 @@ OnKillBoss:
.@gmb=getcharid(0, .@gm$);
if (!isloggedin(.@gma, .@gmb)) end;
message .@gm$, strcharinfo(0)+" defeated Krukan: Guild GP +"+.@ggp+" Guild XP +"+.@gxp;
+ // Arrest scene + exp
+ maptimer .@m$, 1500, .@n$+"::OnReward";
+ setd("$@GTEMP_"+.@m$, $KAMELOT_ID[.@g]);
+ setnpctimer 1000000; // Prefix 1M
+ startnpctimer;
+ end;
+
+
+///////////////////////////////////////////////////////////////////////
+OnTimer1002000:
+ .@m$=instance_mapname("042-2");
+ .@n$=instance_npcname(.name$);
+ // Bring Razha (the only mob with fixed difficulty in Kamelot)
+ .@raz=monster(.@m$, 41, 23, strmobinfo(1, GeneralRazha), GeneralRazha, 1,
+ .@n$+"::OnOptionalBoss");
+ // Configure the optional boss
+ setunitdata(.@raz, UDT_LEVEL, 150);
+ setunitdata(.@raz, UDT_STR, 150);
+ setunitdata(.@raz, UDT_AGI, 150);
+ setunitdata(.@raz, UDT_VIT, 150);
+ setunitdata(.@raz, UDT_INT, 150);
+ setunitdata(.@raz, UDT_DEX, 150);
+ setunitdata(.@raz, UDT_LUK, 150);
+ setunitdata(.@raz, UDT_ADELAY, 1072);
+ setunitdata(.@raz, UDT_ATKRANGE, 3);
+ // Battle Status
+ setunitdata(.@raz, UDT_MAXHP, 150000);
+ setunitdata(.@raz, UDT_HP, 150000);
+ setunitdata(.@raz, UDT_ATKMIN, 400);
+ setunitdata(.@raz, UDT_ATKMAX, 750);
+ setunitdata(.@raz, UDT_DEF, 300);
+ setunitdata(.@raz, UDT_MDEF, 300);
+ setunitdata(.@raz, UDT_HIT, 32767); // Advised: x3
+ setunitdata(.@raz, UDT_FLEE, 420); // Advised: x4
+ setunitdata(.@raz, UDT_CRIT, 70);
+ // Loop through
+
+ sc_start(SC_STUN, 15000, 1, 10000, SCFLAG_NOAVOID|SCFLAG_FIXEDTICK, .@raz);
+ unittalk(.@raz, "What is happening here??");
+ mapannounce .@m$, "General Razha : ##1What's happening here??", 0;
+ end;
+
+OnTimer1007000:
+ .@m$=instance_mapname("042-2");
+ mapannounce .@m$, "General Razha : GUARDS!!", 0;
+ end;
+
+OnTimer1007500:
+ .@m$=instance_mapname("042-2");
+ .@r1=monster(.@m$, 40, 24, strmobinfo(1, CursedSoldier), CursedSoldier, 1);
+ .@r2=monster(.@m$, 42, 24, strmobinfo(1, CursedArcher), CursedArcher, 1);
+ sc_start(SC_STUN, 15000, 1, 10000, SCFLAG_NOAVOID|SCFLAG_FIXEDTICK, .@r1);
+ sc_start(SC_STUN, 15000, 1, 10000, SCFLAG_NOAVOID|SCFLAG_FIXEDTICK, .@r2);
+ kdoor0422Spawn(49, 20, 24, 59, 59); // 1225 tiles, 1 per 25 tiles
+ end;
+
+OnTimer1012000:
+ .@m$=instance_mapname("042-2");
+ mapannounce .@m$, "General Razha : Arrest them all!!", 0;
+ end;
+
+OnTimer1015000:
+ .@m$=instance_mapname("042-2");
+ .@t$=instance_mapname("042-3");
+ .@n$=instance_npcname("#KSlimeSpawn", getd("$@GTEMP_"+.@m$));
+ setarray .@x, 33, 84, 41, 74, 36, 57, 79, 43, 24, 86, 59, 38;
+ setarray .@y, 135, 127, 119, 107, 96, 84, 63, 67, 67, 22, 49, 27;
+ .@c=getunits(BL_PC, .@unt, false, .@m$, 20, 24, 59, 59);
+ for (.@i = 0; .@i < .@c; .@i++) {
+ specialeffect(FX_HIT, AREA, .@unt[.@i]);
+ .@v = (.@i % 12);
+ .@r=attachrid(.@unt[.@i]);
+ if (.@r) {
+ warp .@t$, .@x[.@v], .@y[.@v];
+ if (!countitem(Lockpicks))
+ addtimer 700, .@n$+"::OnFirstSlime";
+ setpcblock(255, false);
+ } else {
+ unitwarp(.@unt[.@i], .@t$, .@x[.@v], .@y[.@v]); // And good luck D:
+ debugmes "FATAL: Could not attach: %d", .@unt[.@i];
+ }
+ }
+ setd("$@GTEMP_"+.@m$, 0);
stopnpctimer;
+ end;
- // TODO: maptimer to give EXP to helpers/survivors
- // TODO: Arrest scene
- // TODO: Actual arresting
+OnReward:
+ .@g=getcharid(2);
+ if (.@g < 1) percentheal -100, -100;
+ setpcblock(255, true);
+ getitem GuildCoin, min(1, $KAMELOT_MX[.@g]/25);
+ getexp $KAMELOT_MX[.@g]*50, $KAMELOT_MX[.@g]*10;
+ dispbottom l("Wait- Something is happening!");
+ end;
+
+OnOptionalBoss:
+ .@g=getcharid(2);
+ // Player Reward for completing this stage
+ getitem GuildCoin, 5;
+ getexp 50000, 10000;
+ // Guild Reward for completing this stage
+ .@ggp=12000;
+ .@gxp=100000;
+ $GUILD_BANK[.@g]+=.@ggp;
+ guildgetexp(.@gxp); // 10xp per player average level (max 1000/1500)
+ // Announce
+ mapannounce getmap(), strcharinfo(0)+" has defeated Razha!", 0;
+ // Guild Master Notification
+ .@gm$=getguildmaster(.@g);
+ if (!getcharid(3, .@gm$)) end;
+ .@gma=getcharid(3, .@gm$);
+ .@gmb=getcharid(0, .@gm$);
+ if (!isloggedin(.@gma, .@gmb)) end;
+ message .@gm$, strcharinfo(0)+" defeated Razha: Guild GP +"+.@ggp+" Guild XP +"+.@gxp;
end;
function kdoor0422Spawn {
diff --git a/npc/042-3/jail.txt b/npc/042-3/jail.txt
index 9c6f065b3..5108d459a 100644
--- a/npc/042-3/jail.txt
+++ b/npc/042-3/jail.txt
@@ -16,18 +16,22 @@ OnKillSlime:
if (@lockpicks)
end;
if (rand2(10000) > 1000) {
- getmapxy(.@m$, .@x, .@y, 0);
- sleep2(1800);
- .@mob=monster(.@m$, .@x, .@y, strmobinfo(1, CopperSlime), CopperSlime, 1, .@label$);
- // This should wipe the monster experience value
- setunitdata(.@mob, UDT_LEVEL, 1);
- end;
+ goto OnFirstSlime;
}
@lockpicks=true;
getitem Lockpicks, 1;
getitem TreasureKey, 1;
end;
+OnFirstSlime:
+ getmapxy(.@m$, .@x, .@y, 0);
+ sleep2(1800);
+ .@mob=monster(.@m$, .@x, .@y, strmobinfo(1, CopperSlime), CopperSlime, 1, .@label$);
+ // This should wipe the monster experience value
+ setunitdata(.@mob, UDT_LEVEL, 1);
+ end;
+
+
// Spawn Siege Towers
OnInstanceInit:
.@m$=instance_mapname(.map$);