Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
DengSir committed Sep 4, 2024
1 parent 4f9ce82 commit 97a563a
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 90 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ jobs:
- name: Generate glyph
run: deno task glyph

- name: Generate itemenchant
run: deno task itemenchant

- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
Expand Down
2 changes: 1 addition & 1 deletion Scripts/GlyphGen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @Date : 1/28/2024, 4:02:59 PM
*/

import * as path from 'https://deno.land/[email protected]/path/mod.ts';
import * as path from '@std/path';
import { ProjectId, WowToolsClient } from './util.ts';

class App {
Expand Down
61 changes: 61 additions & 0 deletions Scripts/ItemEnchant.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/**
* @File : ItemEnchant.ts
* @Author : Dencer ([email protected])
* @Link : https://dengsir.github.io
* @Date : 9/4/2024, 2:23:31 PM
*/

interface ItemEnchant {
isTemporary: boolean;
enchant: number;
spell: number;
requiredItemClass: number;
item?: number;
itemSubclassMask?: number;
invTypeMask?: number;
}

interface ItemEnchantMap {
[key: string]: ItemEnchant;
}

class App {
async run() {
const resp = await fetch('https://nether.wowhead.com/wotlk/data/gear-planner?dv=100');
const text = await resp.text();

const m = text.match(/"wow\.gearPlanner\.wrath.enchant",(.+)\)/);
if (!m) {
throw Error('not found');
}
const d = JSON.parse(m[1]) as ItemEnchantMap | undefined;

if (!d) {
throw Error('not found');
}

const codes = [];

for (const [, v] of Object.entries(d)) {
if (v.isTemporary) {
continue;
}
if (v.requiredItemClass === 2 || v.requiredItemClass === 4) {
const item = v.item || 'n';
const itemSubclassMask = v.itemSubclassMask || 'n';
const invTypeMask = v.invTypeMask || 'n';
codes.push(
`D(${v.enchant},${v.spell},${item},${v.requiredItemClass},${itemSubclassMask},${invTypeMask})`
);
}
}

const code = `select(2,...).ItemEnchantMake()
local n=nil
${codes.join('\n')}`;

Deno.writeTextFileSync('Data/Wrath/ItemEnchant.lua', code);
}
}

new App().run();
2 changes: 1 addition & 1 deletion Scripts/ItemSetsGen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @Date : 2022/9/26 18:47:21
*/

import * as path from 'https://deno.land/[email protected]/path/mod.ts';
import * as path from '@std/path';
import { ProjectId, WowToolsClient } from './util.ts';

class App {
Expand Down
2 changes: 1 addition & 1 deletion Scripts/TalentsGen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @Date : 2022/9/26 14:22:02
*/

import * as path from 'https://deno.land/[email protected]/path/mod.ts';
import * as path from '@std/path';
import { ProjectId, WowToolsClient } from './util.ts';

interface Config {
Expand Down
3 changes: 3 additions & 0 deletions UI/Template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
</Ui>
3 changes: 3 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"imports": { "@std/path": "jsr:@std/path@^1.0.3" }
}
99 changes: 13 additions & 86 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"version": "conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md",
"talent": "deno run --allow-all Scripts/TalentsGen.ts",
"itemset": "deno run --allow-all Scripts/ItemSetsGen.ts",
"glyph": "deno run --allow-all Scripts/GlyphGen.ts"
"glyph": "deno run --allow-all Scripts/GlyphGen.ts",
"itemenchant": "deno run --allow-all Scripts/ItemEnchantsGen.ts"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 97a563a

Please sign in to comment.