House VE Rewards (Automatic Stipends)

Automated House reward system for dragon kills. Houses with 8+ members can enable auto-stipend: upon Voldemort Encounter completion, players automatically receive configured amounts of gold/gems from House vault. Optional bonus for multiple VEs within 24 hours (daydkbonusgold/daydkbonusgems settings). Head of House configures amounts via House navigation. Officers/Heads of House receive system mail notification of payouts. Requires House Vault module. Where you kill Voldemort and the House vault magically deposits gold directly into your hand while sending passive-aggressive emails to House leadership about dwindling vault reserves.

Eligibility Requirements

House Size Restriction:

  • Minimum 8 House members with clanrank > 0 (excludes applicants)
  • SQL check: COUNT(*) FROM accounts WHERE clanid=[X] AND clanrank > 0
  • If < 8 members: Auto-stipend disabled (setting ignored)
  • Prevents small Houses from draining vault immediately

Module Dependencies:

  • Requires: House Vault module
  • Uses vaultgold/vaultgems prefs from clanvault module
  • Won't function without House vault installed

Auto-Stipend Toggle:

  • House pref: autoStipend (bool, default: 0/disabled)
  • Head of House toggles via "Automatic Reward Setup" link in House navigation
  • Only visible to Heads of House (clanrank == 40)
  • Only visible if House has 8+ members

Reward Configuration

Base Rewards (per VE):

  • autoAmountGold: Gold to stipend (int, default: 0)
  • autoAmountGems: Gems to stipend (int, default: 0)
  • Leader sets amounts via web form
  • Applied to every dragon kill (if auto-stipend enabled)

24-Hour Bonus Rewards:

  • daydkbonusgold: EXTRA gold per VE if multiple VEs in 24h (int, default: 0)
  • daydkbonusgems: EXTRA gems per VE if multiple VEs in 24h (int, default: 0)
  • Triggered when: (current time - lastdkctime) < 86400 seconds
  • lastdkctime pref tracks timestamp of previous dragon kill
  • Bonus ADDS to base reward (not replacement)

Example Configuration:

  • autoAmountGold = 1000, autoAmountGems = 2
  • daydkbonusgold = 500, daydkbonusgems = 1
  • First VE: 1000 gold + 2 gems
  • Second VE within 24h: 1500 gold + 3 gems (1000+500 base+bonus)
  • Third VE within 24h: 1500 gold + 3 gems (bonus continues)
  • VE after 24h gap: 1000 gold + 2 gems (bonus resets)

Payout Process

Trigger:

  • Hook: dragonkill
  • Fires immediately upon dragon defeat
  • Before newday, before VE rewards screen

Validation Checks:

  • 1. Is autoStipend enabled for House? (if no: skip)
  • 2. Does House have 8+ members? (if no: skip)
  • 3. Is 24h bonus applicable? (check lastdkctime)
  • 4. Calculate total rewards (base + bonus if applicable)
  • 5. Check vault has sufficient funds

Insufficient Vault Funds:

  • No gold: "Your House is set to automatically reward you [X] Gold for this kill, but unfortunately the House vault has no gold in it at this time, so you cannot be rewarded, please contact the Head of your House."
  • Partial gold: "Your House is set to automatically reward you [base] Gold. and [bonus] extra. unfortunately the House vault only has [available] available at the moment, so you will only be stipended that amount."
  • No gems: Same messages for gems
  • Payout amount = MIN(requested, available)
  • If vault empty: totalstipgold/totalstipgems set to 0 (no payout)

Successful Payout:

  • Vault amounts decremented: vaultgold -= totalstipgold, vaultgems -= totalstipgems
  • Player amounts incremented: $session['user']['gold'] += totalstipgold, etc.
  • Message (no bonus): "Your House has been set to automatically reward you [X] Gold for this kill. This gold is being put directly into your hand, congratulations!"
  • Message (with bonus): "Your House has been set to automatically reward you [base] Gold for this kill, and, since you have done this more then once in 24 hours, you will also be stipended [bonus] additional gold for a total of [total] gold. This gold is being put directly into your hand, congratulations!"

Officer Notification System

Email Trigger:

  • If totalstipgold + totalstipgems > 1 (at least 1 gold or 1 gem paid)
  • System mail sent to all House Prefects + Head of House (clanrank >= CLAN_OFFICER)
  • Excludes player who received payout (acctid <> current player)
  • Only sends if officer has "showNot" pref enabled (clanvault notification setting)

Email Content:

  • Subject: "Automatic Reward to [PlayerName]"
  • Body: "[PlayerName] has been automatically Rewarded [gold] gold and [gems] gems for completing a leveling cycle."
  • Bonus note (if applicable): "Of this, [bonusgold] gold and [bonusgems] gems was a bonus for completing a cycle in under 24 hours."
  • Vault status: "There is now [remaining gold] gold and [remaining gems] gems remaining in the House vault."

Purpose:

  • Transparency: Prefects see vault deductions
  • Accountability: Track who's benefiting from auto-stipend
  • Budget planning: Monitor vault depletion rate

Head of House Configuration Interface

Access:

  • House navigation (op=enter or op='')
  • Only visible if: clanrank == 40 (Head of House) AND House has 8+ members
  • Link: "Automatic Reward Setup"
  • Page: runmodule.php?module=clandkrewards&op=admin

Form Fields:

  • autoAmountGold: Text input (Gold to Automatically Reward)
  • autoAmountGems: Text input (Gems to Automatically Reward)
  • daydkbonusgold: Text input (Bonus gold for multiple VEs/24h)
  • daydkbonusgems: Text input (Bonus gems for multiple VEs/24h)
  • Submit button: "Save Settings!"

Toggle Button:

  • If autoStipend == 0: "Turn AutoRewards on"
  • If autoStipend == 1: "Turn AutoRewards off"
  • Click to toggle enabled/disabled state
  • Confirmation message shown

Strategic Considerations

For Heads of House (Setting Amounts):

  • Balance vault sustainability vs member rewards
  • High amounts = vault depletes quickly
  • Low amounts = members less motivated
  • Consider House vault income sources (donations, deposits)
  • Monitor vault balance regularly
  • Disable auto-stipend if vault running low

For Players (Receiving Rewards):

  • Free gold/gems for VE completion (always accept!)
  • 24h bonus incentivizes rapid leveling cycles
  • If vault empty: Contact Head of House to refill or disable auto-stipend
  • Don't expect rewards in small Houses (< 8 members)

Abuse Prevention:

  • 8+ member minimum prevents solo farming
  • Vault depletion = auto-stop (no negative balances)
  • Prefect notifications = transparency
  • Head of House-only configuration = prevents tampering

Limitations

  • No Refunds: If player defeats dragon but dies before claiming reward, payout still occurs
  • Vault Dependency: Completely dependent on clan vault having funds
  • No Individual Caps: No limit on how many times one player can receive rewards
  • 24h Window Rigid: Bonus is all-or-nothing based on 86400 second threshold
  • No Graduated Bonuses: Can't configure different bonuses for 2nd, 3rd, 4th VE
  • Email Spam Risk: Officers get email for EVERY payout (can be many/day in active clan)
  • No Rank-Based Amounts: Members/officers/leaders all receive same amounts

House Automatic VE Rewards: where your Head of House configures auto-stipend amounts (default: 0 gold, 0 gems because nobody's set it up yet), and if your House has at least 8 members and the vault actually has funds, you automatically receive gold and gems deposited "directly into your hand" upon killing Voldemort, with bonus amounts if you're grinding multiple VEs within 24 hours because apparently the House rewards efficiency over taking breaks. Prefects and Heads of House receive passive-aggressive system mail notifications tracking every single payout ("There is now [X] gold and [Y] gems remaining in the House vault") so they can watch the vault deplete in real-time and contemplate whether auto-stipend was a terrible idea. If the vault runs dry mid-payout, you get a consolation message explaining that your House "unfortunately" has insufficient funds and you should "contact the Head of your House," which is code for "your housemates spent all the vault gold on random purchases and now you're broke."