• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

TrinityCore WotLK Teleporte Eluna

Lstm

Respected Member
I was trying to add a submenu in my npc teleporting but it still fails to be very noob in Eluna, someone could provide me with some information to make such a change and leave according as I wish?
I would also add a tools menu with Set My Hearthstone, Bank and Mail
The script used is this!


I wanted to add the submenu Instances and Raid
Code:
[COLOR="#FF0000"]
-- by FoeReaper of EmuDevs.com
-- Modified by slp13at420 of EmuDevs.com
print("+-+-+-+-+-+-+-+-+-+-+-+")
print("+     Teleporter      +")
print("+     Loading...      +")
print("+-+-+-+-+-+-+-+-+-+-+-+")

[3] = {"|TInterface/Icons/Achievement_Boss_CThun:40:40:-14|tInstances", 2, 2,
		{"|TInterface/Icons/Achievement_Level_10:40:40:-14|tLevel 10-40", 2, 2, 1, 530, 2029.750000, 6232.069824, 133.494980, 1.303950},
		{"|TInterface/Icons/Achievement_Level_40:40:40:-14|tLevel 41-69", 2, 2, 1, 530, -207.335007, 2035.920044, 96.463997, 1.596760},
		{"|TInterface/Icons/Achievement_Level_70:40:40:-14|tLevel 70-80", 2, 2, 1, 530, -1610.849976, 7733.620117, -17.277300, 1.335220},
		
		},
			
	[4] = {"|TInterface/Icons/Achievement_Boss_LichKing:40:40:-14|tRaids", 9, 2,
		{"|TInterface/Icons/Achievement_Zone_EasternKingdoms_01:40:40:-14|tClassic Raids", 2, 2, 1, 1, 4249.990234, 740.101990, -25.671000, 1.340620},
		{"|TInterface/Icons/Achievement_Zone_Kalimdor_01:40:40:-14|tBurning Crusade Raids", 2, 2, 1, 0, -7179.339844, -921.211975, 165.820999, 5.095990},
		{"|TInterface/Icons/Achievement_Zone_Northrend_01:40:40:-14|tWrath of The Lich King Raids", 2, 2, 1, 0, -7527.049805, -1226.770020, 285.731995, 5.296260},
			},	[/COLOR]


Code:
local itemid = nil -- to use with an item change from nil to item id.
local npcid = 100019 -- to use with an npc change from nil to npc id.
local Teleport = {};
local Color = {
	[1] = "", -- Ally -- blue
	[2] = "", -- Horde -- red
	[3] = "", -- Both -- green
	[4] = "", -- GM -- black
		};
-- Menu Title, icon, team, {location name, icon, team, minimum level, map, x, y, z, o}

-- icon 0=bubble::1=bag::2=flight::3=book::4=wheel::5=wheel::6=bag dot::7=bubble dots::8=tabard::9=2swords::10=dot

-- team :: 0 = ally, 1 = horde,  2 = horde/ally, 3 = gm /:T:\ 2 checks for a reason

Teleporter = {
	[1] = {"|TInterface/Icons/Achievement_WorldEvent_Lunar:40:40:-14|tMall", 2, 2,
		{"|TInterface/Icons/Inv_Misc_Tournaments_banner_Human:40:40:-14|tAlliance Mall", 				1, 0, 1, 	0, -8500.637695, 	1115.817505, 17.944719, 1.560146},
		{"|TInterface/Icons/Inv_Misc_Tournaments_banner_Orc:40:40:-14|tHorde Mall", 					1, 1, 1, 	530, 9688.199219, -7447.814453, 13.601118, 4.668594},
		{"|TInterface/Icons/ability_mage_coldasice:40:40:-14|tTransmog Mall", 							2, 2, 1, 	571, 5780.717285, 583.949707, 565.303406, 1.698786},
		},
		
	[2] = {"|TInterface/Icons/Achievement_WorldEvent_ChildrensWeek:40:40:-14|tCities", 2, 2,
		-- TELEPORTE ALLY
		{"|cff0000FF-- Alliance --|r", 8, 0, 1},
		{"|TInterface/Icons/Inv_Misc_Tournaments_banner_Human:26:26:-14|tStormwind", 					8, 0, 1, 	0, 	-8829.954102, 623.858276, 93.886230, 3.857445},
		{"|TInterface/Icons/Inv_Misc_Tournaments_Symbol_Dwarf:26:26:-14|tIronforge", 					8, 0, 1, 	0, -4918.879883, -940.406006, 501.563995, 5.423470},
		{"|TInterface/Icons/Inv_Misc_Tournaments_banner_Nightelf:26:26:-14|tDarnassus", 				8, 0, 1, 	1, 9952.044922, 2280.140625, 1341.394043, 1.588014},
		{"|TInterface/Icons/Inv_Misc_Tournaments_Symbol_Draenei:26:26:-14|tExodar", 					8, 0, 1, 	530, -3965.699951, -11653.599609, -138.843994, 0.852154},
		
		{"|cffFF0000-- Horde --|r", 8, 0, 1},
		{"|TInterface/Icons/Inv_Misc_Tournaments_banner_Orc:26:26:-14|tInvadir em Orgrimmar", 			8, 0, 1, 	1, 1276.557495, -4349.433594, 33.097115, 0.858401},
		{"|TInterface/Icons/Inv_Misc_Tournaments_Symbol_Tauren:26:26:-14|tInvadir em Thunder Bluff", 	8, 0, 1, 	1, -1305.345581, 211.944519, 68.681328, 5.034245},
		{"|TInterface/Icons/Inv_Misc_Tournaments_Symbol_BloodElf:26:26:-14|tInvadir em Silvermoon", 	8, 0, 1, 	530, 9259.864258, -7294.007324, 24.431414, 0.372467},
		{"|TInterface/Icons/Inv_Misc_Tournaments_Symbol_Scourge:26:26:-14|tInvadir em Undercity", 		8, 0, 1, 	0, 1698.361084, 749.673035, 73.008842, 4.015910},
		
		
		-- TELEPORTE HORDE
		{"|cffFF0000-- Horde --|r", 8, 1, 1},
		{"|TInterface/Icons/Inv_Misc_Tournaments_banner_Orc:26:26:-14|tOrgrimmar", 						8, 1, 1, 	1, 1600.981689, -4378.820313, 9.998322, 5.248190},
		{"|TInterface/Icons/Inv_Misc_Tournaments_Symbol_Tauren:26:26:-14|tThunder Bluff", 				8, 1, 1, 	1, -1274.449951, 71.860100, 128.158981, 0.707645},
		{"|TInterface/Icons/Inv_Misc_Tournaments_Symbol_BloodElf:26:26:-14|tSilvermoon", 				8, 1, 1, 	530, 9741.669922, -7454.189941, 13.557200, 3.142310},
		{"|TInterface/Icons/Inv_Misc_Tournaments_Symbol_Scourge:26:26:-14|tUndercity", 					8, 1, 1, 	0, 1637.209961, 240.132004, -43.103401, 3.131470},
		
		{"|cff0000FF-- Alliance --|r", 8, 1, 1},
		{"|TInterface/Icons/Inv_Misc_Tournaments_banner_Human:26:26:-14|tInvadir em Stormwind", 		8, 1, 1, 	1, 	1919.770020, 	-2169.679932, 	94.672897, 	6.141770},
		{"|TInterface/Icons/Inv_Misc_Tournaments_Symbol_Dwarf:26:26:-14|tInvadir em Ironforge", 		8, 1, 1, 	1, 	3117.120117, 	-4387.970215, 	91.905899, 	5.498970},
		{"|TInterface/Icons/Inv_Misc_Tournaments_banner_Nightelf:26:26:-14|tInvadir em Darnassus", 		8, 1, 1, 	530, 	-4192.620117, 	-12576.700195, 	36.759800, 	1.628130},
		{"|TInterface/Icons/Inv_Misc_Tournaments_Symbol_Draenei:26:26:-14|tInvadir em Exodar", 			8, 1, 1, 	530, 	-2095.699951, 	-11841.099609, 	51.155701, 	6.192880},
		
		
		-- NEUTRAL
		{"|cff483D8B-- Neutral --", 8, 2, 1},
		{"|TInterface/Icons/Spell_Arcane_PortalShattrath:26:26:-14|tShattrath", 						8, 2, 1, 	530, -1887.619995, 5359.089844, -12.427900, 1.258830},
		{"|TInterface/Icons/Spell_Arcane_PortalDalaran:26:26:-14|tDalaran", 							8, 2, 1, 	571, 5807.060059, 506.243988, 657.575989, 5.544610},
		{"|TInterface/Icons/Inv_Misc_Tournaments_banner_Bloodelf:26:26:-14|tIsle of Quel' Danas", 		8, 2, 1, 	530, 12806.500000, -6911.109863, 41.115601, 2.229350},
			},
			
	[3] = {"|TInterface/Icons/Achievement_Boss_CThun:40:40:-14|tInstances", 2, 2,
		{"|TInterface/Icons/Achievement_Level_10:40:40:-14|tLevel 10-40", 2, 2, 1, 530, 2029.750000, 6232.069824, 133.494980, 1.303950},
		{"|TInterface/Icons/Achievement_Level_40:40:40:-14|tLevel 41-69", 2, 2, 1, 530, -207.335007, 2035.920044, 96.463997, 1.596760},
		{"|TInterface/Icons/Achievement_Level_70:40:40:-14|tLevel 70-80", 2, 2, 1, 530, -1610.849976, 7733.620117, -17.277300, 1.335220},
		
		},
			
	[4] = {"|TInterface/Icons/Achievement_Boss_LichKing:40:40:-14|tRaids", 9, 2,
		{"|TInterface/Icons/Achievement_Zone_EasternKingdoms_01:40:40:-14|tClassic Raids", 2, 2, 1, 1, 4249.990234, 740.101990, -25.671000, 1.340620},
		{"|TInterface/Icons/Achievement_Zone_Kalimdor_01:40:40:-14|tBurning Crusade Raids", 2, 2, 1, 0, -7179.339844, -921.211975, 165.820999, 5.095990},
		{"|TInterface/Icons/Achievement_Zone_Northrend_01:40:40:-14|tWrath of The Lich King Raids", 2, 2, 1, 0, -7527.049805, -1226.770020, 285.731995, 5.296260},
			},	
			
	[5] = {"|TInterface/Icons/Achievement_BG_winWSG:40:40:-14|tPVP", 2, 2,
		{"|TInterface/Icons/Achievement_BG_killingblow_30:40:40:-14|tDire Maul Arena", 2, 2, 1, 571, 2954.239990, 5379.129883, 60.453800, 2.555440},
		{"|TInterface/Icons/Achievement_BG_killingblow_startingrock:40:40:-14|tGurubashi Arena", 2, 2, 2, 1, 571, 5411.169922, -699.369995, 167.082001, 1.571670},
		{"|TInterface/Icons/Achievement_BG_killingblow_berserker:40:40:-14|tArena Floor Nagrand", 2, 2, 2, 1, 571, 5411.169922, -699.369995, 167.082001, 1.571670},
		{"|TInterface/Icons/Achievement_BG_killingblow_most:40:40:-14|tCustom Arena", 2, 2, 2, 1, 571, 5411.169922, -699.369995, 167.082001, 1.571670},
			},
	[COLOR="#FF0000"][6] = {"|TInterface/Icons/Achievement_BG_winWSG:40:40:-14|tTools", 2, 2,
			{"|TInterface/Icons/INV_MISC_RUNE_01:40:40:-14|tDefinir Hearthstone", 2, 2, 1, 571, 2954.239990, 5379.129883, 60.453800, 2.555440},
			{"|TInterface/Icons/INV_Misc_Bag_07:40:40:-14|tVerificar Bank", 2, 2, 1, 571, 2954.239990, 5379.129883, 60.453800, 2.555440},
{"|TInterface/Icons/INV_Misc_Bag_07:40:40:-14|tVerificar Mail", 2, 2, 1, 571, 2954.239990, 5379.129883, 60.453800, 2.555440},
			},[/COLOR]
		}

local function TeleportStoneOnHello(event, player, unit, sender, intid, code, lang)

	if (player:IsInCombat()~=true)then	-- Show main menu
	    
	    for i, v in ipairs(Teleporter) do

	        if(v[3] == 2)or(v[3] == player:GetTeam())or(player:IsGM() == true)then
	            player:GossipMenuAddItem(v[2], ""..Color[v[3]+1]..""..v[1], i, 0)
	        end
	    end
	    	player:GossipSendMenu(1, unit)
    else
		player:SendNotification("Você está em combate.")
	end
end

local function TeleporterOnGossipSelect(event, player, unit, sender, intid, code)

    if (sender == 0) then -- return to main menu
        TeleportStoneOnHello(event, player, unit)
    return
    end

    if (intid == 0) then -- Show teleport sub-menu
    
        for i, v in ipairs(Teleporter[sender]) do

            if (i > 3) then

            	if((Teleporter[sender][i][3] == 2 or Teleporter[sender][i][3] == player:GetTeam())or(player:IsGM() == true))then
                	player:GossipMenuAddItem(v[2], ""..(Color[((Teleporter[sender][i][3])+1)]).."".. v[1].."|r", sender, i)
                end
            end
		end
	        player:GossipMenuAddItem(7, "|TInterface/PaperDollInfoFrame/UI-GearManager-Undo:40:40:-14|tVoltar", 0, 0)
	        player:GossipSendMenu(1, unit)
        return
    else
        -- teleport --
        local name, icon, team, level, map, x, y, z, o = table.unpack(Teleporter[sender][intid])
        player:Teleport(map, x, y, z, o)
    end
	player:GossipComplete()
end

if(itemid ~= nil)then
	RegisterItemGossipEvent(itemid, 1, TeleportStoneOnHello)
	RegisterItemGossipEvent(itemid, 2, TeleporterOnGossipSelect)
end

if(npcid ~= nil)then
	RegisterCreatureGossipEvent(npcid, 1, TeleportStoneOnHello)
	RegisterCreatureGossipEvent(npcid, 2, TeleporterOnGossipSelect)
end

-- by FoeReaper of EmuDevs.com
-- Modified by slp13at420 of EmuDevs.com
 
Last edited:

Tommy

Founder
You mention that the script fails? Are there any errors? Look in Eluna.log and Server.log. Unless you mean there's no Lua errors and it just fails to show your menus?..

#moreinfo
 

Lstm

Respected Member
For example I tried to add a submenu for my INSTANCES menu and did not work the way it was put so


Code:
[3] = {"|TInterface/Icons/Achievement_Boss_CThun:40:40:-14|tInstances", 2, 2,
		{"|TInterface/Icons/Achievement_Level_10:40:40:-14|tLevel 10-40", 2, 2, 1, 	
		{"TESTE INSTANCE 10-40", 2, 2, 1, 530, 2029.750000, 6232.069824, 133.494980, 1.303950},
		
		{"|TInterface/Icons/Achievement_Level_40:40:40:-14|tLevel 41-69", 								2, 2, 1, 	530, -207.335007, 2035.920044, 96.463997, 1.596760},
		{"|TInterface/Icons/Achievement_Level_70:40:40:-14|tLevel 70-80", 								2, 2, 1, 	530, -1610.849976, 7733.620117, -17.277300, 1.335220},
		
		},

This is the error

Code:
[COLOR="#FF0000"]2016-05-01_11:13:38 ERROR [Eluna]: Error loading `lua_scripts/npc_teleporte.lua`
2016-05-01_11:13:38 ERROR lua_scripts/npc_teleporte.lua:87: '}' expected (to close '{' at line 16) near 'local'[/COLOR]
 

Lstm

Respected Member
I do not know who would be the credits a friend who gave me this script
just wanted to know the importance of adding this option to add a submenu someone could help me?
 

Foereaper

Founder
You would have to rewrite the entire logic of the script, you are better off rewriting it from scratch or finding a different script that already supports what you want.
 

slp13at420

Mad Scientist
The original script is not written to support this. I am also sure the original author would appreciate you keeping the credits intact.

now I could be way wrong on this but I think its my mutation of your work [MENTION=7]Foereaper[/MENTION] -->

but it looks like someone's been cutting at it.
 
Last edited:

Lstm

Respected Member
I did not know who was this script, just received from a friend on skype
And now I can see that is Foereaper
I apologize but did not really know who he was and his credits are kept from now
 

slp13at420

Mad Scientist
I did not know who was this script, just received from a friend on skype
And now I can see that is Foereaper
I apologize but did not really know who he was and his credits are kept from now

no prob. at least you are honest . some do try to claim stuff we recognize as someone else's work but they claim is there own lol.

the credits are for the user and maker.
they will give you a base history of the script who/when/what - who made it, when they made it, and for what they made.
for us its gets our name out there. I know I would enjoy knowing my name is a common name out there among the servers as would many others.

95% of this script is [MENTION=7]Foereaper[/MENTION] the other 5% is my modifications for a few more bells n whistles.

As [MENTION=7]Foereaper[/MENTION] stated earlier, this was scripted solely as a teleporter script. you would be better off just doing a gossip vendor from scratch rather than trying to add vendor stuff to this.
 
Last edited:
Top