Skip to content

sors89/PlayerOnHurtDebuff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PlayerOnHurtDebuff

This plugin allows npcs and projectiles to inflict debuff with custom duration and chance to player.

How to install

Grab a PlayerOnHurtDebuff.dll at here and drop it in ServerPlugins folder.

Configuration

If there is no config file, the plugin will automatically create a PlayerOnHurtDebuff.json in tshock directory.
Example config file:

{
  "Projectiles": {
    "508": [
      {
        "InflictBuffID": 33,
        "Duration": {
          "Min": 20,
          "Max": 40
        },
        "Chance": 0.5
      }
    ]
  },
  "Npcs": {
    "287": [
      {
        "InflictBuffID": 22,
        "Duration": {
          "Min": 5,
          "Max": 10
        },
        "Chance": 0.75
      }
    ]
  }
}

508 is JavelinHostile's Projectile ID and 287 is BoneLee's NPC ID. Both should be hostile. FYI Projectile ID and NPC ID
InflictBuffID: Buff ID that you want to inflict when it hit player. (e.g 195 is Withered Armor debuff).
Duration: must be in seconds. Min is minimum buff duration and Max is maximum buff duration. The plugin will choose randomly in (Min, Max) range.
Chance: chance to actually inflict buff to player. 0 < chance <= 1. Remember that 1 equals to 100%, 0.75 equals to 75%, 0.5 equals to 50% and so on...

Note 1: You can add multiple buffs per projectile or npc.
Note 2: Friendly projectile will not inflict debuff.
Here is an example of adding multiple buffs to projectile and npc:

{
  "Projectiles": {
    "508": [
      {
        "InflictBuffID": 33,
        "Duration": {
          "Min": 20,
          "Max": 40
        },
        "Chance": 0.5
      },
      {
        "InflictBuffID": 30,
        "Duration": {
          "Min": 10,
          "Max": 30
        },
        "Chance": 1.0
      }
    ],
    "82": [
      {
        "InflictBuffID": 195,
        "Duration": {
          "Min": 20,
          "Max": 40
        },
        "Chance": 0.25
      }
    ]
  },
  "Npcs": {
    "287": [
      {
        "InflictBuffID": 22,
        "Duration": {
          "Min": 5,
          "Max": 10
        },
        "Chance": 0.75
      },
      {
        "InflictBuffID": 32,
        "Duration": {
          "Min": 10,
          "Max": 20
        },
        "Chance": 0.1
      }
    ]
  }
}

About

Make npcs and projectiles inflict debuff to player.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages