Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
SpellSummonMetadata.cpp
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
#include "
SpellSummonMetadata.h
"
7
8
namespace
Skyfire
9
{
10
namespace
Spells
11
{
12
namespace
13
{
14
struct
TotemHealthRule
15
{
16
uint32
SpellId;
17
uint32
HealthPct;
18
};
19
20
uint32
const
DamageBasedSummonProperties[] =
21
{
22
64,
23
61,
24
1101,
25
66,
26
648,
27
2301,
28
1061,
29
1261,
30
629,
31
181,
32
715,
33
1562,
34
833,
35
1161
36
};
37
38
TotemHealthRule
const
TotemHealthRules[] =
39
{
40
{ 115313, 30 },
41
{ 115315, 30 },
42
{ 126135, 30 },
43
{ 16190, 10 }
44
};
45
}
46
47
bool
ShouldUseDamageAsSummonCount
(
uint32
summonPropertyId)
48
{
49
for
(
uint32
propertyId : DamageBasedSummonProperties)
50
if
(propertyId == summonPropertyId)
51
return
true
;
52
53
return
false
;
54
}
55
56
uint32
GetSummonCountForProperty
(
uint32
summonPropertyId,
int32
damage)
57
{
58
if
(!
ShouldUseDamageAsSummonCount
(summonPropertyId))
59
return
1;
60
61
return
damage > 0 ?
uint32
(damage) : 1;
62
}
63
64
uint32
GetTotemSummonHealthPct
(
uint32
spellId)
65
{
66
for
(TotemHealthRule
const
& rule : TotemHealthRules)
67
if
(rule.SpellId == spellId)
68
return
rule.HealthPct;
69
70
return
0;
71
}
72
}
73
}
int32
std::int32_t int32
Definition
Define.h:73
uint32
std::uint32_t uint32
Definition
Define.h:77
SpellSummonMetadata.h
Skyfire::Spells
Definition
SpellAuraMetadata.cpp:13
Skyfire::Spells::ShouldUseDamageAsSummonCount
bool ShouldUseDamageAsSummonCount(uint32 summonPropertyId)
Definition
SpellSummonMetadata.cpp:47
Skyfire::Spells::GetSummonCountForProperty
uint32 GetSummonCountForProperty(uint32 summonPropertyId, int32 damage)
Definition
SpellSummonMetadata.cpp:56
Skyfire::Spells::GetTotemSummonHealthPct
uint32 GetTotemSummonHealthPct(uint32 spellId)
Definition
SpellSummonMetadata.cpp:64
Skyfire
Definition
AuthPatchTransfer.h:12
src
server
game
Spells
SpellSummonMetadata.cpp
Generated on
for Project SkyFire Core by
1.17.0