summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-rw-r--r--npc/029-1_Candor/barrier.txt2
-rw-r--r--npc/029-3_Fight_Cave/barrier.txt2
-rw-r--r--npc/029-3_Fight_Cave/parua.txt92
3 files changed, 86 insertions, 10 deletions
diff --git a/npc/029-1_Candor/barrier.txt b/npc/029-1_Candor/barrier.txt
index a5970bec..a92993ff 100644
--- a/npc/029-1_Candor/barrier.txt
+++ b/npc/029-1_Candor/barrier.txt
@@ -1,5 +1,5 @@
029-1.gat,53,36,0 script #CandorBarrier 127,1,1,{
- if ($@FIGHT_CAVE_STATUS != 0) goto L_Block;
+ if ($@FIGHT_CAVE_STATUS == 1) goto L_Block;
warp "029-3.gat", 46, 23;
end;
diff --git a/npc/029-3_Fight_Cave/barrier.txt b/npc/029-3_Fight_Cave/barrier.txt
index 85655adb..ec8aeb3d 100644
--- a/npc/029-3_Fight_Cave/barrier.txt
+++ b/npc/029-3_Fight_Cave/barrier.txt
@@ -1,5 +1,5 @@
029-3.gat,45,20,0 script #FightCaveBarrier 127,1,1,{
- if ($@FIGHT_CAVE_STATUS != 0) goto L_Block;
+ if ($@FIGHT_CAVE_STATUS == 1) goto L_Block;
warp "029-1.gat", 54, 39;
end;
diff --git a/npc/029-3_Fight_Cave/parua.txt b/npc/029-3_Fight_Cave/parua.txt
index ef99b3b3..f08734e6 100644
--- a/npc/029-3_Fight_Cave/parua.txt
+++ b/npc/029-3_Fight_Cave/parua.txt
@@ -1,7 +1,8 @@
// Parua's fight
-
+// Todo: Remove comments from "getareausers" lines. They are only to facilitate testing
029-3.gat,50,25,0 script Parua 183,{
- if ($@FIGHT_CAVE_STATUS != 0) goto L_Enjoy;
+ if ($@FIGHT_CAVE_STATUS == 1) goto L_Enjoy;
+ if ($@FIGHT_CAVE_STATUS >= 2) goto L_Wait;
mes "[Parua]";
mes "\"Hello.\"";
next;
@@ -13,38 +14,78 @@
mes "\"Very well, for a fee of 20,000 GP, I will awaken that power.\"";
menu "No, what a ripoff!", L_Exit,
"Fine, here you go.", -;
+ if ($@FIGHT_CAVE_STATUS == 1) goto L_AlreadyStarted;
+ if (zeny >= 20000 + 3000) goto L_CallPlayers;
+L_Paying:
+// if (getareausers("029-3.gat", 20, 20, 70, 60) < 5) goto L_NotEnoughPlayers;
if (zeny < 20000) goto L_NotEnough;
- if ($@FIGHT_CAVE_STATUS != 0) goto L_AlreadyStarted;
- if (getareausers("029-3.gat", 20, 20, 70, 60) < 5) goto L_NotEnoughPlayers;
-
set zeny, zeny - 20000;
+
+L_StartFight:
+// if (getareausers("029-3.gat", 20, 20, 70, 60) < 5) goto L_NotEnoughPlayers;
npctalk "Let the battle begin!";
set $@FIGHT_CAVE_STATUS, 1;
set $@FIGHT_CAVE_LEVEL, 1;
set $@FIGHT_CAVE_PLAYER_COUNT, getareausers("029-3.gat", 20, 20, 70, 60);
+ startnpctimer;
+ goto L_Exit;
- set $@FIGHT_CAVE_LAST, 0;
+L_CallPlayers:
+ mes "[Parua]";
+ mes "\"Good... Your money will be very useful. I can awaken this power right now, if you want, or, for an additional fee of 3,000 GP, I can help you gather some of your friends to help you in this battle. What will it be?\"";
+ menu "We are OK. Just do it!", L_Paying,
+ "I will accept your help.", -;
+ mes "[Parua]";
+ mes "\"OK, I can make up to 3 announcements to the people of this world, letting them know that you are about to challenge the powers that sleep in this cave! If you want the fight to start in 5 minutes, I will make one announcement, if it is 15 minutes, I will make 2 announcements, and if it is to start in 30 minutes, it will be 3 announcements.\"";
+ next;
+ mes "\"But be careful! if there aren't at least five people here at the time of the fight, your money will be lost.\"";
+ next;
+ mes "\"So, when should it start?\"";
+ menu "In 5 minutes", -,
+ "In 15 minutes", -,
+ "In 30 minutes", -,
+ "I don't want to wait. Let's start it now!", L_Paying;
+
+// if (getareausers("029-3.gat", 20, 20, 70, 60) < 5) goto L_NotEnoughPlayers;
+ if (zeny < 20000 + 3000) goto L_NotEnough_Announce;
+ set zeny, zeny - (20000 + 3000);
+ set $@SPONSOR$, strcharinfo(0);
+ set $@FIGHT_CAVE_STATUS, $@FIGHT_CAVE_STATUS + (@menu + 2);
+ if ($@FIGHT_CAVE_STATUS == 3) set $@ANNOUNCE_TIME, gettimetick(2) + 300;
+ if ($@FIGHT_CAVE_STATUS == 4) set $@ANNOUNCE_TIME, gettimetick(2) + 900;
+ if ($@FIGHT_CAVE_STATUS == 5) set $@ANNOUNCE_TIME, gettimetick(2) + 1800;
startnpctimer;
- goto L_Exit;
+ close;
L_Enjoy:
mes "[Parua]";
mes "\"Enjoy the fight!\"";
goto L_Exit;
+L_Wait:
+ mes "[Parua]";
+ mes "\"Be Patient... The fight will start in " + ($@ANNOUNCE_TIME - gettimetick(2)) + " seconds.\"";
+ goto L_Exit;
+
L_NotEnough:
mes "[Parua]";
mes "\"Seems you can't meet my fee.\"";
goto L_Exit;
+L_NotEnough_Announce:
+ mes "[Parua]";
+ mes "\"Seems you can't meet the announcement fee.\"";
+ goto L_Exit;
+
L_AlreadyStarted:
mes "[Parua]";
mes "\"Seems your friend already paid me.\"";
goto L_Exit;
L_NotEnoughPlayers:
+ if ($@FIGHT_CAVE_STATUS == 2) goto L_CleanUp_Announcement;
mes "[Parua]";
mes "\"Maybe you should bring some friends with you; this will get messy.\"";
mes "He takes a moment to calculate. \"You'll probably need at least...five people, including yourself.\"";
@@ -57,7 +98,9 @@ L_Exit:
// Fight logic
OnTimer5000:
setnpctimer 0;
- if ($@FIGHT_CAVE_STATUS != 0) goto L_CaveLogic;
+ if ($@FIGHT_CAVE_STATUS == 1) goto L_CaveLogic;
+ if ($@FIGHT_CAVE_STATUS >= 2) goto L_GlobalAnnounce;
+
L_Return_1:
set $@FIGHT_CAVE_PLAYER_COUNT, 0;
areatimer "029-3.gat", 20, 20, 70, 60, 10, "Parua::onTick";
@@ -106,6 +149,30 @@ L_Announce:
set $@FIGHT_CAVE_LAST, $@FIGHT_CAVE_LAST + 30;
goto L_Return_2;
+L_GlobalAnnounce:
+ if ($@FIGHT_CAVE_STATUS == 3) goto L_Five_Minutes;
+ if ($@FIGHT_CAVE_STATUS == 4) goto L_Fifteen_Minutes;
+ if ($@FIGHT_CAVE_STATUS == 5) goto L_Thirty_Minutes;
+ if (gettimetick(2) >= $@ANNOUNCE_TIME) goto L_StartFight;
+ end;
+
+L_Five_Minutes:
+ if ($@ANNOUNCE_TIME - gettimetick(2) > 300) end;
+ announce "Parua: " + $@SPONSOR$ + " invites everyone to a challenge against the powers that sleep in Candor. It is almost time! The fight will start in 5 minutes and, at the moment, there are only " + getareausers("029-3.gat", 20, 20, 70, 60) + " fighter(s) in the cave.", 0;
+ set $@FIGHT_CAVE_STATUS, 2;
+ end;
+
+L_Fifteen_Minutes:
+ if ($@ANNOUNCE_TIME - gettimetick(2) > 900) end;
+ announce "Parua: " + $@SPONSOR$ + " invites everyone to a challenge against the powers that sleep in Candor. You have a good time to prepare yourself for this fight, since it will only start in 15 minutes. Right now, there are " + getareausers("029-3.gat", 20, 20, 70, 60) + " fighter(s) in the cave.", 0;
+ set $@FIGHT_CAVE_STATUS, 3;
+ end;
+
+L_Thirty_Minutes:
+ announce "Parua: " + $@SPONSOR$ + " invites everyone to a challenge against the powers that sleep in Candor. The fight will start in 30 minutes, so prepare yourself and call your friends. At this moment there are " + getareausers("029-3.gat", 20, 20, 70, 60) + " fighter(s) in the cave.", 0;
+ set $@FIGHT_CAVE_STATUS, 4;
+ end;
+
L_MOB1:
set $@MOB_1_SUMMON, $@MOB_1_SUMMON + 1;
set $@FIGHT_CAVE_POINTS, $@FIGHT_CAVE_POINTS - 243;
@@ -167,6 +234,15 @@ L_CleanUp:
setnpctimer 0;
end;
+L_CleanUp_Announcement:
+ npctalk $@SPONSOR$ + " lost the money invested in the fight, since there are less than 5 players in the cave";
+ set $@SPONSOR$, "";
+ set $@ANNOUNCE_TIME, 0;
+ set $@FIGHT_CAVE_STATUS, 0;
+ stopnpctimer;
+ setnpctimer 0;
+ end;
+
onReward:
if (isdead(0)) end;
set BOSS_POINTS, BOSS_POINTS + 100;