Commit Graph

132 Commits

Author SHA1 Message Date
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
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
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
5c86b2aa36 Core/SpellScripts: SPELL_SCRIPT_HOOK_EFFECT_SUCCESSFUL_DISPEL is a TargetHook and a EffectHook 2017-05-07 20:39:51 +02:00
joschiwald
2b5d7eef3a Core/SpellScripts: Added helper method to validate spells 2017-01-12 23:03:08 +01:00
joschiwald
fc22e97369 Core/SpellScripts: Added some const correctness 2017-01-04 00:08:52 +01:00
vincent-michael
86b98686a9 Update copyright note for 2017
Happy new year
2017-01-01 16:23:13 +01:00
ariel-
780d1019f2 Core/ScriptMgr: use vector instead of list to contain Spell and Aura scripts and hooks
(cherry picked from commit cbb5c073ce)
2016-11-14 05:35:41 -03:00
Ivan Beňovic
8ff5b35be1 Core/Spells: Add SpellMissInfo argument to BeforeHit hooks and call them also when the spell doesn't hit. (#17613) 2016-07-20 09:08:58 +02:00
Naios
9cc97f226d Core/Game: Rewrote the ScriptMgr to support script reloading.
* Finally this commit enables dynamic script hotswapping
  and finished the PR #15671.
* Split the storage layout to use optimized storages
  for database bound and unbound scripts.
* Add several unload workers to reload scripts correctly
  -> Requires further investigation.
* Fixes memory leaks in ScriptMgr when dropping invalid scripts.
* Fixes VehicleScripts
* Makes OutdoorPvP scripts reloadable
* Makes InstanceMapScripts reloadable
* Makes CommandScripts reloadable
2016-04-11 21:14:00 +02:00
Vincent-Michael
478cc756eb Update copyright note for 2016
Happy new year (Again new year with idiots ...)
2016-01-01 00:34:25 +01:00
Vincent-Michael
2e586bc520 Core: Header cleanup in game/*/*.cpp 2015-07-25 20:18:42 +02:00
Shauren
a22e4e121a Core/Misc: Fixing warnings detected by Visual Studio 2015 compiler 2015-07-21 00:33:36 +02:00
ariel-
7ee455df59 Spell logging corrections
(cherry picked from commit fe83ecb2cf)

Conflicts:
	src/server/game/Conditions/ConditionMgr.cpp
2015-06-26 03:27:29 +01:00
Shocker
cc3ddf23ce Core/Spells: Fix spell scripts for effect hooks greater than EFFECT_7 2015-05-27 18:33:51 +03:00
jackpoz
6df3f795ba Core/Aura: Replace assert with logged error for invalid AuraRemoveMode
Fix AuraScript::Remove() triggering an assert with default parameter and log an error when Aura is removed with invalid mode AURA_REMOVE_NONE instead of triggering an assert deep down in the call tree.
Fix https://github.com/TrinityCore/TrinityCore/issues/714 , triggered by spell 50240 "Evasive Maneuvers" script

(cherry picked from commit 9ea93eae33)
2015-01-17 17:46:22 +01:00
Vincent-Michael
ab90f74486 Update copyright note for 2015
Happy new year
2015-01-01 00:28:09 +01:00
joschiwald
9ecc578cb1 Core/Scripts: multiple changes
- fixed non pch build
- fixed some warnings
- fixed some coverity issues
- some random things here and there
2014-12-29 01:00:16 +01:00
Unholychick
ebf95e7ed7 Core/Scripts: Add new SpellScript hook OnEffectSuccessfulDispel
Adds SpellScript hook to execute scripts after succesful dispels, example could be warlock pets Devour Magic, which should only trigger when succesfully dispelling an aura.
2014-12-25 22:21:15 +01:00
Shauren
9f0051c4e5 Core/Spells: Implemented using dbc spellpower/ap coeffiecients for spells 2014-12-19 23:52:29 +01:00
Rat
2144d6c851 Core/Spells: core now builds without scripts project, still not stable 2014-11-24 18:57:49 +01:00
Shauren
a0e50ea35f Core/Entities: Use ObjectGuid class in game project 2014-09-14 16:14:12 +02:00
Shauren
7532864264 Buildsystem/MSVC: Warning fixes
C4800 'type' : forcing value to bool 'true' or 'false' (performance warning)
C4127 conditional expression is constant
2014-07-17 15:42:57 +02:00
Discover-
a242662ae6 Core/Spells: Fix DK Ghoul's damage after ad8eb434c0. I misread 'SpellScript::m_damage' for 'SpellScript::damage'.
By @joschiwald
2014-01-31 10:37:55 +01:00
Discover-
ad8eb434c0 Core/Misc: Missing changes and get rid of useless method in acd46085d1 2014-01-30 10:28:05 +01:00
joschiwald
acd46085d1 Core/Spells: drop last leftovers of hardcoded spell target selection and move it into spellscripts
Closes #1719
Closes #3186
2014-01-30 02:40:12 +01:00
joschiwald
a5b04e06f7 Core/SpellScripts: Implemeted SpellScript hook OnDestinationTargetSelect to easier modify SpellDestinations 2014-01-23 18:15:59 +01:00