[7450] Fixes and improvements in TARGET_BEHIND_VICTIM, SPELL_EFFECT_JUMP2, SPELL_EFFECT_TELEPORT_UNITS work. Author: VladimirMangos

* Move near teleport code for player/creature in Unit::NearTeleportTo
    * Allow correctly seelct target and end point orientation for script casted spells with TARGET_BEHIND_VICTIM
    * Replace use BuildTeleportAckMsg by BuildHeartBeatMsg for creature teleports. BuildTeleportAckMsg
      set active mover for targeted player to affected creature and "freeze" player.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-03-13 18:28:10 -06:00
parent c823272e34
commit c3d14c8241
3 changed files with 50 additions and 55 deletions

View File

@@ -13491,3 +13491,19 @@ void Unit::SetPhaseMask(uint32 newPhaseMask, bool update)
if(Pet* pet = GetPet())
pet->SetPhaseMask(newPhaseMask,true);
}
void Unit::NearTeleportTo( float x, float y, float z, float orientation, bool casting /*= false*/ )
{
if(GetTypeId() == TYPEID_PLAYER)
((Player*)this)->TeleportTo(GetMapId(), x, y, z, orientation, TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (casting ? TELE_TO_SPELL : 0));
else
{
GetMap()->CreatureRelocation((Creature*)this, x, y, z, orientation);
WorldPacket data;
// Work strange for many spells: triggered active mover set for targeted player to creature
//BuildTeleportAckMsg(&data, x, y, z, orientation);
BuildHeartBeatMsg(&data);
SendMessageToSet(&data, false);
}
}