Commit Graph
855 Commits
Author SHA1 Message Date
luis ae2e9ffda5 same 2026-03-13 21:55:19 -03:00
luis 469318460f Reduce memory 2026-03-13 21:53:10 -03:00
luis f6b9191c9f fix build 2026-03-13 21:49:44 -03:00
luis 62918918a9 remove 2026-03-13 21:34:41 -03:00
luis c47ddd83bf Housing: Audit DB2 field names against WoWDBDefs, wire CriteriaTree-based initiative task matching
Comprehensive audit of all neighborhood and housing DB2 tables against
WoWDBDefs canonical field definitions. Renames all misnamed fields across
DB2Structure.h, DB2LoadInfo.h, and internal cache structs in HousingMgr.h.

Key field corrections across 12 DB2 tables:
- NeighborhoodMap: Radius→EntryRotation, PlotCount→UiTextureKitID, FactionRestriction→Flags
- NeighborhoodNameGen: Suffix→Middle, FullName→Suffix
- HouseTheme: IconFileDataID→Flags, CategoryID→ParentThemeID
- HouseDecorMaterial: 5 fields renamed (WMOMaterialReference, MaterialTextureIndex, etc.)
- HouseLevelRewardInfo: HouseLevelID→HouseLevelDataID, RewardType→Field_4, RewardValue→IconFileDataID
- InitiativeCycle: Duration→HouseXPCap
- InitiativeMilestone: 4 fields renamed (MilestoneOrderIndex, RequiredContributionAmount, etc.)
- InitiativeReward: 7 fields renamed (Money, DecorID, DecorQuantity, Favor, RewardQuestID, etc.)
- InitiativeTask: 6 fields renamed (CriteriaTreeID, QuestID, ProgressContributionAmount, etc.)
- DecorCategory/DecorSubcategory/DecorDyeSlot: display fields renamed

Logic bugs revealed and fixed by the audit:
- Budget wiring removed (DB2 has no budget type/value; budgets come from hardcoded table)
- Initiative task type filtering removed (CriteriaTreeID is a FK, not a type enum)
- Initiative target counts fixed (was using QuestID as threshold, now ProgressContributionAmount)
- Initiative duration sourced from NeighborhoodInitiative.Duration, not InitiativeCycle.HouseXPCap
- Initiative rewards rewritten to use correct DB2 fields (Money, DecorID, Favor, etc.)
- Plot count derived from actual plot data instead of misnamed UiTextureKitID field
- NeighborhoodMgr faction checks updated to use Flags with confirmed bitmask values

CriteriaTree-based initiative task matching:
- Replace 4 ad-hoc OnPlayerAction() calls that used non-existent TaskType enum (1-4)
- Add single hook in CriteriaHandler::UpdateCriteria after validation passes
- BuildCriteriaIndex() walks each task's CriteriaTree to find leaf Criteria entries,
  builds reverse index CriteriaID → (neighborhood, initiative, task) for O(1) lookup
- OnCriteriaProgress() matches criteria fires against active initiative tasks,
  covering all 250+ criteria types (kills, crafting, gathering, quests, etc.) automatically
- Index rebuilt on initiative start/complete to stay current
2026-03-13 21:24:12 -03:00
Shauren 7274ff07fb Core/Misc: Reduce memory usage when data query cache is disabled in config
Signed-off-by: luis <[email protected]>
2026-03-13 19:34:15 -03:00
Shauren 291526eebb Core/Misc: Add missing includes and remove unneccessary Bag::GetDebugInfo override
Signed-off-by: luis <[email protected]>
2026-03-13 19:33:06 -03:00
luis 1473595f13 log 2026-03-13 19:30:20 -03:00
luis d9c86296b1 typo 2026-03-13 02:58:36 -03:00
luis 59d8341d7f garrison_commandscript 2026-03-13 02:57:07 -03:00
luis c5eb1cc2ad Fix mem leak and fix garr buildings ui 2026-03-13 02:06:04 -03:00
luis af95f1df16 try fix garr ui 2026-03-13 01:49:28 -03:00
luis f2de90e74c CRITICAL FIX: Correct destination Z to ground level to prevent flying or underground movement 2026-03-12 21:35:53 -03:00
luis c85fdc5e58 fix bg bot part 1 2026-03-12 21:27:11 -03:00
luis 48630fdc38 typo 2026-03-12 20:43:49 -03:00
luis 5d670be3c8 try fix bg playerbots 2026-03-12 20:12:13 -03:00
Shauren 5badcaaf3c Core/Spells: Fixed spell visual selection
Signed-off-by: luis <[email protected]>
2026-03-12 19:49:00 -03:00
Shauren 9e0d2040f2 Core/Misc: Remove outdated TODO comment
Signed-off-by: luis <[email protected]>
2026-03-12 19:44:25 -03:00
Shauren 786dee89e2 Scripts/Spells: Handle haranir Shadowy Apparitions spell visual
Signed-off-by: luis <[email protected]>
2026-03-12 19:43:26 -03:00
Céfiro_Caecias b6293c49ad DB/World: DBErrors Fixes 2026-03-12 12:24:17 -03:00
luis 4c1530fb2e missing sql 2026-03-12 08:46:19 -03:00
luis 1029149df0 Pet Battles: Teleport player behind pet at battle start
PlayerPositions in SMSG_PET_BATTLE_FINALIZE_LOCATION does not move the
player character. Use NearTeleportTo to explicitly position the player
5 units behind the midpoint along the facing axis.
2026-03-12 08:38:20 -03:00
luis 05828b9eac Pet Battles: Fix weather env slot, generic detection, multi-hit overkill
- Weather now targets environment slot 2 (PBOID 8 / PetbattleEnviros::Weather)
  instead of slot 0 (Pad0), matching client expectations
- Replace hardcoded weather ability name list with generic DB2-driven detection:
  PropsID chain walk + reverse AuraBattlePetAbilityID walk + BattlePetAbilityState
  diagnostic logging to discover remaining weather abilities
- Multi-hit abilities now stop when the target dies (prevents overkill)
- Battle positioning: offset player 5 units behind pet along facing axis
2026-03-12 08:37:35 -03:00
luis cf2fcb272a Pet Battles: Implement weather system and battle positioning 2026-03-12 08:35:37 -03:00
luis 7bf6bcb46c Pet Battles: Add effect properties mapping dump for diagnostics
The BattlePetEffectPropertiesID values in the DB2 don't map 0-18
sequentially — they're arbitrary IDs (222, 26, 24, etc.). Add startup
logging that dumps all unique PropertiesIDs with their ParamLabel
strings and usage counts, so we can build the correct mapping.

Also improve the UNHANDLED effect warning to include all 6 Param values
and the ParamLabel strings from the DB2, making the logs self-documenting.
2026-03-12 08:33:41 -03:00
luis 8d332b0643 Pet Battles: Fix wild battle pet marking not working
Two bugs prevented TryMarkAsWildBattlePet() from ever marking critters:

1. Init order: BattlePetMgr::Initialize() ran AFTER sMapMgr->Initialize(),
   so the species-by-creature map was empty during creature spawning.
   Moved battle pet initialization before map system startup.

2. Respawn flag wipe: TryMarkAsWildBattlePet() ran BEFORE
   setDeathState(JUST_RESPAWNED), which calls ReplaceAllNpcFlags from
   template, wiping the dynamically added UNIT_NPC_FLAG_WILD_BATTLE_PET.
   Moved TryMarkAsWildBattlePet() to after setDeathState.
2026-03-12 08:32:18 -03:00
luis 6df914d395 Pet Battles: Fix weather auras, multi-turn auras, and pet death continuation
- Move TickWeather() inside AURA_PROCESSING_BEGIN/END block so client
  processes weather effects correctly (was outside the wrapper)
- Emit AURA_CHANGE for environment auras each round with CurrentRound
  increment (was missing — pet auras had this but weather did not)
- Add AURA_APPLY/AURA_CANCEL for multi-turn abilities so client shows
  buff icon during multi-turn sequences (Burrow, Lift-Off, etc.)
- Fix HandlePetBattleInput to only accept input during ROUND_IN_PROGRESS
  state, preventing ProcessRound from firing with dead front pet during
  WAITING_FOR_FRONT_PET state
2026-03-12 08:30:37 -03:00
luis 38cd0bf7d6 Pet Battles: Fix AFK timeout triggering immediately
Move _roundTimerSecs increment inside the 1-second tick block.
Previously it incremented every Update() call (~100ms), reaching
the 45s threshold in ~4.5 seconds instead of 45 seconds.
2026-03-12 08:28:37 -03:00
luis ade323f7b3 Pet Battles: PR readiness fixes — validation, timeouts, logging, cleanup
- Add per-round AFK timeout (30s + 15s grace, auto-forfeit)
- Add input validation: MoveType range check, duplicate input guard,
  battle state checks, distance check for wild battles, queue loadout check
- Fix 28 TC_LOG_ERROR → TC_LOG_DEBUG/WARN for non-error messages
- Send SMSG_BATTLE_PETS_HEALED after HealBattlePetsPct
- Send SMSG_PET_BATTLE_MAX_GAME_LENGTH_WARNING 5 min before timeout
- Fix CMSG_BATTLE_PET_SUMMON threading (PROCESS_INPLACE → THREADUNSAFE)
- Remove unused ResolveSpeed() and opponentTeam variable
- Fix TOOD typo, add ChatRestricted TODO comment
2026-03-12 08:27:04 -03:00
luis dc30fdd09d Pet Battles: Emit AURA_PROCESSING_BEGIN/END and AURA_CHANGE effects
Matches Blizzard sniff pattern where every round wraps aura tick
processing in BEGIN(PBOID=9) / END(PBOID=9) sentinel effects.

- Emit AURA_PROCESSING_BEGIN before aura ticking
- Phase 1: DoT/HoT periodic damage/healing (SET_HEALTH)
- Phase 2: AURA_CHANGE per active aura with updated CurrentRound
- Phase 3: Decrement rounds, AURA_CANCEL for expired auras
- Emit AURA_PROCESSING_END after all aura processing
- Add explicit switch cases for effect types 13/14 in BuildRoundEffects
- Fill SourceTeam/SourcePet and Param3/Param4 on AURA_CANCEL effects
2026-03-12 08:24:21 -03:00
luis 24cc4993f9 Pet Battles: Dynamically mark critters as wild battle pets 2026-03-12 08:22:52 -03:00
luis 1debf61e1b Pet Battles: Fix weather/environment effects not showing in client UI
SetWeather() updated internal state but never emitted round effects,
so the client never knew weather was applied. Weather expiry also had
no AURA_CANCEL, leaving stale icons. InitialUpdate Enviros array was
never populated with active weather data.

- SetWeather() now emits AURA_APPLY targeting environment PBOID (6+)
- Previous weather is cancelled before new weather is applied
- Cleansing weather emits AURA_CANCEL for all active environment auras
- TickWeather() emits AURA_CANCEL when weather duration expires
- BuildPetBattleEnviros() populates InitialUpdate Enviros in all paths
- Added PBOID_ENVIRONMENT_BASE constant and TargetEnvSlot field for
  environment-targeted round effects
2026-03-12 08:20:07 -03:00
luis 9ff52e29fb Housing: Fix fixture edit mode using wrong EditorMode and missing FixtureGuid
The "Edit House Exterior" button sent EditorMode=4 (Customize/interior) instead
of EditorMode=6 (ExteriorCustomization). The client checks
C_HouseEditor.IsHouseEditorModeActive(ExteriorCustomization) which returned
false, so the exterior customization UI never activated.

Also the SMSG response had an empty FixtureGuid — the client uses this GUID
to determine enter vs exit state for fixture editing.

Fixes:
- Use HOUSING_EDITOR_MODE_EXTERIOR_CUSTOMIZATION (6) for fixture edit mode
- Populate FixtureGuid with the root fixture MeshObject GUID (componentType=9)
- Always CREATE Account entity in fixture mode (same pattern as decor edit)
- Include all fixture MeshObject CREATEs in same UPDATE_OBJECT packet
- Add GetPlotMeshObjects() accessor to HousingMap
2026-03-12 07:58:15 -03:00
luis 1a7d471b08 Housing: Fix edit mode decor list by sending all MeshObject CREATEs in same packet
The Placed Decor list was empty or incomplete because the client correlates
MeshObject FHousingDecor_C.DecorGUID with Account FHousingStorage_C entries
only when both arrive together. MeshObjects created via normal grid visibility
(separate earlier packets) arrived before FHousingStorage_C was populated,
so the client never associated them with decor entries.

Key fixes:
- Always send Account entity as CREATE (not VALUES_UPDATE) on edit mode entry
  since the initial login CREATE has no FHousingStorage_C data
- Re-send CREATE for ALL decor MeshObjects in the same UPDATE_OBJECT packet
  as the Account entity, ensuring the client has complete correlation data
- Add plot boundary spell visual activation on edit mode entry
- Improve edit mode diagnostics with mesh tracking counters
- Fix various housing packet and neighborhood handler improvements
2026-03-12 07:56:50 -03:00
luis 4f7372c043 Housing: Fix house finder map showing wrong occupied plot markers
Field1 and Field2 in JamCliHouseFinderNeighborhood are a bitmask of
occupied plot indices (client ORs them into uint64 at offset 520, then
checks bit N to render plot N as occupied). We were incorrectly packing
plot counts into Field1 and MapID into Field2, producing wrong bits.

Also set JamCliHouse::HouseLevel to the plot index, which the client
uses as the hash table key for plot-to-house mapping.
2026-03-12 07:50:30 -03:00
luis 0cb961d47d Housing: Fix entity GUID mismatch, initiative wire format, and packet error fields
Fix Housing/4 NeighborhoodMirrorEntity GUID using battlenetAccountId instead
of the neighborhood's actual DB low GUID. The client matches entity GUIDs
against NeighborhoodGUID references in JamCliHouse packets — a mismatch
causes the client to fail to associate plot data with the correct entity.
Added ResetGuid() to correct the GUID in Player::LoadFromDB before the
entity is added to the world.

Fix initiative SMSG_GET_PLAYER_INITIATIVE_INFO_RESULT: duration now converts
DB2 days to seconds (×86400), progress scales from 0.0–1.0 to 0–1000 wire
format, and the packet is sent proactively on service status check so the
client's isLoaded flag gets set.

Revert incorrect HasError replacements on 14+ non-initiative response packets
back to their proper Result field assignments. Remove fake initiative SQL
hotfix data that overwrote real DB2 records.
2026-03-12 07:49:28 -03:00
Céfiro_Caecias be453341aa DB/World: item_loot_template 2026-03-11 18:36:01 -03:00
Céfiro_Caecias 410b10434c DB/World: DBErrors Fixes 2026-03-11 17:43:10 -03:00
Céfiro_Caecias 16ffd4f291 DB/World: DBErrors Fixes 2026-03-11 17:01:38 -03:00
Céfiro_Caecias 0904a357a8 DB/World: TC Tables Calibrations 2026-03-11 17:01:04 -03:00
Céfiro_Caecias 9711520b0e Update README.md 2026-03-11 16:16:34 -03:00
luis 728fb96387 +++ 2026-03-11 14:20:53 -03:00
luis 6e05686bfe typo 2026-03-11 14:17:28 -03:00
luis 8a7bf4fe76 duplicate 2026-03-11 14:03:15 -03:00
Shauren 154d79123c Core/AuctionHouse: Replace IteratorPair with std::span
Signed-off-by: luis <[email protected]>
2026-03-11 14:01:19 -03:00
luis 7bb714e7dc Missing tables 2026-03-11 13:57:54 -03:00
luis 2a3d992f66 missing changes 2026-03-11 13:53:41 -03:00
luis b9425b5542 rework 2026-03-11 13:45:47 -03:00
luis 4066c83108 Core/Conditions: Allow CONDITION_NONE to be used without a script if NegativeCondition is 1 2026-03-11 08:50:23 -03:00
Shauren cb995fb8e9 Core/Conditions: Replace Condition::ToString with fmt::formatter
Signed-off-by: luis <[email protected]>
2026-03-11 08:46:54 -03:00