Крч стоит груп лут , лутают боса ты жмешь "мне это нужно"
нужен аддон который если ты сролил шмотку выбивает это на экран
типа вот так
ну как на офе вобщем.
Крч стоит груп лут , лутают боса ты жмешь "мне это нужно"
нужен аддон который если ты сролил шмотку выбивает это на экран
типа вот так
ну как на офе вобщем.
Последний раз редактировалось «Severgon»; 28.01.2017 в 16:21.
Xloot и там модули к нему, XLootMaster, XlootGroup, XlootMonitor, настроить можно как душа пожелает)
не то, на єкране же должно а не в чате =/
Ну как то так, при луте нескольких сразу спавна нету, просто замена с остановкой анимации предыдущего:
Скрытый текст
PHP код:
local Config = {
Point = {x = 0, y = 0}, -- Позиция фрейма (Относительно центра);
Time = 4, -- Время отображения фрейма (не считая анимацию);
Sound = "RaidWarning" -- Звук при выигрыше;
};
local Core = CreateFrame("Button", nil, UIParent);
Core:RegisterEvent("ADDON_LOADED");
Core:SetScript("OnEvent", function(self, event, ...) return self[event](self, ...) end);
function Core:CreateMainFrame()
self:SetPoint("CENTER", UIParent, Config.Point.x, Config.Point.y);
self:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16, edgeSize = 2});
self:SetBackdropColor(131/255, 139/255, 139/255, 0.6);
self:SetSize(200, 50);
self:Hide();
self:SetAlpha(0);
self.Icon = self:CreateTexture(nil, "ARTWORK");
self.Icon:SetPoint("LEFT", self, 5, 0);
self.Icon:SetSize(35, 35);
self.Title = self:CreateFontString(nil, "OVERLAY");
self.Title:SetPoint("TOPLEFT", self.Icon, "TOPRIGHT", 3, 0);
self.Title:SetFont("Fonts\\FRIZQT__.TTF", 10, "OUTLINE");
self.Title:SetTextColor(1, 215/255, 0);
self.Title:SetText("Вы получили");
self.Item = self:CreateTexture(nil, "ARTWORK");
self.Item:SetPoint("TOPLEFT", self.Title, "BOTTOMLEFT", 0, -3);
self.Item:SetSize(152, 21);
self.Item:SetTexture(0, 0, 0, 0.8);
self.Item.Text = self:CreateFontString(nil, "OVERLAY");
self.Item.Text:SetPoint("TOPLEFT", self.Item, "TOPLEFT", 3, 0);
self.Item.Text:SetPoint("BOTTOMRIGHT", self.Item, "BOTTOMRIGHT", 0, 0);
self.Item.Text:SetFont("Fonts\\FRIZQT__.TTF", 12, "OUTLINE");
end;
function Core:CreateAnim()
self.Anim = self:CreateAnimationGroup("Loot");
self.Anim:SetScript("OnFinished", function(self) self:GetParent():Hide(); end);
self.Anim:SetLooping("NONE");
local in1 = self.Anim:CreateAnimation("Alpha");
in1:SetDuration(1);
in1:SetOrder(1);
local in2 = self.Anim:CreateAnimation("Alpha");
in2:SetDuration(1);
in2:SetOrder(2);
in1:SetChange(1);
in2:SetStartDelay(Config.Time);
in2:SetChange(-1);
end;
function Core:ADDON_LOADED(addonName)
self:CreateMainFrame();
self:CreateAnim();
self:RegisterEvent("CHAT_MSG_LOOT");
self:UnregisterEvent("ADDON_LOADED");
end;
function Core:OnUpdate(ItemName, Quality, Texture)
if self.Anim:IsPlaying() then self.Anim:Stop(); end;
self:Show();
PlaySound(Config.Sound);
self.Icon:SetTexture(Texture);
self.Item.Text:SetText(ItemName);
local r, g, b = GetItemQualityColor(Quality);
self:SetBackdropBorderColor(r, g, b, 0.8);
self.Item.Text:SetTextColor(r, g, b);
self.Anim:Play();
end;
Core:SetScript("OnMouseDown", function(self, button)
if button ~= "LeftButton" then return; end;
if ( not ItemRefTooltip:IsShown() ) then
ItemRefTooltip:SetOwner(UIParent, "ANCHOR_PRESERVE");
ItemRefTooltip:SetHyperlink(self["Hyperlink"]);
else
ItemRefTooltip:Hide();
end
end);
local p = gsub(LOOT_ROLL_YOU_WON, "%%s", "(.+)");
function Core:CHAT_MSG_LOOT(Message)
local _,_,Item = Message:find(p)
if Item then
local Name,_,Quality,_,_,_,_,_,_,Texture = GetItemInfo(Item);
self["Hyperlink"] = Item;
self:OnUpdate(Name, Quality, Texture);
end;
end;
[свернуть]
«Severgon» (31.01.2017)
«Severgon» (31.01.2017)
Проверяй. На моем реалме дроп фиговый но вроде се норм.
Скрытый текст
PHP код:
local Config = {
Point = {x = 0, y = -100}, -- Позиция фрейма (Относительно центра);
Time = 4, -- Время отображения фрейма (не считая анимацию);
Sound = "RaidWarning" -- Звук при выигрыше;
};
local GetItemQualityColor, GetItemInfo, GetLootMethod, GetLootThreshold, gsub = GetItemQualityColor, GetItemInfo, GetLootMethod, GetLootThreshold, gsub;
local ItemFrames = {};
local Core = CreateFrame("Frame");
Core:RegisterEvent("ADDON_LOADED");
Core:SetScript("OnEvent", function(self, event, ...) return self[event](self, ...) end);
function Core:CreateItemFrame(Index)
self["ItemFrame_"..Index] = CreateFrame("Button", nil, self);
local Button = self["ItemFrame_"..Index];
Button:SetPoint("CENTER", UIParent, Config.Point.x, Config.Point.y + (Index-1)*55);
Button:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16, edgeSize = 2});
Button:SetBackdropColor(131/255, 139/255, 139/255, 0.6);
Button:SetSize(200, 50);
Button:Hide();
Button:SetAlpha(0);
--
Button.Icon = Button:CreateTexture(nil, "ARTWORK");
Button.Icon:SetPoint("LEFT", Button, 5, 0);
Button.Icon:SetSize(35, 35);
--
Button.Title = Button:CreateFontString(nil, "OVERLAY");
Button.Title:SetPoint("TOPLEFT", Button.Icon, "TOPRIGHT", 3, 0);
Button.Title:SetFont("Fonts\\FRIZQT__.TTF", 10, "OUTLINE");
Button.Title:SetTextColor(1, 215/255, 0);
Button.Title:SetText("Вы получили");
--
Button.Item = Button:CreateTexture(nil, "ARTWORK");
Button.Item:SetPoint("TOPLEFT", Button.Title, "BOTTOMLEFT", 0, -3);
Button.Item:SetSize(152, 21);
Button.Item:SetTexture(0, 0, 0, 0.8);
--
Button.Item.Text = Button:CreateFontString(nil, "OVERLAY");
Button.Item.Text:SetPoint("TOPLEFT", Button.Item, "TOPLEFT", 3, 0);
Button.Item.Text:SetPoint("BOTTOMRIGHT", Button.Item, "BOTTOMRIGHT", 0, 0);
Button.Item.Text:SetFont("Fonts\\FRIZQT__.TTF", 12, "OUTLINE");
--
self:CreateAnim(Button);
ItemFrames[Index] = Button;
--
Button:SetScript("OnMouseDown", function(self, button)
if button ~= "LeftButton" then return; end;
ItemRefTooltip:SetOwner(UIParent, "ANCHOR_PRESERVE");
ItemRefTooltip:SetHyperlink(self["Hyperlink"]);
end);
end;
function Core:CreateAnim(Frame)
Frame.Anim = Frame:CreateAnimationGroup("Loot");
Frame.Anim:SetScript("OnFinished", function(self) self:GetParent():Hide(); end);
--
Frame.Anim:SetLooping("NONE");
local in1 = Frame.Anim:CreateAnimation("Alpha");
in1:SetDuration(1);
in1:SetOrder(1);
local in2 = Frame.Anim:CreateAnimation("Alpha");
in2:SetDuration(1);
in2:SetOrder(2);
in1:SetChange(1);
in2:SetStartDelay(Config.Time);
in2:SetChange(-1);
end;
function Core:ADDON_LOADED(addonName)
self:RegisterEvent("PARTY_LOOT_METHOD_CHANGED");
self:UnregisterEvent("ADDON_LOADED");
end;
function Core:OnUpdate(ItemName, Quality, Texture, Hyperlink)
local Length = #ItemFrames;
local Button;
for i = 1, Length + 1 do
if ( not ItemFrames[i] ) then
self:CreateItemFrame(i);
Button = ItemFrames[i];
break;
elseif ( not ItemFrames[i]:IsVisible() ) then
Button = ItemFrames[i];
break;
end;
end;
--
if Button.Anim:IsPlaying() then Button.Anim:Stop(); end;
Button:Show();
Button["Hyperlink"] = Hyperlink;
PlaySound(Config.Sound);
Button.Icon:SetTexture(Texture);
Button.Item.Text:SetText(ItemName);
local r, g, b = GetItemQualityColor(Quality);
Button:SetBackdropBorderColor(r, g, b, 0.8);
Button.Item.Text:SetTextColor(r, g, b);
Button.Anim:Play();
end;
function Core:PARTY_LOOT_METHOD_CHANGED()
if GetLootMethod() == "group" or GetLootMethod() == "needbeforegreed" then
self.Message = gsub(LOOT_ROLL_YOU_WON, "%%s", "(.+)");
if not self:IsEventRegistered("CHAT_MSG_LOOT") then self:RegisterEvent("CHAT_MSG_LOOT"); end;
elseif GetLootMethod() == "master" then
self.Message = gsub(LOOT_ITEM_SELF, "%%s", "(.+)");
if not self:IsEventRegistered("CHAT_MSG_LOOT") then self:RegisterEvent("CHAT_MSG_LOOT"); end;
else
if self:IsEventRegistered("CHAT_MSG_LOOT") then self:UnregisterEvent("CHAT_MSG_LOOT"); end;
end;
end;
function Core:CHAT_MSG_LOOT(Message)
local _,_,Item = Message:find(self.Message)
if Item then
local Name,_,Quality,_,_,_,_,_,_,Texture = GetItemInfo(Item);
if Quality < GetLootThreshold() then return; end;
self:OnUpdate(Name, Quality, Texture, Item);
end;
end;
[свернуть]
- - - Updated - - -
Теперь и для "мастерлута" и "Приоритета по нужности"
Последний раз редактировалось Wbtest2; 19.03.2017 в 00:31.
«Severgon» (31.01.2017),redojke (14.03.2017)
А теперь поясните мне, нубу, как этим пользоваться? Ну типо что куда закинуть, если я хочу себе такое же?) Напомнило прямо таки диабло2)
Сообщение от ℬовδай’κа
За это у нас наказывают)
Сообщение от Кодекс
[свернуть]