2CHEVSKII
Forces NPCs to drop their weapon and other loot after death

Supported Games
GameServerKingsGameServerKings

Warning

Plugin might not work / have issues if you are using it among other plugins which alter NPC loot / death behaviour (such as BotSpawn, for example).

What is it?

Makes NPCs such as scientists and bandits to drop weapon they use, ammo for it and some meds after death. Works with all types of NPCs (Outpost/Junkpile/Bandit Camp/Chinook/Cargoship). Amounts, drop chances and condition of the weapon are configurable.

Configuration

  • You can setup the chance of drop for every category or disable some of them.
  • Also allows You to set the amount of ammo, medical syringes and condition of guns dropped after NPC death.
  • By default ammo and medical syringes count chosen randomly between 2 values set in the cfg file, if You want something of it to be exact value - just set both corresponding numbers to that value (ex. minAmmo: 30, maxAmmo: 30)
  • Condition is relative to each item, so it's set between 0 and 100 (%)
  • Chance of item drop is between 0.0 (0%) and 1.0 (100%), independent for each category
  • There is an option to remove default NPC loot
  • Weapons can be spawned in inventory instead of dropping them on the ground
  • All the items can be dropped on the ground if bot's inventory is full (if you are using custom loot for bots)
  • Random skin can be assigned to dropped weapon
  • Ammo inside the dropped weapon can be configured
  • Attachments can be randomly assigned to weapon from the given list
  • Min/max attachment count and spawn chance are configurable
{
  "Guns": {
    "Gun condition": {
      "Min": 5,
      "Max": 95
    },
    "Attachment count": {
      "Min": 0,
      "Max": 2
    },
    "Attachment list": [
      "weapon.mod.8x.scope",
      "weapon.mod.flashlight",
      "weapon.mod.holosight",
      "weapon.mod.lasersight",
      "weapon.mod.muzzleboost",
      "weapon.mod.muzzlebrake",
      "weapon.mod.silencer",
      "weapon.mod.simplesight",
      "weapon.mod.small.scope"
    ],
    "Assign random skin": true,
    "Drop chance": 1.0
  },
  "Ammo": {
    "Amount to drop": {
      "Min": 10,
      "Max": 55
    },
    "Drop chance": 0.8
  },
  "Meds": {
    "Amount to drop": {
      "Min": 1,
      "Max": 3
    },
    "Drop chance": 0.4
  },
  "Put weapon into corpse": false,
  "Remove default loot from corpse": false,
  "Drop spawned items near corpse (otherwise just delete them)": true
}

Credits

Thanks to TTRRust for help with adding ammo to the corpse.

MIT License


Copyright (c) 2020 2CHEVSKII


Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:


The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.