Helena 0 Posted December 31, 2013 Can someone direct me to the right lines/files to edit? I already messed some around in clif.c but I couldn't get it working, (I got the HP bar from monsters removed though... but that's not the bar I wanted xD) Thanks in advance. Quote Share this post Link to post Share on other sites
0 pan 87 Posted January 4, 2014 With this mods there will be no hunger, as far as I know there's no way to totally remove the hunger bar without having client-side modified. Haven't tested this changes in-game, but they built without showing any errors/warnings. Open src/map/pet.c and search for: if( pd->petDB ) { if( pd->petDB->equip_script ) status_calc_pc(sd,SCO_NONE); if( battle_config.pet_hungry_delay_rate != 100 ) interval = (pd->petDB->hungry_delay*battle_config.pet_hungry_delay_rate)/100; else interval = pd->petDB->hungry_delay; } if( interval <= 0 ) interval = 1; pd->pet_hungry_timer = timer->add(timer->gettick() + interval, pet->hungry, sd->bl.id, 0); return 0;}Change it to: if( pd->petDB ) { if( pd->petDB->equip_script ) status_calc_pc(sd,SCO_NONE);// if( battle_config.pet_hungry_delay_rate != 100 )// interval = (pd->petDB->hungry_delay*battle_config.pet_hungry_delay_rate)/100;// else// interval = pd->petDB->hungry_delay; } // if( interval <= 0 )// interval = 1;// pd->pet_hungry_timer = timer->add(timer->gettick() + interval, pet->hungry, sd->bl.id, 0); pd->pet.hungry = 70; // Optimal hunger value pd->pet.intimate = 1000; // Oh, so intimate return 0;}Now search for:timer->add_func_list(pet->hungry,"pet_hungry");Change it to://timer->add_func_list(pet->hungry,"pet_hungry");Find:int pet_hungry(int tid, int64 tick, int id, intptr_t data) { struct map_session_data *sd; struct pet_data *pd; int interval; sd=map->id2sd(id); if(!sd) return 1; if(!sd->status.pet_id || !sd->pd) return 1; pd = sd->pd; if(pd->pet_hungry_timer != tid){ ShowError("pet_hungry_timer %d != %dn",pd->pet_hungry_timer,tid); return 0; } pd->pet_hungry_timer = INVALID_TIMER; if (pd->pet.intimate <= 0) return 1; //You lost the pet already, the rest is irrelevant. pd->pet.hungry--; if( pd->pet.hungry < 0 ) { pet_stop_attack(pd); pd->pet.hungry = 0; pet->set_intimate(pd, pd->pet.intimate - battle_config.pet_hungry_friendly_decrease); if( pd->pet.intimate <= 0 ) { pd->pet.intimate = 0; pd->status.speed = pd->db->status.speed; } status_calc_pet(pd, SCO_NONE); clif->send_petdata(sd,pd,1,pd->pet.intimate); } clif->send_petdata(sd,pd,2,pd->pet.hungry); if(battle_config.pet_hungry_delay_rate != 100) interval = (pd->petDB->hungry_delay*battle_config.pet_hungry_delay_rate)/100; else interval = pd->petDB->hungry_delay; if(interval <= 0) interval = 1; pd->pet_hungry_timer = timer->add(tick+interval,pet->hungry,sd->bl.id,0); return 0;}Replace it with:int pet_hungry(int tid, int64 tick, int id, intptr_t data) {/** struct map_session_data *sd; struct pet_data *pd; int interval; sd=map->id2sd(id); if(!sd) return 1; if(!sd->status.pet_id || !sd->pd) return 1; pd = sd->pd; if(pd->pet_hungry_timer != tid){ ShowError("pet_hungry_timer %d != %dn",pd->pet_hungry_timer,tid); return 0; } pd->pet_hungry_timer = INVALID_TIMER; if (pd->pet.intimate <= 0) return 1; //You lost the pet already, the rest is irrelevant. pd->pet.hungry--; if( pd->pet.hungry < 0 ) { pet_stop_attack(pd); pd->pet.hungry = 0; pet->set_intimate(pd, pd->pet.intimate - battle_config.pet_hungry_friendly_decrease); if( pd->pet.intimate <= 0 ) { pd->pet.intimate = 0; pd->status.speed = pd->db->status.speed; } status_calc_pet(pd, SCO_NONE); clif->send_petdata(sd,pd,1,pd->pet.intimate); } clif->send_petdata(sd,pd,2,pd->pet.hungry); if(battle_config.pet_hungry_delay_rate != 100) interval = (pd->petDB->hungry_delay*battle_config.pet_hungry_delay_rate)/100; else interval = pd->petDB->hungry_delay; if(interval <= 0) interval = 1; pd->pet_hungry_timer = timer->add(tick+interval,pet->hungry,sd->bl.id,0);**/ return 0;}Find:int pet_hungry_timer_delete(struct pet_data *pd){ nullpo_ret(pd); if(pd->pet_hungry_timer != INVALID_TIMER) { timer->delete(pd->pet_hungry_timer,pet->hungry); pd->pet_hungry_timer = INVALID_TIMER; } return 1;}Replace with:int pet_hungry_timer_delete(struct pet_data *pd){ nullpo_ret(pd);/** if(pd->pet_hungry_timer != INVALID_TIMER) { timer->delete(pd->pet_hungry_timer,pet->hungry); pd->pet_hungry_timer = INVALID_TIMER; }**/ return 1;}Search for: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); } if( pd->pet.intimate <= 0 ) { pd->pet.intimate = 0; pet_stop_attack(pd); pd->status.speed = pd->db->status.speed; } else if( pd->pet.intimate > 1000 ) pd->pet.intimate = 1000; status_calc_pet(pd, SCO_NONE); pd->pet.hungry += pd->petDB->fullness; if( pd->pet.hungry > 100 ) pd->pet.hungry = 100; clif->send_petdata(sd,pd,2,pd->pet.hungry); clif->send_petdata(sd,pd,1,pd->pet.intimate); clif->pet_food(sd,pd->petDB->FoodID,1); return 0;}Replace it with: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); } if( pd->pet.intimate <= 0 ) { pd->pet.intimate = 0; pet_stop_attack(pd); pd->status.speed = pd->db->status.speed; } else if( pd->pet.intimate > 1000 ) pd->pet.intimate = 1000; status_calc_pet(pd, SCO_NONE); pd->pet.hungry += pd->petDB->fullness; if( pd->pet.hungry > 100 ) pd->pet.hungry = 100;**/ clif->send_petdata(sd,pd,2,pd->pet.hungry); clif->send_petdata(sd,pd,1,pd->pet.intimate);// clif->pet_food(sd,pd->petDB->FoodID,1); return 0;} Quote Share this post Link to post Share on other sites
0 Helena 0 Posted January 4, 2014 Can't that also be done by simply setting a number in pet.conf on zero? I appreciate your reply and attempt to help, but I still want pets to be hungry, just not have the bar. Some of my monster/pet sprites are inaccurately positioned, and the hunger bar blocks a part of their sprite... Quote Share this post Link to post Share on other sites
Can someone direct me to the right lines/files to edit?
I already messed some around in clif.c but I couldn't get it working, (I got the HP bar from monsters removed though... but that's not the bar I wanted xD)
Thanks in advance.
Share this post
Link to post
Share on other sites