100 Commits
Author SHA1 Message Date
ariel- b1adc269fb Core/Player: partial revert of m_items handling as it's cause of a exploit 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- f6bb4241f6 Core/Spells: fix another regression with arcane missiles being marked positive 2022-09-12 09:15:19 +02:00
ariel- 80b256795c Core/Spells: always initialize hitinfo aura
Ref 437c5c7b9d2122f7b1f46fd4e0f502c8be1e3091
2022-09-12 09:15:19 +02:00
ariel- 1d1787f70a Scripts/Spells: fix Seaforium Blast script crash 2022-09-12 09:15:19 +02:00
ariel- 82ffeb587b Core/Spells: fix delayed hit aura crash 2022-09-12 09:15:18 +02:00
ariel- 58e418574e Core/Player: properly clear m_items array when unequipping items from the bag
- Also cleanup weapon damage ap mult when direct destroying a equipped weapon
2022-09-12 09:15:18 +02:00
ariel- 082121cb38 Core/Entities: cleanup of weapon damage
- ScalingStatDistribution/Value (ie heirlooms): apply bonuses in all cases, some calls used nullptr (like after disarm) and item wasn't regaining them
- AP multiplier wasn't correctly reflected after unequipping a weapon
- Correctly set base damages at unequip
2022-09-12 09:15:18 +02:00
ariel- 460c317399 Core/Spells: fix issues with delayed spells and auras
- Was losing info of delayed targets due to remove_if move-assigning targets, it needs to be saved into delayed target vector before returning from lambda
- Delayed auras applying on many targets are now handled gracefully
2022-09-12 09:15:17 +02:00
ariel- 427582b0f7 Core/Spells: only apply aura effects when needed. 2022-09-12 09:15:17 +02:00
ariel- ae23b5d45a Core/Auras: fix nopch 2022-09-12 09:15:17 +02:00
ariel- ee99e76fa9 Core/Auras: fix auras apply on player when loading. Fixes Ghost aura flags and player deathstate 2022-09-12 09:15:17 +02:00
ariel- 55577ad85b Core/Spells: Fix some issues with channeled spells and aura duration mods 2022-09-12 09:15:16 +02:00
ariel- 1725fa9006 Core/Entities: fix creatures ignoring immune flags. 2022-09-12 09:15:16 +02:00
ariel- b3c8d78fa2 Core/Spell: fix SendSpellMiss requiring caster Unit 2022-09-12 09:15:16 +02:00
ariel- c889b81f2c Core/Spell: fix target checks
- Aura will be applied at last moment possible (after damage) to prevent regressions on #18395
- Partial revert of 9b38a6352c0fe2499de54fd769aa1c721a410bda as it wasnt handling correctly checks without spells
2022-09-12 09:15:15 +02:00
ariel- 5e6167ce46 Core/Spells: register and apply individual aura effects on hit handler
- Remove area aura processing from spell system, they're fully handled by aura owner update now
2022-09-12 09:15:15 +02:00
ariel- 9b54c3f842 Core/Spells: tweak 'neutral' spell positivity
- Fixes Mind Control dummy self aura appearing as a debuff
2022-09-12 09:15:15 +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- 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
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
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
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
ariel- 276d6e49f1 Core/Entities: killed Creature::SetInCombatWithZone and replaced with AI version
Closes #12108 (again)

(cherry picked from commit 7c9722a4ae08b5f283f6a085a411e37604a7da9f)

# 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
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
ariel- 51045c3b50 Core/Scripts: added nullptr checks to DamageTaken hooks
Since cb9e72e521d3cc415dd15bf6912c87f89e41b92a attacker may not be in world when hook is called

(cherry picked from commit 0db5c2df3fe56f42293865e87ec781cd4d41598b)

# Conflicts:
#	src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp
#	src/server/scripts/World/npcs_special.cpp
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 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
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- 4c658cf2da Revert "Core/Spell: don't set scaleAura for some special spells"
This reverts commit 1ca8434b365687dbd12ca232a615d126234eba5e.

Closes #19472

(cherry picked from commit c296d255e25a2d0eb7155f64eea32cc36fed280a)
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- 58745ed8cc Core/AHBot: fixed assert check
(cherry picked from commit c36854677c4cef0c83a81afa23b45ba322d354cc)
2022-02-16 04:49:24 +01:00
ariel- 14a95ff976 Core/Spell: don't set scaleAura for some special spells
Closes #14541

(cherry picked from commit 1ca8434b365687dbd12ca232a615d126234eba5e)
2022-02-16 04:49:24 +01:00
ariel- 4a3c6b3ae5 Core/AHBot: fix a typo
(cherry picked from commit e594c2d096c101a5b722793612febb6276b3b48e)
2022-02-16 04:49:24 +01:00
ariel- df00319c1b Core/AHBot: Refactor of AuctionHouseBotSeller:
- Use AuctionHouseBot.Class.* for what they really are, priorities, factor them when calculating item amount per class, changed enums to CONFIG_AHBOT_CLASS_*_PRIORITY to reflect this change
- Don't factor in the priority calc empty item lists:
  * Let's say you had AuctionHouseBot.Class.Glyph set to 10, sum of AuctionHouseBot.Class.* is 20, and AuctionHouseBot.Items.Amount.White is 5000
  * If there were no glyphs on the item list, you automatically lost 50% of the total item amount, meaning only 2500 of original 5000 were alloted to fill
- Fixed AuctionHouseBot.AH.Price.Ratio to be an actual percentage factor

- Separated containers in SellerConfiguration, each one better reflects what kind of data is stored there, now we won't use magic index 0 from _ItemInfo :P
- General cleanup, removal of bad voodoo and magical numbers
- Use unordered_sets for loading item lists, as they were only used to check for item presence

(cherry picked from commit 7f8bfe68d0f660643c8bd4c63d2129d220c2184c)
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
ariel- 70ecdd1511 Core/Aura: fix SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE unapply case for dead players
Closes #19276

(cherry picked from commit e1083794cde600205c45a016e6d077d1ffa4dea9)
2022-02-16 04:49:24 +01:00
ariel- 827fcb652a Core/Entities: Fix null-dereference crash
Closes #19191

(cherry picked from commit d61e0f79c40681ce7675e878e0ec0bdc2294527f)
2022-02-16 04:49:24 +01:00
ariel- b8d1bab8de Core/Spells: refactor spell_enchant_proc_data table
- Renamed fields to mimic those in spell_proc
- Added Enchant proc attributes for controlling specific enchant features

Ref #7789

(cherry picked from commit f609e7a08b3b4d2d9642e5ec252e1eedad836f0f)
2022-02-16 04:49:24 +01:00
ariel- 5e57ad6fa8 Core/Scripts: fix Nightfall proc chance and reduce it for victims with level above 60
Closes #15734

missing code
(cherry picked from commit eac9c1f0b992fd3622fd7dd864b2acc2781ec778)
2022-02-16 04:49:24 +01:00
ariel- 4ecfc62438 Core/Achievement: fix bad lookup of ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPPED_ITEM item
Closes #19064

(cherry picked from commit 70c4a37544ade558fb79383d2668f5f0322d47b8)
2022-01-28 22:32:59 +01:00
ariel- 35b5eaed8f Core/AchievementMgr: fix integer underflow neglecting already completed realm firsts
Closes #19334

(cherry picked from commit 9cfa7c752e1d61b02acb852d2fd304a80d10b60a)
2022-01-28 22:32:59 +01:00
ariel- 8aa53f2df7 Core/Achievements: port realm first achievement handling from master
veeeery partial cherry-pick of c75fcbe20b07fd7518be58bf02ba30d903133449

(cherry picked from commit 4596c17dae1dcb199b9301b7dcfd556bb1c0d7d5)
2022-01-28 22:32:59 +01:00
ariel- 29166a1d0a Core/Util: avoid one useless copy when adding stuff into a HookList
(cherry picked from commit 077b5aec9ede78034ba2ec4838b72e8121dab7ce)
2022-01-22 20:27:51 +01:00
ariel- af98e8516c Core/Auras: reworked multiplicative AuraEffects calculation 2021-11-28 12:14:05 +01:00
ariel- 0792739a98 Core/Scripts: fixed npc immunity flags during Harbinger Skyriss encounter
- Added missing _Reset
- Properly register Skyriss summons in SummonList

Closes #21154

Who ordered up an extra large can of whoop-ass?

(cherry picked from commit f8b148c3346e6d5017bf3b044cc36bce32c0cf45)
2021-07-29 21:41:02 +02:00
ariel- 5c882e8788 Core/Unit: fixed Global cooldown cancelation on spell interrupt 2021-04-16 20:41:20 +02:00
ariel- dcd017bbad Core/Spell: fix LoS checks for GameObject spells
Closes #21580
2020-09-11 15:11:24 +02:00
ariel- d34eb1a276 Core/GameObject: kill uninitialized, unused field from GameObjectTemplateAddon struct 2020-09-11 15:10:18 +02:00
ariel- 9040070520 Core/GameObject: refactor dismounting on use
# Conflicts:
#	src/server/game/Entities/GameObject/GameObject.cpp
2020-09-11 15:09:58 +02:00
ariel- 46866bad04 Core/GameObject: implement dismount on use of certain GOs
- The fact of player dismounting was entirely client-sided, with no server code enforcing it.

Closes #19979

# Conflicts:
#	src/server/game/Entities/GameObject/GameObject.cpp
2020-09-11 15:08:53 +02:00
ariel- e4ba06c828 Core/Utils: restored previous behaviour of RandomResize 2020-07-24 10:31:01 +02:00
ariel- 32d189e8b7 Core/Misc: kill whitespace
# Conflicts:
#	sql/updates/world/3.3.5/2018_01_10_04_world_335.sql
#	src/server/game/Combat/ThreatManager.h
#	src/server/game/Entities/Creature/Creature.cpp
#	src/server/game/Entities/Player/Player.cpp
#	src/server/scripts/Kalimdor/boss_azuregos.cpp
2020-07-22 17:10:27 +02:00
ariel- 0fcc0ebca2 Core/Player: don't check quest requirements against RewardNextQuest
- This field is only used to propose a new quest to player after completion, shouldn't be used to condition current quest

Closes #19515
2020-02-20 02:20:08 +01:00
ariel- d28be94e4a Core/Quests: implemented MSG_QUEST_PUSH_RESULT notifications
- Allow to share already completed (but not rewarded) quests, restriction was unblizzlike

thanks Cannix for the heads up
2020-02-20 01:55:48 +01:00
ariel- 08e174549e Core/Quest: fix RewardNextQuest being used to condition previous quests in chain 2020-02-20 01:42:01 +01:00
ariel- a7484837a8 Core/Quests: fixed exclusivegroup interaction with prevquestId and nextQuestId.
- They should work as documented by wiki now.
- Add some consts to Player methods
- Fixed negative PrevQuestID to mean only active quest (ie not rewarded/complete, as those quests are required to complete another)

Closes #19300
2020-02-20 01:39:08 +01:00
ariel- d78ad034d0 Core/Quests: changed quest_template_addon.NextQuestID to unsigned
- No reason to keep this anymore after 4349adf0f25210e5b26201523a09bc26b4a83394, this is a broken functionality.
2020-02-20 01:33:53 +01:00
ariel- 330f399de3 Core/Globals: some changes in quest loading
- Made load/reload associated quest tables data-driven, so removed a bunch of similar looking code from ObjectMgr (yay!)
- Codestyle and encapsulation for ExclusiveQuestGroups
2020-02-20 01:31:29 +01:00
ariel- ef6f5abf75 Core/Globals: Fix Quest codestyle and member variable initialization 2020-02-20 01:24:47 +01:00
ariel- 00db1e6b22 Core/Creatures: Minor HasSpell method cleanup
Cherry-picked improved from 5734788c0277d7f342d534dca63db0ce4e862bc5
2018-03-29 00:58:17 +02:00
ariel- 9f7e1a0673 Core/Spells: fix another regression with arcane missiles being marked positive
Closes #21670
2018-03-29 00:51:50 +02:00
ariel- 18b04b326e Scripts/ICC: use script searchers instead of saving list of creature pointers
Closes #21644
2018-03-29 00:51:39 +02:00
ariel- 3303c4551b DB/Spells: fix group stacking rules for MP5 buffs (BoW and Mana Spring)
Closes #21637
2018-03-29 00:49:15 +02:00
ariel- dfff9d62e4 Core/Spells: autogenerate miss proc for spells with auras with hit chance -100
Closes #21629
2018-03-29 00:46:02 +02:00
ariel- fda47267f8 DB/Spells: Weakened soul shouldn't remove stealth
Closes #21611
2018-03-16 21:57:49 +01:00
ariel- e4e85ffa22 DB/Creature: root training dummies
Closes #21513
2018-03-12 12:20:01 +01:00
ariel- 2aa4871b20 Core/Conditions: validate object types when conditioning implicit spell targets with CONDITION_OBJECT_ENTRY_GUID
Closes #21569
2018-03-09 10:15:46 +01:00
ariel- 79a0d012f2 Scripts/Commands: Make Shauren happy 2018-03-06 23:48:53 +01:00
ariel- 23b2d7bcea Core/Spells: explicitly disable non proccing auras when generating default procs
Closes #21529
2018-03-05 14:36:32 +01:00
ariel- 2697bdf2b2 Core/Misc: fix bad dbc data for lock 'Locked ball and chain'
Closes #12260
2018-03-05 14:34:31 +01:00
ariel- 24413cd30f Core/Auras: travis fix 2018-03-05 14:33:25 +01:00
ariel- b795e71e6b DB/Spell: fix Hit debuff stack rule
By Despondencyy

Closes #21367
2018-03-05 14:33:16 +01:00
ariel- 62c114d402 Core/Auras: fixed SPELL_AURA_MOD_HIT_CHANCE honoring stack rules in all cases
Updates #21367
2018-03-05 14:19:32 +01:00
ariel- 0321955726 Core/Auras: added sanity checks for area auras having a different owner unit than caster
Closes #21517
2018-03-05 14:19:22 +01:00
ariel- 30e0c87ff9 Core/Auras: restrict target map update only to area auras as player requires to have auras registered on load
Closes #21472
2018-02-24 13:13:47 +01:00
ariel- f2f574fbdd DB/Spells: fix proc regression with Missile Barrage
Closes #21466
2018-02-24 13:12:03 +01:00
ariel- e219b3f940 Core/Auras: fixed Drain Mana breaking early if caster has Mana Feed talent but no active pet 2018-02-18 17:59:30 +01:00
ariel- 3292925319 Core/Events: update holiday code and remove misleading log (event date is the one from game_event)
- add siign to DBC struct member CalendarFilterType as it was being used as such
- kill localtime usage as it's deprecated

Closes #18542
2018-02-17 16:14:35 +01:00