Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Entry = 180001 -- 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, "Section A", npc_text+2},
- {0, "Section B", npc_text+3},
- {0, "Other Information", npc_text+4},
- -- {0, "More info", npc_text+4},
- -- {0, "More info", npc_text+5},
- -- {0, "More info", npc_text+6},
- -- {0, "More info", npc_text+7},
- -- {0, "More info", npc_text+8},
- }
- local Start = 1
- local function Hello(pUnit, event, pPlayer)
- pUnit:GossipCreateMenu(npc_text, pPlayer, 0)
- for k, v in ipairs(T) do
- pUnit:GossipMenuAddItem(v[1], v[2], Start+k, 0, '', 0)
- end
- pUnit:GossipSendMenu(pPlayer)
- end
- local function Select(pUnit, event, pPlayer, id, intid, code)
- if(intid == 1) then
- pPlayer:GossipComplete()
- return
- elseif(intid > Start) then
- pUnit:GossipCreateMenu(T[intid-Start][3], pPlayer, 0)
- pUnit:GossipMenuAddItem(0, "Back..", 0, 0, '', 0)
- pUnit:GossipSendMenu(pPlayer)
- return
- end
- Hello(pUnit, event, pPlayer)
- end
- RegisterUnitGossipEvent(Entry, 1, Hello)
- RegisterUnitGossipEvent(Entry, 2, Select)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement