Jump void:
Quote:
public static void Handle(Main.GameClient GC, byte[] Data)
{
GC.MyChar.Mining = false;
GC.MyChar.AtkMem.Attacking = false;
GC.MyChar.Action = 100;
if (GC.MyChar.Loc.AbleToJump(BitConverter.ToUInt16(Da ta, 8), BitConverter.ToUInt16(Data, 10), GC.MyChar.StatEff.Contains(NewestCOServer.Game.Sta tusEffectEn.Cyclone)))
{
Game.World.Action(GC.MyChar, Data);
GC.MyChar.Loc.Jump(BitConverter.ToUInt16(Data, 8), BitConverter.ToUInt16(Data, 10));
Game.World.Spawns(GC.MyChar, true);
}
else
{
GC.LocalMessage(2005, "Invalid Jump!");
GC.AddSend(Packets.GeneralData(GC.MyChar.EntityID, 0, GC.MyChar.Loc.X, GC.MyChar.Loc.Y, 0x6c));
}
}
|
Here the Write´s
public unsafe void WriteInt16(ushort val)
{
*((ushort*)(Ptr + Count)) = val;
Count += 2;
}
public unsafe void WriteInt32(uint val)
{
*((uint*)(Ptr + Count)) = val;
Count += 4;
}
public unsafe void WriteInt64(ulong val)
{
*((ulong*)(Ptr + Count)) = val;
Count += 8;
}
Here the walk:
public static void Handle(Main.GameClient GC, byte[] Data)
{
GC.MyChar.Mining = false;
GC.MyChar.AtkMem.Attacking = false;
GC.MyChar.Action = 100;
Game.World.Action(GC.MyChar, Data);
GC.MyChar.Direction = (byte)(Data[4] % 8);
GC.MyChar.Loc.Walk((byte)(Data[4] % 8));
Game.World.Spawns(GC.MyChar, true);
}
All based on patch 5119+