Commit Graph
2195 Commits
Author SHA1 Message Date
Ovah d18d2b84f2 Core/Objects: cache current liquid status of objects when updating position data and use it to replace unnecessary vmap lookups (#24399)
* dropped unneeded IsUnderwater override for players since the default position data update considers collision height already so we don't have to rely on that tempfix anymore. This actually fixes breathing bars showing up depending on your characters size (gnomes get their breathing bar earlier, taurens later etc)

(cherry picked from commit bea850fb73c6c3b3cc4e51bd3a42d178947882a5)
2022-01-01 12:42:17 +01:00
Giacomo Pozzoni 6ec933f281 Core/Logs: Log full guid instead of just low guid
(cherry picked from commit 468ecb7252ea4eabd37e11b9ddbbb96ffd26bd7e)
2021-12-31 21:56:40 +01:00
aquadeus 9cc3cd128c Core/Auras: Implement SPELL_AURA_MOD_MELEE_DAMAGE_FROM_CASTER (343) (#27491) 2021-12-30 12:08:02 +01:00
Antonio Martín Berti b221f4b372 Core/Auras: Implemented SPELL_AURA_TRIGGER_SPELL_ON_HEALTH_PCT (#27455) 2021-12-25 17:01:17 +01:00
Meji 924182f692 Core/BattlePets: Misc fixes (#27446)
* Added script for "Summon Battle Pet" spell (118301).
* Set the saved display of the battle pet when summoning it.
* If a summon has SummonPropertiesFlags::SummonFromBattlePetJournal it will remove NpcFlag UNIT_NPC_FLAG_WILD_BATTLE_PET (Wild battle pets).
* When a creature is summoned with SummonTitle::Companion, it will check to see if it has SummonPropertiesFlags::SummonFromBattlePetJournal before updating the battle pet's update fields. (If you have a summoned battle pet and summon a creature with that SummonTitle, it will incorrectly update the battle pet's update fields with the summoned battle pet's data).
* Implemented SummonPropertiesFlags::UseCreatureLevel. If a summon has this flag, it will use the owner's level (If the summon doesn't have SummonProperties it will always use the selected level).
2021-12-25 15:27:58 +01:00
NoName 8ec51bf3b6 Core/Spell: Proper SPELL_EFFECT_PULL_TOWARDS_DEST implementation for players (#24178)
* Core/Spell: Proper SPELL_EFFECT_PULL_TOWARDS_DEST implementation for players
Closes ##23203 and also reverts 9a1282a

thnx to xvwyh

* Make it optional

(cherry picked from commit 6067a996324dc4e36a414257e6abf7f9dfdfa934)
2021-12-22 20:50:33 +01:00
ForesterDev aa4ee9278f Core/PacketIO: Port refactors from f6e6baa2932788b17169ba103b62a6f66ee7290a (#24200)
(cherry picked from commit f6e6baa2932788b17169ba103b62a6f66ee7290a)
2021-12-22 14:59:13 +01:00
Ovah 8f4c6ebb49 Core/Units: UNIT_FLAG_PACIFIED will no longer block victim updates (#24190)
* Core/Units: UNIT_FLAG_PACIFIED will no longer block victim updates

* pacified units should only have their melee attacks blocked as counterpart to silence mechanics

* Core/Spells: removed unnecessary attack stop call from pacify aura effect handler

(cherry picked from commit 6cbfda2fcecdda980b60b359018e520f1daeaf3a)
2021-12-22 14:47:20 +01:00
NoName 61f3d51143 Core/Movement: Implement MoveSplineFlag::Enter_Cycle (#24049)
by xvwyh

(cherry picked from commit 40542f01e3fec0bff2c6e5eadbe20e58f19b0fd8)
2021-12-22 14:33:58 +01:00
Ovah a91be4995b Core/Vehicles: implement vehicle seat addon table to specify seat ori… (#24112)
* Core/Vehicles: implement vehicle seat addon table to specify seat orientation offsets and exit positions in form of offsets or absolute positions
* converted Traveler's Tundra Mammoth to seat addon table data

* first follow batch

* whoopsie

* Core/Vehicles: go from local copies to pointers

* Update and rename 2020_99_99_99_world.sql to 2020_02_08_01_world.sql

Co-authored-by: Giacomo Pozzoni <[email protected]>
(cherry picked from commit 98d6c501d7c1a7a632c6ff8b1d46c7d0d4ae5b37)
2021-12-21 15:32:49 +01:00
Ovahlord 606597f4f8 Core/Movement: reset position update interrupt info after the interrupt checks have been executed
* for discussion see: https://github.com/TrinityCore/TrinityCore/commit/02daf1bf3afc570c26e8e9f431866fcb3720174a#r36916229

(cherry picked from commit 01584cb0b9fe623fdf5694b985a53aa45f9f1d30)
2021-12-20 23:47:37 +01:00
Ovah 43a7091e8a Core/Movement: properly fix aura interrupts during movement (#24068)
We want our movement to be fully updated before even thinking about interrupting anything. The old logic was updating positions, interrupting stuff and afterwards updating movement generators. This way we were ending up with false interrupts.

properly fixes #22908

(cherry picked from commit 02daf1bf3afc570c26e8e9f431866fcb3720174a)
2021-12-20 23:47:23 +01:00
NoName 37178ff311 Core/Spells: SPELL_AURA_48 implementation (#24054)
by xvwyh

(cherry picked from commit b3b7f0761d5605d57f9d62ca8e22a8cd9a4df24b)
2021-12-20 22:30:41 +01:00
Kelno 45585b5305 Fixed PvP Combat timer never getting refreshed (#24058)
* Fixed PvP Combat timer never gets refreshed while meleeing

* Apply Treeston feedback

Co-authored-by: Giacomo Pozzoni <[email protected]>
(cherry picked from commit 2b024e8fbff24b071217cd88f052fdeaa48b47ba)
2021-12-20 21:25:46 +01:00
Giacomo Pozzoni d095d4afe9 Fix fleeing speed to 66% run speed (#24025)
* Core/Movement: Fix fleeing speed to 66% run speed

Fix fleeing speed to 66% run speed until the creature starts returning home

* Fix build

* Don't check speed type

* Don't apply speed reduction twice

* Fix no-pch (1st try)

* Make sure every spell focus is interrupted when seeking assistance

(cherry picked from commit 4ccf01de3947f50629c20192da3f99cb8c693b35)
2021-12-19 17:39:25 +01:00
Giacomo Pozzoni 292df30394 Core/Movement: Fix wrong orientation set when pausing movement (#23986)
* Core/Movement: Fix wrong orientation set when pausing movement

* Update MoveSpline.h

* Update Unit.cpp

(cherry picked from commit e698c17a2688385e62744cdf5eb37b12b9e304fa)
2021-12-19 15:48:43 +01:00
Giacomo Pozzoni 96ec8477f0 Core/Creatures: Fix spell_school_immune_mask being applied against positive spells too (#23999)
(cherry picked from commit 18a4cbee5eb10cf0502ffae9c89ad468a2c58012)
2021-12-19 15:31:34 +01:00
ccrs dfb2221552 Core/Movement: delay movement update in MotionMaster until its owner signals AddToWorld
ref #23199
closes #23876

(cherry picked from commit d033032d33cff5dae76000f8432d78746cda9e06)
2021-12-18 23:03:00 +01:00
ForesterDev 4a47e1c6be Core/Defines: define UNIT_FLAG_SWIMMING (#23630)
(cherry picked from commit c03c88d0c02c5dda9f14dec1ed151ca30a92118e)
2021-12-18 22:50:52 +01:00
Gildor cc0940fe25 Core/Misc: Fix parry-haste mechanic. (#23773)
* Should check victim that do a parry instead of the unit that deal the damage (Wrong implementation of this commit: 4a46fee03ef204289bbd96e8e1e07117b3bebd9f )

Closes #23754

(cherry picked from commit f8d7b260476c69e09ab0329cb7cd6c277f5473a7)
2021-12-18 21:45:45 +01:00
Giacomo Pozzoni 6d5086da17 Core/Vehicle: Change vehicle accessories' phase according to the player on the vehicle (#23646)
* Core/Vehicle: Change vehicle accessories' phase according to the player on the vehicle

* Get the root vehicle to set the phase to all accessories. Attempt to get the accessories to stay mounted on the vehicle.

* Fix the accessories to stay mounted on the vehicle

(cherry picked from commit 15e85f882fdb7b5d1d48302907e76c993ee4e923)
2021-12-18 14:08:25 +01:00
Wyrserth 2f2de26311 Core/Spell: honor IsStackableOnOneSlotWithDifferentCasters() when deciding if an aura should stack from different casters or not. (#23579)
Fixes #23387 and #22818.

(cherry picked from commit 0b87dffc3543c6953118d89b04a06fb19a1ab1dd)
2021-12-18 00:09:49 +01:00
Ovah d01a22f58e Core/Spells: fixed root behaivior of creatures that are being rooted via movement template while getting a root aura removed (#23216)
* Core/Spells: do not allow root auras to bypass the root movement template state when getting removed

* yeah....

(cherry picked from commit d629bad7a19c1f4c4cd9fb4382fadd97b320dc38)
2021-12-17 22:55:50 +01:00
Treeston 4330b7c921 Entities/Unit: fix an unrelated check from doing nothing because somebody didn't understand how type-casting works
(cherry picked from commit 0b722e23cf0cdbd7b9753ffe77b349930c34779e)
2021-12-17 22:54:01 +01:00
Treeston 970a89a8c3 Entities/Unit: Add a missing underflow check to prevent really really low damage from underflowing when paired with flat damage modifiers. Closes #23655.
(cherry picked from commit a8b1b9a3c6266d589afb378f07c505f79c75a6a4)
2021-12-17 22:50:25 +01:00
Treeston 6b1ca0ca12 Core/Combat: Properly unset engagement flag on death.
(cherry picked from commit 9c603ea87f09c47d52f093ccc73ee75c15eff6f5)
2021-12-17 22:45:55 +01:00
jackpoz e6e73b7b13 Core/Spells: Fix infinite loop
Fix an infinite loop caused by a mix of item 25498 and liquid damage

(cherry picked from commit 9b292f436903e436bfdfdc61d40d2efffad35bca)
2021-12-17 21:44:04 +01:00
Shauren e8b3dda4a0 Core/BattlePets: Wrap battle pet related code in a separate namespace 2021-12-17 14:23:43 +01:00
Treeston c13d83796f Core/AI: Finally move the "is creature engaged" flag to be a property of the creature AI, where it honestly always belonged. Fixes #17981 and #23602 for real this time.
(cherry picked from commit 0e7c66cb4c7ff7d44e232d0b50703a48605ffd24)
2021-12-17 00:23:33 +01:00
jackpoz f65edd1130 Core/MovementGenerator: Add more details to asserts
Include movespline in Unit::GetDebugInfo() and the Player owner in FlightPathMovementGenerator::DoEventIfAny() assert

(cherry picked from commit 560b7e33974904938f3f85a2f78c0850df2f9333)
2021-12-16 22:03:52 +01:00
ccrs ef6a5d3c3c Core/Unit: movement related corrections prior to getting Charmed
(cherry picked from commit 294a3a2789582e05a7847620173d533bd07e44e9)
2021-12-15 23:42:06 +01:00
ccrs ff11e95071 Core/Unit: f869c49 followup
Movement Pause/Clear is already handled in Unit::SetCharmedBy and Unit::RemoveCharmedBy, respectively

TODO: missing PAUSE handling in RandomMovementGenerator
(cherry picked from commit 4fa3c04b7263c0038b96e50c29f8ba52a4802995)
2021-12-14 22:19:13 +01:00
Wyrserth 24c07367f1 Core/Vehicle: prevent creature vehicles from following their old movement generator when a player enters them in some cases.
Closes #21731 and #22368.

(cherry picked from commit f869c4969ebd573da2742dcee0dfbe688e7896e0)
2021-12-14 22:19:01 +01:00
Shauren d249a2a98a Warning fixes 2021-12-14 22:15:04 +01:00
Wyrserth edf12fd6a1 Core/Conditions: allow spellclick conditions to properly work for aura apply/remove (#23527)
(cherry picked from commit 12e545f7e2247f91db3fd1e8e2f961982422a147)
2021-12-14 20:52:13 +01:00
ForesterDev 104ec7a81a Core/Unit: Implement more helper methods (#23555)
(cherry picked from commit c44fb37f74347e3b6d399c941716971503af4cf8)
2021-12-14 20:42:32 +01:00
Treeston bba4696de7 Entities/Player: Clean up client control handling behavior around possession. Mind Control should no longer cause various weirdness. Closes #23539.
(cherry picked from commit f6f1c48aa592ea10c99fd23f46e94934b2f0cef2)
2021-12-13 23:44:13 +01:00
ForesterDev 27886c7f5d Core/Player: add helper methods GetNativeGender/SetNativeGender/SetGender (#23520)
* Core/Player: add helper methods GetNativeGender/SetNativeGender/SetGender and fix some cases, where we should get player gender, instead of modified by display gender

* fix merge

* Add virtual methods for Unit class

(cherry picked from commit b47bb59e2a3e42aff3793517ef94f51678b54905)
2021-12-13 00:42:20 +01:00
ccrs 4e6c59dca7 Core/Unit: rename several getters to follow codestyle
uint8 GetLevel()
        uint8 GetLevelForTarget(WorldObject const* /*target*/)
        void SetLevel(uint8 lvl)
        uint8 GetRace()
        uint32 GetRaceMask()
        uint8 GetClass()
        uint32 GetClassMask()
        uint8 GetGender()

(cherry picked from commit 5c09ff51f7015b775def8d5cc1f678eaef37200f)
2021-12-13 00:42:20 +01:00
jackpoz 841630fcc3 Core/Misc: Fix static analysis issues reported by Coverity Scan
(cherry picked from commit de88691e257af0bf078d9be74ab3bb578f016547)
2021-12-13 00:42:18 +01:00
Wyrserth 09e849bb69 Core/Spell: allow damage from binary spells to go through elemental resistance's damage reduction. (#23479)
(cherry picked from commit efc999227d87398b25e04a3fba881c27de8135f3)
2021-12-13 00:42:17 +01:00
Aokromes 30cec73c61 Coding standards (#23514)
* Coding standards

* revert part

(cherry picked from commit fe744977c917957e112704ccd66e228b826b3f7a)
2021-12-13 00:42:17 +01:00
Shauren 54f607641a Core/Spells: Moved SpellVisual functions from Unit to WorldObject 2021-12-12 19:34:00 +01:00
Treeston 38d7c1530a Combat/Threat: Split ThreatManager::NotifyDisengaged off from ThreatManager::ClearAllThreat. NotifyDisengaged signifies intent to clear the engagement flag, and should only be called from AI. Fixes #23490.
(cherry picked from commit 1158f267df22c0782fb5f20f7de31f5643ac0b58)
2021-12-12 02:09:15 +01:00
Treeston f9b8fe686d Entities/Unit: Adjust an overzealous assert to not catch self references, and add the inverse assert too. 396f87c follow-up.
(cherry picked from commit aeed616c22868e2c5759c01d2c0feb52a7c3bc97)
2021-12-12 01:27:04 +01:00
Treeston d10554da14 Entities/Unit: Fix an issue where Unit pointers could be left dangling if a channeled Charm was interrupted by a control aura application. Closes #23440.
(cherry picked from commit f4b06fd0b7ead843bba8f5215a09abf7976e012c)
2021-12-12 01:27:04 +01:00
Treeston edc7583119 Entities/Unit: Cleanup all the direct accesses to m_unitMovedByMe. Refactor the field to be protected. Add assertions to catch dangling pointers.
(cherry picked from commit 396f87c30dff1b50f1eb0d924778a7fbab7e8d11)
2021-12-12 01:26:41 +01:00
Treeston dabdad3b47 Core/Misc: Rename Unit::AttackedTarget to Unit::AtTargetAttacked to match naming scheme for these notifiers
(cherry picked from commit 632a300dd20aad9663392c2f21a8ed29ffee1ef7)
2021-12-12 00:33:18 +01:00
Treeston 35e55f1089 Core/Entities: Kick engagement logic upstairs to Unit (from ThreatManager), since all Units with AI need it (not just those with threat list). Fixes #17981.
(cherry picked from commit dbe3bbefe734f8824e8f07c302e256f0d446b974)
2021-12-12 00:31:15 +01:00
jackpoz 134fa22510 Core/Unit: Ignore On Transport spline movements if the Unit isn't on a transport anymore
On Transport splines use coordinates relative to the transport but if the transport is not found anymore than there is no way to get the absolute coordinates, leading to relative coordinates being used as absolute instead. The result is a Unit being set at position (0, 0, 0) or close by.

(cherry picked from commit c90f789eac9092d5332e92242ed0bfab7fd9e9fe)
2021-12-11 14:12:54 +01:00