Chun3 Posted September 27, 2019 Posted September 27, 2019 View File 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. Submitter Chun3 Submitted 09/27/2019 Category Source Modifications Video Content Author Chun Quote
noobzter003 Posted September 29, 2019 Posted September 29, 2019 (edited) Great release mate!! but it is possible put range the pk mode, not in whole map. example, 40 Cell near the boss Edited September 29, 2019 by noobzter003 Quote
Chun3 Posted September 29, 2019 Author Posted September 29, 2019 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! Quote
PsyOps Posted February 19, 2020 Posted February 19, 2020 Hi, just a question. Tried the script. This is my error. Currently using rathena trunk from 2019 February. Quote
Obiwan Posted April 25, 2020 Posted April 25, 2020 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. anyone have this fix diff for latest rathena Quote
Jayz Posted April 25, 2020 Posted April 25, 2020 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. Quote
Obiwan Posted April 25, 2020 Posted April 25, 2020 (edited) 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 April 25, 2020 by Obiwan Quote
PsyOps Posted April 25, 2020 Posted April 25, 2020 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 Quote
kalabasa Posted September 29, 2020 Posted September 29, 2020 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 Quote
Gouki Posted January 9, 2021 Posted January 9, 2021 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. Quote
JinYuichi Posted January 9, 2021 Posted January 9, 2021 @@ -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 Quote
Gouki Posted January 9, 2021 Posted January 9, 2021 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! Quote
simplexjay2 Posted January 29, 2021 Posted January 29, 2021 @@ -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 Quote
ADMSarah Posted March 10, 2024 Posted March 10, 2024 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.? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.