Advertisement
Guest User

Arena TOP 10 - Renatokeys

a guest
Apr 21st, 2014
423
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.25 KB | None | 0 0
  1.     ----------------------------------------------
  2.     -- TOP 5 per class                          //
  3.     -- Script by Renatokeys                     //
  4.     ----------------------------------------------
  5.     local NPC_ID = 222222
  6.      
  7.      local arena = {
  8.             [2] = {"TOP 10 arena 2v2"},
  9.             [3]     = {"TOP 10 arena 3v3"},
  10.             [5] = {"TOP 10 arena 5v5"},    
  11.     };
  12.            
  13.      
  14.     function seleciona(event, plr, unit)
  15.             for k, v in pairs(arena) do
  16.                     plr:GossipMenuAddItem(0, v[1], 0, k)
  17.             end
  18.             plr:GossipSendMenu(1, unit)
  19.     end
  20.      
  21.     function clica(event, plr, unit, arg2, intid)
  22.         if (intid > 0) then
  23.             local resultado = CharDBQuery("SELECT name,rating FROM arena_team WHERE type='"..intid.."' ORDER BY rating DESC LIMIT 10")
  24.             repeat
  25.             time = resultado:GetString(0);
  26.             pontos = resultado:GetUInt32(1);
  27.             plr:SendBroadcastMessage("|cFF33CCFFNome do time : |r ".. time .." ,  |cFF33CCFFRating : |r" .. pontos .. "  pontos de arena ")
  28.             until not resultado:NextRow()    
  29.         end
  30.     end
  31.     RegisterCreatureGossipEvent(NPC_ID, 1, seleciona)
  32.     RegisterCreatureGossipEvent(NPC_ID, 2, clica)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement