mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripts/Spells: Hex of Jammal'an (#28083)
This commit is contained in:
6
sql/updates/world/3.3.5/2022_07_03_01_world.sql
Normal file
6
sql/updates/world/3.3.5/2022_07_03_01_world.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
--
|
||||
DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (-12480,12479,12480);
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_sunken_temple_hex_of_jammalan','spell_sunken_temple_hex_of_jammalan_transform');
|
||||
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
|
||||
(12479,'spell_sunken_temple_hex_of_jammalan'),
|
||||
(12480,'spell_sunken_temple_hex_of_jammalan_transform');
|
||||
@@ -33,6 +33,8 @@ EndContentData */
|
||||
#include "Map.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
#include "sunken_temple.h"
|
||||
|
||||
/*#####
|
||||
@@ -88,8 +90,68 @@ class go_atalai_statue : public GameObjectScript
|
||||
}
|
||||
};
|
||||
|
||||
enum HexOfJammalan
|
||||
{
|
||||
SPELL_HEX_OF_JAMMALAN_TRANSFORM = 12480,
|
||||
SPELL_HEX_OF_JAMMALAN_CHARM = 12483
|
||||
};
|
||||
|
||||
// 12479 - Hex of Jammal'an
|
||||
class spell_sunken_temple_hex_of_jammalan : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_sunken_temple_hex_of_jammalan);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_HEX_OF_JAMMALAN_TRANSFORM, SPELL_HEX_OF_JAMMALAN_CHARM });
|
||||
}
|
||||
|
||||
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
|
||||
return;
|
||||
|
||||
Unit* target = GetTarget();
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
if (!caster || !caster->IsAlive())
|
||||
return;
|
||||
|
||||
caster->CastSpell(target, SPELL_HEX_OF_JAMMALAN_TRANSFORM, true);
|
||||
caster->CastSpell(target, SPELL_HEX_OF_JAMMALAN_CHARM, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_sunken_temple_hex_of_jammalan::AfterRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
// 12480 - Hex of Jammal'an
|
||||
class spell_sunken_temple_hex_of_jammalan_transform : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_sunken_temple_hex_of_jammalan_transform);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_HEX_OF_JAMMALAN_CHARM });
|
||||
}
|
||||
|
||||
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetTarget()->RemoveAurasDueToSpell(SPELL_HEX_OF_JAMMALAN_CHARM);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_sunken_temple_hex_of_jammalan_transform::AfterRemove, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_sunken_temple()
|
||||
{
|
||||
new at_malfurion_stormrage();
|
||||
new go_atalai_statue();
|
||||
RegisterSpellScript(spell_sunken_temple_hex_of_jammalan);
|
||||
RegisterSpellScript(spell_sunken_temple_hex_of_jammalan_transform);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user