|
المشاركات 250 |
+التقييم 0.13 |
تاريخ التسجيل Aug 2019 |
الاقامة ونـت مـال امك ! |
نظام التشغيل يــأ 2020 |
رقم العضوية 539 |
public static void PurifyItem
public static void PurifyItem(MsgQuench ps, Client.GameState client)
{
MsgItemInfo Item = null, AddingItem = null;
if (client.Inventory.TryGetItem(ps.ItemUID, out Item) && client.Inventory.TryGetItem(ps.AddUID, out AddingItem))
{
if (ps.ItemUID == ps.AddUID)
return;
var PurifyInformation = Database.ConquerItemInformation.BaseInformations[AddingItem.ID];
var ItemInformation = Database.ConquerItemInformation.BaseInformations[Item.ID];
if (PurifyInformation.PurificationLevel > 0)
{
if (ItemInformation.Level >= PurifyInformation.Level)
{
var doPurify = false;
if (client.Inventory.Contains(720027, (ushort)(PurifyInformation.PurificationMeteorNeed / 10)))
{
client.Inventory.Remove(720027, (byte)(PurifyInformation.PurificationMeteorNeed / 10));
doPurify = true;
}
if (!doPurify && client.Inventory.Contains(1088001, PurifyInformation.PurificationMeteorNeed))
{
client.Inventory.Remove(1088001, (byte)PurifyInformation.PurificationMeteorNeed);
doPurify = true;
}
if (doPurify)
{
if (Item.Purification.PurificationItemID > 0)
Database.ItemAddingTable.RemoveAdding(Item.UID, Item.Purification.PurificationItemID);
client.Send(ps);
ItemAdding.Purification_ purify = new ItemAdding.Purification_();
purify.AddedOn = DateTime.Now;
purify.Available = true;
purify.ItemUID = ps.ItemUID;
purify.PurificationLevel = PurifyInformation.PurificationLevel;
if (client.Player.VIPLevel == 1)
purify.PurificationDuration = 8 * 24 * 60 * 60;
else if (client.Player.VIPLevel == 2)
purify.PurificationDuration = 9 * 24 * 60 * 60;
else if (client.Player.VIPLevel == 3)
purify.PurificationDuration = 11 * 24 * 60 * 60;
else if (client.Player.VIPLevel == 4)
purify.PurificationDuration = 14 * 24 * 60 * 60;
else if (client.Player.VIPLevel == 5)
purify.PurificationDuration = 14 * 24 * 60 * 60;
else if (client.Player.VIPLevel == 6)
purify.PurificationDuration = 14 * 24 * 60 * 60;
else if (client.Player.VIPLevel == 0)
purify.PurificationDuration = 7 * 24 * 60 * 60;
purify.PurificationItemID = AddingItem.ID;
Database.ItemAddingTable.AddPurification(purify);
Item.Purification = purify;
Item.Mode = COServer.Game.Enums.ItemMode.Update;
Item.Send(client);
client.Inventory.Remove(AddingItem, COServer.Game.Enums.ItemUse.Remove);
client.CalculateStatBonus();
client.LoadItemStats();
// client.ReshareClan();
if (client.Team != null)
foreach (var teammate in client.Team.Teammates)
// teammate.ReshareClan();
client.CalculateHPBonus();
client.Send(ps);
}
}
}
}
}