Commit Graph

1136 Commits

Author SHA1 Message Date
PolarCookie
87486cecff Core/Spells: fix issues with delayed spells and auras (#22382)
* Core/Spells: fix issues with delayed spells and auras

* Make Travis Happy

(cherry picked from commit a0999744ef)
2021-11-15 22:13:17 +01:00
ModoX
8b171d7c01 Core/Instances: Drop allowMount column in instance_template as it is already handled properly by SPELL_ATTR0_OUTDOORS_ONLY (#27148) 2021-10-23 11:42:47 +02:00
Treeston
a5989dcee9 Core/Unit: Store charmer and charmed pointers on Unit directly, no more map lookups for Unit::GetCharmer and Unit::GetCharmed
(cherry picked from commit d4ef2529e9)
2021-10-23 00:11:44 +02:00
Treeston
e4e8c1c59c Core/AI: Clean up charm AI handling, we now have two unique_ptr instead of a crapton of booleans
(cherry picked from commit 042f5515e4)
2021-10-22 23:47:51 +02:00
Shauren
3e81db7b93 Core/Auras: Implemented SPELL_AURA_CAST_WHILE_WALKING_BY_SPELL_LABEL and SPELL_AURA_CAST_WHILE_WALKING_ALL 2021-10-16 18:44:59 +02:00
ModoX
68c2fc8ff5 Core/Characters: Made homebind location a WorldLocation (this implicitly adds orientation) (#27055) 2021-10-16 01:17:47 +02:00
Shauren
49eb3cf8fe Core/Spells: Implemented SPELL_EFFECT_TELEPORT_WITH_SPELL_VISUAL_KIT_LOADING_SCREEN 2021-10-13 11:49:30 +02:00
Shauren
8492c273dd Core/Spells: Implemented SpellReagentsCurrency.db2 2021-10-10 19:12:17 +02:00
Shauren
2965d201ab Core/Spells: Changed Spell::SendCastResult arguments to signed ints to match packet structure 2021-10-10 19:00:02 +02:00
ModoX
a048475cb0 Core/Spells: Implemented SpellValueMod duration (#26945) 2021-10-06 18:31:04 +02:00
Shauren
cbf1f2883a Core/Spells: Reduce number of CastSpell overloads to 1 2021-10-03 19:58:03 +02:00
Shauren
555b2d40ec Core/Spells: Send OriginalCastId in SMSG_SPELL_START and SMSG_SPELL_GO for triggered spells in 'game' project 2021-10-03 16:36:39 +02:00
Shauren
3af9be830d Core/Spells: Removed CastSpellExtraArgs constructors accepting ObjectGuid, they would become ambiguous with future changes 2021-10-03 14:58:35 +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 081eab3cf5)
2021-09-26 16:07:09 +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 2a84562dc8)
2021-09-24 23:37:43 +02:00
Treeston
bc89e1cdb0 Core/Position: Refactor GetAngle -> GetAbsoluteAngle because code clarity is good.
(cherry picked from commit 4692e10ca2)
2021-09-23 22:21:29 +02:00
ariel-
a8226a1d67 Core/Spells: always initialize hitinfo aura
Ref 437c5c7b9d

(cherry picked from commit 07e42f7d41)
2021-09-19 22:21:04 +02:00
ariel-
c8d7289245 Core/Spells: fix delayed hit aura crash
Closes #21664

(cherry picked from commit 437c5c7b9d)
2021-09-19 22:19:22 +02:00
Meji
0a83f74876 Core/Achievements: Update CriteriaType enum (#26856) 2021-09-08 22:07:01 +02:00
ariel-
f420a439f9 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

Closes #21609
Closes #21612

(cherry picked from commit 2828869844)
2021-09-06 20:40:42 +02:00
ariel-
5491b7f89f Core/Spells: only apply aura effects when needed. Fixes #21602
(cherry picked from commit abb602f7c1)
2021-09-06 20:10:16 +02:00
ariel-
b2de3efb4b Core/Spells: Fix some issues with channeled spells and aura duration mods
Closes #21584

(cherry picked from commit ac97655063)
2021-09-06 20:05:37 +02:00
ariel-
50fe2dc7e3 Core/Spell: fix LoS checks for GameObject spells
Closes #21580

(cherry picked from commit f7869ad38b)
2021-09-06 15:10:16 +02:00
Shauren
add2e6d212 Core/Spells: Avoid static analysis false positive 2021-09-05 23:04:33 +02:00
ariel-
60ff73eeba Core/Spell: fix SendSpellMiss requiring caster Unit
(cherry picked from commit 7f947646f9)
2021-09-05 22:48:28 +02:00
ariel-
a2ea26816e Core/Spell: fix target checks
- Aura will be applied at last moment possible (after damage) to prevent regressions on #18395
- Partial revert of 9b38a6352c as it wasnt handling correctly checks without spells

Closes #21578
Closes #21579
Closes #21581

(cherry picked from commit d6b9f148a7)
2021-09-05 22:43:48 +02:00
Shauren
8a4e1119ac Core/Spells: Unify spell effect access api in both branches 2021-09-04 15:13:15 +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
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 9b38a6352c)
2021-08-28 15:59:11 +02:00
ariel-
1e1415a491 Core/Spells: rework part 1: Improved positive detection logic
(cherry picked from commit efeae33495)
2021-08-28 15:59:11 +02:00
Traesh
fb6761c273 Core/Spells Implement targets 133, 134, 135 : TARGET_UNIT_LINE_CASTER_TO_DEST_*** (#26786) 2021-08-15 11:09:46 +02:00
Treeston
e47e95b6dc Core/VMap: Add outdoor state to Map::GetFullTerrainStatusForPosition. Add WorldObject::IsOutdoors, basic member access.
Ref #21479.

(cherry picked from commit e79c595b69)
2021-08-08 21:21:34 +02:00
Cannix
64234b35ed Core/Spells: Execute item casts immediately instead (#21396)
(cherry picked from commit 7e71b4535a)
2021-08-08 21:21:34 +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
ariel-
d91e099b10 Core/Spells: prevent creatures to focus channeled spells without SPELL_ATTR1_CHANNEL_TRACK_TARGET
- Creatures stuck here wouldn't try attacking because of this
- Remove one workaround in halion script, now it's unneeded

Ref #11311

(cherry picked from commit 29f7258dc8)
2021-06-21 12:47:03 +02:00
ariel-
5323a7d386 Core/Spells: fixed server being too overzealous with autoshot
- Interrupting it when casting another spell and switching targets

Ref #21390

(cherry picked from commit 93cbe815cb)
2021-06-21 00:06:41 +02:00
ariel-
13be704cb4 Core/Spells: implement SPELLVALUE_CRIT_CHANCE
(cherry picked from commit 546a605bd0)
2021-06-19 23:33:44 +02:00
ariel-
85e5509e91 Core/Spells: calculate crit chance only for spells that do damage/healing
Refs #18813

(cherry picked from commit 52873a7072)
2021-06-19 23:33:38 +02:00
ariel-
800d92bec3 Core/Spells: remove duplicated LowerPlayerDamageReq call on reflected spells
- It is already called at Unit::DealDamage

(cherry picked from commit e979a58d17)
2021-06-19 23:33:24 +02:00
ariel-
01d9306854 Core/Spells: kill unused parameter from Spell constructor
Added in 1f2292af79

(cherry picked from commit 9fc732eb97)
2021-06-19 23:33:23 +02:00
ariel-
c43f61df3d Core/Spell: killed deprecated code which randomly changed powercost for missed spells
Added in 80d3cd43f6

Closes #5954

(cherry picked from commit b1072faa50)
2021-06-16 21:40:33 +02:00
ariel-
d0f4310c44 Core/Entities: don't allow client control if player is still affected by any lose of control state
(cherry picked from commit e315e41d36)
2021-06-16 21:26:57 +02:00
ariel-
84a29d8077 Core/Unit: fixed crash
Closes #21231

(cherry picked from commit 22b24d8dae)
2021-06-14 01:19:38 +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
Shauren
0b2087ae41 Core/Criteria: Add all values of CriteriaStartEvent 2021-06-01 21:16:41 +02:00
Shauren
6ecfe58cae Core/Maps & Extractors: Move copypasted map file headers into a single shared file and replace #defines with enums 2021-05-29 21:21:37 +02:00