Did you rebuild the NpcDialog project? Right click on the project in C# -> Solution explorer and hit Rebuild project. It should work fine.
Quote:
What is wrong with this NPC ?
EDIT:Code:#region Leave market case 11181: { switch (npcRequest.OptionID) { case 0: { dialog.Text("Would you like to leave the Market ? It's free!"); dialog.Option("Yes.", 1); dialog.Option("No.", 255); dialog.Send(); break; } case 1: { if (client.Entity.PreviousMapID == 1002) //Twincity { client.Entity.Teleport(1002, 400, 400); } if (client.Entity.PreviousMapID == 1020) // Ape mountian { client.Entity.Teleport(1020, 567, 576); } if (client.Entity.PreviousMapID == 1000) // Desert City { client.Entity.Teleport(1000, 500, 650); } if (client.Entity.PreviousMapID == 1001) //Mystic castle { client.Entity.Teleport(1001, 316, 642); } if (client.Entity.PreviousMapID == 1015) //Bird Island { client.Entity.Teleport(1015, 723, 573); } if (client.Entity.PreviousMapID == 1011) //Phoenix Castle { client.Entity.Teleport(1011, 190, 271); } else { client.Entity.Teleport(1002, 400, 400); } } break; } break; } #endregion
Every npc I add does not work.
case 1: // NPC ID -- Yours may be different
ushort Map, X, Y; // Define 3 Variables as UInt16
switch (client.Entity.PreviousMapID) // Search through Previous Map
{
default: // UnDefined Map
case 1002: // Twin City
Map = 1020; X = 567; Y = 576;
break;
case 1020: // Ape Mountain
Map = 1002; X = 400; Y = 400;
break;
case 1000: // Desert City
Map = 1000; X = 500; Y = 650;
break;
case 1001: // Mystic Castle
Map = 1001; X = 316; Y = 642;
break;
case 1015: // Bird Island
Map = 1015; X = 723; Y = 573;
break;
case 1011: // Phoenix Castle
Map = 1011; X = 190; Y = 271;
break;
}
client.Entity.Teleport(Map, X, Y); // Teleport the Entity to the defined position
break;
public static COPacket Weather(Features.WeatherType Type, uint Intensity, uint Appearence, uint Direction)
{
byte[] Packet = new byte[8 + 20];
COPacket P = new COPacket(Packet);
P.WriteInt16((ushort)(Packet.Length - 8));
P.WriteInt16((ushort)0x3f8);
P.WriteInt32((byte)Type);
P.WriteInt32(Intensity);
P.WriteInt32(Direction);
P.WriteInt32(Appearence);
return P;
}
I think it goes in EntityTable.cs Or PacketHandler.csQuote:
Ok thanks another question
Say I had this packet and I needed to add it where would I add it and how would the packet format be ?
Not Packets.cs :SCode:public static COPacket Weather(Features.WeatherType Type, uint Intensity, uint Appearence, uint Direction) { byte[] Packet = new byte[8 + 20]; COPacket P = new COPacket(Packet); P.WriteInt16((ushort)(Packet.Length - 8)); P.WriteInt16((ushort)0x3f8); P.WriteInt32((byte)Type); P.WriteInt32(Intensity); P.WriteInt32(Direction); P.WriteInt32(Appearence); return P; }
#region WeatherPacket (1016)
case 0x3f8:
{
if (client.Action != 2)
return;
[COLOR="Red"][B]P[/B][/COLOR].WriteInt16((ushort)([B][COLOR="Red"]Packet[/COLOR][/B].Length - 8));
[COLOR="Red"][B]P[/B][/COLOR].WriteInt16((ushort)0x3f8);
[COLOR="Red"][B]P[/B][/COLOR].WriteInt32((byte)[COLOR="Red"][B]Type[/B][/COLOR]);
[COLOR="Red"][B]P[/B][/COLOR].WriteInt32([COLOR="Red"][B]Intensity[/B][/COLOR]);
[COLOR="Red"][B]P[/B][/COLOR].WriteInt32([COLOR="Red"][B]Direction[/B][/COLOR]);
[COLOR="Red"][B]P[/B][/COLOR].WriteInt32([COLOR="Red"][B]Appearence[/B][/COLOR]);
break;
}
#endregion
case "weather":
{
Weather weather = new Weather(true);
weather.WeatherType = uint.Parse(Data[1]);
weather.Intensity = uint.Parse(Data[2]);
weather.Appearance = uint.Parse(Data[3]);
weather.Direction = uint.Parse(Data[4]);
weather.Send(client);
break;
}
Awesome thanksQuote:
Command:
case "weather":
{
Weather weather = new Weather(true);
weather.WeatherType = Weather.Rain;
weather.Direction = 255;
weather.Send(client);
break;
}