محمد ياسر
2019-04-24, 09:08 AM
شفره لما تبقي عايز تجيب ايتم بوند الايتم هيجي معاك بوند
هتبقي زي الشفره العاديه الي هيا كده مثلا
خش فالاضافة ع طول .
في الباكت هندل
ابحث عن
case "item":
وضيف دة فوقها أو تحتها ,
case "Harrybound":
{
if (Data.Length > 2)
{
string ItemName = Data[1].ToLower();
Game.Enums.ItemQuality Quality = Game.Enums.ItemQuality.Fixed;
switch (Data[2].ToLower())
{
case "fixed": Quality = Game.Enums.ItemQuality.Fixed; break;
case "normal": Quality = Game.Enums.ItemQuality.Normal; break;
case "normalv1": Quality = Game.Enums.ItemQuality.NormalV1; break;
case "normalv2": Quality = Game.Enums.ItemQuality.NormalV2; break;
case "normalv3": Quality = Game.Enums.ItemQuality.NormalV3; break;
case "refined": Quality = Game.Enums.ItemQuality.Refined; break;
case "unique": Quality = Game.Enums.ItemQuality.Unique; break;
case "elite": Quality = Game.Enums.ItemQuality.Elite; break;
case "super": Quality = Game.Enums.ItemQuality.Super; break;
case "other": Quality = Game.Enums.ItemQuality.Other; break;
default:
{
Quality = (Game.Enums.ItemQuality)int.Parse(Data[2]);
break;
}
}
Database.ConquerItemBaseInformation CIBI = null;
foreach (Database.ConquerItemBaseInformation infos in Database.ConquerItemInformation.BaseInformations.V alues)
{
if (infos.LoweredName == ItemName && Quality == (Game.Enums.ItemQuality)(infos.ID % 10))
{
CIBI = infos;
}
}
if (CIBI == null)
break;
ConquerItem newItem = new GamePackets.ConquerItem(true);
newItem.ID = CIBI.ID;
newItem.Durability = CIBI.Durability;
newItem.MaximDurability = CIBI.Durability;
if (Data.Length > 3)
{
byte plus = 0;
byte.TryParse(Data[3], out plus);
newItem.Plus = Math.Min((byte)12, plus);
if (Data.Length > 4)
{
byte bless = 0;
byte.TryParse(Data[4], out bless);
newItem.Bless = Math.Min((byte)7, bless);
if (Data.Length > 5)
{
byte ench = 0;
byte.TryParse(Data[5], out ench);
newItem.Enchant = Math.Min((byte)255, ench);
if (Data.Length > 6)
{
byte soc1 = 0;
byte.TryParse(Data[6], out soc1);
if (Enum.IsDefined(typeof(Game.Enums.Gem), soc1))
{
newItem.SocketOne = (Game.Enums.Gem)soc1;
}
if (Data.Length > 7)
{
byte soc2 = 0;
byte.TryParse(Data[7], out soc2);
if (Enum.IsDefined(typeof(Game.Enums.Gem), soc2))
{
newItem.SocketTwo = (Game.Enums.Gem)soc2;
}
}
if (Data.Length > 10)
{
byte R = 0, G = 0, B = 0;
byte.TryParse(Data[8], out R);
byte.TryParse(Data[9], out G);
byte.TryParse(Data[10], out B);
newItem.SocketProgress = (uint)(B | (G << 8) | (R << 16));
}
}
}
}
}
newItem.Color = (Game.Enums.Color)Kernel.Random.Next(4, 8);
if (client.Account.State == Database.AccountTable.AccountState.Administrator)
newItem.Bound = true;
client.Inventory.Add(newItem, Game.Enums.ItemUse.CreateAndAdd);
client.Send("Item ID " + newItem.ID);
}
break;
}
الشفرة هتبقى كدة
@Harrybound Name 12 7 255 13 13
هتبقي زي الشفره العاديه الي هيا كده مثلا
خش فالاضافة ع طول .
في الباكت هندل
ابحث عن
case "item":
وضيف دة فوقها أو تحتها ,
case "Harrybound":
{
if (Data.Length > 2)
{
string ItemName = Data[1].ToLower();
Game.Enums.ItemQuality Quality = Game.Enums.ItemQuality.Fixed;
switch (Data[2].ToLower())
{
case "fixed": Quality = Game.Enums.ItemQuality.Fixed; break;
case "normal": Quality = Game.Enums.ItemQuality.Normal; break;
case "normalv1": Quality = Game.Enums.ItemQuality.NormalV1; break;
case "normalv2": Quality = Game.Enums.ItemQuality.NormalV2; break;
case "normalv3": Quality = Game.Enums.ItemQuality.NormalV3; break;
case "refined": Quality = Game.Enums.ItemQuality.Refined; break;
case "unique": Quality = Game.Enums.ItemQuality.Unique; break;
case "elite": Quality = Game.Enums.ItemQuality.Elite; break;
case "super": Quality = Game.Enums.ItemQuality.Super; break;
case "other": Quality = Game.Enums.ItemQuality.Other; break;
default:
{
Quality = (Game.Enums.ItemQuality)int.Parse(Data[2]);
break;
}
}
Database.ConquerItemBaseInformation CIBI = null;
foreach (Database.ConquerItemBaseInformation infos in Database.ConquerItemInformation.BaseInformations.V alues)
{
if (infos.LoweredName == ItemName && Quality == (Game.Enums.ItemQuality)(infos.ID % 10))
{
CIBI = infos;
}
}
if (CIBI == null)
break;
ConquerItem newItem = new GamePackets.ConquerItem(true);
newItem.ID = CIBI.ID;
newItem.Durability = CIBI.Durability;
newItem.MaximDurability = CIBI.Durability;
if (Data.Length > 3)
{
byte plus = 0;
byte.TryParse(Data[3], out plus);
newItem.Plus = Math.Min((byte)12, plus);
if (Data.Length > 4)
{
byte bless = 0;
byte.TryParse(Data[4], out bless);
newItem.Bless = Math.Min((byte)7, bless);
if (Data.Length > 5)
{
byte ench = 0;
byte.TryParse(Data[5], out ench);
newItem.Enchant = Math.Min((byte)255, ench);
if (Data.Length > 6)
{
byte soc1 = 0;
byte.TryParse(Data[6], out soc1);
if (Enum.IsDefined(typeof(Game.Enums.Gem), soc1))
{
newItem.SocketOne = (Game.Enums.Gem)soc1;
}
if (Data.Length > 7)
{
byte soc2 = 0;
byte.TryParse(Data[7], out soc2);
if (Enum.IsDefined(typeof(Game.Enums.Gem), soc2))
{
newItem.SocketTwo = (Game.Enums.Gem)soc2;
}
}
if (Data.Length > 10)
{
byte R = 0, G = 0, B = 0;
byte.TryParse(Data[8], out R);
byte.TryParse(Data[9], out G);
byte.TryParse(Data[10], out B);
newItem.SocketProgress = (uint)(B | (G << 8) | (R << 16));
}
}
}
}
}
newItem.Color = (Game.Enums.Color)Kernel.Random.Next(4, 8);
if (client.Account.State == Database.AccountTable.AccountState.Administrator)
newItem.Bound = true;
client.Inventory.Add(newItem, Game.Enums.ItemUse.CreateAndAdd);
client.Send("Item ID " + newItem.ID);
}
break;
}
الشفرة هتبقى كدة
@Harrybound Name 12 7 255 13 13