kfritz411

Member
At it again folks!

I've been looking for ways to randomly add items to monster corpse. I have found this method that is nice and easy, but it's TOO consistent.

this.PackReg(2);
PackItem( new Soul( Utility.RandomMinMax(0, 1) ) );
PackItem( new EtherealLeather( Utility.RandomMinMax(0, 1) ) );
PackItem( new ShadowLeather( Utility.RandomMinMax(0, 1) ) );

Is there a way to do this where I can lower the overall drop. As of right now, every mob (pretty sure it's every single one) I kill that has this script gets at least 1 of the items dropped in the corpse. I'd like to limit this as more like: 1 in 10 gets at least 1 of the listed items in a random amount.

I'm not sure if there's anything that has an existing script I can copy/paste/retool, or if maybe I'm missing variables/arguments on the script I'm using?

Thanks!
 
public override void OnDeath( Container c )
{
base.OnDeath( c );

if ( Utility.RandomDouble() < 0.95 )
c.DropItem( new EmberStaff() );

if ( Utility.RandomDouble() < 0.55 )
c.DropItem( new DeathsHead() );

}


something like this I believe
 
public override void OnDeath( Container c )
{
base.OnDeath( c );

if ( Utility.RandomDouble() < 0.1 )
c.DropItem( new EmberStaff() );

if ( Utility.RandomDouble() < 0.01 )
c.DropItem( new DeathsHead() );

}

smaller than .9 but it seems to be working the way I'd hoped. Thanks!
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back