Core/Spells: Fixed Shadowmourne proc

Scripts/Quests: Fixed quest 24547 (A Feast of Souls)

Closes issue #2331.

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-09-28 17:35:59 +02:00
parent 6875626647
commit d2117fd4ee
6 changed files with 122 additions and 0 deletions
+2
View File
@@ -19358,6 +19358,7 @@ INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFam
( 71564, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Nevermelting Ice Crystal
(71545, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 50, 0), -- Tiny Abomination in a Jar (Heroic)
( 71406, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 50, 0), -- Tiny Abomination in a Jar
( 71903, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 20, 0), -- Item - Shadowmourne Legendary
( 75474, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Charred Twilight Scale (Heroic)
( 75465, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Charred Twilight Scale
( 75457, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Sharpened Twilight Scale (Heroic)
@@ -26864,6 +26865,7 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
( 8213, 'spell_item_savory_deviate_delight'),
( 14537, 'spell_item_six_demon_bag'),
( 59640, 'spell_item_underbelly_elixir'),
( 71905, 'spell_item_shadowmourne'),
-- warrior
( 12975, 'spell_warr_last_stand'),
-- paladin
@@ -0,0 +1,3 @@
DELETE FROM `spell_proc_event` WHERE `entry`=71903;
INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`procFlags`,`procEx`,`ppmRate`,`CustomChance`,`Cooldown`) VALUES
(71903,0x00,0,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0,20,0); -- Item - Shadowmourne Legendary
@@ -0,0 +1,3 @@
DELETE FROM `spell_script_names` WHERE `spell_id`=71905 AND `ScriptName`='spell_item_shadowmourne';
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(71905,'spell_item_shadowmourne'); -- Item - Shadowmourne Legendary
+37
View File
@@ -5676,6 +5676,31 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
}
break;
}
// Item - Shadowmourne Legendary
case 71903:
{
if (!pVictim || !pVictim->isAlive() || HasAura(73422)) // cant collect shards while under effect of Chaos Bane buff
return false;
CastSpell(this, 71905, true, NULL, triggeredByAura);
// this can't be handled in AuraScript because we need to know pVictim
Aura const* dummy = GetAura(71905);
if (!dummy || dummy->GetStackAmount() < 10)
return false;
RemoveAurasDueToSpell(71905);
triggered_spell_id = 71904;
target = pVictim;
break;
}
// Shadow's Fate (Shadowmourne questline)
case 71169:
{
triggered_spell_id = 71203;
target = triggeredByAura->GetCaster();
break;
}
}
break;
}
@@ -8754,6 +8779,18 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
case 72202:
target = FindNearestCreature(37813, 75.0f); // NPC_DEATHBRINGER_SAURFANG = 37813
break;
// Shadow's Fate (Shadowmourne questline)
case 71169:
if (GetTypeId() != TYPEID_PLAYER)
return false;
if (ToPlayer()->GetQuestStatus(24547) != QUEST_STATUS_INCOMPLETE) // A Feast of Souls
return false;
if (pVictim->GetTypeId() != TYPEID_UNIT)
return false;
// critters are not allowed
if (pVictim->GetCreatureType() == CREATURE_TYPE_CRITTER)
return false;
break;
}
if (cooldown && GetTypeId() == TYPEID_PLAYER && ToPlayer()->HasSpellCooldown(trigger_spell_id))
+1
View File
@@ -3606,6 +3606,7 @@ void SpellMgr::LoadSpellCustomAttr()
case 45150: // Meteor Slash
case 64422: case 64688: // Sonic Screech
case 72373: // Shared Suffering
case 71904: // Chaos Bane
// ONLY SPELLS WITH SPELLFAMILY_GENERIC and EFFECT_SCHOOL_DAMAGE
mSpellCustomAttr[i] |= SPELL_ATTR_CU_SHARE_DAMAGE;
count++;
+76
View File
@@ -632,6 +632,81 @@ public:
}
};
enum eShadowmourneVisuals
{
SPELL_SHADOWMOURNE_VISUAL_LOW = 72521,
SPELL_SHADOWMOURNE_VISUAL_HIGH = 72523,
SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF = 73422,
};
class spell_item_shadowmourne : public SpellScriptLoader
{
public:
spell_item_shadowmourne() : SpellScriptLoader("spell_item_shadowmourne") { }
class spell_item_shadowmourne_AuraScript : public AuraScript
{
public:
spell_item_shadowmourne_AuraScript() : AuraScript(), prevStackCount(0) { }
bool Validate(SpellEntry const* /*spellEntry*/)
{
if (!sSpellStore.LookupEntry(SPELL_SHADOWMOURNE_VISUAL_LOW))
return false;
if (!sSpellStore.LookupEntry(SPELL_SHADOWMOURNE_VISUAL_HIGH))
return false;
if (!sSpellStore.LookupEntry(SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF))
return false;
return true;
}
void OnStackChange(AuraEffect const* /*aurEff*/, AuraApplication const* aurApp, AuraEffectHandleModes /*mode*/)
{
Unit* target = aurApp->GetTarget();
if (!target)
return;
switch (GetStackAmount())
{
case 1:
target->CastSpell(target, SPELL_SHADOWMOURNE_VISUAL_LOW, true);
break;
case 6:
target->RemoveAurasDueToSpell(SPELL_SHADOWMOURNE_VISUAL_LOW);
target->CastSpell(target, SPELL_SHADOWMOURNE_VISUAL_HIGH, true);
break;
case 10:
target->RemoveAurasDueToSpell(SPELL_SHADOWMOURNE_VISUAL_HIGH);
target->CastSpell(target, SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF, true);
break;
}
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraApplication const* aurApp, AuraEffectHandleModes /*mode*/)
{
Unit* target = aurApp->GetTarget();
if (!target)
return;
if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_STACK)
return;
target->RemoveAurasDueToSpell(SPELL_SHADOWMOURNE_VISUAL_LOW);
target->RemoveAurasDueToSpell(SPELL_SHADOWMOURNE_VISUAL_HIGH);
}
void Register()
{
OnEffectApply += AuraEffectApplyFn(spell_item_shadowmourne_AuraScript::OnStackChange, EFFECT_0, SPELL_AURA_MOD_STAT, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_item_shadowmourne_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_MOD_STAT, AURA_EFFECT_HANDLE_REAL);
}
uint8 prevStackCount;
};
AuraScript* GetAuraScript() const
{
return new spell_item_shadowmourne_AuraScript();
}
};
enum eGenericData
{
SPELL_ARCANITE_DRAGONLING = 19804,
@@ -661,4 +736,5 @@ void AddSC_item_spell_scripts()
new spell_item_savory_deviate_delight();
new spell_item_six_demon_bag();
new spell_item_underbelly_elixir();
new spell_item_shadowmourne();
}