Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
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
12
class
Unit
;
13
class
ThreatManager
;
14
class
HostileReference
;
15
class
SpellInfo
;
16
17
//=================================================
18
19
class
HostileRefManager
:
public
RefManager
<Unit, ThreatManager>
20
{
21
private
:
22
Unit
*
iOwner
;
23
public
:
24
explicit
HostileRefManager
(
Unit
* owner) {
iOwner
= owner; }
25
~HostileRefManager
();
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
43
void
deleteReferencesForFaction
(
uint32
faction);
44
45
HostileReference
*
getFirst
() {
return
((
HostileReference
*)
RefManager<Unit, ThreatManager>::getFirst
()); }
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
Common.h
int32
std::int32_t int32
Definition
Define.h:73
uint32
std::uint32_t uint32
Definition
Define.h:77
RefManager.h
HostileRefManager::getFirst
HostileReference * getFirst()
Definition
HostileRefManager.h:45
HostileRefManager::iOwner
Unit * iOwner
Definition
HostileRefManager.h:22
HostileRefManager::deleteReferencesForFaction
void deleteReferencesForFaction(uint32 faction)
Definition
HostileRefManager.cpp:117
HostileRefManager::threatAssist
void threatAssist(Unit *victim, float baseThreat, SpellInfo const *threatSpell=NULL)
Definition
HostileRefManager.cpp:23
HostileRefManager::~HostileRefManager
~HostileRefManager()
Definition
HostileRefManager.cpp:13
HostileRefManager::UpdateVisibility
void UpdateVisibility()
Definition
HostileRefManager.cpp:171
HostileRefManager::setOnlineOfflineState
void setOnlineOfflineState(bool isOnline)
Definition
HostileRefManager.cpp:75
HostileRefManager::deleteReference
void deleteReference(Unit *creature)
Definition
HostileRefManager.cpp:135
HostileRefManager::GetOwner
Unit * GetOwner()
Definition
HostileRefManager.h:27
HostileRefManager::addTempThreat
void addTempThreat(float threat, bool apply)
Definition
HostileRefManager.cpp:42
HostileRefManager::deleteReferences
void deleteReferences()
Definition
HostileRefManager.cpp:102
HostileRefManager::HostileRefManager
HostileRefManager(Unit *owner)
Definition
HostileRefManager.h:24
HostileRefManager::addThreatPercent
void addThreatPercent(int32 percent)
Definition
HostileRefManager.cpp:62
HostileRefManager::updateThreatTables
void updateThreatTables()
Definition
HostileRefManager.cpp:88
HostileReference
Definition
ThreatManager.h:28
RefManager::getFirst
Reference< TO, FROM > * getFirst()
Definition
RefManager.h:20
RefManager< Unit, ThreatManager >::RefManager
RefManager()
Definition
RefManager.h:17
SpellInfo
Definition
SpellInfo.h:158
ThreatManager
Definition
ThreatManager.h:180
Unit
Definition
Unit.h:1367
src
server
game
Combat
HostileRefManager.h
Generated on
for Project SkyFire Core by
1.17.0