443 {
446 {
450 for (Unit::AuraApplicationMap::iterator i = Auras.begin(); i != Auras.end(); ++i)
451 {
452 Aura* aura = i->second->GetBase();
454 continue;
455
456
458 if (!(familyFlag[1] & 0x00000080 || familyFlag[0] & 0x0000C000))
459 continue;
461 {
462
463 if (familyFlag[0] & 0x4000)
464 {
465 int32 TickCount = aurEff->GetTotalTicks();
467 basePoint = aurEff->GetAmount();
468 ApplyPct(basePoint, TickCount * 40);
470 }
471
472 else if (familyFlag[1] & 0x00000080)
473 {
476
477
479 int32 casterBasePoint = aurEff->GetAmount() * unitTarget->GetMaxPower(
POWER_MANA) / 50;
480 if (basePoint > casterBasePoint)
481 basePoint = casterBasePoint;
482 ApplyPct(basePoint, TickCount * 60);
483 }
484
485 else if (familyFlag[0] & 0x00008000)
486 {
488 {
490 break;
491
493 }
494
496 }
497
498
500 aurEff->ChangeAmount(aurEff->CalculateAmount(caster), false);
501 }
502 break;
503 }
504
505 if (spellId)
507 }
508 }
T ApplyPct(T &base, U pct)
Definition: Util.h:73
T CalculatePct(T base, U pct)
Definition: Util.h:61
std::int32_t int32
Definition: Define.h:103
std::uint32_t uint32
Definition: Define.h:107
@ SPELL_HUNTER_CHIMERA_SHOT_SCORPID
Definition: spell_hunter.cpp:53
@ SPELL_HUNTER_CHIMERA_SHOT_VIPER
Definition: spell_hunter.cpp:52
@ SPELL_HUNTER_CHIMERA_SHOT_SERPENT
Definition: spell_hunter.cpp:51
@ POWER_MANA
Definition: SharedDefines.h:269
@ DOT
Definition: Unit.h:250
Player * ToPlayer()
Definition: Object.h:201
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
bool HasSpellCooldown(uint32 spell_id) const override
Definition: Player.cpp:16364
void AddSpellCooldown(uint32 spell_id, uint32 itemid, uint32 end_time, bool needSendToClient=false, bool forceSendToSpectator=false) override
Definition: Player.cpp:11120
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Definition: Unit.h:639
SpellCastResult CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1224
Definition: SpellAuraEffects.h:39
int32 GetTotalTicks() const
Definition: SpellAuraEffects.cpp:7370
Definition: SpellAuras.h:87
void RefreshDuration(bool withMods=false)
Definition: SpellAuras.cpp:880
ObjectGuid GetCasterGUID() const
Definition: SpellAuras.h:105
AuraEffect * GetEffect(uint8 effIndex) const
Definition: SpellAuras.h:175
uint8 GetStackAmount() const
Definition: SpellAuras.h:148
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:100
flag96 SpellFamilyFlags
Definition: SpellInfo.h:388
Unit * GetHitUnit()
Definition: SpellScript.cpp:448
Unit * GetCaster()
Definition: SpellScript.cpp:401