Commit Graph

60 Commits

Author SHA1 Message Date
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
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
QAston
abe769a310 Core/ScriptSystem: Extend SpellScript API by spell focus targets accessors.
--HG--
branch : trunk
2010-10-04 20:32:10 +02:00
QAston
69057dcaeb Core/ScriptSystem/SpellScripts: Runtime checks for functions working only during spell hit phase
--HG--
branch : trunk
2010-10-04 19:12:20 +02:00
QAston
caaa77deb2 Core/ScriptSystem:
Add basic code for runtime checks of function calls in AuraScripts
 Make AuraScript::PreventDefaultAction() do not take parameters and add description for the function
 Remove PreventDefaultEffect() from aura script, use PreventDefaultAction() instead
 Unload aura scripts memory on aura delete

--HG--
branch : trunk
2010-10-04 17:44:49 +02:00
Shauren
692779f283 Core/Scripts: Added possibility to disable default aura effects for the whole duration of aura (PreventDefaultAction works per script call, PreventDefaultEffect is global)
Scripts/Icecrown Citadel: Corrected aura scripts for new PreventDefaultEffect, thx QAston for pointing it out
SQL: Corrected name for 9599 vehicle accessory
SQL: Fixed import errors in 9600_world_script_texts.sql by Supabad

--HG--
branch : trunk
rename : sql/updates/9599_vehicle_accessory.sql => sql/updates/9599_world_vehicle_accessory.sql
2010-08-26 15:32:08 +02:00
Shauren
73d3f210a9 Scripts/Icecrown Citadel: Add script for Deathbringer Saurfang (only missing alliance outro due to need of spawning and moving a transport)
Scripts/Icecrown Citadel: Corrected Lord Marrowgar, should no longer target tanks with Bone Spike Graveyard, his Coldflame should now spread properly
Core/Scripts: Moved Lady Deathwhisper Mana Barrier handler to scripts
Core/Scripts: Allow AuraScript to prevent default effects by effect index
Core/Scripts: Added Is25ManRaid() method to ScriptedAI, obviously used to check if raid is 25man
Core/Achievements: Pass m_caster to UpdateAchievementCriteria for ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET

--HG--
branch : trunk
2010-08-21 20:50:38 +02:00
Spp
9e4357c9ad Core: Fix more warnings
--HG--
branch : trunk
2010-08-24 14:44:56 +02:00
QAston
07a3a1254b *Add AuraScript class for scripting aura objects - scripts are registered same way as SpellScripts, bound to SpellScriptNames table. For more details see example_spell.cpp and SpellScript.h
*Rename SpellHandlerScript to SpellScriptLoader, EffectHandlerFn to SpellEffectFn, HitHandlerFn to SpellHitFn, SpellScript::EffectHandlers to SpellScript::OnEffect, these changes were neccesary to prevent namespace collisions, happily you can solve these by simple find and replace
*Make spells 66244 and 5581 example scripts.

--HG--
branch : trunk
2010-08-24 00:10:49 +02:00