Jump to content

Question

Posted (edited)

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.

this src enabled pkmode to all maps

/*===================================
* 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!

Edited by RCharles

6 answers to this question

Recommended Posts

Posted
there is already a release for @pk command here. try to use the search engine before making a new topic.

Do you know that, that release just activate pk for 1 player using that command?

its not the same as setting the pk_mode to 1.

Posted
there is already a release for @pk command here. try to use the search engine before making a new topic.

Do you know that, that release just activate pk for 1 player using that command?

its not the same as setting the pk_mode to 1.

oh. you want a custom command that enable pk to all maps?

Posted (edited)

lol. you should change your topic title. @pkmode is for single user who wants to turn on turn off pk state if your server setup is pk server.

please read what i posted.. please do understand also. relate it to my bug tracker post.

its related to /conf/battle/misc.conf

// PK Server Mode. Turns entire server pvp(excluding towns). Experience loss is doubled if killed by another player.

// When players hunt monsters over 20 levels higher, they will receive 15% additional exp., and 25% chance of receiving more items.

// There is a nopvp.txt for setting up maps not to have pk on in this mode. Novices cannot be attacked and cannot attack.

// Normal pvp counter and rank display are disabled as well.

// Note: If pk_mode is set to 2 instead of 1 (yes), players will receive a

// manner penalty of 5 each time they kill another player (see manner_system

// config to adjust how this will affect players)

pk_mode: 0

bug tracker post: http://rathena.org/board/tracker/issue-6218-setbattleflag-not-working/

Edited by RCharles

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...