summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-09-26 23:35:57 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-09-26 23:35:57 +0000
commitea6e7e30cec79be1624525389dd0a2d93e88471e (patch)
tree390ffd7064b56577b59c26968a2be5ea9e142475
parent5f27a7bab8da0b9257ada110662fdda3d520e135 (diff)
downloadhercules-ea6e7e30cec79be1624525389dd0a2d93e88471e.tar.gz
hercules-ea6e7e30cec79be1624525389dd0a2d93e88471e.tar.bz2
hercules-ea6e7e30cec79be1624525389dd0a2d93e88471e.tar.xz
hercules-ea6e7e30cec79be1624525389dd0a2d93e88471e.zip
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
-rw-r--r--src/map/script.c37
1 files changed, 32 insertions, 5 deletions
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;