Language:
Lua     Change language:
Pastebin: 122782
Author: Garkin
Subject: Castbar Hooks
Created: 2009-08-22 08:12:46
Download and save
Toggle line numbers
1-- Castbar Hooks 
2function SHI.ShowCastBar(...) 
3    ShowCastBarHook(...) 
4 
5    local abilityId, _, desiredCastTime = ... 
6 
7    if (spellTable[abilityId]) then 
8        -- player is casting a hot? 
9 
10        local targetName = TargetInfo:UnitName("selffriendlytarget"):match(L"([^^]+)"
11        if not targetName then 
12            targetName = playerName 
13        end 
14 
15        if (desiredCastTime == 0) then 
16            SHI.AddHot(targetName, abilityId, spellTable[abilityId].duration, -1
17            castCache = {} 
18        else 
19            castCache = {target = targetName, ability = abilityId} 
20        end 
21 
22    end 
23end 
24 
25function SHI.HideCastBar(...) 
26    local isCancel = ... 
27    if (castCache.ability) then 
28        -- if a hot was casted, apply it to it's original target now 
29            if (isCancel) then 
30            castCache = {} 
31        else 
32            SHI.AddHot(castCache.target, castCache.ability, spellTable[castCache.ability].duration, -1
33        end 
34    end 
35    HideCastBarHook(...) 
36end 
Thread:
[122782] Castbar Hooks by Garkin at 2009-08-22 08:12:46
Tip: Click the line numbers to toggle highliting on that line.

Paste followup:

Language:
Author:
Subject:


    Tabstop:     bigger biggest
Note: You can prefix a line with "@@@" to highlight it.