Table of Contents

Enum ModifierSourceKind

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

What kind of thing contributed a modifier to an attribute.

public enum ModifierSourceKind : byte

Fields

Authoritative = 1

The server's total, installed wholesale by the reconcile, the spawn payload or the attribute broadcast.

This is the residual: the difference between what the server says the total is and what this peer's own attributed sources add up to. On an observer it is the entire modifier, because an observer applies no sources of its own. On the server it is normally zero, because the server IS the authority and its ledger is fully attributed.

Buff = 3

A buff, keyed by its template id — which is also its instance key in the buff container.

DungeonScaling = 4

Dungeon difficulty scaling applied to an NPC, keyed by the attribute template the scaling entry names — or zero for the sheet-wide resource multiplier, which names none.

The id is what keeps the two halves of a difficulty definition separate. EnemyResourceMultiplier applies to every resource and takes id zero; EnemyAttributeScalars names one template each and takes that template's id. Sharing one key made the named entry REPLACE the sheet-wide one, so a resource singled out for extra scaling silently lost the group multiplier instead of compounding with it.

Item = 2

An equipped item, keyed by ID — its row in character_item.

The item's real, durable identity, which survives a move between slots, a move between containers and a relog. It used to be a process-local counter (Item.InstanceID) because the database could not supply an id that identified an item: rows lived in three tables keyed (character_id, slot), each with its own identity sequence, so a row id named a slot and the same number named three different items. The single character_item table removed that, and with it the need for a second identity.

Zero is NOT a key here. An item created at runtime has no identity until its first persist returns one, and it can be equipped in the meantime — but zero is the absence of an identity, not one of its values, so two such items would share the key Item(0) and, because SetSource STATES a contribution rather than adding to one, the second would silently replace the first. ItemGenerator.TryResolveLedgerSource therefore DECLINES for a zero id: such an item contributes nothing until Item.AssignPersistentID gives it an identity, at which point the bonus is applied for the first time. The cost is a database round trip of missing stats, against a silent and permanent loss.

That decline is also what keeps an observer's sheet honest: an observer builds its copy of a peer's equipment with no ids at all (EquipmentController.WritePayload does not send them to non-owners), so it applies nothing — correctly, because the server's authoritative ExternalModifier already contains every equipped item's bonus.

NpcBonus = 5

An NPC's authored attribute bonus roll, keyed by the template it names AND its position in the authored list.

AttributeBonuses is an authored LIST and nothing stops it naming the same template twice — a designer splitting a roll into a flat part and a scalar part, say. The template alone is not enough to tell those two apart: they produce the same key, the second overwrites the first, and half the roll silently disappears. The list index is what separates them. See NpcBonus(int, int) for how the two are packed.

Region = 6

A region the character is standing in, keyed by the region's instance id.

Unattributed = 0

The bucket AddModifier(int) writes into.

Deliberately named for what it is. Nothing in the shipped call graph writes here any more — every real contributor names itself — and anything that appears in this bucket is a contribution nobody can remove except by negating it, which is the failure the ledger exists to end. It survives so that the escape hatch is visible rather than absent.

Remarks

The kind is half of a ModifierSource key. It exists because the id spaces do not share a namespace: an item's database id and a buff's template id are both small positive numbers and would otherwise collide, so item 7 and buff 7 would overwrite each other's contribution to the same attribute.