Code:
function Proffesion_ONClick(pUnit, event, player)
proffesionmenu(pUnit, player)
end
function proffesionmenu(pUnit, player)
pUnit:GossipCreateMenu(3802, player, 0) -- 3802 here links to the entry ID 3802 in npc_text
if player:HasQuest(1) then -- if the player has the quest
pUnit:GossipMenuAddItem(7, "What's the difference between a miner and a lumberjack?", 5, 0)
end
pUnit:GossipMenuAddItem(0, "Nevermind.", 1, 0)
pUnit:GossipSendMenu(player)
end
function ProffesionOnGossip(pUnit, event, player, id, intid, code)
if (intid == 1) then
player:GossipComplete()
elseif intid == 2 then
proffesionmenu(pUnit, player)
elseif intid == 5 then
pUnit:GossipCreateMenu(7363, player, 0) -- again, 7363 links to npc_text
pUnit:GossipMenuAddItem(0, "Tell me more.", 6, 0)
pUnit:GossipMenuAddItem(0, "Wait, what did you say first?", 2, 0)
pUnit:GossipMenuAddItem(0, "Nevermind.", 1, 0)
pUnit:GossipSendMenu(player)
elseif intid == 6 then
pUnit:GossipCreateMenu(2222, player, 0) -- again, 2222 links to npc_text
pUnit:GossipMenuAddItem(0, "Ok, thanks.", 2, 0)
pUnit:GossipMenuAddItem(0, "Nevermind.", 1, 0)
pUnit:GossipSendMenu(player)
-- And now since we got to this part of the gossip, we can mark quest complete:
if player:HasQuest(1) then -- if the player has quest ID 1
player:MarkQuestObjectiveAsComplete(3030, 0) -- mark quest ID 3030 objective 0 as complete
end
end
end
RegisterUnitGossipEvent(npcid, 1, "Proffesion_ONClick")
RegisterUnitGossipEvent(npcid, 2, "ProffesionOnGossip")