how to code the drop on monsters

02/04/2009 15:31 _MaryJuana#1
hello, can anyone say me how to code the drop on monsters?

i use the DeathCo Source right now and i learned to code npcs and lottery, if anyone can tell me how to code the drop rate, i will be very happy ( sry for my english :) )
02/04/2009 15:39 PeTe Ninja#2
drop rates are in entities.cs

for regular droprates

Code:
   if (Other.ChanceSuccess(20))//CPBag
                    {
                        string Item = "729911-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);
                    }
for monster droprates

Code:
    if (Name == "HillMonster")//Emerald
                    {
                        if (Other.ChanceSuccess(1.7))
                        {
                            string Item = "1080001-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);
                        }
                    }
for multiple monsters

Code:
   if (Name == "Slinger" || Name == "BlueBird" || Name == "FiendBat" || Name == "Talon" || Name == "Bladeling" || Name == "AgileRat" || Name == "Naga" || Name == "GoldGhost")//CloudDiamond
                    {
                        if (Other.ChanceSuccess(1.7))
                        {
                            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);
                        }
                    }

press thanks if this helped...


( sick again....my mommy brought me home :(
02/04/2009 17:21 _MaryJuana#3
thats for the LOFT source or not? o.O
02/04/2009 18:04 PeTe Ninja#4
it is for lotf


press thanks if THAT helped you.. lol i want a thanks
02/04/2009 19:53 N6gesemees#5
Double post !
02/04/2009 20:23 PeTe Ninja#6
Quote:
Originally Posted by N6gesemees View Post
Double post !
not really its a bug and it happens if you click the sumbit reply twice which i did on accident because i didnt think it was loading
02/04/2009 23:04 tanelipe#7
How it is a bug if you hit the Submit Reply button twice? It's working just as it is supposed to. :P
02/04/2009 23:11 PeTe Ninja#8
bug for my computer :D, because it slow
02/05/2009 00:10 kinshi88#9
Patience is the key....