Commit Graph
100 Commits
Author SHA1 Message Date
luis e73c288b95 66527 2026-03-20 22:42:30 -03:00
luis 3adc7d1ff9 mapflags 3 2026-03-20 22:42:04 -03:00
luis 07458287a8 Core: Updated allowed build to 12.0.1.66431 2026-03-20 22:30:19 -03:00
luis f7af1f5a5b fix lua 2026-03-20 20:45:24 -03:00
luis 06a7860594 Housing: Fix fixture hookpoint linking, door GO management, and map visibility
Fixture System:
- Use MeshObject GUIDs (HighGuid 56) for FHousingFixture_C Guid and
  AttachParentGUID fields instead of Housing GUIDs. The client's fixture
  manager searches the frame tree using AttachParentGUID as key, and frames
  are indexed by MeshObject entity GUIDs. This fixes fixture hookpoints
  showing "None" despite fixtures being spawned.
- Force-send AT entity CREATE/VALUES to player before ENTER_PLOT packet,
  matching the retail pattern where UPDATE_OBJECT and ENTER_PLOT arrive at
  the same timestamp.
- Set MAX_VISIBILITY_DISTANCE on HousingMap and HouseInteriorMap so all
  entities are visible map-wide, eliminating entity streaming race conditions.
- Add PreloadHousingMaps at server startup with LoadAllCells for
  neighborhood maps (validates map type before loading).

Fixture Placement:
- Door (entrance) replacement: placing a new door auto-removes any existing
  door at a different hook and despawns/respawns the clickable door GO.
- Hook exclusivity: placing a fixture removes any existing fixture at that
  hook first.
- Fix DELETE_FIXTURE handler: pass original hookID to RemoveFixture instead
  of resolved parent componentID. Fixtures are keyed by hookID.
- Remove default fixture respawn on delete (was causing flicker loop).

Door GO Management:
- Add RespawnDoorGOAtHook/DespawnDoorGO methods for targeted door GO
  updates without full house rebuild.
- Door GO positioned at fixture MeshObject location (exact hookpoint).
- Force-send CREATE to player immediately after spawning door GO.
- Auto-create missing door GO templates from ExteriorComponent DB2 at
  startup (EnsureDoorGameObjectTemplates) with retail values:
  Lock=4296, autoClose=3000, startOpen=1.

Interior Exit:
- Use ExteriorComponentExitPoint position for interior→exterior teleport,
  placing player in front of the door they entered through.

Other:
- Add MeshObject::AddRoomDoor for HousingRoomData Doors array population.
- Rename HousingPackets PlotAreaTriggerGuid to NeighborhoodEntityGuid.
2026-03-20 01:36:59 -03:00
luis ad0637b126 Pet Battles: Fix BattlePetState IDs from DB2, add per-type weather damage
Cross-referenced BattlePetState.db2 via wago.tools/WoWDBDefs and fixed
wrong state IDs: Stat_Accuracy is 41 (was 22=Mechanic_IsStunned),
Mod_HealingDealtPercent is 65 (was 26=Ramping_DamageID),
Mod_HealingTakenPercent is 66 (was 27=Ramping_DamageUses).

Added per-type weather damage bonus using the 3-state mechanism from
DB2: Mod_PetTypeDamageDealtPercent(87) + Mod_PetType_ID(89) restricts
damage bonuses to matching ability types (e.g. Rain = +25% Aquatic
only, not all damage). Also added Add_FlatDamageTaken(71) for
Sandstorm-style damage shields.

Expanded enum to 43 states covering weather markers (53-63, 316),
mechanics, cosmetics, and combat modifiers — all verified against
BattlePetState.db2 LuaName field.
2026-03-20 01:23:39 -03:00
luis 8f9c7c3de8 Pet Battles: Wire state-driven weather system from DB2
Replace dead hardcoded PetBattleWeatherType enum with a data-driven
weather system that reads BattlePetAbilityState entries from DB2.

The old system had SetWeather/GetWeatherDamageModifier/GetWeatherHealingModifier
functions but SetWeather was never called, so weather abilities fired
visually (aura icon appeared) but had zero gameplay effect.

Now weather modifiers (damage %, healing %, accuracy, speed) are loaded
from BattlePetAbilityState DB2 onto the environment slot when a weather
aura is applied, and read back during combat calculations. Elemental
pets remain immune to all weather effects.
2026-03-20 01:22:05 -03:00
luis f19aab2fee fix build 2026-03-19 22:21:41 -03:00
luis 65fa4999a0 ++ 2026-03-18 02:17:37 -03:00
luis 2a3de1833a lua 2026-03-18 02:13:06 -03:00
luis 1eb0b1d8b7 lua 2026-03-18 01:55:55 -03:00
luis 1f90dc60df lua 2026-03-18 01:21:06 -03:00
luis 6d6aa1a723 lua part 1 2026-03-18 01:13:14 -03:00
luis aa968ba82e fix build 2026-03-17 23:54:38 -03:00
luis 5241086f27 dragonriding 2026-03-17 23:50:52 -03:00
luis 01cf332cfa dragonriding 2026-03-17 22:39:51 -03:00
luis b06857173c still fly bug 2026-03-17 22:08:21 -03:00
luis 34f88a8963 bot + packets 2026-03-17 20:34:19 -03:00
luis 4127c8485a Disable AI update throttler that blocked all strategy execution
The AdaptiveAIUpdateThrottler was preventing UpdateStrategies() from
ever being reached, leaving bots idle with active but never-executed
strategies. Also swapped quest/loot priority so quest (MOVEMENT=45)
runs below loot (FOLLOW=50) only when loot is gated by IsActive.

Added temporary STRAT-SELECT diagnostic logging to trace which
strategy wins priority selection each tick.
2026-03-17 20:31:29 -03:00
luis cedc8bba80 UiChromieTimeExpansionInfo.db2 2026-03-17 14:30:21 -03:00
luis 224446458c dragon riding and perks 2026-03-17 02:11:22 -03:00
luis 5a56fa0773 trading post 2026-03-17 01:14:23 -03:00
luis 494d808780 update full 12xx data and more systems work 2026-03-16 23:47:15 -03:00
luis 14a90db884 Pet Battles: Fix BattlePetAbilityEffect column names and DisplayID repair
Rename misnamed SQL columns to match WoWDBDefs 12.0:
- Aura → BattlePetEffectPropertiesID
- BattlePetEffectPropertiesID → AuraBattlePetAbilityID
- VisualID → BattlePetVisualID

Add migration script for existing databases, update SELECT query.

Also add DisplayID=0 repair in LoadPlayerTeam and a log warning
in SelectPetDisplay when creature_template is missing.
2026-03-16 20:26:49 -03:00
luis 78782bc6f3 Fix bot strategy activation blocked by throttle and death recovery
Solo strategy activation (rest, solo_combat, quest, grind, loot, solo)
was positioned after both the AI update throttler and the death recovery
guard in UpdateAI(). Bots that were throttled or dead at login never
reached the activation code, leaving them with Strategies=0 and idle.

Move the one-time strategy activation to run before all guards so it
executes on the first UpdateAI tick regardless of throttle/death state.
2026-03-16 20:21:29 -03:00
luis ddb75df371 Housing: Re-CREATE all fixture entities after rebuild to fix hook recognition 2026-03-16 20:14:57 -03:00
luis c869b64ab9 Fix db2 activities 2026-03-15 22:33:10 -03:00
luis 8f73d0cdf8 fix trading post 2026-03-15 22:17:39 -03:00
luis 9404d5afac perk program full work ui now of vendor 2026-03-15 21:38:21 -03:00
luis 27b107530d more work 2026-03-15 21:20:35 -03:00
luis dfe864e477 trading post try fix crash 2026-03-15 21:18:19 -03:00
luis 6902181f28 trading post crash on npc gossip due to PerksVendorItem 2026-03-15 20:48:52 -03:00
luis 9bbebb333b trading post 2026-03-15 19:57:25 -03:00
luis 02ac83d4af trading post 2026-03-15 19:40:29 -03:00
luis cf8d0f8b00 new housing 2026-03-15 18:16:17 -03:00
luis 2f5144077e Housing: Fix DB2 field ordering, door placement, and fixture validation
Fix ExteriorComponentHookEntry struct field order to match DB2 LoadInfo
(Position/Rotation before ID when IndexField=2), resolving garbage hook
IDs during fixture resolution.

Replace first-match door hook selection with center-front scoring
heuristic (|X|*2 + Y) to ensure the main entrance spawns at the front
of the house rather than on a side/back wall.

Add fixture validation in SelectFixtureOption: enforce component type
must match hook type, and only one door allowed per house. This prevents
placing windows at door hooks and spawning multiple entrances.

Only auto-resolve the single best door hook during SpawnExtCompTree —
other fixture types (windows, chimneys, dormers) require explicit player
selection, matching retail behavior where they unlock via progression.

Additional fixes: unique fixture GUIDs via atomic counter (subType=5),
size-aware default fixture lookup, range-based DB2 store iteration,
and starter fixture migration that preserves existing roots.
2026-03-15 17:59:32 -03:00
luis dd888b36db Housing: Add racial house styles and starter fixture persistence
Map player race to house exterior WMO style on purchase:
Night Elf → Woodland (55), Blood Elf → Engraved (56),
other Alliance → Human (9), other Horde → Orc (87).

On house creation, persist starter fixtures (Base + Roof) to
character_housing_fixtures so spawning reads from DB rather than
relying on runtime default resolution. Door auto-resolves from
the hook system via GetDefaultFixtureForType.
2026-03-15 17:54:46 -03:00
luis 06a4b3f844 Housing: Refactor fixture resolution to direct (type, wmoDataID) lookup
Replace the broken GroupXHook→Group→XGroup chain with a direct
_defaultFixtureByTypeWmo index that maps (componentType, wmoDataID)
to the default fixture component ID. This correctly resolves fixtures
for all 4 racial house styles (Human/NightElf/BloodElf/Orc).

Key changes:
- BuildExteriorComponentIndexes: filter structural roots by
  ExteriorComponentType.ParentComponentType==0 with hardcoded
  fallback for broken DB2 store iteration
- New GetDefaultFixtureForType() replaces GetComponentAtHook()
- SpawnExtCompTree uses type+WMO lookup for hook children
- Door GO spawning fully data-driven from DB2 (entry + position
  from hook offset + ExitPoint offset)
- Root selection: rootOverrides → coreExtCompID → default → first
- Fix missing fixture overrides on late-spawn path
- Add GetRootComponentOverrides() for player-selected root variants
2026-03-15 17:52:14 -03:00
luis 29d7e7689b typo 2026-03-15 17:27:47 -03:00
luis d08f65b834 world quest changes 2026-03-15 17:26:25 -03:00
luis c9d5652b32 typo 2026-03-15 15:01:33 -03:00
luis 570f4935c9 missing packet 2026-03-15 14:59:41 -03:00
luis 3c84a9793c typo 2026-03-15 14:52:29 -03:00
luis 6ceb6bae47 new spells 2026-03-15 11:02:20 -03:00
luis b9275f314b new undead zone scripts 2026-03-15 10:52:47 -03:00
luis c67de7f095 world quest part 1 2026-03-14 13:10:10 -03:00
luis 787e355835 need check on ida 2026-03-14 09:19:51 -03:00
luis b8dd010248 fix crash 2026-03-14 09:10:37 -03:00
luis 1826c9d792 typo 2026-03-14 08:44:25 -03:00
luis bb22e56f7c core improvements 2026-03-14 08:36:09 -03:00
luis 788094aebc Housing: Fix exterior component tree spawning with data-driven multi-root architecture
- Fix DB2 store iteration bug: ExteriorComponentHook entries with
  ParentIndexField were only partially accessible via range-based
  iteration (1808 of 23881 entries). Use LookupEntry() over
  GetNumRows() to reach all entries, fixing hook resolution
  (compByHook was 0, now resolves all 1461 GroupXHook mappings).

- Spawn all root components per HouseExteriorWmoDataID: houses
  consist of multiple independent roots (Base type=9, Roof type=10)
  sharing the same WMO data ID. Each root spawns independently at
  house position with its own hook children (doors on base,
  chimney/windows on roof). Filter by Size to avoid spawning
  small/medium/large variants simultaneously.

- Build parent-child index from ExteriorComponent.ParentComponentID
  for component variants that reference a parent component.

- Add _rootCompsByWmoDataId index for fast lookup of all root
  components belonging to a house exterior.

- Fix MeshObject fixture data to pass fixtureGuid and
  parentFixtureGuid for proper client-side attachment hierarchy.

- Fix BNetAccount dirty state in fixture edit mode by clearing
  update mask after PopulateCatalogStorageEntries.
2026-03-14 07:45:27 -03:00
luis e9876286b9 initial trading post it have mem leak and dragonriding base 2026-03-14 07:08:14 -03:00
luis 19177a9f6a fix build 2026-03-13 22:16:05 -03:00
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
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
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
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
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
luis 456d69d25a Core/Quests Implement quest campaigns 2026-03-11 08:46:19 -03:00
luis 8fdb729d0b Core/Quests: Move questline handling to new QuestMgr namespace and implement SPELL_EFFECT_SKIP_QUESTLINE 2026-03-10 22:04:58 -03:00
luis 418ebd03cf fix crash 2026-03-10 20:45:23 -03:00
luis 9837379646 improved race haranir 2026-03-10 20:42:01 -03:00
luis 9b5cf857c8 new race 2026-03-10 20:13:25 -03:00
luis 42ef944517 Housing: Fix 0/0 decor budget display by sending CREATE for missing entities
Account and HousingPlayerHouseEntity get destroyed on the client during
map transfers to the housing map. The edit mode handler always sent
VALUES_UPDATE, which the client "rescued" (ignored) because the entities
no longer existed in its object cache.

Now check HaveAtClient() first — if the client doesn't have the entity,
send a full CREATE_OBJECT and re-register the GUID in m_clientGUIDs.
This ensures the client receives InteriorDecorPlacementBudget, storage
entries, and DecorMaxOwnedCount needed for the decor count display.
2026-03-10 19:55:50 -03:00
luis b299277770 Housing: Fix initiative packet parsing, opcode collisions, and tutorial CVar timing
- Fix CMSG_INITIATIVE_REPORT_PROGRESS ByteBufferException: packet only
  contains a packed NeighborhoodGuid (sniff-verified 7 bytes), not three
  extra uint32 fields. Handler now just sends initiative info back.

- Fix 4 SMSG initiative opcode collisions (0x420369-0x42036C) with
  existing opcodes (CATALOG_SHOP_OBTAIN_LICENSE, MIRROR_VARS,
  SET_INSTANCE_LEAVER, UNSET_INSTANCE_LEAVER). Reassigned to
  0x420380-0x420383.

- Fix tutorial mode still blocking editor: CVar injection in
  Player::LoadFromDB happened after the client already fetched account
  data during auth. Added SendAccountDataTimes() after SetAccountData()
  to force the client to re-fetch the updated GLOBAL_CONFIG_CACHE with
  housingTutorialsEnabled=0 and closedInfoFramesAccountWide bits.

- Reset FHousingStorage_C populated flag on every edit mode entry so
  the Account VALUES_UPDATE always carries the full storage map.

- Remove FHousingDecorActor_C fragment from decor MeshObjects (sniff
  analysis confirmed fragment 28 is not present on any retail entity).

- Use DROP+CREATE instead of CREATE IF NOT EXISTS in initiative SQL
  to prevent stale schema from persisting silently.
2026-03-10 19:54:41 -03:00
luis 1d444ee8f7 Housing: Deep-dive initiative improvements from sniff/IDA analysis
Sniff analysis (223 packets across 12 .pkt files):
- Confirmed SMSG_INITIATIVE_SERVICE_STATUS wire format (1 byte, 0x80)
- Activity log responses contain packed GUIDs with double contribution scores
- Player initiative info uses float scale (ProgressRequired=1000.0f)
- Task progress is neighborhood-wide aggregate (confirmed by sniff values)

IDA binary analysis findings implemented:
- Add 8 new enums: NeighborhoodInitiativeUpdateStatus (Started/Milestone/
  Completed/Failed), ChestResult, TaskType (Single/RepeatableFinite/
  RepeatableInfinite), CompletionState, InitiativeFlags, MilestoneFlags,
  RewardFlags, NeighborhoodType
- Add 5 new SMSG opcodes: INITIATIVE_UPDATE_STATUS (1 byte status),
  INITIATIVE_POINTS_UPDATE (2 uint32: current/max), INITIATIVE_MILESTONE_UPDATE
  (3 bytes: index/reached/flags), INITIATIVE_CHEST_RESULT (1 uint32 result),
  INITIATIVE_TRACKED_UPDATED (packed GUID)
- Send InitiativeUpdateStatus on initiative start/complete/expire/milestone
- Send InitiativePointsUpdate after every task progress change
- Send InitiativeMilestoneUpdate when milestones are reached

Weighted cycle selection (IDA-verified):
- Build InitiativeCyclePriority index map during initialization
- SelectWeightedCycle() uses InitiativeCyclePriority.Weight for weighted
  random selection among candidate cycles
- CheckAndStartInitiatives() now uses weighted selection with fallback
  to equal-weight when no priority data exists

DB2 data fixes:
- Fix InitiativeReward.RewardData SQL column type from text to bigint
- Fix reward data values from empty string to 0
- Document that RewardType=0 with RewardAmount = favor points granted
  via Housing::AddFavor (HouseInitiativeFavor = AccountTransType 66)
2026-03-10 19:49:39 -03:00
luis 8b80a9f7ad Housing: Complete initiative persistence — task progress, milestones, rewards
- Add neighborhood_initiative_task_progress table persisting per-task progress
  and status (NOT_STARTED/IN_PROGRESS/COMPLETE) across server restarts
- Add neighborhood_initiative_milestones table persisting milestone reached
  state with timestamps
- Add neighborhood_initiative_reward_claims table tracking per-player reward
  claims to prevent double-claiming
- Implement PersistSingleTaskProgress, PersistMilestoneReached, PersistRewardClaim
  with corresponding CHAR_REP/INS prepared statements
- LoadFromDB now restores task progress, milestone state, and reward claims
  from DB instead of defaulting to zero/recalculating
- Implement ClaimMilestoneReward with full DB2 reward chain: walks
  InitiativeRewardXMilestone → InitiativeReward to grant currency, items,
  or favor based on RewardType
- HasUnclaimedRewards now checks per-player claim state, not just milestone reached
- HandleGetInitiativeClaimRewardRequest and HandleGetInitiativeOpenChestRequest
  now use ClaimMilestoneReward for actual reward distribution
- PersistTaskProgress stub replaced with full implementation
2026-03-10 19:43:07 -03:00
luis 5def5c28d0 Housing: Wire up initiative/endeavor system and fix interior editor unlock
- Register PlayerInitiativeComponent_C entity fragment (FragmentID 37) on player
  load so C_NeighborhoodInitiative Lua API returns initiative state
- Populate InitiativeInfo fields (duration, progress, milestone, cycle, contribution)
  and Houses set from InitiativeManager data
- Send SMSG_INITIATIVE_SERVICE_STATUS (0x80=enabled) proactively on both exterior
  and interior map entry so IsInitiativeEnabled() returns true immediately
- Set IsInitiative flag on cornerstone UI response when neighborhood has active initiative
- Add InsertSetUpdateFieldValue friend declaration to SetUpdateFieldSetter (was missing,
  preventing set-type update field insertion from compiling)
- Send SMSG_HOUSING_GET_CURRENT_HOUSE_INFO_RESPONSE in interior map so editor UI
  has proper house context
- Add SendPostTutorialAuras to HouseInteriorMap to unlock all editor modes (expert,
  cleanup, layout, customize) — auras are lost on map transfer and must be re-sent
2026-03-10 13:36:47 -03:00