162 {
164 {
167 {
168
170 if (pInfo)
171 {
172 ghoul->SetCreateHealth(pInfo->
health);
176 ghoul->SetCreateStat(
Stats(stat),
float(pInfo->
stats[stat]));
177 }
178
179 ghoul->SetBaseWeaponDamage(
BASE_ATTACK,
MINDAMAGE,
float(ghoul->GetLevel() - (ghoul->GetLevel() / 4)));
180 ghoul->SetBaseWeaponDamage(
BASE_ATTACK,
MAXDAMAGE,
float(ghoul->GetLevel() + (ghoul->GetLevel() / 4)));
181
182
183 if (
Aura* aur = ghoul->AddAura(62137, ghoul))
185 if (aur->GetEffect(0))
186 aur->GetEffect(0)->SetAmount(-aurEff->GetSpellInfo()->Effects[
EFFECT_2].CalcValue());
187
188
190
191
196
197
199 {
202 continue;
203
204 float value = 0.0f;
206
207
209 if (aurEff)
210 {
213 }
214
216 if (aurEff)
218
219 value = float(
GetCaster()->GetStat(stat)) * mod;
220 value = ghoul->GetTotalStatValue(stat, value);
221 ghoul->SetStat(stat,
int32(value));
222 ghoul->ApplyStatBuffMod(stat, value, true);
223 }
224
225
230
231
233
234
236 ghoul->UpdateAllStats();
237 ghoul->SetFullHealth();
238
239
246 }
247 }
248 }
T AddPct(T &base, U pct)
Definition: Util.h:67
T CalculatePct(T base, U pct)
Definition: Util.h:61
std::int32_t int32
Definition: Define.h:103
std::uint8_t uint8
Definition: Define.h:109
#define sObjectMgr
Definition: ObjectMgr.h:1623
@ MINDAMAGE
Definition: Unit.h:135
@ MAXDAMAGE
Definition: Unit.h:136
UnitMods
Definition: Unit.h:142
@ UNIT_MOD_ARMOR
Definition: Unit.h:156
@ UNIT_MOD_ATTACK_POWER
Definition: Unit.h:163
@ UNIT_MOD_HEALTH
Definition: Unit.h:148
@ UNIT_MOD_POWER_START
Definition: Unit.h:174
@ BASE_ATTACK
Definition: Unit.h:209
@ BASE_VALUE
Definition: Unit.h:126
@ TOTAL_VALUE
Definition: Unit.h:128
@ TOTAL_PCT
Definition: Unit.h:129
@ BASE_PCT
Definition: Unit.h:127
@ UNIT_FIELD_ATTACK_POWER_MODS
Definition: UpdateFields.h:163
@ UNIT_FIELD_ATTACK_POWER_MULTIPLIER
Definition: UpdateFields.h:164
@ UNIT_FIELD_ATTACK_POWER
Definition: UpdateFields.h:162
@ UNIT_FIELD_BASEATTACKTIME
Definition: UpdateFields.h:120
@ SPELL_HUNTER_PET_SCALING_04
Definition: PetDefines.h:141
@ SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE
Definition: SpellAuraDefines.h:200
@ SPELL_AURA_MOD_ATTACK_POWER
Definition: SpellAuraDefines.h:162
@ SPELL_AURA_MELEE_SLOW
Definition: SpellAuraDefines.h:256
@ SPELL_AURA_ADD_FLAT_MODIFIER
Definition: SpellAuraDefines.h:170
@ SPELL_AURA_MOD_STAT
Definition: SpellAuraDefines.h:92
@ SPELL_AURA_MOD_MELEE_RANGED_HASTE
Definition: SpellAuraDefines.h:255
@ SPELL_AURA_MOD_ATTACK_POWER_PCT
Definition: SpellAuraDefines.h:229
@ SPELL_BLOCK_TYPE_POSITIVE
Definition: SpellDefines.h:158
@ SPELL_DK_GLYPH_OF_THE_GHOUL
Definition: spell_dk.cpp:39
@ EFFECT_1
Definition: SharedDefines.h:32
@ EFFECT_0
Definition: SharedDefines.h:31
@ EFFECT_2
Definition: SharedDefines.h:33
#define MAX_STATS
Definition: SharedDefines.h:265
@ POWER_ENERGY
Definition: SharedDefines.h:272
@ IMMUNITY_STATE
Definition: SharedDefines.h:1395
@ SPELLFAMILY_DEATHKNIGHT
Definition: SharedDefines.h:3543
Stats
Definition: SharedDefines.h:257
@ STAT_AGILITY
Definition: SharedDefines.h:259
@ STAT_STRENGTH
Definition: SharedDefines.h:258
@ STAT_STAMINA
Definition: SharedDefines.h:260
Unit * GetCharm() const
Definition: Unit.cpp:10628
float m_modAttackSpeedPct[3]
Definition: Unit.h:1789
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition: Unit.cpp:5465
Definition: ObjectMgr.h:528
uint32 health
Definition: ObjectMgr.h:535
std::array< uint32, MAX_STATS > stats
Definition: ObjectMgr.h:534
uint32 armor
Definition: ObjectMgr.h:537
Definition: SpellAuraEffects.h:39
SpellInfo const * GetSpellInfo() const
Definition: SpellAuraEffects.h:54
int32 GetAmount() const
Definition: SpellAuraEffects.h:64
Definition: SpellAuras.h:87
Definition: SpellInfo.h:316
std::array< SpellEffectInfo, MAX_SPELL_EFFECTS > Effects
Definition: SpellInfo.h:393
int32 GetEffectValue() const
Definition: SpellScript.cpp:600
Unit * GetCaster()
Definition: SpellScript.cpp:401