Hey guys,
Need your help here, not sure if this has been posted before. I tried to do a search but nothing comes up. Anyways, here we go.
Okay, so when any user tries to kill the monster or on the map where the Item is suppose to drop.. Nothing happens. Oddly enough, if a guard kills the monster or on that Map.. the Item drops.
Any ideas? I appreciate the help guys. Thanks!
Need your help here, not sure if this has been posted before. I tried to do a search but nothing comes up. Anyways, here we go.
Okay, so when any user tries to kill the monster or on the map where the Item is suppose to drop.. Nothing happens. Oddly enough, if a guard kills the monster or on that Map.. the Item drops.
Any ideas? I appreciate the help guys. Thanks!
Code:
foreach (SpecialItemDrop sitem in SpecialItemDropList)
{
if (sitem.Map != 0)
if (Owner.MapID != sitem.Map)
continue;
if (ServerBase.Kernel.Rate(sitem.Rate + morepercent, sitem.Discriminant))
{
if (killer.VIPLevel > 4)
{
if (killer.Owner.Inventory.Count <= 39)
{
killer.Owner.Inventory.Add((uint)sitem.ItemID, 0, 1);
continue;
}
}
var infos = Database.ConquerItemInformation.BaseInformations[(uint)sitem.ItemID];
ushort X = Owner.X, Y = Owner.Y;
Game.Map Map = ServerBase.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 = (Conquer_Online_Server.Game.Enums.Color)ServerBase.Kernel.Random.Next(4, 8);
floorItem.Item.ID = (uint)sitem.ItemID;
floorItem.Item.MaximDurability = infos.Durability;
floorItem.Item.MobDropped = true;
if (!Network.PacketHandler.IsEquipment(sitem.ItemID) && infos.ConquerPointsWorth == 0)
{
floorItem.Item.StackSize = 1;
floorItem.Item.MaxStackSize = infos.StackSize;
}
floorItem.ValueType = Network.GamePackets.FloorItem.FloorValueType.Item;
floorItem.ItemID = (uint)sitem.ItemID;
floorItem.MapID = Owner.MapID;
floorItem.MapObjType = Game.MapObjectType.Item;
floorItem.X = X;
floorItem.Y = Y;
floorItem.Owner = killer.Owner;
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);
}
}
}
}
public static SafeDictionary<uint, MonsterInformation> MonsterInfos = new SafeDictionary<uint, MonsterInformation>(8000);
public static void Load()
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT);
cmd.Select("specialdrops");
MySqlReader rdr = new MySqlReader(cmd);
while (rdr.Read())
{
SpecialItemDrop sitem = new SpecialItemDrop();
sitem.ItemID = rdr.ReadInt32("itemid");
sitem.Rate = rdr.ReadInt32("rate");
sitem.Discriminant = rdr.ReadInt32("discriminant");
sitem.Map = rdr.ReadInt32("map");
SpecialItemDropList.Add(sitem);
}