Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Entry = 123 -- NPC entry
- local npc_text = 700000
- local T =
- {
- -- {icon, "Name", npc_text+X},
- {0, "I would like to know how the server works", npc_text+1},
- {0, "I would like to know how I level up", npc_text+2},
- {0, "I would like to know where the mall is located", npc_text+3},
- {0, "How can I find other players?", npc_text+4},
- }
- local D = #T
- function T.Hello(pUnit, event, pPlayer)
- pUnit:GossipCreateMenu(npc_text, pPlayer, 0)
- for k, v in ipairs(T) do
- pUnit:GossipMenuAddItem(v[1], v[2], D+k, 0, '', 0)
- end
- pUnit:GossipSendMenu(pPlayer)
- end
- function T.Select(pUnit, event, pPlayer, id, intid, code)
- if(intid > D) then
- pUnit:GossipCreateMenu(T[intid-D][3], pPlayer, 0)
- pUnit:GossipMenuAddItem(0, "Back..", 0, 0, '', 0)
- pUnit:GossipSendMenu(pPlayer)
- return
- end
- T.Hello(pUnit, event, pPlayer)
- end
- RegisterUnitGossipEvent(Entry, 1, T.Hello)
- RegisterUnitGossipEvent(Entry, 1, T.Select)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement