void CalcDamage(SpellEffIndex /*effIndex*/) { if (!GetHitUnit() || !GetTargetDest()) return; float distance = GetHitUnit()->GetExactDist2d(GetTargetDest()); if (distance < 3.4f) return; SetHitDamage(int32(GetHitDamage() * 10.0f / pow(distance, 1.9f))); }
void CheckTarget(SpellEffIndex effIndex) { PreventHitDefaultEffect(EFFECT_0); if (!GetTargetDest()) return; uint32 triggered_spell_id = GetSpellInfo()->Effects[effIndex].TriggerSpell; float x, y, z; GetTargetDest()->GetPosition(x, y, z); // let Rotface handle the cast - caster dies before this executes if (InstanceScript* script = GetCaster()->GetInstanceScript()) if (Creature* rotface = script->instance->GetCreature(script->GetData64(DATA_ROTFACE))) rotface->CastSpell(x, y, z, triggered_spell_id, true, NULL, NULL, GetCaster()->GetGUID()); }
void HandleDummy(SpellEffIndex /*effIndex*/) { int32 damage = GetEffectValue(); Position const* pos = GetTargetDest(); if (Unit* target = GetHitUnit()) { if (!target->HasAuraType(SPELL_AURA_DEFLECT_SPELLS)) // Deterrence target->CastSpell(pos->GetPositionX(), pos->GetPositionY(), pos->GetPositionZ(), damage, true); } }
void HandleSummon(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); Unit* caster = GetCaster(); uint32 entry = uint32(GetSpellInfo()->EffectMiscValue[effIndex]); WorldLocation* summonLocation = GetTargetDest(); if (!caster || !summonLocation) return; caster->SummonCreature(entry, summonLocation->GetPositionX(), summonLocation->GetPositionY(), GROUND_Z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 20000); }