Page 1 of 1

Anvil altar for smashing things

Posted: Mon Oct 15, 2012 4:09 am
by Lupe Fenrir
I made a script for an altar that you can put a gem on and then smash with a hammer to reveal a key.
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,
}
Uses the "waltar" found here, but it will work the same if you change the word "waltar" to "altar" or "Alcove, I just think it looks better this way. :P


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.

Re: Anvil altar for smashing things

Posted: Mon Oct 15, 2012 7:29 am
by Kuningas
I'm thinking smashing rocks to find gems myself -- I may incorporate it to a puzzle in my main dungeon.

Also, I like the way you've put the sounds in as well, makes for a lot more anvil-like experience. : D

Re: Anvil altar for smashing things

Posted: Mon Oct 15, 2012 3:52 pm
by Lupe Fenrir
I'm happy you liked it. :D

Re: Anvil altar for smashing things

Posted: Mon Oct 15, 2012 5:39 pm
by crisman
Nice idea!! I'm working on the same waltar, but mine is a heated waltar, for creating some special chemical compound by placing flasks with the starting mixture on it. I'll script it this evening, right now I'm just write on paper the puzzle itself :D