diff --git a/src/app/helpers/npc.ts b/src/app/helpers/npc.ts index 604fa75..72f381c 100644 --- a/src/app/helpers/npc.ts +++ b/src/app/helpers/npc.ts @@ -62,6 +62,7 @@ export const defaultNPC: () => INPCDefinition = () => ({ messages: [''], sfx: { name: undefined as unknown as string, + radius: 6, maxChance: 0, }, }, @@ -69,6 +70,7 @@ export const defaultNPC: () => INPCDefinition = () => ({ messages: [''], sfx: { name: undefined as unknown as string, + radius: 6, maxChance: 0, }, }, @@ -76,6 +78,7 @@ export const defaultNPC: () => INPCDefinition = () => ({ messages: [], sfx: { name: undefined as unknown as string, + radius: 6, maxChance: 0, }, }, diff --git a/src/app/helpers/schemas/_helpers.ts b/src/app/helpers/schemas/_helpers.ts index 9a77067..2aa0f62 100644 --- a/src/app/helpers/schemas/_helpers.ts +++ b/src/app/helpers/schemas/_helpers.ts @@ -1,6 +1,7 @@ import { difference, get, isNumber, isString, isUndefined } from 'lodash'; import { Allegiance, + DamageClass, HasIdentification, ItemSlot, QuestRewardType, @@ -127,6 +128,11 @@ export function isStat(val: any): boolean { return Object.values(Stat).includes(val); } +export function isDamageType(val: any): boolean { + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + return Object.values(DamageClass).includes(val); +} + export function isAllegiance(val: any): boolean { // eslint-disable-next-line @typescript-eslint/no-unsafe-argument return Object.values(Allegiance).includes(val); @@ -159,11 +165,14 @@ export function isRandomTraitObject(val: any): boolean { } export function isNPCEffect(val: any): boolean { - return ( - val.endsAt === -1 && + return val.endsAt === -1 && isString(val.name) && - isObjectWithSome(['potency', 'damageType', 'enrageTimer'])(val.extra) - ); + isObjectWithSome(['potency', 'damageType', 'enrageTimer'])(val.extra) && + val.extra + ? isNumber(val.extra?.potency) && + isDamageType(val.extra?.damageType) && + isNumber(val.extra?.enrageTimer) + : true; } export function isQuestReward(val: any): boolean { diff --git a/src/app/helpers/schemas/npc.ts b/src/app/helpers/schemas/npc.ts index 35f4ddc..dd72cf5 100644 --- a/src/app/helpers/schemas/npc.ts +++ b/src/app/helpers/schemas/npc.ts @@ -42,6 +42,7 @@ const triggerValidators: SchemaProperty[] = ['leash', 'spawn', 'combat'] isObjectWithFailure(['name', 'maxChance']), ], [`triggers.${triggerType}.sfx.name`, false, isString], + [`triggers.${triggerType}.sfx.radius`, false, isNumber], [`triggers.${triggerType}.sfx.maxChance`, false, isNumber], ]) .flat() as SchemaProperty[]; @@ -74,7 +75,12 @@ export const npcSchema: Schema = [ ['dropPool', false, isDropPool], ['drops', false, isArrayOf(isRollable)], ['forceAI', false, isString], - ['items', false, isObjectWith(['equipment', 'sack', 'belt'])], + [ + 'items', + false, + isObjectWithSome(['equipment', 'sack', 'belt']), + isObjectWithSomeFailure(['equipment', 'sack', 'belt']), + ], [ 'items.equipment', false, diff --git a/src/app/helpers/schemas/quest.ts b/src/app/helpers/schemas/quest.ts index 57fd401..ebd5cb9 100644 --- a/src/app/helpers/schemas/quest.ts +++ b/src/app/helpers/schemas/quest.ts @@ -3,7 +3,6 @@ import { Schema } from '../../../interfaces'; import { isArrayOf, isItemSlot, - isObjectWith, isObjectWithSome, isObjectWithSomeFailure, isQuestReward, @@ -32,7 +31,14 @@ export const questSchema: Schema = [ [ 'messages', false, - isObjectWith([ + isObjectWithSome([ + 'kill', + 'complete', + 'incomplete', + 'alreadyHas', + 'permComplete', + ]), + isObjectWithSomeFailure([ 'kill', 'complete', 'incomplete', diff --git a/src/app/helpers/schemas/recipe.ts b/src/app/helpers/schemas/recipe.ts index e29b703..afb6ef8 100644 --- a/src/app/helpers/schemas/recipe.ts +++ b/src/app/helpers/schemas/recipe.ts @@ -24,8 +24,8 @@ export const recipeSchema: Schema = [ [ 'ozIngredients', false, - isArrayOfAtMostLength(2), - () => 'ozIngredients must not have more than 2 elements', + isArrayOfAtMostLength(4), + () => 'ozIngredients must not have more than 4 elements', ], ['potencyScalar', false, isNumber], ['requireClass', false, isArrayOf(isString)], diff --git a/src/app/helpers/schemas/spawner.ts b/src/app/helpers/schemas/spawner.ts index b9564b3..5125f08 100644 --- a/src/app/helpers/schemas/spawner.ts +++ b/src/app/helpers/schemas/spawner.ts @@ -17,6 +17,7 @@ export const spawnerSchema: Schema = [ ['shouldSerialize', false, isBoolean], ['alwaysSpawn', false, isBoolean], ['requireHoliday', false, isString], + ['requireEvent', false, isString], ['requireDeadToRespawn', false, isBoolean], ['canSlowDown', false, isBoolean], @@ -32,6 +33,9 @@ export const spawnerSchema: Schema = [ ['eliteTickCap', false, isNumber], ['npcAISettings', false, isArrayOf(isString)], + ['maxSpawn', false, isNumber], + ['shouldBeActive', false, isBoolean], + ['respectKnowledge', false, isBoolean], ['isDangerous', false, isBoolean], ]; diff --git a/src/app/helpers/spawner.ts b/src/app/helpers/spawner.ts index a512ccf..5681bfe 100644 --- a/src/app/helpers/spawner.ts +++ b/src/app/helpers/spawner.ts @@ -28,6 +28,9 @@ export const defaultSpawner: () => ISpawnerData = () => ({ stripOnSpawner: false, respectKnowledge: true, attributeAddChance: 0, + shouldBeActive: false, + requireEvent: '', + maxSpawn: undefined, requireHoliday: undefined as unknown as string, _paths: '', }); diff --git a/src/app/tabs/npcs/npcs-editor/npcs-editor.component.html b/src/app/tabs/npcs/npcs-editor/npcs-editor.component.html index 45dd59f..fdf7243 100644 --- a/src/app/tabs/npcs/npcs-editor/npcs-editor.component.html +++ b/src/app/tabs/npcs/npcs-editor/npcs-editor.component.html @@ -620,6 +620,12 @@ + +
+ Spawn SFX Radius + +
@@ -638,6 +644,12 @@
+ +
+ Leash SFX Radius + +
diff --git a/src/app/tabs/npcs/npcs-editor/npcs-editor.component.ts b/src/app/tabs/npcs/npcs-editor/npcs-editor.component.ts index 1e3d31c..4185631 100644 --- a/src/app/tabs/npcs/npcs-editor/npcs-editor.component.ts +++ b/src/app/tabs/npcs/npcs-editor/npcs-editor.component.ts @@ -147,6 +147,7 @@ export class NpcsEditorComponent messages: [''], sfx: { name: undefined as unknown as string, + radius: 6, maxChance: 0, }, }; @@ -155,6 +156,7 @@ export class NpcsEditorComponent npc.triggers[triggerType].sfx ??= { name: undefined as unknown as string, + radius: 6, maxChance: 0, }; diff --git a/src/app/tabs/recipes/recipes-editor/recipes-editor.component.ts b/src/app/tabs/recipes/recipes-editor/recipes-editor.component.ts index 9416cf3..c17889f 100644 --- a/src/app/tabs/recipes/recipes-editor/recipes-editor.component.ts +++ b/src/app/tabs/recipes/recipes-editor/recipes-editor.component.ts @@ -63,6 +63,8 @@ export class RecipesEditorComponent item.ozIngredients ??= []; item.ozIngredients[0] ??= { filter: '', display: '', ounces: 0 }; item.ozIngredients[1] ??= { filter: '', display: '', ounces: 0 }; + item.ozIngredients[2] ??= { filter: '', display: '', ounces: 0 }; + item.ozIngredients[3] ??= { filter: '', display: '', ounces: 0 }; } private assignProps(item: IRecipe) { diff --git a/src/app/tabs/spawners/spawners-editor/spawners-editor.component.html b/src/app/tabs/spawners/spawners-editor/spawners-editor.component.html index ea348b5..33742c3 100644 --- a/src/app/tabs/spawners/spawners-editor/spawners-editor.component.html +++ b/src/app/tabs/spawners/spawners-editor/spawners-editor.component.html @@ -72,10 +72,29 @@ class="form-input" /> + +
+
+ Max Monsters Total + +
+
- +
+
+ Required Event + +
+
+
+
+ +
+
@@ -121,6 +140,14 @@
+
+ +
+
AI Settings