ProjectionEvent
type ProjectionEvent =
| {
/** A game session starts. */
readonly type: "login";
}
| {
/** A game session ends. */
readonly type: "logout";
}
| {
/** A player goes AFK or comes back. */
readonly type: "player-afk";
readonly afk: boolean;
readonly entityId: number;
readonly username: string;
}
| {
/** A map finishes loading. */
readonly type: "join-map";
readonly map: {
readonly id: number;
readonly name: string;
readonly roomNumber: number;
};
}
| {
/** An item drops. */
readonly type: "item-drop";
readonly item: ItemSnapshot;
}
| {
/** A quest turn-in succeeds. */
readonly type: "quest-complete";
readonly questId: number;
}
| {
/** A monster dies. */
readonly type: "monster-death";
readonly monsterMapId: number;
}
| {
/** A monster respawns. */
readonly type: "monster-respawn";
readonly monsterMapId: number;
}
| {
/** A player dies. */
readonly type: "player-death";
readonly entityId: number;
readonly username: string;
}
| {
/** A player joins or leaves the current map. */
readonly type: "players-changed";
}
| {
/** An aura is added to or refreshed on a player or monster. */
readonly type: "aura-added";
/** The aura duration in seconds, when available. */
readonly duration?: number;
readonly icon?: string;
readonly name: string;
/** The applying entity's map-scoped ID, when known. */
readonly sourceId?: number;
readonly sourceType?: "monster" | "player";
/** The affected entity's map-scoped ID. */
readonly targetId: number;
readonly targetType: "monster" | "player";
}
| {
/** An aura is removed from a player or monster. */
readonly type: "aura-removed";
/** The aura duration in seconds, when available. */
readonly duration?: number;
readonly icon?: string;
readonly name: string;
/** The applying entity's map-scoped ID, when known. */
readonly sourceId?: number;
readonly sourceType?: "monster" | "player";
/** The affected entity's map-scoped ID. */
readonly targetId: number;
readonly targetType: "monster" | "player";
}
| {
/** A monster's counter attack starts. */
readonly type: "counter-attack-start";
/** The expected window duration in milliseconds, when known. */
readonly durationMs?: number;
/** The monster's map-scoped ID. */
readonly monsterMapId: number;
/** Where the trigger was detected. */
readonly source: "aura" | "message";
/** A stable identifier for the recognized trigger. */
readonly triggerId: string;
/** The aura name or combat message that matched the trigger. */
readonly triggerText: string;
}
| {
/** A monster's counter attack ends. */
readonly type: "counter-attack-end";
/** The monster's map-scoped ID. */
readonly monsterMapId: number;
/** Where the trigger was detected. */
readonly source: "aura" | "message";
/** A stable identifier for the recognized trigger. */
readonly triggerId: string;
/** The aura name or combat message that matched the trigger. */
readonly triggerText: string;
}
| ({
/** A player's location changes. */
readonly type: "player-location";
readonly cell: string;
readonly entityId: number;
readonly pad: string;
/** The latest known coordinates for the player. */
readonly position: {
readonly x: number;
readonly y: number;
};
readonly username: string;
} & (
| {
/** The destination reported by a complete walk update. */
readonly destination: {
readonly x: number;
readonly y: number;
};
readonly kind: "walk";
}
| {
/** `position` reports coordinates; `cell` reports only cell/pad. */
readonly kind: "cell" | "position";
}
))
| {
/** A yellow combat message appears. */
readonly type: "update-message";
/** The animation's `animStr`, when present. */
readonly animation?: string;
readonly message: string;
/** The related monster's map-scoped ID, when the message names one. */
readonly monsterMapId?: number;
readonly source: "animation" | "aura";
}
| {
/** The current map's encounter zone changes. */
readonly type: "zone";
readonly map: string;
readonly zone: string;
}
Defined in Event.ts:16