[Mini-Guide]How to make mobs drop certain items

07/27/2009 11:52 Arcotemple:)#16
@weasel
who the hell are you and why do you thank every one of my posts?
07/30/2009 05:18 Jay1029#17
What LOTF source are you guys using to do this because I've searched a few of 'em now and none have "if (Name == "Guard")"
07/30/2009 06:04 Incariuz#18
No clue what source they are using. Cause even I never had that in LOTF. But if you're simply having difficulty finding where to do this... Open Entities.cs, and look for something like.

Code:
                uint MoneyDrops = 0;

                if (Other.ChanceSuccess(30))
                {
                    int DropTimes = 1;
                    if (Other.ChanceSuccess(15))
                    {
                        DropTimes = General.Rand.Next(1, 6);
                    }
                    for (int i = 0; i < DropTimes; i++)
                    {
                        MoneyDrops = (uint)General.Rand.Next(1, 10);

                        if (Other.ChanceSuccess(90))
                            MoneyDrops = (uint)General.Rand.Next(1, 200);
                        if (Other.ChanceSuccess(70))
                            MoneyDrops = (uint)General.Rand.Next(30, 500);
                        if (Other.ChanceSuccess(50))
                            MoneyDrops = (uint)General.Rand.Next(100, 1000);
                        if (Other.ChanceSuccess(30))
                            MoneyDrops = (uint)General.Rand.Next(500, 5000);
                        if (Other.ChanceSuccess(15))
                            MoneyDrops = (uint)General.Rand.Next(1000, 15000);

                        MoneyDrops = MoneyDrops / (136 - (uint)Level) * 10;
                        if (MoneyDrops < 1)
                            MoneyDrops = 1;
                        string Item = "";

                        if (MoneyDrops < 10)
                            Item = "1090000-0-0-0-0-0";
                        else if (MoneyDrops < 100)
                            Item = "1090010-0-0-0-0-0";
                        else if (MoneyDrops < 1000)
                            Item = "1090020-0-0-0-0-0";
                        else if (MoneyDrops < 3000)
                            Item = "1091000-0-0-0-0-0";
                        else if (MoneyDrops < 10000)
                            Item = "1091010-0-0-0-0-0";
                        else
                            Item = "1091020-0-0-0-0-0";

                        DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                        World.ItemDrops(item);
                    }
                }
                else
                {
                    if (Other.ChanceSuccess(1))
                    {
                        string Item = "1060101-0-0-0-0-0";
                        DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                        World.ItemDrops(item);
                    }
                    if (Other.ChanceSuccess(1))
                    {
                        string Item = "1060100-0-0-0-0-0";
                        DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                        World.ItemDrops(item);
                    }
                    if (Other.ChanceSuccess(0.5))
                    {
                        string Item = "721533-0-0-0-0-0";
                        DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                        World.ItemDrops(item);
                    }
                    if (Other.ChanceSuccess(0.3))
                    {
                        string Item = "721536-0-0-0-0-0";
                        DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                        World.ItemDrops(item);
                    }
                    if (Other.ChanceSuccess(0.1))
                    {
                        string Item = "723038-0-0-0-0-0";
                        DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                        World.ItemDrops(item);
                    }
and post your code, which could be something like...

Code:
                    if (Name == "TreasureBird")
                    {
                        if (Other.ChanceSuccess(5))
                        {
                            string Item = "1088001-0-0-0-0-0";
                            DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                            World.ItemDrops(item);
                        }
                    }
Directly below the first portion I added.

Yours will not be identical to mine, but hopefully this helps.
07/30/2009 18:26 Jay1029#19
Yeah I figured it out but that would have helped, thanks.