Advertisement
Guest User

information npc

a guest
Jan 18th, 2012
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. local Entry = 1000001 -- 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. }
  11. local D = #T
  12.  
  13. function T.Hello(pUnit, event, pPlayer)
  14. pUnit:GossipCreateMenu(npc_text, pPlayer, 0)
  15. for k, v in ipairs(T) do
  16. pUnit:GossipMenuAddItem(v[1], v[2], D+k, 0, '', 0)
  17. end
  18. pUnit:GossipSendMenu(pPlayer)
  19. end
  20.  
  21. function T.Select(pUnit, event, pPlayer, id, intid, code)
  22. if(intid > D) then
  23. pUnit:GossipCreateMenu(T[intid-D][3], pPlayer, 0)
  24. pUnit:GossipMenuAddItem(0, "Back..", 0, 0, '', 0)
  25. pUnit:GossipSendMenu(pPlayer)
  26. return
  27. end
  28. T.Hello(pUnit, event, pPlayer)
  29. end
  30.  
  31. RegisterUnitGossipEvent(100001, 1, T.Hello)
  32. RegisterUnitGossipEvent(100001, 1, T.Select)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement