please i've maked some codes for 4351 and i'm trying to make the right packets... but not seems to work yet... if possible i would like to learn a little more and i want help from epvp community....
here are the codes for NpcTalk :
Code:
using System;
using System.Collections.Generic;
using System.Text;
using MyMathLib;
using TheCOServer.PacketHandler;
namespace TheCOServer.ClientRequests
{
public class NpcTalk : Base
{
public Packets BasePacket = new Packets();
public NpcTalk(int uid, int linkback, byte[] Data, Client Client)
{
switch (uid)
{
default:
{
Text("non-player character with id " + uid + " not ready yet!", Client);
Link("I'll be right back!", 255, Client);
End(Client);
break;
}
}
}
public void Text(string value, Client Client)
{
byte[] pack = Client.ThePackets.NpcSay(value);
Client.SendPacket(pack);
}
public void Link(string value, int LinkBack, Client Client)
{
byte[] pack = Client.ThePackets.NpcLink(value, (byte)LinkBack);
Client.SendPacket(pack);
}
public void Input(string value, int LinkBack, Client Client)
{
//Client.SendPacket(BasePacket.NPCTalk(LinkBack, 3, value));
}
public void Face(byte Face, Client Client)
{
byte[] pack = Client.ThePackets.NpcFace(Face);
Client.SendPacket(pack);
}
public void End(Client Client)
{
byte[] pack = Client.ThePackets.NpcEnd();
Client.SendPacket(pack);
}
}
}
and here are the packets that i've maked:
Code:
public byte[] NpcSay(string Text)
{
WriteShort(16 + Text.Length);
WriteShort(2032);
WriteLong(0);
WriteShort(0);
Byte(255);
Byte(1);
Byte(1);
WriteLong(Text.Length);
WriteString(Text);
Byte(0);
return GetBytes();
}
public byte[] NpcLink(string Text, byte Link)
{
WriteShort(16 + Text.Length);
WriteShort(2032);
WriteLong(0);
WriteShort(0);
Byte(Link);
Byte(2);
Byte(1);
WriteLong(Text.Length);
WriteString(Text);
Byte(0);
return GetBytes();
}
public byte[] NpcFace(int Face)
{
WriteShort(16);
WriteShort(2032);
WriteLong(10);
WriteLong(10);
WriteShort(Face);
Byte(255);
Byte(4);
WriteLong(0);
return GetBytes();
}
public byte[] NpcEnd()
{
WriteShort(16);
WriteShort(2032);
WriteLong(0);
WriteShort(0);
Byte(255);
Byte(100);
WriteLong(0);
return GetBytes();
}
sorry for the bad english.. and thanks in advance for any help : D
also (don't ask why using that source or flame the thread... i just wanna help ... nothing more.. nothing less : D)
bug: client close when click at any npc!
cya!