Tercio@0: local floor = floor Tercio@0: local min = min Tercio@0: local UnitExists = UnitExists Tercio@0: local GetPlayerMapPosition = GetPlayerMapPosition Tercio@0: local UnitHealth = UnitHealth Tercio@0: Tercio@0: local f = CreateFrame ("frame", "Hansgar_And_Franzok_Assist", UIParent) Tercio@0: f:SetFrameStrata ("DIALOG") Tercio@0: Tercio@0: f:SetSize (155, 156) Tercio@0: f:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, insets = {left = -1, right = -1, top = -1, bottom = -1}, Tercio@0: edgeFile = "Interface\\AddOns\\Hansgar_And_Franzok_Assist\\border_2", edgeSize = 8}) Tercio@0: f:SetPoint ("center", UIParent, "center") Tercio@0: f:SetBackdropColor (0, 0, 0, 0) Tercio@0: f:SetBackdropBorderColor (0, 0, 0, 1) Tercio@0: f:SetMovable (true) Tercio@0: f:EnableMouse (true) Tercio@0: f:Hide() Tercio@0: Tercio@0: local title = f:CreateFontString (nil, "overlay", "GameFontNormal") Tercio@0: title:SetText ("Hansgar & Franzok Assist") Tercio@0: title:SetPoint ("center", f, "center") Tercio@0: title:SetPoint ("bottom", f, "top", 0, 2) Tercio@0: Tercio@0: -- Tercio@0: local frame_event = CreateFrame ("frame", "Hansgar_And_Franzok_AssistEvents", f) Tercio@0: frame_event:RegisterEvent ("ENCOUNTER_START") Tercio@0: frame_event:RegisterEvent ("ENCOUNTER_END") Tercio@0: frame_event:RegisterEvent ("ADDON_LOADED") Tercio@0: Tercio@0: -- Tercio@0: local player_bar = CreateFrame ("statusbar", "Hansgar_And_Franzok_AssistPlayerBar", f) Tercio@0: player_bar:SetPoint ("topleft", f, "bottomleft", 0, -3) Tercio@0: player_bar:SetPoint ("topright", f, "bottomright", 0, -3) Tercio@0: player_bar:SetHeight (14) Tercio@0: player_bar:SetStatusBarColor (0, 0, 0, 0) Tercio@0: player_bar:SetMinMaxValues (0, 100) Tercio@0: player_bar:SetValue (0) Tercio@0: f.player_bar = player_bar Tercio@0: Tercio@0: player_bar.texture = player_bar:CreateTexture (nil, "overlay") Tercio@0: player_bar.texture:SetTexture ("Interface\\AddOns\\Hansgar_And_Franzok_Assist\\bar_skyline") Tercio@0: player_bar:SetStatusBarTexture (player_bar.texture) Tercio@0: Tercio@0: -- Tercio@0: Tercio@0: local db Tercio@0: Tercio@0: frame_event:SetFrameStrata ("FULLSCREEN") Tercio@0: Tercio@0: frame_event:SetScript ("OnEvent", function (self, event, ...) Tercio@0: Tercio@0: if (event == "ADDON_LOADED" and select (1, ...) == "Hansgar_And_Franzok_Assist") then Tercio@0: Tercio@0: db = Hansgar_And_Franzok_DB Tercio@0: if (not db) then Tercio@0: db = {} Tercio@0: Hansgar_And_Franzok_DB = db Tercio@0: end Tercio@0: db.STAMPERS_DELAY = db.STAMPERS_DELAY or 5 Tercio@0: Tercio@0: SLASH_Hansgar_And_Franzok_Assist1, SLASH_Hansgar_And_Franzok_Assist2 = "/hansgar", "/franzok" Tercio@0: function SlashCmdList.Hansgar_And_Franzok_Assist (msg, editbox) Tercio@0: Tercio@0: local command, rest = msg:match ("^(%S*)%s*(.-)$") Tercio@0: Tercio@0: if (command == "delay") then Tercio@0: local t = tonumber (rest) Tercio@0: if (t) then Tercio@0: db.STAMPERS_DELAY = t Tercio@0: print ("|cFFFFAA00Hansgar and Franzok Assist|r delay set to: ", t) Tercio@0: else Tercio@0: print ("|cFFFFAA00Hansgar and Franzok Assist|r invalid time.", t) Tercio@0: end Tercio@0: Tercio@0: elseif (command == "test" or command == "show") then Tercio@0: if (f.StampersPhase) then Tercio@0: return f:StopTracking() Tercio@0: end Tercio@0: f:StartTracking() Tercio@0: Tercio@0: elseif (command == "hide") then Tercio@0: if (f.StampersPhase) then Tercio@0: return f:StopTracking() Tercio@0: end Tercio@0: Tercio@0: else Tercio@0: print ("|cFFFFAA00Hansgar and Franzok Assist|r Commands:") Tercio@0: print ("|cFFFFFF00/hansgar delay