Quote:
Originally Posted by abdoumatrix
case votepoints:
in HandleBuyFromNpc
|
i have to try that
PHP Code:
case Conquer_Online_Server.Database.ShopFile.MoneyType.TreasuerPoints:
{
if (iteminfo.BaseInformation.TreasuerPointsWorth * Amount > client.Entity.TreasuerPoints)
return;
if (client.Entity.TreasuerPoints - (iteminfo.BaseInformation.TreasuerPointsWorth * Amount) > client.Entity.TreasuerPoints)
return;
item.ID = itemUsage.dwParam;
item.Durability = item.MaximDurability = iteminfo.BaseInformation.Durability;
item.Color = (Conquer_Online_Server.Game.Enums.Color)3;
uint NewAmount = itemUsage.dwExtraInfo > 0 ? itemUsage.dwExtraInfo : 1;
while (NewAmount > 0)
{
if (iteminfo.BaseInformation.StackSize == 0)
{
item = new ConquerItem(true);
item.ID = itemUsage.dwParam;
item.Durability = item.MaximDurability = iteminfo.BaseInformation.Durability;
item.Color = (Conquer_Online_Server.Game.Enums.Color)3;
client.Inventory.Add(item, Game.Enums.ItemUse.CreateAndAdd);
item.MaxStackSize = item.StackSize = 1;
NewAmount--;
}
else
{
if (client.Inventory.GetStackContainer(iteminfo.BaseInformation.ID, iteminfo.BaseInformation.StackSize, 1, out _ExistingItem))
{
_ExistingItem.StackSize++;
Database.ConquerItemTable.UpdateStack(_ExistingItem);
_ExistingItem.Mode = Game.Enums.ItemMode.Update;
_ExistingItem.Send(client);
NewAmount -= 1;
}
else
{
item = new ConquerItem(true);
item.ID = itemUsage.dwParam;
item.Durability = item.MaximDurability = iteminfo.BaseInformation.Durability;
item.Color = (Conquer_Online_Server.Game.Enums.Color)3;
item.MaxStackSize = iteminfo.BaseInformation.StackSize;
item.StackSize = 1;
if (NewAmount >= item.MaxStackSize)
{
item.StackSize = item.MaxStackSize;
NewAmount -= item.StackSize;
}
else
{
item.StackSize = (ushort)NewAmount;
NewAmount = 0;
}
client.Inventory.Add(item, Game.Enums.ItemUse.CreateAndAdd);
Database.ConquerItemTable.UpdateStack(item);
}
}
}
client.Entity.TreasuerPoints -= (iteminfo.BaseInformation.TreasuerPointsWorth * Amount);
break;
}
and use
PHP Code:
public enum MoneyType
{
Gold = 0,
ConquerPoints = 1,
HonorPoints = 2,
TreasuerPoints = 18
and made shop in my emoneyshop and use moneytype 18
and made npc in navicat
try with type 18 and try with type 1
when i use type 18 i got no replay from npc
and when i use type 1 i got CP mall but he selling items to me for 0 cps or 0 money or 0 TreasuerPoints
Quote:
Originally Posted by pintinho12
Well, you add all items you want to sell on your table, assign them to a shop, set a moneytype, example, 1 silver, 2 cps, 3 bcps, 4 vote points
Then when buying, you just search on your dictionary if that item exists on that shop and handle the right moneytype
|
cant make table in navicat do that
i try to make it with C# codes same like honer shops