mauiboy Posted August 30, 2016 Share Posted August 30, 2016 Requesting @pk state on/off indicated in the title. Thanks in advance guys! Quote Link to comment Share on other sites More sharing options...
0 mauiboy Posted September 4, 2016 Author Share Posted September 4, 2016 Finally found one and works fine on latest version. (Credits to the Owner/s) First : I got the main source codes edited by malufett here, but it allows you to use @pk anywhere. https://rathena.org/board/topic/62914-pk-command/ Second : So I keep on searching and I found this function suggested by Brynner to restrict anyone to use @pk state on/off only on towns/non-PVP maps. https://rathena.org/board/topic/71819-pk-command-inside-town-only/ if( map[sd->bl.m].flag.pvp || map[sd->bl.m].flag.gvg || map[sd->bl.m].flag.gvg_castle || map[sd->bl.m].flag.gvg_dungeon ) { clif_displaymessage(fd, "You can only change your PK state on non-PVP maps."); return -1; } Third : I made a little editing on adding this function from Brynner. at atcommand.c int atcommand_pkmode( const int fd, struct map_session_data *sd, const char *command, const char *message ) { nullpo_retr(-1, sd); if( map[sd->bl.m].flag.pvp || map[sd->bl.m].flag.gvg || map[sd->bl.m].flag.gvg_castle || map[sd->bl.m].flag.gvg_dungeon ) { clif_displaymessage(fd, "You can only change your PK state on non-PVP maps."); return -1; } else if (!sd->state.pk_mode) { sd->state.pk_mode = 1; clif_displaymessage(sd->fd, "You are now no longer in PK mode."); } else { sd->state.pk_mode = 0; clif_displaymessage(sd->fd, "Returned to normal state."); } return 0; } Im currently using this code and it works fine on my test server. Thanks to all! Quote Link to comment Share on other sites More sharing options...
0 mauiboy Posted September 1, 2016 Author Share Posted September 1, 2016 BUMP Quote Link to comment Share on other sites More sharing options...
0 Bringer Posted September 4, 2016 Share Posted September 4, 2016 Finally found one and works fine on latest version. (Credits to the Owner/s) First : I got the main source codes edited by malufett here, but it allows you to use @pk anywhere. https://rathena.org/board/topic/62914-pk-command/ Second : So I keep on searching and I found this function suggested by Brynner to restrict anyone to use @pk state on/off only on towns/non-PVP maps. https://rathena.org/board/topic/71819-pk-command-inside-town-only/ if( map[sd->bl.m].flag.pvp || map[sd->bl.m].flag.gvg || map[sd->bl.m].flag.gvg_castle || map[sd->bl.m].flag.gvg_dungeon ) { clif_displaymessage(fd, "You can only change your PK state on non-PVP maps."); return -1; } Third : I made a little editing on adding this function from Brynner. at atcommand.c int atcommand_pkmode( const int fd, struct map_session_data *sd, const char *command, const char *message ) { nullpo_retr(-1, sd); if( map[sd->bl.m].flag.pvp || map[sd->bl.m].flag.gvg || map[sd->bl.m].flag.gvg_castle || map[sd->bl.m].flag.gvg_dungeon ) { clif_displaymessage(fd, "You can only change your PK state on non-PVP maps."); return -1; } else if (!sd->state.pk_mode) { sd->state.pk_mode = 1; clif_displaymessage(sd->fd, "You are now no longer in PK mode."); } else { sd->state.pk_mode = 0; clif_displaymessage(sd->fd, "Returned to normal state."); } return 0; } Im currently using this code and it works fine on my test server. Thanks to all! this file pk_mod_rA_r16215.PATCH? Quote Link to comment Share on other sites More sharing options...
0 mauiboy Posted September 4, 2016 Author Share Posted September 4, 2016 Finally found one and works fine on latest version. (Credits to the Owner/s) First : I got the main source codes edited by malufett here, but it allows you to use @pk anywhere. https://rathena.org/board/topic/62914-pk-command/ Second : So I keep on searching and I found this function suggested by Brynner to restrict anyone to use @pk state on/off only on towns/non-PVP maps. https://rathena.org/board/topic/71819-pk-command-inside-town-only/ if( map[sd->bl.m].flag.pvp || map[sd->bl.m].flag.gvg || map[sd->bl.m].flag.gvg_castle || map[sd->bl.m].flag.gvg_dungeon ) { clif_displaymessage(fd, "You can only change your PK state on non-PVP maps."); return -1; } Third : I made a little editing on adding this function from Brynner. at atcommand.c int atcommand_pkmode( const int fd, struct map_session_data *sd, const char *command, const char *message ) { nullpo_retr(-1, sd); if( map[sd->bl.m].flag.pvp || map[sd->bl.m].flag.gvg || map[sd->bl.m].flag.gvg_castle || map[sd->bl.m].flag.gvg_dungeon ) { clif_displaymessage(fd, "You can only change your PK state on non-PVP maps."); return -1; } else if (!sd->state.pk_mode) { sd->state.pk_mode = 1; clif_displaymessage(sd->fd, "You are now no longer in PK mode."); } else { sd->state.pk_mode = 0; clif_displaymessage(sd->fd, "Returned to normal state."); } return 0; } Im currently using this code and it works fine on my test server. Thanks to all! this file pk_mod_rA_r16215.PATCH? Yes Quote Link to comment Share on other sites More sharing options...
0 noxty Posted June 8, 2019 Share Posted June 8, 2019 (edited) Hello, I'm using the latest version of rAthena and I wanted to put this mod but I get this error when compiling, I hope you can help me. Thank you. Edited June 8, 2019 by noxty Quote Link to comment Share on other sites More sharing options...
0 noxty Posted June 8, 2019 Share Posted June 8, 2019 Quote Link to comment Share on other sites More sharing options...
0 Bringer Posted June 8, 2019 Share Posted June 8, 2019 (edited) 8 hours ago, noxty said: - if( map[m].flag.pvp && sd->state.pk_mode && flag&BCT_ENEMY && s_bl->type != BL_MOB ) - return 0; + if( map_getmapflag(sd->bl.m, MF_PVP) && sd->state.pk_mode && flag&BCT_ENEMY && s_bl->type != BL_MOB ) + return 0; - }else if( map[m].flag.pvp && sd->state.pk_mode && t_bl->type != BL_MOB ) - return 0; return 0; // You can't target anything out of your duel + }else if (map_getmapflag(sd->bl.m, MF_PVP) && sd->state.pk_mode && t_bl->type != BL_MOB) + return 0; Try This Edited June 9, 2019 by Bringer Quote Link to comment Share on other sites More sharing options...
0 noxty Posted June 9, 2019 Share Posted June 9, 2019 Thanks for the help but now I have another mistake, I hope you can help me. Thank you Quote Link to comment Share on other sites More sharing options...
0 Bringer Posted June 10, 2019 Share Posted June 10, 2019 18 hours ago, noxty said: Thanks for the help but now I have another mistake, I hope you can help me. Thank you + if( map_getmapflag(sd->bl.m, MF_PVP) && sd->state.pk_mode && flag&BCT_ENEMY && s_bl->type != BL_MOB ) + return 0; + }else if (map_getmapflag(sd->bl.m, MF_PVP) && sd->state.pk_mode && t_bl->type != BL_MOB) + Quote Link to comment Share on other sites More sharing options...
0 Rook1es Posted December 6, 2020 Share Posted December 6, 2020 i hope its helps you! i fix it my self ! pk_mod_rA_latest.PATCH Quote Link to comment Share on other sites More sharing options...
0 Get Backers Posted December 6, 2020 Share Posted December 6, 2020 (edited) Hi thanks for the mod how about @pk off in town.. for example when using @pk off in town and enter the pvp / mvp room can still be attacked Edited December 6, 2020 by Get Backers Quote Link to comment Share on other sites More sharing options...
Requesting @pk state on/off indicated in the title. Thanks in advance guys!
Link to comment
Share on other sites