summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-rw-r--r--npc/001-14/ctrl.txt82
-rw-r--r--npc/001-14/hocus.txt2
2 files changed, 82 insertions, 2 deletions
diff --git a/npc/001-14/ctrl.txt b/npc/001-14/ctrl.txt
index dbccadf92..ab7c035e7 100644
--- a/npc/001-14/ctrl.txt
+++ b/npc/001-14/ctrl.txt
@@ -25,11 +25,91 @@ OnInit:
// FIXME
001-14,111,42,0 script Hocus#MOLY0100 NPC_BLACKWIZARD,{
- npctalk l("Energy Ball Challenge");
+ if (gettimetick(2) < @moly_tick) end;
+ mes ".:: " + l("Energy Ball Challenge") + ":: .";
+ mes l("The goal is simple - I'll spawn an energy ball and you must kill it quickly. You'll be disqualified if you equip a non-magical weapon at any time.");
+ dnext;
+ mes l("You'll have 60 seconds to kill as many balls as you can!");
+ mesc l("NOTE: Beside wands and staves, %s, %s, and the %s count as magic weapons.", getitemlink(Judgement), getitemlink(DarkPulsar), getitemlink(Lightbringer));
+ mes "";
+ mesc l("Your progress thus far: %s sparks", fnum(FYMOLY_ENBALL)), 3;
+ next;
+ mesc l("Begin campaign?"), 1;
+ if (askyesno() == ASK_NO) close;
+ @moly_tick = gettimetick(2) + 60;
+ @moly_score = 0;
+ .m$=getmap();
+ @map$=getmap();
+ .@m=areamonster(.m$, 108, 43, 118, 48, "Target", YellowSpark, 1, "Hocus#MOLY0100::OnClick");
+ setunitdata(.@m, UDT_HP, 1);
+ setunitdata(.@m, UDT_MAXHP, 1);
+ setunitdata(.@m, UDT_LEVEL, 1);
+ setunitdata(.@m, UDT_SPEED, 60);
+ npctalk3 l("Countdown: 1 minute");
+ addtimer 2000, instance_npcname("Hocus#MOLY0100")+"::OnCheck";
+ initnpctimer;
+ closeclientdialog;
+ close;
+
+OnTimer15000:
+ npctalk "45 seconds";
+ end;
+
+OnTimer30000:
+ npctalk "30 seconds";
+ end;
+
+OnTimer45000:
+ npctalk "15 seconds";
+ end;
+
+OnTimer55000:
+ npctalk col("5 seconds", 1);
+ end;
+
+OnTimer60000:
+ killmonsterall(.m$);
+ maptimer2(.m$, 10, "Hocus#MOLY0100::OnEnd");
+ npctalk col("Time out!", 1);
+ stopnpctimer;
+ end;
+
+OnClick:
+ if (gettimetick(2) > @moly_tick) end;
+ @moly_score+=1;
+ .@m=areamonster(@map$, 108, 43, 118, 48, "Target", YellowSpark, 1, "Hocus#MOLY0100::OnClick");
+ setunitdata(.@m, UDT_HP, 1);
+ setunitdata(.@m, UDT_MAXHP, 1);
+ setunitdata(.@m, UDT_LEVEL, 1);
+ setunitdata(.@m, UDT_SPEED, 60);
+ end;
+
+OnCheck:
+ if (gettimetick(2) > @moly_tick) end;
+ .@wp = getequipid(EQI_HAND_R);
+ if (.@wp < 1) addtimer(2000, instance_npcname("Hocus#MOLY0100")+"::OnCheck");
+ if (.@wp != Judgement &&
+ .@wp != DarkPulsar &&
+ .@wp != Lightbringer &&
+ getiteminfo(.@wp, ITEMINFO_SUBTYPE) != W_STAFF) {
+ @moly_score = -1;
+ @moly_tick = 0;
+ dispbottom col(l("You have been disqualified - illegal weapon: %s", getitemname(.@wp)), 1);
+ stopnpctimer;
+ end;
+ }
+ addtimer 2000, instance_npcname("Hocus#MOLY0100")+"::OnCheck";
+ end;
+
+OnEnd:
+ dispbottom l("End! Score this time: %d", @moly_score);
+ FYMOLY_ENBALL = max(FYMOLY_ENBALL, @moly_score);
+ @moly_score = 0;
end;
OnInit:
.distance=7;
+ .m$="001-14";
end;
}
diff --git a/npc/001-14/hocus.txt b/npc/001-14/hocus.txt
index 078892283..ae438c893 100644
--- a/npc/001-14/hocus.txt
+++ b/npc/001-14/hocus.txt
@@ -54,7 +54,7 @@ function showScores {
mesc l("Reminder: "), 1;
mesc l("Scores are updated every 6 hours."), 1;
next;
- //parseScores("Energy Balls Challenge", "$@moly01_n$", "$@moly01_v");
+ parseScores("Energy Balls Challenge", "$@moly01_n$", "$@moly01_v");
//parseScores("Boss Fight Challenge", "$@moly02_n$", "$@moly02_v", 0);
//parseScores("Fluffy Hunt Challenge", "$@moly03_n$", "$@moly03_v");
parseScores("Chanting Challenge", "$@moly04_n$", "$@moly04_v");