Commit Graph

90 Commits

Author SHA1 Message Date
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
Shauren
c8d20004a5 Core: Minor code style corrections 2012-06-30 16:07:09 +02:00
QAston
469c7a0955 Core/Scripts: fix a crash from e0997874f5 2012-06-30 10:43:34 +02:00
Shauren
067c27d299 Core/SpellScript: Corrected error messages and in-source documentation for OnObjectAreaTargetSelect hook and allow using that hook only for area spell targets 2012-06-30 00:06:17 +02:00
Shauren
e0997874f5 Core/SpellScripts: Changed OnUnitTargetSelect hook to OnObjectAreaTargetSelect, it will now work with WorldObject instead of only Units and call it even for empty target lists 2012-06-29 21:53:35 +02:00
QAston
b53485e053 Fix build and correct minor codestyle issue. 2012-04-28 15:10:52 +02:00
QAston
b899f5fc94 Core/SpellScripts: rename GetTarget*() functions to GetExplTarget*(), so the names reflect better what those functions do. Also update some comments. 2012-04-28 14:55:14 +02:00
Shauren
3c2dd7c5ed Scripts/Ulduar: Algalon the Observer 2012-04-19 23:19:27 +02:00
Kandera
dda7fab230 Core/SpellScripts: Fix crash caused by 6cb8d607ce 2012-04-12 09:15:36 -04:00
Subv
6cb8d607ce Spells/Scripts: Allow OnEffectAbsorb to call PreventDefaultAction in AuraScripts
closes #6172

Signed-off-by: Subv <s.v.h21@hotmail.com>
2012-04-12 05:52:20 -05:00
QAston
a08fe16d69 Core/Spells: Allow spell effects to have multiple destinations. Spells like: 49814, 10869 and similar are now properly selecting destination targets. 2012-03-03 00:19:48 +01:00
QAston
f09b5a6bea Core/Db/Conditions:
-Drop condition CONDITION_SPELL_SCRIPT_TARGET, use other condition types instead
-Change CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET to CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET:
--allow using this condition for more spell implicit target types (not just ENTRY)
--SourceGroup value for this src type is now effMask and it's now required

Core/Spells: Unify the way implicit targets are handled, fully implement some partially implemented target types, fix some minor bugs found on the way, general improvements and cleanup.
2012-02-21 20:17:45 +01:00
Kandera
c517806a23 Scripts/Spells: Convert code from Spell::EffectDummy to spell scripts. 2012-02-18 12:12:49 +01:00
Giuseppe Montesanto
271feb587f Add hook on AuraScript called when an aura is dispelled 2012-02-04 13:32:40 +01:00
kiper
8299627ed9 Update headers for 2012. HAPPY NEW YEAR!!! 2012-01-01 00:32:13 +01:00
QAston
afc18461d7 Core/SpellScripts: Add BeforeCast, OnCast and AfterCast hooks to SpellScripts. 2011-12-31 13:11:12 +01:00
Spp
b16d2245bb Cosmetic: Multiple cosmetic changes
- Added missing space to 'if', 'for', 'while' and 'switch' when it's followed by '('
- Added missing space after a comma and remove space before comma (with some exceptions)
- Remove trailing spaces
- Convert tab to spaces

Note: Only affects files with extension "cpp" and "h" under /src/server
2011-09-29 12:43:05 +02:00
QAston
e949ad3adb Core/Spells: spell effect handling improvements
* Call spell effect handlers in 4 modes:
   - SPELL_EFFECT_HANDLE_LAUNCH - called when spell is launched (cast just finished)
   - SPELL_EFFECT_HANDLE_LAUNCH_TARGET - called when spell is launched for each target in spell target map
   - SPELL_EFFECT_HANDLE_HIT - called when spell hits its destination
   - SPELL_EFFECT_HANDLE_HIT_TARGET - called when spell hits it's target from spell target map
*Correctly implement SPELL_EFFECT_TRIGGER_SPELL, SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE, SPELL_EFFECT_TRIGGER_MISSILE_SPELL_WITH_VALUE, SPELL_EFFECT_TRIGGER_MISSILE_SPELL
*Remove spell system hacks which became obsolete with this commit
Core/SpellScripts:
add OnEffectLaunch, OnEffectLaunchTarget, OnEffectHit, OnEffectHitTarget hooks for new effect handle modes and remove OnEffect hook.
A generic rule of thumb how to update your scripts (will work for nearly all cases) for spell system noobs:
if your spell script used GetHitXXXX function, you need to use OnEffectHitTarget, otherwise use
OnEffectHit
2011-09-25 13:29:50 +02:00
Shauren
080c420e6a Core/SpellScripts: Added method to access m_spellValue in script 2011-08-20 15:47:35 +02:00
Machiavelli
156d491c27 Core/Spells: Add GetTriggeringSpell() method to SpellScript and use it to properly filter server side spell 18350's script. 2011-08-06 19:40:50 +02:00
Spp
e7327e7e94 Core: Fix compile without PCH and fix some warnings 2011-08-03 11:23:08 +02:00
Spp-
c69b149d7e Core: Typo fix introduced in previous commit (:S) 2011-08-01 14:57:30 +02:00
Spp-
079f292b15 Core: Some more missing changes from previous commit (Pass by const reference for simple objects replaced with pass by value). Also fix unintended change 2011-08-01 14:51:44 +02:00
Shauren
b9a6e2333c Core/Spells: Removed implicit casts from SpellImplicitTargetInfo, fixed copypaste mistakes and one crash 2011-07-27 12:35:59 +02:00
QAston
b0fe236265 Core: Use new SpellInfo class in core. Sadly, this commit is not compatibile with some of the custom code. To make your code work again you may need to change:
*SpellEntry is now SpellInfo
*GetSpellProto is now GetSpellInfo
*SpellEntry::Effect*[effIndex] is now avalible under SpellInfo.Effects[effIndex].*
*sSpellStore.LookupEntry is no longer valid, use sSpellMgr->GetSpellInfo()
*SpellFunctions from SpellMgr.h like DoSpellStuff(spellId) are now: spellInfo->DoStuff()
*SpellMgr::CalculateEffectValue and similar functions are now avalible in SpellEffectInfo class.
*GET_SPELL macro is removed, code which used it is moved to SpellMgr::LoadDbcDataCorrections
*code which affected dbc data in SpellMgr::LoadSpellCustomAttr is now moved to LoadDbcDataCorrections
2011-07-26 23:09:28 +02:00
QAston
3137a82c7c Core/Spells: Cleanup in Spell.h:
- Codestyle (fix function naming) and cleanup changes in SpellCastTargets class, also access variables of this class by getters/setters
 - Move IsQuestTameSpell function to SpellMgr.h
 - Move UnitList typedef to Unit.h
Additionally - add missing copyright notice to SpellAuraEffects.h
2011-06-23 13:28:52 +02:00
kaelima
b9e8694540 Core: Continued cleanup
If and for whitespaces.
2011-06-12 02:30:32 +02:00
click
158966dc79 Core: Codestyle cleanup 2011-06-11 22:35:29 +02:00
QAston
b9e8e6d3b4 Core/Auras: Add functions for common actions on aura charges. 2011-06-07 17:26:27 +02:00