The first is: if I want monitor the duration of a temporary enchant weapon through APIs GetWeaponEnchantInfo() and cd:SetCooldown (start, duration), how can I retrieve the start and duration values?
The second is: How can I avoid, once the cooldown finish, the Flash animation?
local function getPetOwner(petName)
scanTool:ClearLines()
scanTool:SetUnit(petName)
local ownerText = scanText:GetText()
if not ownerText then return nil end
local owner, _ = string.split("'",ownerText)
return owner -- This is the pet's owner
end
This function only work for pets in your party/raid: if I wanted to extend this function, for example, to the pet of the enemy players in battlegrounds how can I do? I know that Afflicted3 has managed to do something like this.
This function will determine whether two units are friendly to each other (i.e. able to help each other in combat). But when I request a duel with a member of my party/raid, the reaction should change, because the player becomes aggressive towards me. Instead, it still reports as a friendly unit.
However, it works correctly if I request a duel with player in my faction that is not part of my party/raid.
Is there a way to determine if a player is part of my party/raid?
local f = CreateFrame("frame")
f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
local function getType(sourceGUID)
local guid = sourceGUID
local B = tonumber(guid:sub(5,5), 16);
local maskedB = B % 8; -- x % 8 has the same effect as x & 0x7 on numbers <= 0xf
local knownTypes = {[0]="player", [3]="NPC", [4]="pet", [5]="vehicle"};
return(knownTypes[maskedB])
end
local function getPetOwner(petName)
local scanTool = CreateFrame( "GameTooltip", "ScanTooltip", nil, "GameTooltipTemplate" )
scanTool:SetOwner( WorldFrame, "ANCHOR_NONE" )
local scanText = _G["ScanTooltipTextLeft2"] -- This is the line with <[Player]'s Pet>
scanTool:ClearLines()
scanTool:SetUnit(petName)
local ownerText = scanText:GetText()
if not ownerText then return nil end
local owner, _ = string.split("'",ownerText)
return owner -- This is the pet's owner
end
f:SetScript("OnEvent", function(self, event, ...)
if (event == "COMBAT_LOG_EVENT_UNFILTERED") then
if (arg2 == "SPELL_CAST_SUCCESS") then
if (getType(arg3) == "pet") then
local unit = "target,focus,mouseover,arena1,arena2,arena3,arena4,arena5"
for token in string.gmatch(unit, "[^,]+") do
if (UnitName(token)) and (UnitName(token) == getPetOwner(arg4)) then
local sourceFlags = UnitName(getPetOwner(arg4))
if (UnitIsPlayer(sourceFlags)) and (not UnitIsFriend(sourceFlags, "player")) then
if (arg10 == "Spell Lock") then
print(sourceFlags.."\032" .. "has cast".."\032" .. arg10)
end
end
end
end
end
end
end
end)
I'm targeting a player. If I would catch a spell from this pet using UNIT_SPELLCAST_SUCCEEDED what can I do? There is a flag to identfy the target's pet?
I found the library LibCandyBar and I found it very interesting. I'm trying to create an addon with a list of timer that trips move as soon as one of them expires (like DBM). The only problem is that I can not find a function to identify the timer (you can not assign a name to the statusbar) and to see if it is active or not, so I decided to fall back on the library LibBars-1.0. Searching on the web I found a sample code and I have tested it, but I BugSack returns this error:
1x LibBars-1.0-90013 (NewTwo):329: You may only call :NewBarGroup as an embedded function
The sample code is:
local LB = LibStub("LibBars-1.0") -- LibBars
local LSM = LibStub("LibSharedMedia-3.0") -- LibSharedMedia
local barFont = "Arial Narrow" -- Font text uses
local barFontSize = 12 -- Font Size
local barHeight = 20 -- Height of the bars
local barWidth = 150 -- Width of the bars
local barTexture = "Blizzard" -- Texture the bars use
local bars = nil
-- Create the bars
bars = LB:NewBarGroup("Bars", nil, barWidth, barHeight, "testBars")
bars:SetFont(LSM:Fetch('font', barFont), barFontSize)
bars:SetTexture(LSM:Fetch('statusbar', barTexture))
bars:SetUserPlaced(true)
-- Add a countdown bar from 10 to 0
bars:NewTimerBar("Test", "test", 10, 10, "Interface\\Icons\\Spell_Holy_WordFortitude")
I'm trying the library GTB-1.0 to create dynamic progress bar. I followed the instructions to the site http://www.wowwiki.com/GTB and this is my attempt:
0
The first is: if I want monitor the duration of a temporary enchant weapon through APIs GetWeaponEnchantInfo() and cd:SetCooldown (start, duration), how can I retrieve the start and duration values?
The second is: How can I avoid, once the cooldown finish, the Flash animation?
Thank you in advance
0
I took this piece of code from here, because I needed the texture of the tick
0
0
0
This function only work for pets in your party/raid: if I wanted to extend this function, for example, to the pet of the enemy players in battlegrounds how can I do? I know that Afflicted3 has managed to do something like this.
Regarding this, I would not know where to start
0
However, it works correctly if I request a duel with player in my faction that is not part of my party/raid.
Is there a way to determine if a player is part of my party/raid?
0
0
0
0
0
1x LibBars-1.0-90013 (NewTwo):329: You may only call :NewBarGroup as an embedded function
The sample code is:
0
http://nopaste.info/28b3117c05.html
BugSack return me this error:
NewAddon-0.2\NewAddon.lua:24: You must call 'RegisterBar' from a registered GTB object.
0
0
I've correctly load the libraries, but doesn't appear nothing, only last line works :confused:
0
thanks