diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index a93ec143..e15facaf 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,5 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpFromSelfieMessageComposer, CallForHelpMessageComposer, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, ChatReviewGuideDecidesOnOfferMessageComposer, ChatReviewGuideDetachedMessageComposer, ChatReviewGuideVoteMessageComposer, ChatReviewSessionCreateMessageComposer, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DeletePendingCallsForHelpMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCfhStatusMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetFaqCategoryMessageComposer, GetFaqTextMessageComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetGuideReportingStatusMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetPendingCallsForHelpMessageComposer, GetQuizQuestionsComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, GuideSessionCreateMessageComposer, GuideSessionFeedbackMessageComposer, GuideSessionGetRequesterRoomMessageComposer, GuideSessionGuideDecidesMessageComposer, GuideSessionInviteRequesterMessageComposer, GuideSessionIsTypingMessageComposer, GuideSessionMessageMessageComposer, GuideSessionOnDutyUpdateMessageComposer, GuideSessionReportMessageComposer, GuideSessionRequesterCancelsMessageComposer, GuideSessionResolvedMessageComposer, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PostMessageMessageComposer, PostQuizAnswersComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SearchFaqsMessageComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; +import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpFromSelfieMessageComposer, CallForHelpMessageComposer, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, ChatReviewGuideDecidesOnOfferMessageComposer, ChatReviewGuideDetachedMessageComposer, ChatReviewGuideVoteMessageComposer, ChatReviewSessionCreateMessageComposer, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DeletePendingCallsForHelpMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCfhStatusMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetFaqCategoryMessageComposer, GetFaqTextMessageComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetGuideReportingStatusMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetPendingCallsForHelpMessageComposer, GetQuizQuestionsComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, GuideSessionCreateMessageComposer, GuideSessionFeedbackMessageComposer, GuideSessionGetRequesterRoomMessageComposer, GuideSessionGuideDecidesMessageComposer, GuideSessionInviteRequesterMessageComposer, GuideSessionIsTypingMessageComposer, GuideSessionMessageMessageComposer, GuideSessionOnDutyUpdateMessageComposer, GuideSessionReportMessageComposer, GuideSessionRequesterCancelsMessageComposer, GuideSessionResolvedMessageComposer, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PostMessageMessageComposer, PostQuizAnswersComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SearchFaqsMessageComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackMessageEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { BotAddedToInventoryEvent, BotInventoryMessageEvent, BotReceivedMessageEvent, BotRemovedFromInventoryEvent } from './messages/incoming/bots'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; @@ -601,8 +601,6 @@ export class NitroMessages implements IMessageConfiguration // HELP this._events.set(IncomingHeader.CFH_DISABLED_NOTIFY, CallForHelpDisabledNotifyMessageEvent); this._events.set(IncomingHeader.CFH_RESULT_MESSAGE, CallForHelpResultMessageEvent); - this._events.set(IncomingHeader.HELPER_TALENT_TRACK, TalentTrackEvent); - // INVENTORY this._events.set(IncomingHeader.ACHIEVEMENT_PROGRESSED, AchievementEvent); @@ -813,6 +811,9 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.TRAX_SONG_INFO, TraxSongInfoMessageEvent); this._events.set(IncomingHeader.USER_SONG_DISKS_INVENTORY, UserSongDisksInventoryMessageEvent); + // TALENT + this._events.set(IncomingHeader.HELPER_TALENT_TRACK, TalentTrackMessageEvent); + // USER this._events.set(IncomingHeader.IN_CLIENT_LINK, InClientLinkEvent); this._events.set(IncomingHeader.USER_IGNORED, IgnoredUsersEvent); diff --git a/src/nitro/communication/messages/incoming/help/index.ts b/src/nitro/communication/messages/incoming/help/index.ts index f3c3017a..ed4c56df 100644 --- a/src/nitro/communication/messages/incoming/help/index.ts +++ b/src/nitro/communication/messages/incoming/help/index.ts @@ -1,3 +1,2 @@ export * from './CallForHelpDisabledNotifyMessageEvent'; export * from './CallForHelpResultMessageEvent'; -export * from './TalentTrackEvent'; diff --git a/src/nitro/communication/messages/incoming/index.ts b/src/nitro/communication/messages/incoming/index.ts index 68200572..b9e74ff9 100644 --- a/src/nitro/communication/messages/incoming/index.ts +++ b/src/nitro/communication/messages/incoming/index.ts @@ -47,6 +47,7 @@ export * from './room/unit/chat'; export * from './roomevents'; export * from './security'; export * from './sound'; +export * from './talent'; export * from './user'; export * from './user/access'; export * from './user/data'; diff --git a/src/nitro/communication/messages/incoming/help/TalentTrackEvent.ts b/src/nitro/communication/messages/incoming/talent/TalentTrackMessageEvent.ts similarity index 70% rename from src/nitro/communication/messages/incoming/help/TalentTrackEvent.ts rename to src/nitro/communication/messages/incoming/talent/TalentTrackMessageEvent.ts index 488e9f42..7fd14982 100644 --- a/src/nitro/communication/messages/incoming/help/TalentTrackEvent.ts +++ b/src/nitro/communication/messages/incoming/talent/TalentTrackMessageEvent.ts @@ -1,8 +1,8 @@ import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; -import { TalentTrackParser } from '../../parser/help/TalentTrackParser'; +import { TalentTrackParser } from '../../parser/talent/TalentTrackParser'; -export class TalentTrackEvent extends MessageEvent implements IMessageEvent +export class TalentTrackMessageEvent extends MessageEvent implements IMessageEvent { constructor(callBack: Function) { diff --git a/src/nitro/communication/messages/incoming/talent/index.ts b/src/nitro/communication/messages/incoming/talent/index.ts new file mode 100644 index 00000000..ebe3f002 --- /dev/null +++ b/src/nitro/communication/messages/incoming/talent/index.ts @@ -0,0 +1 @@ +export * from './TalentTrackMessageEvent'; diff --git a/src/nitro/communication/messages/parser/help/common/TalentTrackLevel.ts b/src/nitro/communication/messages/parser/help/common/TalentTrackLevel.ts deleted file mode 100644 index ffc487bd..00000000 --- a/src/nitro/communication/messages/parser/help/common/TalentTrackLevel.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { TalentTrackLevelAchievement } from './TalentTrackLevelAchievement'; -import { TalentTrackLevelItem } from './TalentTrackLevelItem'; - -export class TalentTrackLevel -{ - private _level: number; - private _state: number; - private _achievements: TalentTrackLevelAchievement[] - private _perks: string[]; - private _items: TalentTrackLevelItem[]; - - constructor(level: number, state: number, achievements: TalentTrackLevelAchievement[], perks: string[], items: TalentTrackLevelItem[]) - { - this._level = level; - this._state = state; - this._achievements = achievements; - this._perks = perks; - this._items = items; - } - - public get level(): number - { - return this._level; - } - - public get state(): number - { - return this._state; - } - - public get achievements(): TalentTrackLevelAchievement[] - { - return this._achievements; - } - - public get perks(): string[] - { - return this._perks; - } - - public get items(): TalentTrackLevelItem[] - { - return this._items; - } -} diff --git a/src/nitro/communication/messages/parser/help/common/TalentTrackLevelAchievement.ts b/src/nitro/communication/messages/parser/help/common/TalentTrackLevelAchievement.ts deleted file mode 100644 index cd77c5d7..00000000 --- a/src/nitro/communication/messages/parser/help/common/TalentTrackLevelAchievement.ts +++ /dev/null @@ -1,49 +0,0 @@ -export class TalentTrackLevelAchievement -{ - private _id: number; - private _index: number; - private _achievementCode: string; - private _state: number; - private _progress: number; - private _achievementProgress: number; - - constructor(id: number, index: number, achievementCode: string, state: number, progress: number, achievementProgress: number) - { - this._id = id; - this._index = index; - this._achievementCode = achievementCode; - this._state = state; - this._progress = progress; - this._achievementProgress = achievementProgress; - } - - public get id(): number - { - return this._id; - } - - public get index(): number - { - return this._index; - } - - public get achievementCode(): string - { - return this._achievementCode; - } - - public get state(): number - { - return this._state; - } - - public get progress(): number - { - return this._progress; - } - - public get achievementProgress(): number - { - return this._achievementProgress; - } -} diff --git a/src/nitro/communication/messages/parser/help/common/TalentTrackLevelItem.ts b/src/nitro/communication/messages/parser/help/common/TalentTrackLevelItem.ts deleted file mode 100644 index bf59dc07..00000000 --- a/src/nitro/communication/messages/parser/help/common/TalentTrackLevelItem.ts +++ /dev/null @@ -1,21 +0,0 @@ -export class TalentTrackLevelItem -{ - private _name: string; - private _unknownInt: number; - - constructor(name: string, unknownInt: number) - { - this._name = name; - this._unknownInt = unknownInt; - } - - public get name(): string - { - return this._name; - } - - public get unknownInt(): number - { - return this._unknownInt; - } -} diff --git a/src/nitro/communication/messages/parser/help/common/index.ts b/src/nitro/communication/messages/parser/help/common/index.ts deleted file mode 100644 index 22aefb71..00000000 --- a/src/nitro/communication/messages/parser/help/common/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './TalentTrackLevel'; -export * from './TalentTrackLevelAchievement'; -export * from './TalentTrackLevelItem'; diff --git a/src/nitro/communication/messages/parser/help/index.ts b/src/nitro/communication/messages/parser/help/index.ts index c6f0c7d9..5cd9ff49 100644 --- a/src/nitro/communication/messages/parser/help/index.ts +++ b/src/nitro/communication/messages/parser/help/index.ts @@ -1,4 +1,2 @@ export * from './CallForHelpDisabledNotifyMessageParser'; export * from './CallForHelpResultMessageParser'; -export * from './common'; -export * from './TalentTrackParser'; diff --git a/src/nitro/communication/messages/parser/index.ts b/src/nitro/communication/messages/parser/index.ts index 8cac1987..a2660f7f 100644 --- a/src/nitro/communication/messages/parser/index.ts +++ b/src/nitro/communication/messages/parser/index.ts @@ -24,4 +24,5 @@ export * from './room'; export * from './roomevents'; export * from './security'; export * from './sound'; +export * from './talent'; export * from './user'; diff --git a/src/nitro/communication/messages/parser/talent/TalentTrackLevel.ts b/src/nitro/communication/messages/parser/talent/TalentTrackLevel.ts new file mode 100644 index 00000000..03d8c4db --- /dev/null +++ b/src/nitro/communication/messages/parser/talent/TalentTrackLevel.ts @@ -0,0 +1,45 @@ +import { TalentTrackRewardProduct } from './TalentTrackRewardProduct'; +import { TalentTrackTask } from './TalentTrackTask'; + +export class TalentTrackLevel +{ + private _level: number; + private _state: number; + private _tasks: TalentTrackTask[] + private _rewardPerks: string[]; + private _rewardProducts: TalentTrackRewardProduct[]; + + constructor(level: number, state: number, achievements: TalentTrackTask[], perks: string[], items: TalentTrackRewardProduct[]) + { + this._level = level; + this._state = state; + this._tasks = achievements; + this._rewardPerks = perks; + this._rewardProducts = items; + } + + public get level(): number + { + return this._level; + } + + public get state(): number + { + return this._state; + } + + public get tasks(): TalentTrackTask[] + { + return this._tasks; + } + + public get perks(): string[] + { + return this._rewardPerks; + } + + public get items(): TalentTrackRewardProduct[] + { + return this._rewardProducts; + } +} diff --git a/src/nitro/communication/messages/parser/help/TalentTrackParser.ts b/src/nitro/communication/messages/parser/talent/TalentTrackParser.ts similarity index 77% rename from src/nitro/communication/messages/parser/help/TalentTrackParser.ts rename to src/nitro/communication/messages/parser/talent/TalentTrackParser.ts index 71e97ccd..4cf2984d 100644 --- a/src/nitro/communication/messages/parser/help/TalentTrackParser.ts +++ b/src/nitro/communication/messages/parser/talent/TalentTrackParser.ts @@ -1,7 +1,7 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; -import { TalentTrackLevel } from './common/TalentTrackLevel'; -import { TalentTrackLevelAchievement } from './common/TalentTrackLevelAchievement'; -import { TalentTrackLevelItem } from './common/TalentTrackLevelItem'; +import { TalentTrackLevel } from './TalentTrackLevel'; +import { TalentTrackRewardProduct } from './TalentTrackRewardProduct'; +import { TalentTrackTask } from './TalentTrackTask'; export class TalentTrackParser implements IMessageParser { @@ -30,7 +30,7 @@ export class TalentTrackParser implements IMessageParser const levelId = wrapper.readInt(); const levelState = wrapper.readInt(); - const levelAchievements: TalentTrackLevelAchievement[] = []; + const levelAchievements: TalentTrackTask[] = []; const achievementsCount = wrapper.readInt(); for(let j = 0; j < achievementsCount; j++) @@ -42,7 +42,7 @@ export class TalentTrackParser implements IMessageParser const progress = wrapper.readInt(); const achievementProgress = wrapper.readInt(); - levelAchievements.push(new TalentTrackLevelAchievement(id, index, code, state, progress, achievementProgress)); + levelAchievements.push(new TalentTrackTask(id, index, code, state, progress, achievementProgress)); } const levelPerks: string[] = []; @@ -50,7 +50,7 @@ export class TalentTrackParser implements IMessageParser for(let j = 0; j < perksCount; j++) levelPerks.push(wrapper.readString()); - const levelItems: TalentTrackLevelItem[] = []; + const levelItems: TalentTrackRewardProduct[] = []; const itemsCount = wrapper.readInt(); for(let j = 0; j < itemsCount; j++) @@ -58,7 +58,7 @@ export class TalentTrackParser implements IMessageParser const name = wrapper.readString(); const unknownInt = wrapper.readInt(); - levelItems.push(new TalentTrackLevelItem(name, unknownInt)); + levelItems.push(new TalentTrackRewardProduct(name, unknownInt)); } this._levels.push(new TalentTrackLevel(levelId, levelState, levelAchievements, levelPerks, levelItems)); diff --git a/src/nitro/communication/messages/parser/talent/TalentTrackRewardProduct.ts b/src/nitro/communication/messages/parser/talent/TalentTrackRewardProduct.ts new file mode 100644 index 00000000..24aaaa99 --- /dev/null +++ b/src/nitro/communication/messages/parser/talent/TalentTrackRewardProduct.ts @@ -0,0 +1,21 @@ +export class TalentTrackRewardProduct +{ + private _productCode: string; + private _vipDays: number; + + constructor(name: string, unknownInt: number) + { + this._productCode = name; + this._vipDays = unknownInt; + } + + public get productCode(): string + { + return this._productCode; + } + + public get vipDays(): number + { + return this._vipDays; + } +} diff --git a/src/nitro/communication/messages/parser/talent/TalentTrackTask.ts b/src/nitro/communication/messages/parser/talent/TalentTrackTask.ts new file mode 100644 index 00000000..a249b11a --- /dev/null +++ b/src/nitro/communication/messages/parser/talent/TalentTrackTask.ts @@ -0,0 +1,49 @@ +export class TalentTrackTask +{ + private _id: number; + private _requiredLevel: number; + private _badgeCode: string; + private _state: number; + private _currentScore: number; + private _totalScore: number; + + constructor(id: number, requiredLevel: number, badgeCode: string, state: number, currentScore: number, totalScore: number) + { + this._id = id; + this._requiredLevel = requiredLevel; + this._badgeCode = badgeCode; + this._state = state; + this._currentScore = currentScore; + this._totalScore = totalScore; + } + + public get id(): number + { + return this._id; + } + + public get requiredLevel(): number + { + return this._requiredLevel; + } + + public get badgeCode(): string + { + return this._badgeCode; + } + + public get state(): number + { + return this._state; + } + + public get currentScore(): number + { + return this._currentScore; + } + + public get totalScore(): number + { + return this._totalScore; + } +} diff --git a/src/nitro/communication/messages/parser/talent/index.ts b/src/nitro/communication/messages/parser/talent/index.ts new file mode 100644 index 00000000..7df63262 --- /dev/null +++ b/src/nitro/communication/messages/parser/talent/index.ts @@ -0,0 +1,4 @@ +export * from './TalentTrackLevel'; +export * from './TalentTrackParser'; +export * from './TalentTrackRewardProduct'; +export * from './TalentTrackTask';