Problem with Gossip Script menu

User Tag List

Results 1 to 9 of 9
  1. #1
    controlsx2's Avatar Member
    Reputation
    16
    Join Date
    Jun 2007
    Posts
    223
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with Gossip Script

    Im having a problem with the following script. It works fine. But any of the 'Help me make options' does nothing. It seems i cant do anything other than gossip with the NPC. The Say or give item functions arnt working, but they work when used with other non gossip NPC's

    Code:
    function AngelSmithGossipOnTalk(Unit, Event, player)
    	Unit:GossipCreateMenu(100, player, 0)
    	Unit:GossipMenuAddItem(0, "Who are you?", 1, 0)
    	Unit:GossipMenuAddItem(0, "Can you help me forge a powerful weapon?", 2, 0)
    	Unit:GossipMenuAddItem(0, "Can you help me forge powerful armor?", 10, 0)
    	Unit:GossipMenuAddItem(0, "Never mind.", 3, 0)
    	Unit:GossipSendMenu(player)
    end
    
    function AngelSmithGossipOnSelect(Unit, Event, player, id, intid, code, pMisc)
    	if (intid == 2) then
    			Unit:GossipCreateMenu(100, player, 0)
    	Unit:GossipMenuAddItem(0, "Help me craft a Sword", 4, 0)
    	Unit:GossipMenuAddItem(0, "Help me to craft a Staff", 5, 0)
    	Unit:GossipMenuAddItem(0, "Help me craft a Dagger", 21, 0)
    	Unit:GossipMenuAddItem(0, "Help me to craft a Bow", 22, 0)
    	Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    	Unit:GossipSendMenu(player)
    	end
    	
    	if (intid == 10) then
    			Unit:GossipCreateMenu(100, player, 0)
    	Unit:GossipMenuAddItem(0, "Help me craft a Helmet", 11, 0)
    	Unit:GossipMenuAddItem(0, "Help me to craft Gloves", 12, 0)
    	Unit:GossipMenuAddItem(0, "Help me craft Boots", 13, 0)
    	Unit:GossipMenuAddItem(0, "Help me to craft a Belt", 14, 0)
    	Unit:GossipMenuAddItem(0, "Help me craft Bracers", 15, 0)
    	Unit:GossipMenuAddItem(0, "Help me to craft Shoulders", 16, 0)
    	Unit:GossipMenuAddItem(0, "Help me craft Legs", 17, 0)
    	Unit:GossipMenuAddItem(0, "Help me to craft a Chestpiece", 18, 0)
    	Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    	Unit:GossipSendMenu(player)
    	end
    	
    	if (intid == 1) then
    		Unit:GossipCreateMenu(100, player, 0)
    	Unit:GossipMenuAddItem(0, "I am a Weaponsmith, I left my home in Ironforge a long time ago in order to aid the new heroes of our lands. If you are able to recover an ancient angelic relic i will be able to craft you a weapon of great power.", 99, 0)
    	Unit:GossipMenuAddItem(0, "Okay", 3, 0)
    	Unit:GossipSendMenu(player)
    	end
    	
    	
    	--CRAFT ITEM
    	
    	if (intid == 11) then
    	player:GossipComplete()
    		if player:HasItem(191501) then
    
    		player:RemoveItem(191501)
            player:AddItem(191510)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Headguard is Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		end
    
    	end
    	if (intid == 12) then
    	player:GossipComplete()
    		if player:HasItem(191501) then
    		player:RemoveItem(191501)
            player:AddItem(191511)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Handguards is Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		end
    
    	end
    	if (intid == 13) then
    	player:GossipComplete()
    		if player:HasItem(191501) then
    
    		player:RemoveItem(191501)
            player:AddItem(191507)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Boots are Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		end
    
    	end
    	if (intid == 14) then
    	player:GossipComplete()
    		if player:HasItem(191501) then
    
    		player:RemoveItem(191501)
            player:AddItem(191506)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Waistguard is Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		end
    
    	end
    	if (intid == 15) then
    	player:GossipComplete()
    		if player:HasItem(191501) then
    
    		player:RemoveItem(191501)
            player:AddItem(191505)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Bracers are Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		end
    
    	end
    	if (intid == 16) then
    	player:GossipComplete()
    		if player:HasItem(191501) then
    
    		player:RemoveItem(191501)
            player:AddItem(191504)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Shoulders are Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		end
    
    	end
    	if (intid == 17) then
    	player:GossipComplete()
    		if player:HasItem(191501) then
    
    		player:RemoveItem(191501)
            player:AddItem(191503)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Legguards are Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		end
    
    	end
    	if (intid == 18) then
    	player:GossipComplete()
    		if player:HasItem(191501) then
    
    		player:RemoveItem(191501)
            player:AddItem(191502)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Chestpiece is Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		end
    
    	end
    	-- CRAFT WEAPONS
    	if (intid == 4) then
    	
    		if (player:HasItem(191501)) then
    		player:GossipComplete()
    		player:RemoveItem(191501)
            player:AddItem(191525)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Sword is Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		end
    
    	end
    	
    	if (intid == 5) then
    	player:GossipComplete()
    		if player:HasItem(191501) then
    
    		player:RemoveItem(191501)
            player:AddItem(191524)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Staff is Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		end
    	end
    
    	if (intid == 21) then
    		player:GossipComplete()
    		if player:HasItem(191501) then
    
    		player:RemoveItem(191501)
            player:AddItem(191527)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Dagger is Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		end
    
    	end
    	
    	if (intid == 22) then
    	player:GossipComplete()
    		if player:HasItem(191501) then
    
    		player:RemoveItem(191501)
            player:AddItem(191526)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Bow is Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		end
    	end
    
    	
    if (intid == 3) then
    		player:GossipComplete()
    
    end
    
    end
    
    function AngelSmith_OnSpawn(Unit, Event)
    Unit:CastSpell(46565)
    Unit:CastSpellOnTarget(46565, Unit)
    end
    
    
    
    -- RegisterUnitEvents
    RegisterUnitGossipEvent(291505, 1, "AngelSmithGossipOnTalk")
    RegisterUnitGossipEvent(291505, 2, "AngelSmithGossipOnSelect")
    RegisterUnitEvent(291505, 18, "AngelSmith_OnSpawn")

    Problem with Gossip Script
  2. #2
    riizu's Avatar Active Member
    Reputation
    16
    Join Date
    Oct 2007
    Posts
    263
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    From what I can tell, the player:GossipComplete() function exits out of the gossip script. Wouldn't one only want this to happen if the player selects "Never mind" or lacks the item?

    For example:
    Code:
    	if (intid == 22) then
    	player:GossipComplete()
    		if player:HasItem(191501) then
    
    		player:RemoveItem(191501)
            player:AddItem(191526)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Bow is Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		end
    	end
    Could be:

    Code:
    	if (intid == 22) then
    	
    	        if player:HasItem(191501) then
                    player:GossipComplete()
    		player:RemoveItem(191501)
            player:AddItem(191526)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Bow is Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		end
    	end
    Assuming im understanding right, doing that would result in the NPC checking if the player has the item, if they do then close the gossip, remove the item, add the bow, and then send the chat message. Otherwise, create a menu that states they dont have the required artifact.

    Also, if your creating a menu, wouldnt you need to send it?
    Last edited by riizu; 07-13-2010 at 04:01 PM.

  3. #3
    controlsx2's Avatar Member
    Reputation
    16
    Join Date
    Jun 2007
    Posts
    223
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by riizu View Post

    Also, if your creating a menu, wouldnt you need to send it?
    God your right! How could i not have noticed lol. Thanks!

  4. #4
    Rock Lee's Avatar Banned
    Reputation
    41
    Join Date
    Jul 2010
    Posts
    155
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    player:GossipComplete() should be at the bottom of the menu. Example:

    Code:
    	if (intid == 22) then
    		if (player:HasItem(191501)) then
    		player:RemoveItem(191501)
    		player:AddItem(191526)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Bow is Complete!")
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    		Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		end
    	player:GossipComplete()
    	end
    Although i dont understand why you create a new menu - if the person doesnt have the item - where he's able to select the "You require an Angelic Artifact before i can help you" - option.
    Wouldnt it be better to just put player:GossipComplete() there instead and maybe a Unit:SendChatMessage(12, 0, "You require an Angelic Artifact before i can help you") before that?

  5. #5
    riizu's Avatar Active Member
    Reputation
    16
    Join Date
    Oct 2007
    Posts
    263
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Basically what I stated SombreroShark Minus the switch to the SendChatMessage, but I believe he wants the player to be able to go back into the menu.

    controlsx2, here's my edit on your script.

    Code:
    function AngelSmithGossipOnTalk(Unit, Event, player)
    	Unit:GossipCreateMenu(100, player, 0)
    	Unit:GossipMenuAddItem(0, "Who are you?", 1, 0)
    	Unit:GossipMenuAddItem(0, "Can you help me forge a powerful weapon?", 2, 0)
    	Unit:GossipMenuAddItem(0, "Can you help me forge powerful armor?", 10, 0)
    	Unit:GossipMenuAddItem(0, "Never mind.", 3, 0)
    	Unit:GossipSendMenu(player)
    end
    
    function AngelSmithGossipOnSelect(Unit, Event, player, id, intid, code, pMisc)
    	if (intid == 2) then
    			Unit:GossipCreateMenu(100, player, 0)
    			Unit:GossipMenuAddItem(0, "Help me craft a Sword", 4, 0)
    			Unit:GossipMenuAddItem(0, "Help me to craft a Staff", 5, 0)
    			Unit:GossipMenuAddItem(0, "Help me craft a Dagger", 21, 0)
    			Unit:GossipMenuAddItem(0, "Help me to craft a Bow", 22, 0)
    			Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    			Unit:GossipSendMenu(player)
    	end
    	
    	if (intid == 10) then
    			Unit:GossipCreateMenu(100, player, 0)
    			Unit:GossipMenuAddItem(0, "Help me craft a Helmet", 11, 0)
    			Unit:GossipMenuAddItem(0, "Help me to craft Gloves", 12, 0)
    			Unit:GossipMenuAddItem(0, "Help me craft Boots", 13, 0)
    			Unit:GossipMenuAddItem(0, "Help me to craft a Belt", 14, 0)
    			Unit:GossipMenuAddItem(0, "Help me craft Bracers", 15, 0)
    			Unit:GossipMenuAddItem(0, "Help me to craft Shoulders", 16, 0)
    			Unit:GossipMenuAddItem(0, "Help me craft Legs", 17, 0)
    			Unit:GossipMenuAddItem(0, "Help me to craft a Chestpiece", 18, 0)
    			Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    			Unit:GossipSendMenu(player)
    	end
    	
    	if (intid == 1) then
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I am a Weaponsmith, I left my home in Ironforge a long time ago in order to aid the new heroes of our lands. If you are able to recover an ancient angelic relic i will be able to craft you a weapon of great power.", 99, 0)
    		Unit:GossipMenuAddItem(0, "Okay", 3, 0)
    		Unit:GossipSendMenu(player)
    	end
    	
    	
    	--CRAFT ITEM
    	
    	if (intid == 11) then
    		if player:HasItem(191501) then
    		player:GossipComplete()
    		player:RemoveItem(191501)
            player:AddItem(191510)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Headguard is Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		Unit:GossipSendMenu(player)
    		end
    
    	end
    	if (intid == 12) then
    		if player:HasItem(191501) then
    		player:GossipComplete()
    		player:RemoveItem(191501)
            player:AddItem(191511)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Handguards is Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		Unit:GossipSendMenu(player)
    		end
    
    	end
    	if (intid == 13) then
    		if player:HasItem(191501) then
    		player:GossipComplete()
    		player:RemoveItem(191501)
            player:AddItem(191507)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Boots are Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		Unit:GossipSendMenu(player)
    		end
    
    	end
    	if (intid == 14) then	
    		if player:HasItem(191501) then
    		player:GossipComplete()
    		player:RemoveItem(191501)
            player:AddItem(191506)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Waistguard is Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		Unit:GossipSendMenu(player)
    		end
    
    	end
    	if (intid == 15) then
    		if player:HasItem(191501) then
    		player:GossipComplete()
    		player:RemoveItem(191501)
            player:AddItem(191505)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Bracers are Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		Unit:GossipSendMenu(player)
    		end
    
    	end
    	if (intid == 16) then
    		if player:HasItem(191501) then
    		player:GossipComplete()
    		player:RemoveItem(191501)
            player:AddItem(191504)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Shoulders are Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		Unit:GossipSendMenu(player)
    		end
    
    	end
    	if (intid == 17) then
    		if player:HasItem(191501) then
    		player:GossipComplete()
    		player:RemoveItem(191501)
            player:AddItem(191503)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Legguards are Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		Unit:GossipSendMenu(player)
    		end
    
    	end
    	if (intid == 18) then	
    		if player:HasItem(191501) then
    		player:GossipComplete()
    		player:RemoveItem(191501)
            player:AddItem(191502)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Chestpiece is Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		Unit:GossipSendMenu(player)
    		end
    
    	end
    	-- CRAFT WEAPONS
    	if (intid == 4) then
    	
    		if (player:HasItem(191501)) then
    		player:GossipComplete()
    		player:RemoveItem(191501)
            player:AddItem(191525)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Sword is Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		Unit:GossipSendMenu(player)
    		end
    
    	end
    	
    	if (intid == 5) then
    		if player:HasItem(191501) then
    		player:GossipComplete()
    		player:RemoveItem(191501)
            player:AddItem(191524)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Staff is Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		Unit:GossipSendMenu(player)
    		end
    	end
    
    	if (intid == 21) then	
    		if player:HasItem(191501) then
    		player:GossipComplete()
    		player:RemoveItem(191501)
            player:AddItem(191527)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Dagger is Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		Unit:GossipSendMenu(player)
    		end
    
    	end
    	
    	if (intid == 22) then
    		if player:HasItem(191501) then
    		player:GossipComplete()
    		player:RemoveItem(191501)
            player:AddItem(191526)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Bow is Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		Unit:GossipSendMenu(player)
    		end
    	end
    
    	
    if (intid == 3) then
    		player:GossipComplete()
    		end
    
    end
    
    function AngelSmith_OnSpawn(Unit, Event)
    Unit:CastSpell(46565)
    Unit:CastSpellOnTarget(46565, Unit)
    end
    
    
    
    -- RegisterUnitEvents
    RegisterUnitGossipEvent(291505, 1, "AngelSmithGossipOnTalk")
    RegisterUnitGossipEvent(291505, 2, "AngelSmithGossipOnSelect")
    RegisterUnitEvent(291505, 18, "AngelSmith_OnSpawn")
    This incorporates the GossipSendMenu function you left out, as well as a Player:GossipComplete if they have the item.

  6. #6
    Rock Lee's Avatar Banned
    Reputation
    41
    Join Date
    Jul 2010
    Posts
    155
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by riizu View Post
    Basically what I stated SombreroShark Minus the switch to the SendChatMessage, but I believe he wants the player to be able to go back into the menu.
    Yes, but your script was faulty.

    Code:
    	if (intid == 22) then
    	player:GossipComplete()
    		if player:HasItem(191501) then
    
    		player:RemoveItem(191501)
            player:AddItem(191526)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Bow is Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		end
    	end

  7. #7
    riizu's Avatar Active Member
    Reputation
    16
    Join Date
    Oct 2007
    Posts
    263
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wait what? Um... direct copypaste from my last code post.
    Code:
    if (intid == 22) then
    		if player:HasItem(191501) then
    		player:GossipComplete()
    		player:RemoveItem(191501)
            player:AddItem(191526)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Bow is Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		Unit:GossipSendMenu(player)
    		end
    What you just linked was his original code... anyways no big deal. Was just saying we both agreed, not flaming you...

  8. #8
    Rock Lee's Avatar Banned
    Reputation
    41
    Join Date
    Jul 2010
    Posts
    155
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by riizu View Post
    Wait what? Um... direct copypaste from my last code post.
    Code:
    if (intid == 22) then
    		if player:HasItem(191501) then
    		player:GossipComplete()
    		player:RemoveItem(191501)
            player:AddItem(191526)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Bow is Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		Unit:GossipSendMenu(player)
    		end
    What you just linked was his original code... anyways no big deal. Was just saying we both agreed, not flaming you...
    I wasnt flaming you either. The only reason i replied was cause your code was faulty.

    Originally Posted by riizu View Post
    From what I can tell, the player:GossipComplete() function exits out of the gossip script. Wouldn't one only want this to happen if the player selects "Never mind" or lacks the item?

    For example:
    Code:
    	if (intid == 22) then
    	player:GossipComplete()
    		if player:HasItem(191501) then
    
    		player:RemoveItem(191501)
            player:AddItem(191526)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Bow is Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		end
    	end
    Could be:

    Code:
    	if (intid == 22) then
    	
    	        if player:HasItem(191501) then
                    player:GossipComplete()
    		player:RemoveItem(191501)
            player:AddItem(191526)
    		Unit:SendChatMessage(12, 0, "Congratulations! Your Bow is Complete!")  --Insert Relic removal and weapon gaining here when weapons are made
    		else
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "You require an Angelic Artifact before i can help you", 99, 0)
    	    Unit:GossipMenuAddItem(0, "Never mind", 3, 0)
    		end
    	end
    Assuming im understanding right, doing that would result in the NPC checking if the player has the item, if they do then close the gossip, remove the item, add the bow, and then send the chat message. Otherwise, create a menu that states they dont have the required artifact.

    Also, if your creating a menu, wouldnt you need to send it?

  9. #9
    riizu's Avatar Active Member
    Reputation
    16
    Join Date
    Oct 2007
    Posts
    263
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The first code copy was HIS code. And then I preceded to post MY code afterwards.

    For Example: = his code

    Could Be = my code edits

Similar Threads

  1. Problem with Lua scripts!
    By wour55 in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 09-12-2010, 04:10 PM
  2. Problem with lua script :/ please help!
    By robinelitenn in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 10-24-2009, 05:10 PM
  3. Problem with LUA scripted Mobs
    By foamysquirl in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 07-24-2009, 02:45 PM
  4. [Help Plzzzz] LUA Problem with KJ Script
    By Arthas117 in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 08-16-2008, 05:25 PM
  5. Problems with my C++ script
    By Sylex in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 02-07-2008, 08:04 AM
All times are GMT -5. The time now is 01:44 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