VicTheSlik
New member
Can I request for @pk on/off plugin. Something like this http://herc.ws/board/topic/463-pk-patch-v11/
The condition should be that both parties are killable, with just using @killable, doesn't mean the other party/person has to be killable to kill the other person.what does that patch do ?useless crap
src/map/atcommand.c | 30 ++++++++++++++++++++++++++++++ src/map/battle.c | 4 ++++ src/map/pc.h | 1 + 3 files changed, 35 insertions(+)diff --git a/src/map/atcommand.c b/src/map/atcommand.cindex ff88f2c..16e63c2 100644--- a/src/map/atcommand.c+++ b/src/map/atcommand.c@@ -197,6 +197,35 @@ static inline const char* atcommand_help_string(AtCommandInfo *info) { return info->help; } +ACMD(pkmode) {++// unsigned int tick = iTimer->gettick();++ nullpo_retr(-1, sd);+ + if( map_flag_vs(sd->bl.m) ) {+ clif->message(sd->fd, "You can only change your PK state on non-PVP maps.");+ return false;+ }++// if(DIFF_TICK(sd->pk_mode_tick,tick) > 0){ //check the delay before use this command again+// clif->message(sd->fd, "You cannot turn OFF your PK state twice within just 15 minutes.");+// return false;+// }+//else{+ if (!sd->state.pk_mode) {+ sd->state.pk_mode = 1;+ clif->message(sd->fd, "Your PK state is now OFF");+// sd->pk_mode_tick = tick + 0; //set the delay here+ } else {+ sd->state.pk_mode = 0;+ clif->message(sd->fd, "Your PK state is now ON");+// sd->pk_mode_tick = tick + 1500000; //set the delay here+ }+//}+ return true;+}+ /*========================================== * @send (used for testing packet sends from the client) *------------------------------------------*/@@ -9596,6 +9625,7 @@ void atcommand_basecommands(void) { ACMD_DEF(makehomun), ACMD_DEF(homfriendly), ACMD_DEF(homhungry),+ ACMD_DEF(pkmode), ACMD_DEF(homtalk), ACMD_DEF(hominfo), ACMD_DEF(homstats),diff --git a/src/map/battle.c b/src/map/battle.cindex 1cbc3ba..84eb42f 100644--- a/src/map/battle.c+++ b/src/map/battle.c@@ -6511,6 +6511,8 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f if( sd->state.monster_ignore && flag&BCT_ENEMY ) return 0; // Global immunity only to Attacks+ if( map->list[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 ) {@@ -6581,6 +6583,8 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f return 0; } }+ else if( map_flag_gvg(m) && 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)->class_ == MOBID_EMPERIUM ) return 0; //If you don't belong to a guild, can't target emperium. if( t_bl->type != BL_PC )diff --git a/src/map/pc.h b/src/map/pc.hindex 2c8b24a..9d739a9 100644--- a/src/map/pc.h+++ b/src/map/pc.h@@ -205,6 +205,7 @@ struct map_session_data { unsigned int standalone : 1;/* [Ind/Hercules <3] */ unsigned int loggingout : 1; unsigned int warp_clean : 1;+ unsigned int pk_mode : 1; } state; struct { unsigned char no_weapon_damage, no_magic_damage, no_misc_damage;
I think its bug
and in post#6, somebody already say just use @killable isn't it ?
I've used this patch when im using rAthena long time ago. I think its from eA if im correct and yes its bugged. I never tried the patch on herc. Never tried using @killable.what does that patch do ?useless crap
src/map/atcommand.c | 30 ++++++++++++++++++++++++++++++ src/map/battle.c | 4 ++++ src/map/pc.h | 1 + 3 files changed, 35 insertions(+)diff --git a/src/map/atcommand.c b/src/map/atcommand.cindex ff88f2c..16e63c2 100644--- a/src/map/atcommand.c+++ b/src/map/atcommand.c@@ -197,6 +197,35 @@ static inline const char* atcommand_help_string(AtCommandInfo *info) { return info->help; } +ACMD(pkmode) {++// unsigned int tick = iTimer->gettick();++ nullpo_retr(-1, sd);+ + if( map_flag_vs(sd->bl.m) ) {+ clif->message(sd->fd, "You can only change your PK state on non-PVP maps.");+ return false;+ }++// if(DIFF_TICK(sd->pk_mode_tick,tick) > 0){ //check the delay before use this command again+// clif->message(sd->fd, "You cannot turn OFF your PK state twice within just 15 minutes.");+// return false;+// }+//else{+ if (!sd->state.pk_mode) {+ sd->state.pk_mode = 1;+ clif->message(sd->fd, "Your PK state is now OFF");+// sd->pk_mode_tick = tick + 0; //set the delay here+ } else {+ sd->state.pk_mode = 0;+ clif->message(sd->fd, "Your PK state is now ON");+// sd->pk_mode_tick = tick + 1500000; //set the delay here+ }+//}+ return true;+}+ /*========================================== * @send (used for testing packet sends from the client) *------------------------------------------*/@@ -9596,6 +9625,7 @@ void atcommand_basecommands(void) { ACMD_DEF(makehomun), ACMD_DEF(homfriendly), ACMD_DEF(homhungry),+ ACMD_DEF(pkmode), ACMD_DEF(homtalk), ACMD_DEF(hominfo), ACMD_DEF(homstats),diff --git a/src/map/battle.c b/src/map/battle.cindex 1cbc3ba..84eb42f 100644--- a/src/map/battle.c+++ b/src/map/battle.c@@ -6511,6 +6511,8 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f if( sd->state.monster_ignore && flag&BCT_ENEMY ) return 0; // Global immunity only to Attacks+ if( map->list[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 ) {@@ -6581,6 +6583,8 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f return 0; } }+ else if( map_flag_gvg(m) && 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)->class_ == MOBID_EMPERIUM ) return 0; //If you don't belong to a guild, can't target emperium. if( t_bl->type != BL_PC )diff --git a/src/map/pc.h b/src/map/pc.hindex 2c8b24a..9d739a9 100644--- a/src/map/pc.h+++ b/src/map/pc.h@@ -205,6 +205,7 @@ struct map_session_data { unsigned int standalone : 1;/* [Ind/Hercules <3] */ unsigned int loggingout : 1; unsigned int warp_clean : 1;+ unsigned int pk_mode : 1; } state; struct { unsigned char no_weapon_damage, no_magic_damage, no_misc_damage;
I think its bug
and in post#6, somebody already say just use @killable isn't it ?
Yes, My server is set to PK Mode.The condition should be that both parties are killable, with just using @killable, doesn't mean the other party/person has to be killable to kill the other person.what does that patch do ?useless crap
src/map/atcommand.c | 30 ++++++++++++++++++++++++++++++ src/map/battle.c | 4 ++++ src/map/pc.h | 1 + 3 files changed, 35 insertions(+)diff --git a/src/map/atcommand.c b/src/map/atcommand.cindex ff88f2c..16e63c2 100644--- a/src/map/atcommand.c+++ b/src/map/atcommand.c@@ -197,6 +197,35 @@ static inline const char* atcommand_help_string(AtCommandInfo *info) { return info->help; } +ACMD(pkmode) {++// unsigned int tick = iTimer->gettick();++ nullpo_retr(-1, sd);+ + if( map_flag_vs(sd->bl.m) ) {+ clif->message(sd->fd, "You can only change your PK state on non-PVP maps.");+ return false;+ }++// if(DIFF_TICK(sd->pk_mode_tick,tick) > 0){ //check the delay before use this command again+// clif->message(sd->fd, "You cannot turn OFF your PK state twice within just 15 minutes.");+// return false;+// }+//else{+ if (!sd->state.pk_mode) {+ sd->state.pk_mode = 1;+ clif->message(sd->fd, "Your PK state is now OFF");+// sd->pk_mode_tick = tick + 0; //set the delay here+ } else {+ sd->state.pk_mode = 0;+ clif->message(sd->fd, "Your PK state is now ON");+// sd->pk_mode_tick = tick + 1500000; //set the delay here+ }+//}+ return true;+}+ /*========================================== * @send (used for testing packet sends from the client) *------------------------------------------*/@@ -9596,6 +9625,7 @@ void atcommand_basecommands(void) { ACMD_DEF(makehomun), ACMD_DEF(homfriendly), ACMD_DEF(homhungry),+ ACMD_DEF(pkmode), ACMD_DEF(homtalk), ACMD_DEF(hominfo), ACMD_DEF(homstats),diff --git a/src/map/battle.c b/src/map/battle.cindex 1cbc3ba..84eb42f 100644--- a/src/map/battle.c+++ b/src/map/battle.c@@ -6511,6 +6511,8 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f if( sd->state.monster_ignore && flag&BCT_ENEMY ) return 0; // Global immunity only to Attacks+ if( map->list[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 ) {@@ -6581,6 +6583,8 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f return 0; } }+ else if( map_flag_gvg(m) && 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)->class_ == MOBID_EMPERIUM ) return 0; //If you don't belong to a guild, can't target emperium. if( t_bl->type != BL_PC )diff --git a/src/map/pc.h b/src/map/pc.hindex 2c8b24a..9d739a9 100644--- a/src/map/pc.h+++ b/src/map/pc.h@@ -205,6 +205,7 @@ struct map_session_data { unsigned int standalone : 1;/* [Ind/Hercules <3] */ unsigned int loggingout : 1; unsigned int warp_clean : 1;+ unsigned int pk_mode : 1; } state; struct { unsigned char no_weapon_damage, no_magic_damage, no_misc_damage;
I think its bug
and in post#6, somebody already say just use @killable isn't it ?
With the requested @pk here, you should be able to set PK conditions that count for every player I think.
Probably a bit like @duel? We might need more specifics ;p
Thank you so much! I will try this@@VicTheSlik
@@Easycore
fine ...
http://upaste.me/b16121870ca99a9c0
btw I found that when pk mode, there is no indicator showing that player having pk on
I rather fix this kind of source mode though
http://herc.ws/board/topic/4589-pk-area/?p=29668
so you turned on pk mode inside confbattlemisc.txt ?well isn't this official ....My server is in PK mode.
prontera mapflag pvp off
Thanks for this!@@VicTheSlik
@@Easycore
fine ...
http://upaste.me/b16121870ca99a9c0
btw I found that when pk mode, there is no indicator showing that player having pk on
I rather fix this kind of source mode though
http://herc.ws/board/topic/4589-pk-area/?p=29668
Error please fix@@VicTheSlik
@@Easycore
fine ...
http://upaste.me/b16121870ca99a9c0
btw I found that when pk mode, there is no indicator showing that player having pk on
I rather fix this kind of source mode though
http://herc.ws/board/topic/4589-pk-area/?p=29668
pkmode.c: In function ‘plugin_init’:
pkmode.c:64:2: warning: implicit declaration of function ‘addHookPost’ [-Wimplicit-function-declaration]
addHookPost( "battle->check_target", battle_check_target_post, );
^
pkmode.c:64:2: warning: nested extern declaration of ‘addHookPost’ [-Wnested-externs]
pkmode.c:64:65: error: expected expression before ‘)’ token
addHookPost( "battle->check_target", battle_check_target_post, );
^
make[1]: *** [../../plugins/pkmode.so] Error 1
We use essential cookies to make this site work, and optional cookies to enhance your experience.