Reasearchs and tests on MSG_MOVE_TELEPORT

I make this topic, because this problem persists from ages and noone can bring any proper solution to it. This packet should be used by creatures when they teleport, currently HEARTBEAT is being used with movement flags which is wrong and so the result is wrong. The client doesn’t register tha appopriate packets being sent and result is creature gets teleported, but visually not (client side not).

All people who want to help, please share ideas how this can be fixed blizzlike and share tests you did and stuff that didn’t work. So new ppl that waste efforts on it will get the picture and from where to start.

Also I’m willing to test all solutions that your offer, if they make atleast some sense.

This is how it’s being handled currently:

void Unit::NearTeleportTo(float x, float y, float z, float orientation, bool casting /= false/)
{
DisableSpline();
if (GetTypeId() == TYPEID_PLAYER)
ToPlayer()->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
{
UpdatePosition(x, y, z, orientation, true);
SendMovementFlagUpdate();
}
}
This is why we can’t use:

void Unit::SendMovementFlagUpdate(bool self /* = false */)
{
WorldPacket data;
BuildHeartBeatMsg(&data);
SendMessageToSet(&data, self);
}

The teleport packet needs to send to the new position of the npc. In order to do that we need to create location as object somehow, then send that data to this object? Just guessing.

I think I have this answered, but my knowledge don’t permit to create what I want:

Now am nearly 100% sure for spells with target B db_dest the target location is being used somehow for receiving the packets: how is the mechanic going →

I. npc start cast with effect SPELL_EFFECT_TELEPORT_UNITS

II.update position is called with coordinates from spell target

III.MSG_MOVE_TELEPORT is built and sent to target of spell (it’s almost all revealed in sniffs, but after enought tries am sure is like this)

I did some research why it happened now:

if cellgrid different from current location, in CreatureRelocation creature update notify added to queue instead UpdateObjectVisibility immediately.

If you call UpdateObjectVisibility in this case creature appear correct, (like in case when creature in the same cell)

I think there are issue in VisibleChangesNotifier…ProcessRelocationNotifies…etc.

What opcode is MSG_TELEPORT? What sniffs says about it?

I. npc start cast with effect SPELL_EFFECT_TELEPORT_UNITS

II.update position is called with coordinates from spell target

III.MSG_MOVE_TELEPORT is built and sent to target of spell (it’s almost all revealed in sniffs, but after enought tries am sure is like this)

All sniffs says about is practicly this. 0 movement flags, no spline, meaning is used isntead of Heartbeat.

BTW, I asked before about updating, but noone shared any hint.

The idea of this opcode is to trigger that visibility update clientside. Or atleast this is what I think.

UpdateObjectVisibility is called, but with old coordinates and no updates comes from creature until new movement.

You can test it with spells like 79383 etc…then cast again, creature will apear in previous place.

I know, that is why this packet needs to be sent to there imo… You are still testing with heartbeat? This thing you talk about already is fixed by Elron123, but we need to fix it without using movement.

I don’t understand which opcode should be (you speaking about MSG_MOVE_TELEPORT what ID is?)

I fix it in this way: not by heartbeat msg, but by sending UpdateObjectVisibility (so notifiers sended immediately with gridcells checkspreloading) after teleport , not by AddCreatureToMoveList (which add creature update notifiers to queue).

This one is source of wrong position update for client in teleport case:

// delay creature move for grid/cell to grid/cell moves

Just wrote new method Map::CreatureTeleport.

Not sure about “blizzlike”… I need more info about “how it going on blizz”

What packet client recieve after creature teleport.

This packet is used for two cases, first case are players. This is handled in core.

Second case are npcs. This isn’t handled properly.

First of all based on my research npcs only use this packet after teleporting with spells to visible locations. What happen is this:

Send with compressed move packets you can get absolutely nothing before and after that is connected with moving/updating and anything on the subject.

That is why we most likely need to achieve the updating client by sending this packet. Or other possibilites is what you did + sending that packet, but then I’m not sure why would it be sent. That is why I think the whole packet needs to be send to that position.

ServerToClient: MSG_MOVE_TELEPORT (0x00C5) Length: 38 Time: 07/17/2010 02:24:02.000 Number: 886797 GUID: Full: 0xF130006C0716E0F0 Type: Unit Entry: 27655 Low: 1499376 Movement Flags: None (0) Extra Movement Flags: None (0) Time: -566812466 Position: X: 968.708 Y: 1042.49 Z: 527.322 O: 0.003508 Fall Time: 0 ServerToClient: SMSG_SPELL_GO (0x0132) Length: 58 Time: 07/17/2010 02:24:02.000 Number: 886798 Caster GUID: Full: 0xF130006C0716E0F0 Type: Unit Entry: 27655 Low: 1499376 Caster Unit GUID: Full: 0xF130006C0716E0F0 Type: Unit Entry: 27655 Low: 1499376 Cast Count: 0 Spell ID: 50476 Cast Flags: Unknown7, Immunity (67109120) Time: -566816468 Hit Count: 1 [0] Hit GUID: Full: 0xF130006C0716E0F0 Type: Unit Entry: 27655 Low: 1499376 Miss Count: 0 Target Flags: Unit, DestinationLocation (66) Target GUID: 0x0 Destination Transport GUID: 0x0 Destination Position: X: 968.708 Y: 1042.49 Z: 527.322 Unk Byte 2: 1

That packet is sent automatically (or should be) when an entity is hit by a teleport spell.

Hm…Let’s try broadcast this by creature in “blizlike” way )

And how can we do that?

Ya, I got it worked!

Patch is coming soon.

Ready: http://paste2.org/p/2637891

You are supposed to do this, without the movemet update part I think. I already did that before 5 months, but without last line it doesn’t work.

You can’t use that (0 flags send and no heartbeat send):

void Unit::SendMovementFlagUpdate(bool self /* = false */) { WorldPacket data; BuildHeartBeatMsg(&data); SendMessageToSet(&data, self); }

What’s wrong?

BuildMovementPacket it’s part of opcode.

MSG_MOVE_TELEPORT send to client new position (only visual creature relocation)
UpdatePosition - do real relocation on server-side.

So all fine.

I had fixed it already, in the exact same way as you Vlad