コード例 #1
0
            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)));
            }
コード例 #2
0
ファイル: boss_rotface.cpp プロジェクト: Albis/TrinityCore
            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());
            }
コード例 #3
0
ファイル: spell_dk.cpp プロジェクト: bahajan95/flame-core
 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);
     }
 }
コード例 #4
0
            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);
            }