[Request] Corrupted Strength in it's own talent category

A place to post your add ons and ideas for them

Moderator: Moderator

Post Reply
Message
Author
waveris
Posts: 4
Joined: Sat Jun 06, 2015 7:46 am

[Request] Corrupted Strength in it's own talent category

#1 Post by waveris »

Tried adding a different version of corrupted strength to it's own talent category so i could edit the damage type and play adventurer "reavers" for specific elements, but couldn't get it to work.

Just looking for the "melee attack on spell cast" part to be added, maybe Bloodlust too?

lukep
Sher'Tul Godslayer
Posts: 1712
Joined: Mon Mar 14, 2011 10:32 am
Location: Canada

Re: [Request] Corrupted Strength in it's own talent category

#2 Post by lukep »

For that melee attack, you need to look at mod/class/Actor.lua, find "function _M:postUseTalent(ab, ret, silent)" (which contains Corrupted Strength's code) and use a hook/superload to add your own version of that bit.
Some of my tools for helping make talents:
Melee Talent Creator
Annotated Talent Code (incomplete)

waveris
Posts: 4
Joined: Sat Jun 06, 2015 7:46 am

Re: [Request] Corrupted Strength in it's own talent category

#3 Post by waveris »

No errors are happening, but the talent category isn't showing up in the list, nor does it show up if i set a class to start with the category unlocked.

newTalentType{ allow_random=true, type="corruption/reaving", name = "reaving", description = "x" }
ActorTalents:loadDefinition("/data-mod1/talents/corruption/reaving.lua")

in reaving.lua and load.lua respectively. Is there anything else i need to do, or a file i should check to make sure it's loading the category?

lukep
Sher'Tul Godslayer
Posts: 1712
Joined: Mon Mar 14, 2011 10:32 am
Location: Canada

Re: [Request] Corrupted Strength in it's own talent category

#4 Post by lukep »

Ah, that's a second problem you'll have to deal with. Adventurers get their talents by looking at all of the existing classes and grabbing the categories from there. You need to make a class with your custom talent tree in it, even if it isn't a playable class.

EDIT: oops, it looks like you've covered this already. I'm not sure what's stopping the talent category from showing up, maybe try grabbing some addon for a class, removing 90% of it, and dropping your code in there?
Some of my tools for helping make talents:
Melee Talent Creator
Annotated Talent Code (incomplete)

waveris
Posts: 4
Joined: Sat Jun 06, 2015 7:46 am

Re: [Request] Corrupted Strength in it's own talent category

#5 Post by waveris »

It's working now after using what you suggested, thanks.

waveris
Posts: 4
Joined: Sat Jun 06, 2015 7:46 am

Re: [Request] Corrupted Strength in it's own talent category

#6 Post by waveris »

Alright, i looked at a bunch of other addons and couldn't work out how to get the actor.lua file working. Currently absolutely no talents consume resources on cast, nor do they go on cooldown.


local _M = loadPrevious(...)
local Talents = require "engine.interface.ActorTalents"
local super_postUseTalent = _M.postUseTalent (((some addons were using baseXX instead of super_XX so idk ??)))

function _M:postUseTalent(ab, ret, silent)
if not util.getval(ab.no_energy, self, ab) then
self:useEnergy(self:getTalentSpeed(ab) * game.energy_to_act)

-- Free melee blow
if ab.is_spell and ab.mode ~= "sustained" and self:knowTalent(self.T_REAVING) and not self:attr("forbid_reaving_blow") and not self.turn_procs.reaving then
local tgts = {}
for _, c in pairs(util.adjacentCoords(self.x, self.y)) do
local target = game.level.map(c[1], c[2], Map.ACTOR)
if target and self:reactionToward(target) < 0 then tgts[#tgts+1] = target end
end
if #tgts > 0 then
self.turn_procs.reaving = true
DamageType:projectingFor(self, {project_type={talent=self:getTalentFromId(self.T_REAVING)}})
self:attackTarget(rng.table(tgts), DamageType.COLD, self:combatTalentWeaponDamage(self.T_REAVING, 0.5, 1.1), true)
DamageType:projectingFor(self, nil)
end
end
end

end
return _M

All the lower case 'reaving' were originally 'corrupted_strength', wasn't sure if they needed changing but i did it anyway

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: [Request] Corrupted Strength in it's own talent category

#7 Post by HousePet »

Since you haven't called super_postUseTalent anywhere, you've removed all the original functions of postUseTalent, like costs and cooldowns.
My feedback meter decays into coding. Give me feedback and I make mods.

stinkstink
Spiderkin
Posts: 543
Joined: Sat Feb 11, 2012 1:12 am

Re: [Request] Corrupted Strength in it's own talent category

#8 Post by stinkstink »

Did the code I sent you the other night not work? You should just be do this without having to superload anything in Actor.lua by putting a callback into the talent you want to trigger the attacks:

Code: Select all

	callbackOnTalentPost = function(self, t, ab, ret, silent)
        if ab.is_spell and ab.mode ~= "sustained" and not self:attr("forbid_corrupted_strength_blow") and not self.turn_procs.corrupted_strength then
			local tgts = {}
			for _, c in pairs(util.adjacentCoords(self.x, self.y)) do
					local target = game.level.map(c[1], c[2], Map.ACTOR)
					if target and self:reactionToward(target) < 0 then tgts[#tgts+1] = target end
			end
			if #tgts > 0 then
					self.turn_procs.corrupted_strength = true
					DamageType:projectingFor(self, {project_type={talent=t}})
					self:attackTarget(rng.table(tgts), DamageType.COLD, self:combatTalentWeaponDamage(t.id, 0.5, 1.1), true)
					DamageType:projectingFor(self, nil)
			end
        end
	end,

Post Reply