Jump to content

Release: PK mode if MVP is alive.


Chun3

Recommended Posts


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.01
  • Content Count:  67
  • Reputation:   9
  • Joined:  08/22/19
  • Last Seen:  

PK mode if MVP is alive.


When a mvp spawns on his natural map, the pk mode goes on, when he dies, off.

@monster or script commands doesn't trigger.


 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  109
  • Reputation:   5
  • Joined:  03/17/16
  • Last Seen:  

Great release mate!! but it is possible  put range the pk mode, not in whole map.

 

example, 40 Cell near the boss

Edited by noobzter003
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  70
  • Reputation:   0
  • Joined:  06/19/18
  • Last Seen:  

Great release!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.01
  • Content Count:  67
  • Reputation:   9
  • Joined:  08/22/19
  • Last Seen:  

9 hours ago, noobzter003 said:

Great release mate!! but it is possible  put range the pk mode, not in whole map.

example, 40 Cell near the boss

Will search for it later, since you have x and y from the respawn, just need to know how to set cellflagpvp using src

3 hours ago, Psy Ops said:

Great release!

Thanks!

Link to comment
Share on other sites

  • 4 months later...

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  150
  • Reputation:   11
  • Joined:  12/03/18
  • Last Seen:  

Hi, just a question. Tried the script.

This is my error. Currently using rathena trunk from 2019 February.

diff.PNG

Link to comment
Share on other sites

  • 2 months later...

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  88
  • Reputation:   0
  • Joined:  08/25/12
  • Last Seen:  

On 2/19/2020 at 10:42 PM, Dev G Inc said:

Hi, just a question. Tried the script.

This is my error. Currently using rathena trunk from 2019 February.

diff.PNG

anyone have this fix diff for latest rathena

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  59
  • Topics Per Day:  0.01
  • Content Count:  396
  • Reputation:   53
  • Joined:  07/24/12
  • Last Seen:  

51 minutes ago, Obiwan said:

anyone have this fix diff for latest rathena

This fix source already added on the description, next time read before click

 

	//On latest rAthena:
	
	open src/map/mob.c
	
	on 	int mob_delayspawn
	find
	md->spawn_timer = INVALID_TIMER;
		mob_spawn(md);
	
	change to
	
	
		md->spawn_timer = INVALID_TIMER;
		mob_spawn(md);
++		if( md->state.boss ) {
++		map_setmapflag(bl->m, MF_PVP, true);
++		}
		

	
	on	int mob_spawn
	find
	if (md->spawn) { //Respawn data
		md->bl.m = md->spawn->m;
		md->bl.x = md->spawn->x;
		md->bl.y = md->spawn->y;
	
	change to
	if (md->spawn) { //Respawn data
		md->bl.m = md->spawn->m;
		md->bl.x = md->spawn->x;
		md->bl.y = md->spawn->y;
++		if(md->spawn->state.boss)  map_setmapflag(md->bl.m, MF_PVP, true);
	
	
	


	on	int mob_dead
	find
	
			// MvP tomb [GreenBox]
	if (battle_config.mvp_tomb_enabled && md->spawn->state.boss && map[md->bl.m].flag.notomb != 1)
		mvptomb_create(md, mvp_sd ? mvp_sd->status.name : NULL, time(NULL));
	
	change to (Config your mvp_tomb_enabled on battle folder.)
	
		// MvP tomb [GreenBox]
	if (battle_config.mvp_tomb_enabled && md->spawn->state.boss && map[md->bl.m].flag.notomb != 1)
		mvptomb_create(md, mvp_sd ? mvp_sd->status.name : NULL, time(NULL));
++	if(md->spawn->state.boss)  {
++	map_setmapflag(md->bl.m, MF_PVP, false);
++	}
	
	recompile and is ready.
	
	

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  88
  • Reputation:   0
  • Joined:  08/25/12
  • Last Seen:  

2 hours ago, Zack- said:

This fix source already added on the description, next time read before click

 


	//On latest rAthena:
	
	open src/map/mob.c
	
	on 	int mob_delayspawn
	find
	md->spawn_timer = INVALID_TIMER;
		mob_spawn(md);
	
	change to
	
	
		md->spawn_timer = INVALID_TIMER;
		mob_spawn(md);
++		if( md->state.boss ) {
++		map_setmapflag(bl->m, MF_PVP, true);
++		}
		

	
	on	int mob_spawn
	find
	if (md->spawn) { //Respawn data
		md->bl.m = md->spawn->m;
		md->bl.x = md->spawn->x;
		md->bl.y = md->spawn->y;
	
	change to
	if (md->spawn) { //Respawn data
		md->bl.m = md->spawn->m;
		md->bl.x = md->spawn->x;
		md->bl.y = md->spawn->y;
++		if(md->spawn->state.boss)  map_setmapflag(md->bl.m, MF_PVP, true);
	
	
	


	on	int mob_dead
	find
	
			// MvP tomb [GreenBox]
	if (battle_config.mvp_tomb_enabled && md->spawn->state.boss && map[md->bl.m].flag.notomb != 1)
		mvptomb_create(md, mvp_sd ? mvp_sd->status.name : NULL, time(NULL));
	
	change to (Config your mvp_tomb_enabled on battle folder.)
	
		// MvP tomb [GreenBox]
	if (battle_config.mvp_tomb_enabled && md->spawn->state.boss && map[md->bl.m].flag.notomb != 1)
		mvptomb_create(md, mvp_sd ? mvp_sd->status.name : NULL, time(NULL));
++	if(md->spawn->state.boss)  {
++	map_setmapflag(md->bl.m, MF_PVP, false);
++	}
	
	recompile and is ready.
	
	

 

mob.cpp: In function ‘int mob_delayspawn(int, t_tick, int, intptr_t)’:
mob.cpp:1052:1: error: a function-definition is not allowed here before ‘{’ toke                                                                             n
 {
 ^
mob.cpp:1088:54: error: a function-definition is not allowed here before ‘{’ tok                                                                             en
 int mob_count_sub(struct block_list *bl, va_list ap) {
                                                      ^
mob.cpp:1105:1: error: a function-definition is not allowed here before ‘{’ toke                                                                             n
 {
 ^
mob.cpp:1207:1: error: a function-definition is not allowed here before ‘{’ toke                                                                             n
 {
 ^
mob.cpp:1241:1: error: a function-definition is not allowed here before ‘{’ toke                                                                             n
 {
 ^
mob.cpp:1268:1: error: a function-definition is not allowed here before ‘{’ toke                                                                             n
 {
 ^
mob.cpp:1330:1: error: a function-definition is not allowed here before ‘{’ toke                                                                             n
 {
 ^
mob.cpp:1356:70: error: a function-definition is not allowed here before ‘{’ tok                                                                             en
 static int mob_ai_sub_hard_bg_ally(struct block_list *bl,va_list ap) {
                                                                      ^
mob.cpp:1374:1: error: a function-definition is not allowed here before ‘{’ toke                                                                             n
 {
 ^
mob.cpp:1398:64: error: a function-definition is not allowed here before ‘{’ tok                                                                             en
 static int mob_warpchase_sub(struct block_list *bl,va_list ap) {
                                                                ^
mob.cpp:1430:1: error: a function-definition is not allowed here before ‘{’ toke                                                                             n
 {
 ^
mob.cpp:1516:1: error: a function-definition is not allowed here before ‘{’ toke                                                                             n
 {
 ^
mob.cpp:1565:1: error: a function-definition is not allowed here before ‘{’ toke                                                                             n
 {
 ^
mob.cpp:1660:1: error: a function-definition is not allowed here before ‘{’ toke                                                                             n
 {
 ^
mob.cpp:1686:1: error: a function-definition is not allowed here before ‘{’ toke                                                                             n
 {
 ^
mob.cpp:1977:1: error: a function-definition is not allowed here before ‘{’ toke                                                                             n
 {
 ^
mob.cpp:1993:1: error: a function-definition is not allowed here before ‘{’ toke                                                                             n
 {
 ^
mob.cpp:2004:1: error: a function-definition is not allowed here before ‘{’ toke                                                                             n
 {
 ^
mob.cpp:2079:31: error: a function-definition is not allowed here before ‘{’ tok                                                                             en
 static TIMER_FUNC(mob_ai_lazy){
                               ^
mob.cpp:2087:31: error: a function-definition is not allowed here before ‘{’ tok                                                                             en
 static TIMER_FUNC(mob_ai_hard){
                               ^
mob.cpp:2103:75: error: a function-definition is not allowed here before ‘{’ tok                                                                             en
 void mob_setdropitem_option(struct item *itm, struct s_mob_drop *mobdrop) {
                                                                           ^
mob.cpp:2120:1: error: a function-definition is not allowed here before ‘{’ toke                                                                             n
 {
 ^
mob.cpp:2136:1: error: a function-definition is not allowed here before ‘{’ toke                                                                             n
 {
 ^
mob.cpp:2154:39: error: a function-definition is not allowed here before ‘{’ tok                                                                             en
 static TIMER_FUNC(mob_delay_item_drop){
                                       ^
mob.cpp:2182:1: error: a function-definition is not allowed here before ‘{’ toke                                                                             n
 {
 ^
mob.cpp:2218:29: error: a function-definition is not allowed here before ‘{’ tok                                                                             en
 TIMER_FUNC(mob_timer_delete){
                             ^
mob.cpp:2240:1: error: a function-definition is not allowed here before ‘{’ toke                                                                             n
 {
 ^
mob.cpp:2257:1: error: a function-definition is not allowed here before ‘{’ toke                                                                             n
 {
 ^
mob.cpp:2264:24: error: a function-definition is not allowed here before ‘{’ tok                                                                             en
 TIMER_FUNC(mob_respawn){
                        ^
mob.cpp:2273:1: error: a function-definition is not allowed here before ‘{’ toke                                                                             n
 {
 ^
mob.cpp:2397:1: error: a function-definition is not allowed here before ‘{’ toke                                                                             n
 {
 ^
mob.cpp:2442:1: error: a function-definition is not allowed here before ‘{’ toke                                                                             n
 {
 ^
mob.cpp:5734:1: error: expected ‘}’ at end of input
 }
 ^
make[1]: *** [obj/mob.o] Error 1
make[1]: Leaving directory `/root/trunk/src/map'
make: *** [map] Error 2

hello i got this error i did what on the diff files

 

update: fixed now thank you

Edited by Obiwan
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  150
  • Reputation:   11
  • Joined:  12/03/18
  • Last Seen:  

3 hours ago, Zack- said:

This fix source already added on the description, next time read before click

 


	//On latest rAthena:
	
	open src/map/mob.c
	
	on 	int mob_delayspawn
	find
	md->spawn_timer = INVALID_TIMER;
		mob_spawn(md);
	
	change to
	
	
		md->spawn_timer = INVALID_TIMER;
		mob_spawn(md);
++		if( md->state.boss ) {
++		map_setmapflag(bl->m, MF_PVP, true);
++		}
		

	
	on	int mob_spawn
	find
	if (md->spawn) { //Respawn data
		md->bl.m = md->spawn->m;
		md->bl.x = md->spawn->x;
		md->bl.y = md->spawn->y;
	
	change to
	if (md->spawn) { //Respawn data
		md->bl.m = md->spawn->m;
		md->bl.x = md->spawn->x;
		md->bl.y = md->spawn->y;
++		if(md->spawn->state.boss)  map_setmapflag(md->bl.m, MF_PVP, true);
	
	
	


	on	int mob_dead
	find
	
			// MvP tomb [GreenBox]
	if (battle_config.mvp_tomb_enabled && md->spawn->state.boss && map[md->bl.m].flag.notomb != 1)
		mvptomb_create(md, mvp_sd ? mvp_sd->status.name : NULL, time(NULL));
	
	change to (Config your mvp_tomb_enabled on battle folder.)
	
		// MvP tomb [GreenBox]
	if (battle_config.mvp_tomb_enabled && md->spawn->state.boss && map[md->bl.m].flag.notomb != 1)
		mvptomb_create(md, mvp_sd ? mvp_sd->status.name : NULL, time(NULL));
++	if(md->spawn->state.boss)  {
++	map_setmapflag(md->bl.m, MF_PVP, false);
++	}
	
	recompile and is ready.
	
	

 

Thanks Boss Zack ?

Link to comment
Share on other sites

  • 5 months later...

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.05
  • Content Count:  478
  • Reputation:   14
  • Joined:  11/30/17
  • Last Seen:  

Hi there! good script can you also add modification to disable @warp command directly to that particular map when mvp are alive and can @warp again after mvp is killed

Link to comment
Share on other sites

  • 3 months later...

  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.06
  • Content Count:  241
  • Reputation:   11
  • Joined:  08/12/20
  • Last Seen:  

Looks like this diff, doesn't work on latest rathena? I already tried to replace my working mob.cpp and recompiled and got same errors.

 


image.png.dec27f7d4fa707f3324b5836871b287c.pngimage.png.931bc57f96bd15bf56827737a240dcbf.png

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  91
  • Reputation:   17
  • Joined:  11/24/14
  • Last Seen:  

@@ -1058,6 +1058,9 @@ TIMER_FUNC(mob_delayspawn){
		}
		md->spawn_timer = INVALID_TIMER;
		mob_spawn(md);
+		if( md->state.boss ) {
+		map_setmapflag(bl->m, MF_PVP, true);
+		}
	}
	return 0;
}
@ -1139,6 +1142,7 @@ 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;
+		if(md->spawn->state.boss)  map_setmapflag(md->bl.m, MF_PVP, true);

		if( (md->bl.x == 0 && md->bl.y == 0) || md->spawn->xs || md->spawn->ys )
		{	//Monster can be spawned on an area.
@ -3158,6 +3162,9 @@ 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));
+	if(md->spawn->state.boss)  {
+	map_setmapflag(md->bl.m, MF_PVP, false);
+	}

	if( !rebirth )
		mob_setdelayspawn(md); //Set respawning.

@Almond Snicker

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.06
  • Content Count:  241
  • Reputation:   11
  • Joined:  08/12/20
  • Last Seen:  

9 hours ago, JinYuichi said:

@@ -1058,6 +1058,9 @@ TIMER_FUNC(mob_delayspawn){
		}
		md->spawn_timer = INVALID_TIMER;
		mob_spawn(md);
+		if( md->state.boss ) {
+		map_setmapflag(bl->m, MF_PVP, true);
+		}
	}
	return 0;
}
@ -1139,6 +1142,7 @@ 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;
+		if(md->spawn->state.boss)  map_setmapflag(md->bl.m, MF_PVP, true);

		if( (md->bl.x == 0 && md->bl.y == 0) || md->spawn->xs || md->spawn->ys )
		{	//Monster can be spawned on an area.
@ -3158,6 +3162,9 @@ 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));
+	if(md->spawn->state.boss)  {
+	map_setmapflag(md->bl.m, MF_PVP, false);
+	}

	if( !rebirth )
		mob_setdelayspawn(md); //Set respawning.

@Almond Snicker

I think I know now where it went wrong comparing to your diff, I'll try this later when I get home thank you!

Link to comment
Share on other sites

  • 3 weeks later...

  • Group:  Members
  • Topic Count:  56
  • Topics Per Day:  0.01
  • Content Count:  224
  • Reputation:   4
  • Joined:  02/09/12
  • Last Seen:  

@@ -1058,6 +1058,9 @@ TIMER_FUNC(mob_delayspawn){
		}
		md->spawn_timer = INVALID_TIMER;
		mob_spawn(md);
+                if( md->state.boss ) {
+                map_setmapflag(bl->m, MF_PVP, true);
                }
	}
	return 0;
}
@ -1139,6 +1142,7 @@ 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;
+		if(md->spawn->state.boss)  map_setmapflag(md->bl.m, MF_PVP, true);

		if( (md->bl.x == 0 && md->bl.y == 0) || md->spawn->xs || md->spawn->ys )
		{	//Monster can be spawned on an area.
@ -3158,6 +3162,9 @@ 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));
+        if(md->spawn->state.boss)  {
+        map_setmapflag(md->bl.m, MF_PVP, false);
+        }

	if( !rebirth )
		mob_setdelayspawn(md); //Set respawning.

This is Working for me 

Link to comment
Share on other sites

  • 3 years later...

  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.03
  • Content Count:  38
  • Reputation:   0
  • Joined:  08/19/23
  • Last Seen:  

Question: Do we need to use normal account only? I've tried and test the recent diff nothing errors happen on the console but when I try it ingame using GM accounts I think PK mode is not open.?

Link to comment
Share on other sites

Join the conversation

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

Guest
Reply to this topic...

×   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.

×
×
  • Create New...