WriteInt 16/32/move

10/11/2009 11:38 lesley21#1
Does any of u guys have Code of ,
WriteInt 16
WriteInt 32
And
Move ??

I need it for a project of Conquer Online . Could u guys paste it here ,?
Thx,
Lesley21.
10/12/2009 09:32 ~Yuki~#2
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+