diff --git a/docs/api/classes/client_LodestoneClient.default.md b/docs/api/classes/client_LodestoneClient.default.md index 63b6c00..19274c6 100644 --- a/docs/api/classes/client_LodestoneClient.default.md +++ b/docs/api/classes/client_LodestoneClient.default.md @@ -29,7 +29,7 @@ Client for interfacing with the Final Fantasy XIV Lodestone. #### Defined in -[LodestoneClient.ts:53](https://github.com/XIVStats/lodestone/blob/81c10ae/src/client/LodestoneClient.ts#L53) +[LodestoneClient.ts:55](https://github.com/XIVStats/lodestone/blob/31dd347/src/client/LodestoneClient.ts#L55) ## Properties @@ -43,4 +43,4 @@ An instance will be generated by default, but as a consumer you can provide your #### Defined in -[LodestoneClient.ts:49](https://github.com/XIVStats/lodestone/blob/81c10ae/src/client/LodestoneClient.ts#L49) +[LodestoneClient.ts:51](https://github.com/XIVStats/lodestone/blob/31dd347/src/client/LodestoneClient.ts#L51) diff --git a/src/client/LodestoneClient.ts b/src/client/LodestoneClient.ts index 0c1700d..8bb80d1 100644 --- a/src/client/LodestoneClient.ts +++ b/src/client/LodestoneClient.ts @@ -33,6 +33,8 @@ import { ICharacterFetchError } from '../interface/ICharacterFetchError' import CharacterFetchError from '../errors/CharacterFetchError' import CharacterFetchTimeoutError from '../errors/CharacterFetchTimeoutError' import ICharacterSetFetchResult from '../interface/ICharacterSetFetchResult' +import IItem from '../interface/IItem' +import Creature from '../entity/Creature' export type OnSuccessFunction = (id: number, character?: Character) => void export type OnErrorFunction = (id: number, error: Error) => void @@ -80,6 +82,23 @@ export default class LodestoneClient { } } + public async getCharacterMounts(id: number, fetchNames?: boolean): Promise { + // eslint-disable-next-line no-useless-catch + try { + const response = await this.axiosInstance.get(`/character/${id}/mount/`) + const tooltipUrls = Character.getMountTooltipUrlsFromPage(id, response.data, this.cheerioInstance) + return [] + } catch (e) { + throw e + } + } + + public async getCreatureToolTip(path: string, fetchName?: string): Promise { + const shortenedPath = path.replace('/lodestone', '') + const response = await this.axiosInstance.get(shortenedPath) + return Creature.fromToolTip(response.data, this.cheerioInstance) + } + public async getCharacters( characterIds: number[], parallelismLimit: number, diff --git a/src/entity/Character.ts b/src/entity/Character.ts index d7b3402..e8b34aa 100644 --- a/src/entity/Character.ts +++ b/src/entity/Character.ts @@ -32,6 +32,7 @@ import IAttributeMapping from '../interface/IAttributeMapping' import Class from './Class' import GearCategory from './GearCategory' import Level from './Level' +import IItem from '../interface/IItem' export default class Character implements ICharacter { constructor(readonly id: number, readonly name: string) {} @@ -68,7 +69,7 @@ export default class Character implements ICharacter { minionIds?: string[] | undefined - mountIds?: string[] | undefined + mounts?: IItem[] | undefined private static processAttribute($: CheerioAPI, config: string | IAttributeMapping | undefined): string | undefined { if (typeof config === 'object') { @@ -127,7 +128,7 @@ export default class Character implements ICharacter { category, name: local$.find('.db-tooltip__item__name').text(), id, - iLvl: Number(local$.find('.db-tooltip__item__level').text().replace('Item Level', '').trim()), + iLvl: Number(local$.find('.db-tooltip__item__level').text().replace('Creature Level', '').trim()), }, }) } @@ -165,4 +166,11 @@ export default class Character implements ICharacter { return character } + + static getMountTooltipUrlsFromPage(id: number, data: string, cheerio: CheerioAPI): string[] { + const $ = cheerio.load(data) + return $('.character__mounts > ul > li') + .toArray() + .map((listItem) => listItem.attribs['data-tooltip_href']) + } } diff --git a/src/entity/Creature.ts b/src/entity/Creature.ts new file mode 100644 index 0000000..62103b2 --- /dev/null +++ b/src/entity/Creature.ts @@ -0,0 +1,43 @@ +/* + * MIT License + * + * Copyright (c) 2021 Peter Reid + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + +import { CheerioAPI } from 'cheerio' +import IItem from '../interface/IItem' +import CreatureType from './CreatureType' + +export default class Creature { + constructor(public item: IItem, public creatureType?: CreatureType, public creatureName?: string) {} + + static fromToolTip(data: string, cheerio: CheerioAPI, itemIdOnly?: string): Creature { + const $ = cheerio.load(data) + const typeAsString = $('header')[0].attribs.class.replace('__header', '').toUpperCase() + const type = typeAsString as CreatureType + const creatureName = !itemIdOnly ? $('h4').text() : undefined + const item = $('a')[0] + const itemName = !itemIdOnly ? item.attribs['data-tooltip'] : undefined + const itemId = item.attribs.href.replace('/lodestone/playguide/db/item/', '').replace('/', '') + return new Creature({ name: itemName, id: itemId }, type, creatureName) + } +} diff --git a/src/entity/CreatureType.ts b/src/entity/CreatureType.ts new file mode 100644 index 0000000..429aefe --- /dev/null +++ b/src/entity/CreatureType.ts @@ -0,0 +1,31 @@ +/* + * MIT License + * + * Copyright (c) 2021 Peter Reid + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + +const enum CreatureType { + Mount = 'MOUNT', + Minion = 'MINION', +} + +export default CreatureType diff --git a/src/entity/__tests__/Character.test.ts b/src/entity/__tests__/Character.test.ts index 924b654..14acf98 100644 --- a/src/entity/__tests__/Character.test.ts +++ b/src/entity/__tests__/Character.test.ts @@ -29,6 +29,7 @@ import Cheerio from 'cheerio' import Character from '../Character' import Class from '../Class' import GearCategory from '../GearCategory' +import IItem from '../../interface/IItem' describe('Character', () => { describe('when loading character information from HTML', () => { @@ -384,4 +385,28 @@ describe('Character', () => { } }) }) + + // describe('when loading character mounts from HTML', () => { + // const expectedMountsOne: IItem[] = [] + // + // describe.each([[11886902, "P'tajha Rihll", expectedMountsOne]])( + // 'for character %s - %s', + // (charId, name, expected) => { + // let resultantMounts: IItem[] + // + // beforeAll((done) => { + // readFile(join(__dirname, 'resources', 'mount', `${charId}.html`), 'utf8', (err, data) => { + // jest.setTimeout(10000) + // const testString = Buffer.from(data) + // resultantMounts = Character.getMountTooltipUrlsFromPage(charId, testString.toString(), Cheerio) + // done() + // }) + // }) + // + // it('base test', () => { + // expect(resultantMounts.length).toEqual(23) + // }) + // } + // ) + // }) }) diff --git a/src/entity/__tests__/Creature.test.ts b/src/entity/__tests__/Creature.test.ts new file mode 100644 index 0000000..33137ac --- /dev/null +++ b/src/entity/__tests__/Creature.test.ts @@ -0,0 +1,76 @@ +/* + * MIT License + * + * Copyright (c) 2021 Peter Reid + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + +import { readFile } from 'fs' +import { join } from 'path' +import Cheerio from 'cheerio' +import Creature from '../Creature' +import CreatureType from '../CreatureType' + +describe('Creature', () => { + describe('given a mount tooltip is being loaded', () => { + const expectedMountOne: Creature = { + creatureName: 'Company Chocobo', + creatureType: CreatureType.Mount, + item: { + id: '85f78cb2a87', + name: 'Chocobo Whistle', + }, + } + // /lodestone/character/11886902/mount/tooltip/9045c5c5d5d181ee495f0e76af07d6d93c9f0f13 + describe.each([['9045c5c5d5d181ee495f0e76af07d6d93c9f0f13', "P'tajha Rihll", 'Company Chocobo', expectedMountOne]])( + 'for tooltip %s - relating to %s - Mount: %s', + (toolTipId, name, mountName, expected) => { + let resultantCreature: Creature + const nonObjectAttributes = Object.entries(expected).filter((pair) => typeof pair[1] !== 'object') + const objectAttributes = Object.entries(expected).filter((pair) => typeof pair[1] === 'object') + + beforeAll((done) => { + readFile(join(__dirname, 'resources', 'mount', 'tooltip', `${toolTipId}.html`), 'utf8', (err, data) => { + jest.setTimeout(10000) + const testString = Buffer.from(data) + resultantCreature = Creature.fromToolTip(testString.toString(), Cheerio) + done() + }) + }) + + it.each(nonObjectAttributes)("should evaluate %s as '%s'", (key) => { + // @ts-ignore + expect(resultantCreature[key]).toEqual(expected[key]) + }) + + if (objectAttributes.length > 0) { + describe.each(objectAttributes)('should evaluate %s as object', (key, value) => { + // @ts-ignore + it.each(Object.entries(value))("with key %s equal to '%s'", (lowerKey, lowerValue) => { + // @ts-ignore + expect(resultantCreature[key][lowerKey]).toEqual(lowerValue) + }) + }) + } + } + ) + }) +}) diff --git a/src/entity/__tests__/resources/11886902.html b/src/entity/__tests__/resources/11886902.html index 0583637..de11ae6 100644 --- a/src/entity/__tests__/resources/11886902.html +++ b/src/entity/__tests__/resources/11886902.html @@ -802,7 +802,7 @@

Character

-

Profile

Display Attributes

Race/Clan/Gender

Elezen
Wildwood / ♀

Nameday

29th Sun of the 3rd Astral Moon

Guardian

Thaliak, the Scholar

City-state

Gridania

Grand Company

Order of the Twin Adder / First Serpent Lieutenant

Free Company

Archadian Moogles

Attributes

Strength187
Dexterity360
Vitality1599
Intelligence359
Mind1754

Offensive Properties

Critical Hit Rate845
Determination1243
Direct Hit Rate380

Defensive Properties

Defense1269
Magic Defense2218

Physical Properties

Attack Power187
Skill Speed380

Mental Properties

Attack Magic Potency1754
Healing Magic Potency1754
Spell Speed566

Role

Tenacity380
Piety1075

LEVEL 80

  • 70
  • -
  • 80
  • -
  • 80
  • 71
  • 40
  • -
  • -
  • -
  • -
  • 55
  • -
  • 15
  • -
  • -
  • 77
  • 71
  • 80
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • 60
  • 7
  • -
  • -
  • HP

    25769
  • MP

    10000

Character Profile

Main Class: White Mage / Conjurer (ilvl 201)
Started 2015-08-10

Secondary Classes
- DRK - ilvl 188
- BLM - ilvl 171

Current Goals:
- Full Esoteric gear upgraded to 210 for WHM
- Void Ark Gear for DRK
- Alexander Gordias Gear for BLM
- Anima Weapon Stage 2+ (Stage 1 complete in <14 hrs)

To-Do:
- Turn 9
- Thornmarch ex / Ramuh ex
- Alexander Savage
- New 3.x Extreme Primals
+

Profile

Display Attributes

Race/Clan/Gender

Elezen
Wildwood / ♀

Nameday

29th Sun of the 3rd Astral Moon

Guardian

Thaliak, the Scholar

City-state

Gridania

Grand Company

Order of the Twin Adder / First Serpent Lieutenant

Free Company

Archadian Moogles

Attributes

Strength187
Dexterity360
Vitality1599
Intelligence359
Mind1754

Offensive Properties

Critical Hit Rate845
Determination1243
Direct Hit Rate380

Defensive Properties

Defense1269
Magic Defense2218

Physical Properties

Attack Power187
Skill Speed380

Mental Properties

Attack Magic Potency1754
Healing Magic Potency1754
Spell Speed566

Role

Tenacity380
Piety1075

LEVEL 80

  • 70
  • -
  • 80
  • -
  • 80
  • 71
  • 40
  • -
  • -
  • -
  • -
  • 55
  • -
  • 15
  • -
  • -
  • 77
  • 71
  • 80
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • 60
  • 7
  • -
  • -
  • HP

    25769
  • MP

    10000

Character Profile

Main Class: White Mage / Conjurer (ilvl 201)
Started 2015-08-10

Secondary Classes
- DRK - ilvl 188
- BLM - ilvl 171

Current Goals:
- Full Esoteric gear upgraded to 210 for WHM
- Void Ark Gear for DRK
- Alexander Gordias Gear for BLM
- Anima Weapon Stage 2+ (Stage 1 complete in <14 hrs)

To-Do:
- Turn 9
- Thornmarch ex / Ramuh ex
- Alexander Savage
- New 3.x Extreme Primals
diff --git a/src/entity/__tests__/resources/18001255.html b/src/entity/__tests__/resources/18001255.html index 06839da..58f21dd 100644 --- a/src/entity/__tests__/resources/18001255.html +++ b/src/entity/__tests__/resources/18001255.html @@ -803,7 +803,7 @@

Character

-

Profile

Display Attributes

Race/Clan/Gender

Lalafell
Dunesfolk / ♂

Nameday

6th Sun of the 6th Astral Moon

Guardian

Rhalgr, the Destroyer

City-state

Gridania

Grand Company

Order of the Twin Adder / Serpent Captain

Free Company

Archadian Moogles

Attributes

Strength191
Dexterity321
Vitality1355
Intelligence370
Mind1430

Offensive Properties

Critical Hit Rate865
Determination1055
Direct Hit Rate372

Defensive Properties

Defense973
Magic Defense1700

Physical Properties

Attack Power191
Skill Speed372

Mental Properties

Attack Magic Potency1430
Healing Magic Potency1430
Spell Speed699

Role

Tenacity372
Piety551

LEVEL 76

  • 71
  • 71
  • 71
  • 80
  • 80
  • 71
  • 72
  • 76
  • 71
  • 71
  • 73
  • 80
  • -
  • 71
  • 72
  • 71
  • 80
  • 71
  • 71
  • 70
  • 80
  • 80
  • 80
  • 80
  • 80
  • 80
  • 80
  • 80
  • 80
  • 80
  • 80
  • HP

    19155
  • MP

    10000

Character Profile

eOuD5GFkbrcbaVFkZSVwmUgzDnf2
+

Profile

Display Attributes

Race/Clan/Gender

Lalafell
Dunesfolk / ♂

Nameday

6th Sun of the 6th Astral Moon

Guardian

Rhalgr, the Destroyer

City-state

Gridania

Grand Company

Order of the Twin Adder / Serpent Captain

Free Company

Archadian Moogles

Attributes

Strength191
Dexterity321
Vitality1355
Intelligence370
Mind1430

Offensive Properties

Critical Hit Rate865
Determination1055
Direct Hit Rate372

Defensive Properties

Defense973
Magic Defense1700

Physical Properties

Attack Power191
Skill Speed372

Mental Properties

Attack Magic Potency1430
Healing Magic Potency1430
Spell Speed699

Role

Tenacity372
Piety551

LEVEL 76

  • 71
  • 71
  • 71
  • 80
  • 80
  • 71
  • 72
  • 76
  • 71
  • 71
  • 73
  • 80
  • -
  • 71
  • 72
  • 71
  • 80
  • 71
  • 71
  • 70
  • 80
  • 80
  • 80
  • 80
  • 80
  • 80
  • 80
  • 80
  • 80
  • 80
  • 80
  • HP

    19155
  • MP

    10000

Character Profile

eOuD5GFkbrcbaVFkZSVwmUgzDnf2
diff --git a/src/entity/__tests__/resources/27218992.html b/src/entity/__tests__/resources/27218992.html index 29fb337..ef79bca 100644 --- a/src/entity/__tests__/resources/27218992.html +++ b/src/entity/__tests__/resources/27218992.html @@ -802,7 +802,7 @@

Character

-

Profile

Display Attributes

Race/Clan/Gender

Lalafell
Dunesfolk / ♀

Nameday

8th Sun of the 1st Astral Moon

Guardian

Halone, the Fury

City-state

Limsa Lominsa

Grand Company

Maelstrom / Storm Corporal

Free Company

Archadian Moogles

Attributes

Strength3117
Dexterity282
Vitality3557
Intelligence179
Mind299

Offensive Properties

Critical Hit Rate1549
Determination1418
Direct Hit Rate365

Defensive Properties

Defense5790
Magic Defense5790

Physical Properties

Attack Power3117
Skill Speed1284

Mental Properties

Attack Magic Potency179
Healing Magic Potency299
Spell Speed365

Role

Tenacity1460
Piety296

LEVEL 71

  • 71
  • 80
  • 72
  • 80
  • -
  • 80
  • -
  • 80
  • 80
  • 80
  • 80
  • -
  • -
  • -
  • -
  • 80
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • HP

    77788
  • MP

    10000

Character Profile

fflogs-pqtaA4nVJXF12fxDkvTH3zPmLWQGwZhM

+

Profile

Display Attributes

Race/Clan/Gender

Lalafell
Dunesfolk / ♀

Nameday

8th Sun of the 1st Astral Moon

Guardian

Halone, the Fury

City-state

Limsa Lominsa

Grand Company

Maelstrom / Storm Corporal

Free Company

Archadian Moogles

Attributes

Strength3117
Dexterity282
Vitality3557
Intelligence179
Mind299

Offensive Properties

Critical Hit Rate1549
Determination1418
Direct Hit Rate365

Defensive Properties

Defense5790
Magic Defense5790

Physical Properties

Attack Power3117
Skill Speed1284

Mental Properties

Attack Magic Potency179
Healing Magic Potency299
Spell Speed365

Role

Tenacity1460
Piety296

LEVEL 71

  • 71
  • 80
  • 72
  • 80
  • -
  • 80
  • -
  • 80
  • 80
  • 80
  • 80
  • -
  • -
  • -
  • -
  • 80
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • HP

    77788
  • MP

    10000

Character Profile

fflogs-pqtaA4nVJXF12fxDkvTH3zPmLWQGwZhM

diff --git a/src/entity/__tests__/resources/28309293.html b/src/entity/__tests__/resources/28309293.html index 73ad5b1..b275179 100644 --- a/src/entity/__tests__/resources/28309293.html +++ b/src/entity/__tests__/resources/28309293.html @@ -803,7 +803,7 @@

Character

-

Profile

Display Attributes

Race/Clan/Gender

Au Ra
Xaela / ♀

Nameday

7th Sun of the 1st Astral Moon

Guardian

Azeyma, the Warden

City-state

Ul'dah

Grand Company

Maelstrom / Second Storm Lieutenant

Free Company

Archadian Moogles

Attributes

Strength1862
Dexterity340
Vitality1903
Intelligence272
Mind134

Offensive Properties

Critical Hit Rate1010
Determination1361
Direct Hit Rate1032

Defensive Properties

Defense2432
Magic Defense1913

Physical Properties

Attack Power1862
Skill Speed537

Mental Properties

Attack Magic Potency272
Healing Magic Potency134
Spell Speed380

Role

Tenacity380
Piety340

LEVEL 80

  • 6
  • 9
  • 80
  • 67
  • 1
  • 60
  • 80
  • -
  • 1
  • 1
  • 9
  • 61
  • 80
  • 1
  • 37
  • 80
  • 80
  • 60
  • 80
  • 1
  • -
  • -
  • -
  • 2
  • -
  • -
  • -
  • 80
  • -
  • 80
  • -
  • HP

    31684
  • MP

    10000

Character Profile

-
+

Profile

Display Attributes

Race/Clan/Gender

Au Ra
Xaela / ♀

Nameday

7th Sun of the 1st Astral Moon

Guardian

Azeyma, the Warden

City-state

Ul'dah

Grand Company

Maelstrom / Second Storm Lieutenant

Free Company

Archadian Moogles

Attributes

Strength1862
Dexterity340
Vitality1903
Intelligence272
Mind134

Offensive Properties

Critical Hit Rate1010
Determination1361
Direct Hit Rate1032

Defensive Properties

Defense2432
Magic Defense1913

Physical Properties

Attack Power1862
Skill Speed537

Mental Properties

Attack Magic Potency272
Healing Magic Potency134
Spell Speed380

Role

Tenacity380
Piety340

LEVEL 80

  • 6
  • 9
  • 80
  • 67
  • 1
  • 60
  • 80
  • -
  • 1
  • 1
  • 9
  • 61
  • 80
  • 1
  • 37
  • 80
  • 80
  • 60
  • 80
  • 1
  • -
  • -
  • -
  • 2
  • -
  • -
  • -
  • 80
  • -
  • 80
  • -
  • HP

    31684
  • MP

    10000

Character Profile

-
diff --git a/src/entity/__tests__/resources/38531003.html b/src/entity/__tests__/resources/38531003.html index 5a1645a..ffffe7d 100644 --- a/src/entity/__tests__/resources/38531003.html +++ b/src/entity/__tests__/resources/38531003.html @@ -800,7 +800,7 @@

Character

-

Profile

Display Attributes

Race/Clan/Gender

Elezen
Wildwood / ♀

Nameday

4th Sun of the 4th Astral Moon

Guardian

Nymeia, the Spinner

City-state

Limsa Lominsa

Free Company

Gandalf's Gangstas

Attributes

Strength65
Dexterity76
Vitality84
Intelligence106
Mind68

Offensive Properties

Critical Hit Rate140
Determination81
Direct Hit Rate149

Defensive Properties

Defense56
Magic Defense115

Physical Properties

Attack Power65
Skill Speed138

Mental Properties

Attack Magic Potency106
Healing Magic Potency68
Spell Speed139

Role

Tenacity138
Piety77

LEVEL 24

  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • 24
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • 5
  • -
  • 1
  • -
  • HP

    489
  • MP

    10000

Character Profile

-
+

Profile

Display Attributes

Race/Clan/Gender

Elezen
Wildwood / ♀

Nameday

4th Sun of the 4th Astral Moon

Guardian

Nymeia, the Spinner

City-state

Limsa Lominsa

Free Company

Gandalf's Gangstas

Attributes

Strength65
Dexterity76
Vitality84
Intelligence106
Mind68

Offensive Properties

Critical Hit Rate140
Determination81
Direct Hit Rate149

Defensive Properties

Defense56
Magic Defense115

Physical Properties

Attack Power65
Skill Speed138

Mental Properties

Attack Magic Potency106
Healing Magic Potency68
Spell Speed139

Role

Tenacity138
Piety77

LEVEL 24

  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • 24
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • 5
  • -
  • 1
  • -
  • HP

    489
  • MP

    10000

Character Profile

-
diff --git a/src/entity/__tests__/resources/mount/11886902.html b/src/entity/__tests__/resources/mount/11886902.html new file mode 100644 index 0000000..cdae3fd --- /dev/null +++ b/src/entity/__tests__/resources/mount/11886902.html @@ -0,0 +1,1317 @@ + + + + + + + + + + + P'tajha Rihll | FINAL FANTASY XIV, The Lodestone + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + +
+ + + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + +

Character

+ + + + + + + +
+ +
+ + + + +
+

Character

+ + + +
+ +
+ +
+
+

Archmage

+

P'tajha Rihll

+ +

Cerberus (Chaos)

+
+
+
+ + + + +
+ +
+ +

You have no connection with this character.

+ + + + + +
Follower Requests
+

Before this character can be followed, you must first submit a follower request.
Do you wish to proceed?

+ + + + +
+ +
+ + + + + + +
+ +

Mounts

+ +
+ +

Total: 40

+
+ +
+
    +
  • +
+
+ +
+
+
+ +
+ + + + +
+ ForumsMog StationOfficial Blog +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + + +
+ + + + + + + + + +
+ + + +
+ + + + + + +
+ + + +
+

Community Wall

+ +
+
+

Recent Activity

+ +
+

+ Filter which items are to be displayed below.
+ + * Notifications for standings updates are shared across all Worlds.
+ * Notifications for PvP team formations are shared for all languages.
+ * Notifications for free company formations are shared for all languages. +
+

+ + +
+
Sort by
Data Center / Home World
Primary language
Displaying
+
+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + +
+ +
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/entity/__tests__/resources/mount/tooltip/9045c5c5d5d181ee495f0e76af07d6d93c9f0f13.html b/src/entity/__tests__/resources/mount/tooltip/9045c5c5d5d181ee495f0e76af07d6d93c9f0f13.html new file mode 100644 index 0000000..4fd3d80 --- /dev/null +++ b/src/entity/__tests__/resources/mount/tooltip/9045c5c5d5d181ee495f0e76af07d6d93c9f0f13.html @@ -0,0 +1,27 @@ + + + +

Company Chocobo

Born and bred in the city-state of Ishgard, the majority of company chocobos are geldings of the rouncey variety; however, massive destriers and miniature Belah'dian jennets are also raised to accommodate the builds of Roegadyn and
Lalafellin riders respectively.

MovementTerrestrial

Item

diff --git a/src/interface/ICharacter.ts b/src/interface/ICharacter.ts index 17769ea..51ab5c2 100644 --- a/src/interface/ICharacter.ts +++ b/src/interface/ICharacter.ts @@ -27,6 +27,7 @@ import IGearSet from './IGearSet' import { IMappableCharacter } from './IMappableCharacter' import Class from '../entity/Class' import IClassLevels from './IClassLevels' +import IItem from './IItem' export default interface ICharacter extends IMappableCharacter { readonly name: string @@ -63,5 +64,5 @@ export default interface ICharacter extends IMappableCharacter { readonly minionIds?: string[] - readonly mountIds?: string[] + readonly mounts?: IItem[] } diff --git a/src/interface/IGearPiece.ts b/src/interface/IGearPiece.ts index f0a535c..0327431 100644 --- a/src/interface/IGearPiece.ts +++ b/src/interface/IGearPiece.ts @@ -24,10 +24,10 @@ */ import GearCategory from '../entity/GearCategory' +import IItem from './IItem' -export default interface IGearPiece { - category: GearCategory - id: string +export default interface IGearPiece extends IItem { name: string + category: GearCategory iLvl: number } diff --git a/src/interface/IItem.ts b/src/interface/IItem.ts new file mode 100644 index 0000000..64d4949 --- /dev/null +++ b/src/interface/IItem.ts @@ -0,0 +1,29 @@ +/* + * MIT License + * + * Copyright (c) 2021 Peter Reid + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + +export default interface IItem { + name?: string + id: string +} diff --git a/src/interface/IMappableCharacter.ts b/src/interface/IMappableCharacter.ts index e88ecc2..1a1beb2 100644 --- a/src/interface/IMappableCharacter.ts +++ b/src/interface/IMappableCharacter.ts @@ -27,6 +27,7 @@ import IGearSet from './IGearSet' import IAttributeMapping from './IAttributeMapping' import Class from '../entity/Class' import IClassLevels from './IClassLevels' +import IItem from './IItem' export interface IMappableCharacter { readonly name: string @@ -63,5 +64,5 @@ export interface IMappableCharacter { readonly minionIds?: string[] - readonly mountIds?: string[] + readonly mounts?: IItem[] }