Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
ThreatCalcHelper.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_THREATCALCHELPER
7
#define SF_THREATCALCHELPER
8
9
#include "
Define.h
"
10
11
class
Unit
;
12
class
SpellInfo
;
13
14
struct
ThreatCalcHelper
15
{
16
static
uint32
const
NormalSchoolMask
= 1;
17
18
struct
SpellThreatCalculation
19
{
20
float
threat
;
21
bool
ignoresUnitModifiers
;
22
};
23
24
static
SpellThreatCalculation
ApplySpellThreatModifiers
(
float
threat,
float
pctMod,
bool
hasEnergizeEffect)
25
{
26
if
(pctMod != 1.0f)
27
threat *= pctMod;
28
29
SpellThreatCalculation
result = { threat, hasEnergizeEffect };
30
return
result;
31
}
32
33
static
float
calcThreat
(
Unit
* hatedUnit,
Unit
* hatingUnit,
float
threat,
uint32
schoolMask =
NormalSchoolMask
,
SpellInfo
const
* threatSpell = NULL);
34
static
bool
isValidProcess
(
Unit
* hatedUnit,
Unit
* hatingUnit,
SpellInfo
const
* threatSpell = NULL);
35
};
36
37
#endif
Define.h
uint32
std::uint32_t uint32
Definition
Define.h:77
SpellInfo
Definition
SpellInfo.h:158
Unit
Definition
Unit.h:1367
ThreatCalcHelper::SpellThreatCalculation
Definition
ThreatCalcHelper.h:19
ThreatCalcHelper::SpellThreatCalculation::ignoresUnitModifiers
bool ignoresUnitModifiers
Definition
ThreatCalcHelper.h:21
ThreatCalcHelper::SpellThreatCalculation::threat
float threat
Definition
ThreatCalcHelper.h:20
ThreatCalcHelper
Definition
ThreatCalcHelper.h:15
ThreatCalcHelper::calcThreat
static float calcThreat(Unit *hatedUnit, Unit *hatingUnit, float threat, uint32 schoolMask=NormalSchoolMask, SpellInfo const *threatSpell=NULL)
Definition
ThreatManager.cpp:22
ThreatCalcHelper::isValidProcess
static bool isValidProcess(Unit *hatedUnit, Unit *hatingUnit, SpellInfo const *threatSpell=NULL)
Definition
ThreatManager.cpp:55
ThreatCalcHelper::ApplySpellThreatModifiers
static SpellThreatCalculation ApplySpellThreatModifiers(float threat, float pctMod, bool hasEnergizeEffect)
Definition
ThreatCalcHelper.h:24
ThreatCalcHelper::NormalSchoolMask
static uint32 const NormalSchoolMask
Definition
ThreatCalcHelper.h:16
src
server
game
Combat
ThreatCalcHelper.h
Generated on
for Project SkyFire Core by
1.17.0