fix(Core/Spell): Instant Statue

This commit is contained in:
Kitzunu
2021-01-20 23:14:05 +01:00
parent ce4dbbce76
commit e2d9bb880a
2 changed files with 57 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1611180684314340400');
DELETE FROM `spell_script_names` WHERE `spell_id` = 75731;
INSERT INTO `spell_script_names` (`spell_id`, `scriptName`) VALUE
(75731, 'spell_item_instant_statue');
UPDATE `creature_template` SET `AIName` = '' WHERE `entry` = 40246;
DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (74890, -75731);
INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
(74890, 75055, 0, 'Instant Statue'),
(-75731, -74890, 0, 'Instant Statue'),
(-75731, -75055, 0, 'Instant Statue');

View File

@@ -1546,6 +1546,51 @@ public:
}
};
enum InstantStatue
{
CREATURE_INSTANT_STATUE_PEDESTAL = 40246,
SPELL_INSTANT_STATUE = 75731
};
class spell_item_instant_statue : public SpellScriptLoader
{
public:
spell_item_instant_statue() : SpellScriptLoader("spell_item_instant_statue") { }
class spell_item_instant_stature_AuraScript : public AuraScript
{
PrepareAuraScript(spell_item_instant_stature_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_INSTANT_STATUE))
{
return false;
}
return true;
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Player* player = GetCaster()->ToPlayer();
if (Creature * creature = player->FindNearestCreature(CREATURE_INSTANT_STATUE_PEDESTAL, 0.0f, true))
{
creature->RemoveAurasDueToSpell(SPELL_INSTANT_STATUE);
}
}
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_item_instant_stature_AuraScript::OnRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_item_instant_stature_AuraScript();
}
};
// Theirs
// Generic script for handling item dummy effects which trigger another spell.
class spell_item_trigger_spell : public SpellScriptLoader
@@ -4250,6 +4295,7 @@ void AddSC_item_spell_scripts()
new spell_item_direbrew_remote();
new spell_item_eye_of_gruul_healing_discount();
new spell_item_summon_argent_knight();
new spell_item_instant_statue();
// Theirs
// 23074 Arcanite Dragonling