Skip to content

Commit

Permalink
chat messages when broken/destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
bmos committed Apr 27, 2021
1 parent d143a3d commit c8113b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/broken_itemdurability.lua
Expand Up @@ -145,10 +145,12 @@ function handleBrokenItem(nodeItem)
DB.setValue(nodeItem, 'carried', 'number', 0)
DB.setValue(nodeItem, 'name', 'string', '[DESTROYED] ' .. DB.getValue(nodeItem, 'name', ''))
end
ChatManager.Message(string.format(Interface.getString('char_weapon_destroyed'), sItemName), true, rSource);
elseif nBrokenState == 1 and not sItemName:find('%[BROKEN%]') then
makeBackup(nodeItem)
brokenPenalties(nodeItem, true)
DB.setValue(nodeItem, 'name', 'string', '[BROKEN] ' .. DB.getValue(nodeItem, 'name', ''))
ChatManager.Message(string.format(Interface.getString('char_weapon_broken'), sItemName), true, rSource);
else
brokenPenalties(nodeItem, false)
removeBackup(nodeItem)
Expand Down
2 changes: 2 additions & 0 deletions strings/strings_item_durability.xml
Expand Up @@ -23,4 +23,6 @@
<string name="enc_opt_item_destroyed_unequipped">Un-equip</string>

<!-- chat messages -->
<string name="char_actions_weapon_broken">%s has broken.</string>
<string name="char_actions_weapon_destroyed">%s is destroyed.</string>
</root>

0 comments on commit c8113b5

Please sign in to comment.