bg_join - battleground doc update (#5385)
* Added more information in the doc about waitingroom2bg_single and bg_join commands * Added MF_BATTLEGROUND mapflag check in waitingroom2bg_single and bg_join to prevent the player to join a bg when the battle map is not a battleground map
This commit is contained in:
parent
bd90763ffe
commit
08adc45ba9
@ -9392,6 +9392,7 @@ QMARK_PURPLE - Purple Marker
|
|||||||
Adds the first waiting player from the chat room of the given NPC to an existing battleground group.
|
Adds the first waiting player from the chat room of the given NPC to an existing battleground group.
|
||||||
The player will also be warped to the default spawn point of the battle group or to the specified coordinates
|
The player will also be warped to the default spawn point of the battle group or to the specified coordinates
|
||||||
<x> and <y> on the given <map>.
|
<x> and <y> on the given <map>.
|
||||||
|
Note: The map need the mapflag MF_BATTLEGROUND otherwise the player is removed from the Battleground team.
|
||||||
|
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
@ -9437,6 +9438,7 @@ Returns battle group ID on success. Returns 0 on failure.
|
|||||||
|
|
||||||
Adds an attached player or <char id> if specified to an existing battleground group. The player will also be warped
|
Adds an attached player or <char id> if specified to an existing battleground group. The player will also be warped
|
||||||
to the default spawn point of the battle group or to the specified coordinates <x> and <y> on the given <map>.
|
to the default spawn point of the battle group or to the specified coordinates <x> and <y> on the given <map>.
|
||||||
|
Note: The map need the mapflag MF_BATTLEGROUND otherwise the player is removed from the Battleground team.
|
||||||
|
|
||||||
Returns true on success. Returns false on failure.
|
Returns true on success. Returns false on failure.
|
||||||
|
|
||||||
@ -9566,8 +9568,8 @@ Example:
|
|||||||
Retrieves data related to given Battle Group. Type can be one of the following:
|
Retrieves data related to given Battle Group. Type can be one of the following:
|
||||||
|
|
||||||
0 - Amount of players currently belonging to the group.
|
0 - Amount of players currently belonging to the group.
|
||||||
1 - Store GID of players in <Battle Group> in a temporary global array $@arenamembers
|
1 - Store GID of players in <Battle Group> in a temporary global array $@arenamembers,
|
||||||
and returns amount of players currently belonging to the group.
|
stores and also returns the amount of players currently belonging to the group in $@arenamemberscount.
|
||||||
|
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
|
@ -19970,6 +19970,11 @@ BUILDIN_FUNC(waitingroom2bg_single)
|
|||||||
x = bg->cemetery.x;
|
x = bg->cemetery.x;
|
||||||
y = bg->cemetery.y;
|
y = bg->cemetery.y;
|
||||||
}
|
}
|
||||||
|
if (!map_getmapflag(map_mapindex2mapid(mapindex), MF_BATTLEGROUND)) {
|
||||||
|
ShowWarning("buildin_waitingroom2bg_single: Map %s requires the mapflag MF_BATTLEGROUND.\n", mapindex_id2name(mapindex));
|
||||||
|
script_pushint(st, false);
|
||||||
|
return SCRIPT_CMD_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
nd = npc_name2id(script_getstr(st,6));
|
nd = npc_name2id(script_getstr(st,6));
|
||||||
|
|
||||||
@ -20055,6 +20060,11 @@ BUILDIN_FUNC(bg_join) {
|
|||||||
script_pushint(st, false);
|
script_pushint(st, false);
|
||||||
return SCRIPT_CMD_FAILURE;
|
return SCRIPT_CMD_FAILURE;
|
||||||
}
|
}
|
||||||
|
if (!map_getmapflag(map_mapindex2mapid(mapindex), MF_BATTLEGROUND)) {
|
||||||
|
ShowWarning("buildin_bg_join: Map %s requires the mapflag MF_BATTLEGROUND.\n", mapindex_id2name(mapindex));
|
||||||
|
script_pushint(st, false);
|
||||||
|
return SCRIPT_CMD_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
if (bg_team_join(bg_id, sd, false) && pc_setpos(sd, mapindex, x, y, CLR_TELEPORT) == SETPOS_OK)
|
if (bg_team_join(bg_id, sd, false) && pc_setpos(sd, mapindex, x, y, CLR_TELEPORT) == SETPOS_OK)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user