- Home
- Downloads
-
Addons & Mods
Featured
World of Warcraft
5,104 Addons
-
Popular Downloads
- Top World of Warcraft Addons
- Top Minecraft Server Mods
- Top Rift Addons
- Top Skyrim Mods
- Top World of Tanks WoT Mods
- Top Starcraft II Maps
- Top Terraria Maps
- Top Runes of Magic Addons
- Top Warhammer Online Addons
- Top Age of Conan Addons
-
- Curse Client
- Premium
- News
- Giveaways
- Videos
- Forums
LibPlayerSpellInfo-1.0
- 0 Likes
- World of Warcraft
- 30 Monthly Downloads
- Supports: 4.0.1
- 837 Total Downloads
- Updated 11/12/2010 11:55:06 PM
- Created 10/8/2010 11:22:41 AM
- 0 Favorites
- Project Site
- Release Type: Release
- License: LPS Style BSD
- Newest File: Release-r7
About LibPlayerSpellInfo-1.0
A library to provide extended information regarding player spell action/macro cast requirements (such as reagent, equipment and form requirements).
Includes:
- Spell requirement API's that determine if a spell meets equipment, form, and/or reagent requirements.
- There are also API's for parsing entire macrotext objects and determining if a spell name/link/id is a valid player spell/companion/mount.
- Cast requirement API's (basically beefier IsUsableSpell/Action/Item functions) that determine nearly all1 casting requirements for any given spell/item/action.
1 Excluded parameters are whether the player has control of their character (which can be determined with LibUnitControl-1.0) and whether the player's target is within LOS, which is currently impossible to discern.
Usage
Here's a relatively simple display hook for use with the default blizzard actionbars that improves color indication of a whether a spell can be cast:
local lps = LibStub("LibPlayerSpellInfo-1.0") local hook_ActionButton_OnUpdate = ActionButton_OnUpdate function ActionButton_OnUpdate(button, elapsed) if button.rangeTimer and ( button.rangeTimer - elapsed <= 0 ) then ActionButton_UpdateUsable(button) end hook_ActionButton_OnUpdate(button, elapsed) end function ActionButton_UpdateUsable(button) local name = button:GetName() local icon, texture = _G[name.."Icon"], _G[name.."NormalTexture"] local isKnown, hasReact, _, inRange, hasUnit, _, hasMana hasEquip, hasReagent, inForm = lps:ActionUseInfo(button.action) if ( not inForm ) then -- Green overlay icon:SetVertexColor(0, 0.4, 0.2) texture:SetVertexColor(0, 0.4, 0.2) elseif ( not hasEquip ) or ( not hasReagent ) then -- Orange overlay icon:SetVertexColor(0.4, 0.2, 0) texture:SetVertexColor(0.4, 0.2, 0) elseif ( not hasMana ) then -- Blue overlay icon:SetVertexColor(0.2, 0.3, 0.7) texture:SetVertexColor(0.2, 0.3, 0.7) elseif ( hasUnit and not inRange ) then -- Red overlay icon:SetVertexColor(0.7, 0.15, 0.15) texture:SetVertexColor(0.7, 0.15, 0.15) elseif ( isKnown and not hasReact ) then -- Gray overlay icon:SetVertexColor(0.4, 0.4, 0.4); texture:SetVertexColor(1.0, 1.0, 1.0) else -- No overlay icon:SetVertexColor(1.0, 1.0, 1.0) texture:SetVertexColor(1.0, 1.0, 1.0) end end
------------------------------------------------------------------------
r8 | draake | 2010-11-13 05:54:32 +0000 (Sat, 13 Nov 2010) | 1 line
Changed paths:
A /tags/Release-r7 (from /trunk/LibPlayerSpellInfo-1.0:7)
Tagging as Release-r7.
------------------------------------------------------------------------
r7 | draake | 2010-11-13 05:51:31 +0000 (Sat, 13 Nov 2010) | 1 line
Changed paths:
M /trunk/LibPlayerSpellInfo-1.0/LibPlayerSpellInfo-1.0.lua
Work around for GetCompanionInfo improperly returning nil when logging in sometimes.
------------------------------------------------------------------------
r6 | draake | 2010-10-13 19:35:01 +0000 (Wed, 13 Oct 2010) | 1 line
Changed paths:
M /trunk/LibPlayerSpellInfo-1.0/LibPlayerSpellInfo-1.0.lua
Clean up api info for luadoc... part4.
------------------------------------------------------------------------
r5 | draake | 2010-10-08 17:35:30 +0000 (Fri, 08 Oct 2010) | 1 line
Changed paths:
M /trunk/LibPlayerSpellInfo-1.0/LibPlayerSpellInfo-1.0.lua
Clean up api info for luadoc... part3.
------------------------------------------------------------------------
| File Name | Release Type | Game Version | Downloads | Date |
|---|---|---|---|---|
| Release-r7 | Release | 4.0.1 | 108 | 11/12/2010 11:55:06 PM |
Top Downloads
-
- Bagnon
- Bags & Inventory
- 380,324 Monthly Downloads
-
- Deadly Boss Mods
- Combat and Boss Encounters
- 302,560 Monthly Downloads
-
- Recount
- Combat
- 301,016 Monthly Downloads
-
- SpellFlash
- PvP, Buffs & Debuffs, Quests & Leveling, Action Bars, and Combat
- 282,737 Monthly Downloads
-
- GatherMate2_Data
- Achievements
- 210,508 Monthly Downloads