Battle Arena
Village PvP arena system where players challenge each other to non-lethal combat. Cost: fighterscost gold per player level per fight (default: 100 gold × your level). Daily limit: allowed fights per day (default: 5). Battle points system: Earn points for wins, lose points for defeats. Leaderboard: Fighter with most battle points becomes arena champion. Champion displayed on login screen if showleader setting enabled. Auto-match system selects opponents close to your level. No death penalty (arena combat is non-lethal). Points accumulate indefinitely (no decay). Uses external library: modules/lib/battlearena.php for combat logic. Where you pay gold based on your level to fight other players in an official gladiatorial arena that tracks your win/loss record via battle points, the top-ranked fighter gets their name plastered on the login screen for bragging rights, and despite stabbing each other with real weapons in front of an audience nobody actually dies because it's "sport."
Location & Access
Where: Location. Navigation: Village → "Battle Arena"
Prerequisites: None. Available to all players.
Daily Limit: allowed fights per day (default: 5). Resets at newday.
How the Arena Works
Entering the Arena
The Arena: "You enter a large circular arena. The roar of the crowd fills your ears as spectators cheer for blood sport. A sign reads: '`bBattle Arena`b - Test Your Might!'"
Arena Master: "The Arena Master approaches. '`#Looking for a fight? Each bout costs `^[cost] gold`#. You have `@[remaining]`# fights remaining today.'"
Cost Calculation: cost = fighterscost × player_level (default: 100 × level)
Examples:
- Level 10: 100 × 10 = 1,000 gold per fight
- Level 50: 100 × 50 = 5,000 gold per fight
- Level 100: 100 × 100 = 10,000 gold per fight
Opponent Matching
Auto-Match System: Arena selects opponent from player pool
Matching Criteria:
- Players close to your level (exact algorithm in lib/battlearena.php)
- Excludes offline players (must be active)
- Excludes yourself
- Random selection from eligible pool
No Opponent Available: "No suitable opponents found. Try again later."
Arena Combat
Combat Mechanics: Standard LoGD combat system (same as forest fights)
Your Buffs Apply: Spells, equipment, potions, companion all active
Opponent Buffs Apply: Opponent fights with their full stats and buffs
Non-Lethal: No death penalty. Losing doesn't kill you. Winning doesn't kill opponent.
Combat Outcomes
Victory:
- Win message: "`@You have defeated [opponent]! The crowd erupts in cheers!"
- +1 battle point (battlepoints pref increases)
- Gold cost not refunded (pay to play regardless of outcome)
Defeat:
- Loss message: "`\$You have been defeated by [opponent]! The crowd boos your failure."
- -1 battle point (battlepoints pref decreases, can go negative)
- No HP loss (arena magic heals you after fight)
- No death (non-lethal sport)
Flee:
- Can flee from arena combat like forest fights
- Counts as loss (-1 battle point)
- Still costs gold (no refund)
Battle Points System
How Points Work
Starting Points: 0 (battlepoints pref default)
Earning Points: +1 per victory
Losing Points: -1 per defeat
Point Range: Unlimited. Can go negative (e.g., -5 if you lose 5 in a row)
No Decay: Points never decrease except through losses. Keep points forever.
Leaderboard
Champion: Player with highest battlepoints value
Tracking: Module queries all players' battlepoints prefs, sorts by value, selects top player
Champion Display: If showleader setting enabled, champion's name shown on login screen (index.php)
Champion Message (if enabled):
- "`bBattle Arena Champion: `@[champion name]`b"
- Displayed to all players on login
- Updates dynamically when new champion emerges
Ties: If multiple players tied for highest points, system selects one (likely first found in database query)
Checking Your Points
Display: "Your current battle points: `@[X]`0"
Location: Shown in Battle Arena interface before entering fights
No Public Leaderboard: Only champion displayed publicly. Your points visible only to you.
Daily Fight Limit
Default Limit: allowed setting (default: 5 fights per day)
Counter: fights pref tracks how many fights used today
Reset: newday hook resets fights pref to 0
Limit Reached: "You've reached your daily fight limit. Return tomorrow for more battles."
Strategy: Use all 5 fights per day if grinding points. Maximize daily progression.
Cost Analysis
| Player Level | Cost per Fight | Daily Cost (5 fights) | Weekly Cost (35 fights) |
|---|---|---|---|
| 10 | 1,000 gold | 5,000 gold | 35,000 gold |
| 25 | 2,500 gold | 12,500 gold | 87,500 gold |
| 50 | 5,000 gold | 25,000 gold | 175,000 gold |
| 100 | 10,000 gold | 50,000 gold | 350,000 gold |
| 150 | 15,000 gold | 75,000 gold | 525,000 gold |
Takeaway: Arena is expensive gold sink at high levels. 50k+ gold per day for level 100+ players.
Strategy
Is the Arena Worth It?
Pros:
- PvP practice without death penalty (safe training)
- Battle points for bragging rights
- Champion status displayed publicly (if enabled)
- Test your build against other players
- No XP loss on defeat (unlike dying in graveyard PvP)
Cons:
- Very expensive (scales with level)
- No rewards except points (no gold, gems, XP, or items)
- Losing costs same as winning (pay regardless of outcome)
- Limited to 5 fights per day (can't grind infinitely)
- Points are purely cosmetic (no mechanical benefit)
Verdict: Gold sink for PvP enthusiasts and competitive players. Not economically efficient. Only do it if you enjoy PvP or want champion status.
Winning Strategy
Optimize Your Build:
- Best equipment (weapons, armor)
- Active buffs (potions, spells, elixirs)
- Companion (if you have academy squire, bring them)
- High HP (survive longer in prolonged fights)
Choose Fight Times Wisely:
- Fight when buffed (after buying elixirs, casting spells)
- Fight when at full HP (don't enter wounded)
- Avoid fighting if unbuffed or weak
Flee When Necessary:
- If losing badly, flee to avoid -1 point (oh wait, fleeing also gives -1 point)
- Actually, fleeing doesn't help. Might as well fight to the end.
Climbing the Leaderboard
Path to Champion:
- Fight daily (5 fights × 7 days = 35 fights per week)
- Win more than you lose (need positive win rate)
- Accumulate points over time (1 point per net win)
- Outlast other competitors (consistent play wins)
Time Investment:
- If you win 60% of fights: +3 points every 5 fights = +21 points per week
- If current champion has 100 points: Need ~5 weeks to catch up (assuming they stop playing)
- Active champion means you need better win rate to overtake
When to Skip Arena
- Low on gold (can't afford 5k+ per fight)
- Weak build (will lose most fights)
- Don't care about points (no mechanical benefit)
- Prefer forest fights (XP and gold rewards more useful)
Admin Configuration
Settings:
- fighterscost: Gold cost per player level per fight (int, default: 100)
- allowed: Number of fights allowed per day (int, default: 5)
- showleader: Display arena champion on login? (bool, default: 1/true)
- leader: User ID of current champion
User Preferences:
- battlepoints: Player's total battle points (int, default: 0)
- fights: Fights used today (int, default: 0)
Technical Details
Hooks Used:
- village: Add "Battle Arena" navigation link
- index: Display champion name on login screen (if showleader enabled)
- newday: Reset fights pref to 0
External Library: modules/lib/battlearena.php
- Contains combat matching algorithm
- Handles opponent selection logic
- Processes combat outcomes
- Updates battle points
Champion Detection Logic:
function battlearena_isnewleader() {
$currentleader = get_module_setting("leader");
$sql = "SELECT userid, value FROM ". db_prefix('module_userprefs'). "
WHERE modulename='battlearena' AND setting='battlepoints' AND value <> ''
ORDER BY value + 0 DESC LIMIT 1";
$result = db_query($sql);
$row = db_fetch_assoc($result);
if ($row['userid'] != $currentleader) {
set_module_setting("leader", $row['userid']);
invalidatedatacache("battleleader");
}
}
Queries all players' battle points, sorts descending, takes top player. Updates leader setting if changed. Invalidates cache to refresh display.
Index Display Hook:
// If showleader enabled
if (get_module_setting("showleader")) {
$leaderid = get_module_setting("leader");
$leader = get_character_field("name", $leaderid);
output("`n`bBattle Arena Champion: `@$leader`b`n");
}
Lore & Theme
Gladiatorial Arena: Classic combat sport. Players fight for glory and reputation. Spectators cheer bloodshed (but non-lethal).
Champion Status: Top fighter recognized publicly. Name displayed on login screen. Prestige and bragging rights.
Non-Lethal Combat: Arena magic prevents death. Defeated fighters healed after bout. Sport, not murder.
Pay-to-Play: Gold cost represents entrance fee. Arena maintenance, staff wages, healing magic costs. Winners and losers both pay.
Battle Points as Reputation: Points = fame. High points = respected warrior. Negative points = laughingstock. Social currency.
Common Questions
Q: Can I die in the arena?
A: No. Arena combat is non-lethal. Losing doesn't kill you or send you to Shades.
Q: Do I get anything for winning besides battle points?
A: No. No gold, gems, XP, or items. Only battle points (cosmetic/reputation).
Q: Can I see other players' battle points?
A: No public leaderboard. Only the champion's name is displayed. Your points visible only to you.
Q: Can battle points go negative?
A: Yes. If you lose more than you win, points can drop below 0 (e.g., -10 points).
Q: Do I get my gold back if I win?
A: No. Gold cost is entrance fee, not a wager. Pay regardless of outcome.
Q: How do I become champion?
A: Have the highest battle points. Win more fights than anyone else. Points accumulate over time.
Q: Can I fight specific players?
A: No. Auto-match system selects opponents. No manual targeting.
Q: Does the arena cost scale with level?
A: Yes. Cost = 100 gold × your level. Level 100 = 10,000 gold per fight.
Battle Arena: where you pay increasingly absurd amounts of gold based on your level to fight other players in a gladiatorial arena that tracks your wins and losses via battle points which have zero mechanical benefit and are purely for bragging rights, the current points leader gets their name displayed to everyone who logs in which is the only reward besides personal satisfaction, combat is officially non-lethal despite you and your opponent stabbing each other with real weapons because "arena magic" prevents death somehow, you can lose points by losing fights and go negative if you're really bad, and the whole system is basically an expensive gold sink for PvP enthusiasts who enjoy competitive ranking systems and don't mind spending 50,000+ gold per day for the privilege of maybe becoming champion someday.