Commit Graph

2199 Commits

Author SHA1 Message Date
Shauren d56d92fbe7 Core/Units: Allow mind controlling non-controllable vehicles (for example players that become vehicle during boss encounters or creatures that only are vehicles to show non standard power type)
Closes #24562

(cherry picked from commit 1fecbc6892)
2022-01-02 16:17:18 +01:00
Shauren 6413466693 Core/Spells: Relaxed aura exclusivity check to allow casting spells that have other, non-aura effects even if aura will not be applied
Closes #24553

(cherry picked from commit 829cf38c67)
2022-01-02 00:30:31 +01:00
Shauren 679e9910e0 Core/Auras: Prevent getting negative scale with auras
Closes #24040

(cherry picked from commit 50576fa1f5)
2022-01-01 22:49:58 +01:00
Shauren c9443f190a Core/Spells Fixed scroll stacking check when not targeting self
* Reuse code that removes non-stackable auras at apply to check before casting the spell to keep reagents/cast item

(cherry picked from commit 43d9ffd1bc)
2022-01-01 22:27:05 +01:00
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 bea850fb73)
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 468ecb7252)
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 6067a99632)
2021-12-22 20:50:33 +01:00
ForesterDev aa4ee9278f Core/PacketIO: Port refactors from f6e6baa293 (#24200)
(cherry picked from commit f6e6baa293)
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 6cbfda2fce)
2021-12-22 14:47:20 +01:00
NoName 61f3d51143 Core/Movement: Implement MoveSplineFlag::Enter_Cycle (#24049)
by xvwyh

(cherry picked from commit 40542f01e3)
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 <giacomopoz@gmail.com>
(cherry picked from commit 98d6c501d7)
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 01584cb0b9)
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 02daf1bf3a)
2021-12-20 23:47:23 +01:00
NoName 37178ff311 Core/Spells: SPELL_AURA_48 implementation (#24054)
by xvwyh

(cherry picked from commit b3b7f0761d)
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 <giacomopoz@gmail.com>
(cherry picked from commit 2b024e8fbf)
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 4ccf01de39)
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 e698c17a26)
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 18a4cbee5e)
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 d033032d33)
2021-12-18 23:03:00 +01:00
ForesterDev 4a47e1c6be Core/Defines: define UNIT_FLAG_SWIMMING (#23630)
(cherry picked from commit c03c88d0c0)
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: 4a46fee03e )

Closes #23754

(cherry picked from commit f8d7b26047)
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 15e85f882f)
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 0b87dffc35)
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 d629bad7a1)
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 0b722e23cf)
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 a8b1b9a3c6)
2021-12-17 22:50:25 +01:00
Treeston 6b1ca0ca12 Core/Combat: Properly unset engagement flag on death.
(cherry picked from commit 9c603ea87f)
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 9b292f4369)
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 0e7c66cb4c)
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 560b7e3397)
2021-12-16 22:03:52 +01:00
ccrs ef6a5d3c3c Core/Unit: movement related corrections prior to getting Charmed
(cherry picked from commit 294a3a2789)
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 4fa3c04b72)
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 f869c4969e)
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 12e545f7e2)
2021-12-14 20:52:13 +01:00
ForesterDev 104ec7a81a Core/Unit: Implement more helper methods (#23555)
(cherry picked from commit c44fb37f74)
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 f6f1c48aa5)
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 b47bb59e2a)
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 5c09ff51f7)
2021-12-13 00:42:20 +01:00
jackpoz 841630fcc3 Core/Misc: Fix static analysis issues reported by Coverity Scan
(cherry picked from commit de88691e25)
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 efc999227d)
2021-12-13 00:42:17 +01:00
Aokromes 30cec73c61 Coding standards (#23514)
* Coding standards

* revert part

(cherry picked from commit fe744977c9)
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 1158f267df)
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 aeed616c22)
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 f4b06fd0b7)
2021-12-12 01:27:04 +01:00