[Help]ShopFlag

04/29/2009 12:18 CoAttack#16
Quote:
Originally Posted by $HaDoW View Post
nah didint got ;D
Btw my LOTF is diff :D I have fixed all the known bugs only left to add Vending
can i go on your server and see i can do the bugs that i know of.
04/29/2009 14:16 $HaDoW#17
ofc PM me on msn or skype
MSN: [Only registered and activated users can see links. Click Here To Register...]
Skype: HaKaShis
;)
04/29/2009 14:18 KraHen#18
Quote:
Originally Posted by $HaDoW View Post
ofc PM me on msn or skype
MSN: [Only registered and activated users can see links. Click Here To Register...]
Skype: HaKaShis
;)
Let`s bet that I can have infinite pots
04/29/2009 21:07 CoAttack#19
Quote:
Originally Posted by ElDeRnEcRo View Post
Let`s bet that I can have infinite pots
xD.
04/30/2009 05:22 Pete1990#20
Quote:
Originally Posted by $HaDoW View Post
post anything you have ! I'm searching for a better scource then LOTF !
because I havent seen any better one yet !
You wont find one all other ones suck learn to Code its pretty easy BTW Copy Past isnt coding lmao:D
04/30/2009 05:39 $HaDoW#21
like I dont fucking know !
I work with WoW Servers 4 years !
04/30/2009 05:55 kinshi88#22
@$HaDoW
Please watch your language.
Its really not necessary.


As for the shop flags, where are you stuck?
04/30/2009 06:25 $HaDoW#23
Sorry... just hate ppl who Flame !
the last thing I had was you press on FlagShop its spawns a carpet and siting on it and nothing else but after no luck I deleted the code and now I'm left only with the Packtes :(
05/01/2009 05:58 DungMaster#24
Will not be easy to get the code of shopflags. But good luck ;)
05/23/2009 22:51 $HaDoW#25
so can anyone help ? anyone got anything ?
this is all I have :( some one plz help me !
Code:
using System;
using System.Collections;
using System.Text;

namespace COServer_Project
{
    class OpenShop
    {
        private Client TClient;
        private byte[] data;
        public OpenShop(byte[] packet, Client client)
        {
            data = packet;
            TClient = client;
         //   shopid = _shopid;
            runshop();
        }
        void runshop()
        {
            try
            {
                int CharID = (data[11] << 24) + (data[10] << 16) + (data[9] << 8) + data[8];
                int X = (data[13] << 8) + data[12];
                int Y = (data[15] << 8) + data[14];
                if (TClient.MyChar.ShopID == 0)
                {
                    uint map_in = Convert.ToUInt32(TClient.MyChar.LocMap);

                 //   lock (NPCs.AllNPCs.SyncRoot)
                    {
                        foreach (DictionaryEntry DE in NPCs.AllNPCs)
                        {
                            SingleNPC Npc = (SingleNPC)DE.Value;

                            int N0 = Convert.ToInt32(Npc.UID);
                            int N1 = Convert.ToInt32(Npc.X);
                            int N2 = Convert.ToInt32(Npc.Y);
                            int N6 = Convert.ToInt32(Npc.Map);

                            if (map_in == N6)
                            {
                                if (N1 + 2 == TClient.MyChar.LocX && N2 == TClient.MyChar.LocY)
                                {
                                    int ShopID = N0 + 500;
                                    if (!World.ShopHash.Contains(ShopID))
                                    {
                                        TClient.MyChar.ShopID = ShopID;

                                        World.ShopHash.Add(ShopID, TClient);

                                        TClient.SendPacket(General.MyPackets.GeneralData3((long)CharID,TClient.MyChar.LocX, TClient.MyChar.LocY, 111)); 

                                        foreach (DictionaryEntry sr in World.AllChars)
                                        {
                                            Character Char = (Character)sr.Value;
                                            if (MyMath.CanSee(TClient.MyChar.LocX, TClient.MyChar.LocY, Char.LocX, Char.LocY) && TClient.MyChar.LocMap == Char.LocMap)
                                            {
                                                Char.MyClient.SendPacket(Packets.SpawnRug.Packet(TClient.MyChar, ShopID));
                                               
                                            }
                                        }
                                        TClient.SendPacket(General.MyPackets.GeneralData((long)CharID, (long)ShopID, TClient.MyChar.LocX, TClient.MyChar.LocY, 111)); 
                                        TClient.MyChar.Direction = 6;
                                    }
                                    else
                                    {
                                        TClient.SendPacket(General.MyPackets.SendMsg(15445, "SYSTEM", TClient.MyChar.Name, "This shop is in use, try another.", 2005));
                                    }
                                }
                            }
                        }
                    }
                }
                else
                {
                    TClient.SendPacket(General.MyPackets.SendMsg(15445, "SYSTEM", TClient.MyChar.Name, "You start vending.", 2005));
                }
            }
            catch
            {
               
            }
        }
    }
}
Code:
public static class SpawnRug
        {
            unsafe public static byte[] Packet(Character Char, int ID)
            {
                ushort PacketType = 0x7ee;
                byte[] Packet = new byte[21 + Char.MyClient.MyChar.Name.Length];
                fixed (byte* Ptr = Packet)
                {
                    *((ushort*)(Ptr)) = (ushort)Packet.Length;
                    *((ushort*)(Ptr + 2)) = (ushort)PacketType;
                    *((uint*)(Ptr + 4)) = (uint)ID;
                    *((ushort*)(Ptr + 8)) = (ushort)(Char.LocX + 1);
                    *((ushort*)(Ptr + 10)) = (ushort)Char.LocY;
                    *((ushort*)(Ptr + 12)) = (ushort)406;
                    *((ushort*)(Ptr + 14)) = (ushort)0;
                    *((byte*)(Ptr + 16)) = (byte)1;
                    *((byte*)(Ptr + 17)) = (byte)Char.MyClient.MyChar.Name.Length;

                    for (int i = 0; i < Char.MyClient.MyChar.Name.Length; i++)
                        *((byte*)(Ptr + 18 + i)) = Convert.ToByte(Char.MyClient.MyChar.Name[i]);
                }
                return Packet;
            }
        }
        public static class MarketStall
        {
            unsafe public static byte[] Packet(int ID, Character Character)
            {
                ushort PacketType = 0x3f2;
                byte[] Packet = new byte[24];
                fixed (byte* Ptr = Packet)
                {
                    *((ushort*)(Ptr)) = (ushort)Packet.Length;
                    *((ushort*)(Ptr + 2)) = (ushort)PacketType;
                    *((uint*)(Ptr + 4)) = (uint)758292;
                    *((uint*)(Ptr + 8)) = (uint)Character.UID;

                    *((uint*)(Ptr + 12)) = (uint)ID;
                    *((ushort*)(Ptr + 16)) = (ushort)272;
                    *((ushort*)(Ptr + 18)) = (ushort)198;
                    *((ushort*)(Ptr + 20)) = (ushort)6;
                    *((ushort*)(Ptr + 22)) = (ushort)110;
                }
                return Packet;
            }
        }
what am I missing ?