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
Cooldowns
Re: Cooldowns
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.
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
lame. thanks though i'll think of something elseIsaac 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.
I smell you, i do! You GRADUNK! No be hiding on TORGAL!
- JohnWordsworth
- Posts: 1397
- Joined: Fri Sep 14, 2012 4:19 pm
- Location: Devon, United Kingdom
- Contact:
Re: Cooldowns
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).
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.
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
}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.
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
Re: Cooldowns
sweet. thanks john i'll give it a try and let you know how it goes!
I smell you, i do! You GRADUNK! No be hiding on TORGAL!
Re: Cooldowns
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.
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.
I smell you, i do! You GRADUNK! No be hiding on TORGAL!