summaryrefslogtreecommitdiff
path: root/world/map/npc/009-7/core.txt
diff options
context:
space:
mode:
Diffstat (limited to 'world/map/npc/009-7/core.txt')
-rw-r--r--world/map/npc/009-7/core.txt76
1 files changed, 30 insertions, 46 deletions
diff --git a/world/map/npc/009-7/core.txt b/world/map/npc/009-7/core.txt
index ab033c66..cc4b9806 100644
--- a/world/map/npc/009-7/core.txt
+++ b/world/map/npc/009-7/core.txt
@@ -49,9 +49,9 @@ L_Missing:
L_Proceed2:
set $@fightclub_myself, 0;
set @target, 0;
- if($@Temp_NoMagic != 1)
+ if($@Temp_NoMagic == 0)
mes "(no rules)";
- if($@Temp_NoMagic == 1) mes "- No Magic";
+ if($@Temp_NoMagic != 0) mes "- No Magic";
set $@Temp_NoMagic, 0; // now we clean these vars ASAP because they're globals
return;
}
@@ -59,14 +59,14 @@ L_Proceed2:
// ** called when someone agree to duel
function|script|fightclub_AddToQueue
{
- set @Duel_Loop, 0;
+ set @ATQ_Loop, 0;
goto L_Loop;
L_Loop:
- if(($@Duel_Queue_Blue$[@Duel_Loop] == @caster_name$) && ($@Duel_Queue_Red$[@Duel_Loop] == @target_name$)) goto L_Exists;
- if(($@Duel_Queue_Red$[@Duel_Loop] == @caster_name$) && ($@Duel_Queue_Blue$[@Duel_Loop] == @target_name$)) goto L_Exists;
- set @Duel_Loop, (@Duel_Loop + 1);
- if(@Duel_Loop >= getarraysize($@Duel_Queue_ID)) goto L_Proceed;
+ if(($@Duel_Queue_Blue$[@ATQ_Loop] == @caster_name$) && ($@Duel_Queue_Red$[@ATQ_Loop] == @target_name$)) goto L_Exists;
+ if(($@Duel_Queue_Red$[@ATQ_Loop] == @caster_name$) && ($@Duel_Queue_Blue$[@ATQ_Loop] == @target_name$)) goto L_Exists;
+ set @ATQ_Loop, (@ATQ_Loop + 1);
+ if(@ATQ_Loop >= getarraysize($@Duel_Queue_ID)) goto L_Proceed2;
goto L_Loop;
L_Exists:
@@ -77,14 +77,14 @@ L_Full:
mes "There is already " + $@Duel_QueueLimit + " battles in the queue, which is the maximum. Please try again later.";
close;
-L_Proceed:
+L_Proceed2:
if(getarraysize($@Duel_Queue_ID) >= ($@Duel_QueueLimit + 1)) goto L_Full;
set @index, getarraysize($@Duel_Queue_ID);
- if(@index >= 1) goto L_Proceed2;
+ if(@index >= 1) goto L_Proceed22;
set @index, 1;
- goto L_Proceed2;
+ goto L_Proceed22;
-L_Proceed2:
+L_Proceed22:
if($@Duel_Queue_Red$[@index] != "") goto L_NotClean;
set $@Duel_Queue_Red$[@index], @caster_name$;
if($@Duel_Queue_Blue$[@index] != "") goto L_NotClean;
@@ -92,7 +92,6 @@ L_Proceed2:
if($@Duel_Queue_ID[@index] != 0) goto L_NotClean;
set $@Duel_Queue_ID[@index], ($@Duel_Queue_ID[(@index - 1)] + 1);
if($@Duel_Queue_ID[@index] <= $Duel_LastDuel) goto L_FixId;
- if($@Duel_CurrentDuel < 1) goto L_Request;
return;
L_NotClean:
@@ -101,11 +100,6 @@ L_NotClean:
L_FixId:
set $@Duel_Queue_ID[@index], ($Duel_LastDuel + 1);
- if($@Duel_CurrentDuel < 1) goto L_Request;
- return;
-
-L_Request:
- callfunc "fightclub_NextBattle";
return;
}
@@ -150,17 +144,18 @@ L_Missing:
return;
L_Proceed2:
- addtimer ($@Duel_TimeBeforeNext * 1000), "#FightClub#utils::OnDelayedNextBattle";
+ addtimer ($@Duel_TimeBeforeNext * 1000), "#FightClubUtils::OnDelayedNextBattle";
return;
}
// ** called after the delay
function|script|fightclub_NextBattleProceed
{
- set $@Duel_NoMagic, (DUELS & $@NoMagicBit); // get the rules of the caster
+ set $@Duel_NoMagic, 0;
+ if((DUELS & $@NoMagicBit) != 0) set $@Duel_NoMagic, 1; // get the rules of the caster
donpcevent "Rouge#Duels::OnAnnounceNext";
set $@Duel_Started, 0;
- addtimer ($@Duel_TimeBeforeWarp * 1000), "#FightClub#utils::OnDelayedStart";
+ addtimer ($@Duel_TimeBeforeWarp * 1000), "#FightClubUtils::OnDelayedStart";
return;
}
@@ -168,7 +163,7 @@ function|script|fightclub_StartBattle
{
set $@Duel_Started, 1;
npcwarp 40, 45, "Rouge#Duels";
- donpcevent "#FightClub#TimeLimit::OnStartTimer";
+ donpcevent "#FightClubTimeLimit::OnStartTimer";
if(attachrid($@Duel_RedPlayer) != 1) goto L_Missing;
callfunc "fightclub_enter";
if(attachrid($@Duel_BluePlayer) != 1) goto L_Missing;
@@ -183,7 +178,6 @@ L_Missing:
function|script|fightclub_TimeOut
{
- debugmes "on time out";
donpcevent "Rouge#Duels::OnAnnounceTimeOut";
if(attachrid($@Duel_RedPlayer) != 1) goto L_Missing;
callfunc "fightclub_exit";
@@ -226,8 +220,11 @@ function|script|fightclub_Victory
// ** called when the player needs to be reset
function|script|fightclub_DestroyMe
{
- callfunc "fightclub_exit";
- percentheal -100, 0; // dying removes @killable, @killer or any temp buff
+ set @Duel_Fighter, 0;
+ sc_end 132; sc_end 14; sc_end 37; sc_end 185; sc_end 194; sc_end 195; sc_end 196; sc_end 197; sc_end 198; sc_end 199; // remove effects
+ percentheal -100, 0; // doing @killer is unreliable
+ gmcommand "@alive"; // refill hp/mana
+ if(getmap() == "009-7") warp "009-7.gat", rand($@fightclub_x1, $@fightclub_x2), rand(($@fightclub_y1 - 2), ($@fightclub_y1 - 3));
return;
}
@@ -278,14 +275,12 @@ L_Resume:
// ** called after the server boots up
function|script|fightclub_StartUp
{
- if($fightclub_enabled < 1) set $fightclub_enabled, 1; // init the (permanent) enabled global (this will only be done once, when the duel system is merged with master)
if($@Duel_TimeBeforeNext < 1) set $@Duel_TimeBeforeNext, 5; // init the (temporary) TimeBeforeNext global
if($@Duel_TimeBeforeWarp < 1) set $@Duel_TimeBeforeWarp, 5; // init the (temporary) TimeBeforeWarp global
if($@Duel_TimeBeforeStart < 1) set $@Duel_TimeBeforeStart, 3; // init the (temporary) TimeBeforeStart global
if($@Duel_TimeLimit < 1) set $@Duel_TimeLimit, 120; // init the (temporary) TimeLimit global
if($@Duel_QueueLimit < 1) set $@Duel_QueueLimit, 5; // init the (temporary) QueueLimit global
if($@Duel_PlayerQueueLimit < 1) set $@Duel_PlayerQueueLimit, 2; // init the (temporary) PlayerQueueLimit global
- if($@fightclub_password$ == "") set $@fightclub_password$, "Banana"; // init the (temporary) fightclub_password global
setarray $@Duel_Queue_ID, 0;
cleararray $@Duel_Queue_ID, 0, ($@Duel_QueueLimit + 1);
setarray $@Duel_Queue_Blue$, "";
@@ -293,9 +288,12 @@ function|script|fightclub_StartUp
setarray $@Duel_Queue_Red$, "";
cleararray $@Duel_Queue_Red$, "", ($@Duel_QueueLimit + 1);
set $@Duel_TotalTime, 0;
- // flags below
+ // DUELS flags below
set $@DuelPvpBit, (1 << 1);
set $@NoMagicBit, (1 << 2);
+ // $SANGUINE flags below
+ set $@SV_FCDBit, (1 << 1);
+ set $@SV_BMDBit, (1 << 2);
return;
}
@@ -312,7 +310,7 @@ function|script|fightclub_CleanStage
set $@Duel_Missing, 0;
set $@Duel_TotalTime, 0;
npcwarp 32, 45, "Rouge#Duels";
- donpcevent "#FightClub#TimeLimit::OnStopTimer";
+ donpcevent "#FightClubTimeLimit::OnStopTimer";
killmonster "009-7.gat", "All";
return;
}
@@ -335,7 +333,6 @@ L_Start:
goto L_NoMagic;
L_NoMagic:
- if((DUELS & $@NoMagicBit) != 1) goto L_Done;
mes "Do you want to allow magic?";
mes "If disabled, the fighters will not be able to use any kind of spell.";
menu
@@ -387,9 +384,7 @@ L_BlueWins:
goto L_Missing;
L_Missing:
- callfunc "fightclub_CleanStage";
- callfunc "fightclub_NextBattle";
- return;
+ goto L_Proceed;
L_BlueWins2:
callfunc "fightclub_exit";
@@ -397,7 +392,6 @@ L_BlueWins2:
L_Proceed:
callfunc "fightclub_CleanStage";
- callfunc "fightclub_NextBattle";
return;
L_Murdered:
@@ -426,8 +420,9 @@ function|script|fightclub_enter
set @Duel_Fighter, 1;
warp "009-7.gat", rand($@fightclub_x1,$@fightclub_x2), rand($@fightclub_y1,$@fightclub_y2);
gmcommand "@alive"; // ensure that you can't duel wih a corpse
+ sc_end 132; sc_end 14; sc_end 37; sc_end 185; sc_end 194; sc_end 195; sc_end 196; sc_end 197; sc_end 198; sc_end 199; // remove effects
message strcharinfo(0), "Get Ready.";
- addtimer ($@Duel_TimeBeforeStart * 1000), "#FightClub#utils::OnBecomeKiller"; // call fightclub_enter_killer in 3 seconds
+ addtimer ($@Duel_TimeBeforeStart * 1000), "#FightClubUtils::OnBecomeKiller"; // call fightclub_enter_killer in 3 seconds
return;
}
@@ -436,7 +431,6 @@ function|script|fightclub_enter_killer
{
gmcommand "@killable";
gmcommand "@killer"; // add both killable and killer so if one doesn't kick in, the other (hopefully) will
- set @killer, 1;
message strcharinfo(0), "GO !";
return;
}
@@ -444,17 +438,7 @@ function|script|fightclub_enter_killer
// ** called every time a player exits the ring
function|script|fightclub_exit
{
- set @Duel_Fighter, 0;
- if(getmap() == "009-7") warp "009-7.gat", 31, 40; // do not warp if player left the room
- if(@killer != 1) goto L_Clean;
- gmcommand "@killable";
- gmcommand "@killer";
- goto L_Clean;
-
-L_Clean:
- set @killer, 0; // the player no longer have @killer
- gmcommand "@alive"; // refill hp/mana
- sc_end 132; sc_end 14; sc_end 37; sc_end 185; // remove effects
+ callfunc "fightclub_DestroyMe"; // kill and reset state
message strcharinfo(0), "Thank you for participating in the fight club!";
if(@Duel_HasPendingRequest) message strcharinfo(0), "You have received a new duel request.";
return;