azeroth-shell 0.0.0-stage → 0.1.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 +138 -2
- package/bin/azsh.mjs +19 -0
- package/docs/aifid/eventai-texts.json +4414 -0
- package/docs/dungeons/atlas/atlas-rows-dungeons.json +8989 -0
- package/docs/dungeons/survey/pack-id-migration.json +2418 -0
- package/package.json +26 -4
- package/src/autopilot/bossSkip.ts +26 -0
- package/src/autopilot/combatRotation.ts +824 -0
- package/src/autopilot/config.ts +533 -0
- package/src/autopilot/consumables.ts +58 -0
- package/src/autopilot/encounterStand.ts +121 -0
- package/src/autopilot/objectGatePlan.ts +53 -0
- package/src/autopilot/pathEngage.ts +229 -0
- package/src/autopilot/plan.ts +1643 -0
- package/src/autopilot/questPolicy.ts +274 -0
- package/src/autopilot/routeStep.ts +69 -0
- package/src/autopilot/sessionReport.ts +88 -0
- package/src/autopilot/topOffPower.ts +26 -0
- package/src/autopilot/view.ts +476 -0
- package/src/cli/bootCheck.mjs +34 -0
- package/src/cli/bootData.mjs +57 -0
- package/src/cli/combatLogFilter.ts +153 -0
- package/src/cli/combatLogFormat.ts +613 -0
- package/src/cli/fileRepository.mjs +105 -0
- package/src/cli/gzLoader.mjs +31 -0
- package/src/cli/liveGauntletEscort.ts +978 -0
- package/src/cli/liveStratUndead.ts +305 -0
- package/src/cli/macroHostCombat.ts +545 -0
- package/src/cli/macroHostWorld.ts +330 -0
- package/src/cli/prefs.mjs +31 -0
- package/src/cli/register.mjs +4 -0
- package/src/cli/repl.mjs +693 -0
- package/src/cli/rotationText.mjs +226 -0
- package/src/cli/squad.mjs +105 -0
- package/src/cli/term.mjs +126 -0
- package/src/cli/text.mjs +122 -0
- package/src/cli/tui.mjs +626 -0
- package/src/cli/tuiArena.mjs +109 -0
- package/src/cli/tuiAutopilotSettings.mjs +93 -0
- package/src/cli/tuiBags.mjs +180 -0
- package/src/cli/tuiBars.mjs +133 -0
- package/src/cli/tuiBg.mjs +243 -0
- package/src/cli/tuiBulk.mjs +162 -0
- package/src/cli/tuiCheck.mjs +1882 -0
- package/src/cli/tuiCity.mjs +396 -0
- package/src/cli/tuiCompanionKit.mjs +300 -0
- package/src/cli/tuiCompanions.mjs +471 -0
- package/src/cli/tuiDev.mjs +62 -0
- package/src/cli/tuiDungeon.mjs +606 -0
- package/src/cli/tuiEnchantTarget.mjs +120 -0
- package/src/cli/tuiFight.mjs +577 -0
- package/src/cli/tuiFightPanes.mjs +228 -0
- package/src/cli/tuiFloor.mjs +506 -0
- package/src/cli/tuiGear.mjs +158 -0
- package/src/cli/tuiHonor.mjs +74 -0
- package/src/cli/tuiLoot.mjs +97 -0
- package/src/cli/tuiMacros.mjs +144 -0
- package/src/cli/tuiOutfitter.mjs +115 -0
- package/src/cli/tuiPet.mjs +116 -0
- package/src/cli/tuiProfessions.mjs +800 -0
- package/src/cli/tuiRaid.mjs +127 -0
- package/src/cli/tuiRep.mjs +65 -0
- package/src/cli/tuiSaves.mjs +69 -0
- package/src/cli/tuiSearch.mjs +363 -0
- package/src/cli/tuiSettings.mjs +151 -0
- package/src/cli/tuiSimLab.mjs +80 -0
- package/src/cli/tuiTalents.mjs +60 -0
- package/src/cli/tuiViews.mjs +1178 -0
- package/src/cli/tuiWiki.mjs +181 -0
- package/src/cli/tuiWorld.mjs +361 -0
- package/src/cli/wikiIndex.ts +259 -0
- package/src/cli/wikiSources.ts +355 -0
- package/src/data/alteracValley.ts +176 -0
- package/src/data/appearanceOptions.ts +534 -0
- package/src/data/applyLootChanceSanity.ts +21 -0
- package/src/data/createFlavor.ts +96 -0
- package/src/data/customItems.ts +33 -0
- package/src/data/dataStore.ts +1904 -0
- package/src/data/dungeonGameObjects.ts +84 -0
- package/src/data/dungeonPlateCover.ts +66 -0
- package/src/data/dungeonSpawns.ts +294 -0
- package/src/data/dungeons/alterac-valley.ts +135 -0
- package/src/data/dungeons/apply-dungeon-rooms.ts +29 -0
- package/src/data/dungeons/apply-encounter-outdoors.ts +72 -0
- package/src/data/dungeons/apply-instance-geometry.ts +65 -0
- package/src/data/dungeons/apply-spawn-placement.ts +171 -0
- package/src/data/dungeons/blackfathom-deeps.ts +539 -0
- package/src/data/dungeons/blackrock-depths.ts +1410 -0
- package/src/data/dungeons/blackwing-lair.ts +129 -0
- package/src/data/dungeons/boss-eventai.ts +8 -0
- package/src/data/dungeons/deadmines.ts +410 -0
- package/src/data/dungeons/dire-maul-east.ts +980 -0
- package/src/data/dungeons/dire-maul-north.ts +661 -0
- package/src/data/dungeons/dire-maul-west.ts +785 -0
- package/src/data/dungeons/dungeon-rooms.json +5479 -0
- package/src/data/dungeons/encounter-outdoors.json +359 -0
- package/src/data/dungeons/eventai/blackfathom-deeps.ts +308 -0
- package/src/data/dungeons/eventai/blackrock-depths.ts +1257 -0
- package/src/data/dungeons/eventai/deadmines.ts +264 -0
- package/src/data/dungeons/eventai/dire-maul-east.ts +320 -0
- package/src/data/dungeons/eventai/gnomeregan.ts +213 -0
- package/src/data/dungeons/eventai/helpers.ts +79 -0
- package/src/data/dungeons/eventai/index.ts +133 -0
- package/src/data/dungeons/eventai/lbrs.ts +372 -0
- package/src/data/dungeons/eventai/maraudon.ts +323 -0
- package/src/data/dungeons/eventai/ragefire-chasm.ts +108 -0
- package/src/data/dungeons/eventai/razorfen-downs.ts +207 -0
- package/src/data/dungeons/eventai/razorfen-kraul.ts +326 -0
- package/src/data/dungeons/eventai/scholomance.ts +680 -0
- package/src/data/dungeons/eventai/shadowfang-keep.ts +230 -0
- package/src/data/dungeons/eventai/sm-cathedral.ts +75 -0
- package/src/data/dungeons/eventai/sm-graveyard.ts +150 -0
- package/src/data/dungeons/eventai/sm-library.ts +55 -0
- package/src/data/dungeons/eventai/stratholme-undead.ts +127 -0
- package/src/data/dungeons/eventai/sunken-temple.ts +582 -0
- package/src/data/dungeons/eventai/the-stockade.ts +228 -0
- package/src/data/dungeons/eventai/ubrs.ts +225 -0
- package/src/data/dungeons/eventai/uldaman.ts +355 -0
- package/src/data/dungeons/eventai/wailing-caverns.ts +396 -0
- package/src/data/dungeons/eventai/zul-farrak.ts +591 -0
- package/src/data/dungeons/gnomeregan.ts +909 -0
- package/src/data/dungeons/index.ts +126 -0
- package/src/data/dungeons/instance-geometry.json +5233 -0
- package/src/data/dungeons/key-sources.json +169 -0
- package/src/data/dungeons/lbrs.ts +996 -0
- package/src/data/dungeons/maraudon.ts +786 -0
- package/src/data/dungeons/molten-core.ts +194 -0
- package/src/data/dungeons/naxxramas.ts +173 -0
- package/src/data/dungeons/onyxias-lair.ts +71 -0
- package/src/data/dungeons/pack-from-clusters.ts +1256 -0
- package/src/data/dungeons/ragefire-chasm.ts +238 -0
- package/src/data/dungeons/razorfen-downs.ts +698 -0
- package/src/data/dungeons/razorfen-kraul.ts +766 -0
- package/src/data/dungeons/ruins-of-ahnqiraj.ts +121 -0
- package/src/data/dungeons/scholomance.ts +1076 -0
- package/src/data/dungeons/shadowfang-keep.ts +740 -0
- package/src/data/dungeons/sm-armory.ts +266 -0
- package/src/data/dungeons/sm-cathedral.ts +430 -0
- package/src/data/dungeons/sm-graveyard.ts +482 -0
- package/src/data/dungeons/sm-library.ts +337 -0
- package/src/data/dungeons/stratholme-live.ts +808 -0
- package/src/data/dungeons/stratholme-undead.ts +1164 -0
- package/src/data/dungeons/sunken-temple.ts +931 -0
- package/src/data/dungeons/temple-of-ahnqiraj.ts +119 -0
- package/src/data/dungeons/the-stockade.ts +282 -0
- package/src/data/dungeons/ubrs.ts +1286 -0
- package/src/data/dungeons/uldaman.ts +685 -0
- package/src/data/dungeons/wailing-caverns.ts +356 -0
- package/src/data/dungeons/zul-farrak.ts +686 -0
- package/src/data/dungeons/zul-gurub.ts +142 -0
- package/src/data/dungeons.ts +42 -0
- package/src/data/fixtures.ts +446 -0
- package/src/data/gameobject-data.json.gz +0 -0
- package/src/data/item-data.json.gz +0 -0
- package/src/data/loot-data.json.gz +0 -0
- package/src/data/maps/atlas-approach-maps.json +1425 -0
- package/src/data/maps/atlas-landmarks.json +1711 -0
- package/src/data/maps/dungeon-viewports.json +392 -0
- package/src/data/materializeModDamagePercentTaken.ts +70 -0
- package/src/data/materializeModHealthRegen.ts +89 -0
- package/src/data/materializeSpellReputation.ts +26 -0
- package/src/data/pageTexts.ts +19 -0
- package/src/data/profession-data.json.gz +0 -0
- package/src/data/raid-plans/blackfathom-deeps.json +86 -0
- package/src/data/raid-plans/blackrock-depths.json +419 -0
- package/src/data/raid-plans/blackwing-lair.json +328 -0
- package/src/data/raid-plans/deadmines.json +55 -0
- package/src/data/raid-plans/dire-maul-east.json +94 -0
- package/src/data/raid-plans/dire-maul-north.json +70 -0
- package/src/data/raid-plans/dire-maul-west.json +75 -0
- package/src/data/raid-plans/gnomeregan.json +131 -0
- package/src/data/raid-plans/lbrs.json +176 -0
- package/src/data/raid-plans/maraudon.json +102 -0
- package/src/data/raid-plans/molten-core.json +169 -0
- package/src/data/raid-plans/naxxramas.json +354 -0
- package/src/data/raid-plans/onyxias-lair.json +18 -0
- package/src/data/raid-plans/ragefire-chasm.json +30 -0
- package/src/data/raid-plans/razorfen-downs.json +75 -0
- package/src/data/raid-plans/razorfen-kraul.json +53 -0
- package/src/data/raid-plans/ruins-of-ahnqiraj.json +110 -0
- package/src/data/raid-plans/scholomance.json +170 -0
- package/src/data/raid-plans/shadowfang-keep.json +87 -0
- package/src/data/raid-plans/sm-armory.json +53 -0
- package/src/data/raid-plans/sm-cathedral.json +72 -0
- package/src/data/raid-plans/sm-graveyard.json +63 -0
- package/src/data/raid-plans/sm-library.json +23 -0
- package/src/data/raid-plans/stratholme-live.json +129 -0
- package/src/data/raid-plans/stratholme-undead.json +73 -0
- package/src/data/raid-plans/sunken-temple.json +159 -0
- package/src/data/raid-plans/temple-of-ahnqiraj.json +163 -0
- package/src/data/raid-plans/the-stockade.json +42 -0
- package/src/data/raid-plans/ubrs.json +53 -0
- package/src/data/raid-plans/uldaman.json +131 -0
- package/src/data/raid-plans/wailing-caverns.json +90 -0
- package/src/data/raid-plans/zul-farrak.json +156 -0
- package/src/data/raid-plans/zul-gurub.json +307 -0
- package/src/data/raidInstanceCreatures.mjs +473 -0
- package/src/data/rotations/index.ts +152 -0
- package/src/data/rotations/layout.mjs +72 -0
- package/src/data/rotations/pve/druid/balance.json +754 -0
- package/src/data/rotations/pve/druid/feral-tank.json +2448 -0
- package/src/data/rotations/pve/druid/feral.json +2660 -0
- package/src/data/rotations/pve/druid/restoration.json +424 -0
- package/src/data/rotations/pve/hunter/beast-mastery.json +1288 -0
- package/src/data/rotations/pve/hunter/marksmanship.json +1260 -0
- package/src/data/rotations/pve/hunter/survival.json +1373 -0
- package/src/data/rotations/pve/mage/arcane-leveling.json +1798 -0
- package/src/data/rotations/pve/mage/fire-leveling.json +2003 -0
- package/src/data/rotations/pve/mage/frost-leveling.json +1912 -0
- package/src/data/rotations/pve/paladin/holy.json +755 -0
- package/src/data/rotations/pve/paladin/protection.json +962 -0
- package/src/data/rotations/pve/paladin/retribution.json +924 -0
- package/src/data/rotations/pve/priest/discipline.json +772 -0
- package/src/data/rotations/pve/priest/holy.json +707 -0
- package/src/data/rotations/pve/priest/shadow.json +787 -0
- package/src/data/rotations/pve/rogue/assassination.json +2477 -0
- package/src/data/rotations/pve/rogue/combat.json +2483 -0
- package/src/data/rotations/pve/rogue/subtlety.json +2523 -0
- package/src/data/rotations/pve/shaman/elemental.json +1157 -0
- package/src/data/rotations/pve/shaman/enhancement.json +1085 -0
- package/src/data/rotations/pve/shaman/restoration.json +592 -0
- package/src/data/rotations/pve/warlock/affliction.json +1185 -0
- package/src/data/rotations/pve/warlock/demonology.json +1165 -0
- package/src/data/rotations/pve/warlock/destruction.json +1177 -0
- package/src/data/rotations/pve/warrior/arms.json +3020 -0
- package/src/data/rotations/pve/warrior/fury.json +2996 -0
- package/src/data/rotations/pve/warrior/protection.json +2509 -0
- package/src/data/rotations/pvp/druid/balance.json +593 -0
- package/src/data/rotations/pvp/druid/feral.json +3276 -0
- package/src/data/rotations/pvp/druid/restoration.json +662 -0
- package/src/data/rotations/pvp/hunter/beast-mastery.json +665 -0
- package/src/data/rotations/pvp/hunter/marksmanship.json +2406 -0
- package/src/data/rotations/pvp/hunter/survival.json +635 -0
- package/src/data/rotations/pvp/mage/arcane.json +574 -0
- package/src/data/rotations/pvp/mage/fire.json +570 -0
- package/src/data/rotations/pvp/mage/frost.json +4048 -0
- package/src/data/rotations/pvp/paladin/holy.json +1498 -0
- package/src/data/rotations/pvp/paladin/protection.json +567 -0
- package/src/data/rotations/pvp/paladin/retribution.json +1110 -0
- package/src/data/rotations/pvp/priest/discipline.json +1848 -0
- package/src/data/rotations/pvp/priest/holy.json +6340 -0
- package/src/data/rotations/pvp/priest/shadow.json +2329 -0
- package/src/data/rotations/pvp/rogue/assassination.json +1322 -0
- package/src/data/rotations/pvp/rogue/combat.json +5258 -0
- package/src/data/rotations/pvp/rogue/subtlety.json +586 -0
- package/src/data/rotations/pvp/shaman/elemental.json +1404 -0
- package/src/data/rotations/pvp/shaman/enhancement.json +1277 -0
- package/src/data/rotations/pvp/shaman/restoration.json +2490 -0
- package/src/data/rotations/pvp/warlock/affliction.json +1017 -0
- package/src/data/rotations/pvp/warlock/demonology.json +1503 -0
- package/src/data/rotations/pvp/warlock/destruction.json +638 -0
- package/src/data/rotations/pvp/warrior/arms.json +5665 -0
- package/src/data/rotations/pvp/warrior/fury.json +850 -0
- package/src/data/rotations/pvp/warrior/protection.json +777 -0
- package/src/data/schema/bundle.ts +511 -0
- package/src/data/schema/constants.ts +49 -0
- package/src/data/schema/creature.ts +454 -0
- package/src/data/schema/encounter.ts +155 -0
- package/src/data/schema/faction.ts +48 -0
- package/src/data/schema/item.ts +297 -0
- package/src/data/schema/itemEnchant.ts +105 -0
- package/src/data/schema/npc.ts +44 -0
- package/src/data/schema/primitives.ts +295 -0
- package/src/data/schema/profession.ts +226 -0
- package/src/data/schema/quest.ts +154 -0
- package/src/data/schema/spell.ts +1149 -0
- package/src/data/schema/talent.ts +74 -0
- package/src/data/schema/world.ts +124 -0
- package/src/data/schema.ts +19 -0
- package/src/data/skinNodeGapFill.ts +68 -0
- package/src/data/spell-data.json.gz +0 -0
- package/src/data/spell-script-targets.json +1 -0
- package/src/data/tables/ahItemValues.json.gz +0 -0
- package/src/data/tables/alteracValley.json.gz +0 -0
- package/src/data/tables/areatriggerTeleports.json.gz +0 -0
- package/src/data/tables/botNames.json.gz +0 -0
- package/src/data/tables/botPopulation.json.gz +0 -0
- package/src/data/tables/botSpecs.json.gz +0 -0
- package/src/data/tables/classLevelStats.json.gz +0 -0
- package/src/data/tables/combatConditions.json.gz +0 -0
- package/src/data/tables/combatSkillMeta.json.gz +0 -0
- package/src/data/tables/conditions.json.gz +0 -0
- package/src/data/tables/createInfo.json.gz +0 -0
- package/src/data/tables/creatureAggroGroups.json.gz +0 -0
- package/src/data/tables/creatureClassLevelStats.json.gz +0 -0
- package/src/data/tables/creaturePatrolPacks.json.gz +0 -0
- package/src/data/tables/creatureWeapons.json.gz +0 -0
- package/src/data/tables/creatures.json.gz +0 -0
- package/src/data/tables/dbScripts.json.gz +0 -0
- package/src/data/tables/dungeonAuthoredRoutes.json.gz +0 -0
- package/src/data/tables/dungeonCensus.json.gz +0 -0
- package/src/data/tables/dungeonGameObjects.json.gz +0 -0
- package/src/data/tables/dungeonPacks.json.gz +0 -0
- package/src/data/tables/dungeonPlateCover.json.gz +0 -0
- package/src/data/tables/dungeonSpawns.json.gz +0 -0
- package/src/data/tables/dungeonSurvey.json.gz +0 -0
- package/src/data/tables/durabilityCosts.json.gz +0 -0
- package/src/data/tables/durabilityQuality.json.gz +0 -0
- package/src/data/tables/enchantApplicators.json.gz +0 -0
- package/src/data/tables/entranceYards.json.gz +0 -0
- package/src/data/tables/explorationBasexp.json.gz +0 -0
- package/src/data/tables/factionTemplates.json.gz +0 -0
- package/src/data/tables/factions.json.gz +0 -0
- package/src/data/tables/gameEvents.json.gz +0 -0
- package/src/data/tables/gameObjects.json.gz +0 -0
- package/src/data/tables/gossipMenus.json.gz +0 -0
- package/src/data/tables/graveyards.json.gz +0 -0
- package/src/data/tables/instanceMaps.json.gz +0 -0
- package/src/data/tables/itemEnchantmentTemplates.json.gz +0 -0
- package/src/data/tables/itemEnchants.json.gz +0 -0
- package/src/data/tables/itemRandomProperties.json.gz +0 -0
- package/src/data/tables/itemSets.json.gz +0 -0
- package/src/data/tables/items.json.gz +0 -0
- package/src/data/tables/levelStats.json.gz +0 -0
- package/src/data/tables/locks.json.gz +0 -0
- package/src/data/tables/map-pin-overrides.json.gz +0 -0
- package/src/data/tables/nonCombatTrash.json.gz +0 -0
- package/src/data/tables/npcTexts.json.gz +0 -0
- package/src/data/tables/pageTexts.json.gz +0 -0
- package/src/data/tables/petAbilityTP.json.gz +0 -0
- package/src/data/tables/petGenericSpells.json.gz +0 -0
- package/src/data/tables/petLevelStats.json.gz +0 -0
- package/src/data/tables/playerbot-weightscales.json.gz +0 -0
- package/src/data/tables/pools.json.gz +0 -0
- package/src/data/tables/quests.json.gz +0 -0
- package/src/data/tables/races.json.gz +0 -0
- package/src/data/tables/reputationRanks.json.gz +0 -0
- package/src/data/tables/reputationRates.json.gz +0 -0
- package/src/data/tables/reputationSpillover.json.gz +0 -0
- package/src/data/tables/ridingSpells.json.gz +0 -0
- package/src/data/tables/scriptTexts.json.gz +0 -0
- package/src/data/tables/soundClipVolume.json.gz +0 -0
- package/src/data/tables/spellChain.json.gz +0 -0
- package/src/data/tables/spellTeleports.json.gz +0 -0
- package/src/data/tables/spells.json.gz +0 -0
- package/src/data/tables/talents.json.gz +0 -0
- package/src/data/tables/tavernTriggers.json.gz +0 -0
- package/src/data/tables/taxiNodes.json.gz +0 -0
- package/src/data/tables/taxiRoutes.json.gz +0 -0
- package/src/data/tables/trainers.json.gz +0 -0
- package/src/data/tables/transports.json.gz +0 -0
- package/src/data/tables/travelAnchors.json.gz +0 -0
- package/src/data/tables/travelEdges.json.gz +0 -0
- package/src/data/tables/unitConditions.json.gz +0 -0
- package/src/data/tables/vendors.json.gz +0 -0
- package/src/data/tables/weaponEnchantProcs.json.gz +0 -0
- package/src/data/tables/xp.json.gz +0 -0
- package/src/data/tables/zoneWeather.json.gz +0 -0
- package/src/data/tables/zones.json.gz +0 -0
- package/src/data/world-data.ts +56 -0
- package/src/data/zone-music-sets.json +2751 -0
- package/src/dev/etl/lib/loot-chance-sanity.mjs +180 -0
- package/src/domain/audioQuality.mjs +145 -0
- package/src/domain/bg/ab.ts +433 -0
- package/src/domain/bg/arenaComps.ts +644 -0
- package/src/domain/bg/arenaLab.ts +695 -0
- package/src/domain/bg/arenaPace.ts +31 -0
- package/src/domain/bg/arenaRating.ts +110 -0
- package/src/domain/bg/av.ts +758 -0
- package/src/domain/bg/avEnemyPush.ts +219 -0
- package/src/domain/bg/avField.ts +283 -0
- package/src/domain/bg/avInstanceNodes.ts +197 -0
- package/src/domain/bg/avInstanceScore.ts +123 -0
- package/src/domain/bg/avQuestItems.ts +55 -0
- package/src/domain/bg/avQuests.ts +210 -0
- package/src/domain/bg/avSession.ts +196 -0
- package/src/domain/bg/bgConsumes.ts +269 -0
- package/src/domain/bg/bgPrebuff.ts +153 -0
- package/src/domain/bg/bgRest.ts +91 -0
- package/src/domain/bg/bgRoster.ts +305 -0
- package/src/domain/bg/bgTier.ts +61 -0
- package/src/domain/bg/bgWorld.ts +862 -0
- package/src/domain/bg/match.ts +215 -0
- package/src/domain/bg/strategies.ts +552 -0
- package/src/domain/bg/types.ts +291 -0
- package/src/domain/bg/wsg.ts +264 -0
- package/src/domain/bots/actionProviderSpec.ts +38 -0
- package/src/domain/bots/autoConsumables.ts +285 -0
- package/src/domain/bots/betweenPullRest.ts +239 -0
- package/src/domain/bots/botGear.ts +248 -0
- package/src/domain/bots/botInventory.ts +486 -0
- package/src/domain/bots/botPet.ts +535 -0
- package/src/domain/bots/botPool.ts +291 -0
- package/src/domain/bots/botProfessions.ts +334 -0
- package/src/domain/bots/companionActionBar.ts +209 -0
- package/src/domain/bots/companionHireCost.ts +236 -0
- package/src/domain/bots/companionMissions.ts +582 -0
- package/src/domain/bots/companionPrep.ts +254 -0
- package/src/domain/bots/companionQuests.ts +270 -0
- package/src/domain/bots/companionRep.ts +75 -0
- package/src/domain/bots/companionRotation.ts +708 -0
- package/src/domain/bots/companionXp.ts +66 -0
- package/src/domain/bots/consumableShare.ts +811 -0
- package/src/domain/bots/dpsMate.ts +1072 -0
- package/src/domain/bots/groupCompReport.ts +132 -0
- package/src/domain/bots/healthstoneSupply.ts +198 -0
- package/src/domain/bots/outfitter.ts +1056 -0
- package/src/domain/bots/paladinPrePull.ts +231 -0
- package/src/domain/bots/partyRole.ts +40 -0
- package/src/domain/bots/playerbotEquipCache.ts +412 -0
- package/src/domain/bots/playerbotItemEligibility.ts +60 -0
- package/src/domain/bots/playerbotStatWeight.ts +853 -0
- package/src/domain/bots/playerbotUnavailableItems.ts +147 -0
- package/src/domain/bots/prePullBuffs.ts +219 -0
- package/src/domain/bots/prePullStealth.ts +82 -0
- package/src/domain/bots/runSupply.ts +251 -0
- package/src/domain/bots/runSupplyPrefs.ts +28 -0
- package/src/domain/bots/sendTradeGoods.ts +394 -0
- package/src/domain/bots/soulShardCap.ts +35 -0
- package/src/domain/bots/squad.ts +842 -0
- package/src/domain/bots/squadRun.ts +81 -0
- package/src/domain/character/actionbar.ts +346 -0
- package/src/domain/character/appearance.ts +165 -0
- package/src/domain/character/buildCombatant.ts +1726 -0
- package/src/domain/character/character.ts +356 -0
- package/src/domain/character/characterName.ts +43 -0
- package/src/domain/character/characterRatings.ts +424 -0
- package/src/domain/character/characterSpells.ts +282 -0
- package/src/domain/character/characterStats.ts +1559 -0
- package/src/domain/character/characterTalents.ts +398 -0
- package/src/domain/character/combatSkills.ts +994 -0
- package/src/domain/character/displayForm.ts +72 -0
- package/src/domain/character/formTalentAuras.ts +171 -0
- package/src/domain/character/forms.ts +499 -0
- package/src/domain/character/races.ts +40 -0
- package/src/domain/character/resurrectionSickness.ts +49 -0
- package/src/domain/character/spellbook.ts +169 -0
- package/src/domain/character/stanceBar.ts +354 -0
- package/src/domain/character/stancePrereq.ts +70 -0
- package/src/domain/character/talentBuilds.ts +63 -0
- package/src/domain/character/talentImport.ts +130 -0
- package/src/domain/character/talentLink.ts +123 -0
- package/src/domain/character/talents.ts +201 -0
- package/src/domain/core/conditionSnapshot.ts +92 -0
- package/src/domain/core/hover.ts +14 -0
- package/src/domain/core/ids.ts +58 -0
- package/src/domain/core/internalNameTags.ts +5 -0
- package/src/domain/core/runtimeDataPatches.ts +357 -0
- package/src/domain/creature/aiTargeting.ts +588 -0
- package/src/domain/creature/combatCondition.ts +157 -0
- package/src/domain/creature/creatureAggro.ts +804 -0
- package/src/domain/creature/creatureAi.ts +206 -0
- package/src/domain/creature/creatureAiConstants.ts +661 -0
- package/src/domain/creature/creatureCastList.ts +1007 -0
- package/src/domain/creature/creatureEventAi.ts +1409 -0
- package/src/domain/creature/creatureGroups.ts +144 -0
- package/src/domain/creature/creatureLinking.ts +333 -0
- package/src/domain/creature/creatureScaling.ts +320 -0
- package/src/domain/creature/creatureTrigger.ts +53 -0
- package/src/domain/creature/creatureWander.ts +74 -0
- package/src/domain/creature/eventAiTexts.ts +145 -0
- package/src/domain/creature/faction.ts +287 -0
- package/src/domain/creature/forcedReaction.ts +48 -0
- package/src/domain/creature/outdoorHuntable.ts +74 -0
- package/src/domain/creature/patrolPacks.ts +210 -0
- package/src/domain/creature/reputation.ts +967 -0
- package/src/domain/creature/unitFlags.ts +74 -0
- package/src/domain/creature/worldBosses.ts +393 -0
- package/src/domain/dungeonMusic.mjs +48 -0
- package/src/domain/economy/auction.ts +282 -0
- package/src/domain/economy/auctionBot.ts +1060 -0
- package/src/domain/economy/honorPrice.ts +100 -0
- package/src/domain/economy/mail.ts +958 -0
- package/src/domain/economy/money.ts +42 -0
- package/src/domain/economy/syntheticClassTrainers.ts +62 -0
- package/src/domain/economy/trading.ts +296 -0
- package/src/domain/economy/vendorSellAll.ts +252 -0
- package/src/domain/economy/vendorStock.ts +146 -0
- package/src/domain/items/ammo.ts +817 -0
- package/src/domain/items/bank.ts +162 -0
- package/src/domain/items/consumableFamily.ts +205 -0
- package/src/domain/items/craftUpgrades.ts +83 -0
- package/src/domain/items/createItem.ts +93 -0
- package/src/domain/items/durability.ts +581 -0
- package/src/domain/items/equipment.ts +441 -0
- package/src/domain/items/equipmentHelper.ts +767 -0
- package/src/domain/items/inventory.ts +561 -0
- package/src/domain/items/itemBonding.ts +93 -0
- package/src/domain/items/itemContainer.ts +245 -0
- package/src/domain/items/itemDisplayName.ts +33 -0
- package/src/domain/items/itemInstance.ts +181 -0
- package/src/domain/items/itemRandomEnchantOutcomes.ts +315 -0
- package/src/domain/items/itemRandomProps.ts +77 -0
- package/src/domain/items/itemRestrictions.ts +329 -0
- package/src/domain/items/itemTeaches.ts +82 -0
- package/src/domain/items/itemUseCooldown.ts +52 -0
- package/src/domain/items/itemUseTarget.ts +90 -0
- package/src/domain/items/junkCategories.ts +174 -0
- package/src/domain/items/junkFilter.ts +368 -0
- package/src/domain/items/keyring.ts +131 -0
- package/src/domain/items/loot.ts +221 -0
- package/src/domain/items/mounts.ts +190 -0
- package/src/domain/items/onUsePayload.ts +102 -0
- package/src/domain/items/pendingLoot.ts +107 -0
- package/src/domain/items/relic.ts +105 -0
- package/src/domain/items/rocketBoots.ts +36 -0
- package/src/domain/items/sortContainer.ts +139 -0
- package/src/domain/items/spareContainers.ts +71 -0
- package/src/domain/items/spellReagentIndex.ts +131 -0
- package/src/domain/items/staleConsumables.ts +66 -0
- package/src/domain/items/weaponSpender.ts +110 -0
- package/src/domain/listDungeonIds.mjs +28 -0
- package/src/domain/macro/compose.ts +239 -0
- package/src/domain/macro/conditions.ts +260 -0
- package/src/domain/macro/creatureTypes.ts +40 -0
- package/src/domain/macro/describe.ts +169 -0
- package/src/domain/macro/icon.ts +60 -0
- package/src/domain/macro/index.ts +20 -0
- package/src/domain/macro/normalize.ts +112 -0
- package/src/domain/macro/parse.ts +316 -0
- package/src/domain/macro/plan.ts +288 -0
- package/src/domain/macro/rotation.ts +590 -0
- package/src/domain/macro/rotationEnv.ts +173 -0
- package/src/domain/macro/slots.ts +101 -0
- package/src/domain/macro/snapshot.ts +114 -0
- package/src/domain/macro/templates.ts +446 -0
- package/src/domain/macro/types.ts +70 -0
- package/src/domain/macro/units.ts +93 -0
- package/src/domain/macro/weaponTypes.ts +83 -0
- package/src/domain/nav/cityTeleports.ts +10 -0
- package/src/domain/nav/mounting.ts +113 -0
- package/src/domain/nav/nav.ts +43 -0
- package/src/domain/nav/navCollision.ts +606 -0
- package/src/domain/nav/navOutdoors.ts +91 -0
- package/src/domain/nav/navRegistry.ts +179 -0
- package/src/domain/nav/navRoomGraph.ts +302 -0
- package/src/domain/nav/navTypes.ts +43 -0
- package/src/domain/nav/navmesh.ts +1715 -0
- package/src/domain/nav/speed.ts +200 -0
- package/src/domain/nav/storey.ts +10 -0
- package/src/domain/nav/travel.ts +725 -0
- package/src/domain/nav/travelTypes.ts +75 -0
- package/src/domain/pet/pet.ts +1150 -0
- package/src/domain/pet/petActionBar.ts +180 -0
- package/src/domain/pet/petSpellbook.ts +39 -0
- package/src/domain/pet/petStable.ts +81 -0
- package/src/domain/professions/autoDisenchant.ts +236 -0
- package/src/domain/professions/characterEnchants.ts +176 -0
- package/src/domain/professions/craftCooldown.ts +52 -0
- package/src/domain/professions/enchantApply.ts +62 -0
- package/src/domain/professions/enchantTargets.ts +114 -0
- package/src/domain/professions/enchanting.ts +236 -0
- package/src/domain/professions/gatherFilter.ts +149 -0
- package/src/domain/professions/gearEnchant.ts +137 -0
- package/src/domain/professions/heldTools.ts +29 -0
- package/src/domain/professions/learnAllRecipes.ts +146 -0
- package/src/domain/professions/miningHarvest.ts +69 -0
- package/src/domain/professions/partyDisenchant.ts +294 -0
- package/src/domain/professions/partyWork.ts +83 -0
- package/src/domain/professions/pickpocket.ts +172 -0
- package/src/domain/professions/poisons.ts +240 -0
- package/src/domain/professions/professions.ts +677 -0
- package/src/domain/professions/rareNodes.ts +45 -0
- package/src/domain/professions/skinLoot.ts +27 -0
- package/src/domain/professions/vendorReagents.ts +152 -0
- package/src/domain/professions/weaponImbueHand.ts +171 -0
- package/src/domain/questFarmFilter.mjs +42 -0
- package/src/domain/quests/doQuest.ts +1204 -0
- package/src/domain/quests/gossip.ts +308 -0
- package/src/domain/quests/gossipTalk.ts +298 -0
- package/src/domain/quests/interpreter/canComplete.ts +150 -0
- package/src/domain/quests/interpreter/claim.ts +137 -0
- package/src/domain/quests/interpreter/dbscript/handlers.ts +1371 -0
- package/src/domain/quests/interpreter/dbscript/handlersBatch.ts +1251 -0
- package/src/domain/quests/interpreter/dbscript/hooks.ts +331 -0
- package/src/domain/quests/interpreter/dbscript/index.ts +212 -0
- package/src/domain/quests/interpreter/dbscript/opcodes.ts +257 -0
- package/src/domain/quests/interpreter/dbscript/registry.ts +1194 -0
- package/src/domain/quests/interpreter/dbscript/registryAreatriggerScripts.ts +539 -0
- package/src/domain/quests/interpreter/dbscript/registryAshenvale.ts +553 -0
- package/src/domain/quests/interpreter/dbscript/registryAzshara.ts +272 -0
- package/src/domain/quests/interpreter/dbscript/registryDarkshore.ts +637 -0
- package/src/domain/quests/interpreter/dbscript/registryDesolace.ts +501 -0
- package/src/domain/quests/interpreter/dbscript/registryDustwallowMarsh.ts +735 -0
- package/src/domain/quests/interpreter/dbscript/registryFelwood.ts +493 -0
- package/src/domain/quests/interpreter/dbscript/registryFeralas.ts +485 -0
- package/src/domain/quests/interpreter/dbscript/registryGoScripts.ts +203 -0
- package/src/domain/quests/interpreter/dbscript/registryMoonglade.ts +288 -0
- package/src/domain/quests/interpreter/dbscript/registryNpcProfessions.ts +230 -0
- package/src/domain/quests/interpreter/dbscript/registryNpcsSpecial.ts +545 -0
- package/src/domain/quests/interpreter/dbscript/registryRazorfenDowns.ts +293 -0
- package/src/domain/quests/interpreter/dbscript/registryRazorfenKraul.ts +221 -0
- package/src/domain/quests/interpreter/dbscript/registryRedridge.ts +112 -0
- package/src/domain/quests/interpreter/dbscript/registrySearingGorge.ts +125 -0
- package/src/domain/quests/interpreter/dbscript/registrySiblings.ts +51 -0
- package/src/domain/quests/interpreter/dbscript/registrySilverpineForest.ts +172 -0
- package/src/domain/quests/interpreter/dbscript/registryStonetalonMountains.ts +180 -0
- package/src/domain/quests/interpreter/dbscript/registryStormwindCity.ts +369 -0
- package/src/domain/quests/interpreter/dbscript/registryStranglethornVale.ts +115 -0
- package/src/domain/quests/interpreter/dbscript/registryStratholme.ts +146 -0
- package/src/domain/quests/interpreter/dbscript/registrySunkenTemple.ts +149 -0
- package/src/domain/quests/interpreter/dbscript/registrySwampOfSorrows.ts +163 -0
- package/src/domain/quests/interpreter/dbscript/registryTanaris.ts +318 -0
- package/src/domain/quests/interpreter/dbscript/registryTeldrassil.ts +120 -0
- package/src/domain/quests/interpreter/dbscript/registryTheBarrens.ts +603 -0
- package/src/domain/quests/interpreter/dbscript/registryThousandNeedles.ts +499 -0
- package/src/domain/quests/interpreter/dbscript/registryTirisfalGlades.ts +222 -0
- package/src/domain/quests/interpreter/dbscript/registryUngoroCrater.ts +291 -0
- package/src/domain/quests/interpreter/dbscript/registryWarEffort.ts +773 -0
- package/src/domain/quests/interpreter/dbscript/registryWesternPlaguelands.ts +206 -0
- package/src/domain/quests/interpreter/dbscript/registryWestfall.ts +190 -0
- package/src/domain/quests/interpreter/dbscript/registryWetlands.ts +186 -0
- package/src/domain/quests/interpreter/dbscript/registryWinterspring.ts +235 -0
- package/src/domain/quests/interpreter/dbscript/types.ts +817 -0
- package/src/domain/quests/interpreter/dbscript/vm.ts +171 -0
- package/src/domain/quests/interpreter/diff.ts +349 -0
- package/src/domain/quests/interpreter/fixtures/oracle-questlog-qi2.json +2417 -0
- package/src/domain/quests/interpreter/flags.ts +101 -0
- package/src/domain/quests/interpreter/index.ts +113 -0
- package/src/domain/quests/interpreter/live.ts +178 -0
- package/src/domain/quests/interpreter/types.ts +81 -0
- package/src/domain/quests/interpreter/updaters.ts +412 -0
- package/src/domain/quests/questCorpseUse.ts +155 -0
- package/src/domain/quests/questDialog.ts +43 -0
- package/src/domain/quests/questFight.ts +34 -0
- package/src/domain/quests/questObjectiveLabel.ts +39 -0
- package/src/domain/quests/questRewardChoice.ts +85 -0
- package/src/domain/quests/questScriptCredit.ts +26 -0
- package/src/domain/quests/questScriptItemUse.ts +74 -0
- package/src/domain/quests/questTameRods.ts +79 -0
- package/src/domain/quests/questlog.ts +1545 -0
- package/src/domain/quests/talkDeliver.ts +170 -0
- package/src/domain/raid/globalActionBar.ts +195 -0
- package/src/domain/raid/instanceRoster.ts +194 -0
- package/src/domain/raid/partySummon.ts +198 -0
- package/src/domain/raid/partyVault.ts +320 -0
- package/src/domain/raid/raidBossAbilities.ts +268 -0
- package/src/domain/raid/raidComp.ts +335 -0
- package/src/domain/raid/raidCustomRows.ts +453 -0
- package/src/domain/raid/raidEncounterGear.ts +298 -0
- package/src/domain/raid/raidEncounterTactics.ts +412 -0
- package/src/domain/raid/raidPlan.ts +509 -0
- package/src/domain/raid/raidPlanEdits.ts +98 -0
- package/src/domain/raid/raidPlanPacks.ts +480 -0
- package/src/domain/raid/raidRecovery.ts +183 -0
- package/src/domain/raid/raidRosterTemplate.ts +138 -0
- package/src/domain/rotation/auraSide.ts +68 -0
- package/src/domain/rotation/build.ts +3031 -0
- package/src/domain/rotation/classes/druid.ts +58 -0
- package/src/domain/rotation/classes/hooks.ts +59 -0
- package/src/domain/rotation/classes/hunter.ts +156 -0
- package/src/domain/rotation/classes/index.ts +104 -0
- package/src/domain/rotation/classes/mage.ts +99 -0
- package/src/domain/rotation/classes/paladin.ts +296 -0
- package/src/domain/rotation/classes/priest.ts +94 -0
- package/src/domain/rotation/classes/pullOpener.ts +92 -0
- package/src/domain/rotation/classes/rogue.ts +69 -0
- package/src/domain/rotation/classes/shaman.ts +29 -0
- package/src/domain/rotation/classes/supportSpec.ts +94 -0
- package/src/domain/rotation/classes/warlock.ts +81 -0
- package/src/domain/rotation/classes/warrior.ts +402 -0
- package/src/domain/rotation/classify.ts +1381 -0
- package/src/domain/rotation/condMetricPicker.ts +379 -0
- package/src/domain/rotation/consumables.ts +242 -0
- package/src/domain/rotation/evaluate.ts +1115 -0
- package/src/domain/rotation/finisherLadder.ts +145 -0
- package/src/domain/rotation/invent.ts +938 -0
- package/src/domain/rotation/killOrder.ts +30 -0
- package/src/domain/rotation/openerForm.ts +22 -0
- package/src/domain/rotation/paladinBuffs.ts +568 -0
- package/src/domain/rotation/prebuff.ts +283 -0
- package/src/domain/rotation/raidRowTuning.ts +34 -0
- package/src/domain/rotation/rotation.ts +11 -0
- package/src/domain/rotation/rotationProfiles.ts +180 -0
- package/src/domain/rotation/rotationSuggestions.ts +851 -0
- package/src/domain/rotation/ruleAfterChain.ts +49 -0
- package/src/domain/rotation/spec.ts +70 -0
- package/src/domain/rotation/spellPicker.ts +140 -0
- package/src/domain/rotation/stand.ts +143 -0
- package/src/domain/rotation/types.ts +718 -0
- package/src/domain/run/battlegroundRun.ts +111 -0
- package/src/domain/run/canEnterContext.ts +32 -0
- package/src/domain/run/death.ts +561 -0
- package/src/domain/run/deathRecovery.ts +289 -0
- package/src/domain/run/duel.ts +141 -0
- package/src/domain/run/dungeonRun.ts +344 -0
- package/src/domain/run/floorRest.ts +159 -0
- package/src/domain/run/honor.ts +557 -0
- package/src/domain/run/honorWeek.ts +180 -0
- package/src/domain/run/whenMap.ts +977 -0
- package/src/domain/scriptdev/arathiHighlands.ts +445 -0
- package/src/domain/scriptdev/ashenvale.ts +635 -0
- package/src/domain/scriptdev/ashenvaleHelpers.ts +1215 -0
- package/src/domain/scriptdev/azshara.ts +892 -0
- package/src/domain/scriptdev/blackfathomDeeps.ts +212 -0
- package/src/domain/scriptdev/blackrockDepths.ts +1434 -0
- package/src/domain/scriptdev/blackrockSpire.ts +730 -0
- package/src/domain/scriptdev/blackwingLair.ts +521 -0
- package/src/domain/scriptdev/burningSteppes.ts +62 -0
- package/src/domain/scriptdev/classFilter.ts +43 -0
- package/src/domain/scriptdev/darkshore.ts +817 -0
- package/src/domain/scriptdev/darkshoreHelpers.ts +853 -0
- package/src/domain/scriptdev/deadmines.ts +331 -0
- package/src/domain/scriptdev/desolace.ts +1239 -0
- package/src/domain/scriptdev/direMaul.ts +859 -0
- package/src/domain/scriptdev/durotar.ts +532 -0
- package/src/domain/scriptdev/dustwallowMarsh.ts +758 -0
- package/src/domain/scriptdev/dustwallowMarshHelpers.ts +994 -0
- package/src/domain/scriptdev/easternPlaguelands.ts +21 -0
- package/src/domain/scriptdev/felwood.ts +1055 -0
- package/src/domain/scriptdev/feralas.ts +571 -0
- package/src/domain/scriptdev/feralasHelpers.ts +838 -0
- package/src/domain/scriptdev/gnomeregan.ts +466 -0
- package/src/domain/scriptdev/guards.ts +616 -0
- package/src/domain/scriptdev/hinterlands.ts +693 -0
- package/src/domain/scriptdev/host.ts +1134 -0
- package/src/domain/scriptdev/index.ts +123 -0
- package/src/domain/scriptdev/instanceRaids.ts +136 -0
- package/src/domain/scriptdev/itemScripts.ts +37 -0
- package/src/domain/scriptdev/lochModan.ts +283 -0
- package/src/domain/scriptdev/maraudon.ts +232 -0
- package/src/domain/scriptdev/moltenCore.ts +831 -0
- package/src/domain/scriptdev/moonglade.ts +659 -0
- package/src/domain/scriptdev/moongladeHelpers.ts +933 -0
- package/src/domain/scriptdev/naxxramas.ts +577 -0
- package/src/domain/scriptdev/naxxramasConstruct.ts +364 -0
- package/src/domain/scriptdev/naxxramasFrostwyrm.ts +378 -0
- package/src/domain/scriptdev/naxxramasMilitary.ts +276 -0
- package/src/domain/scriptdev/npcProfessions.ts +1025 -0
- package/src/domain/scriptdev/npcsSpecial.ts +1379 -0
- package/src/domain/scriptdev/onyxiasLair.ts +313 -0
- package/src/domain/scriptdev/orgrimmar.ts +147 -0
- package/src/domain/scriptdev/professionSpecConsumer.ts +481 -0
- package/src/domain/scriptdev/razorfenDowns.ts +468 -0
- package/src/domain/scriptdev/razorfenKraul.ts +410 -0
- package/src/domain/scriptdev/redridgeMountains.ts +163 -0
- package/src/domain/scriptdev/registry.ts +945 -0
- package/src/domain/scriptdev/ruinsOfAhnqiraj.ts +356 -0
- package/src/domain/scriptdev/scarletMonastery.ts +713 -0
- package/src/domain/scriptdev/scholomance.ts +682 -0
- package/src/domain/scriptdev/searingGorge.ts +295 -0
- package/src/domain/scriptdev/shadowfangKeep.ts +181 -0
- package/src/domain/scriptdev/silithus.ts +71 -0
- package/src/domain/scriptdev/silverpineForest.ts +662 -0
- package/src/domain/scriptdev/stonetalonMountains.ts +493 -0
- package/src/domain/scriptdev/stormwindCity.ts +1192 -0
- package/src/domain/scriptdev/stranglethornVale.ts +402 -0
- package/src/domain/scriptdev/stratholme.ts +650 -0
- package/src/domain/scriptdev/stratholmeScripts.ts +505 -0
- package/src/domain/scriptdev/sunkenTemple.ts +736 -0
- package/src/domain/scriptdev/swampOfSorrows.ts +22 -0
- package/src/domain/scriptdev/tanaris.ts +391 -0
- package/src/domain/scriptdev/tanarisHelpers.ts +661 -0
- package/src/domain/scriptdev/teldrassil.ts +143 -0
- package/src/domain/scriptdev/templeOfAhnqiraj.ts +1013 -0
- package/src/domain/scriptdev/theBarrens.ts +709 -0
- package/src/domain/scriptdev/theBarrensHelpers.ts +1026 -0
- package/src/domain/scriptdev/thousandNeedles.ts +426 -0
- package/src/domain/scriptdev/thousandNeedlesHelpers.ts +566 -0
- package/src/domain/scriptdev/tirisfalGlades.ts +533 -0
- package/src/domain/scriptdev/types.ts +1026 -0
- package/src/domain/scriptdev/uldaman.ts +437 -0
- package/src/domain/scriptdev/ungoroCrater.ts +549 -0
- package/src/domain/scriptdev/ungoroCraterHelpers.ts +1006 -0
- package/src/domain/scriptdev/wailingCaverns.ts +700 -0
- package/src/domain/scriptdev/warEffort.ts +371 -0
- package/src/domain/scriptdev/westernPlaguelands.ts +952 -0
- package/src/domain/scriptdev/westfall.ts +767 -0
- package/src/domain/scriptdev/wetlands.ts +660 -0
- package/src/domain/scriptdev/winterspring.ts +482 -0
- package/src/domain/scriptdev/winterspringHelpers.ts +801 -0
- package/src/domain/scriptdev/worldBosses.ts +605 -0
- package/src/domain/scriptdev/zulfarrak.ts +478 -0
- package/src/domain/scriptdev/zulgurub.ts +1152 -0
- package/src/domain/sim/dummySim.ts +408 -0
- package/src/domain/sim/targetDummy.ts +29 -0
- package/src/domain/social/guild.ts +148 -0
- package/src/domain/spells/areaAuraMembership.ts +93 -0
- package/src/domain/spells/breakableStunCc.ts +166 -0
- package/src/domain/spells/cancelAura.ts +80 -0
- package/src/domain/spells/diminishing.ts +167 -0
- package/src/domain/spells/dispel.ts +149 -0
- package/src/domain/spells/dispelMechanic.ts +105 -0
- package/src/domain/spells/equipSpells.ts +247 -0
- package/src/domain/spells/learnOnTargets.ts +260 -0
- package/src/domain/spells/mergeSchoolImmunityFromRaw.ts +66 -0
- package/src/domain/spells/resurrectSpell.ts +124 -0
- package/src/domain/spells/spellPushback.ts +39 -0
- package/src/domain/spells/spellReflect.ts +43 -0
- package/src/domain/spells/stealth.ts +183 -0
- package/src/domain/spells/totem.ts +394 -0
- package/src/domain/spells/worldCast.ts +187 -0
- package/src/domain/world/areaTriggerLocks.ts +177 -0
- package/src/domain/world/dungeonMusic.ts +108 -0
- package/src/domain/world/gameEvents.ts +119 -0
- package/src/domain/world/gameObjects.ts +1030 -0
- package/src/domain/world/goEventFire.ts +234 -0
- package/src/domain/world/goMoTransport.ts +74 -0
- package/src/domain/world/goTransport.ts +81 -0
- package/src/domain/world/hazards.ts +459 -0
- package/src/domain/world/openLock.ts +398 -0
- package/src/domain/world/pools.ts +470 -0
- package/src/domain/world/restArea.ts +37 -0
- package/src/domain/world/weather.ts +201 -0
- package/src/domain/zoneAmbience.mjs +87 -0
- package/src/domain/zoneMusic.mjs +62 -0
- package/src/domain/zoneMusicQueue.mjs +7 -0
- package/src/engine/combat/activeSeal.ts +39 -0
- package/src/engine/combat/aiTargetResolve.ts +64 -0
- package/src/engine/combat/aoeCast.ts +289 -0
- package/src/engine/combat/applyConsumeAura.ts +74 -0
- package/src/engine/combat/applyDemonicSacrifice.ts +70 -0
- package/src/engine/combat/applyDispelMechanic.ts +30 -0
- package/src/engine/combat/applyHealEffect.ts +301 -0
- package/src/engine/combat/applySchoolAbsorb.ts +114 -0
- package/src/engine/combat/applySpell.ts +3169 -0
- package/src/engine/combat/applySpellLate.ts +2026 -0
- package/src/engine/combat/applySpellLateBag.ts +144 -0
- package/src/engine/combat/areaAura.ts +283 -0
- package/src/engine/combat/attackTable.ts +508 -0
- package/src/engine/combat/battleRez.ts +87 -0
- package/src/engine/combat/castAction.ts +36 -0
- package/src/engine/combat/castTargetGates.ts +75 -0
- package/src/engine/combat/castableKit.ts +68 -0
- package/src/engine/combat/ccMirrorUpgrade.ts +39 -0
- package/src/engine/combat/chainFan.ts +210 -0
- package/src/engine/combat/channel.ts +423 -0
- package/src/engine/combat/chaseCloseness.ts +95 -0
- package/src/engine/combat/cmangosCastGates.ts +129 -0
- package/src/engine/combat/combatFlag.ts +77 -0
- package/src/engine/combat/combatGeometry.ts +1329 -0
- package/src/engine/combat/combustion.ts +68 -0
- package/src/engine/combat/context.ts +730 -0
- package/src/engine/combat/createSession.ts +1165 -0
- package/src/engine/combat/creatureLeash.ts +38 -0
- package/src/engine/combat/crowdControl.ts +1259 -0
- package/src/engine/combat/dispelDuty.ts +54 -0
- package/src/engine/combat/dispelReflect.ts +609 -0
- package/src/engine/combat/displaceFloor.ts +113 -0
- package/src/engine/combat/duelBounds.ts +47 -0
- package/src/engine/combat/equippedItemGate.ts +297 -0
- package/src/engine/combat/evadeLifecycle.ts +63 -0
- package/src/engine/combat/eventAi.ts +2220 -0
- package/src/engine/combat/facing.ts +74 -0
- package/src/engine/combat/fearFlee.ts +137 -0
- package/src/engine/combat/fighterFactory.ts +1144 -0
- package/src/engine/combat/forceDespawnAction.ts +51 -0
- package/src/engine/combat/formulas.ts +807 -0
- package/src/engine/combat/friendlyFan.ts +55 -0
- package/src/engine/combat/groundPoolTick.ts +210 -0
- package/src/engine/combat/hazards.ts +114 -0
- package/src/engine/combat/healTargets.ts +226 -0
- package/src/engine/combat/heartbeatResist.ts +49 -0
- package/src/engine/combat/hostileItemUse.ts +75 -0
- package/src/engine/combat/interruptAuras.ts +66 -0
- package/src/engine/combat/itemRescue.ts +49 -0
- package/src/engine/combat/itemUse.ts +260 -0
- package/src/engine/combat/kitById.ts +23 -0
- package/src/engine/combat/knockBack.ts +201 -0
- package/src/engine/combat/leap.ts +89 -0
- package/src/engine/combat/mitigation.ts +587 -0
- package/src/engine/combat/modTaunt.ts +43 -0
- package/src/engine/combat/motionClaim.ts +268 -0
- package/src/engine/combat/motionGate.ts +150 -0
- package/src/engine/combat/motionGenerator.ts +27 -0
- package/src/engine/combat/navSight.ts +138 -0
- package/src/engine/combat/perfSink.ts +28 -0
- package/src/engine/combat/periodicDue.ts +55 -0
- package/src/engine/combat/petAuras.ts +86 -0
- package/src/engine/combat/pickAction.ts +3449 -0
- package/src/engine/combat/powerForm.ts +735 -0
- package/src/engine/combat/powerPools.ts +49 -0
- package/src/engine/combat/predicates.ts +538 -0
- package/src/engine/combat/procsDamage.ts +1823 -0
- package/src/engine/combat/reactiveGates.ts +135 -0
- package/src/engine/combat/roles.ts +389 -0
- package/src/engine/combat/rotationSubject.ts +78 -0
- package/src/engine/combat/ruleAfter.ts +106 -0
- package/src/engine/combat/seedDisplayAuras.ts +203 -0
- package/src/engine/combat/seedOocEffects.ts +317 -0
- package/src/engine/combat/seedSchoolImmunities.ts +45 -0
- package/src/engine/combat/session-types.ts +458 -0
- package/src/engine/combat/sessionApi.ts +1785 -0
- package/src/engine/combat/sessionCharge.ts +124 -0
- package/src/engine/combat/sessionChase.ts +869 -0
- package/src/engine/combat/sessionDeaths.ts +469 -0
- package/src/engine/combat/sessionFocus.ts +506 -0
- package/src/engine/combat/sessionFollow.ts +167 -0
- package/src/engine/combat/sessionGeometry.ts +188 -0
- package/src/engine/combat/sessionHome.ts +75 -0
- package/src/engine/combat/sessionInject.ts +719 -0
- package/src/engine/combat/sessionMechanicMove.ts +555 -0
- package/src/engine/combat/sessionMotion.ts +1553 -0
- package/src/engine/combat/sessionMotionKit.ts +247 -0
- package/src/engine/combat/sessionMoveIntent.ts +49 -0
- package/src/engine/combat/sessionMoveOrder.ts +200 -0
- package/src/engine/combat/sessionPathTo.ts +657 -0
- package/src/engine/combat/sessionPools.ts +688 -0
- package/src/engine/combat/sessionSteer.ts +144 -0
- package/src/engine/combat/sessionStepBack.ts +151 -0
- package/src/engine/combat/sessionStepWrap.ts +116 -0
- package/src/engine/combat/sessionView.ts +442 -0
- package/src/engine/combat/simEffects.ts +32 -0
- package/src/engine/combat/simFacade.ts +620 -0
- package/src/engine/combat/simPump.ts +264 -0
- package/src/engine/combat/simSnapshot.ts +165 -0
- package/src/engine/combat/simThreadPool.ts +35 -0
- package/src/engine/combat/skeramImages.ts +57 -0
- package/src/engine/combat/slowUpdate.ts +178 -0
- package/src/engine/combat/snapToFloor.ts +42 -0
- package/src/engine/combat/speedAura.ts +29 -0
- package/src/engine/combat/spellReagents.ts +71 -0
- package/src/engine/combat/stealthDetect.ts +93 -0
- package/src/engine/combat/stepBackMotion.ts +171 -0
- package/src/engine/combat/stepSession.ts +3102 -0
- package/src/engine/combat/summonCast.ts +243 -0
- package/src/engine/combat/thaddiusPolarity.ts +97 -0
- package/src/engine/combat/threat.ts +388 -0
- package/src/engine/combat/threatOps.ts +272 -0
- package/src/engine/combat/tickWorkerBody.ts +211 -0
- package/src/engine/combat/totemAuras.ts +122 -0
- package/src/engine/combat/triggerPayload.ts +42 -0
- package/src/engine/combat/triggeredCompanion.ts +63 -0
- package/src/engine/combat/types.ts +1897 -0
- package/src/engine/combat/useObjectTrap.ts +140 -0
- package/src/engine/combat/walkSurface.ts +54 -0
- package/src/engine/combat/weapon.ts +1248 -0
- package/src/engine/combat/worldFrame.ts +43 -0
- package/src/engine/combat.solo-golden.json +2242 -0
- package/src/engine/combat.ts +84 -0
- package/src/engine/core/detMath.ts +289 -0
- package/src/engine/core/events.ts +357 -0
- package/src/engine/core/rng.ts +36 -0
- package/src/engine/game/actionBars.ts +124 -0
- package/src/engine/game/activateObjectFromSpell.ts +320 -0
- package/src/engine/game/applyActiveObjectFromDbScript.ts +98 -0
- package/src/engine/game/applyDeathAndSpellScripts.ts +268 -0
- package/src/engine/game/applyDoorFromDbScript.ts +388 -0
- package/src/engine/game/applyEscortFromDbScript.ts +290 -0
- package/src/engine/game/applyGoSpellcasterCast.ts +40 -0
- package/src/engine/game/applyHoverFromDbScript.ts +110 -0
- package/src/engine/game/applyOocResurrect.ts +71 -0
- package/src/engine/game/applySpellDurability.ts +115 -0
- package/src/engine/game/applyTailFromDbScript.ts +478 -0
- package/src/engine/game/applyTerminateFromDbScript.ts +95 -0
- package/src/engine/game/auctionMail.ts +269 -0
- package/src/engine/game/bagOverflow.ts +130 -0
- package/src/engine/game/bank.ts +110 -0
- package/src/engine/game/barAutofill.ts +26 -0
- package/src/engine/game/battleground.ts +369 -0
- package/src/engine/game/combatEnemySpec.ts +216 -0
- package/src/engine/game/combatObjectTraps.ts +167 -0
- package/src/engine/game/combatSeed.ts +320 -0
- package/src/engine/game/combatSession.ts +3241 -0
- package/src/engine/game/combatSessionClock.ts +62 -0
- package/src/engine/game/companionQuestActions.ts +242 -0
- package/src/engine/game/companionTraining.ts +40 -0
- package/src/engine/game/consumables.ts +624 -0
- package/src/engine/game/context.ts +53 -0
- package/src/engine/game/createHealthstone.ts +45 -0
- package/src/engine/game/deathFlow.ts +127 -0
- package/src/engine/game/devGrant.ts +117 -0
- package/src/engine/game/dynamicObject.ts +365 -0
- package/src/engine/game/enchantItem.ts +177 -0
- package/src/engine/game/equipmentHelper.ts +806 -0
- package/src/engine/game/factionState.ts +108 -0
- package/src/engine/game/garmentsOoc.ts +69 -0
- package/src/engine/game/globalActionBar.ts +179 -0
- package/src/engine/game/goInteractQuestCredit.ts +51 -0
- package/src/engine/game/goMoTransportUse.ts +61 -0
- package/src/engine/game/goTransportUse.ts +60 -0
- package/src/engine/game/healthstoneUpkeep.ts +59 -0
- package/src/engine/game/killSkin.ts +124 -0
- package/src/engine/game/learnFromItem.ts +118 -0
- package/src/engine/game/loadReconcile.ts +551 -0
- package/src/engine/game/loot.ts +294 -0
- package/src/engine/game/macros.ts +125 -0
- package/src/engine/game/mail.ts +293 -0
- package/src/engine/game/meetingStoneQueue.ts +75 -0
- package/src/engine/game/meetingStoneUse.ts +54 -0
- package/src/engine/game/newGameState.ts +363 -0
- package/src/engine/game/oocAuraInterrupt.ts +92 -0
- package/src/engine/game/oocCast.ts +241 -0
- package/src/engine/game/oocCastEffects.ts +803 -0
- package/src/engine/game/oocCastMethods.ts +1077 -0
- package/src/engine/game/openLockFromSpell.ts +174 -0
- package/src/engine/game/outdoorPvp.ts +187 -0
- package/src/engine/game/outfitter.ts +644 -0
- package/src/engine/game/paladinBoard.ts +393 -0
- package/src/engine/game/partyAuras.ts +121 -0
- package/src/engine/game/persistCombatAuras.ts +91 -0
- package/src/engine/game/pets.ts +459 -0
- package/src/engine/game/prePullHealthstones.ts +154 -0
- package/src/engine/game/professions.ts +2227 -0
- package/src/engine/game/pruneStaleRuntime.ts +39 -0
- package/src/engine/game/questFightCredit.ts +36 -0
- package/src/engine/game/questItemOnCorpse.ts +166 -0
- package/src/engine/game/questItemOnCreature.ts +103 -0
- package/src/engine/game/questLog.ts +879 -0
- package/src/engine/game/questSpellComplete.ts +21 -0
- package/src/engine/game/questTurnIn.ts +598 -0
- package/src/engine/game/raidParty.ts +32 -0
- package/src/engine/game/reagentBuyIn.ts +39 -0
- package/src/engine/game/regenRest.ts +186 -0
- package/src/engine/game/rotation.ts +425 -0
- package/src/engine/game/runFullDungeon.ts +611 -0
- package/src/engine/game/runSupply.ts +80 -0
- package/src/engine/game/sanitizeDriftedItems.ts +135 -0
- package/src/engine/game/scriptDevGoUse.ts +397 -0
- package/src/engine/game/scriptDevInnkeeper.ts +150 -0
- package/src/engine/game/scriptDevProfessionSpec.ts +99 -0
- package/src/engine/game/sendEventFromSpell.ts +87 -0
- package/src/engine/game/sortContainers.ts +85 -0
- package/src/engine/game/spellReputation.ts +69 -0
- package/src/engine/game/squad/squadDungeonSeating.ts +197 -0
- package/src/engine/game/squadDungeon.ts +4222 -0
- package/src/engine/game/squadQuestShare.ts +260 -0
- package/src/engine/game/summonObjectSlot.ts +69 -0
- package/src/engine/game/summonObjectWild.ts +73 -0
- package/src/engine/game/summoningRitualUse.ts +141 -0
- package/src/engine/game/talents.ts +356 -0
- package/src/engine/game/tamingRodUse.ts +66 -0
- package/src/engine/game/tempSpawnCreature.ts +136 -0
- package/src/engine/game/tickDungeonPatrolScripts.ts +205 -0
- package/src/engine/game/tickTimedQuests.ts +28 -0
- package/src/engine/game/trade.ts +586 -0
- package/src/engine/game/travel.ts +1155 -0
- package/src/engine/game/types.ts +1855 -0
- package/src/engine/game/vendorOffers.ts +244 -0
- package/src/engine/game/weaponImbueItem.ts +281 -0
- package/src/engine/game/worldSession.ts +183 -0
- package/src/engine/game/worldState.ts +166 -0
- package/src/engine/game.ts +968 -0
- package/src/engine/spells/GAP.md +67 -0
- package/src/engine/spells/absorbs.ts +376 -0
- package/src/engine/spells/addTargetTrigger.ts +53 -0
- package/src/engine/spells/auraPerSecondCost.ts +50 -0
- package/src/engine/spells/auraStacking.ts +497 -0
- package/src/engine/spells/cmangos-special-cases-combustion.ts +13 -0
- package/src/engine/spells/cmangos-special-cases-s18.ts +445 -0
- package/src/engine/spells/cmangos-special-cases-s19.ts +324 -0
- package/src/engine/spells/cmangos-special-cases-s20.ts +385 -0
- package/src/engine/spells/cmangos-special-cases-s21.ts +116 -0
- package/src/engine/spells/cmangos-special-cases-s22.ts +24 -0
- package/src/engine/spells/cmangos-special-cases-s23.ts +52 -0
- package/src/engine/spells/cmangos-special-cases.ts +1570 -0
- package/src/engine/spells/conditions.ts +718 -0
- package/src/engine/spells/effects.ts +203 -0
- package/src/engine/spells/fixtures/oracle-effects-lock9a.json +1 -0
- package/src/engine/spells/immunity.ts +942 -0
- package/src/engine/spells/intentEffects.ts +351 -0
- package/src/engine/spells/interpreter/GAPS.md +21 -0
- package/src/engine/spells/interpreter/amount.ts +109 -0
- package/src/engine/spells/interpreter/class-scripts-kit.ts +478 -0
- package/src/engine/spells/interpreter/diff.ts +246 -0
- package/src/engine/spells/interpreter/duration.ts +90 -0
- package/src/engine/spells/interpreter/form-attrs.json +1 -0
- package/src/engine/spells/interpreter/form-attrs.ts +95 -0
- package/src/engine/spells/interpreter/handlers/aura-remove.ts +113 -0
- package/src/engine/spells/interpreter/handlers/auras-control.ts +1547 -0
- package/src/engine/spells/interpreter/handlers/auras-core.ts +1583 -0
- package/src/engine/spells/interpreter/handlers/auras-misc.ts +1774 -0
- package/src/engine/spells/interpreter/handlers/effect-disenchant.ts +17 -0
- package/src/engine/spells/interpreter/handlers/effect-skinning.ts +20 -0
- package/src/engine/spells/interpreter/handlers/effects-action-utility.ts +1455 -0
- package/src/engine/spells/interpreter/handlers/effects-core.ts +432 -0
- package/src/engine/spells/interpreter/handlers/effects-remainder.ts +105 -0
- package/src/engine/spells/interpreter/handlers/effects-summon-item.ts +687 -0
- package/src/engine/spells/interpreter/handlers/mod-increase-energy-percent.ts +36 -0
- package/src/engine/spells/interpreter/handlers/mod-increase-energy.ts +36 -0
- package/src/engine/spells/interpreter/handlers/periodic-trigger-zero.ts +327 -0
- package/src/engine/spells/interpreter/handlers/procs.ts +131 -0
- package/src/engine/spells/interpreter/handlers/registry.ts +975 -0
- package/src/engine/spells/interpreter/handlers/shared.ts +667 -0
- package/src/engine/spells/interpreter/handlers.ts +9 -0
- package/src/engine/spells/interpreter/hunter-kit.ts +202 -0
- package/src/engine/spells/interpreter/index.ts +525 -0
- package/src/engine/spells/interpreter/item-triggers.ts +1121 -0
- package/src/engine/spells/interpreter/lift-consume-energy.ts +37 -0
- package/src/engine/spells/interpreter/mage-portals.ts +37 -0
- package/src/engine/spells/interpreter/materialize-charm.ts +88 -0
- package/src/engine/spells/interpreter/materialize-dispel-mechanic.ts +25 -0
- package/src/engine/spells/interpreter/materialize-rating-buffs.ts +81 -0
- package/src/engine/spells/interpreter/materialize-speed.ts +109 -0
- package/src/engine/spells/interpreter/materialize-spell-magnet.ts +22 -0
- package/src/engine/spells/interpreter/opcodes.ts +789 -0
- package/src/engine/spells/interpreter/paladin-kit.ts +95 -0
- package/src/engine/spells/interpreter/paladin-seals.ts +499 -0
- package/src/engine/spells/interpreter/priest-warlock-kit.ts +135 -0
- package/src/engine/spells/interpreter/proc.ts +443 -0
- package/src/engine/spells/interpreter/registry/helpers.ts +16 -0
- package/src/engine/spells/interpreter/registry/index.ts +216 -0
- package/src/engine/spells/interpreter/registry/packs/class-abilities.ts +304 -0
- package/src/engine/spells/interpreter/registry/packs/dire-maul.ts +44 -0
- package/src/engine/spells/interpreter/registry/packs/dummy-script-tail.ts +1065 -0
- package/src/engine/spells/interpreter/registry/packs/ex-wave-m.ts +70 -0
- package/src/engine/spells/interpreter/registry/packs/life-tap.ts +107 -0
- package/src/engine/spells/interpreter/registry/packs/paladin.ts +246 -0
- package/src/engine/spells/interpreter/registry/packs/raid-script-summons.ts +26 -0
- package/src/engine/spells/interpreter/registry/packs/raid-threat-wipe.ts +22 -0
- package/src/engine/spells/interpreter/registry/packs/shaman.ts +214 -0
- package/src/engine/spells/interpreter/registry/packs/si4-dummy-generic-a.ts +269 -0
- package/src/engine/spells/interpreter/registry/packs/si4-dummy-generic-b.ts +370 -0
- package/src/engine/spells/interpreter/registry/packs/si4-dummy-generic-c.ts +172 -0
- package/src/engine/spells/interpreter/registry/packs/si4-dummy-hunter.ts +60 -0
- package/src/engine/spells/interpreter/registry/packs/si4-dummy-warrior.ts +31 -0
- package/src/engine/spells/interpreter/registry/packs/si4-script-generic-a.ts +114 -0
- package/src/engine/spells/interpreter/registry/packs/si4-script-generic-b.ts +249 -0
- package/src/engine/spells/interpreter/registry/packs/si4-script-generic-c.ts +233 -0
- package/src/engine/spells/interpreter/registry/types.ts +48 -0
- package/src/engine/spells/interpreter/talent-scripted.ts +329 -0
- package/src/engine/spells/interpreter/targeting.ts +90 -0
- package/src/engine/spells/interpreter/types-intent.ts +1501 -0
- package/src/engine/spells/interpreter/types.ts +419 -0
- package/src/engine/spells/interpreter/warrior-druid-kit.ts +314 -0
- package/src/engine/spells/interpreter/weapon-imbue-kit.ts +384 -0
- package/src/engine/spells/interrupt.ts +217 -0
- package/src/engine/spells/meleeAttackReset.ts +60 -0
- package/src/engine/spells/oocTriggerSpell.ts +49 -0
- package/src/engine/spells/overrideClassScripts.ts +319 -0
- package/src/engine/spells/parryHaste.ts +20 -0
- package/src/engine/spells/procs.ts +300 -0
- package/src/engine/spells/recovery.ts +203 -0
- package/src/engine/spells/scriptTargetDest.ts +76 -0
- package/src/engine/spells/scriptTargets.ts +85 -0
- package/src/engine/spells/singleTargetAura.ts +82 -0
- package/src/engine/spells/specialCasePayloads.ts +57 -0
- package/src/engine/spells/spellAttributes.ts +249 -0
- package/src/engine/spells/spellBonus.ts +143 -0
- package/src/engine/spells/spellModIntents.ts +419 -0
- package/src/engine/spells/spellMods.ts +283 -0
- package/src/engine/spells/spellRadius.ts +15 -0
- package/src/engine/spells/trapObjects.ts +26 -0
- package/src/json.d.ts +7 -0
- package/src/persistence/memoryRepository.ts +23 -0
- package/src/persistence/saveBackups.ts +162 -0
- package/src/persistence/saveFile.ts +68 -0
- package/src/persistence/saveRepository.ts +11 -0
- package/src/persistence/saveShape.ts +668 -0
- package/src/progression/leveling.ts +89 -0
- package/src/progression/rest.ts +1434 -0
- package/src/progression/training.ts +226 -0
- package/src/progression/xpGain.ts +369 -0
- package/src/quests/quests.ts +1580 -0
- package/src/world/aoePull.ts +198 -0
- package/src/world/areaTableDbc.ts +39 -0
- package/src/world/areaTableMapIdPairs.ts +141 -0
- package/src/world/bakeSlug.ts +43 -0
- package/src/world/continuousDungeon.ts +1250 -0
- package/src/world/dungeonBakeProjection.ts +190 -0
- package/src/world/dungeonMapDensity.ts +342 -0
- package/src/world/dungeonMapProjection.ts +135 -0
- package/src/world/dungeonNav.ts +904 -0
- package/src/world/dungeonNpcSim.ts +147 -0
- package/src/world/dungeonObjectives.ts +234 -0
- package/src/world/dungeonPreset.ts +35 -0
- package/src/world/dungeonRoute.ts +311 -0
- package/src/world/dungeonRouteGeometry.ts +732 -0
- package/src/world/dungeonRouteOrder.ts +1037 -0
- package/src/world/dungeonWingRooms.ts +426 -0
- package/src/world/escort.ts +296 -0
- package/src/world/goPoolRoll.ts +75 -0
- package/src/world/instanceObjects.ts +785 -0
- package/src/world/instances.ts +1572 -0
- package/src/world/meetingStones.ts +56 -0
- package/src/world/navmeshFloors.ts +145 -0
- package/src/world/nearGrid.ts +167 -0
- package/src/world/packBudget.ts +613 -0
- package/src/world/rareRoll.ts +335 -0
- package/src/world/routeAuthoring.ts +132 -0
- package/src/world/routeEdit.ts +209 -0
- package/src/world/world.ts +812 -0
- package/src/world/zoneHazards.ts +47 -0
|
@@ -0,0 +1,1077 @@
|
|
|
1
|
+
// OOC cast methods (spellCooldownRemaining / castOutOfCombat / cannibalize). Predicates stay in oocCast.ts.
|
|
2
|
+
// Pattern C: createOocCastMethodsModule(ctx, extras). No import of game.ts.
|
|
3
|
+
|
|
4
|
+
import { mulberry32, hashSeed } from '../core/rng.ts';
|
|
5
|
+
import { applyResetCooldownsWorld } from '../spells/recovery.ts';
|
|
6
|
+
import { resolveCombatSpell } from '../spells/interpreter/index.ts';
|
|
7
|
+
import { SPELL_ATTR_EX, hasAttrEx } from '../spells/spellAttributes.ts';
|
|
8
|
+
import '../spells/oocTriggerSpell.ts';
|
|
9
|
+
import { passesTargetCreatureType } from '../spells/immunity.ts';
|
|
10
|
+
import { applyOocCastEffects, dropNextCastAura, findArmedNextCastMod } from './oocCastEffects.ts';
|
|
11
|
+
import { createHealthstoneInterpretCtx, createHealthstoneBlockedReason } from './createHealthstone.ts';
|
|
12
|
+
import {
|
|
13
|
+
maxHealth,
|
|
14
|
+
maxPower,
|
|
15
|
+
powerType,
|
|
16
|
+
combatantCreatureType,
|
|
17
|
+
pruneExpiredAuras,
|
|
18
|
+
createMana,
|
|
19
|
+
createHealth,
|
|
20
|
+
currentMana,
|
|
21
|
+
clampResourcePools,
|
|
22
|
+
getActiveBuffIds,
|
|
23
|
+
} from '../../domain/character/character.ts';
|
|
24
|
+
import {
|
|
25
|
+
isNonCombatSpell, lifeTapOocFailReason, oocSpellRequiresEnemyTarget,
|
|
26
|
+
oocSummoningRitualFailReason, oocTotemSummonFailReason, oocPetCallReviveFailReason,
|
|
27
|
+
playerCombatFlagSet,
|
|
28
|
+
} from './oocCast.ts';
|
|
29
|
+
import {
|
|
30
|
+
isFormSpell, isStealthShapeshift, formSpeedBoostSpellIds, MOBILITY_FORM_SPELL_IDS,
|
|
31
|
+
resolveFormCast, resolveSpellCost, FORM_LABEL,
|
|
32
|
+
} from '../../domain/character/forms.ts';
|
|
33
|
+
import { AURA_INTERRUPT, isStealthSpell } from '../../domain/spells/stealth.ts';
|
|
34
|
+
import { castIsAnAction, removeCharAurasWithInterruptFlags } from './oocAuraInterrupt.ts';
|
|
35
|
+
import { hasAttr, SPELL_ATTR, SPELL_ATTR_EX2, hasAttrEx2 } from '../spells/spellAttributes.ts';
|
|
36
|
+
import {
|
|
37
|
+
auraCancelRefusal, CANCEL_AURA_REFUSAL_TEXT, type AuraCancelState,
|
|
38
|
+
} from '../../domain/spells/cancelAura.ts';
|
|
39
|
+
import { isPartyAreaAura } from '../../domain/spells/areaAuraMembership.ts';
|
|
40
|
+
import { resolveChainPair } from '../spells/auraStacking.ts';
|
|
41
|
+
import { newPet, applyPetHappinessPowerDrains } from '../../domain/pet/pet.ts';
|
|
42
|
+
import { resolveTempWeaponImbueHand } from '../../domain/professions/weaponImbueHand.ts';
|
|
43
|
+
import type { LootDrop } from '../../domain/items/loot.ts';
|
|
44
|
+
import { knows } from '../../domain/character/spellbook.ts';
|
|
45
|
+
import {
|
|
46
|
+
recordSpellCast, recordCastedCreatureOrGO,
|
|
47
|
+
} from '../../domain/quests/questlog.ts';
|
|
48
|
+
import { creditQuestCompleteFromSpell } from './questSpellComplete.ts';
|
|
49
|
+
import { applySendEventFromSpell, type ApplySendEventFromSpellResult } from './sendEventFromSpell.ts';
|
|
50
|
+
import { runSpellScripts } from './applyDeathAndSpellScripts.ts';
|
|
51
|
+
import { deliverScriptMail } from './mail.ts';
|
|
52
|
+
import { applyActivateObjectFromSpell } from './activateObjectFromSpell.ts';
|
|
53
|
+
import { applyOpenLockFromSpell } from './openLockFromSpell.ts';
|
|
54
|
+
import {
|
|
55
|
+
LOCKTYPE_PICKLOCK,
|
|
56
|
+
picklockSkillReq,
|
|
57
|
+
tryLockpickingSkillUp,
|
|
58
|
+
type LockDef,
|
|
59
|
+
} from '../../domain/world/openLock.ts';
|
|
60
|
+
import {
|
|
61
|
+
collectSummonObjectWildFromSpell,
|
|
62
|
+
mergeWildSummoned,
|
|
63
|
+
} from './summonObjectWild.ts';
|
|
64
|
+
import {
|
|
65
|
+
collectSummonObjectSlotFromSpell,
|
|
66
|
+
placeSummonObjectSlot,
|
|
67
|
+
} from './summonObjectSlot.ts';
|
|
68
|
+
import { applyOocResurrectEffect, applyOocSelfResurrectEffect } from './applyOocResurrect.ts';
|
|
69
|
+
import { CREATURE_TYPE } from '../../data/schema.ts';
|
|
70
|
+
import { removeItem, countItem } from '../../domain/items/inventory.ts';
|
|
71
|
+
import { refuseIfDead, refuseIfInCombat } from '../../domain/run/death.ts';
|
|
72
|
+
import {
|
|
73
|
+
ITEM_SUBCLASS_WEAPON_FISHING_POLE,
|
|
74
|
+
ensureFishingPoleEquipped,
|
|
75
|
+
} from '../../domain/professions/professions.ts';
|
|
76
|
+
import { firstFeedableFoodEntry } from './pets.ts';
|
|
77
|
+
import { isPoisonConjureName, isPoisonCraftRecipe, POISONS_SKILL_SPELL } from '../../domain/professions/poisons.ts';
|
|
78
|
+
import type { CombatSession } from '../combat/session-types.ts';
|
|
79
|
+
import type { Game } from './types.ts';
|
|
80
|
+
import type { GameCtx } from './context.ts';
|
|
81
|
+
import type { QuestLog } from '../../domain/quests/questlog.ts';
|
|
82
|
+
import type { DataStore } from '../../data/dataStore.ts';
|
|
83
|
+
|
|
84
|
+
export type OocCastMethodsExtras = {
|
|
85
|
+
journeyTick: (nowMs: number) => void;
|
|
86
|
+
castTeleport: Game['castTeleport'];
|
|
87
|
+
pickPocket: Game['pickPocket'];
|
|
88
|
+
skin: Game['skin'];
|
|
89
|
+
disenchant: Game['disenchant'];
|
|
90
|
+
feedPet: Game['feedPet'];
|
|
91
|
+
garmentsAfterCast: (
|
|
92
|
+
spellId: number,
|
|
93
|
+
targetCreature: number | undefined,
|
|
94
|
+
questlog: QuestLog,
|
|
95
|
+
ds: DataStore,
|
|
96
|
+
log: (msg: string) => void,
|
|
97
|
+
) => QuestLog;
|
|
98
|
+
applySendEventTempSpawns: (fired: ApplySendEventFromSpellResult['fired']) => void;
|
|
99
|
+
/** Open combat/floor session, when one owns the player's live auras and vitals. */
|
|
100
|
+
liveSession: () => CombatSession | null;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export function createOocCastMethodsModule(
|
|
104
|
+
ctx: GameCtx,
|
|
105
|
+
extras: OocCastMethodsExtras,
|
|
106
|
+
): Pick<
|
|
107
|
+
Game,
|
|
108
|
+
'spellCooldownRemaining' | 'castOutOfCombat' | 'cannibalize' | 'cancelAura' | 'canCancelAuraNow'
|
|
109
|
+
> {
|
|
110
|
+
const { ds, state, log, refreshQuests, cap } = ctx;
|
|
111
|
+
const {
|
|
112
|
+
journeyTick,
|
|
113
|
+
castTeleport,
|
|
114
|
+
pickPocket,
|
|
115
|
+
skin,
|
|
116
|
+
disenchant,
|
|
117
|
+
feedPet,
|
|
118
|
+
garmentsAfterCast,
|
|
119
|
+
applySendEventTempSpawns,
|
|
120
|
+
liveSession,
|
|
121
|
+
} = extras;
|
|
122
|
+
|
|
123
|
+
/** spellId → expiresAt (-1 = until cancelled) for every aura on the sheet right now. */
|
|
124
|
+
const auraStamp = (): Map<number, number> => {
|
|
125
|
+
const m = new Map<number, number>();
|
|
126
|
+
for (const a of state.char.activeAuras ?? []) m.set(a.spellId, a.expiresAt ?? -1);
|
|
127
|
+
return m;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
// A dungeon keeps ONE endless session open, and while it is open THAT session owns the player's live
|
|
131
|
+
// auras — so mirror whatever the cast LANDED onto the live unit, replaying the aura's own spell.
|
|
132
|
+
const mirrorNewAurasToLiveUnit = (before: Map<number, number>): void => {
|
|
133
|
+
const live = liveSession();
|
|
134
|
+
if (!live || typeof live.applySpellToUnit !== 'function') return;
|
|
135
|
+
for (const a of state.char.activeAuras ?? []) {
|
|
136
|
+
const prev = before.get(a.spellId);
|
|
137
|
+
if (prev !== undefined && prev === (a.expiresAt ?? -1)) continue;
|
|
138
|
+
const raw = ds.spell(a.spellId);
|
|
139
|
+
if (!raw) continue;
|
|
140
|
+
live.applySpellToUnit('player', resolveCombatSpell(raw, { casterLevel: state.char.level }));
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
// Sheet stand-in for "the holder's caster is the player": only a party area aura the PLAYER
|
|
145
|
+
// knows is own. A pet's Blood Pact and a totem's kit auras have another guid.
|
|
146
|
+
const playerIsAreaAuraCaster = (auraId: number): boolean => {
|
|
147
|
+
const chainOf = (id: number) => ds.spellChain(id);
|
|
148
|
+
for (const id of state.spellbook?.known ?? []) {
|
|
149
|
+
const sp = ds.spell(id);
|
|
150
|
+
if (!isPartyAreaAura(sp)) continue;
|
|
151
|
+
if (id === auraId) return true;
|
|
152
|
+
if (resolveChainPair(id, auraId, chainOf)) return true;
|
|
153
|
+
}
|
|
154
|
+
return false;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
/** The gate's state half, resolved from the session when one owns the auras, else the sheet. */
|
|
158
|
+
const cancelStateFor = (id: number, live: CombatSession | null): AuraCancelState =>
|
|
159
|
+
live?.auraCancelState?.(id) ?? { possessed: false, ownAura: playerIsAreaAuraCaster(id) };
|
|
160
|
+
|
|
161
|
+
/** SpellEffects.cpp:1529–1531 / :4189–4191 ScriptsStart(SCRIPT_TYPE_SPELL) on finish. */
|
|
162
|
+
const applySpellDbScripts = (
|
|
163
|
+
spellId: number,
|
|
164
|
+
castOpts?: { targetCreature?: number; targetGoEntry?: number },
|
|
165
|
+
): void => {
|
|
166
|
+
const rows = ds.spellScripts(spellId);
|
|
167
|
+
if (!rows.length) return;
|
|
168
|
+
const target = castOpts?.targetCreature
|
|
169
|
+
? { kind: 'creature' as const, entry: castOpts.targetCreature, alive: true }
|
|
170
|
+
: castOpts?.targetGoEntry
|
|
171
|
+
? { kind: 'gameobject' as const, entry: castOpts.targetGoEntry, spawned: true }
|
|
172
|
+
: null;
|
|
173
|
+
const applied = runSpellScripts(spellId, rows, {
|
|
174
|
+
questlog: state.questlog,
|
|
175
|
+
inventory: state.inventory,
|
|
176
|
+
itemOf: (e) => ds.item(e),
|
|
177
|
+
bagCap: cap(),
|
|
178
|
+
goRuntime: state.goRuntime,
|
|
179
|
+
goRuntimeKey: (e) => `${state.char.zoneId}:${e}`,
|
|
180
|
+
worldStates: state.worldStates,
|
|
181
|
+
relayScripts: (id) => ds.relayScripts(id),
|
|
182
|
+
questOf: (e) => ds.quest(e),
|
|
183
|
+
log,
|
|
184
|
+
source: { kind: 'player' },
|
|
185
|
+
target,
|
|
186
|
+
onMail: (rec) => deliverScriptMail(ctx, rec, Date.now(), 'Mailbox'),
|
|
187
|
+
});
|
|
188
|
+
state.questlog = applied.questlog;
|
|
189
|
+
if (applied.inventory) state.inventory = applied.inventory;
|
|
190
|
+
if (applied.goRuntime) state.goRuntime = applied.goRuntime;
|
|
191
|
+
if (applied.worldStates) state.worldStates = applied.worldStates;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
return {
|
|
195
|
+
spellCooldownRemaining(spellId: number) {
|
|
196
|
+
const s = ds.spell(spellId);
|
|
197
|
+
if (!s) return 0;
|
|
198
|
+
const own = Math.max(0, (state.spellCooldowns?.[spellId] ?? 0) - Date.now());
|
|
199
|
+
let cat = 0;
|
|
200
|
+
if (s.category != null) cat = Math.max(0, (state.categoryCooldowns?.[s.category] ?? 0) - Date.now());
|
|
201
|
+
return Math.max(own, cat);
|
|
202
|
+
},
|
|
203
|
+
|
|
204
|
+
castOutOfCombat(spellId, opts) {
|
|
205
|
+
const rawSpell = ds.spell(spellId);
|
|
206
|
+
if (!rawSpell) { log(`Failed to cast ${spellId}: Unknown spell`); return { ok: false, reason: 'Unknown spell' }; }
|
|
207
|
+
// Dead cannot cast (buffs/OOC utility). Cite: Spell.cpp CheckCast SPELL_FAILED_CASTER_DEAD
|
|
208
|
+
// (m_caster !IsAlive → fail unless ALLOW_CAST_WHILE_DEAD); refuseIfDead (KI-936).
|
|
209
|
+
if (!hasAttr(rawSpell, SPELL_ATTR.ALLOW_CAST_WHILE_DEAD) && !hasAttr(rawSpell, SPELL_ATTR.PASSIVE)) {
|
|
210
|
+
const dead = refuseIfDead(state.char.health, state.deathFlow);
|
|
211
|
+
if (dead) return dead;
|
|
212
|
+
}
|
|
213
|
+
// Refuse a non-combat spell while the caster's flag is hot: the bar greys these already, this
|
|
214
|
+
// path did not, and Shadowmeld landed mid-fight. Cite: Spell.cpp:4598 IsNonCombatSpell.
|
|
215
|
+
if (isNonCombatSpell(rawSpell)) {
|
|
216
|
+
const busy = refuseIfInCombat(playerCombatFlagSet(liveSession()));
|
|
217
|
+
if (busy) { log(`Failed to cast ${rawSpell.name}: ${busy.reason}`); return busy; }
|
|
218
|
+
}
|
|
219
|
+
// SI5 OOC resolve (+ Create Healthstone Improved rank / TOO_MANY — Warlock.cpp).
|
|
220
|
+
// Berserking haste_mod needs health % (SpellEffects.cpp:1270–1275; KI-125).
|
|
221
|
+
const maxHpOoc = maxHealth(state.char, ds);
|
|
222
|
+
const s = resolveCombatSpell(rawSpell, {
|
|
223
|
+
casterLevel: state.char.level,
|
|
224
|
+
casterHealthPercent: maxHpOoc > 0 ? (state.char.health / maxHpOoc) * 100 : 100,
|
|
225
|
+
casterMaxHealth: maxHpOoc,
|
|
226
|
+
...createHealthstoneInterpretCtx(spellId, state.char, ds),
|
|
227
|
+
});
|
|
228
|
+
if (!knows(state.spellbook, spellId)) { log(`Failed to cast ${s.name}: Not learned`); return { ok: false, reason: 'Not learned' }; }
|
|
229
|
+
if (
|
|
230
|
+
spellId === POISONS_SKILL_SPELL
|
|
231
|
+
|| isPoisonCraftRecipe(ds.recipe(spellId))
|
|
232
|
+
|| (s.effects.some((e) => e.kind === 'conjure') && isPoisonConjureName(s.name))
|
|
233
|
+
) {
|
|
234
|
+
log(`Failed to cast ${s.name}: Craft that from the profession tab`);
|
|
235
|
+
return { ok: false, reason: 'Craft that from the profession tab' };
|
|
236
|
+
}
|
|
237
|
+
{ const hsBlock = createHealthstoneBlockedReason(spellId, s.effects, state.inventory); if (hsBlock) { log(`Failed to cast ${s.name}: ${hsBlock}`); return { ok: false, reason: hsBlock }; } }
|
|
238
|
+
|
|
239
|
+
// Fishing 7620/7731/7732/18248: EquippedItemClass weapon + subclass bit 20.
|
|
240
|
+
// Cite: Spell.cpp TotemCategory / EquippedItem*; ItemPrototype.h subclass 20.
|
|
241
|
+
const poleMask = 1 << ITEM_SUBCLASS_WEAPON_FISHING_POLE;
|
|
242
|
+
if (
|
|
243
|
+
rawSpell.equippedItemClass === 2
|
|
244
|
+
&& ((rawSpell.equippedItemSubClassMask ?? 0) & poleMask) === poleMask
|
|
245
|
+
) {
|
|
246
|
+
const worn = ensureFishingPoleEquipped(state.char, state.inventory, ds);
|
|
247
|
+
if (!worn.ok) {
|
|
248
|
+
log(`Failed to cast ${s.name}: Requires a Fishing Pole`);
|
|
249
|
+
return { ok: false, reason: 'Requires a Fishing Pole' };
|
|
250
|
+
}
|
|
251
|
+
state.char = worn.char;
|
|
252
|
+
state.inventory = worn.inventory;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Form / stance gate (same product rules as combat: NOT_SHAPESHIFT leaves form first).
|
|
256
|
+
const form = (state.char.form ?? 0) | 0;
|
|
257
|
+
const gate = resolveFormCast(s, form);
|
|
258
|
+
if (!gate.ok) {
|
|
259
|
+
log(`Failed to cast ${s.name}: ${gate.reason}`);
|
|
260
|
+
return { ok: false, reason: gate.reason };
|
|
261
|
+
}
|
|
262
|
+
if (gate.leaveForm && form) {
|
|
263
|
+
// Drop form → mana as active power. Strip the form chip too (KI-699 phantom Ghost Wolf).
|
|
264
|
+
const mana = currentMana(state.char);
|
|
265
|
+
state.char.form = undefined;
|
|
266
|
+
state.char.power = mana;
|
|
267
|
+
delete state.char.mana;
|
|
268
|
+
if (state.char.activeAuras) {
|
|
269
|
+
const drop = new Set<number>([...MOBILITY_FORM_SPELL_IDS, ...formSpeedBoostSpellIds(form)]);
|
|
270
|
+
const activeAuras = state.char.activeAuras.filter((a) => {
|
|
271
|
+
if (drop.has(a.spellId)) return false;
|
|
272
|
+
const sp = ds.spell(a.spellId);
|
|
273
|
+
return !sp || !isFormSpell(sp);
|
|
274
|
+
});
|
|
275
|
+
state.char.activeAuras = activeAuras;
|
|
276
|
+
state.char.activeBuffs = getActiveBuffIds({ ...state.char, activeAuras }, Date.now(), ds);
|
|
277
|
+
}
|
|
278
|
+
log(`You leave ${FORM_LABEL[form] || 'form'}.`);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// Hostile damage, debuffs and CC need an enemy target, which OOC has none of, so fail before the
|
|
282
|
+
// spend. Dismiss, feed, possess and learn are self-utility; taming uses its target creature.
|
|
283
|
+
const isDismissPet = s.effects.some((e) => e.kind === 'dismiss_pet');
|
|
284
|
+
const isFeedPet = s.effects.some((e) => e.kind === 'feed_pet');
|
|
285
|
+
const isPossessPet = s.effects.some((e) => e.kind === 'mod_possess_pet');
|
|
286
|
+
const isLearnPetSpell = s.effects.some((e) => e.kind === 'learn_pet_spell');
|
|
287
|
+
const isPetTame = s.role === 'pet_tame';
|
|
288
|
+
if (!isDismissPet && !isFeedPet && !isPossessPet && !isLearnPetSpell && !isPetTame && oocSpellRequiresEnemyTarget(s)) {
|
|
289
|
+
log(`Failed to cast ${s.name}: No target`);
|
|
290
|
+
return { ok: false, reason: 'No target' };
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// A corpse racial reads its target creature type off the last corpse. Eyes of the Beast has a
|
|
294
|
+
// Beast mask on a LIVING pet, not a corpse, so possess is excluded. Cite: Spell.cpp.
|
|
295
|
+
const corpseTypeMask = ((s.targetCreatureTypeMask ?? 0) | 0) > 0
|
|
296
|
+
&& !oocSpellRequiresEnemyTarget(s)
|
|
297
|
+
&& s.role !== 'pet_tame'
|
|
298
|
+
&& !isPossessPet
|
|
299
|
+
? ((s.targetCreatureTypeMask ?? 0) | 0)
|
|
300
|
+
: 0;
|
|
301
|
+
if (corpseTypeMask) {
|
|
302
|
+
const type = state.lastCorpse?.creatureType;
|
|
303
|
+
// type 0 is not edible (passesTargetCreatureType early-allows 0 for unit targets).
|
|
304
|
+
if (type == null || type === 0 || !passesTargetCreatureType(corpseTypeMask, type)) {
|
|
305
|
+
log(`Failed to cast ${s.name}: No edible corpse nearby`);
|
|
306
|
+
return { ok: false, reason: 'No edible corpse nearby' };
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// role pet_heal (Mend Pet / Health Funnel): need a living pet; fail before spend.
|
|
311
|
+
// Cite: combat.ts healTarget when roleOf === 'pet_heal'; KI-105 / KI-130.
|
|
312
|
+
if (s.role === 'pet_heal') {
|
|
313
|
+
if (!state.char.pet) {
|
|
314
|
+
log(`Failed to cast ${s.name}: You have no pet`);
|
|
315
|
+
return { ok: false, reason: 'You have no pet' };
|
|
316
|
+
}
|
|
317
|
+
if (state.char.pet.health <= 0) {
|
|
318
|
+
log(`Failed to cast ${s.name}: Your pet is dead`);
|
|
319
|
+
return { ok: false, reason: 'Your pet is dead' };
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// SPELL_AURA_MOD_POSSESS_PET (128): CheckCast requires GetPet() not charmed.
|
|
324
|
+
// Cite: Spell.cpp:5717–5735; SpellAuras.cpp HandleModPossessPet; KI-729.
|
|
325
|
+
if (isPossessPet) {
|
|
326
|
+
if (!state.char.pet) {
|
|
327
|
+
log(`Failed to cast ${s.name}: You have no pet`);
|
|
328
|
+
return { ok: false, reason: 'You have no pet' };
|
|
329
|
+
}
|
|
330
|
+
if (state.char.pet.health <= 0) {
|
|
331
|
+
log(`Failed to cast ${s.name}: Your pet is dead`);
|
|
332
|
+
return { ok: false, reason: 'Your pet is dead' };
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// SPELL_EFFECT_LEARN_PET_SPELL (57): refuse no/dead pet before spend.
|
|
337
|
+
// Cite: Spell.cpp:5308–5313 CheckCast SPELL_FAILED_NO_PET; SpellEffects.cpp:3393–3397.
|
|
338
|
+
if (isLearnPetSpell) {
|
|
339
|
+
if (!state.char.pet) {
|
|
340
|
+
log(`Failed to cast ${s.name}: You have no pet`);
|
|
341
|
+
return { ok: false, reason: 'You have no pet' };
|
|
342
|
+
}
|
|
343
|
+
if (state.char.pet.health <= 0) {
|
|
344
|
+
log(`Failed to cast ${s.name}: Your pet is dead`);
|
|
345
|
+
return { ok: false, reason: 'Your pet is dead' };
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// FEED_PET needs a living happiness pet and diet food, consuming the item for a 20 s course. The
|
|
350
|
+
// pre-spend gates mirror the resolver and CheckCast. Cite: SpellEffects.cpp:4681-4712.
|
|
351
|
+
if (isFeedPet) {
|
|
352
|
+
if (!state.char.pet) {
|
|
353
|
+
log(`Failed to cast ${s.name}: You have no pet`);
|
|
354
|
+
return { ok: false, reason: 'You have no pet' };
|
|
355
|
+
}
|
|
356
|
+
if (state.char.pet.health <= 0) {
|
|
357
|
+
log(`Failed to cast ${s.name}: Your pet is dead`);
|
|
358
|
+
return { ok: false, reason: 'Your pet is dead' };
|
|
359
|
+
}
|
|
360
|
+
const foodEntry = (opts?.itemEntry != null && opts.itemEntry > 0)
|
|
361
|
+
? opts.itemEntry
|
|
362
|
+
: firstFeedableFoodEntry(ctx);
|
|
363
|
+
if (foodEntry == null) {
|
|
364
|
+
log(`Failed to cast ${s.name}: You need pet food`);
|
|
365
|
+
return { ok: false, reason: 'You need pet food' };
|
|
366
|
+
}
|
|
367
|
+
// Same path as feedPet() API — consume 1 food, start feedRemaining course.
|
|
368
|
+
const fed = feedPet(foodEntry);
|
|
369
|
+
if (!fed.ok) {
|
|
370
|
+
log(`Failed to cast ${s.name}: ${fed.reason ?? 'Cannot feed pet'}`);
|
|
371
|
+
return { ok: false, reason: fed.reason ?? 'Cannot feed pet' };
|
|
372
|
+
}
|
|
373
|
+
state.questlog = creditQuestCompleteFromSpell(
|
|
374
|
+
recordSpellCast(state.questlog, spellId, (e) => ds.quest(e)),
|
|
375
|
+
ds.spell(spellId),
|
|
376
|
+
);
|
|
377
|
+
refreshQuests();
|
|
378
|
+
{
|
|
379
|
+
const now = Date.now();
|
|
380
|
+
const personal = (s.cooldownMs ?? 0) | 0;
|
|
381
|
+
const catMs = (s.category != null && s.category !== 0)
|
|
382
|
+
? ((s.categoryRecoveryMs != null && s.categoryRecoveryMs > 0)
|
|
383
|
+
? s.categoryRecoveryMs
|
|
384
|
+
: personal)
|
|
385
|
+
: 0;
|
|
386
|
+
if (personal > 0) {
|
|
387
|
+
if (!state.spellCooldowns) state.spellCooldowns = {};
|
|
388
|
+
state.spellCooldowns[spellId] = now + personal;
|
|
389
|
+
}
|
|
390
|
+
if (s.category != null && catMs > 0) {
|
|
391
|
+
if (!state.categoryCooldowns) state.categoryCooldowns = {};
|
|
392
|
+
state.categoryCooldowns[s.category] = now + catMs;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
log(`You cast ${s.name}.`);
|
|
396
|
+
return { ok: true, conjured: [] };
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
// A party battle rez needs a dead friendly, and single-player has no party corpse model — refuse
|
|
400
|
+
// before the spend unless self is dead. Reincarnation is separate and always self.
|
|
401
|
+
if (s.effects.some((e) => e.kind === 'resurrect' || e.kind === 'resurrect_pct')) {
|
|
402
|
+
const forceSelf = opts?.reviveTarget === 'self';
|
|
403
|
+
const flow = state.deathFlow;
|
|
404
|
+
const selfDead = !!flow
|
|
405
|
+
&& flow.deathState !== 'ALIVE'
|
|
406
|
+
&& flow.deathState !== 'JUST_ALIVED';
|
|
407
|
+
if (!forceSelf && !selfDead) {
|
|
408
|
+
log(`Failed to cast ${s.name}: No target`);
|
|
409
|
+
return { ok: false, reason: 'No target' };
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
// A summoning ritual needs party clicks after the cast, which solo has no channel for, so refuse
|
|
414
|
+
// before the mana and shard are spent. Cite: SpellEffects.cpp EffectTransmitted.
|
|
415
|
+
{
|
|
416
|
+
const ritualFail = oocSummoningRitualFailReason(s.effects, (entry) => ds.gameObject(entry));
|
|
417
|
+
if (ritualFail) {
|
|
418
|
+
log(`Failed to cast ${s.name}: ${ritualFail}`);
|
|
419
|
+
return { ok: false, reason: ritualFail };
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// Totems are fight-scoped only — no OOC totem entity on char/world. Refuse before
|
|
424
|
+
// mana so castOutOfCombat is not a pure sink (KI-817). Cite: oocCast.oocTotemSummonFailReason.
|
|
425
|
+
{
|
|
426
|
+
const totemFail = oocTotemSummonFailReason(s.effects, s.role);
|
|
427
|
+
if (totemFail) {
|
|
428
|
+
log(`Failed to cast ${s.name}: ${totemFail}`);
|
|
429
|
+
return { ok: false, reason: totemFail };
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
// SPELL_ATTR_EX2_NO_ACTIVE_PETS gate.
|
|
434
|
+
// Cite: Spell.cpp:5877-5890 if player HasAttribute(NO_ACTIVE_PETS) and (GetPetGuid() || HasCharm())
|
|
435
|
+
if (hasAttrEx2(s, SPELL_ATTR_EX2.NO_ACTIVE_PETS)) {
|
|
436
|
+
if (state.char.pet || state.char.storedPet) {
|
|
437
|
+
log(`Failed to cast ${s.name}: You already have a pet`);
|
|
438
|
+
return { ok: false, reason: 'You already have a pet' };
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
// Pet call and revive gates, pre-spend: a living pet out refuses, a dead one needs Revive, no pet
|
|
443
|
+
// at all refuses, and a stored living pet is fine. Cite: Spell.cpp CheckCast ~5555-5580.
|
|
444
|
+
{
|
|
445
|
+
const petGate = oocPetCallReviveFailReason(s.effects, state.char);
|
|
446
|
+
if (petGate) {
|
|
447
|
+
log(`Failed to cast ${s.name}: ${petGate}`);
|
|
448
|
+
return { ok: false, reason: petGate };
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
if (hasAttrEx(rawSpell, SPELL_ATTR_EX.DISMISS_PET_FIRST) && state.char.pet) {
|
|
453
|
+
const name = state.char.pet.name;
|
|
454
|
+
state.char.storedPet = applyPetHappinessPowerDrains(state.char.pet, s.effects);
|
|
455
|
+
state.char.pet = undefined;
|
|
456
|
+
log(`You dismissed ${name}.`);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
// A fixed-entry summon needs a baked creature template before the spend: a missing one used to
|
|
460
|
+
// report success and clear the Imp with no replacement. Cite: SpellEffects.cpp:4565-4570.
|
|
461
|
+
{
|
|
462
|
+
let missingTpl: number | null = null;
|
|
463
|
+
for (const e of s.effects) {
|
|
464
|
+
const kind = e.kind;
|
|
465
|
+
if (kind !== 'summon_possessed' && kind !== 'summon_demon' && kind !== 'summon_pet') continue;
|
|
466
|
+
const c = ('creature' in e ? (e.creature as number) : 0) | 0;
|
|
467
|
+
if (c > 0 && !ds.creature(c)) {
|
|
468
|
+
missingTpl = c;
|
|
469
|
+
break;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
if (missingTpl != null) {
|
|
473
|
+
log(`Failed to cast ${s.name}: Unknown creature`);
|
|
474
|
+
return { ok: false, reason: 'Unknown creature' };
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// Cite: Spell.cpp CalculatePowerCost — POWER_HEALTH uses GetCreateHealth for % costs.
|
|
479
|
+
const armed = findArmedNextCastMod(state.char, s, ds);
|
|
480
|
+
let cost = resolveSpellCost(s, createMana(state.char, ds), createHealth(state.char, ds));
|
|
481
|
+
if (hasAttrEx(s, SPELL_ATTR_EX.USE_ALL_MANA)) {
|
|
482
|
+
if (s.powerType === 'health') cost = state.char.health;
|
|
483
|
+
else if (s.powerType === 'mana') cost = currentMana(state.char);
|
|
484
|
+
else cost = state.char.power;
|
|
485
|
+
}
|
|
486
|
+
// ApplySpellMod COST / CASTING_TIME before TakePower. Cite: Player.h:2575; SPELLMOD_COST=14.
|
|
487
|
+
if (armed?.freeCost) cost = 0;
|
|
488
|
+
else if (armed?.costModPct) cost = Math.max(0, Math.round(cost * (1 + armed.costModPct / 100)));
|
|
489
|
+
if (armed?.costFlat) cost = Math.max(0, cost + armed.costFlat);
|
|
490
|
+
{
|
|
491
|
+
// Form costs and mana spells spend mana, energy and rage spend the active power, and a health
|
|
492
|
+
// cost spends HP — which must be strictly greater than the cost. Cite: Spell.cpp:6383-6387.
|
|
493
|
+
const spendsHealth = s.powerType === 'health';
|
|
494
|
+
const spendsMana = !spendsHealth && (s.powerType === 'mana' || isFormSpell(s) || !!s.costPct);
|
|
495
|
+
const spendsEnergy = s.powerType === 'energy';
|
|
496
|
+
const spendsRage = s.powerType === 'rage';
|
|
497
|
+
if (spendsHealth && cost > 0) {
|
|
498
|
+
if (state.char.health <= cost) {
|
|
499
|
+
log(`Failed to cast ${s.name}: Not enough health`);
|
|
500
|
+
return { ok: false, reason: 'Not enough health' };
|
|
501
|
+
}
|
|
502
|
+
} else if (spendsMana && cost > 0) {
|
|
503
|
+
const mana = currentMana(state.char);
|
|
504
|
+
if (mana < cost) {
|
|
505
|
+
log(`Failed to cast ${s.name}: Not enough mana`);
|
|
506
|
+
return { ok: false, reason: 'Not enough mana' };
|
|
507
|
+
}
|
|
508
|
+
} else if (spendsEnergy && cost > 0 && state.char.power < cost) {
|
|
509
|
+
log(`Failed to cast ${s.name}: Not enough energy`);
|
|
510
|
+
return { ok: false, reason: 'Not enough energy' };
|
|
511
|
+
} else if (spendsRage && cost > 0 && state.char.power < cost) {
|
|
512
|
+
log(`Failed to cast ${s.name}: Not enough rage`);
|
|
513
|
+
return { ok: false, reason: 'Not enough rage' };
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
// Reagent gate: CheckItems then TakeReagents, consumed after the cooldown check so a cooldown
|
|
518
|
+
// refusal does not eat them. Cite: Spell.cpp:6560-6593; :4332-4350.
|
|
519
|
+
const spellReagents = s.reagents ?? [];
|
|
520
|
+
for (const r of spellReagents) {
|
|
521
|
+
if (countItem(state.inventory, r.item) < r.count) {
|
|
522
|
+
const idef = ds.item(r.item);
|
|
523
|
+
const reason = idef
|
|
524
|
+
? `Requires ${r.count}× ${idef.name}`
|
|
525
|
+
: `Missing reagents (item ${r.item})`;
|
|
526
|
+
log(`Failed to cast ${s.name}: ${reason}`);
|
|
527
|
+
return { ok: false, reason };
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
// Cooldown enforcement (per-spell + category shared, e.g. potions). World wall time.
|
|
532
|
+
const cnow = Date.now();
|
|
533
|
+
const ownRem = Math.max(0, (state.spellCooldowns?.[spellId] ?? 0) - cnow);
|
|
534
|
+
let catRem = 0;
|
|
535
|
+
if (s.category != null) catRem = Math.max(0, (state.categoryCooldowns?.[s.category] ?? 0) - cnow);
|
|
536
|
+
if (ownRem > 0 || catRem > 0) {
|
|
537
|
+
log(`Failed to cast ${s.name}: On cooldown`);
|
|
538
|
+
return { ok: false, reason: 'cooldown' };
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// Life Tap pre-spend fizzle (Warlock.cpp OnCheckCast). Cite: KI-043; oocCast.ts.
|
|
542
|
+
{
|
|
543
|
+
const ltFail = lifeTapOocFailReason(s.effects, state.char.health);
|
|
544
|
+
if (ltFail) {
|
|
545
|
+
log(`Failed to cast ${s.name}: ${ltFail}`);
|
|
546
|
+
return { ok: false, reason: ltFail };
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
// The weapon imbue hand has the same eligibility as an item coat — weapon hands only, never a
|
|
551
|
+
// shield — resolved empty-first before the spend so a refusal does not eat mana.
|
|
552
|
+
let resolvedWeaponImbueHand: 'mainhand' | 'offhand' | undefined;
|
|
553
|
+
if (s.effects.some((e) => e.kind === 'weapon_imbue')) {
|
|
554
|
+
const app = ds.enchantApplicator(spellId);
|
|
555
|
+
const picked = resolveTempWeaponImbueHand({
|
|
556
|
+
equipped: state.char.equipped,
|
|
557
|
+
ds,
|
|
558
|
+
app,
|
|
559
|
+
requested: (opts?.slot === 'offhand' || opts?.slot === 'mainhand') ? opts.slot : undefined,
|
|
560
|
+
char: state.char,
|
|
561
|
+
now: cnow,
|
|
562
|
+
mode: 'empty-first',
|
|
563
|
+
});
|
|
564
|
+
if (!picked.ok) {
|
|
565
|
+
if (picked.needsChoose) {
|
|
566
|
+
log(`Failed to cast ${s.name}: Choose a slot`);
|
|
567
|
+
return {
|
|
568
|
+
ok: false,
|
|
569
|
+
reason: 'Choose a slot',
|
|
570
|
+
needsTarget: {
|
|
571
|
+
spellId,
|
|
572
|
+
enchantId: app?.enchantId ?? 0,
|
|
573
|
+
target: { kind: 'self' },
|
|
574
|
+
slots: picked.needsChoose.slots,
|
|
575
|
+
rejected: picked.needsChoose.rejected,
|
|
576
|
+
},
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
log(`Failed to cast ${s.name}: ${picked.reason}`);
|
|
580
|
+
return { ok: false, reason: picked.reason };
|
|
581
|
+
}
|
|
582
|
+
resolvedWeaponImbueHand = picked.hand;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
// City teleports gate mana, cooldown and reagents at the cast, with the power taken on arrival.
|
|
586
|
+
// Empty-effect ranks used to sink mana with the zone unchanged. Cite: game/travel.ts.
|
|
587
|
+
if (s.effects.some((e) => e.kind === 'teleport')) {
|
|
588
|
+
const nowTp = Date.now();
|
|
589
|
+
journeyTick(nowTp);
|
|
590
|
+
const tp = castTeleport(spellId, nowTp);
|
|
591
|
+
if (!tp.ok) {
|
|
592
|
+
log(`Failed to cast ${s.name}: ${tp.reason ?? 'teleport failed'}`);
|
|
593
|
+
return { ok: false, reason: tp.reason ?? 'teleport failed' };
|
|
594
|
+
}
|
|
595
|
+
// OOC cast is atomic: advance past castTime so the portal leg lands (power/CD on arrival).
|
|
596
|
+
const arriveAt = nowTp + Math.max(1, ((s.castTimeMs ?? 0) | 0) + 1);
|
|
597
|
+
journeyTick(arriveAt);
|
|
598
|
+
state.questlog = creditQuestCompleteFromSpell(recordSpellCast(state.questlog, spellId, (e) => ds.quest(e)), ds.spell(spellId));
|
|
599
|
+
refreshQuests();
|
|
600
|
+
log(`You cast ${s.name}.`);
|
|
601
|
+
return { ok: true, conjured: [] };
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
// Astral Recall / hearth teleports — same bind as Hearthstone, no item required.
|
|
605
|
+
// Cite: SpellEffects.cpp EffectTeleportUnits TARGET_LOCATION_CASTER_HOME_BIND; KI-532.
|
|
606
|
+
if (s.effects.some((e) => e.kind === 'teleport_hearth')) {
|
|
607
|
+
const nowTp = Date.now();
|
|
608
|
+
journeyTick(nowTp);
|
|
609
|
+
const bind = state.char.hearthBind;
|
|
610
|
+
if (!bind) {
|
|
611
|
+
log(`Failed to cast ${s.name}: You have no hearthstone bind`);
|
|
612
|
+
return { ok: false, reason: 'You have no hearthstone bind' };
|
|
613
|
+
}
|
|
614
|
+
if (state.instance) {
|
|
615
|
+
log(`Failed to cast ${s.name}: Cannot hearth inside an instance`);
|
|
616
|
+
return { ok: false, reason: 'Cannot hearth inside an instance' };
|
|
617
|
+
}
|
|
618
|
+
// Spend mana/CD before snap (atomic OOC — no multi-minute cast bar in headless).
|
|
619
|
+
{
|
|
620
|
+
const spendsMana = s.powerType === 'mana' || isFormSpell(s) || !!s.costPct;
|
|
621
|
+
if (spendsMana && cost > 0) {
|
|
622
|
+
if (powerType(state.char) === 'mana') state.char.power -= cost;
|
|
623
|
+
else state.char.mana = Math.max(0, (state.char.mana ?? 0) - cost);
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
{
|
|
627
|
+
const personal = (s.cooldownMs ?? 0) | 0;
|
|
628
|
+
if (personal > 0) {
|
|
629
|
+
if (!state.spellCooldowns) state.spellCooldowns = {};
|
|
630
|
+
state.spellCooldowns[spellId] = nowTp + personal;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
state.char = {
|
|
634
|
+
...state.char,
|
|
635
|
+
zoneId: bind.zone,
|
|
636
|
+
journey: undefined,
|
|
637
|
+
};
|
|
638
|
+
state.questlog = creditQuestCompleteFromSpell(recordSpellCast(state.questlog, spellId, (e) => ds.quest(e)), ds.spell(spellId));
|
|
639
|
+
refreshQuests();
|
|
640
|
+
log(`You cast ${s.name}.`);
|
|
641
|
+
return { ok: true, conjured: [] };
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
// Skinning: state.corpse → game.skin. Cite: SpellEffects.cpp:4970–5006 EffectSkinning.
|
|
645
|
+
if (s.effects.some((e) => e.kind === 'skinning')) {
|
|
646
|
+
const sk = skin();
|
|
647
|
+
if (!sk.ok) {
|
|
648
|
+
log(`Failed to cast ${s.name}: ${sk.reason ?? 'Cannot skin'}`);
|
|
649
|
+
return { ok: false, reason: sk.reason ?? 'Cannot skin' };
|
|
650
|
+
}
|
|
651
|
+
{
|
|
652
|
+
const personal = (s.cooldownMs ?? 0) | 0;
|
|
653
|
+
if (personal > 0) {
|
|
654
|
+
if (!state.spellCooldowns) state.spellCooldowns = {};
|
|
655
|
+
state.spellCooldowns[spellId] = Date.now() + personal;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
state.questlog = creditQuestCompleteFromSpell(recordSpellCast(state.questlog, spellId, (e) => ds.quest(e)), ds.spell(spellId));
|
|
659
|
+
refreshQuests();
|
|
660
|
+
log(`You cast ${s.name}.`);
|
|
661
|
+
return { ok: true, conjured: sk.yielded };
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
// Disenchant: itemTarget → existing game.disenchant (destroy + mats + craft skill-up).
|
|
665
|
+
// Cite: SpellEffects.cpp:4640–4666 EffectDisEnchant; domain/professions/enchanting.ts.
|
|
666
|
+
if (s.effects.some((e) => e.kind === 'disenchant')) {
|
|
667
|
+
const itemEntry = (opts?.itemEntry != null && opts.itemEntry > 0) ? opts.itemEntry : 0;
|
|
668
|
+
if (itemEntry <= 0) {
|
|
669
|
+
log(`Failed to cast ${s.name}: No target`);
|
|
670
|
+
return { ok: false, reason: 'No target' };
|
|
671
|
+
}
|
|
672
|
+
const de = disenchant(itemEntry);
|
|
673
|
+
if (!de.ok) {
|
|
674
|
+
log(`Failed to cast ${s.name}: ${de.reason ?? 'Cannot disenchant'}`);
|
|
675
|
+
return { ok: false, reason: de.reason ?? 'Cannot disenchant' };
|
|
676
|
+
}
|
|
677
|
+
{
|
|
678
|
+
const personal = (s.cooldownMs ?? 0) | 0;
|
|
679
|
+
if (personal > 0) {
|
|
680
|
+
if (!state.spellCooldowns) state.spellCooldowns = {};
|
|
681
|
+
state.spellCooldowns[spellId] = Date.now() + personal;
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
state.questlog = creditQuestCompleteFromSpell(recordSpellCast(state.questlog, spellId, (e) => ds.quest(e)), ds.spell(spellId));
|
|
685
|
+
refreshQuests();
|
|
686
|
+
log(`You cast ${s.name}.`);
|
|
687
|
+
return { ok: true, conjured: de.yielded };
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
// Pick Pocket: need a creature target OOC — not a pure no-op while stealthed.
|
|
691
|
+
// Cite: SpellEffects.cpp EffectPickPocket; domain/professions/pickpocket.ts; KI-112.
|
|
692
|
+
if (s.effects.some((e) => e.kind === 'pickpocket')) {
|
|
693
|
+
const creatureEntry = opts?.targetCreature;
|
|
694
|
+
if (creatureEntry == null) {
|
|
695
|
+
log(`Failed to cast ${s.name}: No target`);
|
|
696
|
+
return { ok: false, reason: 'No target' };
|
|
697
|
+
}
|
|
698
|
+
const pp = pickPocket(creatureEntry, { nowMs: Date.now() });
|
|
699
|
+
if (!pp.ok) {
|
|
700
|
+
log(`Failed to cast ${s.name}: ${pp.reason ?? 'pick pocket failed'}`);
|
|
701
|
+
// A resist is a landed hostile cast that did nothing: the mob knows who tried.
|
|
702
|
+
return pp.aggro
|
|
703
|
+
? { ok: false, reason: pp.reason ?? 'pick pocket failed', aggroCreature: creatureEntry }
|
|
704
|
+
: { ok: false, reason: pp.reason ?? 'pick pocket failed' };
|
|
705
|
+
}
|
|
706
|
+
{
|
|
707
|
+
const spendsEnergy = s.powerType === 'energy';
|
|
708
|
+
if (spendsEnergy && cost > 0) state.char.power -= cost;
|
|
709
|
+
}
|
|
710
|
+
const now = Date.now();
|
|
711
|
+
{
|
|
712
|
+
const personal = (s.cooldownMs ?? 0) | 0;
|
|
713
|
+
if (personal > 0) {
|
|
714
|
+
if (!state.spellCooldowns) state.spellCooldowns = {};
|
|
715
|
+
state.spellCooldowns[spellId] = now + personal;
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
state.questlog = creditQuestCompleteFromSpell(recordSpellCast(state.questlog, spellId, (e) => ds.quest(e)), ds.spell(spellId));
|
|
719
|
+
refreshQuests();
|
|
720
|
+
log(`You cast ${s.name}.`);
|
|
721
|
+
return { ok: true, conjured: [] };
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
// Tame Beast's baked effects are a misclassified self attack-power buff, not a tame, so they are
|
|
725
|
+
// not applied: require a beast target and perform the same tame the dedicated path does.
|
|
726
|
+
if (s.role === 'pet_tame') {
|
|
727
|
+
const creatureEntry = opts?.targetCreature;
|
|
728
|
+
if (creatureEntry == null) {
|
|
729
|
+
log(`Failed to cast ${s.name}: No target`);
|
|
730
|
+
return { ok: false, reason: 'No target' };
|
|
731
|
+
}
|
|
732
|
+
const c = ds.creature(creatureEntry);
|
|
733
|
+
if (!c?.tameable) {
|
|
734
|
+
log(`Failed to cast ${s.name}: That beast cannot be tamed`);
|
|
735
|
+
return { ok: false, reason: 'That beast cannot be tamed' };
|
|
736
|
+
}
|
|
737
|
+
// Spend resource (same rules as the generic path below).
|
|
738
|
+
{
|
|
739
|
+
const spendsHealth = s.powerType === 'health';
|
|
740
|
+
const spendsMana = !spendsHealth && (s.powerType === 'mana' || isFormSpell(s) || !!s.costPct);
|
|
741
|
+
const spendsEnergy = s.powerType === 'energy';
|
|
742
|
+
const spendsRage = s.powerType === 'rage';
|
|
743
|
+
if (spendsHealth && cost > 0) {
|
|
744
|
+
state.char.health = Math.max(0, state.char.health - cost);
|
|
745
|
+
} else if (spendsMana && cost > 0) {
|
|
746
|
+
if (powerType(state.char) === 'mana') state.char.power -= cost;
|
|
747
|
+
else state.char.mana = Math.max(0, (state.char.mana ?? 0) - cost);
|
|
748
|
+
} else if ((spendsEnergy || spendsRage) && cost > 0) {
|
|
749
|
+
state.char.power -= cost;
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
const pet = newPet(creatureEntry, ds, state.char);
|
|
753
|
+
if (!pet) {
|
|
754
|
+
log(`Failed to cast ${s.name}: Unknown beast`);
|
|
755
|
+
return { ok: false, reason: 'Unknown beast' };
|
|
756
|
+
}
|
|
757
|
+
state.char.pet = pet;
|
|
758
|
+
const now = Date.now();
|
|
759
|
+
{
|
|
760
|
+
const personal = (s.cooldownMs ?? 0) | 0;
|
|
761
|
+
const catMs = (s.category != null && s.category !== 0)
|
|
762
|
+
? ((s.categoryRecoveryMs != null && s.categoryRecoveryMs > 0)
|
|
763
|
+
? s.categoryRecoveryMs
|
|
764
|
+
: personal)
|
|
765
|
+
: 0;
|
|
766
|
+
if (personal > 0) {
|
|
767
|
+
if (!state.spellCooldowns) state.spellCooldowns = {};
|
|
768
|
+
state.spellCooldowns[spellId] = now + personal;
|
|
769
|
+
}
|
|
770
|
+
if (s.category != null && catMs > 0) {
|
|
771
|
+
if (!state.categoryCooldowns) state.categoryCooldowns = {};
|
|
772
|
+
state.categoryCooldowns[s.category] = now + catMs;
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
// FO3: successful cast credits spellCastTargets.
|
|
776
|
+
state.questlog = recordSpellCast(state.questlog, spellId, (e) => ds.quest(e));
|
|
777
|
+
refreshQuests();
|
|
778
|
+
log(`You tamed ${c.name}.`);
|
|
779
|
+
return { ok: true, conjured: [] };
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
// Spend reagents (after all fail-checks).
|
|
783
|
+
for (const r of spellReagents) {
|
|
784
|
+
state.inventory = removeItem(state.inventory, r.item, r.count)[0];
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
// Spend resource. Cite: Spell.cpp TakePower — POWER_HEALTH → ModifyHealth(-cost).
|
|
788
|
+
{
|
|
789
|
+
const spendsHealth = s.powerType === 'health';
|
|
790
|
+
const spendsMana = !spendsHealth && (s.powerType === 'mana' || isFormSpell(s) || !!s.costPct);
|
|
791
|
+
const spendsEnergy = s.powerType === 'energy';
|
|
792
|
+
const spendsRage = s.powerType === 'rage';
|
|
793
|
+
if (spendsHealth && cost > 0) {
|
|
794
|
+
state.char.health = Math.max(0, state.char.health - cost);
|
|
795
|
+
} else if (spendsMana && cost > 0) {
|
|
796
|
+
if (powerType(state.char) === 'mana') state.char.power -= cost;
|
|
797
|
+
else state.char.mana = Math.max(0, (state.char.mana ?? 0) - cost);
|
|
798
|
+
} else if ((spendsEnergy || spendsRage) && cost > 0) {
|
|
799
|
+
state.char.power -= cost;
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
const conjured: LootDrop[] = [];
|
|
804
|
+
const now = Date.now();
|
|
805
|
+
const aurasBeforeCast = auraStamp();
|
|
806
|
+
// Stealth toggle: recasting Stealth/Prowl while the aura is up cancels it (Classic).
|
|
807
|
+
const alreadyStealthed = s.effects.some((e) => e.kind === 'stealth')
|
|
808
|
+
&& (state.char.activeAuras ?? []).some((a) => a.spellId === spellId);
|
|
809
|
+
// RemoveAurasOnCast(AURA_INTERRUPT_FLAG_ACTION) at cast start — the world half of the strip
|
|
810
|
+
// combat already runs. Cite: Spell.cpp:2941-2944; Unit.cpp:5239.
|
|
811
|
+
if (castIsAnAction(s)) {
|
|
812
|
+
const stripped = removeCharAurasWithInterruptFlags(
|
|
813
|
+
state.char, AURA_INTERRUPT.ACTION, ds, s, liveSession(),
|
|
814
|
+
);
|
|
815
|
+
for (const gone of stripped) log(`${gone.name} fades.`);
|
|
816
|
+
}
|
|
817
|
+
if (alreadyStealthed && isStealthSpell(s)) {
|
|
818
|
+
state.char.activeAuras = pruneExpiredAuras(state.char.activeAuras, now)
|
|
819
|
+
.filter((a) => a.spellId !== spellId);
|
|
820
|
+
if (isStealthShapeshift((state.char.form ?? 0) | 0)) {
|
|
821
|
+
state.char.form = undefined;
|
|
822
|
+
}
|
|
823
|
+
log(`You leave ${s.name}.`);
|
|
824
|
+
} else if (isDismissPet) {
|
|
825
|
+
// DISMISS_PET, with its optional happiness drain, which runs on the live pet before the
|
|
826
|
+
// unsummon. Cite: SpellEffects.cpp:1750-1791 and :4714-4729.
|
|
827
|
+
if (!state.char.pet) {
|
|
828
|
+
log(`Failed to cast ${s.name}: You have no pet`);
|
|
829
|
+
return { ok: false, reason: 'You have no pet' };
|
|
830
|
+
}
|
|
831
|
+
// CMaNGOS: "not let dismiss dead pet". Cite: SpellEffects.cpp:4721–4723 EffectDismissPet.
|
|
832
|
+
if (state.char.pet.health <= 0) {
|
|
833
|
+
log(`Failed to cast ${s.name}: Your pet is dead`);
|
|
834
|
+
return { ok: false, reason: 'Your pet is dead' };
|
|
835
|
+
}
|
|
836
|
+
const name = state.char.pet.name;
|
|
837
|
+
state.char.storedPet = applyPetHappinessPowerDrains(state.char.pet, s.effects);
|
|
838
|
+
state.char.pet = undefined;
|
|
839
|
+
log(`You dismissed ${name}.`);
|
|
840
|
+
} else {
|
|
841
|
+
// Beneficial OOC effects + SPELL_EFFECT_TRIGGER_SPELL expansion (Vanish → stealth).
|
|
842
|
+
// Cite: game/oocCastEffects.ts; SpellEffects.cpp EffectTriggerSpell; KI-458.
|
|
843
|
+
const applied = applyOocCastEffects({
|
|
844
|
+
spellId,
|
|
845
|
+
spell: s,
|
|
846
|
+
char: state.char,
|
|
847
|
+
inventory: state.inventory,
|
|
848
|
+
ds,
|
|
849
|
+
now, alreadyStealthed, log,
|
|
850
|
+
weaponImbueHand: resolvedWeaponImbueHand,
|
|
851
|
+
// Only the PLAYER's own cast carries a spellbook, and only a shift reads it (Furor).
|
|
852
|
+
knownSpellIds: state.spellbook?.known,
|
|
853
|
+
rng: mulberry32(hashSeed(state.rngSeed, state.fightCounter++)),
|
|
854
|
+
});
|
|
855
|
+
state.char = applied.char;
|
|
856
|
+
state.inventory = applied.inventory;
|
|
857
|
+
conjured.push(...applied.conjured);
|
|
858
|
+
// These two stay here rather than in the peeled effects module because they need the whole
|
|
859
|
+
// GameState: resurrect resolves a revive target, and the cooldown reset rewrites the maps.
|
|
860
|
+
for (const eff of s.effects) {
|
|
861
|
+
if (eff.kind === 'resurrect' || eff.kind === 'resurrect_pct') {
|
|
862
|
+
log(applyOocResurrectEffect(state, ds, eff, s.name, opts?.reviveTarget === 'self'));
|
|
863
|
+
} else if (eff.kind === 'self_resurrect') {
|
|
864
|
+
// Reincarnation / EffectSelfResurrect — always self. Cite: SpellEffects.cpp:4937.
|
|
865
|
+
log(applyOocSelfResurrectEffect(state, ds, eff, s.name));
|
|
866
|
+
} else if (eff.kind === 'reset_cooldowns') {
|
|
867
|
+
applyResetCooldownsWorld(eff.scope, spellId, state.spellCooldowns, state.categoryCooldowns, state.spellbook.known, (id) => ds.spell(id));
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
// SUMMON_OBJECT_WILD places temporary world gameobjects with no owner. It needs GameState, so
|
|
871
|
+
// it sits beside resurrect for the same reason. Cite: SpellEffects.cpp:3620-3662.
|
|
872
|
+
{
|
|
873
|
+
const wilds = collectSummonObjectWildFromSpell(s, now);
|
|
874
|
+
if (wilds.length) {
|
|
875
|
+
state.wildSummonedObjects = mergeWildSummoned(state.wildSummonedObjects, wilds, now);
|
|
876
|
+
for (const w of wilds) {
|
|
877
|
+
const goName = ds.gameObject(w.goEntry)?.name ?? `object ${w.goEntry}`;
|
|
878
|
+
log(`You summon ${goName}.`);
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
const slots = collectSummonObjectSlotFromSpell(s, now);
|
|
882
|
+
if (slots.length) {
|
|
883
|
+
state.objectSlots = placeSummonObjectSlot(state.objectSlots, slots, now);
|
|
884
|
+
for (const w of slots) {
|
|
885
|
+
const goName = ds.gameObject(w.goEntry)?.name ?? `object ${w.goEntry}`;
|
|
886
|
+
log(`You summon ${goName}.`);
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
// DropAuraCharge after a successful matching cast — the world chip must go with the combat one.
|
|
893
|
+
// Cite: Player.cpp:16843–16855 RemoveSpellMods; SpellAuras.cpp:5750 DropAuraCharge.
|
|
894
|
+
if (armed) state.char = dropNextCastAura(state.char, armed.spellId, ds, now);
|
|
895
|
+
|
|
896
|
+
// Charge / similar: spell-level rage grant (not an effect kind). Cap at rage max.
|
|
897
|
+
// Cite: combat.ts cast path ~5043 gainRage(spell.rageGenerated).
|
|
898
|
+
if (s.rageGenerated && s.rageGenerated > 0 && powerType(state.char) === 'rage') {
|
|
899
|
+
const max = maxPower(state.char, ds);
|
|
900
|
+
state.char.power = Math.min(max, state.char.power + s.rageGenerated);
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
// A successful OOC cast credits its spell cast targets and quest completion. A cast on a GO
|
|
904
|
+
// credits the GO too, and the garments heal credits TalkedToCreature on the patient.
|
|
905
|
+
if (opts?.targetGoEntry) {
|
|
906
|
+
state.questlog = recordCastedCreatureOrGO(
|
|
907
|
+
state.questlog,
|
|
908
|
+
opts.targetGoEntry,
|
|
909
|
+
spellId,
|
|
910
|
+
(e) => ds.quest(e),
|
|
911
|
+
);
|
|
912
|
+
state.questlog = creditQuestCompleteFromSpell(state.questlog, ds.spell(spellId));
|
|
913
|
+
} else {
|
|
914
|
+
state.questlog = creditQuestCompleteFromSpell(recordSpellCast(state.questlog, spellId, (e) => ds.quest(e)), ds.spell(spellId));
|
|
915
|
+
state.questlog = garmentsAfterCast(spellId, opts?.targetCreature, state.questlog, ds, log);
|
|
916
|
+
}
|
|
917
|
+
// SPELL_EFFECT_SEND_EVENT — StartEvents_Event(misc). Cite: SpellEffects.cpp:1794–1798.
|
|
918
|
+
{
|
|
919
|
+
const se = applySendEventFromSpell(
|
|
920
|
+
state.questlog,
|
|
921
|
+
s,
|
|
922
|
+
(id) => ds.eventScripts(id),
|
|
923
|
+
log,
|
|
924
|
+
(e) => ds.quest(e),
|
|
925
|
+
);
|
|
926
|
+
state.questlog = se.log;
|
|
927
|
+
applySendEventTempSpawns(se.fired);
|
|
928
|
+
}
|
|
929
|
+
// dbscripts_on_spell — same finish moment as SEND_EVENT. Cite: SpellEffects.cpp:1529–1531.
|
|
930
|
+
applySpellDbScripts(spellId, opts);
|
|
931
|
+
// SPELL_EFFECT_ACTIVATE_OBJECT — GameObjectActions on targetGoEntry (gameObjTarget).
|
|
932
|
+
// No target → no-op (C++ if (!gameObjTarget) return). Cite: SpellEffects.cpp:4377–4482.
|
|
933
|
+
{
|
|
934
|
+
const goEntry = opts?.targetGoEntry;
|
|
935
|
+
const ao = applyActivateObjectFromSpell(s, {
|
|
936
|
+
targetGoEntry: goEntry,
|
|
937
|
+
goRuntime: state.goRuntime,
|
|
938
|
+
goRuntimeKey: (entry) => `${state.char.zoneId}:${entry}`,
|
|
939
|
+
wildSummonedObjects: state.wildSummonedObjects,
|
|
940
|
+
goName: goEntry ? (ds.gameObject(goEntry)?.name) : undefined,
|
|
941
|
+
});
|
|
942
|
+
if (ao.goRuntime) state.goRuntime = ao.goRuntime;
|
|
943
|
+
if (ao.wildSummonedObjects) state.wildSummonedObjects = ao.wildSummonedObjects;
|
|
944
|
+
for (const a of ao.applied) log(a.message);
|
|
945
|
+
}
|
|
946
|
+
// SPELL_EFFECT_OPEN_LOCK (33) / OPEN_LOCK_ITEM (59) — EffectOpenLock on GO / item.
|
|
947
|
+
// No target → no-op (C++ :2217–2228). Cite: SpellEffects.cpp:2204–2274; openLockFromSpell.ts.
|
|
948
|
+
{
|
|
949
|
+
const goEntry = opts?.targetGoEntry;
|
|
950
|
+
const go = goEntry ? ds.gameObject(goEntry) : undefined;
|
|
951
|
+
const lockDef = go?.lockId != null
|
|
952
|
+
? (ds.lock(go.lockId) as LockDef | undefined)
|
|
953
|
+
: undefined;
|
|
954
|
+
const ol = applyOpenLockFromSpell(s, {
|
|
955
|
+
targetGoEntry: goEntry,
|
|
956
|
+
lock: lockDef,
|
|
957
|
+
goRuntime: state.goRuntime,
|
|
958
|
+
goRuntimeKey: (entry) => `${state.char.zoneId}:${entry}`,
|
|
959
|
+
targetName: go?.name,
|
|
960
|
+
});
|
|
961
|
+
if (ol.goRuntime) state.goRuntime = ol.goRuntime;
|
|
962
|
+
for (const a of ol.applied) {
|
|
963
|
+
log(a.message);
|
|
964
|
+
// UpdateGatherSkill when open succeeded via picklock skill case.
|
|
965
|
+
// Cite: SpellEffects.cpp:2232–2244; skillId from CanOpenLock SkillByLockType.
|
|
966
|
+
if (
|
|
967
|
+
(a.open || a.unlocked) &&
|
|
968
|
+
(a.lockType === LOCKTYPE_PICKLOCK || (a.lockType == null && picklockSkillReq(lockDef) > 0))
|
|
969
|
+
) {
|
|
970
|
+
const rngLp = mulberry32(hashSeed(state.rngSeed, state.fightCounter++));
|
|
971
|
+
const gain = tryLockpickingSkillUp(
|
|
972
|
+
state.char.combatSkills,
|
|
973
|
+
picklockSkillReq(lockDef),
|
|
974
|
+
(p) => rngLp.chance(p),
|
|
975
|
+
);
|
|
976
|
+
if (gain.map) state.char = { ...state.char, combatSkills: gain.map };
|
|
977
|
+
if (gain.up != null) log(`Your lockpicking skill has increased to ${gain.up}.`);
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
refreshQuests();
|
|
982
|
+
|
|
983
|
+
// Start this cast's cooldowns, preferring the split personal and category recovery off the
|
|
984
|
+
// category recovery time. Cite: SpellMgr.h GetSpellRecoveryTime; spells/recovery.ts.
|
|
985
|
+
{
|
|
986
|
+
const personal = (s.cooldownMs ?? 0) | 0;
|
|
987
|
+
const catMs = (s.category != null && s.category !== 0)
|
|
988
|
+
? ((s.categoryRecoveryMs != null && s.categoryRecoveryMs > 0)
|
|
989
|
+
? s.categoryRecoveryMs
|
|
990
|
+
: personal)
|
|
991
|
+
: 0;
|
|
992
|
+
if (personal > 0) {
|
|
993
|
+
if (!state.spellCooldowns) state.spellCooldowns = {};
|
|
994
|
+
state.spellCooldowns[spellId] = now + personal;
|
|
995
|
+
}
|
|
996
|
+
if (s.category != null && catMs > 0) {
|
|
997
|
+
if (!state.categoryCooldowns) state.categoryCooldowns = {};
|
|
998
|
+
state.categoryCooldowns[s.category] = now + catMs;
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
// One feed per corpse (same as cannibalize()).
|
|
1003
|
+
if (corpseTypeMask) state.lastCorpse = null;
|
|
1004
|
+
|
|
1005
|
+
mirrorNewAurasToLiveUnit(aurasBeforeCast);
|
|
1006
|
+
|
|
1007
|
+
if (!isFormSpell(s)) log(`You cast ${s.name}.`);
|
|
1008
|
+
return { ok: true, conjured };
|
|
1009
|
+
},
|
|
1010
|
+
|
|
1011
|
+
cannibalize() {
|
|
1012
|
+
// The dead cannot cannibalize: CheckCast fails a dead caster unless the spell may be cast while
|
|
1013
|
+
// dead. Cite: Spell.cpp:4586 SPELL_FAILED_CASTER_DEAD.
|
|
1014
|
+
{
|
|
1015
|
+
const dead = refuseIfDead(state.char.health, state.deathFlow);
|
|
1016
|
+
if (dead) return dead;
|
|
1017
|
+
}
|
|
1018
|
+
// The Forsaken devour a fresh Humanoid or Undead corpse to recover health out of combat, gated
|
|
1019
|
+
// on race, on having learned Cannibalize, and on a suitable corpse — one feed per corpse.
|
|
1020
|
+
const CANNIBALIZE = 20577, HEAL_FRAC = 0.35;
|
|
1021
|
+
if (combatantCreatureType(state.char) !== CREATURE_TYPE.UNDEAD) return { ok: false, reason: 'Only the Forsaken can cannibalize' };
|
|
1022
|
+
if (!knows(state.spellbook, CANNIBALIZE)) return { ok: false, reason: 'You have not learned Cannibalize' };
|
|
1023
|
+
const type = state.lastCorpse?.creatureType;
|
|
1024
|
+
if (type !== CREATURE_TYPE.HUMANOID && type !== CREATURE_TYPE.UNDEAD) return { ok: false, reason: 'No edible corpse nearby' };
|
|
1025
|
+
const max = maxHealth(state.char, ds);
|
|
1026
|
+
const before = state.char.health;
|
|
1027
|
+
state.char.health = Math.min(max, before + Math.round(max * HEAL_FRAC));
|
|
1028
|
+
state.lastCorpse = null; // consumed
|
|
1029
|
+
const restored = state.char.health - before;
|
|
1030
|
+
log(`You feast on the corpse, restoring ${restored} health.`);
|
|
1031
|
+
return { ok: true, restored };
|
|
1032
|
+
},
|
|
1033
|
+
|
|
1034
|
+
cancelAura(spellId: number) {
|
|
1035
|
+
const id = spellId | 0;
|
|
1036
|
+
const sp = ds.spell(id);
|
|
1037
|
+
if (!sp) return { ok: false, reason: CANCEL_AURA_REFUSAL_TEXT['unknown-spell'] };
|
|
1038
|
+
const name = sp.name || `spell ${id}`;
|
|
1039
|
+
|
|
1040
|
+
// Session: ActiveEffect.source. Sheet: playerIsAreaAuraCaster (player guid, not pet/totem).
|
|
1041
|
+
// Cite: SpellHandler.cpp:446,484.
|
|
1042
|
+
const live = liveSession();
|
|
1043
|
+
const refusal = auraCancelRefusal(sp, cancelStateFor(id, live));
|
|
1044
|
+
if (refusal) return { ok: false, reason: CANCEL_AURA_REFUSAL_TEXT[refusal] };
|
|
1045
|
+
|
|
1046
|
+
// Two stores hold auras, and on a floor usually only the session does: it owns the
|
|
1047
|
+
// player's live auras from zone-in to zone-out, so a floor-gained aura is off the sheet.
|
|
1048
|
+
const auras = state.char.activeAuras;
|
|
1049
|
+
const onSheet = (auras ?? []).some((a) => a.spellId === id)
|
|
1050
|
+
|| (state.char.activeBuffs ?? []).includes(id);
|
|
1051
|
+
const onUnit = !!live?.playerView().buffs.some((b) => (b.spellId | 0) === id);
|
|
1052
|
+
if (!onSheet && !onUnit) return { ok: false, reason: `You are not affected by ${name}` };
|
|
1053
|
+
|
|
1054
|
+
if (onSheet) {
|
|
1055
|
+
// getActiveBuffIds derives activeBuffs from activeAuras whenever that list exists; a
|
|
1056
|
+
// legacy save with no activeAuras holds ids only in activeBuffs, hence the 2nd filter.
|
|
1057
|
+
if (auras !== undefined) state.char.activeAuras = auras.filter((a) => a.spellId !== id);
|
|
1058
|
+
state.char.activeBuffs = getActiveBuffIds(state.char, Date.now(), ds).filter((b) => b !== id);
|
|
1059
|
+
// A +Int/+Sta buff leaving shrinks the pools it grew. clampResourcePools returns a copy.
|
|
1060
|
+
state.char = clampResourcePools(state.char, ds);
|
|
1061
|
+
}
|
|
1062
|
+
// Cite: sessionApi.ts:1438 removeAurasDueToSpell -> Unit.cpp:5085
|
|
1063
|
+
// RemoveAurasDueToSpellByCancel (AURA_REMOVE_BY_CANCEL).
|
|
1064
|
+
live?.removeAurasDueToSpell('player', id);
|
|
1065
|
+
|
|
1066
|
+
log(`${name} fades from you.`);
|
|
1067
|
+
return { ok: true, name };
|
|
1068
|
+
},
|
|
1069
|
+
|
|
1070
|
+
canCancelAuraNow(spellId: number) {
|
|
1071
|
+
const id = spellId | 0;
|
|
1072
|
+
const sp = ds.spell(id);
|
|
1073
|
+
if (!sp) return false;
|
|
1074
|
+
return auraCancelRefusal(sp, cancelStateFor(id, liveSession())) === null;
|
|
1075
|
+
},
|
|
1076
|
+
};
|
|
1077
|
+
}
|