void SetDest(SpellDestination& dest)
 {
     // Adjust effect summon position
     Position const offset = { frand(-7.0f, 7.0f), frand(-7.0f, 7.0f), 11.0f, 0.0f };
     dest.Relocate(*GetCaster());
     dest.RelocateOffset(offset);
 }
Esempio n. 2
0
 void ModDestHeight(SpellDestination& dest)
 {
     Unit* caster = GetCaster();
     Position pos = caster->GetPosition();
     pos.m_positionZ = caster->GetMap()->GetHeight(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), true, 100.0f);
     dest.Relocate(pos);
 }
 void SetDest(SpellDestination& dest)
 {
     std::list<Spell::TargetInfo> const* targetsInfo = GetSpell()->GetUniqueTargetInfo();
     for (std::list<Spell::TargetInfo>::const_iterator ihit = targetsInfo->begin(); ihit != targetsInfo->end(); ++ihit)
         if (Unit* target = ObjectAccessor::GetUnit(*GetCaster(), ihit->targetGUID))
         {
             dest.Relocate(*target);
             if (roll_chance_i(50))
                 break;
         }
 }
Esempio n. 4
0
        void SetDest(SpellDestination& dest)
        {
            // Do our own calculations for the destination position.
            /// TODO: Remove this once we find a general rule for WorldObject::MovePosition (this spell shouldn't take the Z change into consideration)
            Unit* caster = GetCaster();
            float angle = float(rand_norm()) * static_cast<float>(2 * M_PI);
            uint32 dist = caster->GetObjectSize() + GetSpellInfo()->GetEffect(EFFECT_0)->CalcRadius(caster) * (float)rand_norm();

            float x = caster->GetPositionX() + dist * std::cos(angle);
            float y = caster->GetPositionY() + dist * std::sin(angle);
            float z = caster->GetMap()->GetHeight(caster->GetPhases(), x, y, caster->GetPositionZ());
            float o = dest._position.GetOrientation();

            dest.Relocate({ x, y, z, o });
        }
Esempio n. 5
0
 void SetDest(SpellDestination& dest)
 {
     dest.Relocate(TeleportPoint[urand(0, 6)]);
 }