|
|
المشاركات 222 |
+التقييم 0.13 |
تاريخ التسجيل Feb 2020 |
الاقامة اسكندريه |
نظام التشغيل C#C |
رقم العضوية 3522 |
tempX = (ushort)Kernel.Random.Next(0, 300);
tempY = (ushort)Kernel.Random.Next(0, 300);
SocketTalismanWithItem(ItemUsage itemUsage, Client.GameState client)
static void LockItem(ItemLock itemLock, Client.GameState client)
{
ConquerItem item = null;
if (client.Inventory.TryGetItem(itemLock.UID, out item))
{
itemLock.ID = 1;
item.Lock = 1;
item.Mode = Game.Enums.ItemMode.Update;
client.Send(itemLock);
item.Send(client);
Database.ConquerItemTable.UpdateLock(item);
}
else if (client.Equipment.TryGetItem(itemLock.UID) != null)
{
item = client.Equipment.TryGetItem(itemLock.UID);
itemLock.ID = 1;
item.Lock = 1;
item.Mode = Game.Enums.ItemMode.Update;
client.Send(itemLock);
item.Send(client);
Database.ConquerItemTable.UpdateLock(item);
}
}
static void UnlockItemInstant(ItemLock itemLock, Client.GameState client)
{
ConquerItem item = null;
if (client.Inventory.TryGetItem(itemLock.UID, out item))
{
if (item.Lock == 1)
{
item.Lock = 0;
item.Mode = Game.Enums.ItemMode.Update;
item.Send(client);
Database.ConquerItemTable.UpdateLock(item);
}
else
client.Send(new Message("Can't unlock an item that is in progress of unlocking.", System.Drawing.Color.FloralWhite, Message.TopLeft));
}
}
static void UnlockItem5Days(ItemLock itemLock, Client.GameState client)
{
ConquerItem item = null;
if (client.Inventory.TryGetItem(itemLock.UID, out item))
{
if (item.Lock == 1)
{
item.Lock = 2;
item.UnlockEnd = DateTime.Now.AddDays(5);
item.Mode = Game.Enums.ItemMode.Update;
item.Send(client);
Database.ConquerItemTable.UpdateLock(item);
}
else
client.Send(new Message("Can't unlock an item that is in progress of unlocking.", System.Drawing.Color.FloralWhite, Message.TopLeft));
}
}
sockettalismanwithitem(itemusage itemusage, client.gamestate client)
static void lockitem(itemlock itemlock, client.gamestate client)
{
conqueritem item = null;
if (client.inventory.trygetitem(itemlock.uid, out item))
{
itemlock.id = 1;
item.lock = 1;
item.mode = game.enums.itemmode.update;
client.send(itemlock);
item.send(client);
database.conqueritemtable.updatelock(item);
}
else if (client.equipment.trygetitem(itemlock.uid) != null)
{
item = client.equipment.trygetitem(itemlock.uid);
itemlock.id = 1;
item.lock = 1;
item.mode = game.enums.itemmode.update;
client.send(itemlock);
item.send(client);
database.conqueritemtable.updatelock(item);
}
}
static void unlockiteminstant(itemlock itemlock, client.gamestate client)
{
conqueritem item = null;
if (client.inventory.trygetitem(itemlock.uid, out item))
{
if (item.lock == 1)
{
item.lock = 0;
item.mode = game.enums.itemmode.update;
item.send(client);
database.conqueritemtable.updatelock(item);
}
else
client.send(new message("can't unlock an item that is in progress of unlocking.", system.drawing.color.floralwhite, message.topleft));
}
}
static void unlockitem5days(itemlock itemlock, client.gamestate client)
{
conqueritem item = null;
if (client.inventory.trygetitem(itemlock.uid, out item))
{
if (item.lock == 1)
{
item.lock = 2;
item.unlockend = datetime.now.adddays(5);
item.mode = game.enums.itemmode.update;
item.send(client);
database.conqueritemtable.updatelock(item);
}
else
client.send(new message("can't unlock an item that is in progress of unlocking.", system.drawing.color.floralwhite, message.topleft));
}
}
case 2202:
#region ItemLock (2048)
case 2048:
{
if (client.Action != 2)
return;
ItemLock itemlock = new ItemLock(false);
itemlock.Deserialize(packet);
switch (itemlock.ID)
{
case ItemLock.RequestLock:
LockItem(itemlock, client);
break;
case ItemLock.RequestUnlock:
if (client.Player.VIPLevel == 6)
{
client.ItemUnlockPacket = itemlock;
Npcs dialog = new Npcs(client);
client.ActiveNpc = 9999995;
}
else
UnlockItem5Days(itemlock, client);
break;
}
break;
}
#endregion
|
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
|