Inform = nil
local testWarning1, testWarning2, testWarning3
local testTimer
local testSpecialWarning
Inform = DBM:NewMod("DPM")
local id=1

DPM_newauranumber=0
DPM_selectclass = 1
DPM_selectspell = 1
DPM_addonloaded = 0
DPM_version = 3.22
DPM_versiontype = "beta"
DPM_TextEnemy= "\124cAAF00000"
DPM_TextFriend = "\124cff00ff00"
DPM_TextEnd = "\124h\124r"
DPM_TextDPM = "\124cffff6600<\124h\124r\124cffffff11DPM\124h\124r\124cffff6600>\124h\124r"
DPM_exversion=DPM_version

function DPMBGLocation()
local table = {"Arathi Basin","Alterac Valley","Eye of the Storm","Strand of the Ancients","Isle of Conquest"}
local a=0
local location = GetZoneText()
local looklocation = nil
local endlocation = nil

for a=1,getn(table) do
 looklocation = table[a]
 if(looklocation == location) then
   endlocation = looklocation
 end
end

return endlocation
end
function DPMArenaLocation()
local table = {"Ring of Valor","Ruins of Lordaeron","Ring of Trials","Circle of Blood","Dalaran Arena"}
local a=0
local location = GetZoneText()
local looklocation = nil
local endlocation = nil

for a=1,getn(table) do
 looklocation = table[a]
 if(looklocation == location) then
   endlocation = looklocation
 end
end

return endlocation
end
DPM_chat = {
  ["TYPE"]={"PARTY","BATTLEGROUND","RAID","GUILD","RAID_WARNING"},
  ["TRUE"]={
    function() 
	  if(GetNumPartyMembers()>0) then 
	    return 1 
	  else 
	    return 0 
	  end 
    end,
	function() 
	  if(DPMBGLocation()) then
	    return 1
	  else
	    return 0
	  end
	end,
    function() 
	  if(GetRealNumRaidMembers()>0) then 
	    return 1 
	  else 
	    return 0 
	  end 
    end,
	function() 
	  if(IsInGuild()==1) then
	    return 1
	  else
	    return 0
	  end
    end,
	function()
	  if(GetNumPartyMembers()>0) then 
	    if(GetNumPartyMembers()<6) then
		  return 1
		elseif(GetNumPartyMembers()>5) then
		  if(IsPartyLeader()) then
	        return 1
          else
	        return 0
          end
		end
	  else
	    return 0
	  end
	end
	}
  }
DPM_classes={
"Paladin",
"Druid",
"Warrior",
"Rogue",
"Hunter",
"Mage",
"Deathknight",
"Priest",
"Shaman",
"Warlock",
"Other"
}
--\\\\\\\\\\\\\\\\\\\\\\\Create Rune Functions////////////////////////
function RuneCreateFrame(name,x,y,parent,width,height,move,mouse,rto,rpoint)
  local Parent = parent

  if(parent==nil) then

    local Parent = UIParent

  end

  local FrameLevel = 4
  local RelativeTo="CENTER"
  local RelativePoint = "CENTER"

  if(rto) then
    local RelativeTo=rto
  end

  if not(rpoint==nil) then
    local RelativePoint = rpoint
  end

  local Fx = x
  local Fy = y
  local FName =  name
  local FWidth = width
  local FHeight = height
  local MoveAble = move
  local MouseAble = mouse  
  local FFrame = CreateFrame("FRAME",FName,Parent)
  FFrame:SetBackdrop(StaticPopup1:GetBackdrop())
  FFrame:SetWidth(FWidth)
  FFrame:SetHeight(FHeight)
  FFrame:SetPoint(RelativePoint,Parent,RelativeTo , Fx,Fy)

  if(MoveAble) then
    FFrame:SetMovable(true)
  end

  if(MouseAble) then
    FFrame:EnableMouse(true)
    FFrame:SetScript("OnMouseDown",function() FFrame:StartMoving() end)
    FFrame:SetScript("OnMouseUp",function() FFrame:StopMovingOrSizing() end)
  end

  FFrame:SetFrameLevel(4)

  return FFrame
end
function RuneCreateButton(name,text,x,y,parent,w,h,relativeto,relativepoint,OnClicking)
  if(parent==nil) then
   local Parent = UIParent
  else
   Parent = parent
  end
  local Name = name
  local BX = x
  local BY = y
  local RelativeTo = relativeto
  local RelativePoint = relativepoint
  local BWidth = w
  local BHeight = h
  local Text = text

  local FrameLevel = 5
  local ButtonFrame = CreateFrame("BUTTON",Name,Parent)
  ButtonFrame:ClearAllPoints()
  ButtonFrame:SetPoint(RelativeTo, Parent, RelativePoint, BX, BY)
  ButtonFrame:SetMovable(true)
  ButtonFrame:EnableMouse(true)
  ButtonFrame:SetNormalTexture("Interface\\Buttons\\UI-DialogBox-Button-Up.blp") 
  ButtonFrame:SetPushedTexture("Interface\\Buttons\\UI-DialogBox-Button-Down")

  ButtonFrame:SetHighlightTexture("Interface\\Buttons\\UI-DialogBox-Button-Highlight")


  ButtonFrame:SetWidth(BWidth)
  ButtonFrame:SetHeight(BHeight)

  function ButtonFrame.ButtonClick(self,button,down)
    OnClicking(self, button, down)
  end

  ButtonFrame:SetFrameLevel(FrameLevel)
  local ButtonFrameFont = ButtonFrame:CreateFontString("ButtonFrameString", FrameLevel+1, "GameFontNormal")
  ButtonFrameFont:SetPoint("BOTTOM",ButtonFrame,"CENTER",0,-1.5)
  ButtonFrameFont:SetText(text)
  ButtonFrame:SetScript("OnClick", function(self, button, down) OnClicking(self, button, down,ButtonFrameFont, Name) end)

  return ButtonFrame, ButtonFrameFont
end
function RuneCreateEditbox(name,x,y,parent,rt,rp)
  if(parent==nil) then
    local Parent = UIParent
  else
    Parent = parent
  end
  Name = name
  RelativeTo = rt
  RelativePoint = rp
  EditX = x
  EditY = y
  local FrameLevel = 5

  local EditBox = CreateFrame("EditBox", Name, Parent)
  EditBox:SetFrameLevel(FrameLevel)
  EditBox:ClearAllPoints()
  EditBox:SetPoint("TOPLEFT", Parent, "TOPLEFT",EditX+67,EditY)
 
  EditBox:SetPoint("BOTTOMRIGHT", Parent, "TOPRIGHT", EditX-17,EditY-25)
  EditBox:SetFontObject(GameFontHighlightSmall)
  EditBox:SetTextInsets(8,8,8,8)
  EditBox:SetBackdrop({
	bgFile = "Interface\\Buttons\\UI-SliderBar-Background",
	edgeFile = "Interface\\Buttons\\UI-SliderBar-Border",
	tile = true,
	tileSize = 8,
	edgeSize = 8,
	insets = { left = 3, right = 3, top = 6, bottom = 6 }
  })
  EditBox:SetBackdropColor(.1,.1,.1,1)
  EditBox:SetMovable(true)
  EditBox:SetMultiLine(false)
  EditBox:SetAutoFocus(false)

  EditBox:SetScript("OnTextSet", function(self)
    if self:GetText() == "" then
      EditBox:SetPoint(RelativeTo,Parent,RelativePoint,EditX,EditY)
    else
      EditBox:SetPoint(RelativeTo,Parent,RelativePoint,EditX,EditY)
      EditBox:SetFocus()
      EditBox:HighlightText()
    end
  end)

  EditBox:SetScript("OnEscapePressed", EditBox.ClearFocus)
  EditBox:SetScript("OnEnterPressed", EditBox.ClearFocus)
  EditBox:SetScript("OnTabPressed", EditBox.ClearFocus)
  EditBox:ClearFocus()

  return EditBox
end
function RuneCreateText(name,text,x,y,parent,w,h,relativeto,relativepoint,white,tittle,justify,TextFunctionOnClick)
  if(parent==nil) then
    local Parent = UIParent
  else
    Parent = parent
  end

  local Name = name
  local TextX = x
  local TextY = y
  local RelativeTo = relativeto
  local RelativePoint = relativepoint
  local TextWidth = w
  local TextHeight = h
  local Text = text

  local FrameLevel = 4

  local TextFrame = CreateFrame("FRAME",Name,Parent)
  TextFrame:ClearAllPoints()
  TextFrame:SetWidth(TextWidth)
  TextFrame:SetHeight(TextHeight)
  local TextFrameFont = TextFrame:CreateFontString(nil, "BACKGROUND","GameFontNormal")

  if(tittle) then
    --TextFrameFont:SetFont("Fonts\\skurri.ttf",20,"OUTLINE")
    TextFrameFont:SetFont("Fonts\\ARIALN.TTF",20,"OUTLINE")
  end

  if(white) then
    TextFrameFont:SetTextColor(1,1,1)
  end
   
  if(justify) then
    TextFrameFont:SetJustifyH(justify)
  end
  
  TextFrameFont:SetAllPoints()
  TextFrameFont:SetText(Text)
  TextFrame:SetPoint(RelativeTo,Parent,RelativePoint,TextX,TextY)
  TextFrame:SetMovable(true)
  TextFrame:SetFrameLevel(FrameLevel)

  function TextFrame.OnGlobalClick(a1,a2,a3,a4)
    TextFunctionOnClick(TextFrame,TextFrameFont,a1,a2,a3,a4)
  end

  function TextFrameFont.OnGlobalClick(a1,a2,a3,a4)
    TextFunctionOnClick(TextFrame,TextFrameFont,a1,a2,a3,a4)
  end

  return TextFrame,TextFrameFont
end
function RuneCreateDropdownMenu(name,x,y,parent,items,rto,rpoint,DDMFunctionOnClick,DDMFunctionOnInit,UseOnInit)
    
  if(parent==nil) then
    local Parent = UIParent
  else
    Parent = parent
  end

  local FrameWidth = 100
  local MenuWidth = 124
  local StartID = 1
  local TextAllign = "LEFT"
  local DDMItems = items
  local RelativeTo = rto
  local RelativePoint = rpoint
  local DDMx = x
  local DDMy = y
  local DDMName = name
  local DDMFrame = CreateFrame("FRAME",DDMName, Parent,"UIDropDownMenuTemplate")
  DDMFrame:ClearAllPoints()
  DDMFrame:SetPoint(RelativeTo, Parent, RelativePoint, DDMx, DDMy)
  DDMFrame:Show()

  function DDMFrame.OnClick(self)
    local idd = UIDropDownMenu_GetSelectedID(DDMFrame) --this:GetID()
    DDMFunctionOnClick(optionID,optionName,DDMFrame, idd)
  end

  function DDMFrame.DropDownMenuOnClick()
    local optionID = this:GetID();
    UIDropDownMenu_SetSelectedID(DDMFrame, optionID);
    local optionName =  UIDropDownMenu_GetText(DDMFrame);
    UIDropDownMenu_SetSelectedValue(DDMFrame, optionName);
    DDMFrame.OnClick()
  end

  function DDMFrame.DropDownMenuInit(ex,exex)
    if(tostring(UseOnInit)=="nil") then
      for index,value in pairs(DDMItems) do
       local info = UIDropDownMenu_CreateInfo()
       info.text = value
       info.value = value
       info.tooltipTitle = tostring(value)
       --info.tooltipText = tostring(value)	
       info.func = DDMFrame.DropDownMenuOnClick
       UIDropDownMenu_AddButton(info, nil, DDMFrame)
     end
   else
     DDMFunctionOnInit(DDMFrame,DDMFrame.DropDownMenuOnClick,DDMItems,DDMFrame,ex,exex)
   end
   UIDropDownMenu_Refresh(DDMFrame)
  end
 
  UIDropDownMenu_Initialize(DDMFrame, 	DDMFrame.DropDownMenuInit)
  UIDropDownMenu_SetWidth(DDMFrame, 	FrameWidth);
  UIDropDownMenu_SetButtonWidth(DDMFrame,MenuWidth)
  UIDropDownMenu_SetSelectedID(DDMFrame, StartID)
  UIDropDownMenu_JustifyText(DDMFrame, 	TextAllign)
  
  return DDMFrame
end
function RuneCreateCheckbox(name,x,y,parent,rto,rpoint,w,h,down,CBoxClick)
  local DPMcheckbox = CreateFrame("CheckButton",name,parent)
  DPMcheckbox:SetWidth(w)
  DPMcheckbox:SetHeight(h)
  DPMcheckbox:SetNormalTexture("Interface\\Buttons\\UI-CheckBox-Up") 
  DPMcheckbox:SetPushedTexture("Interface\\Buttons\\UI-CheckBox-Down") 
  DPMcheckbox:SetHighlightTexture("Interface\\Buttons\\UI-CheckBox-Highlight", "ADD") 
  DPMcheckbox:SetCheckedTexture("Interface\\Buttons\\UI-CheckBox-Check") 
  DPMcheckbox:SetPoint(rpoint,parent,rto,x,y)

  if(down==1) then 
    DPMcheckbox:SetChecked(true) 
  else 
    DPMcheckbox:SetChecked(false) 
  end

  DPMcheckbox:SetScript("OnClick", function(self, button, down)
    local enabled=DPMcheckbox:GetChecked()
    CBoxClick(self,button,enabled)
  end)

  DPMcheckbox:SetFrameLevel(5)

  DPMcheckbox:SetScript("OnShow", function(self)
  if(name=="DPMcheckbox0") then
    if(DPMdisable==1) then 
      DPMcheckbox:SetChecked(true) else DPMcheckbox:SetChecked(false) end
    end
  end)

  return DPMcheckbox
end
function RuneCreateScrollframe(name,x,y,parent,rto,rpoint,w1,h1,w2,h2)

if not(parent) then parent=UIParent end

  local SFrame = CreateFrame("ScrollFrame",name, parent, "UIPanelScrollFrameTemplate")
  local MSFrame = CreateFrame("Frame", name.."Child", SFrame)

  SFrame:SetScrollChild(MSFrame)
  SFrame:SetPoint(rpoint, parent, rto, x, y)

  MSFrame:SetPoint("TOPLEFT", name, "TOPLEFT", 0, 0)
  
  MSFrame:SetFrameLevel(4)
  SFrame:SetFrameLevel(4)
  SFrame:SetWidth(w1)  
  SFrame:SetHeight(h1) 

  MSFrame:SetWidth(w2)  
  MSFrame:SetHeight(h2) 

  SFrame:SetHorizontalScroll(0)
  SFrame:SetVerticalScroll(0)

  SFrame:SetBackdrop({bgFile="Interface\\DialogFrame\\UI-DialogBox-Background", edgeFile="", tile = false, tileSize = 0, edgeSize = 0, insets = { left = 0, right = 0, top = 0, bottom = 0 }})
  SFrame:EnableMouse(true)
  
  SFrame:Show()
  MSFrame:Show()

  return MSFrame
end
function RuneAddTooltip(frame,title,content)
  local function TooltipOnEnter(self,title,content)  
   GameTooltip:SetOwner(self, "ANCHOR_NAME")  
    GameTooltip:SetPoint("BOTTOMLEFT",GameTooltip:GetOwner(),"TOPRIGHT",0,10)
    GameTooltip:SetText(tostring(title))  -- This sets the top line of text, in gold.  
    GameTooltip:AddLine(tostring(content), 1, 1, 1)  
    GameTooltip:SetAnchorType("ANCHOR_TOPLEFT", GameTooltip:GetOwner():GetWidth(),0)  
    GameTooltip:Show() 
  end
  local function TooltipOnLeave(self)  
    GameTooltip:Hide() 
  end 
  frame:SetScript("OnEnter", function() TooltipOnEnter(frame,title,content) end)
  frame:SetScript("OnLeave", function() TooltipOnLeave(frame) end)
end
function RuneEBSetText(EB,text)
  EB:ClearFocus()
  EB:SetText(tostring(text))
  EB:ClearFocus()
  EB:SetText(tostring(text))
  EB:SetCursorPosition(0);
  EB:ClearFocus()
end
--////////////////////////Create Rune Functions\\\\\\\\\\\\\\\\\\\\\\\\\
function DPMResetDPMTable()
  local table = {
	["Warrior"] = {
		["Other"] = {"1","1","0","1","0","1","1","1","0","1","1","0"},
		["Spell"] = {"Retaliation","Bladestorm","Mortal Strike","Disarm","Shield Block","Shield Wall","Berserker Rage","Recklessness","Spell Reflection","Enraged Regeneration","Death Wish","Sudden Death"}, 
		["Tip"] = {"Counter-Attack","DANGER! immune to stun","-50% healing taken","Disarm","+100% block","-75% dmg taken","Immune to fear, sap and incapactate","+20% dmg taken, 100% crit","Spell reflection","Heals 30% hp over 10sec","+20% dmg","1 Execute"},
		["Check"] = {"0","0","1","1","0","0","0","0","0","0","0","1"},
		["Group"] = {"0","0","1","1","0","0","0","0","0","0","0","0"},
		["TargetFriend"] = {"0","0","1","1","0","0","0","0","1","0","0","0"},
		["TargetOther"] = {"1","1","0","1","1","1","1","1","1","1","1","1"},
		["DT"] = {"3,15","3,6","2,10","1,10","3,10","3,10","3,10","3,15","2,5","2,10","3,30","3,10"},},
	["Paladin"] = {		
		["Other"] = {"1","0","0","1","1","1","1",},
		["Spell"] = {"Hand of Protection","Hand of Freedom","Holy Shield","Aura Mastery","Avenging Wrath","Divine Shield","Divine Protection",},
		["Tip"] = {"Immune to physical dmg","Immune to slow","+30% block","Immune to stun/fear/silence","+20% dmg/healing","Immune to dmg","-50% dmg taken",},
		["Check"] = {"1","1","0","1","1","0","1",},
		["Group"] = {"0","0","0","0","0","1","0",},
		["TargetFriend"] = {"0","0","0","0","1","1","0",},
		["TargetOther"] = {"1","1","1","1","1","1","1",},		
		["DT"] = {"3,10","2,10","2,10","3,10","2,20","2,12","2,12",},},
	["Shaman"] = {		
		["Other"] = {"1",},		
		["Spell"] = {"Elemental Mastery",},
		["Tip"] = {"100% crit",},
		["Check"] = {"0",},
		["Group"] = {"0",},
		["TargetFriend"] = {"0",},
		["TargetOther"] = {"1",},
		["DT"] = {"2,0",},},
	["Rogue"] = {
		["Other"] = {"1","1","1","1","0","1",},
		["Spell"] = {"Evasion","Dismantle","Cloak of Shadows","Cold Blood","Riposte","Blind",},
		["Tip"] = {"+50% dodge","Disarm","+90% resist","+100% crit","Disarm","CC",},
		["Check"] = {"0","1","0","0","1","1",},
		["Group"] = {"0","1","1","0","1","1",},
		["TargetFriend"] = {"1","1","1","0","1","1",},
		["TargetOther"] = {"1","1","1","1","1","1",},
		["DT"] = {"3,15","2,10","3,5","2,0","2,6","2,10",},	},
	["Mage"] = {
		["Other"] = {"1","1","1",},
		["Spell"] = {"Ice Block","Presence of Mind","Arcane Power",},
		["Tip"] = {"Immune to dmg","Instant spell","+30% dmg",},
		["Check"] = {"0","0","0",},
		["Group"] = {"0","0","0",},
		["TargetFriend"] = {"0","0","0",},
		["TargetOther"] = {"1","1","1",},
		["DT"] = {"3,10","2,0","2,15",},},
	["Druid"] = {
		["Other"] = {"0","1","0",},
		["Spell"] = {"Cyclone","Starfall","Barskin",},
		["Tip"] = {"CC","Aoe","-20% dmg taken",},
		["Check"] = {"1","0","0",},
		["Group"] = {"1","0","0",},
		["TargetFriend"] = {"1","0","0",},
		["TargetOther"] = {"1","1","1",},
		["DT"] = {"3,2","3,10","3,12",},	},
	["Deathknight"] = {
		["Other"] = {"1","1","1","1",},
		["Spell"] = {"Dancing Rune Weapon","Icebound Fortitude","Mark of Blood","Lichborne",},
		["Tip"] = {"Extra Deathknight","Immune to stun, -50% dmg taken","DANGER! +4% hp when you attack","Immune to charm/fear/sleep",},
		["Check"] = {"0","0","1","0",},
		["Group"] = {"0","0","1","0",},
		["TargetFriend"] = {"0","0","1","0",},
		["TargetOther"] = {"1","1","1","1",},
		["DT"] = {"3,12","3,12","3,20","2,10",},	},
	["Priest"] = {
		["Other"] = {"1","1","1","0",},
		["Spell"] = {"Power Infusion","Pain Suppression","Dispersion","Psychic Horror",},
		["Tip"] = {"+20% spell haste","-40% dmg taken","-90% dmg taken","Disarm",},
		["Check"] = {"0","0","0","1",},
		["Group"] = {"0","0","0","1",},
		["TargetFriend"] = {"0","0","0","1",},
		["TargetOther"] = {"1","1","1","1",},
		["DT"] = {"2,15","2,8","3,6","2,10",},},
	["Hunter"] = {
		["Other"] = {"0","1","1","1",},
		["Spell"] = {"Disengage","Deterrence","Feign Death","Bestrial Wrath",},
		["Tip"] = {"13yd away, cd:","+25% dodge change","Cheating!","+50% dmg, immune to cc",},
		["Check"] = {"0","0","0","0",},
		["Group"] = {"0","0","0","0",},
		["TargetFriend"] = {"0","0","0","0",},
		["TargetOther"] = {"1","1","1","1",},
		["DT"] = {"3,30","3,10","3,0","3,18",},},
	["Warlock"] = {
		["Other"] = {"1",},
		["Spell"] = {"Metamorphosis",},
		["Tip"] = {"+600% armor, +20% dmg, -50% cc",},
		["Check"] = {"0",},
		["Group"] = {"0",},
		["TargetFriend"] = {"0",},
		["TargetOther"] = {"1",},
		["DT"] = {"3,30",},},
	["Other"] = {
		["Other"] = {},
		["Spell"] = {},
		["Tip"] = {},
		["Check"] = {},
		["Group"] = {},
		["TargetFriend"] = {},
		["TargetOther"] = {},
		["DT"] = {},},
	}
  return table
end
function DPMResetSettingsTable()
local table = {
  ["Disable"]={0},
  ["DisableWNIC"]={0},
  ["DBMBars"]={1},
  ["SoundWarning"]={0},
  ["ColorCode"]={1},
  ["Broadcast"]={
    ["Broadcast"]={0},
	["PARTY"]={0},
	["BATTLEGROUND"]={0},
	["RAID"]={0},
	["GUILD"]={0},
	["RAID_WARNING"]={0}},
  ["EnableWhen"]={
    ["EnableWhen"]={0},
	["Arena"]={0},
	["Battleground"]={0}},
  ["TargetF"]={1},
  ["TargetO"]={1},
  ["Self"]={1},
  ["Group"]={1},
  ["Other"]={1}
}

return table
end
function DPMDT(table)
  local danger,timer = strsplit(",",table, 2)
 return danger,timer
end
function DPMGetDangerLevel(danger)
  local DPM_dtext = ""
  danger = tonumber(danger)
  if(danger==1) then DPM_dtext="Not dangerous"
  elseif(danger==2) then DPM_dtext="Dangerous"
  else DPM_dtext="Very dangerous" end
  return DPM_dtext
end
function DPMGetDangerLevelText(danger)
  local DPM_dtext = 1
  if(danger=="Not dangerous") then DPM_dtext=1
  elseif(danger=="Dangerous") then DPM_dtext=2
  else DPM_dtext=3 end
  return DPM_dtext
end
function DPMprint(text,r,g,b)
  ChatFrame1:AddMessage(tostring(text),r,g,b)
end

function DPMSplitServer(name)
	if not(tostring(name)=="nil") then
		local a, b = strsplit("-", name, 2)
		name=a
	end
	return name
end

function DPMDBMFrame(timer, id, icon, huge, small)
--/run print(DPMDBMFrame(10,"hejsa"))
--[[
local name1, level1, class1, loc1, connected1, status1 = GetFriendInfo(1)
if(tostring(name1)=="nil") then name1="Zagorm" end
local name2, level2, class2, loc2, connected2, status2 = GetFriendInfo(2)
if(tostring(name2)=="nil") then name1="Zandrak" end

local SpellLink = GetSpellLink(5)
local _,_,SpellIcon = GetSpellInfo(5)

DBMFrame(10, ""..name1.." -> "..SpellLink,SpellIcon, false) 
 --DBMFrame(10, "Boom!", icon, huge, 
 ]]
  --DBM.Bars:CreateBar(10, "Test 1", "Interface\\Icons\\Spell_Nature_WispSplode")
  --DBM.Bars:CreateBar(10, "Test 1", "Interface\\Icons\\Spell_Nature_WispSplode",1,0,1982937,0)
  --DBM.Bars:CreateBar(8, "Test 2", "Interface\\Icons\\Spell_Nature_WispSplode",0,1,1982937,0)
	if(DPM_settings["DBMBars"][1]==1) then
		Bar = DBM.Bars:CreateBar(timer, tostring(id), tostring(icon),huge)
	end
	return Bar
end
function DPMDBMInform(icon,text,time,danger)
	if(time==0) then
		time = 0 
	end 
	if(danger==false) then
		local SoundHolder = DBM.Options.RaidWarningSound 
		if(DPM_settings["SoundWarning"][1]==1) then
			DBM.Options.RaidWarningSound = ""
		end
		testWarning1 = Inform:NewAnnounce("%s", 1, tostring(icon))
		if not(time==0) then 
			testWarning1:Schedule(time, text) 
		else 
			testWarning1:Show(text)
		end
		DBM.Options.RaidWarningSound = SoundHolder
	else
		local SoundHolder = DBM.Options.SpecialWarningSound
		if(DPM_settings["SoundWarning"][1]==1) then
			DBM.Options.SpecialWarningSound = ""
		end
		testSpecialWarning = Inform:NewSpecialWarning("%s")
		if not(time==0) then 
			testSpecialWarning:Schedule(time, text) 
		else 
			testSpecialWarning:Show(text)
		end
		DBM.Options.SpecialWarningSound = SoundHolder
	end
end

function DPMTestDBM(testlevel)
  local name1, level1, class1, loc1, connected1, status1 = GetFriendInfo(3)
  if(tostring(name1)=="nil") then name1="Zagorm" end
  local name2, level2, class2, loc2, connected2, status2 = GetFriendInfo(2)
  if(tostring(name2)=="nil") then name2="Zandrak" end
    local name3, level3, class3, loc3, connected3, status3 = GetFriendInfo(1)
  if(tostring(name2)=="nil") then name2="Fenros" end

  local SpellLink3 = GetSpellLink(46924)
  local _,_,SpellIcon3 = GetSpellInfo(46924)
  local SpellLink2 = GetSpellLink(642)
  local _,_,SpellIcon2 = GetSpellInfo(642)
    local SpellLink1 = GetSpellLink(20928)
  local _,_,SpellIcon1 = GetSpellInfo(20928)
  
  if(testlevel==3) then
    DPMDBMFrame(6, ""..name3.." -> "..SpellLink3,SpellIcon3, false) 
    DPMDBMInform(SpellIcon,""..DPM_TextEnemy..name3..DPM_TextEnd.." -> "..SpellLink3.." (DANGER! immune to stun)",0,true)
    DPMprint(""..DPM_TextDPM.." "..DPM_TextEnemy..""..name3..""..DPM_TextEnd.." \124cbc33cbc3-> "..SpellLink3.." \124cbc33cbc3(DANGER! immunne to stun)\124h\124r")
  elseif(testlevel==2) then
    DPMDBMFrame(12, ""..name2.." -> "..SpellLink2,SpellIcon2, false) 
    DPMDBMInform(SpellIcon2,""..DPM_TextEnemy..name2..DPM_TextEnd.." -> "..SpellLink2.." (Immune to dmg)",0,false)
  elseif(testlevel==1) then
    DPMDBMFrame(10, ""..name1.." -> "..SpellLink1,SpellIcon1, false) 
  end
end
function DPMDBMAddText(text,prefix)
  if not(prefix) then prefix = "DPM" end
  DBM:AddMsg(text,prefix)
end
--[[||||||||||||||||||||||Function LoadAdjustAuras||||||||||||||||||||||||||||||]]--
function LoadAdjustAuras()
--[[||||||||||||||||||||||Reset DPM Table||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Reset DPM Table||||||||||||||||||||||||||||||]]--
if(DPM_table==nil) then
  DPM_table = DPMResetDPMTable()
end

if(DPM_settings==nil) then
  DPM_settings = DPMResetSettingsTable()
end
  
--[[||||||||||||||||||||||Reset DPM Table||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Reset DPM Table||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Frames||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Frames||||||||||||||||||||||||||||||]]--

DPM_AFrame = RuneCreateFrame("DPM_AFrame",0,0,nil,210,325,true,true)
tinsert(UISpecialFrames,"DPM_AFrame");
DPM_AdjustTittleFrame = RuneCreateFrame("DPM_AdjustTittleFrame",-85.5,175,DPM_AFrame,381,50,false,false,"BOTTOM","TOP")

SFFrame = RuneCreateFrame("SFFrame",-185,0,DPM_AFrame,185,325,false,false,"TOPLEFT","TOPRIGHT")
SFrame = RuneCreateScrollframe("STest",-35,-12,SFFrame,"TOPRIGHT","TOPRIGHT",145,303,100,50)

EB_Name = RuneCreateEditbox("EditBoxName",0,-100,DPM_AFrame,"TOP","TOP")
EB_Tip = RuneCreateEditbox("EditBoxTip",0,-125,DPM_AFrame,"TOP","TOP")
EB_Timer = RuneCreateEditbox("EditBoxTimer",0,-150,DPM_AFrame,"TOP","TOP")
EB_Danger = RuneCreateEditbox("EditBoxDanger",0,-175,DPM_AFrame,"TOP","TOP")
EB_Timer:SetNumeric()
EB_Timer:SetMaxLetters(3)
EB_Danger:SetFrameLevel(3)

DPM_T, DPM_TF = RuneCreateText("TitleController","",0,-65,DPM_AFrame,300,50,"TOP","TOP",false,true,"CENTER", function(localT,localTF,a1,a2,a3,a4) end)

RuneCreateText("Adjust","Adjust Auras",10,-10,DPM_AdjustTittleFrame,300,25,"TOP","TOP",false,true,"CENTER")
RuneCreateText("Class","Class:",20,-15,DPM_AFrame,300,25,"TOPlEFT","TOPlEFT",false,false,"LEFT")
RuneCreateText("Name","Name:",20,-100,DPM_AFrame,300,25,"TOPlEFT","TOPlEFT",false,false,"LEFT")
RuneCreateText("Tip","Tip:",20,-125,DPM_AFrame,300,25,"TOPlEFT","TOPlEFT",false,false,"LEFT")
RuneCreateText("Timer","Timer:",20,-150,DPM_AFrame,300,25,"TOPlEFT","TOPlEFT",false,false,"LEFT")
RuneCreateText("Danger","Danger:",20,-175,DPM_AFrame,300,25,"TOPlEFT","TOPlEFT",false,false,"LEFT")

RuneCreateText("FTarget",""..DPM_TextFriend.."FTarget:"..DPM_TextEnd,20,-220,DPM_AFrame,300,25,"TOPlEFT","TOPlEFT",true,false,"LEFT")
RuneCreateText("OTarget",""..DPM_TextEnemy.."OTarget:"..DPM_TextEnd,34,-220,DPM_AFrame,300,25,"TOP","TOP",true)
RuneCreateText("Self",""..DPM_TextFriend.."Self:"..DPM_TextEnd,20,-240,DPM_AFrame,300,25,"TOPlEFT","TOPlEFT",true,false,"LEFT")
RuneCreateText("CGroup",""..DPM_TextFriend.."Group:"..DPM_TextEnd,-20,-240,DPM_AFrame,300,25,"TOP","TOP",true)
RuneCreateText("COther",""..DPM_TextEnemy.."Other:"..DPM_TextEnd,40,-240,DPM_AFrame,300,25,"TOP","TOP",true)

DPM_B_13 = RuneCreateButton("1/3","1/3",-55,-200,DPM_AFrame,50,25,"TOP","TOP",function() RuneEBSetText(EB_Danger,DPMGetDangerLevel(1)) end)
DPM_B_23 = RuneCreateButton("2/3","2/3",0,-200,DPM_AFrame,50,25,"TOP","TOP",function() RuneEBSetText(EB_Danger,DPMGetDangerLevel(2)) end)
DPM_B_33 = RuneCreateButton("3/3","3/3",55,-200,DPM_AFrame,50,25,"TOP","TOP",function() RuneEBSetText(EB_Danger,DPMGetDangerLevel(3)) end)

CB_TargetOther= RuneCreateCheckbox("CBoxTO",70,-220,DPM_AFrame,"TOP","TOP",25,25,1,function(self,button,down) end)
CB_TargetFriend= RuneCreateCheckbox("CBoxTF",-25,-220,DPM_AFrame,"TOP","TOP",25,25,1,function(self,button,down) end)
CB_Group = RuneCreateCheckbox("CBoxG",10,-240,DPM_AFrame,"TOP","TOP",25,25,1,function(self,button,down) end)
CB_Other = RuneCreateCheckbox("CBoxO",70,-240,DPM_AFrame,"TOP","TOP",25,25,1,function(self,button,down) end)
CB_Self = RuneCreateCheckbox("CBoxS",-49,-240,DPM_AFrame,"TOP","TOP",25,25,1,function(self,button,down) end)

RuneAddTooltip(EB_Name,"Name","This is the name of the aura.\n>>MAKE SURE YOU SPELL THE NAME CORRECT!<<")
RuneAddTooltip(EB_Tip,"Tip","This is the tip coming when someone gains the aura.")
RuneAddTooltip(EB_Timer,"Timer","When someone gains the aura a DBM-bar ticks\ndown from the amount of seconds selected here.")
RuneAddTooltip(DPM_B_13,"Dangerous (1/3)",'You wont be noticed with a "fake raidwarning".\nA DBM-bar is shown.')
RuneAddTooltip(DPM_B_23,"Dangerous (2/3)",'You will see a "fake raidwarning".\nA DBM-bar is shown.')
RuneAddTooltip(DPM_B_33,"Dangerous (3/3)",'You will see a "fake raidwarning".\nA sound will inform you.\nA DBM-bar is shown.')
RuneAddTooltip(CB_Self,"Check Self",'The aura will be checked if you gain it.')
RuneAddTooltip(CB_Group,"Check Group",'The aura will be checked when\nsomeone from your group/raid gains it.')
RuneAddTooltip(CB_Other,"Check Other",'The aura will be checked when someone who is not in your group/raid,\nis not your target and is not you, gains it.')
RuneAddTooltip(CB_TargetFriend,"Check Other Targets",'The aura will be checked when your friendly target gains it.')
RuneAddTooltip(CB_TargetOther,"Check Friendly Targets",'The aura will be checked when your target that is not in\nyour group/raid and is not you, gains it.')

DPM_SbT_Save = nil
DPM_SbT_Cancel = nil
DPM_SbT_DelAura = nil

function DPMSetFrameLevel(level)
  DPM_SbT_Cancel:SetFrameLevel(level)
  DPM_SbT_DelAura:SetFrameLevel(level)
  DPM_SbT_Save:SetFrameLevel(level)
  EB_Timer:SetFrameLevel(level)
  EB_Tip:SetFrameLevel(level)
  EB_Name:SetFrameLevel(level)
  DPM_B_13:SetFrameLevel(level)
  DPM_B_23:SetFrameLevel(level)
  DPM_B_33:SetFrameLevel(level)
  CB_Self:SetFrameLevel(level)
  CB_Group:SetFrameLevel(level)
  CB_Other:SetFrameLevel(level)
  CB_TargetOther:SetFrameLevel(level)
  CB_TargetFriend:SetFrameLevel(level)

  if(level==5) then

  end
  
  if(level==3) then
    CB_Group:SetChecked(false)	
	CB_TargetOther:SetChecked(false)	
    CB_TargetFriend:SetChecked(false)	
    CB_Other:SetChecked(false)	
    CB_Self:SetChecked(false)	
	RuneEBSetText(EB_Name,"") 
    RuneEBSetText(EB_Tip,"") 
    RuneEBSetText(EB_Timer,"") 
    RuneEBSetText(EB_Danger,"") 
    DPM_TF:SetText("_____") 
  end
end


--[[||||||||||||||||||||||Create Frames||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Frames||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Function Create Scroll Buttons||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Function Create Scroll Buttons||||||||||||||||||||||||||||||]]--
function CreateSButton(number)
  local B,BTF = nil
  B,BTF = RuneCreateButton(""..DPM_selectclass.." "..number,""..tostring(DPM_table[tostring(DPM_classes[DPM_selectclass])]["Spell"][number]),5,-(number-1)*18,SFrame,140,25,"TOPLEFT","TOPLEFT", function(self, button, down, font,name) 
  if not(tostring(tostring(DPM_table[tostring(DPM_classes[DPM_selectclass])]["Spell"][number]))=="nil") then
      local a1,b1 = strsplit(" ",name,2)
      name=tonumber(b1)
      local class = tonumber(DPM_selectclass)
       
      RuneEBSetText(EB_Name,DPM_table[tostring(DPM_classes[class])]["Spell"][name])
      DPM_TF:SetText(DPM_table[tostring(DPM_classes[class])]["Spell"][name])
      RuneEBSetText(EB_Tip,DPM_table[tostring(DPM_classes[class])]["Tip"][name])
      local danger,timer = DPMDT(DPM_table[tostring(DPM_classes[class])]["DT"][name])
      RuneEBSetText(EB_Timer,timer)
      RuneEBSetText(EB_Danger,DPMGetDangerLevel(danger))

      DPMSetFrameLevel(5)
	  
	  if(tonumber(DPM_table[tostring(DPM_classes[class])]["Group"][name])==1) then CB_Group:SetChecked(true) else CB_Group:SetChecked(false) end
      if(tonumber(DPM_table[tostring(DPM_classes[class])]["Other"][name])==1) then CB_Other:SetChecked(true) else CB_Other:SetChecked(false) end
      if(tonumber(DPM_table[tostring(DPM_classes[class])]["Check"][name])==1) then CB_Self:SetChecked(true) else CB_Self:SetChecked(false) end
	  if(tonumber(DPM_table[tostring(DPM_classes[class])]["TargetOther"][name])==1) then CB_TargetOther:SetChecked(true) else CB_TargetOther:SetChecked(false) end
	  if(tonumber(DPM_table[tostring(DPM_classes[class])]["TargetFriend"][name])==1) then CB_TargetFriend:SetChecked(true) else CB_TargetFriend:SetChecked(false) end
	else
      DPMSetFrameLevel(3)
  end

  DPM_selectspell = tonumber(name)
  end)
   
  if(BTF:GetText()=="nil") then
    B:Hide()
  end
   
  return B,BTF
end
--[[||||||||||||||||||||||Function Create Scroll Buttons||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Function Create Scroll Buttons||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Scroll Buttons||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Scroll Buttons||||||||||||||||||||||||||||||]]--
DPM_Sb1, DPM_Sbtf1 = CreateSButton(1)
DPM_Sb2, DPM_Sbtf2 = CreateSButton(2)
DPM_Sb3, DPM_Sbtf3 = CreateSButton(3)
DPM_Sb4, DPM_Sbtf4 = CreateSButton(4)
DPM_Sb5, DPM_Sbtf5 = CreateSButton(5)
DPM_Sb6, DPM_Sbtf6 = CreateSButton(6)
DPM_Sb7, DPM_Sbtf7 = CreateSButton(7)
DPM_Sb8, DPM_Sbtf8 = CreateSButton(8)
DPM_Sb9, DPM_Sbtf9 = CreateSButton(9)
DPM_Sb10, DPM_Sbtf10 = CreateSButton(10)
DPM_Sb11, DPM_Sbtf11 = CreateSButton(11)
DPM_Sb12, DPM_Sbtf12 = CreateSButton(12)
DPM_Sb13, DPM_Sbtf13 = CreateSButton(13)
DPM_Sb14, DPM_Sbtf14 = CreateSButton(14)
DPM_Sb15, DPM_Sbtf15 = CreateSButton(15)
DPM_Sb16, DPM_Sbtf16 = CreateSButton(16)
DPM_Sb17, DPM_Sbtf17 = CreateSButton(17)
DPM_Sb18, DPM_Sbtf18 = CreateSButton(18)
DPM_Sb19, DPM_Sbtf19 = CreateSButton(19)
DPM_Sb20, DPM_Sbtf20 = CreateSButton(20)
DPM_Sb21, DPM_Sbtf21 = CreateSButton(21)
DPM_Sb22, DPM_Sbtf22 = CreateSButton(22)
DPM_Sb23, DPM_Sbtf23 = CreateSButton(23)
DPM_Sb24, DPM_Sbtf24 = CreateSButton(24)
DPM_Sb25, DPM_Sbtf25 = CreateSButton(25)
DPM_Sb26, DPM_Sbtf26 = CreateSButton(26)
DPM_Sb27, DPM_Sbtf27 = CreateSButton(27)
DPM_Sb28, DPM_Sbtf28 = CreateSButton(28)
DPM_Sb29, DPM_Sbtf29 = CreateSButton(29)
DPM_Sb30, DPM_Sbtf30 = CreateSButton(30)
DPM_Sb31, DPM_Sbtf31 = CreateSButton(31)
DPM_Sb32, DPM_Sbtf32 = CreateSButton(32)
DPM_Sb33, DPM_Sbtf33 = CreateSButton(33)
DPM_Sb34, DPM_Sbtf34 = CreateSButton(34)
DPM_Sb35, DPM_Sbtf35 = CreateSButton(35)
DPM_Sb36, DPM_Sbtf36 = CreateSButton(36)
DPM_Sb37, DPM_Sbtf37 = CreateSButton(37)
DPM_Sb38, DPM_Sbtf38 = CreateSButton(38)
DPM_Sb39, DPM_Sbtf39 = CreateSButton(39)
DPM_Sb40, DPM_Sbtf40 = CreateSButton(40)
--[[||||||||||||||||||||||Create Scroll Buttons||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Scroll Buttons||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Function Return SlideButton||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Function Return SlideButton||||||||||||||||||||||||||||||]]--
function FindSlideButton(number)
  local DPM_BTF=nil
  local DPM_B=nil
  if(number==1) then DPM_BTF=DPM_Sbtf1 DPM_B = DPM_Sb1
  elseif(number==2) then DPM_BTF=DPM_Sbtf2 DPM_B = DPM_Sb2
  elseif(number==3) then DPM_BTF=DPM_Sbtf3 DPM_B = DPM_Sb3
  elseif(number==4) then DPM_BTF=DPM_Sbtf4 DPM_B = DPM_Sb4
  elseif(number==5) then DPM_BTF=DPM_Sbtf5 DPM_B = DPM_Sb5
  elseif(number==6) then DPM_BTF=DPM_Sbtf6 DPM_B = DPM_Sb6
  elseif(number==7) then DPM_BTF=DPM_Sbtf7 DPM_B = DPM_Sb7
  elseif(number==8) then DPM_BTF=DPM_Sbtf8 DPM_B = DPM_Sb8
  elseif(number==9) then DPM_BTF=DPM_Sbtf9 DPM_B = DPM_Sb9
  elseif(number==10) then DPM_BTF=DPM_Sbtf10 DPM_B = DPM_Sb10
  elseif(number==11) then DPM_BTF=DPM_Sbtf11 DPM_B = DPM_Sb11
  elseif(number==12) then DPM_BTF=DPM_Sbtf12 DPM_B = DPM_Sb12
  elseif(number==13) then DPM_BTF=DPM_Sbtf13 DPM_B = DPM_Sb13
  elseif(number==14) then DPM_BTF=DPM_Sbtf14 DPM_B = DPM_Sb14
  elseif(number==15) then DPM_BTF=DPM_Sbtf15 DPM_B = DPM_Sb15
  elseif(number==16) then DPM_BTF=DPM_Sbtf16 DPM_B = DPM_Sb16
  elseif(number==17) then DPM_BTF=DPM_Sbtf17 DPM_B = DPM_Sb17
  elseif(number==18) then DPM_BTF=DPM_Sbtf18 DPM_B = DPM_Sb18
  elseif(number==19) then DPM_BTF=DPM_Sbtf19 DPM_B = DPM_Sb19
  elseif(number==20) then DPM_BTF=DPM_Sbtf20 DPM_B = DPM_Sb20
  elseif(number==21) then DPM_BTF=DPM_Sbtf21 DPM_B = DPM_Sb21
  elseif(number==22) then DPM_BTF=DPM_Sbtf22 DPM_B = DPM_Sb22
  elseif(number==23) then DPM_BTF=DPM_Sbtf23 DPM_B = DPM_Sb23
  elseif(number==24) then DPM_BTF=DPM_Sbtf24 DPM_B = DPM_Sb24
  elseif(number==25) then DPM_BTF=DPM_Sbtf25 DPM_B = DPM_Sb25
  elseif(number==26) then DPM_BTF=DPM_Sbtf26 DPM_B = DPM_Sb26
  elseif(number==27) then DPM_BTF=DPM_Sbtf27 DPM_B = DPM_Sb27
  elseif(number==28) then DPM_BTF=DPM_Sbtf28 DPM_B = DPM_Sb28
  elseif(number==29) then DPM_BTF=DPM_Sbtf29 DPM_B = DPM_Sb29
  elseif(number==30) then DPM_BTF=DPM_Sbtf30 DPM_B = DPM_Sb30
  elseif(number==31) then DPM_BTF=DPM_Sbtf31 DPM_B = DPM_Sb31
  elseif(number==32) then DPM_BTF=DPM_Sbtf32 DPM_B = DPM_Sb32
  elseif(number==33) then DPM_BTF=DPM_Sbtf33 DPM_B = DPM_Sb33
  elseif(number==34) then DPM_BTF=DPM_Sbtf34 DPM_B = DPM_Sb34
  elseif(number==35) then DPM_BTF=DPM_Sbtf35 DPM_B = DPM_Sb35
  elseif(number==36) then DPM_BTF=DPM_Sbtf36 DPM_B = DPM_Sb36
  elseif(number==37) then DPM_BTF=DPM_Sbtf37 DPM_B = DPM_Sb37
  elseif(number==38) then DPM_BTF=DPM_Sbtf38 DPM_B = DPM_Sb38
  elseif(number==39) then DPM_BTF=DPM_Sbtf39 DPM_B = DPM_Sb39
  elseif(number==40) then DPM_BTF=DPM_Sbtf40 DPM_B = DPM_Sb40
  end

  return DPM_B,DPM_BTF
end
--[[||||||||||||||||||||||Function Return SlideButton||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Function Return SlideButton||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Function Refresh Slidebuttons||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Function Refresh Slidebuttons||||||||||||||||||||||||||||||]]--
function DPMBrefresh(number)
  local DPM_BTF=nil
  local DPM_B=nil
  DPM_B,DPM_BTF = FindSlideButton(number)
  if(DPM_B) then
  DPM_BTF:SetText(tostring(DPM_table[tostring(DPM_classes[DPM_selectclass])]["Spell"][number]))

  local Danger,Timer = DPMDT(tostring(DPM_table[tostring(DPM_classes[DPM_selectclass])]["DT"][number]))
  RuneAddTooltip(DPM_B,tostring(DPM_table[tostring(DPM_classes[DPM_selectclass])]["Spell"][number]),"Tip: "..tostring(DPM_table[tostring(DPM_classes[DPM_selectclass])]["Tip"][number]).."\nDanger: "..DPMGetDangerLevel(Danger).."\nTimer: "..tostring(Timer))
  if(DPM_BTF:GetText()=="nil") then
  DPM_B:Hide()
  else
  DPM_B:Show()
  end
  end
end
--[[||||||||||||||||||||||Function Refresh Slidebuttons||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Function Refresh Slidebuttons||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Button NewAura||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Button NewAura||||||||||||||||||||||||||||||]]--
DPM_SbT_NewAura = RuneCreateButton("AddNewAura","New Aura",-40,-50,DPM_AFrame,80,25,"TOP","TOP",function()
  if(tostring(DPM_Sbtf40:GetText())=="nil") then 

  local place=getn(DPM_table[tostring(DPM_classes[DPM_selectclass])]["Spell"])+1
  place=1
  DPM_newauranumber=DPM_newauranumber+1

  tinsert(DPM_table[tostring(DPM_classes[DPM_selectclass])]["Spell"], place, "Aura Name "..tostring(DPM_newauranumber))
  tinsert(DPM_table[tostring(DPM_classes[DPM_selectclass])]["Tip"], place, "Tip Here")
  tinsert(DPM_table[tostring(DPM_classes[DPM_selectclass])]["DT"], place, "2,0")
  tinsert(DPM_table[tostring(DPM_classes[DPM_selectclass])]["Check"], place, "1")
  tinsert(DPM_table[tostring(DPM_classes[DPM_selectclass])]["Other"], place, "1")
  tinsert(DPM_table[tostring(DPM_classes[DPM_selectclass])]["Group"], place, "1")
  tinsert(DPM_table[tostring(DPM_classes[DPM_selectclass])]["TargetOther"], place, "1")
  tinsert(DPM_table[tostring(DPM_classes[DPM_selectclass])]["TargetFriend"], place, "1")

  for a=1,41 do DPMBrefresh(a) end
  DPM_Sb1:Click() 

  else 
  DPMDBMAddText("You have added to many spells already","Ajust Auras") 
  end 
end)
--[[||||||||||||||||||||||Create Button NewAura||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Button NewAura||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Button DelAura||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Button DelAura||||||||||||||||||||||||||||||]]--
DPM_SbT_DelAura = RuneCreateButton("DelAura","Delete Aura",40,-50,DPM_AFrame,80,25,"TOP","TOP", function() 
  if not(tostring(DPM_Sbtf1:GetText())=="nil") then 

  local tnumber=getn(DPM_table[tostring(DPM_classes[DPM_selectclass])]["Spell"])+1
  if(tostring(DPM_selectspell)=="nil") then place=1 end
  tremove(DPM_table[tostring(DPM_classes[DPM_selectclass])]["Spell"], DPM_selectspell) 
  tremove(DPM_table[tostring(DPM_classes[DPM_selectclass])]["Tip"], DPM_selectspell) 
  tremove(DPM_table[tostring(DPM_classes[DPM_selectclass])]["DT"], DPM_selectspell) 
  tremove(DPM_table[tostring(DPM_classes[DPM_selectclass])]["Check"], DPM_selectspell) 
  tremove(DPM_table[tostring(DPM_classes[DPM_selectclass])]["Other"], DPM_selectspell) 
  tremove(DPM_table[tostring(DPM_classes[DPM_selectclass])]["Group"], DPM_selectspell) 
  tremove(DPM_table[tostring(DPM_classes[DPM_selectclass])]["TargetOther"], DPM_selectspell) 
  tremove(DPM_table[tostring(DPM_classes[DPM_selectclass])]["TargetFriend"], DPM_selectspell) 
  for a=1,41 do DPMBrefresh(a) end 
  local DPM_B,DPM_BTF = nil
  local place = DPM_selectspell
  if(DPM_selectspell==1) then place = DPM_selectspell elseif(DPM_selectspell+1==tnumber) then place = DPM_selectspell-1 else place = DPM_selectspell end
  DPM_B,DPM_BTF = FindSlideButton(place)
  DPM_B:Click() 
  else
  DPMDBMAddText("You dont have any spells to delete","Adjust Auras")
  end
end)
--[[||||||||||||||||||||||Create Button DelAura||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Button DelAura||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Button CancelAura||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Button CancelAura||||||||||||||||||||||||||||||]]--
DPM_SbT_Cancel = RuneCreateButton("Cancel","Cancel",-40,-270,DPM_AFrame,80,25,"TOP","TOP",function() 
  local place = DPM_selectspell
  DPM_B,DPM_BTF = FindSlideButton(place)
  DPM_B:Click() 
end)
--[[||||||||||||||||||||||Create Button CancelAura||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Button CancelAura||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Button CloseAura||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Button CloseAura||||||||||||||||||||||||||||||]]--
DPM_SbT_Close = RuneCreateButton("Close","Close",0,-290,DPM_AFrame,120,25,"TOP","TOP",function()  DPM_AFrame:Hide() InterfaceOptionsFrame:Show() end)
--[[||||||||||||||||||||||Create Button CloseAura||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Button CloseAura||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Button SaveAura||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Button SaveAura||||||||||||||||||||||||||||||]]--
DPM_SbT_Save = RuneCreateButton("Save","Save",40,-270,DPM_AFrame,80,25,"TOP","TOP",function() 
  local place= DPM_selectspell
  local danger = DPMGetDangerLevelText(EB_Danger:GetText())

  local checkedC = CB_Self:GetChecked()
  local checkedO = CB_Other:GetChecked()
  local checkedG = CB_Group:GetChecked()
  local checkedTO = CB_TargetOther:GetChecked()
  local checkedTF = CB_TargetFriend:GetChecked()
  
  local name = EB_Name:GetText()
  local tip = EB_Tip:GetText()
  local timer = EB_Timer:GetText()

  if(checkedC==nil) then checkedC="0" else checkedC="1" end
  if(checkedO==nil) then checkedO="0" else checkedO="1" end
  if(checkedG==nil) then checkedG="0" else checkedG="1" end
  if(checkedTO==nil) then checkedTO="0" else checkedTO="1" end
  if(checkedTF==nil) then checkedTF="0" else checkedTF="1" end

  DPM_TF:SetText(name)
  DPM_table[tostring(DPM_classes[DPM_selectclass])]["Spell"][place]=tostring(name)
  DPM_table[tostring(DPM_classes[DPM_selectclass])]["Tip"][place]=tostring(tip)
  DPM_table[tostring(DPM_classes[DPM_selectclass])]["DT"][place]=""..tostring(danger)..","..tostring(timer)
  DPM_table[tostring(DPM_classes[DPM_selectclass])]["Check"][place]=checkedC
  DPM_table[tostring(DPM_classes[DPM_selectclass])]["Other"][place]=checkedO
  DPM_table[tostring(DPM_classes[DPM_selectclass])]["Group"][place]=checkedG
  DPM_table[tostring(DPM_classes[DPM_selectclass])]["TargetOther"][place]=checkedTO
  DPM_table[tostring(DPM_classes[DPM_selectclass])]["TargetFriend"][place]=checkedTF

  for a=1,41 do DPMBrefresh(a) end 
  DPMDBMAddText("Saving...","DPM-Aura Settings") 
end)
--[[||||||||||||||||||||||Create Button SaveAura||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Button SaveAura||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Button ResetAuras||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Button ResetAuras||||||||||||||||||||||||||||||]]--
--DPM_SbT_Reset = CreateButton("Reset","Reset",-60,-13,DPM_AFrame,40,25,"TOP","TOP",function() DPM_table = ResetDPMTable() for a=1,41 do Brefresh(a) end DPM_Sb1:Click() EBSetText(EB_Reset,"") end)
--EB_Reset:SetScript("OnTextChanged", function(self) if(strlower(EB_Reset:GetText())=="reset") then DPM_SbT_Reset:SetFrameLevel(5) else DPM_SbT_Reset:SetFrameLevel(3) end end)
--[[||||||||||||||||||||||Create Button ResetAuras||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create Button ResetAuras||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create DropDownMenu Class||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create DropDownMenu Class||||||||||||||||||||||||||||||]]--
local DPM_ComboClass=RuneCreateDropdownMenu("DPM_ComboClass",25,-15,DPM_AFrame,DPM_classes,"TOP","TOP", function(Id,Name,a1,number,a3,a4) DPM_selectclass = number DPM_Sb1:Click()  
  for a=1,41 do DPMBrefresh(a) end 
  DPM_Sb1:Click() 
end)
--[[||||||||||||||||||||||Create DropDownMenu Class||||||||||||||||||||||||||||||]]--
--[[||||||||||||||||||||||Create DropDownMenu Class||||||||||||||||||||||||||||||]]--

for a=1,41 do DPMBrefresh(a) end 
DPM_Sb1:Click() 

end
function LoadSettingsFrame()

DPM_MFrame = RuneCreateFrame("DPM_MFrame",0,0,nil,210,300,false,false)
DPM_MFrame:SetBackdrop({})
local DPM_Bnumber = 0

local cb1 = RuneCreateCheckbox("CBoxDisable",15,-40-(DPM_Bnumber*25),DPM_MFrame,"TOPLEFT","TOPLEFT",25,25,0,function(self,button,down) end)  DPM_Bnumber=DPM_Bnumber+1
local cb2 = RuneCreateCheckbox("CBoxDisableWNTIC",15,-40-(DPM_Bnumber*25),DPM_MFrame,"TOPLEFT","TOPLEFT",25,25,0,function(self,button,down) end)  DPM_Bnumber=DPM_Bnumber+1
local cb3 = RuneCreateCheckbox("CBoxUseDBMBars",15,-40-(DPM_Bnumber*25),DPM_MFrame,"TOPLEFT","TOPLEFT",25,25,0,function(self,button,down) end)  DPM_Bnumber=DPM_Bnumber+1
local cb4 = RuneCreateCheckbox("CBoxSoundWarning",15,-40-(DPM_Bnumber*25),DPM_MFrame,"TOPLEFT","TOPLEFT",25,25,0,function(self,button,down) end)  DPM_Bnumber=DPM_Bnumber+1
local cb5 = RuneCreateCheckbox("CBoxColorCode",15,-40-(DPM_Bnumber*25),DPM_MFrame,"TOPLEFT","TOPLEFT",25,25,0,function(self,button,down) end)  DPM_Bnumber=DPM_Bnumber+1
local cb6 = RuneCreateCheckbox("CBoxBCW",15,-40-(DPM_Bnumber*25),DPM_MFrame,"TOPLEFT","TOPLEFT",25,25,0,function(self,button,down) end)  DPM_Bnumber=DPM_Bnumber+1
local cb7 = RuneCreateCheckbox("CBoxParty",40,-40-(DPM_Bnumber*25),DPM_MFrame,"TOPLEFT","TOPLEFT",25,25,0,function(self,button,down) end) DPM_Bnumber=DPM_Bnumber+1
local cb8 = RuneCreateCheckbox("CBoxBG",40,-40-(DPM_Bnumber*25),DPM_MFrame,"TOPLEFT","TOPLEFT",25,25,0,function(self,button,down) end) DPM_Bnumber=DPM_Bnumber+1
local cb9 = RuneCreateCheckbox("CBoxRaid",40,-40-(DPM_Bnumber*25),DPM_MFrame,"TOPLEFT","TOPLEFT",25,25,0,function(self,button,down) end) DPM_Bnumber=DPM_Bnumber+1
local cb10 = RuneCreateCheckbox("CBoxGuild",40,-40-(DPM_Bnumber*25),DPM_MFrame,"TOPLEFT","TOPLEFT",25,25,0,function(self,button,down) end) DPM_Bnumber=DPM_Bnumber+1
local cb11 = RuneCreateCheckbox("CBoxRW",40,-40-(DPM_Bnumber*25),DPM_MFrame,"TOPLEFT","TOPLEFT",25,25,0,function(self,button,down)  end)
DPM_Bnumber = 0
local c2b1 = RuneCreateCheckbox("CBoxOEW",210,-40-(DPM_Bnumber*25),DPM_MFrame,"TOPLEFT","TOPLEFT",25,25,0,function(self,button,down) end) DPM_Bnumber=DPM_Bnumber+1
local c2b2 = RuneCreateCheckbox("CBoxArena",210+25,-40-(DPM_Bnumber*25),DPM_MFrame,"TOPLEFT","TOPLEFT",25,25,0,function(self,button,down) end) DPM_Bnumber=DPM_Bnumber+1
local c2b3 = RuneCreateCheckbox("CBoxBG",210+25,-40-(DPM_Bnumber*25),DPM_MFrame,"TOPLEFT","TOPLEFT",25,25,0,function(self,button,down) end) DPM_Bnumber=DPM_Bnumber+1
local c2b4_5 = RuneCreateCheckbox("CBoxTargetF",210,-40-(DPM_Bnumber*25),DPM_MFrame,"TOPLEFT","TOPLEFT",25,25,0,function(self,button,down) end) DPM_Bnumber=DPM_Bnumber+1
local c2b4 = RuneCreateCheckbox("CBoxTargetO",210,-40-(DPM_Bnumber*25),DPM_MFrame,"TOPLEFT","TOPLEFT",25,25,0,function(self,button,down) end) DPM_Bnumber=DPM_Bnumber+1
local c2b5 = RuneCreateCheckbox("CBoxSelf",210,-40-(DPM_Bnumber*25),DPM_MFrame,"TOPLEFT","TOPLEFT",25,25,0,function(self,button,down) end) DPM_Bnumber=DPM_Bnumber+1
local c2b6 = RuneCreateCheckbox("CBoxGroup",210,-40-(DPM_Bnumber*25),DPM_MFrame,"TOPLEFT","TOPLEFT",25,25,0,function(self,button,down) end) DPM_Bnumber=DPM_Bnumber+1
local c2b7 = RuneCreateCheckbox("CBoxOther",210,-40-(DPM_Bnumber*25),DPM_MFrame,"TOPLEFT","TOPLEFT",25,25,0,function(self,button,down) end) DPM_Bnumber=DPM_Bnumber+1

RuneCreateText("DeadlyPvpMods","Deadly Pvp Mods - version: "..DPM_versiontype.." "..DPM_version,10,-12,DPM_MFrame,300,25,"TOPLEFT","TOPLEFT",false,true) 
DPM_Bnumber = 0
RuneCreateText("DisableDPM","Disable DPM",-70,-40-(DPM_Bnumber*25),DPM_MFrame,300,25,"TOPLEFT","TOPLEFT",true)  DPM_Bnumber=DPM_Bnumber+1
RuneCreateText("DisableDPMWNIC","Disable DPM when\nnot in combat",-108,-40-(DPM_Bnumber*25),DPM_MFrame,300,25,"TOP","TOP",true)  DPM_Bnumber=DPM_Bnumber+1
RuneCreateText("UseDBMBars","Use DBM bars",-65,-40-(DPM_Bnumber*25),DPM_MFrame,300,25,"TOPLEFT","TOPLEFT",true)  DPM_Bnumber=DPM_Bnumber+1
RuneCreateText("Sound","Disable sound",-65,-40-(DPM_Bnumber*25),DPM_MFrame,300,25,"TOPLEFT","TOPLEFT",true)  DPM_Bnumber=DPM_Bnumber+1
RuneCreateText("ColorCode",'Use colorcode',-62,-40-(DPM_Bnumber*25),DPM_MFrame,300,25,"TOPLEFT","TOPLEFT",true)  DPM_Bnumber=DPM_Bnumber+1
RuneCreateText("Broadcastwarnings","Broadcast warnings to:",-39,-40-(DPM_Bnumber*25),DPM_MFrame,300,25,"TOPLEFT","TOPLEFT",false)  DPM_Bnumber=DPM_Bnumber+1
RuneCreateText("BCParty",'Party',-62,-40-(DPM_Bnumber*25),DPM_MFrame,300,25,"TOPLEFT","TOPLEFT",true) DPM_Bnumber=DPM_Bnumber+1
RuneCreateText("BCBG",'Battleground',-38.5,-40-(DPM_Bnumber*25),DPM_MFrame,300,25,"TOPLEFT","TOPLEFT",true) DPM_Bnumber=DPM_Bnumber+1
RuneCreateText("BCRaid",'Raid',-64.5,-40-(DPM_Bnumber*25),DPM_MFrame,300,25,"TOPLEFT","TOPLEFT",true) DPM_Bnumber=DPM_Bnumber+1
RuneCreateText("BCGuild",'Guild',-61.5,-40-(DPM_Bnumber*25),DPM_MFrame,300,25,"TOPLEFT","TOPLEFT",true) DPM_Bnumber=DPM_Bnumber+1
RuneCreateText("BCRW",'Raidwarning',-39.5,-40-(DPM_Bnumber*25),DPM_MFrame,300,25,"TOPLEFT","TOPLEFT",true) DPM_Bnumber=DPM_Bnumber+1
DPM_Bnumber = 0
RuneCreateText("OEW","Only enable DPM when:",-70+195+35,-40-(DPM_Bnumber*25),DPM_MFrame,300,25,"TOPLEFT","TOPLEFT",false) DPM_Bnumber=DPM_Bnumber+1
RuneCreateText("Arena","In Arena",-70+155,-40-(DPM_Bnumber*25),DPM_MFrame,300,25,"TOP","TOP",true) DPM_Bnumber=DPM_Bnumber+1
RuneCreateText("BG","In Battleground",-70+176,-40-(DPM_Bnumber*25),DPM_MFrame,300,25,"TOP","TOP",true) DPM_Bnumber=DPM_Bnumber+1
RuneCreateText("FTarget",DPM_TextFriend.."Check Ftargets auras gained"..DPM_TextEnd,-70+195+43,-40-(DPM_Bnumber*25),DPM_MFrame,300,25,"TOPLEFT","TOPLEFT",true) DPM_Bnumber=DPM_Bnumber+1
RuneCreateText("OTarget",DPM_TextEnemy.."Check Otargets auras gained"..DPM_TextEnd,-70+195+46,-40-(DPM_Bnumber*25),DPM_MFrame,300,25,"TOPLEFT","TOPLEFT",true) DPM_Bnumber=DPM_Bnumber+1
RuneCreateText("Self",DPM_TextFriend.."Check your auras gained"..DPM_TextEnd,-70+195+35,-40-(DPM_Bnumber*25),DPM_MFrame,300,25,"TOPLEFT","TOPLEFT",true) DPM_Bnumber=DPM_Bnumber+1
RuneCreateText("Group",DPM_TextFriend.."Check groups auras gained"..DPM_TextEnd,-70+195+42,-40-(DPM_Bnumber*25),DPM_MFrame,300,25,"TOPLEFT","TOPLEFT",true) DPM_Bnumber=DPM_Bnumber+1
RuneCreateText("Raid",DPM_TextEnemy.."Check other auras gained"..DPM_TextEnd,-70+195+37,-40-(DPM_Bnumber*25),DPM_MFrame,300,25,"TOPLEFT","TOPLEFT",true) DPM_Bnumber=DPM_Bnumber+1

function RefreshDPMSettings()
local cb = cb1 if(DPM_settings["Disable"][1]==1) then cb:SetChecked(true) else cb:SetChecked(false) end
local cb = cb2 if(DPM_settings["DisableWNIC"][1]==1) then cb:SetChecked(true) else cb:SetChecked(false) end
local cb = cb3 if(DPM_settings["DBMBars"][1]==1) then cb:SetChecked(true) else cb:SetChecked(false) end
local cb = cb4 if(DPM_settings["SoundWarning"][1]==1) then cb:SetChecked(true) else cb:SetChecked(false) end
local cb = cb5 if(DPM_settings["ColorCode"][1]==1) then cb:SetChecked(true) else cb:SetChecked(false) end
local cb = cb6 if(DPM_settings["Broadcast"]["Broadcast"][1]==1) then cb:SetChecked(true) else cb:SetChecked(false) end
local cb = cb7 if(DPM_settings["Broadcast"]["PARTY"][1]==1) then cb:SetChecked(true) else cb:SetChecked(false) end
local cb = cb8 if(DPM_settings["Broadcast"]["BATTLEGROUND"][1]==1) then cb:SetChecked(true) else cb:SetChecked(false) end
local cb = cb9 if(DPM_settings["Broadcast"]["RAID"][1]==1) then cb:SetChecked(true) else cb:SetChecked(false) end
local cb = cb10 if(DPM_settings["Broadcast"]["GUILD"][1]==1) then cb:SetChecked(true) else cb:SetChecked(false) end
local cb = cb11 if(DPM_settings["Broadcast"]["RAID_WARNING"][1]==1) then cb:SetChecked(true) else cb:SetChecked(false) end

local cb = c2b1 if(DPM_settings["EnableWhen"]["EnableWhen"][1]==1) then cb:SetChecked(true) else cb:SetChecked(false) end
local cb = c2b2 if(DPM_settings["EnableWhen"]["Arena"][1]==1) then cb:SetChecked(true) else cb:SetChecked(false) end
local cb = c2b3 if(DPM_settings["EnableWhen"]["Battleground"][1]==1) then cb:SetChecked(true) else cb:SetChecked(false) end
local cb = c2b4_5 if(DPM_settings["TargetF"][1]==1) then cb:SetChecked(true) else cb:SetChecked(false) end
local cb = c2b4 if(DPM_settings["TargetO"][1]==1) then cb:SetChecked(true) else cb:SetChecked(false) end
local cb = c2b5 if(DPM_settings["Self"][1]==1) then cb:SetChecked(true) else cb:SetChecked(false) end
local cb = c2b6 if(DPM_settings["Group"][1]==1) then cb:SetChecked(true) else cb:SetChecked(false) end
local cb = c2b7 if(DPM_settings["Other"][1]==1) then cb:SetChecked(true) else cb:SetChecked(false) end
end
function SaveDPMSettings()
local table = nil  
if(cb1:GetChecked()) then table=1 else table=0 end DPM_settings["Disable"][1] = table
if(cb2:GetChecked()) then table=1 else table=0 end DPM_settings["DisableWNIC"][1] = table
if(cb3:GetChecked()) then table=1 else table=0 end DPM_settings["DBMBars"][1] = table
if(cb4:GetChecked()) then table=1 else table=0 end DPM_settings["SoundWarning"][1] = table
if(cb5:GetChecked()) then table=1 else table=0 end DPM_settings["ColorCode"][1] = table
if(cb6:GetChecked()) then table=1 else table=0 end DPM_settings["Broadcast"]["Broadcast"][1]  = table
if(cb7:GetChecked()) then table=1 else table=0 end DPM_settings["Broadcast"]["PARTY"][1] = table
if(cb8:GetChecked()) then table=1 else table=0 end DPM_settings["Broadcast"]["BATTLEGROUND"][1]= table 
if(cb9:GetChecked()) then table=1 else table=0 end DPM_settings["Broadcast"]["RAID"][1] = table
if(cb10:GetChecked()) then table=1 else table=0 end DPM_settings["Broadcast"]["GUILD"][1] = table
if(cb11:GetChecked()) then table=1 else table=0 end DPM_settings["Broadcast"]["RAID_WARNING"][1] = table

if(c2b1:GetChecked()) then table=1 else table=0 end DPM_settings["EnableWhen"]["EnableWhen"][1] = table
if(c2b2:GetChecked()) then table=1 else table=0 end DPM_settings["EnableWhen"]["Arena"][1] = table
if(c2b3:GetChecked()) then table=1 else table=0 end DPM_settings["EnableWhen"]["Battleground"][1] = table
if(c2b4_5:GetChecked()) then table=1 else table=0 end DPM_settings["TargetF"][1] = table
if(c2b4:GetChecked()) then table=1 else table=0 end DPM_settings["TargetO"][1] = table
if(c2b5:GetChecked()) then table=1 else table=0 end DPM_settings["Self"][1] = table
if(c2b6:GetChecked()) then table=1 else table=0 end DPM_settings["Group"][1] = table
if(c2b7:GetChecked()) then table=1 else table=0 end DPM_settings["Other"][1] = table

end

StaticPopupDialogs["DPM_RESET_SETTINGS"] = {
  text = "Are you sure you want to reset DPM Settings?\n(This reset is not including aura settings.)",
  button1 = "Yes",
  button2 = "No",

  OnAccept = function()
    DPMDBMAddText("Resetting...","DPM-Settings")
    DPM_settings = DPMResetSettingsTable()
	RefreshDPMSettings()
  end,
  timeout = 0,
  whileDead = true,
  hideOnEscape = true,
}
StaticPopupDialogs["DPM_RESET_AURA_SETTINGS"] = {
  text = "Are you sure you want to reset DPM Aura Settings?\n(This will delete user-added auras).",
  button1 = "Yes",
  button2 = "No",

  OnAccept = function()
      DPMDBMAddText("Resetting...","DPM-Aura Settings") 
      DPM_table = DPMResetDPMTable() 
  end,
  timeout = 0,
  whileDead = true,
  hideOnEscape = true,
}

local b2 = RuneCreateButton("DPMReset","Reset Settings",15,-320,DPM_MFrame,150,35,"TOPLEFT","TOPLEFT",function() 
  StaticPopup_Show("DPM_RESET_SETTINGS")
end)
local b1 = RuneCreateButton("DPMCheckVersion","Version Check",15,-345,DPM_MFrame,150,35,"TOPLEFT","TOPLEFT",function() 
  DPMDBMAddText("Displaying Versions","DPM")
  SendAddonMessage("DPMcheck", DPM_version, "GUILD")
  SendAddonMessage("DPMcheck", DPM_version, "RAID")
end)

local b3 = RuneCreateButton("DPMResetAura","Reset Aura Settings",220,-320,DPM_MFrame,150,35,"TOPLEFT","TOPLEFT",function() 
  StaticPopup_Show("DPM_RESET_AURA_SETTINGS")
end)
local b4 = RuneCreateButton("DPMAdjust","Adjust Auras",220,-345,DPM_MFrame,150,35,"TOPLEFT","TOPLEFT",function() 
	DPMDBMAddText("Saving..","DPM-Settings")
	SaveDPMSettings()
	HideUIPanel(InterfaceOptionsFrame)
	HideUIPanel(GameMenuFrame)
	for a=1,41 do DPMBrefresh(a) end 
	DPM_Sb1:Click() 
	DPM_AFrame:Show()
end)

local b5 = RuneCreateButton("DPMTestDBM33","Test DBM-Bars 3/3",220+45,-395,DPM_MFrame,120,35,"TOPLEFT","TOPLEFT",function() 
  DPMTestDBM(3)
end)
local b6 = RuneCreateButton("DPMTestDBM23","Test DBM-Bars 2/3",220-120+45,-395,DPM_MFrame,120,35,"TOPLEFT","TOPLEFT",function() 
  DPMTestDBM(2)
end)
local b7 = RuneCreateButton("DPMTestDBM13","Test DBM-Bars 1/3",220-240+45,-395,DPM_MFrame,120,35,"TOPLEFT","TOPLEFT",function() 
  DPMTestDBM(1)
end)

RuneAddTooltip(cb1,"Disable DPM","Disable Deadly Pvp Mods")
  RuneAddTooltip(c2b1,"Only enable DPM when","Only enable DPM under certain conditions.")
RuneAddTooltip(cb2,"Disable DPM when not in combat","Disable Deadly Pvp Mods when\nyou are not in combat.")
  RuneAddTooltip(c2b2,"Arena","Only enable DPM in arena.")
RuneAddTooltip(cb3,"Use DBM bars","Use the Deadly Boss Mods bars")
  RuneAddTooltip(c2b3,"Battleground","Only enable DPM in battleground.")
RuneAddTooltip(cb4,"Disable Sound Warnings","Disable sound from this addon")
  RuneAddTooltip(c2b4_5,"Check targets activity","DPM will check all auras gained by your friendly target")
  RuneAddTooltip(c2b4,"Check targets activity","DPM will check all auras gained by your target if\nyour target is not in your group/raid and is not you.")
RuneAddTooltip(cb5,"Colorcode",'Use the color "Red" for enemy, and "Green" for friendly.')
  RuneAddTooltip(c2b5,"Check your activity","DPM will check all auras gained by you")
RuneAddTooltip(cb6,"Broadcast warnings","Broadcast the warnings from DPM to a channel.")
  RuneAddTooltip(c2b6,"Check group activity","DPM will check all auras gained by your group")
RuneAddTooltip(cb7,"Party","Broadcast warnings to your party")
  RuneAddTooltip(c2b7,"Check other activity","DPM will check all auras gained by other\nthan your target, you and your group")
RuneAddTooltip(cb8,"Battleground","Broadcast warnings to battleground")
RuneAddTooltip(cb9,"Raid","Broadcast warnings to your raid")
RuneAddTooltip(cb10,"Guild","Broadcast warnings to your guild")
RuneAddTooltip(cb11,"Raidwarning","Broadcast warnings to raidwarning channel.\nIf you are in raidgroup, you need to be the leader to use raidwarnings.")
RuneAddTooltip(b1,"Version Check","Check version in your guild and raidgroup")
RuneAddTooltip(b2,"Defaults","Reset DPM settings to deafult\n(this reset is not including aura settings.")
RuneAddTooltip(b3,"Defaults","Reset DPM Aura Settings to its deafult.\n(this will delete user-added auras)")
RuneAddTooltip(b4,"Adjust Auras","Adjust auras DPM is using.")
RuneAddTooltip(b5,"Test DBM-Bars (3/3)","Test DBM-Bars on Very Dangerous level")
RuneAddTooltip(b6,"Test DBM-Bars (2/3)","Test DBM-Bars on Dangerous level")
RuneAddTooltip(b7,"Test DBM-Bars (1/3)","Test DBM-Bars on Not Dangerous level")

DPM_MFrame:Hide()
DPM_MFrame.name="Deadly Pvp Mods"
DPM_MFrame.parent=nil
DPM_MFrame.cancel = function() end
DPM_MFrame.default = function() DPM_settings = DPMResetSettingsTable() RefreshDPMSettings() end
DPM_MFrame.refresh = function() RefreshDPMSettings() end
DPM_MFrame.okay = function()  SaveDPMSettings() end
InterfaceOptions_AddCategory(DPM_MFrame,nil,1)

  function DPMShowInterface()
    GameMenuButtonUIOptions:Click()
    InterfaceOptionsFrameTab2:Click()
    InterfaceOptionsFrameAddOnsButton1:Click()
  end
end
function LoadMinimapButton()
	local dragMode = nil --"free", nil
	
	local function moveButton(self)
		if dragMode == "free" then
			local centerX, centerY = Minimap:GetCenter()
			local x, y = GetCursorPosition()
			x, y = x / self:GetEffectiveScale() - centerX, y / self:GetEffectiveScale() - centerY
			self:ClearAllPoints()
			self:SetPoint("CENTER", x, y)
		else
			local centerX, centerY = Minimap:GetCenter()
			local x, y = GetCursorPosition()
			x, y = x / self:GetEffectiveScale() - centerX, y / self:GetEffectiveScale() - centerY
			centerX, centerY = math.abs(x), math.abs(y)
			centerX, centerY = (centerX / math.sqrt(centerX^2 + centerY^2)) * 76, (centerY / sqrt(centerX^2 + centerY^2)) * 76
			centerX = x < 0 and -centerX or centerX
			centerY = y < 0 and -centerY or centerY
			self:ClearAllPoints()
			self:SetPoint("CENTER", centerX, centerY)
		end
	end

	local button = CreateFrame("Button", "DPMMinimapButton", Minimap)
	button:SetHeight(25)
	button:SetWidth(25)
	button:SetFrameStrata("MEDIUM")
	button:SetPoint("CENTER", 75.70,-6.63)
	button:SetMovable(true)
	button:SetUserPlaced(true)
	button:SetNormalTexture("Interface\\HelpFrame\\HotIssueIcon.blp")
	button:SetPushedTexture("Interface\\HelpFrame\\HotIssueIcon.blp")
	button:SetHighlightTexture("Interface\\Minimap\\UI-Minimap-Background.blp")

	button:SetScript("OnMouseDown", function(self, button)
		if IsShiftKeyDown() and IsAltKeyDown() then
			dragMode = "free"
			self:SetScript("OnUpdate", moveButton)
		elseif IsShiftKeyDown() or button == "RightButton" then
			dragMode = nil
			self:SetScript("OnUpdate", moveButton)
		end
	end)
	button:SetScript("OnMouseUp", function(self)
		self:SetScript("OnUpdate", nil)
	end)
	button:SetScript("OnClick", function(self, button)
		if IsShiftKeyDown() or button == "RightButton" then return end
		DPMShowInterface()
	end)
	button:SetScript("OnEnter", function(self)
		GameTooltip_SetDefaultAnchor(GameTooltip, self)
		GameTooltip:SetText("Deadly Pvp Mods", 1, 1, 0)
		GameTooltip:AddLine("version: "..DPM_version.." "..DPM_versiontype, 0, 1, 1, 1)
		GameTooltip:AddLine(" ")
		GameTooltip:AddLine("Shift+click or right-click to move\nAlt+shift+click for free drag&drop", 1, 1,1, 1)
		GameTooltip:Show()
	end)
	button:SetScript("OnLeave", function(self)
		GameTooltip:Hide()
	end)
end
--[[||||||||||||||||||||||Function LoadAdjustAuras||||||||||||||||||||||||||||||]]--

local function DPM_CreateLoadFrame()
--Loading and Create AdjustFrame
local DPM_loadframe = CreateFrame("Frame",UIParent)
DPM_loadframe:RegisterEvent("ADDON_LOADED")
DPM_loadframe:RegisterEvent("PARTY_MEMBERS_CHANGED")
DPM_loadframe:RegisterEvent("CHAT_MSG_ADDON")
DPM_loadframe:SetScript("OnEvent",function(self, event, ...)
--PARTY_MEMBER_CHANGED
  if (event=="PARTY_MEMBERS_CHANGED") then
    SendAddonMessage("DPMversion", DPM_version, "RAID")
  end
--ADDON_LOADED
  if (event=="ADDON_LOADED") then
  
    if(UnitIsInMyGuild("player")) then
      SendAddonMessage("DPMversion", DPM_version, "GUILD")
    end

    if(DPM_addonloaded==0) then
      DPM_addonloaded = 1
	  DPMDBMAddText("Loaded","Deadly Pvp Mods") 
      LoadAdjustAuras()
	  LoadSettingsFrame()
	  LoadMinimapButton()
	end
  end
--CHAT_MSG_ADDON
  if (event=="CHAT_MSG_ADDON") then
    local prefix,message,type,sender = select(1, ...)

    if(prefix=="DPMversion") then
      local newversion=tonumber(message)

      if(newversion>DPM_exversion) then
        DPMDBMAddText("The newest version of \124cffff6600Deadly Pvp Mods ("..newversion..")\124h\124r is out now! \124cffff6600["..sender.."]\124h\124r has it, why dont you get it?","DPM")
	    DPM_exversion=newversion
      end

    end

    if(prefix=="DPMcheck") then
      SendAddonMessage("DPMtrue", DPM_version.." "..type, "WHISPER",sender)
    end

    if(prefix=="DPMtrue") then
      local a,b = strsplit(" ", message)  
      if(b=="GUILD") then
	    DPMprint("In Guild:\124Hplayer:"..sender.."\124h \124cffff6600"..sender.."\124h\124r has Deadly Boss Mods - Version: \124cffff6600"..a.."\124h\124r",0,255,0)
      elseif(b=="RAID") then
		DPMprint("In Raid:\124Hplayer:"..sender.."\124h \124cffff6600"..sender.."\124h\124r has Deadly Boss Mods - Version: \124cffff6600"..a.."\124h\124r",255,0,0)
      end
    end
  end
end)
end
DPM_CreateLoadFrame()

function FindAura(AName)

    local ClassN
    local SpellN
    local CheckAName
    local Igennem
    local SaveSpellN,SaveClassN = nil
	
    for ClassN=1,getn(DPM_classes) do
        for SpellN=1,getn(DPM_table[tostring(DPM_classes[ClassN])]["Spell"]) do
            CheckAName=DPM_table[tostring(DPM_classes[ClassN])]["Spell"][SpellN]
            if(AName==CheckAName) then
                SaveClassN = ClassN
                SaveSpellN = SpellN
                Igennem=true
            end
        end
    end
	
    return SaveClassN,SaveSpellN
end
 
function ParseGUID(guid)
   local first3 = tonumber("0x"..strsub(guid, 3,5))
   local unitType = bit.band(first3,0x00f)
   local type = nil

   if (unitType == 0x000) then
      type = "player"
   elseif (unitType == 0x003) then
      type = "npc"
   elseif (unitType == 0x004) then
      type = "pet"
   elseif (unitType == 0x005) then
      type = "vehicle"
   end
  
   return type
end

function DPM_ApplyAura(SpellTip,DPMCheckSelf,SpellDanger,SpellTimer,SpellLink,SpellIcon,SourceType,DestType,SourceName,DestName,SpellID,SpellName,SourceFriend,DestFriend, PlayerName,IgennemType,EventType,SettingsUseColorCode,SettingsUseDBMBars,SettingsUseSoundWarning)
  --IgennemType: 5 = targetfriend, 4 = targetenemy, 3 = Group, 2 = Other, 1 = Self.
  --target > self > group > other
  local SaveSourceName=SourceName
  local SaveDestName=DestName
  local SpellText,FormatSpellText,ColorCode,FormatChatSpellText,ChatSpellTip,PlayerTarget= ""

  PlayerTarget = UnitName("target")
  CheckDestName = DestName
  if not(SpellTip=="") then
    ChatSpellTip="("..SpellTip..")"
  else
    ChatSpellTip=""
  end
  
  if(SourceName==PlayerName) then
    SourceName="[**YOU**]"
  else
    SourceName="["..SourceName.."]"
  end
  if(DestName==PlayerName) then
    DestName="[**YOU**]"
  else
    DestName="["..DestName.."]"
  end
  
  if(IgennemType==5) then
     ColorCode = DPM_TextFriend
  elseif(IgennemType==4) then
      ColorCode = DPM_TextEnemy
  elseif(IgennemType==3) then
    ColorCode = DPM_TextFriend
  elseif(IgennemType==2) then
    if(DestFriend==nil) then
      ColorCode = DPM_TextEnemy
	else
	  ColorCode = DPM_TextFriend
	end
  elseif(IgennemType==1) then
    ColorCode = DPM_TextFriend
  else
    ColorCode = ""
  end

  --\\\\\\\\\\\\\\\\\\\\\\\Use Color Code////////////////////////  
  if(SettingsUseColorCode==0) then
    ColorCode = ""
  end
  --////////////////////////Use Color Code\\\\\\\\\\\\\\\\\\\\\\\\\
  
  local SpellText = "\124Hplayer:"..SaveDestName.."\124h"..ColorCode..""..DestName..""..DPM_TextEnd.." -> "..SpellLink.." "..ChatSpellTip..""
  local FormatChatSpellText = ""..SaveDestName.." -> "..SpellLink.." "..ChatSpellTip..""
  local FormatSpellText = "\124Hplayer:"..SaveDestName.."\124h"..DestName.." -> "..SpellLink

  ----\\\\\\\\\\\\\\\\\\\\\\\Create DBM bar////////////////////////
	if(tonumber(SpellDanger)==3) then
		if(EventType=="SPELL_AURA_APPLIED") then
			DPMDBMAddText(SpellText,"DPM")
			DPMDBMInform(SpellIcon,SpellText,0,true)
		end
		DPMDBMFrame(SpellTimer, FormatSpellText, SpellIcon, false)
	elseif(tonumber(SpellDanger)==2) then
		if(EventType=="SPELL_AURA_APPLIED") then
			DPMDBMInform(SpellIcon,SpellText,0,false)
		end
		DPMDBMFrame(SpellTimer, FormatSpellText, SpellIcon, false)
	elseif(tonumber(SpellDanger)==1) then
		DPMDBMFrame(SpellTimer, FormatSpellText, SpellIcon, false)
	end
  
--\\\\\\\\\\\\\\\\\\\\\\\Broadcast////////////////////////
  if(DPM_settings["Broadcast"]["Broadcast"][1]==1) then
    if(EventType=="SPELL_AURA_APPLIED") then
	local ctype,cenable,a = nil
      for a=1,getn(DPM_chat["TYPE"]) do
	    if(DPM_chat["TRUE"][a]()==1) then
        cenable=DPM_settings["Broadcast"][DPM_chat["TYPE"][a]][1]
	    ctype=DPM_chat["TYPE"][a]
		  if(DPM_chat["TRUE"][a]()==1) then
	        if(cenable==1) then
			  local secleft = SpellTimer
			  if(secleft==0) then secleft="" elseif(secleft==1) then secleft=SpellTimer.."sec left" else secleft=SpellTimer.."secs left" end
              SendChatMessage(FormatChatSpellText.." "..secleft.."",tostring(ctype))
	        end
		  end
		end
      end
    end
  end
--////////////////////////Broadcast\\\\\\\\\\\\\\\\\\\\\\\\\
----////////////////////////Create DBM bar\\\\\\\\\\\\\\\\\\\\\\\\\
end

local DPM_eventframe=CreateFrame("FRAME","DPM_eventframe",UIParent)
DPM_eventframe:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
DPM_eventframe:SetScript("OnEvent", function(self, event, ...)

  local incombat=nil

  if (event=="COMBAT_LOG_EVENT_UNFILTERED") then
  --\\\\\\\\\\\\\\\\\\\\\\\Check Disablesettings///////////////////////
  if(DPM_settings["Disable"][1]==0) then

    local timestamp, type, sourceGUID, sourceName, sourceFlags, destGUID, destName, destFlags = select(1, ...)
    local spellId, spellName, spellSchool = select(9, ...)
    local SourceType, DestType,  SourceName, DestName, SpellID, SpellName, DestFriend, SourceFriend, ClassNumber, SpellNumber,SpellTip,SpellTimer,SpellDanger;
	local CheckSelf,SpellLink,SpellIcon,CheckGroup, CheckOther,CheckTargetO, CheckTargetF;

    if(type=="SPELL_AURA_APPLIED") or (type=="SPELL_AURA_REFRESH") then
	--\\\\\\\\\\\\\\\\\\\\\\\In Certain Conditions////////////////////////
    local disable = nil
      if(tonumber(DPM_settings["EnableWhen"]["EnableWhen"][1])==1) then
        if(DPM_settings["EnableWhen"]["Arena"][1]==1) then
          if(DPMArenaLocation()==nil) then
	        disable = true
	      else
	        disable = false
	      end
		end
		if(disable==true) or (disable==nil) then
	      if(DPM_settings["EnableWhen"]["Battleground"][1]==1) then
	        if(DPMBGLocation()==nil) then
	          disable = true
	        else
	          disable = false
	        end
	      end
	    end
        else
          disable=false
      end
	
	if not(disable) then
	local incombatdisable = false
    local incombat = UnitAffectingCombat("player")
    --\\\\\\\\\\\\\\\\\\\\\\\Disable in combat////////////////////////
     if(DPM_settings["DisableWNIC"][1]==1) then
       if(incombat==nil) then
	     incombatdisable=true
	   end
     end
  
    if(incombatdisable==false) then
      ClassNumber, SpellNumber = FindAura(spellName)
      if not(ClassNumber==nil) then
      SpellTip = DPM_table[tostring(DPM_classes[ClassNumber])]["Tip"][SpellNumber]
      SpellDanger,SpellTimer = DPMDT(DPM_table[tostring(DPM_classes[ClassNumber])]["DT"][SpellNumber])
      SpellDanger = tonumber(SpellDanger)
      SpellTimer = tonumber(SpellTimer)
      SpellLink = GetSpellLink(spellId)
      local _,_,SpellIcon = GetSpellInfo(spellId)
	
      CheckGroup = DPM_table[tostring(DPM_classes[ClassNumber])]["Group"][SpellNumber]
      CheckOther = DPM_table[tostring(DPM_classes[ClassNumber])]["Other"][SpellNumber]
	  CheckTargetO = DPM_table[tostring(DPM_classes[ClassNumber])]["TargetOther"][SpellNumber]
	  CheckTargetF = DPM_table[tostring(DPM_classes[ClassNumber])]["TargetFriend"][SpellNumber]
	  CheckSelf = DPM_table[tostring(DPM_classes[ClassNumber])]["Check"][SpellNumber]
      local SettingsCheckTargetO = tostring(DPM_settings["TargetO"][1])
	  local SettingsCheckTargetF = tostring(DPM_settings["TargetF"][1])
      local SettingsCheckSelf = tostring(DPM_settings["Self"][1])
	  local SettingsCheckGroup = tostring(DPM_settings["Group"][1])
	  local SettingsCheckOther = tostring(DPM_settings["Other"][1])
	  local SettingsUseColorCode = DPM_settings["ColorCode"][1]
	  local SettingsUseDBMBars = DPM_settings["DBMBars"][1]
	  local SettingsUseSoundWarning = DPM_settings["SoundWarning"][1]
	  
      SourceType = ParseGUID(sourceGUID)
      DestType = ParseGUID(destGUID)
      SourceName = sourceName
      DestName = destName
      SpellID = spellId
      SpellName = spellName
      local PlayerName = UnitName("player")
	  local TargetName = UnitName("target")
      SourceFriend = UnitIsFriend(PlayerName, SourceName)
      DestFriend = UnitIsFriend(PlayerName, DestName)
      
	  DestName = DPMSplitServer(DestName)
	  SourceName = DPMSplitServer(SourceName)
	  	  
      local Igennem = false
      local IgennemType = nil
      --\\\\\\\\\\\\\\\\\\\\\\\Check Settings////////////////////////
      if(CheckGroup=="1") and (SettingsCheckGroup=="1") then
        if(DestFriend==1) then
          IgennemType = 3
        end
	  end
      if(CheckOther=="1") and (SettingsCheckOther=="1")  then
	  if(tostring(DestFriend)=="nil") then
	    if not(DestName == TargetName) then
		    IgennemType = 2
        end
	  end
      end

      if(CheckSelf=="1") and (SettingsCheckSelf=="1") then
        if(DestName==PlayerName) then
		    IgennemType = 1
        end
      end
	  
	  if not(IgennemType == 1) then
	    if(DestName==TargetName) then
		  if(DestFriend==nil) then
			if(CheckTargetO=="1") and (SettingsCheckTargetO=="1") then
			  IgennemType = 4
			end
		  else
			if(CheckTargetF=="1") and (SettingsCheckTargetF=="1") then
			  IgennemType = 5
			end
		  end
		end
	  end

	  if(IgennemType) then
        DPM_ApplyAura(SpellTip,CheckSelf,SpellDanger,SpellTimer,SpellLink,SpellIcon,SourceType,DestType,SourceName,DestName,SpellID,SpellName,SourceFriend,DestFriend, PlayerName,IgennemType,type,SettingsUseColorCode,SettingsUseDBMBars,SettingsUseSoundWarning)
	  end
    end
    end
	--////////////////////////Check Settings\\\\\\\\\\\\\\\\\\\\\\\\\
  end
   --////////////////////////In Certain Conditions\\\\\\\\\\\\\\\\\\\\\\\\\
  end
  --////////////////////////Disable in combat\\\\\\\\\\\\\\\\\\\\\\\\\
  end
  --////////////////////////Check Disablesettings\\\\\\\\\\\\\\\\\\\\\\\\\
  end
end)





--[[
/run print(GetZoneText())
print("\124Hplayer:Editbox\124hEditbox")
/run print("\124Hplayer:Editbox\124h\124caa55aa55EditBox\124h\124r")
if not(UnitAffectingCombat("player")) then end
ChatFrame1:AddMessage("Addon: Deadly Pvp Mods loaded",0,1,0) 

[Disable DPM]
[Disable DPM when not in combat]
[Use DBM bars/texts]
[Show spelltip in warnings]
[Use special warnings]
[Use color code]
[Broadcast warnings to:]
[Party]
[Battleground]
[Raid]
[Guild]
[Raidwarning]
[Show versions in guild/raid]
[Reset]
/run StaticPopup_Show("CONFIRM_RESET_INTERFACE_SETTINGS")
Frame = CreateF("DPM_AFrame",0,0,nil,210,325,true,true)
CheckBox = CreateCBox("CBoxG",13,-240,DPM_AFrame,"TOP","TOP",25,25,1,function(self,button,down) end)
Button = CreateButton("1/3","1/3",-55,-200,DPM_AFrame,50,25,"TOP","TOP",function() EBSetText(EB_Danger,GetDangerLevel(1)) end)
CreateText("COther","Other",40,-240,DPM_AFrame,300,25,"TOP","TOP")
DPM_AddTooltip(EB_Name,"Name","This is the name of the aura.\nMake sure you type the name right.")


PlaySoundFile("Sound\\Creature\\Zippelin\\ZippelinAttack.wav")
frameprint("Addon: Deadly Pvp Mods loaded",0,255,0)
]]--

--[[
print("Following players have DPM:")
SendAddonMessage("DPMcheck", version, "GUILD")
SendAddonMessage("DPMcheck", version, "RAID")
]]--