Gossip NPC menu

User Tag List

Thread: Gossip NPC

Results 1 to 4 of 4
  1. #1
    Deathmaker1's Avatar Private
    Reputation
    1
    Join Date
    Jan 2011
    Posts
    10
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Gossip NPC

    Hi guys,I'm doing an event for my server,and I'm stucked in this gossip script.
    The npcs after you click on the option "We're ready to Start" he must yell "Let's go" and then do the function Registered,but he stops here,doesn't do the other functions.
    Here's the code:
    Code:
    function Salvatore_Gossip(unit, event, player)
    unit:GossipCreateMenu(104, player, 0)
    unit:GossipMenuAddItem(0,"We're ready toStart", 4, 0)
    
    unit:GossipSendMenu(player)
    end
    
    function Salvatore_Submenus(unit, event, player, id, intid, code)
    if(intid == 4) then
    unit:SendChatMessage(14,0,"Let's go!")
    unit:RegisterEvent("Emote_Salvatore", 5000,1)
    unit:RegisterEvent("Yell_Salvatore", 7000,1)
    
    player:GossipComplete()
    end
    end
    function Emote_Salvatore(unit,Event)
    unit:SendChatMessage(42,0,"Lieutenant Sawer in 3 seconds!")
    end
    function Yell_Salvatore(unit,Event)
    unit:SendChatMessage(14,0,"You will dye!")
    unit:MoveTo(5845.81,608.71,650.90,0.00)
    end
    RegisterUnitGossipEvent(85788, 1, "Salvatore_Gossip")
    RegisterUnitGossipEvent(85788, 2, "Salvatore_Submenus")
    Last edited by Deathmaker1; 03-17-2011 at 04:16 AM.

    Gossip NPC
  2. #2
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Basically: registering within a gossip event is broken.

    Solution?

    Register a event on spawn that checks for if a variable is true. That variable only turns true once the gossip menu is used.

  3. #3
    Deathmaker1's Avatar Private
    Reputation
    1
    Join Date
    Jan 2011
    Posts
    10
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've done it but the NPC makes me the check on spawn only once

  4. #4
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    "Register a event on spawn"

    Register a event on spawn != on spawn.

    Example:
    Code:
    local gossip = false
    
    function onspawn(pUnit, Event)
    pUnit:RegisterEvent("check_for_gossip", 5000, 0)
    end
    
    function check_for_gossip(pUnit)
    if gossip then
    pUnit:RemoveEvents()
    pUnit:SendChatMessage(12,0,"Oh shiz, you talked to me!")
    gossip = false
    end
    end
    
    RegisterUnitEvent(npcid, 18, "onspawn")
    
    --gossip stuff
    
    function OnGossipOptionClick(stuff)
    if intid == 1 then
    gossip = true
    end
    end

Similar Threads

  1. [Lua Script] Two gossip npc's on the same script.
    By sora2810 in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 12-01-2010, 12:56 PM
  2. [Lua] Gossip NPC Question
    By Herbalism in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 11-07-2010, 06:52 AM
  3. How to : Basic Gossip NPC
    By Warriar in forum WoW EMU Guides & Tutorials
    Replies: 10
    Last Post: 01-27-2010, 11:32 PM
  4. LolKitteh Gossip NPC
    By dexterkris in forum WoW EMU General Releases
    Replies: 6
    Last Post: 09-16-2009, 01:13 PM
  5. [guides] boss and gossip npc in c++
    By scarfaze in forum WoW EMU Guides & Tutorials
    Replies: 4
    Last Post: 07-26-2009, 07:19 AM
All times are GMT -5. The time now is 11:04 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