mauiboy Posted August 30, 2016 Group: Members Topic Count: 15 Topics Per Day: 0.00 Content Count: 63 Reputation: 1 Joined: 07/06/16 Last Seen: February 1 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 1, 2016 Group: Members Topic Count: 15 Topics Per Day: 0.00 Content Count: 63 Reputation: 1 Joined: 07/06/16 Last Seen: February 1 Author Share Posted September 1, 2016 BUMP Quote Link to comment Share on other sites More sharing options...
0 mauiboy Posted September 4, 2016 Group: Members Topic Count: 15 Topics Per Day: 0.00 Content Count: 63 Reputation: 1 Joined: 07/06/16 Last Seen: February 1 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 Bringer Posted September 4, 2016 Group: Members Topic Count: 162 Topics Per Day: 0.04 Content Count: 748 Reputation: 47 Joined: 03/12/14 Last Seen: Yesterday at 08:53 AM 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 Group: Members Topic Count: 15 Topics Per Day: 0.00 Content Count: 63 Reputation: 1 Joined: 07/06/16 Last Seen: February 1 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 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 28 Reputation: 1 Joined: 04/22/12 Last Seen: August 29, 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 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 28 Reputation: 1 Joined: 04/22/12 Last Seen: August 29, 2019 Share Posted June 8, 2019 Quote Link to comment Share on other sites More sharing options...
0 Bringer Posted June 8, 2019 Group: Members Topic Count: 162 Topics Per Day: 0.04 Content Count: 748 Reputation: 47 Joined: 03/12/14 Last Seen: Yesterday at 08:53 AM 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 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 28 Reputation: 1 Joined: 04/22/12 Last Seen: August 29, 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 Group: Members Topic Count: 162 Topics Per Day: 0.04 Content Count: 748 Reputation: 47 Joined: 03/12/14 Last Seen: Yesterday at 08:53 AM 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 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 97 Reputation: 5 Joined: 06/21/15 Last Seen: September 28, 2024 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 Group: Members Topic Count: 26 Topics Per Day: 0.02 Content Count: 70 Reputation: 0 Joined: 11/23/20 Last Seen: January 24, 2021 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...
Question
mauiboy
Requesting @pk state on/off indicated in the title. Thanks in advance guys!
Link to comment
Share on other sites
11 answers to this question
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.