Advertisement
Guest User

gmcp.Char.Afflictions Tracker

a guest
Apr 10th, 2015
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.36 KB | None | 0 0
  1. --Event handlers:
  2. --gmcp.Char.Afflictions.List
  3. --gmcp.Char.Afflictions.Add
  4. --gmcp.Char.Afflictions.Remove
  5.  
  6. Track = Track or {}
  7. Track.afflictions = Track.afflictions or {}
  8. Track.afflictions.list = Track.afflictions.list or {}
  9.  
  10. Track.afflictions.hide = {
  11.     ["blindness"] = true,
  12.     ["deafness"] = true
  13. }
  14.  
  15. Track.afflictions.show = function(win)
  16.     if win then
  17.         clearWindow(win)
  18.     else
  19.         win = "main"
  20.     end
  21.  
  22.     for x,_ in pairs(Track.afflictions.list) do
  23.         if not Track.afflictions.hide[x] then
  24.             cecho(win, x .. "\n")
  25.         end
  26.     end
  27. end
  28.  
  29. function afflictions(event, arg)
  30.     if event == "gmcp.Char.Afflictions.List" then
  31.         Track.afflictions.list = {}
  32.         for _,x in ipairs(gmcp.Char.Afflictions.List) do
  33.             Track.afflictions.list[x.name] = {desc = x.desc, cure = x.cure}
  34.         end
  35.     end
  36.  
  37.     if event == "gmcp.Char.Afflictions.Add" then
  38.         Track.afflictions.list[gmcp.Char.Afflictions.Add.name] = {desc = gmcp.Char.Afflictions.Add.desc, cure = gmcp.Char.Afflictions.Add.cure}
  39.         cecho("--<red>[AFFLICTION][+]" .. gmcp.Char.Afflictions.Add.name:title())
  40.     end
  41.  
  42.     if event == "gmcp.Char.Afflictions.Remove" then
  43.         for _,x in ipairs(gmcp.Char.Afflictions.Remove) do
  44.             cecho("--<green>[AFFLICTION][-]" .. x:title())
  45.             Track.afflictions.list[x] = nil
  46.         end
  47.     end
  48.  
  49.     Track.afflictions.show(GUI.afflictions.display.name) -- Geyser.MiniConsole name, wherever you want to print it
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement