diff --git a/game/engine/interface/ActorTalents.lua b/game/engine/interface/ActorTalents.lua index dff722875602ff47528232afd1a39d4c02059435..901901fd1d45bf68dc122175af1d445f1ab34825 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 eedfe64ed3e38e6fcea2a268c36b2ee687648a19..db4d3c6badc3951ba252d3af7df67ea1f066df15 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 2125948200b2a0cc8da2e51a844fbfc3d7c0ab11..a01e5106d03b10aca6c0666864f0d18ab5ec50a2 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 682f8dd25ca3d42a12b657e9a97f31a0e06d1eab..0d324f6a32144b63d59c90b99ad0a0d67ff0d8bf 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 761d6d94053ae88d39daf36bc6ebc62bcc32cbd7..73740ebd4456a04b134f26955715531cf2d31f4b 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 5df2bcf09ba86ce2df1d9f7c518d506b881e5e50..56e240ef0cd60e9c63051ac4bdd35e8acae4b8fc 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 0000000000000000000000000000000000000000..8f5972d4ebabc105b1cc3cdc1a2569ee46559a84 --- /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 0000000000000000000000000000000000000000..cd4412502f0318a4c70fb74ae18695be1968ab4b --- /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 0000000000000000000000000000000000000000..c11633400eac431ccc003f30506c6ee8893e163e --- /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 fcf9ea39c2f883a297b2c6dfdcd6fc6d33f7e881..8235dbf6ec1c7af1c3731fab641fa6d2ca256bf2 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 a1bf22abe4092eb9837c68ed0728b673f530cd74..05e92039b0e82b19e6064ff8a4653f3579ad9a67 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 106652a00ab003cc8b11f15b1039c3640b3ca9cc..0bdf5480d9b1113915d50098489600b37328d83e 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 674e8f2fc5748779505d66250ce7202e1733aa8d..e91873c614675688284432fca3f9d4cdc8b2eb37 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 b7b97e73557127ebef367bae48f5930d7b67477b..f828f0149330cf86f654cb253281812c717d2912 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 1910db1779428f1e84442064c2722e5a90023f15..439c3a0a195a52a5f1e67cd76fc6151bb8524596 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 e3da8efeba110371565854556a5c7e1236d5d158..d60c2c9408587dced3d35f8f14f62519282465b7 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 576c19208013804358d12742675f44b9c79fa12d..d2da1d0ec369d34faafd4f6867b504f1ba1c3a6c 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 2447d5239db264c32850561ed730d5babf4d40c6..28cecec7903a7ee9aac36653828e38a7f490702e 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 0e97f3b5b36f1954eaa6e6b0e2dcd3594a66ec3a..7e79ff0b9087a252e15ebf5dfb8be785b98b8401 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 d40047f0b15c2fed134a47c34eecbfc6cddfafc2..06a8c3a908066535d46140e56276112ded2ebd82 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 49fa741edf27a819cad2156061d8d1590026c9ff..ee13dcf70af187e8568effeef8ff1e18c8d44693 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 5d31c1633b9ad8205683feae1ba3d014d81b273a..693b46df32c3275a828d65d2eea03a6b47dc1c7b 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 d45e49758440162dc0b65d16c02f7dc2154f96e4..581db88f47bbd25e3e2bdf3843fa79a70522da1b 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 f59e78f4277c2d042db9c3483a7089f1682e9d04..5148474921c8bbdc55ce6b8ecd8d0e8fc420396a 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 b224f803e6be646d2f65b605b20e650ee98b9676..9cd4537deb641cf9216fcdf00320e6ba08bd1569 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 87b9ced3aca43843d03fd51b841611b765f399d6..d8eb8321f31dfebd71be72bfb06fdc4662c3b3ee 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 fc33b73d89491b702789751776bce4d6d5bb80d2..9a4dd20b56587a50da2269d53428157306ce6d1f 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 ea26d9b7c4eea08f5c2a307981b6cd59ee70f2c6..c983380212d66fcc3923e7742d0251c37b2867fc 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 5496a69839f39f502557a325a3aa1401cc76d0f4..429405c93add087562d97989c532f038f20b5c44 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 c7b1fbd28d1f254bc961089e6da127f886e3d9b3..1b9180af07867b35fa0fef5d7dbfc51da6158947 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 3f4df9b85595ac5abd94a04610fa84188a5a94a3..3b0cc038dc407b28cd435e2ab17ad05d1ffef414 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 aa8a18a5e2f6643507455593370b9312edb8d067..6f35313ecd9caf6f6e18910acb1555a4ce025480 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 24c36eaca65b10d3bb42f652604b9f2e21d19445..db3c8f282667b10d483916a4803f592129bbb853 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 bc457d9e62b02b82431af4d94a5c39700597e2e4..9789a0403021d85b9141ce6379895b5f62eb9259 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 1f3f71f3d8fe55ec72e273c3c8db5de069505cfc..8dbfa5b83d8dcedb78db041afbac486fdca83b08 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 26866e93c0753e735b407dcf482055f546fb2316..07694634adad4707128f300d07084ef6684055f8 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 9c9a33e1076fcadb4ef7e7afaa50cebc0eefe0a2..946907b4ee8cd3b01d0f6e063fa5a22a5b1c42f4 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 6bdeb835f16713f78e17ba0fac120cbdc6e4ce92..de56da559c7a6d87f1878e779b33757b669dd14a 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 a1eb3c573fb6f68cb6db6313ac3689d9c37f4b27..96b73ce94b298482f8a6d42a05cb548543315b7c 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 574273f3f93c4d837d4053d97b9bf691396766bd..3392c9fabb11ea874d92ddb1cf4e368dd88184f9 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 152fa29160119be8f5a8d4d2a66f005277c04368..f9745b86dcccf8770044c7dfa8627245477c1973 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 f39cd94173d1eba25df73fff9812232897036d0d..e8fcd05a4409df34b375e941e3a5758095f23b6e 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 3530fad8e67dec6c9da78c50563764c303465b7f..84fc76b4d71577b5bfe7ee6236625769157c07d0 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 453a7c5319cd00d686fd9367649143a404d892d9..a1facde933306950ee308dcecad80567edc89b54 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 5cbba026168e7d33ddb190230db61d9422df3d4c..a9064b08380394ec4a3d3ad7a56f83d58b4e279d 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 da029debc5aa4e53002a71fdea361f4d22049bc7..f7700c40eba74cf51767525743cca474aca32afa 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 702445348b195c9bb52aa47afe9668f277626b8e..a4436c98d4e742f776dd76ccf3493aab9db3ca27 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 2014dcc1d8e34421335d68ce64ce0fe27f682e79..8962e7f3e202fa08e3cc943d0a33f34ca9be724d 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 3a922ad30446467f5345373e672904117fb18190..91c84a12d4ac264d86c70520ffd9210ca123fc43 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 8e8a46a519e03df5e007ac4f0425a722122d97f9..25c0f69596989e348f11c9b4c57206c021b48a69 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 831a9c9b516bc98be4aeb9b586555b91d3cac4ff..8f47be914eb166e49818489097696ce9d5338069 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 9695a7abf2d069c62a4264bbbef1bee984521f9c..35486e35454f73495af81720132a31d77752ada7 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 dd1224aeed7071160ec9f462ee117d5f5c4b6a8c..ab241fe721685b6d8bf5d4bf38761d03b43cc7fe 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 365dc09d1b73e9245063ff0cbb1d8e658604494f..703d90811746666e4b35517868c01f220231faa7 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 66e97a2509813482b09b4faad54775367e3cfd1a..9d31eab62664e89e56b1e9d8f7151842508b1bac 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 0f1fc97a422af6c841d112ededd9a50905379e54..db989a6c84bdd1efd1a549ff7817d78edbef4faa 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