diff --git a/Data/Config/teleporters.cfg b/Data/Config/teleporters.cfg new file mode 100644 index 0000000..6ebeaa7 --- /dev/null +++ b/Data/Config/teleporters.cfg @@ -0,0 +1,106 @@ +# Format: Map1 x1 y1 z1 Map2 x2 y2 z2 [Back(true/false)] +# Covetous +Britannia 2888 659 0 Underworld 1088 1235 25 true +Britannia 2889 659 0 Underworld 1088 1235 25 true +Underworld 1024 1320 0 Underworld 1071 1476 0 true +Underworld 1024 1321 0 Underworld 1071 1477 0 true +Underworld 1024 1322 0 Underworld 1071 1478 0 true +Underworld 843 1501 0 Underworld 909 1747 0 true +Underworld 843 1502 0 Underworld 909 1748 0 true +Underworld 843 1503 0 Underworld 909 1749 0 true +Underworld 884 1651 -13 Underworld 727 1731 20 true +Underworld 885 1651 -13 Underworld 728 1731 20 true +Underworld 729 1731 20 Underworld 885 1651 -13 false +Underworld 924 1664 -18 Underworld 528 1732 20 true +Underworld 924 1665 -18 Underworld 528 1733 20 true +Underworld 528 1734 20 Underworld 924 1665 -18 false +#Deceit +Britannia 4193 1303 0 Underworld 115 2407 0 true +Britannia 4194 1303 0 Underworld 116 2407 0 true +Underworld 114 2407 0 Britannia 4193 1303 0 false +Underworld 117 2407 0 Britannia 4194 1303 0 false +Underworld 144 2355 -18 Underworld 296 2296 20 true +Underworld 145 2355 -18 Underworld 297 2296 20 true +Underworld 146 2355 -18 Underworld 298 2296 20 true +Underworld 338 2346 5 Underworld 73 2497 5 true +Underworld 154 2611 -38 Underworld 313 2504 20 true +Underworld 155 2611 -38 Underworld 314 2504 20 true +#Despise +Britannia 1646 1225 10 Underworld 731 1027 30 true +Britannia 1647 1225 10 Underworld 732 1027 30 true +Britannia 1648 1225 10 Underworld 733 1027 30 true +Britannia 1649 1225 10 Underworld 732 1027 30 false +Underworld 721 1004 50 Underworld 601 1105 41 true +Underworld 721 1005 50 Underworld 601 1106 41 true +Underworld 721 1006 50 Underworld 601 1107 41 true +Underworld 723 1008 12 Underworld 852 1144 40 true +Underworld 723 1009 12 Underworld 852 1145 40 true +Underworld 723 1010 12 Underworld 852 1146 40 true +Underworld 713 1227 -13 Underworld 485 1418 72 true +Underworld 713 1228 -13 Underworld 485 1419 72 true +Underworld 713 1229 -13 Underworld 485 1420 72 true +#Destard +Britannia 1535 2640 0 Underworld 1026 1095 4 true +Britannia 1536 2640 0 Underworld 1027 1095 4 true +Britannia 1537 2640 0 Underworld 1028 1095 4 true +Britannia 1538 2640 0 Underworld 1026 1095 4 false +Britannia 1539 2640 0 Underworld 1027 1095 4 false +Underworld 913 997 -28 Underworld 1022 525 22 true +Underworld 914 997 -28 Underworld 1023 525 22 true +Underworld 915 997 -28 Underworld 1024 525 22 true +Underworld 1025 525 22 Underworld 913 997 -28 false +Underworld 1033 536 -25 Underworld 979 736 25 true +Underworld 1033 537 -25 Underworld 979 737 25 true +Underworld 1033 538 -25 Underworld 979 738 25 true +Underworld 1033 539 -25 Underworld 979 739 25 true +#Hythloth +Britannia 4242 3395 0 Underworld 60 832 59 true +Britannia 4242 3396 0 Underworld 60 833 59 true +Britannia 4242 3397 0 Underworld 60 834 59 true +Britannia 4242 3398 0 Underworld 60 833 59 false +Underworld 141 883 22 Underworld 129 841 22 false +Underworld 57 912 0 Underworld 328 864 0 true +Underworld 275 864 4 Underworld 120 1040 -7 true +Underworld 275 865 4 Underworld 120 1041 -7 true +Underworld 120 1042 -7 Underworld 275 864 4 false +Underworld 82 1088 4 Underworld 288 1112 37 true +Underworld 82 1089 4 Underworld 288 1113 37 true +Underworld 288 1114 37 Underworld 82 1088 4 false +#Shame +Britannia 1380 1749 0 Underworld 554 175 0 true +Britannia 1381 1749 0 Underworld 555 175 0 true +Britannia 1382 1749 0 Underworld 556 175 0 true +Britannia 1383 1749 0 Underworld 555 175 0 false +Underworld 650 67 -25 Underworld 810 58 5 true +Underworld 900 150 5 Underworld 602 299 25 true +Underworld 626 322 5 Underworld 601 328 5 true +Underworld 595 314 5 Underworld 1075 299 -5 true +#Wrong +Britannia 2402 614 0 Underworld 719 887 5 true +Britannia 2403 614 0 Underworld 720 887 5 true +Underworld 721 887 5 Britannia 2402 614 0 false +Underworld 722 887 5 Britannia 2403 614 0 false +#Silent Tomb +Britannia 2182 2117 -13 Underworld 3762 979 17 true +Underworld 3762 980 17 Britannia 2182 2117 -13 false +Underworld 3742 922 0 Underworld 3514 997 0 true +Underworld 3743 922 0 Underworld 3515 997 0 true +Underworld 3461 933 0 Underworld 3991 990 0 true +Underworld 3462 933 0 Underworld 3992 990 0 true +Underworld 3485 962 11 Underworld 3485 962 11 true +Underworld 3485 963 11 Underworld 2186 2004 2 true +Britannia 2186 2004 2 Underworld 4010 937 17 false +Britannia 2186 2005 1 Underworld 4010 938 17 false +Underworld 4010 937 17 Britannia 2049 1935 -13 true +Underworld 4010 938 17 Britannia 2049 1935 -13 false +#Wailing Halls +Britannia 1568 1070 -19 Underworld 2985 211 0 true +Britannia 1568 1071 -19 Underworld 2985 212 0 true +Underworld 2985 213 0 Britannia 1568 1070 -19 false +Underworld 2985 214 0 Britannia 1568 1071 -19 false +Underworld 2985 215 0 Britannia 1568 1070 -19 false +Underworld 2985 216 0 Britannia 1568 1071 -19 false +Underworld 2888 296 -18 Underworld 2641 302 20 true +Underworld 2888 297 -18 Underworld 2641 303 20 true +Underworld 2708 182 -18 Underworld 2219 222 20 true +Underworld 2708 183 -18 Underworld 2219 223 20 true diff --git a/Scripts/Commands/GenTeleporter.cs b/Scripts/Commands/GenTeleporter.cs new file mode 100644 index 0000000..c4e6b7a --- /dev/null +++ b/Scripts/Commands/GenTeleporter.cs @@ -0,0 +1,93 @@ +using System; +using System.IO; +using Server; +using Server.Items; +using Server.Commands; + +namespace Server.Misc +{ + public class GenTeleporters + { + public static void Initialize() + { + CommandSystem.Register( "GenTeleporters", AccessLevel.Administrator, new CommandEventHandler( GenTeleporters_OnCommand ) ); + } + + [Usage( "GenTeleporters" )] + [Description( "Generates teleporters from Data/Config/teleporters.cfg" )] + public static void GenTeleporters_OnCommand( CommandEventArgs e ) + { + e.Mobile.SendMessage( "Generating teleporters..." ); + string filePath = Path.Combine( Core.BaseDirectory, "Data/Config/teleporters.cfg" ); + + int count = 0; + + if ( File.Exists( filePath ) ) + { + using ( StreamReader ip = new StreamReader( filePath ) ) + { + string line; + while ( (line = ip.ReadLine()) != null ) + { + line = line.Trim(); + + // Skip empty lines and comments + if ( line.Length == 0 || line.StartsWith( "#" ) ) + continue; + + string[] split = line.Split( ' ' ); + + // We need at least 8 parameters: Map1 X1 Y1 Z1 Map2 X2 Y2 Z2 + if ( split.Length >= 8 ) + { + try + { + Map map1 = Map.Parse( split[0] ); + int x1 = Convert.ToInt32( split[1] ); + int y1 = Convert.ToInt32( split[2] ); + int z1 = Convert.ToInt32( split[3] ); + + Map map2 = Map.Parse( split[4] ); + int x2 = Convert.ToInt32( split[5] ); + int y2 = Convert.ToInt32( split[6] ); + int z2 = Convert.ToInt32( split[7] ); + + // Default to two-way unless false is explicitly stated + bool twoWay = true; + if ( split.Length >= 9 && split[8].ToLower() == "false" ) + { + twoWay = false; + } + + Point3D loc1 = new Point3D( x1, y1, z1 ); + Point3D loc2 = new Point3D( x2, y2, z2 ); + + // Create Teleporter A (Location 1 -> Location 2) + Teleporter tele1 = new Teleporter( loc2, map2 ); + tele1.MoveToWorld( loc1, map1 ); + count++; + + // Conditionally Create Teleporter B (Location 2 -> Location 1) + if ( twoWay ) + { + Teleporter tele2 = new Teleporter( loc1, map1 ); + tele2.MoveToWorld( loc2, map2 ); + count++; + } + } + catch + { + Console.WriteLine( "Warning: Error parsing teleporter line: {0}", line ); + } + } + } + } + e.Mobile.SendMessage( "{0} teleporters generated successfully.", count ); + } + else + { + e.Mobile.SendMessage( "Error: Could not find Data/Config/teleporters.cfg" ); + } + } + } +}