diff options
| author | Vincent_Michael <Vincent_Michael@gmx.de> | 2013-02-18 18:51:52 +0100 |
|---|---|---|
| committer | Vincent_Michael <Vincent_Michael@gmx.de> | 2013-02-18 18:51:52 +0100 |
| commit | 71eaceae5de6cc1c517bec78d0ef52e149a59b6e (patch) | |
| tree | a89711c8f03305f36b6042efa8eb5c5b104c2fad /src/server/scripts/Spells | |
| parent | 2277f6db44a4dabf98611189d8d75df3a0008a66 (diff) | |
| parent | 1c745dfe16787f9b51310c07b5b3c6801e9592e5 (diff) | |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts:
src/server/game/Entities/Vehicle/Vehicle.cpp
src/server/game/Globals/ObjectMgr.cpp
src/server/game/Spells/SpellMgr.cpp
src/server/game/Weather/Weather.h
src/server/shared/Database/Implementation/WorldDatabase.cpp
src/tools/CMakeLists.txt
Diffstat (limited to 'src/server/scripts/Spells')
| -rw-r--r-- | src/server/scripts/Spells/spell_item.cpp | 61 |
1 files changed, 37 insertions, 24 deletions
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index d57ed6e126b..c9c75cdb134 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -813,53 +813,65 @@ class spell_item_scroll_of_recall : public SpellScriptLoader enum ShadowsFate { SPELL_SOUL_FEAST = 71203, - QUEST_A_FEAST_OF_SOULS = 24547 }; -class spell_item_shadows_fate : public SpellScriptLoader +class spell_item_unsated_craving : public SpellScriptLoader { public: - spell_item_shadows_fate() : SpellScriptLoader("spell_item_shadows_fate") { } + spell_item_unsated_craving() : SpellScriptLoader("spell_item_unsated_craving") { } - class spell_item_shadows_fate_AuraScript : public AuraScript + class spell_item_unsated_craving_AuraScript : public AuraScript { - PrepareAuraScript(spell_item_shadows_fate_AuraScript); + PrepareAuraScript(spell_item_unsated_craving_AuraScript); - bool Validate(SpellInfo const* /*spellInfo*/) + bool CheckProc(ProcEventInfo& procInfo) { - if (!sSpellMgr->GetSpellInfo(SPELL_SOUL_FEAST)) + Unit* caster = procInfo.GetActor(); + if (!caster || caster->GetTypeId() != TYPEID_PLAYER) return false; - if (!sObjectMgr->GetQuestTemplate(QUEST_A_FEAST_OF_SOULS)) + + Unit* target = procInfo.GetActionTarget(); + if (!target || target->GetTypeId() != TYPEID_UNIT || target->GetCreatureType() == CREATURE_TYPE_CRITTER || target->isSummon()) return false; - return true; - } - bool Load() - { - _procTarget = NULL; return true; } - bool CheckProc(ProcEventInfo& /*eventInfo*/) + void Register() { - _procTarget = GetCaster(); - return _procTarget && _procTarget->GetTypeId() == TYPEID_PLAYER && _procTarget->ToPlayer()->GetQuestStatus(QUEST_A_FEAST_OF_SOULS) == QUEST_STATUS_INCOMPLETE; + DoCheckProc += AuraCheckProcFn(spell_item_unsated_craving_AuraScript::CheckProc); } + }; - void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) + AuraScript* GetAuraScript() const + { + return new spell_item_unsated_craving_AuraScript(); + } +}; + +class spell_item_shadows_fate : public SpellScriptLoader +{ + public: + spell_item_shadows_fate() : SpellScriptLoader("spell_item_shadows_fate") { } + + class spell_item_shadows_fate_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_shadows_fate_AuraScript); + + void HandleProc(ProcEventInfo& procInfo) { - PreventDefaultAction(); - GetTarget()->CastSpell(_procTarget, SPELL_SOUL_FEAST, true); + Unit* caster = procInfo.GetActor(); + Unit* target = GetCaster(); + if (!caster || !target) + return; + + caster->CastSpell(target, SPELL_SOUL_FEAST, TRIGGERED_FULL_MASK); } void Register() { - DoCheckProc += AuraCheckProcFn(spell_item_shadows_fate_AuraScript::CheckProc); - OnEffectProc += AuraEffectProcFn(spell_item_shadows_fate_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + OnProc += AuraProcFn(spell_item_shadows_fate_AuraScript::HandleProc); } - - private: - Unit* _procTarget; }; AuraScript* GetAuraScript() const @@ -2481,6 +2493,7 @@ void AddSC_item_spell_scripts() new spell_item_piccolo_of_the_flaming_fire(); new spell_item_savory_deviate_delight(); new spell_item_scroll_of_recall(); + new spell_item_unsated_craving(); new spell_item_shadows_fate(); new spell_item_shadowmourne(); new spell_item_shadowmourne_soul_fragment(); |
