Commit Graph
2212 Commits
Author SHA1 Message Date
jackpoz 1180c43bac Core/Spells: Fix assert triggered
Fix assert triggered when a spell would trigger another spell in OnEffectHitTarget that would kill the target, then processing the main spell effects. The triggered spell can kill the target, changing its death state to CORPSE and removing auras created.
Fix #22306
2022-09-12 09:15:22 +02:00
Shauren 96c4a1b1f9 Core/Spells: Fixed unapplying rockbiter weapon 2022-09-12 09:15:21 +02:00
Shauren dc8bf301bb Core/Auras: Fixed saving auras with same spell id but different item source 2022-09-12 09:15:21 +02:00
Shauren adfeaa7666 Core/PacketIO: Fixed SMSG_SPELLNONMELEEDAMAGELOG structure 2022-09-12 09:15:20 +02:00
ariel- 3a3e70f2b6 Core/Spells: all bleed effects should ignore armor 2022-09-12 09:15:19 +02:00
ariel- b3c8d78fa2 Core/Spell: fix SendSpellMiss requiring caster Unit 2022-09-12 09:15:16 +02:00
ariel- 1fe5563431 Core/Spells: Fix periodic rolling adding bonuses twice
Calculation is now done in CalculateAmount
2022-09-12 09:15:15 +02:00
ariel- b6fac86b71 Core/Spells: rework part 5: GameObject casting 2022-09-12 09:15:14 +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
Ovahlord 36b5e120af build fix 2022-09-12 09:15:12 +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- 64b9b1c28b Core/Spells: kill unused parameter from Spell constructor 2022-09-12 09:15:10 +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 5ff7fda516 resolved a cherrypick mistake 2022-09-12 09:15:07 +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 f1986c6aafdf2457902a7a4cc7acc903cbbdc7bb 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 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
Shauren 25465699f7 Core/GameObjects: Transport (type 11) improvements
* Fully synchronize serverside animation progress with client
* Implemented updating passenger positions on elevators
* Removed visibility hack for elevators that always forced CreateObject packet to be sent to client
2022-06-18 21:36:17 +02:00
Ovahlord 78896a132f Core/Spells: ported proc flag updates from master branch 2022-02-22 21:19:09 +01:00
Ovahlord 80881f898c build fix 2022-02-21 14:55:09 +01:00
Ovahlord 7bf3379df5 warning fixes 2022-02-21 14:43:50 +01:00
Ovahlord a204e9c61a Core/Units: some minor refactors to reduce the amount of container element copies and improved some array initializations 2022-02-21 14:31:46 +01:00
Ovahlord 6506e71a23 Core/Units: added a helper to check if a limited target aura exists without creating an empty element in the container 2022-02-21 13:44:24 +01:00
ariel- cb168a8e7e Core/Unit: fix crash on magic school autoattacks
Closes #19436

(cherry picked from commit 0b50ea072e504ac7d5bf87b08d564955785f7197)
2022-02-16 04:49:24 +01:00
ariel- 5ad31dcf55 Core/Unit: fix SPELL_AURA_MOD_DAMAGE_DONE damage calculation on non-melee schools
for Keader :P

(cherry picked from commit 66ac1509ae925edc8848cdf6c370f8ed52c688ec)
2022-02-16 04:49:24 +01:00
ariel- d441e864c4 Core/Unit: cleanup and minor fixes of miss and resist calculations
- Removed Unit::GetUnitMeleeSkill as it was basically a copy of GetMaxSkillValueForLevel
- Removed static from GetEffectiveResistChance, as this was passed anyways, changed name to CalculateAverageResistReduction, which better reflects what it does
- Fix melee miss chances calculated from attacker maxskill instead of victim maxskill
- Do actual checks if spell can be resisted/missed in MagicSpellHitResult (ie chances > 0)
- Fixed SPELLMOD_RESIST_MISS_CHANCE calculation in MeleeSpellMissChance
- Minor codestyle and cleanup of diminishing returns calcs

(cherry picked from commit e565b34f6d24411e210151d0d03e524f94cdff85)
2022-02-16 04:49:24 +01:00
ariel- 0e8422c30a Core/Misc: fix static analysis issues
CID 1373466
CID 1373481
CID 1373482

(cherry picked from commit e478434146fd479fab955aaa80eb925c15e29809)
2022-02-16 04:49:24 +01:00
ariel- 4ad1d377fe Core/Entities: virtualize CheckAttackFitToAuraRequirement
- Should've been like this to begin with

(cherry picked from commit 21d95a1d767c95910d4508e0e83f34b4f89f587a)
2022-02-16 04:49:24 +01:00
xinef1 df9738aaa9 Core/Misc: Fixed player corpse looting, added player corpse loot and some more (#19122)
* Fixed corpse looting in wintergrasp
Added corpse loot for wintergrasp quests and To the Looter Go the Spoils (1166) achievement
Don't generate money for loot if no loot mode is available
Simplified few things

(cherry picked from commit 2412886ef69d305df1bd6e6422ca3134c0ab1449)
2022-02-16 04:49:24 +01:00
xinef1 f431459063 Core/Creatures: Various fixes for creatures, regarding combat conditions, despawning, and few others (#18998)
* Made some changes to kiting mechanics, simplified code and made taunt auras prolong combat no matter the distance from the spawn
Unified some creature despawning code, removed some brutal direct calls in scripts
Don't play death anim on forced despawn
Removed some redundant visibility changes on creature despawn
Fixed possible problem with pet initializing template info from difficulty greater than normal
Properly keep UNIT_FLAG_IN_COMBAT on UpdateEntry call
Moved RegenerateMana function to general Regenerate(Power) function
Fixed increased health regeneration from polymorph for pets
Implemented CREATURE_TYPE_FLAG_GHOST_VISIBLE, those creatures will be properly seen when player is dead also
Removed hackfix from Gaeriyan and Franclorn Forgewright, fixed properly
Simplified ForcedRespawnTime code in ForcedDespawn
Do not allow to assist unit while evading or when enemy is evading
Do not allow to attack other units when evading or when the unit is evading
Corrected distance checking code before creature is allowed to evade, should fix some common problems
Properly return summon position for summoned creatures as their respawn position
Properly stop all moving units on gossip hello, no matter their npc flags

(cherry picked from commit e1f14215d86fc9f0cd041f0e87bf0a689c086329)
2022-02-16 04:49:24 +01:00
Ovahlord bea6e6dcea fixed build 2022-02-05 07:22:16 +01:00
Ovahlord f2d651f6a9 Core/Units: no longer normalize melee basic attacks of feral druids 2022-02-05 00:00:55 +01:00
Ovahlord db769f5e52 Core/Units: safeguard Unit::CancelSpellMissiles against triggering an assert in BasicEvent::ScheduleAbort when trying to cancel spell events that already are about to the aborted 2022-01-17 10:59:41 +01:00
Ovahlord 009e1dba37 Core/Spells: coefficient scaling will no longer affect attack power multipliers 2022-01-09 15:09:21 +01:00
Ovahlord e84bb6e6ba Core/Units: no longer send debug hitInfo flags as these have no clientside effect at all
closes #261
2022-01-05 22:35:30 +01:00
Ovahlord 7dc29ee9c1 Core/Spells: skip unnecessary coefficient scaling lookups when no coefficient is provided 2022-01-05 22:32:05 +01:00
Ovahlord 2dc07876ea Core/Spells: implement spellpower and attackpower coefficient scaling 2022-01-05 20:19:06 +01:00
Ovahlord 01d0a0b09c Core/Spells: use the correct getter for school mask 2022-01-05 15:03:42 +01:00
Ovahlord fa378dc870 Core/Spells: Unit::MeleeDamageBonusTaken will now use the SchoolMask of melee attack spells when spellInfo is provided
ref https://github.com/TrinityCore/TrinityCore/issues/27523
2022-01-05 13:11:58 +01:00
Ovahlord 7f62463f36 Core/Movement: no longer blindy rely on ack messages to change movementstatus values as the client can and will sometimes ignore packets such as when receiving movement packets while not being sent out via update object (changing maps via teleport) 2022-01-04 15:04:49 +01:00
Ovahlord 91516e155f Core/Units: ported another crashfix from TC 2022-01-04 11:48:42 +01:00
Shauren 8acf90d115 Core/Units: Sync ProcessTerrainStatusUpdate code with master branch 2022-01-01 16:49:48 +01:00