Since setbattleflag "pk_mode",1 will not work in running time of the server.
from my bug report: http://rathena.org/b...ag-not-working/
I would like to ask help from you about this src mod i found in eA (@pkmode)
Can someone make this compatible with rAthena source code.
/*===================================
* PK Mode for entire Server [swapnil (Tribunal)]
* For Boundless RO
*-----------------------------------*/
int atcommand_pkmode(const int fd, struct map_session_data* sd, const char* command, const char* message)
{
int value = 0;
int i = 0;
char broadcast[128];
nullpo_retr(-1, sd);
if (!message || !*message || !sscanf(message, "%d", &value)) {
clif_displaymessage(sd->fd,"Please enter a parameter. Usage : @pkmode <1|0> .");
return -1;
}
if(value > 1) value = 1;
if(value < 0) value = 0;
for(i = 0; i < map_num; i++){
if(!map[i].flag.nochangepvp){ map[i].flag.pvp = value;
if(value == 1) {
if (!battle_config.pk_mode)
{// display pvp circle and rank
clif_send0199(sd->bl.m, 1);
map_foreachinmap(atcommand_pvpon_sub,i, BL_PC);
}
}
if(value == 0) {
if (!battle_config.pk_mode)
clif_send0199(sd->bl.m, 0);
map_foreachinmap(atcommand_pvpoff_sub,i, BL_PC);
map_foreachinmap(atcommand_stopattack,i, BL_CHAR, 0);
}
}
}
clif_displaymessage(fd, "Action carried out.");
if(value == 1) sprintf (broadcast, "Global PvP Event has commenced!");
if(value == 0) sprintf (broadcast, "Global PvP Event has been stopped!");
intif_broadcast(broadcast,strlen(broadcast)+1,0);
return 0;
}
Source: http://www.eathena.w...howtopic=252536
Thanks!