المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : مشـكــلة بخـصـووص اللـوتــري .


osama
2019-08-08, 01:29 AM
يجماعة ونا بفتح الصندوق الوترى لو انا معي 75 لوترى فى بعض مثلان بيخدهم كلهم مرة واحدة

حاجة لما اشترى الوترى من الشوب مين المفورد لما تفتحهم ينضمو كلهم فى بعض لا بيعمل كل 3 لوحدهم لاازم انتة الى تحطهم فى بعض

اية الحل يا شباب

Tefa
2019-08-08, 04:55 AM
كلك يمين ع كود بتاع Remove,Add
و ابعتهملي هنا ف شات

osama
2019-08-08, 07:35 AM
مش فاهم انا ساحب سيستم الوترى من سورس KhaledMohamed v3
لو معاك السيستم كامل يريت لو تجيب الاضافة علشاان السورس صعب فا محتاج السيستم كامل

Tefa
2019-08-08, 08:31 AM
كود مسئول عن اضافة ايتم في السورس inventory.cs
اسحبهم هما كمان من سورس خالد محمد
اي public bool Add(
او remove اسحبهم للسورس بتاعك

osama
2019-08-08, 11:17 AM
كود مسئول عن اضافة ايتم في السورس inventory.cs
اسحبهم هما كمان من سورس خالد محمد
اي public bool add(
او remove اسحبهم للسورس بتاعك

لى الاسف السورس حليا انا مسحو من على الجهاز لو الاكواد جاهزة معاك ياريت يا ريدر لو تجبها معلشى هتعبك معية
انا عاوز اخلى الوترى شغالة زى اون لااين

Tefa
2019-08-08, 02:11 PM
public bool Add(uint id, byte plus, byte times, bool bound = false)
{
try
{
Database.ConquerItemInformation infos = new Database.ConquerItemInformation(id, plus);
while (times > 0)
{
if (Count <= 39)
{
ConquerItem item;
item = new ConquerItem(true);
{
#region Stacksize
if (infos.BaseInformation.StackSize > 1)
{
//item.StackSize = (byte)times;
ushort _StackCount = infos.BaseInformation.StackSize;
if (times <= infos.BaseInformation.StackSize)
_StackCount = (ushort)times;
item.StackSize = (ushort)_StackCount;
Database.ConquerItemTable.UpdateStack(item);
times -= (byte)_StackCount;
}
else
{
item = new ConquerItem(true);
item.StackSize = 1;
times--;
}
#endregion Stacksize
item.ID = id;
item.Plus = plus;
item.Durability = item.MaximDurability = infos.BaseInformation.Durability;

};
this.Add(item, Enums.ItemUse.CreateAndAdd);
}
else
{
return false;
}
// times--;
}
}
catch (Exception e)
{
Program.SaveException(e);
}
return true;
}

public bool Add(uint id, byte plus, byte times, byte soc1, byte soc2, byte Bless = 0)
{
Database.ConquerItemInformation infos = new Database.ConquerItemInformation(id, plus);
while (times > 0)
{
if (Count <= 39)
{
ConquerItem item = new Network.GamePackets.ConquerItem(true);
item.ID = id;
item.Plus = plus;
//if (soc1 != 0)
item.SocketOne = (Enums.Gem)soc1;
item.SocketTwo = (Enums.Gem)soc2;
item.Bless = Bless;
item.Durability = item.MaximDurability = infos.BaseInformation.Durability;
Add(item, Enums.ItemUse.CreateAndAdd);
}
else
{
return false;
}
times--;
}
return true;
}
public bool Add(uint id, Game.Enums.ItemEffect effect)
{
try
{
ConquerItem item = new Network.GamePackets.ConquerItem(true);
item.ID = id;
item.Effect = effect;
Database.ConquerItemInformation infos = new Database.ConquerItemInformation(id, 0);
item.Durability = item.MaximDurability = infos.BaseInformation.Durability;
if (Count <= 39)
{
Add(item, Enums.ItemUse.CreateAndAdd);
}
else
{
return false;
}
}
catch (Exception e)
{
Program.SaveException(e);
}
return true;
}
public bool Add(ConquerItem item, Enums.ItemUse use)
{
try
{
if (!Database.ConquerItemInformation.BaseInformations .ContainsKey(item.ID))
return true;
if (Count == 40)
{
Owner.Send(Constants.FullInventory);
return false;
}
if (!inventory.ContainsKey(item.UID))
{
item.Position = 0;
switch (use)
{
case Enums.ItemUse.CreateAndAdd:
item.UID = KhaledMohamed.Network.GamePackets.ConquerItem.Item UID.Next;
Database.ConquerItemTable.AddItem(ref item, Owner);
Database.ConquerItemTable.Update_Free(item, Owner);
item.MobDropped = false;
break;
case Enums.ItemUse.Add:
Database.ConquerItemTable.UpdateLocation(item, Owner);
break;
case Enums.ItemUse.Move:
item.Position = 0;
item.StatsLoaded = false;
Database.ConquerItemTable.UpdateLocation(item, Owner);
break;
}
if (use != Enums.ItemUse.None)
Database.ItemLog.LogItem(item.UID, Owner.Entity.UID, KhaledMohamed.Database.ItemLog.ItemLogAction.Add);
lock (inventory)
{
if (!inventory.ContainsKey(item.UID))
{
inventory.Add(item.UID, item);
}
}
objects = inventory.Values.ToArray();
item.Mode = Enums.ItemMode.Default;
if (use != Enums.ItemUse.None)
item.Send(Owner);

//Data data = new Data(true);
//data.ID = Data.OpenCustom;
//data.UID = Owner.Entity.UID;
//data.TimeStamp = Time32.Now;
//data.dwParam = 3382;
//data.wParam1 = Owner.Entity.X;
//data.wParam2 = Owner.Entity.Y;
//Owner.Send(data);
return true;
}
}
catch (Exception e)
{
Program.SaveException(e);
}
return false;
}

public bool Remove(ConquerItem item, Enums.ItemUse use)
{
try
{
if (inventory.ContainsKey(item.UID))
{
switch (use)
{
case Enums.ItemUse.RemoveFromStack:
{
if (item.StackSize > 1)
{
item.StackSize -= 1;
Database.ConquerItemTable.UpdateStack(item);
item.Mode = Game.Enums.ItemMode.Update;
item.Send(Owner);
return true;
}
else
{
Database.ConquerItemTable.RemoveItem(item.UID);
}
break;
}
case Enums.ItemUse.Remove:
case Enums.ItemUse.Delete:
Database.ConquerItemTable.RemoveItem(item.UID); break;
case Enums.ItemUse.Move: Database.ConquerItemTable.UpdateLocation(item, Owner); break;
}
Database.ItemLog.LogItem(item.UID, Owner.Entity.UID, KhaledMohamed.Database.ItemLog.ItemLogAction.Remov e);

inventory.Remove(item.UID);
objects = inventory.Values.ToArray();
Network.GamePackets.ItemUsage iu = new Network.GamePackets.ItemUsage(true);
iu.UID = item.UID;
iu.ID = Network.GamePackets.ItemUsage.RemoveInventory;
Owner.Send(iu);
return true;
}
}
catch (Exception e)
{
Program.SaveException(e);
}
return false;
}
public bool Remove(ConquerItem item, Enums.ItemUse use, bool equipment)
{
try
{
if (inventory.ContainsKey(item.UID))
{
inventory.Remove(item.UID);
objects = inventory.Values.ToArray();
Network.GamePackets.ItemUsage iu = new Network.GamePackets.ItemUsage(true);
iu.UID = item.UID;
iu.ID = Network.GamePackets.ItemUsage.RemoveInventory;
Owner.Send(iu);
return true;
}
}
catch (Exception e)
{
Program.SaveException(e);
}
return false;
}
public bool Remove(uint UID, Enums.ItemUse use, bool sendRemove)
{
try
{
if (inventory.ContainsKey(UID))
{
switch (use)
{
case Enums.ItemUse.Remove: Database.ConquerItemTable.RemoveItem(UID); break;
case Enums.ItemUse.Move: Database.ConquerItemTable.UpdateLocation(inventory[UID], Owner); break;
}
Database.ItemLog.LogItem(UID, Owner.Entity.UID, KhaledMohamed.Database.ItemLog.ItemLogAction.Remov e);
inventory.Remove(UID);
objects = inventory.Values.ToArray();
if (sendRemove)
{
Network.GamePackets.ItemUsage iu = new Network.GamePackets.ItemUsage(true);
iu.UID = UID;
iu.ID = Network.GamePackets.ItemUsage.RemoveInventory;
Owner.Send(iu);
}
return true;
}
}
catch (Exception e)
{
Program.SaveException(e);
}
return false;
}
public bool Remove(string name)
{
try
{
string loweredName = name.ToLower();
foreach (var item in inventory.Values)
{
if (Database.ConquerItemInformation.BaseInformations[item.ID].LowerName == loweredName)
{
Database.ItemLog.LogItem(item.UID, Owner.Entity.UID, KhaledMohamed.Database.ItemLog.ItemLogAction.Remov e);
Remove(item, Enums.ItemUse.Remove);
Network.GamePackets.ItemUsage iu = new Network.GamePackets.ItemUsage(true);
iu.UID = item.UID;
iu.ID = Network.GamePackets.ItemUsage.RemoveInventory;
Owner.Send(iu);
return true;
}
}
}
catch (Exception e)
{
Program.SaveException(e);
}
return false;
}

osama
2019-08-08, 08:54 PM
public bool Add(uint id, byte plus, byte times, bool bound = false)
{
try
{
Database.ConquerItemInformation infos = new Database.ConquerItemInformation(id, plus);
while (times > 0)
{
if (Count <= 39)
{
ConquerItem item;
item = new ConquerItem(true);
{
#region Stacksize
if (infos.BaseInformation.StackSize > 1)
{
//item.StackSize = (byte)times;
ushort _StackCount = infos.BaseInformation.StackSize;
if (times <= infos.BaseInformation.StackSize)
_StackCount = (ushort)times;
item.StackSize = (ushort)_StackCount;
Database.ConquerItemTable.UpdateStack(item);
times -= (byte)_StackCount;
}
else
{
item = new ConquerItem(true);
item.StackSize = 1;
times--;
}
#endregion Stacksize
item.ID = id;
item.Plus = plus;
item.Durability = item.MaximDurability = infos.BaseInformation.Durability;

};
this.Add(item, Enums.ItemUse.CreateAndAdd);
}
else
{
return false;
}
// times--;
}
}
catch (Exception e)
{
Program.SaveException(e);
}
return true;
}

public bool Add(uint id, byte plus, byte times, byte soc1, byte soc2, byte Bless = 0)
{
Database.ConquerItemInformation infos = new Database.ConquerItemInformation(id, plus);
while (times > 0)
{
if (Count <= 39)
{
ConquerItem item = new Network.GamePackets.ConquerItem(true);
item.ID = id;
item.Plus = plus;
//if (soc1 != 0)
item.SocketOne = (Enums.Gem)soc1;
item.SocketTwo = (Enums.Gem)soc2;
item.Bless = Bless;
item.Durability = item.MaximDurability = infos.BaseInformation.Durability;
Add(item, Enums.ItemUse.CreateAndAdd);
}
else
{
return false;
}
times--;
}
return true;
}
public bool Add(uint id, Game.Enums.ItemEffect effect)
{
try
{
ConquerItem item = new Network.GamePackets.ConquerItem(true);
item.ID = id;
item.Effect = effect;
Database.ConquerItemInformation infos = new Database.ConquerItemInformation(id, 0);
item.Durability = item.MaximDurability = infos.BaseInformation.Durability;
if (Count <= 39)
{
Add(item, Enums.ItemUse.CreateAndAdd);
}
else
{
return false;
}
}
catch (Exception e)
{
Program.SaveException(e);
}
return true;
}
public bool Add(ConquerItem item, Enums.ItemUse use)
{
try
{
if (!Database.ConquerItemInformation.BaseInformations .ContainsKey(item.ID))
return true;
if (Count == 40)
{
Owner.Send(Constants.FullInventory);
return false;
}
if (!inventory.ContainsKey(item.UID))
{
item.Position = 0;
switch (use)
{
case Enums.ItemUse.CreateAndAdd:
item.UID = KhaledMohamed.Network.GamePackets.ConquerItem.Item UID.Next;
Database.ConquerItemTable.AddItem(ref item, Owner);
Database.ConquerItemTable.Update_Free(item, Owner);
item.MobDropped = false;
break;
case Enums.ItemUse.Add:
Database.ConquerItemTable.UpdateLocation(item, Owner);
break;
case Enums.ItemUse.Move:
item.Position = 0;
item.StatsLoaded = false;
Database.ConquerItemTable.UpdateLocation(item, Owner);
break;
}
if (use != Enums.ItemUse.None)
Database.ItemLog.LogItem(item.UID, Owner.Entity.UID, KhaledMohamed.Database.ItemLog.ItemLogAction.Add);
lock (inventory)
{
if (!inventory.ContainsKey(item.UID))
{
inventory.Add(item.UID, item);
}
}
objects = inventory.Values.ToArray();
item.Mode = Enums.ItemMode.Default;
if (use != Enums.ItemUse.None)
item.Send(Owner);

//Data data = new Data(true);
//data.ID = Data.OpenCustom;
//data.UID = Owner.Entity.UID;
//data.TimeStamp = Time32.Now;
//data.dwParam = 3382;
//data.wParam1 = Owner.Entity.X;
//data.wParam2 = Owner.Entity.Y;
//Owner.Send(data);
return true;
}
}
catch (Exception e)
{
Program.SaveException(e);
}
return false;
}

public bool Remove(ConquerItem item, Enums.ItemUse use)
{
try
{
if (inventory.ContainsKey(item.UID))
{
switch (use)
{
case Enums.ItemUse.RemoveFromStack:
{
if (item.StackSize > 1)
{
item.StackSize -= 1;
Database.ConquerItemTable.UpdateStack(item);
item.Mode = Game.Enums.ItemMode.Update;
item.Send(Owner);
return true;
}
else
{
Database.ConquerItemTable.RemoveItem(item.UID);
}
break;
}
case Enums.ItemUse.Remove:
case Enums.ItemUse.Delete:
Database.ConquerItemTable.RemoveItem(item.UID); break;
case Enums.ItemUse.Move: Database.ConquerItemTable.UpdateLocation(item, Owner); break;
}
Database.ItemLog.LogItem(item.UID, Owner.Entity.UID, KhaledMohamed.Database.ItemLog.ItemLogAction.Remov e);

inventory.Remove(item.UID);
objects = inventory.Values.ToArray();
Network.GamePackets.ItemUsage iu = new Network.GamePackets.ItemUsage(true);
iu.UID = item.UID;
iu.ID = Network.GamePackets.ItemUsage.RemoveInventory;
Owner.Send(iu);
return true;
}
}
catch (Exception e)
{
Program.SaveException(e);
}
return false;
}
public bool Remove(ConquerItem item, Enums.ItemUse use, bool equipment)
{
try
{
if (inventory.ContainsKey(item.UID))
{
inventory.Remove(item.UID);
objects = inventory.Values.ToArray();
Network.GamePackets.ItemUsage iu = new Network.GamePackets.ItemUsage(true);
iu.UID = item.UID;
iu.ID = Network.GamePackets.ItemUsage.RemoveInventory;
Owner.Send(iu);
return true;
}
}
catch (Exception e)
{
Program.SaveException(e);
}
return false;
}
public bool Remove(uint UID, Enums.ItemUse use, bool sendRemove)
{
try
{
if (inventory.ContainsKey(UID))
{
switch (use)
{
case Enums.ItemUse.Remove: Database.ConquerItemTable.RemoveItem(UID); break;
case Enums.ItemUse.Move: Database.ConquerItemTable.UpdateLocation(inventory[UID], Owner); break;
}
Database.ItemLog.LogItem(UID, Owner.Entity.UID, KhaledMohamed.Database.ItemLog.ItemLogAction.Remov e);
inventory.Remove(UID);
objects = inventory.Values.ToArray();
if (sendRemove)
{
Network.GamePackets.ItemUsage iu = new Network.GamePackets.ItemUsage(true);
iu.UID = UID;
iu.ID = Network.GamePackets.ItemUsage.RemoveInventory;
Owner.Send(iu);
}
return true;
}
}
catch (Exception e)
{
Program.SaveException(e);
}
return false;
}
public bool Remove(string name)
{
try
{
string loweredName = name.ToLower();
foreach (var item in inventory.Values)
{
if (Database.ConquerItemInformation.BaseInformations[item.ID].LowerName == loweredName)
{
Database.ItemLog.LogItem(item.UID, Owner.Entity.UID, KhaledMohamed.Database.ItemLog.ItemLogAction.Remov e);
Remove(item, Enums.ItemUse.Remove);
Network.GamePackets.ItemUsage iu = new Network.GamePackets.ItemUsage(true);
iu.UID = item.UID;
iu.ID = Network.GamePackets.ItemUsage.RemoveInventory;
Owner.Send(iu);
return true;
}
}
}
catch (Exception e)
{
Program.SaveException(e);
}
return false;
}



بردو بياخد 10 لو معمولين فى بعض انا عاوز ياخد 3 زى اى سرفر لاك لو 30 واحدة فى بعض بيخدهم كلهم + فى مشكلة كمان لما تعمل

+Ticket باخد واحدة وكل حاجة بس بيتنية شغال يستبدل بى 1 انا عاوز يقف لحد معين زى اون لااين اعمل اية ؟