Commit Graph
2095 Commits
Author SHA1 Message Date
ccrs 426f9f2f92 Core/Movement: MotionMaster reimplementation (#21888)
Internal structure and handling changes, nothing behavioural (or thats the intention at least).

(cherry picked from commit 982643cd96790ffc54e7a3e507469649f3b074d2)
2021-09-28 00:15:13 +02:00
ccrs ab740026b3 Core/Movement: crashfix workaround
untested
ref #18471

(cherry picked from commit 76667e45a902f86bd341d40efa28037137e5e541)
2021-09-26 16:16:16 +02:00
Treeston c926e2fc94 1b7ec4b follow-up
(cherry picked from commit 7fe59c95d857708181991bf8478712b56e5076ac)
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 081eab3cf5a5ec42917b2a7eaebf816fb36da423)
2021-09-26 16:07:09 +02:00
ccrs 0b6049fe0b Core/Movement: use helpers for validation
(cherry picked from commit 71188062314ee94402d9d3e228fd5b46e8865b18)
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 2a45418032233bc8779cdb44f9be6057c4b417c5)
2021-09-26 14:19:36 +02:00
ccrs 4793b073ee Core/Misc: movement header cleanup
(cherry picked from commit f9914caefc59f36ab7583432442a26b29124b7f1)
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 74defba5a7e3e0619ca05808936ebd74741e1472)
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 2a84562dc85516f432bb1e5de9add23c28b26ce4)
2021-09-24 23:37:43 +02:00
ariel- 3ea88f814a Core/Spells: all bleed effects should ignore armor
Closes #21759

(cherry picked from commit 5dec0e491ba56c940833791d2cb4a2607c2b003f)
2021-09-23 23:37:11 +02:00
Treeston bc89e1cdb0 Core/Position: Refactor GetAngle -> GetAbsoluteAngle because code clarity is good.
(cherry picked from commit 4692e10ca2ffed5ba2a0336e9c93962b0fad9eaa)
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 a35d0a5f56c224ea081cdd5e16eb7bd181e70ab0)
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 a891eb364e941a5146fba4af16e1ecf65cdd9239)
2021-09-06 15:23:29 +02:00
ariel- 60ff73eeba Core/Spell: fix SendSpellMiss requiring caster Unit
(cherry picked from commit 7f947646f9d51b53b5297bfdddbada09500c53d3)
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 93eda20d5cf6eeb34e1aee1b81469ba6e8fa7f0c)
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 45c5e1b9d63796d168339a44f63418f220cf2403)
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 e8d5aa56cc48572d81e1898b7b4ff10cfa6d1957)
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 9b38a6352c0fe2499de54fd769aa1c721a410bda)
2021-08-28 15:59:11 +02:00
ariel- 1e1415a491 Core/Spells: rework part 1: Improved positive detection logic
(cherry picked from commit efeae33495c8b57ae04aeeb382ee85099ac0b600)
2021-08-28 15:59:11 +02:00
Shauren a91edcb952 Core/Creatures: Remove hover on death
(cherry picked from commit 241109327bf573460d488d707d7eb19f82f1350c)
2021-08-24 13:45:34 +02:00
Shauren 2e2b298618 Core/Movement: Fixed creature hover
Closes #15177

(cherry picked from commit 2baa81065ba27f0a6d278a8dd8a79b7c831e0a2b)
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 98d6258efdc07b53808ba6177e5427c65163bc0d)
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 1074a9b053c7d1fbff1321bf95b15d7be1ee669f)
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 fc678bb3c21d6c5a87a840c7bbf596eaea1cffc3)
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 ba27711145d1b015578aedb48ea8532b4f0bec75)
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 d3d0640a8d61e9a216876b7f1b114673893b2bc8)
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 c7095375c37c3812d14fbc865b95c8442b8712cf)
2021-06-20 01:09:20 +02:00
ariel- 23a88fae6f Core/Scripts: remove Tenacity hack, implemented with proper aura
(cherry picked from commit 404240fb6820ab997b65740b234305c4c654c543)
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 4d14f613f3d0dc579e2ca4b8dead65ac6e43965d)
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 52873a7072ceb1f88d9caeefdda6084e6bb1d4af)
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 2d2c43f4b91fef6fcd4d8c069a9bb41d66c97efe)
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 e315e41d36061fc88dfa09bfa0da1fbc0c00826f)
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 514c847881a9fff504e90f1186a1209c0b8a3674)
2021-06-16 19:43:20 +02:00
Treeston 14bda72751 Core/Unit: Remove a superfluous threat state update in SetPhaseMask.
(cherry picked from commit 2c86c78f04f7cb95c201592b8d3002525eb6a46f)
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 9f5d1e2b10013e5fecf35fdd5af70921c96d07d1)
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 ccf0807be0974dfb8080cb2fc6ea616cc96f062c)
2021-06-15 23:42:10 +02:00
ariel- bf4330bfb5 Core/Unit: fix mess-up with CalcArmorReducedDamage parameter order
(cherry picked from commit 01537e1dfbd042b3608d5ac895009182026def00)
2021-06-15 23:08:27 +02:00
ariel- 431a326e69 Core/Entities: Port some refactors from f1986c6aafdf2457902a7a4cc7acc903cbbdc7bb 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 688e96fb4ffcdeb55b58d13285e3cebfbc617614)
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 0e9b1635e0a2351342e8ed0ae4a1495479e09ffc)
2021-06-14 18:50:10 +02:00
ariel- 84a29d8077 Core/Unit: fixed crash
Closes #21231

(cherry picked from commit 22b24d8dae23d4a4b4314f46b65b8e453816eef7)
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 d570e2af3e7bcb625d8941397d55972d49319a8f)
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 3b01cccd7eafaff9f3b8236a544e4fa46818926c)
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 cb9e72e521d3cc415dd15bf6912c87f89e41b92a)
2021-06-13 00:59:13 +02:00