Commit Graph

876 Commits

Author SHA1 Message Date
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
Shauren
43d9ffd1bc 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
2020-04-28 11:02:27 +02:00
FAQ
8d87c834e7 Core/Spells: Scrolls should not be consumed, when they fail to apply. 2020-04-28 11:02:27 +02:00
Ovah
f1e4ee21f8 Core/AI: Implemented OnSpellCastInterrupt and OnSuccessfulSpellCast hooks
Ported from: 020825902c and 1aa42e97a8
2020-04-25 16:07:18 -03:00
Gildor
247151b470 Core/Spells: Improve check for non damage/heal spells in Spell::TargetInfo::DoDamageAndTriggers (#24467)
* this prevent cases like full absorb damage that override proper hitMask
2020-04-18 18:04:45 +02:00
Keader
c41ae89069 Core/Spells: Fixed Ice Block / Divine Shield cast in Cyclone (#24465) 2020-04-18 17:53:06 +02:00
Gildor
862097a633 Core/Gameobjects: Improve stealth detection (#24417)
* Core/Gameobjects: Improve stealth detection

* fix warning: private field 'i_funit' is not used

* Code cleanup

* add comment

Co-authored-by: jackpoz <giacomopoz@gmail.com>
2020-04-12 15:28:01 +02:00
Shauren
18b36734f6 Core/Spells: Fixed checking free inventory space for some spells that have bad dbc data
Closes #24423
2020-04-10 16:38:50 +02:00
Giacomo Pozzoni
3def52c1c4 Core/Logs: Log full guid instead of just low guid, part 2 2020-04-05 19:10:58 +02:00
Giacomo Pozzoni
468ecb7252 Core/Logs: Log full guid instead of just low guid 2020-04-05 19:10:57 +02:00
jackpoz
2a41755b58 Core/Spells: Fix missing "Inventory is full" with spells that create more than 1 item 2020-03-19 21:23:35 +01:00
ForesterDev
573ddf4d22 Core/Items: implement some helper methods for easier readability (#24113) 2020-02-01 14:45:58 +01:00
Giacomo Pozzoni
29bf280e34 Core/PathGenerator: Fix path generator returning shortcuts when start and end are on the same polygon (#24036)
* Core/PathGenerator: Fix path generator returning shortcuts when start and end are on the same polygon

Fix path generator returning shortcuts when start and end are on the same polygon by handling this case as if start and end were on 2 different polygons. This will ensure BuildPointPath() gets called which calls FindSmoothPath(), making sure each step is not longer than SMOOTH_PATH_STEP_SIZE (4 yards)

* Change ingame cast error message to SPELL_FAILED_NOPATH from SPELL_FAILED_OUT_OF_RANGE if the generated path is too long
2020-01-09 19:38:45 +01:00