uesp-eso-build-wrapper 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # uesp-eso-build-wrapper
2
2
 
3
+ [![CI](https://github.com/srtomy/uesp-eso-build-wrapper/actions/workflows/ci.yml/badge.svg)](https://github.com/srtomy/uesp-eso-build-wrapper/actions/workflows/ci.yml)
4
+
3
5
  A Node.js/TypeScript wrapper around the [UESP ESO Build Editor](https://github.com/uesp/uesp-esochardata) math engine.
4
6
 
5
7
  Calculate Elder Scrolls Online **Computed Character Statistics** — Health, Magicka, Stamina, mitigation, crit chance, regeneration, and 200+ more — using UESP's own formulas. No formula reimplementation. No database.
@@ -35,10 +37,10 @@ const stats = calculateBuild({
35
37
  },
36
38
  });
37
39
 
38
- console.log(stats.Health); // 16000
39
- console.log(stats.Magicka); // 19104
40
+ console.log(stats.Health); // 16000
41
+ console.log(stats.Magicka); // 19104
40
42
  console.log(stats.MagickaRegen); // 514
41
- console.log(stats.SpellDamage); // 1000
43
+ console.log(stats.SpellDamage); // 1000
42
44
  ```
43
45
 
44
46
  ## With Equipped Items
@@ -48,7 +50,7 @@ Items are passed directly as returned by the [UESP public item API](https://esol
48
50
  ```ts
49
51
  // 1. Fetch item data from UESP API
50
52
  const res = await fetch(
51
- 'https://esolog.uesp.net/exportJson.php?table=minedItem&id=70&level=50&quality=5'
53
+ 'https://esolog.uesp.net/exportJson.php?table=minedItem&id=70&level=50&quality=5',
52
54
  );
53
55
  const data = await res.json();
54
56
  const item = data.minedItem[0]; // pick the variant you want
@@ -77,10 +79,10 @@ Initializes the UESP math engine. **Must be called once** before `calculateBuild
77
79
 
78
80
  Safe to call multiple times — only executes on the first call.
79
81
 
80
- | Param | Type | Default | Description |
81
- |---|---|---|---|
82
- | `resourcesPath` | `string` | bundled vendor | Path to `esoEditBuild.js` and `esobuilddata.js` |
83
- | `initDataPath` | `string` | bundled vendor | Path to `uesp-init-data.json` with game formulas |
82
+ | Param | Type | Default | Description |
83
+ | --------------- | -------- | -------------- | ------------------------------------------------ |
84
+ | `resourcesPath` | `string` | bundled vendor | Path to `esoEditBuild.js` and `esobuilddata.js` |
85
+ | `initDataPath` | `string` | bundled vendor | Path to `uesp-init-data.json` with game formulas |
84
86
 
85
87
  ### `calculateBuild(input: BuildInput): ComputedStats`
86
88
 
@@ -91,20 +93,20 @@ Runs the UESP engine and returns the computed stats.
91
93
  ```ts
92
94
  interface BuildInput {
93
95
  character: {
94
- race: string; // "High Elf" | "Nord" | "Breton" | "Khajiit" | ...
95
- class: string; // "Sorcerer" | "Dragonknight" | "Nightblade" | ...
96
- level: number; // 1–50
96
+ race: string; // "High Elf" | "Nord" | "Breton" | "Khajiit" | ...
97
+ class: string; // "Sorcerer" | "Dragonknight" | "Nightblade" | ...
98
+ level: number; // 1–50
97
99
  attributes: {
98
- health: number; // attribute points (max 64 total)
100
+ health: number; // attribute points (max 64 total)
99
101
  magicka: number;
100
102
  stamina: number;
101
103
  };
102
- mundusStone?: string; // "The Thief" | "The Apprentice" | ...
103
- cyrodiil?: boolean; // Battle Spirit (PvP)
104
- vampireStage?: number; // 0–4
105
- werewolfStage?: number; // 0 or 1
106
- championPoints?: number; // 0–3600
107
- rulesVersion?: string; // "Live" (default) | "PTS"
104
+ mundusStone?: string; // "The Thief" | "The Apprentice" | ...
105
+ cyrodiil?: boolean; // Battle Spirit (PvP)
106
+ vampireStage?: number; // 0–4
107
+ werewolfStage?: number; // 0 or 1
108
+ championPoints?: number; // 0–3600
109
+ rulesVersion?: string; // "Live" (default) | "PTS"
108
110
  };
109
111
  items?: Partial<Record<EquipSlot, UespItemApiData>>;
110
112
  }
@@ -123,18 +125,18 @@ Poison1 | Poison2 | Food | Potion
123
125
 
124
126
  Key stats returned (see [`types.ts`](src/lib/eso-engine/types.ts) for full list):
125
127
 
126
- | Property | Description |
127
- |---|---|
128
- | `Health` / `Magicka` / `Stamina` | Maximum resource pools |
129
- | `HealthRegen` / `MagickaRegen` / `StaminaRegen` | Out-of-combat regeneration |
130
- | `WeaponDamage` / `SpellDamage` | Base damage |
131
- | `WeaponCrit` / `SpellCrit` | Critical chance |
132
- | `PhysicalResist` / `SpellResist` / `CritResist` | Resistances |
133
- | `PhysicalPenetration` / `SpellPenetration` | Armor penetration |
134
- | `DefensePhysicalMitigation` / `DefenseSpellMitigation` | Effective mitigation % |
135
- | `HealingDone` / `HealingTaken` | Healing modifiers |
136
- | `RunSpeed` / `SprintSpeed` | Movement speed |
137
- | `raw` | All 221 stats as `Record<string, number>` |
128
+ | Property | Description |
129
+ | ------------------------------------------------------ | ----------------------------------------- |
130
+ | `Health` / `Magicka` / `Stamina` | Maximum resource pools |
131
+ | `HealthRegen` / `MagickaRegen` / `StaminaRegen` | Out-of-combat regeneration |
132
+ | `WeaponDamage` / `SpellDamage` | Base damage |
133
+ | `WeaponCrit` / `SpellCrit` | Critical chance |
134
+ | `PhysicalResist` / `SpellResist` / `CritResist` | Resistances |
135
+ | `PhysicalPenetration` / `SpellPenetration` | Armor penetration |
136
+ | `DefensePhysicalMitigation` / `DefenseSpellMitigation` | Effective mitigation % |
137
+ | `HealingDone` / `HealingTaken` | Healing modifiers |
138
+ | `RunSpeed` / `SprintSpeed` | Movement speed |
139
+ | `raw` | All 221 stats as `Record<string, number>` |
138
140
 
139
141
  > All stat IDs match `g_EsoComputedStats` from the UESP engine (version 49+).
140
142
 
@@ -35,5 +35,35 @@ Bundled files from uesp/uesp-esochardata:
35
35
  - vendor/uesp-esochardata/resources/esobuilddata.js
36
36
  - vendor/uesp-data/uesp-init-data.json (formulas extracted from the UESP website)
37
37
 
38
+ --------------------------------------------------------------------------------
39
+ uesp/uesp-esolog
40
+ https://github.com/uesp/uesp-esolog
41
+
42
+ MIT License
43
+
44
+ Copyright (c) 2020 Dave Humphrey
45
+
46
+ Permission is hereby granted, free of charge, to any person obtaining a copy
47
+ of this software and associated documentation files (the "Software"), to deal
48
+ in the Software without restriction, including without limitation the rights
49
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
50
+ copies of the Software, and to permit persons to whom the Software is
51
+ furnished to do so, subject to the following conditions:
52
+
53
+ The above copyright notice and this permission notice shall be included in all
54
+ copies or substantial portions of the Software.
55
+
56
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
57
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
58
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
59
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
60
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
61
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
62
+ SOFTWARE.
63
+ --------------------------------------------------------------------------------
64
+
65
+ Bundled files from uesp/uesp-esolog:
66
+ - vendor/uesp-esolog/resources/esoskills.js
67
+
38
68
  Elder Scrolls Online is a trademark of ZeniMax Media Inc. This project is not
39
69
  affiliated with or endorsed by ZeniMax Media Inc. or Bethesda Softworks.
@@ -0,0 +1 @@
1
+ // This package is Node.js-only and has no browser exports.
@@ -17,7 +17,7 @@
17
17
  *
18
18
  * 4. Ler os resultados de g_EsoComputedStats[statId].value
19
19
  */
20
- import type { BuildInput, ComputedStats } from './types';
20
+ import type { BuffInfo, BuildInput, ComputedStats, PassiveSkillInfo, ToggleSkillInfo } from './types';
21
21
  /**
22
22
  * Calcula os Computed Character Statistics para a build fornecida.
23
23
  *
@@ -36,4 +36,71 @@ import type { BuildInput, ComputedStats } from './types';
36
36
  * ```
37
37
  */
38
38
  export declare function calculateBuild(input: BuildInput): ComputedStats;
39
+ /**
40
+ * Returns the catalog of buffs available in the loaded UESP engine.
41
+ *
42
+ * Each entry maps to one row in the UESP buff tab. Pass `entry.name` to
43
+ * `BuildInput.activeBuffs` to enable that buff in a calculation.
44
+ *
45
+ * Must be called after `initEsoEngine()`.
46
+ *
47
+ * @param group - Optional filter. Ex: "Major", "Minor", "Set", "Target",
48
+ * "Skill", "Potion", "Poison", "Cyrodiil", "Other".
49
+ * Omit to return all 164 buffs.
50
+ */
51
+ export declare function listAvailableBuffs(group?: string): BuffInfo[];
52
+ /**
53
+ * Returns all racial passive skills for the given race.
54
+ * Each passive may appear in multiple ranks (rank 1, 2, 3).
55
+ * Pass the abilityId of the desired rank to BuildInput.passiveSkills.
56
+ *
57
+ * Must be called after initEsoEngine().
58
+ *
59
+ * @param race - Race name as passed to BuildInput.character.race.
60
+ * Ex: "High Elf", "Nord", "Khajiit"
61
+ */
62
+ export declare function listRacialPassives(race: string): PassiveSkillInfo[];
63
+ /**
64
+ * Returns all class passive skills for the given class.
65
+ * Each passive may appear in multiple ranks (rank 1, 2, 3).
66
+ * Pass the abilityId of the desired rank to BuildInput.passiveSkills.
67
+ *
68
+ * Must be called after initEsoEngine().
69
+ *
70
+ * @param className - Class name as passed to BuildInput.character.class.
71
+ * Ex: "Sorcerer", "Nightblade", "Dragonknight"
72
+ */
73
+ export declare function listClassPassives(className: string): PassiveSkillInfo[];
74
+ /**
75
+ * Returns all passive skills for the given skill line.
76
+ * Each passive may appear in multiple ranks (rank 1, 2, 3).
77
+ * Pass the abilityId of the desired rank to BuildInput.passiveSkills.
78
+ *
79
+ * Must be called after initEsoEngine().
80
+ *
81
+ * @param skillLine - Skill line name as it appears in g_SkillsData.
82
+ * Use listAvailableSkillLines() to discover valid names.
83
+ * Examples: "Light Armor", "Heavy Armor", "Undaunted", "Destruction Staff",
84
+ * "Fighters Guild", "Mages Guild", "Psijic Order", "Assault", "Support",
85
+ * "Vampire", "Werewolf"
86
+ */
87
+ export declare function listPassivesBySkillLine(skillLine: string): PassiveSkillInfo[];
88
+ /**
89
+ * Returns all skill line names that have passive skills available.
90
+ * Use the returned names with listPassivesBySkillLine().
91
+ *
92
+ * Must be called after initEsoEngine().
93
+ */
94
+ export declare function listAvailableSkillLines(): string[];
95
+ /**
96
+ * Returns all available toggle skills from the loaded UESP engine.
97
+ * Pass entry.name to BuildInput.toggleSkills to enable it.
98
+ *
99
+ * Note: toggle skills with requiresCyrodiil=true also need character.cyrodiil=true.
100
+ * Toggle skills backed by a passive (isPassive=true) need the associated skill
101
+ * in passiveSkills/skillBars for the engine to process the description match.
102
+ *
103
+ * Must be called after initEsoEngine().
104
+ */
105
+ export declare function listAvailableToggleSkills(): ToggleSkillInfo[];
39
106
  //# sourceMappingURL=calculator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"calculator.d.ts","sourceRoot":"","sources":["../../../src/lib/eso-engine/calculator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAa,MAAM,SAAS,CAAC;AAuBpE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,aAAa,CAyJ/D"}
1
+ {"version":3,"file":"calculator.d.ts","sourceRoot":"","sources":["../../../src/lib/eso-engine/calculator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EAEV,aAAa,EAEb,gBAAgB,EAEhB,eAAe,EAEhB,MAAM,SAAS,CAAC;AAqCjB;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,aAAa,CAgc/D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,EAAE,CA6B7D;AA2BD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAKnE;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAKvE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAK7E;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,EAAE,CASlD;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,IAAI,eAAe,EAAE,CA6B7D"}