Scripts/Icecrown Citadel: Improvements to Shadowmourne quest line

This commit is contained in:
Shauren committed 2013-02-17 02:10:08 +01:00
1 parent 2d861b71ce
commit e49aaab6f6
8 files changed
+137 -140

No files matched your search

+42 -29
View File
@@ -813,7 +813,40 @@ class spell_item_scroll_of_recall : public SpellScriptLoader
enum ShadowsFate
{
SPELL_SOUL_FEAST = 71203,
QUEST_A_FEAST_OF_SOULS = 24547
};
class spell_item_unsated_craving : public SpellScriptLoader
{
public:
spell_item_unsated_craving() : SpellScriptLoader("spell_item_unsated_craving") { }
class spell_item_unsated_craving_AuraScript : public AuraScript
{
PrepareAuraScript(spell_item_unsated_craving_AuraScript);
bool CheckProc(ProcEventInfo& procInfo)
{
Unit* caster = procInfo.GetActor();
if (!caster || caster->GetTypeId() != TYPEID_PLAYER)
return false;
Unit* target = procInfo.GetActionTarget();
if (!target || target->GetTypeId() != TYPEID_UNIT || target->GetCreatureType() == CREATURE_TYPE_CRITTER || target->isSummon())
return false;
return true;
}
void Register()
{
DoCheckProc += AuraCheckProcFn(spell_item_unsated_craving_AuraScript::CheckProc);
}
};
AuraScript* GetAuraScript() const
{
return new spell_item_unsated_craving_AuraScript();
}
};
class spell_item_shadows_fate : public SpellScriptLoader
@@ -825,41 +858,20 @@ class spell_item_shadows_fate : public SpellScriptLoader
{
PrepareAuraScript(spell_item_shadows_fate_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/)
void HandleProc(ProcEventInfo& procInfo)
{
if (!sSpellMgr->GetSpellInfo(SPELL_SOUL_FEAST))
return false;
if (!sObjectMgr->GetQuestTemplate(QUEST_A_FEAST_OF_SOULS))
return false;
return true;
}
Unit* caster = procInfo.GetActor();
Unit* target = GetCaster();
if (!caster || !target)
return;
bool Load()
{
_procTarget = NULL;
return true;
}
bool CheckProc(ProcEventInfo& /*eventInfo*/)
{
_procTarget = GetCaster();
return _procTarget && _procTarget->GetTypeId() == TYPEID_PLAYER && _procTarget->ToPlayer()->GetQuestStatus(QUEST_A_FEAST_OF_SOULS) == QUEST_STATUS_INCOMPLETE;
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
{
PreventDefaultAction();
GetTarget()->CastSpell(_procTarget, SPELL_SOUL_FEAST, true);
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();