Commit Graph

2093 Commits

Author SHA1 Message Date
Treeston
c926e2fc94 1b7ec4b follow-up
(cherry picked from commit 7fe59c95d8)
2021-09-26 16:11:59 +02:00
Treeston
f1ac141f25 Core/Unit: UNIT_FLAG renames
[UNIT_FLAG_PLAYER_CONTROLLED -> UNIT_FLAG_POSSESSED]
[UNIT_FLAG_PVP_ATTACKABLE -> UNIT_FLAG_PLAYER_CONTROLLED]
Signed off by: Shauren, Warlockbugs.

(cherry picked from commit 081eab3cf5)
2021-09-26 16:07:09 +02:00
ccrs
0b6049fe0b Core/Movement: use helpers for validation
(cherry picked from commit 7118806231)
2021-09-26 14:21:14 +02:00
ccrs
d59a6af9c6 Core/Movement: move MoveSplineInit (#21857)
The number of edge cases in which weirdness is seen on "effect movements" will be kinda reduced, plus consistency, plus movementInform on custom movement spline initalizations.

(cherry picked from commit 2a45418032)
2021-09-26 14:19:36 +02:00
ccrs
4793b073ee Core/Misc: movement header cleanup
(cherry picked from commit f9914caefc)
2021-09-26 01:22:17 +02:00
Treeston
3d9d6fbcb8 Core/Movement: Fix a potential crash on newly created pets. Closes #21791.
(cherry picked from commit 74defba5a7)
2021-09-24 23:43:30 +02:00
Treeston
1493920495 Core/Movement: Replace old TargetedMovementGenerator into ChaseMovementGenerator and FollowMovementGenerator, full rewrite for both.
- Chase to angle is now functional. Pets use this to chase behind the target. Closes #19925.
- Chase to arbitrary range interval works. Not used anywhere, but you can technically make hunter-like mobs.
- Pets now follow the hunter cleanly and without stutter stepping. Also fix some other things. Closes #8924.

(cherry picked from commit 2a84562dc8)
2021-09-24 23:37:43 +02:00
ariel-
3ea88f814a Core/Spells: all bleed effects should ignore armor
Closes #21759

(cherry picked from commit 5dec0e491b)
2021-09-23 23:37:11 +02:00
Treeston
bc89e1cdb0 Core/Position: Refactor GetAngle -> GetAbsoluteAngle because code clarity is good.
(cherry picked from commit 4692e10ca2)
2021-09-23 22:21:29 +02:00
Meji
0a83f74876 Core/Achievements: Update CriteriaType enum (#26856) 2021-09-08 22:07:01 +02:00
ariel-
a6e84ebfab Core/Entities: completely remove 60% melee miss cap as there is no proof of its existence
- Auras modifying hit chance should have full effect now

Ref issue #21629

(cherry picked from commit a35d0a5f56)
2021-09-06 21:32:47 +02:00
Keader
0de5fbb6c0 Core/Unit: Guardians no longer enter combat before reaching the target (#19816)
(cherry picked from commit a891eb364e)
2021-09-06 15:23:29 +02:00
ariel-
60ff73eeba Core/Spell: fix SendSpellMiss requiring caster Unit
(cherry picked from commit 7f947646f9)
2021-09-05 22:48:28 +02:00
ariel-
9fa95b4b57 Core/Spells: Fix periodic rolling adding bonuses twice
Calculation is now done in CalculateAmount

(cherry picked from commit 93eda20d5c)
2021-09-04 22:52:31 +02:00
Shauren
8a4e1119ac Core/Spells: Unify spell effect access api in both branches 2021-09-04 15:13:15 +02:00
Shauren
9d7eee1a8c Core/Auras: Fixed cherry-pick mistakes in Unit::RemoveMovementImpairingAuras and Unit::HasAuraWithMechanic 2021-08-30 23:21:14 +02:00
Shauren
407e5aea1a Core/Spells: Remove leftover code from old mechanic - default spellpower scaling coefficients 2021-08-30 23:17:12 +02:00
ariel-
962f6d7988 Core/Spells: rework part 5: GameObject casting
Closes #21330
Closes #18885
Ref #18752

(cherry picked from commit 45c5e1b9d6)
2021-08-28 15:59:11 +02:00
ariel-
f3548d45d0 Core/Spells: rework part 3: spells only handle at most one UnitAura and one DynObjAura during its lifetime
Closes #15088

(cherry picked from commit e8d5aa56cc)
2021-08-28 15:59:11 +02:00
ariel-
52ae3c89d1 Core/Spells: rework part 2: Split up target selection logic
Target check only determines what kind of entities we can target, spell positivity determines if that entity is valid for attack/assist

Closes #8844

(cherry picked from commit 9b38a6352c)
2021-08-28 15:59:11 +02:00
ariel-
1e1415a491 Core/Spells: rework part 1: Improved positive detection logic
(cherry picked from commit efeae33495)
2021-08-28 15:59:11 +02:00
Shauren
a91edcb952 Core/Creatures: Remove hover on death
(cherry picked from commit 241109327b)
2021-08-24 13:45:34 +02:00
Shauren
2e2b298618 Core/Movement: Fixed creature hover
Closes #15177

(cherry picked from commit 2baa81065b)
2021-08-24 12:44:38 +02:00
ariel-
a1a00f823e Core/Entities: kill unused return value from Unit::HandleSpellClick
- AI hook will now receive the result by copy, as modifying it had no effect
- Some renaming: result->spellClickHandled, clickPair is actually clickBounds, the clickPair is the pair <creatureID, SpellClickInfo>

(cherry picked from commit 98d6258efd)
2021-08-08 21:21:34 +02:00
ariel-
181c671924 Core/Scripts: remove hack that caused aura to not be applied and saved twice on owned auras, causing an error on save
- This is handled by group stack rules actually
- Also reset removed aura counter when cleaning removed auras

Closes #21486

(cherry picked from commit 1074a9b053)
2021-08-08 21:21:34 +02:00
ariel-
b1a76fc756 Core/Unit: clear charmed/possessed state before returning client control. Works like a charm
Closes #21471

(cherry picked from commit fc678bb3c2)
2021-08-08 21:21:34 +02:00
ariel-
70c26d53cb Core/Entities: unit states cleanup
- Added new UNIT_STATE_FOCUSING for creature focus system, this will stop creatures adding/clearing the UNIT_STATE_CANNOT_TURN mask (eg UNIT_STATE_STUNNED if stunned while focusing a spell)
- Added UNIT_STATE_CHARMED that gets set/removed on any charm type (UNIT_STATE_POSSESSED is only for possess as it's name suggests)
- The new states are checked against mask to know whenever client needs to regain character control

Closes and fixes #21460

(cherry picked from commit ba27711145)
2021-08-08 21:21:34 +02:00
jackpoz
efce8ca379 Core/Misc: Fix static analysis issues
Fix static analysis issues reported by Coverity

(cherry picked from commit d3d0640a8d)
2021-08-08 21:21:34 +02:00
Shauren
9067eb22ce Core/Units: Fixed crash in Unit::CalcArmorReducedDamage when called from periodic aura tick if caster is no longer in world
Closes #26776
2021-08-08 13:03:57 +02:00
Shauren
ce1046a8fd Core/DataStores: 9.1.0 db2 structures 2021-08-08 00:18:10 +02:00
ariel-
15810eb579 Core/Unit: kill unused parameter from SpellxxxBonusTaken
(cherry picked from commit c7095375c3)
2021-06-20 01:09:20 +02:00
ariel-
23a88fae6f Core/Scripts: remove Tenacity hack, implemented with proper aura
(cherry picked from commit 404240fb68)
2021-06-20 00:55:53 +02:00
ariel-
bc6b0c5197 Core/Unit: corrected calculation for SPELL_AURA_MOD_DAMAGE_TAKEN/SPELL_AURA_MOD_HEALING auras
- Spell bonus calculation and penalty was done twice, but it's simply flat +SP, which should be taken into account before other bonuses
- Fixed missing code from SpellDamageBonusDone/SpellHealingBonusDone and killed multiplication by stack amount twice for default coefficient spells (already multiplied on level penalty)

(cherry picked from commit 4d14f613f3)
2021-06-20 00:28:50 +02:00
ariel-
85e5509e91 Core/Spells: calculate crit chance only for spells that do damage/healing
Refs #18813

(cherry picked from commit 52873a7072)
2021-06-19 23:33:38 +02:00
ariel-
d34292534c Core/Spells: fix SPELLMOD_DAMAGE application order for melee spells
Closes #20597

(cherry picked from commit 2d2c43f4b9)
2021-06-19 23:33:23 +02:00
ariel-
29bfa32fc3 Core/Entities: don't allow client control if player is still affected by any lose of control state
(cherry picked from commit e315e41d36)
2021-06-16 20:38:56 +02:00
ariel-
df585571f1 Core/Unit: fixed Global cooldown cancelation on spell interrupt
Thanks to Nyeriah for the heads up

(cherry picked from commit 514c847881)
2021-06-16 19:43:20 +02:00
Treeston
14bda72751 Core/Unit: Remove a superfluous threat state update in SetPhaseMask.
(cherry picked from commit 2c86c78f04)
2021-06-16 14:37:58 +02:00
ariel-
85ffcd9826 Core/Scripts: fix wrong uses of SetHitDamage hook.
This hook modifies damage AFTER it has been reduced by target auras/armor/resistances etc, it's useful if you want to scale damage by a factor, but not to add flat bonuses.
We're fixing those by moving calculation to Launch phase, where target taken bonuses haven't been used yet.

- Bronjahm: Magic's Bane
- BPC: Shadow Prison
- Oculus: Shock Lance
- Ymiron: Dark Slash (extra fix, it was wrongly damaging half of total health, it's supposed to be half of CURRENT health!)
- DK: Raise Ally Thrash spell (also extra fix: corrected formula)
- Warrior: Bloodthirst (shouldn't matter much as it's damage class none and those don't get bonuses by default)
- Warrior: Concussion Blow
- Warlock: extra fix for Haunt, healing part shouldn't scale with spell power

Closes #9560

(cherry picked from commit 9f5d1e2b10)
2021-06-16 14:26:09 +02:00
ariel-
d0fa8c72a3 Core/Unit: check remaining instead of full duration for Bounced by DR auras
(cherry picked from commit ccf0807be0)
2021-06-15 23:42:10 +02:00
ariel-
bf4330bfb5 Core/Unit: fix mess-up with CalcArmorReducedDamage parameter order
(cherry picked from commit 01537e1dfb)
2021-06-15 23:08:27 +02:00
ariel-
431a326e69 Core/Entities: Port some refactors from f1986c6aaf 2021-06-15 00:48:02 +02:00
ariel-
6ab410b926 Core/Unit: allow miss chance to exceed 60% cap with certain auras
(cherry picked from commit 688e96fb4f)
2021-06-14 18:52:48 +02:00
ariel-
770367a514 Core/Unit: fix Sanctified Wrath (again)
- Actually only rank 1 was affected because of 50% reduction on rank 2

(cherry picked from commit 0e9b1635e0)
2021-06-14 18:50:10 +02:00
ariel-
84a29d8077 Core/Unit: fixed crash
Closes #21231

(cherry picked from commit 22b24d8dae)
2021-06-14 01:19:38 +02:00
ariel-
bec829df0a Core/Unit: simplified and arranged spell bonus calculation
- Remove duplicated SPELLMOD_BONUS_MULTIPLIER handling (both on done and taken)
- Handle properly bonus data, don't apply bonus by default, only player spells should take into account spell power
- Moved Earthliving Weapon coefficient to DB
- Refactored Avenging Wrath handling

Closes #13287
Closes #21230

(cherry picked from commit d570e2af3e)
2021-06-14 01:17:43 +02:00
ariel-
5fbddef85f Core/Spell: SpellValueOverrides encapsulation
- No sense to let scripts use SpellValueOverrides, we already have modifiers in CastSpellExtraArgs struct

(cherry picked from commit 3b01cccd7e)
2021-06-14 00:19:50 +02:00
ariel-
fccf1a8c62 Core/Auras: removed caster dependency from core
- Decoupled Unit logic: split of spell critical chance into done (caster bonuses) and taken (target bonuses), this allows to precalculate caster bonuses on aura apply and then check victim's auras on damage/healing calc
- Made static a bunch of methods (they no longer have this pointer because they are now called from periodic handlers which may or may not have an active caster in world)
- Simplified all AuraEffect bonuses into AuraEffect::_amount, no more duplicated code
- Critical chance and whether or not caster is player owned unit (for resilience calcs) is now saved one level upper, on Aura itself (it's impossible as of 3.3.5 to have different effects with different critical chances)
- Minor cleanup of SPELL_DAMAGE_CLASS_NONE and Arcane Potency (#18813) crit handling

Closes #19876

(cherry picked from commit cb9e72e521)
2021-06-13 00:59:13 +02:00
Shauren
f6b919fafe Core/Reputation: Named all reputation flags 2021-06-05 23:00:06 +02:00
Shauren
9542d221cb Core/Units: Add std::function overloads to GetAura/GetAuraApplication 2021-06-04 21:20:55 +02:00