|
المشاركات 50 |
+التقييم 0.03 |
تاريخ التسجيل Jul 2019 |
الاقامة زعـلأان منـكك !! |
نظام التشغيل مبـرشـم ♥ |
رقم العضوية 448 |
case ItemUsage.SplitStack
case ItemUsage.SplitStack:
{
ConquerItem MyItem = null;
ConquerItem NewStack = new ConquerItem(true);
if (client.Inventory.TryGetItem(usage.UID, out MyItem))
{
Database.ConquerItemInformation infos = new ConquerOnline.Database.ConquerItemInformation(MyItem.ID, 0);
if (MyItem.StackSize > 1 && MyItem.StackSize <= infos.BaseInformation.StackSize)
{
if (client.Inventory.Count < 40)
{
ushort Amount = (ushort)usage.dwParam;
if (MyItem.StackSize > Amount)
{
MyItem.StackSize -= Amount;
MyItem.Mode = Game.Enums.ItemMode.Update;
MyItem.Send(client);
MyItem.Mode = Game.Enums.ItemMode.Default;
MyItem.MaxStackSize = infos.BaseInformation.StackSize;
NewStack.ID = MyItem.ID;
NewStack.StackSize += Amount;
NewStack.Durability = MyItem.Durability;
NewStack.MaxStackSize = infos.BaseInformation.StackSize;
client.Inventory.Add(NewStack, Game.Enums.ItemUse.CreateAndAdd);
Database.ConquerItemTable.UpdateStack(MyItem);
}
}
}
}
break;
}
case ItemUsage.MergeStackableItems:
case ItemUsage.MergeStackableItems:
{
ConquerItem MyItem = null;
ConquerItem MergeStack = new ConquerItem(true);
Database.ConquerItemInformation infos = null;
if (client.Inventory.TryGetItem(usage.UID, out MyItem) && client.Inventory.TryGetItem((uint)usage.dwParam, out MergeStack))
{
if (MyItem.ID == MergeStack.ID)
{
infos = new ConquerOnline.Database.ConquerItemInformation(MyItem.ID, 0);
if (MyItem.StackSize < 1)
MyItem.StackSize = 1;
if (MergeStack.StackSize < 1)
MergeStack.StackSize = 1;
if ((MyItem.StackSize + MergeStack.StackSize) <= infos.BaseInformation.StackSize)
{
MyItem.StackSize += MergeStack.StackSize;
MyItem.Mode = Game.Enums.ItemMode.Update;
MyItem.Send(client);
MyItem.Mode = Game.Enums.ItemMode.Default;
Database.ConquerItemTable.UpdateStack(MyItem);
client.Inventory.Remove(MergeStack, Game.Enums.ItemUse.Remove);
}
}
}
break;
}
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
أدوات الموضوع | |
|