aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2013-02-17 02:10:08 +0100
committerShauren <shauren.trinity@gmail.com>2013-02-17 02:10:08 +0100
commite49aaab6f624d5d824e195c11ef3bd0e809d8460 (patch)
tree2e65c0daaafb6f56c0d20965c7c4ce1c891f0179 /src/server/scripts/Spells
parent2d861b71ce9753ffa4d899acdbb0ca44bcb13128 (diff)
Scripts/Icecrown Citadel: Improvements to Shadowmourne quest line
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r--src/server/scripts/Spells/spell_item.cpp61
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();