From ea6e7e30cec79be1624525389dd0a2d93e88471e Mon Sep 17 00:00:00 2001 From: shennetsind Date: Wed, 26 Sep 2012 23:35:57 +0000 Subject: Fixed bugreport:6720 fixed pvp/gvg mapflag handling by setmapflag/removemapflag script commands git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16805 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/script.c | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) (limited to 'src/map') diff --git a/src/map/script.c b/src/map/script.c index bfc186322..35841016f 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -10515,7 +10515,20 @@ BUILDIN_FUNC(getmapflag) return 0; } - +/* pvp timer handling */ +static int script_mapflag_pvp_sub(struct block_list *bl,va_list ap) { + TBL_PC* sd = (TBL_PC*)bl; + if (sd->pvp_timer == INVALID_TIMER) { + sd->pvp_timer = add_timer(gettick() + 200, pc_calc_pvprank_timer, sd->bl.id, 0); + sd->pvp_rank = 0; + sd->pvp_lastusers = 0; + sd->pvp_point = 5; + sd->pvp_won = 0; + sd->pvp_lost = 0; + } + clif_map_property(sd, MAPPROPERTY_FREEPVPZONE); + return 0; +} BUILDIN_FUNC(setmapflag) { int m,i; @@ -10536,10 +10549,18 @@ BUILDIN_FUNC(setmapflag) case MF_NOBRANCH: map[m].flag.nobranch = 1; break; case MF_NOPENALTY: map[m].flag.noexppenalty = 1; map[m].flag.nozenypenalty = 1; break; case MF_NOZENYPENALTY: map[m].flag.nozenypenalty = 1; break; - case MF_PVP: map[m].flag.pvp = 1; break; + case MF_PVP: + map[m].flag.pvp = 1; + if( !battle_config.pk_mode ) { + map_foreachinmap(script_mapflag_pvp_sub,m,BL_PC); + } + break; case MF_PVP_NOPARTY: map[m].flag.pvp_noparty = 1; break; case MF_PVP_NOGUILD: map[m].flag.pvp_noguild = 1; break; - case MF_GVG: map[m].flag.gvg = 1; break; + case MF_GVG: + map[m].flag.gvg = 1; + clif_map_property_mapall(m, MAPPROPERTY_AGITZONE); + break; case MF_GVG_NOPARTY: map[m].flag.gvg_noparty = 1; break; case MF_NOTRADE: map[m].flag.notrade = 1; break; case MF_NOSKILL: map[m].flag.noskill = 1; break; @@ -10614,10 +10635,16 @@ BUILDIN_FUNC(removemapflag) case MF_NOBRANCH: map[m].flag.nobranch = 0; break; case MF_NOPENALTY: map[m].flag.noexppenalty = 0; map[m].flag.nozenypenalty = 0; break; case MF_NOZENYPENALTY: map[m].flag.nozenypenalty = 0; break; - case MF_PVP: map[m].flag.pvp = 0; break; + case MF_PVP: + map[m].flag.pvp = 0; + clif_map_property_mapall(m, MAPPROPERTY_NOTHING); + break; case MF_PVP_NOPARTY: map[m].flag.pvp_noparty = 0; break; case MF_PVP_NOGUILD: map[m].flag.pvp_noguild = 0; break; - case MF_GVG: map[m].flag.gvg = 0; break; + case MF_GVG: + map[m].flag.gvg = 0; + clif_map_property_mapall(m, MAPPROPERTY_NOTHING); + break; case MF_GVG_NOPARTY: map[m].flag.gvg_noparty = 0; break; case MF_NOTRADE: map[m].flag.notrade = 0; break; case MF_NOSKILL: map[m].flag.noskill = 0; break; -- cgit v1.2.3-70-g09d2