src/map/pc.h
find:
unsigned int warping : 1;//states whether you're in the middle of a warp processing
add after:
unsigned int main_blacklisted : 1;
src/map/map.c
find:
party_booking_delete(sd); // Party Booking [spiria]
add before:
if(sd->state.main_blacklisted) {
sd->state.main_blacklisted = 0;
}
src/map/atcommand.c
find:
ACMD_FUNC(main)
{
add after:
if (sd->state.main_blacklisted) {
clif_displaymessage(fd, "You have been banned for using @main.");
return -1;
}
find:
ACMD_FUNC(main)
add before:
ACMD_FUNC(mainblock)
{
struct map_session_data *pl_sd = NULL;
nullpo_retr(-1, sd);
if (!message || !*message) {
clif_displaymessage(fd, "Please enter a player name (usage: @mainblock <char name/ID>).");
return -1;
}
if ((pl_sd = map_nick2sd((char *)message)) == NULL && (pl_sd = map_charid2sd(atoi(message))) == NULL) {
clif_displaymessage(fd, msg_txt(3)); // Character not found.
return -1;
}
if (pc_get_group_level(sd) < pc_get_group_level(pl_sd)) {
clif_displaymessage(fd, msg_txt(81)); // Your GM level doesn't authorize you to preform this action on the specified player.
return -1;
}
if (pl_sd->state.main_blacklisted == 0) {
pl_sd->state.main_blacklisted = 1;
clif_displaymessage(fd, "Blocked @main for character!");
} else {
clif_displaymessage(fd, "Character is already blocked!");
}
return 0;
}
find:
ACMD_DEF(main),
add before:
ACMD_DEF(mainblock),
If you want to toggle the ban on @mainblock, do this:
find:
clif_displaymessage(fd, "Character is already blocked!");
change to:
pl_sd->state.main_blacklisted = 0;
clif_displaymessage(fd, "Character unblocked!");