-
Notifications
You must be signed in to change notification settings - Fork 1
deathdrop
The death drop system allows any monster entity to drop items upon death, based on a unique per-monster key-value that targets either a specific item name or a more complex randomized list.
-
$s_deathdrop- Defines a drop list name from the JSON configuration.
-
$i_deathdrop- Defines the model attachment index used to spawn the item at a specific position and angle.
- If unused, the item's position defaults to the monster's center.
If a monster contains:
"$s_deathdrop" "medic"It will drop one of the items defined under "medic" in the JSON:
"medic":
[
"item_bts_sprayaid",
"item_healthkit"
],Each entry in the list has an equal chance to spawn. In this example, there are two entries, so each has a 50% chance.
You can add new entries or modify existing ones within the "deathdrop" object context.
In the JSON config, you can define special entity names with unique behaviors:
-
"grenade"- Spawns a live hand grenade.
-
""(empty string)- Represents a chance to drop nothing.
You can include multiple lists. For example:
"$s_deathdrop" "zhev.medic"The system will:
- Select a random list.
- Then select a random item from that list.
If the value of $s_deathdrop starts with #, it will bypass lists and spawn the specified entity directly.
Example:
"$s_deathdrop" "#weapon_minigun"This will spawn a minigun.
Using # is not compatible with . so whatever the key name starts with # that'd be the whole item name with no randomization at all.
If an entity entry is defined in the JSON, it will be automatically precached.
If you use #, make sure the entity is already precached.
Weapon entities precache themselves automatically. This behavior may also apply to other item types depending on implementation.