Go to Page... |
Updated: | 08-14-06 03:48 AM |
Created: | unknown |
Downloads: | 2,697 |
Favorites: | 9 |
MD5: |
Introduction to the WoW Spellbook cache
Scanning the spellbook is a slow operation, so when many addons all trigger at the same time to read the spellbook, it makes WoW stutter.
This library is created to fix that problem, it handles all reads of the spellbook and provides a table (cache) to addons.
To Do
The goal for version 2.0 is to create an API for accesing the table.
Changelog
1.7
Update for WoW 1.11 patch login error, restructuring and simplifying due to Cosmos way of including the code was made simpler.
1.4
SeaSpellbook.GetSpellIDByName( name, [booktype[, rank]] )
name = localized spell name. ie. "Wrath".
booktype = BOOKTYPE_SPELL or BOOKTYPE_PET (SPELL is default).
rank = Spell Rank number. 0 is default (alias for highest rank).
returns id when everything is kayO
returns nill if there is anything wrong with the parameters.
An alias for SeaSpellbook[booktype][name][rank].ID with error checking.
1.3
Fixed missing notification of spellbook change when training.
1.2
Some optimization.
1.1
Cleaned up Embedding/Stand alone design. (New file names and directory structure.)
Fixed a bug that could popup when Sea was also on the system.
Overview
The library works in 3 modes.
As an intergrated part of Sea in Cosmos. (In Cosmos Alpha)
Cosmos Download
Standalone addon.
Extract the directory in Interface/AddOns
Embedded into an addon.
Add the following to your addons .toc file. (Changed significantly in 1.1)
## OptionalDeps: Sea, SeaSpellbook
SeaSpellbook\PreSeaSpellbook.lua
SeaSpellbook\main\Sea.wow.spellbook.lua
SeaSpellbook\PostSeaSpellbook.lua
SeaSpellbook\main\Sea.wow.spellbook.xml
Load on Demand
It's not at this time supported to be embedded in a "Load On Demand" addon and my research into this area doesn't look promising. It's suggested you include it in StandAlone mode, since the library is completely inactive until someone calls RegisterScholar.
All 3 modes can be on the same system, the Embedder handles cleaning up, so only one version is in memory after the next Garbage Collector run.
How to use the library
SeaSpellbook.RegisterScholar( { id = "MyId", callback = function(bookType) if bookType = BOOKTYPE_SPELL then main spellbook was updated elseif bookType = BOOKTYPE_PET then pet spellbook was updated end, feedback = { [BOOKTYPE_SPELL] = true, [BOOKTYPE_PET] = true }, description = "SomeAddons scholar" } )
["Battle Shout"] = { [2] = { ["rageCost"] = 10, ["description"] = "The warrior shouts, increasing the attack power of all party members within 20 yards by 36. Lasts 2 min.", ["ID"] = 21, ["castTime"] = -2, ["debug"] = { ["L2"] = "10 Rage", ["L1"] = "Battle Shout", ["L3"] = "Instant", ["L4"] = "The warrior shouts, increasing the attack power of all party members within 20 yards by 36. Lasts 2 min.", }, ["rank"] = "Rank 2", }, [0] = { ["rageCost"] = 10, ["description"] = "The warrior shouts, increasing the attack power of all party members within 20 yards by 36. Lasts 2 min.", ["ID"] = 21, ["castTime"] = -2, ["debug"] = { ["L2"] = "10 Rage", ["L1"] = "Battle Shout", ["L3"] = "Instant", ["L4"] = "The warrior shouts, increasing the attack power of all party members within 20 yards by 36. Lasts 2 min.", }, ["rank"] = "Rank 2", }, ["spellTexture"] = "Interface\\Icons\\Ability_Warrior_BattleShout",
SeaSpellbook = { ["textures"] = { ["spell"] = { ["Interface\\Icons\\Racial_Orc_BerserkerStrength"] = { [1] = "Blood Fury", },
There have been no comments posted to this file.
Be the first to add one. |