TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Totem.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 2 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef TRINITYCORE_TOTEM_H
20 #define TRINITYCORE_TOTEM_H
21 
22 #include "TemporarySummon.h"
23 
25 {
28  TOTEM_STATUE = 2 // copied straight from MaNGOS, may need more implementation to work
29 };
30 // Some Totems cast spells that are not in creature DB
32 {
33  // Totemic Wrath
36 };
37 
38 class TC_GAME_API Totem : public Minion
39 {
40  public:
41  Totem(SummonPropertiesEntry const* properties, Unit* owner);
42  virtual ~Totem() { }
43  void Update(uint32 time) override;
44  void InitStats(uint32 duration) override;
45  void InitSummon() override;
46  void UnSummon(uint32 msTime = 0) override;
47  uint32 GetSpell(uint8 slot = 0) const { return m_spells[slot]; }
48  uint32 GetTotemDuration() const { return m_duration; }
49  void SetTotemDuration(uint32 duration) { m_duration = duration; }
50  TotemType GetTotemType() const { return m_type; }
51 
52  bool UpdateStats(Stats /*stat*/) override { return true; }
53  bool UpdateAllStats() override { return true; }
54  void UpdateResistances(uint32 /*school*/) override { }
55  void UpdateArmor() override { }
56  void UpdateMaxHealth() override { }
57  void UpdateMaxPower(Powers /*power*/) override { }
58  void UpdateAttackPowerAndDamage(bool /*ranged*/) override { }
59  void UpdateDamagePhysical(WeaponAttackType /*attType*/) override { }
60 
61  bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const override;
62 
63  protected:
66 };
67 #endif
uint32 GetSpell(uint8 slot=0) const
Definition: Totem.h:47
TotemType GetTotemType() const
Definition: Totem.h:50
bool UpdateStats(Stats) override
Definition: Totem.h:52
Definition: Totem.h:27
Definition: SpellInfo.h:326
void UpdateResistances(uint32) override
Definition: Totem.h:54
void InitStats(uint32 duration) override
Definition: TemporarySummon.cpp:298
void UpdateMaxPower(Powers) override
Definition: Totem.h:57
Stats
Definition: SharedDefines.h:235
TotemSpells
Definition: Totem.h:31
Definition: Totem.h:34
Definition: Totem.h:26
virtual ~Totem()
Definition: Totem.h:42
Definition: Totem.h:38
virtual void UnSummon(uint32 msTime=0)
Definition: TemporarySummon.cpp:237
bool UpdateAllStats() override
Definition: Totem.h:53
Definition: TemporarySummon.h:66
TotemType m_type
Definition: Totem.h:64
Powers
Definition: SharedDefines.h:246
TotemType
Definition: Totem.h:24
uint32_t uint32
Definition: Define.h:150
bool IsImmunedToSpellEffect(SpellInfo const *spellInfo, uint32 index) const override
Definition: Creature.cpp:1810
void UpdateMaxHealth() override
Definition: Totem.h:56
uint32 GetTotemDuration() const
Definition: Totem.h:48
void UpdateAttackPowerAndDamage(bool) override
Definition: Totem.h:58
uint32 m_duration
Definition: Totem.h:65
TempSummonType m_type
Definition: TemporarySummon.h:60
virtual void InitSummon()
Definition: TemporarySummon.cpp:220
void UpdateArmor() override
Definition: Totem.h:55
#define TC_GAME_API
Definition: Define.h:134
void SetTotemDuration(uint32 duration)
Definition: Totem.h:49
uint8_t uint8
Definition: Define.h:152
void Update(uint32 time) override
Definition: TemporarySummon.cpp:47
WeaponAttackType
Definition: Unit.h:615
Definition: Unit.h:1305
void UpdateDamagePhysical(WeaponAttackType) override
Definition: Totem.h:59
Definition: Totem.h:28
Definition: Totem.h:35
Definition: DBCStructure.h:1242