Jump to content
Chun3

Release: PK mode if MVP is alive.

Recommended Posts

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

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

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

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

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

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

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

@@ -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

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

@@ -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

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

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.