Lua GossipAddQuests

From ArcEmu-Wiki
Jump to: navigation, search
+/-
Main Page        LuaArcEmu Website     ArcEmu Forum     Bug Tracker


Description

This function is used to show quests in the npc's gossip menu if any quests are available.

The function must be placed between :GossipCreateMenu() and :GossipSendMenu(pPlayer) functions.

Method info

pUnit, menu sender object. Usually NPC but can be item or player too.

pPlayer, target object. Player who is viewing the menu.

object pUnit:GossipAddQuests(object pPlayer)

Example

local npc_id = 1234   -- dummy id
 
local function NPC_GossipHello(pUnit, event, pPlayer)
	pUnit:GossipCreateMenu(2345, pPlayer, 0)   -- 2345 = dummy gossip entry
	pUnit:GossipAddQuests(pPlayer)
	pUnit:GossipSendMenu(pPlayer)
end
 
RegisterUnitGossipEvent(npc_id, 1, NPC_GossipHello)   -- GOSSIP_EVENT_ON_TALK
Personal tools