summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmistry <Equinox1991@gmail.com>2015-09-06 05:35:33 +0800
committerEmistry <Equinox1991@gmail.com>2015-09-06 05:35:33 +0800
commit1bd8e9d50ed6de9433c3d6ccb842491cdafcd0a1 (patch)
treee133a4ef06b5fa55f166f7500ef805b9c405e343
parente6d9b557c979954d49f80d180696d0fa50ff1db0 (diff)
downloadhercules-1bd8e9d50ed6de9433c3d6ccb842491cdafcd0a1.tar.gz
hercules-1bd8e9d50ed6de9433c3d6ccb842491cdafcd0a1.tar.bz2
hercules-1bd8e9d50ed6de9433c3d6ccb842491cdafcd0a1.tar.xz
hercules-1bd8e9d50ed6de9433c3d6ccb842491cdafcd0a1.zip
Updated getwaitingroomstate() script command.
type 0 - return number of users in the waiting room and account_id list stored in $@chatmembers[] type 34 - Minimum Base Level to enter waiting room. type 35 - Maximum Base Level to enter waiting room. type 36 - Minimum Zeny to enter waiting room.
-rw-r--r--doc/script_commands.txt7
-rw-r--r--src/map/script.c16
2 files changed, 21 insertions, 2 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 9d3673490..146e58a45 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -6798,7 +6798,8 @@ if any.
The valid information types are:
- 0 - Number of users currently chatting.
+ 0 - Number of users currently in the waiting room
+ $@chatmembers[] - list of user account_id
1 - Maximum number of users allowed.
2 - Will return 1 if the waiting room has a trigger set.
0 otherwise.
@@ -6811,6 +6812,10 @@ The valid information types are:
32 - Whether or not the waiting room is full.
33 - Whether the amount of users in the waiting room is higher than the
trigger number.
+ 34 - Minimum Base Level to enter waiting room.
+ 35 - Maximum Base Level to enter waiting room.
+ 36 - Minimum Zeny to enter waiting room.
+
---------------------------------------
diff --git a/src/map/script.c b/src/map/script.c
index 23cf034b8..e134730da 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -11420,6 +11420,10 @@ BUILDIN(disablewaitingroomevent) {
/// <type>=16 : the name of the waiting room event
/// <type>=32 : if the waiting room is full
/// <type>=33 : if there are enough users to trigger the event
+/// -- Custom Added
+/// <type>=34 : minimum player of waiting room
+/// <type>=35 : maximum player of waiting room
+/// <type>=36 : minimum zeny required
///
/// getwaitingroomstate(<type>,"<npc_name>") -> <info>
/// getwaitingroomstate(<type>) -> <info>
@@ -11440,7 +11444,13 @@ BUILDIN(getwaitingroomstate) {
}
switch(type) {
- case 0: script_pushint(st, cd->users); break;
+ case 0:
+ for (int i = 0; i < cd->users; i++) {
+ struct map_session_data *sd = cd->usersd[i];
+ mapreg->setreg(reference_uid(script->add_str("$@chatmembers"), i), sd->bl.id);
+ }
+ script_pushint(st, cd->users);
+ break;
case 1: script_pushint(st, cd->limit); break;
case 2: script_pushint(st, cd->trigger&0x7f); break;
case 3: script_pushint(st, ((cd->trigger&0x80)!=0)); break;
@@ -11449,6 +11459,10 @@ BUILDIN(getwaitingroomstate) {
case 16: script_pushstrcopy(st, cd->npc_event);break;
case 32: script_pushint(st, (cd->users >= cd->limit)); break;
case 33: script_pushint(st, (cd->users >= cd->trigger)); break;
+
+ case 34: script_pushint(st, cd->minLvl); break;
+ case 35: script_pushint(st, cd->maxLvl); break;
+ case 36: script_pushint(st, cd->zeny); break;
default: script_pushint(st, -1); break;
}
return true;