## Definitive explanation of gozag gold distraction

Ask fellow adventurers how to stay alive in the deep, dark, dangerous dungeon below, or share your own accumulated wisdom.

Crypt Cleanser

Posts: 686

Joined: Saturday, 12th December 2015, 23:54

### Definitive explanation of gozag gold distraction

Here is how Gozag gold distraction works as of 0.27 trunk. There's some math in this post but you can skip to the end if you just want the highlights.

First, here are some things that do not matter for gold distraction:
• Amount of gold you are carrying
• Anything to do with number of gold piles onscreen / in the monster's los / on the level / generated by killing monsters

When a monster corpse is turned into a pile of gold by gozag, a base_gold value for the monster is determined based on the number of chunks monsters of that size provide (yes, this is still tracked internally after food removal). Giant monsters are 12 chunks, big are 10, large are 9, and everything else doesn't matter for gold aura because everything human size or less is treated the same. base_gold is equal to 7 + (chunks -4)*2 for monsters bigger than human and 7 otherwise. The amount of gold generated in place of the corpse is base_gold / 2 + random2avg(base_gold, 2). After calculating that, crawl doubles that value and compares it to the duration of your gold distraction aura, then sets the duration of your gold distraction aura to whichever is higher.
Example: you have no gold aura and kill a stone giant. Base gold is 23, gold generated is 11 + random2avg(23, 2) = 11-33, biased toward 22. Gold aura will get a duration somewhere between 22 and 66 (220-660 aut).

After duration is set, crawl checks the current strength of your gold aura. On a (strength) in (strength +9) chance it stays the same, otherwise it increases by 1. So if you had no gold aura it will always increase to 1, but if you're at 9 already it only has a 50% chance to go up and if you got to 90 it'd have less than a 10% chance to increase. When the gold aura duration times out, gold aura strength resets to 0, but otherwise it does not decrease over time.

Once you have some gold aura, monsters have a chance to get distracted every time they act, provided that you can see their location, they are not asleep, they are not a battlesphere, fulminant prism, or orb of destruction, they are not a tentacle or tentacle segment, they are not firewood, and they are hostile. The odds of distracting a monster are calculated as follows: do a number of trials equal to the strength of your gold aura. Each trial has a 3% chance to succeed. If any of the trials succeed, the monster gets horny for gold (ENCH_GOLD_LUST is applied) for a random duration between 1 and 5 turns (10-50 aut), ending immediately if you attack them. Example probabilities: if your gold aura strength is 1, then monsters have a 3% chance to get enchanted. If your gold aura strength is 5, they have just over 13%. If your gold aura strength is 10, they have not quite 23%.

Tl;dr for explanation dislikers:
Gold distraction does not care about piles of gold or amount of gold you're carrying. Its duration gets set based on the amount of gold each new thing you kill is worth and its strength increases based on how many things you can kill without its duration timing out in between, but with diminishing returns as its power gets higher. As a result, it's very good at locking down monsters if you can continuously kill stuff. This is part of the reason that gozag is so good in zigs.

For this message the author Hellmonk has received thanks: 4
andrew, petercordia, PleasingFungus, rigrig

Crypt Cleanser

Posts: 686

Joined: Saturday, 12th December 2015, 23:54

### Definitive explanation of gozag bribe branch

By popular request, here's how bribe branch works:

When you try to bribe a branch, crawl will check to see if you're on the branch entrance of a bribable branch or if you're in a bribable branch and will prompt for both, in that order. Bribable branches are D, Orc, Elf, Snake, Shoals, Crypt, Tomb, Depths, Vaults, Zot, Hell (vestibule and hellbranches are combined for the purposes of bribe branch) and Pan. Bribing a branch adds the amount of gold used to that branch's bribe fund. The bribe status light is displayed in white if your bribe fund is >2000 gold, lightblue if between 2000 and 1000, and blue if 1000 or less.

Bribes are applied to monsters in the branch as a daction, or delayed level action, which means they are technically set as soon as the monster is generated/the level is bribed, but they aren't checked and gold isn't deducted until the monster comes into view (and bribes are removed if the bribe status ends due to lack of funds). Bribes are applied with the following rules:
• Monsters with less than human intelligence cannot be bribed
• Unique hell and pan lords cannot be bribed
• Monsters you have already seen will not be bribed
• Friendly monsters will not be bribed
• Summons will not be bribed
• If the monster has a band leader and the band leader is bribed, the monster gets a guaranteed bribe of the same type
Otherwise, there is a chance to bribe the monster. First, crawl calculates a base bribability. This is equal to the monster's hd / the branch's bribability factor or 1, whichever is greater. Branch bribability factor is either 2 (D, Orc), 3 (Elf, Snake, Shoals, Crypt, Tomb), or 4 (anywhere else). There is a bribability / 8 chance to apply a bribe to the monster; 1/3rd of the time this will be a friendly bribe and the remainder of the time this will be a neutral bribe.
Example: You bribe Zot:5. An orb of fire that you haven't seen yet is on the floor. You have a (30/4) = 7 in 8 chance of applying some kind of bribe and a little under 30% of the time you'll get a friendly bribe.

When you see a monster for the first time, bribe status is checked. Monsters with a friendly bribe set become friendly and monsters with a neutral bribe set become good_neutral, which is the kind that doesn't like to hit you. Friendly status is permanent even once the bribe runs out, but good_neutral bribed monsters become regular neutral once the bribe expires. The amount of gold deducted from the bribe is equal to the monster's xp value / 20 for a neutral bribe, double that for a friendly bribe. The last bribe that exhausts the bribe fund won't deduct more gold than is in the fund though, even if you're friendly bribing an orb of fire with 1 gold left.
Example: you successfully bribe an orb of fire and make it friendly. Average orb of fire xp is 8554. Your bribe fund loses about 855 gold, with some variance depending on how much hp that particular orb of fire has.

Hitting a monster with either bribe property set or one that has been bribed already will break the bribe for that monster as well as any bribed monster it can see. This happens even if you hit it from out of line of sight without knowing that it would be bribed, so try to avoid corner sniping things when you're bribing branches with gozag.

Tl;dr for explanation dislikers:
Bribes are most effective on high hd enemies and most expensive on high exp enemies. You have no control over whether a monster will get friendly bribed or neutral bribed (unless you want to make it not get bribed at all). Don't corner snipe things with gozag unless you like to turn bribed monsters hostile. You're more likely to bribe an orbrun panlord that spawns in dungeon than in zot or depths, not that you have any control over that.

For this message the author Hellmonk has received thanks: 3
andrew, Bozobub, PleasingFungus