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)
        {
            Creature* creature = GetCaster()->ToCreature();
            if (creature)
                return;
            
            // Side of the room: WEST > 366.781f (middle of the room) > EAST
            float ori = creature->GetPositionY() > 366.781f ? DegToRad(270) : DegToRad(90);

            // DB dest has no orientation field (always 0.0f).
            dest.RelocateOffset({ 0.0f, 0.0f, 0.0f, ori });

            creature->SetHomePosition(dest._position.GetPosition());
        }
Esempio n. 5
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 });
        }
 void SetDest(SpellDestination& dest)
 {
     Position const offset = { 0.5f, 0.5f, 5.0f, 0.0f };
     dest.RelocateOffset(offset);
 }
 void SetDest(SpellDestination& dest)
 {
     // Adjust effect summon position
     Position const offset = { 0.0f, 0.0f, 20.0f, 0.0f };
     dest.RelocateOffset(offset);
 }
Esempio n. 8
0
 void ModDestHeight(SpellDestination& dest)
 {
     // All stalactite triggers should have Z position 301.3837f, but no way to relocate (not relocateoffset!) height only.
     Position offset = { 0.0f, 0.0f, 50.0f, 0.0f };
     dest.RelocateOffset(offset);
 }
 void SetDest(SpellDestination& dest)
 {
     dest.RelocateOffset({ 0.0f, 0.0f, 30.0f, 0.0f });
 }
Esempio n. 10
0
 void SetDest(SpellDestination& dest)
 {
     dest.Relocate(TeleportPoint[urand(0, 6)]);
 }