Skip to content
Snippets Groups Projects
world-artifacts.lua 231 KiB
Newer Older
dg's avatar
dg committed
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009 - 2014 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

dg's avatar
dg committed
local Stats = require "engine.interface.ActorStats"
local Talents = require "engine.interface.ActorTalents"
dg's avatar
dg committed

--- Load additional artifacts
for def, e in pairs(game.state:getWorldArtifacts()) do
	importEntity(e)
	print("Importing "..e.name.." into world artifacts")
dg's avatar
dg committed
-- This file describes artifacts not bound to a special location, they can be found anywhere
DarkGod's avatar
DarkGod committed

newEntity{ base = "BASE_GEM", 
	power_source = {arcane=true},
	unique = true,
	unided_name = "windy gem",
	name = "Windborne Azurite", subtype = "blue",
DarkGod's avatar
DarkGod committed
	color = colors.BLUE, image = "object/artifact/windborn_azurite.png",
DarkGod's avatar
DarkGod committed
	level_range = {18, 40},
	desc = [[Air currents swirl around this bright blue jewel.]],
	rarity = 240,
	cost = 200,
	identified = false,
	material_level = 4,
	wielder = {
		inc_stats = {[Stats.STAT_DEX] = 8, [Stats.STAT_CUN] = 8 },
DarkGod's avatar
DarkGod committed
		inc_damage = {[DamageType.LIGHTNING] = 20 },
		cancel_damage_chance = 8, -- add to tooltip
DarkGod's avatar
DarkGod committed
		damage_affinity={
			[DamageType.LIGHTNING] = 20,
		},
		movement_speed = 0.2,
	},
	imbue_powers = {
DarkGod's avatar
DarkGod committed
		inc_stats = {[Stats.STAT_DEX] = 8, [Stats.STAT_CUN] = 8 },
DarkGod's avatar
DarkGod committed
		inc_damage = {[DamageType.LIGHTNING] = 20 },
DarkGod's avatar
DarkGod committed
		cancel_damage_chance = 8,
DarkGod's avatar
DarkGod committed
		damage_affinity={
			[DamageType.LIGHTNING] = 20,
		},
DarkGod's avatar
DarkGod committed
		movement_speed = 0.15,
	},
DarkGod's avatar
DarkGod committed
}

-- Low base values because you can stack affinity and resist
-- The 3rd type is pretty meaningless balance-wise.  Magic debuffs hardly matter.  The real advantage is the affinity.
newEntity{ base = "BASE_INFUSION",
	name = "Primal Infusion", unique=true, image = "object/artifact/primal_infusion.png",
DarkGod's avatar
DarkGod committed
	desc = [[This wild infusion has evolved.]],
	unided_name = "pulsing infusion",
	level_range = {15, 40},
	rarity = 300,
	cost = 300,
	material_level = 3,

	inscription_kind = "protect",
	inscription_data = {
DarkGod's avatar
DarkGod committed
		cooldown = 18,
DarkGod's avatar
DarkGod committed
		dur = 6,
		power = 10,
		use_stat_mod = 0.1, 
		what = {physical=true, mental=true, magical=true},
	},
	inscription_talent = "INFUSION:_PRIMAL",
}

dg's avatar
dg committed
newEntity{ base = "BASE_STAFF",
	power_source = {arcane=true},
	unique = true,
	name = "Staff of Destruction",
	flavor_name = "magestaff",
	unided_name = "darkness infused staff", image = "object/artifact/staff_of_destruction.png",
	level_range = {20, 25},
dg's avatar
dg committed
	color=colors.VIOLET,
dg's avatar
dg committed
	rarity = 170,
dg's avatar
dg committed
	desc = [[This unique-looking staff is carved with runes of destruction.]],
dg's avatar
dg committed
	cost = 200,
	material_level = 3,

	require = { stat = { mag=24 }, },
	modes = {"fire", "cold", "lightning", "arcane"},
dg's avatar
dg committed
		apr = 4,
		dammod = {mag=1.5},
		damtype = DamageType.FIRE,
		is_greater = true,
	},
	wielder = {
		combat_spellpower = 10,
dg's avatar
dg committed
		combat_spellcrit = 15,
dg's avatar
dg committed
		inc_damage={
			[DamageType.FIRE] = 20,
			[DamageType.LIGHTNING] = 20,
			[DamageType.COLD] = 20,
			[DamageType.ARCANE] = 20,
dg's avatar
dg committed
		},
		learn_talent = {[Talents.T_COMMAND_STAFF] = 1},
	talent_on_spell = { {chance=10, talent=Talents.T_IMPENDING_DOOM, level=1}},
dg's avatar
dg committed
newEntity{ base = "BASE_RING",
	power_source = {nature=true},
dg's avatar
dg committed
	unique = true,
dg's avatar
dg committed
	name = "Vargh Redemption", color = colors.LIGHT_BLUE, image="object/artifact/ring_vargh_redemption.png",
dg's avatar
dg committed
	unided_name = "sea-blue ring",
	desc = [[This azure ring seems to be always moist to the touch.]],
	level_range = {10, 20},
	rarity = 150,
dg's avatar
dg committed
	cost = 500,
dg's avatar
dg committed
	material_level = 2,
dg's avatar
dg committed

	max_power = 60, power_regen = 1,
	use_power = { name = "summon a tidal wave", power = 60,
		use = function(self, who)
			local duration = 7
			local radius = 1
			local dam = 20
			-- Add a lasting map effect
			game.level.map:addEffect(who,
				who.x, who.y, duration,
				engine.DamageType.WAVE, {dam=dam, x=who.x, y=who.y},
dg's avatar
dg committed
				radius,
				5, nil,
				engine.MapEffect.new{color_br=30, color_bg=60, color_bb=200, effect_shader="shader_images/water_effect1.png"},
dg's avatar
dg committed
				function(e)
dg's avatar
dg committed
					e.radius = e.radius + 0.4
					return true
dg's avatar
dg committed
				end,
				false
			)
			game.logSeen(who, "%s brandishes the %s, calling forth the might of the oceans!", who.name:capitalize(), self:getName())
dg's avatar
dg committed
		end
	},
	wielder = {
		inc_stats = { [Stats.STAT_WIL] = 4, [Stats.STAT_CON] = 6 },
dg's avatar
dg committed
		max_mana = 20,
		max_stamina = 20,
		max_psi = 20,
dg's avatar
dg committed
		resists = {
			[DamageType.COLD] = 25,
			[DamageType.NATURE] = 10,
		},
	},
}

dg's avatar
dg committed
newEntity{ base = "BASE_RING",
	power_source = {nature=true},
dg's avatar
dg committed
	unique = true,
dg's avatar
dg committed
	name = "Ring of the Dead", color = colors.DARK_GREY, image = "object/artifact/jewelry_ring_of_the_dead.png",
dg's avatar
dg committed
	unided_name = "dull black ring",
	desc = [[This ring is imbued with powers from beyond the grave. It is said that those who wear it may find a new path when all other roads turn dim.]],
dg's avatar
dg committed
	level_range = {35, 42},
	rarity = 250,
	cost = 500,
	material_level = 4,
	special_desc = function(self) return "Will bring you back from death, but only once!" end,
dg's avatar
dg committed
	wielder = {
		inc_stats = { [Stats.STAT_LCK] = 10, },
		die_at = -100,
		combat_physresist = 10,
		combat_mentalresist = 10,
		combat_spellresist = 10,
dg's avatar
dg committed
	},
	one_shot_life_saving = true,
}

dg's avatar
dg committed
newEntity{ base = "BASE_RING",
	power_source = {arcane=true},
dg's avatar
dg committed
	unique = true,
dg's avatar
dg committed
	name = "Elemental Fury", color = colors.PURPLE, image = "object/artifact/ring_elemental_fury.png",
dg's avatar
dg committed
	unided_name = "multi-hued ring",
	desc = [[This ring shines with many colors.]],
	level_range = {15, 30},
dg's avatar
dg committed
	rarity = 200,
dg's avatar
dg committed
	cost = 200,
dg's avatar
dg committed
	material_level = 3,
	special_desc = function(self) return "All your damage is converted and split into arcane, fire, cold and lightning." end,
dg's avatar
dg committed
	wielder = {
dg's avatar
dg committed
		inc_stats = { [Stats.STAT_MAG] = 3,[Stats.STAT_CUN] = 3, },
dg's avatar
dg committed
		inc_damage = {
			[DamageType.ARCANE]    = 12,
			[DamageType.FIRE]      = 12,
			[DamageType.COLD]      = 12,
			[DamageType.LIGHTNING] = 12,
dg's avatar
dg committed
newEntity{ base = "BASE_AMULET",
	power_source = {technique=true},
dg's avatar
dg committed
	unique = true,
dg's avatar
dg committed
	name = "Feathersteel Amulet", color = colors.WHITE, image = "object/artifact/feathersteel_amulet.png",
dg's avatar
dg committed
	unided_name = "light amulet",
	desc = [[The weight of the world seems a little lighter with this amulet around your neck.]],
	level_range = {5, 15},
	rarity = 200,
	cost = 90,
	material_level = 2,
	wielder = {
		max_encumber = 20,
		fatigue = -20,
		avoid_pressure_traps = 1,
dg's avatar
dg committed
	},
}

dg's avatar
dg committed
newEntity{ base = "BASE_AMULET", define_as = "SET_GARKUL_TEETH",
	power_source = {technique=true},
dg's avatar
dg committed
	unique = true,
dg's avatar
dg committed
	name = "Garkul's Teeth", color = colors.YELLOW, image = "object/artifact/amulet_garkuls_teeth.png",
dg's avatar
dg committed
	unided_name = "a necklace made of teeth",
dg's avatar
dg committed
	desc = [[Hundreds of humanoid teeth have been strung together on multiple strands of thin leather, creating this tribal necklace.  One would have to assume that these are not the teeth of Garkul the Devourer but rather the teeth of Garkul's many meals.]],
dg's avatar
dg committed
	level_range = {40, 50},
	rarity = 300,
	cost = 1000,
	material_level = 5,
dg's avatar
dg committed
	wielder = {
		inc_stats = {
dg's avatar
dg committed
			[Stats.STAT_STR] = 10,
			[Stats.STAT_CON] = 6,
dg's avatar
dg committed
		},
		talents_types_mastery = {
			["technique/2hweapon-cripple"] = 0.1,
			["technique/2hweapon-offense"] = 0.1,
			["technique/warcries"] = 0.1,
			["technique/bloodthirst"] = 0.1,
dg's avatar
dg committed
		combat_physresist = 18,
		combat_mentalresist = 18,
dg's avatar
dg committed
		pin_immune = 1,
dg's avatar
dg committed
	},
	max_power = 48, power_regen = 1,
dg's avatar
dg committed
	use_talent = { id = Talents.T_SHATTERING_SHOUT, level = 4, power = 10 },
dg's avatar
dg committed

	set_list = { {"define_as", "HELM_OF_GARKUL"} },
	on_set_complete = function(self, who)
		self:specialSetAdd({"wielder","die_at"}, -100)
		game.logSeen(who, "#CRIMSON#As you wear both Garkul's heirlooms you can feel the mighty warrior's spirit flowing through you.")
	end,
	on_set_broken = function(self, who)
		game.logPlayer(who, "#CRIMSON#The spirit of Garkul fades away.")
	end,
dg's avatar
dg committed
}

dg's avatar
dg committed
newEntity{ base = "BASE_LITE",
	power_source = {nature=true},
	name = "Summertide Phial", image="object/artifact/summertide_phial.png",
dg's avatar
dg committed
	unided_name = "glowing phial",
	level_range = {1, 10},
dg's avatar
dg committed
	color=colors.YELLOW,
dg's avatar
dg committed
	rarity = 100,
dg's avatar
dg committed
	desc = [[A small crystal phial that captured Sunlight during the Summertide.]],
dg's avatar
dg committed
	cost = 200,
dg's avatar
dg committed
	max_power = 15, power_regen = 1,
	use_power = { name = "call light", power = 10,
		use = function(self, who)
			who:project({type="ball", range=0, radius=20}, who.x, who.y, engine.DamageType.LITE, 100)
dg's avatar
dg committed
			game.logSeen(who, "%s brandishes the %s and banishes all shadows!", who.name:capitalize(), self:getName())
dg's avatar
dg committed
		end
	},
dg's avatar
dg committed
		lite = 4,
		healing_factor = 0.1,
		inc_damage = {[DamageType.LIGHT]=10},
		resists = {[DamageType.LIGHT]=30},
newEntity{ base = "BASE_GEM",
	power_source = {arcane=true},
dg's avatar
dg committed
	name = "Burning Star", image = "object/artifact/jewel_gem_burning_star.png",
dg's avatar
dg committed
	unided_name = "burning jewel",
	level_range = {20, 30},
dg's avatar
dg committed
	color=colors.YELLOW,
	identified = false,
dg's avatar
dg committed
	rarity = 250,
	material_level = 3,
dg's avatar
dg committed
	desc = [[The first Halfling mages during the Age of Allure discovered how to capture the Sunlight and infuse gems with it.
This star is the culmination of their craft. Light radiates from its ever-shifting yellow surface.]],
dg's avatar
dg committed
	cost = 400,
	max_power = 30, power_regen = 1,
	use_power = { name = "map surroundings", power = 30,
dg's avatar
dg committed
		use = function(self, who)
			who:magicMap(20)
dg's avatar
dg committed
			game.logSeen(who, "%s brandishes the %s which radiates in all directions!", who.name:capitalize(), self:getName())
dg's avatar
dg committed
		end
	},
	carrier = {
		lite = 1,
dg's avatar
dg committed
newEntity{ base = "BASE_LITE",
	power_source = {arcane=true},
dg's avatar
dg committed
	unique = true,
	name = "Dúathedlen Heart",
dg's avatar
dg committed
	unided_name = "a dark, fleshy mass", image = "object/artifact/dark_red_heart.png",
dg's avatar
dg committed
	level_range = {30, 40},
	color = colors.RED,
	encumber = 1,
	rarity = 300,
	material_level = 4,
DarkGod's avatar
DarkGod committed
	desc = [[This dark red heart still beats despite being separated from its owner.  It also snuffs out any light source that comes near it.]],
dg's avatar
dg committed
	cost = 100,

	wielder = {
		lite = -1000,
		infravision = 6,
dg's avatar
dg committed
		resists_cap = { [DamageType.LIGHT] = 10 },
		resists = { [DamageType.LIGHT] = 30 },
		talents_types_mastery = { ["cunning/stealth"] = 0.1 },
		combat_dam = 7,
dg's avatar
dg committed
	},

	max_power = 15, power_regen = 1,
	use_talent = { id = Talents.T_BLOOD_GRASP, level = 3, power = 10 },
}

dg's avatar
dg committed
newEntity{
	power_source = {nature=true},
dg's avatar
dg committed
	unique = true,
	type = "potion", subtype="potion",
	name = "Blood of Life",
	unided_name = "bloody phial",
	level_range = {1, 50},
dg's avatar
dg committed
	display = '!', color=colors.VIOLET, image="object/artifact/potion_blood_of_life.png",
dg's avatar
dg committed
	encumber = 0.4,
dg's avatar
dg committed
	rarity = 350,
dg's avatar
dg committed
	desc = [[This vial of blood was drawn from an ancient race in the Age of Haze. Some of the power and vitality of those early days of the world still flows through it. "Drink me, mortal," the red liquid seems to whisper in your thoughts. "I will bring you light beyond darkness. Those who taste my essence fear not the death of flesh. Drink me, mortal, if you value your life..."]],
dg's avatar
dg committed
	cost = 1000,
dg's avatar
dg committed
	special = true,
dg's avatar
dg committed
	use_simple = { name = "quaff the Blood of Life to grant an extra life", use = function(self, who)
		game.logSeen(who, "%s quaffs the %s!", who.name:capitalize(), self:getName())
dg's avatar
dg committed
		if not who:attr("undead") then
			who.blood_life = true
			game.logPlayer(who, "#LIGHT_RED#You feel the Blood of Life rushing through your veins.")
		else
			game.logPlayer(who, "The Blood of Life seems to have no effect on you.")
		end
		return {used=true, id=true, destroy=true}
dg's avatar
dg committed
	end},
}
dg's avatar
dg committed

	power_source = {technique=true},
dg's avatar
dg committed
	name = "Eden's Guile", image = "object/artifact/boots_edens_guile.png",
	unided_name = "pair of yellow boots",
dg's avatar
dg committed
	desc = [[The boots of a Rogue outcast, who knew that the best way to deal with a problem was to run from it.]],
	on_id_lore = "eden-guile",
dg's avatar
dg committed
	rarity = 300,
	material_level = 2,
	wielder = {
		combat_armor = 1,
		combat_def = 2,
		fatigue = 2,
		talents_types_mastery = { ["cunning/survival"] = 0.2 },
		inc_stats = { [Stats.STAT_CUN] = 3, },
	},

	max_power = 50, power_regen = 1,
dg's avatar
dg committed
	use_power = { name = "boost speed", power = 50,
			who:setEffect(who.EFF_SPEED, 8, {power=math.min(0.20 + who:getCun() / 200, 0.7)})
	power_source = {nature=true, technique=true},
dg's avatar
dg committed
	name = "Fire Dragon Shield", image = "object/artifact/fire_dragon_shield.png",
	moddable_tile = "special/%s_fire_dragon_shield",
	moddable_tile_big = true,
dg's avatar
dg committed
	desc = [[This large shield was made using scales of many fire drakes from the lost land of Tar'Eyal.]],
	color = colors.LIGHT_RED,
	metallic = false,
	level_range = {27, 35},
	rarity = 300,
	require = { stat = { str=28 }, },
	cost = 350,
	material_level = 4,
dg's avatar
dg committed
		physcrit = 4.5,
		dammod = {str=1},
		damtype = DamageType.FIRE,
	},
	wielder = {
		resists={[DamageType.FIRE] = 35},
		on_melee_hit={[DamageType.FIRE] = 17},
		combat_armor = 9,
		combat_def = 16,
		combat_def_ranged = 15,
		fatigue = 20,
		learn_talent = { [Talents.T_BLOCK] = 5, },
dg's avatar
dg committed
newEntity{ base = "BASE_SHIELD",
	power_source = {technique=true},
dg's avatar
dg committed
	unique = true,
	name = "Titanic", image = "object/artifact/shield_titanic.png",
	moddable_tile = "special/%s_titanic",
	moddable_tile_big = true,
dg's avatar
dg committed
	unided_name = "huge shield",
dg's avatar
dg committed
	desc = [[This shield made of the darkest stralite is huge, heavy and very solid.]],
dg's avatar
dg committed
	color = colors.GREY,
	level_range = {20, 30},
	rarity = 270,
	require = { stat = { str=37 }, },
	cost = 300,
	material_level = 3,
dg's avatar
dg committed
	special_combat = {
		dam = 48,
dg's avatar
dg committed
		physcrit = 4.5,
		dammod = {str=1},
dg's avatar
dg committed
	},
	wielder = {
		combat_armor = 18,
		combat_def = 20,
		combat_def_ranged = 10,
		fatigue = 30,
		combat_armor_hardiness = 20,
		learn_talent = { [Talents.T_BLOCK] = 4, },
dg's avatar
dg committed
newEntity{ base = "BASE_SHIELD",
	power_source = {nature=true},
	unique = true,
	name = "Black Mesh", image = "object/artifact/shield_mesh.png",
	unided_name = "pile of tendrils",
DarkGod's avatar
DarkGod committed
	desc = [[Black, interwoven tendrils form this mesh that can be used as a shield. It reacts visibly to your touch, clinging to your arm and engulfing it in a warm, black mass.]],
dg's avatar
dg committed
	color = colors.BLACK,
	level_range = {15, 30},
	rarity = 270,
dg's avatar
dg committed
	cost = 400,
	material_level = 3,
	moddable_tile = "special/%s_black_mesh",
	moddable_tile_big = true,
dg's avatar
dg committed
	metallic = false,
	special_combat = {
		dam = resolvers.rngavg(25,35),
		block = resolvers.rngavg(90, 120),
		physcrit = 5,
		dammod = {str=1},
	},
	wielder = {
		combat_armor = 2,
		combat_def = 8,
		combat_def_ranged = 8,
		fatigue = 12,
		learn_talent = { [Talents.T_BLOCK] = 3, },
		resists = { [DamageType.BLIGHT] = 15, [DamageType.DARKNESS] = 30, },
		stamina_regen = 2,
	},
	on_block = {desc = "30% chance of pulling in the attacker", fct = function(self, who, src, type, dam, eff)
dg's avatar
dg committed
		if rng.percent(30) then
			if not src then return end

			src:pull(who.x, who.y, 15)
			game.logSeen(src, "Black tendrils shoot out of the mesh and pull %s to you!", src.name:capitalize())
			if core.fov.distance(who.x, who.y, src.x, src.y) <= 1 and src:canBe('pin') then
				src:setEffect(src.EFF_CONSTRICTED, 6, {src=who})
			end
		end
	power_source = {technique=true},
	name = "Rogue Plight", image = "object/artifact/armor_rogue_plight.png",
dg's avatar
dg committed
	desc = [[No rogue blades shall incapacitate the wearer of this armour.]],
	sentient = true,
	global_speed = 0.25, -- act every 4th turn
	material_level = 3,
	on_wear = function(self, who)
		self.worn_by = who
	end,
	on_takeoff = function(self, who)
		self.worn_by = nil
	end,
	special_desc = function(self) return "Transfers a bleed, poison, or wound to its source or a nearby enemy every 4 turns." 
	end,
	wielder = {
		combat_def = 6,
		combat_armor = 7,
		fatigue = 7,
		inc_stats = { [Stats.STAT_WIL] = 5, [Stats.STAT_CON] = 4, },
	act = function(self)
		self:useEnergy()
	
		if not self.worn_by then return end -- items act even when not equipped
		local who = self.worn_by

		-- Make sure the item is worn
		-- This should be redundant but whatever
		local o, item, inven_id = who:findInAllInventoriesBy("define_as", "ROGUE_PLIGHT")
		if not o or not who:getInven(inven_id).worn then return end
		
		local Map = require "engine.Map"
		
		for eff_id, p in pairs(who.tmp) do
			-- p only has parameters, we need to get the effect definition (e) to check subtypes
			local e = who.tempeffect_def[eff_id]
DarkGod's avatar
DarkGod committed
			if e.status == "detrimental" and e.subtype and (e.subtype.bleed or e.subtype.poison or e.subtype.wound) then	
				
				-- Copy the effect parameters then change only the source
				-- This will preserve everything passed to the debuff in setEffect but will use the new source for +damage%, etc
				local effectParam = who:copyEffect(eff_id)
				effectParam.src = who
					
				if p.src and p.src.setEffect and not p.src.dead then -- Most debuffs don't define a source
					p.src:setEffect(eff_id, p.dur, effectParam)
					who:removeEffect(eff_id)
					game.logPlayer(who, "#CRIMSON#Rogue Plight transfers an effect to its source!")
					return true
				else 
					-- If there is no source move the debuff to an adjacent enemy instead
					-- If there is no source or adjacent enemy the effect fails		
					for _, coor in pairs(util.adjacentCoords(who.x, who.y)) do
						local act = game.level.map(coor[1], coor[2], Map.ACTOR)
						if act then
							act:setEffect(eff_id, p.dur, effectParam)
							who:removeEffect(eff_id)
							game.logPlayer(who, "#CRIMSON#Rogue Plight transfers an effect to a nearby enemy!")
							return true
						end		
DarkGod's avatar
DarkGod committed
					end
				end
			end
		end	
DarkGod's avatar
DarkGod committed
	end,
	power_source = {nature=true},
	unique = true,
	type = "misc", subtype="egg",
	unided_name = "dark egg",
dg's avatar
dg committed
	name = "Mummified Egg-sac of Ungolë", image = "object/artifact/mummified_eggsack.png",
dg's avatar
dg committed
	display = "*", color=colors.DARK_GREY,
	not_in_stores = true,
DarkGod's avatar
DarkGod committed
	desc = [[Dry and dusty to the touch, it still seems to retain some shadow of life.]],

	carrier = {
		lite = -2,
	},
	max_power = 100, power_regen = 1,
	use_power = { name = "summon spiders", power = 80, use = function(self, who)
dg's avatar
dg committed
		if not who:canBe("summon") then game.logPlayer(who, "You cannot summon; you are suppressed!") return end
		local NPC = require "mod.class.NPC"
		local list = NPC:loadList("/data/general/npcs/spider.lua")

		for i = 1, 2 do
			-- Find space
			local x, y = util.findFreeGrid(who.x, who.y, 5, true, {[engine.Map.ACTOR]=true})
			if not x then break end

			local e
			repeat e = rng.tableRemove(list)
			until not e.unique and e.rarity

			local spider = game.zone:finishEntity(game.level, "actor", e)
			spider.make_escort = nil
			spider.silent_levelup = true
			spider.faction = who.faction
			spider.ai = "summoned"
			spider.ai_real = "dumb_talented_simple"
			spider.summoner = who
			spider.summon_time = 10
			local setupSummon = getfenv(who:getTalentFromId(who.T_SPIDER).action).setupSummon
			setupSummon(who, spider, x, y)
	end },
}

newEntity{ base = "BASE_HELM",
	power_source = {technique=true},
	unique = true,
	name = "Helm of the Dwarven Emperors", image = "object/artifact/helm_of_the_dwarven_emperors.png",
	unided_name = "shining helm",
	desc = [[A Dwarven helm embedded with a single diamond that can banish all underground shadows.]],
	level_range = {20, 28},
	rarity = 240,
	cost = 700,
	material_level = 2,
dg's avatar
dg committed
	wielder = {
		lite = 1,
		combat_armor = 6,
		fatigue = 4,
		blind_immune = 0.3,
		confusion_immune = 0.3,
		inc_stats = { [Stats.STAT_WIL] = 3, [Stats.STAT_MAG] = 4, },
dg's avatar
dg committed
		inc_damage={
			[DamageType.LIGHT] = 8,
		},
	},
	max_power = 30, power_regen = 1,
	use_talent = { id = Talents.T_SUN_FLARE, level = 3, power = 30 },
	on_wear = function(self, who)
		if who.descriptor and who.descriptor.race == "Dwarf" then
			local Stats = require "engine.interface.ActorStats"

			self:specialWearAdd({"wielder","inc_stats"}, { [Stats.STAT_CUN] = 5, [Stats.STAT_MAG] = 5, [Stats.STAT_WIL] = 5, })
			game.logPlayer(who, "#LIGHT_BLUE#The legacy of Dwarven Emperors grants you their wisdom.")
dg's avatar
dg committed
}

dg's avatar
dg committed
newEntity{ base = "BASE_KNIFE",
	power_source = {technique=true},
dg's avatar
dg committed
	unique = true,
dg's avatar
dg committed
	name = "Silent Blade", image = "object/artifact/dagger_silent_blade.png",
dg's avatar
dg committed
	unided_name = "shining dagger",
Amagad's avatar
Amagad committed
	moddable_tile = "special/%s_dagger_silent_blade",
	moddable_tile_big = true,
dg's avatar
dg committed
	desc = [[A thin, dark dagger that seems to meld seamlessly into the shadows.]],
dg's avatar
dg committed
	level_range = {23, 28},
dg's avatar
dg committed
	rarity = 200,
	require = { stat = { cun=25 }, },
	cost = 250,
	material_level = 2,
dg's avatar
dg committed
	combat = {
		dam = 25,
dg's avatar
dg committed
		apr = 10,
		physcrit = 8,
		dammod = {dex=0.55,str=0.35},
dg's avatar
dg committed
		no_stealth_break = true,
		melee_project={[DamageType.RANDOM_SILENCE] = 10},
	},
dg's avatar
dg committed
	wielder = {combat_atk = 10},
dg's avatar
dg committed
}

newEntity{ base = "BASE_KNIFE", define_as = "ART_PAIR_MOON",
	power_source = {arcane=true},
dg's avatar
dg committed
	unique = true,
dg's avatar
dg committed
	name = "Moon", image = "object/artifact/dagger_moon.png",
dg's avatar
dg committed
	unided_name = "crescent blade",
Amagad's avatar
Amagad committed
	moddable_tile = "special/%s_dagger_moon",
	moddable_tile_big = true,
DarkGod's avatar
DarkGod committed
	desc = [[A viciously curved blade that a folk story says is made from a material that originates from the moon.  Devouring the light around it, it fades.]],
dg's avatar
dg committed
	level_range = {20, 30},
	rarity = 200,
	require = { stat = { dex=24, cun=24 }, },
dg's avatar
dg committed
	cost = 300,
	material_level = 3,
	combat = {
dg's avatar
dg committed
		apr = 30,
		physcrit = 10,
		dammod = {dex=0.45,str=0.45},
		melee_project={[DamageType.DARKNESS] = 20},
dg's avatar
dg committed
	},
	wielder = {
		lite = -1,
		inc_damage={
			[DamageType.DARKNESS] = 10,
dg's avatar
dg committed
		},
	},
	set_list = { {"define_as","ART_PAIR_STAR"} },
	on_set_complete = function(self, who)
		self:specialSetAdd({"wielder","lite"}, 1)
dg's avatar
dg committed
		self:specialSetAdd({"combat","melee_project"}, {[engine.DamageType.RANDOM_CONFUSION]=10})
DarkGod's avatar
DarkGod committed
		self:specialSetAdd({"wielder","inc_damage"}, {[engine.DamageType.DARKNESS]=15})
		game.logSeen(who, "#ANTIQUE_WHITE#The two blades glow brightly as they are brought close together.")
	on_set_broken = function(self, who)
		game.logPlayer(who, "#ANTIQUE_WHITE#The light from the two blades fades as they are separated.")
newEntity{ base = "BASE_KNIFE", define_as = "ART_PAIR_STAR",
	power_source = {arcane=true},
dg's avatar
dg committed
	unique = true,
	name = "Star",
	unided_name = "jagged blade", image = "object/artifact/dagger_star.png",
Amagad's avatar
Amagad committed
	moddable_tile = "special/%s_dagger_star",
	moddable_tile_big = true,
	desc = [[Legend tells of a blade, shining bright as a star. Forged from a material fallen from the skies, it glows.]],
dg's avatar
dg committed
	level_range = {20, 30},
	rarity = 200,
	require = { stat = { dex=24, cun=24 }, },
dg's avatar
dg committed
	cost = 300,
	material_level = 3,
	combat = {
dg's avatar
dg committed
		apr = 20,
		physcrit = 20,
		dammod = {dex=0.45,str=0.45},
		melee_project={[DamageType.LIGHT] = 20},
dg's avatar
dg committed
	},
	wielder = {
		lite = 1,
		inc_damage={
			[DamageType.LIGHT] = 10,
dg's avatar
dg committed
		},
	},
	set_list = { {"define_as","ART_PAIR_MOON"} },
	on_set_complete = function(self, who)
		self:specialSetAdd({"wielder","lite"}, 1)
dg's avatar
dg committed
		self:specialSetAdd({"combat","melee_project"}, {[engine.DamageType.RANDOM_BLIND]=10})
DarkGod's avatar
DarkGod committed
		self:specialSetAdd({"wielder","inc_damage"}, {[engine.DamageType.LIGHT]=15})
dg's avatar
dg committed
newEntity{ base = "BASE_RING",
	power_source = {technique=true},
dg's avatar
dg committed
	unique = true,
dg's avatar
dg committed
	name = "Ring of the War Master", color = colors.DARK_GREY, image = "object/artifact/ring_of_war_master.png",
dg's avatar
dg committed
	unided_name = "blade-edged ring",
dg's avatar
dg committed
	desc = [[A blade-edged ring that radiates power. As you put it on, strange thoughts of pain and destruction come to your mind.]],
	level_range = {40, 50},
dg's avatar
dg committed
	rarity = 200,
	cost = 500,
	material_level = 5,
	wielder = {
		inc_stats = { [Stats.STAT_STR] = 3, [Stats.STAT_DEX] = 3, [Stats.STAT_CON] = 3, },
		combat_apr = 15,
		combat_dam = 10,
		combat_physcrit = 5,
dg's avatar
dg committed
		talents_types_mastery = {
			["technique/2hweapon-cripple"] = 0.3,
			["technique/2hweapon-offense"] = 0.3,
			["technique/2hweapon-assault"] = 0.3,
			["technique/archery-bow"] = 0.3,
			["technique/archery-sling"] = 0.3,
			["technique/archery-training"] = 0.3,
			["technique/archery-utility"] = 0.3,
			["technique/archery-excellence"] = 0.3,
			["technique/combat-techniques-active"] = 0.3,
			["technique/combat-techniques-passive"] = 0.3,
			["technique/combat-training"] = 0.3,
			["technique/dualweapon-attack"] = 0.3,
			["technique/dualweapon-training"] = 0.3,
			["technique/shield-defense"] = 0.3,
			["technique/shield-offense"] = 0.3,
			["technique/warcries"] = 0.3,
			["technique/superiority"] = 0.3,
			["technique/thuggery"] = 0.3,
			["technique/pugilism"] = 0.3,
			["technique/unarmed-discipline"] = 0.3,
			["technique/unarmed-training"] = 0.3,
			["technique/grappling"] = 0.3,
			["technique/finishing-moves"] = 0.3,
dg's avatar
dg committed
		},
	},
}
dg's avatar
dg committed
newEntity{ base = "BASE_GREATMAUL",
	power_source = {technique=true},
dg's avatar
dg committed
	unique = true,
dg's avatar
dg committed
	name = "Unstoppable Mauler", color = colors.UMBER, image = "object/artifact/unstoppable_mauler.png",
dg's avatar
dg committed
	unided_name = "heavy maul",
dg's avatar
dg committed
	desc = [[A huge greatmaul of incredible weight. Wielding it, you feel utterly unstoppable.]],
dg's avatar
dg committed
	level_range = {23, 30},
	rarity = 270,
	require = { stat = { str=40 }, },
	cost = 250,
	material_level = 3,
	combat = {
dg's avatar
dg committed
		dam = 48,
		apr = 15,
		physcrit = 3,
		dammod = {str=1.2},
dg's avatar
dg committed
		talent_on_hit = { [Talents.T_SUNDER_ARMOUR] = {level=3, chance=15} },
dg's avatar
dg committed
	},
	wielder = {
dg's avatar
dg committed
		combat_atk = 20,
		pin_immune = 1,
		knockback_immune = 1,
	},
DarkGod's avatar
DarkGod committed
	max_power = 18, power_regen = 1,
	use_talent = { id = Talents.T_FEARLESS_CLEAVE, level = 3, power = 18 },
dg's avatar
dg committed
}

dg's avatar
dg committed
newEntity{ base = "BASE_MACE",
	power_source = {technique=true},
dg's avatar
dg committed
	unique = true,
	name = "Crooked Club", color = colors.GREEN, image = "object/artifact/weapon_crooked_club.png",
dg's avatar
dg committed
	unided_name = "weird club",
Amagad's avatar
Amagad committed
	moddable_tile = "special/%s_weapon_crooked_club",
	moddable_tile_big = true,
	desc = [[An oddly twisted club with a hefty weight on the end. There's something very strange about it.]],
	level_range = {12, 20},
dg's avatar
dg committed
	rarity = 192,
	require = { stat = { str=20 }, },
dg's avatar
dg committed
	cost = 250,
	material_level = 2,
	combat = {
		dam = 25,
dg's avatar
dg committed
		apr = 4,
		physcrit = 10,
		dammod = {str=1},
		melee_project={[DamageType.RANDOM_CONFUSION_PHYS] = 14},
		talent_on_hit = { T_BATTLE_CALL = {level=1, chance=10},},
		burst_on_crit = {
			[DamageType.PHYSKNOCKBACK] = 20,
		},
dg's avatar
dg committed
	},
dg's avatar
dg committed
	wielder = {combat_atk=12,},
dg's avatar
dg committed
}

newEntity{ base = "BASE_CLOTH_ARMOR",
dg's avatar
dg committed
	power_source = {nature=true},
dg's avatar
dg committed
	name = "Spider-Silk Robe of Spydrë", color = colors.DARK_GREEN, image = "object/artifact/robe_spider_silk_robe_spydre.png",
dg's avatar
dg committed
	desc = [[This set of robes is made wholly of spider silk. It looks outlandish and some sages think it came from another world, probably through a farportal.]],
	level_range = {20, 30},
	rarity = 190,
	cost = 250,
	material_level = 3,
	wielder = {
		combat_def = 10,
dg's avatar
dg committed
		combat_armor = 15,
DarkGod's avatar
DarkGod committed
		combat_armor_hardiness = 30,
dg's avatar
dg committed
		inc_stats = { [Stats.STAT_CON] = 5, [Stats.STAT_WIL] = 4, },
		combat_mindpower = 10,
		combat_mindcrit = 5,
		combat_spellresist = 10,
		combat_physresist = 10,
dg's avatar
dg committed
		inc_damage={[DamageType.NATURE] = 10, [DamageType.MIND] = 10, [DamageType.ACID] = 10},
dg's avatar
dg committed
		on_melee_hit={[DamageType.POISON] = 20, [DamageType.SLIME] = 20},
newEntity{ base = "BASE_HELM", define_as = "HELM_KROLTAR",
	power_source = {technique=true},
dg's avatar
dg committed
	name = "Dragon-helm of Kroltar", image = "object/artifact/dragon_helm_of_kroltar.png",
dg's avatar
dg committed
	desc = [[A visored steel helm, embossed and embellished with gold, that bears as its crest the head of Kroltar, the greatest of the fire drakes.]],
dg's avatar
dg committed
	require = { talent = { {Talents.T_ARMOUR_TRAINING,3} }, stat = { str=35 }, },
	level_range = {37, 45},
	rarity = 280,
	cost = 400,
	material_level = 4,
	wielder = {
		inc_stats = { [Stats.STAT_STR] = 5, [Stats.STAT_CON] = 5, [Stats.STAT_LCK] = -4, },
		combat_def = 5,
		combat_armor = 9,
		fatigue = 10,
	},
	max_power = 45, power_regen = 1,
dg's avatar
dg committed
	use_talent = { id = Talents.T_WARSHOUT, level = 2, power = 45 },
	set_list = { {"define_as","SCALE_MAIL_KROLTAR"} },
	on_set_complete = function(self, who)
		self:specialSetAdd("skullcracker_mult", 1)
		self:specialSetAdd({"wielder","combat_spellresist"}, 15)
		self:specialSetAdd({"wielder","combat_mentalresist"}, 15)
		self:specialSetAdd({"wielder","combat_physresist"}, 15)
DarkGod's avatar
DarkGod committed
		game.logPlayer(who, "#GOLD#As the helm of Kroltar approaches the your scale armour, they begin to fume and emit fire.")
	on_set_broken = function(self, who)
DarkGod's avatar
DarkGod committed
		game.logPlayer(who, "#GOLD#The fumes and fire fade away.")
newEntity{ base = "BASE_HELM",
	power_source = {technique=true},
	unique = true,
	name = "Crown of Command", image = "object/artifact/crown_of_command.png",
	unided_name = "unblemished silver crown",
dg's avatar
dg committed
	desc = [[This crown was worn by the Halfling king Roupar, who ruled over the Nargol lands in the Age of Dusk.  Those were dark times, and the king enforced order and discipline under the harshest of terms.  Any who deviated were punished, any who disagreed were repressed, and many disappeared without a trace into his numerous prisons.  All must be loyal to the crown or suffer dearly.  When he died without heir the crown was lost and his kingdom fell into chaos.]],
	require = { stat = { cun=25 } },
	level_range = {20, 35},
	rarity = 280,
	cost = 300,
	material_level = 3,
		inc_stats = { [Stats.STAT_CON] = 3, [Stats.STAT_WIL] = 10, },
		combat_def = 3,
		combat_armor = 6,
		fatigue = 4,
		resists = { [DamageType.PHYSICAL] = 8},
		talents_types_mastery = { ["technique/superiority"] = 0.2, ["technique/field-control"] = 0.2 },
	},
	max_power = 60, power_regen = 1,
	use_talent = { id = Talents.T_INDOMITABLE, level = 1, power = 60 },
	on_wear = function(self, who)
		self.worn_by = who
		if who.descriptor and who.descriptor.race == "Halfling" then
			local Stats = require "engine.interface.ActorStats"
			self:specialWearAdd({"wielder","inc_stats"}, { [Stats.STAT_CUN] = 7, [Stats.STAT_STR] = 7, }) 
			game.logPlayer(who, "#LIGHT_BLUE#You gain understanding of the might of your race.", self:getName())
		end
	end,
	on_takeoff = function(self)
		self.worn_by = nil
dg's avatar
dg committed
newEntity{ base = "BASE_GLOVES",
	power_source = {technique=true},
dg's avatar
dg committed
	unique = true,
	name = "Gloves of the Firm Hand", image = "object/artifact/gloves_of_the_firm_hand.png",
dg's avatar
dg committed
	unided_name = "heavy gloves",
dg's avatar
dg committed
	desc = [[These gloves make you feel rock steady! These magical gloves feel really soft to the touch from the inside. On the outside, magical stones create a rough surface that is constantly shifting. When you brace yourself, a magical ray of earth energy seems to automatically bind them to the ground, granting you increased stability.]],
dg's avatar
dg committed
	level_range = {17, 27},
	rarity = 210,
	cost = 150,
	material_level = 3,
	wielder = {
dg's avatar
dg committed
		talent_cd_reduction={[Talents.T_CLINCH]=2},
dg's avatar
dg committed
		inc_stats = { [Stats.STAT_CON] = 4 },
dg's avatar
dg committed
		combat_armor = 8,
		disarm_immune=0.4,
dg's avatar
dg committed
		knockback_immune=0.3,
dg's avatar
dg committed
		combat = {
dg's avatar
dg committed
			dam = 18,
			apr = 1,
			physcrit = 7,
			talent_on_hit = { T_CLINCH = {level=3, chance=20}, T_MAIM = {level=3, chance=10}, T_TAKE_DOWN = {level=3, chance=10} },
dg's avatar
dg committed
			dammod = {dex=0.4, str=-0.6, cun=0.4 },
dg's avatar
dg committed
		},
dg's avatar
dg committed
newEntity{ base = "BASE_GAUNTLETS",
dg's avatar
dg committed
	power_source = {arcane=true, technique=true},
dg's avatar
dg committed
	unique = true,
	name = "Dakhtun's Gauntlets", color = colors.STEEL_BLUE, image = "object/artifact/dakhtuns_gauntlets.png",
dg's avatar
dg committed
	unided_name = "expertly-crafted dwarven-steel gauntlets",
	desc = [[Fashioned by Grand Smith Dakhtun in the Age of Allure, these dwarven-steel gauntlets have been etched with golden arcane runes and are said to grant the wearer unparalleled physical and magical might.]],
	level_range = {40, 50},
	rarity = 300,
	cost = 2000,
	material_level = 5,
dg's avatar
dg committed
	wielder = {
		inc_stats = { [Stats.STAT_STR] = 6, [Stats.STAT_MAG] = 6 },
		inc_damage = { [DamageType.PHYSICAL] = 10 },
		combat_physcrit = 10,
		combat_spellcrit = 10,
dg's avatar
dg committed
		combat_critical_power = 50,