diff --git a/src/nitro/communication/messages/incoming/room/pet/_Str_3763.ts b/src/nitro/communication/messages/incoming/room/pet/BreedingPetInfo.ts similarity index 83% rename from src/nitro/communication/messages/incoming/room/pet/_Str_3763.ts rename to src/nitro/communication/messages/incoming/room/pet/BreedingPetInfo.ts index ca1d0f8d..e01b9d75 100644 --- a/src/nitro/communication/messages/incoming/room/pet/_Str_3763.ts +++ b/src/nitro/communication/messages/incoming/room/pet/BreedingPetInfo.ts @@ -1,8 +1,8 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; -export class _Str_3763 +export class BreedingPetInfo { - private _Str_7992: number; + private _webId: number; private _name: string; private _level: number; private _figure: string; @@ -12,7 +12,7 @@ export class _Str_3763 { if(!wrapper) throw new Error('invalid_wrapper'); - this._Str_7992 = wrapper.readInt(); + this._webId = wrapper.readInt(); this._name = wrapper.readString(); this._level = wrapper.readInt(); this._figure = wrapper.readString(); @@ -21,16 +21,16 @@ export class _Str_3763 public dispose():void { - this._Str_7992 = 0; + this._webId = 0; this._name = ''; this._level = 0; this._figure = ''; this._owner = ''; } - public get _Str_5277(): number + public get webId(): number { - return this._Str_7992; + return this._webId; } public get name(): string @@ -52,4 +52,4 @@ export class _Str_3763 { return this._owner; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/incoming/room/pet/_Str_5753.ts b/src/nitro/communication/messages/incoming/room/pet/RarityCategoryData.ts similarity index 75% rename from src/nitro/communication/messages/incoming/room/pet/_Str_5753.ts rename to src/nitro/communication/messages/incoming/room/pet/RarityCategoryData.ts index a9163d8f..02858ab3 100644 --- a/src/nitro/communication/messages/incoming/room/pet/_Str_5753.ts +++ b/src/nitro/communication/messages/incoming/room/pet/RarityCategoryData.ts @@ -1,15 +1,15 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; -export class _Str_5753 +export class RarityCategoryData { - private _Str_16211: number; + private _chance: number; private _breeds: number[]; constructor(wrapper: IMessageDataWrapper) { if(!wrapper) throw new Error('invalid_wrapper'); - this._Str_16211 = wrapper.readInt(); + this._chance = wrapper.readInt(); this._breeds = []; let totalCount = wrapper.readInt(); @@ -24,17 +24,17 @@ export class _Str_5753 public dispose():void { - this._Str_16211 = -1; + this._chance = -1; this._breeds = []; } - public get _Str_12554(): number + public get chance(): number { - return this._Str_16211; + return this._chance; } public get breeds(): number[] { return this._breeds; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/incoming/room/pet/index.ts b/src/nitro/communication/messages/incoming/room/pet/index.ts index 0ef84361..bdc9ea4a 100644 --- a/src/nitro/communication/messages/incoming/room/pet/index.ts +++ b/src/nitro/communication/messages/incoming/room/pet/index.ts @@ -1,4 +1,4 @@ +export * from './BreedingPetInfo'; export * from './PetFigureUpdateEvent'; export * from './PetInfoEvent'; -export * from './_Str_3763'; -export * from './_Str_5753'; +export * from './RarityCategoryData'; diff --git a/src/nitro/communication/messages/parser/inventory/pets/ConfirmBreedingRequestParser.ts b/src/nitro/communication/messages/parser/inventory/pets/ConfirmBreedingRequestParser.ts new file mode 100644 index 00000000..4840e664 --- /dev/null +++ b/src/nitro/communication/messages/parser/inventory/pets/ConfirmBreedingRequestParser.ts @@ -0,0 +1,83 @@ +import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; +import { BreedingPetInfo } from '../../../incoming/room/pet/BreedingPetInfo'; +import { RarityCategoryData } from '../../../incoming/room/pet/RarityCategoryData'; + +export class ConfirmBreedingRequestParser implements IMessageParser +{ + private _nestId: number; + private _pet1: BreedingPetInfo; + private _pet2: BreedingPetInfo; + private _rarityCategories: RarityCategoryData[]; + private _resultPetType: number; + + public flush(): boolean + { + this._nestId = 0; + + if(this._pet1) + { + this._pet1.dispose(); + this._pet1 = null; + } + + if(this._pet2) + { + this._pet2.dispose(); + this._pet2 = null; + } + + for(const k of this._rarityCategories) k && k.dispose(); + + this._rarityCategories = []; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._nestId = wrapper.readInt(); + this._pet1 = new BreedingPetInfo(wrapper); + this._pet2 = new BreedingPetInfo(wrapper); + + let totalCount = wrapper.readInt(); + + while(totalCount > 0) + { + this._rarityCategories.push(new RarityCategoryData(wrapper)); + + totalCount--; + } + + this._resultPetType = wrapper.readInt(); + + return true; + } + + public get nestId(): number + { + return this._nestId; + } + + public get pet1():BreedingPetInfo + { + return this._pet1; + } + + public get pet2():BreedingPetInfo + { + return this._pet2; + } + + public get rarityCategories(): RarityCategoryData[] + { + return this._rarityCategories; + } + + public get resultPetType(): number + { + return this._resultPetType; + } +} diff --git a/src/nitro/communication/messages/parser/inventory/pets/_Str_6256.ts b/src/nitro/communication/messages/parser/inventory/pets/ConfirmBreedingResultParser.ts similarity index 66% rename from src/nitro/communication/messages/parser/inventory/pets/_Str_6256.ts rename to src/nitro/communication/messages/parser/inventory/pets/ConfirmBreedingResultParser.ts index effbdcc5..dc397621 100644 --- a/src/nitro/communication/messages/parser/inventory/pets/_Str_6256.ts +++ b/src/nitro/communication/messages/parser/inventory/pets/ConfirmBreedingResultParser.ts @@ -1,14 +1,14 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; -export class _Str_6256 implements IMessageParser +export class ConfirmBreedingResultParser implements IMessageParser { - private _Str_6143: number; + private _breedingNestStuffId: number; private _result: number; public flush(): boolean { - this._Str_6143 = 0; + this._breedingNestStuffId = 0; this._result = 0; return true; @@ -18,19 +18,19 @@ export class _Str_6256 implements IMessageParser { if(!wrapper) return false; - this._Str_6143 = wrapper.readInt(); + this._breedingNestStuffId = wrapper.readInt(); this._result = wrapper.readInt(); return true; } - public get _Str_12769(): number + public get breedingNestStuffId(): number { - return this._Str_6143; + return this._breedingNestStuffId; } public get result(): number { return this._result; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/inventory/pets/_Str_7486.ts b/src/nitro/communication/messages/parser/inventory/pets/GoToBreedingNestFailureParser.ts similarity index 80% rename from src/nitro/communication/messages/parser/inventory/pets/_Str_7486.ts rename to src/nitro/communication/messages/parser/inventory/pets/GoToBreedingNestFailureParser.ts index 4a8091b9..5d49339b 100644 --- a/src/nitro/communication/messages/parser/inventory/pets/_Str_7486.ts +++ b/src/nitro/communication/messages/parser/inventory/pets/GoToBreedingNestFailureParser.ts @@ -1,9 +1,9 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; -export class _Str_7486 implements IMessageParser +export class GoToBreedingNestFailureParser implements IMessageParser { - public static _Str_17785: number = 6; + public static PET_TOO_TIRED_TO_BREED: number = 6; private _reason: number; @@ -23,4 +23,4 @@ export class _Str_7486 implements IMessageParser { return this._reason; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/inventory/pets/_Str_6719.ts b/src/nitro/communication/messages/parser/inventory/pets/_Str_6719.ts deleted file mode 100644 index 7dc784a3..00000000 --- a/src/nitro/communication/messages/parser/inventory/pets/_Str_6719.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; -import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; -import { _Str_3763 } from '../../../incoming/room/pet/_Str_3763'; -import { _Str_5753 } from '../../../incoming/room/pet/_Str_5753'; - -export class _Str_6719 implements IMessageParser -{ - private _Str_5743: number; - private _pet1: _Str_3763; - private _pet2: _Str_3763; - private _Str_4447: _Str_5753[]; - private _Str_21973: number; - - public flush(): boolean - { - this._Str_5743 = 0; - - if(this._pet1) - { - this._pet1.dispose(); - this._pet1 = null; - } - - if(this._pet2) - { - this._pet2.dispose(); - this._pet2 = null; - } - - for(const k of this._Str_4447) k && k.dispose(); - - this._Str_4447 = []; - - return true; - } - - public parse(wrapper: IMessageDataWrapper): boolean - { - if(!wrapper) return false; - - this._Str_5743 = wrapper.readInt(); - this._pet1 = new _Str_3763(wrapper); - this._pet2 = new _Str_3763(wrapper); - - let totalCount = wrapper.readInt(); - - while(totalCount > 0) - { - this._Str_4447.push(new _Str_5753(wrapper)); - - totalCount--; - } - - this._Str_21973 = wrapper.readInt(); - - return true; - } - - public get _Str_12369(): number - { - return this._Str_5743; - } - - public get pet1():_Str_3763 - { - return this._pet1; - } - - public get pet2():_Str_3763 - { - return this._pet2; - } - - public get _Str_10346(): _Str_5753[] - { - return this._Str_4447; - } - - public get _Str_24905(): number - { - return this._Str_21973; - } -} \ 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 ad0f5a19..8a829173 100644 --- a/src/nitro/communication/messages/parser/inventory/pets/index.ts +++ b/src/nitro/communication/messages/parser/inventory/pets/index.ts @@ -1,3 +1,6 @@ +export * from './ConfirmBreedingRequestParser'; +export * from './ConfirmBreedingResultParser'; +export * from './GoToBreedingNestFailureParser'; export * from './NestBreedingSuccessParser'; export * from './PetAddedToInventoryParser'; export * from './PetBoughtNotificationMessageParser'; @@ -6,6 +9,3 @@ export * from './PetData'; export * from './PetFigureDataParser'; export * from './PetInventoryParser'; export * from './PetRemovedFromInventoryParser'; -export * from './_Str_6256'; -export * from './_Str_6719'; -export * from './_Str_7486'; diff --git a/src/nitro/session/events/RoomSessionConfirmPetBreedingEvent.ts b/src/nitro/session/events/RoomSessionConfirmPetBreedingEvent.ts index 26eb1ce6..5b6afe1b 100644 --- a/src/nitro/session/events/RoomSessionConfirmPetBreedingEvent.ts +++ b/src/nitro/session/events/RoomSessionConfirmPetBreedingEvent.ts @@ -5,31 +5,31 @@ export class RoomSessionConfirmPetBreedingEvent extends RoomSessionEvent { public static RSPFUE_CONFIRM_PET_BREEDING: string = 'RSPFUE_CONFIRM_PET_BREEDING'; - private _Str_5743: number; + private _nestId: number; private _pet1: any; private _pet2: any; - private _Str_4447: any[]; + private _rarityCategories: any[]; private _Str_6321: number; constructor(k: IRoomSession, _arg_2: number, _arg_3: any, _arg_4: any, _arg_5: any[], _arg_6: number) { super(RoomSessionConfirmPetBreedingEvent.RSPFUE_CONFIRM_PET_BREEDING, k); - this._Str_5743 = _arg_2; + this._nestId = _arg_2; this._pet1 = _arg_3; this._pet2 = _arg_4; - this._Str_4447 = _arg_5; + this._rarityCategories = _arg_5; this._Str_6321 = _arg_6; } - public get _Str_10346(): any[] + public get rarityCategories(): any[] { - return this._Str_4447; + return this._rarityCategories; } - public get _Str_12369(): number + public get nestId(): number { - return this._Str_5743; + return this._nestId; } public get pet1(): any @@ -46,4 +46,4 @@ export class RoomSessionConfirmPetBreedingEvent extends RoomSessionEvent { return this._Str_6321; } -} \ No newline at end of file +} diff --git a/src/nitro/session/events/RoomSessionConfirmPetBreedingResultEvent.ts b/src/nitro/session/events/RoomSessionConfirmPetBreedingResultEvent.ts index b702457b..c629ca08 100644 --- a/src/nitro/session/events/RoomSessionConfirmPetBreedingResultEvent.ts +++ b/src/nitro/session/events/RoomSessionConfirmPetBreedingResultEvent.ts @@ -16,7 +16,7 @@ export class RoomSessionConfirmPetBreedingResultEvent extends RoomSessionEvent this._result = _arg_3; } - public get _Str_12769(): number + public get breedingNestStuffId(): number { return this._breedingNestStuffId; } @@ -25,4 +25,4 @@ export class RoomSessionConfirmPetBreedingResultEvent extends RoomSessionEvent { return this._result; } -} \ No newline at end of file +}