Jump to content
java

pk mode [on/off]

Recommended Posts

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

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

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

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

* @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

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

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

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

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.