Register for your free account! | Forgot your password?

You last visited: Today at 20:47

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

Advertisement



[Help]elite-coemu

Discussion on [Help]elite-coemu within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
niko40601's Avatar
 
elite*gold: 0
Join Date: Jul 2010
Posts: 17
Received Thanks: 1
[Help]elite-coemu

when i try to buy something from shopping mall the item won't appear until i re log.it has to do with itembuy.cs
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

using WorldServer.Networking;
using WorldServer.Packets;
using WorldServer.Structures;

namespace WorldServer.Handlers
{
    public partial class Handler
    {
        public static void ItemBuy(byte[] Data, ClientSocket CSocket)
        {
            int Shop = PacketProcessor.ReadLong(Data, 4);
            int Item = PacketProcessor.ReadLong(Data, 8);
            int Amount = PacketProcessor.ReadLong(Data, 20);
            {
                if (Amount == 0)
                    Amount = 1;
                if (CSocket.Client.Inventory.Count == 41 - Amount)
                {
                    CSocket.Send(CoPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "[ERROR] Your inventory is full.", Struct.ChatType.Top));
                    return;
                }
                foreach (KeyValuePair<int, Struct.Shops> NewItem in World.Shops)
                {

                    int ShopID = NewItem.Value.ShopID;
                    int ItemType = NewItem.Value.ItemType;
                    int MoneyType = NewItem.Value.MoneyType;
                    if (ShopID == Shop && ItemType == Item)
                    {
                        Struct.ItemData I = World.Items[ItemType];
                        Struct.ItemInfo Items = new Struct.ItemInfo();
                        for (byte x = 0; x < Amount; x++)
                        {
                            Items.Color = new Random().Next(3, 9);
                            Items.ItemID = ItemType;
                            Items.UID = Database.ItemCount += 1;

                            if (Items.ItemID == 730001)
                                Items.Plus = 1;
                            if (Items.ItemID == 730002)
                                Items.Plus = 2;
                            if (Items.ItemID == 730003)
                                Items.Plus = 3;
                            if (Items.ItemID == 730004)
                                Items.Plus = 4;
                            if (Items.ItemID == 730005)
                                Items.Plus = 5;
                            if (Items.ItemID == 730006)
                                Items.Plus = 6;
                            if (Items.ItemID == 730007)
                                Items.Plus = 7;
                            Items.Dura = I.MaxDura;
                            Items.MaxDura = I.MaxDura;
                            if (MoneyType == 0 && CSocket.Client.Money >= I.Cost)
                            {
                                bool created = Database.NewItem(Items, CSocket);
                                while (!created)
                                {
                                    Items.UID = Database.ItemCount += 1;
                                    Database.ItemCount = Items.UID;
                                    created = Database.NewItem(Items, CSocket);
                                }
                                CSocket.Client.Inventory.Add(Items.UID, Items);
                                CSocket.Send(CoPacket.ItemInfo(Items.UID, Items.ItemID, Items.Plus, 0, 0, 0, 0, 0, Items.MaxDura, Items.MaxDura, 0, 0, 0, 0, 0, 0, Items.Color));
                                CSocket.Client.Money -= I.Cost;
                                CSocket.Send(CoPacket.Status(CSocket, 2, CSocket.Client.Money, Struct.StatusTypes.InvMoney));
                                Database.ItemCount = Items.UID;
                                if (FileLogger.LogItemBuy)
                                    FileLogger.ItemBuy(Items, Amount, ShopID, "Gold", CSocket);
                            }
                            else if (MoneyType == 1 && CSocket.Client.Money >= I.CPCost)
                            {
                                bool created = Database.NewItem(Items, CSocket);
                                while (!created)
                                {
                                    Items.UID = Database.ItemCount += 1;
                                    Database.ItemCount = Items.UID;
                                    created = Database.NewItem(Items, CSocket);
                                }
                                CSocket.Client.Inventory.Add(Items.UID, Items);
                                CSocket.Send(CoPacket.ItemInfo(Items.UID, Items.ItemID, Items.Plus, 0, 0, 0, 0, 0, Items.MaxDura, Items.MaxDura, 0, 0, 0, 0, 0, 0, Items.Color));
                                CSocket.Client.CPs -= I.CPCost;
                                CSocket.Send(CoPacket.Status(CSocket, 2, CSocket.Client.CPs, Struct.StatusTypes.InvCPoints));
                                Database.ItemCount = Items.UID;

                            }
                            else
                            {
                                CSocket.Send(CoPacket.Chat(0, "System", CSocket.Client.Name, "[Error] You do not have enough to buy that Item(s)", "yellow", Struct.ChatType.Top));
                            }
                        }
                        if (Amount > 1)
                            if (FileLogger.LogItemBuy)
                                FileLogger.ItemBuy(Items, Amount, ShopID, "Cps", CSocket);
                    }
                }
            }
        }
    }
}
help please

can can some one tell me why this doesnt work

case 18880://elfstar
{
if (LinkBack == 0)
{
Text("Here is some stuff from the Blackmarket?", CSocket);
Link("GoldPrize-10mil cps", 1, CSocket);
Link("SilverPrize-5mil cps", 2, CSocket);
Link("BronzePrize-1mil cps", 3, CSocket);
Link("MoonBox-25k cps", 4, CSocket);
Link("Emerald-10k cps", 5, CSocket);
Link("Nah No thanks!!", 255, CSocket);
End(CSocket);
}
else if (LinkBack == 1)

if (CSocket.Client.CPs >= 10000000)
{
CPs(-10000000, CSocket);
AddItem(2100075, 1, CSocket);
}
else if (LinkBack == 2)
if (CSocket.Client.CPs >= 5000000)
{
CPs(-5000000, CSocket);
AddItem(2100065, 1, CSocket);
}
else if (LinkBack == 3)
if (CSocket.Client.CPs >= 1000000)
{
CPs(-1000000, CSocket);
AddItem(2100055, 1, CSocket);
}
else if (LinkBack == 4)
if (CSocket.Client.CPs >= 25000)
{
CPs(-25000, CSocket);
AddItem(721090, 1, CSocket);
}
else if (LinkBack == 5)
if (CSocket.Client.CPs >= 10000)
{
CPs(-10000, CSocket);
AddItem(1080001, 1, CSocket);
}
else
{
Text("How dare you try to rip me off! Get lost, Or get my money!", CSocket);
Link("I'm sorry, I didn't realize.", 255, CSocket);
End(CSocket);
}
}
break;

it wont let me buy anything but the goldprize
niko40601 is offline  
Old 08/08/2010, 02:56   #2
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,765
Received Thanks: 382
try this:
Code:
case 18880://elfstar
{
if (LinkBack == 0)
{
Text("Here is some stuff from the Blackmarket?", CSocket);
Link("GoldPrize-10mil cps", 1, CSocket);
Link("SilverPrize-5mil cps", 2, CSocket);
Link("BronzePrize-1mil cps", 3, CSocket);
Link("MoonBox-25k cps", 4, CSocket);
Link("Emerald-10k cps", 5, CSocket);
Link("Nah No thanks!!", 255, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
if (CSocket.Client.CPs >= 10000000)
{
CPs(-10000000, CSocket);
AddItem(2100075, 1, CSocket);
}
else
{
Text("How dare you try to rip me off! Get lost, Or get my money!", CSocket);
Link("I'm sorry, I didn't realize.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 2)
{
if (CSocket.Client.CPs >= 5000000)
{
CPs(-5000000, CSocket);
AddItem(2100065, 1, CSocket);
}
else
{
Text("How dare you try to rip me off! Get lost, Or get my money!", CSocket);
Link("I'm sorry, I didn't realize.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 3)
{
if (CSocket.Client.CPs >= 1000000)
{
CPs(-1000000, CSocket);
AddItem(2100055, 1, CSocket);
}
else
{
Text("How dare you try to rip me off! Get lost, Or get my money!", CSocket);
Link("I'm sorry, I didn't realize.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 4)
{
if (CSocket.Client.CPs >= 25000)
{
CPs(-25000, CSocket);
AddItem(721090, 1, CSocket);
}
else
{
Text("How dare you try to rip me off! Get lost, Or get my money!", CSocket);
Link("I'm sorry, I didn't realize.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 5)
{
if (CSocket.Client.CPs >= 10000)
{
CPs(-10000, CSocket);
AddItem(1080001, 1, CSocket);
}
else
{
Text("How dare you try to rip me off! Get lost, Or get my money!", CSocket);
Link("I'm sorry, I didn't realize.", 255, CSocket);
End(CSocket);
}
break;
}
Fish* is offline  
Reply


Similar Threads Similar Threads
Elite Coemu
07/20/2010 - CO2 Private Server - 0 Replies
what is bad about elite coemu ? iv seen a lot of people on this form say its no good but i do not see why can someone please tell me the reason for this.
Elite-CoEmu
07/09/2010 - CO2 Private Server - 0 Replies
I need some help setting up Elite-CoEmu i keep getting errors im running on 64x OS so i switched the servers to 86x otherwise i get the error that is in the attached files like this for world server 10:41 - System.IO.FileLoadException: Could not load file or assembly 'MySql.Data, Version=6.2.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT:...
(help)Elite-CoEmu error
06/14/2010 - CO2 Private Server - 4 Replies
Need help with Elite-CoEmu http://i41.tinypic.com/b8u7vo.jpg
How do i get Elite CoEmu? please help!!!
06/11/2010 - CO2 Private Server - 4 Replies
Okay so i have Elite Coemu downloaded and stuff but if someone could send me a tutorial how to install it? cause idk how to change from coemu to elite coemu please reply and stuff
(help)Elite-CoEmu error
05/13/2010 - CO2 Private Server - 3 Replies
Please help fast http://i40.tinypic.com/ddwtu.jpg



All times are GMT +1. The time now is 20:48.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.