TrinityCore
Totem.h
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#ifndef TRINITYCORE_TOTEM_H
19#define TRINITYCORE_TOTEM_H
20
21#include "TemporarySummon.h"
22
24{
27 TOTEM_STATUE = 2 // copied straight from MaNGOS, may need more implementation to work
28};
29
30class TC_GAME_API Totem final : public Minion
31{
32 public:
33 Totem(SummonPropertiesEntry const* properties, Unit* owner);
34 virtual ~Totem() { }
35 void Update(uint32 diff) override;
36 void InitStats(WorldObject* summoner, Milliseconds duration) override;
37 void InitSummon(WorldObject* summoner) override;
38 void UnSummon(uint32 msTime = 0) override;
39 uint32 GetSpell(uint8 slot = 0) const { return m_spells[slot]; }
40 Milliseconds GetTotemDuration() const { return m_duration; }
41 void SetTotemDuration(Milliseconds duration) { m_duration = duration; }
42 TotemType GetTotemType() const { return m_type; }
43
44 bool UpdateStats(Stats /*stat*/) override { return true; }
45 bool UpdateAllStats() override { return true; }
46 void UpdateResistances(uint32 /*school*/) override { }
47 void UpdateArmor() override { }
48 void UpdateMaxHealth() override { }
49 void UpdateMaxPower(Powers /*power*/) override { }
50 void UpdateAttackPowerAndDamage(bool /*ranged*/) override { }
51 void UpdateDamagePhysical(WeaponAttackType /*attType*/) override { }
52
53 bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, SpellEffectInfo const& spellEffectInfo, WorldObject const* caster, bool requireImmunityPurgesEffectAttribute = false) const override;
54
55 protected:
58};
59#endif
#define TC_GAME_API
Definition: Define.h:123
uint8_t uint8
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:142
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition: Duration.h:29
WeaponAttackType
Powers
Stats
TotemType
Definition: Totem.h:24
@ TOTEM_ACTIVE
Definition: Totem.h:26
@ TOTEM_PASSIVE
Definition: Totem.h:25
@ TOTEM_STATUE
Definition: Totem.h:27
bool IsImmunedToSpellEffect(SpellInfo const *spellInfo, SpellEffectInfo const &spellEffectInfo, WorldObject const *caster, bool requireImmunityPurgesEffectAttribute=false) const override
Definition: Creature.cpp:2467
void InitStats(WorldObject *summoner, Milliseconds duration) override
virtual void UnSummon(uint32 msTime=0)
virtual void InitSummon(WorldObject *summoner)
TempSummonType m_type
void Update(uint32 diff) override
Definition: Totem.h:31
void UpdateMaxHealth() override
Definition: Totem.h:48
void UpdateArmor() override
Definition: Totem.h:47
void SetTotemDuration(Milliseconds duration)
Definition: Totem.h:41
uint32 GetSpell(uint8 slot=0) const
Definition: Totem.h:39
Milliseconds m_duration
Definition: Totem.h:57
bool UpdateAllStats() override
Definition: Totem.h:45
virtual ~Totem()
Definition: Totem.h:34
Milliseconds GetTotemDuration() const
Definition: Totem.h:40
TotemType m_type
Definition: Totem.h:56
void UpdateAttackPowerAndDamage(bool) override
Definition: Totem.h:50
bool UpdateStats(Stats) override
Definition: Totem.h:44
TotemType GetTotemType() const
Definition: Totem.h:42
void UpdateResistances(uint32) override
Definition: Totem.h:46
void UpdateMaxPower(Powers) override
Definition: Totem.h:49
void UpdateDamagePhysical(WeaponAttackType) override
Definition: Totem.h:51
Definition: Unit.h:627