Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 15:29

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Request]Buy from shop packetID

Discussion on [Request]Buy from shop packetID within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 793
[Request]Buy from shop packetID

using ConquerPatch._5017;

I`d need the packetID of the packet that allows you to buy stuff from shops, or if it`s a subtype of a packet, then the ID and the subtype. Btw, if anyone has a list of the PacketIDs (just the IDs, not the codes) for 5017, I`d be really grateful.
KraHen is offline  
Old 11/05/2009, 10:08   #2
 
UnoAmigos's Avatar
 
elite*gold: 0
Join Date: Feb 2009
Posts: 192
Received Thanks: 107
Quote:
Originally Posted by ElDeRnEcRo View Post
using ConquerPatch._5017;

I`d need the packetID of the packet that allows you to buy stuff from shops, or if it`s a subtype of a packet, then the ID and the subtype. Btw, if anyone has a list of the PacketIDs (just the IDs, not the codes) for 5017, I`d be really grateful.
Anyway...you mean you cant buy in shop?

Try this code.... press Thanks if i helped..

Code:
#region shops
                            case 1:
                                {
                                    Me.Ready = false;
                                    uint ItemID = (uint)((Data[0x0b] << 24) + (Data[0x0a] << 16) + (Data[0x09] << 8) + Data[0x08]);
                                    uint CPsVal = Data[18];
                                    uint Value = (uint)((Data[0x07] << 24) + (Data[0x06] << 16) + (Data[0x05] << 8) + Data[0x04]);
                                    byte Amount = Data[20];
                                    int Money = Data[5];
                                    if (Amount == 0)
                                        Amount = 1;

                                    string TehShop = System.IO.File.ReadAllText(System.Windows.Forms.Application.StartupPath + @"\Shop.dat");

                                    try
                                    {
                                        if (Other.CharExist(Convert.ToString(ItemID), TehShop))
                                        {
                                            foreach (uint[] item in ExternalDatabase.Items)
                                            {
                                                if (ItemID == item[0])
                                                {
                                                    Value = item[7];
                                                    CPsVal = item[15];
                                                }
                                            }
                                            for (int i = 0; i < Amount; i++)
                                            {
                                                if (Me.ItemsInInventory > 39)
                                                    return;
                                                if (Me.Coins >= Value && CPsVal == 0 || Me.ECs > CPsVal && CPsVal != 0)
                                                {
                                                    if (CPsVal == 0)
                                                        Me.Coins -= Value;
                                                    if (CPsVal > 0)
                                                        Me.ECs -= CPsVal;

                                                    if (Me.Coins < 0)
                                                        Me.Coins = 0;
                                                    if (Me.ECs < 0)
                                                        Me.ECs = 0;

                                                    byte WithPlus = 0;
                                                    if (ItemID == 730003)
                                                        WithPlus = 3;
                                                    if (ItemID == 730004)
                                                        WithPlus = 4;
                                                    if (ItemID == 730005)
                                                        WithPlus = 5;
                                                    if (ItemID == 730006)
                                                        WithPlus = 6;
                                                    if (ItemID == 730007)
                                                        WithPlus = 7;
                                                    if (ItemID == 730008)
                                                        WithPlus = 8;
                                                    if (ItemID == 730009)
                                                        WithPlus = 9;
                                                    if (ItemID == 601819)
                                                        WithPlus = 9;
                                                    if (ItemID == 601829)
                                                        WithPlus = 10;
                                                    if (ItemID == 601839)
                                                        WithPlus = 11;
                                                    if (ItemID == 601849)
                                                        WithPlus = 12;

                                                    Me.AddItem(Convert.ToString(ItemID) + "-" + WithPlus + "-0-0-0-0", 0, (uint)Gen.Rand.Next(10000000));
                                                    Sp(Gen.MyPackets.Vital(Me.UID, 4, Me.Coins));
                                                    Sp(Gen.MyPackets.Vital(Me.UID, 30, Me.ECs));
                                                }
                                                else
                                                {
                                                    Sp(Gen.MyPackets.SendMsg(MessageId, "SYSTEM", Me.Name, "You don't have " + Value + " silvers or " + CPsVal + " ECs.", 2005));
                                                    break;
                                                }
                                            }
                                        }
                                        else
                                        {
                                            Gen.WriteLine("There is no such item in Shop.dat.(" + ItemID + ")");
                                        }
                                    }
                                    catch (Exception Exc) { Gen.WriteLine(Convert.ToString(Exc)); }
                                    Me.Ready = true;
                                    break;
                                }
                            #endregion

and you can there ID in shop.dat

Code:
[Shop0]
ID=3 [COLOR="Red"]<-----------ID[/COLOR]
Name=Drugstore [COLOR="Red"]<-------------NPC name[/COLOR]
Type=1
MoneyType=0 [COLOR="Red"]<---------0 for Golds and 1 for CPs[/COLOR]
ItemAmount=19
Item0=1000000
Item1=1000010
Item2=1000020
Item3=1000030
Item4=1001000
Item5=1001010
Item6=1001020
Item7=1002000
Item8=1002010
Item9=1002020
Item10=1060020
Item11=1001030
Item12=1001040
Item13=1002030
Item14=1002040
Item15=720011
Item16=720012
Item17=720013
Item18=1002050

Edit ECs to CPs and Coins for Silvers....Also Me for MyChar.

Sp(Gen.MyPackets.Vital(Me.UID, 30, Me.ECs)); to

SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));

Its from my Own Source.....
UnoAmigos is offline  
Thanks
1 User
Old 11/05/2009, 13:01   #3


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 793
No, I need buying stuff from shops, so he`s right.

@UnoAmigos: By the way your source looks like a complete LOTF ripoff.
KraHen is offline  
Old 11/06/2009, 01:26   #4
 
elite*gold: 0
Join Date: Aug 2009
Posts: 930
Received Thanks: 448
are you referring to market stalls, or literal shops?
.Guru is offline  
Old 11/06/2009, 02:48   #5
 
elite*gold: 0
Join Date: Feb 2006
Posts: 550
Received Thanks: 81
Quote:
Originally Posted by ElDeRnEcRo View Post
No, I need buying stuff from shops, so he`s right.

@UnoAmigos: By the way your source looks like a complete LOTF ripoff.
what he posted was all LOTF code, rofl'd at reading all lines of a file each time someone buys an item.
ChingChong23 is offline  
Reply


Similar Threads Similar Threads
[Request] Met/DB NPC and maybe shop?
08/12/2009 - CO2 Private Server - 1 Replies
Hey guys, figured I'd work at a server while I get help with my own source lol. uhh using coemu the mets people...lack the ability to work? lol so uhh, anyone able to gimme a hand with this one? Would greatly appreciate it...I know the packets are in the packetprocessor(I know I checked xD) but the npcs dont work. so thanks to any responders in advanced. and setting up a custom shop in CoEmu alsoways gives me problems...(like not working for example) I cant change money values..or have the npc...
MessageBoard PacketID?
07/26/2009 - CO2 Private Server - 5 Replies
Heya. Was just wondering if anyone has the messageboard packetid to make a text be written in the messageboard. I got so far that I can get what message the user inputs in the window, but not sure how to get it to write a text in the board. Thanks.
[REQUEST-V62] GM All-In-One-Shop
06/19/2009 - MapleStory - 0 Replies
Never mind



All times are GMT +2. The time now is 15:29.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.