I hope someone other than me will find it useful.
Code: Select all
cloneObject{
name = "grimforge_anvil",
baseObject = "waltar", -- should work with any alcove or altar variant
onInsertItem = function (self, item)
if item.name == "ogre_hammer" then
for i in self:containedItems() do
if i.name == "blue_gem" then
playSound("impact_blunt")
playSound("lightning_bolt_hit")
playSound("level_up")
i:destroy()
self:addItem(spawn("gold_key"))
break
end
end
end
return item.name == "blue_gem" and self:getItemCount() == 0
end,
}Also, if anyone knows how to make it "activate" only when you break something on it, as opposed to when you add something to or remove something from it, please tell me.