Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # NOTE: All divisions here are integer divisions (ie: 10/3 = 3)
- def get_party_avg_level():
- chars = get_number_chars_unlocked() # caps at 56
- avg = 0
- for member in frontline:
- avg = avg + member.level
- if (chars >= 12):
- return (avg / 12)
- else:
- # take the average based on how many chars you can have in party of 12
- return (avg / chars)
- lv = get_enemy_level() # NOT the challenge level, actual enemy level
- avg = get_party_avg_level()
- multiplier = 100
- # This bonus has a hard cap
- cap_bonus = 100 - ((avg * 100) / lv)
- cap_bonus = (cap_bonus / 3) * 10
- # This bonus has no cap
- lv_bonus = (lv - avg) * 12
- # If either result was less than 0, make it zero
- cap_bonus = max(cap_prob, 0)
- lv_bonus = max(lv_prob, 0)
- # Add the lesser bonus to the multiplier
- final_bonus = min(cap_bonus, lv_bonus)
- multiplier = multiplier + final_bonus
- for drop_item_slot in get_enemy_drop_item_slots():
- drop_chance = drop_item_slot.chance # Chance of dropping this item
- final_prob = drop_chance * multiplier / 100
- r = random(10000) # random number 0-9999
- if (r < final_prob):
- drop_item_for_player()
- """
- EXAMPLES
- Kraken (Lv25) dropping a Toadstoolshed (3333 chance), party average Lv19:
- cap_bonus = 100 - ((19 * 100) / 25) = 24
- cap_bonus = (24 / 3) * 10 = 80
- lv_bonus = (25 - 19) * 12 = 72
- final_bonus = min(80, 72) = 72
- final_prob = 3333 * (100 + 72) / 100 = 5732
- You increased the drop rate from 33.33% to 57.32%
- Kraken (Lv25) dropping a Toadstoolshed (3333 chance), party average Lv1:
- cap_bonus = 100 - ((1 * 100) / 25) = 96
- cap_bonus = (96 / 3) * 10 = 320
- lv_bonus = (25 - 1) * 12 = 288
- final_bonus = min(320, 288) = 288
- final_prob = 3333 * (100 + 288) / 100 = 12932
- You increased the drop rate from 33.33% to 100%
- Kraken (Lv25) dropping a Toadstoolshed (3333 chance), party average Lv40:
- cap_bonus = 100 - ((40 * 100) / 25) = -60
- cap_bonus = (96 / 3) * 10 = -200 (gets set to 0)
- lv_bonus = (25 - 40) * 12 = -180 (gets set to 0)
- final_bonus = min(0, 0) = 0
- final_prob = 3333 * (100 + 0) / 100 = 3333
- Drop rate not altered
- > Because of how the functions are defined, you can rewrite the formulas for cap_bonus and lv_bonus as follows:
- cap_bonus = (1 - x) * 1000 / 3
- lv_bonus = (1 - x) * 12 * lv
- Where x is the fraction (avg / lv)
- Therefore, if x is 1 or higher, the drop rate will not be altered
- If it is less than 1, then which formula takes priority depends only on the enemy level
- Since 12 * lv > 1000 / 3 for lv >= 28, we use lv_bonus for enemies up to Lv27, and cap_bonus for Lv28 onwards
- It follows that the highest bonus you can receive is when the fraction is rounded to 0 for cap_bonus: 1000 / 3 = 333
- > Other factors change the multiplier value before this part of the code execute. You can see a list of them below:
- # of Items Discovery Weekly held: +2 for each, up to +100
- # of Explorer King's Legend held: +2 for each, up to +100
- # of consecutive battles in dungeon: +2 for each battle, caps at:
- +100 before pillar of light
- +250 after pillar of light in regular dungeon
- +1000 after pillar of light in infinity corridor
- If any character in frontline has Gensokyo's Shopkeeper learned: +4 for each Skill Level
- Otherwise, if any character in backlines has Gensokyo's Shopkeeper learned: +1 for each Skill Level
- If any character in frontline has Dowsing learned: +20 for each Skill Level
- Otherwise, if any character in backlines has Dowsing learned: +5 for each Skill Level
- If any character in frontline has Ability to Gather Treasures learned: +10 for each Skill Level (+5 for each Skill Level of More and More Treasures if also learned)
- Otherwise, if any character in backlines has Ability to Gather Treasures learned: +3 for each Skill Level (+2 for each Skill Level if More and More Treasures if also learned)
- If any character in frontline has Kappa's Material Aesthetica learned: +20 for each Skill Level
- For each frontliner with Aesthetic Sense learned: +2 for each Skill Level
- For each backliner with Aesthetic Sense learned: +2
- > Some spells and skills also change the drop rate upon ko, but act directly on the enemy's dropped item slot's drop chance. These spells and effects are listed below:
- If the character has Kill Bonus: Drops learned, increase drop chances by 1/6 of its value
- If the character has Kappa's Material Aesthetica learned, increase drop chances by 40%
- If the spell used was Rare Metal Detector, double drop chances
- If the character has a Luck and Pluck equipped, increase drop chances by 20%
- If the character has Kill Bonus: Drops learned, increase drop chances by 1/5 of its value [Bug? Why does it do this again?]
- If the spell used was Radiant Treasure Gun, increase drop chances by 25% [40% if More and More Treasures learned]
- EXAMPLE
- Kraken dropping a Toadstoolshed (3333 chance), killed by Appraiser Nazrin's Rare Metal Detector:
- Base chance = 3333
- After Kill bonus: Drops 1/6 bonus: (3333 * 1.16) = 3888
- After Rare Metal Detector bonus: (3888 * 2) = 7776
- After Kill Bonus: Drops 1/5 bonus: (7776 * 1.2) = 9331
- You increased the drop rate from 33.33% to 93.31%
- """
Add Comment
Please, Sign In to add comment