Project SkyFire Core
SkyFire 5.4.8 server core API documentation
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
7
8namespace Skyfire
9{
10namespace 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
65 {
66 for (TotemHealthRule const& rule : TotemHealthRules)
67 if (rule.SpellId == spellId)
68 return rule.HealthPct;
69
70 return 0;
71 }
72}
73}
std::int32_t int32
Definition Define.h:73
std::uint32_t uint32
Definition Define.h:77
bool ShouldUseDamageAsSummonCount(uint32 summonPropertyId)
uint32 GetSummonCountForProperty(uint32 summonPropertyId, int32 damage)
uint32 GetTotemSummonHealthPct(uint32 spellId)