The Barrel

Location Event where two men roll large barrel behind bank, stand it upright, walk away to the inn (presumably for ale), leaving barrel unattended. You can break it open for random rewards or ignore it. Break outcomes: 33% explosion (explode setting, killplayer true = death, false = lose playerhp % HP default 50%), ~51% gold reward (mingold 10 to maxgold 10000), ~49% gems reward (mingems 2 to maxgems 10). Costs 1 visit counter. 25% raw chance (rawchance setting, range 5-50%). Max visitmax visits per day (default 3). Walking away consumes visit counter but is safe. Where your curiosity about an unattended barrel overcomes your survival instincts, you attack it with your weapon, and there's a coin flip between finding treasure or discovering it was full of sulfur, potassium nitrate, and charcoal (gunpowder) which explodes in your face and either kills you outright or leaves you deaf with ringing ears and 50% less HP, proving that not every wooden container in medieval villages should be violently opened.

Location & Access

Where: Location Event hook. 25% raw chance (rawchance setting, range 5-50% in 5% increments). Blocked if visitmax visits reached (default: 3 visits per day). Resets at newday.

Event Weight Function:

$visits = get_module_pref("visits", "barrel");
$visitmax = get_module_setting("visitmax", "barrel");
$chance = rawchance * (($visits < $visitmax));
return $chance;

Returns rawchance (25%) if visits < visitmax, otherwise 0 (blocked).

The Encounter

Setup: "Walking along through the village, you notice two men rolling a large barrel around to the back of the bank. They stand it on end, and walk back the way they came. They go into the inn, possibly for some ale, leaving you and your curiosity alone with the barrel."

Your Options:

  • Break it! — Attack barrel with your weapon (random outcome, consumes visit counter)
  • Ignore the barrel — Walk away (safe, but consumes visit counter)

Important: BOTH choices consume a visit counter. Even ignoring the barrel counts as one of your 3 daily visits.

Break the Barrel Outcomes

Attack Description: "You let your curiosity get the best of you, and you decide to break open the barrel to see what's inside. With a firm grip on your [weapon] to the barrel and."

Random Roll: e_rand(1,100) determines outcome.

Outcome 1: Explosion (33% or less, based on explode setting)

Explosion Message: "`c`b`$B`!O`^O`)M`!!`@!`&!`c`b`0`n`n" (colorful "BOOM!!" text)

If killplayer = true (default):

  • "That'll teach you to attack barrels full of sulfur, potassium nitrate, and charcoal! You got all bloweded upped!"
  • alive = 0, hitpoints = 0
  • Navigation: "To the shades" (shades.php)
  • addnews: "[name] was killed after attacking a barrel full of gun powder!"
  • debuglog: "got blown up by the barrel."

If killplayer = false:

  • "A few minutes pass while you were blacked out. You should really think about not fighting anything else today."
  • "Besides a few cuts and bruises, you survived the exploding barrel. Now, if you could just get rid of that ringing in your ears."
  • hitpoints -= playerhp% of current HP (default: 50% HP loss)
  • Survive but badly injured

Outcome 2: Gold (Roll 34-84, approximately 51%)

Description: "outpours `^[amount] Gold!"

  • Gold gain: e_rand(mingold, maxgold) — default range 10 to 10,000 gold
  • Average: ~5,005 gold if evenly distributed
  • Navigation: "Return to village" (village.php)

Outcome 3: Gems (Roll 85-100, approximately 16%)

Description: "outpours `@[amount] gems!"

  • Gem gain: e_rand(mingems, maxgems) — default range 2 to 10 gems
  • Average: ~6 gems if evenly distributed
  • Navigation: "Return to village" (village.php)

Note: Code shows 51% range (34-84) for gold, but comment suggests "elseif($exploder<51)" which would be 34-50%. Actual implementation uses 34-84 range based on else/elseif structure, giving gold higher probability than gems.

Ignoring the Barrel

Safe Option: "You decide that barrel busting just doesn't fit into your schedule today, and continue on your way.`n"

Effects:

  • visits counter increments by 1 (consumes a visit)
  • No rewards
  • No risk of death or HP loss
  • specialinc cleared, return to village

Strategic Note: Walking away still uses one of your 3 daily visits. If you're not going to break it, better to just not trigger the event.

Probability Analysis

Outcome Probability Effect
Explosion (death) 33% Die, go to Shades
Explosion (survive) 33% -50% HP, concussed
Gold reward ~51% +10 to +10,000 gold
Gem reward ~16% +2 to +10 gems

Expected Value Calculation (if killplayer = true):

  • 33% chance: Death (catastrophic negative value)
  • 51% chance: Average 5,005 gold (value ≈ 5 gems equivalent)
  • 16% chance: Average 6 gems
  • Net expected: Negative due to death risk (unless resurrection is free/easy)

Expected Value (if killplayer = false):

  • 33% chance: -50% HP (recoverable at inn/healer)
  • 67% chance: Net positive rewards (gold or gems)
  • Net expected: Slightly positive if HP restoration is cheap

Strategy

If killplayer = true (default):

  • Recommended: Ignore — 33% death risk is unacceptable
  • Death costs: All forest fights lost, resurrection gold/gems, potential VE loss
  • Expected gold/gem reward doesn't offset death probability
  • Only break if: You don't care about dying, have resurrection safety net (horcrux/phoenix), or gambling for fun

If killplayer = false:

  • Recommended: Break it — 67% positive outcomes, 33% HP loss (recoverable)
  • HP loss can be healed at inn (cheap) or healer
  • Gold/gem rewards outweigh healing costs
  • Expected value is positive for risk-neutral players

When to Walk Away:

  • Low HP (can't afford 50% HP loss)
  • Death unacceptable (important day, quests active, VE preservation)
  • Risk-averse playstyle
  • Already got rewards from previous barrels today

Visit Management:

  • You get 3 barrels per day (visitmax default)
  • Walking away consumes a visit (wasted opportunity)
  • If you're going to ignore it, better to just leave when event triggers
  • Use all 3 visits if killplayer = false (positive expected value)

Admin Configuration

Explosion Settings:

  • explode: Percentage barrel explodes (int, default: 33%)
  • killplayer: Kill player on explode? (bool, default: 1/true)
  • playerhp: If killplayer false, % HP lost (int, default: 50%)

General Settings:

  • visitmax: Number of times allowed to visit barrel per day (int, default: 3)
  • mingold: Minimum gold in barrel (int, default: 10)
  • maxgold: Maximum gold in barrel (int, default: 10,000)
  • rawchance: Raw chance of seeing barrel (range 5-50% in 5% increments, default: 25%)
  • mingems: Minimum gems in barrel (int, default: 2)
  • maxgems: Maximum gems in barrel (int, default: 10)

User Preferences:

  • visits: How many visits to barrel has player made today? (int, default: 0)

Commented-Out Settings: Code includes commented-out options for killing/hurting OTHER players with explosion (killothers, hurtothers, otherplayerhp, maxkill). Not currently implemented. Could be enabled for area-of-effect explosion that damages nearby players.

Technical Details

Hooks Used:

  • village: Event hook with custom weight function (rawchance × visit availability)
  • newday: Reset visits pref to 0

Outcome Logic:

$exploder = e_rand(1,100);
if ($exploder < explode) {
    // Explosion (33% default)
    if (killplayer) { death } else { HP loss }
} elseif ($exploder < 51) {
    // NOTE: This condition is never true if explode=33
    // Actual gold range: 34-84 (51% due to else fallthrough)
    gold reward
} else {
    // Gems (remainder, ~16%)
    gem reward
}

Visit Counter: Incremented for BOTH "break" and "walkaway" options. Both consume a daily visit slot.

Lore & Theme

The Setup: Two men delivering barrel to bank (storage? deposit? suspicious transaction?). They take a break for ale, leaving barrel unattended. Classic temptation scenario.

Gunpowder Barrel: Sulfur, potassium nitrate, charcoal = black powder/gunpowder. Medieval/early modern explosive. Why is there a gunpowder barrel behind a bank? Robbery? Mining? Demolition? Never explained.

The Gamble: Unknown contents. Could be treasure (someone's deposit), supplies (merchant goods), or explosives (dangerous materials). Breaking it = vandalism + trespassing + gambling with your life.

Death Message: "You got all bloweded upped!" — Intentionally silly grammar. Dark humor. "That'll teach you to attack barrels" — Victim blaming, deserved death for curiosity.

Survival: "Ringing in your ears" — tinnitus from explosion. "Cuts and bruises" — shrapnel wounds. "Blacked out" — concussion. Realistic explosion aftermath.

Thematic Elements: Greed vs caution, curiosity kills the cat, high-risk gambling, vandalism, opportunistic theft, explosive consequences (literal), "don't touch things that aren't yours."

Common Questions

Q: Can I disable the death outcome?
A: Yes. Admin can set killplayer = false. Explosion will only deal 50% HP damage instead of killing.

Q: Why does walking away consume a visit?
A: Code increments visit counter for both outcomes. Design choice to limit daily interactions regardless of action taken.

Q: What's the best strategy?
A: If killplayer = true (default), don't break it (33% death too risky). If killplayer = false, break all 3 barrels (positive expected value).

Q: Can the explosion hurt other players?
A: Not currently. Code has commented-out options for AoE damage, but not implemented.

Q: Is the gold amount random?
A: Yes. Range is 10-10,000 gold (mingold to maxgold settings). Could get 10 gold, could get 10,000. Huge variance.

Q: Can I get both gold AND gems?
A: No. Single random roll determines ONE outcome: explosion, gold, or gems.

The Barrel: where two delivery guys abandon a mysterious barrel behind the bank to go drink, you decide that smashing other people's property with your weapon is a reasonable response to unattended objects, and one-third of the time it turns out to be full of gunpowder which explodes and kills you instantly while the game mocks you with "you got all bloweded upped!" which is technically correct but grammatically offensive, though the other two-thirds of the time you find between 10 and 10,000 gold or a handful of gems which makes you feel vindicated about your life choices until the next barrel explodes in your face.