Code: Select all
Packet Name: Move Player
Packet: 0x97
Sent By: Client
Size: 2 Bytes
Packet Build
BYTE[1] cmd
BYTE[1] direction
Subcommand Build
N/A
Notes
N/A
Code: Select all
Packet Name: Move Player
Packet: 0x97
Sent By: Client
Size: 2 Bytes
Packet Build
BYTE[1] cmd
BYTE[1] direction
Subcommand Build
N/A
Notes
N/A
Code: Select all
Sent By: ClientCode: Select all
program test(who)
SendSysMessage (who, "Welches Tier soll bewegt werden?");
var npc:= Target(who);
SendSysMessage (who, "Wohin das Tier bewegen?");
var tgt := target (who);
if (tgt != 0)
var skirt := -1;
var path;
repeat
skirt := skirt + 1;
path := FindPath (npc.x, npc.y, npc.z, tgt.x, tgt.y, tgt.z, _DEFAULT_REALM, FP_IGNORE_MOBILES, skirt);
until (skirt >= 20 || path != error);
if (path != error)
var pathElem;
var oldX := who.x;
var oldY := who.y;
var oldZ := who.z;
PrintTextAbove (who, who.x + ":" + who.y + ":" + who.z + " -> " + tgt.x + ":" + tgt.y + ":" + tgt.z + ", required skirt: " + skirt);
foreach pathElem in path
MoveObjectToLocation (npc, pathElem.x, pathElem.y, pathElem.z, _DEFAULT_REALM, MOVEOBJECT_FORCELOCATION);
sleepms (300);
endforeach
MoveObjectToLocation (npc, oldX, oldY, oldZ, _DEFAULT_REALM, MOVEOBJECT_FORCELOCATION);
else
SendSysMessage (who, "no path found from " + who.x + ":" + who.y + ":" + who.z + " to " + tgt.x + ":" + tgt.y + ":" + tgt.z);
SendSysMessage (who, "Reason: " + path);
endif
endif
endprogramCode: Select all
program test(who)
SendSysMessage (who, "Welches Tier soll bewegt werden?");
var npc:= Target(who);
SendSysMessage (who, "Wohin das Tier bewegen?");
var tgt := target (who);
var event := struct{};
event.+type := "movecmd";
event.+x := tgt.x;
event.+y := tgt.y;
event.+z := tgt.z;
event.+realm := who.realm;
event.+source := who;
npc.process.sendevent(event);
endprogram
Code: Select all
"movecmd":
path := FindPath (ev.x, ev.y, ev.z, ev.x, ev.y, ev.z, who.realm, FP_IGNORE_MOBILES, 20);
if (path)
foreach pathElem in path
RunTowardLocation (pathElem.x, pathElem.y)
sleepms (300);
endforeach
else
SendSysMessage (ev.source, "no path found from " + ev.source.x + ":" + ev.source.y + ":" + ev.source.z + " to " + ev.x + ":" + ev.y + ":" + ev.z);
SendSysMessage (ev.source, "Reason: " + path.errortext);
endif
Packet Name: Move PlayerCWO wrote:Are you trying to get a script to move a player? Because according to the info, this is sent by the client, not the server so this will have no effect if you try to send it from a script.
Code: Select all
Sent By: Client
Code: Select all
var movepacket:="9700";
SendPacket(who,movepacket);