diff options
author | megamage <none@none> | 2009-03-13 18:28:10 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-03-13 18:28:10 -0600 |
commit | c3d14c82419ca06bae620df9560133cd16b4caed (patch) | |
tree | 920bb242fdf1a0ccf916d44e489871c8626aaeff /src/game/Unit.cpp | |
parent | c823272e34f0cbd1ec796e959bddb853ce34ce9e (diff) |
[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
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index edbb670187a..a8275c73b9a 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -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); + } +} |