Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Cooldown Core Help.


Zetasis
 Share

Recommended Posts

Okay I have been trying to add this http://www.touchofdeathforums.com/smf/index.php/topic,47318.0.html and I can't seem to figure out how I am supposed to set up the CustomeSpells.ini. If anyone could help me that would be great. Thanks.

Here is what it says:
@Fujibayashi.Kyou:

> ```
> Sub CooldownStep(Index, Cooldown, SpellNumA)
>
> Call Putvar("Scripts/CustomSpells" & GetPlayerName(Index) & ".ini", "SPELL" & SpellNumA & "", "OnCooldown", 1)
>         Call SetTimer("RemoveCooldown " & Index & "," & SpellNumA, Cooldown)
>
> End Sub
>
> Sub RemoveCooldown(Index, SpellNumB)
>
> Call Putvar("Scripts/CustomSpells" & GetPlayerName(Index) & ".ini", "SPELL" & SpellNumB & "", "OnCooldown", 0)
> Call RemoveTimer("RemoveCooldown " & Index & "," & SpellNumB)
>
> End Sub
>
> Function GotCooldown(Index, SpellNumC)
>
> If GetVar("Scripts/CustomSpells" & GetPlayerName(Index) & ".ini", "SPELL" & SpellNumC & "", "OnCooldown") = 1 Then
> GotCooldown = True
> Else
> GotCooldown = False
>
> End Function
>
> ```
> This is a simple Cooldown Script that you can use to set a cooldown for a scripted spell or w/e. This script needs scripting knowledge to use it properly. Stick this at the bottom of your Main.txt.
>
> To use:
>
> > Call CooldownStep(Index, Cooldown, SpellNumA)
> > Cooldown -> Duration of cooldown
> > SpellNumA -> The Spell Number stored in the .ini file. Just make sure this isn't a number already used to prevent errors.
> >
> > This sub sets the cooldown for the spell.
>
> > Function GotCooldown(Index, SpellNumC)
> > SpellNumC -> The Spell Number stored in the .ini file.
> >
> > This function checks if there is a cooldown active for the spell. (True/False)
>
> Note: The SpellNumA and SpellNumC have to be the same number if it is the same spell. The letter behind SpellNum was introduced to prevent errors.
>
> Use the function to check for a cooldown active for the spell, if not then allow the spell to be cast using a If/Else statement. Then set the cooldown to the part after the effects are done.
>
> Example:
> ```
> Let's say you have a spell called ABC as Spell number 1 that has a cooldown of 1 sec.
>
> Sub ABC(Index......)
>
> If GotCooldown(Index, 1) = True Then
> Exit Sub
> Else
> Call CooldownStep(Index, 1000, 1)
> End Sub

> ```
> Credits would be nice but not required.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...