Skip to content

Commit

Permalink
Get djinn teleport realm based on current region
Browse files Browse the repository at this point in the history
  • Loading branch information
NetDwarf committed Sep 30, 2022
1 parent 2a1ec1a commit abd24df
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion GameServer/gameobjects/Atlantis/Teleporter/AncientBoundDjinn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,9 @@ protected override bool GetTeleportLocation(GamePlayer player, string text)
return base.GetTeleportLocation(player, text);
}

var currentRegionRealm = GetRegionRealm(this.CurrentRegion);
// Find the teleport location in the database. For Djinns use the player realm to match Interact list given.
Teleport port = WorldMgr.GetTeleportLocation(player.Realm, String.Format("{0}:{1}", Type, text));
Teleport port = WorldMgr.GetTeleportLocation(currentRegionRealm, String.Format("{0}:{1}", Type, text));

if (port != null)
{
Expand All @@ -254,6 +255,13 @@ protected override bool GetTeleportLocation(GamePlayer player, string text)
return true; // Needs further processing.
}

private eRealm GetRegionRealm(Region region)
{
if(region.ID < 73) return eRealm.Midgard;
else if(region.ID < 130) return eRealm.Albion;
else return eRealm.Hibernia;
}


/// <summary>
/// Player has picked a subselection.
Expand Down

0 comments on commit abd24df

Please sign in to comment.