示例#1
0
文件: duel.c 项目: DingWeizhe/rathena
/*
 * Make a player accept a duel
 * @did = duel id
 * @sd = player accepting duel
 */
void duel_accept(const unsigned int did, struct map_session_data* sd)
{
	char output[256];

	duel_list[did].members_count++;
	duel_set(sd->duel_invite, sd);
	duel_list[did].invites_count--;
	sd->duel_invite = 0;

	// " -> Player %s has accepted duel --"
	sprintf(output, msg_txt(sd,376), sd->status.name);
	clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS);

	clif_map_property(&sd->bl, MAPPROPERTY_FREEPVPZONE, SELF);
	//clif_misceffect2(&sd->bl, 159);
}
示例#2
0
文件: duel.c 项目: DingWeizhe/rathena
/*
 * Make a player leave a duel
 * @did = duel id
 * @sd = leaving player
 */
void duel_leave(const unsigned int did, struct map_session_data* sd)
{
	char output[256];

	// " <- Player %s has left duel --"
	sprintf(output, msg_txt(sd,375), sd->status.name);
	clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS);

	duel_list[did].members_count--;

	if(duel_list[did].members_count == 0) {
		map_foreachpc(duel_leave_sub, did);
		duel_count--;
	}

	duel_set(0, sd);
	duel_savetime(sd);
	clif_map_property(&sd->bl, MAPPROPERTY_NOTHING, SELF);
}
示例#3
0
文件: duel.c 项目: DingWeizhe/rathena
/*
 * Create a new duel for sd
 */
int duel_create(struct map_session_data* sd, const unsigned int maxpl)
{
	int i=1;
	char output[256];

	while(duel_list[i].members_count > 0 && i < MAX_DUEL) i++;
	if(i == MAX_DUEL) return 0;

	duel_count++;
	duel_set(i, sd);
	duel_list[i].members_count++;
	duel_list[i].invites_count = 0;
	duel_list[i].max_players_limit = maxpl;

	strcpy(output, msg_txt(sd,372)); // " -- Duel has been created (@invite/@leave) --"
	clif_messagecolor(&sd->bl, color_table[COLOR_LIGHT_GREEN], output, false, SELF);

	clif_map_property(&sd->bl, MAPPROPERTY_FREEPVPZONE, SELF);
	//clif_misceffect2(&sd->bl, 159);
	return i;
}
示例#4
0
文件: duel.c 项目: 544a/rathena
/*
 * Create a new duel for sd
 */
int duel_create(struct map_session_data* sd, const unsigned int maxpl)
{
	int i=1;
	char output[256];

	while(duel_list[i].members_count > 0 && i < MAX_DUEL) i++;
	if(i == MAX_DUEL) return 0;

	duel_count++;
	duel_set(i, sd);
	duel_list[i].members_count++;
	duel_list[i].invites_count = 0;
	duel_list[i].max_players_limit = maxpl;

	strcpy(output, msg_txt(sd,372)); // " -- Duel has been created (@invite/@leave) --"
	clif_disp_onlyself(sd, output, strlen(output));

	clif_map_property(sd, MAPPROPERTY_FREEPVPZONE);
	clif_maptypeproperty2(&sd->bl,SELF);
	//clif_misceffect2(&sd->bl, 159);
	return i;
}