GetCoolDown
Get Cool Down is a command which retrieves the cooldown time for a skill. wherever you use a SetCoolDown, you must use GetCoolDown... One exception is inside the player_ultimate_on event, as our base checks for cooldowns before it fires the ultimate command. That means that if you set a CoolDown for an ability/skill, (not ultimate), you must use GetCoolDown to make sure it's 0 before you carry on with the command.
The correct syntax is
<variable> = wcs.Command(<userid>).GetCoolDown(<skill name>)
- Variable - Any local python variable
- Userid - The player that you're trying to retrieve the cooldown information
- Skill name - The name of the skill that has a cooldown on it
Example:
race = wcs.Race('My Race Name')
race.registerSkill('My Cooldown Skill',1,1,'Skill to test cooldown on')
def player_ability_on(ev):
if not wcs.Command(ev['userid']).GetCoolDown('My Cooldown Skill'):
# The cooldown is 0, so we can carry on with the skil ^_^
es.msg('You're skill has been activated')
wcs.Command(ev['userid']).SetCoolDown('My Cooldown Skill',30)
# Sets a cooldown for this skill for 30 seconds... See SetCoolDown
Comments (0)
You don't have permission to comment on this page.