* fix(Core/Reputations): Faction rep gained by killing mobs is now properly rounded up.
Do not increase reputation rank if exceeds max rank cap.
Fixes#8718
Both Faction - Argent Crusade, Frenzyheart Tribe, Kirin Tor, Knights of the Ebon Blade, The Ashen Verdict, The Kalu'ak, The Oracles, The Sons of Hodir, The Wyrmrest Accord
Alliance - Alliance Vanguard, Explorers' League, The Frostborn, The Silver Covenant, Valiance Expedition
Horde - Horde Expedition, The Hand of Vengeance, The Sunreavers, The Taunka, Warsong Offensive
- Get zone/area IDs from vmap data in the liquid update
- Add new method Map::getFullVMapDataForPosition to get area info and liquid info in a single vmap lookup
- Adjust GetZoneId/GetAreaId on WorldObject to always return these cached fields.
- Clean up liquid state handling on Unit and Player
- Implemented getting area id from gameobject spawns.
- Removed old core related to getting movement flags dependent on environment.
- Movement flags are now processed more precisely and dynamically.
Original source: TrinityCore.
- Closes#5086
- Updates #2208.
Npc positioning
Implemented slope check to avoid unwanted climbing for some kind of movements (backwards, repositioning etc.)
Implemented backwards movement
Re-implemented circle repositioning algorithm (smartest than retail, but with the same feeling)
Fixed random position of summoned minions
Improved pet following movement. Also, they attack NPC from behind now. Thanks to @Footman
Swimming creatures
Fixed max_z coordinate for swimming creatures. Now only part of their body is allowed to be out of the water level
Fixed pathfinder for swimming creatures creating shortcuts for specific segments, now they swim underwater to reach the seashore instead of flying above the water level.
Creatures with water InhabitType but no swimming flag now, when not in combat, will walk on water depth instead of swimming. Thanks @jackpoz for the original code
UNIT_FLAG_SWIMMING in UpdateEnvironmentIfNeeded to show the swimming animation correctly when underwater
Implemented HasEnoughWater check to avoid swimming creatures to go where the water level is too low but also to properly enable swimming animation only when a creature has enough water to swim.
Walking creatures
Extended the DetourNavMeshQuery adding area cost based on walkability (slope angle + source height) to find better paths at runtime instead of completely remove them from mmaps
improve Z height in certain conditions (see #4205, #4203, #4247 )
Flying creatures
Rewriting of the hover system
Removed hacks and improved the UpdateEnvironmentIfNeeded. Now creatures can properly switch from flying to walk etc.
Spells
LOS on spell effect must be calculated on CollisionHeight and HitSpherePoint instead of position coords.
Improved position for object/creature spawned via spells
Improved checks for Fleeing movements (fear spells)
Other improvements
Implemented method to calculate the CollisionWidth from dbc (used by repositioning algorithm etc.)
Improved raycast and collision checks
Co-authored-by: Footman <p.alexej@freenet.de>
Co-authored-by: Helias <stefanoborzi32@gmail.com>
Co-authored-by: Francesco Borzì <borzifrancesco@gmail.com>
Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
* NULL to nullptr
* NULL to nullptr
* NULL to nullptr
* NULL to nullptr
* NULL to nullptr
Co-authored-by: Francesco Borzì <borzifrancesco@gmail.com>
Co-authored-by: Stefano Borzì <stefanoborzi32@gmail.com>
PlayerScript#OnFirstLogin was broken in that if you tried to teach the
player a spell or give an item to him that change wouldn't persist.
Meaning that the next time the Player would log in, his awarded spells
or items would be gone.
Meanwhile PlayerScript#OnLogin didn't have this behavior meaning
that the sematics of PlayerScript#OnFirstLogin and PlayerScript#OnLogin
where very different, which is unexpected.
This issue was caused by an implementation detail in Player#learnSpell
(and similiar) which behaves differently depending on
Player#isBeingLoaded phase. This code change makes its that
PlayerOnFirstLogin hook executes when Player#isBeingLoaded == false
fixing the issue.
Alternatives: The fact that Player#learnSpells and others behave
differently depending on the load phase is questionable and from my
research it seems like this impl detail is only used when giving the
player his template spells. We could add a overload to
Player#learnSpell with a flag like `isSpellTemporary` and make
the template spells loading use it. Then we would be able to remove
this implicit temporary spell mechanism when Player#isBeingLoaded
thing. However this is a deeper change and not worth the risk.