Commit Graph

91 Commits

Author SHA1 Message Date
Shauren
a0e50ea35f Core/Entities: Use ObjectGuid class in game project 2014-09-14 16:14:12 +02:00
DDuarte
a394205eca Core/Server: Add missing overrides 2014-08-09 20:17:40 +01: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
Shauren
f9c7bb4171 Partially revert f296095191 "Fix various warnings. The core, the scripts and the tools now compile without warnings with -Wall -Wextra -pedantic."
Visual studio does not support constexpr
Made semicolon after "Prepare*Script" mandatory - workaround for dumb IDEs inserting extra indentation level after newline
2014-05-18 12:50:10 +02:00
Shauren
3a1a55bb0a Core/Spells: Fixed target selection hooks running twice for each effect if both target A and B were using the same hook type (OnObjectAreaTargetSelect, OnObjectTargetSelect, OnDestinationTargetSelect) 2014-03-22 21:39:38 +01: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
Malcrom
fe95371d9a Core/Scripting: Replace casted with cast as casted is not a word. 2013-12-25 14:16:55 -03:30
jackpoz
ca6b9df261 Core/Misc: Fix some static analysis issues
Fix some static analysis issues about uninitialized values.
2013-12-14 19:36:43 +01:00
Ascathor
2607738990 Core/Code: Unify codestyle for brackets: {} to { }.
Also added missing copyright to some files.
2013-10-27 23:46:02 +01:00
joschiwald
2b19ba1879 Misc: replace Unit::GetPlayer with ObjectAccessor::GetPlayer and some cosmetic changes 2013-08-18 01:41:10 +02: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
Spp
9fbc4c0ae2 Core/Misc: reduced amount of string memory allocations (Step II) 2012-10-24 15:34:48 +02:00
Spp
d0334bf948 Core/Dungeon Finder: Some optimizations.
- Store teleport coordinates to avoid recalculations each time someone has to be teleported
- Correct teleport error msg when player is charming or using vehicle
- Internal changes in storage types
- Proper code for missing achievement lock type
- Better debug msgs
- Trying to get rid of "Player*" and "Group*" inside LFGMgr as much as possible (Step 1)
2012-10-18 09:15:10 +02:00
kaelima
8c013955ac Core/Misc: Fix some possible issues detected by static code analysis 2012-10-07 01:31:43 +02: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
358c6a26d6 Core: Warning fixes (Also some -pedantic under game folder) 2012-09-10 13:04:31 +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
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
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
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
Spp
9e517c963b Cosmetic: Replace "* )" with "*)" and "* /*" with "* /*" 2011-09-29 09:32:55 +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
Spp
af05915b9e [Cosmetic] Apply codestyle "XXX * " and "XXX *" changed to "XXX* " (with some exceptions) 2011-09-15 14:12:57 +02:00
Shauren
080c420e6a Core/SpellScripts: Added method to access m_spellValue in script 2011-08-20 15:47:35 +02:00
QAston
03f3a2a636 Core/SpellScripts: Add possibility to access real damage/healing done by SpellScript from AfterHit hooks. 2011-08-20 00:45:34 +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
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
click
f778c5e739 Whitespace cleanups... 2011-06-18 19:51:28 +02:00
tobmaps
1abdb65f5a Core/Misc: Cleanups, code style and typo fixes 2011-06-16 20:08:28 +07: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