159 Commits

Author SHA1 Message Date
Shauren
6b4ff53187 Core/Misc: Mark some functions noexcept to reduce size of compiled code 2026-01-09 12:14:36 +01:00
Shauren
d2f5f70326 Core/Scripts: Reorder SpellScriptBase fields to reduce padding and remove unused include 2025-11-16 23:47:51 +01:00
Shauren
f94d87b00f Core/Scripts: Mark script base class constructors noexcept 2025-06-13 19:31:03 +02:00
Shauren
36332d2463 Core/Misc: Remove a bunch of code from headers 2025-06-13 16:36:03 +02:00
Shauren
cc0e892d8d Core/Scripts: Allow accessing removed spell HitAura in scripts 2025-05-30 00:19:32 +02:00
Shauren
561b122364 Core/Spells: Replace MAX_SPELL_EFFECTS loop limits with correct upper bound depending on how many effects the spell has 2025-01-09 17:48:41 +01:00
Shauren
9894f6b802 Core/Random: Changed random functions returning doubles to return floats
* They were all cast to float at use anyway
* Improves roll_chance_f performance (rand32() is now called internally by uniform_real_distribution once instead of twice)
2023-10-31 20:20:00 +01:00
Shauren
9cdf3530f4 Core/Scripts: Added damage and healing calculation hook to spell and aura scripts allowing to override base damage amount, flat value mod and percent value mod separately 2023-08-01 21:31:06 +02:00
Shauren
1af6533c0f codestyle fix 2023-07-27 22:27:59 +02:00
Shauren
46b67ec205 Core/Scripts: Fixed unsafe function pointer type casting in spell scripts 2023-07-27 19:37:57 +02:00
Shauren
228c56f3c5 Scripts/Spells: Modernize spell script internals a bit - this makes Prepare macros unneccessary 2023-07-24 00:27:25 +02:00
Shauren
f8a6a9b017 Scripts/Spells: Added spell effect validation helper 2023-05-30 19:34:19 +02:00
Shauren
a8bb1739e9 Core/Spells: Refactor Spell::finish to accept SpellCastResult argument instead of just a bool indicating success 2023-02-28 00:19:31 +01:00
Shauren
d791afae1d Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api) 2023-01-08 21:16:53 +01:00
Shauren
92ed5e8af1 Core/Misc: Include cleanup, 2023 edition 2023-01-07 22:38:21 +01:00
Seyden
f25aceab28 Core/Spells: Refactor heal absorb code 2022-07-28 21:26:48 +02:00
Nyr
44236c7078 Core/Spells: Implement OnEffectAbsorbHeal and AfterEffectAbsorbHeal hooks 2022-07-28 21:26:48 +02:00
Shauren
701532f9f0 Core/Scripts: Expose calculated spell value variance to scripts 2022-07-15 18:31:54 +02:00
Shauren
86e7789160 Core/Scripts: Allow spell script ValidateSpellInfo to work with any container type
(cherry picked from commit f2f0aeb562)
2022-03-10 21:29:07 +01:00
Shauren
f8ad7017dd Core/Misc: Move (or delete) constructors and destructors to .cpp files (avoids compiling them in every file that includes them) 2022-02-12 21:36:46 +01:00
Giacomo Pozzoni
c66bcc4c0e Core/Spell: Fix name clashing between local variables and class member fields (#25352)
(cherry picked from commit 8a48ece573)
2022-02-04 13:00:08 +01:00
Shauren
2cc652b305 Core/Scripts: Expose IsCrit to hit hooks for spell scripts 2022-01-30 12:36:29 +01:00
Ovah
c7cf9f8c6c Core/Spells: Expose corpseTarget to spell scripts with SpellScript::GetHitCorpse() (#24981)
Closes #24945

(cherry picked from commit 94a4404e7e)
2022-01-22 00:34:38 +01:00
Giacomo Pozzoni
8f4db9aa69 Core/Spells: implement corpse target type support and properly fix resurrections (#24921)
* Core/Spells: implement corpse target type support and properly fix resurrections

(cherry picked from commit df193945d9)

* Core/Spells: implement TARGET_CORPSE_SRC_AREA_RAID and updated remaining resurrection effect handlers for updated corpse targeting

(cherry picked from commit 98b075cb4b)

* Fix no-pch

Co-authored-by: Ovahlord <dreadkiller@gmx.de>
(cherry picked from commit cc71da35b5)
2022-01-20 00:13:02 +01:00
jackpoz
68faf5bc4b Core/Common: Replace ASSERT(false, "...") with ABORT_MSG("...")
(cherry picked from commit 54c701cf0d)
2022-01-19 22:17:42 +01:00
Keader
4110a06e81 Core/Misc: Fixed resistance calculate for Mutated Transformation and Twilight Bloodbolt (#24717)
Ref: 9f7b464a6a
- Implemented a new SpellScript hook that allow control Resistance/Absorb amount of a damage spell.

(cherry picked from commit d81a9e5bc3)
2022-01-06 19:59:50 +01:00
Shauren
115409f353 Core/Spells: Implemented target 116 TARGET_UNIT_AND_DEST_LAST_ENEMY 2021-12-29 16:03:52 +01:00
Shauren
e00b1df36e Core/Scripts: Allow Get**TargetCountForEffect functions to be used in EffectLaunch script hooks 2021-12-25 22:46:46 +01:00
Matan Shukry
a3d06f2f32 Scripts/Spells: Implemented various rogue spells (#26319)
* Ruthlessness
* Mastery: Main Gauche
* Venomous Wounds
* Symbols of Death
* Backstab
* Premeditation
* Grand Melee
* True Bearing
* Slice and Dice
* Roll the Bones
2021-12-25 21:25:54 +01:00
Shauren
2965d201ab Core/Spells: Changed Spell::SendCastResult arguments to signed ints to match packet structure 2021-10-10 19:00:02 +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
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-
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
Traesh
fb6761c273 Core/Spells Implement targets 133, 134, 135 : TARGET_UNIT_LINE_CASTER_TO_DEST_*** (#26786) 2021-08-15 11:09:46 +02:00
ariel-
8c379e920c 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-
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
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
Matan Shukry
530631e0a7 Core/Auras: Implemented SPELL_AURA_SCHOOL_ABSORB_OVERKILL (#26269) 2021-04-17 22:42:34 +02:00
Robingad
f8255b1541 Core/Script: Implement CalcCritChance hooks for spell and aura scripts (#26116)
(cherry picked from commit AshamaneProject/AshamaneCore@4e0a3f4343)
2021-03-25 21:28:22 +01:00
Matan Shukry
2420f4e7a1 Core/Scripts: Implemented new aura script hook OnEnterLeaveCombat 2021-03-23 00:46:47 +01:00
Matan Shukry
7159de62b6 Scripts/Spells: Remove const from AuraEffect argument for AuraEffectProcFn 2021-02-13 14:08:16 +01: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
Shauren
c7306439e7 Core/Spells: Implement using different difficulty data from all spell related db2s, not just SpellEffect and SpellPower 2020-06-12 01:29:18 +02:00
Aokromes
b0bf1275ee New Year 2020-01-02 06:44:10 +01:00
Shauren
0a2d9ad2f7 Core/Items: Add ItemContext param to Item::Create function 2019-11-23 00:03:42 +01:00
vincent-michael
5620eb9463 Update copyright note for 2019
auto happy = new year(2019);
2019-01-01 10:14:33 +01:00
vincent-michael
7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00
ariel-
43260b7ebb Core/SpellScript: allow optional parameters to be passed to FinishCast
followup of 50a3ce5703

(cherry picked from commit aa21137aeb)
2017-12-26 20:30:36 +01:00
Aokromes
90badf9d7e Misc: More cleanup 2017-11-25 02:50:29 +01:00