[HELP]Market Vending

11/12/2008 22:18 Incariuz#1
Ok... So I've been making some good progress with my source, thanks to many people for guiding me through it. But now I'm stuck on getting my market vending working. Of course I have the stalls all over, but when a character clicks to open shop, and says yes, it states shop cannot be opened there. I was hoping perhaps someone could give me an idea on what it is I need to add/change to get somewhere with this.

Thanks in advance to anyone willing to help.
11/12/2008 22:25 tao4229#2
Infamous just figured it out(full working), and he's the second person(Q? first) to do it... You have to figure out the vending item packet yourself, and the vending button(whatever he meant by that :D) and other things.
11/12/2008 22:27 Incariuz#3
Hmmm... that doesn't sound fun, lol. Guess I'll just put the market on hold till I learn more I can figure it out alone.
11/12/2008 22:34 InfamousNoone#4
Start Vending - 0x3F2.cs

Code:
using System;
using System.Collections.Generic;
using System.Native;
using Conquer.Client;
using Conquer.SQL;
using Conquer.Structures;
using Conquer.Packets;
using Conquer.Processor.Items;

namespace Conquer.Processor.Packets
{
    public unsafe partial class PacketProcessor
    {
        public static void StartVending(GameClient Client, DataPacket* Packet)
        {
            if (!Client.VendingInfo.IsVending && Client.Entity.MapID == Constants.MarketMapID)
            {
                Dictionary<uint, ConquerNpc> mapNpcs = null;
                if (Database.Npcs.TryGetValue(Client.Entity.MapID, out mapNpcs))
                {
                    foreach (KeyValuePair<uint, ConquerNpc> entry in mapNpcs)
                    {
                        if (entry.Value.X == Client.Entity.Data.X - 2 && entry.Value.Y == Client.Entity.Data.Y)
                        {
                            ConquerNpc npc = entry.Value;
                            npc.ConvertToVendNpc(Client);
                            mapNpcs[npc.UID] = npc;
                            Client.VendingInfo.IsVending = true;
                            Client.VendingInfo.ShopID = npc.UID;

                            SendRangePacket.Add(Client.Entity, Constants.ViewDistance, 0, &npc, npc.Size, null);
                            Packet->dwParam = Client.VendingInfo.ShopID;
                            Client.Send(Packet, Packet->Size);
                            break;
                        }
                    }
                }
            }
        }
    }
}
11/12/2008 22:39 xprincex#5
Thanks this will help me tons
11/12/2008 22:41 valyy#6
hey i need code for fix bloked in portal plz give my:(
11/12/2008 22:42 Incariuz#7
I'm guessing that will not work with LOTF. I guess I'l play with it sometime, see if it helps me learn something. Thanks Infamous.
11/13/2008 08:06 alexbigfoot#8
Quote:
Originally Posted by InfamousNoone View Post
Start Vending - 0x3F2.cs

Code:
using System;
using System.Collections.Generic;
using System.Native;
using Conquer.Client;
using Conquer.SQL;
using Conquer.Structures;
using Conquer.Packets;
using Conquer.Processor.Items;

namespace Conquer.Processor.Packets
{
    public unsafe partial class PacketProcessor
    {
        public static void StartVending(GameClient Client, DataPacket* Packet)
        {
            if (!Client.VendingInfo.IsVending && Client.Entity.MapID == Constants.MarketMapID)
            {
                Dictionary<uint, ConquerNpc> mapNpcs = null;
                if (Database.Npcs.TryGetValue(Client.Entity.MapID, out mapNpcs))
                {
                    foreach (KeyValuePair<uint, ConquerNpc> entry in mapNpcs)
                    {
                        if (entry.Value.X == Client.Entity.Data.X - 2 && entry.Value.Y == Client.Entity.Data.Y)
                        {
                            ConquerNpc npc = entry.Value;
                            npc.ConvertToVendNpc(Client);
                            mapNpcs[npc.UID] = npc;
                            Client.VendingInfo.IsVending = true;
                            Client.VendingInfo.ShopID = npc.UID;

                            SendRangePacket.Add(Client.Entity, Constants.ViewDistance, 0, &npc, npc.Size, null);
                            Packet->dwParam = Client.VendingInfo.ShopID;
                            Client.Send(Packet, Packet->Size);
                            break;
                        }
                    }
                }
            }
        }
    }
}
omg,lol u want to say, the first "1010" packet is the "show vending" and the second is the sending the shop id to the client?

i think i got it :DDD

inf should know what i mean by that |:D
11/13/2008 11:38 becko713#9
shop Flag Full work

only when Player Sit can't saw ShopFlag Close button

if any one have the packet to Show this Button i want it
11/13/2008 12:54 Ultimatum#10
Quote:
Originally Posted by InfamousNoone View Post
Start Vending - 0x3F2.cs

Code:
using System;
using System.Collections.Generic;
using System.Native;
using Conquer.Client;
using Conquer.SQL;
using Conquer.Structures;
using Conquer.Packets;
using Conquer.Processor.Items;

namespace Conquer.Processor.Packets
{
    public unsafe partial class PacketProcessor
    {
        public static void StartVending(GameClient Client, DataPacket* Packet)
        {
            if (!Client.VendingInfo.IsVending && Client.Entity.MapID == Constants.MarketMapID)
            {
                Dictionary<uint, ConquerNpc> mapNpcs = null;
                if (Database.Npcs.TryGetValue(Client.Entity.MapID, out mapNpcs))
                {
                    foreach (KeyValuePair<uint, ConquerNpc> entry in mapNpcs)
                    {
                        if (entry.Value.X == Client.Entity.Data.X - 2 && entry.Value.Y == Client.Entity.Data.Y)
                        {
                            ConquerNpc npc = entry.Value;
                            npc.ConvertToVendNpc(Client);
                            mapNpcs[npc.UID] = npc;
                            Client.VendingInfo.IsVending = true;
                            Client.VendingInfo.ShopID = npc.UID;

                            SendRangePacket.Add(Client.Entity, Constants.ViewDistance, 0, &npc, npc.Size, null);
                            Packet->dwParam = Client.VendingInfo.ShopID;
                            Client.Send(Packet, Packet->Size);
                            break;
                        }
                    }
                }
            }
        }
    }
}
So you found the button out xD

Quote:
Originally Posted by Incariuz View Post
I'm guessing that will not work with LOTF. I guess I'l play with it sometime, see if it helps me learn something. Thanks Infamous.
Yeh it will work for lotf, you just gotta know what your doin i guess.
11/13/2008 14:39 xprincex#11
Well if any of you watched Inf tuts on c# and can see how fast he codes it probably just wrote one up real quick and no it dont work with loft unless u tweak it to. So therefore its more as a learning code so you guys understand how it works.

Vivi
11/13/2008 15:40 Ultimatum#12
LOL, your not suppost to copy + paste and everythings done. What i ment was that code hes posted is infact part of vending, if you know how to code you can make it work in lotf.

Im not bothered anyway i allready have it done, just need to analyse the logged packet to get the button to quit vending.
11/14/2008 18:59 xprincex#13
THe way i see if u have a server with cmds vending should be the last thing on your mind
11/14/2008 21:31 valyy#14
i have error with Constants
11/14/2008 23:49 alexbigfoot#15
Quote:
Originally Posted by valyy View Post
i have error with Constants
u`re using the codeblock that inf showd?

Quote:
Originally Posted by InfamousNoone View Post
Start Vending - 0x3F2.cs

Code:
using System;
using System.Collections.Generic;
using System.Native;
using Conquer.Client;
using Conquer.SQL;
using Conquer.Structures;
using Conquer.Packets;
using Conquer.Processor.Items;

namespace Conquer.Processor.Packets
{
    public unsafe partial class PacketProcessor
    {
        public static void StartVending(GameClient Client, DataPacket* Packet)
        {
            if (!Client.VendingInfo.IsVending && Client.Entity.MapID == Constants.MarketMapID)
            {
                Dictionary<uint, ConquerNpc> mapNpcs = null;
                if (Database.Npcs.TryGetValue(Client.Entity.MapID, out mapNpcs))
                {
                    foreach (KeyValuePair<uint, ConquerNpc> entry in mapNpcs)
                    {
                        if (entry.Value.X == Client.Entity.Data.X - 2 && entry.Value.Y == Client.Entity.Data.Y)
                        {
                            ConquerNpc npc = entry.Value;
                            npc.ConvertToVendNpc(Client);
                            mapNpcs[npc.UID] = npc;
                            Client.VendingInfo.IsVending = true;
                            Client.VendingInfo.ShopID = npc.UID;

                            SendRangePacket.Add(Client.Entity, Constants.ViewDistance, 0, &npc, npc.Size, null);
                            Packet->dwParam = Client.VendingInfo.ShopID;
                            Client.Send(Packet, Packet->Size);
                            break;
                        }
                    }
                }
            }
        }
    }
}