[Release]My source...

05/13/2010 21:03 -impulse-#76
Did you rebuild the NpcDialog project? Right click on the project in C# -> Solution explorer and hit Rebuild project. It should work fine.
05/13/2010 21:15 MonstersAbroad#77
Ah thanks.
05/13/2010 21:17 gerble93#78
Quote:
Originally Posted by MonstersAbroad View Post
What is wrong with this NPC ?
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
EDIT:

Every npc I add does not work.

This could work better....

Code:
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;
Remember to Build Project (right click..Rebuild)
05/13/2010 21:26 MonstersAbroad#79
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 ?
Code:
        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;
        }
Not Packets.cs :S
05/13/2010 22:05 BlueFlame11#80
Quote:
Originally Posted by MonstersAbroad View Post
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 ?
Code:
        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;
        }
Not Packets.cs :S
I think it goes in EntityTable.cs Or PacketHandler.cs
05/13/2010 22:31 MonstersAbroad#81
ok so I got this errors marked in red:
Code:
#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
Sorry if it is nooby I am a NOOB at packets but am trying hard!
05/13/2010 22:47 -impulse-#82

Command:
case "weather":
{
Weather weather = new Weather(true);
weather.WeatherType = Weather.Rain;
weather.Direction = 255;
weather.Send(client);
break;
}
05/13/2010 22:54 MonstersAbroad#83
THANKS!
05/13/2010 23:00 -impulse-#84
Yep
05/13/2010 23:05 Kiyono#85
I more or less had the same packet (didn't had the "type = 0x?" part) and I used this command:
Code:
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;
                                        }
05/13/2010 23:14 MonstersAbroad#86
Nice work!

P.S: I managed to make DMaps load fully.
05/13/2010 23:20 BlueFlame11#87
Quote:
Originally Posted by -impulse- View Post

Command:
case "weather":
{
Weather weather = new Weather(true);
weather.WeatherType = Weather.Rain;
weather.Direction = 255;
weather.Send(client);
break;
}
Awesome thanks
05/14/2010 15:53 Korvacs#88
Your source is very bulky, it could be streamlined a hell of alot.

I would imagine the memory usage is pretty high aswell, the entire packethandler is surrounded by a try catch, not something you want to be doing.

Its fairly unique, ill give you that.
05/14/2010 18:07 MonstersAbroad#89
Jack,

Still bugless and very very stable.
05/14/2010 19:42 Korvacs#90
Quote:
Originally Posted by MonstersAbroad View Post
Jack,

Still bugless and very very stable.
I never said it wasnt, theres just plenty of room for improvement.