diff options
-rw-r--r-- | db/pre-re/pet_db.conf | 1 | ||||
-rw-r--r-- | db/re/pet_db.conf | 1 | ||||
-rw-r--r-- | src/map/pet.c | 9 | ||||
-rw-r--r-- | src/map/pet.h | 1 |
4 files changed, 11 insertions, 1 deletions
diff --git a/db/pre-re/pet_db.conf b/db/pre-re/pet_db.conf index 101fb3912..9e9806180 100644 --- a/db/pre-re/pet_db.conf +++ b/db/pre-re/pet_db.conf @@ -49,6 +49,7 @@ pet_db:( OverFeedDecrement: overfeeding intimacy (int, defaults to 100) OwnerDeathDecrement: owner die intimacy (int, defaults to 20) StarvingDelay: starving time (int, defaults to 20) + StarvingDecrement: starving intimacy (int, defaults to 20) } CaptureRate: capture rate (int, defaults to 1000) Speed: speed (int, defaults to 150) diff --git a/db/re/pet_db.conf b/db/re/pet_db.conf index d4203ab43..c290bc822 100644 --- a/db/re/pet_db.conf +++ b/db/re/pet_db.conf @@ -49,6 +49,7 @@ pet_db:( OverFeedDecrement: overfeeding intimacy (int, defaults to 100) OwnerDeathDecrement: owner die intimacy (int, defaults to 20) StarvingDelay: starving time (int, defaults to 20) + StarvingDecrement: starving intimacy (int, defaults to 20) } CaptureRate: capture rate (int, defaults to 1000) Speed: speed (int, defaults to 150) diff --git a/src/map/pet.c b/src/map/pet.c index 649884468..6b1f3176f 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -277,7 +277,7 @@ static int pet_hungry(int tid, int64 tick, int id, intptr_t data) { pet_stop_attack(pd); pd->pet.hungry = PET_HUNGER_STARVING; - pet->set_intimate(pd, pd->pet.intimate - battle_config.pet_hungry_friendly_decrease); + pet->set_intimate(pd, pd->pet.intimate - pd->petDB->starving_decrement); if (pd->pet.intimate == PET_INTIMACY_NONE) pd->status.speed = pd->db->status.speed; status_calc_pet(pd, SCO_NONE); @@ -1428,6 +1428,7 @@ static int pet_read_db_sub(struct config_setting_t *it, int n, const char *sourc pet->db[n].r_full = 100; pet->db[n].die = 20; pet->db[n].starving_delay = min(20000, pet->db[n].hungry_delay); + pet->db[n].starving_decrement = 20; if ((t = libconfig->setting_get_member(it, "Intimacy"))) { if (config_setting_is_group(t)) { @@ -1570,6 +1571,12 @@ static bool pet_read_db_sub_intimacy(int idx, struct config_setting_t *t) if (libconfig->setting_lookup_int(t, "StarvingDelay", &i32) == CONFIG_TRUE) pet->db[idx].starving_delay = cap_value(1000 * i32, 0, pet->db[idx].hungry_delay); + if (libconfig->setting_lookup_int(t, "StarvingDecrement", &i32) == CONFIG_TRUE) + pet->db[idx].starving_decrement = cap_value(i32, PET_INTIMACY_NONE, PET_INTIMACY_MAX); + + if (pet->db[idx].starving_decrement == PET_INTIMACY_NONE) + pet->db[idx].starving_delay = 0; + return true; } diff --git a/src/map/pet.h b/src/map/pet.h index 98b6f3517..3d3712243 100644 --- a/src/map/pet.h +++ b/src/map/pet.h @@ -59,6 +59,7 @@ struct s_pet_db { int autofeed; int hunger_decrement; int starving_delay; + int starving_decrement; struct script_code *equip_script; struct script_code *pet_script; |