Skip to content
Snippets Groups Projects
objects.lua 4.97 KiB
Newer Older
dg's avatar
dg committed
-- ToME - Tales of Maj'Eyal
dg's avatar
dg committed
-- Copyright (C) 2009, 2010, 2011, 2012 Nicolas Casalini
dg's avatar
dg committed
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
--
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org

load("/data/general/objects/objects-maj-eyal.lua")
newEntity{ base = "BASE_LORE",
	define_as = "NOTE"..i,
dg's avatar
dg committed
	name = "Song of the Sands", lore="sandworm-note-"..i,
	desc = [[Some people get the weirdest ideas!]],
	rarity = false,
}
end

dg's avatar
dg committed
-- Artifact, dropped by the sandworm queen
dg's avatar
dg committed
newEntity{
dg's avatar
dg committed
	power_source = {nature=true},
dg's avatar
dg committed
	define_as = "SANDQUEEN_HEART",
dg's avatar
dg committed
	type = "corpse", subtype = "heart", image = "object/artifact/queen_heart.png",
dg's avatar
dg committed
	name = "Heart of the Sandworm Queen", unique=true, unided_name="pulsing organ",
dg's avatar
dg committed
	display = "*", color=colors.VIOLET,
dg's avatar
dg committed
	desc = [[The heart of the Sandworm Queen, ripped from her dead body. You could ... consume it, should you feel mad enough.]],
dg's avatar
dg committed
	cost = 3000,
dg's avatar
dg committed
	use_simple = { name="consume the heart", use = function(self, who)
dg's avatar
dg committed
		game.logPlayer(who, "#00FFFF#You consume the heart and feel the knowledge of this very old creature fill you!")
dg's avatar
dg committed
		who.unused_stats = who.unused_stats + 3
dg's avatar
dg committed
		who.unused_talents = who.unused_talents + 1
		who.unused_generics = who.unused_generics + 1
dg's avatar
dg committed
		game.logPlayer(who, "You have %d stat point(s) to spend. Press G to use them.", who.unused_stats)
		game.logPlayer(who, "You have %d class talent point(s) to spend. Press G to use them.", who.unused_talents)
		game.logPlayer(who, "You have %d generic talent point(s) to spend. Press G to use them.", who.unused_generics)
dg's avatar
dg committed

		if not who:attr("forbid_nature") then
			if who:knowTalentType("wild-gift/harmony") then
				who:setTalentTypeMastery("wild-gift/harmony", who:getTalentTypeMastery("wild-gift/harmony") + 0.2)
			elseif who:knowTalentType("wild-gift/harmony") == false then
				who:learnTalentType("wild-gift/harmony", true)
			else
				who:learnTalentType("wild-gift/harmony", false)
			end
			-- Make sure a previous amulet didnt bug it out
			if who:getTalentTypeMastery("wild-gift/harmony") == 0 then who:setTalentTypeMastery("wild-gift/harmony", 1) end
			game.logPlayer(who, "You are transformed by the heart of the Queen!.")
			game.logPlayer(who, "#00FF00#You gain an affinity for nature. You can now learn new Harmony talents (press G).")
dg's avatar
dg committed

			who:attr("drake_touched", 1)
dg's avatar
dg committed

dg's avatar
dg committed
		game:setAllowedBuild("wilder_wyrmic", true)

		return {used=true, id=true, destroy=true}
dg's avatar
dg committed
	end}
dg's avatar
dg committed
	power_source = {nature=true},
	define_as = "PUTRESCENT_POTION",
	type = "corpse", subtype = "blood",
dg's avatar
dg committed
	name = "Wyrm Bile", unique=true, unided_name="putrescent potion", image="object/artifact/vial_wyrm_bile.png",
	display = "*", color=colors.VIOLET,
	desc = [[A vial of thick, lumpy fluid. Who knows what this will do to you if you drink it?]],
	cost = 3000,

	use_simple = { name="drink the vile blood", use = function(self, who)
		game.logPlayer(who, "#00FFFF#You drink the wyrm bile and feel forever transformed!")
		who.unused_talents_types = who.unused_talents_types + 1
		game.log("You have %d category point(s) to spend. Press G to use them.", who.unused_talents_types)

		local str, dex, con, mag, wil, cun = rng.range(-3, 6), rng.range(-3, 6), rng.range(-3, 6), rng.range(-3, 6), rng.range(-3, 6), rng.range(-3, 6)
		who:incStat("str", str) if str >= 0 then str="+"..str end
		who:incStat("dex", dex) if dex >= 0 then dex="+"..dex end
		who:incStat("mag", mag) if mag >= 0 then mag="+"..mag end
		who:incStat("wil", wil) if wil >= 0 then wil="+"..wil end
		who:incStat("cun", cun) if cun >= 0 then cun="+"..cun end
		who:incStat("con", con) if con >= 0 then con="+"..con end
		game.logPlayer(who, "#00FF00#Your stats have changed! (Str %s, Dex %s, Mag %s, Wil %s, Cun %s, Con %s)", str, dex, mag, wil, cun, con)

dg's avatar
dg committed
		who:attr("drake_touched", 1)

		return {used=true, id=true, destroy=true}
dg's avatar
dg committed

newEntity{ base = "BASE_GEM",
	define_as = "ATAMATHON_ACTIVATE",
	subtype = "red",
dg's avatar
dg committed
	name = "Atamathon's Lost Ruby Eye", color=colors.VIOLET, quest=true, unique=true, identified=true, image="object/artifact/atamathons_lost_ruby_eye.png",
dg's avatar
dg committed
	desc = [[One of the ruby eyes of the legendary giant golem: Atamathon.
It is said it was made by the halflings during the Age of Pyre as a weapon against the orcs. Even though it was destroyed it managed to deal a crippling blow by killing their leader, Garkul the Devourer.]],
	material_level = 5,
	cost = 100,
	wielder = { inc_damage = {[DamageType.FIRE]=12} },
	imbue_powers = { inc_damage = {[DamageType.FIRE]=12} },
}