KrunghCrow
Allows barrels to blow up on damage or death

Supported Games
GameServerKingsGameServerKings

How it works

Video link

Permissions

  • explosivebarrels.use : To have the player a shot on triggering this event.

Configuration

{
  "1. NORMAL barrels settings:": {
    "1. Chance to explode on taking damage (set to 0 to disable)": 0,
    "2. Chance to explode on death (set to 0 to disable)": 10,
    "3. Damage on explosion (set to 0 to disable)": 0,
    "4. Radius of damage on explosion": 5,
    "5. List of effects on explosion": [
      "assets/bundled/prefabs/fx/gas_explosion_small.prefab",
      "assets/bundled/prefabs/fx/explosions/explosion_03.prefab"
    ]
  },
  "2. OIL barrels settings:": {
    "1. Chance to explode on taking damage (set to 0 to disable)": 10,
    "2. Chance to explode on death (set to 0 to disable)": 75,
    "3. Damage on explosion (set to 0 to disable)": 50,
    "4. Radius of damage on explosion": 3,
    "5. List of effects on explosion": [
      "assets/bundled/prefabs/fx/gas_explosion_small.prefab",
      "assets/bundled/prefabs/fx/explosions/explosion_03.prefab"
    ]
  }
}

API

To make your barrel excempted from triggering.

object CanBarrelExplode(BaseCombatEntity barrel)

object CanBarrelExplode(BaseCombatEntity barrel)
{
    if (your method goes here)
        return false;

    return null;
}

When the barrel exploded

void OnBarrelExploded(HitInfo info, BasePlayer player, BaseCombatEntity barrel)
{
    Puts($"{player.displayName} exploded a barrel at {barrel.transform.position}");
}

Credits

  • Orange, the original developer of the plugin
MIT License

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.