Advertisement
Xzempt

Untitled

Apr 8th, 2012
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.70 KB | None | 0 0
  1. function gsay(text)
  2.     SendChatMessage(text, "GUILD")
  3. end
  4.  
  5. Watchlist = { }
  6. illegalspells = { "Eye of Kilrogg", "Mind Vision", "Far Sight", "Reincarnation", "Rebirth", "Lay on Hands", "Raise Ally", "Army of the Dead", "Astral Recall", "Nitro Boosts", "Saronite Bomb", "Cobalt Frag Bomb", "Explosive Sheep", "Divine Intervention", "Soulstone Resurrection", "Inferno" }
  7. illegalpotions = { "Indestructible", "Speed", "Wild Magic", "Arcane Protection", "Fire Protection", "Frost Protection", "Nature Protection", "Shadow Protection", "Nightmare Slumber", "Ironshield", "Fel Mana", "Destruction", "Holy Protection", "Stoneshield", "Restoration", "Resistance", "Free Action", "Swim Speed", "Shrouding", "Living Free Action", "Sneaking", "Greater Stoneshield", "Greater Dreamless Sleep", "Petrification", "Invulnerability", "Dreamless Sleep", "Haste", "Major Dreamless Sleep"  }
  8. illegalelixirs = { "Pygmy Oil", "Lesser Intellect", "Health", "Armor", "Fire Power", "Strong Troll's Blood Elixir", "Greater Intellect", "Detect Undead", "Agility", "Greater Water Breathing", "Onslaught Elixir", "Detect Demon", "Greater Agility", "Arcane Elixir", "Mighty Agility", "Wrath Elixir", "Healing Power", "Major Strength", "Mighty Strength", "Guru's Elixir", "Spellpower Elixir", "Greater Arcane Elixir", "Mighty Thoughts", "Weak Troll's Blood Elixir", "Lesser Armor" }
  9.  if not enforcerFrame then
  10.     enforcerFrame = CreateFrame("Frame", nil, UIParent)
  11.  end
  12. local frame = enforcerFrame
  13. frame:RegisterEvent("COMBAT_LOG_EVENT")
  14. frame:SetScript("OnEvent", function(self, event, ...)
  15.     for i,v in ipairs(illegalspells) do
  16.         if (arg10 == illegalspells[i]) and (arg2 == "SPELL_RESURRECT") or (arg10 == illegalspells[i]) and (arg2 == "SPELL_AURA_APPLIED") or (arg10 == illegalspells[i]) and (arg2 == "SPELL_CAST_SUCCESS") and (arg10 == "Lay on Hands") or (arg10 == illegalspells[i]) and (arg2 == "SPELL_SUMMON") and (arg10 ~= "Eye of Kilrogg")  and (arg10 ~= "Army of the Dead") or (arg10 == illegalspells[i]) and (arg2 == "SPELL_CAST_SUCCESS") and (arg10 == "Raise Ally") or (arg10 == illegalspells[i]) and (arg2 == "SPELL_CAST_SUCCESS") and (arg10 == "Reincarnation") then
  17.             for i,v in ipairs(Watchlist) do
  18.                 if (arg4 == Watchlist[i]) then
  19.                     spell = GetSpellLink(arg9)
  20.                     gsay(arg4.. " used a forbidden spell. Spell: " ..spell.. ". " ..arg4.. " is disqualified.")
  21.                 end
  22.             end
  23.         end
  24.     end
  25.     if (arg10) then
  26.         if (arg2 ~= "SPELL_AURA_APPLIED") and (arg2 ~= "SPELL_AURA_REMOVED") and (arg2 ~= "SPELL_HEAL") and (arg2 ~= "SPELL_ENERGIZE") and (arg2 ~= "SPELL_PERIODIC_HEAL") then
  27.             if (string.find(arg10,  "Flask of(.*)")) and (arg10 ~= "Flask of the North") and (arg2 ~= "SPELL_AURA_APPLIED") or (string.find(arg10,  "Elixir of(.*)")) or (arg10 == "Fortitude") and (arg2 ~= "SPELL_AURA_APPLIED") and (arg2 ~= "SPELL_AURA_REMOVED") or (string.find(arg10,  "(.*)Forgotten Kings")) or (string.find(arg10,  "(.*)Potion")) and (arg2 ~= "SPELL_HEAL") or (string.find(arg10,  "Restore Mana")) and (arg2 ~= "SPELL_ENERGIZE") or (string.find(arg10,  "Noggenfogger Elixir")) then
  28.                 for i,v in ipairs(Watchlist) do
  29.                     if (arg4 == Watchlist[i]) then
  30.                         spell = GetSpellLink(arg9)
  31.                         gsay(arg4.. " used a forbidden spell. Spell: " ..spell.. ". " ..arg4.. " is disqualified.")
  32.                     end
  33.                 end
  34.             end
  35.         end
  36.     end
  37.     if (arg2 == "SPELL_CAST_SUCCESS") and (arg10) then
  38.         for i,v in ipairs(illegalpotions) do
  39.             if (arg10 == illegalpotions[i]) and (arg10 ~= "Shadow Protection") then
  40.                 for i,v in ipairs(Watchlist) do
  41.                     if (arg4 == Watchlist[i]) then
  42.                         spell = GetSpellLink(arg9)
  43.                         gsay(arg4.. " used a forbidden spell. Spell: " ..spell.. ". " ..arg4.. " is disqualified.")
  44.                     end
  45.                 end
  46.             end
  47.         end
  48.         if (arg10 == "Shadow Protection") and (arg9 == 7242) or (arg9 == 28537) or (arg9 == 17548) or (arg9 == 53915) then
  49.             for i,v in ipairs(Watchlist) do
  50.                 if (arg4 == Watchlist[i]) then
  51.                     spell = GetSpellLink(arg9)
  52.                     gsay(arg4.. " used a forbidden spell. Spell: " ..spell.. ". " ..arg4.. " is disqualified.")
  53.                 end
  54.             end    
  55.         end
  56.     end
  57.     if (arg2 == "SPELL_AURA_APPLIED") and (arg10) then
  58.         for i,v in ipairs(illegalelixirs) do
  59.             if (arg10 == illegalelixirs[i]) then
  60.                 for i,v in ipairs(Watchlist) do
  61.                     if (arg4 == Watchlist[i]) then
  62.                         spell = GetSpellLink(arg9)
  63.                         gsay(arg4.. " used a forbidden spell. Spell: " ..spell.. ". " ..arg4.. " is disqualified.")
  64.                     end
  65.                 end
  66.             end
  67.         end
  68.      end
  69.      if (arg2 == "SPELL_DAMAGE") and (string.find(arg10, "(.*)Frag Bomb")) then
  70.         for i,v in ipairs(Watchlist) do
  71.             if (arg4 == Watchlist[i]) then
  72.                 spell = GetSpellLink(arg9)
  73.                 gsay(arg4.. " used a forbidden spell. Spell: " ..spell.. ". " ..arg4.. " is disqualified.")
  74.             end
  75.         end
  76.     end
  77.     if (arg10 == "Eye of Kilrogg") or (arg10 == "Thunderstorm") then print (arg4.. " used " ..arg10) end
  78. end)
  79.  
  80.  
  81. function ClearWatchList()
  82.     table.wipe(Watchlist)
  83.     print("Watch List has been cleared.")
  84.     CombatLogClearEntries()
  85. end
  86. function RemoveWatchList()
  87. RemoveTarget = UnitName("target")
  88.     if (RemoveTarget) then
  89.         for i,v in ipairs(Watchlist) do
  90.             if (Watchlist[i] == RemoveTarget) then
  91.                 table.remove(Watchlist, i)
  92.                 print("Watchlist successfully updated." ..RemoveTarget.. " was removed.")
  93.             end
  94.         end
  95.     end
  96.     if not RemoveTarget then print("Please target someone to remove from the list.") end
  97. end
  98. function AddWatchList()
  99. Addtarget = UnitName("target")
  100.     if (Addtarget) then
  101.         table.insert(Watchlist, Addtarget)
  102.         print(Addtarget.. " added to watch list.")
  103.     else
  104.         print("Please target someone to add to the list.")
  105.     end
  106. end
  107. SLASH_wl1 = '/wl'
  108. function SlashCmdList.wl(msg, editbox)
  109.     if (msg == "Show") or (msg == "show") then
  110.     WatchList:Show()
  111.     end
  112.     if (msg == "Hide") or (msg == "hide") then
  113.     WatchList:Hide()
  114.     end
  115.  
  116. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement