diff options
author | Kenpachi Developer <Kenpachi.Developer@gmx.de> | 2020-03-09 17:21:18 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2020-04-05 21:29:52 +0200 |
commit | f50acd072b4c221983b8ecc85e7f6c92c8472bef (patch) | |
tree | d21dadfb3b739392dddb1ac9b5bc3a2c8f155aa4 | |
parent | ea24f8edd68edb71cb1ea2cee08979667e4f92e6 (diff) | |
download | hercules-f50acd072b4c221983b8ecc85e7f6c92c8472bef.tar.gz hercules-f50acd072b4c221983b8ecc85e7f6c92c8472bef.tar.bz2 hercules-f50acd072b4c221983b8ecc85e7f6c92c8472bef.tar.xz hercules-f50acd072b4c221983b8ecc85e7f6c92c8472bef.zip |
Implement usage of pet_catch_rate_official_formula battle flag
-rw-r--r-- | src/map/pet.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/map/pet.c b/src/map/pet.c index a20a59a3a..4d7a2366b 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -658,7 +658,17 @@ static int pet_catch_process2(struct map_session_data *sd, int target_id) return 1; } - int pet_catch_rate = pet->db[i].capture * (100 - get_percentage(md->status.hp, md->status.max_hp)) / 100 + pet->db[i].capture; + int pet_catch_rate; + int capture = pet->db[i].capture; + int mob_hp_perc = get_percentage(md->status.hp, md->status.max_hp); + + if (battle_config.pet_catch_rate_official_formula == 1) { + pet_catch_rate = capture * (100 - mob_hp_perc) / 100 + capture; + } else { + int lvl_diff_mod = (sd->status.base_level - md->level) * 30; + int char_luk_mod = sd->battle_status.luk * 20; + pet_catch_rate = (capture + lvl_diff_mod + char_luk_mod) * (200 - mob_hp_perc) / 100; + } pet_catch_rate = cap_value(pet_catch_rate, 1, 10000) * battle_config.pet_catch_rate / 100; |