On your atcommand.cpp
1.
After
ACMD_DEF(jailfor)
Add
ACMD_DEF2("pk",pk)
2.
Before
ACMD_FUNC(whogm)
Add
ACMD_FUNC(pk)
{
nullpo_retr(-1, sd);
if (map_getmapflag(sd->bl.m, MF_PVP) || map_getmapflag(sd->bl.m, MF_GVG) || map_getmapflag(sd->bl.m, MF_GVG_CASTLE) || map_getmapflag(sd->bl.m, MF_GVG_DUNGEON)) {
clif_displaymessage(fd, "You can only change your PK state on non-PVP maps.");
return -1;
}
if (!sd->state.pk_mode) {
sd->state.pk_mode = 1;
clif_displaymessage(fd, "You are now no longer in PK mode.");
}
else {
sd->state.pk_mode = 0;
clif_displaymessage(fd, "Returned to normal state.");
}
return 0;
}
On your pc.hpp
After
unsigned int warping : 1
Add
unsigned int pk_mode : 1;
On your battle.cpp
After
else if (sd->duel_group && !((!battle_config.duel_allow_pvp && mapdata->flag[MF_PVP]) || (!battle_config.duel_allow_gvg && mapdata_flag_gvg(mapdata))))
{
if (t_bl->type == BL_PC && (sd->duel_group == ((TBL_PC*)t_bl)->duel_group))
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
}
Add
else if (map_getmapflag(s_bl->m, MF_PVP) && sd->state.pk_mode && t_bl->type != BL_MOB)
return 0;
After
if( ((sd->state.block_action & PCBLOCK_IMMUNE) || (sc->data[SC_KINGS_GRACE] && s_bl->type != BL_PC)) && flag&BCT_ENEMY )
return 0; // Global immunity only to Attacks
Add
if (sd->state.pk_mode && flag&BCT_ENEMY && s_bl->type != BL_MOB && map_getmapflag(s_bl->m, MF_PVP))
return 0;
Recompile and re-test
I cannot create patch today as I am doing something with my Git. So yea do it manually for now ?