Commit Graph

979 Commits

Author SHA1 Message Date
Shauren
aebf308368 Core/Spells: Fixed Spell::EffectWeaponDmg for spells with multiple damage effects
Closes #26717
2021-08-28 19:53:53 +02:00
Shauren
3dd75a49b1 Core/Spells: Removed SpellEffIndex effIndex argument from spell effect handlers, it was commented out in almost every handler 2021-08-28 19:51:29 +02:00
Shauren
bc2c76a5b8 Core/Spells: Refactor building SMSG_SPELL_EXECUTE_LOG to not create 192 empty vectors on every spell cast 2021-08-28 18:30:45 +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-
65dca120d3 Core/Spells: rework part 4: iterate over effects first
Ref #18395

Implement far spell queue processing
Closes #7395

(cherry picked from commit 080d2c6cd4)
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
Jeremy
69edf282fa Partial: Core/Entities: Reduce the probability of units dropping under the map (#21322)
Reduce the probabilty of going under the map

(cherry picked from commit 9e0faace9a)

Revert "Core/Entities: Reduce the probability of units dropping under the map (#21322)"

(cherry picked from commit 2dadbda24a)
2021-08-08 21:21:34 +02:00
Shauren
fcead0b4ea Core/Spells: Use caster as chat source in Spell::EffectSendChatMessage 2021-08-08 18:15:00 +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-
3485cb38ed 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

(cherry picked from commit 303efcf0e4)
2021-06-19 23:33:25 +02:00
ariel-
f9b14ca795 Core/Spells: fix logic error causing near teleports to drop combat for players
Closes #21362

(cherry picked from commit 65709e1c30)
2021-06-19 23:33:24 +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-
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
xinef1
1912999b9e Core/Spells: Defined and implemented some new spell attributes (#18950)
(cherry picked from commit 23823f5147)
2021-05-16 21:56:07 +02:00
Treeston
34c7810fe5 Core: Combat/threat system rewrite (PR #19930)
- PvE combat is now always mutual. UNIT_FLAG_IN_COMBAT is backed by actual references to the units we're in combat with.
- PvP combat is now also tracked, and almost always mutual; spells like Vanish and Feign Death can break this rule. That means we can easily determine a list of players we're fighting.
- By extension, IsInCombatWith now has sensible behavior when invoked on nonplayers.
- Threat and combat systems are no longer the same.
  - They still have an enforced relationship (threat implies combat - clearing combat clears threat)...
  - ...but we can have combat without threat. A creature (with threat list) isn't considered to be engaged until it has an entry on its threat list...
  - ...which means we can now faithfully replicate retail engage behavior. Combat on projectile launch - engagement start on projectile impact. Yay for progress!
- AI method refactor, as already ported in 6113b9d - `JustEngagedWith`, `JustEnteredCombat` and `JustExitedCombat`.
- Vehicle threat is now properly pooled on the main vehicle body (fixes #16542).
- Various edge case bug fixes for threat redirects (Misdirection "cancelling" Vigilance and similar).
- Target re-selection is now significantly faster.
- Fixed a ton of other smaller edge case bugs, probably.

Closes #7951 and #19998.

(cherry picked from commit 532ab1c7f8)
2021-05-16 21:56:01 +02:00
Shauren
1a7779a6e6 Core/Spells: Expose number of targets selected for each spell effect to scripts to allow implementing spells that do something depending on number of targets hit 2021-05-13 00:38:09 +02:00
Shauren
fb66575d38 Core/Grids: Move packet sending functionality out of MessageDistDeliverer and into separate, customizable class and unify LocalizedPacketDo, LocalizedPacketListDo as generic localizable action 2021-05-01 20:16:10 +02:00
Shauren
3a37a2e0d7 Core/Grids: Allow customizing packets sent with MessageDistDeliverer and MessageDistDelivererToHostile depending on receiver
* Switch combat log sending to that implementation
2021-04-30 00:08:07 +02:00
Shauren
4e00cb7c15 Core/Spells: Fix feed pet effect after wrong merge conflict resolution 2021-04-22 22:57:00 +02:00
Matan Shukry
60df74933f Core/Spells: Removed extra health from feed pet (#26305) 2021-04-22 22:02:19 +02:00
Matan Shukry
a8fa2a03be Core/Items: Calculating item level + organized iterating over items (#26276)
* Unified iterating player items into a single function

Co-authored-by: Shauren <shauren.trinity@gmail.com>
2021-04-21 10:02:42 +02:00
Treeston
9b141207d1 [3.3.5] CastSpell unclusterfucking (that's a word now) (#21123)
Core/Spell: The giant CastSpell unclusterfucking (that's a word now) of this generation.

- CastSpell now always takes three arguments - target, spellId, and a struct containing extra arguments
- This struct (CastSpellExtraArgs, see SpellDefines.h) serves as a conglomerate of every previous combination of the 20 billion different CastSpell overloads, all merged into one
  - It has some great utility constructors - check them out! All of these can be used to implicitly construct the ExtraArgs object.
- A gajillion refactors to make everything behave the way it always has

(cherry picked from commit d507a7e338)
2021-04-16 15:22:42 +02:00
Treeston
76b2d37259 Core/Spell: Remove some leftover hack code from ::EffectSanctuary pertaining to vanish. None of this code did anything anymore.
(cherry picked from commit 3a536260f8)
2021-04-15 05:53:27 +02:00
Shauren
2398c1e23c Core/Spells: Implemented SUMMON_PROP_FLAG_PERSONAL_GROUP_SPAWN 2021-03-28 20:22:05 +02:00
Shauren
46a81ea1f4 Core/Spells: Add missing privateObjectOwner support to Spell::SummonGuardian 2021-03-28 20:22:05 +02:00
Shauren
33b3ebcae6 Core/Objects: Pass privateObjectOwner guid directly to SummonCreature functions 2021-03-28 20:22:05 +02:00
Matan Shukry
1082a6645e Core/Objects: Move personal summon handling from TemporarySummon/GameObject to WorldObject and check it using dedicated guid field 2021-03-28 20:22:05 +02:00
Matan Shukry
1c852af7f2 Core/Spells: Implement SPELL_EFFECT_TELEPORT_TO_RETURN_POINT (#26217) 2021-03-28 00:22:34 +01:00
Shauren
07a47947e2 Core/Spells: Defined and implemented new spell interrupt flags 2021-03-24 23:36:53 +01:00
Shauren
9b5a46ca2b Core/Auras: Defined and implemented many new interrupt flags 2021-03-21 12:05:32 +01:00
Shauren
6585666e6e Core/Spells: Define all spell modifier types and implement ProcCooldown mod and PeriodicHealingAndDamage for melee periodic damage 2021-03-15 21:03:06 +01:00
Shauren
34768c5b44 Core/Spells: Implemented SPELL_EFFECT_PLAY_SCENE_SCRIPT_PACKAGE and SPELL_EFFECT_CREATE_PRIVATE_CONVERSATION 2021-03-04 20:31:08 +01:00
Shauren
a05fc3ded5 Core/Spells: Updated spell effect type definitions to match latest client version 2021-03-04 20:30:50 +01:00
Shauren
ad479e8fa0 Core/Spells: Implemented spell effect 202 SPELL_EFFECT_APPLY_AREA_AURA_SUMMONS 2021-02-28 22:08:58 +01:00
Robingad
5e78494e54 Core/Spells: Add nullptr itemTarget check in Spell::EffectEnchantItemTmp (#26172) 2021-02-28 18:10:27 +01:00
jackpoz
a01d397c3d Core/Misc: Fix static analysis issues
Fix static analysis issues reported by 3rd party tools

(cherry picked from commit 24e82fe83d)
2021-02-25 18:50:55 +01:00
Matan Shukry
2b672d807f Scripts/Spells: Fix Ferocious Bite damage increase from extra energy (#26093) 2021-02-23 20:05:39 +01:00
Shauren
4ee565b2c8 Core/Auras: Implemented SPELL_AURA_MOD_PERIODIC_DAMAGE_TAKEN 2021-02-21 15:20:18 +01:00
jackpoz
852c9e9108 Core/Misc: Fix static analysis issues
(cherry picked from commit a80c95a1c7)
2021-02-06 21:41:51 +01:00
Matan Shukry
e601c6d1f9 Core/Spells: Implemented summoning a personal gameobject effect (#25917) 2021-01-23 16:44:47 +01:00
Shauren
b82a3a557a Core/DataStores: Updated db2 structures to 9.0.2
* Includes support for new character customization
2020-12-08 18:16:47 +01:00
Gildor
6c0af8743f Core/Spells: EffectSanctuary should stop attack (#20492)
(cherry picked from commit 82e58a0c6f)
2020-09-15 23:10:24 +02:00
Keader
a9ea939185 Core/Spells: Fixed Cloak of Shadows dispel (removed old hack)
Closes #8758
Serverside spell (35729) already handle with it

(cherry picked from commit c1b833a919)
2020-09-08 22:49:44 +02:00
Shauren
b231903932 Core/Misc: Port all the refactors sneaked in master to 3.3.5 include cleanup port 2020-09-04 13:38:24 +02:00
Gustavo
e5963fda0e Core/Scripts: More fixes in boss Lich King (#20147)
* Core/Scripts: More fixes in boss Lich King

Fix Valkyr charge spell, they will no longer ignore Z position and become unreachable.
Correct height of Spirit Bomb and added the 3 seconds delay on his explosion.
Set the Trigger inside frostmourne room as active, to avoid problems with reseting the room, e.g: Spirit Bombs not despawning and Wicked Spirits stuck in evade.
Use correct InhabitType for Wicked and Vile Spirits, this avoid a situation where they could spawn falling.

(cherry picked from commit 22a7956069)
2020-08-23 01:20:27 +02:00
treeston
2dfafa69eb Hi, I'm Treeston, and welcome to Combat PR Prep Refactors.
Today, we're moving UNIT_FLAG_IMMUNE_TO_PC and UNIT_FLAG_IMMUNE_TO_NPC to higher-level abstraction so combat manager can react to it.
New methods on Unit:
- void SetImmuneTo<All/PC/NPC>(apply, keepCombat = false);
- bool IsImmuneTo<All/PC/NPC>() const;

(cherry picked from commit 74af880217)
2020-08-18 18:53:13 +02:00
Shauren
1c52d5fff7 Core/Misc: Replace NULL with nullptr 2020-08-14 17:06:03 +02:00
Treeston
8be23fcbbd [3.3.5] Combat/Threat rewrite - prep & refactor (#19966)
* Combat/Threat rewrite (PR #19930) prep work. Mostly refactors, and a compatibility layer on ThreatManager/HostileReference that allows scripts to be changed already.

(cherry picked from commit e2a1ccd118)
2020-08-13 22:46:44 +02:00