View Single Post
09-23-14, 08:54 AM   #3
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
I would say this is about
Lua Code:
  1. if C["duffed"].spellannounce ~= true then return end

C["duffed"].spellannounce is there on reload but not on login.

Move this into the OnEvent function and trigger it on PLAYER_ENTERING_WORLD:

Lua Code:
  1. local D, C, L = unpack(select(2, ...))
  2. if C["duffed"].spellannounce ~= true then return end
  3.  
  4. D.Spells = {
  5.     -- Death Knight
  6.     [48792] = true, -- Icebound Fortitude
  7.     [48707] = true, -- Anti-Magic-Shell
  8.     [55233] = true, -- Vampric Blood
  9.     [61999] = true, -- Raise Ally
  10.     [113072] = true, -- Symbiosis (Might of Ursoc)
  11.  
  12.     -- Druid
  13.     [61336] = true, -- Survival Insticts
  14.     [106922] = true, -- Might of Ursoc
  15.  
  16.     -- Monk
  17.     [115203] = true, -- Fortifying Brew
  18.     [115213] = true, -- Avert Harm
  19.     [113306] = true, -- Symbiosis (Survival Insticts)
  20.  
  21.     -- Paladin
  22.     [498] = true, -- Divine Protection
  23.     [642] = true, -- Divine Shield
  24.     [31850] = true, -- Ardent Defender
  25.     [113075] = true, -- Symbiosis (Barkskin)
  26.    
  27.     -- Priest
  28.     [33206] = true, -- Pain Supression
  29.     [47788] = true, -- Guardian Spirit
  30.     [62618] = true, -- PW: Barrier
  31.     [109964] = true, -- Spirit Shell
  32.  
  33.     -- Shaman
  34.     [16190] = true, -- Mana Tide Totem
  35.     [98008] = true, -- Spirit Link Totem
  36.     [108280] = true, -- Healing Tide Totem
  37.     [120668] = true, -- Stormlash Totem
  38.  
  39.     -- Warlock
  40.     [20707] = true, -- Soulstone
  41.  
  42.     -- Warrior
  43.     [871] = true, -- Shield Wall
  44.     [12975] = true, -- Last Stand
  45.     [97462] = true, -- Rallying Cry
  46.     [114192] = true, -- Mocking Banner
  47.     [114203] = true, -- Demoralizing Banner
  48.     [114207] = true, -- Skull Banner
  49.     [122286] = true, -- Symbiosis (Savage Defense)
  50. }

Do the same with this part:

Lua Code:
  1. D.Delay = function(delay, func, ...)
  2.     if(type(delay) ~= "number" or type(func) ~= "function") then
  3.         return false
  4.     end
  5.     if(waitFrame == nil) then
  6.         waitFrame = CreateFrame("Frame","WaitFrame", UIParent)
  7.         waitFrame:SetScript("onUpdate",function (self, elapse)
  8.             local count = #waitTable
  9.             local i = 1
  10.             while(i <= count) do
  11.                 local waitRecord = tremove(waitTable, i)
  12.                 local d = tremove(waitRecord, 1)
  13.                 local f = tremove(waitRecord, 1)
  14.                 local p = tremove(waitRecord, 1)
  15.                 if(d>elapse) then
  16.                   tinsert(waitTable, i, {d - elapse, f, p})
  17.                   i = i + 1
  18.                 else
  19.                   count = count - 1
  20.                   f(unpack(p))
  21.                 end
  22.             end
  23.         end)
  24.     end
  25.     tinsert(waitTable, {delay,func,{...}})
  26.     return true
  27. end