[svn] Merge branch r50 with trunk.

--HG--
branch : trunk
This commit is contained in:
megamage committed 2008-10-17 21:44:37 -05:00
1 parent 16dcd37279
commit bac1fb628e
18 files changed
+4803 -1271

No files matched your search

-29
View File
@@ -1919,35 +1919,6 @@ void Spell::EffectTeleportUnits(uint32 i)
((Player*)unitTarget)->TeleportTo(st->target_mapId,st->target_X,st->target_Y,st->target_Z,st->target_Orientation,unitTarget==m_caster ? TELE_TO_SPELL : 0);
break;
}
case TARGET_BEHIND_VICTIM:
{
// Get selected target for player (or victim for units)
Unit *pTarget = NULL;
if(m_caster->GetTypeId() == TYPEID_PLAYER)
pTarget = ObjectAccessor::GetUnit(*m_caster, ((Player*)m_caster)->GetSelection());
else
pTarget = m_caster->getVictim();
// No target present - return
if (!pTarget)
return;
// Init dest coordinates
uint32 mapid = m_caster->GetMapId();
float x = m_targets.m_destX;
float y = m_targets.m_destY;
float z = m_targets.m_destZ;
float orientation = pTarget->GetOrientation();
// Teleport
if(unitTarget->GetTypeId() == TYPEID_PLAYER)
((Player*)unitTarget)->TeleportTo(mapid, x, y, z, orientation, TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (unitTarget==m_caster ? TELE_TO_SPELL : 0));
else
{
MapManager::Instance().GetMap(mapid, m_caster)->CreatureRelocation((Creature*)unitTarget, x, y, z, orientation);
WorldPacket data;
unitTarget->BuildTeleportAckMsg(&data, x, y, z, orientation);
unitTarget->SendMessageToSet(&data, false);
}
return;
}
default:
{
// If not exist data for dest location - return