From 2f160d340e37a5a825d0a20de116b6f3dcf817f5 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Fri, 6 Aug 2010 19:27:02 +0000
Subject: [PATCH] Added tridents

git-svn-id: http://svn.net-core.org/repos/t-engine4@991 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/modules/tome/class/Game.lua              |   2 +-
 game/modules/tome/data/general/npcs/all.lua   |   1 +
 game/modules/tome/data/general/npcs/naga.lua  |  10 +-
 .../tome/data/general/objects/2htridents.lua  | 106 ++++++++++++++++++
 .../tome/data/zones/caverns-osse/objects.lua  |   1 +
 .../tome/data/zones/flooded-cave/objects.lua  |   3 +-
 game/modules/tome/resolvers.lua               |   1 +
 7 files changed, 117 insertions(+), 7 deletions(-)
 create mode 100644 game/modules/tome/data/general/objects/2htridents.lua

diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua
index 436d248ff2..95224773bd 100644
--- a/game/modules/tome/class/Game.lua
+++ b/game/modules/tome/class/Game.lua
@@ -469,7 +469,7 @@ function _M:setupCommands()
 				self.player.esp.all = 1
 				self.player.esp.range = 50
 				self.player.inc_damage.all = 100000
-				self:changeLevel(2, "eruan")
+				self:changeLevel(2, "flooded-cave")
 --				self:changeLevel(1, "wilderness-arda-fareast")
 --				game.memory_levels["wilderness-arda-fareast-1"] = game.level
 --				self.player:grantQuest("orc-pride")
diff --git a/game/modules/tome/data/general/npcs/all.lua b/game/modules/tome/data/general/npcs/all.lua
index bbcd931d39..6c6dea9dfc 100644
--- a/game/modules/tome/data/general/npcs/all.lua
+++ b/game/modules/tome/data/general/npcs/all.lua
@@ -38,6 +38,7 @@ loadIfNot("/data/general/npcs/minotaur.lua")
 loadIfNot("/data/general/npcs/molds.lua")
 loadIfNot("/data/general/npcs/multihued-drake.lua")
 --loadIfNot("/data/general/npcs/mummy.lua")
+--loadIfNot("/data/general/npcs/naga.lua")
 loadIfNot("/data/general/npcs/ooze.lua")
 loadIfNot("/data/general/npcs/orc-grushnak.lua")
 loadIfNot("/data/general/npcs/orc.lua")
diff --git a/game/modules/tome/data/general/npcs/naga.lua b/game/modules/tome/data/general/npcs/naga.lua
index 941f7dfbed..fac84c27bf 100644
--- a/game/modules/tome/data/general/npcs/naga.lua
+++ b/game/modules/tome/data/general/npcs/naga.lua
@@ -51,7 +51,7 @@ newEntity{ base = "BASE_NPC_NAGA",
 	rarity = 1,
 	max_life = resolvers.rngavg(120,150), life_rating = 14,
 	resolvers.equip{
-		{type="weapon", subtype="battleaxe", autoreq=true},
+		{type="weapon", subtype="trident", autoreq=true},
 	},
 	combat_armor = 20, combat_def = 10,
 	resolvers.talents{
@@ -67,7 +67,7 @@ newEntity{ base = "BASE_NPC_NAGA",
 	rarity = 1,
 	max_life = resolvers.rngavg(120,150), life_rating = 14,
 	resolvers.equip{
-		{type="weapon", subtype="battleaxe", autoreq=true},
+		{type="weapon", subtype="trident", autoreq=true},
 	},
 	combat_armor = 20, combat_def = 10,
 	resolvers.talents{ [Talents.T_SUNDER_ARMOUR]=4, },
@@ -81,7 +81,7 @@ newEntity{ base = "BASE_NPC_NAGA",
 	female = true,
 	max_life = resolvers.rngavg(120,150), life_rating = 14,
 	resolvers.equip{
-		{type="weapon", subtype="battleaxe", autoreq=true},
+		{type="weapon", subtype="trident", autoreq=true},
 	},
 	combat_armor = 20, combat_def = 10,
 	resolvers.talents{ [Talents.T_SUNDER_ARMOUR]=4, },
@@ -95,7 +95,7 @@ newEntity{ base = "BASE_NPC_NAGA",
 	female = true,
 	max_life = resolvers.rngavg(120,150), life_rating = 14,
 	resolvers.equip{
-		{type="weapon", subtype="battleaxe", autoreq=true},
+		{type="weapon", subtype="trident", autoreq=true},
 	},
 	combat_armor = 20, combat_def = 10,
 	resolvers.talents{ [Talents.T_SUNDER_ARMOUR]=4, },
@@ -109,7 +109,7 @@ newEntity{ base = "BASE_NPC_NAGA",
 	female = true,
 	max_life = resolvers.rngavg(120,150), life_rating = 14,
 	resolvers.equip{
-		{type="weapon", subtype="battleaxe", autoreq=true},
+		{type="weapon", subtype="trident", autoreq=true},
 	},
 	combat_armor = 20, combat_def = 10,
 	resolvers.talents{ [Talents.T_SUNDER_ARMOUR]=4, },
diff --git a/game/modules/tome/data/general/objects/2htridents.lua b/game/modules/tome/data/general/objects/2htridents.lua
new file mode 100644
index 0000000000..9e1ef64a69
--- /dev/null
+++ b/game/modules/tome/data/general/objects/2htridents.lua
@@ -0,0 +1,106 @@
+-- ToME - Tales of Middle-Earth
+-- Copyright (C) 2009, 2010 Nicolas Casalini
+--
+-- 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
+
+newEntity{
+	define_as = "BASE_TRIDENT",
+	slot = "MAINHAND",
+	slot_forbid = "OFFHAND",
+	type = "weapon", subtype="trident", image = resolvers.image_material("2htrident", "sea-metal"),
+	add_name = " (#COMBAT#)",
+	display = "|", color=colors.AQUAMARINE,
+	encumber = 3,
+	rarity = 5,
+	metallic = true,
+	no_rust = true,
+	combat = { talented = "axe", damrange = 1.6, sound = "actions/melee", sound_miss = "actions/melee_miss", },
+	desc = [[A two handed massive trident.
+The trident counts as an axe for purpose of weapon combat talents.]],
+	twohanded = true,
+	egos = "/data/general/objects/egos/weapon.lua", egos_chance = { prefix=resolvers.mbonus(40, 5), suffix=resolvers.mbonus(40, 5) },
+}
+
+newEntity{ base = "BASE_TRIDENT",
+	name = "coral trident",
+	level_range = {1, 10},
+	require = { stat = { str=11 }, },
+	cost = 5,
+	material_level = 1,
+	combat = {
+		dam = resolvers.rngavg(6,10),
+		apr = 6,
+		physcrit = 1.5,
+		dammod = {str=1.2},
+	},
+}
+
+newEntity{ base = "BASE_TRIDENT",
+	name = "blue-steel trident",
+	level_range = {10, 20},
+	require = { stat = { str=16 }, },
+	cost = 10,
+	material_level = 2,
+	combat = {
+		dam = resolvers.rngavg(11,19),
+		apr = 8,
+		physcrit = 2,
+		dammod = {str=1.2},
+	},
+}
+
+newEntity{ base = "BASE_TRIDENT",
+	name = "deep-steel trident",
+	level_range = {20, 30},
+	require = { stat = { str=24 }, },
+	cost = 15,
+	material_level = 3,
+	combat = {
+		dam = resolvers.rngavg(24,31),
+		apr = 10,
+		physcrit = 2.5,
+		dammod = {str=1.2},
+	},
+}
+
+newEntity{ base = "BASE_TRIDENT",
+	name = "orite trident",
+	level_range = {30, 40},
+	require = { stat = { str=35 }, },
+	cost = 25,
+	material_level = 4,
+	combat = {
+		dam = resolvers.rngavg(36,44),
+		apr = 13,
+		physcrit = 3.5,
+		dammod = {str=1.2},
+	},
+}
+
+newEntity{ base = "BASE_TRIDENT",
+	name = "orichalcum trident",
+	level_range = {40, 50},
+	require = { stat = { str=48 }, },
+	cost = 35,
+	material_level = 5,
+	combat = {
+		dam = resolvers.rngavg(50, 56),
+		apr = 16,
+		physcrit = 4,
+		dammod = {str=1.2},
+	},
+}
diff --git a/game/modules/tome/data/zones/caverns-osse/objects.lua b/game/modules/tome/data/zones/caverns-osse/objects.lua
index e9f8e015a0..3ce6462edb 100644
--- a/game/modules/tome/data/zones/caverns-osse/objects.lua
+++ b/game/modules/tome/data/zones/caverns-osse/objects.lua
@@ -18,6 +18,7 @@
 -- darkgod@te4.org
 
 load("/data/general/objects/objects.lua")
+load("/data/general/objects/2htridents.lua")
 
 local Talents = require "engine.interface.ActorTalents"
 local Stats = require "engine.interface.ActorStats"
diff --git a/game/modules/tome/data/zones/flooded-cave/objects.lua b/game/modules/tome/data/zones/flooded-cave/objects.lua
index 0d803fa0c7..5916651b1d 100644
--- a/game/modules/tome/data/zones/flooded-cave/objects.lua
+++ b/game/modules/tome/data/zones/flooded-cave/objects.lua
@@ -22,10 +22,11 @@ local Stats = require "engine.interface.ActorStats"
 local DamageType = require "engine.DamageType"
 
 load("/data/general/objects/objects.lua")
+load("/data/general/objects/2htridents.lua")
 
 -- Artifact, droped (and used!) by Bill the Stone Troll
 
-newEntity{ base = "BASE_BATTLEAXE",
+newEntity{ base = "BASE_TRIDENT",
 	define_as = "TRIDENT_TIDES",
 	name = "Trident of the Tides", unique=true,
 	desc = [[As you wield this trident you can feel the power of the tides rushing through your arms.
diff --git a/game/modules/tome/resolvers.lua b/game/modules/tome/resolvers.lua
index d93b49faa2..2ab3aaa7d0 100644
--- a/game/modules/tome/resolvers.lua
+++ b/game/modules/tome/resolvers.lua
@@ -213,6 +213,7 @@ function resolvers.image_material(image, values)
 end
 function resolvers.calc.image_material(t, e)
 	if not t[2] or (type(t[2]) == "string" and t[2] == "metal") then t[2] = {"iron", "steel", "dsteel", "galvorn", "mithril"} end
+	if type(t[2]) == "string" and t[2] == "sea-metal" then t[2] = {"coral", "blue-steel", "deep-steel", "orite", "orichalcum"} end
 	if type(t[2]) == "string" and t[2] == "leather" then t[2] = {"rough", "cured", "hardened", "reinforced", "drakeskin"} end
 	if type(t[2]) == "string" and t[2] == "wood" then t[2] = {"elm","ash","yew","elvenwood","dragonbone"} end
 	if type(t[2]) == "string" and t[2] == "cloth" then t[2] = {"linen","woolen","cashmere","silk","elvensilk"} end
-- 
GitLab