Exemplo n.º 1
0
int merc_hom_food(struct map_session_data *sd, struct homun_data *hd)
{
	int i, foodID, emotion;
	char mes[255];

	if(hd->homunculus.vaporize)
		return 1 ;

	foodID = hd->homunculusDB->foodID;
	i = pc_search_inventory(sd,foodID);
	if(i < 0) {
		clif_hom_food(sd,foodID,0);
		return 1;
	}
	pc_delitem(sd,i,1,0,0);

	if ( hd->homunculus.hunger >= 91 ) {
		merc_hom_decrease_intimacy(hd, 50);
		emotion = E_WAH;
	} else if ( hd->homunculus.hunger >= 76 ) {
		merc_hom_decrease_intimacy(hd, 5);
		emotion = E_SWT2;
	} else if ( hd->homunculus.hunger >= 26 ) {
		merc_hom_increase_intimacy(hd, 75);
		emotion = E_HO;
	} else if ( hd->homunculus.hunger >= 11 ) {
		merc_hom_increase_intimacy(hd, 100);
		emotion = E_HO;
	} else {
		merc_hom_increase_intimacy(hd, 50);
		emotion = E_HO;
	}

	hd->homunculus.hunger += 10;	//dunno increase value for each food
	if(hd->homunculus.hunger > 100)
		hd->homunculus.hunger = 100;

	clif_emotion(&hd->bl,emotion);
	snprintf(mes, sizeof mes,msg_txt(908),hd->homunculus.name);
	clif_message(&hd->bl,mes);

	clif_send_homdata(sd,SP_HUNGRY,hd->homunculus.hunger);
	clif_send_homdata(sd,SP_INTIMATE,hd->homunculus.intimacy / 100);
	clif_hom_food(sd,foodID,1);
       	
	// Too much food :/
	if(hd->homunculus.intimacy == 0)
		return merc_hom_delete(sd->hd, E_OMG);

	return 0;
}
Exemplo n.º 2
0
int merc_hom_food(struct map_session_data *sd, struct homun_data *hd)
{
	int i, foodID, emotion;

	if(hd->homunculus.vaporize)
		return 1 ;

	foodID = hd->homunculusDB->foodID;
	i = pc_search_inventory(sd,foodID);
	if(i < 0) {
		clif_hom_food(sd,foodID,0);
		return 1;
	}
	pc_delitem(sd,i,1,0);

	if ( hd->homunculus.hunger >= 91 ) {
		merc_hom_decrease_intimacy(hd, 50);
		emotion = 16;
	} else if ( hd->homunculus.hunger >= 76 ) {
		merc_hom_decrease_intimacy(hd, 5);
		emotion = 19;
	} else if ( hd->homunculus.hunger >= 26 ) {
		merc_hom_increase_intimacy(hd, 75);
		emotion = 2;
	} else if ( hd->homunculus.hunger >= 11 ) {
		merc_hom_increase_intimacy(hd, 100);
		emotion = 2;
	} else {
		merc_hom_increase_intimacy(hd, 50);
		emotion = 2;
	}

	hd->homunculus.hunger += 10;	//dunno increase value for each food
	if(hd->homunculus.hunger > 100)
		hd->homunculus.hunger = 100;

	clif_emotion(&hd->bl,emotion) ;
	clif_send_homdata(sd,SP_HUNGRY,hd->homunculus.hunger);
	clif_send_homdata(sd,SP_INTIMATE,hd->homunculus.intimacy / 100);
	clif_hom_food(sd,foodID,1);
       	
	// Too much food :/
	if(hd->homunculus.intimacy == 0)
		return merc_hom_delete(sd->hd, 23); //omg  

	return 0;
}
Exemplo n.º 3
0
int merc_hom_food(struct map_session_data *sd, struct homun_data *hd, int value)
{
	int emotion, addint;

	if(hd->homunculus.vaporize)
		return 1 ;

//	foodID = hd->homunculusDB->foodID;
//	i = pc_search_inventory(sd,foodID);
//	if(i < 0) {
//		clif_hom_food(sd,foodID,0);
//		return 1;
//	}
//	pc_delitem(sd,i,1,0,0);

//	if ( hd->homunculus.hunger >= 91 ) {

	addint = 100 - hd->homunculus.hunger;
	if(addint > value)
		addint = value;

		merc_hom_increase_intimacy(hd, addint);
		emotion = E_HO;




//	} else if ( hd->homunculus.hunger >= 76 ) {
//		merc_hom_increase_intimacy(hd, 5);
//		emotion = E_HO;
//	} else if ( hd->homunculus.hunger >= 26 ) {
//		merc_hom_increase_intimacy(hd, 5);
//		emotion = E_HO;
//	} else if ( hd->homunculus.hunger >= 11 ) {
//		merc_hom_increase_intimacy(hd, 5);
//		emotion = E_HO;
//	} else {
//		merc_hom_increase_intimacy(hd, 5);
//		emotion = E_HO;
//	}

	hd->homunculus.hunger += value;	//dunno increase value for each food
	if(hd->homunculus.hunger > 100)
		hd->homunculus.hunger = 100;

	clif_emotion(&hd->bl,emotion);
	clif_send_homdata(sd,SP_HUNGRY,hd->homunculus.hunger);
//	clif_send_homdata(sd,SP_INTIMATE,hd->homunculus.intimacy / 100);
//	clif_hom_food(sd,foodID,1);
       	
	// Too much food :/
//	if(hd->homunculus.intimacy == 0)
//		return merc_hom_delete(sd->hd, E_OMG);

	return 0;
}