View Single Post
06-24-21, 03:20 PM   #3
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
Lua Code:
  1. local f=CreateFrame("frame")
  2. f:RegisterEvent("GOSSIP_SHOW")
  3. f:SetScript("OnEvent",function()
  4.  
  5.     -- get the npc id from its guid
  6.     local _,_,_,_,_,npc=strsplit("-",(UnitGUID("npc")) or "")
  7.  
  8.     -- its a string because it just came from a string
  9.     if npc=="135614" then -- wowhead.com/npc=135614
  10.  
  11.         -- first argument is the ordered number of the gossip window
  12.         -- in this case, 2 would select "stay awhile and listen"
  13.         -- second argument is when a gossip option pops up a box
  14.         -- that needs input, currently only used to interact with
  15.         -- the Tyrael's Hilt npc or Landro Longshot
  16.         -- third argument skips any possible confirmation dialog
  17.         -- that the gossip option may generate
  18.         C_GossipInfo.SelectOption(1,"",true)
  19.  
  20.     end
  21. end)
  Reply With Quote