java Posted June 15, 2012 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
malufett Posted June 15, 2012 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
java Posted June 15, 2012 Author 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
Brynner Posted June 24, 2012 Posted June 24, 2012 how to enable @pk for towns only. if you go to the field and dungeon you cannot use @pk. Quote
RCharles Posted July 15, 2012 Posted July 15, 2012 Does this src mod enable pk on maintown also? Quote
close23 Posted July 21, 2012 Posted July 21, 2012 Does this src mod enable pk on maintown also? it will only enable/disable your pk state. Quote
Petey Pablo Posted August 27, 2012 Posted August 27, 2012 how to work with the eathena emulator? Quote
Ninja Posted August 28, 2012 Posted August 28, 2012 how to work with the eathena emulator? try posting on eA Quote
Fresh prince Posted November 28, 2012 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
Cydh Posted November 29, 2012 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
Fresh prince Posted November 29, 2012 Posted November 29, 2012 @cydh is your link gonna work on rathena? Thanks Quote
Cydh Posted November 29, 2012 Posted November 29, 2012 @Fresh prince, omg.. for rA is on topic.. >_> Quote
Fresh prince Posted November 29, 2012 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
Cydh Posted November 30, 2012 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
Fresh prince Posted November 30, 2012 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
Cydh Posted November 30, 2012 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
Fresh prince Posted December 1, 2012 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
Cydh Posted December 2, 2012 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
Fresh prince Posted December 2, 2012 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
Ukiram Posted September 23, 2019 Posted September 23, 2019 *bump Is this still working on Latest rAthena? 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.