Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 01:46

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



SpecialDrops & OwnItem

Discussion on SpecialDrops & OwnItem within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2007
Posts: 9
Received Thanks: 0
SpecialDrops & OwnItem

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);
            }
snappy is offline  
Old 06/23/2013, 09:54   #2
 
LordGragen.'s Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 606
Received Thanks: 68
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



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.
LordGragen. is offline  
Old 06/23/2013, 10:50   #3
 
elite*gold: 0
Join Date: Apr 2007
Posts: 9
Received Thanks: 0
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
snappy is offline  
Old 06/23/2013, 11:22   #4
 
LordGragen.'s Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 606
Received Thanks: 68
i think you should post here, there is many people with bigger exp then me that can help you solve the problem,
LordGragen. is offline  
Old 06/23/2013, 13:47   #5
 
elite*gold: 0
Join Date: Apr 2007
Posts: 9
Received Thanks: 0
Nevermind, dumb error in the code. Thanks for your help!
snappy is offline  
Reply




All times are GMT +1. The time now is 01:46.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.