Module Author Info
Here an overview of the 'standard' ForteXorcist functions you can use in your modules. Note that these may change while I improve the code. I will add descriptions to every function and their arguments in time. Last updated March 29th 2009.

functions in the Core
Media
RegisterFont
FW:RegisterFont(path, name)

SetDefaultFont
FW:SetDefaultFont(path, size)

RegisterSound
FW:RegisterSound(path, name)
Event Registration
RegisterToEvent
FW:RegisterToEvent(event, function(event,...) )
UnregisterToEvent
FW:UnregisterToEvent(event, function(event,...) )
RegisterVariablesEvent
FW:RegisterVariablesEvent( function() )

RegisterUpdatedEvent
FW:RegisterUpdatedEvent( function() )
UnregisterUpdatedEvent
FW:UnregisterUpdatedEvent( function() )
RegisterLoadEvent
FW:RegisterLoadEvent( function() )

RegisterDelayedLoadEvent
FW:RegisterDelayedLoadEvent( function() )

RegisterTimedEvent
FW:RegisterTimedEvent(interval, function() )
UnregisterTimedEvent
FW:UnregisterTimedEvent(interval, function() )
DelayedExec
FW:DelayedExec(delay,times,func,...)
Options Registration
SetMainCategory
FW:SetMainCategory(maincat, mainicon, mainindex, color, frame)
SetSubCategory
FW:SetSubCategory(subcat, subicon, subindex)
RegisterOption
FW:RegisterOption(typ, width, pos, text, tip, option, func, minimum, maximum)
If the Spell Timer is present (FW.Modules.Timer non-nil)
Spell/Item/Buff Registration
RegisterSpell
You might ask why this function is so complex compared to the other ones. That's because the spells that you register with this function will always show on the timer if successfully cast. For example you can start casting on one unit and switch to another target before the cast in complete and it will still apply the spell to the right target and adjust its duration without having to look at any buffs or debuffs at all.

In addition, you can add spells here that you do not have to cast, but belong to you. They will stay on the timer even if you deselect the unit (unlike spells added with RegisterDebuff). This is intended for YOUR spells only. Usually your proccs are added using RegisterDebuff, but the really important ones that need tracking at all times can be added with RegisterSpell as well. If you want to get warned for spell resists/fails on a spell by text or sound, it also has to be registered with this function.

You can find spell modifier functions below. These can be used to correct spell durations, add an extra spell and other things like that.

FW:RegisterSpell(spell id, has a target, default duration, is dot, spell type [, reduced to in pvp, change texture, stacks] )
  1. spell id
    integer spell id, required. Obviously this is the spell ID of the spell you are adding. You can easily get these from thottbot, wowhead etc. Note that right now this ID is used to translate into a Spell Name string, because not everything in the wow api uses IDs and everything does at least use these name strings. This means you can get into trouble if you try to register multiple spells with the same name but a different ID. For lower ranks etc. use the Modifier function that you can find below.
  2. has a target
    0 or 1, required. 0 for NO, 1 for YES. You basically tell the addon that it should be checking for a resist or not, and if it should add it with a target name or as a no-target spell. If you set the timer to order by unit # no-target spells come before any targetted spells.
  3. default duration
    number, required. Here you can set the default duration of this spell. Usually this will be the durations of the highest ranks (most of the time this requires the least work with the spell rank modifier function). For lower ranks etc. use the Modifier functions that you can find below.
  4. is dot
    0 or 1, required. 0 for NO, 1 for YES. You tell the add-on that it's allowed to check the combat log for Damage-over-Time ticks of this spell to add/remove it. It will also enable the dot-tick sparks on the timer bars for this spell. Do not use this for Heal-over-Time spells!
  5. spell type
    integer, required. This number indicates what kind of spell it is. Here's a list of the possibilities (some cannot be used, they are used by spells that are added in other ways). Each type/group can has its own colour setting in the interface. Make sure you set each spell to its appropriate type, since it may cause unwanted behaviour if you don't:
    ------
    1. normal (aka magic). Use for your harmful spells and debuffs. Only one spell of the same name can be up at the same target.
    2. shared (aka curse). Only one spell of this shared type is allowed on a target at a time. For example curses. Harmful spells and debuffs only.
    3. unique (aka crowd control). A spell added here can only be up at one target at a time. Usually this is the case for crowd control spells. Harmful spells and debuffs only.
    4. pet.
    5. (powerup). Don't use.
    6. enslave/charm
    7. (tdebuff). Don't use.
    8. (drain). Don't use.
    9. heal. Use for friendly spells/buffs only.
    10. friendly buff. Use for friendly spells/buffs only.
    ------
  6. reduced to in pvp
    number or nil, optional. 0 or nil to disable. If the duration of the spell is higher than the value you set here, and the spell is cast on a player or pet, this value is used instead.
  7. change texture
    string texture path or nil, optional. You can replace the texture of the spell here. No idea why this is still here :P
  8. stacks
    integer or nil, optional. If the spell can stack you have to set the maximum number of stacks here. If you don't the timer will not show stacks for this spell at all.

Modifier functions belonging to RegisterSpell:
RegisterSpellRename
You can use this in case one spell adds a buff or debuff with a different name. This is for example used to add Blood Plague when Plague Strike is cast. Blood Plague is the spell registered by RegisterSpell and Plague Strike is turned into this using the spell rename.

FW:RegisterSpellRename(spell id, new spell id)
  1. spell id
    Spell ID of the spell cast to be renamed/redirected.
  2. new spell id
    The Spell ID of the spell that needs to be added on the timer. This ID has to be registered with RegisterSpell.

RegisterSpellAdd
This can be used in case one spell triggers more than one debuff.

FW:RegisterSpellAdd(spell id, extra spell id)
  1. spell id
    Spell ID of the spell cast to receive an additional spell on the timer.
  2. extra spell id
    The Spell ID of the spell that needs to be added on the timer. This ID has to be registered with RegisterSpell.

RegisterSpellModRank
With this function you can adjust the duration of the spell based on rank. If your spell isn't any of the ranks you've registered, the default duration will be used. There's no stacking of modified times in this case. For example when a spell with Rank2 is cast, the Rank1 modifier of a spell is NOT added on top of the Rank2 value, instead only what you set for Rank2 will be used. I telling this because it's a bit different for set bonuses as you can read below.

FW:RegisterSpellModRank(spell id, rank, mod)
  1. spell id
    Spell ID of the spell cast that needs its duration modified from default.
  2. rank
    Rank number that needs to be modified. If a rank is used that's not registered here, the default duration will be used.
  3. mod
    The adjustment of the default duration for this rank. Does not stack with modifiers of lower ranks. Can be positive or negative.

RegisterSpellModTlnt
With this function you can adjust the duration of the spell based on talent ranks. If this talent isn't any of the ranks you've registered, the default duration will be used. There's no stacking of modified times in this case (see RegisterSpellModRank info).

FW:RegisterSpellModTlnt(spell id, talent id, num, mod)
  1. spell id
    Spell ID of the spell cast that needs its duration modified from default.
  2. talent id
    Talent ID of the talent that changes the duration of this spell.
  3. num
    Rank/points of the talent that needs to be modified. If a rank is used that's not registered here, the default duration will be used.
  4. mod
    The adjustment of the default duration for this talent rank. Does not stack with modifiers of lower ranks. Can be positive or negative.

RegisterSpellModGlph
Works the same as the talent modifier (See RegisterSpellModTlnt).

FW:RegisterSpellModGlph(spell id, glyph id, num, mod)
  1. spell id
    Spell ID of the spell cast that needs its duration modified from default.
  2. glyph id
    Glyph ID of the glyph that changes the duration of this spell.
  3. num
    This is still a leftover of when I had no idea about glyphs yet, and supported stacking the same glyphs. This argument will be removed in v1.10. Use 1 for now.
  4. mod
    The adjustment of the default duration for this glyph. Can be positive or negative.

RegisterSet
If there's set bonusses that modify the duration of a spell, you have to register all the set-parts of this set first. When you've done this, you can use the RegisterSpellModSetB function.

FW:RegisterSet("My set name","item id string1","item id string2",...)
  1. my set name
    This is the name string of the set you're adding. This can basically be any string you choose, as long as you use the same string in the RegisterSpellModSetB function.
  2. item id strings
    Item id strings. After the set name you have to add all the item ids that belong to this set. Note that you have to input each of them as a string, not a number (unlike the spell ids).

RegisterSpellModSetB
FW:RegisterSpellModSetB(spell id, "My set name", min num items, mod)

RegisterSpellModComb
Combo-point based duration modifier. Works pretty much the same as the rank modifier (see RegisterSpellModRank).

FW:RegisterSpellModComb(spell id, points, mod)
  1. spell id
    Spell ID of the spell cast that needs its duration modified from default.
  2. points
    Combo-Points that are relevant to this spell.
  3. mod
    The adjustment of the default duration for this number of combo-points. Does not stack with modifiers of lower points. Can be a positive or negative number OR a percentage string. This means that using 5 is adding 5 seconds, while using "150%" adds 50% to the duration. Percentage based modifiers get calculated last.
RegisterDrain
FW:RegisterDrain(spell, ticks total)

RegisterTickSpeed
FW:RegisterTickSpeed(spell, time between ticks)

RegisterBuff
FW:RegisterBuff(buff id [, hiddencd] )

RegisterDebuff
FW:RegisterDebuff(debuff id, mineonly)

RegisterCasterBuffs
FW:RegisterCasterBuffs()

RegisterMeleeBuffs
FW:RegisterMeleeBuffs()
Event Hooks
RegisterOnTimerFade
FW:RegisterOnTimerFade( function("unit name", mark, "spell name") )

RegisterOnTimerBreak
FW:RegisterOnTimerBreak( function("unit name", mark, "spell name") )

RegisterOnBuffGain
FW:RegisterOnBuffGain( function("buff name") )
If the Cooldown Timer is present (FW.Modules.Cooldown non-nil)
Spell/Item/Buff Registration
RegisterCooldownPowerup
FW:RegisterCooldownPowerup(item id)

RegisterCooldownBuff
FW:RegisterCooldownBuff(buff id)

RegisterCasterPowerupCooldowns
FW:RegisterCasterPowerupCooldowns()

RegisterMeleePowerupCooldowns
FW:RegisterMeleePowerupCooldowns()
Event Hooks
RegisterOnCooldownUsed
FW:RegisterOnCooldownUsed( function("spell name") )

RegisterOnCooldownReady
FW:RegisterOnCooldownReady( function("spell name") )
More to come...