static int pet_food(struct map_session_data *sd, struct pet_data *pd) { int i, food_id; food_id = pd->petDB->FoodID; i = pc_search_inventory(sd, food_id); if( i == INDEX_NOT_FOUND ) { clif_pet_food(sd, food_id, 0); return 1; } pc_delitem(sd, i, 1, 0, 0, LOG_TYPE_CONSUME); if( pd->pet.hungry > 90 ) pet_set_intimate(pd, pd->pet.intimate - pd->petDB->r_full); else { int add_intimate = 0; if( battle_config.pet_friendly_rate != 100 ) add_intimate = (pd->petDB->r_hungry * battle_config.pet_friendly_rate) / 100; else add_intimate = pd->petDB->r_hungry; if( pd->pet.hungry > 75 ) { add_intimate = add_intimate>>1; if( add_intimate <= 0 ) add_intimate = 1; } pet_set_intimate(pd, pd->pet.intimate + add_intimate); }
static int pet_food(struct map_session_data *sd, struct pet_data *pd) { int i,k; k=pd->petDB->FoodID; i=pc_search_inventory(sd,k); if(i < 0) { clif_pet_food(sd,k,0); return 1; } pc_delitem(sd,i,1,0,0,LOG_TYPE_CONSUME); if( pd->pet.hungry > 90 ) pet_set_intimate(pd, pd->pet.intimate - pd->petDB->r_full); else { if( battle_config.pet_friendly_rate != 100 ) k = (pd->petDB->r_hungry * battle_config.pet_friendly_rate)/100; else k = pd->petDB->r_hungry; if( pd->pet.hungry > 75 ) { k = k >> 1; if( k <= 0 ) k = 1; } pet_set_intimate(pd, pd->pet.intimate + k); }