Commit Graph

888 Commits

Author SHA1 Message Date
Jinnaix
b155209ec4 Core/Spells: Correct flagging spell caster for pvp when healing/buffing friendly creatures - it should only happen if target is in combat (#27977) 2022-06-09 11:33:30 +02:00
Gildor
70767717c1 Core/Spells: Increase search radius for avoid problems with some spells that can't find units with huge combat reach (#27827) 2022-04-06 23:56:40 +02:00
Shauren
3f55647b3e Core/Spells: Add one more allowed case for CastSpellTargetArg constructor 2022-04-01 20:33:46 +02:00
Shauren
e334fdf3ad Core/Units: Reduce differences between branches part 1 - object class 2022-03-29 23:07:07 +02:00
Shauren
d611925dc7 Core/Units: Reduce differences between branches part 1 - unit updatefield accessors 2022-03-29 11:30:49 +02:00
offl
ad5129e74b Core/AI: Change m_originalCaster to m_caster when calling OnSpellStart (#27815) 2022-02-21 20:06:35 +02:00
offl
3dca705acc Core/AI: OnSpellCast, OnSpellFailed, OnSpellStart hooks (#27704) 2022-02-18 19:14:44 +02:00
trickerer
084f8f3ded Core/Combat Improve extra attacks handling (#26859)
* Core/Combat Improve extra attacks handling

* Remove unnecessary _lastDamagedTargetGuid check

* Add missing initialization of _lastExtraAttackSpell. Do not use hardcoded spell ids.

* Partially revert 9f90b83501
2021-10-01 16:40:20 +02:00
Shauren
7440c9cf19 Core/Spells: Removed SpellEffIndex effIndex argument from spell effect handlers 2021-08-30 23:51:37 +02:00
Shauren
5ccf7164cb Build fix 2021-08-29 22:14:34 +02:00
Shauren
6573395f24 Core/Spells: Spell effect info access refactoring part 2 - passing SpellEffectInfo as arguments directly instead of SpellInfo + effect index 2021-08-29 21:12:49 +02:00
Shauren
4c59532865 Core/Spells: Begin unifying spell effect access api with master branch
* Introduce SpellInfo::GetEffects and SpellInfo::GetEffect functoins
2021-08-28 23:42:25 +02:00
jackpoz
33dace231c Core/Misc: Fix issues reported by static analysis 2021-06-20 13:11:53 +02:00
Chaouki Dhib
2d114ea560 Core/Movement: Improve client control logic (#26348) 2021-05-16 13:16:08 +02:00
Ovah
6215cb4e00 Core/Spells: implement SpellInfo helper to filter for relevant mechanic immunities in spell_start packet (#26183)
* Core/Spells: implement SpellInfo helper to filter for relevant mechanic immunities when sending SMSG_SPELL_START packets.

According to sniff analysis Blizzard does not send all mechanic immunities of creatures but instead only the ones that are responsible for actual interrupts which are MECHANIC_INTERRUPT  and MECHANIC_SILENCE. Additionally we no longer send immunities for instant cast spells as sniffs confirm that they are not sent for spells without a cast time.
2021-04-11 12:51:58 +02:00
offl
e6d9d9ead9 Core/Misc: Define / rename attributes and flags (#26315)
Co-authored-by: Trond B. Krokli <38162891+illfated@users.noreply.github.com>
2021-04-08 19:28:02 +03:00
Gildor
c13ccaab5c Core/Spells: Aura refresh improvements (#25511) 2020-10-08 20:36:50 +02:00
Ovah
77aa058504 Core/Spells: unify OnSpellCastInterrupt and OnSuccessfulSpellCast hooks into OnSpellCastFinished (#25522)
* added support for calling the hook when completing a channeled spell as well
2020-10-03 00:48:32 +02:00
Ovah
0d152e932c Core/Spells: fix a possible crash when a target that has been focused during spell casts disappears 2020-09-15 14:49:18 +02:00
Ovah
39a436bd65 Core/Spells: cleaned up and improved spell focusing behavior (PR #25440) 2020-09-14 19:47:51 +02:00
Keader
d7a78c1930 Core/Spells: Do not reset periodic timer for stacking DoTs on recast 2020-09-13 13:48:53 +02:00
Treeston
3fbbe7cfbe Core/Misc: DBC std::array refactors, and |Hachievement unit tests 2020-09-01 00:38:46 +02:00
Giacomo Pozzoni
8a48ece573 Core/Spell: Fix name clashing between local variables and class member fields (#25352) 2020-08-29 14:33:49 +02:00
Giacomo Pozzoni
cfc8f7b442 Core/Misc: Fix issues reported by static analysis (#25351)
* Core/Misc: Fix issues reported by static analysis

* Core/Vmaps: Code cleanup after e777161888
2020-08-29 13:02:42 +02:00
Shauren
bf7efe3ca0 Core/PacketIO: Fixed structure of "fake" SMSG_SPELL_GO sent when loading pets from db
Closes #25354
2020-08-28 23:59:17 +02:00
Shauren
bbcf00257e Core/Spells: Fix summoning warlock pets in case that pet has never been summoned before 2020-08-17 11:52:44 +02:00
Shauren
9c5876d8ab Core/Spells: Fix summoning SUMMON_PET type pets
Closes #25265
2020-08-17 09:19:43 +02:00
Shauren
5c1fc5e387 Core/Pets: Pet management refactoring (#25191)
* Core/Pets: Pet management refactoring

* Preload basic pet data on character login with async query
* Load additional pet data (declined names/auras/spells/cooldowns) using async query after we are sure pet loading will succeed
* Remove all select queries related to pet stable/unstable
* Remove all silent pet deletions except explicit UI-triggered abandons
* Fixed displaying stable master content when current pet is not summoned
* Allow to stable/swap unsummoned current pet

Closes #3610
Closes #21266
2020-08-16 21:39:25 +02:00
Carbenium
1d8782e356 Core/EventProcessor: std::chrono-ify the remaining public API 2020-07-27 13:36:25 +02:00
Carbenium
92a02a5c87 Core/EventProcessor: std::chrono-ify CalculateTime
uint64 CalculateTime(uint64 t_offset) has been replaced with Milliseconds CalculateTime(Milliseconds t_offset).
Also add the std::chrono-ified overload void AddEvent(BasicEvent*, Milliseconds, bool)
2020-07-27 13:36:25 +02:00
Peter Keresztes Schmidt
85b5b842ca Misc: Use [[fallthrough]] attribute instead of comment to mark intentional fallthroughs (#25054)
Related: #25006
2020-07-18 20:42:28 +02:00
Peter Keresztes Schmidt
202fd41389 Core/Misc: Replace boost::optional with std::optional (#25047)
C++17 is already mandatory, so it's a safe thing to do
2020-07-15 10:22:29 +02:00
Peter Keresztes Schmidt
c92950b3e1 Core/DataStores: Update DBC field names to generated ones (#24999) 2020-07-12 15:36:55 +02:00
Shauren
14db2215d3 Core/Spells: Don't select corpses for spell targets that expect to hit units
Closes #24980
2020-07-09 18:44:21 +02:00
jackpoz
519192f210 Core/Spells: Add missing code from corpse target type cherry-picks 2020-07-05 16:21:58 +02:00
Giacomo Pozzoni
cc71da35b5 Core/Spells: implement corpse target type support and properly fix resurrections (#24921)
* Core/Spells: implement corpse target type support and properly fix resurrections

(cherry picked from commit df193945d9)

# Conflicts:
#	src/server/game/Spells/Spell.cpp
#	src/server/game/Spells/Spell.h

* Core/Spells: implement TARGET_CORPSE_SRC_AREA_RAID and updated remaining resurrection effect handlers for updated corpse targeting

(cherry picked from commit 98b075cb4b)

# Conflicts:
#	src/server/game/Miscellaneous/SharedDefines.h
#	src/server/game/Spells/Spell.cpp
#	src/server/game/Spells/SpellEffects.cpp
#	src/server/game/Spells/SpellInfo.cpp

* Fix no-pch

Co-authored-by: Ovahlord <dreadkiller@gmx.de>
2020-06-29 23:03:03 +02:00
Shauren
0468c70dfe Core/Maps: Implemented getting area id from gameobject spawns
Yes, you can now spawn LK platform anywhere and it will treat you as inside Icecrown Citadel

(cherry picked from commit 42f9deb21e)
2020-06-27 20:23:30 +02:00
jackpoz
54c701cf0d Core/Common: Replace ASSERT(false, "...") with ABORT_MSG("...") 2020-06-26 23:37:52 +02:00
Rothend
50a9c49c88 Core/Spell: fix ammo consumption for Hunter's non-damaging spells. (#24819) 2020-06-24 21:08:39 +02:00
Peter Keresztes Schmidt
b210bb3713 Core/Misc: Replace Trinity::make_unique with std (#24869)
(cherry picked from commit bab5fd87a3)
2020-06-23 18:03:16 +02:00
ForesterDev
e3b232fe0e Core/AI: refactor SpellHit and SpellHitTarget. (#24691)
* Core/AI: refactor SpellHit and SpellHitTarget.

- now caster/target is WorldObject instead of Unit
- remove SpellHitByGameObject / SpellHitTargetGameObject (handled by SpellHit / SpellHitTarget)
- rename parameters in scripts according parent methods

* Restore logic in Algalon script

* Changed check for REMORSELESS_WINTER hit to avoid dublicate call, because it has TARGET_UNIT_CASTER for effects 0/1 and TARGET_GAMEOBJECT_SRC_AREA for effect 2

* Fix build after merge
2020-06-07 10:22:13 +02:00
Keader
d81a9e5bc3 Core/Misc: Fixed resistance calculate for Mutated Transformation and Twilight Bloodbolt (#24717)
Ref: 9f7b464a6a
- Implemented a new SpellScript hook that allow control Resistance/Absorb amount of a damage spell.
2020-06-03 22:05:08 -03:00
Gildor
90e00c3e2a Core/Spells: Fix ammo consumption (#24736) 2020-06-02 20:34:44 +02:00
joshwhedon
4db77bc913 Removing a duplicate item combat spell handling causing poisons (and others) to proc twice. (#24627)
https://github.com/TrinityCore/TrinityCore/issues/24608
2020-05-15 21:54:33 +02:00
Giacomo Pozzoni
c0b75bf40d Core/MMAPs: Adjust walkable climb and fix a lot of mmap raycast issues (#24539)
* Core/MMAPs: Adjust walkable climb

Adjust walkable climb as recast using walkableClimb also to find the poly from a position, giving priority to polys that are below the position but closer than walkableClimb.

* Temporarily disable static collision (the whole check should be removed)

* Core/Spells: removed deprecated mmap path check for TARGET_DEST_CASTER_FRONT_LEAP

* Core/Objects: allow flying units to use the helper as well (flying units casting radius based spells)

* Code refactor

* Handle raycasts that end in a point with no height in the mmap mesh as PATHFIND_NOPATH

* Walk back a bit from raycast hitpoints as sometime the 2D result point is outside of the polygons due to floating point errors.

* Remove whitespace

* Revert 4a197ba22a as a raycast point path should have the Z retrieved with getPolyHeight(). Raycast will only return a 2-point path with Start and Hitpoint/End

* Cleanup PathGenerator raycast case

* Fix PathGenerator raycast broken if start and end are on same poly.
Fix PathGenerator raycast broken if no wall is hit.
Remove unused case of using raycast with an existing previous path (can be added back properly if needed).
Remove forcing poly length to 2 when we actually have already the right number.

* Use closestPointOnPolyBoundary on the second try of finding a point on poly for raycast.
Note that in this case the mesh height is not used which might cause issues. The poly boundary height will be used instead.

* Handle cases where getPolyHeight() fails because the point is on polygon border (and caused by floating point imprecision)

* Add far from poly flags

* Set PATHFIND_INCOMPLETE in raycast case if startFarFromPoly or endFarFromPoly

* Fix blink close to walls with no valid polygon behind the wall

* Require to re-extract mmaps

Co-authored-by: Ovah <dreadkiller@gmx.de>
2020-05-15 20:43:12 +02:00
Shauren
c189fe4911 Core/Spells: Fix refreshing exclusive auras that have different values in each effect
Closes #24592
2020-05-10 16:30:48 +02:00
Shauren
1fecbc6892 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
2020-05-06 16:45:03 +02:00
Shauren
829cf38c67 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
2020-05-03 16:19:19 +02:00
Shauren
978745220a Core/Spells: Fixed refreshing stat buff auras that have been improved by talents
Closes #24527
2020-05-01 21:02:01 +02:00
NoName
c38a9d757d Core/Spells: implement SMSG_MOUNT_RESULT and use it for transformed mounting cases (#24507)
cherry-pick from fb0d2ed2b9

Co-authored-by: Ovah <dreadkiller@gmx.de>
2020-04-29 22:37:35 +02:00