Скрипты Neilyo и не только  
Автор Сообщение



<Железная Маска>


Сервер: Черный Шрам
Рейтинг поля боя: 1825
2х2: 1713
3х3: 1666
0
Сообщение Скрипты Neilyo и не только

не работает /testaef 

 

 

как фреймы то вне арены посмотреть? поставил скрипт под моп



12 ноя 2012, 22:23
Профиль

0
Сообщение Скрипты Neilyo и не только

Можноли впилить, по аналогии с тринкетами, кд на диспелл ? ( как это сделано в гладиусе )

 

 

модуль гладиуса 

Код:

--Dispell Module for Gladius
--Mavvo
local Gladius = _G.Gladius
if not Gladius then
DEFAULT_CHAT_FRAME:AddMessage(format("Module %s requires Gladius", "Dispell"))
end
local L = Gladius.L
local LSM

-- global functions
local strfind = string.find
local pairs = pairs
local strformat = string.format
local UnitName, UnitClass, UnitFactionGroup, UnitLevel = UnitName, UnitClass, UnitFactionGroup, UnitLevel

local Dispell = Gladius:NewModule("Dispell", false, true, {
dispellAttachTo = "Frame",
dispellAnchor = "TOPLEFT",
dispellRelativePoint = "TOPRIGHT",
dispellGridStyleIcon = false,
dispellGridStyleIconColor = { r = 0, g = 1, b = 0, a = 1 },
dispellGridStyleIconUsedColor = { r = 1, g = 0, b = 0, a = 1 },
dispellAdjustSize = true,
dispellSize = 52,
dispellOffsetX = 52,
dispellOffsetY = 0,
dispellFrameLevel = 2,
dispellIconCrop = false,
dispellGloss = true,
dispellGlossColor = { r = 1, g = 1, b = 1, a = 0.4 },
dispellCooldown = true,
dispellCooldownReverse = false,
dispellFaction = true,
}, { "Dispell icon", "Grid style health bar", "Grid style power bar" })

function Dispell:OnEnable()
--self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")


LSM = Gladius.LSM

if (not self.frame) then
self.frame = {}
end
end

function Dispell:OnDisable()
self:UnregisterAllEvents()

for unit in pairs(self.frame) do
self.frame[unit]:SetAlpha(0)
end
end

function Dispell:GetAttachTo()
return Gladius.db.dispellAttachTo
end

function Dispell:GetFrame(unit)
return self.frame[unit]
end

function Dispell:SetTemplate(template)
if (template == 1) then
-- reset width
if (Gladius.db.targetBarAttachTo == "HealthBar" and not Gladius.db.healthBarAdjustWidth) then
Gladius.db.healthBarAdjustWidth = true
end

-- reset to default
for k, v in pairs(self.defaults) do
Gladius.db[k] = v
end
elseif (template == 2) then
if (Gladius.db.modules["HealthBar"]) then
if (Gladius.db.healthBarAdjustWidth) then
Gladius.db.healthBarAdjustWidth = false
Gladius.db.healthBarWidth = Gladius.db.barWidth - Gladius.db.healthBarHeight
else
Gladius.db.healthBarWidth = Gladius.db.healthBarWidth - Gladius.db.healthBarHeight
end

Gladius.db.dispellGridStyleIcon = true

Gladius.db.dispellAdjustHeight = false
Gladius.db.dispellHeight = Gladius.db.healthBarHeight

Gladius.db.dispellAttachTo = "HealthBar"
Gladius.db.dispellAnchor = "TOPLEFT"
Gladius.db.dispellRelativePoint = "TOPRIGHT"

Gladius.db.dispellOffsetX = 52
Gladius.db.dispellOffsetY = 0
end
else
if (Gladius.db.modules["PowerBar"]) then
if (Gladius.db.powerBarAdjustWidth) then
Gladius.db.powerBarAdjustWidth = false
Gladius.db.powerBarWidth = Gladius.db.powerBarWidth - Gladius.db.powerBarHeight
else
Gladius.db.powerBarWidth = Gladius.db.powerBarWidth - Gladius.db.powerBarHeight
end

Gladius.db.dispellGridStyleIcon = true

Gladius.db.dispellAdjustHeight = false
Gladius.db.dispellHeight = Gladius.db.powerBarHeight

Gladius.db.dispellAttachTo = "PowerBar"
Gladius.db.dispellAnchor = "TOPLEFT"
Gladius.db.dispellRelativePoint = "TOPRIGHT"

Gladius.db.dispellOffsetX = 52
Gladius.db.dispellOffsetY = 0
end
end
end

 


function Dispell:COMBAT_LOG_EVENT_UNFILTERED(event, ...)
if select(2, ...)=="SPELL_DISPEL" then
local spell = select(12, ...)
local unit = select(4, ...)

--if (not strfind(unit, "arena") or strfind(unit, "pet")) then return end

if (not(UnitGUID("arena1")==unit or UnitGUID("arena2")==unit or UnitGUID("arena3")==unit or UnitGUID("arena4")==unit or UnitGUID("arena5")==unit)) then return end


if (spell == 527 -- priest Purify [url=http://mop.wowhead.com/spell=527]http://mop.wowhead.com/spell=527[/url]
or spell == 4987 --paladin Cleanse [url=http://mop.wowhead.com/spell=4987]http://mop.wowhead.com/spell=4987[/url]
or spell == 77130 --shaman Purify Spirit [url=http://mop.wowhead.com/spell=77130]http://mop.wowhead.com/spell=77130[/url]
or spell == 88423 --druid Nature's cure [url=http://mop.wowhead.com/spell=88423]http://mop.wowhead.com/spell=88423[/url]
) then

if UnitGUID("arena1")==unit then
self:UpdateDispell("arena1", 8) end
if UnitGUID("arena2")==unit then
self:UpdateDispell("arena2", 8) end
if UnitGUID("arena3")==unit then
self:UpdateDispell("arena3", 8) end
if UnitGUID("arena4")==unit then
self:UpdateDispell("arena4", 8) end
if UnitGUID("arena5")==unit then
self:UpdateDispell("arena5", 8) end
end

-- wotf
-- if (spell == GetSpellInfo(7744)) then
-- self:UpdateDispell(unit, 45)
-- end
end
end

function Dispell:UpdateDispell(unit, duration)
-- grid style icon
if (Gladius.db.dispellGridStyleIcon) then
self.frame[unit].texture:SetVertexColor(Gladius.db.dispellGridStyleIconUsedColor.r, Gladius.db.dispellGridStyleIconUsedColor.g, Gladius.db.dispellGridStyleIconUsedColor.b, Gladius.db.dispellGridStyleIconUsedColor.a)
end

-- announcement
if (Gladius.db.announcements.dispell) then
Gladius:Call(Gladius.modules.Announcements, "Send", strformat(L["DISPELL USED: %s (%s)"], UnitName(unit) or "test", UnitClass(unit) or "test"), 2, unit)
end

if (Gladius.db.announcements.dispell or Gladius.db.dispellGridStyleIcon) then
self.frame[unit].timeleft = duration
self.frame[unit]:SetScript("OnUpdate", function(f, elapsed)
self.frame[unit].timeleft = self.frame[unit].timeleft - elapsed

if (self.frame[unit].timeleft <= 0) then
-- dispell
if (Gladius.db.dispellGridStyleIcon) then
self.frame[unit].texture:SetVertexColor(Gladius.db.dispellGridStyleIconColor.r, Gladius.db.dispellGridStyleIconColor.g, Gladius.db.dispellGridStyleIconColor.b, Gladius.db.dispellGridStyleIconColor.a)
end

-- announcement
if (Gladius.db.announcements.dispell) then
Gladius:Call(Gladius.modules.Announcements, "Send", strformat(L["DISPELL READY: %s (%s)"], UnitName(unit) or "", UnitClass(unit) or ""), 2, unit)
end

self.frame[unit]:SetScript("OnUpdate", nil)
end
end)
end

-- cooldown
Gladius:Call(Gladius.modules.Timer, "SetTimer", self.frame[unit], duration)
end

function Dispell:CreateFrame(unit)
local button = Gladius.buttons[unit]
if (not button) then return end


-- create frame
self.frame[unit] = CreateFrame("CheckButton", "Gladius" .. self.name .. "Frame" .. unit, button, "ActionButtonTemplate")
self.frame[unit]:EnableMouse(false)
self.frame[unit]:SetNormalTexture("Interface\\AddOns\\Gladius\\images\\gloss")
self.frame[unit].texture = _G[self.frame[unit]:GetName().."Icon"]
self.frame[unit].normalTexture = _G[self.frame[unit]:GetName().."NormalTexture"]
self.frame[unit].cooldown = _G[self.frame[unit]:GetName().."Cooldown"]

end

function Dispell:Update(unit)
-- create frame
if (not self.frame[unit]) then
self:CreateFrame(unit)
end

-- update frame
self.frame[unit]:ClearAllPoints()

-- anchor point
local parent = Gladius:GetParent(unit, Gladius.db.dispellAttachTo)
self.frame[unit]:SetPoint(Gladius.db.dispellAnchor, parent, Gladius.db.dispellRelativePoint, Gladius.db.dispellOffsetX, Gladius.db.dispellOffsetY)

-- frame level
self.frame[unit]:SetFrameLevel(Gladius.db.dispellFrameLevel)

if (Gladius.db.dispellAdjustSize) then
if (self:GetAttachTo() == "Frame") then
local height = false
--[[ need to rethink that
for _, module in pairs(Gladius.modules) do
if (module:GetAttachTo() == self.name) then
height = false
end
end]]

if (height) then
self.frame[unit]:SetWidth(Gladius.buttons[unit].height)
self.frame[unit]:SetHeight(Gladius.buttons[unit].height)
else
self.frame[unit]:SetWidth(Gladius.buttons[unit].frameHeight)
self.frame[unit]:SetHeight(Gladius.buttons[unit].frameHeight)
end
else
self.frame[unit]:SetWidth(Gladius:GetModule(self:GetAttachTo()).frame[unit]:GetHeight() or 1)
self.frame[unit]:SetHeight(Gladius:GetModule(self:GetAttachTo()).frame[unit]:GetHeight() or 1)
end
else
self.frame[unit]:SetWidth(Gladius.db.dispellSize)
self.frame[unit]:SetHeight(Gladius.db.dispellSize)
end

-- set frame mouse-interactable area
if (self:GetAttachTo() == "Frame") then
local left, right, top, bottom = Gladius.buttons[unit]:GetHitRectInsets()

if (strfind(Gladius.db.dispellRelativePoint, "LEFT")) then
left = -self.frame[unit]:GetWidth() + Gladius.db.dispellOffsetX
else
right = -self.frame[unit]:GetWidth() + -Gladius.db.dispellOffsetX
end

-- search for an attached frame
--[[for _, module in pairs(Gladius.modules) do
if (module.attachTo and module:GetAttachTo() == self.name and module.frame and module.frame[unit]) then
local attachedPoint = module.frame[unit]:GetPoint()

if (strfind(Gladius.db.trinketRelativePoint, "LEFT") and (not attachedPoint or (attachedPoint and strfind(attachedPoint, "RIGHT")))) then
left = left - module.frame[unit]:GetWidth()
elseif (strfind(Gladius.db.trinketRelativePoint, "RIGHT") and (not attachedPoint or (attachedPoint and strfind(attachedPoint, "LEFT")))) then
right = right - module.frame[unit]:GetWidth()
end
end
end]]

-- top / bottom
if (self.frame[unit]:GetHeight() > Gladius.buttons[unit]:GetHeight()) then
bottom = -(self.frame[unit]:GetHeight() - Gladius.buttons[unit]:GetHeight()) + Gladius.db.dispellOffsetY
end

Gladius.buttons[unit]:SetHitRectInsets(left, right, 0, 0)
Gladius.buttons[unit].secure:SetHitRectInsets(left, right, 0, 0)
end

-- style action button
self.frame[unit].normalTexture:SetHeight(self.frame[unit]:GetHeight() + self.frame[unit]:GetHeight() * 0.4)
self.frame[unit].normalTexture:SetWidth(self.frame[unit]:GetWidth() + self.frame[unit]:GetWidth() * 0.4)

self.frame[unit].normalTexture:ClearAllPoints()
self.frame[unit].normalTexture:SetPoint("CENTER", 0, 0)
self.frame[unit]:SetNormalTexture("Interface\\AddOns\\Gladius\\images\\gloss")

self.frame[unit].texture:ClearAllPoints()
self.frame[unit].texture:SetPoint("TOPLEFT", self.frame[unit], "TOPLEFT")
self.frame[unit].texture:SetPoint("BOTTOMRIGHT", self.frame[unit], "BOTTOMRIGHT")

if (not Gladius.db.dispellIconCrop and not Gladius.db.dispellGridStyleIcon) then
self.frame[unit].texture:SetTexCoord(0, 1, 0, 1)
else
self.frame[unit].texture:SetTexCoord(0.07, 0.93, 0.07, 0.93)
end

self.frame[unit].normalTexture:SetVertexColor(Gladius.db.dispellGlossColor.r, Gladius.db.dispellGlossColor.g,
Gladius.db.dispellGlossColor.b, Gladius.db.dispellGloss and Gladius.db.dispellGlossColor.a or 0)

-- cooldown
if (Gladius.db.dispellCooldown) then
self.frame[unit].cooldown:Show()
else
self.frame[unit].cooldown:Hide()
end

self.frame[unit].cooldown:SetReverse(Gladius.db.dispellCooldownReverse)
Gladius:Call(Gladius.modules.Timer, "RegisterTimer", self.frame[unit], Gladius.db.dispellCooldown)

-- hide
self.frame[unit]:SetAlpha(0)
end

function Dispell:Show(unit)
local testing = Gladius.test

-- show frame
self.frame[unit]:SetAlpha(1)

if (Gladius.db.dispellGridStyleIcon) then
self.frame[unit].texture:SetTexture(LSM:Fetch(LSM.MediaType.STATUSBAR, "Minimalist"))
self.frame[unit].texture:SetVertexColor(Gladius.db.dispellGridStyleIconColor.r, Gladius.db.dispellGridStyleIconColor.g, Gladius.db.dispellGridStyleIconColor.b, Gladius.db.dispellGridStyleIconColor.a)
else
local dispellIcon
local playerClass, englishClass = UnitClass(unit);

if (not testing) then

if (englishClass == "PRIEST" ) then
dispellIcon = "Interface\\Icons\\spell_holy_dispelmagic"

elseif (englishClass == "SHAMAN" ) then
dispellIcon = "Interface\\Icons\\ability_shaman_cleansespirit"

elseif (englishClass == "PALADIN" ) then
dispellIcon = "Interface\\Icons\\spell_holy_purify"

elseif (englishClass == "DRUID" ) then
dispellIcon = "Interface\\Icons\\ability_shaman_cleansespirit"

elseif (englishClass == "MAGE" ) then
dispellIcon = "Interface\\Icons\\spell_nature_removecurse"

end

else
if (englishClass == "PRIEST" or unit=="arena1") then
dispellIcon = "Interface\\Icons\\spell_holy_dispelmagic"

elseif (englishClass == "SHAMAN" or unit=="arena2") then
dispellIcon = "Interface\\Icons\\ability_shaman_cleansespirit"

elseif (englishClass == "PALADIN" or unit=="arena3") then
dispellIcon = "Interface\\Icons\\spell_holy_purify"

elseif (englishClass == "DRUID" or unit=="arena4") then
dispellIcon = "Interface\\Icons\\ability_shaman_cleansespirit"

elseif (englishClass == "MAGE" or unit=="arena5") then
dispellIcon = "Interface\\Icons\\spell_nature_removecurse"
end
end

self.frame[unit].texture:SetTexture(dispellIcon)

if (Gladius.db.dispellIconCrop) then
self.frame[unit].texture:SetTexCoord(0.07, 0.93, 0.07, 0.93)
end

self.frame[unit].texture:SetVertexColor(1, 1, 1, 1)
end
end

function Dispell:Reset(unit)
if (not self.frame[unit]) then return end

-- reset frame
local dispellIcon

if (UnitFactionGroup("player") == "Horde" and Gladius.db.dispellFaction) then
dispellIcon = "Interface\\Icons\\INV_Jewelry_Necklace_38"
else
dispellIcon = "Interface\\Icons\\INV_Jewelry_Necklace_37"
end

self.frame[unit].texture:SetTexture(dispellIcon)

if (Gladius.db.dispellIconCrop) then
self.frame[unit].texture:SetTexCoord(0.07, 0.93, 0.07, 0.93)
end

self.frame[unit]:SetScript("OnUpdate", nil)

-- reset cooldown
Gladius:Call(Gladius.modules.Timer, "HideTimer", self.frame[unit])

-- hide
self.frame[unit]:SetAlpha(0)
end

function Dispell:Test(unit)
-- test
if (unit == "arena1") then
self:UpdateDispell(unit, 8)
end
if (unit == "arena2") then
self:UpdateDispell(unit, 8)
end
if (unit == "arena3") then
self:UpdateDispell(unit, 8)
end
if (unit == "arena4") then
self:UpdateDispell(unit, 8)
end

end

-- Add the announcement toggle
function Dispell:OptionsLoad()
Gladius.options.args.Announcements.args.general.args.announcements.args.dispell = {
type="toggle",
name=L["Dispell"],
desc=L["Announces when an enemy cast a dispell."],
disabled=function() return not Gladius.db.modules[self.name] end,
}
end

function Dispell:GetOptions()
return {
general = {
type="group",
name=L["General"],
order=1,
args = {
widget = {
type="group",
name=L["Widget"],
desc=L["Widget settings"],
inline=true,
order=1,
args = {
dispellGridStyleIcon = {
type="toggle",
name=L["Dispell Grid Style Icon"],
desc=L["Toggle dispell grid style icon"],
disabled=function() return not Gladius.dbi.profile.modules[self.name] end,
order=5,
},
sep = {
type = "description",
name="",
width="full",
order=7,
},
dispellGridStyleIconColor = {
type="color",
name=L["Dispell Grid Style Icon Color"],
desc=L["Color of the dispell grid style icon"],
hasAlpha=true,
get=function(info) return Gladius:GetColorOption(info) end,
set=function(info, r, g, b, a) return Gladius:SetColorOption(info, r, g, b, a) end,
disabled=function() return not Gladius.dbi.profile.dispellGridStyleIcon or not Gladius.dbi.profile.modules[self.name] end,
order=10,
},
dispellGridStyleIconUsedColor = {
type="color",
name=L["Dispell Grid Style Icon Used Color"],
desc=L["Color of the dispell grid style icon when it's on cooldown"],
hasAlpha=true,
get=function(info) return Gladius:GetColorOption(info) end,
set=function(info, r, g, b, a) return Gladius:SetColorOption(info, r, g, b, a) end,
disabled=function() return not Gladius.dbi.profile.dispellGridStyleIcon or not Gladius.dbi.profile.modules[self.name] end,
order=12,
},
sep1 = {
type = "description",
name="",
width="full",
order=13,
},
dispellCooldown = {
type="toggle",
name=L["Dispell Cooldown Spiral"],
desc=L["Display the cooldown spiral for important auras"],
disabled=function() return not Gladius.dbi.profile.modules[self.name] end,
hidden=function() return not Gladius.db.advancedOptions end,
order=15,
},
dispellCooldownReverse = {
type="toggle",
name=L["Dispell Cooldown Reverse"],
desc=L["Invert the dark/bright part of the cooldown spiral"],
disabled=function() return not Gladius.dbi.profile.modules[self.name] end,
hidden=function() return not Gladius.db.advancedOptions end,
order=20,
},
sep2 = {
type = "description",
name="",
width="full",
order=23,
},
dispellGloss = {
type="toggle",
name=L["Dispell Gloss"],
desc=L["Toggle gloss on the dispell icon"],
disabled=function() return not Gladius.dbi.profile.modules[self.name] end,
hidden=function() return not Gladius.db.advancedOptions end,
order=25,
},
dispellGlossColor = {
type="color",
name=L["Dispell Gloss Color"],
desc=L["Color of the dispell icon gloss"],
get=function(info) return Gladius:GetColorOption(info) end,
set=function(info, r, g, b, a) return Gladius:SetColorOption(info, r, g, b, a) end,
hasAlpha=true,
disabled=function() return not Gladius.dbi.profile.modules[self.name] end,
hidden=function() return not Gladius.db.advancedOptions end,
order=30,
},
sep3 = {
type = "description",
name="",
width="full",
hidden=function() return not Gladius.db.advancedOptions end,
order=33,
},
dispellIconCrop = {
type="toggle",
name=L["Dispell Icon Border Crop"],
desc=L["Toggle if the borders of the dispell icon should be cropped"],
disabled=function() return not Gladius.dbi.profile.modules[self.name] end,
order=35,
},
dispellFaction = {
type="toggle",
name=L["Dispell Icon Faction"],
desc=L["Toggle if the dispell icon should be changing based on the opponents faction"],
disabled=function() return not Gladius.dbi.profile.modules[self.name] end,
order=40,
},
sep3 = {
type = "description",
name="",
width="full",
order=43,
},
dispellFrameLevel = {
type="range",
name=L["Dispell Frame Level"],
desc=L["Frame level of the dispell"],
disabled=function() return not Gladius.dbi.profile.modules[self.name] end,
hidden=function() return not Gladius.db.advancedOptions end,
min=1, max=5, step=1,
width="double",
order=45,
},
},
},
size = {
type="group",
name=L["Size"],
desc=L["Size settings"],
inline=true,
order=2,
args = {
dispellAdjustSize = {
type="toggle",
name=L["Dispell Adjust Size"],
desc=L["Adjust dispell size to the frame size"],
disabled=function() return not Gladius.dbi.profile.modules[self.name] end,
order=5,
},
dispellSize = {
type="range",
name=L["Dispell Size"],
desc=L["Size of the dispell"],
min=10, max=100, step=1,
disabled=function() return Gladius.dbi.profile.dispellAdjustSize or not Gladius.dbi.profile.modules[self.name] end,
order=10,
},
},
},
position = {
type="group",
name=L["Position"],
desc=L["Position settings"],
inline=true,
order=3,
args = {
dispellAttachTo = {
type="select",
name=L["Dispell Attach To"],
desc=L["Attach dispell to the given frame"],
values=function() return Gladius:GetModules(self.name) end,
disabled=function() return not Gladius.dbi.profile.modules[self.name] end,
arg="general",
order=5,
},
dispellPosition = {
type="select",
name=L["Dispell Position"],
desc=L["Position of the dispell"],
values={ ["LEFT"] = L["Left"], ["RIGHT"] = L["Right"] },
get=function() return strfind(Gladius.db.dispellAnchor, "RIGHT") and "LEFT" or "RIGHT" end,
set=function(info, value)
if (value == "LEFT") then
Gladius.db.dispellAnchor = "TOPRIGHT"
Gladius.db.dispellRelativePoint = "TOPLEFT"
else
Gladius.db.dispellAnchor = "TOPLEFT"
Gladius.db.dispellRelativePoint = "TOPRIGHT"
end

Gladius:UpdateFrame(info[1])
end,
disabled=function() return not Gladius.dbi.profile.modules[self.name] end,
hidden=function() return Gladius.db.advancedOptions end,
order=6,
},
sep = {
type = "description",
name="",
width="full",
order=7,
},
dispellAnchor = {
type="select",
name=L["Dispell Anchor"],
desc=L["Anchor of the dispell"],
values=function() return Gladius:GetPositions() end,
disabled=function() return not Gladius.dbi.profile.modules[self.name] end,
hidden=function() return not Gladius.db.advancedOptions end,
order=10,
},
dispellRelativePoint = {
type="select",
name=L["Dispell Relative Point"],
desc=L["Relative point of the dispell"],
values=function() return Gladius:GetPositions() end,
disabled=function() return not Gladius.dbi.profile.modules[self.name] end,
hidden=function() return not Gladius.db.advancedOptions end,
order=15,
},
sep2 = {
type = "description",
name="",
width="full",
order=17,
},
dispellOffsetX = {
type="range",
name=L["Dispell Offset X"],
desc=L["X offset of the dispell"],
min=-100, max=100, step=1,
disabled=function() return not Gladius.dbi.profile.modules[self.name] end,
order=20,
},
dispellOffsetY = {
type="range",
name=L["Dispell Offset Y"],
desc=L["Y offset of the dispell"],
disabled=function() return not Gladius.dbi.profile.modules[self.name] end,
min=-50, max=50, step=1,
order=25,
},
},
},
},
},
}
end

 



13 ноя 2012, 08:40
Профиль



<Мёртвая Хватка>


Сервер: Азурегос
2х2: 1766
3х3: 1794
2
Сообщение Скрипты Neilyo и не только

по аналогии с тринкетами, кд на диспелл

Код:
local dispelFrames = {}
local dispellID = {
    [527]    =8, -- priest Purify
    [4987]    =8,    -- paladin Cleanse
    [77130]    =8,    -- shaman Purify Spirit
    [88423]    =8,    -- druid Nature's cure
    [115450]    =8,    -- monk

}

local dispelCD = CreateFrame('frame')
dispelCD:RegisterEvent('PLAYER_ENTERING_WORLD')

local updateDispelFrames = function()
    dispelFrames = wipe(dispelFrames)
    for i = 1, MAX_ARENA_ENEMIES do
        arenaFrame = 'ArenaEnemyFrame'..i
        local dispel = _G[arenaFrame..'Dispel'] or CreateFrame('Cooldown', arenaFrame..'Dispel', ArenaEnemyFrames)
        dispel:SetPoint('RIGHT', arenaFrame, 'LEFT', -30, 0)
        dispel:SetSize(24, 24)
        dispel.icon = dispel.icon or dispel:CreateTexture(nil, 'BACKGROUND')
        dispel.icon:SetAllPoints()
        dispel.icon:SetTexture(select(3, GetSpellInfo(527)))
        dispelFrames[UnitGUID('arena'..i)] = dispel
    end
end

dispelCD:SetScript('OnEvent',function(self,event,...)
    if event == 'PLAYER_ENTERING_WORLD' then
        updateDispelFrames()
        local _, instanceType = IsInInstance()
        if instanceType == "arena" then
            self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
        elseif self:IsEventRegistered("COMBAT_LOG_EVENT_UNFILTERED") then
            self:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
            for _, df in pairs(dispelFrames) do df:SetCooldown(0, 0) end
        end
    elseif event == 'COMBAT_LOG_EVENT_UNFILTERED' then
        local _, subevent, _, unit, _, _, _, _, _, _, _, spell
        if (not(UnitGUID('arena1')==unit or UnitGUID('arena2')==unit or UnitGUID('arena3')==unit or UnitGUID('arena4')==unit or UnitGUID('arena5')==unit)) then return end
        if subevent == 'SPELL_DISPEL' then
            updateDispelFrames()
            if dispellID[spell] then
                dispelFrames[unit].icon:SetTexture(select(3, GetSpellInfo(spell)))
                CooldownFrame_SetTimer(dispelFrames[unit], GetTime(), 8, 1)
            end
        end
    end
end)

не тестил, но по идее должно работать с дефолт арена фреймами. тринки справа, диспелы слева. и да, кд диспелла 8 сек? забыл, кхе. если ошибся поправьте в коде =8 на верное число



13 ноя 2012, 09:14
Профиль

0
Сообщение Скрипты Neilyo и не только

2 Fernir


Благодарю , вечером опробуем :)

 

115450 - Монковский диспел, заню , монков сейчас не очень много ,но добавить стоит



13 ноя 2012, 09:22
Профиль



<Дум Сквад>


Сервер: Черный Шрам
2х2: 1364
3х3: 96
0
Сообщение Скрипты Neilyo и не только

Witcher, а можешь на подобии скрипта на фокус накидать похожий, чтоб при клике правой кнопке по пати/рейд фрейму декурсить?



13 ноя 2012, 16:45
Профиль



<Имя Говорит Само за Себя>


Сервер: Гордунни
0
Сообщение Скрипты Neilyo и не только

Himmka писал(а):

Witcher, а можешь на подобии скрипта на фокус накидать похожий, чтоб при клике правой кнопке по пати/рейд фрейму декурсить?

Лучше погугли макросы по маусоверу.



13 ноя 2012, 16:46
Профиль



<Мёртвая Хватка>


Сервер: Азурегос
2х2: 1766
3х3: 1794
0
Сообщение Скрипты Neilyo и не только

я делал пост на эту тему - delaem-freim-klikabelnmi-t12089.html



13 ноя 2012, 16:52
Профиль



<Имя Говорит Само за Себя>


Сервер: Гордунни
0
Сообщение Скрипты Neilyo и не только

:cryкуда все вложения пропали?



13 ноя 2012, 17:05
Профиль

0
Сообщение Скрипты Neilyo и не только

хочу заменить текстуру нажатия на экшнбарах:

Код:
Button:SetPushedTexture("путь до текстуры")

это не работает, помогите допилить пжл

и ещё, вот код:

Код:
MainMenuBarLeftEndCap:SetTexture("Interface\\PlayerActionBarAlt\\SpellBar-Stone_left")
MainMenuBarRightEndCap:SetTexture("Interface\\PlayerActionBarAlt\\SpellBar-Stone_left")
MainMenuBarLeftEndCap:ClearAllPoints()
MainMenuBarLeftEndCap:SetPoint("BOTTOMRIGHT", MainMenuBar, "BOTTOMLEFT", 29, -4)
MainMenuBarLeftEndCap:SetWidth(132)
MainMenuBarLeftEndCap:SetHeight(132/2)
MainMenuBarRightEndCap:ClearAllPoints()
MainMenuBarRightEndCap:SetPoint("BOTTOMLEFT", MainMenuBar, "BOTTOMRIGHT", -29, -4)
MainMenuBarRightEndCap:SetWidth(132)
MainMenuBarRightEndCap:SetHeight(132/2)
MainMenuBarLeftEndCap:SetDrawLayer("BACKGROUND")
MainMenuBarRightEndCap:SetDrawLayer("BACKGROUND")


меняет текстурки грифонов на те, что были у Фернира в суперклассике, почемуто стали отображаться

зеленные квадраты вместо текстур, это близыы убрали их из игры или что?вроде они еще остались судя по http://wowprogramming.com

 



14 ноя 2012, 12:16
Профиль



<Открытый Космос>


Сервер: Soulflayer
2х2: 1434
0
Сообщение Скрипты Neilyo и не только

Metampsi писал(а):

 

меняет текстурки грифонов на те, что были у Фернира в суперклассике, почемуто стали отображаться

зеленные квадраты вместо текстур, это близыы убрали их из игры или что?вроде они еще остались судя по http://wowprogramming.com

 

http://wowprogramming.com там еще катовксие текстурки.

Если кто знает где есть под моp, поделитесь



14 ноя 2012, 19:20
Профиль



<Имя Говорит Само за Себя>


Сервер: Гордунни
0
Сообщение Скрипты Neilyo и не только

А что мешает скопировать текстуру с вовпрограмминг и указать на нее путь?



14 ноя 2012, 19:33
Профиль



<Открытый Космос>


Сервер: Soulflayer
2х2: 1434
0
Сообщение Скрипты Neilyo и не только

wit4er писал(а):

А что мешает скопировать текстуру с вовпрограмминг и указать на нее путь?

Поподробней пожалуйста, я обычно брал оттуда текстуру изменял в фотошопе и кидал в папку интерфейс

 



14 ноя 2012, 22:22
Профиль



<Имя Говорит Само за Себя>


Сервер: Гордунни
0
Сообщение Скрипты Neilyo и не только

Lancer писал(а):

wit4er писал(а):

А что мешает скопировать текстуру с вовпрограмминг и указать на нее путь?

Поподробней пожалуйста, я обычно брал оттуда текстуру изменял в фотошопе и кидал в папку интерфейс

 

Я про это и говорю, если их нет в файлах игры, то можно вставить с сайта или откуда-нибудь еще.



14 ноя 2012, 23:44
Профиль



<Дум Сквад>


Сервер: Черный Шрам
2х2: 1364
3х3: 96
0
Сообщение Скрипты Neilyo и не только

Fernir писал(а):

я делал пост на эту тему - delaem-freim-klikabelnmi-t12089.html

Зашел, прочитал, вроде разобрался. Но макрос работает, а если в аддон пихаю - нет. Может быть из-за русского названия спелла в .LUA ? 

Если да то в какой кодировке надо сохранять?

 макрос вот такой:

Код:
/run for i=2,40 do

_G["CompactRaidFrame"..i]:SetAttribute("type2", "spell")  

_G["CompactRaidFrame"..i]:SetAttribute("spell2", "Снятие порчи")

end;



15 ноя 2012, 01:33
Профиль



<Мёртвая Хватка>


Сервер: Азурегос
2х2: 1766
3х3: 1794
0
Сообщение Скрипты Neilyo и не только

ага, пересохрани луа файл в utf8 формате и заработает



15 ноя 2012, 13:21
Профиль

0
Сообщение Скрипты Neilyo и не только

Здравствуйте, возник вопрос, можно сделать что бы иконка класса заменяла портрет, только в аренафреймах?



15 ноя 2012, 13:29
Профиль



<Имя Говорит Само за Себя>


Сервер: Гордунни
0
Сообщение Скрипты Neilyo и не только

psihrus писал(а):

Здравствуйте, возник вопрос, можно сделать что бы иконка класса заменяла портрет, только в аренафреймах?


Наверное, если ничего не делать, то так и будет.



15 ноя 2012, 13:33
Профиль

0
Сообщение Скрипты Neilyo и не только

wit4er писал(а):

psihrus писал(а):

Здравствуйте, возник вопрос, можно сделать что бы иконка класса заменяла портрет, только в аренафреймах?


Наверное, если ничего не делать, то так и будет.

Возможно у него не стандартный интерфейс

 



15 ноя 2012, 14:54
Профиль

0
Сообщение Скрипты Neilyo и не только

Вроде тут пираточников не жалуют, я играю на лк, если я не ошибаюсь то на лк такого нету.



15 ноя 2012, 15:00
Профиль



<Имя Говорит Само за Себя>


Сервер: Гордунни
0
Сообщение Скрипты Neilyo и не только

psihrus писал(а):

Вроде тут пираточников не жалуют, я играю на лк, если я не ошибаюсь то на лк такого нету.

Сейчас посмотрел мувик с вотлк арены, там на фреймах классовые портреты.



15 ноя 2012, 15:32
Профиль
Начать новую тему Ответить на тему


Перейти:  

На сайте использованы материалы, принадлежащие Blizzard Entertainment. Копирование материалов возможно только c разрешения портала. В противном случае это будет называться уже другим словом.
Рейтинг@Mail.ru