Advertisement
Rochet2

Untitled

Jan 18th, 2012
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local Entry = 180001 -- NPC entry
  2. local npc_text = 700000
  3. local T =
  4. {
  5. --  {icon, "Name", npc_text+X},
  6.     {0, "I would like to know how the server works", npc_text+1},
  7.     {0, "Section A", npc_text+2},
  8.     {0, "Section B", npc_text+3},
  9.     {0, "Other Information", npc_text+4},
  10. --  {0, "More info", npc_text+4},
  11. --  {0, "More info", npc_text+5},
  12. --  {0, "More info", npc_text+6},
  13. --  {0, "More info", npc_text+7},
  14. --  {0, "More info", npc_text+8},
  15. }
  16. local Start = 1
  17.  
  18. local function Hello(pUnit, event, pPlayer)
  19.     pUnit:GossipCreateMenu(npc_text, pPlayer, 0)
  20.     for k, v in ipairs(T) do
  21.         pUnit:GossipMenuAddItem(v[1], v[2], Start+k, 0, '', 0)
  22.     end
  23.     pUnit:GossipSendMenu(pPlayer)
  24. end
  25.  
  26. local function Select(pUnit, event, pPlayer, id, intid, code)
  27.     if(intid == 1) then
  28.         pPlayer:GossipComplete()
  29.         return
  30.     elseif(intid > Start) then
  31.         pUnit:GossipCreateMenu(T[intid-Start][3], pPlayer, 0)
  32.         pUnit:GossipMenuAddItem(0, "Back..", 0, 0, '', 0)
  33.         pUnit:GossipSendMenu(pPlayer)
  34.         return
  35.     end
  36.     Hello(pUnit, event, pPlayer)
  37. end
  38.  
  39. RegisterUnitGossipEvent(Entry, 1, Hello)
  40. RegisterUnitGossipEvent(Entry, 2, Select)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement