Scripts/Vashjir: Implement Sea Legs aura (#31899)

This commit is contained in:
Naddley
2026-07-19 14:32:19 +02:00
committed by GitHub
parent 47a9b7faca
commit 5f792dc8c4
3 changed files with 102 additions and 0 deletions
@@ -0,0 +1,23 @@
-- SpellScriptName
DELETE FROM `spell_script_names` WHERE `spell_id` = 76377;
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(76377, 'spell_vashjir_sea_legs_aura');
-- Sea Legs
UPDATE `gameobject_template` SET `RequiredLevel`=30, `VerifiedBuild`=68453 WHERE `entry`=205989; -- Saltwater Star
UPDATE `gameobject_template` SET `RequiredLevel`=30, `VerifiedBuild`=68453 WHERE `entry`=202560; -- Conch Shell
UPDATE `quest_details` SET `Emote2`=5, `VerifiedBuild`=68453 WHERE `ID`=25281; -- Pay It Forward
UPDATE `quest_details` SET `Emote2`=396, `VerifiedBuild`=68453 WHERE `ID`=24432; -- Sea Legs
-- SpellArea
DELETE FROM `spell_area` WHERE `spell` = 76377;
INSERT INTO `spell_area` (`spell`, `area`, `quest_start`, `quest_end`, `aura_spell`, `racemask`, `gender`, `flags`, `quest_start_status`, `quest_end_status`) VALUES
(76377, 5146, 24432, 0, 0, 0, 2, 3, 64, 11), -- (Cast) SpellID: 76377 (Sea Legs) (A)
(76377, 5145, 24432, 0, 0, 0, 2, 3, 64, 11), -- (Cast) SpellID: 76377 (Sea Legs) (A)
(76377, 4815, 24432, 0, 0, 0, 2, 3, 64, 11), -- (Cast) SpellID: 76377 (Sea Legs) (A)
(76377, 5144, 24432, 0, 0, 0, 2, 3, 64, 11), -- (Cast) SpellID: 76377 (Sea Legs) (A)
(76377, 5146, 25929, 0, 0, 0, 2, 3, 64, 11), -- (Cast) SpellID: 76377 (Sea Legs) (H)
(76377, 5145, 25929, 0, 0, 0, 2, 3, 64, 11), -- (Cast) SpellID: 76377 (Sea Legs) (H)
(76377, 4815, 25929, 0, 0, 0, 2, 3, 64, 11), -- (Cast) SpellID: 76377 (Sea Legs) (H)
(76377, 5144, 25929, 0, 0, 0, 2, 3, 64, 11); -- (Cast) SpellID: 76377 (Sea Legs) (H)
@@ -0,0 +1,73 @@
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
#include "Unit.h"
namespace Scripts::EasternKingdoms::Vashjir
{
namespace Spells
{
static constexpr uint32 SeaLegsAura = 73701;
}
// 76377 - Sea Legs
class spell_vashjir_sea_legs_aura : public AuraScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ Spells::SeaLegsAura });
}
void CalcPeriodic(AuraEffect const* /*aurEff*/, bool& isPeriodic, int32& amplitude) const
{
isPeriodic = true;
amplitude = 500;
}
void OnUpdate(AuraEffect* /*aurEff*/)
{
Unit* target = GetTarget();
if (target->IsInWater())
target->CastSpell(target, Spells::SeaLegsAura, TRIGGERED_IGNORE_CAST_IN_PROGRESS);
else
target->RemoveAura(Spells::SeaLegsAura);
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->RemoveAura(Spells::SeaLegsAura);
}
void Register() override
{
DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_vashjir_sea_legs_aura::CalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY);
OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_vashjir_sea_legs_aura::OnUpdate, EFFECT_0, SPELL_AURA_DUMMY);
AfterEffectRemove += AuraEffectRemoveFn(spell_vashjir_sea_legs_aura::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
}
void AddSC_vashjir()
{
using namespace Scripts::EasternKingdoms::Vashjir;
// Spells
RegisterSpellScript(spell_vashjir_sea_legs_aura);
}
@@ -215,6 +215,9 @@ void AddSC_boss_the_curator_rtk();
void AddSC_boss_mana_devourer();
void AddSC_boss_shade_of_medivh();
// Vashjir
void AddSC_vashjir();
// The name of this function should match:
// void Add${NameOfDirectory}Scripts()
void AddEasternKingdomsScripts()
@@ -417,4 +420,7 @@ void AddEasternKingdomsScripts()
AddSC_boss_the_curator_rtk();
AddSC_boss_mana_devourer();
AddSC_boss_shade_of_medivh();
// Vashjir
AddSC_vashjir();
}