Skip to content

Combat System

TalesMUD uses a turn-based combat system with initiative, auto-attacks, class skills and spells, status effects, and full loot/XP distribution on defeat.

Combat begins when a player uses the attack command:

> attack goblin
You attack the Cave Goblin!
Initiative roll: 15 (your DEX mod: +2, roll: 13)
Cave Goblin initiative: 8
You act first!

The attack command aliases: a, hit

Turn order is determined by rolling 1d20 + DEX modifier for each combatant:

initiative_score = d20_roll + DEX_modifier

Higher scores act first. In case of tie, player acts first.

Once combat starts, a CombatInstance tracks:

  • All player participants
  • All enemy participants
  • Current turn order
  • Active status effects per combatant
  • Skill cooldowns per combatant
  • Combat state (active/ending)

Each combat round, combatants auto-attack their target. Damage formula:

base_damage = weapon_damage + primary_attribute_modifier
final_damage = max(1, base_damage - target_armor_defense)

Physical classes use STR or DEX modifier; magic classes use INT or WIS.

CommandAliasesDescription
attack [target]a, hitAttack a target, start or continue combat
cast [skill]spellCast an equipped skill or spell
defendd, guardDefensive stance — +50% defense for this round
fleerun, escapeAttempt to flee combat
skillsspells, abilitiesList equipped skills and cooldowns
statuscs, combatShow combat status and HP
bindSet current room as respawn point

Players can equip up to 4 skills simultaneously. Skills are class-specific and unlocked by level. See Skills & Spells for the full list.

> cast fireball
You hurl a ball of fire at the Cave Goblin for 18 damage! [Mana: 12/20]
The Cave Goblin is on fire! (DoT: 3 damage for 3 rounds)

The defend command increases defense by 50% for the current round:

> defend
You take a defensive stance. Your defense is increased by 50%.

Flee success is based on DEX:

flee_chance = 50% + (DEX_modifier * 5%)

On success: combat ends, player moves to a random adjacent room. On failure: the enemy gets a free attack.

> flee
You attempt to flee... (DEX mod: +3 → 65% chance)
Success! You escape the combat and stumble into the corridor.

Status effects apply buffs, debuffs, damage over time (DoT), or healing over time (HoT):

Effect TypeDescription
stunTarget skips their next action
dotDamage over time — ticks each round for N rounds
hotHealing over time — heals each round for N rounds
buffIncreases a stat by a percentage (attack, defense, dodge)
debuffDecreases a stat by a percentage
mana_shieldAbsorbs damage by consuming mana

When all enemies are defeated:

  1. XP calculated from each defeated enemy’s xpReward
  2. XP divided among all player participants
  3. Loot table checked — items rolled and added to the room
  4. Gold dropped to the room (if enemy has gold configured)
  5. Quest kill objectives updated for all participants
  6. Death messages sent to the room
  7. NPC instance removed or flagged for respawn

When a player’s HP reaches 0:

  1. Combat ends
  2. Player is moved to their bound respawn room (or the starting room)
  3. Player respawns at 50% HP and mana
  4. Death message sent to the room

Set your respawn point with bind in any room that allows binding.

XP is split evenly among all players in the combat instance. Loot drops to the room and is available to anyone (first-come first-served unless a group loot system is in place).