Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
HostileRefManager.h
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#ifndef SF_HOSTILEREFMANAGER
7#define SF_HOSTILEREFMANAGER
8
9#include "Common.h"
10#include "RefManager.h"
11
12class Unit;
13class ThreatManager;
15class SpellInfo;
16
17//=================================================
18
19class HostileRefManager : public RefManager<Unit, ThreatManager>
20{
21private:
23public:
24 explicit HostileRefManager(Unit* owner) { iOwner = owner; }
26
27 Unit* GetOwner() { return iOwner; }
28
29 // send threat to all my hateres for the victim
30 // The victim is hated than by them as well
31 // use for buffs and healing threat functionality
32 void threatAssist(Unit* victim, float baseThreat, SpellInfo const* threatSpell = NULL);
33
34 void addTempThreat(float threat, bool apply);
35
36 void addThreatPercent(int32 percent);
37
38 // The references are not needed anymore
39 // tell the source to remove them from the list and free the mem
40 void deleteReferences();
41
42 // Remove specific faction references
44
46
47 void updateThreatTables();
48
49 void setOnlineOfflineState(bool isOnline);
50
51 // set state for one reference, defined by Unit
52 void setOnlineOfflineState(Unit* creature, bool isOnline);
53
54 // delete one reference, defined by Unit
55 void deleteReference(Unit* creature);
56
57 void UpdateVisibility();
58};
59//=================================================
60#endif
std::int32_t int32
Definition Define.h:73
std::uint32_t uint32
Definition Define.h:77
HostileReference * getFirst()
void deleteReferencesForFaction(uint32 faction)
void threatAssist(Unit *victim, float baseThreat, SpellInfo const *threatSpell=NULL)
void setOnlineOfflineState(bool isOnline)
void deleteReference(Unit *creature)
void addTempThreat(float threat, bool apply)
HostileRefManager(Unit *owner)
void addThreatPercent(int32 percent)
Reference< TO, FROM > * getFirst()
Definition RefManager.h:20
Definition Unit.h:1367