Jump to content
  • 0

how to activate mf_nosave in mvp map when MVP is alive?


Question

Posted
diff --git a/src/map/map.hpp b/src/map/map.hpp
index 98bdc69ec0..b6c8d291fe 100644
--- a/src/map/map.hpp
+++ b/src/map/map.hpp
@@ -581,6 +581,7 @@ enum e_mapflag : int16 {
 	MF_NOPENALTY,
 	MF_NOZENYPENALTY,
 	MF_PVP,
+	MF_MAPMVP,
 	MF_PVP_NOPARTY,
 	MF_PVP_NOGUILD,
 	MF_GVG,
diff --git a/src/map/mob.cpp b/src/map/mob.cpp
index 16edfb7a6b..69696f2efc 100644
--- a/src/map/mob.cpp
+++ b/src/map/mob.cpp
@@ -1035,6 +1035,14 @@ TIMER_FUNC(mob_delayspawn){
 		md->spawn_timer = INVALID_TIMER;
 		mob_spawn(md);
 	}
+	/* [cook1e]
+	Spawn MVP and enable MF_PVP and MF_MAPMVP
+	MF_MAPMVP - Disable going to savepoint once you die 2 times in a PVP map.
+	*/
+	if(md->state.boss) {
+		map_setmapflag(bl->m, MF_PVP, true);
+		map_setmapflag(bl->m, MF_MAPMVP, true);
+	}
 	return 0;
 }
 
@@ -1115,6 +1123,15 @@ int mob_spawn (struct mob_data *md)
 		md->bl.m = md->spawn->m;
 		md->bl.x = md->spawn->x;
 		md->bl.y = md->spawn->y;
+		
+		/* [cook1e]
+		Spawn MVP and enable MF_PVP and MF_MAPMVP
+		MF_MAPMVP - Disable going to savepoint once you die 2 times in a PVP map.
+		*/
+		if(md->spawn->state.boss) {  
+			map_setmapflag(md->bl.m, MF_PVP, true);
+			map_setmapflag(md->bl.m, MF_MAPMVP, true);
+		}
 
 		if( (md->bl.x == 0 && md->bl.y == 0) || md->spawn->xs || md->spawn->ys )
 		{	//Monster can be spawned on an area.
@@ -3126,6 +3143,15 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
 	// MvP tomb [GreenBox]
 	if (battle_config.mvp_tomb_enabled && md->spawn->state.boss && map_getmapflag(md->bl.m, MF_NOTOMB) != 1)
 		mvptomb_create(md, mvp_sd ? mvp_sd->status.name : NULL, time(NULL));
+	
+	/* [cook1e]
+	Dead MVP disable MF_PVP and MF_MAPMVP
+	MF_MAPMVP - Disable going to savepoint once you die 2 times in a PVP map.
+	*/
+	if(md->spawn->state.boss) {
+		map_setmapflag(md->bl.m, MF_PVP, false);
+		map_setmapflag(md->bl.m, MF_MAPMVP, false);
+	}
 
 	if( !rebirth )
 		mob_setdelayspawn(md); //Set respawning.
diff --git a/src/map/pc.cpp b/src/map/pc.cpp
index 468f3d58b5..44948f8959 100755
--- a/src/map/pc.cpp
+++ b/src/map/pc.cpp
@@ -9412,7 +9412,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
 			ssd->pvp_point++;
 			ssd->pvp_won++;
 		}
-		if( sd->pvp_point < 0 ) {
+		if( sd->pvp_point < 0 && !mapdata->flag[MF_MAPMVP] ) {
 			sd->respawn_tid = add_timer(tick+1000, pc_respawn_timer,sd->bl.id,0);
 			return 1|8;
 		}
diff --git a/src/map/script_constants.hpp b/src/map/script_constants.hpp
index 13e5ad06f5..24d4b6fcef 100644
--- a/src/map/script_constants.hpp
+++ b/src/map/script_constants.hpp
@@ -464,6 +464,7 @@
 	export_constant(MF_NOPENALTY);
 	export_constant(MF_NOZENYPENALTY);
 	export_constant(MF_PVP);
+	export_constant(MF_MAPMVP);
 	export_constant(MF_PVP_NOPARTY);
 	export_constant(MF_PVP_NOGUILD);
 	export_constant(MF_GVG);

above is a dif to make MVP map pvp on when MVP monster is alive
i want to implement mf_nosave as well when the MVP is alive so its gonna feel like real PVP map
how to do that?
thanks

1 answer to this question

Recommended Posts

  • 0
Posted

maybe try with this
 

diff --git a/src/map/map.hpp b/src/map/map.hpp
index 98bdc69ec0..b6c8d291fe 100644
--- a/src/map/map.hpp
+++ b/src/map/map.hpp
@@ -581,6 +581,7 @@ enum e_mapflag : int16 {
 	MF_NOPENALTY,
 	MF_NOZENYPENALTY,
 	MF_PVP,
+	MF_MAPMVP,
 	MF_PVP_NOPARTY,
 	MF_PVP_NOGUILD,
 	MF_GVG,
diff --git a/src/map/mob.cpp b/src/map/mob.cpp
index 16edfb7a6b..69696f2efc 100644
--- a/src/map/mob.cpp
+++ b/src/map/mob.cpp
@@ -1035,6 +1035,14 @@ TIMER_FUNC(mob_delayspawn){
 		md->spawn_timer = INVALID_TIMER;
 		mob_spawn(md);
 	}
+	/* [cook1e]
+	Spawn MVP and enable MF_PVP and MF_MAPMVP
+	MF_MAPMVP - Disable going to savepoint once you die 2 times in a PVP map.
+	*/
+	if(md->state.boss) {
+		map_setmapflag(bl->m, MF_PVP, true);
+		map_setmapflag(bl->m, MF_MAPMVP, true);
+		map_setmapflag(bl->m, MF_NOSAVE, true);
+	}
 	return 0;
 }
 
@@ -1115,6 +1123,15 @@ int mob_spawn (struct mob_data *md)
 		md->bl.m = md->spawn->m;
 		md->bl.x = md->spawn->x;
 		md->bl.y = md->spawn->y;
+		
+		/* [cook1e]
+		Spawn MVP and enable MF_PVP and MF_MAPMVP
+		MF_MAPMVP - Disable going to savepoint once you die 2 times in a PVP map.
+		*/
+		if(md->spawn->state.boss) {  
+			map_setmapflag(md->bl.m, MF_PVP, true);
+			map_setmapflag(md->bl.m, MF_MAPMVP, true);
+			map_setmapflag(md->bl.m, MF_NOSAVE, true);
+		}
 
 		if( (md->bl.x == 0 && md->bl.y == 0) || md->spawn->xs || md->spawn->ys )
 		{	//Monster can be spawned on an area.
@@ -3126,6 +3143,15 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
 	// MvP tomb [GreenBox]
 	if (battle_config.mvp_tomb_enabled && md->spawn->state.boss && map_getmapflag(md->bl.m, MF_NOTOMB) != 1)
 		mvptomb_create(md, mvp_sd ? mvp_sd->status.name : NULL, time(NULL));
+	
+	/* [cook1e]
+	Dead MVP disable MF_PVP and MF_MAPMVP
+	MF_MAPMVP - Disable going to savepoint once you die 2 times in a PVP map.
+	*/
+	if(md->spawn->state.boss) {
+		map_setmapflag(md->bl.m, MF_PVP, false);
+		map_setmapflag(md->bl.m, MF_MAPMVP, false);
+		map_setmapflag(md->bl.m, MF_NOSAVE, false);
+	}
 
 	if( !rebirth )
 		mob_setdelayspawn(md); //Set respawning.
diff --git a/src/map/pc.cpp b/src/map/pc.cpp
index 468f3d58b5..44948f8959 100755
--- a/src/map/pc.cpp
+++ b/src/map/pc.cpp
@@ -9412,7 +9412,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
 			ssd->pvp_point++;
 			ssd->pvp_won++;
 		}
-		if( sd->pvp_point < 0 ) {
+		if( sd->pvp_point < 0 && !mapdata->flag[MF_MAPMVP] ) {
 			sd->respawn_tid = add_timer(tick+1000, pc_respawn_timer,sd->bl.id,0);
 			return 1|8;
 		}
diff --git a/src/map/script_constants.hpp b/src/map/script_constants.hpp
index 13e5ad06f5..24d4b6fcef 100644
--- a/src/map/script_constants.hpp
+++ b/src/map/script_constants.hpp
@@ -464,6 +464,7 @@
 	export_constant(MF_NOPENALTY);
 	export_constant(MF_NOZENYPENALTY);
 	export_constant(MF_PVP);
+	export_constant(MF_MAPMVP);
 	export_constant(MF_PVP_NOPARTY);
 	export_constant(MF_PVP_NOGUILD);
 	export_constant(MF_GVG);

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...