Skip to content

Commit 777010f

Browse files
authored
fix: ac compatibility (#3716)
1 parent 05b0334 commit 777010f

File tree

4 files changed

+28
-58
lines changed

4 files changed

+28
-58
lines changed

libs/features/creature/src/creature-template/creature-template.component.html

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -133,29 +133,10 @@
133133
<keira-boolean-option-selector [control]="editorService.form.controls.RegenHealth" id="RegenHealth" />
134134
</div>
135135
<div class="form-group col-12 col-sm-6 col-md-4 col-lg-3 col-xl-2">
136-
<label class="control-label" for="mechanic_immune_mask">mechanic_I_M</label>
137-
<keira-flags-selector-btn
138-
[control]="editorService.form.controls.mechanic_immune_mask"
139-
[disabled]="editorService.form.controls.mechanic_immune_mask.disabled"
140-
[config]="{ flags: MECHANIC_IMMUNE_MASK, name: 'mechanic_immune_mask' }"
141-
/>
142-
<input
143-
[formControlName]="'mechanic_immune_mask'"
144-
id="mechanic_immune_mask"
145-
type="number"
146-
class="form-control form-control-sm"
147-
/>
148-
</div>
149-
<div class="form-group col-12 col-sm-6 col-md-4 col-lg-3 col-xl-2">
150-
<label class="control-label" for="spell_school_immune_mask">spell_school_I_M</label>
151-
<keira-flags-selector-btn
152-
[control]="editorService.form.controls.spell_school_immune_mask"
153-
[disabled]="editorService.form.controls.spell_school_immune_mask.disabled"
154-
[config]="{ flags: SPELL_SCHOOL_IMMUNE_MASK, name: 'spell_school_immune_mask' }"
155-
/>
136+
<label class="control-label" for="CreatureImmunitiesId">CreatureImmunitiesId</label>
156137
<input
157-
[formControlName]="'spell_school_immune_mask'"
158-
id="spell_school_immune_mask"
138+
[formControlName]="'CreatureImmunitiesId'"
139+
id="CreatureImmunitiesId"
159140
type="number"
160141
class="form-control form-control-sm"
161142
/>
@@ -370,11 +351,6 @@
370351
<div class="content-block">
371352
<span class="category-title" [translate]="'CREATURE.TEMPLATE.MODIFIERS'"></span>
372353
<div class="row">
373-
<div class="form-group col-12 col-sm-6 col-md-4 col-lg-3 col-xl-2">
374-
<label class="control-label" for="scale">scale</label>
375-
<i class="fas fa-info-circle ms-1" placement="auto" [tooltip]="'CREATURE.TEMPLATE.SCALE' | translate"></i>
376-
<input [formControlName]="'scale'" id="scale" type="number" class="form-control form-control-sm" />
377-
</div>
378354
<div class="form-group col-12 col-sm-6 col-md-4 col-lg-3 col-xl-2">
379355
<label class="control-label" for="DamageModifier">DamageModifier</label>
380356
<i class="fas fa-info-circle ms-1" placement="auto" [tooltip]="'CREATURE.TEMPLATE.DAMAGE_MODIFIER' | translate"></i>

libs/features/creature/src/creature-template/creature-template.component.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ import {
1313
DYNAMIC_FLAGS,
1414
EXPANSION,
1515
FLAGS_EXTRA,
16-
MECHANIC_IMMUNE_MASK,
1716
MOVEMENT_TYPE,
1817
NPC_FLAGS,
1918
RANK,
20-
SPELL_SCHOOL_MASK,
2119
UNIT_CLASS,
2220
UNIT_FLAGS,
2321
UNIT_FLAGS_2,
@@ -69,8 +67,6 @@ export class CreatureTemplateComponent extends SingleRowEditorComponent<Creature
6967
protected readonly CREATURE_RACE = CREATURE_RACE;
7068
protected readonly MOVEMENT_TYPE = MOVEMENT_TYPE;
7169
protected readonly FLAGS_EXTRA = FLAGS_EXTRA;
72-
protected readonly MECHANIC_IMMUNE_MASK = MECHANIC_IMMUNE_MASK;
73-
protected readonly SPELL_SCHOOL_IMMUNE_MASK = SPELL_SCHOOL_MASK;
7470
protected readonly CREATURE_ICON = CREATURE_ICON;
7571
protected readonly EXPANSION = EXPANSION;
7672
protected readonly UNIT_CLASS = UNIT_CLASS;

libs/features/creature/src/creature-template/creature-template.integration.spec.ts

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ describe('CreatureTemplate integration tests', () => {
2525
'INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, ' +
2626
'`KillCredit1`, `KillCredit2`, `name`, `subname`, ' +
2727
'`IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `speed_swim`, `speed_flight`, `detection_range`, ' +
28-
'`scale`, `rank`, `dmgschool`, `DamageModifier`, `BaseAttackTime`, `RangeAttackTime`, `BaseVariance`, `RangeVariance`, ' +
28+
'`rank`, `dmgschool`, `DamageModifier`, `BaseAttackTime`, `RangeAttackTime`, `BaseVariance`, `RangeVariance`, ' +
2929
'`unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, ' +
3030
'`type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `PetSpellDataId`, `VehicleId`, `mingold`, ' +
3131
'`maxgold`, `AIName`, `MovementType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `ExperienceModifier`, ' +
32-
'`RacialLeader`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `spell_school_immune_mask`, ' +
32+
'`RacialLeader`, `movementId`, `RegenHealth`, `CreatureImmunitiesId`, ' +
3333
'`flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES\n' +
34-
"(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, " +
35-
"0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, '', 0);\n";
34+
"(1234, 0, 0, 0, 0, 0, '', '', '', 0, 1, 1, 0, 0, 0, 1, 1.14286, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, " +
35+
"0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, '', 0);\n";
3636

3737
const originalEntity = new CreatureTemplate();
3838
originalEntity.entry = id;
@@ -85,14 +85,14 @@ describe('CreatureTemplate integration tests', () => {
8585
'INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, ' +
8686
'`KillCredit1`, `KillCredit2`, `name`, `subname`, `IconName`, ' +
8787
'`gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `speed_swim`, `speed_flight`, `detection_range`, ' +
88-
'`scale`, `rank`, `dmgschool`, `DamageModifier`, `BaseAttackTime`, `RangeAttackTime`, `BaseVariance`, ' +
88+
'`rank`, `dmgschool`, `DamageModifier`, `BaseAttackTime`, `RangeAttackTime`, `BaseVariance`, ' +
8989
'`RangeVariance`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, ' +
9090
'`type`, `type_flags`, ' +
9191
'`lootid`, `pickpocketloot`, `skinloot`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, ' +
9292
'`AIName`, `MovementType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `ExperienceModifier`, `RacialLeader`, ' +
93-
'`movementId`, `RegenHealth`, `mechanic_immune_mask`, `spell_school_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES\n' +
94-
"(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," +
95-
" 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, '', 0);";
93+
'`movementId`, `RegenHealth`, `CreatureImmunitiesId`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES\n' +
94+
"(1234, 0, 0, 0, 0, 0, 'Shin', '', '', 0, 1, 1, 0, 0, 0, 1, 1.14286, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0," +
95+
" 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, '', 0);";
9696

9797
querySpy.calls.reset();
9898

@@ -133,29 +133,29 @@ describe('CreatureTemplate integration tests', () => {
133133

134134
// selectors
135135
await page.setNgxSelectValueByIndex('IconName', 1);
136-
values[15] = 1; // exp
137-
values[24] = 1; // rank
138-
values[25] = 1; // dmgschool
136+
values[11] = 1; // exp
137+
values[19] = 1; // rank
138+
values[20] = 1; // dmgschool
139139
await page.setNgxSelectValueByIndex('unit_class', 1);
140-
values[35] = 1; // family
141-
values[36] = 1; // type
142-
values[46] = 2; // MovementType
143-
values[52] = 1; // RacialLeader
144-
values[54] = 0; // RegenHealth
140+
values[30] = 1; // family
141+
values[31] = 1; // type
142+
values[41] = 2; // MovementType
143+
values[47] = 1; // RacialLeader
144+
values[49] = 0; // RegenHealth
145145

146146
const expectedQuery =
147147
'UPDATE `creature_template` ' +
148148
'SET `difficulty_entry_2` = 1, `difficulty_entry_3` = 2, `KillCredit1` = 3, `KillCredit2` = 4,' +
149149
" `name` = '5', `subname` = '6', `IconName` = 'Directions', `gossip_menu_id` = 8, `minlevel` = 9, `maxlevel` = 10, " +
150150
'`faction` = 12, `npcflag` = 13, `speed_walk` = 14, `speed_run` = 15, `speed_swim` = 16, ' +
151-
'`speed_flight` = 17, `detection_range` = 18, `scale` = 19, `DamageModifier` = 22, ' +
152-
'`BaseAttackTime` = 23, `RangeAttackTime` = 24, `BaseVariance` = 25, `RangeVariance` = 26, `unit_class` = 2, ' +
153-
'`unit_flags` = 28, `unit_flags2` = 29, `dynamicflags` = 30, ' +
154-
'`type_flags` = 33, `lootid` = 34, `pickpocketloot` = 35, `skinloot` = 36,' +
155-
" `PetSpellDataId` = 37, `VehicleId` = 38, `mingold` = 39, `maxgold` = 40, `AIName` = '41', " +
156-
'`HoverHeight` = 43, `HealthModifier` = 44, `ManaModifier` = 45, `ArmorModifier` = 46, ' +
157-
'`ExperienceModifier` = 47, `movementId` = 49, `mechanic_immune_mask` = 51, ' +
158-
"`spell_school_immune_mask` = 52, `flags_extra` = 53, `ScriptName` = '54' WHERE (`entry` = 1234);";
151+
'`speed_flight` = 17, `detection_range` = 18, `DamageModifier` = 21, ' +
152+
'`BaseAttackTime` = 22, `RangeAttackTime` = 23, `BaseVariance` = 24, `RangeVariance` = 25, `unit_class` = 2, ' +
153+
'`unit_flags` = 27, `unit_flags2` = 28, `dynamicflags` = 29, ' +
154+
'`type_flags` = 32, `lootid` = 33, `pickpocketloot` = 34, `skinloot` = 35,' +
155+
" `PetSpellDataId` = 36, `VehicleId` = 37, `mingold` = 38, `maxgold` = 39, `AIName` = '40', " +
156+
'`HoverHeight` = 42, `HealthModifier` = 43, `ManaModifier` = 44, `ArmorModifier` = 45, ' +
157+
'`ExperienceModifier` = 46, `movementId` = 48, `CreatureImmunitiesId` = 50, ' +
158+
"`flags_extra` = 51, `ScriptName` = '52' WHERE (`entry` = 1234);";
159159

160160
querySpy.calls.reset();
161161

libs/shared/acore-world-model/src/entities/creature-template.type.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export class CreatureTemplate extends TableRow {
3131
speed_swim: number = 1;
3232
speed_flight: number = 1;
3333
detection_range: number = 1;
34-
scale: number = 1;
3534
rank: number = 0;
3635
dmgschool: number = 0;
3736
DamageModifier: number = 1;
@@ -63,8 +62,7 @@ export class CreatureTemplate extends TableRow {
6362
RacialLeader: number = 0;
6463
movementId: number = 0;
6564
RegenHealth: number = 1;
66-
mechanic_immune_mask: number = 0;
67-
spell_school_immune_mask: number = 0;
65+
CreatureImmunitiesId: number = 0;
6866
flags_extra: number = 0;
6967
ScriptName: string = '';
7068
VerifiedBuild: number = 0;

0 commit comments

Comments
 (0)