//Vaporize a character's homun. If flag, HP needs to be 80% or above. int merc_hom_vaporize(struct map_session_data *sd, int flag) { struct homun_data *hd; nullpo_ret(sd); hd = sd->hd; if (!hd || hd->homunculus.vaporize) return 0; if (status_isdead(&hd->bl)) return 0; //Can't vaporize a dead homun. if (flag && get_percentage(hd->battle_status.hp, hd->battle_status.max_hp) < 80) return 0; hd->regen.state.block = 3; //Block regen while vaporized. //Delete timers when vaporized. merc_hom_hungry_timer_delete(hd); hd->homunculus.vaporize = 1; if(battle_config.hom_setting&0x40) memset(hd->blockskill, 0, sizeof(hd->blockskill)); clif_hominfo(sd, sd->hd, 0); merc_save(hd); return unit_remove_map(&hd->bl, CLR_OUTSIGHT); }
int merc_hom_dead(struct homun_data *hd, struct block_list *src) { //There's no intimacy penalties on death (from Tharis) struct map_session_data *sd = hd->master; clif_emotion(&hd->bl, E_WAH); //Delete timers when dead. merc_hom_hungry_timer_delete(hd); hd->homunculus.hp = 0; if (!sd) //unit remove map will invoke unit free return 3; clif_emotion(&sd->bl, E_SOB); //Remove from map (if it has no intimacy, it is auto-removed from memory) return 3; }
int merc_hom_dead(struct homun_data *hd, int flag) { struct map_session_data *sd = hd->master; struct s_homunculus *hom; struct item tmp_item; int rate; sd = hd->master; hd = sd->hd; hom = &hd->homunculus; rate =(hd->homunculus.class_) + 5530; merc_save(hd); sd = hd->master; pc_delitem(sd, pc_search_inventory(sd,690), 1, 0, 0); //sd->status.hom_id = 0; sd->status.lock = 0; merc_hom_hungry_timer_delete(hd); hd->homunculus.hp = 0; hom->char_id = sd->status.char_id; memset(&tmp_item,0,sizeof(tmp_item)); tmp_item.nameid = rate; tmp_item.identify = 1; tmp_item.card[0] = CARD0_HUN; tmp_item.card[1] = GetWord(hd->homunculus.hom_id,0); tmp_item.card[2] = GetWord(hd->homunculus.hom_id,1); tmp_item.card[3] = 1; 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); } hd->homunculus.hp = 0; hd->homunculus.intimacy = 0; return unit_remove_map(&hd->bl,CLR_OUTSIGHT); }