SpecialDrops & OwnItem

06/23/2013 08:00 snappy#1
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!


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);
            }
06/23/2013 09:54 LordGragen.#2
i do not see anything wrong with the code about the guard and player drop but!

i checked on my old trinity source that i was using and

[Only registered and activated users can see links. Click Here To Register...]

Code:
 if (killer.Name.Contains("Guard"))
                return;
that part mean if the guard kills the monster it will not drop anything, which means after you add this it will not drop anything else, now to the player question.

in monsterinfo or w.e your .cs is called see if there is something like the code i showed you that block the drop if a player kill the monster.
06/23/2013 10:50 snappy#3
Yea, I removed that part of the code on purpose. Even when i do reinsert that code. Still does not drop. I couldn't find any code that would be preventing this from dropping. Could i possibly PM or email you my entire monster.cs file? thanks
06/23/2013 11:22 LordGragen.#4
i think you should post here, there is many people with bigger exp then me that can help you solve the problem,
06/23/2013 13:47 snappy#5
Nevermind, dumb error in the code. Thanks for your help!