Commit Graph
927 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
agatho 8d65207489 Fix stale travel route blocking bots already on destination map
The stale route check only compared origin map, missing cases where
the bot spawned on the destination map (e.g. quest ender on same
continent). Route to Ratchet dock (Kalimdor) blocked a bot in
Northshire (Eastern Kingdoms) because originMapId matched.

Now also clears the route when the bot is already on the destination
map — no cross-map travel needed, just walk directly.

Added diagnostic logging to travel check for visibility.

Signed-off-by: luis <[email protected]>
2026-03-20 01:18:28 -03:00
agatho 2eaca0645a Clear stale travel route after map change from hearthstone
After hearthstoning to a new map, the travel manager's route (planned
for the old map) stayed active and blocked all quest processing. The
bot stood idle forever because UpdateBehavior returned early every tick.

Now detects when the bot's current map differs from the route's origin
map and clears the stale travel manager, allowing quest processing to
resume on the new map.

Also added INFO-level diagnostic to HandleOnTransport for travel
movement visibility.

Signed-off-by: luis <[email protected]>
2026-03-20 01:17:56 -03:00
agatho 0bf86c6aa0 Handle auto-accept quests (QUEST_FLAGS_AUTO_ACCEPT) for bots
Starting zone quests like Reclaiming Sunstrider Isle use the auto-accept
flag (0x80000) which bypasses the normal gossip menu. PrepareQuestMenu
doesn't include them, so bots stood idle at quest givers like Magistrix
Erona without accepting anything.

SearchForQuestGivers now also checks quest relations for auto-accept
quests when evaluating NPCs. ProcessQuestGiver runs auto-accept quests
first via AddQuestAndCheckCompletion before processing the gossip menu
for normal quests.

Signed-off-by: luis <[email protected]>
2026-03-20 01:17:25 -03:00
agatho 6dc54587b1 Fix quest giver interaction failing when ObjectAccessor can't find NPC
ObjectAccessor::GetCreature fails for some NPCs even when the bot is
standing next to them. Added grid scan fallback using creature entry
from the GUID to find the actual NPC within interaction range.

Also switched to 2D distance for position-based checks to prevent
Z-height differences from causing false "too far" results.

Signed-off-by: luis <[email protected]>
2026-03-20 01:16:51 -03:00
agatho 5614394566 Allow cross-map quest hub search and hearthstone travel
QuestHubDatabase::IsAppropriateFor no longer restricts to same map,
so bots stranded on a continent with no level-appropriate content can
find hubs on other maps. Cross-map hubs get a 0.5x scoring penalty to
prefer same-map when available.

When no quest hubs or quest givers are found nearby, bots now:
1. Search QuestHubDatabase across all maps
2. If best hub is cross-map and hearthstone goes there, cast hearthstone
3. If best hub needs multi-leg travel, use TravelRouteManager
4. If no hubs at all, use hearthstone as last resort

Signed-off-by: luis <[email protected]>
2026-03-20 01:16:13 -03:00
agatho 94a0a769d5 Use PrepareQuestMenu for quest eligibility instead of CanTakeQuest
CanTakeQuest returned true for quests that weren't actually available
in-game because ContentTuning data was missing, making GetQuestMinLevel
return 0. Bots walked to NPCs that had no quests to offer.

Replace manual quest relation iteration + CanTakeQuest with
Player::PrepareQuestMenu which is TrinityCore's authoritative check
for quest availability. This is the same system that renders quest
exclamation marks for real players and properly handles ContentTuning,
phase visibility, conditions, and all edge cases.

Applied to both SearchForQuestGivers (scan phase) and ProcessQuestGiver
(acceptance phase).

Signed-off-by: luis <[email protected]>
2026-03-20 01:15:31 -03:00
agatho facd9e31e0 Fix pending quest giver lost when ObjectAccessor fails
The pending quest giver check used ObjectAccessor::GetCreature which
can fail for phased/special NPCs like Image of Archmage Xylem, causing
the GUID to be cleared and the bot to stop walking mid-path.

Now stores the NPC position alongside the GUID. The bot walks to the
stored position even if creature lookup fails, and attempts grid scan
for quest givers on arrival. Also logs at INFO level for diagnosis.

Signed-off-by: luis <[email protected]>
2026-03-20 01:14:53 -03:00
agatho cd2722498d Fix rest threshold randomized every tick causing inconsistent behavior
The critical rest threshold (no consumables path) was calling frand()
on every IsActive() check, producing a different threshold each tick.
Bots at moderate health (49-53%) would flicker between rest and other
strategies because the random threshold kept changing.

Moved to a per-bot threshold assigned once at construction (30-50%)
so each bot has a stable, unique resting personality.

Signed-off-by: luis <[email protected]>
2026-03-20 01:14:25 -03:00
agatho 281f8ac25e Fix corpses not marked as looted after bot picks up items
Add SendLootRelease() after looting all items from a corpse. Without
this, the corpse stayed "lootable" forever and FindLootableCorpses kept
returning it, causing loot strategy to permanently block quest strategy.

Signed-off-by: luis <[email protected]>
2026-03-20 01:13:46 -03:00
agatho eb35be730d Fix quest giver interaction lost between ticks and stuck turn-ins
Add persistent _pendingQuestGiverGuid so the bot completes walking to
and interacting with a quest giver across multiple UpdateBehavior ticks,
even when other quests are active in the log.

Also track FindQuestEnderLocation failures in TurnInQuest — after 3
consecutive failures the bot abandons the quest and blacklists it,
preventing infinite turn-in loops on quests with missing ender data.

Signed-off-by: luis <[email protected]>
2026-03-20 01:13:05 -03:00
agatho 6bf07a0dd1 Fix ValidatedPathGenerator failing on long-distance paths
PathGenerator returns NOPATH beyond navmesh query range limits, causing
bots to stand idle during long travel. ValidatedPathGenerator now
segments long paths with 200yd intermediate waypoints. The travel
manager re-evaluates every 500ms for incremental progress.

Added INFO-level path validation failure logging.

Signed-off-by: luis <[email protected]>
2026-03-20 01:11:59 -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
agatho 4341bcc1cd Gate loot and rest strategies on actual need in IsActive
LootStrategy::IsActive now checks for nearby lootable corpses with
permission before returning true, preventing it from permanently
blocking lower-priority strategies like quest when nothing to loot.

RestStrategy::IsActive now checks health/mana levels and consumable
availability. With consumables it activates normally. Without them it
only activates below a randomized 30-50% threshold per check, allowing
bots to quest/grind at moderate health while still waiting for passive
regen when critically low.

Signed-off-by: luis <[email protected]>
2026-03-17 20:34:45 -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
agatho 1e7a5c3632 Fix missing includes after BotMovement relocation to module
Files previously compiled in the game library had implicit access to
all game headers via PCH. Now in the playerbot module they need explicit
includes for: Position.h, Map.h, Creature.h, CreatureAI.h, G3D/Vector3.h,
and VMapFactory.h.

Signed-off-by: luis <[email protected]>
2026-03-17 13:54:01 -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
agatho 0a3a69b19e Move BotMovement system from game/ to Playerbot module
Relocate 44 BotMovement files (Controller, StuckDetector, StateMachine,
Pathfinding, Generators, Validation) from src/server/game/Movement/ into
src/modules/Playerbot/Movement/BotMovement/ to comply with module-first
architecture. All playerbot code must live in the module directory.

Updated CMakeLists.txt with all source files in playerbot-gameplay lib
and added 6 include directories for the BotMovement subdirectories.

Also fixes StuckDetector::Reset() to clear position history, preventing
an infinite stuck detection loop where bots were immediately re-detected
as stuck after recovery due to stale position snapshots.

Signed-off-by: luis <[email protected]>
2026-03-16 20:16:50 -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