Hello,
i have this @pk mod, the problem is when Pally and a char, are both in pk off state, pally wont be able to devo the char, basically pally->devo->party member (both pk off) = success pally->devo->party member (both pk on) = success
pally->devo->party member (not in same pk state) = fail currently happening,
pally->devo->party member (both pk on) = success
pally->devo->party member (both pk off) = fail
pally->devo->party member (not in same pkstate) = fail
conf\atcommand_athena.conf
pk: 0,80 // pk
map\atcommand.c, find
---------------------
/*==========================================
* atcommand_info[] structure definition
*------------------------------------------*/
AtCommandInfo atcommand_info[] = {
it becomes
----------
// @pk
int atcommand_pk( const int fd, struct map_session_data *sd, const char *command, const char *message ) {
unsigned int tick = gettick();
nullpo_retr(-1, sd);
if(!map[sd->bl.m].flag.town){ //Only can be used at town
clif_displaymessage(sd->fd, "You can only use this command inside towns.");
return -1;
}
if(DIFF_TICK(sd->pk_mode_tick,tick) > 0){ //check the delay before use this command again
clif_displaymessage(sd->fd, "You must wait 60 seconds to use this command again.");
return -1;
}
else{
if (!sd->state.pk_mode) {
sd->state.pk_mode = 1;
clif_displaymessage(sd->fd, "You are can no longer be attacked by players.");
sd->pk_mode_tick = tick + 60000; //set the delay here
} else {
sd->state.pk_mode = 0;
clif_displaymessage(sd->fd, "You can now attack players");
sd->pk_mode_tick = tick + 60000; //set the delay here
}
return 0;
}
/*==========================================
* atcommand_info[] structure definition
*------------------------------------------*/
AtCommandInfo atcommand_info[] = {
==============================================================================================================================
==============================================================================================================================
map\atcommand.c, find
---------------------
{ "delitem", 60,60, atcommand_delitem },
{ "charcommands", 1,1, atcommand_commands },
{ "font", 1,1, atcommand_font },
it becomes
----------
{ "delitem", 60,60, atcommand_delitem },
{ "charcommands", 1,1, atcommand_commands },
{ "font", 1,1, atcommand_font },
{ "pkmode", 0,80, atcommand_pkmode },
==============================================================================================================================
==============================================================================================================================
map\battle.c, find (line 3407 svn15191)
---------------------------------------
if( sd->state.monster_ignore && flag&BCT_ENEMY )
return 0; // Global inminuty only to Attacks
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
it becomes
----------
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
still in map\battle.c, near above, find (line 3471 svn15191)
------------------------------------------------------------
else
return 0; // You can't target anything out of your duel
}
}
if( map_flag_gvg(m) && !sd->status.guild_id && t_bl->type == BL_MOB && ((TBL_MOB*)t_bl)->guardian_data )
it becomes
----------
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 ) //pkmode
return 0; //pkmode
}
if( map_flag_gvg(m) && !sd->status.guild_id && t_bl->type == BL_MOB && ((TBL_MOB*)t_bl)->guardian_data )
the last, in map\pc.h, find (line 141 svn15191)
-----------------------------------------------
unsigned int warping : 1;//states whether you're in the middle of a warp processing
} state;
struct {
it becomes
----------
unsigned int warping : 1;//states whether you're in the middle of a warp processing
unsigned int pk_mode : 1; //[malufett] //pkmode
} state;
struct {
==============================================================================================================================
==============================================================================================================================
map\pc.h, find (line 210 svn15191)
----------------------------------
unsigned int ks_floodprotect_tick; // [Kill Steal Protection]
struct {
become
------
unsigned int ks_floodprotect_tick; // [Kill Steal Protection]
unsigned int pk_mode_tick; //@pkmode
struct {
map\pc.h, find (line 579 svn15191)
----------------------------------
sd->canlog_tick = gettick();
//Required to prevent homunculus copuing a base speed of 0.
become
------
sd->canlog_tick = gettick();
sd->pk_mode_tick = gettick(); //@pk
//Required to prevent homunculus copuing a base speed of 0.