[ArcEmu] Custom flight path that requires an item (3.3.5a) menu

User Tag List

Results 1 to 4 of 4
  1. #1
    Teryaki's Avatar Legendary Explorer CoreCoins Purchaser
    Reputation
    667
    Join Date
    Mar 2010
    Posts
    950
    Thanks G/R
    103/82
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [ArcEmu] Custom flight path that requires an item (3.3.5a)

    Hey Ownedcore!

    I am back in the WoW mood, but for some older things. I recently compiled a 3.3.5a ArcEmu server, and I have this fascination for creating custom flight paths. I have been experimenting a bit with a script that makes it so a certain item is required to start the flight, if it is not present in the player's bags, then it sends them a message saying they don't have the required item. I got it to work for a brief moment, and then I went to tweak something and now the gossip doesn't even start anymore. Here is the code, I suspect it has something to do with the player:GossipComplete() section. I am not sure it is placed in the right area, but I tried replacing it pretty much everywhere within the if statement. I can get the npc to start the flight path without the item requirement, but I know this method works because I got it to work for a bit before I messed with it.

    Code:
    if (intid == 3) then
        if (player:IsInCombat()==true) then
            player:SendAreaTriggerMessage("You are in combat!")
        else
            if (player:GetItemCount(item1id) > 0 then
                CustomFlightPath = LuaTaxi:CreateTaxi()
                for I, MyFP in ipairs(MyFlightPath) do
                CustomFlightPath:AddPathNode(MyFP[1], MyFP[2], MyFP[3], MyFP[4])
                end
                player:RemoveItem(item1id, 1)
                player:StartTaxi(CustomFlightPath, GetDisplay)
            else
                player:SendAreaTriggerMessage("You do not have the required item in your inventory!")
            end
        end
    player:GossipComplete()
    end
    If you see anything that might be misplaced, misspelled, or illegal coding, please let me know. It is driving me crazy to get it to work again.

    Just a note: item1id was defined as local at the top of the program. Here is the full program. I am just testing LUA with this mob, so there are just random crap coded in this script. It worked before adding the code I placed above.

    Code:
    local GetDisplay = 17699
    local NPCID = 90000
    local item1id = 49623
    
    local MyFlightPath = {
        {1, 16218.30, 16277.84, 25},
        {1, 16206.73, 16251.14, 32},
        {1, 16228.76, 16230.82, 42},
        {1, 16266.93, 16246.27, 63},
        {1, 16275.62, 16281.19, 66},
        {1, 16250.80, 16298.93, 51},
        {1, 16224.79, 16301.91, 49},
        {1, 16206.46, 16313.54, 39},
        {1, 16189.04, 16307.65, 34},
        {1, 16214.10, 16285.48, 26},
        {1, 16218.45, 16281.15, 21}
    }
    
    local GMIslandTest = {
        {1, 16218.30, 16277.84, 25},
        {1, 16206.73, 16251.14, 32},
        {1, 16228.76, 16230.82, 42},
        {1, 16266.93, 16246.27, 63},
        {1, 16275.62, 16281.19, 66},
        {1, 16250.80, 16298.93, 51},
        {1, 16224.79, 16301.91, 49},
        {1, 16206.46, 16313.54, 39},
        {1, 16189.04, 16307.65, 34},
        {1, 16214.10, 16285.48, 26},
        {1, 16218.45, 16281.15, 21}
    }
    
    
    function Flight_Master_OnGossipTalk(pUnit, event, player, pMisc)
    pUnit:GossipCreateMenu(50, player, 0)
    pUnit:GossipMenuAddItem(9, "Show Me Where I Can fly.", 1, 0)
    pUnit:GossipMenuAddItem(4, "Show Me What Else You Have To Offer.", 5, 0)
    pUnit:GossipMenuAddItem(9, "Never Mind", 2, 0)
    pUnit:GossipSendMenu(player)
    end
    
    
    function Flight_Master_OnGossipSelect(pUnit, event, player, id, intid, code, pMisc)
    if (intid == 1) then
    pUnit:GossipCreateMenu(50, player, 0)
    pUnit:GossipMenuAddItem(9, "Custom Location", 3, 0, "The Cost: 1 Shadowmourne")
    pUnit:GossipMenuAddItem(9, "GM Island Joy Ride", 4, 0, "The Cost: 1 Shadowmourne", 100)
    pUnit:GossipMenuAddItem(9, "Never Mind", 2, 0)
    pUnit:GossipSendMenu(player)
    end
    
    if (intid == 2) then
    player:GossipComplete()
    end
    
    if (intid == 3) then
        if (player:IsInCombat()==true) then
            player:SendAreaTriggerMessage("You are in combat!")
        else
            if (player:GetItemCount(item1id) > 0 then
                CustomFlightPath = LuaTaxi:CreateTaxi()
                for I, MyFP in ipairs(MyFlightPath) do
                CustomFlightPath:AddPathNode(MyFP[1], MyFP[2], MyFP[3], MyFP[4])
                end
                player:RemoveItem(item1id, 1)
                player:StartTaxi(CustomFlightPath, GetDisplay)
            else
                player:SendAreaTriggerMessage("You do not have the required item in your inventory!")
            end
        end
    player:GossipComplete()
    end
    
    if (intid == 4) then
            GMIslandJoy = LuaTaxi:CreateTaxi()
            for I, MyFP in ipairs(GMIslandTest) do
            GMIslandJoy:AddPathNode(MyFP[1], MyFP[2], MyFP[3], MyFP[4])
            end
            player:DealGoldCost(100)
            player:StartTaxi(GMIslandJoy, GetDisplay)
            player:GossipComplete()
    end
    
    if (intid == 5) then
    pUnit:GossipCreateMenu(50, player, 0)
    pUnit:GossipMenuAddItem(4, "Weather", 6, 0)
    pUnit:GossipMenuAddItem(5, "Queue Me For A Battleground!", 7, 0)
    pUnit:GossipMenuAddItem(5, "Show Me The Money!", 8, 0)
    pUnit:GossipMenuAddItem(5, "Screw the Battlegrounds, give me honor! (200 honor)", 9, 0, "The Cost:", 2000000)
    pUnit:GossipMenuAddItem(9, "Never Mind", 2, 0)
    pUnit:GossipSendMenu(player)
    end
    
    if (intid == 6) then
    pUnit:GossipCreateMenu(50, player, 0)
    pUnit:GossipMenuAddItem(6, "Sunny", 10, 0)
    pUnit:GossipMenuAddItem(6, "Foggy", 11, 0, "The Cost:", 20000)
    pUnit:GossipMenuAddItem(6, "Rainy", 12, 0, "The Cost:", 23000)
    pUnit:GossipMenuAddItem(6, "Monsoon", 13, 0, "The Cost:", 25000)
    pUnit:GossipMenuAddItem(6, "Snowy", 14, 0 , "The Cost:", 34000)
    pUnit:GossipMenuAddItem(6, "Sandstorm", 15, 0, "The Cost:", 22000)
    pUnit:GossipMenuAddItem(9, "Never Mind", 2, 0)
    pUnit:GossipSendMenu(player)
    end
    
    if (intid == 9) then
            player:DealGoldCost(2000000)
            player:GiveHonor(200)
            player:GossipComplete()
    end
    
    if (intid == 10) then
            player:SetPlayerWeather(0, 1)
            player:GossipComplete()
    end
    
    if (intid == 11) then
            player:DealGoldCost(20000)
            player:SetPlayerWeather(1, 1)
            player:GossipComplete()
    end
    
    if (intid == 12) then
            player:DealGoldCost(23000)
            player:SetPlayerWeather(2, 1)
            player:GossipComplete()
    end
    
    if (intid == 13) then
            player:DealGoldCost(25000)
            player:SetPlayerWeather(4, 1)
            player:GossipComplete()
    end
    
    if (intid == 14) then
            player:DealGoldCost(34000)
            player:SetPlayerWeather(8, 1)
            player:GossipComplete()
    end
    
    if (intid == 15) then
            player:DealGoldCost(22000)
            player:SetPlayerWeather(16, 1)
            player:GossipComplete()
    end
    
    if (intid == 8) then
            player:SendBankWindow(player)
            player:GossipComplete()
    end  
    end
    
    RegisterUnitGossipEvent(90000, 1, "Flight_Master_OnGossipTalk")
    RegisterUnitGossipEvent(90000, 2, "Flight_Master_OnGossipSelect")
    Thanks for reading, I will keep trying to figure out why that particular part of the code is not working in the meantime.

    Teryaki
    Last edited by Teryaki; 05-24-2012 at 08:56 PM.
    My Exploration Channel: Teryaki's Channel
    Teryaki#1806

    [ArcEmu] Custom flight path that requires an item (3.3.5a)
  2. #2
    Deadendz's Avatar Private
    Reputation
    19
    Join Date
    Jul 2010
    Posts
    5
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can try this, make sure the script actually loads too.

    Code:
    if (intid == 3) then
        if (player:IsInCombat()==true) then
            player:SendAreaTriggerMessage("You are in combat!")
        elseif (player:GetItemCount(item1id)) > 0 then
            CustomFlightPath = LuaTaxi:CreateTaxi() 
    	for i = 1, #MyFlightPath do
    		MYFP = MyFlightPath[i]
    		CustomFlightPath:AddPathNode(MYFP[1], MYFP[2], MYFP[3], MYFP[4])
    	end  
            player:RemoveItem(item1id, 1)
            player:StartTaxi(CustomFlightPath, GetDisplay)
        else
            player:SendAreaTriggerMessage("You do not have the required item in your inventory!")
        end
        player:GossipComplete()
    end
    Edit: Fixed

    And this whole script works for me:

    Code:
    local GetDisplay = 17699
    local NPCID = 90000
    local item1id = 49623
    
    local MyFlightPath = {
        {1, 16218.30, 16277.84, 25},
        {1, 16206.73, 16251.14, 32},
        {1, 16228.76, 16230.82, 42},
        {1, 16266.93, 16246.27, 63},
        {1, 16275.62, 16281.19, 66},
        {1, 16250.80, 16298.93, 51},
        {1, 16224.79, 16301.91, 49},
        {1, 16206.46, 16313.54, 39},
        {1, 16189.04, 16307.65, 34},
        {1, 16214.10, 16285.48, 26},
        {1, 16218.45, 16281.15, 21}
    }
    
    
    local GMIslandTest = {
        {1, 16218.30, 16277.84, 25},
        {1, 16206.73, 16251.14, 32},
        {1, 16228.76, 16230.82, 42},
        {1, 16266.93, 16246.27, 63},
        {1, 16275.62, 16281.19, 66},
        {1, 16250.80, 16298.93, 51},
        {1, 16224.79, 16301.91, 49},
        {1, 16206.46, 16313.54, 39},
        {1, 16189.04, 16307.65, 34},
        {1, 16214.10, 16285.48, 26},
        {1, 16218.45, 16281.15, 21}
    }
    
    
    function Flight_Master_OnGossipTalk(pUnit, event, player, pMisc)
    	pUnit:GossipCreateMenu(50, player, 0)
    	pUnit:GossipMenuAddItem(9, "Show Me Where I Can fly.", 1, 0)
    	pUnit:GossipMenuAddItem(4, "Show Me What Else You Have To Offer.", 5, 0)
    	pUnit:GossipMenuAddItem(9, "Never Mind", 2, 0)
    	pUnit:GossipSendMenu(player)
    end
    
    
    function Flight_Master_OnGossipSelect(pUnit, event, player, id, intid, code, pMisc)
    	if (intid == 1) then
    		pUnit:GossipCreateMenu(50, player, 0)
    		pUnit:GossipMenuAddItem(9, "Custom Location", 3, 0, "The Cost: 1 Shadowmourne")
    		pUnit:GossipMenuAddItem(9, "GM Island Joy Ride", 4, 0, "The Cost: 1 Shadowmourne", 100)
    		pUnit:GossipMenuAddItem(9, "Never Mind", 2, 0)
    		pUnit:GossipSendMenu(player)
    	end
    
    	if (intid == 2) then
    		player:GossipComplete()
    	end
    
    	if (intid == 3) then
    		if (player:IsInCombat()==true) then
    			player:SendAreaTriggerMessage("You are in combat!")
    		elseif (player:GetItemCount(item1id)) > 0 then
    			CustomFlightPath = LuaTaxi:CreateTaxi() 
    			for i = 1, #MyFlightPath do
    			     MYFP = MyFlightPath[i]
    		             CustomFlightPath:AddPathNode(MYFP[1], MYFP[2], MYFP[3], MYFP[4])
    			end 
    			player:RemoveItem(item1id, 1)
    			player:StartTaxi(CustomFlightPath, GetDisplay)
    		else
    			player:SendAreaTriggerMessage("You do not have the required item in your inventory!")
    		end
    			player:GossipComplete()
    	end
    
    	if (intid == 4) then
                 GMIslandJoy = LuaTaxi:CreateTaxi() 
                 for i = 1, #GMIslandTest do
    	          local GMFP = GMIslandTest[i]
    	          GMIslandJoy:AddPathNode(GMFP[1], GMFP[2], GMFP[3], GMFP[4])
                 end 
                 player:DealGoldCost(100)
                 player:StartTaxi(GMIslandJoy, GetDisplay)
                 player:GossipComplete()
    	end
    
    	if (intid == 5) then
    		pUnit:GossipCreateMenu(50, player, 0)
    		pUnit:GossipMenuAddItem(4, "Weather", 6, 0)
    		pUnit:GossipMenuAddItem(5, "Queue Me For A Battleground!", 7, 0)
    		pUnit:GossipMenuAddItem(5, "Show Me The Money!", 8, 0)
    		pUnit:GossipMenuAddItem(5, "Screw the Battlegrounds, give me honor! (200 honor)", 9, 0, "The Cost:", 2000000)
    		pUnit:GossipMenuAddItem(9, "Never Mind", 2, 0)
    		pUnit:GossipSendMenu(player)
    	end
    
    	if (intid == 6) then
    		pUnit:GossipCreateMenu(50, player, 0)
    		pUnit:GossipMenuAddItem(6, "Sunny", 10, 0)
    		pUnit:GossipMenuAddItem(6, "Foggy", 11, 0, "The Cost:", 20000)
    		pUnit:GossipMenuAddItem(6, "Rainy", 12, 0, "The Cost:", 23000)
    		pUnit:GossipMenuAddItem(6, "Monsoon", 13, 0, "The Cost:", 25000)
    		pUnit:GossipMenuAddItem(6, "Snowy", 14, 0 , "The Cost:", 34000)
    		pUnit:GossipMenuAddItem(6, "Sandstorm", 15, 0, "The Cost:", 22000)
    		pUnit:GossipMenuAddItem(9, "Never Mind", 2, 0)
    		pUnit:GossipSendMenu(player)
    	end
    
    	if (intid == 9) then
            player:DealGoldCost(2000000)
            player:GiveHonor(200)
            player:GossipComplete()
    	end
    
    	if (intid == 10) then
            player:SetPlayerWeather(0, 1)
            player:GossipComplete()
    	end
    
    	if (intid == 11) then
            player:DealGoldCost(20000)
            player:SetPlayerWeather(1, 1)
            player:GossipComplete()
    	end
    
    	if (intid == 12) then
            player:DealGoldCost(23000)
            player:SetPlayerWeather(2, 1)
            player:GossipComplete()
    	end
    
    	if (intid == 13) then
            player:DealGoldCost(25000)
            player:SetPlayerWeather(4, 1)
            player:GossipComplete()
    	end
    
    	if (intid == 14) then
            player:DealGoldCost(34000)
            player:SetPlayerWeather(8, 1)
            player:GossipComplete()
    	end
    
    	if (intid == 15) then
            player:DealGoldCost(22000)
            player:SetPlayerWeather(16, 1)
            player:GossipComplete()
    	end
    
    	if (intid == 8) then
            player:SendBankWindow(player)
            player:GossipComplete()
    	end  
    end
    
    RegisterUnitGossipEvent(NPCID, 1, "Flight_Master_OnGossipTalk")
    RegisterUnitGossipEvent(NPCID, 2, "Flight_Master_OnGossipSelect")
    Last edited by Deadendz; 05-24-2012 at 10:26 PM.

  3. #3
    Teryaki's Avatar Legendary Explorer CoreCoins Purchaser
    Reputation
    667
    Join Date
    Mar 2010
    Posts
    950
    Thanks G/R
    103/82
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm, I will give it a try. I am fairly certain the script is loading, because if I ditch that part of the code entirely it loads up and I can interact with the NPC.

    Edit: OMG you are awesome. I have been working on trying to figure out how to get it to work for the past 2 days! +rep to you! Thank you!
    Last edited by Teryaki; 05-24-2012 at 10:51 PM.
    My Exploration Channel: Teryaki's Channel
    Teryaki#1806

  4. #4
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Also on a side note, GossipComplete() simply closes the gossip window for that player. It does not matter where it is called, unless you try to add gossip buttons to the menu once it has been closed (for example). You can still interact with the player after closure since the player variable has not changed and is not affected by a gossip.

Similar Threads

  1. [Noob Friendly] Custom Flight Paths (Requires client side patch)
    By Nadromar in forum WoW EMU Guides & Tutorials
    Replies: 15
    Last Post: 09-27-2022, 05:19 PM
  2. [Lua Script] Custom flight path problem.
    By DaynNight in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 02-19-2012, 12:00 PM
  3. [Lua Script] What are the commands for the custom flight paths ?
    By Wheeze201 in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 06-27-2010, 12:46 PM
  4. [ArcEmu] Custom arrows "That item cannot be Equipped."
    By Joonas in forum WoW EMU Questions & Requests
    Replies: 5
    Last Post: 03-24-2010, 09:41 AM
  5. Making a Item that requires honor or mark of honor
    By Rellik29 in forum WoW Items & Quests
    Replies: 1
    Last Post: 05-23-2008, 07:52 AM
All times are GMT -5. The time now is 05:10 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search