diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d65b61..bb4fd1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# v0.2.2 + +* Support for multiple currency values drawn in roll tables +* Suport for avoid equipped items +* BUGFIX: Equipped items do not transfer equipped to the player +* Add Compendium for currency types + # v.0.2.0 [BREAKING] - New macro, please replace. diff --git a/lang/en.json b/lang/en.json index a5fea48..bc1c080 100644 --- a/lang/en.json +++ b/lang/en.json @@ -22,6 +22,10 @@ "interactDistance": "Maximum distance to interact (in grids)", "interactDistanceHint": "the maximum distance for players to interact with the lock in number of grids", "lootSystem": "Loot System", - "lootSystemHint": "Choose one of the ways to perform the loot (Soon)" + "lootSystemHint": "Choose one of the ways to perform the loot (Soon)", + "lootEquipable": "Loot equipped items", + "lootEquipableHint": "If disabled, the player can not loot equipped items, if enabled the player can loot items equipped but with an additional % of items in that condition", + "lootEquipableAgil": "addict for equipped items (%)", + "lootEquipableAgilHint": "Percentage of additional chance of equipped item in NPC not to looting (ie. too damaged for use)" } } \ No newline at end of file diff --git a/lang/pt-BR.json b/lang/pt-BR.json index 557ea83..f5cdd0c 100644 --- a/lang/pt-BR.json +++ b/lang/pt-BR.json @@ -22,6 +22,10 @@ "removeItem": "Remover os Itens", "removeItemHint": "Se ativado remove os itens do token (não remove do ator a menos que o token estiver linkado)", "lootSystem": "Sistema de Pilhagem", - "lootSystemHint": "Escolha uma das formas para realizar a pilhagem (em breve)" + "lootSystemHint": "Escolha uma das formas para realizar a pilhagem (em breve)", + "lootEquipable": "Pilhar equipamentos equipados", + "lootEquipableHint": "Se desativado o jogador não poderá pilhar itens equipados, se ativado o jogador poderá pilhar itens equipados porém com um ágio adicional da arma não estar em condição", + "lootEquipableAgil": "Ágio para itens equipados (%)", + "lootEquipableAgilHint": "Porcentagem de chance adicional do item equipado no NPC não servirem para pilhagem (Foram danificadas)" } } \ No newline at end of file diff --git a/module.json b/module.json index 3e9a521..132ac0b 100644 --- a/module.json +++ b/module.json @@ -3,7 +3,7 @@ "title": "Innocenti Looting", "description": "

Modules for loot from monsters and Npcs

", "author": "Renato innocenti", - "version": "0.2.0", + "version": "0.2.2", "minimumCoreVersion": "0.7.0", "compatibleCoreVersion": "0.7.9", "systems": [ "dnd5e" ], @@ -29,10 +29,18 @@ "packs": [ { "name": "looting-macros", - "label": "Looting Demo", + "label": "Macro Looting", "path": "packs/looting-macro.db", "module": "innocenti-looting", "entity": "Macro" + }, + + { + "name": "looting-items", + "label": "Looting Items Currency", + "path": "packs/item-currency.db", + "module": "innocenti-looting", + "entity": "Item" } ], "socket": true, diff --git a/packs/item-currency.db b/packs/item-currency.db new file mode 100644 index 0000000..55cbd2e --- /dev/null +++ b/packs/item-currency.db @@ -0,0 +1,17 @@ +{"name":"Copper 5d6 (cp)","permission":{"default":0,"X4uo406iXTm4HkVN":3},"type":"loot","data":{"description":{"value":"
\n\t\t\t
Treasure
\n\t\t\t
\n\t\t\t\t
1 cp, 0.32 oz.
\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t\t
\n\t\t

Common coins come in several different denominations based on the relative worth of the metal from which they are made. The three most common coins are the gold piece (gp), the silver piece (sp), and the copper piece (cp).

With one gold piece, a character can buy a belt pouch, 50 feet of good rope, or a goat. A skilled (but not exceptional) artisan can earn one gold piece a day. The gold piece is the standard unit of measure for wealth, even if the coin itself is not commonly used. When merchants discuss deals that involve goods or services worth hundreds or thousands of gold pieces, the transactions don't usually involve the exchange of individual coins. Rather, the gold piece is a standard measure of value, and the actual exchange is in gold bars, letters of credit, or valuable goods.

One gold piece is worth ten silver pieces, the most prevalent coin among commoners. A silver piece buys a laborer's work for a day, a flask of lamp oil, or a night's rest in a poor inn.

One silver piece is worth ten copper pieces, which are common among laborers and beggars. A single copper piece buys a candle, a torch, or a piece of chalk.

In addition, unusual coins made of other precious metals sometimes appear in treasure hoards. The electrum piece (ep) and the platinum piece (pp) originate from fallen empires and lost kingdoms, and they sometimes arouse suspicion and skepticism when used in transactions. An electrum piece is worth five silver pieces, and a platinum piece is worth ten gold pieces.

A standard coin weighs about a third of an ounce, so fifty coins weigh a pound.

","chat":"","unidentified":""},"source":"5d6","quantity":1,"weight":0.02,"price":0.01,"attuned":false,"attunement":0,"equipped":true,"rarity":"None","identified":false,"damage":{"parts":[]},"attributes":{"spelldc":10}},"flags":{"plutonium":{"page":"items.html","source":"PHB","hash":"copper%20(cp)_phb","data":{"item":{"name":"Copper (cp)","source":"PHB","page":143,"type":"$","rarity":"none","weight":0.02,"value":1,"entries":["Common coins come in several different denominations based on the relative worth of the metal from which they are made. The three most common coins are the gold piece (gp), the silver piece (sp), and the copper piece (cp).","With one gold piece, a character can buy a belt pouch, 50 feet of good rope, or a goat. A skilled (but not exceptional) artisan can earn one gold piece a day. The gold piece is the standard unit of measure for wealth, even if the coin itself is not commonly used. When merchants discuss deals that involve goods or services worth hundreds or thousands of gold pieces, the transactions don't usually involve the exchange of individual coins. Rather, the gold piece is a standard measure of value, and the actual exchange is in gold bars, letters of credit, or valuable goods.","One gold piece is worth ten silver pieces, the most prevalent coin among commoners. A silver piece buys a laborer's work for a day, a flask of lamp oil, or a night's rest in a poor inn.","One silver piece is worth ten copper pieces, which are common among laborers and beggars. A single copper piece buys a candle, a torch, or a piece of chalk.","In addition, unusual coins made of other precious metals sometimes appear in treasure hoards. The electrum piece (ep) and the platinum piece (pp) originate from fallen empires and lost kingdoms, and they sometimes arouse suspicion and skepticism when used in transactions. An electrum piece is worth five silver pieces, and a platinum piece is worth ten gold pieces.","A standard coin weighs about a third of an ounce, so fifty coins weigh a pound."],"_isEnhanced":true,"_category":"Other","_typeListText":["treasure"],"_typeHtml":"treasure","_attunement":null,"_attunementCategory":"No","_fProperties":[],"_fMisc":["Mundane"],"_fValue":0.01,"_fTier":["none"],"_fIsMundane":true,"_fBonus":[],"_vType":"Treasure"}}}},"img":"https://5e.tools/img/items%2FCopper%20(cp).jpg","effects":[],"_id":"1tH2gJdWkvuv1ATN"} +{"name":"Platinum 3d6 (pp)","permission":{"default":0,"X4uo406iXTm4HkVN":3},"type":"loot","data":{"description":{"value":"
\n\t\t\t
Treasure
\n\t\t\t
\n\t\t\t\t
10 gp, 0.32 oz.
\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t\t
\n\t\t

Common coins come in several different denominations based on the relative worth of the metal from which they are made. The three most common coins are the gold piece (gp), the silver piece (sp), and the copper piece (cp).

With one gold piece, a character can buy a belt pouch, 50 feet of good rope, or a goat. A skilled (but not exceptional) artisan can earn one gold piece a day. The gold piece is the standard unit of measure for wealth, even if the coin itself is not commonly used. When merchants discuss deals that involve goods or services worth hundreds or thousands of gold pieces, the transactions don't usually involve the exchange of individual coins. Rather, the gold piece is a standard measure of value, and the actual exchange is in gold bars, letters of credit, or valuable goods.

One gold piece is worth ten silver pieces, the most prevalent coin among commoners. A silver piece buys a laborer's work for a day, a flask of lamp oil, or a night's rest in a poor inn.

One silver piece is worth ten copper pieces, which are common among laborers and beggars. A single copper piece buys a candle, a torch, or a piece of chalk.

In addition, unusual coins made of other precious metals sometimes appear in treasure hoards. The electrum piece (ep) and the platinum piece (pp) originate from fallen empires and lost kingdoms, and they sometimes arouse suspicion and skepticism when used in transactions. An electrum piece is worth five silver pieces, and a platinum piece is worth ten gold pieces.

A standard coin weighs about a third of an ounce, so fifty coins weigh a pound.

","chat":"","unidentified":""},"source":"3d6","quantity":1,"weight":0.02,"price":10,"attuned":false,"attunement":0,"equipped":true,"rarity":"None","identified":false,"damage":{"parts":[]},"attributes":{"spelldc":10}},"flags":{"plutonium":{"page":"items.html","source":"PHB","hash":"platinum%20(pp)_phb","data":{"item":{"name":"Platinum (pp)","source":"PHB","page":143,"type":"$","rarity":"none","weight":0.02,"value":1000,"entries":["Common coins come in several different denominations based on the relative worth of the metal from which they are made. The three most common coins are the gold piece (gp), the silver piece (sp), and the copper piece (cp).","With one gold piece, a character can buy a belt pouch, 50 feet of good rope, or a goat. A skilled (but not exceptional) artisan can earn one gold piece a day. The gold piece is the standard unit of measure for wealth, even if the coin itself is not commonly used. When merchants discuss deals that involve goods or services worth hundreds or thousands of gold pieces, the transactions don't usually involve the exchange of individual coins. Rather, the gold piece is a standard measure of value, and the actual exchange is in gold bars, letters of credit, or valuable goods.","One gold piece is worth ten silver pieces, the most prevalent coin among commoners. A silver piece buys a laborer's work for a day, a flask of lamp oil, or a night's rest in a poor inn.","One silver piece is worth ten copper pieces, which are common among laborers and beggars. A single copper piece buys a candle, a torch, or a piece of chalk.","In addition, unusual coins made of other precious metals sometimes appear in treasure hoards. The electrum piece (ep) and the platinum piece (pp) originate from fallen empires and lost kingdoms, and they sometimes arouse suspicion and skepticism when used in transactions. An electrum piece is worth five silver pieces, and a platinum piece is worth ten gold pieces.","A standard coin weighs about a third of an ounce, so fifty coins weigh a pound."],"_isEnhanced":true,"_category":"Other","_typeListText":["treasure"],"_typeHtml":"treasure","_attunement":null,"_attunementCategory":"No","_fProperties":[],"_fMisc":["Mundane"],"_fValue":10,"_fTier":["none"],"_fIsMundane":true,"_fBonus":[],"_vType":"Treasure"}}}},"img":"https://5e.tools/img/items%2FPlatinum%20(pp).jpg","effects":[],"_id":"2eYUvuuhKd3K48qG"} +{"name":"Gold 4d6x10 (gp)","permission":{"default":0,"X4uo406iXTm4HkVN":3},"type":"loot","data":{"description":{"value":"
\n\t\t\t
Treasure
\n\t\t\t
\n\t\t\t\t
1 gp, 0.32 oz.
\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t\t
\n\t\t

Common coins come in several different denominations based on the relative worth of the metal from which they are made. The three most common coins are the gold piece (gp), the silver piece (sp), and the copper piece (cp).

With one gold piece, a character can buy a belt pouch, 50 feet of good rope, or a goat. A skilled (but not exceptional) artisan can earn one gold piece a day. The gold piece is the standard unit of measure for wealth, even if the coin itself is not commonly used. When merchants discuss deals that involve goods or services worth hundreds or thousands of gold pieces, the transactions don't usually involve the exchange of individual coins. Rather, the gold piece is a standard measure of value, and the actual exchange is in gold bars, letters of credit, or valuable goods.

One gold piece is worth ten silver pieces, the most prevalent coin among commoners. A silver piece buys a laborer's work for a day, a flask of lamp oil, or a night's rest in a poor inn.

One silver piece is worth ten copper pieces, which are common among laborers and beggars. A single copper piece buys a candle, a torch, or a piece of chalk.

In addition, unusual coins made of other precious metals sometimes appear in treasure hoards. The electrum piece (ep) and the platinum piece (pp) originate from fallen empires and lost kingdoms, and they sometimes arouse suspicion and skepticism when used in transactions. An electrum piece is worth five silver pieces, and a platinum piece is worth ten gold pieces.

A standard coin weighs about a third of an ounce, so fifty coins weigh a pound.

","chat":"","unidentified":""},"source":"4d6*10","quantity":1,"weight":0.02,"price":1,"attuned":false,"attunement":0,"equipped":true,"rarity":"None","identified":false,"damage":{"parts":[]},"attributes":{"spelldc":10}},"flags":{"plutonium":{"page":"items.html","source":"PHB","hash":"gold%20(gp)_phb","data":{"item":{"name":"Gold (gp)","source":"PHB","page":143,"type":"$","rarity":"none","weight":0.02,"value":100,"entries":["Common coins come in several different denominations based on the relative worth of the metal from which they are made. The three most common coins are the gold piece (gp), the silver piece (sp), and the copper piece (cp).","With one gold piece, a character can buy a belt pouch, 50 feet of good rope, or a goat. A skilled (but not exceptional) artisan can earn one gold piece a day. The gold piece is the standard unit of measure for wealth, even if the coin itself is not commonly used. When merchants discuss deals that involve goods or services worth hundreds or thousands of gold pieces, the transactions don't usually involve the exchange of individual coins. Rather, the gold piece is a standard measure of value, and the actual exchange is in gold bars, letters of credit, or valuable goods.","One gold piece is worth ten silver pieces, the most prevalent coin among commoners. A silver piece buys a laborer's work for a day, a flask of lamp oil, or a night's rest in a poor inn.","One silver piece is worth ten copper pieces, which are common among laborers and beggars. A single copper piece buys a candle, a torch, or a piece of chalk.","In addition, unusual coins made of other precious metals sometimes appear in treasure hoards. The electrum piece (ep) and the platinum piece (pp) originate from fallen empires and lost kingdoms, and they sometimes arouse suspicion and skepticism when used in transactions. An electrum piece is worth five silver pieces, and a platinum piece is worth ten gold pieces.","A standard coin weighs about a third of an ounce, so fifty coins weigh a pound."],"_isEnhanced":true,"_category":"Other","_typeListText":["treasure"],"_typeHtml":"treasure","_attunement":null,"_attunementCategory":"No","_fProperties":[],"_fMisc":["Mundane"],"_fValue":1,"_fTier":["none"],"_fIsMundane":true,"_fBonus":[],"_vType":"Treasure"}}}},"img":"https://5e.tools/img/items%2FGold%20(gp).jpg","effects":[],"_id":"DEW55l15PcyrujUi"} +{"_id":"JqWNMmLD187Y0nwh","name":"Electrum 3d6 (ep)","permission":{"default":0,"X4uo406iXTm4HkVN":3},"type":"loot","data":{"description":{"value":"
\n\t\t\t
Treasure
\n\t\t\t
\n\t\t\t\t
5 sp, 0.32 oz.
\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t\t
\n\t\t

Common coins come in several different denominations based on the relative worth of the metal from which they are made. The three most common coins are the gold piece (gp), the silver piece (sp), and the copper piece (cp).

With one gold piece, a character can buy a belt pouch, 50 feet of good rope, or a goat. A skilled (but not exceptional) artisan can earn one gold piece a day. The gold piece is the standard unit of measure for wealth, even if the coin itself is not commonly used. When merchants discuss deals that involve goods or services worth hundreds or thousands of gold pieces, the transactions don't usually involve the exchange of individual coins. Rather, the gold piece is a standard measure of value, and the actual exchange is in gold bars, letters of credit, or valuable goods.

One gold piece is worth ten silver pieces, the most prevalent coin among commoners. A silver piece buys a laborer's work for a day, a flask of lamp oil, or a night's rest in a poor inn.

One silver piece is worth ten copper pieces, which are common among laborers and beggars. A single copper piece buys a candle, a torch, or a piece of chalk.

In addition, unusual coins made of other precious metals sometimes appear in treasure hoards. The electrum piece (ep) and the platinum piece (pp) originate from fallen empires and lost kingdoms, and they sometimes arouse suspicion and skepticism when used in transactions. An electrum piece is worth five silver pieces, and a platinum piece is worth ten gold pieces.

A standard coin weighs about a third of an ounce, so fifty coins weigh a pound.

","chat":"","unidentified":""},"source":"3d6","quantity":1,"weight":0.02,"price":0.5,"attuned":false,"attunement":0,"equipped":true,"rarity":"None","identified":false,"damage":{"parts":[]},"attributes":{"spelldc":10}},"flags":{"plutonium":{"page":"items.html","source":"PHB","hash":"electrum%20(ep)_phb","data":{"item":{"name":"Electrum (ep)","source":"PHB","page":143,"type":"$","rarity":"none","weight":0.02,"value":50,"entries":["Common coins come in several different denominations based on the relative worth of the metal from which they are made. The three most common coins are the gold piece (gp), the silver piece (sp), and the copper piece (cp).","With one gold piece, a character can buy a belt pouch, 50 feet of good rope, or a goat. A skilled (but not exceptional) artisan can earn one gold piece a day. The gold piece is the standard unit of measure for wealth, even if the coin itself is not commonly used. When merchants discuss deals that involve goods or services worth hundreds or thousands of gold pieces, the transactions don't usually involve the exchange of individual coins. Rather, the gold piece is a standard measure of value, and the actual exchange is in gold bars, letters of credit, or valuable goods.","One gold piece is worth ten silver pieces, the most prevalent coin among commoners. A silver piece buys a laborer's work for a day, a flask of lamp oil, or a night's rest in a poor inn.","One silver piece is worth ten copper pieces, which are common among laborers and beggars. A single copper piece buys a candle, a torch, or a piece of chalk.","In addition, unusual coins made of other precious metals sometimes appear in treasure hoards. The electrum piece (ep) and the platinum piece (pp) originate from fallen empires and lost kingdoms, and they sometimes arouse suspicion and skepticism when used in transactions. An electrum piece is worth five silver pieces, and a platinum piece is worth ten gold pieces.","A standard coin weighs about a third of an ounce, so fifty coins weigh a pound."],"_isEnhanced":true,"_category":"Other","_typeListText":["treasure"],"_typeHtml":"treasure","_attunement":null,"_attunementCategory":"No","_fProperties":[],"_fMisc":["Mundane"],"_fValue":0.5,"_fTier":["none"],"_fIsMundane":true,"_fBonus":[],"_vType":"Treasure"}}}},"img":"https://5e.tools/img/items%2FElectrum%20(ep).jpg","effects":[]} +{"name":"Electrum 3d6x10 (ep)","permission":{"default":0,"X4uo406iXTm4HkVN":3},"type":"loot","data":{"description":{"value":"
\n\t\t\t
Treasure
\n\t\t\t
\n\t\t\t\t
5 sp, 0.32 oz.
\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t\t
\n\t\t

Common coins come in several different denominations based on the relative worth of the metal from which they are made. The three most common coins are the gold piece (gp), the silver piece (sp), and the copper piece (cp).

With one gold piece, a character can buy a belt pouch, 50 feet of good rope, or a goat. A skilled (but not exceptional) artisan can earn one gold piece a day. The gold piece is the standard unit of measure for wealth, even if the coin itself is not commonly used. When merchants discuss deals that involve goods or services worth hundreds or thousands of gold pieces, the transactions don't usually involve the exchange of individual coins. Rather, the gold piece is a standard measure of value, and the actual exchange is in gold bars, letters of credit, or valuable goods.

One gold piece is worth ten silver pieces, the most prevalent coin among commoners. A silver piece buys a laborer's work for a day, a flask of lamp oil, or a night's rest in a poor inn.

One silver piece is worth ten copper pieces, which are common among laborers and beggars. A single copper piece buys a candle, a torch, or a piece of chalk.

In addition, unusual coins made of other precious metals sometimes appear in treasure hoards. The electrum piece (ep) and the platinum piece (pp) originate from fallen empires and lost kingdoms, and they sometimes arouse suspicion and skepticism when used in transactions. An electrum piece is worth five silver pieces, and a platinum piece is worth ten gold pieces.

A standard coin weighs about a third of an ounce, so fifty coins weigh a pound.

","chat":"","unidentified":""},"source":"3d6*10","quantity":1,"weight":0.02,"price":0.5,"attuned":false,"attunement":0,"equipped":true,"rarity":"None","identified":false,"damage":{"parts":[]},"attributes":{"spelldc":10}},"flags":{"plutonium":{"page":"items.html","source":"PHB","hash":"electrum%20(ep)_phb","data":{"item":{"name":"Electrum (ep)","source":"PHB","page":143,"type":"$","rarity":"none","weight":0.02,"value":50,"entries":["Common coins come in several different denominations based on the relative worth of the metal from which they are made. The three most common coins are the gold piece (gp), the silver piece (sp), and the copper piece (cp).","With one gold piece, a character can buy a belt pouch, 50 feet of good rope, or a goat. A skilled (but not exceptional) artisan can earn one gold piece a day. The gold piece is the standard unit of measure for wealth, even if the coin itself is not commonly used. When merchants discuss deals that involve goods or services worth hundreds or thousands of gold pieces, the transactions don't usually involve the exchange of individual coins. Rather, the gold piece is a standard measure of value, and the actual exchange is in gold bars, letters of credit, or valuable goods.","One gold piece is worth ten silver pieces, the most prevalent coin among commoners. A silver piece buys a laborer's work for a day, a flask of lamp oil, or a night's rest in a poor inn.","One silver piece is worth ten copper pieces, which are common among laborers and beggars. A single copper piece buys a candle, a torch, or a piece of chalk.","In addition, unusual coins made of other precious metals sometimes appear in treasure hoards. The electrum piece (ep) and the platinum piece (pp) originate from fallen empires and lost kingdoms, and they sometimes arouse suspicion and skepticism when used in transactions. An electrum piece is worth five silver pieces, and a platinum piece is worth ten gold pieces.","A standard coin weighs about a third of an ounce, so fifty coins weigh a pound."],"_isEnhanced":true,"_category":"Other","_typeListText":["treasure"],"_typeHtml":"treasure","_attunement":null,"_attunementCategory":"No","_fProperties":[],"_fMisc":["Mundane"],"_fValue":0.5,"_fTier":["none"],"_fIsMundane":true,"_fBonus":[],"_vType":"Treasure"}}}},"img":"https://5e.tools/img/items%2FElectrum%20(ep).jpg","effects":[],"_id":"O72BEMophWj7a7qo"} +{"name":"Gold 3d6 (gp)","permission":{"default":0,"X4uo406iXTm4HkVN":3},"type":"loot","data":{"description":{"value":"
\n\t\t\t
Treasure
\n\t\t\t
\n\t\t\t\t
1 gp, 0.32 oz.
\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t\t
\n\t\t

Common coins come in several different denominations based on the relative worth of the metal from which they are made. The three most common coins are the gold piece (gp), the silver piece (sp), and the copper piece (cp).

With one gold piece, a character can buy a belt pouch, 50 feet of good rope, or a goat. A skilled (but not exceptional) artisan can earn one gold piece a day. The gold piece is the standard unit of measure for wealth, even if the coin itself is not commonly used. When merchants discuss deals that involve goods or services worth hundreds or thousands of gold pieces, the transactions don't usually involve the exchange of individual coins. Rather, the gold piece is a standard measure of value, and the actual exchange is in gold bars, letters of credit, or valuable goods.

One gold piece is worth ten silver pieces, the most prevalent coin among commoners. A silver piece buys a laborer's work for a day, a flask of lamp oil, or a night's rest in a poor inn.

One silver piece is worth ten copper pieces, which are common among laborers and beggars. A single copper piece buys a candle, a torch, or a piece of chalk.

In addition, unusual coins made of other precious metals sometimes appear in treasure hoards. The electrum piece (ep) and the platinum piece (pp) originate from fallen empires and lost kingdoms, and they sometimes arouse suspicion and skepticism when used in transactions. An electrum piece is worth five silver pieces, and a platinum piece is worth ten gold pieces.

A standard coin weighs about a third of an ounce, so fifty coins weigh a pound.

","chat":"","unidentified":""},"source":"3d6","quantity":1,"weight":0.02,"price":1,"attuned":false,"attunement":0,"equipped":true,"rarity":"None","identified":false,"damage":{"parts":[]},"attributes":{"spelldc":10}},"flags":{"plutonium":{"page":"items.html","source":"PHB","hash":"gold%20(gp)_phb","data":{"item":{"name":"Gold (gp)","source":"PHB","page":143,"type":"$","rarity":"none","weight":0.02,"value":100,"entries":["Common coins come in several different denominations based on the relative worth of the metal from which they are made. The three most common coins are the gold piece (gp), the silver piece (sp), and the copper piece (cp).","With one gold piece, a character can buy a belt pouch, 50 feet of good rope, or a goat. A skilled (but not exceptional) artisan can earn one gold piece a day. The gold piece is the standard unit of measure for wealth, even if the coin itself is not commonly used. When merchants discuss deals that involve goods or services worth hundreds or thousands of gold pieces, the transactions don't usually involve the exchange of individual coins. Rather, the gold piece is a standard measure of value, and the actual exchange is in gold bars, letters of credit, or valuable goods.","One gold piece is worth ten silver pieces, the most prevalent coin among commoners. A silver piece buys a laborer's work for a day, a flask of lamp oil, or a night's rest in a poor inn.","One silver piece is worth ten copper pieces, which are common among laborers and beggars. A single copper piece buys a candle, a torch, or a piece of chalk.","In addition, unusual coins made of other precious metals sometimes appear in treasure hoards. The electrum piece (ep) and the platinum piece (pp) originate from fallen empires and lost kingdoms, and they sometimes arouse suspicion and skepticism when used in transactions. An electrum piece is worth five silver pieces, and a platinum piece is worth ten gold pieces.","A standard coin weighs about a third of an ounce, so fifty coins weigh a pound."],"_isEnhanced":true,"_category":"Other","_typeListText":["treasure"],"_typeHtml":"treasure","_attunement":null,"_attunementCategory":"No","_fProperties":[],"_fMisc":["Mundane"],"_fValue":1,"_fTier":["none"],"_fIsMundane":true,"_fBonus":[],"_vType":"Treasure"}}}},"img":"https://5e.tools/img/items%2FGold%20(gp).jpg","effects":[],"_id":"ZCo2OzukCquTEfUm"} +{"name":"Silver 4d6 (sp)","permission":{"default":0,"X4uo406iXTm4HkVN":3},"type":"loot","data":{"description":{"value":"
\n\t\t\t
Treasure
\n\t\t\t
\n\t\t\t\t
1 sp, 0.32 oz.
\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t\t
\n\t\t

Common coins come in several different denominations based on the relative worth of the metal from which they are made. The three most common coins are the gold piece (gp), the silver piece (sp), and the copper piece (cp).

With one gold piece, a character can buy a belt pouch, 50 feet of good rope, or a goat. A skilled (but not exceptional) artisan can earn one gold piece a day. The gold piece is the standard unit of measure for wealth, even if the coin itself is not commonly used. When merchants discuss deals that involve goods or services worth hundreds or thousands of gold pieces, the transactions don't usually involve the exchange of individual coins. Rather, the gold piece is a standard measure of value, and the actual exchange is in gold bars, letters of credit, or valuable goods.

One gold piece is worth ten silver pieces, the most prevalent coin among commoners. A silver piece buys a laborer's work for a day, a flask of lamp oil, or a night's rest in a poor inn.

One silver piece is worth ten copper pieces, which are common among laborers and beggars. A single copper piece buys a candle, a torch, or a piece of chalk.

In addition, unusual coins made of other precious metals sometimes appear in treasure hoards. The electrum piece (ep) and the platinum piece (pp) originate from fallen empires and lost kingdoms, and they sometimes arouse suspicion and skepticism when used in transactions. An electrum piece is worth five silver pieces, and a platinum piece is worth ten gold pieces.

A standard coin weighs about a third of an ounce, so fifty coins weigh a pound.

","chat":"","unidentified":""},"source":"4d6","quantity":1,"weight":0.02,"price":0.1,"attuned":false,"attunement":0,"equipped":true,"rarity":"None","identified":false,"damage":{"parts":[]},"attributes":{"spelldc":10}},"flags":{"plutonium":{"page":"items.html","source":"PHB","hash":"silver%20(sp)_phb","data":{"item":{"name":"Silver (sp)","source":"PHB","page":143,"type":"$","rarity":"none","weight":0.02,"value":10,"entries":["Common coins come in several different denominations based on the relative worth of the metal from which they are made. The three most common coins are the gold piece (gp), the silver piece (sp), and the copper piece (cp).","With one gold piece, a character can buy a belt pouch, 50 feet of good rope, or a goat. A skilled (but not exceptional) artisan can earn one gold piece a day. The gold piece is the standard unit of measure for wealth, even if the coin itself is not commonly used. When merchants discuss deals that involve goods or services worth hundreds or thousands of gold pieces, the transactions don't usually involve the exchange of individual coins. Rather, the gold piece is a standard measure of value, and the actual exchange is in gold bars, letters of credit, or valuable goods.","One gold piece is worth ten silver pieces, the most prevalent coin among commoners. A silver piece buys a laborer's work for a day, a flask of lamp oil, or a night's rest in a poor inn.","One silver piece is worth ten copper pieces, which are common among laborers and beggars. A single copper piece buys a candle, a torch, or a piece of chalk.","In addition, unusual coins made of other precious metals sometimes appear in treasure hoards. The electrum piece (ep) and the platinum piece (pp) originate from fallen empires and lost kingdoms, and they sometimes arouse suspicion and skepticism when used in transactions. An electrum piece is worth five silver pieces, and a platinum piece is worth ten gold pieces.","A standard coin weighs about a third of an ounce, so fifty coins weigh a pound."],"_isEnhanced":true,"_category":"Other","_typeListText":["treasure"],"_typeHtml":"treasure","_attunement":null,"_attunementCategory":"No","_fProperties":[],"_fMisc":["Mundane"],"_fValue":0.1,"_fTier":["none"],"_fIsMundane":true,"_fBonus":[],"_vType":"Treasure"}}}},"img":"https://5e.tools/img/items%2FSilver%20(sp).jpg","effects":[],"_id":"cQe8PQRPhNlF2fdU"} +{"name":"Silver 6d6x10 (sp)","permission":{"default":0,"X4uo406iXTm4HkVN":3},"type":"loot","data":{"description":{"value":"
\n\t\t\t
Treasure
\n\t\t\t
\n\t\t\t\t
1 sp, 0.32 oz.
\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t\t
\n\t\t

Common coins come in several different denominations based on the relative worth of the metal from which they are made. The three most common coins are the gold piece (gp), the silver piece (sp), and the copper piece (cp).

With one gold piece, a character can buy a belt pouch, 50 feet of good rope, or a goat. A skilled (but not exceptional) artisan can earn one gold piece a day. The gold piece is the standard unit of measure for wealth, even if the coin itself is not commonly used. When merchants discuss deals that involve goods or services worth hundreds or thousands of gold pieces, the transactions don't usually involve the exchange of individual coins. Rather, the gold piece is a standard measure of value, and the actual exchange is in gold bars, letters of credit, or valuable goods.

One gold piece is worth ten silver pieces, the most prevalent coin among commoners. A silver piece buys a laborer's work for a day, a flask of lamp oil, or a night's rest in a poor inn.

One silver piece is worth ten copper pieces, which are common among laborers and beggars. A single copper piece buys a candle, a torch, or a piece of chalk.

In addition, unusual coins made of other precious metals sometimes appear in treasure hoards. The electrum piece (ep) and the platinum piece (pp) originate from fallen empires and lost kingdoms, and they sometimes arouse suspicion and skepticism when used in transactions. An electrum piece is worth five silver pieces, and a platinum piece is worth ten gold pieces.

A standard coin weighs about a third of an ounce, so fifty coins weigh a pound.

","chat":"","unidentified":""},"source":"6d6*10","quantity":1,"weight":0.02,"price":0.1,"attuned":false,"attunement":0,"equipped":true,"rarity":"None","identified":false,"damage":{"parts":[]},"attributes":{"spelldc":10}},"flags":{"plutonium":{"page":"items.html","source":"PHB","hash":"silver%20(sp)_phb","data":{"item":{"name":"Silver (sp)","source":"PHB","page":143,"type":"$","rarity":"none","weight":0.02,"value":10,"entries":["Common coins come in several different denominations based on the relative worth of the metal from which they are made. The three most common coins are the gold piece (gp), the silver piece (sp), and the copper piece (cp).","With one gold piece, a character can buy a belt pouch, 50 feet of good rope, or a goat. A skilled (but not exceptional) artisan can earn one gold piece a day. The gold piece is the standard unit of measure for wealth, even if the coin itself is not commonly used. When merchants discuss deals that involve goods or services worth hundreds or thousands of gold pieces, the transactions don't usually involve the exchange of individual coins. Rather, the gold piece is a standard measure of value, and the actual exchange is in gold bars, letters of credit, or valuable goods.","One gold piece is worth ten silver pieces, the most prevalent coin among commoners. A silver piece buys a laborer's work for a day, a flask of lamp oil, or a night's rest in a poor inn.","One silver piece is worth ten copper pieces, which are common among laborers and beggars. A single copper piece buys a candle, a torch, or a piece of chalk.","In addition, unusual coins made of other precious metals sometimes appear in treasure hoards. The electrum piece (ep) and the platinum piece (pp) originate from fallen empires and lost kingdoms, and they sometimes arouse suspicion and skepticism when used in transactions. An electrum piece is worth five silver pieces, and a platinum piece is worth ten gold pieces.","A standard coin weighs about a third of an ounce, so fifty coins weigh a pound."],"_isEnhanced":true,"_category":"Other","_typeListText":["treasure"],"_typeHtml":"treasure","_attunement":null,"_attunementCategory":"No","_fProperties":[],"_fMisc":["Mundane"],"_fValue":0.1,"_fTier":["none"],"_fIsMundane":true,"_fBonus":[],"_vType":"Treasure"}}}},"img":"https://5e.tools/img/items%2FSilver%20(sp).jpg","effects":[],"_id":"jMOFqqA7WN6S5czM"} +{"name":"Copper 4d6x100 (cp)","permission":{"default":0,"X4uo406iXTm4HkVN":3},"type":"loot","data":{"description":{"value":"
\n\t\t\t
Treasure
\n\t\t\t
\n\t\t\t\t
1 cp, 0.32 oz.
\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t\t
\n\t\t

Common coins come in several different denominations based on the relative worth of the metal from which they are made. The three most common coins are the gold piece (gp), the silver piece (sp), and the copper piece (cp).

With one gold piece, a character can buy a belt pouch, 50 feet of good rope, or a goat. A skilled (but not exceptional) artisan can earn one gold piece a day. The gold piece is the standard unit of measure for wealth, even if the coin itself is not commonly used. When merchants discuss deals that involve goods or services worth hundreds or thousands of gold pieces, the transactions don't usually involve the exchange of individual coins. Rather, the gold piece is a standard measure of value, and the actual exchange is in gold bars, letters of credit, or valuable goods.

One gold piece is worth ten silver pieces, the most prevalent coin among commoners. A silver piece buys a laborer's work for a day, a flask of lamp oil, or a night's rest in a poor inn.

One silver piece is worth ten copper pieces, which are common among laborers and beggars. A single copper piece buys a candle, a torch, or a piece of chalk.

In addition, unusual coins made of other precious metals sometimes appear in treasure hoards. The electrum piece (ep) and the platinum piece (pp) originate from fallen empires and lost kingdoms, and they sometimes arouse suspicion and skepticism when used in transactions. An electrum piece is worth five silver pieces, and a platinum piece is worth ten gold pieces.

A standard coin weighs about a third of an ounce, so fifty coins weigh a pound.

","chat":"","unidentified":""},"source":"4d6*100","quantity":1,"weight":0.02,"price":0.01,"attuned":false,"attunement":0,"equipped":true,"rarity":"None","identified":false,"damage":{"parts":[]},"attributes":{"spelldc":10}},"flags":{"plutonium":{"page":"items.html","source":"PHB","hash":"copper%20(cp)_phb","data":{"item":{"name":"Copper (cp)","source":"PHB","page":143,"type":"$","rarity":"none","weight":0.02,"value":1,"entries":["Common coins come in several different denominations based on the relative worth of the metal from which they are made. The three most common coins are the gold piece (gp), the silver piece (sp), and the copper piece (cp).","With one gold piece, a character can buy a belt pouch, 50 feet of good rope, or a goat. A skilled (but not exceptional) artisan can earn one gold piece a day. The gold piece is the standard unit of measure for wealth, even if the coin itself is not commonly used. When merchants discuss deals that involve goods or services worth hundreds or thousands of gold pieces, the transactions don't usually involve the exchange of individual coins. Rather, the gold piece is a standard measure of value, and the actual exchange is in gold bars, letters of credit, or valuable goods.","One gold piece is worth ten silver pieces, the most prevalent coin among commoners. A silver piece buys a laborer's work for a day, a flask of lamp oil, or a night's rest in a poor inn.","One silver piece is worth ten copper pieces, which are common among laborers and beggars. A single copper piece buys a candle, a torch, or a piece of chalk.","In addition, unusual coins made of other precious metals sometimes appear in treasure hoards. The electrum piece (ep) and the platinum piece (pp) originate from fallen empires and lost kingdoms, and they sometimes arouse suspicion and skepticism when used in transactions. An electrum piece is worth five silver pieces, and a platinum piece is worth ten gold pieces.","A standard coin weighs about a third of an ounce, so fifty coins weigh a pound."],"_isEnhanced":true,"_category":"Other","_typeListText":["treasure"],"_typeHtml":"treasure","_attunement":null,"_attunementCategory":"No","_fProperties":[],"_fMisc":["Mundane"],"_fValue":0.01,"_fTier":["none"],"_fIsMundane":true,"_fBonus":[],"_vType":"Treasure"}}}},"img":"https://5e.tools/img/items%2FCopper%20(cp).jpg","effects":[],"_id":"m0qiMQRWDEDzfVsZ"} +{"name":"Platinum 1d6 (pp)","permission":{"default":0,"X4uo406iXTm4HkVN":3},"type":"loot","data":{"description":{"value":"
\n\t\t\t
Treasure
\n\t\t\t
\n\t\t\t\t
10 gp, 0.32 oz.
\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t\t
\n\t\t

Common coins come in several different denominations based on the relative worth of the metal from which they are made. The three most common coins are the gold piece (gp), the silver piece (sp), and the copper piece (cp).

With one gold piece, a character can buy a belt pouch, 50 feet of good rope, or a goat. A skilled (but not exceptional) artisan can earn one gold piece a day. The gold piece is the standard unit of measure for wealth, even if the coin itself is not commonly used. When merchants discuss deals that involve goods or services worth hundreds or thousands of gold pieces, the transactions don't usually involve the exchange of individual coins. Rather, the gold piece is a standard measure of value, and the actual exchange is in gold bars, letters of credit, or valuable goods.

One gold piece is worth ten silver pieces, the most prevalent coin among commoners. A silver piece buys a laborer's work for a day, a flask of lamp oil, or a night's rest in a poor inn.

One silver piece is worth ten copper pieces, which are common among laborers and beggars. A single copper piece buys a candle, a torch, or a piece of chalk.

In addition, unusual coins made of other precious metals sometimes appear in treasure hoards. The electrum piece (ep) and the platinum piece (pp) originate from fallen empires and lost kingdoms, and they sometimes arouse suspicion and skepticism when used in transactions. An electrum piece is worth five silver pieces, and a platinum piece is worth ten gold pieces.

A standard coin weighs about a third of an ounce, so fifty coins weigh a pound.

","chat":"","unidentified":""},"source":"1d6","quantity":1,"weight":0.02,"price":10,"attuned":false,"attunement":0,"equipped":true,"rarity":"None","identified":false,"damage":{"parts":[]},"attributes":{"spelldc":10}},"flags":{"plutonium":{"page":"items.html","source":"PHB","hash":"platinum%20(pp)_phb","data":{"item":{"name":"Platinum (pp)","source":"PHB","page":143,"type":"$","rarity":"none","weight":0.02,"value":1000,"entries":["Common coins come in several different denominations based on the relative worth of the metal from which they are made. The three most common coins are the gold piece (gp), the silver piece (sp), and the copper piece (cp).","With one gold piece, a character can buy a belt pouch, 50 feet of good rope, or a goat. A skilled (but not exceptional) artisan can earn one gold piece a day. The gold piece is the standard unit of measure for wealth, even if the coin itself is not commonly used. When merchants discuss deals that involve goods or services worth hundreds or thousands of gold pieces, the transactions don't usually involve the exchange of individual coins. Rather, the gold piece is a standard measure of value, and the actual exchange is in gold bars, letters of credit, or valuable goods.","One gold piece is worth ten silver pieces, the most prevalent coin among commoners. A silver piece buys a laborer's work for a day, a flask of lamp oil, or a night's rest in a poor inn.","One silver piece is worth ten copper pieces, which are common among laborers and beggars. A single copper piece buys a candle, a torch, or a piece of chalk.","In addition, unusual coins made of other precious metals sometimes appear in treasure hoards. The electrum piece (ep) and the platinum piece (pp) originate from fallen empires and lost kingdoms, and they sometimes arouse suspicion and skepticism when used in transactions. An electrum piece is worth five silver pieces, and a platinum piece is worth ten gold pieces.","A standard coin weighs about a third of an ounce, so fifty coins weigh a pound."],"_isEnhanced":true,"_category":"Other","_typeListText":["treasure"],"_typeHtml":"treasure","_attunement":null,"_attunementCategory":"No","_fProperties":[],"_fMisc":["Mundane"],"_fValue":10,"_fTier":["none"],"_fIsMundane":true,"_fBonus":[],"_vType":"Treasure"}}}},"img":"https://5e.tools/img/items%2FPlatinum%20(pp).jpg","effects":[],"_id":"x6iqWeRJRYLNlVHS"} +{"name":"Gold 2d6x10 (gp)","permission":{"default":0,"X4uo406iXTm4HkVN":3},"type":"loot","data":{"description":{"value":"
\n\t\t\t
Treasure
\n\t\t\t
\n\t\t\t\t
1 gp, 0.32 oz.
\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t\t
\n\t\t

Common coins come in several different denominations based on the relative worth of the metal from which they are made. The three most common coins are the gold piece (gp), the silver piece (sp), and the copper piece (cp).

With one gold piece, a character can buy a belt pouch, 50 feet of good rope, or a goat. A skilled (but not exceptional) artisan can earn one gold piece a day. The gold piece is the standard unit of measure for wealth, even if the coin itself is not commonly used. When merchants discuss deals that involve goods or services worth hundreds or thousands of gold pieces, the transactions don't usually involve the exchange of individual coins. Rather, the gold piece is a standard measure of value, and the actual exchange is in gold bars, letters of credit, or valuable goods.

One gold piece is worth ten silver pieces, the most prevalent coin among commoners. A silver piece buys a laborer's work for a day, a flask of lamp oil, or a night's rest in a poor inn.

One silver piece is worth ten copper pieces, which are common among laborers and beggars. A single copper piece buys a candle, a torch, or a piece of chalk.

In addition, unusual coins made of other precious metals sometimes appear in treasure hoards. The electrum piece (ep) and the platinum piece (pp) originate from fallen empires and lost kingdoms, and they sometimes arouse suspicion and skepticism when used in transactions. An electrum piece is worth five silver pieces, and a platinum piece is worth ten gold pieces.

A standard coin weighs about a third of an ounce, so fifty coins weigh a pound.

","chat":"","unidentified":""},"source":"2d6*10","quantity":1,"weight":0.02,"price":1,"attuned":false,"attunement":0,"equipped":true,"rarity":"None","identified":false,"damage":{"parts":[]},"attributes":{"spelldc":10}},"flags":{"plutonium":{"page":"items.html","source":"PHB","hash":"gold%20(gp)_phb","data":{"item":{"name":"Gold (gp)","source":"PHB","page":143,"type":"$","rarity":"none","weight":0.02,"value":100,"entries":["Common coins come in several different denominations based on the relative worth of the metal from which they are made. The three most common coins are the gold piece (gp), the silver piece (sp), and the copper piece (cp).","With one gold piece, a character can buy a belt pouch, 50 feet of good rope, or a goat. A skilled (but not exceptional) artisan can earn one gold piece a day. The gold piece is the standard unit of measure for wealth, even if the coin itself is not commonly used. When merchants discuss deals that involve goods or services worth hundreds or thousands of gold pieces, the transactions don't usually involve the exchange of individual coins. Rather, the gold piece is a standard measure of value, and the actual exchange is in gold bars, letters of credit, or valuable goods.","One gold piece is worth ten silver pieces, the most prevalent coin among commoners. A silver piece buys a laborer's work for a day, a flask of lamp oil, or a night's rest in a poor inn.","One silver piece is worth ten copper pieces, which are common among laborers and beggars. A single copper piece buys a candle, a torch, or a piece of chalk.","In addition, unusual coins made of other precious metals sometimes appear in treasure hoards. The electrum piece (ep) and the platinum piece (pp) originate from fallen empires and lost kingdoms, and they sometimes arouse suspicion and skepticism when used in transactions. An electrum piece is worth five silver pieces, and a platinum piece is worth ten gold pieces.","A standard coin weighs about a third of an ounce, so fifty coins weigh a pound."],"_isEnhanced":true,"_category":"Other","_typeListText":["treasure"],"_typeHtml":"treasure","_attunement":null,"_attunementCategory":"No","_fProperties":[],"_fMisc":["Mundane"],"_fValue":1,"_fTier":["none"],"_fIsMundane":true,"_fBonus":[],"_vType":"Treasure"}}}},"img":"https://5e.tools/img/items%2FGold%20(gp).jpg","effects":[],"_id":"yQBlW5o5qsyocSOL"} +{"name":"Table: Treasure 0-4","permission":{"default":0,"X4uo406iXTm4HkVN":3},"type":"loot","data":{"description":{"value":"","chat":"","unidentified":""},"source":"","quantity":1,"weight":0,"price":0,"attuned":false,"attunement":0,"equipped":false,"rarity":"","identified":true,"attributes":{"spelldc":10}},"flags":{},"img":"icons/containers/bags/coinpouch-leather-orange.webp","effects":[],"_id":"pSz3JJsjpNCPzybB"} +{"name":"Table: Treasure 5-10","permission":{"default":0,"X4uo406iXTm4HkVN":3},"type":"loot","data":{"description":{"value":"","chat":"","unidentified":""},"source":"","quantity":1,"weight":0,"price":0,"attuned":false,"attunement":0,"equipped":false,"rarity":"","identified":true,"attributes":{"spelldc":10}},"flags":{},"img":"icons/containers/bags/coinpouch-leather-orange.webp","effects":[],"_id":"9iXyn3db4oTXlfzt"} +{"$$deleted":true,"_id":"pSz3JJsjpNCPzybB"} +{"$$deleted":true,"_id":"9iXyn3db4oTXlfzt"} +{"name":"Table: Treasure 0-4","permission":{"default":0,"X4uo406iXTm4HkVN":3},"type":"loot","data":{"description":{"value":"

Generates Loot individual for tiers 0-4

\n
\n

Need create a roll table with name: Treasure 0-4

\n
","chat":"","unidentified":""},"source":"","quantity":1,"weight":0,"price":0,"attuned":false,"attunement":0,"equipped":false,"rarity":"","identified":true,"attributes":{"spelldc":10}},"flags":{},"img":"icons/containers/bags/coinpouch-leather-orange.webp","effects":[],"_id":"ugVca9igxjBDFxsW"} +{"name":"Table: Treasure 5-10","permission":{"default":0,"X4uo406iXTm4HkVN":3},"type":"loot","data":{"description":{"value":"

Generates Loot individual for tiers 5-10

\n
\n

Need create a roll table with name: Treasure 5-10

\n
","chat":"","unidentified":""},"source":"","quantity":1,"weight":0,"price":0,"attuned":false,"attunement":0,"equipped":false,"rarity":"","identified":true,"attributes":{"spelldc":10}},"flags":{},"img":"icons/containers/bags/coinpouch-leather-orange.webp","effects":[],"_id":"7bLxxkNehUUv7siY"} diff --git a/scripts/ActionLoot.js b/scripts/ActionLoot.js index 9429523..6941e6b 100644 --- a/scripts/ActionLoot.js +++ b/scripts/ActionLoot.js @@ -37,7 +37,7 @@ export class ActionLoot { // Morto - lootiar titleChat = game.i18n.localize('Looting.MsgChat.looting'); if (entity.getFlag(SETTINGS.MODULE_NAME, SETTINGS.LOOT)) return ui.notifications.warn(game.i18n.format("Looting.Errors.invalidCheck", { token: entity.name })); // j foi lootiado. - await this.LootNPC(entity.actor, this.actor); + await this.LootNPC(entity.actor, this.actor); } else { // vivo - Roubar if (entity.actor.getFlag(SETTINGS.MODULE_LOOT_SHEET, SETTINGS.LOOT_SHEET)) return; // no um bau ou mercador. @@ -93,7 +93,7 @@ export class ActionLoot { // tipos de loot if (game.settings.get(SETTINGS.MODULE_NAME, "lootSystem") == "mode1") { this.loots = await this.InventoryChancesLoot(target.items); - for (var coin in this.lootCurrency) { + for (let coin in this.lootCurrency) { this.data.currency[coin] = this.data.currency[coin] + this.lootCurrency[coin]; } } else if (game.settings.get(SETTINGS.MODULE_NAME, "lootSystem") == "mode2") { @@ -125,27 +125,35 @@ export class ActionLoot { } async InventoryChancesLoot(actoritems, check = false) { - let tables=[]; + let tables = []; let ac = await actoritems.filter(item => { if (item == null || item == undefined) return; if (item.type == "class" || item.type == "spell" || item.type == "feat") return; + let agio = (game.settings.get(SETTINGS.MODULE_NAME, "lootEquipable")) ? game.settings.get(SETTINGS.MODULE_NAME, "lootEquipableAgil") : 0; // weapon equipment consumable + if (!game.settings.get(SETTINGS.MODULE_NAME, "lootEquipable") && item.data.data.equipped) return; if (item.type === "weapon") { if (item.data.data.weaponType == "siege" || item.data.data.weaponType == "natural") return; - if (!check && (Math.floor(Math.random() * 100) + 1) <= game.settings.get(SETTINGS.MODULE_NAME, "perWeapons")) return; + if (!check && (Math.floor(Math.random() * 100) + 1) <= game.settings.get(SETTINGS.MODULE_NAME, "perWeapons") + agio) return; + item.data.data.equipped = false; } if (item.type === "equipment") { if (item.data.data.equipmentType == "vehicle" || item.data.data.equipmentType == "natural") return; - if (!check && (Math.floor(Math.random() * 100) + 1) <= game.settings.get(SETTINGS.MODULE_NAME, "perEquipment")) return; + if (!check && (Math.floor(Math.random() * 100) + 1) <= game.settings.get(SETTINGS.MODULE_NAME, "perEquipment") + agio) return; + item.data.data.equipped = false; } if (item.type === "consumable") { - if (!check && (Math.floor(Math.random() * 100) + 1) <= game.settings.get(SETTINGS.MODULE_NAME, "perConsumable")) return; + if (!check && (Math.floor(Math.random() * 100) + 1) <= game.settings.get(SETTINGS.MODULE_NAME, "perConsumable") + agio) return; } if (item.type === "loot") { - if (this.ConvertItens2Coins(item)) return; - let matches = item.name.match(/Table:([\w\s\S]+)/gis); + //if (this.ConvertItens2Coins(item)) return; + let matches = item.name.match(/\([a-z]{1,2}\)$/gs); if (matches) { - let t = matches[0].split('Table:'); + this.ConvertItens2Coins(coin, item); + } + let tmatches = item.name.match(/Table:([\w\s\S]+)/gis); + if (tmatches) { + let t = tmatches[0].split('Table:'); tables.push(t[1].trim()); return; } @@ -162,7 +170,6 @@ export class ActionLoot { return ac; } - async ConvertItems2TableLoot(tableroll) { let nItems = []; let table = game.tables.getName(tableroll); @@ -170,11 +177,17 @@ export class ActionLoot { //Bettertable let re = await table.roll(); let result = await re.results; + //console.log(result); for (let r of result) { let packs = game.packs.get(r.collection); let entity = (packs) ? await packs.getEntity(r.resultId) : game.items.get(r.resultId); - if (this.ConvertItens2Coins(entity)) return; - nItems.push(entity); + let matches = entity.name.match(/\([a-z]{1,2}\)$/gs); + if (matches) { + let coin = matches[0].substring(1, matches[0].length - 1); + this.ConvertItens2Coins(coin, entity); + } else { + nItems.push(entity); + } } } else { //Vanilla @@ -183,29 +196,28 @@ export class ActionLoot { for (let r of result) { let packs = game.packs.get(r.collection); let entity = (packs) ? await packs.getEntity(r.resultId) : game.items.get(r.resultId); - if (this.ConvertItens2Coins(entity)) return; - nItems.push(entity); + let matches = entity.name.match(/\([a-z]{1,2}\)$/gs); + if (matches) { + let coin = matches[0].substring(1, matches[0].length - 1); + this.ConvertItens2Coins(coin, entity); + } else { + nItems.push(entity); + } } } - // console.log("items", nItems); + console.log("items", nItems); + console.log(this.lootCurrency); return nItems; } - ConvertItens2Coins(item) { - let matches = item.name.match(/\([a-z]{1,2}\)$/gs); - if (matches) { - let coin = matches[0].substring(1, matches[0].length - 1); - if (!this.lootCurrency[`${coin}`]) this.lootCurrency[`${coin}`] = 0; - if (item.data.data.source.match(/[dkfhxo]{1}[0-9\s\+\-\*\/]+/gs)) { - let r = new Roll(item.data.data.source); - this.lootCurrency[`${coin}`] += r.evaluate().total; - } else { - this.lootCurrency[`${coin}`] += item.data.data.quantity; - } - Object.keys(this.lootCurrency).sort() - return true; + ConvertItens2Coins(coin, item) { + if (!this.lootCurrency[`${coin}`]) this.lootCurrency[`${coin}`] = 0; + if (item.data.data.source.match(/[dkfhxo]{1}[0-9\s\+\-\*\/]+/gs)) { + let r = new Roll(item.data.data.source); + this.lootCurrency[`${coin}`] += r.evaluate().total; + } else { + this.lootCurrency[`${coin}`] += item.data.data.quantity; } - return false; } ResultChat(titleChat, items, targetName, currency) { diff --git a/scripts/settings.js b/scripts/settings.js index 99200bd..8992e68 100644 --- a/scripts/settings.js +++ b/scripts/settings.js @@ -61,4 +61,20 @@ Hooks.once("init", () => { default: true, type: Boolean }); + game.settings.register(SETTINGS.MODULE_NAME, "lootEquipable", { + name: game.i18n.localize('Looting.Settings.lootEquipable'), + hint: game.i18n.localize('Looting.Settings.lootEquipableHint'), + scope: "world", + config: true, + default: true, + type: Boolean + }); + game.settings.register(SETTINGS.MODULE_NAME, "lootEquipableAgil", { + name: game.i18n.localize('Looting.Settings.lootEquipableAgil'), + hint: game.i18n.localize('Looting.Settings.lootEquipableAgilHint'), + scope: "world", + config: true, + default: "5", + type: Number + }); });