|
public bool Add
public bool Add(uint id, byte plus, byte Bless, byte Hp, byte Soc1, byte Soc2, byte Days, byte times = 1, bool bound = true, uint PurificationItemID = 0, uint PurificationLevel = 0, uint PurificationDuration = 0, bool Permnant = 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.Bless = Bless;
item.Enchant = Hp;
item.SocketOne = (Enums.Gem)Soc1;
item.SocketTwo = (Enums.Gem)Soc2;
item.DayStamp = DateTime.Now;
item.Days = Days;
item.Bound = true;
TimeSpan Remain = item.DayStamp.AddDays(item.Days) - DateTime.Now;
item.TimeLeftInMinutes = (uint)Remain.TotalSeconds;
item.Durability = item.MaximDurability = infos.BaseInformation.Durability;
};
this.Add(item, Enums.ItemUse.CreateAndAdd);
Database.ConquerItemTable.Update_Free(item, Owner);
if (!Permnant)
{
#region purfy without stablize
ItemAdding.Purification_ purify = new ItemAdding.Purification_();
purify.AddedOn = DateTime.Now;
purify.Available = true;
purify.ItemUID = item.UID;
purify.PurificationLevel = PurificationLevel;
purify.PurificationDuration = PurificationDuration * 24 * 60 * 60;
purify.PurificationItemID = PurificationItemID;
Database.ItemAddingTable.AddPurification(purify);
item.Purification = purify;
item.Mode = MrHassan.Game.Enums.ItemMode.Update;
item.Send(Owner);
ItemAdding effect = new ItemAdding(true);
effect.Type = ItemAdding.PurificationEffect;
effect.Append2(purify);
Owner.Send(effect);
#endregion
}
else
{
#region purfy with stabliz
ItemAdding.Purification_ purify = new ItemAdding.Purification_();
purify.AddedOn = DateTime.Now;
purify.Available = true;
purify.ItemUID = item.UID;
purify.PurificationLevel = PurificationLevel;
purify.PurificationDuration = PurificationDuration * 24 * 60 * 60;
purify.PurificationItemID = PurificationItemID;
Database.ItemAddingTable.AddPurification(purify);
item.Purification = purify;
item.Mode = MrHassan.Game.Enums.ItemMode.Update;
item.Send(Owner);
ItemAdding effect = new ItemAdding(true);
effect.Type = ItemAdding.PurificationEffect;
effect.Append2(purify);
Owner.Send(effect);
var Backup = item.Purification;
Backup.PurificationDuration = 0;
item.Purification = Backup;
item.Send(Owner);
effect.Type = ItemAdding.StabilizationEffect;
effect.Append2(Backup);
Owner.Send(effect);
Database.ItemAddingTable.Stabilize(item.UID, Backup.PurificationItemID);
#endregion
}
}
else
{
return false;
}
// times--;
}
}
catch (Exception e)
{
Program.SaveException(e);
}
return true;
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
مشكلة غريبه جدآ الاسطفا بتظهر من غير ال hp وي الدمج 7 الحل ايه يا رجاله | ahmedfathy | مشكلات السيرفيرات كونكر الشخصيه | 1 | 2019-11-30 03:51 PM |
ازاي تخلي الانبي سي يديك اسطفه برفكشن بدل ام تضيف الكود نفسه | Hassan Emprator | تطوير سيرفرات كونكر | 3 | 2019-10-25 09:22 PM |
مشكلة بتظهر لمة البس الكاس | ViORX | مشكلات السيرفيرات كونكر الشخصيه | 2 | 2019-09-29 12:26 PM |
مشكله اضافه رسمه عالارض لسورس رايزو | neno2052 | مشكلات السيرفيرات كونكر الشخصيه | 6 | 2019-09-18 02:38 PM |
مشكله اضافه رسمه عالارض لسورس رايزو | neno2052 | مشكلات السيرفيرات كونكر الشخصيه | 7 | 2019-09-05 06:01 PM |