TrinityCore
Loading...
Searching...
No Matches
zone_vashjir.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "ScriptMgr.h"
19#include "SpellAuraEffects.h"
20#include "SpellScript.h"
21#include "Unit.h"
22
24{
25namespace Spells
26{
27 static constexpr uint32 SeaLegsAura = 73701;
28}
29
30// 76377 - Sea Legs
32{
33 bool Validate(SpellInfo const* /*spellInfo*/) override
34 {
36 }
37
38 static void CalcPeriodic(AuraScript const&, AuraEffect const* /*aurEff*/, bool& isPeriodic, int32& amplitude)
39 {
40 isPeriodic = true;
41 amplitude = 500;
42 }
43
44 void OnUpdate(AuraEffect const* /*aurEff*/) const
45 {
46 Unit* target = GetTarget();
47 if (target->IsInWater())
49 }
50
51 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
52 {
54 }
55
62};
63
64// 76143 - Low Health
66{
67 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
68 {
69 GetTarget()->SetHealth(GetTarget()->CountPctFromMaxHealth(10));
70 }
71
76};
77}
78
int32_t int32
Definition Define.h:150
uint32_t uint32
Definition Define.h:154
Spells
Definition PlayerAI.cpp:32
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
@ EFFECT_0
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_DUMMY
@ TRIGGERED_IGNORE_CAST_IN_PROGRESS
Will not check if a current cast is in progress.
#define AuraEffectPeriodicFn(F, I, N)
#define AuraEffectCalcPeriodicFn(F, I, N)
#define AuraEffectApplyFn(F, I, N, M)
#define AuraEffectRemoveFn(F, I, N, M)
HookList< EffectCalcPeriodicHandler > DoEffectCalcPeriodic
HookList< EffectApplyHandler > AfterEffectRemove
HookList< EffectPeriodicHandler > OnEffectPeriodic
HookList< EffectApplyHandler > AfterEffectApply
Unit * GetTarget() const
void OnApply(AuraEffect const *, AuraEffectHandleModes)
static void CalcPeriodic(AuraScript const &, AuraEffect const *, bool &isPeriodic, int32 &amplitude)
void OnRemove(AuraEffect const *, AuraEffectHandleModes) const
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition Unit.h:647
void SetHealth(uint64 val)
Definition Unit.cpp:10041
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3846
bool IsInWater() const
Definition Unit.cpp:3349
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2222
void AddSC_vashjir()