~Adam Ant
Wanderer
Loot Generation for EFreet wrong
The problem here is that GenerateLoot() is called twice; once at creature spawn time and again at death.
The LootPack calls are designed to handle this correctly, but the PackItem() calls aren't.
The end result is that the chance (0.02) to get Daemon armor happens twice, once at spawn time and once at death.
The way RunUO usually handled this is to put the lootPack calls in GenerateLoot() as shown here, but to add 'at spawn time drops' to the constructor.
Anywho, just a heads up.
PS. sorry if this isn't the correct forum..
Code:
public override void GenerateLoot()
{
AddLoot( LootPack.Rich );
AddLoot( LootPack.Average );
AddLoot( LootPack.Gems );
if ( 0.02 > Utility.RandomDouble() )
{
switch ( Utility.Random( 5 ) )
{
case 0: PackItem( new DaemonArms() ); break;
case 1: PackItem( new DaemonChest() ); break;
case 2: PackItem( new DaemonGloves() ); break;
case 3: PackItem( new DaemonLegs() ); break;
case 4: PackItem( new DaemonHelm() ); break;
}
}
}
The problem here is that GenerateLoot() is called twice; once at creature spawn time and again at death.
The LootPack calls are designed to handle this correctly, but the PackItem() calls aren't.
The end result is that the chance (0.02) to get Daemon armor happens twice, once at spawn time and once at death.
The way RunUO usually handled this is to put the lootPack calls in GenerateLoot() as shown here, but to add 'at spawn time drops' to the constructor.
Anywho, just a heads up.
PS. sorry if this isn't the correct forum..