ScriptEventForType
type ScriptEventForType<T extends ScriptEventType> = Extract<{
readonly type: "login";
}, {
readonly type: T;
}> | Extract<{
readonly type: "logout";
}, {
readonly type: T;
}> | Extract<{
readonly type: "player-afk";
readonly afk: boolean;
readonly entityId: number;
readonly username: string;
}, {
readonly type: T;
}> | Extract<{
readonly type: "join-map";
readonly map: {
readonly id: number;
readonly name: string;
readonly roomNumber: number;
};
}, {
readonly type: T;
}> | Extract<{
readonly type: "item-drop";
readonly item: ItemSnapshot;
}, {
readonly type: T;
}> | Extract<{
readonly type: "quest-complete";
readonly questId: number;
}, {
readonly type: T;
}> | Extract<{
readonly type: "monster-death";
readonly monsterMapId: number;
}, {
readonly type: T;
}> | Extract<{
readonly type: "monster-respawn";
readonly monsterMapId: number;
}, {
readonly type: T;
}> | Extract<{
readonly type: "player-death";
readonly entityId: number;
readonly username: string;
}, {
readonly type: T;
}> | Extract<{
readonly type: "players-changed";
}, {
readonly type: T;
}> | Extract<{
readonly type: "aura-added";
readonly duration?: number;
readonly icon?: string;
readonly name: string;
readonly sourceId?: number;
readonly sourceType?: "monster" | "player";
readonly targetId: number;
readonly targetType: "monster" | "player";
}, {
readonly type: T;
}> | Extract<{
readonly type: "aura-removed";
readonly duration?: number;
readonly icon?: string;
readonly name: string;
readonly sourceId?: number;
readonly sourceType?: "monster" | "player";
readonly targetId: number;
readonly targetType: "monster" | "player";
}, {
readonly type: T;
}> | Extract<{
readonly type: "counter-attack-start";
readonly durationMs?: number;
readonly monsterMapId: number;
readonly source: "aura" | "message";
readonly triggerId: string;
readonly triggerText: string;
}, {
readonly type: T;
}> | Extract<{
readonly type: "counter-attack-end";
readonly monsterMapId: number;
readonly source: "aura" | "message";
readonly triggerId: string;
readonly triggerText: string;
}, {
readonly type: T;
}> | Extract<{
readonly type: "player-location";
readonly cell: string;
readonly entityId: number;
readonly pad: string;
readonly position: {
readonly x: number;
readonly y: number;
};
readonly username: string;
} & {
readonly destination: {
readonly x: number;
readonly y: number;
};
readonly kind: "walk";
}, {
readonly type: T;
}> | Extract<{
readonly type: "player-location";
readonly cell: string;
readonly entityId: number;
readonly pad: string;
readonly position: {
readonly x: number;
readonly y: number;
};
readonly username: string;
} & {
readonly kind: "cell" | "position";
}, {
readonly type: T;
}> | Extract<{
readonly type: "update-message";
readonly animation?: string;
readonly message: string;
readonly monsterMapId?: number;
readonly source: "animation" | "aura";
}, {
readonly type: T;
}> | Extract<{
readonly type: "zone";
readonly map: string;
readonly zone: string;
}, {
readonly type: T;
}>
Defined in ScriptApi.ts:110