I am attempting to add lootpacks based on region with the goal of making delving into dungeons more lucrative the deeper you go; with gems increasing and gold decreasing, and with an increased chance for magic items, etc.

I have created the dungeon level regions and the lootpacks, and both work, but I hit a snag trying to add the lootpacks to the GenerateLoot method in my test mobile script:

Code:
public override void GenerateLoot()
		{

			if (this.Region is DungeonLevelTwoRegion)
			{
				AddLoot( LootPack.AverageTwo, 1 );
				AddLoot( LootPack.GoldAverageTwo, 1 );
				
			}
			else if (this.Region is DungeonLevelThreeRegion)
			{
				AddLoot( LootPack.AverageThree, 1 );
				AddLoot( LootPack.GoldAverageThree, 1 );
				
			}
			else if (this.Region is DungeonLevelFourRegion)
			{
				AddLoot( LootPack.AverageFour, 1 );
				AddLoot( LootPack.GoldAverageFour, 1 );
				
			}

			else
			{
				AddLoot( LootPack.Average, 1 );
				AddLoot( LootPack.GoldAverage, 1 );
				
			}

		}

It seems that the checks work for increasing the chance for magic items and placing gems in the mob's backpack on death, but that initial gold seems to pass through the checks and default to

AddLoot( LootPack.Average, 1 );
AddLoot( LootPack.GoldAverage, 1 );

Commenting this bit out in the above code results in a backpack not being generated for the mob, though one is generated on death, and the gems, magic items, etc are placed in it. Perhaps the gold portion does not work because the creature does not yet have a region? Is there a way to do this? Any help greatly appreciated.
 
Thanks! I had considered something like that. I am already using that method for generating rares and certain other items. Do you suppose removing gold from the various LootPacks would cause any issues, since the mob would spawn without a backpack? Or would it be better to have it spawn with a dummy backpack with no gold, or perhaps a small amount?
[doublepost=1504906449][/doublepost]Ah, I found out what what was causing it.

new LootPackEntry( true, Gold, 100.00, "8d10+50" ),

The "true" signals that the gold will spawn in the backpack when the mob is spawned. Setting it to "false" for each lootpack entry fixed the initial problem. It now works correctly using the code in GenerateLoot, and spawns an initial backpack, without having to use OnDeath.
 
Back