Adventures
packets101 packets
Hearing and sending packets
What the game sends is heard on phantom.packets.client, and what the server sends on phantom.packets.server. watch hears a packet after it has gone through; on hears it first and may change or drop it; send sends one to that end. See Packets.
Overview
| Packet | Command | Way | What it is |
|---|---|---|---|
QuestJoin | qj | game → server | The player joins or creates a public adventure. |
QuestCreatePrivate | qjc | game → server | The player creates a private adventure to host. |
QuestJoinPrivate | qjp | game → server | The player joins a private adventure another player hosts. |
QuestJoinBuddy | qjf | game → server | The player joins the adventure a buddy is in. |
QuestJoinCancel | qjx | game → server | The player leaves an adventure lobby before it starts. |
QuestKick | qjk | game → server | The host removes a player from a private adventure lobby. |
QuestStart | qs | game → server | The player starts the adventure they are waiting in. |
QuestExit | qx | game → server | The player leaves the adventure. |
QuestActorTrigger | qat | game → server | The player sets off an adventure actor, such as a treasure chest. |
QuestTreasureChoice | qatt | game → server | The player keeps or turns down a treasure chest’s prize. |
QuestPickUp | qpup | game → server | The player picks up an item in an adventure. |
QuestGiftChoice | qpgift | game → server | The player picks a gift on an adventure’s reward screen. |
QuestPlayerGiftChoice | qpgiftplr | game → server | The player picks a gift on their own reward screen. |
QuestGiftsDone | qpgiftdone | game → server | The player finished picking an adventure’s gifts. |
QuestJoinResult | qj | server → game | The server says whether the player joined a public adventure. |
QuestCreatePrivateResult | qjc | server → game | The server says whether the player’s private adventure was created. |
QuestJoinPrivateResult | qjp | server → game | The server says whether the player joined a private adventure. |
QuestJoinNeedsLevel | qj | server → game | The server says the player’s level is too low for a public adventure. |
QuestCreatePrivateNeedsLevel | qjc | server → game | The server says the player’s level is too low to create the private adventure. |
QuestJoinPrivateNeedsLevel | qjp | server → game | The server says the player’s level is too low for the private adventure. |
QuestWaiting | qw | server → game | The players waiting in the adventure lobby changed. |
QuestJoinCancelled | qjx | server → game | The server confirms the player left the adventure lobby. |
QuestStarted | qs | server → game | The adventure starts, with every actor in it. |
QuestTreasure | qatt | server → game | A treasure chest offers the player its prize. |
QuestXp | quxp | server → game | The player earned adventure experience. |
QuestLevelUp | qulu | server → game | A player in the adventure levelled up. |
QuestPlayerLeft | qplq | server → game | A player left the adventure. |
QuestRewards | qpgift | server → game | The adventure’s reward screen opens with its gifts. |
QuestPlayerRewards | qpgiftplr | server → game | The player’s own reward screen opens with its gifts. |
QuestAward | qaward | server → game | The adventure awards a stat or achievement. |
QuestExitByType | qxt | server → game | The server sends the player out of the adventure. |
QuestBundle | qqm | server → game | Several adventure messages packed into one. |
QuestActorSpawned | qspn | server → game | An actor appears in the adventure, such as dropped treasure. |
QuestActorMoved | qau | server → game | An adventure actor moved. |
QuestActorPositionReport | qau | game → server | The client reports where an adventure actor it moves is. |
QuestActorSeek | qas | server → game | An adventure actor starts seeking a player, path or plant. |
QuestActorSeekRequest | qas | game → server | The client asks for an adventure actor to seek. |
QuestActorUntrigger | qaut | game → server | The player left an adventure actor’s area. |
QuestActorHealth | qahs | server → game | An adventure actor was hit, or missed. |
QuestActorDied | qad | server → game | An adventure actor was defeated or used up. |
QuestActorRestored | qrestore | server → game | An adventure actor came back. |
QuestCommand | qcmd | server → game | The adventure’s script tells the client to do something, such as change an actor. |
QuestTeleport | qcmd | server → game | The adventure’s script moves the player to an actor or a spawn point. |
QuestVariable | qcmdVT | server → game | The adventure’s script sets one of its variables. |
QuestActorSwfState | qswfs | server → game | An adventure actor’s animation changes state. |
QuestActorPath | qsp | server → game | An adventure actor walks another path. |
QuestActorIcon | qicon | server → game | An adventure actor’s icon shows or hides. |
QuestMovedItems | qmi | server → game | Where players moved the adventure’s items. |
QuestPickUpResult | qpup | server → game | The server says what came of picking up an adventure item. |
QuestGiveItem | qgi | server → game | The server hands the player an adventure item to pick up. |
QuestHealth | quhp | server → game | A player’s health in the adventure changed. |
QuestRespawned | qrspn | server → game | A player came back to life in the adventure. |
QuestPlayerDead | qpd | server → game | A player in the adventure was defeated. |
QuestCrystals | qporbs | server → game | The crystals the player gathered in the adventure changed. |
QuestExited | qx | server → game | The server answers the player leaving the adventure. |
QuestSeedGiven | qseed | server → game | The player’s seed count changed. |
QuestSeedPlanted | qps | server → game | A seed was planted in the adventure, or refused. |
QuestPlantAte | qpa | server → game | A planted seed’s plant ate a phantom. |
QuestPlantEatRecoil | qepr | server → game | A planted seed’s plant recoils after eating. |
QuestVolumeInteractionUpdate | qviu | server → game | An interactive volume’s progress changed. |
QuestStatsUpdate | qusu | server → game | The player’s own attack and defence range in the adventure changed. |
QuestAvSwitch | qavsw | server → game | A player is drawn disguised as a phantom or NPC, or their disguise is taken off. |
QuestActorAttack | qaa | game → server | The client says an adventure actor, or the player, was hit. |
QuestAttackPlayer | qap | game → server | The client says an adventure phantom it moves attacks a player. |
QuestPlayerAttacked | qap | server → game | An adventure actor attacks a player. |
QuestBeamZap | qbzap | game → server | The client says an adventure beam caught the player. |
QuestBeamZapped | qbzap | server → game | An adventure beam zaps. |
QuestPhantomZap | qpzap | game → server | The client says a phantom’s touch caught the player. |
QuestPhantomZapped | qpzap | server → game | An adventure phantom zaps a player. |
QuestPhantomAttackDestructible | qpad | game → server | The client says a phantom’s attack caught a destructible actor. |
QuestPlayerHeal | qph | game → server | The client says the player’s healing weapon landed on a player. |
QuestProjectileLaunch | qp | game → server | The client says the player threw a weapon in an adventure. |
QuestProjectileLaunched | qp | server → game | A player or actor threw a weapon in the adventure. |
QuestSwipe | qm | game → server | The client says the player swung a weapon in an adventure. |
QuestSwiped | qm | server → game | A player or actor swung a weapon in the adventure. |
QuestRespawnRequest | qprr | game → server | The player asks to come back to life in the adventure. |
QuestRespawnGranted | qprr | server → game | The server lets the player come back to life in the adventure. |
QuestAnswer | qaskr | game → server | The player answers a question the adventure asked. |
QuestMinigameDone | qmgc | game → server | A minigame an adventure launched is over. |
QuestFullRoomMinigameDone | qfrmgdone | game → server | A minigame an adventure room played together is over. |
QuestClone | qcq | game → server | The player asks for the adventure again. |
QuestMovedItemsRequest | qmi | game → server | The client asks where players moved the adventure’s items. |
QuestDropItem | qdroppup | game → server | The player drops the adventure item they carry. |
QuestPlantSeed | qps | game → server | The player plants a seed in the adventure. |
QuestEatPhantom | qep | game → server | The client says a plant bit a phantom. |
QuestPlantAteReport | qpa | game → server | The client says a plant started eating. |
QuestSideScrollReport | qssau | game → server | The client says where the player is in a side scrolling adventure. |
QuestSideScrollMoved | qssau | server → game | A player moved in a side scrolling adventure. |
QuestPlayerRoomChange | qrc | server → game | A player went to another room of the adventure. |
QuestTorch | qtorch | server → game | A torch in the adventure is lit or put out. |
QuestPlaySwf | qplayswf | server → game | The adventure plays a film over the screen. |
QuestPlaySwfDone | qplayswf | game → server | The client says the adventure’s film finished. |
QuestPreloadSwf | qpreloadswf | server → game | The adventure loads a film ahead of playing it. |
QuestFade | qfade | server → game | The adventure fades the screen out, or back in. |
QuestShake | qshake | server → game | The adventure shakes the room. |
QuestSound | qsnd | server → game | The adventure plays a sound. |
QuestVoiceOver | qsndVO | server → game | The adventure plays a voice over with its subtitle. |
QuestMusic | qmusic | server → game | The adventure changes its music. |
QuestMediaLibrary | qmlib | server → game | The adventure loads a pack of its sounds. |
QuestSoundPack | qsndpk | server → game | The adventure loads a pack of its sounds. |
QuestPostUri | qposturi | server → game | The adventure records a page view for analytics. |
QuestJoin
Joins, or creates, a public adventure (QuestXtCommManager.sendQuestCreateJoinPublic):
%xt%o%qj%<room>%<roomName>%<scriptDefId>%<difficulty>%0%
difficulty is 0 for normal and 1 for hard (AdventureExpertPopup.onDifficulty). The client checks the avatar's level before offering hard mode, in the popup only; the join handler shows NDL with the level needed, so the server checks it too.
Fields
| Field | Type | |
|---|---|---|
roomName | string | The room the player joins from, such as jamaa_township.room_main. The client adds it. |
scriptDefId | number | The adventure, by its script's definition id. |
difficulty | number | 0 for normal, 1 for hard (AdventureExpertPopup.onDifficulty). |
reserved | number | Written 0 by the client. What it is for is not recorded here; sendQuestCreateJoinPublic takes an autoStart argument that may be what it carries. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestJoin, (packet) => {
console.log(packet.roomName, packet.scriptDefId, packet.difficulty);
});QuestCreatePrivate
Creates a private adventure the player hosts (QuestXtCommManager.sendQuestCreatePrivate):
%xt%o%qjc%<room>%<roomName>%<scriptDefId>%<difficulty>%
The client offers this to members only (AdventureExpertPopup.onJoinTypeBtn), in the popup and not in the send, so a non-member's request is left for the server to refuse.
Fields
| Field | Type | |
|---|---|---|
roomName | string | The room the player joins from, such as jamaa_township.room_main. The client adds it. |
scriptDefId | number | The adventure, by its script's definition id. |
difficulty | number | 0 for normal, 1 for hard (AdventureExpertPopup.onDifficulty). |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestCreatePrivate, (packet) => {
console.log(packet.roomName, packet.scriptDefId, packet.difficulty);
});QuestJoinPrivate
Joins the private adventure another player hosts, from their avatar's menu (QuestXtCommManager.sendQuestJoinPrivate, called by AvatarWorldView):
%xt%o%qjp%<room>%<roomName>%<hostUserName>%
Fields
| Field | Type | |
|---|---|---|
roomName | string | The room the player joins from, such as jamaa_township.room_main. The client adds it. |
hostUserName | string | The player hosting the adventure, by username. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestJoinPrivate, (packet) => {
console.log(packet.roomName, packet.hostUserName);
});QuestJoinBuddy
Joins a buddy's adventure from their buddy card (QuestXtCommManager.sendQuestJoinBuddy, called by BuddyCard):
%xt%o%qjf%<room>%<roomName>%<buddyUserName>%
The client has no qjf handler; the server answers as it does a public join.
Fields
| Field | Type | |
|---|---|---|
roomName | string | The room the player joins from, such as jamaa_township.room_main. The client adds it. |
buddyUserName | string | The buddy whose adventure to join, by username. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestJoinBuddy, (packet) => {
console.log(packet.roomName, packet.buddyUserName);
});QuestJoinCancel
Leaves an adventure's waiting lobby (QuestXtCommManager.sendQuestJoinCancel): no arguments.
Fields
| Field | Type | |
|---|---|---|
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestJoinCancel, (packet) => {
console.log('quest.join-cancel');
});QuestKick
The host of a private adventure removes a player from its lobby (QuestXtCommManager.sendQuestPrivateKick, from PrivateAdventureJoin.onKickPlayerBtn).
Fields
| Field | Type | |
|---|---|---|
userName | string | The player to remove from the lobby, by username. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestKick, (packet) => {
console.log(packet.userName);
});QuestStart
Starts the adventure the player waits in (QuestXtCommManager.sendQuestStartRequest), naming the lobby room:
%xt%o%qs%<room>%<roomName>%
Fields
| Field | Type | |
|---|---|---|
roomName | string | The lobby room the player waits in, by name. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestStart, (packet) => {
console.log(packet.roomName);
});QuestExit
Leaves an adventure (QuestXtCommManager.sendQuestExit, from QuestManager.commandExit). exitType is empty for an ordinary exit, ffm when leaving the first five minutes tutorial, or the exit the adventure's script named.
Fields
| Field | Type | |
|---|---|---|
exitType | string | Empty for an ordinary exit, ffm leaving the tutorial, or the exit the script named. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestExit, (packet) => {
console.log(packet.exitType);
});QuestActorTrigger
The player sets off an actor: clicks a treasure chest, steps on a switch, talks to an NPC (QuestXtCommManager.questActorTriggered):
%xt%o%qat%<room>%<actorId>%<value>%
value is 0 for most actors, and 1 or 2 where the actor's script asks which way it was set off. The server decides what happens; for a chest it answers with quest.treasure.
Fields
| Field | Type | |
|---|---|---|
actorId | string | The actor set off, by its id in the adventure. |
value | number | 0 for most actors; 1 or 2 where the actor's script asks which way it was set off. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestActorTrigger, (packet) => {
console.log(packet.actorId, packet.value);
});QuestTreasureChoice
Keeps or turns down the prize a treasure chest offered (QuestXtCommManager.questActorTreasureTriggered, from QuestActor.keptPlacedTreasure, rejectedPlacedTreasure and keptDroppedTreasure):
%xt%o%qatt%<room>%<actorId>%<1 to keep, 0 to turn down>%
Fields
| Field | Type | |
|---|---|---|
actorId | string | The treasure chest, by its actor id. |
keep | boolean | True keeps the prize, false turns it down. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestTreasureChoice, (packet) => {
console.log(packet.actorId, packet.keep);
});QuestPickUp
Picks up an item actor (QuestXtCommManager.questPickUpItem), naming the player's own id in the room as the one picking it up.
Fields
| Field | Type | |
|---|---|---|
actorId | string | The item actor to pick up, by its id in the adventure. |
userId | number | The player's own SmartFox user id, as the one picking it up. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestPickUp, (packet) => {
console.log(packet.actorId, packet.userId);
});QuestGiftChoice
The gift the player chose on an adventure's reward screen (qpgift, see quest.rewards).
Fields
| Field | Type | |
|---|---|---|
index | number | The gift picked, by its place on the reward screen, or -1 when it was thrown away. |
belowGoal | boolean | The player gathered fewer crystals than the goal and was shown the consolation prize. |
discarded | boolean | The gift was thrown away rather than kept. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestGiftChoice, (packet) => {
console.log(packet.index, packet.belowGoal, packet.discarded);
});QuestPlayerGiftChoice
The gift the player chose on their own reward screen (qpgiftplr, see quest.player-rewards).
Fields
| Field | Type | |
|---|---|---|
index | number | The gift picked, by its place on the reward screen, or -1 when it was thrown away. |
belowGoal | boolean | The player gathered fewer crystals than the goal and was shown the consolation prize. |
discarded | boolean | The gift was thrown away rather than kept. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestPlayerGiftChoice, (packet) => {
console.log(packet.index, packet.belowGoal, packet.discarded);
});QuestGiftsDone
The reward screen was closed with every gift picked (QuestXtCommManager.sendPickGiftComplete). The client always writes 1.
Fields
| Field | Type | |
|---|---|---|
done | boolean | Every gift was picked. The client always writes 1. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestGiftsDone, (packet) => {
console.log(packet.done);
});QuestJoinResult
The answer to joining a public adventure (qj, answering quest.join). See above.
Fields
| Field | Type | |
|---|---|---|
joined | boolean | The player joined: the first argument is not 0. |
extra | string[] | What follows a join, as it came. What follows the refusal: the level needed for NL and NDL, the restriction for NA. |
refusal | QuestJoinRefusal | (string & {}) | null | Why the join was refused (QuestJoinRefusal), or null for a join. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestJoinResult, (packet) => {
console.log(packet.joined, packet.extra, packet.refusal);
});QuestCreatePrivateResult
The answer to creating a private adventure (qjc, answering quest.create-private). Its handler does not read the difficulty. See above.
Fields
| Field | Type | |
|---|---|---|
joined | boolean | The player joined: the first argument is not 0. |
extra | string[] | What follows a join, as it came. What follows the refusal: the level needed for NL and NDL, the restriction for NA. |
refusal | QuestJoinRefusal | (string & {}) | null | Why the join was refused (QuestJoinRefusal), or null for a join. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestCreatePrivateResult, (packet) => {
console.log(packet.joined, packet.extra, packet.refusal);
});QuestJoinPrivateResult
The answer to joining a private adventure (qjp, answering quest.join-private). See above.
Fields
| Field | Type | |
|---|---|---|
joined | boolean | The player joined: the first argument is not 0. |
extra | string[] | What follows a join, as it came. What follows the refusal: the level needed for NL and NDL, the restriction for NA. |
refusal | QuestJoinRefusal | (string & {}) | null | Why the join was refused (QuestJoinRefusal), or null for a join. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestJoinPrivateResult, (packet) => {
console.log(packet.joined, packet.extra, packet.refusal);
});QuestJoinNeedsLevel
quest.join-result refused for the level it needs. See above.
Fields
| Field | Type | |
|---|---|---|
refusal | "NL" | "NDL" | NL for the adventure, NDL for its hard mode. |
level | number | The adventure level the player needs. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestJoinNeedsLevel, (packet) => {
console.log(packet.refusal, packet.level);
});QuestCreatePrivateNeedsLevel
quest.create-private-result refused for the level it needs. See above.
Fields
| Field | Type | |
|---|---|---|
refusal | "NL" | "NDL" | NL for the adventure, NDL for its hard mode. |
level | number | The adventure level the player needs. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestCreatePrivateNeedsLevel, (packet) => {
console.log(packet.refusal, packet.level);
});QuestJoinPrivateNeedsLevel
quest.join-private-result refused for the level it needs. See above.
Fields
| Field | Type | |
|---|---|---|
refusal | "NL" | "NDL" | NL for the adventure, NDL for its hard mode. |
level | number | The adventure level the player needs. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestJoinPrivateNeedsLevel, (packet) => {
console.log(packet.refusal, packet.level);
});QuestWaiting
Who waits in the player's adventure lobby (AdventureJoin.handleWaitResponse and PrivateAdventureJoin.handleWaitResponse): every argument is a player's id in the room.
Fields
| Field | Type | |
|---|---|---|
userIds | number[] | The players waiting, by their SmartFox user ids: every argument, with no count. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestWaiting, (packet) => {
console.log(packet.userIds);
});QuestJoinCancelled
The lobby was left (QuestManager.handleQuestJoinCancelResponse); nothing in it is read.
Fields
| Field | Type | |
|---|---|---|
extra | string[] | Whatever the message holds, which the client does not read. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestJoinCancelled, (packet) => {
console.log(packet.extra);
});QuestStarted
The adventure starts (QuestXtCommManager.questStartResponse and QuestManager.handleQuestStartResponse):
%xt%qs%<room>%<scriptDefId>%<playerCount>%<actorCount>%<scriptTimestamp>%<actor>...%
A negative actorCount means it did not start, and nothing follows. Each actor is its id, type, definition (a name for type 16, a number otherwise), state, visible, click needed, path and movie state.
Fields
| Field | Type | |
|---|---|---|
scriptDefId | number | The adventure, by its script's definition id. |
playerCount | number | How many players are in the adventure. |
started | boolean | The adventure started: false when the actor count is negative. |
timestamp | string | The script's timestamp, as text; empty when the adventure did not start. |
actors | QuestActorInfo[] | Every actor in the adventure, after their count; empty when it did not start. |
extra | string[] | Whatever follows, as it came. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestStarted, (packet) => {
console.log(packet.scriptDefId, packet.playerCount, packet.started);
});QuestTreasure
A treasure chest's prize, offered to the player who opened it (QuestManager.handleQuestActorTriggerTreasure, then QuestActor.handleTriggerTreasure):
%xt%qatt%<room>%<actorId>%<prize>%<value>%<color>%<popup>%
prize is a QUEST_PRIZE; 5 resets the chest, and 6 and 7 only open it. popup 2 shows the member chest's popup. The client shows the prize and answers with quest.treasure-choice.
Fields
| Field | Type | |
|---|---|---|
actorId | string | The treasure chest, by its actor id. |
prize | number | What the prize is (QUEST_PRIZE); 5 resets the chest, and 6 and 7 only open it. |
value | number | The item's definition id, or how many gems or crystals. |
color | number | The clothing item's colour. |
popup | number | 2 shows the member chest's popup. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestTreasure, (packet) => {
console.log(packet.actorId, packet.prize, packet.value);
});QuestXp
Experience earned in an adventure (QuestManager.handleXpUpdate):
%xt%quxp%<room>%<earned>%<totalXp>%<previousLevel>%<level>%<levelProgress>%<actorId>%
levelProgress is the fraction of the way to the next level; actorId is the actor that gave the experience, which shows it above itself.
Fields
| Field | Type | |
|---|---|---|
earned | number | The experience just earned. |
totalXp | number | The player's experience in all. |
previousLevel | number | The player's level before this. |
level | number | The player's level now. |
levelProgress | number | The fraction of the way to the next level. |
actorId | string | The actor that gave the experience, which shows it above itself. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestXp, (packet) => {
console.log(packet.earned, packet.totalXp, packet.previousLevel);
});QuestLevelUp
A player in the adventure reached a new level (QuestManager.handleLevelUp).
Fields
| Field | Type | |
|---|---|---|
userId | number | The player, by SmartFox user id. |
level | number | Their new level. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestLevelUp, (packet) => {
console.log(packet.userId, packet.level);
});QuestPlayerLeft
A player left the adventure (QuestManager.handlePlayerLeftQuest): their id and avatar name.
Fields
| Field | Type | |
|---|---|---|
userId | number | The player, by SmartFox user id. |
avatarName | string | The name of the avatar they played. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestPlayerLeft, (packet) => {
console.log(packet.userId, packet.avatarName);
});QuestRewards
The adventure's reward screen and its gifts (qpgift). See above.
Fields
| Field | Type | |
|---|---|---|
popupType | number | The screen's look: 3 lucky, 4 and 5 spring, 6 hot and cold. 5 shows after a delay. |
gifts | QuestGift[] | The gifts, after their count. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestRewards, (packet) => {
console.log(packet.popupType, packet.gifts);
});QuestPlayerRewards
The player's own reward screen and its gifts (qpgiftplr). See above.
Fields
| Field | Type | |
|---|---|---|
popupType | number | The screen's look: 3 lucky, 4 and 5 spring, 6 hot and cold. 5 shows after a delay. |
gifts | QuestGift[] | The gifts, after their count. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestPlayerRewards, (packet) => {
console.log(packet.popupType, packet.gifts);
});QuestAward
The adventure's script awards something recorded in a user variable (QuestManager.handleAward). The client passes it straight back as achievement.set-user-var, except variable 78, which only plays the Colour Me Rad animation.
Fields
| Field | Type | |
|---|---|---|
userVarId | number | The user variable awarded; 78 only plays the Colour Me Rad animation. |
value | number | The value the client passes back in achievement.set-user-var. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestAward, (packet) => {
console.log(packet.userVarId, packet.value);
});QuestExitByType
The server sends the player out of the adventure a particular way (QuestManager.handleExitByType): ffm after the tutorial, flag straight to Jamaa Township.
Fields
| Field | Type | |
|---|---|---|
exitType | string | How the player is sent out: ffm after the tutorial, flag to Jamaa Township. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestExitByType, (packet) => {
console.log(packet.exitType);
});QuestBundle
Several adventure messages in one (QuestXtCommManager.handleXtReply, case qqm):
%xt%qqm%<room>%<Base64 of zlib bytes>%
The client decodes the Base64 (Base64.decodeToByteArray), uncompresses it, and reads a short count of messages; each is a short count of strings, then that many readUTF strings, the first the command. It hands each one to handleXtReply again as [command, room, ...args], the room being the bundle's, so each is read exactly as if it had come alone. It does so only while an adventure is running (QuestManager._questActorDictionary set).
Writing one back stores the bytes without compressing them, which the client reads the same.
Fields
| Field | Type | |
|---|---|---|
messages | QuestBundledMessage[] | The messages packed in the bundle, in order. |
extra | string[] | Whatever follows the payload, as it came. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestBundle, (packet) => {
console.log(packet.messages, packet.extra);
});QuestActorSpawned
An actor appears mid-adventure, spawned by another (QuestManager.handleSpawn, then doSpawn):
%xt%qspn%<room>%<spawnedFrom>%<actorId>%<type>%<defId>%<by type...>%
It starts visible, needing a click, in state 0, at the position of the actor that spawned it. A dropped treasure (type 200) adds its sub type and prize: 1 a den item id; 2 a clothing item id and its colour; 3 gems and 4 crystals, each an amount. A phantom or destructible (types 11 and 23) adds where around its spawner it appears, each from 0 to 1000 across the spawner's radius.
Fields
| Field | Type | |
|---|---|---|
spawnedFrom | string | The actor that spawned it, by its id in the adventure. |
actorId | string | The new actor's id. |
type | number | The new actor's type, such as 200 for a dropped treasure. |
defId | number | The new actor's definition id. |
dropped | QuestDroppedTreasure | null | What a dropped treasure (type 200) holds; null for other types. |
spawnOffset | { x: number; y: number; } | null | Where around its spawner a phantom or destructible (types 11 and 23) appears, each from 0 to 1000 across the spawner's radius; null for other types. |
extra | string[] | Whatever follows, as it came. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestActorSpawned, (packet) => {
console.log(packet.spawnedFrom, packet.actorId, packet.type);
});QuestActorMoved
Where a moving actor is, from the server (QuestManager.handleQuestActorPositionUpdateResponse, then QuestActor.handlePositionUpdate):
%xt%qau%<room>%<actorId>%<x>%<y>%<velocity>%<seekType>%<nearestX>%<nearestY>%
The client sets the actor's actorPos and walks it there at velocity. seekType is what it seeks (0 nothing, 1 its path, 2 a player, 3 a plant; 2 and 3 show its alert). The last two are the offset to the nearest player, which some phantoms turn to face.
Fields
| Field | Type | |
|---|---|---|
actorId | string | The actor, by its id in the adventure. |
x | number | Where the actor is, across, in the room's world coordinates. |
y | number | Where the actor is, down, in the room's world coordinates. |
velocity | number | How fast it walks there, as the client uses it. The unit is not recorded here. |
seekType | number | What it seeks: 0 nothing, 1 its path, 2 a player, 3 a plant. |
nearestX | number | The offset to the nearest player, across, which some phantoms turn to face. |
nearestY | number | The offset to the nearest player, down. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestActorMoved, (packet) => {
console.log(packet.actorId, packet.x, packet.y);
});QuestActorPositionReport
The player's client tells the server where an actor it moves is (QuestXtCommManager.questActorPositionUpdate, from QuestActor.heartbeat), the same fields the server passes on as quest.actor-moved. The client sends it only with another live player in the adventure, and never for a local actor (an id starting _l_).
Fields
| Field | Type | |
|---|---|---|
actorId | string | The actor, by its id in the adventure. |
x | number | Where the actor is, across, in the room's world coordinates. |
y | number | Where the actor is, down, in the room's world coordinates. |
velocity | number | How fast it walks there, as the client uses it. The unit is not recorded here. |
seekType | number | What it seeks: 0 nothing, 1 its path, 2 a player, 3 a plant. |
nearestX | number | The offset to the nearest player, across, which some phantoms turn to face. |
nearestY | number | The offset to the nearest player, down. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestActorPositionReport, (packet) => {
console.log(packet.actorId, packet.x, packet.y);
});QuestActorSeek
Who an actor now seeks (QuestManager.handleQuestActorRequestSeekResponse):
%xt%qas%<room>%<actorId>%<seekType>%<userId>%
The client keeps it when it outranks what the actor sought, or comes from the same player; only the player it names starts the actor seeking.
Fields
| Field | Type | |
|---|---|---|
actorId | string | The actor, by its id in the adventure. |
seekType | number | What it seeks: 0 nothing, 1 its path, 2 a player, 3 a plant. |
userId | number | The player it names, by SmartFox user id; only that player starts the actor seeking. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestActorSeek, (packet) => {
console.log(packet.actorId, packet.seekType, packet.userId);
});QuestActorSeekRequest
The client asks to have an actor seek (QuestXtCommManager.questActorSeek).
Fields
| Field | Type | |
|---|---|---|
actorId | string | The actor, by its id in the adventure. |
seekType | number | What it should seek: 0 nothing, 1 its path, 2 a player, 3 a plant. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestActorSeekRequest, (packet) => {
console.log(packet.actorId, packet.seekType);
});QuestActorUntrigger
The player left an actor's area (QuestXtCommManager.questActorUntriggered, from QuestActor.onRadiusTest and setVisible for volumes and factories).
Fields
| Field | Type | |
|---|---|---|
actorId | string | The actor whose area the player left, by its id in the adventure. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestActorUntrigger, (packet) => {
console.log(packet.actorId);
});QuestActorHealth
An actor's health (QuestManager.handleActorHealthStatus, then QuestActor.healthUpdate and NPCView.updateHealthBar):
%xt%qahs%<room>%<actorId>%<healthPercent>%<damage>%<fierce>% %xt%qahs%<room>%<actorId>%-1%
A health of -1 is a miss, shown as "miss" and followed by nothing. Otherwise damage is shown above the actor, with "Fierce!" when fierce is 1.
Fields
| Field | Type | |
|---|---|---|
actorId | string | The actor, by its id in the adventure. |
healthPercent | number | The actor's health, as a percentage, or -1 for a miss. |
missed | boolean | The attack missed: the health is -1. |
damage | number | null | The damage shown above the actor, or null for a miss or when the message leaves it out. |
fierce | boolean | null | "Fierce!" is shown with the damage: the field is 1. Null when there is no such field. |
extra | string[] | Whatever follows, as it came. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestActorHealth, (packet) => {
console.log(packet.actorId, packet.healthPercent, packet.missed);
});QuestActorDied
An actor is defeated or used up (QuestManager.handleActorDeath, then QuestActor.handleDeath):
%xt%qad%<room>%<actorId>%<damage>%<moved>%<x>%<y>%<otherActorId>%
Its health becomes 0. When moved is 1 the actor is first put at x, y; when otherActorId is not empty that actor is put there instead (what it dropped, say). A phantom plays its defeat and stays; anything else is removed from QuestManager._questActors once its movie says its death finished, or at once when it has none.
Fields
| Field | Type | |
|---|---|---|
actorId | string | The actor defeated, by its id in the adventure. |
damage | number | The damage dealt, as the server sends it. How the client uses it is not recorded here. |
moved | boolean | The actor is first put at x, y: the field is 1. |
x | number | Where it is put, across, in the room's world coordinates, when moved. |
y | number | Where it is put, down, when moved. |
otherActorId | string | An actor put there instead (what it dropped, say), or empty for none. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestActorDied, (packet) => {
console.log(packet.actorId, packet.damage, packet.moved);
});QuestActorRestored
An actor comes back with its health (QuestManager.handleRestore): a phantom returns to where it started, drawn anew.
Fields
| Field | Type | |
|---|---|---|
actorId | string | The actor that came back, by its id in the adventure. |
healthPercent | number | Its health, as a percentage. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestActorRestored, (packet) => {
console.log(packet.actorId, packet.healthPercent);
});QuestCommand
A command from the adventure's script (qcmd). See above.
Fields
| Field | Type | |
|---|---|---|
command | number | What the script tells the client to do (QUEST_COMMAND). |
actorId | string | null | The actor (for qcmdVT, the variable) whose state is set; null for other commands. |
state | number | null | The new state; null for other commands. |
visible | boolean | null | The actor is visible. Null for qcmdVT, other commands, or when missing. |
requireClick | boolean | null | The actor needs a click. Null for qcmdVT, other commands, or when missing. |
args | string[] | A command's arguments, as they came; for setting state, whatever follows. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestCommand, (packet) => {
console.log(packet.command, packet.actorId, packet.state);
});QuestTeleport
The script moves the player (QuestManager.commandTeleport): to an actor, which the client places the player on at once, or to a spawn point by its name, which it keeps for the next room it loads (setGotoSpawnPoint). A variant of quest.command:
%xt%qcmd%<room>%14%1%<actorId>% %xt%qcmd%<room>%14%0%<spawn>%
Fields
| Field | Type | |
|---|---|---|
to | "actor" | "spawn" | Where to: an actor, by its id in the adventure, or a spawn point, by its name. |
target | string | The actor's id, or the spawn point's name. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestTeleport, (packet) => {
console.log(packet.to, packet.target);
});QuestVariable
The adventure's script sets a variable's state (qcmdVT). See above.
Fields
| Field | Type | |
|---|---|---|
command | number | What the script tells the client to do (QUEST_COMMAND). |
actorId | string | null | The actor (for qcmdVT, the variable) whose state is set; null for other commands. |
state | number | null | The new state; null for other commands. |
visible | boolean | null | The actor is visible. Null for qcmdVT, other commands, or when missing. |
requireClick | boolean | null | The actor needs a click. Null for qcmdVT, other commands, or when missing. |
args | string[] | A command's arguments, as they came; for setting state, whatever follows. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestVariable, (packet) => {
console.log(packet.command, packet.actorId, packet.state);
});QuestActorSwfState
An actor's movie changes state (QuestManager.handleSetSwfState, then QuestActor.setSwfState).
Fields
| Field | Type | |
|---|---|---|
actorId | string | The actor, by its id in the adventure. |
swfState | string | The state its movie clip goes to. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestActorSwfState, (packet) => {
console.log(packet.actorId, packet.swfState);
});QuestActorPath
An actor walks another path (QuestManager.handleQuestSetPath, then QuestActor.setPath).
Fields
| Field | Type | |
|---|---|---|
actorId | string | The actor, by its id in the adventure. |
pathName | string | The path it walks now, by name. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestActorPath, (packet) => {
console.log(packet.actorId, packet.pathName);
});QuestActorIcon
An actor's icon shows or hides (QuestManager.handleActorIcon, compared with == "1").
Fields
| Field | Type | |
|---|---|---|
actorId | string | The actor, by its id in the adventure. |
showing | boolean | The icon shows: the field is 1. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestActorIcon, (packet) => {
console.log(packet.actorId, packet.showing);
});QuestMovedItems
Items players moved in the adventure, sent when the player joins its room (QuestManager.handleMovedItemList, asked by sendQuestMovedItemsRequest from questRoomJoined): each is an actor id, its two radii and where it is. The client draws each one it has not drawn.
For one it has already drawn, the client skips two more arguments after the five it read, which looks like a slip in the client; these are read as groups of five, and anything short of a whole group is kept in extra.
Fields
| Field | Type | |
|---|---|---|
items | QuestMovedItem[] | The moved items, five arguments each, with no count. |
extra | string[] | Any arguments short of a whole item, as they came. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestMovedItems, (packet) => {
console.log(packet.items, packet.extra);
});QuestPickUpResult
The server's answer to a pick up, sent to everyone in the adventure (QuestManager.handlePickUpItem):
%xt%qpup%<room>%0%<heldItem>% %xt%qpup%<room>%1%<actorId>%<userId>% %xt%qpup%<room>%2% %xt%qpup%<room>%3%<actorId>%<userId>%<x>%<y>% %xt%qpup%<room>%4%<actorId>%<userId>%<x>%<y>%<innerRadius>%<outerRadius>%<dropperUserId>%...%
A type 15 item picked up is remembered as picked up, so it is not drawn again. For result 4 the client reads one more string when dropperUserId is its own player; that is kept in extra.
Fields
| Field | Type | |
|---|---|---|
extra | string[] | Whatever follows, as it came, such as the extra string after result 4. |
result | number | What the pick up came to (QUEST_PICK_UP). |
heldItem | string | null | The item the player already carries, for result 0; null otherwise. |
actorId | string | null | The item, by its actor id, for results 1, 3 and 4; null otherwise. |
userId | number | null | The player who picked it up or put it down, by SmartFox user id, for 1, 3 and 4. |
x | number | null | Where the item was put down, across, for results 3 and 4; null otherwise. |
y | number | null | Where the item was put down, down, for results 3 and 4; null otherwise. |
innerRadius | number | null | The item's inner radius, for result 4; null otherwise. |
outerRadius | number | null | The item's outer radius, for result 4; null otherwise. |
dropperUserId | number | null | The player who put it down, by SmartFox user id, for result 4; null otherwise. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestPickUpResult, (packet) => {
console.log(packet.extra, packet.result, packet.heldItem);
});QuestGiveItem
The server hands the player an item: the client answers at once with quest.pick-up for it (QuestXtCommManager.handleXtReply, case qgi).
Fields
| Field | Type | |
|---|---|---|
actorId | string | The item handed over, by its actor id, which the client picks up at once. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestGiveItem, (packet) => {
console.log(packet.actorId);
});QuestHealth
A player's health changed (quhp). See above.
Fields
| Field | Type | |
|---|---|---|
userId | number | The player, by SmartFox user id. |
healthPercent | number | Their health as a percentage (AvatarInfo.questHealthPercentage). -1 with a change of 0 does nothing. |
change | number | Negative for a hit (the damage), positive for healing. |
health | number | Their health now. |
maxHealth | number | The most their health can be. |
x | number | null | Where a respawned player appears, across; null for quhp or when missing. |
y | number | null | Where a respawned player appears, down; null for quhp or when missing. |
extra | string[] | Whatever follows, as it came. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestHealth, (packet) => {
console.log(packet.userId, packet.healthPercent, packet.change);
});QuestRespawned
A player came back to life, and where they appear (qrspn). See above.
Fields
| Field | Type | |
|---|---|---|
userId | number | The player, by SmartFox user id. |
healthPercent | number | Their health as a percentage (AvatarInfo.questHealthPercentage). -1 with a change of 0 does nothing. |
change | number | Negative for a hit (the damage), positive for healing. |
health | number | Their health now. |
maxHealth | number | The most their health can be. |
x | number | null | Where a respawned player appears, across; null for quhp or when missing. |
y | number | null | Where a respawned player appears, down; null for quhp or when missing. |
extra | string[] | Whatever follows, as it came. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestRespawned, (packet) => {
console.log(packet.userId, packet.healthPercent, packet.change);
});QuestPlayerDead
A player was defeated (QuestManager.handleQuestPlayerDead): their avatar lies down, and for the client's own player the defeat popup follows two seconds later.
Fields
| Field | Type | |
|---|---|---|
userId | number | The player defeated, by SmartFox user id. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestPlayerDead, (packet) => {
console.log(packet.userId);
});QuestCrystals
How many crystals (orbs) the player has gathered in the adventure (QuestManager.handleOrbsUpdate). The client keeps the highest count seen as _playerOrbCountTotal, which decides the goals reached and whether the reward screen offers its gifts or the consolation prize.
Fields
| Field | Type | |
|---|---|---|
crystals | number | How many crystals the player has gathered in this adventure. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestCrystals, (packet) => {
console.log(packet.crystals);
});QuestExited
The server's answer to leaving an adventure. The client reads nothing in it (QuestXtCommManager.handleXtReply, case qx, only breaks); the room change that follows is what takes the player out.
Fields
| Field | Type | |
|---|---|---|
extra | string[] | Whatever the message holds, which the client does not read. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestExited, (packet) => {
console.log(packet.extra);
});QuestSeedGiven
The player's seed of one kind changed (QuestManager.handleGiveSeed): how many they hold, and the most they may carry. A defId of 0 means every seed the player holds was set to nothing, which the client uses to clear the inventory rather than naming each one.
Fields
| Field | Type | |
|---|---|---|
defId | number | The seed's definition id, or 0 to clear every seed the player holds. |
count | number | How many the player holds now. |
max | number | The most the player may hold. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestSeedGiven, (packet) => {
console.log(packet.defId, packet.count, packet.max);
});QuestSeedPlanted
Whether a seed was planted, sent back to everyone in the adventure (QuestManager.handlePlantSeed, answering QuestXtCommManager.sendPlantSeed):
%xt%qps%<room>%1%<userName>%<actorName>%<defId>%<x>%<y>%<launcherUserId>% %xt%qps%<room>%0%<userName>%
A plant that took root is added to the adventure's actors as a type 21 (phantom eating) plant; the client also takes the seed off the planter's dragged inventory when it is their own name.
Fields
| Field | Type | |
|---|---|---|
planted | boolean | The seed took root. |
userName | string | Who planted it, by account name. |
plant | { actorName: string; defId: number; x: number; y: number; launcherUserId: number; } | null | The plant it grew into, or null when the seed was refused. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestSeedPlanted, (packet) => {
console.log(packet.planted, packet.userName, packet.plant);
});QuestPlantAte
A plant ate a phantom (QuestManager.handlePlantAte), which plays the plant's eating animation on the phantom's actor.
Fields
| Field | Type | |
|---|---|---|
plantActorId | string | The plant, by its actor id. |
phantomActorId | string | The phantom it ate, by its actor id. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestPlantAte, (packet) => {
console.log(packet.plantActorId, packet.phantomActorId);
});QuestPlantEatRecoil
A plant recoils after eating (QuestManager.handlePlantEatRecoil), as its own animation shows.
Fields
| Field | Type | |
|---|---|---|
actorId | string | The plant, by its actor id. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestPlantEatRecoil, (packet) => {
console.log(packet.actorId);
});QuestVolumeInteractionUpdate
Progress on an interactive volume, such as a lever or chain a player holds down (QuestManager.handleQuestVolumeInteractionUpdate). The client plays a start chime the first time progress leaves 0, and a looping sound while it climbs.
Fields
| Field | Type | |
|---|---|---|
actorId | string | The volume actor, by its id in the adventure. |
progress | number | Its progress, 0 to 100. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestVolumeInteractionUpdate, (packet) => {
console.log(packet.actorId, packet.progress);
});QuestStatsUpdate
The player's own attack and defence range in the adventure changed (QuestManager.handleStatsUpdate), written onto their AvatarInfo. Nothing else in the message names the player: the client always takes this as its own.
Fields
| Field | Type | |
|---|---|---|
attackBase | number | The least a hit can do. |
attackMax | number | The most a hit can do. |
defenseBase | number | The least an incoming hit is reduced to. |
defenseMax | number | The most an incoming hit is reduced to. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestStatsUpdate, (packet) => {
console.log(packet.attackBase, packet.attackMax, packet.defenseBase);
});QuestAvSwitch
A player is drawn as a phantom or friendly NPC instead of their own animal (QuestManager.handleAvSwitch), a disguise some adventures use. avatarRefId is null when the disguise is taken off, which the client sends as -1.
Fields
| Field | Type | |
|---|---|---|
avatarRefId | number | null | The animal or NPC drawn in the player's place, or null when the disguise is taken off. |
userId | number | The player, by SmartFox user id. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestAvSwitch, (packet) => {
console.log(packet.avatarRefId, packet.userId);
});QuestActorAttack
The client says something was hit (QuestXtCommManager.questActorAttacked):
%xt%o%qaa%<room>%<actorId>%<playerHit>%<weaponDefId>%<x>%<y>%
An actor hit by the player's weapon is named, with where it stood (QuestActor.handleHit). A phantom's weapon landing on the player is sent with an empty actor id, playerHit 1 and the phantom's weapon (QuestMelee.handleHit, QuestProjectile.handleHit), and the client works out playerHit from the empty id itself. A weapon of -1 is a phantom that runs from the player being caught rather than hurt (QuestManager.questActorAttacked, isRunawayFromPlayer).
Fields
| Field | Type | |
|---|---|---|
actorId | string | The actor hit, by its id in the adventure; empty when the player was the one hit. |
playerHit | boolean | The player was hit rather than an actor: the client writes 1 for an empty actor id. |
weaponDefId | number | The weapon's item definition id, or -1 for a runaway phantom caught. |
x | number | Where the actor stood, across, in the room's world coordinates; 0 for the player. |
y | number | Where the actor stood, down; 0 for the player. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestActorAttack, (packet) => {
console.log(packet.actorId, packet.playerHit, packet.weaponDefId);
});QuestAttackPlayer
The client says a phantom it moves is attacking a player (QuestXtCommManager.sendAttackPlayer, from QuestActor.heartbeat as the phantom's attack starts), naming the weapon the phantom swings: its own, or the one the client picked for it (QuestActor.getActiveWeapon).
Fields
| Field | Type | |
|---|---|---|
actorId | string | The attacking actor, by its id in the adventure. |
userId | number | The player attacked, by SmartFox user id (_attackPlayerSfsId). |
weaponDefId | number | The weapon's item definition id (_attackPlayerWeaponItemDefId). |
color | number | The weapon's colour (_attackPlayerWeaponColor). |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestAttackPlayer, (packet) => {
console.log(packet.actorId, packet.userId, packet.weaponDefId);
});QuestPlayerAttacked
An actor attacks a player, passed on from another player's client (QuestManager.handleAttackPlayer, then QuestActor.handleAttackPlayer): the actor turns to the player and plays its attack. The fields are those of quest.attack-player, in its order.
Fields
| Field | Type | |
|---|---|---|
actorId | string | The attacking actor, by its id in the adventure. |
userId | number | The player attacked, by SmartFox user id. |
weaponDefId | number | The weapon's item definition id. |
color | number | The weapon's colour. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestPlayerAttacked, (packet) => {
console.log(packet.actorId, packet.userId, packet.weaponDefId);
});QuestBeamZap
A beam actor's light caught the player (QuestXtCommManager.questBeamZap, from QuestActor.heartbeat when the beam crosses the player's circle), naming the player.
Fields
| Field | Type | |
|---|---|---|
actorId | string | The beam actor, by its id in the adventure. |
userId | number | The player caught, by SmartFox user id: the client's own. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestBeamZap, (packet) => {
console.log(packet.actorId, packet.userId);
});QuestBeamZapped
A beam actor zaps, passed on to everyone (QuestManager.handleBeamZap, then QuestActor.handleBeamZap, which plays the zap along the beam's own angle). The player is read but not used by the client.
Fields
| Field | Type | |
|---|---|---|
actorId | string | The beam actor, by its id in the adventure. |
userId | number | The player it caught, by SmartFox user id. The client reads it and does nothing with it. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestBeamZapped, (packet) => {
console.log(packet.actorId, packet.userId);
});QuestPhantomZap
A phantom's touch caught the player (QuestXtCommManager.questPhantomZap, from QuestManager.questPhantomZap, QuestActor.heartbeat and the falling phantoms of QuestManager.heartbeat, which name themselves FallingPhantom):
%xt%o%qpzap%<room>%<actorId>%<userId>%<x>%<y>%
x and y are where the player stood.
Fields
| Field | Type | |
|---|---|---|
actorId | string | The phantom, by its actor id, or FallingPhantom for one dropping from above. |
userId | number | The player caught, by SmartFox user id: the client's own. |
x | number | Where the player stood, across, in the room's world coordinates. |
y | number | Where the player stood, down. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestPhantomZap, (packet) => {
console.log(packet.actorId, packet.userId, packet.x);
});QuestPhantomZapped
A phantom zaps a player, passed on to everyone (QuestManager.handlePhantomZap, then QuestActor.handlePhantomZap, which turns the phantom to the player and plays its zap).
Fields
| Field | Type | |
|---|---|---|
actorId | string | The phantom, by its actor id. |
userId | number | The player zapped, by SmartFox user id, whom the phantom turns to. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestPhantomZapped, (packet) => {
console.log(packet.actorId, packet.userId);
});QuestPhantomAttackDestructible
A phantom's attack caught a destructible actor, such as a wall the phantoms break (QuestXtCommManager.questPhantomAttackDestructible, from QuestManager.phantomAttackDestructible, at most once every two seconds for each destructible).
Fields
| Field | Type | |
|---|---|---|
phantomActorId | string | The attacking phantom, by its actor id. |
destructibleActorId | string | The destructible actor (type 23) it caught. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestPhantomAttackDestructible, (packet) => {
console.log(packet.phantomActorId, packet.destructibleActorId);
});QuestPlayerHeal
A healing weapon the player threw landed on a player (QuestXtCommManager.questPlayerHeal, from QuestProjectile.handleHit). How much it heals is the weapon's, which the server reads.
Fields
| Field | Type | |
|---|---|---|
weaponDefId | number | The healing weapon's item definition id. |
userId | number | The player healed, by SmartFox user id. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestPlayerHeal, (packet) => {
console.log(packet.weaponDefId, packet.userId);
});QuestProjectileLaunch
The client throws its player's ranged weapon, and where at (sendQuestProjectileLaunch).
Fields
| Field | Type | |
|---|---|---|
weaponDefId | number | The weapon's item definition id. |
x | number | Where it was aimed, across, in the room's world coordinates. |
y | number | Where it was aimed, down. |
actorId | string | The actor that launched it, or empty for a player. |
userId | number | The player who launched it, by SmartFox user id; 0 or less for an actor. |
color | number | The weapon's colour. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestProjectileLaunch, (packet) => {
console.log(packet.weaponDefId, packet.x, packet.y);
});QuestProjectileLaunched
A ranged weapon thrown by a player or an actor, passed on to everyone (QuestManager.handleLaunchProjectile).
Fields
| Field | Type | |
|---|---|---|
weaponDefId | number | The weapon's item definition id. |
x | number | Where it was aimed, across, in the room's world coordinates. |
y | number | Where it was aimed, down. |
actorId | string | The actor that launched it, or empty for a player. |
userId | number | The player who launched it, by SmartFox user id; 0 or less for an actor. |
color | number | The weapon's colour. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestProjectileLaunched, (packet) => {
console.log(packet.weaponDefId, packet.x, packet.y);
});QuestSwipe
The client swings its player's melee weapon, and where at (sendQuestSwipe).
Fields
| Field | Type | |
|---|---|---|
weaponDefId | number | The weapon's item definition id. |
x | number | Where it was aimed, across, in the room's world coordinates. |
y | number | Where it was aimed, down. |
actorId | string | The actor that launched it, or empty for a player. |
userId | number | The player who launched it, by SmartFox user id; 0 or less for an actor. |
color | number | The weapon's colour. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestSwipe, (packet) => {
console.log(packet.weaponDefId, packet.x, packet.y);
});QuestSwiped
A melee weapon swung by a player or an actor, passed on to everyone (QuestManager.handleSwipe).
Fields
| Field | Type | |
|---|---|---|
weaponDefId | number | The weapon's item definition id. |
x | number | Where it was aimed, across, in the room's world coordinates. |
y | number | Where it was aimed, down. |
actorId | string | The actor that launched it, or empty for a player. |
userId | number | The player who launched it, by SmartFox user id; 0 or less for an actor. |
color | number | The weapon's colour. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestSwiped, (packet) => {
console.log(packet.weaponDefId, packet.x, packet.y);
});QuestRespawnRequest
The death popup's button asks to come back (QuestXtCommManager.sendQuestPlayerRequestRespawn, from QuestManager.onDeathAccept), at the nearest respawn point the adventure gave the player, or where they lie when it gave none.
Fields
| Field | Type | |
|---|---|---|
reserved | number | Written 0 by the client, whose one caller always passes it. |
x | number | Where to come back, across, in the room's world coordinates. |
y | number | Where to come back, down. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestRespawnRequest, (packet) => {
console.log(packet.reserved, packet.x, packet.y);
});QuestRespawnGranted
The server lets the player come back (QuestManager.handleQuestPlayerRequestRespawn), and the client moves them to the nearest respawn point (respawnPlayer). Nothing in it is read; the health that comes with it arrives as quest.respawned.
Fields
| Field | Type | |
|---|---|---|
extra | string[] | Whatever the message holds, which the client does not read. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestRespawnGranted, (packet) => {
console.log(packet.extra);
});QuestAnswer
The answer to a yes or no question the adventure's script asked (QuestXtCommManager.questAskComplete, from QuestManager.onCommandAskConfirm), sent back with the actor and state the qcmd ask command carried.
Fields
| Field | Type | |
|---|---|---|
actorName | string | The actor that asked (_questCommandActor). |
actorState | number | The state the ask command carried (_questCommandActorState). |
yes | boolean | Yes: the client writes 1 for yes and 0 for no. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestAnswer, (packet) => {
console.log(packet.actorName, packet.actorState, packet.yes);
});QuestMinigameDone
A minigame the adventure's script launched is over (QuestXtCommManager.questMiniGameComplete, from QuestManager.handleQuestMiniGameComplete), sent back with the actor and state the qcmd game command carried.
Fields
| Field | Type | |
|---|---|---|
actorName | string | The actor that launched the game (_questCommandActorMiniGame). |
actorState | number | The state the game command carried (_questCommandActorStateMiniGame). |
result | number | How the game came out, as the minigame reports it. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestMinigameDone, (packet) => {
console.log(packet.actorName, packet.actorState, packet.result);
});QuestFullRoomMinigameDone
A minigame the whole adventure room played is over (QuestXtCommManager.questFullRoomMinigameComplete, from MinigameManager.leave when the room it goes back to is an adventure's).
Fields
| Field | Type | |
|---|---|---|
roomName | string | The adventure room the game goes back to (MinigameManager._primaryRoomName). |
result | number | How the game came out, as MinigameManager.leave is given it. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestFullRoomMinigameDone, (packet) => {
console.log(packet.roomName, packet.result);
});QuestClone
Asks for the adventure again (QuestXtCommManager.sendQuestCloneQuest): no arguments.
Fields
| Field | Type | |
|---|---|---|
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestClone, (packet) => {
console.log('quest.clone');
});QuestMovedItemsRequest
Asks where players moved the adventure's items (QuestXtCommManager.sendQuestMovedItemsRequest, from QuestManager.questRoomJoined): no arguments. The server answers with quest.moved-items.
Fields
| Field | Type | |
|---|---|---|
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestMovedItemsRequest, (packet) => {
console.log('quest.moved-items-request');
});QuestDropItem
Drops the item the player carries (QuestXtCommManager.sendQuestDropItem, from QuestManager.onDropItemConfirm), where the player stands:
%xt%o%qdroppup%<room>%<x>%<y>%<actorId>%<userId>%
Fields
| Field | Type | |
|---|---|---|
x | number | Where to drop it, across, in the room's world coordinates. |
y | number | Where to drop it, down. |
actorId | string | The item carried, by its actor id. |
userId | number | The player's own SmartFox user id, which the client adds. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestDropItem, (packet) => {
console.log(packet.x, packet.y, packet.actorId);
});QuestPlantSeed
Plants a seed (QuestXtCommManager.sendPlantSeed, from SeedInventoryHandling).
Fields
| Field | Type | |
|---|---|---|
defId | number | The seed's definition id. |
x | number | Where to plant it, across, in the room's world coordinates. |
y | number | Where to plant it, down. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestPlantSeed, (packet) => {
console.log(packet.defId, packet.x, packet.y);
});QuestEatPhantom
A plant bites the phantoms in reach (QuestXtCommManager.sendEatPhantom, from QuestActor.heartbeat as its attack lands), once for each phantom, with where it was.
Fields
| Field | Type | |
|---|---|---|
plantActorId | string | The plant, by its actor id. |
phantomActorId | string | The phantom bitten, by its actor id. |
x | number | Where the phantom was, across, in the room's world coordinates. |
y | number | Where the phantom was, down. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestEatPhantom, (packet) => {
console.log(packet.plantActorId, packet.phantomActorId, packet.x);
});QuestPlantAteReport
A plant starts eating (QuestXtCommManager.sendPlantAte, from QuestActor.heartbeat), the nearest phantom in reach, or none for a plant that only goes off; the server passes it on as quest.plant-ate.
Fields
| Field | Type | |
|---|---|---|
plantActorId | string | The plant, by its actor id. |
phantomActorId | string | The phantom it goes for, by its actor id, or empty for a plant that goes off alone. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestPlantAteReport, (packet) => {
console.log(packet.plantActorId, packet.phantomActorId);
});QuestSideScrollReport
Where the player's avatar is in a side scrolling adventure (QuestXtCommManager.questSideScrollAU).
%xt%o%qssau%<room>%<x>%<y>%<flags>%
Nothing in this build of the client calls it, so its arguments are named from what the server passes on (quest.side-scroll-moved, whose x and y follow the player's id) and from the QSSAU_* bits the class keeps beside it (QUEST_SIDE_SCROLL).
Fields
| Field | Type | |
|---|---|---|
x | number | Where the avatar is going, across, in the room's world coordinates. |
y | number | Where the avatar is going, down. |
flags | number | QUEST_SIDE_SCROLL bits: the keys down and what the avatar just did. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestSideScrollReport, (packet) => {
console.log(packet.x, packet.y, packet.flags);
});QuestSideScrollMoved
Another player's avatar moves in a side scrolling adventure (QuestXtCommManager.handleXtReply, case qssau): the client queues the whole message on that player's AvatarWorldView (queueCommand), which walks the avatar to x, y (sideScrollMovement). The client's own player is skipped.
Fields
| Field | Type | |
|---|---|---|
userId | number | The player, by SmartFox user id. |
x | number | Where their avatar is going, across, in the room's world coordinates. |
y | number | Where their avatar is going, down. |
extra | string[] | Whatever follows, as it came: the QUEST_SIDE_SCROLL bits, which the client does not read. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestSideScrollMoved, (packet) => {
console.log(packet.userId, packet.x, packet.y);
});QuestPlayerRoomChange
Another player went to another room of the adventure (QuestManager.handleQuestRoomChange): the client marks them on its off screen map there (AvatarManager.setOffScreenMapBySfsId) and takes them off the room's list of players.
Fields
| Field | Type | |
|---|---|---|
userId | number | The player, by SmartFox user id. |
roomName | string | The room they went to, such as quest_39.room_2. |
x | number | Where they are there, across, in the room's world coordinates. |
y | number | Where they are there, down. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestPlayerRoomChange, (packet) => {
console.log(packet.userId, packet.roomName, packet.x);
});QuestTorch
A torch is lit or put out (QuestManager.handleQuestTorch), on an actor or on a player:
%xt%qtorch%<room>%0%<lit>%<actorId>% %xt%qtorch%<room>%1%<lit>%<userId>%
The first argument is compared with == 0 for an actor and anything else is a player; lit with == 1. A player's torch is also written onto their AvatarInfo.questTorchStatus.
Fields
| Field | Type | |
|---|---|---|
target | number | 0 for an actor's torch; anything else for a player's. |
lit | boolean | The torch is lit: the field is 1. |
actorId | string | null | The actor carrying it, for an actor's torch; null for a player's. |
userId | number | null | The player carrying it, by SmartFox user id, for a player's torch; null for an actor's. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestTorch, (packet) => {
console.log(packet.target, packet.lit, packet.actorId);
});QuestPlaySwf
The adventure plays a film over the screen (QuestManager.handlePlaySwf): the client loads the media, fades out, plays it, and answers with quest.play-swf-done once it has faded back in. Media 2607 is swapped for its French, Portuguese, German or Spanish version.
Fields
| Field | Type | |
|---|---|---|
mediaId | number | The film, by media id. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestPlaySwf, (packet) => {
console.log(packet.mediaId);
});QuestPlaySwfDone
The adventure's film finished and the screen faded back in (QuestXtCommManager.sendPlaySwfComplete, from QuestManager.heartbeat): no arguments.
Fields
| Field | Type | |
|---|---|---|
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the game sends it to the server, after it has gone through.
const stop = phantom.packets.client.watch(packets.QuestPlaySwfDone, (packet) => {
console.log('quest.play-swf-done');
});QuestPreloadSwf
Loads a film ahead of playing it (QuestManager.handlPreloadSwf), so it starts at once.
Fields
| Field | Type | |
|---|---|---|
mediaId | number | The film, by media id. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestPreloadSwf, (packet) => {
console.log(packet.mediaId);
});QuestFade
The screen fades (QuestManager.handleFade): compared with == 1, a fade back in is queued; anything else fades out.
Fields
| Field | Type | |
|---|---|---|
fadeIn | boolean | Fade back in: the field is 1. False fades out. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestFade, (packet) => {
console.log(packet.fadeIn);
});QuestShake
The room shakes (QuestManager.handleShake), for as long as this says; the client counts it down in seconds.
Fields
| Field | Type | |
|---|---|---|
milliseconds | number | How long to shake, in milliseconds. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestShake, (packet) => {
console.log(packet.milliseconds);
});QuestSound
A sound plays (QuestManager.playSound), by the name the adventure's sound packs give it.
Fields
| Field | Type | |
|---|---|---|
name | string | The sound, by name, which the client looks up without regard to case. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestSound, (packet) => {
console.log(packet.name);
});QuestVoiceOver
A voice over plays with its subtitle (QuestManager.playSound, as a voice over), in place of any voice over already playing.
Fields
| Field | Type | |
|---|---|---|
name | string | The voice over, by name. |
subtitle | string | The subtitle shown with it. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestVoiceOver, (packet) => {
console.log(packet.name, packet.subtitle);
});QuestMusic
The music changes (QuestManager.playMusic), fading out what played before; 0 stops it.
Fields
| Field | Type | |
|---|---|---|
name | string | The music, by name, or 0 for none. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestMusic, (packet) => {
console.log(packet.name);
});QuestMediaLibrary
Loads a pack of the adventure's sounds (QuestManager.handleLoadMediaLib, then loadQuestSfx). The voice packs 3752, 3753 and 5446 are swapped for the player's language.
Fields
| Field | Type | |
|---|---|---|
mediaId | number | The sound pack, by media id. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestMediaLibrary, (packet) => {
console.log(packet.mediaId);
});QuestSoundPack
Loads a pack of the adventure's sounds (QuestManager.loadQuestSfx), as qmlib does.
Fields
| Field | Type | |
|---|---|---|
mediaId | number | The sound pack, by media id. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestSoundPack, (packet) => {
console.log(packet.mediaId);
});QuestPostUri
The adventure records a page view for Animal Jam's analytics (QuestManager.handlePostUri, then SBTracker.trackPageview). Nothing shows on screen.
Fields
| Field | Type | |
|---|---|---|
uri | string | The page recorded. |
room | number | The room the message was sent in, as the SmartFox room id; -1 when it names none. |
Example
// Each time the server sends it to the game, after it has gone through.
const stop = phantom.packets.server.watch(packets.QuestPostUri, (packet) => {
console.log(packet.uri);
});