Commit Graph

153 Commits

Author SHA1 Message Date
Shauren
3260b94dd6 Core/Misc: Replace string to int conversion functions from Common.h with c++17 std::from_chars based ones Trinity::StringTo 2023-05-13 15:46:27 +02:00
Shauren
122d41eb06 Scripts/Spells: Added proc requirements to a few auras that have SPELL_ATTR3_CAN_PROC_FROM_PROCS attribute 2023-04-04 23:57:57 +02:00
Shauren
92ed5e8af1 Core/Misc: Include cleanup, 2023 edition 2023-01-07 22:38:21 +01:00
Shauren
6713fa4c93 Core/Scripts: Added CalcCastTime spell script hook 2022-07-29 20:24:28 +02: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
ad4f4bfab7 Core/Misc: Minor game include cleanup 2022-02-13 00:49:10 +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
Shauren
2cc652b305 Core/Scripts: Expose IsCrit to hit hooks for spell scripts 2022-01-30 12:36:29 +01:00
Peter Keresztes Schmidt
595e89e02b Core/Spells: Mark constructors of Spell/AuraScript handlers as explicit (#25248)
Mostly to make clang-tidy happier

(cherry picked from commit 34d403e83f)
2022-01-26 20:57:27 +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
Seyden
12d00e2e5f Scripts/Spells: Implement OnPrecast scripting hook for spell scripts (#27632)
* Fires before cast bar starts
2022-01-18 21:06:10 +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
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
PolarCookie
f7299dce97 Core/Spell: SpellAura Redux (#22794)
* typo and correction

* spell aura no longer shared between targets

_spellAura isolated

* SPELL_AURA_CONTROL_VEHICLE is not strictly single target spell

Steam Tank Control and Wyrmrest Commander

units can reseat themselves again

* Rename 9999_99_99_99_world.sql to 2019_03_08_00_world.sql

(cherry picked from commit ec3cb05d7f)
2021-11-24 20:35:19 +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
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
1086007f98 Scripts/Spells: Fixed various paladin spell scripts and removed outdated ones 2021-03-04 22:46:44 +01:00
Matan Shukry
19b733fefc Scripts/Spells: Fix Prayer of Mending (#26020) 2021-02-21 21:12:08 +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
1c52d5fff7 Core/Misc: Replace NULL with nullptr 2020-08-14 17:06:03 +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
96575e33bb Core/Items: Add location filters to Player::GetItemByEntry 2019-11-29 00:10:29 +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
6acb2d0331 Core/Spell: Fix typo on documentation
By Mihapro
2017-11-02 19:52:47 +01:00
Shauren
5774e926d9 Core/Spells: Fixed mage Cauterize
* No more immortal fire mages
2017-08-27 11:28:08 +02:00
joschiwald
1f8fc55ac9 Core/Spells: Implementation of QAston proc system (#20131)
* Core/Spells: Implementation of QAston proc system

- Move checks from Unit::IsTriggeredAtSpellProcEvent (old system) to Aura::IsProcTriggeredOnEvent (new system)
- killed charge counter from SpellModifier and Player system for handling charges... no point in having 3 different systems doing the same thing
- Automatically add default entries to spellProcMap, based on spellinfo (else auras won't proc without an entry) Based on old Unit::ProcDamageAndSpellFor
- Old Unit::ProcDamageAndSpellFor renamed to Unit::ProcSkillsAndReactives and made private, will no longer handle auras.
- Start making use of HealInfo::AbsorbHeal in unit calculations, add effective healing info to HealInfo struct
- Changes in spell reflection system, emulates old behaviour, delaying aura drop
- Removed old charge count hacks in SpellMgr::LoadSpellInfoCorrections
- Removed bogus error log when procChance is 0: Some auras have initial 0 procChance but modified by SPELLMOD_CHANCE_OF_SUCCESS
- Fixed TriggerAurasProcOnEvent logic that tried to trigger twice from actor.
- Allow non damaging spells with DamageClass Melee or Ranged to proc character enchants. Ref issue #17034:

  * http://web.archive.org/web/20110309092008/http://elitistjerks.com/f47/t49865-paladin_retribution_pve/
  * When an auto-attack lands (does not dodge/parry/miss) that can proc a seal the of the following things happen independently of each other (see 2 roll system).

  * 1) A "hidden strike" which uses melee combat mechanics occurs. If it lands it refreshes/stacks SoV DoT. Only white swings can trigger a refresh or stack. (This hidden strike mechanic can also proc things like berserking..)
  * 2) A weapon damage based proc will occur if you used a special (CS/DS/judge) or if you have a 5 stack (from auto attacks). This attack can not be avoided.

  * Holy Vengeance is the "hidden strike" it has an apply aura effect and damage class melee.
- Fixed Blood Tap interaction with Death Runes (btw, don't know what was going on with those MiscValueB, spell 45529 doesn't have any MiscValueB in SPELL_EFFECT_ACTIVATE_RUNE)
- Ported some AuraEffect checks from old Unit.cpp function. added new AuraScript hook to check procs of an specific effect
- Allow only AuraEffects that passed the check to proc, this won't block whole aura from proccing (and lose charges) if at least one of the effects procs, though
- Changes in spell mod system (for SPELLMOD_CASTING_TIME). fixes #17558.
- Added an exception for SPELLMOD_CRITICAL_CHANCE too, fixes #15193

(cherry picked from commit e641d0c7d7)

# Conflicts:
#	sql/base/auth_database.sql
#	src/server/game/Entities/Player/Player.cpp
#	src/server/game/Entities/Player/Player.h
#	src/server/game/Entities/Unit/Unit.cpp
#	src/server/game/Entities/Unit/Unit.h
#	src/server/game/Spells/Auras/SpellAuraEffects.cpp
#	src/server/game/Spells/Auras/SpellAuras.cpp
#	src/server/game/Spells/Auras/SpellAuras.h
#	src/server/game/Spells/Spell.cpp
#	src/server/game/Spells/SpellEffects.cpp
#	src/server/game/Spells/SpellInfo.cpp
#	src/server/game/Spells/SpellMgr.cpp
#	src/server/game/Spells/SpellMgr.h
#	src/server/game/Spells/SpellScript.cpp
2017-08-13 12:03:43 +02:00
Shauren
a0a158b5b8 Core/Scripts: Include cleanup 2017-05-28 16:34:44 +02:00
Shauren
0eb38451d3 Nopch fix 2017-05-24 21:31:23 +02:00
Shauren
c5d3dd90be Core/Game: Include cleanup
* Mostly aimed at removing Log/DatabaseEnv includes from other headers
* Fix most packet headers including other packet headers - moved common structures such as ItemInstance to their own files
* Moved SAI function definitions to source files (massive or requiring many different dependencies)
2017-05-18 23:53:25 +02:00
joschiwald
2b5d7eef3a Core/SpellScripts: Added helper method to validate spells 2017-01-12 23:03:08 +01:00
joschiwald
01e44cb794 Core/Spells: Extended remaining 8bit EffectMasks to 32bit 2017-01-06 17:20:04 +01:00
joschiwald
fc22e97369 Core/SpellScripts: Added some const correctness 2017-01-04 00:08:52 +01:00