Beispiel #1
0
void mercenary_heal(struct mercenary_data *md, int hp, int sp)
{
	if( hp )
		clif_mercenary_updatestatus(md->master, SP_HP);
	if( sp )
		clif_mercenary_updatestatus(md->master, SP_SP);
}
Beispiel #2
0
void mercenary_damage(struct mercenary_data *md, struct block_list *src, int hp, int sp)
{
	if( hp )
		clif_mercenary_updatestatus(md->master, SP_HP);
	if( sp )
		clif_mercenary_updatestatus(md->master, SP_SP);
}
Beispiel #3
0
int mercenary_set_faith(struct mercenary_data *md, int value)
{
	struct map_session_data *sd;
	int class_, *faith;

	if( md == NULL || md->db == NULL || (sd = md->master) == NULL )
		return 0;

	class_ = md->db->class_;

	if( class_ >= 6017 && class_ <= 6026 )
		faith = &sd->status.arch_faith;
	else if( class_ >= 6027 && class_ <= 6036 )
		faith = &sd->status.spear_faith;
	else if( class_ >= 6037 && class_ <= 6046 )
		faith = &sd->status.sword_faith;
	else
		return 0;

	*faith += value;
	*faith = cap_value(*faith, 0, SHRT_MAX);
	clif_mercenary_updatestatus(sd, SP_MERCFAITH);

	return 0;
}
Beispiel #4
0
/**
* Mercenary does kill
* @param md Mercenary
**/
void mercenary_kills(struct mercenary_data *md){
	if(md->mercenary.kill_count <= (INT_MAX-1)) //safe cap to INT_MAX
		md->mercenary.kill_count++;

	if( (md->mercenary.kill_count % 50) == 0 )
	{
		mercenary_set_faith(md, 1);
		mercenary_killbonus(md);
	}

	if( md->master )
		clif_mercenary_updatestatus(md->master, SP_MERCKILLS);
}
Beispiel #5
0
int mercenary_kills(struct mercenary_data *md)
{
    md->mercenary.kill_count++;
    md->mercenary.kill_count = cap_value(md->mercenary.kill_count, 0, INT_MAX);

    if((md->mercenary.kill_count % 50) == 0) {
        mercenary_set_faith(md, 1);
        mercenary_killbonus(md);
    }

    if(md->master)
        clif_mercenary_updatestatus(md->master, SP_MERCKILLS);

    return 0;
}