diff --git a/src/nitro/communication/messages/parser/inventory/pets/NestBreedingSuccessParser.ts b/src/nitro/communication/messages/parser/inventory/pets/NestBreedingSuccessParser.ts new file mode 100644 index 00000000..795aea44 --- /dev/null +++ b/src/nitro/communication/messages/parser/inventory/pets/NestBreedingSuccessParser.ts @@ -0,0 +1,34 @@ +import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; + +export class NestBreedingSuccessParser implements IMessageParser +{ + private _rarityCategory: number; + private _petId: number; + + public flush(): boolean + { + this._petId = -1; + this._rarityCategory = -1; + + return true; + } + + public parse(k: IMessageDataWrapper): boolean + { + this._petId = k.readInt(); + this._rarityCategory = k.readInt(); + + return true; + } + + public get rarityCategory(): number + { + return this._rarityCategory; + } + + public get petId(): number + { + return this._petId; + } +} diff --git a/src/nitro/communication/messages/parser/inventory/pets/_Str_7523.ts b/src/nitro/communication/messages/parser/inventory/pets/PetBreedingMessageParser.ts similarity index 52% rename from src/nitro/communication/messages/parser/inventory/pets/_Str_7523.ts rename to src/nitro/communication/messages/parser/inventory/pets/PetBreedingMessageParser.ts index 8d3c0fa6..33aa8db0 100644 --- a/src/nitro/communication/messages/parser/inventory/pets/_Str_7523.ts +++ b/src/nitro/communication/messages/parser/inventory/pets/PetBreedingMessageParser.ts @@ -1,21 +1,21 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; -export class _Str_7523 implements IMessageParser +export class PetBreedingMessageParser implements IMessageParser { - public static _Str_8664: number = 1; - public static _Str_9186: number = 2; - public static _Str_22195: number = 3; + public static STATE_CANCEL: number = 1; + public static STATE_ACCEPT: number = 2; + public static STATE_REQUEST: number = 3; private _state: number; - private _Str_6614: number; - private _Str_6649: number; + private _ownPetId: number; + private _otherPetId: number; public flush(): boolean { this._state = 0; - this._Str_6614 = 0; - this._Str_6649 = 0; + this._ownPetId = 0; + this._otherPetId = 0; return true; } @@ -25,8 +25,8 @@ export class _Str_7523 implements IMessageParser if(!wrapper) return false; this._state = wrapper.readInt(); - this._Str_6614 = wrapper.readInt(); - this._Str_6649 = wrapper.readInt(); + this._ownPetId = wrapper.readInt(); + this._otherPetId = wrapper.readInt(); return true; } @@ -36,13 +36,13 @@ export class _Str_7523 implements IMessageParser return this._state; } - public get _Str_7440(): number + public get ownPetId(): number { - return this._Str_6614; + return this._ownPetId; } - public get _Str_7663(): number + public get otherPetId(): number { - return this._Str_6649; + return this._otherPetId; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/inventory/pets/_Str_9220.ts b/src/nitro/communication/messages/parser/inventory/pets/_Str_9220.ts deleted file mode 100644 index 611c28c9..00000000 --- a/src/nitro/communication/messages/parser/inventory/pets/_Str_9220.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; -import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; - -export class _Str_9220 implements IMessageParser -{ - private _Str_5792: number; - private _Str_2388: number; - - public flush(): boolean - { - this._Str_2388 = -1; - this._Str_5792 = -1; - - return true; - } - - public parse(k: IMessageDataWrapper): boolean - { - this._Str_2388 = k.readInt(); - this._Str_5792 = k.readInt(); - - return true; - } - - public get _Str_16731(): number - { - return this._Str_5792; - } - - public get _Str_2508(): number - { - return this._Str_2388; - } -} \ No newline at end of file diff --git a/src/nitro/communication/messages/parser/inventory/pets/index.ts b/src/nitro/communication/messages/parser/inventory/pets/index.ts index 662abe0c..ad0f5a19 100644 --- a/src/nitro/communication/messages/parser/inventory/pets/index.ts +++ b/src/nitro/communication/messages/parser/inventory/pets/index.ts @@ -1,5 +1,7 @@ +export * from './NestBreedingSuccessParser'; export * from './PetAddedToInventoryParser'; export * from './PetBoughtNotificationMessageParser'; +export * from './PetBreedingMessageParser'; export * from './PetData'; export * from './PetFigureDataParser'; export * from './PetInventoryParser'; @@ -7,5 +9,3 @@ export * from './PetRemovedFromInventoryParser'; export * from './_Str_6256'; export * from './_Str_6719'; export * from './_Str_7486'; -export * from './_Str_7523'; -export * from './_Str_9220'; diff --git a/src/nitro/session/events/RoomSessionNestBreedingSuccessEvent.ts b/src/nitro/session/events/RoomSessionNestBreedingSuccessEvent.ts index 1e4294d1..b7798efa 100644 --- a/src/nitro/session/events/RoomSessionNestBreedingSuccessEvent.ts +++ b/src/nitro/session/events/RoomSessionNestBreedingSuccessEvent.ts @@ -3,26 +3,26 @@ import { RoomSessionEvent } from './RoomSessionEvent'; export class RoomSessionNestBreedingSuccessEvent extends RoomSessionEvent { - public static RSPFUE_NEST_BREEDING_SUCCESS: string = 'RSPFUE_NEST_BREEDING_SUCCESS'; + public static NEST_BREEDING_SUCCESS: string = 'RSPFUE_NEST_BREEDING_SUCCESS'; private _rarityCategory: number; private _petId: number; constructor(k: IRoomSession, _arg_2: number, _arg_3: number) { - super(RoomSessionNestBreedingSuccessEvent.RSPFUE_NEST_BREEDING_SUCCESS, k); + super(RoomSessionNestBreedingSuccessEvent.NEST_BREEDING_SUCCESS, k); this._petId = _arg_2; this._rarityCategory = _arg_3; } - public get _Str_16731(): number + public get rarityCategory(): number { return this._rarityCategory; } - public get _Str_2508(): number + public get petId(): number { return this._petId; } -} \ No newline at end of file +} diff --git a/src/nitro/session/events/RoomSessionPetBreedingEvent.ts b/src/nitro/session/events/RoomSessionPetBreedingEvent.ts index 63bdb2e2..62f12a31 100644 --- a/src/nitro/session/events/RoomSessionPetBreedingEvent.ts +++ b/src/nitro/session/events/RoomSessionPetBreedingEvent.ts @@ -3,7 +3,7 @@ import { RoomSessionEvent } from './RoomSessionEvent'; export class RoomSessionPetBreedingEvent extends RoomSessionEvent { - public static RSPFUE_PET_BREEDING: string = 'RSPFUE_PET_BREEDING'; + public static PET_BREEDING: string = 'RSPFUE_PET_BREEDING'; private _state: number; private _ownPetId: number; @@ -11,7 +11,7 @@ export class RoomSessionPetBreedingEvent extends RoomSessionEvent constructor(k: IRoomSession, _arg_2: number, _arg_3: number, _arg_4: number) { - super(RoomSessionPetBreedingEvent.RSPFUE_PET_BREEDING, k); + super(RoomSessionPetBreedingEvent.PET_BREEDING, k); this._state = _arg_2; this._ownPetId = _arg_3; @@ -23,13 +23,13 @@ export class RoomSessionPetBreedingEvent extends RoomSessionEvent return this._state; } - public get _Str_7440(): number + public get ownPetId(): number { return this._ownPetId; } - public get _Str_7663(): number + public get otherPetId(): number { return this._otherPetId; } -} \ No newline at end of file +} diff --git a/src/nitro/session/events/RoomSessionPetLevelUpdateEvent.ts b/src/nitro/session/events/RoomSessionPetLevelUpdateEvent.ts index 46c2b62a..e603c6da 100644 --- a/src/nitro/session/events/RoomSessionPetLevelUpdateEvent.ts +++ b/src/nitro/session/events/RoomSessionPetLevelUpdateEvent.ts @@ -3,20 +3,20 @@ import { RoomSessionEvent } from './RoomSessionEvent'; export class RoomSessionPetLevelUpdateEvent extends RoomSessionEvent { - public static RSPLUE_PET_LEVEL_UPDATE: string = 'RSPLUE_PET_LEVEL_UPDATE'; + public static PET_LEVEL_UPDATE: string = 'RSPLUE_PET_LEVEL_UPDATE'; private _petId: number; private _level: number; constructor(k: IRoomSession, _arg_2: number, _arg_3: number) { - super(RoomSessionPetLevelUpdateEvent.RSPLUE_PET_LEVEL_UPDATE, k); + super(RoomSessionPetLevelUpdateEvent.PET_LEVEL_UPDATE, k); this._petId = _arg_2; this._level = _arg_3; } - public get _Str_2508(): number + public get petId(): number { return this._petId; } @@ -25,4 +25,4 @@ export class RoomSessionPetLevelUpdateEvent extends RoomSessionEvent { return this._level; } -} \ No newline at end of file +} diff --git a/src/nitro/session/events/RoomSessionPetStatusUpdateEvent.ts b/src/nitro/session/events/RoomSessionPetStatusUpdateEvent.ts index 444f79aa..acbd2d34 100644 --- a/src/nitro/session/events/RoomSessionPetStatusUpdateEvent.ts +++ b/src/nitro/session/events/RoomSessionPetStatusUpdateEvent.ts @@ -3,7 +3,7 @@ import { RoomSessionEvent } from './RoomSessionEvent'; export class RoomSessionPetStatusUpdateEvent extends RoomSessionEvent { - public static RSPFUE_PET_STATUS_UPDATE: string = 'RSPFUE_PET_STATUS_UPDATE'; + public static PET_STATUS_UPDATE: string = 'RSPFUE_PET_STATUS_UPDATE'; private _petId: number; private _canBreed: boolean; @@ -13,7 +13,7 @@ export class RoomSessionPetStatusUpdateEvent extends RoomSessionEvent constructor(k: IRoomSession, _arg_2: number, _arg_3: boolean, _arg_4: boolean, _arg_5: boolean, _arg_6: boolean) { - super(RoomSessionPetStatusUpdateEvent.RSPFUE_PET_STATUS_UPDATE, k); + super(RoomSessionPetStatusUpdateEvent.PET_STATUS_UPDATE, k); this._petId = _arg_2; this._canBreed = _arg_3; @@ -22,28 +22,28 @@ export class RoomSessionPetStatusUpdateEvent extends RoomSessionEvent this._hasBreedingPermission = _arg_6; } - public get _Str_2508(): number + public get petId(): number { return this._petId; } - public get _Str_2934(): boolean + public get canBreed(): boolean { return this._canBreed; } - public get _Str_3068(): boolean + public get canHarvest(): boolean { return this._canHarvest; } - public get _Str_2898(): boolean + public get canRevive(): boolean { return this._canRevive; } - public get _Str_2921(): boolean + public get hasBreedingPermission(): boolean { return this._hasBreedingPermission; } -} \ No newline at end of file +}