diff --git a/src/nitro/room/object/data/IObjectData.ts b/src/nitro/room/object/data/IObjectData.ts index f158baad..1df0cc76 100644 --- a/src/nitro/room/object/data/IObjectData.ts +++ b/src/nitro/room/object/data/IObjectData.ts @@ -7,10 +7,11 @@ export interface IObjectData isUnique: boolean; uniqueNumber: number; uniqueSeries: number; + rarityLevel: number; flags: number; parseWrapper(wrapper: IMessageDataWrapper): void; initializeFromRoomObjectModel(model: IRoomObjectModel): void; writeRoomObjectModel(model: IRoomObjectModel): void; getLegacyString(): string; compare(data: IObjectData): boolean; -} \ No newline at end of file +} diff --git a/src/nitro/room/object/data/ObjectDataBase.ts b/src/nitro/room/object/data/ObjectDataBase.ts index f04d41f6..a5cc3350 100644 --- a/src/nitro/room/object/data/ObjectDataBase.ts +++ b/src/nitro/room/object/data/ObjectDataBase.ts @@ -72,6 +72,11 @@ export class ObjectDataBase implements IObjectData return this._uniqueSeries; } + public get rarityLevel(): number + { + return -1; + } + public get flags(): number { return this._flags; @@ -81,4 +86,4 @@ export class ObjectDataBase implements IObjectData { this._flags = flags; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/data/type/MapDataType.ts b/src/nitro/room/object/data/type/MapDataType.ts index 824f46f1..578549b3 100644 --- a/src/nitro/room/object/data/type/MapDataType.ts +++ b/src/nitro/room/object/data/type/MapDataType.ts @@ -70,6 +70,17 @@ export class MapDataType extends ObjectDataBase return this._data[key]; } + public get rarityLevel(): number + { + if(!this._data || !this._data.length) return -1; + + const state = this._data[MapDataType.RARITY]; + + if(state === undefined || state === null) return -1; + + return parseInt(state); + } + // TODO: How to get the keys? public get data() {