Commit Graph

69 Commits

Author SHA1 Message Date
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
QAston
7b5b95966e Core/AuraScript: Add DoCheckAreaTarget hook to allow explicit area aura target selection. 2011-05-31 20:24:44 +02:00
QAston
42a20f14ef Core/Auras: Use existing aura object on aura reapply/stack increase instead of creating a new one.
You can hook on reapply/stack event by checking for AURA_EFFECT_HANDLE_REAPPLY aura handler mode, AURA_EFFECT_HANDLE_REAL is now not triggered on aura refresh/stack.
2011-05-29 13:18:47 +02:00
QAston
0762791754 Core/AuraScripts: Fix runtime error messages appearing in aura scripts when one hook is called from inside of another one. 2011-05-26 16:12:33 +02:00
QAston
a1b8fd2054 Core/AuraScripts: Add AfterEffectRemove and AfterEffectApply hooks, to allow safe triggering of spellcasts or other actions which may call linked events while OnEffectApply and OnEffectRemove are still there for overriding the way effect is handled on target. 2011-05-25 17:13:32 +02:00
QAston
ca8eb707d7 Core/Auras:
- Use safer order of calls in AuraEffect handlers (unit modification goes before any calls which may result in linked events execution)
 - Allow manual removal of further effects of an aura during aura removal (so Unit::RemoveAurasByType works well in such situations)
2011-05-25 15:13:55 +02:00
Shauren
b8a7eace3e Core/Scripts: Print error when attempting to retrieve aura application target in script hook which does not have one 2011-05-19 13:22:17 +02:00
leak
1003f30448 Add spaces after commas 2011-04-29 20:47:02 +02:00
Shauren
8568f19e5d Scripts/Examples: Corrected code style in spell script examples 2011-04-27 18:58:40 +02:00
Shauren
7120f1eff8 Core/Spells:
* Implemented on CheckCast spell script hook
* Added possibility to send SPELL_FAILED_CUSTOM_ERROR and added enum with all possible options for it

Scripts/Spells:
* Added example script for CheckCast hook with SPELL_FAILED_CUSTOM_ERROR (profession research and Book of Glyph Mastery)
2011-03-04 21:19:43 +01:00
QAston
b5e78bf208 Core/Auras: Move code which uses polymorphism out of Aura constructor. 2011-02-06 13:17:29 +01:00
Shauren
5adf9c5d30 Scripts/Spells: Moved all special target filtering cases to scripts 2011-01-22 17:21:24 +01:00
Shauren
c2690f748b Scripts/Spells: Implemented UnitTargetHandler spell script hook, it can be used to filter area targeting spells 2011-01-21 23:42:51 +01:00
Machiavelli
957c69de83 Update copyright note for 2011.
Happy new year.
2011-01-01 15:01:13 +01:00
QAston
8cd2c73e45 Core/ScriptSystem: Add OnEffectManaShield and AfterEffectManaShield hooks to AuraScript class. Usage of these is the same as similar Absorb hooks.
Scripts: Move Incanter's Absorbtion script from Unit::CalcAbsorbResist to AuraScript.
2010-12-30 19:05:19 +01:00
QAston
c8adcc95f9 Core/Unit: Move spell specific code from Unit::CalcAbsorbResist to AuraScripts. 2010-12-30 02:03:46 +01:00
click
464f1a9f8f Core: Kill off some warnings
--HG--
branch : trunk
2010-12-27 22:58:22 +01:00
QAston
ef968f4b15 Core/Unit: Big cleanup in Unit::CalcAbsorbResist
Core/AuraScript:
	Fix compile time check for AuraScript functions
	Remove AuraApplication from hook functions parameter list, use GetTarget() and GetTargetApplication() instead
	Add OnEffectAbsorb hook
Scripts: move handlers of Spell Deflection, Savage Defense, Primal Tenacity, Nerves of Steel, Astral shift from core to scripts.

--HG--
branch : trunk
2010-12-27 20:14:54 +01:00
Shauren
0c04b178db Scripts/Icecrown Citadel: Minor adjustments and compile warning fixes
--HG--
branch : trunk
2010-12-14 15:46:54 +01:00
QAston
59c1a238f5 Scripts/AuraScript: Make AuraApplication in OnEffectPeriodic never be NULL.
Scripts: remove some unnecessary NULL checks from scripts.

--HG--
branch : trunk
2010-12-05 21:38:52 +01:00
QAston
f8a4312701 Core/ScriptSystem: Add compile time type check of function assigned to hooks -
prevents incorrect function calls. Since this rev you have to put
PrepareAuraScript(<yourscriptclassnamehere>) at the beginning of every aura
script.

--HG--
branch : trunk
2010-10-08 22:33:21 +02:00
QAston
1760e42e2c Core/ScriptSystem: Add compile time type check of function assigned to hooks - prevents incorrect function calls. Since this rev you have to put PrepareSpellScript(<yourscriptclassnamehere>) at the beginning of every spell script. Yes, i know it's unhandy, but unfortunately C++ preprocessor is very limited, so you have to do that extra work each time you write a script:(.
--HG--
branch : trunk
2010-10-08 21:33:44 +02:00
click
613b81f36f REALLY fix the CRLF-crap...
--HG--
branch : trunk
2010-10-07 15:54:07 +02:00