Commit Graph

118 Commits

Author SHA1 Message Date
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
Vincent_Michael
20004050bc Update copyright note for 2014.
Happy new year.
2014-01-01 00:07:53 +01:00
Spp
94e2b9332a Core/Logging: Remove LOG_FILTER_XXX defines with it's value (remember logger names are case-sensitive) 2013-11-08 10:50:51 +01:00
leguybrush
0a308144a8 Core/Code: Unify [more] codestyle for brackets: )\n{\n} to ) { }. 2013-10-28 14:36:07 -04:00
Shauren
2ac6380202 Core/Auras: Allow preventing whole aura proc default handler from script hooks, just how it is possible for separate effects 2013-08-15 16:32:22 +02:00
joschiwald
b4d2796e33 Core/Spells: moved Improved Paladin Auras and Aura Mastery into SpellScripts
Closes #205
Closes #5163
Closes #6809
Closes #7408
Closes #9587
2013-07-27 02:37:48 +02:00
Spp
d1677b2db0 Core/Logging: Performance-related tweaks to logging system
All sLog->out* functions (except outCommand atm) are replaced with TC_LOG_* macros.
    Memleak fix
2013-05-13 15:07:36 +02:00
Shauren
b47cb65b03 Core/Scripts: Allow persistent area auras to use DoCheckAreaTarget hook. 2013-02-02 16:45:57 +01:00
joschiwald
89490e4d7f Core/SpellScripts: implement Spell Proc Hooks and use it in old and new proc system
Hooks:
- DoCheckProc: executed when aura checks if it can proc
- DoPrepareProc: executed before aura procs (possibility to prevent charge drop/cooldown)
- OnProc: executed when aura procs
- OnEffectProc: executed when aura effect procs
- AfterEffectProc: executed after aura effect proced
- AfterProc: executed after aura proced and charges removed

using PreventDefaultAction() in DoPrepareProc will prevent charge drop and cooldown

default execution of a proc can prevented in OnEffectProc with PreventDefaultAction()

Now we should be able to convert almost all procs from Unit::ProcDamageAndSpellFor to SpellScripts

Notes to old proc system:
- if a proc has a cooldown we must check it in spellscript and add it when we handle the proc
- behavior with charge drops is possible undefined (use PreventDefaultAction() in OnEffectProc to notify that the script is executed)
2013-01-11 01:21:44 +01:00
Vincent_Michael
cc65aba789 Update copyright note for 2013.
Happy new year.
2013-01-01 00:41:01 +01:00
Spp
2251d1bfae Core/Misc: Set mode 0644 for files 2012-11-27 13:03:12 +01:00
Faq
0e7ed5ec85 Core/Spells: Implementing some hooks for split damage taken, fixes the limitation of dmg such auras can split, for example at Hand of Sacrifice. Might have unexpected results, but they are called unexpected for a reason.. .Author Tibbi
closes #6025

Made new one as https://github.com/TrinityCore/TrinityCore/pull/7423/ was closed.
2012-09-18 23:28:46 +03:00
Spp
55ce180f28 Core/Logging: Add Asyncronous logging with Loggers ("What to log") and Appenders ("Where to log") system. Will allow to select to full log some parts of core while others are not even logged.
- Logging System is asyncronous to improve performance.
- Each msg and Logger has a Log Type and Log Level assigned. Each msg is assigned the Logger of same Log Type or "root" Logger is selected if there is no Logger configured for the given Log Type
- Loggers have a list of Appenders to send the msg to. The Msg in the Logger is not sent to Appenders if the msg LogLevel is lower than Logger LogLevel.
- There are three (at the moment) types of Appenders: Console, File or DB (this is WIP, not working ATM). Msg is not written to the resource if msg LogLevel is lower than Appender LogLevel.
- Appender and Console Log levels can be changed while server is active with command '.set loglevel (a/l) name level'

Explanation of use with Sample config:

Appender.Console.Type=1       (1 = Console)
Appender.Console.Level=2      (2 = Debug)

Appender.Server.Type=2        (2 = File)
Appender.Server.Level=3       (3 = Info)
Appender.Server.File=Server.log

Appender.SQL.Type=2           (2 = File)
Appender.SQL.Level=1          (1 = Trace)
Appender.SQL.File=sql.log

Appenders=Console Server      (NOTE: SQL has not been included here... that will make core ignore the config for "SQL" as it's not in this list)

Logger.root.Type=0            (0 = Default - if it's not created by config, server will create it with LogLevel = DISABLED)
Logger.root.Level=5           (5 = Error)
Logger.root.Appenders=Console

Logger.SQL.Type=26            (26 = SQL)
Logger.SQL.Level=3            (2 = Debug)
Logger.SQL.Appenders=Console Server SQL

Logger.SomeRandomName.Type=24 (24 = Guild)
Logger.SomeRandomName.Level=5 (5 = Error)
Loggers=root SQL SomeRandomName

* At loading Appender SQL will be ignored, as it's not present on "Appenders"

* sLog->outDebug(LOG_FILTER_GUILD, "Some log msg related to Guilds")
  - Msg is sent to Logger of Type LOG_FILTER_GUILD (24). Logger with name SomeRandomName is found but it's LogLevel = 5 and Msg LogLevel=2... Msg is not logged

* sLog->outError(LOG_FILTER_GUILD, "Some error log msg related to Guilds")
  - Msg is sent to Logger of Type LOG_FILTER_GUILD (24). Logger with name SomeRandomeName is found with proper LogLevel but Logger does not have any Appenders assigned to that logger... Msg is not logged

* sLog->outDebug(LOG_FILTER_SQL, "Some msg related to SQLs")
  - Msg is sent to Logger SQL (matches type), as it matches LogLevel the msg is sent to Appenders Console, Server and SQL
    - Appender Console has lower Log Level: Msg is logged to Console
    - Appender Server has higher Log Level: Msg is not logged to file
    - Appender SQL has lower Log Level: Msg is logged to file sql.log

* sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Some msg related to Battelgrounds")
  - Msg is sent to Logger root (Type 0) as no Logger was found with Type LOG_FILTER_BATTLEGROUND (13). As Logger has higher LogLevel msg is not sent to any appender

* sLog->outError(LOG_FILTER_BATTLEGROUND, "Some error msg related to Battelgrounds")
  - Msg is sent to Logger root (Type 0) as no Logger was found with Type LOG_FILTER_BATTLEGROUND (13). Msg has lower LogLevel and is sent to Appender Console
    - Appender Console has lower LogLevel: Msg is logged to Console
2012-08-03 14:20:18 +02:00
Spp
5a99dfad14 Warning fixes + compile fix after the merge 2012-07-30 10:07:26 +02:00
Shauren
537caf33e9 Core/SpellScript: Implemented OnObjectTargetSelect hook for use with spell target that selects a single object 2012-07-03 12:35:06 +02:00