diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-19 18:44:01 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-19 18:44:01 +0000 |
commit | e3cf8d5104f6fa28e1af240ac9a98f25a5552e27 (patch) | |
tree | e37fa082ab8405c822e426042747a170e1709132 /src/map/script.c | |
parent | fae3410f42f3a2c4c294478c775f936881f31231 (diff) | |
download | hercules-e3cf8d5104f6fa28e1af240ac9a98f25a5552e27.tar.gz hercules-e3cf8d5104f6fa28e1af240ac9a98f25a5552e27.tar.bz2 hercules-e3cf8d5104f6fa28e1af240ac9a98f25a5552e27.tar.xz hercules-e3cf8d5104f6fa28e1af240ac9a98f25a5552e27.zip |
- Removed the max cap of autoloot so you are now allowed to set autoloot values above 100.
- Initialized w1/w2/w3/w4 before reading each npc line to avoid sending unread values to the parsers (for example, if w4 has a value in one line and none on the next, it will be parsed with the previous value of w4 on the following lines)
- Updated getpartymember to receive an int which specifies what to retrieve. 0: Character names (array $@partymembername$), 1 character char ids (array $@partymembercid), 2 character account ids (array $@partynameaid). By default it returns party member names.
- Updated script_commands.txt with the updated behaviour of getpartymember.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6182 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/map/script.c b/src/map/script.c index 3760e75cf..f5230dc3e 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -504,7 +504,7 @@ struct { {buildin_readparam,"readparam","i*"},
{buildin_getcharid,"getcharid","i*"},
{buildin_getpartyname,"getpartyname","i"},
- {buildin_getpartymember,"getpartymember","i"},
+ {buildin_getpartymember,"getpartymember","i*"},
{buildin_getguildname,"getguildname","i"},
{buildin_getguildmaster,"getguildmaster","i"},
{buildin_getguildmasterid,"getguildmasterid","i"},
@@ -4303,16 +4303,27 @@ int buildin_getpartyname(struct script_state *st) int buildin_getpartymember(struct script_state *st)
{
struct party *p;
- int i,j=0;
+ int i,j=0,type=0;
p=NULL;
p=party_search(conv_num(st,& (st->stack->stack_data[st->start+2])));
+ if( st->end>st->start+3 )
+ type=conv_num(st,& (st->stack->stack_data[st->start+3]));
+
if(p!=NULL){
for(i=0;i<MAX_PARTY;i++){
if(p->member[i].account_id){
-// printf("name:%s %d\n",p->member[i].name,i);
- mapreg_setregstr(add_str((unsigned char *) "$@partymembername$")+(i<<24),p->member[i].name);
+ switch (type) {
+ case 2:
+ mapreg_setreg(add_str((unsigned char *) "$@partymemberaid")+(j<<24),p->member[i].account_id);
+ break;
+ case 1:
+ mapreg_setreg(add_str((unsigned char *) "$@partymembercid")+(j<<24),p->member[i].char_id);
+ break;
+ default:
+ mapreg_setregstr(add_str((unsigned char *) "$@partymembername$")+(j<<24),p->member[i].name);
+ }
j++;
}
}
|