From 4b6bbfb449cd483e6d4cbe696dcee39f2d62dd82 Mon Sep 17 00:00:00 2001 From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54> Date: Fri, 23 Jul 2010 22:38:53 +0000 Subject: [PATCH] Allow activable objects to run a talent New egos: charged (prefix), allows to use a random talent, with charges (do not self recharge) git-svn-id: http://svn.net-core.org/repos/t-engine4@933 51575b47-30f0-44d4-a5cc-537603b46e54 --- game/engine/interface/ActorTalents.lua | 26 ++++++++++++------ game/engine/interface/ObjectActivable.lua | 21 +++++++++++++-- game/modules/tome/class/Object.lua | 9 +++++-- .../data/general/objects/egos/amulets.lua | 4 +++ .../tome/data/general/objects/egos/armor.lua | 3 +++ .../tome/data/general/objects/egos/bow.lua | 2 ++ .../general/objects/egos/charged-attack.lua | 27 +++++++++++++++++++ .../objects/egos/charged-defensive.lua | 27 +++++++++++++++++++ .../general/objects/egos/charged-utility.lua | 27 +++++++++++++++++++ .../tome/data/general/objects/egos/helm.lua | 4 +++ .../tome/data/general/objects/egos/lite.lua | 3 +++ .../tome/data/general/objects/egos/rings.lua | 4 +++ .../tome/data/general/objects/egos/robe.lua | 3 +++ .../tome/data/general/objects/egos/shield.lua | 4 +++ .../tome/data/general/objects/egos/sling.lua | 2 ++ .../tome/data/general/objects/egos/staves.lua | 4 +++ .../tome/data/general/objects/egos/weapon.lua | 2 ++ .../data/general/objects/egos/wizard-hat.lua | 4 +++ .../tome/data/talents/cunning/dirty.lua | 3 +++ .../tome/data/talents/cunning/lethality.lua | 2 ++ .../data/talents/cunning/shadow-magic.lua | 2 ++ .../tome/data/talents/cunning/survival.lua | 1 + .../tome/data/talents/divine/combat.lua | 3 +++ .../tome/data/talents/divine/glyphs.lua | 4 +++ .../tome/data/talents/divine/light.lua | 3 +++ .../tome/data/talents/divine/star-fury.lua | 4 +++ game/modules/tome/data/talents/divine/sun.lua | 4 +++ .../tome/data/talents/divine/twilight.lua | 2 ++ game/modules/tome/data/talents/gifts/call.lua | 2 ++ .../tome/data/talents/gifts/cold-drake.lua | 3 +++ .../tome/data/talents/gifts/fire-drake.lua | 4 +++ .../tome/data/talents/gifts/sand-drake.lua | 2 ++ .../modules/tome/data/talents/gifts/slime.lua | 3 +++ .../data/talents/gifts/summon-distance.lua | 4 +++ .../tome/data/talents/gifts/summon-melee.lua | 4 +++ .../data/talents/gifts/summon-utility.lua | 3 +++ game/modules/tome/data/talents/spells/air.lua | 2 ++ .../tome/data/talents/spells/arcane.lua | 2 ++ .../tome/data/talents/spells/conveyance.lua | 2 ++ .../tome/data/talents/spells/divination.lua | 3 +++ .../tome/data/talents/spells/earth.lua | 2 ++ .../tome/data/talents/spells/enhancement.lua | 1 + .../modules/tome/data/talents/spells/fire.lua | 4 +++ .../modules/tome/data/talents/spells/meta.lua | 1 + .../tome/data/talents/spells/nature.lua | 4 +++ .../tome/data/talents/spells/phantasm.lua | 1 + .../tome/data/talents/spells/temporal.lua | 2 ++ .../tome/data/talents/spells/water.lua | 4 +++ .../tome/data/talents/techniques/2hweapon.lua | 6 +++++ .../tome/data/talents/techniques/archery.lua | 5 ++++ .../talents/techniques/combat-techniques.lua | 3 +++ .../data/talents/techniques/dualweapon.lua | 4 +++ .../data/talents/techniques/superiority.lua | 2 ++ .../tome/data/talents/techniques/warcries.lua | 4 +++ .../data/talents/techniques/weaponshield.lua | 4 +++ game/modules/tome/resolvers.lua | 19 +++++++++++++ 56 files changed, 292 insertions(+), 12 deletions(-) create mode 100644 game/modules/tome/data/general/objects/egos/charged-attack.lua create mode 100644 game/modules/tome/data/general/objects/egos/charged-defensive.lua create mode 100644 game/modules/tome/data/general/objects/egos/charged-utility.lua diff --git a/game/engine/interface/ActorTalents.lua b/game/engine/interface/ActorTalents.lua index dff7228756..901901fd1d 100644 --- a/game/engine/interface/ActorTalents.lua +++ b/game/engine/interface/ActorTalents.lua @@ -96,19 +96,23 @@ function _M:init(t) end --- Make the actor use the talent -function _M:useTalent(id) +function _M:useTalent(id, who, force_level) + who = who or self local ab = _M.talents_def[id] assert(ab, "trying to cast talent "..tostring(id).." but it is not defined") if ab.mode == "activated" and ab.action then if self:isTalentCoolingDown(ab) then - game.logPlayer(self, "%s is still on cooldown for %d turns.", ab.name:capitalize(), self.talents_cd[ab.id]) + game.logPlayer(who, "%s is still on cooldown for %d turns.", ab.name:capitalize(), self.talents_cd[ab.id]) return end if not self:preUseTalent(ab) then return end local co = coroutine.create(function() print("USING", ab, ab.name) - local ret = ab.action(self, ab) + local old_level + if force_level then old_level = who.talents[id]; who.talents[id] = force_level end + local ret = ab.action(who, ab) + if force_level then who.talents[id] = old_level end if not self:postUseTalent(ab, ret) then return end @@ -119,19 +123,25 @@ function _M:useTalent(id) if not ok and err then print(debug.traceback(co)) error(err) end elseif ab.mode == "sustained" and ab.activate and ab.deactivate then if self:isTalentCoolingDown(ab) then - game.logPlayer(self, "%s is still on cooldown for %d turns.", ab.name:capitalize(), self.talents_cd[ab.id]) + game.logPlayer(who, "%s is still on cooldown for %d turns.", ab.name:capitalize(), self.talents_cd[ab.id]) return end if not self:preUseTalent(ab) then return end local co = coroutine.create(function() if not self.sustain_talents[id] then - local ret = ab.activate(self, ab) + local old_level + if force_level then old_level = who.talents[id]; who.talents[id] = force_level end + local ret = ab.activate(who, ab) + if force_level then who.talents[id] = old_level end if not self:postUseTalent(ab, ret) then return end self.sustain_talents[id] = ret else - local ret = ab.deactivate(self, ab, self.sustain_talents[id]) + local old_level + if force_level then old_level = who.talents[id]; who.talents[id] = force_level end + local ret = ab.deactivate(who, ab, self.sustain_talents[id]) + if force_level then who.talents[id] = old_level end if not self:postUseTalent(ab, ret) then return end @@ -361,7 +371,7 @@ end --- Do we know this talent function _M:knowTalent(id) if type(id) == "table" then id = id.id end - return self.talents[id] and true or false + return (self:getTalentLevelRaw(id) > 0) and true or false end --- Talent level, 0 if not known @@ -380,7 +390,7 @@ function _M:getTalentLevel(id) else t = _M.talents_def[id] end - return (self.talents[id] or 0) * (self.talents_types_mastery[t.type[1]] or 1) + return (self:getTalentLevelRaw(id)) * (self.talents_types_mastery[t.type[1]] or 1) end --- Talent type level, sum of all raw levels of talents inside diff --git a/game/engine/interface/ObjectActivable.lua b/game/engine/interface/ObjectActivable.lua index eedfe64ed3..db4d3c6bad 100644 --- a/game/engine/interface/ObjectActivable.lua +++ b/game/engine/interface/ObjectActivable.lua @@ -20,6 +20,7 @@ require "engine.class" --- Handles activable objects, much more simple than actor's resource +-- It can define simple activations, complex ones that use power and it can also activate talent (ActorTalents interface must also be used on the Object class in this case) module(..., package.seeall, class.make) function _M:init(t) @@ -32,11 +33,11 @@ end --- Regen resources, shout be called in your actor's act() method function _M:regenPower() - self.power = util.bound(self.power + self.power_regen, 0, self.max_power) + if self.power_regen then self.power = util.bound(self.power + self.power_regen, 0, self.max_power) end end function _M:canUseObject() - if self.use_simple or self.use_power then + if self.use_simple or self.use_power or self.use_talent then return true end end @@ -46,6 +47,12 @@ function _M:getUseDesc() return ("It can be used to %s, costing %d power out of %d/%d."):format(self.use_power.name, self.use_power.power, self.power, self.max_power) elseif self.use_simple then return ("It can be used to %s."):format(self.use_simple.name) + elseif self.use_talent then + if not self.use_talent.power then print(self:getTalentFromId(self.use_talent.id),self.use_talent.id) + return ("It can be used to activate talent: %s (level %d)."):format(self:getTalentFromId(self.use_talent.id).name, self.use_talent.level) + else + return ("It can be used to activate talent: %s (level %d), costing %d power out of %d/%d."):format(self:getTalentFromId(self.use_talent.id).name, self.use_talent.level, self.use_talent.power, self.power, self.max_power) + end end end @@ -69,5 +76,15 @@ function _M:useObject(who) local ok, ret = coroutine.resume(co) if not ok and ret then print(debug.traceback(co)) error(ret) end return ret + elseif self.use_talent then + if not self.use_talent.power or self.power >= self.use_talent.power then + return self:useTalent(self.use_talent.id, who, self.use_talent.level) + else + if self.power_regen and self.power_regen ~= 0 then + game.logPlayer(who, "%s is still recharging.", self:getName{no_count=true}) + else + game.logPlayer(who, "%s can not be used anymore.", self:getName{no_count=true}) + end + end end end diff --git a/game/modules/tome/class/Object.lua b/game/modules/tome/class/Object.lua index 2125948200..a01e5106d0 100644 --- a/game/modules/tome/class/Object.lua +++ b/game/modules/tome/class/Object.lua @@ -29,7 +29,8 @@ local DamageType = require("engine.DamageType") module(..., package.seeall, class.inherit( engine.Object, engine.interface.ObjectActivable, - engine.interface.ObjectIdentify + engine.interface.ObjectIdentify, + engine.interface.ActorTalents )) function _M:init(t, no_default) @@ -38,12 +39,13 @@ function _M:init(t, no_default) engine.Object.init(self, t, no_default) engine.interface.ObjectActivable.init(self, t) engine.interface.ObjectIdentify.init(self, t) + engine.interface.ActorTalents.init(self, t) end --- Can this object act at all -- Most object will want to anwser false, only recharging and stuff needs them function _M:canAct() - if self.power_regen then return true end + if self.power_regen or self.use_talent then return true end return false end @@ -52,6 +54,7 @@ end -- By default, does nothing at all function _M:act() self:regenPower() + self:cooldownTalents() self:useEnergy() end @@ -109,6 +112,8 @@ function _M:descAttribute(attr) return (self.wielder and self.wielder.combat_atk or 0).." attack, "..(self.wielder and self.wielder.combat_apr or 0).." apr"..(self.wielder and self.wielder.combat_dam or 0).." power" elseif attr == "MONEY" then return ("worth %0.2f"):format(self.money_value / 10) + elseif attr == "USE_TALENT" then + return self:getTalentFromId(self.use_talent.id).name end end diff --git a/game/modules/tome/data/general/objects/egos/amulets.lua b/game/modules/tome/data/general/objects/egos/amulets.lua index 682f8dd25c..0d324f6a32 100644 --- a/game/modules/tome/data/general/objects/egos/amulets.lua +++ b/game/modules/tome/data/general/objects/egos/amulets.lua @@ -20,6 +20,10 @@ local Stats = require "engine.interface.ActorStats" local DamageType = require "engine.DamageType" +load("/data/general/objects/egos/charged-attack.lua") +load("/data/general/objects/egos/charged-defensive.lua") +load("/data/general/objects/egos/charged-utility.lua") + newEntity{ name = " of cunning (#STATBONUS#)", suffix=true, level_range = {1, 50}, diff --git a/game/modules/tome/data/general/objects/egos/armor.lua b/game/modules/tome/data/general/objects/egos/armor.lua index 761d6d9405..73740ebd44 100644 --- a/game/modules/tome/data/general/objects/egos/armor.lua +++ b/game/modules/tome/data/general/objects/egos/armor.lua @@ -17,6 +17,9 @@ -- Nicolas Casalini "DarkGod" -- darkgod@te4.org +load("/data/general/objects/egos/charged-defensive.lua") +load("/data/general/objects/egos/charged-utility.lua") + newEntity{ name = " of fire resistance", suffix=true, instant_resolve=true, level_range = {1, 50}, diff --git a/game/modules/tome/data/general/objects/egos/bow.lua b/game/modules/tome/data/general/objects/egos/bow.lua index 5df2bcf09b..56e240ef0c 100644 --- a/game/modules/tome/data/general/objects/egos/bow.lua +++ b/game/modules/tome/data/general/objects/egos/bow.lua @@ -19,6 +19,8 @@ local Talents = require("engine.interface.ActorTalents") local Stats = require("engine.interface.ActorStats") +load("/data/general/objects/egos/charged-attack.lua") + newEntity{ name = " of power", suffix=true, instant_resolve=true, level_range = {1, 50}, diff --git a/game/modules/tome/data/general/objects/egos/charged-attack.lua b/game/modules/tome/data/general/objects/egos/charged-attack.lua new file mode 100644 index 0000000000..8f5972d4eb --- /dev/null +++ b/game/modules/tome/data/general/objects/egos/charged-attack.lua @@ -0,0 +1,27 @@ +-- 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{ + name = "charged(#USE_TALENT#) ", prefix=true, + level_range = {1, 50}, + rarity = 15, + cost = 1, + use_talent = resolvers.random_use_talent({"attack"}, 1), + max_power = resolvers.mbonus_material(6, 2, function(e, v) return v * 1 end), +} diff --git a/game/modules/tome/data/general/objects/egos/charged-defensive.lua b/game/modules/tome/data/general/objects/egos/charged-defensive.lua new file mode 100644 index 0000000000..cd4412502f --- /dev/null +++ b/game/modules/tome/data/general/objects/egos/charged-defensive.lua @@ -0,0 +1,27 @@ +-- 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{ + name = "charged(#USE_TALENT#) ", prefix=true, + level_range = {1, 50}, + rarity = 15, + cost = 1, + use_talent = resolvers.random_use_talent({"defensive"}, 1), + max_power = resolvers.mbonus_material(6, 2, function(e, v) return v * 1 end), +} diff --git a/game/modules/tome/data/general/objects/egos/charged-utility.lua b/game/modules/tome/data/general/objects/egos/charged-utility.lua new file mode 100644 index 0000000000..c11633400e --- /dev/null +++ b/game/modules/tome/data/general/objects/egos/charged-utility.lua @@ -0,0 +1,27 @@ +-- 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{ + name = "charged(#USE_TALENT#) ", prefix=true, + level_range = {1, 50}, + rarity = 15, + cost = 1, + use_talent = resolvers.random_use_talent({"utility"}, 1), + max_power = resolvers.mbonus_material(6, 2, function(e, v) return v * 1 end) +} diff --git a/game/modules/tome/data/general/objects/egos/helm.lua b/game/modules/tome/data/general/objects/egos/helm.lua index fcf9ea39c2..8235dbf6ec 100644 --- a/game/modules/tome/data/general/objects/egos/helm.lua +++ b/game/modules/tome/data/general/objects/egos/helm.lua @@ -19,6 +19,10 @@ local Stats = require "engine.interface.ActorStats" local DamageType = require "engine.DamageType" +load("/data/general/objects/egos/charged-attack.lua") +load("/data/general/objects/egos/charged-defensive.lua") +load("/data/general/objects/egos/charged-utility.lua") + newEntity{ name = " of rage", suffix=true, instant_resolve=true, level_range = {20, 50}, diff --git a/game/modules/tome/data/general/objects/egos/lite.lua b/game/modules/tome/data/general/objects/egos/lite.lua index a1bf22abe4..05e92039b0 100644 --- a/game/modules/tome/data/general/objects/egos/lite.lua +++ b/game/modules/tome/data/general/objects/egos/lite.lua @@ -17,6 +17,9 @@ -- Nicolas Casalini "DarkGod" -- darkgod@te4.org +load("/data/general/objects/egos/charged-utility.lua") + + newEntity{ name = "bright ", prefix=true, instant_resolve=true, level_range = {1, 50}, diff --git a/game/modules/tome/data/general/objects/egos/rings.lua b/game/modules/tome/data/general/objects/egos/rings.lua index 106652a00a..0bdf5480d9 100644 --- a/game/modules/tome/data/general/objects/egos/rings.lua +++ b/game/modules/tome/data/general/objects/egos/rings.lua @@ -20,6 +20,10 @@ local Stats = require "engine.interface.ActorStats" local DamageType = require "engine.DamageType" +load("/data/general/objects/egos/charged-attack.lua") +load("/data/general/objects/egos/charged-defensive.lua") +load("/data/general/objects/egos/charged-utility.lua") + newEntity{ name = " of see invisible", suffix=true, level_range = {1, 20}, diff --git a/game/modules/tome/data/general/objects/egos/robe.lua b/game/modules/tome/data/general/objects/egos/robe.lua index 674e8f2fc5..e91873c614 100644 --- a/game/modules/tome/data/general/objects/egos/robe.lua +++ b/game/modules/tome/data/general/objects/egos/robe.lua @@ -17,6 +17,9 @@ -- Nicolas Casalini "DarkGod" -- darkgod@te4.org +load("/data/general/objects/egos/charged-defensive.lua") +load("/data/general/objects/egos/charged-utility.lua") + newEntity{ name = " of fire resistance", suffix=true, instant_resolve=true, level_range = {1, 50}, diff --git a/game/modules/tome/data/general/objects/egos/shield.lua b/game/modules/tome/data/general/objects/egos/shield.lua index b7b97e7355..f828f01493 100644 --- a/game/modules/tome/data/general/objects/egos/shield.lua +++ b/game/modules/tome/data/general/objects/egos/shield.lua @@ -17,6 +17,10 @@ -- Nicolas Casalini "DarkGod" -- darkgod@te4.org +load("/data/general/objects/egos/charged-attack.lua") +load("/data/general/objects/egos/charged-defensive.lua") +load("/data/general/objects/egos/charged-utility.lua") + newEntity{ name = " of fire resistance", suffix=true, instant_resolve=true, level_range = {1, 50}, diff --git a/game/modules/tome/data/general/objects/egos/sling.lua b/game/modules/tome/data/general/objects/egos/sling.lua index 1910db1779..439c3a0a19 100644 --- a/game/modules/tome/data/general/objects/egos/sling.lua +++ b/game/modules/tome/data/general/objects/egos/sling.lua @@ -19,6 +19,8 @@ local Talents = require("engine.interface.ActorTalents") local Stats = require("engine.interface.ActorStats") +load("/data/general/objects/egos/charged-attack.lua") + newEntity{ name = " of power", suffix=true, instant_resolve=true, level_range = {1, 50}, diff --git a/game/modules/tome/data/general/objects/egos/staves.lua b/game/modules/tome/data/general/objects/egos/staves.lua index e3da8efeba..d60c2c9408 100644 --- a/game/modules/tome/data/general/objects/egos/staves.lua +++ b/game/modules/tome/data/general/objects/egos/staves.lua @@ -19,6 +19,10 @@ local Stats = require "engine.interface.ActorStats" +load("/data/general/objects/egos/charged-attack.lua") +load("/data/general/objects/egos/charged-defensive.lua") +load("/data/general/objects/egos/charged-utility.lua") + newEntity{ name = " of power", suffix=true, instant_resolve=true, level_range = {1, 50}, diff --git a/game/modules/tome/data/general/objects/egos/weapon.lua b/game/modules/tome/data/general/objects/egos/weapon.lua index 576c192080..d2da1d0ec3 100644 --- a/game/modules/tome/data/general/objects/egos/weapon.lua +++ b/game/modules/tome/data/general/objects/egos/weapon.lua @@ -17,6 +17,8 @@ -- Nicolas Casalini "DarkGod" -- darkgod@te4.org +load("/data/general/objects/egos/charged-attack.lua") + newEntity{ name = "flaming ", prefix=true, instant_resolve=true, level_range = {1, 50}, diff --git a/game/modules/tome/data/general/objects/egos/wizard-hat.lua b/game/modules/tome/data/general/objects/egos/wizard-hat.lua index 2447d5239d..28cecec790 100644 --- a/game/modules/tome/data/general/objects/egos/wizard-hat.lua +++ b/game/modules/tome/data/general/objects/egos/wizard-hat.lua @@ -19,6 +19,10 @@ local Stats = require "engine.interface.ActorStats" local DamageType = require "engine.DamageType" +load("/data/general/objects/egos/charged-attack.lua") +load("/data/general/objects/egos/charged-defensive.lua") +load("/data/general/objects/egos/charged-utility.lua") + newEntity{ name = " of amplification", suffix=true, instant_resolve=true, level_range = {20, 50}, diff --git a/game/modules/tome/data/talents/cunning/dirty.lua b/game/modules/tome/data/talents/cunning/dirty.lua index 0e97f3b5b3..7e79ff0b90 100644 --- a/game/modules/tome/data/talents/cunning/dirty.lua +++ b/game/modules/tome/data/talents/cunning/dirty.lua @@ -23,6 +23,7 @@ newTalent{ name = "Dirty Fighting", type = {"cunning/dirty", 1}, points = 5, + random_ego = "attack", cooldown = 12, stamina = 10, require = cuns_req1, @@ -64,6 +65,7 @@ newTalent{ name = "Switch Place", type = {"cunning/dirty", 3}, points = 5, + random_ego = "defensive", cooldown = 10, stamina = 50, require = cuns_req3, @@ -99,6 +101,7 @@ newTalent{ name = "Cripple", type = {"cunning/dirty", 4}, points = 5, + random_ego = "attack", cooldown = 25, stamina = 30, require = cuns_req4, diff --git a/game/modules/tome/data/talents/cunning/lethality.lua b/game/modules/tome/data/talents/cunning/lethality.lua index d40047f0b1..06a8c3a908 100644 --- a/game/modules/tome/data/talents/cunning/lethality.lua +++ b/game/modules/tome/data/talents/cunning/lethality.lua @@ -33,6 +33,7 @@ newTalent{ name = "Deadly Strikes", type = {"cunning/lethality", 2}, points = 5, + random_ego = "attack", cooldown = 12, stamina = 15, require = cuns_req2, @@ -62,6 +63,7 @@ newTalent{ name = "Willful Combat", type = {"cunning/lethality", 3}, points = 5, + random_ego = "attack", cooldown = 60, stamina = 25, require = cuns_req3, diff --git a/game/modules/tome/data/talents/cunning/shadow-magic.lua b/game/modules/tome/data/talents/cunning/shadow-magic.lua index 49fa741edf..ee13dcf70a 100644 --- a/game/modules/tome/data/talents/cunning/shadow-magic.lua +++ b/game/modules/tome/data/talents/cunning/shadow-magic.lua @@ -53,6 +53,7 @@ newTalent{ name = "Shadow Feed", type = {"cunning/shadow-magic", 3}, points = 5, + random_ego = "utility", cooldown = 5, stamina = 100, require = cuns_req3, @@ -70,6 +71,7 @@ newTalent{ name = "Shadowstep", type = {"cunning/shadow-magic", 4}, points = 5, + random_ego = "attack", cooldown = 5, stamina = 100, require = cuns_req4, diff --git a/game/modules/tome/data/talents/cunning/survival.lua b/game/modules/tome/data/talents/cunning/survival.lua index 5d31c1633b..693b46df32 100644 --- a/game/modules/tome/data/talents/cunning/survival.lua +++ b/game/modules/tome/data/talents/cunning/survival.lua @@ -69,6 +69,7 @@ newTalent{ type = {"cunning/survival", 4}, points = 5, require = cuns_req4, + random_ego = "defensive", stamina = 35, cooldown = 30, action = function(self, t) diff --git a/game/modules/tome/data/talents/divine/combat.lua b/game/modules/tome/data/talents/divine/combat.lua index d45e497584..581db88f47 100644 --- a/game/modules/tome/data/talents/divine/combat.lua +++ b/game/modules/tome/data/talents/divine/combat.lua @@ -50,6 +50,7 @@ newTalent{ type = {"divine/combat", 2}, require = divi_req2, points = 5, + random_ego = "attack", cooldown = 22, positive = 25, tactical = { @@ -85,6 +86,7 @@ newTalent{ type = {"divine/combat",3}, require = divi_req3, points = 5, + random_ego = "attack", cooldown = 6, positive = 10, tactical = { @@ -115,6 +117,7 @@ newTalent{ name = "Crusade", type = {"divine/combat", 4}, require = divi_req4, + random_ego = "attack", points = 5, cooldown = 10, positive = 10, diff --git a/game/modules/tome/data/talents/divine/glyphs.lua b/game/modules/tome/data/talents/divine/glyphs.lua index f59e78f427..5148474921 100644 --- a/game/modules/tome/data/talents/divine/glyphs.lua +++ b/game/modules/tome/data/talents/divine/glyphs.lua @@ -23,6 +23,7 @@ newTalent{ name = "Glyph of Fatigue", type = {"divine/glyphs", 1}, require = spells_req1, + random_ego = "attack", points = 5, cooldown = 20, positive = -10, @@ -73,6 +74,7 @@ newTalent{ name = "Glyph of Explosion", type = {"divine/glyphs", 2}, require = spells_req2, + random_ego = "attack", points = 5, cooldown = 20, positive = -10, @@ -124,6 +126,7 @@ newTalent{ name = "Glyph of Repulsion", type = {"divine/glyphs", 3}, require = spells_req3, + random_ego = "attack", points = 5, -- mana = 30, positive = -10, @@ -182,6 +185,7 @@ newTalent{ name = "Glyph of Paralysis", type = {"divine/glyphs", 4}, require = spells_req4, + random_ego = "attack", points = 5, cooldown = 20, positive = -10, diff --git a/game/modules/tome/data/talents/divine/light.lua b/game/modules/tome/data/talents/divine/light.lua index b224f803e6..9cd4537deb 100644 --- a/game/modules/tome/data/talents/divine/light.lua +++ b/game/modules/tome/data/talents/divine/light.lua @@ -22,6 +22,7 @@ newTalent{ type = {"divine/light", 1}, require = spells_req1, points = 5, + random_ego = "defensive", cooldown = 40, positive = -10, tactical = { @@ -42,6 +43,7 @@ newTalent{ name = "Bathe in Light", type = {"divine/light", 2}, require = spells_req2, + random_ego = "defensive", points = 5, cooldown = 10, positive = -20, @@ -76,6 +78,7 @@ newTalent{ type = {"divine/light", 3}, require = spells_req3, points = 5, + random_ego = "defensive", positive = -20, cooldown = 60, action = function(self, t) diff --git a/game/modules/tome/data/talents/divine/star-fury.lua b/game/modules/tome/data/talents/divine/star-fury.lua index 87b9ced3ac..d8eb8321f3 100644 --- a/game/modules/tome/data/talents/divine/star-fury.lua +++ b/game/modules/tome/data/talents/divine/star-fury.lua @@ -22,6 +22,7 @@ newTalent{ type = {"divine/star-fury", 1}, require = divi_req1, points = 5, + random_ego = "attack", cooldown = 3, negative = 10, tactical = { @@ -50,6 +51,7 @@ newTalent{ type = {"divine/star-fury", 2}, require = divi_req2, points = 5, + random_ego = "attack", cooldown = 10, negative = 15, tactical = { @@ -96,6 +98,7 @@ newTalent{ type = {"divine/star-fury",3}, require = divi_req3, points = 5, + random_ego = "attack", cooldown = 7, negative = -20, positive = -10, @@ -129,6 +132,7 @@ newTalent{ type = {"divine/star-fury", 4}, require = divi_req4, points = 5, + random_ego = "attack", cooldown = 12, negative = 20, tactical = { diff --git a/game/modules/tome/data/talents/divine/sun.lua b/game/modules/tome/data/talents/divine/sun.lua index fc33b73d89..9a4dd20b56 100644 --- a/game/modules/tome/data/talents/divine/sun.lua +++ b/game/modules/tome/data/talents/divine/sun.lua @@ -21,6 +21,7 @@ newTalent{ name = "Searing Light", type = {"divine/sun", 1}, require = divi_req1, + random_ego = "attack", points = 5, cooldown = 6, positive = -16, @@ -60,6 +61,7 @@ newTalent{ type = {"divine/sun", 2}, require = divi_req2, points = 5, + random_ego = "attack", cooldown = 22, positive = -15, tactical = { @@ -93,6 +95,7 @@ newTalent{ type = {"divine/sun",3}, require = divi_req3, points = 5, + random_ego = "attack", cooldown = 7, positive = -20, tactical = { @@ -122,6 +125,7 @@ newTalent{ type = {"divine/sun", 4}, require = divi_req4, points = 5, + random_ego = "attack", cooldown = 15, positive = -20, tactical = { diff --git a/game/modules/tome/data/talents/divine/twilight.lua b/game/modules/tome/data/talents/divine/twilight.lua index ea26d9b7c4..c983380212 100644 --- a/game/modules/tome/data/talents/divine/twilight.lua +++ b/game/modules/tome/data/talents/divine/twilight.lua @@ -119,6 +119,7 @@ newTalent{ type = {"divine/twilight",3}, require = divi_req3, points = 5, + random_ego = "attack", cooldown = 15, negative = 15, tactical = { @@ -144,6 +145,7 @@ newTalent{ name = "Shadow Simulacrum", type = {"divine/twilight", 4}, require = divi_req4, + random_ego = "attack", points = 5, cooldown = 30, negative = 10, diff --git a/game/modules/tome/data/talents/gifts/call.lua b/game/modules/tome/data/talents/gifts/call.lua index 5496a69839..429405c93a 100644 --- a/game/modules/tome/data/talents/gifts/call.lua +++ b/game/modules/tome/data/talents/gifts/call.lua @@ -43,6 +43,7 @@ newTalent{ name = "Nature's Touch", type = {"wild-gift/call", 2}, require = gifts_req2, + random_ego = "defensive", points = 5, equilibrium = 10, cooldown = 20, @@ -70,6 +71,7 @@ newTalent{ type = {"wild-gift/call", 3}, require = gifts_req3, points = 5, + random_ego = "utility", equilibrium = 3, cooldown = 10, range = 100, diff --git a/game/modules/tome/data/talents/gifts/cold-drake.lua b/game/modules/tome/data/talents/gifts/cold-drake.lua index c7b1fbd28d..1b9180af07 100644 --- a/game/modules/tome/data/talents/gifts/cold-drake.lua +++ b/game/modules/tome/data/talents/gifts/cold-drake.lua @@ -24,6 +24,7 @@ newTalent{ type = {"wild-gift/cold-drake", 1}, require = gifts_req1, points = 5, + random_ego = "attack", equilibrium = 3, cooldown = 7, range = 1, @@ -76,6 +77,7 @@ newTalent{ type = {"wild-gift/cold-drake", 3}, require = gifts_req3, points = 5, + random_ego = "defensive", equilibrium = 10, cooldown = 30, range = 20, @@ -123,6 +125,7 @@ newTalent{ type = {"wild-gift/cold-drake", 4}, require = gifts_req4, points = 5, + random_ego = "attack", equilibrium = 12, cooldown = 12, message = "@Source@ breathes ice!", diff --git a/game/modules/tome/data/talents/gifts/fire-drake.lua b/game/modules/tome/data/talents/gifts/fire-drake.lua index 3f4df9b855..3b0cc038dc 100644 --- a/game/modules/tome/data/talents/gifts/fire-drake.lua +++ b/game/modules/tome/data/talents/gifts/fire-drake.lua @@ -22,6 +22,7 @@ newTalent{ type = {"wild-gift/fire-drake", 1}, require = gifts_req1, points = 5, + random_ego = "attack", message = "@Source@ roars!", equilibrium = 3, cooldown = 20, @@ -44,6 +45,7 @@ newTalent{ type = {"wild-gift/fire-drake", 2}, require = gifts_req2, points = 5, + random_ego = "attack", equilibrium = 7, cooldown = 10, range = 5, @@ -68,6 +70,7 @@ newTalent{ type = {"wild-gift/fire-drake", 3}, require = gifts_req3, points = 5, + random_ego = "attack", equilibrium = 10, cooldown = 35, tactical = { @@ -105,6 +108,7 @@ newTalent{ type = {"wild-gift/fire-drake", 4}, require = gifts_req4, points = 5, + random_ego = "attack", equilibrium = 12, cooldown = 12, message = "@Source@ breathes fire!", diff --git a/game/modules/tome/data/talents/gifts/sand-drake.lua b/game/modules/tome/data/talents/gifts/sand-drake.lua index aa8a18a5e2..6f35313ecd 100644 --- a/game/modules/tome/data/talents/gifts/sand-drake.lua +++ b/game/modules/tome/data/talents/gifts/sand-drake.lua @@ -87,6 +87,7 @@ newTalent{ type = {"wild-gift/sand-drake", 3}, require = gifts_req3, points = 5, + random_ego = "attack", message = "@Source@ shakes the ground!", equilibrium = 4, cooldown = 30, @@ -111,6 +112,7 @@ newTalent{ type = {"wild-gift/sand-drake", 4}, require = gifts_req4, points = 5, + random_ego = "attack", equilibrium = 12, cooldown = 12, message = "@Source@ breathes sand!", diff --git a/game/modules/tome/data/talents/gifts/slime.lua b/game/modules/tome/data/talents/gifts/slime.lua index 24c36eaca6..db3c8f2826 100644 --- a/game/modules/tome/data/talents/gifts/slime.lua +++ b/game/modules/tome/data/talents/gifts/slime.lua @@ -21,6 +21,7 @@ newTalent{ name = "Poisonous Spores", type = {"wild-gift/slime", 1}, require = gifts_req1, + random_ego = "attack", points = 5, message = "@Source@ releases poisonous spores at @target@.", equilibrium = 2, @@ -79,6 +80,7 @@ newTalent{ type = {"wild-gift/slime", 3}, require = gifts_req3, points = 5, + random_ego = "attack", equilibrium = 4, cooldown = 30, tactical = { @@ -105,6 +107,7 @@ newTalent{ type = {"wild-gift/slime", 4}, require = gifts_req4, points = 5, + random_ego = "utility", equilibrium = 5, cooldown = 20, tactical = { diff --git a/game/modules/tome/data/talents/gifts/summon-distance.lua b/game/modules/tome/data/talents/gifts/summon-distance.lua index bc457d9e62..9789a04030 100644 --- a/game/modules/tome/data/talents/gifts/summon-distance.lua +++ b/game/modules/tome/data/talents/gifts/summon-distance.lua @@ -121,6 +121,7 @@ newTalent{ type = {"wild-gift/summon-distance", 1}, require = gifts_req1, points = 5, + random_ego = "attack", message = "@Source@ summons a Fire Imp!", equilibrium = 2, cooldown = 10, @@ -188,6 +189,7 @@ newTalent{ type = {"wild-gift/summon-distance", 2}, require = gifts_req2, points = 5, + random_ego = "attack", message = "@Source@ summons a 3-headed hydra!", equilibrium = 5, cooldown = 10, @@ -257,6 +259,7 @@ newTalent{ type = {"wild-gift/summon-distance", 3}, require = gifts_req3, points = 5, + random_ego = "attack", message = "@Source@ summons a Warper!", equilibrium = 8, cooldown = 10, @@ -327,6 +330,7 @@ newTalent{ type = {"wild-gift/summon-distance", 4}, require = gifts_req4, points = 5, + random_ego = "attack", message = "@Source@ summons a Fire Drake!", equilibrium = 15, cooldown = 10, diff --git a/game/modules/tome/data/talents/gifts/summon-melee.lua b/game/modules/tome/data/talents/gifts/summon-melee.lua index 1f3f71f3d8..8dbfa5b83d 100644 --- a/game/modules/tome/data/talents/gifts/summon-melee.lua +++ b/game/modules/tome/data/talents/gifts/summon-melee.lua @@ -22,6 +22,7 @@ newTalent{ type = {"wild-gift/summon-melee", 1}, require = gifts_req1, points = 5, + random_ego = "attack", message = "@Source@ summons a War Hound!", equilibrium = 3, cooldown = 15, @@ -84,6 +85,7 @@ newTalent{ type = {"wild-gift/summon-melee", 2}, require = gifts_req2, points = 5, + random_ego = "attack", message = "@Source@ summons a Jelly!", equilibrium = 5, cooldown = 10, @@ -149,6 +151,7 @@ newTalent{ type = {"wild-gift/summon-melee", 3}, require = gifts_req3, points = 5, + random_ego = "attack", message = "@Source@ summons a Minotaur!", equilibrium = 10, cooldown = 15, @@ -219,6 +222,7 @@ newTalent{ type = {"wild-gift/summon-melee", 4}, require = gifts_req4, points = 5, + random_ego = "attack", message = "@Source@ summons an Stone Golem!", equilibrium = 15, cooldown = 20, diff --git a/game/modules/tome/data/talents/gifts/summon-utility.lua b/game/modules/tome/data/talents/gifts/summon-utility.lua index 26866e93c0..07694634ad 100644 --- a/game/modules/tome/data/talents/gifts/summon-utility.lua +++ b/game/modules/tome/data/talents/gifts/summon-utility.lua @@ -143,6 +143,7 @@ newTalent{ name = "Turtle", type = {"wild-gift/summon-utility", 1}, require = gifts_req1, + random_ego = "attack", points = 5, message = "@Source@ summons a Turtle!", equilibrium = 2, @@ -211,6 +212,7 @@ newTalent{ type = {"wild-gift/summon-utility", 2}, require = gifts_req2, points = 5, + random_ego = "attack", message = "@Source@ summons a Spider!", equilibrium = 5, cooldown = 10, @@ -278,6 +280,7 @@ newTalent{ type = {"wild-gift/summon-utility", 3}, require = gifts_req3, points = 5, + random_ego = "attack", message = "@Source@ summons a Benevolent Spirit!", equilibrium = 8, cooldown = 18, diff --git a/game/modules/tome/data/talents/spells/air.lua b/game/modules/tome/data/talents/spells/air.lua index 9c9a33e107..946907b4ee 100644 --- a/game/modules/tome/data/talents/spells/air.lua +++ b/game/modules/tome/data/talents/spells/air.lua @@ -22,6 +22,7 @@ newTalent{ type = {"spell/air", 1}, require = spells_req1, points = 5, + random_ego = "attack", mana = 10, cooldown = 3, tactical = { @@ -51,6 +52,7 @@ newTalent{ type = {"spell/air", 2}, require = spells_req2, points = 5, + random_ego = "attack", mana = 40, cooldown = 8, tactical = { diff --git a/game/modules/tome/data/talents/spells/arcane.lua b/game/modules/tome/data/talents/spells/arcane.lua index 6bdeb835f1..de56da559c 100644 --- a/game/modules/tome/data/talents/spells/arcane.lua +++ b/game/modules/tome/data/talents/spells/arcane.lua @@ -49,6 +49,7 @@ newTalent{ type = {"spell/arcane", 2}, require = spells_req2, points = 5, + random_ego = "attack", mana = 10, cooldown = 3, tactical = { @@ -83,6 +84,7 @@ newTalent{ type = {"spell/arcane", 3}, require = spells_req3, points = 5, + random_ego = "utility", mana = 0, cooldown = 300, tactical = { diff --git a/game/modules/tome/data/talents/spells/conveyance.lua b/game/modules/tome/data/talents/spells/conveyance.lua index a1eb3c573f..96b73ce94b 100644 --- a/game/modules/tome/data/talents/spells/conveyance.lua +++ b/game/modules/tome/data/talents/spells/conveyance.lua @@ -22,6 +22,7 @@ newTalent{ type = {"spell/conveyance",1}, require = spells_req1, points = 5, + random_ego = "utility", mana = 10, cooldown = 8, tactical = { @@ -68,6 +69,7 @@ newTalent{ type = {"spell/conveyance",2}, require = spells_req2, points = 5, + random_ego = "utility", mana = 20, cooldown = 30, tactical = { diff --git a/game/modules/tome/data/talents/spells/divination.lua b/game/modules/tome/data/talents/spells/divination.lua index 574273f3f9..3392c9fabb 100644 --- a/game/modules/tome/data/talents/spells/divination.lua +++ b/game/modules/tome/data/talents/spells/divination.lua @@ -22,6 +22,7 @@ newTalent{ type = {"spell/divination", 1}, require = spells_req1, points = 5, + random_ego = "utility", mana = 10, cooldown = 10, tactical = { @@ -51,6 +52,7 @@ newTalent{ type = {"spell/divination", 2}, require = spells_req2, points = 5, + random_ego = "utility", mana = 20, action = function(self, t) local rad = math.floor(0 + (self:getTalentLevel(t) - 4)) @@ -99,6 +101,7 @@ newTalent{ type = {"spell/divination", 3}, require = spells_req3, points = 5, + random_ego = "utility", mana = 20, cooldown = 20, action = function(self, t) diff --git a/game/modules/tome/data/talents/spells/earth.lua b/game/modules/tome/data/talents/spells/earth.lua index 152fa29160..f9745b86dc 100644 --- a/game/modules/tome/data/talents/spells/earth.lua +++ b/game/modules/tome/data/talents/spells/earth.lua @@ -54,6 +54,7 @@ newTalent{ type = {"spell/earth",2}, require = spells_req2, points = 5, + random_ego = "utility", mana = 40, range = 20, reflectable = true, @@ -77,6 +78,7 @@ newTalent{ type = {"spell/earth",3}, require = spells_req3, points = 5, + random_ego = "attack", mana = 18, cooldown = 6, tactical = { diff --git a/game/modules/tome/data/talents/spells/enhancement.lua b/game/modules/tome/data/talents/spells/enhancement.lua index f39cd94173..e8fcd05a44 100644 --- a/game/modules/tome/data/talents/spells/enhancement.lua +++ b/game/modules/tome/data/talents/spells/enhancement.lua @@ -50,6 +50,7 @@ newTalent{ name = "Earthen Barrier", type = {"spell/enhancement", 2}, points = 5, + random_ego = "utility", cooldown = 25, mana = 45, require = spells_req2, diff --git a/game/modules/tome/data/talents/spells/fire.lua b/game/modules/tome/data/talents/spells/fire.lua index 3530fad8e6..84fc76b4d7 100644 --- a/game/modules/tome/data/talents/spells/fire.lua +++ b/game/modules/tome/data/talents/spells/fire.lua @@ -22,6 +22,7 @@ newTalent{ type = {"spell/fire",1}, require = spells_req1, points = 5, + random_ego = "attack", mana = 12, cooldown = 3, tactical = { @@ -49,6 +50,7 @@ newTalent{ type = {"spell/fire",2}, require = spells_req2, points = 5, + random_ego = "attack", mana = 30, cooldown = 18, tactical = { @@ -74,6 +76,7 @@ newTalent{ type = {"spell/fire",3}, require = spells_req3, points = 5, + random_ego = "attack", mana = 40, cooldown = 8, tactical = { @@ -102,6 +105,7 @@ newTalent{ type = {"spell/fire",4}, require = spells_req4, points = 5, + random_ego = "attack", mana = 100, cooldown = 30, tactical = { diff --git a/game/modules/tome/data/talents/spells/meta.lua b/game/modules/tome/data/talents/spells/meta.lua index 453a7c5319..a1facde933 100644 --- a/game/modules/tome/data/talents/spells/meta.lua +++ b/game/modules/tome/data/talents/spells/meta.lua @@ -22,6 +22,7 @@ newTalent{ type = {"spell/meta",1}, require = spells_req1, points = 5, + random_ego = "utility", mana = 40, cooldown = 7, action = function(self, t) diff --git a/game/modules/tome/data/talents/spells/nature.lua b/game/modules/tome/data/talents/spells/nature.lua index 5cbba02616..a9064b0838 100644 --- a/game/modules/tome/data/talents/spells/nature.lua +++ b/game/modules/tome/data/talents/spells/nature.lua @@ -22,6 +22,7 @@ newTalent{ type = {"spell/nature", 1}, require = spells_req1, points = 5, + random_ego = "defensive", mana = 30, cooldown = 10, tactical = { @@ -43,6 +44,7 @@ newTalent{ type = {"spell/nature", 2}, require = spells_req2, points = 5, + random_ego = "defensive", mana = 60, cooldown = 10, tactical = { @@ -64,6 +66,7 @@ newTalent{ type = {"spell/nature", 3}, require = spells_req3, points = 5, + random_ego = "defensive", mana = 30, cooldown = 15, action = function(self, t) @@ -100,6 +103,7 @@ newTalent{ type = {"spell/nature", 4}, require = spells_req4, points = 5, + random_ego = "attack", mana = 60, cooldown = 100, tactical = { diff --git a/game/modules/tome/data/talents/spells/phantasm.lua b/game/modules/tome/data/talents/spells/phantasm.lua index da029debc5..f7700c40eb 100644 --- a/game/modules/tome/data/talents/spells/phantasm.lua +++ b/game/modules/tome/data/talents/spells/phantasm.lua @@ -21,6 +21,7 @@ newTalent{ name = "Illuminate", type = {"spell/phantasm",1}, require = spells_req1, + random_ego = "utility", points = 5, mana = 5, cooldown = 14, diff --git a/game/modules/tome/data/talents/spells/temporal.lua b/game/modules/tome/data/talents/spells/temporal.lua index 702445348b..a4436c98d4 100644 --- a/game/modules/tome/data/talents/spells/temporal.lua +++ b/game/modules/tome/data/talents/spells/temporal.lua @@ -22,6 +22,7 @@ newTalent{ type = {"spell/temporal", 1}, require = spells_req1, points = 5, + random_ego = "utility", mana = 30, cooldown = 30, tactical = { @@ -48,6 +49,7 @@ newTalent{ type = {"spell/temporal",2}, require = spells_req2, points = 5, + random_ego = "utility", mana = 20, cooldown = 30, tactical = { diff --git a/game/modules/tome/data/talents/spells/water.lua b/game/modules/tome/data/talents/spells/water.lua index 2014dcc1d8..8962e7f3e2 100644 --- a/game/modules/tome/data/talents/spells/water.lua +++ b/game/modules/tome/data/talents/spells/water.lua @@ -22,6 +22,7 @@ newTalent{ type = {"spell/water",1}, require = spells_req1, points = 5, + random_ego = "attack", mana = 25, cooldown = 8, tactical = { @@ -59,6 +60,7 @@ newTalent{ type = {"spell/water", 2}, require = spells_req2, points = 5, + random_ego = "attack", mana = 14, cooldown = 5, tactical = { @@ -86,6 +88,7 @@ newTalent{ type = {"spell/water",3}, require = spells_req3, points = 5, + random_ego = "attack", mana = 55, cooldown = 8, tactical = { @@ -121,6 +124,7 @@ newTalent{ type = {"spell/water",4}, require = spells_req4, points = 5, + random_ego = "attack", mana = 40, cooldown = 30, tactical = { diff --git a/game/modules/tome/data/talents/techniques/2hweapon.lua b/game/modules/tome/data/talents/techniques/2hweapon.lua index 3a922ad304..91c84a12d4 100644 --- a/game/modules/tome/data/talents/techniques/2hweapon.lua +++ b/game/modules/tome/data/talents/techniques/2hweapon.lua @@ -23,6 +23,7 @@ newTalent{ type = {"technique/2hweapon-offense", 1}, require = techs_req1, points = 5, + random_ego = "attack", cooldown = 10, stamina = 30, action = function(self, t) @@ -88,6 +89,7 @@ newTalent{ type = {"technique/2hweapon-offense",3}, require = techs_req3, points = 5, + random_ego = "attack", stamina = 30, cooldown = 18, tactical = { @@ -123,6 +125,7 @@ newTalent{ type = {"technique/2hweapon-offense", 4}, require = techs_req4, points = 5, + random_ego = "attack", cooldown = 30, stamina = 30, action = function(self, t) @@ -177,6 +180,7 @@ newTalent{ type = {"technique/2hweapon-cripple", 1}, require = techs_req1, points = 5, + random_ego = "attack", cooldown = 6, stamina = 8, action = function(self, t) @@ -213,6 +217,7 @@ newTalent{ type = {"technique/2hweapon-cripple", 2}, require = techs_req2, points = 5, + random_ego = "attack", cooldown = 6, stamina = 12, action = function(self, t) @@ -249,6 +254,7 @@ newTalent{ type = {"technique/2hweapon-cripple", 3}, require = techs_req3, points = 5, + random_ego = "attack", cooldown = 6, stamina = 12, action = function(self, t) diff --git a/game/modules/tome/data/talents/techniques/archery.lua b/game/modules/tome/data/talents/techniques/archery.lua index 8e8a46a519..25c0f69596 100644 --- a/game/modules/tome/data/talents/techniques/archery.lua +++ b/game/modules/tome/data/talents/techniques/archery.lua @@ -41,6 +41,7 @@ newTalent{ type = {"technique/archery-training", 1}, no_energy = true, points = 5, + random_ego = "attack", cooldown = 3, stamina = 8, require = techs_dex_req1, @@ -137,6 +138,7 @@ newTalent{ type = {"technique/archery-training", 4}, no_energy = true, points = 5, + random_ego = "attack", cooldown = 14, stamina = 35, require = techs_dex_req4, @@ -196,6 +198,7 @@ newTalent{ type = {"technique/archery-utility", 2}, no_energy = true, points = 5, + random_ego = "attack", cooldown = 10, stamina = 15, require = techs_dex_req2, @@ -221,6 +224,7 @@ newTalent{ type = {"technique/archery-utility", 3}, no_energy = true, points = 5, + random_ego = "attack", cooldown = 10, stamina = 15, require = techs_dex_req3, @@ -246,6 +250,7 @@ newTalent{ type = {"technique/archery-utility", 4}, no_energy = true, points = 5, + random_ego = "attack", cooldown = 14, stamina = 15, require = techs_dex_req4, diff --git a/game/modules/tome/data/talents/techniques/combat-techniques.lua b/game/modules/tome/data/talents/techniques/combat-techniques.lua index 831a9c9b51..8f47be914e 100644 --- a/game/modules/tome/data/talents/techniques/combat-techniques.lua +++ b/game/modules/tome/data/talents/techniques/combat-techniques.lua @@ -53,6 +53,7 @@ newTalent{ message = "@Source@ rushes out!", require = techs_strdex_req2, points = 5, + random_ego = "attack", stamina = 45, cooldown = 50, tactical = { @@ -93,6 +94,7 @@ newTalent{ name = "Perfect Strike", type = {"technique/combat-techniques-active", 3}, points = 5, + random_ego = "attack", cooldown = 55, stamina = 25, require = techs_strdex_req3, @@ -109,6 +111,7 @@ newTalent{ name = "Blinding Speed", type = {"technique/combat-techniques-active", 4}, points = 5, + random_ego = "utility", cooldown = 55, stamina = 25, require = techs_strdex_req4, diff --git a/game/modules/tome/data/talents/techniques/dualweapon.lua b/game/modules/tome/data/talents/techniques/dualweapon.lua index 9695a7abf2..35486e3545 100644 --- a/game/modules/tome/data/talents/techniques/dualweapon.lua +++ b/game/modules/tome/data/talents/techniques/dualweapon.lua @@ -106,6 +106,7 @@ newTalent{ name = "Dual Strike", type = {"technique/dualweapon-attack", 1}, points = 5, + random_ego = "attack", cooldown = 12, stamina = 15, require = techs_dex_req1, @@ -147,6 +148,7 @@ newTalent{ name = "Flurry", type = {"technique/dualweapon-attack", 2}, points = 5, + random_ego = "attack", cooldown = 12, stamina = 15, require = techs_dex_req2, @@ -176,6 +178,7 @@ newTalent{ name = "Sweep", type = {"technique/dualweapon-attack", 3}, points = 5, + random_ego = "attack", cooldown = 8, stamina = 30, require = techs_dex_req3, @@ -225,6 +228,7 @@ newTalent{ name = "Whirlwind", type = {"technique/dualweapon-attack", 4}, points = 5, + random_ego = "attack", cooldown = 8, stamina = 30, require = techs_dex_req4, diff --git a/game/modules/tome/data/talents/techniques/superiority.lua b/game/modules/tome/data/talents/techniques/superiority.lua index dd1224aeed..ab241fe721 100644 --- a/game/modules/tome/data/talents/techniques/superiority.lua +++ b/game/modules/tome/data/talents/techniques/superiority.lua @@ -23,6 +23,7 @@ newTalent{ type = {"technique/superiority", 1}, require = techs_req_high1, points = 5, + random_ego = "attack", cooldown = 40, stamina = 60, action = function(self, t) @@ -67,6 +68,7 @@ newTalent{ type = {"technique/superiority", 3}, require = techs_req_high3, points = 5, + random_ego = "attack", cooldown = 10, stamina = 30, action = function(self, t) diff --git a/game/modules/tome/data/talents/techniques/warcries.lua b/game/modules/tome/data/talents/techniques/warcries.lua index 365dc09d1b..703d908117 100644 --- a/game/modules/tome/data/talents/techniques/warcries.lua +++ b/game/modules/tome/data/talents/techniques/warcries.lua @@ -23,6 +23,7 @@ newTalent{ type = {"technique/warcries", 1}, require = techs_req_high1, points = 5, + random_ego = "attack", cooldown = 7, stamina = 20, range = 4, @@ -44,6 +45,7 @@ newTalent{ type = {"technique/warcries", 2}, require = techs_req_high2, points = 5, + random_ego = "utility", cooldown = 150, action = function(self, t) self:incStamina(20 + self:getTalentLevel(t) * 12) @@ -60,6 +62,7 @@ newTalent{ type = {"technique/warcries", 3}, require = techs_req_high3, points = 5, + random_ego = "defensive", cooldown = 30, stamina = 40, action = function(self, t) @@ -76,6 +79,7 @@ newTalent{ type = {"technique/warcries", 4}, require = techs_req_high4, points = 5, + random_ego = "attack", cooldown = 30, stamina = 40, range = 4, diff --git a/game/modules/tome/data/talents/techniques/weaponshield.lua b/game/modules/tome/data/talents/techniques/weaponshield.lua index 66e97a2509..9d31eab626 100644 --- a/game/modules/tome/data/talents/techniques/weaponshield.lua +++ b/game/modules/tome/data/talents/techniques/weaponshield.lua @@ -26,6 +26,7 @@ newTalent{ type = {"technique/shield-offense", 1}, require = techs_req1, points = 5, + random_ego = "attack", cooldown = 6, stamina = 8, action = function(self, t) @@ -75,6 +76,7 @@ newTalent{ type = {"technique/shield-offense", 3}, require = techs_req3, points = 5, + random_ego = "attack", cooldown = 8, stamina = 22, action = function(self, t) @@ -118,6 +120,7 @@ newTalent{ type = {"technique/shield-offense", 4}, require = techs_req4, points = 5, + random_ego = "attack", cooldown = 6, stamina = 16, action = function(self, t) @@ -160,6 +163,7 @@ newTalent{ type = {"technique/shield-defense", 1}, require = techs_req1, points = 5, + random_ego = "attack", cooldown = 10, stamina = 30, action = function(self, t) diff --git a/game/modules/tome/resolvers.lua b/game/modules/tome/resolvers.lua index 0f1fc97a42..db989a6c84 100644 --- a/game/modules/tome/resolvers.lua +++ b/game/modules/tome/resolvers.lua @@ -187,3 +187,22 @@ end function resolvers.calc.genericlast(t, e) return t[1](e) end + +--- Charges resolver, gives a random use talent +function resolvers.random_use_talent(types, power) + types = table.reverse(types) + return {__resolver="random_use_talent", __resolve_last=true, types, power} +end +function resolvers.calc.random_use_talent(tt, e) + local ml = e.material_level or 1 + local ts = {} + for i, t in ipairs(engine.interface.ActorTalents.talents_def) do + if t.random_ego and tt[1][t.random_ego] and t.type[2] < ml then ts[#ts+1]=t.id end + end + local tid = rng.table(ts) or engine.interface.ActorTalents.T_SENSE + local t = engine.interface.ActorTalents.talents_def[tid] + local level = util.bound(math.ceil(rng.mbonus(5, resolvers.current_level, resolvers.mbonus_max_level) * ml / 5), 1, 5) + e.cost = e.cost + t.type[2] * 3 + e.cost = e.cost + level * 2 + return { id=tid, level=level, power=tt[2] } +end -- GitLab