030-4,32,21,0 script AniManOMat NPC400,{
$@XmasBattleStatusClone = 0;
callfunc "XmasStates";
@xmas_battle_side = 0;
if ($@XmasBattleCoolDown)
goto L_CoolDown;
if (@xmas_side)
@xmas_battle_side = 1;
if ($@XmasBattleStatus)
goto L_BattleInProgress;
if (@xmas_state < $@xmas_boss_door_open_state)
goto L_ThrowOut;
if ((@xmas_boss_start) && (@xmas_state > $@xmas_boss_door_open_state))
goto L_Helper;
if (@xmas_state == $@xmas_boss_door_open_state)
goto L_InitiateBattle;
goto L_InitiateBattle;
L_InitiateBattle:
callfunc "XmasSetBossStart";
if(@xmas_battle_side)
goto L_BattleBad;
goto L_BattleGood;
L_BattleBad:
mesn l("Balthasar");
mes "\"So this is where this whole shallow charade will end...\"";
mes "\"Good. Are you ready to get this over with?\"";
menu
"Huh? Sure, why not.", L_KeepGoing,
"Wait a sec.", L_close,
"Well... since you ask... I prefer to leave now, this is way to dangerous. I have responsibities.", L_Coward;
L_KeepGoing:
mesn l("Balthasar");
mes "\"Okay now listen closely, at least for once.\"";
mes "\"Put the mana battery into that vessel in front of you.\"";
next;
menu
"Ok.", L_YeahOk,
"No way, I prefer to leave. Now!", L_Coward,
"Give me a second, I need to consider my options.", L_close;
L_YeahOk:
mes "You carefully install the Mana Battery as good as you can manage.";
mes "As you bend over, you notice a strong sulphur odour coming from the crate";
next;
mesn l("Balthasar");
mes "\"Ok. now this should be enough.\"";
mes "\"Get out of here, before the bomb explodes!.\"";
menu
"Agreed.", L_StartBad,
"You know what? If I pull this lever this should become HUGE! (Beware! that's dangerous)", L_StartBadHard;
L_BattleGood:
mes "You stare into a box that even through your unexperienced eyes looks less than secure to harbour such a powerful device as the mana battery is.";
menu
"Ok, this should be where the battery belongs.", L_StartGood,
"No WAY! I am not going to put my life in danger", L_close,
"Ok that does it, I am going to leave! I cannot be responsible for blowing up the entire mana world.", L_Coward,
"I studied magic and this looks all wrong. (Beware! that's dangerous)", L_StartGoodHard;
L_StartGood:
if ($@XmasBattleStatus)
goto L_BattleInProgress;
@xmas_battle_status = 1;
goto L_Start;
L_StartGoodHard:
if ($@XmasBattleStatus)
goto L_BattleInProgress;
callsub S_CheckHardReq;
delitem $@xmas_boss_req$[ @xmas_battle_side ], $@xmas_boss_amount[ @xmas_battle_side ];
mes "You pour a handfull of " + $@xmas_boss_req$[@xmas_battle_side] + " over the Mana Battery.";
@xmas_battle_status = 2;
goto L_Start;
L_StartBad:
if ($@XmasBattleStatus)
goto L_BattleInProgress;
@xmas_battle_status = 3;
goto L_Start;
L_StartBadHard:
if ($@XmasBattleStatus)
goto L_BattleInProgress;
callsub S_CheckHardReq;
delitem $@xmas_boss_req$[ @xmas_battle_side ], $@xmas_boss_amount[ @xmas_battle_side ];
mes "You pour a handfull of " + $@xmas_boss_req$[@xmas_battle_side] + " over the Mana Battery.";
@xmas_battle_status = 4;
goto L_Start;
L_Start:
mes "You struggle a little with your task, since the mana battery doesn't seem to fit in as smooth as you expected it.";
next;
mes "W00t!";
next;
mes "Now it is glowing wildly";
next;
mes "it seems like this will not turn out as planned, Look this Guard of Honour is going crazy!";
next;
npctalk "The Guards are out of control!";
if ($@XmasBattleStatus)
goto L_BattleAlreadyStarted;
$@XmasBattleStatus = @xmas_battle_status;
$@XmasBattleStatusClone = $@XmasBattleStatus;
$@XmasBossRound = 0;
$@XmasBossPlayerCount = getmapusers("030-4");
areamonster "030-4", 20, 21, 40, 40, "", 1114, 1, "AniManOMat::OnGuardDeath";
initnpctimer;
goto L_close;
L_ThrowOut:
// if the player didnt get a bomb yet
mes "This looks dangerous. Come back when you are prepared";
next;
warp "030-2",151,25;
goto L_close;
L_Coward:
//Player chose to cancel
mes "What a pitty now you still have a bomb in your hands but...";
mes "As you wish.";
next;
warp "030-2",151,25;
goto L_close;
L_Helper:
//Player used up his own chance to start
mes "mmh the AniManOMat is empty again, maybe we should try with a different mana battery.";
menu
"No I prefer to leave now, get me out of here.", L_Quit,
"Wait let me check if i can fix this ...(Beware!)", L_Repeat,
"Why would I do that? Aaaah... Nevermind.", L_close;
L_Repeat:
//Player wants to try again on hard mode again
if ($@XmasBattleStatus)
goto L_BattleInProgress;
callsub S_CheckHardReq;
delitem $@xmas_boss_req$[ @xmas_battle_side ], $@xmas_boss_amount[ @xmas_battle_side ];
@xmas_battle_status = (2 * (@xmas_battle_side)) + 2;
goto L_Start;
L_Quit:
warp "030-2",151,25;
goto L_close;
L_CoolDown:
mes "The AniManOMat is too hot to handle right now, you should wait a bit to try a new battery.";
menu
"No I prefer to leave now, get me out of here.", L_Quit,
"Ughhh, but I'm certain this time the battery will work!", L_close;
L_BattleInProgress:
mes "The mana battery looks like it is about to explode. You better take cover!";
goto L_close;
L_BattleAlreadyStarted:
mes "Seems like someone was faster than you.";
goto L_close;
L_close:
callsub S_ClearVariables;
close;
// per NPC logic
OnTimer5000:
setnpctimer 0;
if ($@XmasBattleStatus)
goto L_CaveLogic;
goto L_CleanUp;
L_Return_1:
$@XmasBossPlayerCount = 0;
areatimer 0, "030-4", 0, 0, 60, 60, 10, "AniManOMat::OnTick";
end;
L_CaveLogic:
if ($@XmasBossPlayerCount < 1)
goto L_AllDead;
set $@BombTimer, $@BombTimer + 5; // Advance 5 seconds
if (mobcount("030-4", "AniManOMat::OnGuardDeath") == 0)
goto L_NextWave;
if ($@BombTimer >= 120)
goto L_NextWave;
goto L_Return_1;
L_NextWave:
$@BombTimer = 0;
$@DangerCellNumber = rand(8);
$@XmasBossRound = $@XmasBossRound + 1;
if (($@XmasBossRound > 10) && mobcount("030-4", "AniManOMat::OnGuardDeath") == 0)
goto L_Finished;
// Break/LastChance(s)
if (($@XmasBossRound > 10) && ($@XmasBossRound <= 16))
goto L_Return_1;
//KillerWaves
if ($@XmasBossRound > 16)
areamonster "030-4", 0, 0, 50, 50, "", 1114, $@XmasBossRound*2 + $@XmasBossPlayerCount*3, "AniManOMat::OnGuardDeath";
//Normal Waves 1 to 10
// Guard Amount doubles if on hard mode
$@GuardAmount = 1 + (6 + ($@XmasBossRound) + (2 * $@XmasBossPlayerCount)) / 7;
$@SkullAmount = 1 + ($@GuardAmount * $@GuardAmount) / 4;
if ($@GuardAmount > 15)
$@GuardAmount = 15;
//Obliatory Guard Of Honour in the Southern Hallway
areamonster "030-4", 30, 43, 39, 49, "", 1114, $@GuardAmount, "AniManOMat::OnGuardDeath";
//CopperSlimes, I love Copper Slimes anywhere anytime
areamonster "030-4", 20, 21, 49, 49, "", 1098, rand(2,7), "AniManOMat::OnGuardDeath";
//IceSkulls for hard mode in room 3 and 4
if ($@XmasBattleStatus == 2 || $@XmasBattleStatus == 4)
areamonster "030-4", 20, 32, 28, 39, "", 1085, $@SkullAmount / 2, "AniManOMat::OnGuardDeath";
if ($@XmasBattleStatus == 2 || $@XmasBattleStatus == 4)
areamonster "030-4", 41, 32, 49, 39, "", 1085, $@SkullAmount / 2 + 1, "AniManOMat::OnGuardDeath";
//Angry Sea Slimes for Easy Mode in Nice Version in Room 3,4,5,6
if ($@XmasBattleStatus == 1)
areamonster "030-4", 20, 32, 28, 49, "", 1109, $@SkullAmount, "AniManOMat::OnGuardDeath";
if ($@XmasBattleStatus == 1)
areamonster "030-4", 41, 32, 49, 49, "", 1109, $@SkullAmount, "AniManOMat::OnGuardDeath";
//Candied Slimes for Nice Mode in Rooms 1 and 2
if ($@XmasBattleStatus == 1 || $@XmasBattleStatus == 2)
areamonster "030-4", 20, 21, 28, 28, "", 1111, ($@XmasBossRound / 2) + 1, "AniManOMat::OnGuardDeath";
if ($@XmasBattleStatus == 1 || $@XmasBattleStatus == 2)
areamonster "030-4", 41, 21, 49, 28, "", 1111, ($@XmasBossRound / 2) + 2, "AniManOMat::OnGuardDeath";
//Bluepars for Easy mode in Naughty Variant in Rooms 3,4,5,6
if ($@XmasBattleStatus == 3)
areamonster "030-4", 20, 32, 28, 49, "", 1107, $@SkullAmount, "AniManOMat::OnGuardDeath";
if ($@XmasBattleStatus == 3)
areamonster "030-4", 41, 32, 49, 49, "", 1107, $@SkullAmount, "AniManOMat::OnGuardDeath";
// Wicked Mushrooms for Naughty Mode in Rooms 1 and 2
if ($@XmasBattleStatus == 3 || $@XmasBattleStatus == 4)
areamonster "030-4", 20, 21, 28, 28, "", 1106, $@XmasBossRound + ($@XmasBossRound / 2), "AniManOMat::OnGuardDeath";
if ($@XmasBattleStatus == 3 || $@XmasBattleStatus == 4)
areamonster "030-4", 41, 21, 49, 28, "", 1106, $@XmasBossRound + ($@XmasBossRound / 2), "AniManOMat::OnGuardDeath";
$@msgnumber = (2 * $@XmasBossRound) + (($@XmasBattleStatus - 1) >> 1);
$@msg$ = $@XmasBossMes$[ $@msgnumber ];
$@msgnumber = 0;
if ($@XmasBossRound > 10) goto L_Return_1;
callsub S_Announce;
goto L_Return_1;
OnTick:
if (ispcdead()) end;
$@XmasBossPlayerCount = $@XmasBossPlayerCount + 1;
if(isin("030-4", $@DangerCellX1[$@DangerCellNumber], $@DangerCellY1[$@DangerCellNumber], $@DangerCellX2[$@DangerCellNumber], $@DangerCellY2[$@DangerCellNumber]))
goto L_DangerCell;
end;
L_DangerCell:
message strcharinfo(0), "Target Aquired. Locking on Now.";
misceffect 10001, strcharinfo(0);
heal ((MaxHp/100) * -20), 0;
end;
OnGuardDeath:
end;
L_AllDead:
$@msg$ = $@xmas_final_announce$[ ($@XmasBattleStatus - 1) / 2 ];
callsub S_Announce;
goto L_CleanUp;
L_Finished:
$@msg$ = $@xmas_final_announce$[ (($@XmasBattleStatus - 1) / 2) + 2 ];
callsub S_Announce;
goto L_CleanUp;
L_CleanUp:
areatimer 0, "030-4", 0, 0, 50, 50, 10, "AniManOMat::OnReward";
$@XmasBossPlayerCount = 0;
$@XmasBossRound = 0;
$@BombTimer = 0;
$@GuardAmount = 0;
$@SkullAmount = 0;
killmonster "030-4", "AniManOMat::OnGuardDeath";
stopnpctimer;
donpcevent "#XmasChamberCooler::OnCommandCoolDown";
end;
OnReward:
if (ispcdead())
end;
if (($@XmasBattleStatusClone % 2) == 0)
XMASTIME = XMASTIME | $@xmas_boss_hero_bit;
@xmas_state = (XMASTIME & NIBBLE_0_MASK) >> NIBBLE_0_SHIFT;
@bonus = (55 - (BaseLevel / 2));
DailyQuestBonus = DailyQuestBonus + @bonus;
message strcharinfo(0), "You feel a temporary rush of power and zest for action.";
if (@xmas_state != $@xmas_boss_door_open_state )
goto L_End;
@xmas_state = $@xmas_reward_start;
callfunc "XmasSetState";
@xmas_state = 0;
@karma_bonus = $@xmas_boss_bonus;
message strcharinfo(0), "Wow, what happened here?.";
goto L_End;
L_End:
if ((($@XmasBattleStatus - 1) / 2) == 0) goto L_EndNice;
goto L_EndNaughty;
L_EndNaughty:
callfunc "XmasNaughty";
callsub S_ClearVariables;
end;
L_EndNice:
callfunc "XmasNice";
callsub S_ClearVariables;
end;
OnCommandChamberReset:
areatimer 0, "030-4", 0, 0, 50, 50, 10, "AniManOMat::OnReward";
$@XmasBattleStatus = 0;
$@XmasBossPlayerCount = 0;
$@XmasBossRound = 0;
$@BombTimer = 0;
$@GuardAmount = 0;
$@SkullAmount = 0;
killmonster "030-4", "AniManOMat::OnGuardDeath";
stopnpctimer;
setnpctimer 0;
goto L_Restart;
OnInit:
goto L_Restart;
L_Restart:
$@XmasBattleStatus = 0;
setarray $@XmasBossMes$,
"", // unused
"", // unused
"Scrrreeeeeeeeeeeeeeeeeeeeeaaaaaaaaaaaaaaaaaaaaatch",
"Scrrreeeeeeeeeeeeeeeeeeeeeaaaaaaaaaaaaaaaaaaaaatch",
"Avalia : I am getting a weird sensation ... ",
"Balthasar : I think they know what we are up to!",
"Avalia : Oh no! This is going to blow up",
"Balthasar : The Door is locked you idiot, fight for your life.",
"Avalia : Guards of Honor I demand you: STOP!",
"Balthasar : Okay, this is somewhat funny... why are they coming back?!?",
"Avalia : You brave fighters! Deactivate the nutcrackers! they are out of control!",
"Balthasar : The good news is: if we make it this time we will never have to do that again!",
"Avalia : Oh boy we are so screwed.",
"Balthasar : Report: I am an Idiot",
"Avalia : Quick, we need to kill the nutcrackers, before they ruin everything we've been working for.",
"Balthasar : Strange they are getting more and not less.",
"Avalia : Oh no, they are too powerful. Fight my warriors, Fight for the spirit of Christmas.",
"Balthasar : If I was smart enough to stop talking, it would have happened already..",
"Avalia : I cannot believe it, this is making them stronger. More and more of them are coming.",
"Balthasar : I think we are almost done, the bomb should explode any second.",
"Avalia : Those poor creatures. Just kill them all.",
"Balthasar : A N Y S E C O N D.",
"Avalia : Oh well... just try again, I trust in you.",
"Balthasar : just lol.",
"Avalia : Wow! You saved christmas.",
"Balthasar : Yep, it's over... and strange enough you survived.";
setarray $@xmas_final_announce$,
"Avalia : Oh no, not only did you slay half my Guard of Honour, but also the issue was not fixed, try to install the battery again!",
"Balthasar : Boy are you lame. So what now? The battery is still not placed! Go try again!",
"Avalia : W00t you actually made it through. I think now that the manabattery lost some of its abundant power this seems to have given those nutcrackers that didn't go crazy a good boost of life energy. Thank you for your help all and come see me for a reward.",
"Balthasar : Good. They are dead. Now GET OUT OF THERE, this bomb is dangerous!";
// Danger Cells to attack sitters
// 0: 19,20,29,29
// 1: 30,20,40,29
// 2: 41,20,50,29
// 3: 19,31,29,40
// 4: 30,31,40,40
// 5: 41,31,50,40
// 6: 19,42,29,50
// 7: 30,42,40,50
// 8: 41,42,50,50
setarray $@DangerCellX1, 19, 30, 41, 19, 30, 41, 19, 30, 41;
setarray $@DangerCellY1, 20, 20, 20, 31, 31, 31, 42, 42, 42;
setarray $@DangerCellX2, 29, 40, 50, 29, 40, 50, 29, 40, 50;
setarray $@DangerCellY2, 29, 29, 29, 40, 40, 40, 50, 50, 50;
end;
S_Announce:
mapannounce "030-4", "Danger Cell Activated. Zone " + $@DangerCellNumber + " activated.", 0;
mapannounce "030-4", $@msg$, 0;
mapannounce "030-2", $@msg$, 0;
$@msg$ = "";
return;
S_CheckHardReq:
if (BaseLevel < $@BossHardLevel)
goto L_NotHighEnough;
if (countitem($@xmas_boss_req$[ @xmas_battle_side ]) < $@xmas_boss_amount[ @xmas_battle_side ])
goto L_NotEnoughItems;
goto L_Return;
L_NotEnoughItems:
mes "Nono, you need to bring " + $@xmas_boss_amount[ @xmas_battle_side ] + " " + $@xmas_boss_req$[ @xmas_battle_side ] + "s.";
goto L_close;
L_NotHighEnough:
mes "\"Err no sweetie, you don't. just do it the normal way.\"";
goto L_close;
L_Return:
return;
S_ClearVariables:
@xmas_battle_side = 0;
@bonus = 0;
@xmas_state = 0;
@xmas_battle_status = 0;
@karma_bonus = 0;
return;
}
030-4,0,0,0 script #XmasChamberCooler NPC32767,{
end;
OnCommandCoolDown:
$@XmasBattleStatus = 0;
$@XmasBattleCoolDown = 1;
initnpctimer;
end;
OnTimer120000:
$@XmasBattleCoolDown = 0;
stopnpctimer;
end;
}