diff options
-rw-r--r-- | sql/base/world_database.sql | 2 | ||||
-rw-r--r-- | sql/updates/10105_world_spell_proc_event.sql | 3 | ||||
-rw-r--r-- | sql/updates/10105_world_spell_script_names.sql | 3 | ||||
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 37 | ||||
-rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 1 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_item.cpp | 76 |
6 files changed, 122 insertions, 0 deletions
diff --git a/sql/base/world_database.sql b/sql/base/world_database.sql index 1d9186da53a..f8b72324a84 100644 --- a/sql/base/world_database.sql +++ b/sql/base/world_database.sql @@ -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 diff --git a/sql/updates/10105_world_spell_proc_event.sql b/sql/updates/10105_world_spell_proc_event.sql new file mode 100644 index 00000000000..5c4c7586b4b --- /dev/null +++ b/sql/updates/10105_world_spell_proc_event.sql @@ -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 diff --git a/sql/updates/10105_world_spell_script_names.sql b/sql/updates/10105_world_spell_script_names.sql new file mode 100644 index 00000000000..c1d7835a7b1 --- /dev/null +++ b/sql/updates/10105_world_spell_script_names.sql @@ -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 diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 79e31d3e76e..834fdd84bd3 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -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)) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 6c415278ee8..926f9ff952b 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -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++; diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 81b314db9be..1a50126ed64 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -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(); } |