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

مشاهدة النسخة كاملة : جعل الوحش يوقع ايتم عشوائي


محمد ياسر
2019-05-30, 10:00 PM
السلام عليكم ورحمة الله وبركاته
خلي الوحش يوقع ايتم عشوائي ياعني انت وحظك

الكود
#region DB CPS
uint ran13 = (uint)Kernel.Random.Next(1, 50);
if (ran13 > 15)
{
if (this.Name == "Pheasant")
{
if (killer.Name.Contains("Guard"))
return;
uint Uid = 0;
Random R = new Random();
//int Nr = R.Next(1, 1);
switch (((byte)Kernel.Random.Next(1, 50)))
{
case 1:
Uid = 720996;//SmallCPBox
break;
case 2:
Uid = 1088000;
break;
case 3:
Uid = 720998;//LargCPBox
break;
case 4:
Uid = 1088000;
break;
case 5:
Uid = 720996;//SmallCPBox
break;
case 6:
Uid = 1088001;
break;
}
if (Uid != 0)
{
ushort X = Owner.X, Y = Owner.Y;
Game.Map Map = Kernel.Maps[Owner.MapID];
if (Map.SelectCoordonates(ref X, ref Y))
{
Network.GamePackets.FloorItem floorItem = new Network.GamePackets.FloorItem(true);
floorItem.Item = new Network.GamePackets.ConquerItem(true);
floorItem.Item.Color = (DeadPool.Game.Enums.Color)Kernel.Random.Next(4, 8);
floorItem.Item.ID = Uid;
floorItem.Item.MaximDurability = floorItem.Item.Durability = 65535;
floorItem.Item.UID = Program.NextItemID; ;
floorItem.ValueType = Network.GamePackets.FloorItem.FloorValueType.Item;
floorItem.ItemID = Uid;
floorItem.MapID = Owner.MapID;
floorItem.MapObjType = Game.MapObjectType.Item;
floorItem.X = X;
floorItem.Y = Y;
floorItem.Type = Network.GamePackets.FloorItem.Drop;
floorItem.OnFloor = Time32.Now;
floorItem.ItemColor = floorItem.Item.Color;
floorItem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
while (Map.Npcs.ContainsKey(floorItem.UID))
floorItem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
Map.AddFloorItem(floorItem);
SendScreenSpawn(floorItem);
}
}
}
}
#endregion


انت الي اتحدد الوحش مع تغير الاسم فوق
الكود في كلاس المانستر