static int pet_return_egg(struct map_session_data *sd, struct pet_data *pd) { struct item tmp_item; unsigned char flag = 0; pet_lootitem_drop(pd,sd); memset(&tmp_item,0,sizeof(tmp_item)); tmp_item.nameid = pd->petDB->EggID; tmp_item.identify = 1; tmp_item.card[0] = CARD0_PET; tmp_item.card[1] = GetWord(pd->pet.pet_id,0); tmp_item.card[2] = GetWord(pd->pet.pet_id,1); tmp_item.card[3] = pd->pet.rename_flag; if((flag = pc_additem(sd,&tmp_item,1,LOG_TYPE_OTHER))) { clif_additem(sd,0,0,flag); map_addflooritem(&tmp_item,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0,0); } pd->pet.incubate = 1; unit_free(&pd->bl,CLR_OUTSIGHT); status_calc_pc(sd,SCO_NONE); sd->status.pet_id = 0; return 1; }
static int pet_return_egg(struct map_session_data *sd, struct pet_data *pd) { struct item tmp_item; int flag; pet_lootitem_drop(pd,sd); memset(&tmp_item,0,sizeof(tmp_item)); tmp_item.nameid = pd->petDB->EggID; tmp_item.identify = 1; tmp_item.card[0] = CARD0_PET; tmp_item.card[1] = GetWord(pd->pet.pet_id,0); tmp_item.card[2] = GetWord(pd->pet.pet_id,1); tmp_item.card[3] = pd->pet.rename_flag; if((flag = pc_additem(sd,&tmp_item,1))) { clif_additem(sd,0,0,flag); map_addflooritem(&tmp_item,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0); } pd->pet.incuvate = 1; //No need, pet is saved on unit_free below. //intif_save_petdata(sd->status.account_id,&pd->pet); if(pd->state.skillbonus) { pd->state.skillbonus = 0; status_calc_pc(sd,0); } unit_free(&pd->bl,0); sd->status.pet_id = 0; return 1; }
static int pet_performance(struct map_session_data *sd, struct pet_data *pd) { int val; if (pd->pet.intimate > 900) val = (pd->petDB->s_perfor > 0)? 4:3; else if(pd->pet.intimate > 750) //@TODO: This is way too high val = 2; else val = 1; pet_stop_walking(pd,2000<<8); clif_pet_performance(pd, rnd()%val + 1); pet_lootitem_drop(pd,NULL); return 1; }