Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
SpellAuraPeriodic.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 "Battlefield.h"
7#include "BattlefieldMgr.h"
8#include "Battleground.h"
9#include "CellImpl.h"
10#include "Common.h"
11#include "Formulas.h"
12#include "GridNotifiers.h"
13#include "GridNotifiersImpl.h"
14#include "Log.h"
15#include "ObjectAccessor.h"
16#include "ObjectMgr.h"
17#include "Opcodes.h"
18#include "OutdoorPvPMgr.h"
19#include "Pet.h"
20#include "Player.h"
21#include "ReputationMgr.h"
22#include "ScriptMgr.h"
23#include "Spell.h"
24#include "SpellAuraEffects.h"
25#include "SpellAuraMetadata.h"
26#include "SpellMgr.h"
27#include "SpellValidation.h"
28#include "Unit.h"
29#include "Util.h"
30#include "Vehicle.h"
31#include "WeatherMgr.h"
32#include "WorldPacket.h"
33
34class Aura;
35
37{
38 switch (GetSpellInfo()->SpellFamilyName)
39 {
41 switch (GetId())
42 {
43 case 66149: // Bullet Controller Periodic - 10 Man
44 case 68396: // Bullet Controller Periodic - 25 Man
45 {
46 if (!caster)
47 break;
48
49 Skyfire::Spells::PeriodicBulletControllerRule const* bulletController =
51 if (!bulletController)
52 break;
53
54 caster->CastCustomSpell(bulletController->FirstSpellId, SPELLVALUE_MAX_TARGETS,
55 std::rand() % bulletController->MaxTargetRoll + 1, target, true);
56 caster->CastCustomSpell(bulletController->SecondSpellId, SPELLVALUE_MAX_TARGETS,
57 std::rand() % bulletController->MaxTargetRoll + 1, target, true);
58 break;
59 }
60 case 62292: // Blaze (Pool of Tar)
61 // should we use custom damage?
62 target->CastSpell((Unit*)NULL, m_spellInfo->Effects[m_effIndex].TriggerSpell, true);
63 break;
64 case 62399: // Overload Circuit
65 if (target->GetMap()->IsDungeon() && int(target->GetAppliedAuras().count(62399)) >= (target->GetMap()->IsHeroic() ? 4 : 2))
66 {
68 target->CastSpell(target, shutdownSpellId, true); // System Shutdown
69 if (Unit* veh = target->GetVehicleBase())
70 veh->CastSpell(target, shutdownSpellId, true);
71 }
72 break;
73 case 64821: // Fuse Armor (Razorscale)
74 if (GetBase()->GetStackAmount() == GetSpellInfo()->StackAmount)
75 {
77 true, NULL, NULL, GetCasterGUID());
78 target->RemoveAura(64821);
79 }
80 break;
81 }
82 break;
84 {
85 // Mirror Image
86 if (GetId() == 55342)
87 // Set name of summons to name of caster
88 target->CastSpell((Unit*)NULL, m_spellInfo->Effects[m_effIndex].TriggerSpell, true);
89 break;
90 }
92 {
93 switch (GetSpellInfo()->Id)
94 {
95 // Frenzied Regeneration
96 case 22842:
97 {
98 // Converts up to 10 rage per second into health for $d. Each point of rage is converted into ${$m2/10}.1% of max health.
99 // Should be manauser
100 if (target->getPowerType() != POWER_RAGE)
101 break;
102 uint32 rage = target->GetPower(POWER_RAGE);
103 // Nothing todo
104 if (rage == 0)
105 break;
106 int32 mod = (rage < 100) ? rage : 100;
107 int32 points = target->CalculateSpellDamage(target, GetSpellInfo(), 1);
108 int32 regen = target->GetMaxHealth() * (mod * points / 10) / 1000;
110 &regen, 0, 0, true, 0, this);
111 target->SetPower(POWER_RAGE, rage - mod);
112 break;
113 }
114 }
115 break;
116 }
118 {
119 switch (GetSpellInfo()->Id)
120 {
121 // Killing Spree
122 case 51690:
123 {
125 UnitList targets;
126 {
127 // eff_radius == 0
128 float radius = GetSpellInfo()->GetMaxRange(false);
129
131 Cell cell(p);
132
135
138
139 cell.Visit(p, grid_object_checker, *GetBase()->GetOwner()->GetMap(), *target, radius);
140 cell.Visit(p, world_object_checker, *GetBase()->GetOwner()->GetMap(), *target, radius);
141 }
142
143 if (targets.empty())
144 return;
145
147
148 target->CastSpell(spellTarget, Skyfire::Spells::GetKillingSpreePeriodicSpellId(0), true);
149 target->CastSpell(spellTarget, Skyfire::Spells::GetKillingSpreePeriodicSpellId(1), true);
150 break;
151 }
152 }
153 break;
154 }
156 {
157 // Explosive Shot
158 if (GetSpellInfo()->SpellFamilyFlags[1] & 0x80000000)
159 {
160 if (caster)
162 SPELLVALUE_BASE_POINT0, m_amount, target, true, NULL, this);
163 break;
164 }
165 break;
166 }
168 switch (GetId())
169 {
170 case 49016: // Hysteria
171 uint32 damage = uint32(target->CountPctFromMaxHealth(1));
172 target->DealDamage(target, damage, NULL, NODAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
173 break;
174 }
175 // Death and Decay
176 if (GetSpellInfo()->SpellFamilyFlags[0] & 0x20)
177 {
178 if (caster)
180 &m_amount, NULL, NULL, true, 0, this);
181 break;
182 }
183 // Blood of the North
184 // Reaping
185 // Death Rune Mastery
186 if (GetSpellInfo()->SpellIconID == 3041 || GetSpellInfo()->SpellIconID == 22 || GetSpellInfo()->SpellIconID == 2622)
187 {
188 if (target->GetTypeId() != TypeID::TYPEID_PLAYER)
189 return;
190 if (target->ToPlayer()->getClass() != CLASS_DEATH_KNIGHT)
191 return;
192
193 // timer expired - remove death runes
194 target->ToPlayer()->RemoveRunesByAuraEffect(this);
195 }
196 break;
197 default:
198 break;
199 }
200}
201
203{
204 // generic casting code with custom spells and target/caster customs
205 uint32 triggerSpellId = GetSpellInfo()->Effects[GetEffIndex()].TriggerSpell;
206
207 SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId);
208 SpellInfo const* auraSpellInfo = GetSpellInfo();
209 uint32 auraId = auraSpellInfo->Id;
210
211 // specific code for cases with no trigger spell provided in field
212 if (triggeredSpellInfo == NULL)
213 {
214 switch (auraSpellInfo->SpellFamilyName)
215 {
217 {
218 switch (auraId)
219 {
220 // Brood Affliction: Bronze
221 case 23170:
223 break;
224 // Restoration
225 case 24379:
226 case 23493:
227 {
228 if (caster)
229 {
230 int32 heal = caster->CountPctFromMaxHealth(10);
231 caster->HealBySpell(target, auraSpellInfo, heal);
232
233 if (int32 mana = caster->GetMaxPower(POWER_MANA))
234 {
235 mana /= 10;
236 caster->EnergizeBySpell(caster,
238 }
239 }
240 return;
241 }
242 // Nitrous Boost
243 case 27746:
244 if (caster && target->GetPower(POWER_MANA) >= 10)
245 {
246 target->ModifyPower(POWER_MANA, -10);
247 target->SendEnergizeSpellLog(caster, auraId, 10, POWER_MANA);
248 }
249 else
250 target->RemoveAurasDueToSpell(auraId);
251 return;
252 // Frost Blast
253 case 27808:
254 if (caster)
256 SPELLVALUE_BASE_POINT0, int32(target->CountPctFromMaxHealth(21)), target, true, NULL, this);
257 return;
258 // Inoculate Nestlewood Owlkin
259 case 29528:
260 if (target->GetTypeId() != TypeID::TYPEID_UNIT) // prevent error reports in case ignored player target
261 return;
262 break;
263 // Feed Captured Animal
264 case 29917:
266 break;
267 // Extract Gas
268 case 30427:
269 {
270 // move loot to player inventory and despawn target
271 if (caster && caster->GetTypeId() == TypeID::TYPEID_PLAYER &&
272 target->GetTypeId() == TypeID::TYPEID_UNIT &&
274 {
275 Player* player = caster->ToPlayer();
276 Creature* creature = target->ToCreature();
277 // missing lootid has been reported on startup - just return
278 if (!creature->GetCreatureTemplate()->SkinLootId)
279 return;
280
282
283 creature->DespawnOrUnsummon();
284 }
285 return;
286 }
287 // Quake
288 case 30576:
290 break;
291 // Doom
293 // so instakill will be naturally done before trigger spell
294 case 31347:
295 {
296 target->CastSpell(target, Skyfire::Spells::GetPeriodicDoomTriggerSpellId(), true, NULL, this);
297 target->Kill(target);
298 return;
299 }
300 // Spellcloth
301 case 31373:
302 {
303 // Summon Elemental after create item
306 return;
307 }
308 // Flame Quills
309 case 34229:
310 {
311 // cast 24 spells 34269-34289, 34314-34316
312 for (uint32 spell_id = 34269; spell_id != 34290; ++spell_id)
313 target->CastSpell(target, spell_id, true, NULL, this);
314 for (uint32 spell_id = 34314; spell_id != 34317; ++spell_id)
315 target->CastSpell(target, spell_id, true, NULL, this);
316 return;
317 }
318 // Remote Toy
319 case 37027:
321 break;
322 // Eye of Grillok
323 case 38495:
325 break;
326 // Absorb Eye of Grillok (Zezzak's Shard)
327 case 38554:
328 {
329 if (!caster || target->GetTypeId() != TypeID::TYPEID_UNIT)
330 return;
331
332 caster->CastSpell(caster, Skyfire::Spells::GetAbsorbEyeOfGrillokCasterSpellId(), true, NULL, this);
333
334 Creature* creatureTarget = target->ToCreature();
335
336 creatureTarget->DespawnOrUnsummon();
337 return;
338 }
339 // Tear of Azzinoth Summon Channel - it's not really supposed to do anything, and this only prevents the console spam
340 case 39857:
342 break;
343 // Personalized Weather
344 case 46736:
346 break;
347 }
348 break;
349 }
351 {
352 switch (auraId)
353 {
354 // Lightning Shield (The Earthshatterer set trigger after cast Lighting Shield)
355 case 28820:
356 {
357 // Need remove self if Lightning Shield not active
359 target->RemoveAurasDueToSpell(28820);
360 return;
361 }
362 // Totemic Mastery (Skyshatter Regalia (Shaman Tier 6) - bonus)
363 case 38443:
364 {
365 bool all = true;
366 for (int i = SUMMON_SLOT_TOTEM; i < MAX_TOTEM_SLOT; ++i)
367 {
368 if (!target->m_SummonSlot[i])
369 {
370 all = false;
371 break;
372 }
373 }
374
375 if (all)
376 target->CastSpell(target, Skyfire::Spells::GetTotemicMasteryTriggerSpellId(), true, NULL, this);
377 else
379 return;
380 }
381 }
382 break;
383 }
384 default:
385 break;
386 }
387 }
388 else
389 {
390 // Spell exist but require custom code
391 switch (auraId)
392 {
393 // Summon Tarindrella Aura
394 case 92237:
395 {
396 if (caster->FindNearestCreature(49480, 15.0f, true))
397 return;
398 }
399 // Pursuing Spikes (Anub'arak)
400 case 65920:
401 case 65922:
402 case 65923:
403 {
404 Unit* permafrostCaster = NULL;
405 Aura* permafrostAura = target->GetAura(66193);
406 if (!permafrostAura)
407 permafrostAura = target->GetAura(67855);
408 if (!permafrostAura)
409 permafrostAura = target->GetAura(67856);
410 if (!permafrostAura)
411 permafrostAura = target->GetAura(67857);
412
413 if (permafrostAura)
414 permafrostCaster = permafrostAura->GetCaster();
415
416 if (permafrostCaster)
417 {
418 if (Creature* permafrostCasterCreature = permafrostCaster->ToCreature())
419 permafrostCasterCreature->DespawnOrUnsummon(3000);
420
421 target->CastSpell(target, 66181, false);
422 target->RemoveAllAuras();
423 if (Creature* targetCreature = target->ToCreature())
424 targetCreature->DisappearAndDie();
425 }
426 break;
427 }
428 // Mana Tide
429 case 16191:
430 target->CastCustomSpell(target, triggerSpellId, &m_amount, NULL, NULL, true, NULL, this);
431 return;
432 // Negative Energy Periodic
433 case 46284:
434 target->CastCustomSpell(triggerSpellId, SPELLVALUE_MAX_TARGETS, m_tickNumber / 10 + 1, NULL, true, NULL, this);
435 return;
436 // Poison (Grobbulus)
437 case 28158:
438 case 54362:
439 // Slime Pool (Dreadscale & Acidmaw)
440 case 66882:
441 target->CastCustomSpell(triggerSpellId, SPELLVALUE_RADIUS_MOD, (int32)((((float)m_tickNumber / 60) * 0.9f + 0.1f) * 10000 * 2 / 3), NULL, true, NULL, this);
442 return;
443 // Slime Spray - temporary here until preventing default effect works again
444 // added on 9.10.2010
445 case 69508:
446 {
447 if (caster)
448 caster->CastSpell(target, triggerSpellId, true, NULL, NULL, caster->GetGUID());
449 return;
450 }
451 case 24745: // Summon Templar, Trigger
452 case 24747: // Summon Templar Fire, Trigger
453 case 24757: // Summon Templar Air, Trigger
454 case 24759: // Summon Templar Earth, Trigger
455 case 24761: // Summon Templar Water, Trigger
456 case 24762: // Summon Duke, Trigger
457 case 24766: // Summon Duke Fire, Trigger
458 case 24769: // Summon Duke Air, Trigger
459 case 24771: // Summon Duke Earth, Trigger
460 case 24773: // Summon Duke Water, Trigger
461 case 24785: // Summon Royal, Trigger
462 case 24787: // Summon Royal Fire, Trigger
463 case 24791: // Summon Royal Air, Trigger
464 case 24792: // Summon Royal Earth, Trigger
465 case 24793: // Summon Royal Water, Trigger
466 {
467 // All this spells trigger a spell that requires reagents; if the
468 // triggered spell is cast as "triggered", reagents are not consumed
470 caster->CastSpell(target, triggerSpellId, false);
471 return;
472 }
473 // Emblazon Runeblade
474 case 51769:
475 {
476 caster->CastSpell(target, triggerSpellId, false);
477 return;
478 }
479 }
480 }
481
482 // Reget trigger spell proto
483 triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId);
484
485 if (triggeredSpellInfo)
486 {
487 if (Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo) ? caster : target)
488 {
489 triggerCaster->CastSpell(target, triggeredSpellInfo, true, NULL, this);
490 SF_LOG_DEBUG("spells", "AuraEffect::HandlePeriodicTriggerSpellAuraTick: Spell %u Trigger %u", GetId(), triggeredSpellInfo->Id);
491 }
492 }
493 else
494 {
495 Creature* c = target->ToCreature();
496 if (!c || !caster || !sScriptMgr->OnDummyEffect(caster, GetId(), SpellEffIndex(GetEffIndex()), target->ToCreature()) ||
497 !c->AI()->sOnDummyEffect(caster, GetId(), SpellEffIndex(GetEffIndex())))
498 SF_LOG_DEBUG("spells", "AuraEffect::HandlePeriodicTriggerSpellAuraTick: Spell %u has non-existent spell %u in EffectTriggered[%d] and is therefor not triggered.", GetId(), triggerSpellId, GetEffIndex());
499 }
500}
501
503{
505 if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId))
506 {
507 if (Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo) ? caster : target)
508 {
509 int32 basepoints = GetAmount();
510 triggerCaster->CastCustomSpell(target, triggerSpellId, &basepoints, &basepoints, &basepoints, true, 0, this);
511 SF_LOG_DEBUG("spells", "AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell %u Trigger %u", GetId(), triggeredSpellInfo->Id);
512 }
513 }
514 else
515 SF_LOG_DEBUG("spells", "AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell %u has non-existent spell %u in EffectTriggered[%d] and is therefor not triggered.", GetId(), triggerSpellId, GetEffIndex());
516}
517
519{
520 if (!caster || !target->IsAlive())
521 return;
522
524 {
525 SendTickImmune(target, caster);
526 return;
527 }
528
529 // Consecrate ticks can miss and will not show up in the combat log
530 if (GetSpellInfo()->Effects[GetEffIndex()].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA &&
531 caster->SpellHitResult(target, GetSpellInfo(), false) != SPELL_MISS_NONE)
532 return;
533
534 // some auras remove at specific health level or more
536 {
537 switch (GetSpellInfo()->Id)
538 {
539 case 43093: case 31956: case 38801: // Grievous Wound
540 case 35321: case 38363: case 39215: // Gushing Wound
541 if (target->IsFullHealth())
542 {
544 target->RemoveAurasDueToSpell(GetSpellInfo()->Id);
545 return;
546 }
547 break;
548 case 38772: // Grievous Wound
549 {
550 uint32 percent = GetSpellInfo()->Effects[EFFECT_1].CalcValue(caster);
551 if (!target->HealthBelowPct(percent))
552 {
554 target->RemoveAurasDueToSpell(GetSpellInfo()->Id);
555 return;
556 }
557 break;
558 }
559 }
560 }
561
562 uint32 absorb = 0;
563 uint32 resist = 0;
565
566 // ignore non positive values (can be result apply spellmods to aura damage
567 uint32 damage = std::max(GetAmount(), 0);
568
569 // Script Hook For HandlePeriodicDamageAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
570 sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage);
571
573 {
574 damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
575 damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
576
577 // Calculate armor mitigation
579 {
580 uint32 damageReductedArmor = caster->CalcArmorReducedDamage(target, damage, GetSpellInfo());
581 cleanDamage.mitigated_damage += damage - damageReductedArmor;
582 damage = damageReductedArmor;
583 }
584
585 // Curse of Agony damage-per-tick calculation
586 if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellInfo()->SpellFamilyFlags[0] & 0x400) && GetSpellInfo()->SpellIconID == 544)
587 {
588 uint32 totalTick = GetTotalTicks();
589 // 1..4 ticks, 1/2 from normal tick damage
590 if (m_tickNumber <= totalTick / 3)
591 damage = damage / 2;
592 // 9..12 ticks, 3/2 from normal tick damage
593 else if (m_tickNumber > totalTick * 2 / 3)
594 damage += (damage + 1) / 2; // +1 prevent 0.5 damage possible lost at 1..4 ticks
595 // 5..8 ticks have normal tick damage
596 }
597 // There is a Chance to make a Soul Shard when Drain soul does damage
598 if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellInfo()->SpellFamilyFlags[0] & 0x00004000))
599 {
600 if (caster->GetTypeId() == TypeID::TYPEID_PLAYER && caster->ToPlayer()->isHonorOrXPTarget(target))
601 caster->CastSpell(caster, Skyfire::Spells::GetDrainSoulShardSpellId(), true, 0, this);
602 }
603 if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_GENERIC)
604 {
605 switch (GetId())
606 {
607 case 70911: // Unbound Plague
608 case 72854: // Unbound Plague
609 case 72855: // Unbound Plague
610 case 72856: // Unbound Plague
612 damage *= uint32(pow(1.25f, int32(m_tickNumber)));
613 break;
614 default:
615 break;
616 }
617 }
618 }
619 else
620 damage = uint32(target->CountPctFromMaxHealth(damage));
621
622 bool crit = IsPeriodicTickCrit(target, caster);
623 if (crit)
624 damage = caster->SpellCriticalDamageBonus(m_spellInfo, damage, target);
625
626 int32 dmg = damage;
627 caster->ApplyResilience(target, &dmg, crit);
628 damage = dmg;
629
630 caster->CalcAbsorbResist(target, GetSpellInfo()->GetSchoolMask(), DOT, damage, &absorb, &resist, GetSpellInfo());
631
632 SF_LOG_INFO("spells", "PeriodicTick: %u (TypeId: %u) attacked %u (TypeId: %u) for %u dmg inflicted by %u abs is %u",
633 GUID_LOPART(GetCasterGUID()), uint8(GuidHigh2TypeId(GUID_HIPART(GetCasterGUID()))), target->GetGUIDLow(), uint8(target->GetTypeId()), damage, GetId(), absorb);
634
635 caster->DealDamageMods(target, damage, &absorb);
636
637 // Set trigger flag
638 uint32 procAttacker = PROC_FLAG_DONE_PERIODIC;
639 uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC;
641 damage = (damage <= absorb + resist) ? 0 : (damage - absorb - resist);
642 if (damage)
643 procVictim |= PROC_FLAG_TAKEN_DAMAGE;
644
645 int32 overkill = damage - target->GetHealth();
646 if (overkill < 0)
647 overkill = 0;
648
649 SpellPeriodicAuraLogInfo pInfo(this, damage, overkill, absorb, resist, GetSpellInfo()->GetSchoolMask(), 0.0f, crit);
650 target->SendPeriodicAuraLog(&pInfo);
651
652 caster->ProcDamageAndSpell(target, procAttacker, procVictim, procEx, damage, WeaponAttackType::BASE_ATTACK, GetSpellInfo());
653
654 caster->DealDamage(target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true);
655}
656
658{
659 if (!caster || !target->IsAlive())
660 return;
661
663 {
664 SendTickImmune(target, caster);
665 return;
666 }
667
668 if (GetSpellInfo()->Effects[GetEffIndex()].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA &&
669 caster->SpellHitResult(target, GetSpellInfo(), false) != SPELL_MISS_NONE)
670 return;
671
672 uint32 absorb = 0;
673 uint32 resist = 0;
675
676 uint32 damage = std::max(GetAmount(), 0);
677
678 damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
679 damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
680
681 bool crit = IsPeriodicTickCrit(target, caster);
682 if (crit)
683 damage = caster->SpellCriticalDamageBonus(m_spellInfo, damage, target);
684
685 // Calculate armor mitigation
687 {
688 uint32 damageReductedArmor = caster->CalcArmorReducedDamage(target, damage, GetSpellInfo());
689 cleanDamage.mitigated_damage += damage - damageReductedArmor;
690 damage = damageReductedArmor;
691 }
692
693 int32 dmg = damage;
694 caster->ApplyResilience(target, &dmg, crit);
695 damage = dmg;
696
697 caster->CalcAbsorbResist(target, GetSpellInfo()->GetSchoolMask(), DOT, damage, &absorb, &resist, m_spellInfo);
698
699 if (target->GetHealth() < damage)
700 damage = uint32(target->GetHealth());
701
702 SF_LOG_INFO("spells", "PeriodicTick: %u (TypeId: %u) health leech of %u (TypeId: %u) for %u dmg inflicted by %u abs is %u",
703 GUID_LOPART(GetCasterGUID()), uint8(GuidHigh2TypeId(GUID_HIPART(GetCasterGUID()))), target->GetGUIDLow(), uint8(target->GetTypeId()), damage, GetId(), absorb);
704
705 caster->SendSpellNonMeleeDamageLog(target, GetId(), damage, GetSpellInfo()->GetSchoolMask(), absorb, resist, false, 0, crit);
706
707 // Set trigger flag
708 uint32 procAttacker = PROC_FLAG_DONE_PERIODIC;
709 uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC;
711 damage = (damage <= absorb + resist) ? 0 : (damage - absorb - resist);
712 if (damage)
713 procVictim |= PROC_FLAG_TAKEN_DAMAGE;
714 if (caster->IsAlive())
715 caster->ProcDamageAndSpell(target, procAttacker, procVictim, procEx, damage, WeaponAttackType::BASE_ATTACK, GetSpellInfo());
716 int32 new_damage = caster->DealDamage(target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), false);
717 if (caster->IsAlive())
718 {
719 float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster);
720
721 uint32 heal = uint32(caster->SpellHealingBonusDone(caster, GetSpellInfo(), uint32(new_damage * gainMultiplier), DOT, GetBase()->GetStackAmount()));
722 heal = uint32(caster->SpellHealingBonusTaken(caster, GetSpellInfo(), heal, DOT, GetBase()->GetStackAmount()));
723
724 int32 gain = caster->HealBySpell(caster, GetSpellInfo(), heal);
725 caster->getHostileRefManager().threatAssist(caster, gain * 0.5f, GetSpellInfo());
726 }
727}
728
730{
731 if (!caster || !caster->IsAlive() || !target->IsAlive())
732 return;
733
735 {
736 SendTickImmune(target, caster);
737 return;
738 }
739
740 uint32 damage = std::max(GetAmount(), 0);
741 // do not kill health donator
742 if (caster->GetHealth() < damage)
743 damage = caster->GetHealth() - 1;
744 if (!damage)
745 return;
746
747 caster->ModifyHealth(-(int32)damage);
748 SF_LOG_DEBUG("spells", "PeriodicTick: donator %u target %u damage %u.", caster->GetEntry(), target->GetEntry(), damage);
749
750 float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster);
751
752 damage = int32(damage * gainMultiplier);
753
754 caster->HealBySpell(target, GetSpellInfo(), damage);
755}
756
758{
759 if (!caster || !target->IsAlive())
760 return;
761
763 {
764 SendTickImmune(target, caster);
765 return;
766 }
767
768 // heal for caster damage (must be alive)
769 if (target != caster && GetSpellInfo()->AttributesEx2 & SPELL_ATTR2_HEALTH_FUNNEL && !caster->IsAlive())
770 return;
771
772 // don't regen when permanent aura target has full power
773 if (GetBase()->IsPermanent() && target->IsFullHealth())
774 return;
775
776 // ignore negative values (can be result apply spellmods to aura damage
777 int32 damage = std::max(m_amount, 0);
778
780 {
781 // Taken mods
782 float TakenTotalMod = 1.0f;
783
784 // Tenacity increase healing % taken
785 if (AuraEffect const* Tenacity = target->GetAuraEffect(Skyfire::Spells::GetTenacityAuraSpellId(), 0))
786 AddPct(TakenTotalMod, Tenacity->GetAmount());
787
788 // Healing taken percent
789 float minval = (float)target->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
790 if (minval)
791 AddPct(TakenTotalMod, minval);
792
793 float maxval = (float)target->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
794 if (maxval)
795 AddPct(TakenTotalMod, maxval);
796
797 TakenTotalMod = std::max(TakenTotalMod, 0.0f);
798
799 damage = uint32(target->CountPctFromMaxHealth(damage));
800 damage = uint32(damage * TakenTotalMod);
801 }
802 else
803 {
804 // Wild Growth = amount + (6 - 2*doneTicks) * ticks* amount / 100
805 if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellIconID == 2864)
806 {
807 int32 addition = int32(float(damage * GetTotalTicks()) * ((6 - float(2 * (GetTickNumber() - 1))) / 100));
808
809 // Item - Druid T10 Restoration 2P Bonus
811 // divided by 50 instead of 100 because calculated as for every 2 tick
812 addition += abs(int32((addition * aurEff->GetAmount()) / 50));
813
814 damage += addition;
815 }
816
817 damage = caster->SpellHealingBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
818 damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
819 }
820
821 bool crit = IsPeriodicTickCrit(target, caster);
822 if (crit)
823 damage = caster->SpellCriticalHealingBonus(m_spellInfo, damage, target);
824
825 SF_LOG_INFO("spells", "PeriodicTick: %u (TypeId: %u) heal of %u (TypeId: %u) for %u health inflicted by %u",
827
828 uint32 absorb = 0;
829 uint32 heal = uint32(damage);
830 caster->CalcHealAbsorb(target, GetSpellInfo(), heal, absorb);
831 int32 gain = caster->DealHeal(target, heal);
832
833 SpellPeriodicAuraLogInfo pInfo(this, heal, heal - gain, absorb, 0, GetSpellInfo()->GetSchoolMask(), 0.0f, crit);
834 target->SendPeriodicAuraLog(&pInfo);
835
836 target->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, GetSpellInfo());
837
838 bool haveCastItem = GetBase()->GetCastItemGUID() != 0;
839
840 // Health Funnel
841 // damage caster for heal amount
842 if (target != caster && GetSpellInfo()->AttributesEx2 & SPELL_ATTR2_HEALTH_FUNNEL && GetSpellInfo()->Id != 755)
843 {
844 uint32 funnelDamage = gain;
845 uint32 funnelAbsorb = 0;
846 caster->DealDamageMods(caster, funnelDamage, &funnelAbsorb);
847 caster->SendSpellNonMeleeDamageLog(caster, GetId(), funnelDamage, GetSpellInfo()->GetSchoolMask(), funnelAbsorb, 0, false, 0, false);
848
850 caster->DealDamage(caster, funnelDamage, &cleanDamage, NODAMAGE, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true);
851 }
852
853 uint32 procAttacker = PROC_FLAG_DONE_PERIODIC;
854 uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC;
856 // ignore item heals
857 if (!haveCastItem)
858 caster->ProcDamageAndSpell(target, procAttacker, procVictim, procEx, damage, WeaponAttackType::BASE_ATTACK, GetSpellInfo());
859}
860
862{
863 Powers powerType = Powers(GetMiscValue());
864
865 if (!caster || !caster->IsAlive() || !target->IsAlive() || target->getPowerType() != powerType)
866 return;
867
869 {
870 SendTickImmune(target, caster);
871 return;
872 }
873
874 if (GetSpellInfo()->Effects[GetEffIndex()].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA &&
875 caster->SpellHitResult(target, GetSpellInfo(), false) != SPELL_MISS_NONE)
876 return;
877
878 // ignore negative values (can be result apply spellmods to aura damage
879 int32 drainAmount = std::max(m_amount, 0);
880
881 SF_LOG_INFO("spells", "PeriodicTick: %u (TypeId: %u) power leech of %u (TypeId: %u) for %u dmg inflicted by %u",
883
884 int32 drainedAmount = -target->ModifyPower(powerType, -drainAmount);
885
886 float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster);
887
888 SpellPeriodicAuraLogInfo pInfo(this, drainedAmount, 0, 0, 0, GetMiscValue(), gainMultiplier, false);
889 target->SendPeriodicAuraLog(&pInfo);
890
891 int32 gainAmount = int32(drainedAmount * gainMultiplier);
892 int32 gainedAmount = 0;
893 if (gainAmount)
894 {
895 gainedAmount = caster->ModifyPower(powerType, gainAmount);
896 target->AddThreat(caster, float(gainedAmount) * 0.5f, GetSpellInfo()->GetSchoolMask(), GetSpellInfo());
897 }
898
899 // Drain Mana
900 if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK
901 && m_spellInfo->SpellFamilyFlags[0] & 0x00000010)
902 {
903 int32 manaFeedVal = 0;
904 if (AuraEffect const* aurEff = GetBase()->GetEffect(1))
905 manaFeedVal = aurEff->GetAmount();
906 // Mana Feed - Drain Mana
907 if (manaFeedVal > 0)
908 {
909 int32 feedAmount = CalculatePct(gainedAmount, manaFeedVal);
910 caster->CastCustomSpell(caster, Skyfire::Spells::GetManaFeedTriggerSpellId(), &feedAmount, NULL, NULL, true, NULL, this);
911 }
912 }
913}
914
916{
917 Powers powerType;
918 if (GetMiscValue() == POWER_ALL)
919 powerType = target->getPowerType();
920 else
921 powerType = Powers(GetMiscValue());
922
923 if (!target->IsAlive() || !target->GetMaxPower(powerType))
924 return;
925
927 {
928 SendTickImmune(target, caster);
929 return;
930 }
931
932 // don't regen when permanent aura target has full power
933 if (GetBase()->IsPermanent() && target->GetPower(powerType) == target->GetMaxPower(powerType))
934 return;
935
936 // ignore negative values (can be result apply spellmods to aura damage
937 uint32 amount = std::max(m_amount, 0) * target->GetMaxPower(powerType) / 100;
938 SF_LOG_INFO("spells", "PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u",
940
941 SpellPeriodicAuraLogInfo pInfo(this, amount, 0, 0, 0, GetMiscValue(), 0.0f, false);
942 target->SendPeriodicAuraLog(&pInfo);
943
944 int32 gain = target->ModifyPower(powerType, amount);
945
946 if (caster)
947 target->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, GetSpellInfo());
948}
949
951{
952 Powers powerType = Powers(GetMiscValue());
953
954 if (!target->IsAlive() || !target->GetMaxPower(powerType))
955 return;
956
958 {
959 SendTickImmune(target, caster);
960 return;
961 }
962
963 // don't regen when permanent aura target has full power
964 if (GetBase()->IsPermanent() && target->GetPower(powerType) == target->GetMaxPower(powerType))
965 return;
966
967 // ignore negative values (can be result apply spellmods to aura damage
968 int32 amount = std::max(m_amount, 0);
969
970 SpellPeriodicAuraLogInfo pInfo(this, amount, 0, 0, 0, GetMiscValue(), 0.0f, false);
971 target->SendPeriodicAuraLog(&pInfo);
972
973 SF_LOG_INFO("spells", "PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u",
975
976 int32 gain = target->ModifyPower(powerType, amount);
977
978 if (caster)
979 target->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, GetSpellInfo());
980}
981
983{
984 Powers powerType = Powers(GetMiscValue());
985
986 if (!caster || !target->IsAlive() || target->getPowerType() != powerType)
987 return;
988
990 {
991 SendTickImmune(target, caster);
992 return;
993 }
994
995 // ignore negative values (can be result apply spellmods to aura damage
996 int32 damage = std::max(m_amount, 0);
997
998 uint32 gain = uint32(-target->ModifyPower(powerType, -damage));
999
1000 float dmgMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster);
1001
1002 SpellInfo const* spellProto = GetSpellInfo();
1003 // maybe has to be sent different to client, but not by SMSG_SPELL_PERIODIC_AURA_LOG
1004 SpellNonMeleeDamage damageInfo(caster, target, spellProto->Id, spellProto->SchoolMask);
1005 // no SpellDamageBonus for burn mana
1006 caster->CalculateSpellDamageTaken(&damageInfo, int32(gain * dmgMultiplier), spellProto);
1007
1008 caster->DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb);
1009
1010 caster->SendSpellNonMeleeDamageLog(&damageInfo);
1011
1012 // Set trigger flag
1013 uint32 procAttacker = PROC_FLAG_DONE_PERIODIC;
1014 uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC;
1016 if (damageInfo.damage)
1017 procVictim |= PROC_FLAG_TAKEN_DAMAGE;
1018
1019 caster->ProcDamageAndSpell(damageInfo.target, procAttacker, procVictim, procEx, damageInfo.damage, WeaponAttackType::BASE_ATTACK, spellProto);
1020
1021 caster->DealSpellDamage(&damageInfo, true);
1022}
std::int32_t int32
Definition Define.h:73
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
TypeMapContainer< AllWorldObjectTypes > WorldTypeMapContainer
Definition GridDefines.h:72
TypeMapContainer< AllGridObjectTypes > GridTypeMapContainer
Definition GridDefines.h:71
CoordPair< TOTAL_NUMBER_OF_CELLS_PER_MAP > CellCoord
#define SF_LOG_DEBUG(filterType__,...)
Definition Log.h:134
#define SF_LOG_INFO(filterType__,...)
Definition Log.h:137
LootStore LootTemplates_Skinning("skinning_loot_template", "creature skinning id", true)
TypeID GuidHigh2TypeId(uint32 guid_hi)
Definition Object.cpp:44
@ TYPEID_PLAYER
Definition Object.h:55
@ TYPEID_UNIT
Definition Object.h:54
@ TEMPSUMMON_DEAD_DESPAWN
Definition Object.h:74
uint32 GUID_LOPART(uint64 x)
uint32 GUID_HIPART(uint64 guid)
#define sScriptMgr
Definition ScriptMgr.h:764
SpellEffIndex
@ EFFECT_1
Powers
@ POWER_RAGE
@ POWER_ALL
@ POWER_MANA
@ SPELL_EFFECT_PERSISTENT_AREA_AURA
@ SPELL_ATTR2_HEALTH_FUNNEL
@ CREATURE_TYPE_GAS_CLOUD
@ CLASS_DEATH_KNIGHT
@ SPELLFAMILY_WARLOCK
@ SPELLFAMILY_MAGE
@ SPELLFAMILY_GENERIC
@ SPELLFAMILY_HUNTER
@ SPELLFAMILY_ROGUE
@ SPELLFAMILY_SHAMAN
@ SPELLFAMILY_DRUID
@ SPELLFAMILY_DEATHKNIGHT
@ SPELL_MISS_NONE
@ SPELL_SCHOOL_MASK_NORMAL
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_OBS_MOD_HEALTH
@ SPELL_AURA_PROC_TRIGGER_SPELL
@ SPELL_AURA_MOD_HEALING_PCT
#define sSpellMgr
Definition SpellMgr.h:744
@ PROC_EX_INTERNAL_DOT
Definition SpellMgr.h:207
@ PROC_EX_CRITICAL_HIT
Definition SpellMgr.h:186
@ PROC_EX_NORMAL_HIT
Definition SpellMgr.h:185
@ PROC_EX_INTERNAL_HOT
Definition SpellMgr.h:208
@ PROC_FLAG_DONE_PERIODIC
Definition SpellMgr.h:125
@ PROC_FLAG_TAKEN_PERIODIC
Definition SpellMgr.h:126
@ PROC_FLAG_TAKEN_DAMAGE
Definition SpellMgr.h:128
@ SPELLVALUE_RADIUS_MOD
Definition Unit.h:117
@ SPELLVALUE_MAX_TARGETS
Definition Unit.h:118
@ SPELLVALUE_BASE_POINT0
Definition Unit.h:114
#define SUMMON_SLOT_TOTEM
Definition Unit.h:1340
#define MAX_TOTEM_SLOT
Definition Unit.h:1341
@ MELEE_HIT_NORMAL
Definition Unit.h:830
std::list< Unit * > UnitList
Definition Unit.h:370
@ UNIT_STATE_ISOLATED
Definition Unit.h:525
uint32 createProcExtendMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missCondition)
@ NODAMAGE
Definition Unit.h:618
@ DOT
Definition Unit.h:616
T AddPct(T &base, U pct)
Definition Util.h:109
T CalculatePct(T base, U pct)
Definition Util.h:103
uint32 GetTickNumber() const
void HandlePeriodicPowerBurnAuraTick(Unit *target, Unit *caster) const
SpellInfo const * GetSpellInfo() const
AuraType GetAuraType() const
void HandlePeriodicManaLeechAuraTick(Unit *target, Unit *caster) const
void HandleObsModPowerAuraTick(Unit *target, Unit *caster) const
uint8 const m_effIndex
void HandlePeriodicHealthFunnelAuraTick(Unit *target, Unit *caster) const
void HandlePeriodicHealAurasTick(Unit *target, Unit *caster) const
void HandlePeriodicEnergizeAuraTick(Unit *target, Unit *caster) const
void HandlePeriodicTriggerSpellAuraTick(Unit *target, Unit *caster) const
bool IsPeriodicTickCrit(Unit *target, Unit const *caster) const
void HandlePeriodicDummyAuraTick(Unit *target, Unit *caster) const
uint32 GetId() const
int32 GetTotalTicks() const
void HandlePeriodicHealthLeechAuraTick(Unit *target, Unit *caster) const
AuraEffect(Aura *base, uint8 effIndex, int32 *baseAmount, Unit *caster)
void HandlePeriodicDamageAurasTick(Unit *target, Unit *caster) const
void SendTickImmune(Unit *target, Unit *caster) const
int32 GetMiscValue() const
Aura * GetBase() const
uint32 GetEffIndex() const
uint32 m_tickNumber
SpellInfo const *const m_spellInfo
uint64 GetCasterGUID() const
void HandlePeriodicTriggerSpellWithValueAuraTick(Unit *target, Unit *caster) const
int32 GetAmount() const
uint64 GetCastItemGUID() const
Definition SpellAuras.h:90
Unit * GetCaster() const
void DespawnOrUnsummon(uint32 msTimeToDespawn=0)
CreatureTemplate const * GetCreatureTemplate() const
Definition Creature.h:524
CreatureAI * AI() const
Definition Creature.h:483
void threatAssist(Unit *victim, float baseThreat, SpellInfo const *threatSpell=NULL)
bool IsDungeon() const
Definition Map.h:369
bool IsHeroic() const
Definition Map.cpp:3044
uint64 GetGUID() const
Definition Object.h:119
Player * ToPlayer()
Definition Object.h:204
uint32 GetGUIDLow() const
Definition Object.h:120
TypeID GetTypeId() const
Definition Object.h:131
uint32 GetEntry() const
Definition Object.h:125
Creature * ToCreature()
Definition Object.h:207
void AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const &store, bool broadcast=false)
Definition Player.cpp:20654
void RemoveRunesByAuraEffect(AuraEffect const *aura)
Definition Player.cpp:20552
bool isHonorOrXPTarget(Unit const *victim)
Definition Player.cpp:19697
float CalcValueMultiplier(Unit *caster, Spell *spell=NULL) const
uint32 TriggerSpell
Definition SpellInfo.h:108
int32 CalcValue(Unit const *caster=NULL, int32 const *basePoints=NULL, Unit const *target=NULL) const
SpellEffectInfo Effects[MAX_SPELL_EFFECTS]
Definition SpellInfo.h:255
uint32 Id
Definition SpellInfo.h:160
bool NeedsToBeTriggeredByCaster(SpellInfo const *triggeringSpell) const
uint32 SchoolMask
Definition SpellInfo.h:231
float GetMaxRange(bool positive=false, Unit *caster=NULL, Spell *spell=NULL) const
uint32 SpellFamilyName
Definition SpellInfo.h:226
virtual bool sOnDummyEffect(Unit *, uint32, SpellEffIndex)
Definition UnitAI.h:253
Definition Unit.h:1367
int32 ModifyHealth(int32 val)
Definition Unit.cpp:4023
void ApplyResilience(Unit const *victim, int32 *damage, bool isCrit) const
Definition Unit.cpp:7395
uint32 SpellCriticalDamageBonus(SpellInfo const *spellProto, uint32 damage, Unit *victim)
Definition Unit.cpp:3316
int32 CalculateSpellDamage(Unit const *target, SpellInfo const *spellProto, uint8 effect_index, int32 const *basePoints=NULL) const
Definition Unit.cpp:4709
void Kill(Unit *victim, bool durabilityLoss=true)
Definition Unit.cpp:6342
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
void SetPower(Powers power, int32 val)
Definition Unit.cpp:5255
void RemoveAurasDueToSpell(uint32 spellId, uint64 casterGUID=0, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=NULL)
Definition Unit.cpp:4463
uint32 SpellCriticalHealingBonus(SpellInfo const *spellProto, uint32 damage, Unit *victim)
Definition Unit.cpp:3353
uint32 SpellHealingBonusDone(Unit *victim, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack=1) const
Aura * GetAura(uint32 spellId, uint64 casterGUID=0, uint64 itemCasterGUID=0, uint32 reqEffMask=0) const
void DealDamageMods(Unit *victim, uint32 &damage, uint32 *absorb)
Unit * GetVehicleBase() const
Definition Unit.cpp:7203
static bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const *spellInfo=NULL, uint8 effIndex=MAX_SPELL_EFFECTS)
uint64 m_SummonSlot[MAX_SUMMON_SLOT]
Definition Unit.h:2374
uint32 GetMaxHealth() const
Definition Unit.h:1604
bool IsFullHealth() const
Definition Unit.h:1609
uint32 CalcArmorReducedDamage(Unit *victim, const uint32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=WeaponAttackType::MAX_ATTACK)
uint8 getClass() const
Definition Unit.h:1543
bool IsAlive() const
Definition Unit.h:2032
int32 GetMaxPower(Powers power) const
Definition Unit.cpp:5246
void DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss)
int32 ModifyPower(Powers power, int32 val)
Definition Unit.cpp:4081
int32 HealBySpell(Unit *victim, SpellInfo const *spellInfo, uint32 addHealth, bool critical=false)
Definition Unit.cpp:2963
uint32 SpellHealingBonusTaken(Unit *caster, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack=1) const
int32 DealHeal(Unit *victim, uint32 addhealth)
Definition Unit.cpp:2687
void CalcAbsorbResist(Unit *victim, SpellSchoolMask schoolMask, DamageEffectType damagetype, uint32 const damage, uint32 *absorb, uint32 *resist, SpellInfo const *spellInfo=NULL)
void EnergizeBySpell(Unit *victim, uint32 SpellID, int32 Damage, Powers powertype)
Definition Unit.cpp:3045
uint32 DealDamage(Unit *victim, uint32 damage, CleanDamage const *cleanDamage=NULL, DamageEffectType damagetype=DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *spellProto=NULL, bool durabilityLoss=true)
bool HealthBelowPct(int32 pct) const
Definition Unit.h:1613
void CalcHealAbsorb(Unit *victim, SpellInfo const *spellInfo, uint32 &healAmount, uint32 &absorb)
uint32 GetHealth() const
Definition Unit.h:1600
int32 GetMaxPositiveAuraModifier(AuraType auratype) const
uint32 SpellDamageBonusDone(Unit *victim, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack=1) const
HostileRefManager & getHostileRefManager()
Definition Unit.h:2466
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, uint64 casterGUID=0) const
int32 GetPower(Powers power) const
Definition Unit.cpp:5237
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage *log)
Definition Unit.cpp:1766
bool IsImmunedToDamage(SpellSchoolMask meleeSchoolMask) const
Definition Unit.cpp:3415
bool HasUnitState(const uint32 f) const
Definition Unit.h:1485
void CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
int32 GetMaxNegativeAuraModifier(AuraType auratype) const
uint32 SpellDamageBonusTaken(Unit *caster, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack=1) const
void CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=WeaponAttackType::BASE_ATTACK, bool crit=false)
void SendPeriodicAuraLog(SpellPeriodicAuraLogInfo *pInfo)
Definition Unit.cpp:1838
uint32 CountPctFromMaxHealth(int32 pct) const
Definition Unit.h:1633
void SendEnergizeSpellLog(Unit *victim, uint32 spellID, int32 damage, Powers powertype)
Definition Unit.cpp:2974
void RemoveAllAuras()
Powers getPowerType() const
Definition Unit.h:1651
AuraApplicationMap & GetAppliedAuras()
Definition Unit.h:2204
void ProcDamageAndSpell(Unit *victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType=WeaponAttackType::BASE_ATTACK, SpellInfo const *procSpell=NULL, SpellInfo const *procAura=NULL)
Definition UnitProc.cpp:53
SpellMissInfo SpellHitResult(Unit *victim, SpellInfo const *spellInfo, bool canReflect=false)
Definition Unit.cpp:1007
Map * GetMap() const
Definition Object.h:740
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2801
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TempSummonType::TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition Object.cpp:2703
C::value_type const & SelectRandomContainerElement(C const &container)
Definition Containers.h:48
bool IsFullHealthRemovePeriodicDamageAura(uint32 auraSpellId)
uint32 GetWildGrowthTier10AuraSpellId()
uint32 GetDrainSoulShardSpellId()
bool IsUnboundPlaguePeriodicDamageAura(uint32 auraSpellId)
uint32 GetPeriodicOverloadCircuitShutdownSpellId(uint32 auraSpellId)
bool IsPctHealthRemovePeriodicDamageAura(uint32 auraSpellId)
uint32 GetPeriodicFrenziedRegenerationSpellId()
uint32 GetSpellclothSummonCreatureEntry()
uint32 GetAbsorbEyeOfGrillokCasterSpellId()
PeriodicBulletControllerRule const * GetPeriodicBulletControllerRule(uint32 auraSpellId)
uint32 GetPeriodicFrostBlastTriggerSpellId()
uint32 GetPeriodicFuseArmorTriggerSpellId(uint32 auraSpellId)
uint32 GetPeriodicDoomTriggerSpellId()
uint32 GetTotemicMasteryTriggerSpellId()
uint32 GetPeriodicRestorationEnergizeSpellId()
bool IsReagentConsumingPeriodicTriggerAura(uint32 auraSpellId)
uint32 GetPeriodicExplosiveShotTriggerSpellId()
uint32 GetPeriodicDeathAndDecayTriggerSpellId()
uint32 GetKillingSpreePeriodicSpellId(uint8 index)
uint32 GetPeriodicTriggerOverrideSpellId(uint32 auraSpellId)
uint32 GetManaFeedTriggerSpellId()
CellCoord ComputeCellCoord(float x, float y)
Definition Cell.h:37
void Visit(CellCoord const &, TypeContainerVisitor< T, CONTAINER > &visitor, Map &, WorldObject const &, float) const
Definition CellImpl.h:109
uint32 mitigated_damage
Definition Unit.h:869
uint32 SkinLootId
Definition Creature.h:109
float GetOrientation() const
Definition Object.h:331
float GetPositionX() const
Definition Object.h:328
float GetPositionY() const
Definition Object.h:329