diff --git a/packages/api/src/nitro/room/object/RoomObjectVariable.ts b/packages/api/src/nitro/room/object/RoomObjectVariable.ts index b1adc6a5..229de7a7 100644 --- a/packages/api/src/nitro/room/object/RoomObjectVariable.ts +++ b/packages/api/src/nitro/room/object/RoomObjectVariable.ts @@ -23,6 +23,7 @@ export class RoomObjectVariable public static FURNITURE_PURCHASER_NAME: string = 'furniture_purchaser_name'; public static FURNITURE_PURCHASER_FIGURE: string = 'furniture_purchaser_figure'; public static STD: string = 'std'; + public static SWIM: string = 'swm'; public static FIGURE_SIGN: string = 'figure_sign'; public static FIGURE_FLAT_CONTROL: string = 'figure_flat_control'; public static FIGURE_IS_TYPING: string = 'figure_is_typing'; diff --git a/packages/avatar/src/data/HabboAvatarAnimations.ts b/packages/avatar/src/data/HabboAvatarAnimations.ts index f1fc2cc3..2058b645 100644 --- a/packages/avatar/src/data/HabboAvatarAnimations.ts +++ b/packages/avatar/src/data/HabboAvatarAnimations.ts @@ -822,6 +822,224 @@ export const HabboAvatarAnimations = { } ] } - } + }, + { + 'id': 'Swim', + 'parts': [ + { + 'setType': 'bds', + 'frames': [ + { + 'number': 0, + 'assetPartDefinition': 'swm' + }, + { + 'number': 1, + 'assetPartDefinition': 'swm' + }, + { + 'number': 2, + 'assetPartDefinition': 'swm' + }, + { + 'number': 3, + 'assetPartDefinition': 'swm' + } + ] + }, + { + 'setType': 'ss', + 'frames': [ + { + 'number': 0, + 'assetPartDefinition': 'swm' + }, + { + 'number': 1, + 'assetPartDefinition': 'swm' + }, + { + 'number': 2, + 'assetPartDefinition': 'swm' + }, + { + 'number': 3, + 'assetPartDefinition': 'swm' + } + ] + }, + { + 'setType': 'lhs', + 'frames': [ + { + 'number': 0, + 'assetPartDefinition': 'swm' + }, + { + 'number': 1, + 'assetPartDefinition': 'swm' + }, + { + 'number': 2, + 'assetPartDefinition': 'swm' + }, + { + 'number': 3, + 'assetPartDefinition': 'swm' + } + ] + }, + { + 'setType': 'rhs', + 'frames': [ + { + 'number': 0, + 'assetPartDefinition': 'swm' + }, + { + 'number': 1, + 'assetPartDefinition': 'swm' + }, + { + 'number': 2, + 'assetPartDefinition': 'swm' + }, + { + 'number': 3, + 'assetPartDefinition': 'swm' + } + ] + }, + ] + }, + { + 'id': 'Float', + 'parts': [ + { + 'setType': 'bds', + 'frames': [ + { + 'number': 3, + 'assetPartDefinition': 'sws' + }, + { + 'number': 3, + 'assetPartDefinition': 'sws' + }, + { + 'number': 2, + 'assetPartDefinition': 'sws' + }, + { + 'number': 1, + 'assetPartDefinition': 'sws' + }, + { + 'number': 0, + 'assetPartDefinition': 'sws' + } + ] + }, + { + 'setType': 'ss', + 'frames': [ + { + 'number': 0, + 'assetPartDefinition': 'sws' + } + ] + }, + { + 'setType': 'lhs', + 'frames': [ + { + 'number': 0, + 'assetPartDefinition': 'sws' + }, + { + 'number': 0, + 'assetPartDefinition': 'sws' + }, + { + 'number': 1, + 'assetPartDefinition': 'sws' + }, + { + 'number': 1, + 'assetPartDefinition': 'sws' + }, + { + 'number': 2, + 'assetPartDefinition': 'sws' + }, + { + 'number': 3, + 'assetPartDefinition': 'sws' + }, + { + 'number': 3, + 'assetPartDefinition': 'sws' + }, + { + 'number': 2, + 'assetPartDefinition': 'sws' + }, + { + 'number': 1, + 'assetPartDefinition': 'sws' + }, + { + 'number': 1, + 'assetPartDefinition': 'sws' + } + ] + }, + { + 'setType': 'rhs', + 'frames': [ + { + 'number': 0, + 'assetPartDefinition': 'sws' + }, + { + 'number': 0, + 'assetPartDefinition': 'sws' + }, + { + 'number': 1, + 'assetPartDefinition': 'sws' + }, + { + 'number': 1, + 'assetPartDefinition': 'sws' + }, + { + 'number': 2, + 'assetPartDefinition': 'sws' + }, + { + 'number': 3, + 'assetPartDefinition': 'sws' + }, + { + 'number': 3, + 'assetPartDefinition': 'sws' + }, + { + 'number': 2, + 'assetPartDefinition': 'sws' + }, + { + 'number': 1, + 'assetPartDefinition': 'sws' + }, + { + 'number': 1, + 'assetPartDefinition': 'sws' + } + ] + }, + ] + }, ] }; diff --git a/packages/avatar/src/data/HabboAvatarGeometry.ts b/packages/avatar/src/data/HabboAvatarGeometry.ts index e6b9db05..1fba6bc7 100644 --- a/packages/avatar/src/data/HabboAvatarGeometry.ts +++ b/packages/avatar/src/data/HabboAvatarGeometry.ts @@ -75,8 +75,8 @@ export const HabboAvatarGeometry = { 'id': 'swim', 'width': 64, 'height': 70, - 'dx': 25, - 'dy': 10 + 'dx': 0, + 'dy': 0 } ] } @@ -1715,6 +1715,46 @@ export const HabboAvatarGeometry = { } ] }, + { + 'id': 'leftarm', + 'x': -1, + 'y': 0, + 'z': 0.0, + 'radius': 0.6, + 'items': [ + { + 'id': 'lhs', + 'x': 0, + 'y': 0, + 'z': 0, + 'radius': 0.01, + 'nx': 0, + 'ny': 0, + 'nz': -1, + 'double': false + } + ] + }, + { + 'id': 'rightarm', + 'x': 1, + 'y': 0, + 'z': 0.0, + 'radius': 0.6, + 'items': [ + { + 'id': 'rhs', + 'x': 0, + 'y': 0, + 'z': 0, + 'radius': 0.01, + 'nx': 0, + 'ny': 0, + 'nz': -1, + 'double': false + } + ] + }, { 'id': 'head', 'x': 0, diff --git a/packages/avatar/src/data/HabboAvatarPartSets.ts b/packages/avatar/src/data/HabboAvatarPartSets.ts index 1bd4750c..e17a4a0d 100644 --- a/packages/avatar/src/data/HabboAvatarPartSets.ts +++ b/packages/avatar/src/data/HabboAvatarPartSets.ts @@ -412,6 +412,72 @@ export const HabboAvatarPartSets = { 'setType': 'ri' } ] + }, + { + 'id': 'swim', + 'activeParts': [ + { + 'setType': 'bds' + }, + { + 'setType': 'ss' + }, + { + 'setType': 'lhs' + }, + { + 'setType': 'rhs' + } + ] + }, + { + 'id': 'snowwarrun', + 'activeParts': [ + { + 'setType': 'ch' + } + ] + }, + { + 'id': 'snowwarpick', + 'activeParts': [ + { + 'setType': 'ch' + }, + { + 'setType': 'hd' + } + ] + }, + { + 'id': 'snowwardiefront', + 'activeParts': [ + { + 'setType': 'ch' + }, + { + 'setType': 'hd' + } + ] + }, + { + 'id': 'snowwardieback', + 'activeParts': [ + { + 'setType': 'ch' + }, + { + 'setType': 'hd' + } + ] + }, + { + 'id': 'snowwarthrow', + 'activeParts': [ + { + 'setType': 'ch' + } + ] } ] } diff --git a/packages/communication/src/messages/parser/room/unit/RoomUnitStatusParser.ts b/packages/communication/src/messages/parser/room/unit/RoomUnitStatusParser.ts index 3ba39e1a..b32ddddf 100644 --- a/packages/communication/src/messages/parser/room/unit/RoomUnitStatusParser.ts +++ b/packages/communication/src/messages/parser/room/unit/RoomUnitStatusParser.ts @@ -103,9 +103,9 @@ export class RoomUnitStatusParser implements IMessageParser break; } } - - statusActions.push(new RoomUnitStatusAction(parts[0], parts[1])); } + + statusActions.push(new RoomUnitStatusAction(parts[0], parts[1])); } this._statuses.push(new RoomUnitStatusMessage(unitId, x, y, z, height, headDirection, direction, targetX, targetY, targetZ, didMove, canStandUp, statusActions)); diff --git a/packages/room/src/RoomMessageHandler.ts b/packages/room/src/RoomMessageHandler.ts index 246d8241..cbf7ee4b 100644 --- a/packages/room/src/RoomMessageHandler.ts +++ b/packages/room/src/RoomMessageHandler.ts @@ -712,6 +712,8 @@ export class RoomMessageHandler let postureUpdate = false; let postureType = RoomObjectVariable.STD; let parameter = ''; + let moveUpdate = false; + let swimUpdate = false; if(status.actions && status.actions.length) { @@ -736,6 +738,13 @@ export class RoomMessageHandler break; case 'wav': case 'mv': + moveUpdate = true; + postureUpdate = true; + postureType = action.action; + parameter = action.value; + break; + case 'swim': + swimUpdate = true; postureUpdate = true; postureType = action.action; parameter = action.value; @@ -750,6 +759,12 @@ export class RoomMessageHandler } } + if(!moveUpdate && swimUpdate) + { + postureUpdate = true; + postureType = 'float'; + } + if(postureUpdate) this._roomEngine.updateRoomObjectUserPosture(this._currentRoomId, status.id, postureType, parameter); else if(isPosture) this._roomEngine.updateRoomObjectUserPosture(this._currentRoomId, status.id, RoomObjectVariable.STD, ''); }