summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-06 15:58:30 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-06 15:58:30 +0000
commitbb0e0bcc5d4da8331f6fb33c879b2d757855722a (patch)
tree4b768273eb0b136ca23f71f1b4504ed34c1ab8b2 /src/map/script.c
parent4ecf64221cb558786e4581f4ac7ffa733fa3e4d5 (diff)
downloadhercules-bb0e0bcc5d4da8331f6fb33c879b2d757855722a.tar.gz
hercules-bb0e0bcc5d4da8331f6fb33c879b2d757855722a.tar.bz2
hercules-bb0e0bcc5d4da8331f6fb33c879b2d757855722a.tar.xz
hercules-bb0e0bcc5d4da8331f6fb33c879b2d757855722a.zip
- Ganbantein's delay is now 2 secs.
- Removed the time2 value of NJ_NEN since it has no use. - Removed the return code entry when logging GM reload-GM requests (login-sql),it'll just be stored as zero. - Added a fix on socket.c to not pick INADDR_ANY when choosing our own IP. - Applied the correction on maprespawnguildid so that it parses ALL players and not just those on a map. - TK_JUMPKICK now dispels normal aspd/speed potions (not berserk pitched ones) and Preserve will be unable to block this. - Soul Linkers are now inmune to SA_DISPEL - You can now place everything (except magic skills) on top of LPs. - Corrected Ganbantein to not touch song/dance/ensembles. - Status_calc_pc will refuse to execute if the player is still tagged as a "new connection" and the invocation is not meant to be the first one. - Swapped the order of checks in status_isimmune so that Wand of Hermod skill blocking takes precedence over GTB's - Client packets will all be ignored while a player is not on a map until the LoadEndAck packet is received. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9152 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c52
1 files changed, 29 insertions, 23 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 2df67fcb1..9c9a5fc21 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -8650,30 +8650,31 @@ int buildin_emotion(struct script_state *st)
return 0;
}
-int buildin_maprespawnguildid_sub(struct block_list *bl,va_list ap)
+static int buildin_maprespawnguildid_sub_pc(DBKey key, void *data, va_list ap)
{
- int g_id=va_arg(ap,int);
- int flag=va_arg(ap,int);
- struct map_session_data *sd=NULL;
- struct mob_data *md=NULL;
+ va_list ap2 = va_arg(ap, va_list); // double decode -_-
+ int m=va_arg(ap2,int);
+ int g_id=va_arg(ap2,int);
+ int flag=va_arg(ap2,int);
+ struct map_session_data *sd = (TBL_PC*)data;
- if(bl->type == BL_PC)
- sd=(struct map_session_data*)bl;
- if(bl->type == BL_MOB)
- md=(struct mob_data *)bl;
+ if(!sd || sd->bl.m != m)
+ return 0;
+ if(
+ ((sd->status.guild_id == g_id) && flag&1) || //Warp out owners
+ ((sd->status.guild_id != g_id) && flag&2) || //Warp out outsiders
+ (sd->status.guild_id == 0) // Warp out players not in guild [Valaris]
+ )
+ pc_setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,3);
+ return 1;
+}
- if(sd){
- if((sd->status.guild_id == g_id) && (flag&1))
- pc_setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,3);
- else if((sd->status.guild_id != g_id) && (flag&2))
- pc_setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,3);
- else if (sd->status.guild_id == 0) // Warp out players not in guild [Valaris]
- pc_setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,3); // end addition [Valaris]
- }
- if(md && flag&4){
- if(!md->guardian_data && md->class_ != MOBID_EMPERIUM)
- unit_remove_map(bl,1);
- }
+static int buildin_maprespawnguildid_sub_mob(struct block_list *bl,va_list ap)
+{
+ struct mob_data *md=(struct mob_data *)bl;
+
+ if(!md->guardian_data && md->class_ != MOBID_EMPERIUM)
+ status_kill(bl);
return 0;
}
@@ -8685,8 +8686,13 @@ int buildin_maprespawnguildid(struct script_state *st)
int m=map_mapname2mapid(mapname);
- if(m != -1)
- map_foreachinmap(buildin_maprespawnguildid_sub,m,BL_CHAR,g_id,flag);
+ if(m == -1)
+ return 0;
+
+ //Catch ALL players (in case some are 'between maps' on execution time)
+ map_foreachpc(buildin_maprespawnguildid_sub_pc,m,g_id,flag);
+ if (flag&4) //Remove script mobs.
+ map_foreachinmap(buildin_maprespawnguildid_sub_mob,m,BL_MOB);
return 0;
}