Page 1 of 1
Cooldowns
Posted: Sat Jun 14, 2014 6:03 pm
by Gradunk
Im trying to create a tome that decreases cooldowns a bit. is that possible? All the very obscure attributes like that and food consumption are hardly talked about so its hard to find anything regording them.
cloneObject{
name = "tome_swords",
baseObject = "tome_health",
uiName = "The Fencer",
skill = "swords",
requiredLevel = 5,
gameEffect = "Gain 3 swords and reduced cooldowns",
description = "......................................",
onUseItem = function(self,champion)
champion:trainSkill("swords", 3, true)
--Reduce cooldowns by 5%(?)
playSound("level_up")
return true
end
}
i know the general idea behind making the tomes i just don't know that one piece.
I know i could do champion:addTrait("lightning_speed") but i don't want that much cdr
Re: Cooldowns
Posted: Sat Jun 14, 2014 8:04 pm
by Isaac
All of the cool-downs are item specific ~as far as I know.
Item cool down times are not accessible by script, and so to make a blanket reduction for coolDownTime might require defining a cloned copy of every sword with an adjusted coolDownTime; and redefine all default swords with a hook function that swaps them out for the clone weapon, and the clone has a hook to do the reverse when unequipped.
A lot of work for a longsword that has 3.04 instead of 3.2 for its cool down.
Re: Cooldowns
Posted: Sun Jun 15, 2014 12:20 am
by Gradunk
Isaac wrote:All of the cool-downs are item specific ~as far as I know.
Item cool down times are not accessible by script, and so to make a blanket reduction for coolDownTime might require defining a cloned copy of every sword with an adjusted coolDownTime; and redefine all default swords with a hook function that swaps them out for the clone weapon, and the clone has a hook to do the reverse when unequipped.
A lot of work for a longsword that has 3.04 instead of 3.2 for its cool down.
lame. thanks though i'll think of something else
Re: Cooldowns
Posted: Sun Jun 15, 2014 2:25 am
by JohnWordsworth
This is a massive fudge (and might not even work properly) but you could potentially give any champion that has read the tome a tiny bit of haste every time that champion attacks. I think haste exactly halves cooldown while it's active, so the following onAttack hook would give the first champion 0.1 seconds of haste (taking 0.2 seconds off of the cooldown).
Code: Select all
cloneObject {
baseObject = "party",
name = "party",
onAttack = function( champion, weapon )
if ( champion:getOrdinal() == 1 ) then
if ( champion:getCondition("haste") < 0.1 ) then
champion:setConditionCumulative("haste", 0.1);
end
end
end
}
Now, I don't know if setting a condition for 0.1 seconds even works or is long enough to have an effect. But theoretically, this will mean that everytime the first champion (by ordinal) attacks, they get hasted for 0.1 seconds (if not already hasted).
You'll need a script entity which has a global table storing whether or not each champion has read the tome_of_speed, and then lookup that champion in the onAttack hook to see if they need hasting.
Re: Cooldowns
Posted: Mon Jun 16, 2014 5:05 pm
by Gradunk
sweet. thanks john i'll give it a try and let you know how it goes!
Re: Cooldowns
Posted: Tue Jun 17, 2014 7:34 am
by Gradunk
So i gave it a shot and it sadly doesn't work

. i was all happy for a while trying it till i realized i was using the wrong book lol.
This is what i put in orignially. it runs but has no effect. i even tried bumping it up to 5 haste.
cloneObject{
name = "tome_swords",
baseObject = "tome_health",
uiName = "The Fencer",
skill = "swords",
requiredLevel = 5,
gameEffect = "Gain 3 swords and Reduced Cooldowns",
description = "......................................",
onUseItem = function(self,champion)
champion:trainSkill("swords", 3, true)
playSound("level_up")
onAttack = function( champion, weapon )
if ( champion:getOrdinal() == 1 ) then
if ( champion:getCondition("haste") < .1 ) then
champion:setConditionCumulative("haste", 0.1);
end
end
end
return true
end
}
Thanks for trying but ill think of something else to do with the tomb.