All parts of zones/maps have areatriggers, and you can make it so that when you enter a areatrigger you get teleported (which is how Blizzard's portals work) but unfortunately you can not create your own areatrigger without a model edit.
You can, however, spawn a gameobject that shows the portal visual, and then have a invisible npc underneath it that checks for players and whether there in a group.
Code:
-- The ID's of the two invisible npc's (use displayid 11686 for invisible, scale 0.01 (optional) and in game target him and do .mod flags -10 to make him untargetable)
local npcid = 50000
local npcidtwo = 50001
-- Enterance
function InvisPortal_OnSpawn(pUnit, event)
pUnit:RegisterEvent("Check_for_players_invis_portal", 2000, 0) -- 1000 (1 second) is more effective but uses up more server resources
end
function Check_for_players_invis_portal(pUnit, event)
for a, plrs in pairs(pUnit:GetInRangePlayers()) do
if plrs ~= nil then
if pUnit:GetDistanceYards(plrs) < 5 then
if plrs:IsInGroup() then
plrs:Teleport(0, -13555.8, -174.028, 38.9217)
else
plrs:SendAreaTriggerMessage("|CFFff0000You must be in a group!|R")
end
end
end
end
end
RegisterUnitEvent(npcid, 18, "InvisPortal_OnSpawn")
-- Exit
function zInvisPortal_OnSpawn(pUnit, event)
pUnit:RegisterEvent("zCheck_for_players_invis_portal", 2000, 0) -- 1000 (1 second) is more effective but uses up more server resources
end
function zCheck_for_players_invis_portal(pUnit, event)
for a, aaaplrz in pairs(pUnit:GetInRangePlayers()) do
if aaaplrz ~= nil then
if pUnit:GetDistanceYards(aaaplrz) < 5 then
if aaaplrz:IsInGroup() then
aaaplrz:Teleport(0, -13469.4, 43.7858, 30.247)
else
aaaplrz:SendAreaTriggerMessage("|CFFff0000You must be in a group!|R")
end
end
end
end
end
RegisterUnitEvent(npcidtwo, 18, "zInvisPortal_OnSpawn")