thanks how about the horseRacePoints
I have tried to used the bound conquer points with this code in the Packet Handler
PHP Code:
case Conquer_Online_Server.Database.ShopFile.MoneyType.BoundConquerPoints:
{
if (iteminfo.BaseInformation.ConquerPointsWorth * Amount > client.Entity.BoundConquerPoints)
return;
if (client.Entity.BoundConquerPoints - (iteminfo.BaseInformation.ConquerPointsWorth * Amount) > client.Entity.BoundConquerPoints)
return;
item.ID = itemUsage.dwParam;
if (item.ID % 730000 <= 12)
item.Plus = (Byte)(item.ID % 730000);
item.Color = (Conquer_Online_Server.Game.Enums.Color)ServerBase.Kernel.Random.Next(4, 8);
item.Durability = item.MaximDurability = iteminfo.BaseInformation.Durability;
uint NewAmount = itemUsage.dwExtraInfo > 0 ? itemUsage.dwExtraInfo : 1;
while (NewAmount > 0)
{
if (client.Inventory.Contains(iteminfo.BaseInformation.ID, iteminfo.BaseInformation.StackSize, out _ExistingItem))
{
if (_ExistingItem.StackSize == 0)
_ExistingItem.StackSize = 1;
ushort _StackCount = iteminfo.BaseInformation.StackSize;
_StackCount -= (ushort)_ExistingItem.StackSize;
if (_StackCount >= NewAmount)
_StackCount = (ushort)NewAmount;
_ExistingItem.StackSize += _StackCount;
Database.ConquerItemTable.UpdateStack(_ExistingItem);
_ExistingItem.Mode = Game.Enums.ItemMode.Update;
_ExistingItem.Send(client);
_ExistingItem.Mode = Game.Enums.ItemMode.Default;
NewAmount -= _StackCount;
//uint _TotalItemStacks = Math.Min(1, (itemUsage.dwExtraInfo / iteminfo.BaseInformation.StackSize));
}
else
{
if (iteminfo.BaseInformation.StackSize > 1 && itemUsage.dwExtraInfo > 1)
{
item = new ConquerItem(true);
item.ID = itemUsage.dwParam;
item.Bound = true;
item.Durability = item.MaximDurability = iteminfo.BaseInformation.Durability;
item.Color = (Conquer_Online_Server.Game.Enums.Color)3;
ushort _StackCount = iteminfo.BaseInformation.StackSize;
if (NewAmount <= iteminfo.BaseInformation.StackSize)
_StackCount = (ushort)NewAmount;
item.StackSize = (ushort)_StackCount;
client.Inventory.Add(item, Game.Enums.ItemUse.CreateAndAdd);
Database.ConquerItemTable.UpdateStack(item);
NewAmount -= _StackCount;
}
else
{
if ((itemUsage.dwParam % 730000) <= 12)
{
Interfaces.IConquerItem newItem = new GamePackets.ConquerItem(true);
newItem.ID = itemUsage.dwParam;
newItem.Bound = true;
newItem.Plus = (Byte)(newItem.ID % 730000);
client.Inventory.Add(newItem, Game.Enums.ItemUse.CreateAndAdd);
}
else
{
item = new ConquerItem(true);
item.ID = itemUsage.dwParam;
item.Bound = true;
item.Durability = item.MaximDurability = iteminfo.BaseInformation.Durability;
item.Color = (Conquer_Online_Server.Game.Enums.Color)3;
item.StackSize = 1;
client.Inventory.Add(item, Game.Enums.ItemUse.CreateAndAdd);
}
NewAmount--;
}
}
}
client.Entity.BoundConquerPoints -= (iteminfo.BaseInformation.ConquerPointsWorth * Amount);
break;
}
with this shofile
PHP Code:
public static class ShopFile
{
public static Dictionary<uint, Shop> Shops;
public class Shop
{
public uint UID;
public MoneyType MoneyType;
public int Count { get { return Items.Count; } }
public List<uint> Items;
public Dictionary<UInt32, HonorShopItem> HonorShopItems;
public class HonorShopItem
{
public uint cost;
public uint itemid;
}
}
public static void LoadHonorShop()
{
String[] text = File.ReadAllLines("database\\honorshop.ini");
Shop shop = new Shop();
shop.UID = 6000;
shop.MoneyType = MoneyType.HonorPoints;
shop.HonorShopItems = new Dictionary<uint, Shop.HonorShopItem>();
for (int x = 0; x < text.Length; x++)
{
String line = text[x];
String[] split = line.Split(',');
if (Convert.ToUInt32(split[0]) != 0)
{
if (!shop.HonorShopItems.ContainsKey(Convert.ToUInt32(split[0])))
{
Shop.HonorShopItem shopi = new Shop.HonorShopItem();
shopi.cost = Convert.ToUInt32(split[1]);
shopi.itemid = Convert.ToUInt32(split[0]);
shop.HonorShopItems.Add(shopi.itemid, shopi);
}
}
}
Shops.Add(6000, shop);
}
public static void Load()
{
string[] text = File.ReadAllLines(ServerBase.Constants.ShopsPath);
Shop shop = new Shop();
for (int x = 0; x < text.Length; x++)
{
string line = text[x];
string[] split = line.Split('=');
if (split[0] == "Amount")
Shops = new Dictionary<uint, Shop>(int.Parse(split[1]));
else if (split[0] == "ID")
{
if (shop.UID == 0)
shop.UID = uint.Parse(split[1]);
else
{
if (!Shops.ContainsKey(shop.UID))
{
Shops.Add(shop.UID, shop);
shop = new Shop();
shop.UID = uint.Parse(split[1]);
}
}
}
else if (split[0] == "MoneyType")
{
shop.MoneyType = (MoneyType)byte.Parse(split[1]);
}
else if (split[0] == "ItemAmount")
{
shop.Items = new List<uint>(ushort.Parse(split[1]));
}
else if (split[0].Contains("Item") && split[0] != "ItemAmount")
{
uint ID = uint.Parse(split[1]);
if (!shop.Items.Contains(ID))
shop.Items.Add(ID);
}
}
if (!Shops.ContainsKey(shop.UID))
{
Shops.Add(shop.UID, shop);
}
LoadHonorShop();
Program.WriteLine("Shops information loaded.");
}
public enum MoneyType
{
Gold = 0,
ConquerPoints = 1,
BoundConquerPoints = 3, //2
HonorPoints = 4
}
}
with this one
PHP Code:
public uint BoundConquerPoints
{
get { return _BoundConquerPoints; }
set
{
if (value <= 0)
value = 0;
_BoundConquerPoints = value;
if (EntityFlag == EntityFlag.Player)
Update(Network.GamePackets.Update.BoundConquerPoints, (uint)value, false);
}
}
seems like it only affect the ConquerPoints not the BoundConquerPoints