summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-08-08 01:55:58 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-08-08 01:55:58 +0000
commit12c59ee92f231545497b901bf16fee77f080bfea (patch)
treea5ac684163795a0ab89a1164066c5ea3fe7d75a9 /src/map/script.c
parentf325738db0ff69176476cac7f11e0460bfdbcba4 (diff)
downloadhercules-12c59ee92f231545497b901bf16fee77f080bfea.tar.gz
hercules-12c59ee92f231545497b901bf16fee77f080bfea.tar.bz2
hercules-12c59ee92f231545497b901bf16fee77f080bfea.tar.xz
hercules-12c59ee92f231545497b901bf16fee77f080bfea.zip
- Fixed some missing max levels for npc skills
- Expanded isloggedin script command to support an optional argument (char id) - Expanded warpparty command to accept target "Leader", this will warp the party to the leader. - Added a summon structure to handle non-dead-branch mob-groups since the current implementation totally fails for mob groups that don't have MANY integrants - Fixed mobs not attempting an IDLE skill right before unlocking a target. - Removed a useless variable in the pet_data structure git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10961 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 54866ba5d..ec68e2b9f 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -4215,7 +4215,7 @@ struct script_function buildin_func[] = {
BUILDIN_DEF(warpwaitingpc,"sii?"),
BUILDIN_DEF(attachrid,"i"),
BUILDIN_DEF(detachrid,""),
- BUILDIN_DEF(isloggedin,"i"),
+ BUILDIN_DEF(isloggedin,"i?"),
BUILDIN_DEF(setmapflagnosave,"ssii"),
BUILDIN_DEF(setmapflag,"si*"),
BUILDIN_DEF(removemapflag,"si"),
@@ -5118,6 +5118,26 @@ BUILDIN_FUNC(warpparty)
}
}
}
+ else if(strcmp(str,"Leader")==0)
+ {
+ for(i = 0; i < MAX_PARTY && !p->party.member[i].leader; i++);
+ if (i == MAX_PARTY || !p->data[i].sd) //Leader not found / not online
+ return 0;
+ if(map[p->data[i].sd->bl.m].flag.nowarpto)
+ return 0;
+ mapindex = p->data[i].sd->mapindex;
+ x = p->data[i].sd->bl.x;
+ y = p->data[i].sd->bl.y;
+ for (i = 0; i < MAX_PARTY; i++)
+ {
+ pl_sd = p->data[i].sd;
+ if (!pl_sd)
+ continue;
+ if(map[pl_sd->bl.m].flag.noreturn || map[pl_sd->bl.m].flag.nowarp)
+ continue;
+ pc_setpos(pl_sd,mapindex,x,y,3);
+ }
+ }
else
{
mapindex = mapindex_name2id(str);
@@ -9195,8 +9215,11 @@ BUILDIN_FUNC(detachrid)
*------------------------------------------*/
BUILDIN_FUNC(isloggedin)
{
- push_val(st->stack,C_INT, map_id2sd(
- script_getnum(st,2) )!=NULL );
+ TBL_PC* sd = map_id2sd(script_getnum(st,2));
+ if (script_hasdata(st,3) && sd &&
+ sd->status.char_id != script_getnum(st,3))
+ sd = NULL;
+ push_val(st->stack,C_INT,sd!=NULL);
return 0;
}