51 if (!bulletController)
55 std::rand() % bulletController->
MaxTargetRoll + 1, target,
true);
57 std::rand() % bulletController->
MaxTargetRoll + 1, target,
true);
68 target->
CastSpell(target, shutdownSpellId,
true);
70 veh->CastSpell(target, shutdownSpellId,
true);
106 int32 mod = (rage < 100) ? rage : 100;
110 ®en, 0, 0,
true, 0,
this);
139 cell.
Visit(p, grid_object_checker, *
GetBase()->GetOwner()->GetMap(), *target, radius);
140 cell.
Visit(p, world_object_checker, *
GetBase()->GetOwner()->GetMap(), *target, radius);
180 &
m_amount, NULL, NULL,
true, 0,
this);
212 if (triggeredSpellInfo == NULL)
297 target->
Kill(target);
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);
404 Unit* permafrostCaster = NULL;
407 permafrostAura = target->
GetAura(67855);
409 permafrostAura = target->
GetAura(67856);
411 permafrostAura = target->
GetAura(67857);
414 permafrostCaster = permafrostAura->
GetCaster();
416 if (permafrostCaster)
419 permafrostCasterCreature->DespawnOrUnsummon(3000);
424 targetCreature->DisappearAndDie();
448 caster->
CastSpell(target, triggerSpellId,
true, NULL, NULL, caster->
GetGUID());
470 caster->
CastSpell(target, triggerSpellId,
false);
476 caster->
CastSpell(target, triggerSpellId,
false);
483 triggeredSpellInfo =
sSpellMgr->GetSpellInfo(triggerSpellId);
485 if (triggeredSpellInfo)
489 triggerCaster->CastSpell(target, triggeredSpellInfo,
true, NULL,
this);
490 SF_LOG_DEBUG(
"spells",
"AuraEffect::HandlePeriodicTriggerSpellAuraTick: Spell %u Trigger %u",
GetId(), triggeredSpellInfo->
Id);
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());
507 if (
Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(
m_spellInfo) ? caster : target)
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);
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());
520 if (!caster || !target->
IsAlive())
539 case 43093:
case 31956:
case 38801:
540 case 35321:
case 38363:
case 39215:
570 sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage);
582 damage = damageReductedArmor;
594 damage += (damage + 1) / 2;
632 SF_LOG_INFO(
"spells",
"PeriodicTick: %u (TypeId: %u) attacked %u (TypeId: %u) for %u dmg inflicted by %u abs is %u",
641 damage = (damage <= absorb + resist) ? 0 : (damage - absorb - resist);
659 if (!caster || !target->
IsAlive())
690 damage = damageReductedArmor;
702 SF_LOG_INFO(
"spells",
"PeriodicTick: %u (TypeId: %u) health leech of %u (TypeId: %u) for %u dmg inflicted by %u abs is %u",
711 damage = (damage <= absorb + resist) ? 0 : (damage - absorb - resist);
752 damage =
int32(damage * gainMultiplier);
759 if (!caster || !target->
IsAlive())
782 float TakenTotalMod = 1.0f;
786 AddPct(TakenTotalMod, Tenacity->GetAmount());
791 AddPct(TakenTotalMod, minval);
795 AddPct(TakenTotalMod, maxval);
797 TakenTotalMod = std::max(TakenTotalMod, 0.0f);
800 damage =
uint32(damage * TakenTotalMod);
812 addition += abs(
int32((addition * aurEff->GetAmount()) / 50));
825 SF_LOG_INFO(
"spells",
"PeriodicTick: %u (TypeId: %u) heal of %u (TypeId: %u) for %u health inflicted by %u",
844 uint32 funnelDamage = gain;
881 SF_LOG_INFO(
"spells",
"PeriodicTick: %u (TypeId: %u) power leech of %u (TypeId: %u) for %u dmg inflicted by %u",
891 int32 gainAmount =
int32(drainedAmount * gainMultiplier);
892 int32 gainedAmount = 0;
895 gainedAmount = caster->
ModifyPower(powerType, gainAmount);
903 int32 manaFeedVal = 0;
905 manaFeedVal = aurEff->GetAmount();
938 SF_LOG_INFO(
"spells",
"PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u",
973 SF_LOG_INFO(
"spells",
"PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u",
TypeMapContainer< AllWorldObjectTypes > WorldTypeMapContainer
TypeMapContainer< AllGridObjectTypes > GridTypeMapContainer
CoordPair< TOTAL_NUMBER_OF_CELLS_PER_MAP > CellCoord
#define SF_LOG_DEBUG(filterType__,...)
#define SF_LOG_INFO(filterType__,...)
LootStore LootTemplates_Skinning("skinning_loot_template", "creature skinning id", true)
TypeID GuidHigh2TypeId(uint32 guid_hi)
@ TEMPSUMMON_DEAD_DESPAWN
uint32 GUID_LOPART(uint64 x)
uint32 GUID_HIPART(uint64 guid)
@ SPELL_EFFECT_PERSISTENT_AREA_AURA
@ SPELL_ATTR2_HEALTH_FUNNEL
@ CREATURE_TYPE_GAS_CLOUD
@ SPELLFAMILY_DEATHKNIGHT
@ SPELL_SCHOOL_MASK_NORMAL
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_OBS_MOD_HEALTH
@ SPELL_AURA_PROC_TRIGGER_SPELL
@ SPELL_AURA_MOD_HEALING_PCT
@ PROC_FLAG_DONE_PERIODIC
@ PROC_FLAG_TAKEN_PERIODIC
#define SUMMON_SLOT_TOTEM
std::list< Unit * > UnitList
uint32 createProcExtendMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missCondition)
T CalculatePct(T base, U pct)
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
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
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
uint32 GetEffIndex() const
SpellInfo const *const m_spellInfo
uint64 GetCasterGUID() const
void HandlePeriodicTriggerSpellWithValueAuraTick(Unit *target, Unit *caster) const
uint64 GetCastItemGUID() const
void DespawnOrUnsummon(uint32 msTimeToDespawn=0)
CreatureTemplate const * GetCreatureTemplate() const
void threatAssist(Unit *victim, float baseThreat, SpellInfo const *threatSpell=NULL)
uint32 GetGUIDLow() const
void AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const &store, bool broadcast=false)
void RemoveRunesByAuraEffect(AuraEffect const *aura)
bool isHonorOrXPTarget(Unit const *victim)
float CalcValueMultiplier(Unit *caster, Spell *spell=NULL) const
int32 CalcValue(Unit const *caster=NULL, int32 const *basePoints=NULL, Unit const *target=NULL) const
SpellEffectInfo Effects[MAX_SPELL_EFFECTS]
bool NeedsToBeTriggeredByCaster(SpellInfo const *triggeringSpell) const
float GetMaxRange(bool positive=false, Unit *caster=NULL, Spell *spell=NULL) const
virtual bool sOnDummyEffect(Unit *, uint32, SpellEffIndex)
int32 ModifyHealth(int32 val)
void ApplyResilience(Unit const *victim, int32 *damage, bool isCrit) const
uint32 SpellCriticalDamageBonus(SpellInfo const *spellProto, uint32 damage, Unit *victim)
int32 CalculateSpellDamage(Unit const *target, SpellInfo const *spellProto, uint8 effect_index, int32 const *basePoints=NULL) const
void Kill(Unit *victim, bool durabilityLoss=true)
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)
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)
uint32 SpellCriticalHealingBonus(SpellInfo const *spellProto, uint32 damage, Unit *victim)
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
static bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const *spellInfo=NULL, uint8 effIndex=MAX_SPELL_EFFECTS)
uint64 m_SummonSlot[MAX_SUMMON_SLOT]
uint32 GetMaxHealth() const
bool IsFullHealth() const
uint32 CalcArmorReducedDamage(Unit *victim, const uint32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=WeaponAttackType::MAX_ATTACK)
int32 GetMaxPower(Powers power) const
void DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss)
int32 ModifyPower(Powers power, int32 val)
int32 HealBySpell(Unit *victim, SpellInfo const *spellInfo, uint32 addHealth, bool critical=false)
uint32 SpellHealingBonusTaken(Unit *caster, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack=1) const
int32 DealHeal(Unit *victim, uint32 addhealth)
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)
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
void CalcHealAbsorb(Unit *victim, SpellInfo const *spellInfo, uint32 &healAmount, uint32 &absorb)
int32 GetMaxPositiveAuraModifier(AuraType auratype) const
uint32 SpellDamageBonusDone(Unit *victim, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack=1) const
HostileRefManager & getHostileRefManager()
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, uint64 casterGUID=0) const
int32 GetPower(Powers power) const
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage *log)
bool IsImmunedToDamage(SpellSchoolMask meleeSchoolMask) const
bool HasUnitState(const uint32 f) const
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)
uint32 CountPctFromMaxHealth(int32 pct) const
void SendEnergizeSpellLog(Unit *victim, uint32 spellID, int32 damage, Powers powertype)
Powers getPowerType() const
AuraApplicationMap & GetAppliedAuras()
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)
SpellMissInfo SpellHitResult(Unit *victim, SpellInfo const *spellInfo, bool canReflect=false)
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TempSummonType::TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
C::value_type const & SelectRandomContainerElement(C const &container)
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 GetTenacityAuraSpellId()
uint32 GetPeriodicTriggerOverrideSpellId(uint32 auraSpellId)
uint32 GetManaFeedTriggerSpellId()
CellCoord ComputeCellCoord(float x, float y)
void Visit(CellCoord const &, TypeContainerVisitor< T, CONTAINER > &visitor, Map &, WorldObject const &, float) const
float GetOrientation() const
float GetPositionX() const
float GetPositionY() const