Fixed homunculus auto feed for broken luas (#3758)

Fixes #3318

Thanks to @yoonjunho72, @AzarthMZintos and @admkakaroto
This commit is contained in:
Lemongrass3110 2018-12-17 13:53:37 +01:00 committed by GitHub
parent e8a7daec9f
commit 9183a54a0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 0 deletions

View File

@ -71,6 +71,15 @@ feature.achievement: on
// Requires: 2017-09-20bRagexeRE or later
feature.homunculus_autofeed: on
// At which rate should homunculus autofeeding trigger? (Note 2)
// Default: 30
//
// NOTE:
// This setting only applies, if your client side LUAs are bugged.
// By default the client triggers the feeding packet itself once
// it reaches the limit that is hardcoded in the client.
feature.homunculus_autofeed_rate: 30
// Attendance System (Note 1)
// Requires: 2018-03-07bRagexeRE or later
feature.attendance: on

View File

@ -8514,6 +8514,7 @@ static const struct _battle_data {
{ "skill_drop_items_full", &battle_config.skill_drop_items_full, 0, 0, 1, },
{ "switch_remove_edp", &battle_config.switch_remove_edp, 2, 0, 3, },
{ "feature.homunculus_autofeed", &battle_config.feature_homunculus_autofeed, 1, 0, 1, },
{ "feature.homunculus_autofeed_rate", &battle_config.feature_homunculus_autofeed_rate,30, 0, 100, },
{ "summoner_trait", &battle_config.summoner_trait, 3, 0, 3, },
{ "homunculus_autofeed_always", &battle_config.homunculus_autofeed_always, 1, 0, 1, },
{ "feature.attendance", &battle_config.feature_attendance, 1, 0, 1, },

View File

@ -646,6 +646,7 @@ struct Battle_Config
int skill_drop_items_full;
int switch_remove_edp;
int feature_homunculus_autofeed;
int feature_homunculus_autofeed_rate;
int summoner_trait;
int homunculus_autofeed_always;
int feature_attendance;

View File

@ -891,6 +891,10 @@ static TIMER_FUNC(hom_hungry){
clif_emotion(&hd->bl, ET_OK);
}
if( battle_config.feature_homunculus_autofeed && hd->homunculus.autofeed && hd->homunculus.hunger <= battle_config.feature_homunculus_autofeed_rate ){
hom_food( sd, hd );
}
if (hd->homunculus.hunger < 0) {
hd->homunculus.hunger = 0;
// Delete the homunculus if intimacy <= 100