Commit Graph

1205 Commits

Author SHA1 Message Date
Shauren
0ac5b1da8c Core/Spells: Don't select corpses for spell targets that expect to hit units
Closes #24980

(cherry picked from commit 14db2215d3)
2022-01-22 00:33:53 +01:00
Giacomo Pozzoni
8f4db9aa69 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)

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

(cherry picked from commit 98b075cb4b)

* Fix no-pch

Co-authored-by: Ovahlord <dreadkiller@gmx.de>
(cherry picked from commit cc71da35b5)
2022-01-20 00:13:02 +01:00
jackpoz
68faf5bc4b Core/Common: Replace ASSERT(false, "...") with ABORT_MSG("...")
(cherry picked from commit 54c701cf0d)
2022-01-19 22:17:42 +01:00
Seyden
12d00e2e5f Scripts/Spells: Implement OnPrecast scripting hook for spell scripts (#27632)
* Fires before cast bar starts
2022-01-18 21:06:10 +01:00
ModoX
d342be8c79 Core/Spells: Using hearthstone will teleport caster to map again
Closes #27623
2022-01-17 17:02:44 +01:00
Shauren
241193cd02 Core/Items: Implemented many new enchantment flags 2022-01-09 16:31:12 +01:00
Shauren
5f0f9e6875 Core/Spells: Added Spell const* constructor overload to CastSpellExtraArgs 2022-01-09 14:42:35 +01:00
Meji
ddc71206de Core/Spells: Implemented spell effect 225 (SPELL_EFFECT_GRANT_BATTLEPET_LEVEL) (#27506) 2022-01-07 22:14:07 +01:00
ForesterDev
3171cd3fa9 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

(cherry picked from commit e3b232fe0e)
2022-01-06 20:46:25 +01:00
Keader
4110a06e81 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.

(cherry picked from commit d81a9e5bc3)
2022-01-06 19:59:50 +01:00
joshwhedon
e95215e9ae Removing a duplicate item combat spell handling causing poisons (and others) to proc twice. (#24627)
https://github.com/TrinityCore/TrinityCore/issues/24608
(cherry picked from commit 4db77bc913)
2022-01-04 15:33:04 +01:00
Giacomo Pozzoni
89afeed41b 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>
(cherry picked from commit c0b75bf40d)
2022-01-04 15:33:04 +01:00
Shauren
c0f976d23d Core/Spells: Added helper function to select random injured healing spell targets 2022-01-03 13:07:30 +01:00
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
6d94bc2f4b Core/Spells: Fixed refreshing stat buff auras that have been improved by talents
Closes #24527

(cherry picked from commit 978745220a)
2022-01-01 23:45:39 +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
FAQ
88afe180b4 Core/Spells: Scrolls should not be consumed, when they fail to apply.
(cherry picked from commit 8d87c834e7)
2022-01-01 21:55:29 +01:00
Gildor
aa38443cf3 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

(cherry picked from commit 247151b470)
2022-01-01 20:01:16 +01:00
Keader
97ed31fe76 Core/Spells: Fixed Ice Block / Divine Shield cast in Cyclone (#24465)
(cherry picked from commit c41ae89069)
2022-01-01 20:00:53 +01:00
Gildor
60e66621da 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>
(cherry picked from commit 862097a633)
2022-01-01 15:05:01 +01:00
Shauren
ba69c91f4b Core/Spells: Fixed checking free inventory space for some spells that have bad dbc data
Closes #24423

(cherry picked from commit 18b36734f6)
2022-01-01 13:28:04 +01:00
Shauren
f5631b7134 Core/Spells: Implemented target 124 TARGET_UNIT_TARGET_TAP_LIST 2021-12-29 19:08:36 +01:00
Shauren
b50783ae80 Core/Spells: Implemented target 115 TARGET_UNIT_SRC_AREA_FURTHEST_ENEMY 2021-12-29 17:56:11 +01:00
Shauren
115409f353 Core/Spells: Implemented target 116 TARGET_UNIT_AND_DEST_LAST_ENEMY 2021-12-29 16:03:52 +01:00
Shauren
88cf53e54a Core/Spells: Implemented target 62 TARGET_DEST_CASTER_GROUND (the same as target 125) 2021-12-29 13:43:07 +01:00
Shauren
8921d07201 Core/Spells: Rename TARGET_UNIT_CONE_ENEMY_54 to TARGET_UNIT_CONE_180_DEG_ENEMY and add 180 degree fallback for this target type 2021-12-29 11:47:32 +01:00
Shauren
bbdb70ed57 Core/Spells: Implemented target 105 TARGET_UNIT_CASTER_AND_PASSENGERS 2021-12-29 01:18:17 +01:00
Shauren
70f1eaac48 Core/Spells: Rename TARGET_UNIT_CONE_ENEMY_104 to TARGET_UNIT_CONE_CASTER_TO_DEST_ENEMY 2021-12-29 00:12:07 +01:00
Shauren
f515424217 Core/Spells: Implemented target 137 TARGET_DEST_CASTER_MOVEMENT_DIRECTION 2021-12-28 22:19:31 +01:00
Shauren
3c0baab576 Core/Spells: Allow targeting script hooks to work with TARGET_DEST_DYNOBJ_ENEMY, TARGET_DEST_DYNOBJ_ALLY, TARGET_DEST_DYNOBJ_NONE, TARGET_DEST_DEST 2021-12-28 19:25:42 +01:00
Shauren
8029035b80 Core/Spells: Implemented target 138 TARGET_DEST_DEST_GROUND 2021-12-28 19:24:24 +01:00
Shauren
570e882d02 Core/Spells: Fixed Spell::GetUnitTargetCountForEffect incorrectly counting missed targets instead of hit targets 2021-12-25 22:45:59 +01:00
Shauren
5be16577f7 Build fix for older boost version 2021-12-25 21:53:47 +01:00
Matan Shukry
a3d06f2f32 Scripts/Spells: Implemented various rogue spells (#26319)
* Ruthlessness
* Mastery: Main Gauche
* Venomous Wounds
* Symbols of Death
* Backstab
* Premeditation
* Grand Melee
* True Bearing
* Slice and Dice
* Roll the Bones
2021-12-25 21:25:54 +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
jackpoz
4e0da6f7d1 Core/Spells: Fix missing "Inventory is full" with spells that create more than 1 item
(cherry picked from commit 2a41755b58)
2021-12-24 00:46:45 +01:00
ForesterDev
9124fd1f1f Core/Items: implement some helper methods for easier readability (#24113)
(cherry picked from commit 573ddf4d22)
2021-12-21 00:46:13 +01:00
Giacomo Pozzoni
dd929665e5 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

(cherry picked from commit 29bf280e34)
2021-12-20 20:35:37 +01:00
Killyana
a7cf209428 Core/Creature: Clear creature focus after an evade
(cherry picked from commit a32aeceb0d)
2021-12-19 17:44:00 +01:00
Giacomo Pozzoni
8d32849b34 Core/MMaps: Fix charge underwater/falling (#24010)
* Core/MMaps: Fix charge underwater

Fix charge sometimes returning "no path available" when swimming/underwater.
Fix charge selecting a destination point 4 yards above swimming/underwater targets

* Allow falling units to charge targets that are below (lower Z coordinate)

* Disable "raycast" pathfinding as it's not blizzlike.

This might show some strange paths when charging with a target in front.
It also fixes some falling undermap issues.

This Reverts 272009ebee

* Remove Z offset when charging a target as it never made sense

(cherry picked from commit 88a14251e2)
2021-12-19 15:54:09 +01:00
Meji
c4fee8c5cf Core/Spells: Implemented spell effect 204 (SPELL_EFFECT_CHANGE_BATTLEPET_QUALITY) (#27425) 2021-12-19 13:27:27 +01:00
Treeston
14c38a1c52 Core/Unit: Spell focusing now no longer nonsensical. HasSpellFocus always const. Error logs for various stuff.
(cherry picked from commit 4a219eda07)
2021-12-18 11:36:50 +01:00
ccrs
a58881d6da Core/Unit: rename more methods
Workaround prework till actual facing system rework arrives

(cherry picked from commit 85ad0befc5)
2021-12-18 00:29:38 +01:00
ccrs
be4ed9152c Core/Unit: rename IsFocusing method
Workaround prework till actual facing system rework arrives

(cherry picked from commit ec9f15a5ff)
2021-12-18 00:25:14 +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
ccrs
1e84edde39 Core/Spells: Port refactors from d1dc0e2dc1
(cherry picked from commit d1dc0e2dc1)
2021-12-16 00:42:21 +01:00
Shauren
dbb96e7717 Core/Spells: Fixed spells not doing damage after cherry-picking 83a9222c39 2021-12-14 16:13:41 +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
Wyrserth
575f42089e Core/Spell: fix some issues with taunt spells (#23425)
(cherry picked from commit 5dc2dfd60c)
2021-12-13 00:42:18 +01:00