Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjusted death event for Emperium Battleground #3967

Merged
merged 1 commit into from Feb 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions doc/script_commands.txt
Expand Up @@ -9195,6 +9195,10 @@ The player will also be warped to the default spawn point of the battle group or
<On Quit Event> refers to an NPC label that attaches to the character and is run when they relog. (Optional)
<On Death Event> refers to an NPC label that attaches to the character and is run when they die. (Optional)

If "-" is supplied for <map name> then the player will not automatically respawn after the 1 second delay.
This allows for better manipulation of <On Death Event>. The player will have to be warped to desired location
at the end of <On Death Event>.

Unlike the prior command, the latter will attach a GROUP in a waiting room to the battleground, and
sets the array $@arenamembers[0] where 0 holds the IDs of the first group, and 1 holds the IDs of the second.

Expand All @@ -9215,6 +9219,10 @@ Creates an instance of battleground battle group that can be used with other bat
<On Quit Event> refers to an NPC label that attaches to the character and is run when they relog. (Optional)
<On Death Event> refers to an NPC label that attaches to the character and is run when they die. (Optional)

If "-" is supplied for <map name> then the player will not automatically respawn after the 1 second delay.
This allows for better manipulation of <On Death Event>. The player will have to be warped to desired location
at the end of <On Death Event>.

Returns battle group ID on success. Returns 0 on failure.

---------------------------------------
Expand Down
22 changes: 9 additions & 13 deletions npc/custom/battleground/bg_emp.txt
@@ -1,17 +1,12 @@
//===== rAthena Script =======================================
//= Battleground: Emperium
//===== By: ==================================================
//= AnnieRuru
//===== Current Version: =====================================
//= 1.1
//===== Compatible With: =====================================
//= rAthena Project
//===== Description: =========================================
//= A simple battleground script:
//= Destroy the opponent's Emperium to win the match.
//===== Additional Comments: =================================
//= 1.0 First version, edited. [Euphy]
//===== Changelogs: ==========================================
//= 1.0 First version, edited. [Euphy] [AnnieRuru]
//= 1.1 Use up to date battleground script commands [AnnieRuru]
//= 1.2 Fix player can be kill multiple times within 250ms time frame [AnnieRuru]
//============================================================

- script bg_emp#control -1,{
Expand All @@ -26,8 +21,8 @@ OnStart:
end;

// create Battleground and teams
.red = waitingroom2bg( "bat_a01", 157,347, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDead", .rednpcname$ );
.blue = waitingroom2bg( "bat_a01", 142,51, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDead", .bluenpcname$ );
.red = waitingroom2bg( "-", 0,0, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDead", .rednpcname$ );
.blue = waitingroom2bg( "-", 0,0, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDead", .bluenpcname$ );
delwaitingroom .rednpcname$;
delwaitingroom .bluenpcname$;
setwall "bat_a01", 164,347, 6, 4, 0, "bg_emp_town_red";
Expand Down Expand Up @@ -84,9 +79,10 @@ L_EmpDown:
end;

// "OnDeath" event
OnRedDead:
OnBlueDead:
sleep2 1250;
OnRedDead: callsub L_Dead, 157,347;
OnBlueDead: callsub L_Dead, 142,51;
L_Dead:
warp "bat_a01", getarg(0), getarg(1);
percentheal 100,100;
end;

Expand Down