Lua NPC Gossip Checklist menu

User Tag List

Results 1 to 6 of 6
  1. #1
    iindigo's Avatar Active Member
    Reputation
    55
    Join Date
    Sep 2007
    Posts
    110
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lua NPC Gossip Checklist

    Ok, so I've been trying to get NPC gossip options figured out on my server (ArcEmu 3410), and even though I've done what I thought was needed, it won't work. Am I missing something? Here's what I've done:

    • Wrote a .lua file adding gossip options and registering the OnGossipTalk and OnGossipSelect events to my NPC's id.
    • Saved the .lua in my arcemu scripts directory
    • Restarted the server

    Lua support is enabled and working for things already in the DB, so that's not the problem. It's probably something really silly, but I'm not seeing what's wrong. Might anyone here have a clue?


    Thanks!
    Last edited by Ground Zero; 06-16-2010 at 06:13 AM.

    Lua NPC Gossip Checklist
  2. #2
    singoe's Avatar Active Member
    Reputation
    23
    Join Date
    May 2008
    Posts
    150
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It would be helpful if you uploaded you script to pastebin so we could see if there are any errors

  3. #3
    Dynashock's Avatar Contributor

    Reputation
    176
    Join Date
    Nov 2007
    Posts
    203
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you set the flags in creature_proto to 1? (can't remember if it's called npc_flags or just flags)
    Ignorance is bliss.

  4. #4
    iindigo's Avatar Active Member
    Reputation
    55
    Join Date
    Sep 2007
    Posts
    110
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, the creature's flag is set to 1, and when talked to in-game shows the default gossip ("Hello $N, how can I help you?").

    Here's my script thus far:


    Code:
    function NPCGossipTest_OnGossipTalk(pUnit, event, player, pMisc)
    pUnit:GossipCreateMenu(3544, player, 0)
    pUnit:GossipMenuAddItem(2, "Bake a cake!", 1, 0)
    pUnit:GossipMenuAddItem(2, "Bake a pie!", 2, 0)
    
    pUnit:GossipSendMenu(player)
    end
    
    RegisterUnitGossipEvent(500002, 1, "NPCGossipTest_OnGossipTalk")
    RegisterUnitGossipEvent(500002, 2, "NPCGossipTest_OnGossipSelect")
    I haven't even bothered with what the options do when clicked. I'm just trying to get the options to show up in the first place.

  5. #5
    iindigo's Avatar Active Member
    Reputation
    55
    Join Date
    Sep 2007
    Posts
    110
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just a quick bump...

    So is my script written incorrectly, or have I messed up elsewhere?


    Thanks again.

  6. #6
    diviee3's Avatar Sergeant Major
    Reputation
    16
    Join Date
    Jan 2010
    Posts
    176
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here you go:

    Code:
    function NPCGossipTest_OnGossipTalk(pUnit, event, player, pMisc)
    pUnit:GossipCreateMenu(100, player, 0)
    pUnit:GossipMenuAddItem(0, "Bake a cake!", 1, 0)
    pUnit:GossipMenuAddItem(0, "Bake a pie!", 2, 0)
    pUnit:GossipSendMenu(player)
    end
    
    function NPCGossipTest_OnGossipSelect(Unit, Event, player, id, intid, code, pMisc)
       if (intid  == 1) then
          player:SendBroadcastMessage("Here is your cake.")
          Unit:GossipComplete()
       end
    
       if (intid == 2) then
          player:SendBroadcastMessage("Here is your pie.")
          Unit:GossipComplete()
       end
    end
    
    
    RegisterUnitGossipEvent(500002, 1, "NPCGossipTest_OnGossipTalk")
    RegisterUnitGossipEvent(500002, 2, "NPCGossipTest_OnGossipSelect")
    Instead of the chat messages, you can ofcourse put your own events in like additem or something. Take a look at some guides for cool events, for example from here: full list of lua commands

Similar Threads

  1. Replies: 40
    Last Post: 11-04-2008, 04:03 PM
  2. LUA: Understanding Gossip Menus
    By SectorSeven in forum WoW EMU Guides & Tutorials
    Replies: 46
    Last Post: 08-16-2008, 09:27 AM
  3. [Lua] NPC Announcer
    By Maven01 in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 06-19-2008, 03:34 PM
  4. [Help] NPC gossip
    By Stew in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 06-01-2008, 05:53 AM
  5. Unit Event Lua Question (Gossip Talk)
    By moongo in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 05-22-2008, 07:49 PM
All times are GMT -5. The time now is 03:51 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search