Gossip NPC not working menu

User Tag List

Results 1 to 2 of 2
  1. #1
    choweyiii's Avatar Contributor
    Reputation
    91
    Join Date
    Aug 2010
    Posts
    127
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Gossip NPC not working

    I wanted a gossip NPC that a player can talk to to open a door, and spawn the boss inside, ideally I would like players not able to spawn another boss while one is already spawned (boss will despawn when it leaves combat). I don't get any errors when loading the script but, it stops working as I press "Jonathan, please open the door."

    Excuse the cheesy text, still working on that...

    Code:
    function On_Gossip(unit, event, player)
    unit:GossipCreateMenu(15704, player, 0) --There's a great evil held up inside this door, friend. I am the only one with access to the inside.
    unit:GossipMenuAddItem(0, "Jonathan, please open the door.", 1, 0)
    unit:GossipSendMenu(player)
    end
    
    function Gossip_Submenus(unit, event, player, id, intid, code)
    
    if(intid == 1) then
    unit:GossipCreateMenu(15607, player, 0) --What?! You can't be serious! If I open the gate then he will escape and this world will come to a swift end, and I will not allow that to happen!
    unit:GossipMenuAddItem(1, "We're not here for tea and crumpets, Jonathan. Me and my allies seek to destroy the evil one.", 2, 0)
    end
    	
    if(intid == 2) then
    unit:GossipCreateMenu(15606, player, 0) --Very well, then. I will open the gate for a short time. Once you and your allies enter the prison, you will not be able to exit until you defeat him.
    unit:GossipMenuAddItem(1, "I understand, Jonathan, open the gate.", 3, 0)
    end
    
    if(intid == 3) then
    unit:RegisterEvent("Jonathan_Open_Gate", 3000, 1)
    unit:RegisterEvent("Jonathan_Summon_Boss", 5000, 1)
    unit:SendChatMessage(12, 0, "Heros, quickly enter the prison, he cannot be allowed to escape!")
    end
    end
    
    function Jonathan_Open_Gate(unit, event)
      local x = unit:GetX()
      local y = unit:GetY()
      local z = unit:GetZ()
      local door = unit:GetGameObjectNearestCoords(x, y, z, 180904) --door I want opened's ID
    	if (door ~= nil) then
        door:Activate()
    	end
    end
     function Jonathan_Summon_Boss(unit, event)
      unit:SpawnCreature(99999, -8267.537109, 1539.098145, -4.42702, 1, 2212, 1)
      end
      
    RegisterUnitGossipEvent(15693, 1, "On_Gossip")
    RegisterUnitGossipEvent(15693, 2, "Gossip_Submenus")
    Any help will be repped :>

    Gossip NPC not working
  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)
    You cannot register events within a gossip.

    Change NPC flags and set a variable when the gossip is clicked and have a function from on spawn checking for that variable change, should it change register your events and continue as normal.

Similar Threads

  1. [Lua] npc teleport master not working
    By digger514 in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 08-23-2009, 04:33 PM
  2. [Lua] Gossip item not working -.-
    By Tikki100 in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 08-03-2009, 01:11 PM
  3. NPC for battlegrounds will not work.
    By Poyter606 in forum WoW PvP & Battlegrounds
    Replies: 0
    Last Post: 07-17-2008, 12:09 PM
  4. npc spawn command not working
    By Ganoran in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 11-01-2007, 09:06 PM
  5. Spawn NPC not working..
    By Volcomchamp in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 10-01-2007, 04:27 AM
All times are GMT -5. The time now is 08:58 AM. 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