LOOT DROP DEFINITIONS

LOOT DROP SCRIPTS

Objects drop loot via several script functions. Let's go through each with examples.

	ship GetParent LootDrop 0 ;

This is used as the standard function for ships. This function takes in the parent ship's LootDrop parameter. The LootDrop parameter of a ship is a numeric ID that corresponds to a LootDrop definition file linked via the Base\LootDrop.wdt database table.

	derelict GetParent DropResource 1 ;

Derelicts use DropResource function to do almost the same thing as LootDrop on ships. Since there are subtle differences in the code, please use the appropriate script function depending on object type. DropResource also takes the LootDrop ID parameter from the parent object (in this case a derelict).

	loot LootDrop lootId lootPosition ;

The last option, used for all other situations is the direct loot drop generation, regardless of the parent object. In this case, both lootId (from Base\LootDrop.wdt) and lootPosition are supplied directly in the script.


LOOT DROP FILE

Let's have a look at a loot definition file. For example: Spg2\LootDrop\Military.txt
LootDropPart:
{
	Level:	15
	CommodityLootDropDef:
	{
		ValueRange:	5000	9000
		Commodities:	9 37 60 62 72 74 85 90 91 101
	}
	EquipmentLootDropDef:
	{
		ValueRange:	5000	9000
		Equipment:	7 2 3 5 6 7 8 15
	}
	SystemLootDropDef:
	{
		ValueRange:	0	70000
		Systems:	4 0 1 0 4 0 24 0 47
	}
}
Level: 15 This loot definition is used when player is level 15 or lower. If it was Level: 10, it would apply up to level 10 (included).
CommodityLootDropDef: This block defines what commodities and within what maximum value can be dropped. Further explained below.
EquipmentLootDropDef: This block defines what equipment and within what maximum value can be dropped. Further explained below.
SystemLootDropDef: This block defines what ship systems and within what maximum value can be dropped. Further explained below.

CommodityLootDropDef BLOCK

CommodityLootDropDef:
{
	ValueRange:	5000	9000
	Commodities:	9 37 60 62 72 74 85 90 91 101
}
ValueRange: 5000 9000 The maximum combined value of the dropped commodities will range from 5000 to 9000 Credits. The game does the calculation automatically based on the default mid-value found in Commodities.wdt.
Commodities: This series of parameters tells the game what commodities (by Id) can be dropped. The first number in the series shows how many commodity IDs are in the parameter series.

EquipmentLootDropDef BLOCK

EquipmentLootDropDef:
{
	ValueRange:	5000	9000
	Equipment:	7 2 3 5 6 7 8 15
}
ValueRange: 5000 9000 The maximum combined value of the dropped equipment will range from 5000 to 9000 Credits. The game does the calculation automatically based on the default mid-value found in Items.wdt.
Equipment: This series of parameters tells the game what equipment (by Id) can be dropped. The first number in the series shows how many equipment IDs are in the parameter series.

SystemLootDropDef BLOCK

SystemLootDropDef:
{
	ValueRange:	0	70000
	Systems:	4 0 1 0 4 0 24 0 47
}
ValueRange: 0 70000 The maximum combined value of the dropped ship systems will range from 0 to 70000 Credits. The game does the calculation automatically based on the default mid-value found in individual ship systems databases (LightWeapons.wdt, HeavyWeapons.wdt, Fighters.wdt).
Systems: This series of parameters tells the game what ship systems can be dropped. The first number in the series shows how many ship system ID pairs are in the parameter series. The first number in the pair defines ship system type (0=Light weapon, 1=Heavy weapons, 2=Fighter). The second number in the parameter pair defines the exact system ID from its corresponding database.

Final quantities dropped in-game are influenced by other features (various bonuses from Perks, Licenses, Officers...) so actual quantities may vary!