Commit Graph

1190 Commits

Author SHA1 Message Date
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
Wyrserth
83a9222c39 Core/SAI: allow creatures to handle gameobject spellhit SAI events. (#23492)
(cherry picked from commit 7a71127da9)
2021-12-13 00:42:17 +01:00
Treeston
dabdad3b47 Core/Misc: Rename Unit::AttackedTarget to Unit::AtTargetAttacked to match naming scheme for these notifiers
(cherry picked from commit 632a300dd2)
2021-12-12 00:33:18 +01:00
Wyrserth
59da957165 Core/Spells: don't allow spells with SPELL_EFFECT_CREATE_LOOT to be cast if there isn't enough space in inventory (#23404)
* Core/Spells: don't allow spells with SPELL_EFFECT_CREATE_LOOT to be cast if there isn't enough space in inventory,

* Move GetFreeInventorySpace() to a better place, thanks ccrs!

(cherry picked from commit 218055280a)
2021-12-11 13:29:39 +01:00
Wyrserth
9d865f7536 Core/Misc: don't allow players to use/activate/loot non-allowed gameobjects while under the effect of a damage immunity aura (#23319)
* Core/Misc: don't allow players to use/activate/loot non-allowed gameobjects while under the effect of a damage immunity aura.

* Forgot to change this in last-second rename.

* Apply suggested changes, thanks Shauren!

(cherry picked from commit 8bc5451864)
2021-12-09 00:13:59 +01:00
Giacomo Pozzoni
5f545f5402 3.3.5 gameobject summoner (#23289)
* Scripts/Misc: Change IsSummonedBy(Unit*) to IsSummonedBy(WorldObject*)

* Scripts/Misc: Fix build

* Core/TempSummons: Rename GetSummoner() to GetSummonerUnit()

* Core/TempSummons: Add support to TempSummons::GetSummoner() to return GameObject too

* Fix build

* Core/TempSummons: Allow GameObject to be owner of TempSummon

* Core/TempSummons: Add support to SAI for GameObject owner of TempSummon

* Scripts/Misc: Fix no-pch build

* Core/TempSummons: Implement PR comments

(cherry picked from commit 797fba98e9)
2021-12-07 00:02:03 +01:00
brotalnia
ab988dc982 Core/Spells: Return CheckCast result from CastSpell (#23236)
* Return CheckCast result from CastSpell

* Return cast result from UnitAI methods too.

(cherry picked from commit 49d0a5bbb6)
2021-12-05 14:37:13 +01:00
jackpoz
6be185e6a2 Core/Misc: Log Spell/Aura name in Spell/Auras asserts
(cherry picked from commit 4130384f2e)
2021-12-04 00:31:28 +01:00
Jozef Dúc
a13a765610 Core/Object: Range check vol. 2 (#23226)
* Core/Object: Fix all missing parts for #23062

* Update GameObject.cpp

(cherry picked from commit 78070163dc)
2021-12-03 00:21:19 +01:00
jackpoz
a4fcfbb3af Core/Scripts: Rename recent GameObject spell overloads to fix GCC warnings
Rename recent GameObject spell overloads (they used to accept only Unit as parameters) to fix GCC warnings about partial function override.

(cherry picked from commit e3a9a9bfb2)
2021-12-02 00:39:28 +01:00
Jozef Dúc
b717603a9b Core/Object: Range check (#23179)
* Should solve #23062. All credits to @xvwyh

* Remove unused variables

* Remove unused variable

* Cast int32 to uint32

* Remove G3D headers from core header file

* Change door distance

* Update GameObject.cpp

Add newline

* Update GameObject.h

Indentation

(cherry picked from commit 32e1de39a2)
2021-12-02 00:39:20 +01:00
Jeremy
4fcc4a3300 Core/Movement: Fix some undermap issues with random movement/fear/blink (#22937)
* Core/Movement:
- Only move to point if there is a path that is not a shortcut (which will make the unit move through terrain)
- Added new function to check if there is a vmap floor without search distance
- Units that can fly, are underground but far above the vmap floor will stay underground (bronze drakes in tanaris)
- Don't remove PATHFIND_SHORTCUT from path type in some cases

* Core/Object: Ignore UpdateAllowedPositionZ for flying units.

- This will make flying units go through mountains instead of going to the top and back to the bottom to reach you.

* Core/Object: Revert some changes and let MovePositionToFirstCollision deal with a position without ground

* Missing groundZ change for objects on transport

* use CanFly instead of IsFlying

(cherry picked from commit 9fcbd8f15d)
2021-11-26 22:43:48 +01:00
jackpoz
43a41caafb Core/Misc: Fix GCC 8 warnings
(cherry picked from commit 1d04a3b216)
2021-11-24 23:40:15 +01:00
PolarCookie
f7299dce97 Core/Spell: SpellAura Redux (#22794)
* typo and correction

* spell aura no longer shared between targets

_spellAura isolated

* SPELL_AURA_CONTROL_VEHICLE is not strictly single target spell

Steam Tank Control and Wyrmrest Commander

units can reseat themselves again

* Rename 9999_99_99_99_world.sql to 2019_03_08_00_world.sql

(cherry picked from commit ec3cb05d7f)
2021-11-24 20:35:19 +01:00
jackpoz
7a2ef47495 Core/Spells: Adjust range checks to GameObject targets
(cherry picked from commit 72052aa9a5)
2021-11-24 20:35:17 +01:00
jackpoz
71b58c2e62 Core/Spells: Adjust range checks to GameObject targets
(cherry picked from commit 270a144083)
2021-11-24 20:35:17 +01:00