Commit Graph

37606 Commits

Author SHA1 Message Date
ariel-
4bb8c93df8 Core/Spells: rework part 4: iterate over effects first
Implement far spell queue processing

# Conflicts:
#	src/server/game/Spells/Spell.cpp
2022-09-12 09:15:13 +02:00
ariel-
3fbbea61bd Core/Spells: rework part 3: spells only handle at most one UnitAura and one DynObjAura during its lifetime
# Conflicts:
#	src/server/game/Spells/Auras/SpellAuras.h
2022-09-12 09:15:13 +02:00
ariel-
98a988a77a 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
2022-09-12 09:15:13 +02:00
ariel-
95bc5dcc40 Core/Spells: rework part 1: Improved positive detection logic
# Conflicts:
#	src/server/game/Spells/SpellInfo.cpp
2022-09-12 09:15:12 +02:00
Ovahlord
36b5e120af build fix 2022-09-12 09:15:12 +02:00
ariel-
2baddd4393 Core/Auras: remove too strict checks in area auras, since a few aren't owned by its caster 2022-09-12 09:15:12 +02:00
Ovahlord
3e89f6c8e3 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
2022-09-12 09:15:12 +02:00
ariel-
6640641cce Core/Auras: restrict target map update only to area auras as player requires to have auras registered on load 2022-09-12 09:15:12 +02:00
ariel-
e23f4e38cf Core/Auras: skip target map update for one world tick if owner is not yet in world 2022-09-12 09:15:11 +02:00
ariel-
9f9f3fa24f Core/Auras: make area and dynauras condition compliant by using the spellarea searcher instead of script searchers 2022-09-12 09:15:11 +02:00
ariel-
3bfa32d15b Core/Unit: kill unused parameter from SpellxxxBonusTaken 2022-09-12 09:15:11 +02:00
ariel-
6024b7b4fb 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)
2022-09-12 09:15:11 +02:00
ariel-
c81f48197d Core/Spells: calculate crit chance only for spells that do damage/healing 2022-09-12 09:15:10 +02:00
ariel-
dc46f0621b Core/Spells: remove 'Vanish Purge' hack, the spell is present on DB and is copy of one in vanilla DBC
Thanks to killerwife for the heads-up
2022-09-12 09:15:10 +02:00
Ovahlord
cecaedfb80 Scripts/Misc: added a few pointer checks in JustDied hook overrides 2022-09-12 09:15:10 +02:00
ariel-
64b9b1c28b Core/Spells: kill unused parameter from Spell constructor 2022-09-12 09:15:10 +02:00
ariel-
0d6840ee7f Core/Spell: killed deprecated code which randomly changed powercost for missed spells 2022-09-12 09:15:09 +02:00
ariel-
80ab03a8af Core/Player: only call _ApplyWeaponDamage for actual weapons 2022-09-12 09:15:09 +02:00
Ovahlord
2b9d976ed1 fixed build 2022-09-12 09:15:09 +02:00
ariel-
276d6e49f1 Core/Entities: killed Creature::SetInCombatWithZone and replaced with AI version
Closes #12108 (again)

(cherry picked from commit 7c9722a4ae)

# Conflicts:
#	src/server/game/AI/SmartScripts/SmartScript.cpp
#	src/server/game/Entities/Creature/Creature.cpp
#	src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp
#	src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp
#	src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp
#	src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
#	src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
#	src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp
#	src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp
#	src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp
#	src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
2022-09-12 09:15:09 +02:00
Ovahlord
4e3c6bcf6a DB: added a missing spell script name from a cherrypick 2022-09-12 09:15:08 +02:00
Ovahlord
30e219bfa1 Core/Entities: don't allow client control if player is still affected by any lose of control state 2022-09-12 09:15:08 +02:00
ariel-
0f69e644d2 Core/PlayerAI: perform cast checks on auto ranged attack 2022-09-12 09:15:08 +02:00
ariel-
c9e732b0bf 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
2022-09-12 09:15:08 +02:00
Ovahlord
b4f9844ce0 Scripts/Misc: added a few more nullptr checks in DamageTaken hooks 2022-09-12 09:15:07 +02:00
ariel-
51045c3b50 Core/Scripts: added nullptr checks to DamageTaken hooks
Since cb9e72e521 attacker may not be in world when hook is called

(cherry picked from commit 0db5c2df3f)

# Conflicts:
#	src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp
#	src/server/scripts/World/npcs_special.cpp
2022-09-12 09:15:07 +02:00
Ovahlord
1c09965c0f fixed another cherrypick typo 2022-09-12 09:15:07 +02:00
Ovahlord
5ff7fda516 resolved a cherrypick mistake 2022-09-12 09:15:07 +02:00
ariel-
8054d99c8a Core/Scripts: fix some spells double dipping from done/taken bonuses 2022-09-12 09:15:07 +02:00
ariel-
7f587d988c Core/Auras: fix static analysis issues
CID 1384433
CID 1384436
2022-09-12 09:15:06 +02:00
ariel-
5d8fc591ed Core/Unit: fix mess-up with CalcArmorReducedDamage parameter order 2022-09-12 09:15:06 +02:00
ariel-
29fddba8fd Core/Entities: Port some refactors from f1986c6aaf 2022-09-12 09:15:06 +02:00
ariel-
6fc5bfcd08 Core/Unit: fixed crash 2022-09-12 09:15:05 +02:00
ariel-
fd228f6c41 Core/Unit: simplified and arranged spell bonus calculation 2022-09-12 09:15:05 +02:00
ariel-
a804af7219 Core/Spell: SpellValueOverrides encapsulation
- No sense to let scripts use SpellValueOverrides, we already have modifiers in CastSpellExtraArgs struct
2022-09-12 09:15:04 +02:00
ariel-
1d3fbff332 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
2022-09-12 09:15:04 +02:00
Shauren
d448ea4370 Core/Spells: Rename SpellAttr0 to use official attribute names 2022-09-12 09:15:04 +02:00
Ovahlord
24b84ba980 Core/Spells: Eye for an Eye will now deal damage to the attacker instead of attempting (and failing) to target the caster himself 2022-09-12 09:15:03 +02:00
Ovahlord
3c2d2880b7 Core/Spells: Grand Crusader will now only have a chance to proc by hitting the trigger spell's primary target 2022-09-12 09:15:03 +02:00
Ovahlord
8d5544d20c Core/Spells: fixed Judgements of the Just talent 2022-09-12 09:15:03 +02:00
Ovahlord
073f7d34db Core/Spells: fixed Speed of Light and Denounce talents 2022-09-12 09:15:03 +02:00
Ovahlord
bf306d133a Core/Spells: refactored scaling code in SpellEffectInfo::CalcValue to reduce differences with master branch 2022-09-12 09:15:02 +02:00
funjoker
058aac64d6 CircleCI: Only for nopch 2022-09-11 21:17:42 +02:00
funjoker
ca51f502d8 CircleCI: Use larger resource_class to not exceed buildtime 2022-09-11 21:15:14 +02:00
Shauren
dcd46b8b1a Core/Phasing: Fixed terrain swaps appearing on incorrect maps when player is added to a map wilth not meeting its condition but later condition gets satisfied 2022-08-14 18:15:27 +02:00
Ovahlord
e4ea987bab DB/Weather: added missing weather data for Uldum 2022-08-12 23:32:40 +02:00
Ovahlord
6d79ced79a Core/Weather: some minor refactors to reduce differences between master branch 2022-08-12 23:31:54 +02:00
Ovahlord
fd27f0020d Core/Units: defined all faction template flags and properly implemented FactionTemplateFlags::HatesAllExceptFriends
*refactored FactionTemplateEntry helpers to use pointers instead of references since we use datastore pointers in all cases so there is no need to create references
2022-08-10 20:28:47 +02:00
Ovahlord
45af6bbd4b Scripts/Firelands: Burning Blast will now deal 10% increased damage instead of multiplying the entire damage 2022-07-23 23:12:18 +02:00
Ovahlord
f09a7a37cc Scripts/Firelands: Majordomo Staghelm's Leaping Flames will now prioritize ranged classes and specs and falls back to any random target when no eligible target has been found 2022-07-23 22:47:54 +02:00