From 77a9b68c79e1f34ff9b139cb364d628b398ad0de Mon Sep 17 00:00:00 2001 From: Exitare Date: Wed, 8 Jan 2025 02:04:55 -0800 Subject: [PATCH 1/2] chore(creature_template): update initial unit class from being 0 to 1 (warrior class) (#3235) --- .../creature-template/creature-template.integration.spec.ts | 4 ++-- .../acore-world-model/src/entities/creature-template.type.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/features/creature/src/creature-template/creature-template.integration.spec.ts b/libs/features/creature/src/creature-template/creature-template.integration.spec.ts index 2b730113621..bd0f5594a0a 100644 --- a/libs/features/creature/src/creature-template/creature-template.integration.spec.ts +++ b/libs/features/creature/src/creature-template/creature-template.integration.spec.ts @@ -36,7 +36,7 @@ describe('CreatureTemplate integration tests', () => { '`maxgold`, `AIName`, `MovementType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `ExperienceModifier`, ' + '`RacialLeader`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `spell_school_immune_mask`, ' + '`flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES\n' + - "(1234, 0, 0, 0, 0, 0, '', '', '', 0, 1, 1, 0, 0, 0, 1, 1.14286, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, " + + "(1234, 0, 0, 0, 0, 0, '', '', '', 0, 1, 1, 0, 0, 0, 1, 1.14286, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, " + "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, '', 0);\n"; const originalEntity = new CreatureTemplate(); @@ -93,7 +93,7 @@ describe('CreatureTemplate integration tests', () => { '`lootid`, `pickpocketloot`, `skinloot`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, ' + '`AIName`, `MovementType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `ExperienceModifier`, `RacialLeader`, ' + '`movementId`, `RegenHealth`, `mechanic_immune_mask`, `spell_school_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES\n' + - "(1234, 0, 0, 0, 0, 0, 'Shin', '', '', 0, 1, 1, 0, 0, 0, 1, 1.14286, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0," + + "(1234, 0, 0, 0, 0, 0, 'Shin', '', '', 0, 1, 1, 0, 0, 0, 1, 1.14286, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0," + " 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, '', 0);"; querySpy.calls.reset(); diff --git a/libs/shared/acore-world-model/src/entities/creature-template.type.ts b/libs/shared/acore-world-model/src/entities/creature-template.type.ts index dfe7c2f68c5..c3160fb842c 100644 --- a/libs/shared/acore-world-model/src/entities/creature-template.type.ts +++ b/libs/shared/acore-world-model/src/entities/creature-template.type.ts @@ -39,7 +39,7 @@ export class CreatureTemplate extends TableRow { RangeAttackTime: number = 0; BaseVariance: number = 0; RangeVariance: number = 0; - unit_class: number = 0; + unit_class: number = 1; unit_flags: number = 0; unit_flags2: number = 0; dynamicflags: number = 0; From 3a6646e0ec92826290a98354bf4e7703cc66db00 Mon Sep 17 00:00:00 2001 From: Exitare Date: Wed, 8 Jan 2025 02:22:52 -0800 Subject: [PATCH 2/2] chore(creature_template_model): change initial probability from 0 to 1 (#3234) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Stefano Borzì --- ...reature-template-model.integration.spec.ts | 48 +++++++++---------- .../entities/creature-template-model.type.ts | 2 +- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/libs/features/creature/src/creature-template-model/creature-template-model.integration.spec.ts b/libs/features/creature/src/creature-template-model/creature-template-model.integration.spec.ts index cacc4a64194..da3f429b7b1 100644 --- a/libs/features/creature/src/creature-template-model/creature-template-model.integration.spec.ts +++ b/libs/features/creature/src/creature-template-model/creature-template-model.integration.spec.ts @@ -101,9 +101,9 @@ describe('CreatureTemplateModel integration tests', () => { const expectedQuery = 'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234) AND (`Idx` IN (0, 1, 2));\n' + 'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' + - '(1234, 0, 0, 1, 0, 0),\n' + - '(1234, 1, 0, 1, 0, 0),\n' + - '(1234, 2, 0, 1, 0, 0);'; + '(1234, 0, 0, 1, 1, 0),\n' + + '(1234, 1, 0, 1, 1, 0),\n' + + '(1234, 2, 0, 1, 1, 0);'; querySpy.calls.reset(); page.addNewRow(); @@ -127,12 +127,12 @@ describe('CreatureTemplateModel integration tests', () => { page.expectDiffQueryToContain( 'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234) AND (`Idx` IN (0));\n' + 'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' + - '(1234, 0, 0, 1, 0, 0);', + '(1234, 0, 0, 1, 1, 0);', ); page.expectFullQueryToContain( 'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234);\n' + 'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' + - '(1234, 0, 0, 1, 0, 0)', + '(1234, 0, 0, 1, 1, 0)', ); page.setInputValueById('Idx', '28'); @@ -140,12 +140,12 @@ describe('CreatureTemplateModel integration tests', () => { page.expectDiffQueryToContain( 'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234) AND (`Idx` IN (28));\n' + 'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' + - '(1234, 28, 0, 1, 0, 0);', + '(1234, 28, 0, 1, 1, 0);', ); page.expectFullQueryToContain( 'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234);\n' + 'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' + - '(1234, 28, 0, 1, 0, 0);', + '(1234, 28, 0, 1, 1, 0);', ); page.removeNativeElement(); }); @@ -161,14 +161,14 @@ describe('CreatureTemplateModel integration tests', () => { page.expectDiffQueryToContain( 'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234) AND (`Idx` IN (28, 0));\n' + 'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' + - '(1234, 28, 0, 1, 0, 0),\n' + - '(1234, 0, 0, 1, 0, 0);', + '(1234, 28, 0, 1, 1, 0),\n' + + '(1234, 0, 0, 1, 1, 0);', ); page.expectFullQueryToContain( 'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234);\n' + 'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' + - '(1234, 28, 0, 1, 0, 0),\n' + - '(1234, 0, 0, 1, 0, 0);', + '(1234, 28, 0, 1, 1, 0),\n' + + '(1234, 0, 0, 1, 1, 0);', ); page.removeNativeElement(); }); @@ -183,9 +183,9 @@ describe('CreatureTemplateModel integration tests', () => { page.expectFullQueryToContain( 'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234);\n' + 'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' + - '(1234, 0, 0, 1, 0, 0),\n' + - '(1234, 1, 0, 1, 0, 0),\n' + - '(1234, 2, 0, 1, 0, 0);', + '(1234, 0, 0, 1, 1, 0),\n' + + '(1234, 1, 0, 1, 1, 0),\n' + + '(1234, 2, 0, 1, 1, 0);', ); expect(page.getEditorTableRowsCount()).toBe(3); expect(page.getAllModelViewers().length).toBe(3); // check one model viewer per row @@ -199,8 +199,8 @@ describe('CreatureTemplateModel integration tests', () => { page.expectDiffQueryToContain('DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234) AND (`Idx` IN (1));'); page.expectFullQueryToContain( 'creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' + - '(1234, 0, 0, 1, 0, 0),\n' + - '(1234, 2, 0, 1, 0, 0);', + '(1234, 0, 0, 1, 1, 0),\n' + + '(1234, 2, 0, 1, 1, 0);', ); page.deleteRow(1); @@ -209,7 +209,7 @@ describe('CreatureTemplateModel integration tests', () => { page.expectFullQueryToContain( 'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234);\n' + 'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' + - '(1234, 0, 0, 1, 0, 0);', + '(1234, 0, 0, 1, 1, 0);', ); page.deleteRow(0); @@ -235,9 +235,9 @@ describe('CreatureTemplateModel integration tests', () => { page.expectFullQueryToContain( 'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234);\n' + 'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' + - '(1234, 0, 0, 1, 0, 0),\n' + + '(1234, 0, 0, 1, 1, 0),\n' + '(1234, 1, 1111, 222, 333, 0),\n' + - '(1234, 2, 0, 1, 0, 0);', + '(1234, 2, 0, 1, 1, 0);', ); page.removeNativeElement(); }); @@ -258,15 +258,15 @@ describe('CreatureTemplateModel integration tests', () => { page.expectDiffQueryToContain( 'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234) AND (`Idx` IN (1, 2, 28, 3));\n' + 'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' + - '(1234, 28, 0, 1, 0, 0),\n' + - '(1234, 3, 0, 1, 0, 0);', + '(1234, 28, 0, 1, 1, 0),\n' + + '(1234, 3, 0, 1, 1, 0);', ); page.expectFullQueryToContain( 'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234);\n' + 'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' + - '(1234, 0, 0, 1, 0, 0),\n' + - '(1234, 28, 0, 1, 0, 0),\n' + - '(1234, 3, 0, 1, 0, 0);', + '(1234, 0, 0, 1, 1, 0),\n' + + '(1234, 28, 0, 1, 1, 0),\n' + + '(1234, 3, 0, 1, 1, 0);', ); page.removeNativeElement(); }); diff --git a/libs/shared/acore-world-model/src/entities/creature-template-model.type.ts b/libs/shared/acore-world-model/src/entities/creature-template-model.type.ts index fd5e8bb21d0..b2a8b1f5bff 100644 --- a/libs/shared/acore-world-model/src/entities/creature-template-model.type.ts +++ b/libs/shared/acore-world-model/src/entities/creature-template-model.type.ts @@ -9,6 +9,6 @@ export class CreatureTemplateModel extends TableRow { Idx: number = 0; CreatureDisplayID: number = 0; DisplayScale: number = 1; - Probability: number = 0; + Probability: number = 1; VerifiedBuild: number = 0; }