// A Drinker must take a Difficult (-10) Endurance Test.
let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle :  ` - ${this.effect.name}`, fields: {difficulty: "difficult"}})
await test.roll()
// If they fail, they acquire 2 Poisoned Conditions.
if (test.failed)
{
    this.actor.addCondition("poisoned", 2)
    this.script.message(`<p><strong>${this.actor.prototypeToken.name}</strong> a reçu 2 états @Condition[Poisoned].</p>
        <p>N'importe quelle créature possédant le trait de créature bestiale qui les mord et subit des dégâts ne les mordra pas à nouveau lors d'une rencontre hostile, bien que la créature puisse toujours les attaquer d'autres manières.</p>`,
    {
      whisper: ChatMessage.getWhisperRecipients("GM"),
      blind: true
    })
}
  // If they succeed, for a number of rounds equal to 3+ their SL, they have the Corrosive Blood Creature Trait.
else if (test.succeeded)
{
    // Don't attempt to add Corrosive Blood if actor already has it
    const hasCorrosiveBlood = this.actor.has("Corrosive Blood")
    if (hasCorrosiveBlood !== undefined) return

    let item = await fromUuid("Compendium.wfrp4e-core.items.M5QSWOYt2Rbv2yxW")
    let data = item.toObject()
    this.actor.createEmbeddedDocuments("Item", [data], {fromEffect: this.effect.id})

    const duration = 3 + parseInt(test.result.SL)
    this.script.message(`<p><strong>${this.actor.prototypeToken.name}</strong> a reçu le trait de créature Sang Corrosif pour ${duration} tours.</p>`,
      { whisper: ChatMessage.getWhisperRecipients("GM"), blind: true })
}