2024-05-16 17:57:51 +02:00
|
|
|
if (this.actor.system.status.advantage.value == 0)
|
|
|
|
{
|
2024-05-17 01:07:37 +02:00
|
|
|
return this.script.scriptNotification("Pas assez d'Avantages!", "error")
|
2024-05-16 17:57:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
let hatred = await fromUuid("Compendium.wfrp4e-core.items.Item.aE3pyW20Orvdjzj0")
|
|
|
|
let frenzy = await fromUuid("Compendium.wfrp4e-core.items.Item.yRhhOlt18COq4e1q");
|
|
|
|
|
|
|
|
if (this.actor.system.status.advantage.value >= 3)
|
|
|
|
{
|
2024-05-17 01:07:37 +02:00
|
|
|
this.script.scriptNotification(`Ajout de ${frenzy.name}`)
|
2024-05-16 17:57:51 +02:00
|
|
|
this.actor.setAdvantage(0)
|
|
|
|
this.actor.createEmbeddedDocuments("Item", [frenzy])
|
|
|
|
}
|
|
|
|
else if (this.actor.system.status.advantage.value >= 1)
|
|
|
|
{
|
|
|
|
let data = hatred.toObject();
|
2024-05-17 01:07:37 +02:00
|
|
|
data.system.specification.value = "Combatants au corps à corps"
|
|
|
|
this.script.scriptNotification(`Ajout de ${hatred.name}`)
|
2024-05-16 17:57:51 +02:00
|
|
|
this.actor.setAdvantage(0)
|
|
|
|
this.actor.createEmbeddedDocuments("Item", [data])
|
|
|
|
}
|