Jump to content

pk mode [on/off]


java

Recommended Posts


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  251
  • Reputation:   20
  • Joined:  12/22/11
  • Last Seen:  

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 :D

Edited by java
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  554
  • Reputation:   70
  • Joined:  04/04/12
  • Last Seen:  

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???

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  251
  • Reputation:   20
  • Joined:  12/22/11
  • Last Seen:  

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..

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

how to enable @pk for towns only. if you go to the field and dungeon you cannot use @pk.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

bump

Link to comment
Share on other sites

  • 3 weeks later...

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  154
  • Reputation:   8
  • Joined:  05/31/12
  • Last Seen:  

Does this src mod enable pk on maintown also?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  21
  • Reputation:   0
  • Joined:  07/21/12
  • Last Seen:  

Does this src mod enable pk on maintown also?

it will only enable/disable your pk state.

Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  152
  • Topics Per Day:  0.03
  • Content Count:  569
  • Reputation:   11
  • Joined:  11/24/11
  • Last Seen:  

how to work with the eathena emulator?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

how to work with the eathena emulator?

try posting on eA :)

Link to comment
Share on other sites

  • 3 months later...

  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  295
  • Reputation:   6
  • Joined:  10/14/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  295
  • Reputation:   6
  • Joined:  10/14/12
  • Last Seen:  

@cydh is your link gonna work on rathena? Thanks

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

@Fresh prince, omg.. for rA is on topic.. >_>

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  295
  • Reputation:   6
  • Joined:  10/14/12
  • Last Seen:  

/*==========================================

* @pk by : java modified :P i dunno whos the author :D

*------------------------------------------*/

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

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

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 by cydh
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  295
  • Reputation:   6
  • Joined:  10/14/12
  • Last Seen:  

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!

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

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)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  295
  • Reputation:   6
  • Joined:  10/14/12
  • Last Seen:  

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 by Fresh prince
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  295
  • Reputation:   6
  • Joined:  10/14/12
  • Last Seen:  

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 :D

Link to comment
Share on other sites

  • 6 years later...

  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.02
  • Content Count:  291
  • Reputation:   26
  • Joined:  12/16/17
  • Last Seen:  

*bump

Is this still working on Latest rAthena?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...