java Posted June 15, 2012 Group: Members Topic Count: 27 Topics Per Day: 0.01 Content Count: 263 Reputation: 35 Joined: 12/22/11 Last Seen: Yesterday at 05:40 AM Share Posted June 15, 2012 (edited) i dont know whos making this source but im edit this source for rathena credit go to the original author >> found the author is malufett in atcommand.c ====================================================================== add : /*========================================== * @pk by : java modified i dunno whos the author *------------------------------------------*/ ACMD_FUNC(pk) { nullpo_retr(-1, sd);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 PK mode Mwahahahahha!!!."); } return 0; } still at atcommand.c add this : ACMD_DEF(pk), ======================================================================= open atcommand_athena.conf find : kill: ["die"] below that add : pkmode: ["pk"] =============================================================================== open src/map/battle.c find this : if( sd->state.monster_ignore && flag&BCT_ENEMY ) return 0; // Global inminuty only to Attacks below that add : if( map[m].flag.pvp && sd->state.pk_mode && flag&BCT_ENEMY && s_bl->type != BL_MOB ) return 0; still at battle.c find : return 0; // You can't target anything out of your duel } below that add : else if( map[m].flag.pvp && sd->state.pk_mode && t_bl->type != BL_MOB ) return 0; ====================================================================================== open src/map/pc.h find : unsigned int warping : 1;//states whether you're in the middle of a warp processing below that add : unsigned int pk_mode : 1; done, recompile ur server Edited June 15, 2012 by java Quote Link to comment Share on other sites More sharing options...
malufett Posted June 15, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 554 Reputation: 70 Joined: 04/04/12 Last Seen: November 8, 2013 Share Posted June 15, 2012 tskk..why is it... this is very similar with this....XD http://rathena.org/board/topic/62914-pk-command/page__p__106533__hl__pkmode#entry106533 where do you get that??? Quote Link to comment Share on other sites More sharing options...
java Posted June 15, 2012 Group: Members Topic Count: 27 Topics Per Day: 0.01 Content Count: 263 Reputation: 35 Joined: 12/22/11 Last Seen: Yesterday at 05:40 AM Author Share Posted June 15, 2012 again.. someone ask for that source.. he give me this source to modify Index: conf/import-tmpl/atcommand_conf.txt =================================================================== --- conf/import-tmpl/atcommand_conf.txt (revision 0) +++ conf/import-tmpl/atcommand_conf.txt (working copy) @@ -0,0 +1,3 @@ +// PK Mode enabling/disabling Command + +pkmode: 0,0 \ No newline at end of file Index: src/map/atcommand.c =================================================================== --- src/map/atcommand.c (revision 16215) +++ src/map/atcommand.c (working copy) @@ -5323,7 +5323,21 @@ return 0; } +int atcommand_pkmode( const int fd, struct map_session_data *sd, const char *command, const char *message ) { + nullpo_retr(-1, sd); + + 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; +} + /*========================================== * @dropall by [MouseJstr] * Drop all your possession on the ground @@ -8700,6 +8714,7 @@ ACMD_DEF(jail), ACMD_DEF(unjail), ACMD_DEF(jailfor), + ACMD_DEF2("pk",pkmode), ACMD_DEF(jailtime), ACMD_DEF(disguise), ACMD_DEF(undisguise), Index: src/map/battle.c =================================================================== --- src/map/battle.c (revision 16215) +++ src/map/battle.c (working copy) @@ -4739,6 +4808,8 @@ if( sd->state.monster_ignore && flag&BCT_ENEMY ) return 0; // Global inminuty only to Attacks + if( map[m].flag.pvp && sd->state.pk_mode && flag&BCT_ENEMY && s_bl->type != BL_MOB ) + return 0; if( sd->status.karma && s_bl->type == BL_PC && ((TBL_PC*)s_bl)->status.karma ) state |= BCT_ENEMY; // Characters with bad karma may fight amongst them if( sd->state.killable ) { @@ -4799,7 +4870,8 @@ return (BCT_ENEMY&flag)?1:-1; // Duel targets can ONLY be your enemy, nothing else. else return 0; // You can't target anything out of your duel - } + }else if( map[m].flag.pvp && sd->state.pk_mode && t_bl->type != BL_MOB ) + return 0; } if( map_flag_gvg(m) && !sd->status.guild_id && t_bl->type == BL_MOB && ((TBL_MOB*)t_bl)->guardian_data ) return 0; //If you don't belong to a guild, can't target guardians/emperium. Index: src/map/pc.h =================================================================== --- src/map/pc.h (revision 16215) +++ src/map/pc.h (working copy) @@ -146,6 +146,7 @@ struct guild *gmaster_flag; unsigned int prevend : 1;//used to flag wheather you've spent 40sp to open the vending or not. unsigned int warping : 1;//states whether you're in the middle of a warp processing + unsigned int pk_mode : 1; //[malufett] } state; struct { unsigned char no_weapon_damage, no_magic_damage, no_misc_damage; btw that's it.. it's you , u are the one who make this source >.< little edit at 1st post, credit goes to you.. Quote Link to comment Share on other sites More sharing options...
Brynner Posted June 24, 2012 Group: Members Topic Count: 120 Topics Per Day: 0.02 Content Count: 1960 Reputation: 202 Joined: 01/08/12 Last Seen: 30 minutes ago Share Posted June 24, 2012 how to enable @pk for towns only. if you go to the field and dungeon you cannot use @pk. Quote Link to comment Share on other sites More sharing options...
Brynner Posted June 26, 2012 Group: Members Topic Count: 120 Topics Per Day: 0.02 Content Count: 1960 Reputation: 202 Joined: 01/08/12 Last Seen: 30 minutes ago Share Posted June 26, 2012 bump Quote Link to comment Share on other sites More sharing options...
RCharles Posted July 15, 2012 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 154 Reputation: 10 Joined: 05/31/12 Last Seen: May 15, 2014 Share Posted July 15, 2012 Does this src mod enable pk on maintown also? Quote Link to comment Share on other sites More sharing options...
close23 Posted July 21, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 21 Reputation: 0 Joined: 07/21/12 Last Seen: April 8, 2013 Share Posted July 21, 2012 Does this src mod enable pk on maintown also? it will only enable/disable your pk state. Quote Link to comment Share on other sites More sharing options...
Petey Pablo Posted August 27, 2012 Group: Members Topic Count: 152 Topics Per Day: 0.03 Content Count: 569 Reputation: 11 Joined: 11/24/11 Last Seen: March 7, 2022 Share Posted August 27, 2012 how to work with the eathena emulator? Quote Link to comment Share on other sites More sharing options...
Ninja Posted August 28, 2012 Group: Members Topic Count: 54 Topics Per Day: 0.01 Content Count: 513 Reputation: 84 Joined: 08/11/12 Last Seen: July 4, 2024 Share Posted August 28, 2012 how to work with the eathena emulator? try posting on eA Quote Link to comment Share on other sites More sharing options...
Fresh prince Posted November 28, 2012 Group: Members Topic Count: 69 Topics Per Day: 0.02 Content Count: 295 Reputation: 6 Joined: 10/14/12 Last Seen: June 12, 2021 Share Posted November 28, 2012 Hello I assume that you have to put this manually. I do not know how to patch so i tried this. I compile but it seems to stop at atcommnd.c. Where do you exactly put the edits? Can you please post which part or adter which line? Thankyou Quote Link to comment Share on other sites More sharing options...
Cydh Posted November 29, 2012 Group: Developer Topic Count: 153 Topics Per Day: 0.03 Content Count: 2285 Reputation: 747 Joined: 06/16/12 Last Seen: February 21 Share Posted November 29, 2012 how to work with the eathena emulator? http://eathena.ws/forum/topic/505-pk-mode-onoff-from-ra-to-ea/ Quote Link to comment Share on other sites More sharing options...
Fresh prince Posted November 29, 2012 Group: Members Topic Count: 69 Topics Per Day: 0.02 Content Count: 295 Reputation: 6 Joined: 10/14/12 Last Seen: June 12, 2021 Share Posted November 29, 2012 @cydh is your link gonna work on rathena? Thanks Quote Link to comment Share on other sites More sharing options...
Cydh Posted November 29, 2012 Group: Developer Topic Count: 153 Topics Per Day: 0.03 Content Count: 2285 Reputation: 747 Joined: 06/16/12 Last Seen: February 21 Share Posted November 29, 2012 @Fresh prince, omg.. for rA is on topic.. >_> Quote Link to comment Share on other sites More sharing options...
Fresh prince Posted November 29, 2012 Group: Members Topic Count: 69 Topics Per Day: 0.02 Content Count: 295 Reputation: 6 Joined: 10/14/12 Last Seen: June 12, 2021 Share Posted November 29, 2012 /*========================================== * @pk by : java modified i dunno whos the author *------------------------------------------*/ ACMD_FUNC(pk) { nullpo_retr(-1, sd);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 PK mode Mwahahahahha!!!."); } return 0; } Where should i put that? before or after what to look for? ACMD_DEF(pk), And this too? Compile stopped at atcommand.c when i tried this that's why I asked you cydh. thanks Quote Link to comment Share on other sites More sharing options...
Cydh Posted November 30, 2012 Group: Developer Topic Count: 153 Topics Per Day: 0.03 Content Count: 2285 Reputation: 747 Joined: 06/16/12 Last Seen: February 21 Share Posted November 30, 2012 (edited) before /** * Fills the reference of available commands in atcommand DBMap **/ #define ACMD_DEF(x) { #x, atcommand_ ## x, NULL, NULL } #define ACMD_DEF2(x2, x) { x2, atcommand_ ## x, NULL, NULL } void atcommand_basecommands(void) { and ACMD_DEF(mount2) }; AtCommandInfo* atcommand; int i; Edited November 30, 2012 by cydh Quote Link to comment Share on other sites More sharing options...
Fresh prince Posted November 30, 2012 Group: Members Topic Count: 69 Topics Per Day: 0.02 Content Count: 295 Reputation: 6 Joined: 10/14/12 Last Seen: June 12, 2021 Share Posted November 30, 2012 Thanks cydh will try this later. By the way, This whole thing by Java has a delay after using @pk do you know? Thanks a bunch cydh! Quote Link to comment Share on other sites More sharing options...
Cydh Posted November 30, 2012 Group: Developer Topic Count: 153 Topics Per Day: 0.03 Content Count: 2285 Reputation: 747 Joined: 06/16/12 Last Seen: February 21 Share Posted November 30, 2012 Thanks cydh will try this later. By the way, This whole thing by Java has a delay after using @pk do you know? Thanks a bunch cydh! delay when using @pk, to prevent player spam that command. Honestly, I never know what Java did, I just edit it on someone post on eA (look at my link) Quote Link to comment Share on other sites More sharing options...
Fresh prince Posted December 1, 2012 Group: Members Topic Count: 69 Topics Per Day: 0.02 Content Count: 295 Reputation: 6 Joined: 10/14/12 Last Seen: June 12, 2021 Share Posted December 1, 2012 (edited) how to enable @pk for towns only. if you go to the field and dungeon you cannot use @pk. Please anyone can do this? Thanks! Edited December 1, 2012 by Fresh prince Quote Link to comment Share on other sites More sharing options...
Cydh Posted December 2, 2012 Group: Developer Topic Count: 153 Topics Per Day: 0.03 Content Count: 2285 Reputation: 747 Joined: 06/16/12 Last Seen: February 21 Share Posted December 2, 2012 my delay, from eA http://eathena.ws/forum/topic/505-pk-mode-onoff-from-ra-to-ea/#entry3337 only working on town (mine, from eA) http://eathena.ws/forum/topic/505-pk-mode-onoff-from-ra-to-ea/page__st__20#entry3846 Quote Link to comment Share on other sites More sharing options...
Fresh prince Posted December 2, 2012 Group: Members Topic Count: 69 Topics Per Day: 0.02 Content Count: 295 Reputation: 6 Joined: 10/14/12 Last Seen: June 12, 2021 Share Posted December 2, 2012 my delay, from eA http://eathena.ws/fo...o-ea/#entry3337 only working on town (mine, from eA) http://eathena.ws/fo...t__20#entry3846 You're awesome. Thanks for all the help bro, working as it should Quote Link to comment Share on other sites More sharing options...
Ukiram Posted September 23, 2019 Group: Members Topic Count: 45 Topics Per Day: 0.02 Content Count: 291 Reputation: 27 Joined: 12/16/17 Last Seen: December 19, 2023 Share Posted September 23, 2019 *bump Is this still working on Latest rAthena? Quote Link to comment Share on other sites More sharing options...
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.