Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. ----------------------------------------------
  2. -- TOP 5 per class                          //
  3. -- Script by Renatokeys(emudevs)            //
  4. -- http://emudevs.com                       //
  5. ----------------------------------------------
  6.  
  7. local NPC_ID = 1
  8.  
  9. local T = {
  10.     [1] = {"Warrior", "660000"},
  11.     [2] = {"Paladin", "FF0099"},
  12.     [3] = {"Hunter", "CC6611"},
  13.     [4] = {"Rogue", "CCFF00"},
  14.     [5] = {"Priest", "FFFFFF"},
  15.     [6] = {"Death Knight", "4D4D51"},
  16.     [7] = {"Shaman", "0000CC"},
  17.     [8] = {"Mage", "33FFFF"},
  18.     [9] = {"Warlock", "660099"},
  19.     [11] = {"Druid", "FF6600"}
  20. };
  21.  
  22. function clica(event, plr, unit)
  23.     plr:GossipMenuAddItem(0, "Choose the class : ", 0, 0)
  24.    
  25.     for k, v in pairs(T) do
  26.         plr:GossipMenuAddItem(0, "TOP 5 |cff"..v[2]..v[1], 0, k)
  27.     end
  28.    
  29.     plr:GossipSendMenu(1, unit)
  30. end
  31.  
  32. function seleciona(event, plr, unit, arg2, intid)
  33.     if (intid > 0) then
  34.         plr:SendBroadcastMessage("|cff"..T[intid][2]..T[intid][1])
  35.        
  36.         local resultado = CharDBQuery("SELECT name,totalKills FROM characters WHERE class='"..intid.."' ORDER BY totalKills DESC LIMIT 5")
  37.         repeat
  38.             local playername = resultado:GetString(0);
  39.             local kills = resultado:GetUInt32(1);
  40.             plr:SendBroadcastMessage("|cFF33CCFFPlayer : |r ".. playername .." ,  |cFF33CCFFwith : |r" .. kills .. " Kills")
  41.         until not resultado:NextRow()
  42.     end
  43. end
  44. RegisterCreatureGossipEvent(NPC_ID, 1, clica)
  45. RegisterCreatureGossipEvent(NPC_ID, 2, seleciona)