Exemple #1
0
int merc_hom_change_class(struct homun_data *hd, short class_)
{
	int i;
	i = search_homunculusDB_index(class_,HOMUNCULUS_CLASS);
	if(i < 0)
		return 0;
	hd->homunculusDB = &homunculus_db[i];
	hd->homunculus.class_ = class_;
	status_set_viewdata(&hd->bl, class_);
	merc_hom_calc_skilltree(hd);
	return 1;
}
int merc_hom_change_class (struct homun_data *hd, short class_)
{
	int i;
	i = search_homunculusDB_index (class_, HOMUNCULUS_CLASS);

	if (i < 0)
		return 0;

	if(hd->homunculus.class_ == 2633 && class_ != 2634 || hd->homunculus.class_ == 2633 && class_ != 2635 || hd->homunculus.class_ == 2633 && class_ != 2636){
	i = rand(0, 99);
	if(i < 34)
	class_ = 2634;
	else if(i <= 66 && i >= 34)
	class_ = 2635;
	else if(i > 66)
	class_ = 2636;
	}

	hd->homunculusDB = &homunculus_db[i];
	hd->homunculus.class_ = class_;
	status_set_viewdata (&hd->bl, class_);
	merc_hom_calc_skilltree (hd);
	return 1;
}