Neccta
Exalted Member
Alright this is kinda hard to explain but I'll try my best.
I was using a teleporter script by Foereaper, it worked fine but when I used two of them (With different NPCS) it started to give me errors. I couldn't figure it out so then I decided to use a different script and keep the other one by Foereaper. This is were it got weird, I could open the new teleporter gossip and it would work fine. But if I hit the back button it would load Foereapers script, even though both scripts where using different NPCS. So lets say "Horde Towns" is Intid 1 (On the new script) and then I press it, rather than taking me to a sub menu it would open or teleport me to whatever Intid is in Foereapers script. Then I wanted to see if it would still do that with two of the new teleport scripts. I got the same results.
So that's my story.
Here is Foereapers Scipt:
Here is the new script:
I was using a teleporter script by Foereaper, it worked fine but when I used two of them (With different NPCS) it started to give me errors. I couldn't figure it out so then I decided to use a different script and keep the other one by Foereaper. This is were it got weird, I could open the new teleporter gossip and it would work fine. But if I hit the back button it would load Foereapers script, even though both scripts where using different NPCS. So lets say "Horde Towns" is Intid 1 (On the new script) and then I press it, rather than taking me to a sub menu it would open or teleport me to whatever Intid is in Foereapers script. Then I wanted to see if it would still do that with two of the new teleport scripts. I got the same results.
So that's my story.
Here is Foereapers Scipt:
Code:
--[[ How to add new locations!
Example:
The first line will be the main menu ID (Here [1],
increment this for each main menu option!),
the main menu gossip title (Here "Horde Cities"),
as well as which faction can use the said menu (Here 1 (Horde)).
0 = Alliance, 1 = Horde, 2 = Both
The second line is the name of the main menu's sub menus,
separated by name (Here "Orgrimmar") and teleport coordinates
using Map, X, Y, Z, O (Here 1, 1503, -4415.5, 22, 0)
[1] = { "Horde Cities", 1, --
{"Orgrimmar", 1, 1503, -4415.5, 22, 0},
},
You can copy paste the above into the script and change the values as informed.
]]
local UnitEntry = 190003
local T = {
[1] = { "Cities and Daily Quests", 1,
{"Orgrimmar", 1, 1503, -4415.5, 22, 0},
},
[2] = { "Leveling Zones", 1,
{"Borean Tundra", 571, 3230, 5279, 47, 3},
{"Crystalsong Forest", 571, 5732, 1016, 175, 3.6},
{"Dragonblight", 571, 3547, 274, 46, 1.6},
{"Grizzly Hills", 571, 3759, -2672, 177, 3},
},
[3] = { "PvP Locations", 1,
{"Azshara Crater", 37, 88.649, 305.546, 290.091, 0.677},
{"Gurubashi Arena", 0, -13262, 161, 36, 1},
},
[4] = { "Dungeons", 1,
{"Ragefire Chasm (Easy)", 1, 1881.780, -4410.500, -18.470, 5.201},
{"The Shattered Halls (Medium)", 530, -305.541, 3059.297, -2.550, 1.1760},
{"Zul'Farrak (Hard)", 1, -6797.43, -2890.73, 8.88, 6.262},
{"Stormwind Stockade (Easy) (Cross-Faction)", 0, -8799.58, 826.26, 97.635, 0.1236},
{"Razorfen Downs (Medium) (Cross-Faction)", 1, -4657.3, -2519.35, 81.0529, 4.548},
},
[5] = { "Raids", 2,
{"The Obsidian Sanctum", 571, 3472, 264, -120, 3},
},
[6] = { "Reputaion Zones", 1,
{"Thunderbluff Reputation", 1, -2919.855, -258.653, 53.019, 0.1388},
{"Orgrimmar Reputation", 1, -1891.958, -3701.681, 6.230, 2.570},
{"Darkspear Troll Reputation", 1, -1268.180, -5507.819, 4.975, 5.8405},
{"Silvermoon City Reputation", 530, 8849.885, -6272.041, 7.293, 4.999},
{"Undercity Reputation", 0, 1210.288, -1743.128, 62.108, 5.452},
},
};
--[[ CODE STUFFS! DO NOT EDIT BELOW ]]--
--[[ UNLESS YOU KNOW WHAT YOU'RE DOING! ]]--
function Teleporter_Gossip(event, player, unit)
if (#T <= 10) then
for i, v in ipairs(T) do
if(v[2] == 2 or v[2] == player:GetTeam()) then
player:GossipMenuAddItem(0, v[1], 0, i)
end
end
player:GossipSendMenu(1, unit)
else
print("This teleporter only supports 10 different menus.")
end
end
function Teleporter_Event(event, player, unit, sender, intid, code)
if(intid == 0) then
Teleporter_Gossip(event, player, unit)
elseif(intid <= 10) then
for i, v in ipairs(T[intid]) do
if (i > 2) then
player:GossipMenuAddItem(0, v[1], 0, intid..i)
end
end
player:GossipMenuAddItem(0, "Back", 0, 0)
player:GossipSendMenu(1, unit)
elseif(intid > 10) then
for i = 1, #T do
for j, v in ipairs(T[i]) do
if(intid == tonumber(i..j)) then
player:GossipComplete()
player:Teleport(v[2], v[3], v[4], v[5], v[6])
end
end
end
end
end
RegisterCreatureGossipEvent(UnitEntry, 1, Teleporter_Gossip)
RegisterCreatureGossipEvent(UnitEntry, 2, Teleporter_Event)
Here is the new script:
Code:
local Zerazal = {}
local T =
{
-- Horde Cities
{1, 1503, -4415.5, 22, 0}, -- Orgrimmar intid 1
{1, 326.809, -4706.649, 15.366, 4.164}, -- Razor Hill intid 2
{0, -563.598, -4570.899, 9.430, 0.353}, -- Revantusk Village intid 3
-- Ally Cities
{0, -8905, 560, 94, 0.62}, -- Stormwind intid 4
{0, -9449.842, 64.223, 56.044, 3.1109}, -- Goldshire intid 5
{0, 235.409, -2100.9, 119.599, 4.58}, -- Aeire Peak intid 6
-- Reputation Locations
{1, -2919.855, -258.653, 53.019, 0.1388}, -- Thunderbluff Reputation intid 7
{1, -1891.958, -3701.681, 6.230, 2.570}, -- Orgrimmar Reputation intid 8
{1, -1268.180, -5507.819, 4.975, 5.8405}, -- Darkspear Troll Reputation intid 9
{530, 8849.885, -6272.041, 7.293, 4.999}, -- Silvermoon City Reputation intid 10
{0, 1210.288, -1743.128, 62.108, 5.452}, -- Undercity Reputation intid 11
{0, -9381.62, -3010.91, 136.687, 4.2414}, -- Stormwind Reputation intid 12
{0, -5684.05, -1592.45, 383.204, 2.8096}, -- Ironforge Reputation intid 13
{0, -5254.95, 404.271, 391.53, 2.673}, -- Gnomeeregan Reputation intid 14
{1, 2098, -1190.43, 101.787, 3.1674}, -- Darnassus Reputation intid 15
{530, -4906.55, -11167, 29.8235, 4.447}, -- Exodar Reputation intid 16
-- Dungeon Locations
{0, -8799.58, 826.26, 97.635, 0.1236}, -- Stormwind Stockade intid 17
{1, 1815.0726, -4417.857, -16.2574, 5.112}, -- Ragefire Chasm intid 18
{530, -305.541, 3059.297, -2.550, 1.1760}, -- The Shattered Halls intid 19
{1, -4657.3, -2519.35, 81.0529, 4.548}, -- Razorfen Downs intid 20
{1, -6797.43, -2890.73, 8.88, 6.262}, -- Zul'Farrak intid 21
-- PvP Locations
{0, -13229, 226, 33, 1}, -- Gurubashi intid 22
{37, 88.649, 305.546, 290.091, 0.677}, -- Azshara Crater (Horde) intid 23
{0, -13229, 226, 33, 1}, -- Gurubashi intid 24
{37, 475.742, 84.435, 259.205, 2.419}, -- Azshara Crater (Alliance) intid 25
-- Raid Locations
{571, 3472, 264, -120, 3}, -- The Obsidian Sanctum intid 26
-- Leveling Zones
{0, 529.931, -274.057, 151.030, 2.843}, -- Alterac intid 27
{0, -388.269, 1543.824, 16.848, 3.101}, -- Pyrewood Village intid 28
{0, -1744.351, -3147.505, 29.846, 2.466}, -- Witherbark Village intid 29
{0, -486.102, -1426.47, 88.815, 4.7824}, -- Durnholde intid 30
{0, -853.22, -533.528, 9.9855, 0.2428}, -- Southshore intid 31
{0, 2932.58, -716.622, 151.675, 4.484}, -- Scarlet Monastary intid 32
}
function Teleporter_Gossip(event, plr, unit)
plr:GossipMenuAddItem(2, "Main Cities", 0, 1001, 0)
plr:GossipMenuAddItem(8, "Reputation Zones", 0, 1002, 0)
plr:GossipMenuAddItem(5, "Dungeons", 0, 1003, 0)
plr:GossipMenuAddItem(9, "PvP Locations", 0, 1004, 0)
plr:GossipMenuAddItem(3, "Raids", 0, 1005, 0)
plr:GossipMenuAddItem(6, "Leveling Zones", 0, 1006, 0)
plr:GossipSendMenu(1, unit)
end
function Teleporter_Event(event, plr, unit, arg2, intid)
if(intid >= 1) and (intid <= 100) then
plr:Teleport(T[intid][1], T[intid][2], T[intid][3], T[intid][4], T[intid][5])
elseif(intid == 1000) then
Teleporter_Gossip(event, plr, unit)
elseif(intid >= 1001) and (intid <= 1006) then
if(intid == 1001) then
if(plr:GetTeam() == 1) then
plr:GossipMenuAddItem(2, "Orgrimmar", 0, 1)
plr:GossipMenuAddItem(2, "Razor Hill", 0, 2)
plr:GossipMenuAddItem(2, "Revantusk Village", 0, 3)
else
plr:GossipMenuAddItem(2, "Stormwind", 0, 4)
plr:GossipMenuAddItem(2, "Goldshire", 0, 5)
plr:GossipMenuAddItem(2, "Aeire Peak", 0, 6)
end
elseif(intid == 1002) then
if(plr:GetTeam() == 1) then
plr:GossipMenuAddItem(8, "Thunderbluff Reputation", 0, 7)
plr:GossipMenuAddItem(8, "Orgrimmar Reputation", 0, 8)
plr:GossipMenuAddItem(8, "Darkspear Troll Reputation", 0, 9)
plr:GossipMenuAddItem(8, "Silvermoon City Reputation", 0, 10)
plr:GossipMenuAddItem(8, "Undercity Reputation", 0, 11)
else
plr:GossipMenuAddItem(8, "Stormwind Reputation", 0, 12)
plr:GossipMenuAddItem(8, "Ironforge Reputation", 0, 13)
plr:GossipMenuAddItem(8, "Gnomeeregan Reputation", 0, 14)
plr:GossipMenuAddItem(8, "Darnassus Reputation", 0, 15)
plr:GossipMenuAddItem(8, "Exodar Reputation", 0, 16)
end
elseif(intid == 1003) then
plr:GossipMenuAddItem(5, "Stormwind Stockade (Easy)", 0, 17)
plr:GossipMenuAddItem(5, "Ragefire Chasm (Easy)", 0, 18)
plr:GossipMenuAddItem(5, "The Shattered Halls (Medium)", 0, 19)
plr:GossipMenuAddItem(5, "Razorfen Downs (Medium)", 0, 20)
plr:GossipMenuAddItem(5, "Zul'Farrak (Hard)", 0, 21)
elseif(intid == 1004) then
if(plr:GetTeam() == 1) then
plr:GossipMenuAddItem(9, "Gurubashi Arena", 0, 22)
plr:GossipMenuAddItem(9, "Azshara Crater", 0, 23)
else
plr:GossipMenuAddItem(9, "Gurubashi Arena", 0, 24)
plr:GossipMenuAddItem(9, "Azshara Crater", 0, 25)
end
elseif(intid == 1005) then
plr:GossipMenuAddItem(3, "The Obsidian Sanctum", 0, 26)
elseif(intid == 1006) then
if(plr:GetTeam() == 1) then
plr:GossipMenuAddItem(6, "Alterac", 0, 27)
plr:GossipMenuAddItem(6, "Pyrewood Village", 0, 28)
plr:GossipMenuAddItem(6, "Witherbark Village", 0, 29)
else
plr:GossipMenuAddItem(6, "Durnholde", 0, 30)
plr:GossipMenuAddItem(6, "Southshore", 0, 31)
plr:GossipMenuAddItem(6, "Scarlet Monastary", 0, 32)
end
end
plr:GossipMenuAddItem(0, "Back", 0, 1000)
plr:GossipSendMenu(1, unit)
end
end
RegisterCreatureGossipEvent(190003, 1, Teleporter_Gossip)
RegisterCreatureGossipEvent(190003, 2, Teleporter_Event)