Commit Graph

63 Commits

Author SHA1 Message Date
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
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 fb1772e8c9 Core/AuraScripts: Allow to use AuraScript::GetTarget in AfterEffectRemove and AfterEffectApply hooks. 2011-05-26 17:44:07 +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 0eb89fc282 Core/SpellScripts: Better debug output on startup script validation. 2011-05-25 18:00:35 +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
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
Az@zel 52bc1e5fd3 Core/Misc: more warning fixes (some of them were real logical flaws - comparison of unrelated types) (Thanks to Tassader for pointing out that one line was completely unnecessary) 2011-05-11 12:32:54 +06: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 8898db8b27 Core: Corrected NULL usage, it should only be used with pointers, not integers 2011-04-23 15:53:48 +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
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
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 928443d899 Core: Removed more operator workarounds for ACE_Singleton (missed previously because of inconsistent naming)
--HG--
branch : trunk
2010-12-23 23:25:44 +01:00
QAston bb2a715afc Core/Scripts: Comment out code sanitizing hook type - will be fixed soon.
--HG--
branch : trunk
2010-12-06 07:16:39 +01:00
QAston 7db1b39224 Core/Auras: backout r2bf34fd7ac and add alternative - not spell specific sollution for the problem.
--HG--
branch : trunk
2010-12-05 20:43:09 +01:00
azazel 3bd1ee0665 Fix most of the recently introduced warnings
--HG--
branch : trunk
2010-10-16 13:32:30 +06: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 f0c4241ea4 Remove the accidental additions of CRLF-crap from the header updates
--HG--
branch : trunk
2010-10-07 15:35:36 +02:00
click a67d7c9afd Copyright header updates - part 3... (and some whitespace cleanups)
--HG--
branch : trunk
2010-10-07 14:00:52 +02:00
click df66aee929 Yet more copyright header updates
--HG--
branch : trunk
2010-10-07 13:38:35 +02:00
QAston cac4cfda42 Core/ScriptSystem: Add missing script call preparation for SpellScripts - fixes issues with core false alarms after recent changes
--HG--
branch : trunk
2010-10-05 08:17:10 +02:00