Explorar o código

Homunculi configuration adjustments (#2092)

* Fixes #2073.
* Homunculi will no longer autoloot items by default.
* Homunculi will not Vaporize if their HP is below 80% when the master dies.
* The battle configuration homunculus_auto_vapor is now a percentage value to allow for further customization.
Thanks to @TheNoobCompany!
Aleos %!s(int64=8) %!d(string=hai) anos
pai
achega
12756ba8ec
Modificáronse 3 ficheiros con 7 adicións e 8 borrados
  1. 4 3
      conf/battle/homunc.conf
  2. 1 1
      src/map/battle.c
  3. 2 4
      src/map/pc.c

+ 4 - 3
conf/battle/homunc.conf

@@ -40,10 +40,11 @@ hvan_explosion_intimate: 45000
 homunculus_show_growth: yes
 
 // Does autoloot work, when a monster is killed by homunculus only?
-homunculus_autoloot: yes
+homunculus_autoloot: no
 
-// Should homunculi Vaporize when Master dies?
-homunculus_auto_vapor: yes
+// Should homunculi Vaporize when Master dies? (Note 2)
+// A homunculus will not Vaporize if their HP is below 80%.
+homunculus_auto_vapor: 80
 
 // Max level for regular Homunculus
 homunculus_max_level: 99

+ 1 - 1
src/map/battle.c

@@ -8258,7 +8258,7 @@ static const struct _battle_data {
 	{ "ksprotection",                       &battle_config.ksprotection,                    5000,   0,      INT_MAX,        },
 	{ "auction_feeperhour",                 &battle_config.auction_feeperhour,              12000,  0,      INT_MAX,        },
 	{ "auction_maximumprice",               &battle_config.auction_maximumprice,            500000000, 0,   MAX_ZENY,       },
-	{ "homunculus_auto_vapor",              &battle_config.homunculus_auto_vapor,           1,      0,      1,              },
+	{ "homunculus_auto_vapor",              &battle_config.homunculus_auto_vapor,           80,     0,      100,            },
 	{ "display_status_timers",              &battle_config.display_status_timers,           1,      0,      1,              },
 	{ "skill_add_heal_rate",                &battle_config.skill_add_heal_rate,             7,      0,      INT_MAX,        },
 	{ "eq_single_target_reflectable",       &battle_config.eq_single_target_reflectable,    1,      0,      1,              },

+ 2 - 4
src/map/pc.c

@@ -7624,10 +7624,8 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
 			pet_unlocktarget(sd->pd);
 	}
 
-	if (sd->status.hom_id > 0) {
-		if(battle_config.homunculus_auto_vapor && sd->hd)
-			hom_vaporize(sd, HOM_ST_ACTIVE);
-	}
+	if (hom_is_active(sd->hd) && battle_config.homunculus_auto_vapor && get_percentage(sd->hd->battle_status.hp, sd->hd->battle_status.max_hp) >= battle_config.homunculus_auto_vapor)
+		hom_vaporize(sd, HOM_ST_ACTIVE);
 
 	if( sd->md )
 		mercenary_delete(sd->md, 3); // Your mercenary soldier has ran away.