summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-01-15 17:35:50 -0300
committerJesusaves <cpntb1@ymail.com>2022-01-15 17:35:50 -0300
commit1b115b7eee2b2f43bd2848e5da2e615fdc841761 (patch)
tree9df338d26aa7afc7dcaf8968cc41e4c43d9e6b7d
parentd8e4d130cdaafe4d0e580a1b231cc0d12acd3956 (diff)
downloadserverdata-1b115b7eee2b2f43bd2848e5da2e615fdc841761.tar.gz
serverdata-1b115b7eee2b2f43bd2848e5da2e615fdc841761.tar.bz2
serverdata-1b115b7eee2b2f43bd2848e5da2e615fdc841761.tar.xz
serverdata-1b115b7eee2b2f43bd2848e5da2e615fdc841761.zip
Survive! Challenge
-rw-r--r--npc/001-14/ctrl.txt77
-rw-r--r--npc/001-14/hocus.txt2
2 files changed, 77 insertions, 2 deletions
diff --git a/npc/001-14/ctrl.txt b/npc/001-14/ctrl.txt
index 8c316977b..4b340b962 100644
--- a/npc/001-14/ctrl.txt
+++ b/npc/001-14/ctrl.txt
@@ -27,6 +27,7 @@ OnInit:
/////////////////////////////////////////////////////////////////////////////////
001-14,111,42,0 script Hocus#MOLY0100 NPC_BLACKWIZARD,{
if (gettimetick(2) < @moly_tick) end;
+ if (@moly_chall) 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;
@@ -108,6 +109,7 @@ OnCheck:
getiteminfo(.@wp, ITEMINFO_SUBTYPE) != W_STAFF) {
@moly_score = -1;
@moly_tick = 0;
+ @moly_chall = 0;
dispbottom col(l("You have been disqualified - illegal weapon: %s", getitemname(.@wp)), 1);
stopnpctimer;
killmonsterall(getmap());
@@ -198,6 +200,7 @@ OnInit:
/////////////////////////////////////////////////////////////////////////////////
001-14,88,139,0 script Hocus#MOLY0600 NPC_BLACKWIZARD,{
+ if (@moly_chall) end;
mes ".:: " + l("Magic Raw Power Challenge") + ":: .";
mes l("Description: For starters, I'll blow away all your summons and summon an ent. You must do the most damage to it within 10 seconds.");
mes l("Using potions and support magic is fine. It has high defense, so magic attacks work better.");
@@ -244,6 +247,7 @@ OnCheck:
getiteminfo(.@wp, ITEMINFO_SUBTYPE) != W_STAFF)) {
@moly_score = -1;
@moly_tick = 0;
+ @moly_chall = 0;
dispbottom col(l("You have been disqualified - illegal weapon: %s", getitemname(.@wp)), 1);
stopnpctimer;
killmonsterall(getmap());
@@ -316,6 +320,7 @@ OnInit:
/////////////////////////////////////////////////////////////////////////////////
001-14,37,84,0 script Hocus#MOLY0900 NPC_BLACKWIZARD,{
+ if (@moly_chall) end;
mes ".:: " + l("Hocus Said So Challenge") + ":: .";
mes l("Description: There'll be differently colored sparks and you must kill ONLY those of the color I say so! Failure to do so will cause immediate disqualification!");
mesc l("PS. No equipment restriction");
@@ -442,6 +447,7 @@ OnClM:
if (@cl != MagentaSpark) {
@moly_score = -1;
@moly_tick = 0;
+ @moly_chall = 0;
dispbottom col(l("You have been disqualified - target was: %s", strmobinfo(1, @cl)), 1);
killmonsterall(getmap());
// FIXME: Stop npc timer
@@ -473,7 +479,76 @@ OnInit:
/////////////////////////////////////////////////////////////////////////////////
// FIXME
001-14,41,46,0 script Hocus#MOLY1000 NPC_BLACKWIZARD,{
- npctalk l("Survival Challenge");
+ if (@moly_chall) end;
+ mes ".:: " + l("Survival Challenge") + ":: .";
+ mes l("Description: Survive for the longest you can without leaving the designed region.");
+ mes l("Using potions and support magic is fine, as well as summons; but using a non-magical weapon will disqualify you.");
+ 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 survived.", FuzzyTime(gettimetick(2) + FYMOLY_SURVIV)), 3;
+ next;
+ mesc l("Begin campaign?"), 1;
+ if (askyesno() == ASK_NO) close;
+ killmonsterall(getmap());
+ @moly_score = 0;
+ @moly_chall = 10;
+ @map$ = getmap();
+ addtimer 500, instance_npcname("Hocus#MOLY1000")+"::OnCheck";
+ closeclientdialog;
+ close;
+
+OnCheck:
+ if (@moly_chall != 10) end;
+ @moly_score += 1;
+ // Game Over
+ if (ispcdead() ||
+ !isin(@map$, 37, 47, 49, 58)) { // NOT a typo - starting square is OK
+ // Game Over!
+ killmonsterall(getmap());
+ @moly_score = @moly_score / 2;
+ dispbottom l("End! Score this time: %s", FuzzyTime(gettimetick(2)+@moly_score));
+ FYMOLY_SURVIV = max(FYMOLY_SURVIV, @moly_score);
+ @moly_score = 0;
+ @moly_chall = 0;
+ end;
+ }
+ /* Spawn */
+ if (!(@moly_score % 2)) {
+ .@m=areamonster(getmap(), 37, 47, 49, 57, strmobinfo(1, EntAbomination), EntAbomination, 1);
+ setunitdata(.@m, UDT_MAXHP, 50 + @moly_score * 5);
+ setunitdata(.@m, UDT_HP, 50 + @moly_score * 5);
+ setunitdata(.@m, UDT_LEVEL, 1 + (@moly_score / 2));
+ setunitdata(.@m, UDT_SPEED, max(50, 900-(@moly_score * 10)));
+ setunitdata(.@m, UDT_MODE, MD_CANMOVE|MD_CANATTACK|MD_AGGRESSIVE|MD_ANGRY);
+ setunitdata(.@m, UDT_DEF, min(32760, 20+@moly_score));
+ setunitdata(.@m, UDT_MDEF, min(32760, @moly_score));
+ setunitdata(.@m, UDT_LUK, min(32760, @moly_score * 7));
+ setunitdata(.@m, UDT_HIT, 32760);
+ setunitdata(.@m, UDT_FLEE, 0);
+ setunitdata(.@m, UDT_ATKMIN, @moly_score);
+ setunitdata(.@m, UDT_ATKMAX, @moly_score+20);
+ setunitdata(.@m, UDT_ADELAY, max(672, 1872-(@moly_score * 4)));
+ }
+ /* Weapon Check */
+ .@wp = getequipid(EQI_HAND_R);
+ // Disarmed
+ if (.@wp < 1) {
+ addtimer 500, instance_npcname("Hocus#MOLY1000")+"::OnCheck";
+ end;
+ }
+ // Illegal weapon
+ if (.@wp != Judgement &&
+ .@wp != DarkPulsar &&
+ .@wp != Lightbringer &&
+ getiteminfo(.@wp, ITEMINFO_SUBTYPE) != W_STAFF) {
+ @moly_score = -1;
+ @moly_tick = 0;
+ @moly_chall = 0;
+ dispbottom col(l("You have been disqualified - illegal weapon: %s", getitemname(.@wp)), 1);
+ killmonsterall(getmap());
+ end;
+ }
+ addtimer 500, instance_npcname("Hocus#MOLY1000")+"::OnCheck";
end;
OnInit:
diff --git a/npc/001-14/hocus.txt b/npc/001-14/hocus.txt
index c63d83b4f..e824d13e4 100644
--- a/npc/001-14/hocus.txt
+++ b/npc/001-14/hocus.txt
@@ -63,7 +63,7 @@ function showScores {
parseScores("Mana Exp Challenge", "$@moly07_n$", "$@moly07_v");
//parseScores("Obstacle Race Challenge", "$@moly08_n$", "$@moly08_v", t());
parseScores("Hocus Commands Challenge", "$@moly09_n$", "$@moly09_v");
- //parseScores("Survive! Challenge", "$@moly10_n$", "$@moly10_v", t());
+ parseScores("Survive! Challenge", "$@moly10_n$", "$@moly10_v", t());
parseScores("Friendship Challenge", "$@moly11_n$", "$@moly11_v");
parseScores("Intensive Mage Challenge", "$@moly12_n$", "$@moly12_v");
mes "";