Skip to content
ASArcaneMP Scripting APIScripting reference
Global objectServer APIGenerated

Pvp

const Pvp: object

Defined in: server/api.d.ts:5785

Player-vs-player rules and arbitration. Who may hurt whom is server-owned: the rules, pair overrides and each player’s flag and team decide it, and the native hit pipeline (impact relay, pricing, victim apply, vitals fan-out) enforces it.

configure(patch): PvpRules

Changes the server’s PvP rules live, for every client. Throws on an unknown key or a value of the wrong kind; numbers are clamped into range. Fires pvpRulesChanged when anything changed.

Partial<PvpRules>

The rules to change; the rest keep their values.

PvpRules

The rules now in force.

getRules(): PvpRules

The server’s PvP rules now in force.

PvpRules

getVitals(playerId): { ageMs: number; hp: number; level: number; max: number; } | null

That player’s last natively-reported vitals. Null before their first report. The policy object also carries victimHp/victimMax per hit.

number

{ ageMs: number; hp: number; level: number; max: number; } | null

relation(a, b): object

Whether these two may hurt each other right now, how they aim at each other and what a defeat does, as every client resolves it. reason names what decided it.

number | Player

number | Player

object

aim: "lock" | "skillshot"

defeat: "death" | "kneel"

hostile: boolean

reason: string

setPair(a, b, options?): boolean

Overrides the rules for one pair of players, both ways, until cleared or either leaves: a duel is setPair(a, b, { hostile: true, defeat: “kneel” }). A pair wins over rules.who and teams, but not over enabled: false.

number | Player

number | Player

{ aim?: "lock" | "skillshot"; defeat?: "death" | "kneel"; hostile?: boolean; } | null

The fields to override for these two; null or {} clears their override.

boolean

False when the two are the same player, either is not connected, or 32 pairs are already set.

setPolicy(fn?): boolean

Registers (or clears, with no/null argument) the per-hit policy hook, which runs after the rules: zones, gamemode balance and scoring live here.

PvpPolicy | null

Called for each hit the rules let through, with {casterId, victimId, spellId, spell, damage, duration, minHp, dotSeconds, defeat, bodyPart}; damage already carries damageScale and the players’ setDamageGiven/TakenMultiplier. A modded spell has spellId 0 and its mod’s record path as spell. Return false to veto, a number to replace the damage, {allow?, damage?, duration?, minHp?} for full control, or nothing to accept.

boolean

setSpellDamage(spell, damage?): boolean

Per-spell damage the server enforces in place of the built-in table, which is generated from the game’s own spell data, or of a modded spell’s own price. The server log names each modded spell the first time it lands.

string

Record path or basename, e.g. ‘DA_ExpulsoSpellRecord’, or a mod’s own such as ‘DA_Spell_CrucioVehemSpellRecord’.

number | null

Damage per hit before damageScale; for a curse that burns (Crucio), the whole burn. UNCLAMPED (1e6 = lethal), even above moddedSpellCap. null/omitted removes the entry.

boolean