TrinityCore
Loading...
Searching...
No Matches
TemporarySummon.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_TEMPSUMMON_H
19#define TRINITYCORE_TEMPSUMMON_H
20
21#include "Creature.h"
22
24{
25 // Death Knight pets
26 PET_GHOUL = 26125,
28
29 // Shaman pet
30 PET_SPIRIT_WOLF = 29264
31};
32
34
36{
37 public:
38 explicit TempSummon(SummonPropertiesEntry const* properties, WorldObject* owner, bool isWorldObject);
39 virtual ~TempSummon() { }
40 void Update(uint32 time) override;
41 virtual void InitStats(uint32 lifetime);
42 virtual void InitSummon();
43 void UpdateObjectVisibilityOnCreate() override;
44 virtual void UnSummon(uint32 msTime = 0);
45 void RemoveFromWorld() override;
46 void SetTempSummonType(TempSummonType type);
47 void SaveToDB(uint32 /*mapid*/, uint8 /*spawnMask*/, uint32 /*phaseMask*/) override { }
48 WorldObject* GetSummoner() const;
49 Unit* GetSummonerUnit() const;
50 Creature* GetSummonerCreatureBase() const;
51 GameObject* GetSummonerGameObject() const;
52 ObjectGuid GetSummonerGUID() const { return m_summonerGUID; }
53 TempSummonType GetSummonType() const { return m_type; }
54 uint32 GetTimer() const { return m_timer; }
55 bool CanFollowOwner() const { return m_canFollowOwner; }
56 void SetCanFollowOwner(bool can) { m_canFollowOwner = can; }
58
59 std::string GetDebugInfo() const override;
60 private:
66};
67
69{
70 public:
71 Minion(SummonPropertiesEntry const* properties, Unit* owner, bool isWorldObject);
72 void InitStats(uint32 duration) override;
73 void RemoveFromWorld() override;
74 void setDeathState(DeathState s) override;
75 Unit* GetOwner() const { return m_owner; }
76 float GetFollowAngle() const override { return m_followAngle; }
77 void SetFollowAngle(float angle) { m_followAngle = angle; }
78
79 // Death Knight pets
80 bool IsPetGhoul() const { return GetEntry() == PET_GHOUL; } // Ghoul may be guardian or pet
81 bool IsRisenAlly() const { return GetEntry() == PET_RISEN_ALLY; }
82
83 // Shaman pet
84 bool IsSpiritWolf() const { return GetEntry() == PET_SPIRIT_WOLF; } // Spirit wolf from feral spirits
85
86 bool IsGuardianPet() const;
87
88 std::string GetDebugInfo() const override;
89 protected:
90 Unit* const m_owner;
92};
93
95{
96 public:
97 Guardian(SummonPropertiesEntry const* properties, Unit* owner, bool isWorldObject);
98 void InitStats(uint32 duration) override;
99 bool InitStatsForLevel(uint8 level);
100 void InitSummon() override;
101
102 bool UpdateStats(Stats stat) override;
103 bool UpdateAllStats() override;
104 void UpdateResistances(uint32 school) override;
105 void UpdateArmor() override;
106 void UpdateMaxHealth() override;
107 void UpdateMaxPower(Powers power) override;
108 void UpdateAttackPowerAndDamage(bool ranged = false) override;
109 void UpdateDamagePhysical(WeaponAttackType attType) override;
110
111 int32 GetBonusDamage() const { return m_bonusSpellDamage; }
112 float GetBonusStatFromOwner(Stats stat) const { return m_statFromOwner[stat]; }
113 void SetBonusDamage(int32 damage);
114 std::string GetDebugInfo() const override;
115 protected:
117 float m_statFromOwner[MAX_STATS];
118};
119
121{
122 public:
123 Puppet(SummonPropertiesEntry const* properties, Unit* owner);
124 void InitStats(uint32 duration) override;
125 void InitSummon() override;
126 void Update(uint32 time) override;
127};
128
130{
131public:
132 ForcedUnsummonDelayEvent(TempSummon& owner) : BasicEvent(), m_owner(owner) { }
133 bool Execute(uint64 e_time, uint32 p_time) override;
134
135private:
137};
138#endif
#define TC_GAME_API
Definition Define.h:114
uint8_t uint8
Definition Define.h:135
int32_t int32
Definition Define.h:129
uint64_t uint64
Definition Define.h:132
uint32_t uint32
Definition Define.h:133
TempSummonType
WeaponAttackType
Powers
Stats
@ MAX_STATS
PetEntry
@ PET_GHOUL
@ PET_SPIRIT_WOLF
@ PET_RISEN_ALLY
DeathState
Definition Unit.h:210
void setDeathState(DeathState s) override
bool UpdateAllStats() override
void UpdateResistances(uint32 school) override
void Update(uint32 time) override
Definition Creature.cpp:670
bool UpdateStats(Stats stat) override
void RemoveFromWorld() override
Definition Creature.cpp:300
void UpdateAttackPowerAndDamage(bool ranged=false) override
void UpdateArmor() override
void UpdateMaxPower(Powers power) override
std::string GetDebugInfo() const override
void UpdateMaxHealth() override
ForcedUnsummonDelayEvent(TempSummon &owner)
float GetBonusStatFromOwner(Stats stat) const
int32 m_bonusSpellDamage
int32 GetBonusDamage() const
float m_followAngle
void SetFollowAngle(float angle)
Unit * GetOwner() const
bool IsRisenAlly() const
bool IsSpiritWolf() const
Unit *const m_owner
float GetFollowAngle() const override
bool IsPetGhoul() const
uint32 GetEntry() const
Definition Object.h:81
virtual ~TempSummon()
TempSummonType GetSummonType() const
ObjectGuid GetSummonerGUID() const
void SetCanFollowOwner(bool can)
bool CanFollowOwner() const
SummonPropertiesEntry const *const m_Properties
uint32 GetTimer() const
ObjectGuid m_summonerGUID
TempSummonType m_type
void SaveToDB(uint32, uint8, uint32) override
uint32 m_lifetime
bool m_canFollowOwner
Definition Unit.h:769
virtual void UpdateDamagePhysical(WeaponAttackType attType)
virtual void UpdateObjectVisibilityOnCreate()
Definition Object.h:538