From 6ce5680d9e717d7bf48b821273af059f0ef2a3c0 Mon Sep 17 00:00:00 2001 From: WarrentyExpired Date: Tue, 28 Jul 2026 11:34:32 -0400 Subject: [PATCH] #W# Made script to Export Dungeon Traps. --- .../Underworld/{Actions.cfg => CaveNPCs.cfg} | 0 Data/Decoration/Underworld/CavernsOfIce.cfg | 60 --- Data/Decoration/Underworld/Covetous.cfg | 86 ---- Data/Decoration/Underworld/SilentTomb.cfg | 85 ---- Data/Decoration/Underworld/Traps.cfg | 382 ++++++++++++++++++ Data/Decoration/Underworld/WailingHalls.cfg | 144 ------- Scripts/Commands/ExportTraps.cs | 66 +++ 7 files changed, 448 insertions(+), 375 deletions(-) rename Data/Decoration/Underworld/{Actions.cfg => CaveNPCs.cfg} (100%) create mode 100644 Data/Decoration/Underworld/Traps.cfg create mode 100644 Scripts/Commands/ExportTraps.cs diff --git a/Data/Decoration/Underworld/Actions.cfg b/Data/Decoration/Underworld/CaveNPCs.cfg similarity index 100% rename from Data/Decoration/Underworld/Actions.cfg rename to Data/Decoration/Underworld/CaveNPCs.cfg diff --git a/Data/Decoration/Underworld/CavernsOfIce.cfg b/Data/Decoration/Underworld/CavernsOfIce.cfg index 0a8a5b1..1b570f2 100644 --- a/Data/Decoration/Underworld/CavernsOfIce.cfg +++ b/Data/Decoration/Underworld/CavernsOfIce.cfg @@ -4,65 +4,5 @@ BookOfLore 3735 ChestOfSecrets 2193 88 476 -4 -SpikeTrap 4506 (Hue=1079) -77 674 0 - -FireColumnTrap 655 -92 478 -5 - -SpikeTrap 4506 (Hue=1079) -90 666 0 - -SpikeTrap 4506 (Hue=1079) -85 675 0 - -DartTrap 1027 -95 681 0 - -FireColumnTrap 655 -101 481 -4 - -SpikeTrap 4506 (Hue=1079) -101 666 0 - SecretBookDoor 8440 (Facing=WestCW; Hue=1088) 96 679 0 - -GiantSpikeTrap 7167 (Hue=1187) -129 484 -5 - -GiantSpikeTrap 7167 (Hue=1187) -145 459 -7 - -GiantSpikeTrap 7167 (Hue=1187) -164 482 -4 - -GiantSpikeTrap 7167 (Hue=1187) -161 511 -6 - -GiantSpikeTrap 7167 (Hue=1187) -185 504 -4 - -GiantSpikeTrap 7167 (Hue=1187) -198 526 -7 - -GiantSpikeTrap 7167 (Hue=1187) -221 483 -4 - -FireColumnTrap 655 -221 529 -5 - -GiantSpikeTrap 7167 (Hue=1187) -224 441 -5 - -GiantSpikeTrap 7167 (Hue=1187) -240 463 -4 - -FireColumnTrap 655 -240 534 -4 - -GiantSpikeTrap 7167 (Hue=1187) -271 457 -5 - -GiantSpikeTrap 7167 (Hue=1187) -285 518 -5 diff --git a/Data/Decoration/Underworld/Covetous.cfg b/Data/Decoration/Underworld/Covetous.cfg index d81cb97..1e80443 100644 --- a/Data/Decoration/Underworld/Covetous.cfg +++ b/Data/Decoration/Underworld/Covetous.cfg @@ -199,89 +199,3 @@ MetalDoor2 1741 (Facing=SouthCW) MetalDoor2 1735 (Facing=EastCCW) 946 1695 0 -MushroomTrap 6594 -914 1445 0 - -MushroomTrap 6594 -944 1503 1 - -FireColumnTrap 655 -1000 1495 0 - -MushroomTrap 6594 -1031 1227 0 - -MushroomTrap 6594 -1024 1284 0 - -MushroomTrap 6594 -1030 1487 0 - -FireColumnTrap 655 -1058 1481 0 - -MushroomTrap 6594 -1073 1247 0 - -FireColumnTrap 655 -1100 1222 0 - -MushroomTrap 6594 -1099 1302 0 - -FireColumnTrap 655 -1114 1221 0 - -FireColumnTrap 655 -1105 1224 0 - -MushroomTrap 6594 -516 1724 0 - -MushroomTrap 6594 -532 1752 0 - -DartTrap 1599 -703 1736 0 - -DartTrap 1599 -694 1736 0 - -DartTrap 1599 -875 1705 0 - -DartTrap 1027 -889 1679 0 - -FireColumnTrap 655 -883 1721 0 - -GasTrap 5005 -904 1674 0 - -DartTrap 1599 -898 1701 0 - -GiantSpikeTrap 7167 -907 1726 0 - -SawTrap 4524 -914 1685 0 - -DartTrap 1599 -917 1701 0 - -AxeTrap 4403 -924 1719 0 - -GiantSpikeTrap 7167 -942 1658 0 - -GiantSpikeTrap 7167 -939 1667 0 - -GiantSpikeTrap 7167 -949 1662 0 - -SpikeTrap 4360 -944 1681 4 diff --git a/Data/Decoration/Underworld/SilentTomb.cfg b/Data/Decoration/Underworld/SilentTomb.cfg index b8096bb..f73e6af 100644 --- a/Data/Decoration/Underworld/SilentTomb.cfg +++ b/Data/Decoration/Underworld/SilentTomb.cfg @@ -153,88 +153,3 @@ MetalDoor 1653 (Facing=WestCW) MetalDoor 1655 (Facing=EastCCW) 4026 968 0 - -GiantSpikeTrap 7167 -3461 959 0 - -GasTrap 5005 -3474 935 0 - -SawTrap 4374 -3474 950 8 - -DartTrap 1027 -3494 971 0 - -GasTrap 4274 -3515 980 0 - -SpikeTrap 4379 (Hue=1082) -3530 962 4 - -DartTrap 1599 -3730 940 0 - -FireColumnTrap 656 -3729 973 0 - -SpikeTrap 4506 -3730 984 0 - -GiantSpikeTrap 7167 -3750 956 0 - -AxeTrap 4403 -3748 979 0 - -FireColumnTrap 655 -3766 927 0 - -DartTrap 1599 -3763 914 0 - -StoneFaceTrap 4367 -3771 974 0 - -StoneFaceTrap 4367 -3771 966 0 - -AxeTrap 4416 -3784 940 -3 - -GasTrap 5005 -3778 956 0 - -DartTrap 1027 -3976 980 0 - -AxeTrap 4427 -3998 932 -3 - -GasTrap 4999 -3984 945 0 - -GiantSpikeTrap 7167 -3995 964 0 - -SawTrap 4524 -4003 952 0 - -FireColumnTrap 656 -4026 936 0 - -SpikeTrap 4379 (Hue=1082) -4019 954 3 - -MushroomTrap 6594 -3450 949 2 - -MushroomTrap 6594 -3480 997 0 - -MushroomTrap 6594 -3503 961 0 - -MushroomTrap 6594 -3516 930 0 - diff --git a/Data/Decoration/Underworld/Traps.cfg b/Data/Decoration/Underworld/Traps.cfg new file mode 100644 index 0000000..e4626b4 --- /dev/null +++ b/Data/Decoration/Underworld/Traps.cfg @@ -0,0 +1,382 @@ +#Caverns of Ice +giantspiketrap 7167 (Hue=1187; Name=spike trap) +285 518 -5 + +giantspiketrap 7167 (Hue=1187; Name=spike trap) +271 457 -5 + +firecolumntrap 655 (Hue=0; Name=fire trap) +240 534 -4 + +giantspiketrap 7167 (Hue=1187; Name=spike trap) +240 463 -4 + +giantspiketrap 7167 (Hue=1187; Name=spike trap) +224 441 -5 + +firecolumntrap 655 (Hue=0; Name=fire trap) +221 529 -5 + +giantspiketrap 7167 (Hue=1187; Name=spike trap) +198 526 -7 + +giantspiketrap 7167 (Hue=1187; Name=spike trap) +221 483 -4 + +giantspiketrap 7167 (Hue=1187; Name=spike trap) +185 504 -4 + +giantspiketrap 7167 (Hue=1187; Name=spike trap) +161 511 -6 + +giantspiketrap 7167 (Hue=1187; Name=spike trap) +164 482 -4 + +giantspiketrap 7167 (Hue=1187; Name=spike trap) +145 459 -7 + +giantspiketrap 7167 (Hue=1187; Name=spike trap) +129 484 -5 + +spiketrap 4506 (Hue=1079; Name=) +101 666 0 + +firecolumntrap 655 (Hue=0; Name=fire trap) +101 481 -4 + +darttrap 1027 (Hue=0; Name=dart trap) +95 681 0 + +spiketrap 4506 (Hue=1079; Name=) +85 675 0 + +spiketrap 4506 (Hue=1079; Name=) +90 666 0 + +firecolumntrap 655 (Hue=0; Name=fire trap) +92 478 -5 + +spiketrap 4506 (Hue=1079; Name=) +77 674 0 +#Covetous +spiketrap 4360 (Hue=0; Name=) +944 1681 4 + +giantspiketrap 7167 (Hue=0; Name=spike trap) +949 1662 0 + +giantspiketrap 7167 (Hue=0; Name=spike trap) +939 1667 0 + +giantspiketrap 7167 (Hue=0; Name=spike trap) +942 1658 0 + +axetrap 4403 (Hue=0; Name=) +924 1719 0 + +darttrap 1599 (Hue=0; Name=dart trap) +917 1701 0 + +sawtrap 4524 (Hue=0; Name=) +914 1685 0 + +giantspiketrap 7167 (Hue=0; Name=spike trap) +907 1726 0 + +darttrap 1599 (Hue=0; Name=dart trap) +898 1701 0 + +gastrap 5005 (Hue=0; Name=gas trap) +904 1674 0 + +firecolumntrap 655 (Hue=0; Name=fire trap) +883 1721 0 + +darttrap 1027 (Hue=0; Name=dart trap) +889 1679 0 + +darttrap 1599 (Hue=0; Name=dart trap) +875 1705 0 + +darttrap 1599 (Hue=0; Name=dart trap) +703 1736 0 + +darttrap 1599 (Hue=0; Name=dart trap) +694 1736 0 + +mushroomtrap 6594 (Hue=1188; Name=mushroom) +516 1724 0 + +mushroomtrap 6594 (Hue=1179; Name=mushroom) +532 1752 0 + +firecolumntrap 655 (Hue=0; Name=fire trap) +1105 1224 0 + +firecolumntrap 655 (Hue=0; Name=fire trap) +1114 1221 0 + +mushroomtrap 6594 (Hue=1188; Name=mushroom) +1099 1302 0 + +firecolumntrap 655 (Hue=0; Name=fire trap) +1100 1222 0 + +mushroomtrap 6594 (Hue=1179; Name=mushroom) +1073 1247 0 + +firecolumntrap 655 (Hue=0; Name=fire trap) +1058 1481 0 + +mushroomtrap 6594 (Hue=1179; Name=mushroom) +1030 1487 0 + +mushroomtrap 6594 (Hue=1188; Name=mushroom) +1024 1284 0 + +mushroomtrap 6594 (Hue=1179; Name=mushroom) +1031 1227 0 + +firecolumntrap 655 (Hue=0; Name=fire trap) +1000 1495 0 + +mushroomtrap 6594 (Hue=1179; Name=mushroom) +944 1503 1 + +mushroomtrap 6594 (Hue=1188; Name=mushroom) +914 1445 0 +# Silent Tomb +mushroomtrap 6594 (Hue=1179; Name=mushroom) +3516 930 0 + +mushroomtrap 6594 (Hue=1188; Name=mushroom) +3503 961 0 + +mushroomtrap 6594 (Hue=1179; Name=mushroom) +3480 997 0 + +mushroomtrap 6594 (Hue=1179; Name=mushroom) +3450 949 2 + +spiketrap 4379 (Hue=1082; Name=) +4019 954 3 + +firecolumntrap 656 (Hue=0; Name=fire trap) +4026 936 0 + +sawtrap 4524 (Hue=0; Name=) +4003 952 0 + +giantspiketrap 7167 (Hue=0; Name=spike trap) +3995 964 0 + +gastrap 4999 (Hue=0; Name=gas trap) +3984 945 0 + +axetrap 4427 (Hue=0; Name=) +3998 932 -3 + +darttrap 1027 (Hue=0; Name=dart trap) +3976 980 0 + +gastrap 5005 (Hue=0; Name=gas trap) +3778 956 0 + +axetrap 4416 (Hue=0; Name=) +3784 940 -3 + +stonefacetrap 4367 (Hue=0; Name=) +3771 966 0 + +stonefacetrap 4367 (Hue=0; Name=) +3771 974 0 + +darttrap 1599 (Hue=0; Name=dart trap) +3763 914 0 + +firecolumntrap 655 (Hue=0; Name=fire trap) +3766 927 0 + +axetrap 4403 (Hue=0; Name=) +3748 979 0 + +giantspiketrap 7167 (Hue=0; Name=spike trap) +3750 956 0 + +spiketrap 4506 (Hue=0; Name=) +3730 984 0 + +firecolumntrap 656 (Hue=0; Name=fire trap) +3729 973 0 + +darttrap 1599 (Hue=0; Name=dart trap) +3730 940 0 + +spiketrap 4379 (Hue=1082; Name=) +3530 962 4 + +gastrap 4274 (Hue=0; Name=gas trap) +3515 980 0 + +darttrap 1027 (Hue=0; Name=dart trap) +3494 971 0 + +sawtrap 4374 (Hue=0; Name=) +3474 950 8 + +gastrap 5005 (Hue=0; Name=gas trap) +3474 935 0 + +giantspiketrap 7167 (Hue=0; Name=spike trap) +3461 959 0 + +gastrap 4274 (Hue=0; Name=gas trap) +2989 249 0 +# Wailing Halls +mushroomtrap 6594 (Hue=1179; Name=mushroom) +3022 264 0 + +mushroomtrap 6594 (Hue=1188; Name=mushroom) +3004 298 0 + +firecolumntrap 655 (Hue=0; Name=fire trap) +2998 260 0 + +giantspiketrap 7167 (Hue=0; Name=spike trap) +2966 277 0 + +mushroomtrap 6594 (Hue=1188; Name=mushroom) +2974 243 0 + +firecolumntrap 655 (Hue=0; Name=fire trap) +2969 206 0 + +spiketrap 4512 (Hue=0; Name=) +2954 285 0 + +darttrap 1027 (Hue=0; Name=dart trap) +2948 268 0 + +firecolumntrap 655 (Hue=0; Name=fire trap) +2944 208 0 + +mushroomtrap 6594 (Hue=1188; Name=mushroom) +2953 191 0 + +giantspiketrap 7167 (Hue=0; Name=spike trap) +2939 310 0 + +gastrap 4999 (Hue=0; Name=gas trap) +2934 285 0 + +mushroomtrap 6594 (Hue=1179; Name=mushroom) +2927 236 0 + +axetrap 4427 (Hue=0; Name=) +2911 310 -4 + +sawtrap 4524 (Hue=0; Name=) +2900 265 0 + +firecolumntrap 655 (Hue=0; Name=fire trap) +2902 207 0 + +mushroomtrap 6594 (Hue=1179; Name=mushroom) +2895 222 0 + +sawtrap 4529 (Hue=0; Name=) +2704 260 0 + +mushroomtrap 6594 (Hue=1179; Name=mushroom) +2688 313 0 + +firecolumntrap 655 (Hue=0; Name=fire trap) +2692 234 0 + +firecolumntrap 655 (Hue=0; Name=fire trap) +2696 216 0 + +mushroomtrap 6594 (Hue=1188; Name=mushroom) +2687 356 0 + +firecolumntrap 655 (Hue=0; Name=fire trap) +2672 317 0 + +giantspiketrap 7167 (Hue=0; Name=spike trap) +2679 175 0 + +firecolumntrap 655 (Hue=0; Name=fire trap) +2671 268 0 + +mushroomtrap 6594 (Hue=1188; Name=mushroom) +2669 230 0 + +mushroomtrap 6594 (Hue=1188; Name=mushroom) +2655 370 0 + +mushroomtrap 6594 (Hue=1188; Name=mushroom) +2671 198 0 + +spiketrap 4512 (Hue=0; Name=) +2643 247 0 + +firecolumntrap 655 (Hue=0; Name=fire trap) +2650 184 0 + +sawtrap 4524 (Hue=0; Name=) +2634 283 0 + +mushroomtrap 6594 (Hue=1188; Name=mushroom) +2632 215 0 + +gastrap 4274 (Hue=0; Name=gas trap) +2623 262 0 + +firecolumntrap 655 (Hue=0; Name=fire trap) +2621 239 0 + +darttrap 1027 (Hue=0; Name=dart trap) +2601 248 0 + +mushroomtrap 6594 (Hue=1179; Name=mushroom) +2592 233 0 + +spiketrap 4360 (Hue=0; Name=) +2591 288 5 + +firecolumntrap 655 (Hue=0; Name=fire trap) +2574 218 0 + +spiketrap 4506 (Hue=0; Name=) +2396 220 0 + +darttrap 1599 (Hue=0; Name=dart trap) +2354 237 0 + +sawtrap 4524 (Hue=0; Name=) +2346 259 0 + +darttrap 1599 (Hue=0; Name=dart trap) +2333 236 0 + +giantspiketrap 7167 (Hue=0; Name=spike trap) +2319 286 0 + +axetrap 4427 (Hue=0; Name=) +2319 267 -3 + +firecolumntrap 655 (Hue=0; Name=fire trap) +2319 252 0 + +darttrap 1027 (Hue=0; Name=dart trap) +2270 251 0 + +gastrap 4999 (Hue=0; Name=gas trap) +2241 249 0 + +darttrap 1027 (Hue=0; Name=dart trap) +2226 240 0 + +gastrap 4274 (Hue=0; Name=gas trap) +2989 249 0 +######## diff --git a/Data/Decoration/Underworld/WailingHalls.cfg b/Data/Decoration/Underworld/WailingHalls.cfg index d3af387..7c39af1 100644 --- a/Data/Decoration/Underworld/WailingHalls.cfg +++ b/Data/Decoration/Underworld/WailingHalls.cfg @@ -19,9 +19,6 @@ MetalDoor 1663 (Facing=NorthCCW) MetalDoor 1663 (Facing=NorthCCW) 2233 243 0 -DartTrap 1027 -2226 240 0 - MetalDoor 1663 (Facing=NorthCCW) 2245 253 0 @@ -31,12 +28,6 @@ MetalDoor 1655 (Facing=EastCCW) MetalDoor 1663 (Facing=NorthCCW) 2254 253 0 -GasTrap 4999 -2241 249 0 - -DartTrap 1027 -2270 251 0 - MetalDoor 1653 (Facing=WestCW) 2258 257 0 @@ -76,21 +67,9 @@ BarredMetalDoor2 8183 (Facing=NorthCCW) BarredMetalDoor2 8183 (Facing=NorthCCW) 2293 260 0 -FireColumnTrap 655 -2319 252 0 - MetalDoor 1655 (Facing=EastCCW) 2317 266 0 -AxeTrap 4427 -2319 267 -3 - -GiantSpikeTrap 7167 -2319 286 0 - -DartTrap 1599 -2333 236 0 - MetalDoor 1655 (Facing=EastCCW) 2320 248 0 @@ -112,12 +91,6 @@ SecretBookDoor 8440 (Facing=WestCW; Hue=1180) MetalDoor 1661 (Facing=SouthCW) 2349 244 0 -SawTrap 4524 -2346 259 0 - -DartTrap 1599 -2354 237 0 - MetalDoor 1663 (Facing=NorthCCW) 2357 244 0 @@ -142,30 +115,15 @@ BarredMetalDoor2 8183 (Facing=NorthCCW) BarredMetalDoor2 8183 (Facing=NorthCCW) 2391 220 0 -SpikeTrap 4506 -2396 220 0 - BarredMetalDoor2 8183 (Facing=NorthCCW) 2388 230 0 BarredMetalDoor2 8183 (Facing=NorthCCW) 2391 230 0 -FireColumnTrap 655 -2574 218 0 - MetalDoor 1653 (Facing=WestCW) 2586 239 0 -SpikeTrap 4360 -2591 288 5 - -MushroomTrap 6594 -2592 233 0 - -DartTrap 1027 -2601 248 0 - MetalDoor 1653 (Facing=WestCW) 2603 260 0 @@ -181,9 +139,6 @@ MetalDoor 1653 (Facing=WestCW) MetalDoor 1653 (Facing=WestCW) 2612 239 0 -FireColumnTrap 655 -2621 239 0 - MetalDoor 1663 (Facing=NorthCCW) 2608 251 0 @@ -193,18 +148,12 @@ MetalDoor 1663 (Facing=NorthCCW) MetalDoor 1655 (Facing=EastCCW) 2612 259 0 -GasTrap 4274 -2623 262 0 - MetalDoor 1653 (Facing=WestCW) 2615 293 0 SecretStoneDoor2 812 (Facing=SouthCW; Hue=1189) 2616 304 0 -MushroomTrap 6594 -2632 215 0 - MetalDoor 1653 (Facing=WestCW) 2635 239 0 @@ -214,24 +163,15 @@ MetalDoor 1663 (Facing=NorthCCW) MetalDoor 1655 (Facing=EastCCW) 2634 273 0 -SawTrap 4524 -2634 283 0 - MetalDoor 1653 (Facing=WestCW) 2634 300 0 SecretStoneDoor2 814 (Facing=NorthCCW; Hue=1189) 2630 304 0 -FireColumnTrap 655 -2650 184 0 - MetalDoor 1655 (Facing=EastCCW) 2644 254 0 -SpikeTrap 4512 -2643 247 0 - MetalDoor 1663 (Facing=NorthCCW) 2653 256 0 @@ -241,21 +181,6 @@ MetalDoor 1663 (Facing=NorthCCW) MetalDoor 1663 (Facing=NorthCCW) 2640 290 0 -MushroomTrap 6594 -2655 370 0 - -MushroomTrap 6594 -2671 198 0 - -MushroomTrap 6594 -2669 230 0 - -FireColumnTrap 655 -2671 268 0 - -GiantSpikeTrap 7167 -2679 175 0 - MetalDoor 1653 (Facing=WestCW) 2676 187 0 @@ -265,27 +190,15 @@ MetalDoor 1653 (Facing=WestCW) MetalDoor 1663 (Facing=NorthCCW) 2681 249 0 -FireColumnTrap 655 -2672 317 0 - -MushroomTrap 6594 -2687 356 0 - MetalDoor 1653 (Facing=WestCW) 2693 181 0 -FireColumnTrap 655 -2696 216 0 - MetalDoor 1663 (Facing=NorthCCW) 2698 235 0 MetalDoor 1653 (Facing=WestCW) 2693 238 0 -FireColumnTrap 655 -2692 234 0 - MetalDoor 1663 (Facing=NorthCCW) 2698 249 0 @@ -295,9 +208,6 @@ MetalDoor 1653 (Facing=WestCW) MetalDoor 1661 (Facing=SouthCW) 2698 259 0 -MushroomTrap 6594 -2688 313 0 - MetalDoor 1663 (Facing=NorthCCW) 2705 217 0 @@ -310,24 +220,12 @@ MetalDoor 1653 (Facing=WestCW) MetalDoor 1663 (Facing=NorthCCW) 2713 259 0 -SawTrap 4529 -2704 260 0 - -MushroomTrap 6594 -2895 222 0 - -FireColumnTrap 655 -2902 207 0 - MetalDoor 1653 (Facing=WestCW) 2902 258 0 MetalDoor 1663 (Facing=NorthCCW) 2906 264 0 -SawTrap 4524 -2900 265 0 - MetalDoor 1653 (Facing=WestCW) 2898 283 0 @@ -343,12 +241,6 @@ MetalDoor 1653 (Facing=WestCW) MetalDoor 1663 (Facing=NorthCCW) 2908 299 0 -AxeTrap 4427 -2911 310 -4 - -MushroomTrap 6594 -2927 236 0 - SecretStoneDoor2 812 (Facing=SouthCW; Hue=1189) 2917 283 0 @@ -364,42 +256,18 @@ MetalDoor 1655 (Facing=EastCCW) MetalDoor 1653 (Facing=WestCW) 2936 272 0 -GasTrap 4999 -2934 285 0 - MetalDoor 1663 (Facing=NorthCCW) 2934 309 0 -GiantSpikeTrap 7167 -2939 310 0 - -MushroomTrap 6594 -2953 191 0 - -FireColumnTrap 655 -2944 208 0 - MetalDoor 1663 (Facing=NorthCCW) 2946 262 0 -DartTrap 1027 -2948 268 0 - MetalDoor 1653 (Facing=WestCW) 2949 282 0 -SpikeTrap 4512 -2954 285 0 - MetalDoor 1653 (Facing=WestCW) 2953 291 0 -FireColumnTrap 655 -2969 206 0 - -MushroomTrap 6594 -2974 243 0 - MetalDoor 1663 (Facing=NorthCCW) 2962 269 0 @@ -409,9 +277,6 @@ MetalDoor 1653 (Facing=WestCW) MetalDoor 1655 (Facing=EastCCW) 2960 282 0 -GiantSpikeTrap 7167 -2966 277 0 - MetalDoor 1653 (Facing=WestCW) 2969 291 0 @@ -421,12 +286,3 @@ MetalDoor 1663 (Facing=NorthCCW) MetalDoor 1653 (Facing=WestCW) 2976 275 0 -FireColumnTrap 655 -2998 260 0 - -MushroomTrap 6594 -3004 298 0 - -MushroomTrap 6594 -3022 264 0 - diff --git a/Scripts/Commands/ExportTraps.cs b/Scripts/Commands/ExportTraps.cs new file mode 100644 index 0000000..0cd6c22 --- /dev/null +++ b/Scripts/Commands/ExportTraps.cs @@ -0,0 +1,66 @@ +using System; +using System.IO; +using Server; +using Server.Items; +using Server.Commands; + +namespace Server.Scripts.Commands +{ + public class ExportTrapsCommand + { + public static void Initialize() + { + CommandSystem.Register( "ExportTraps", AccessLevel.Administrator, new CommandEventHandler( ExportTraps_OnCommand ) ); + } + + [Usage( "ExportTraps" )] + [Description( "Exports all placed BaseTrap items on your current map to a cfg file in Data/Decoration." )] + private static void ExportTraps_OnCommand( CommandEventArgs e ) + { + Map currentMap = e.Mobile.Map; + + if ( currentMap == null || currentMap == Map.Internal ) + { + e.Mobile.SendMessage( "You cannot export from the internal map." ); + return; + } + + string exportDir = Path.Combine( Core.BaseDirectory, "Data", "Decoration" ); + + if ( !Directory.Exists( exportDir ) ) + { + Directory.CreateDirectory( exportDir ); + } + + // Appends the map name to prevent overwriting + string fileName = String.Format( "ExportedTraps_{0}.cfg", currentMap.Name ); + string filePath = Path.Combine( exportDir, fileName ); + + int count = 0; + + using ( StreamWriter op = new StreamWriter( filePath ) ) + { + foreach ( Item item in World.Items.Values ) + { + // Catch anything that inherits from BaseTrap (Axe, Spike, Gas, etc.) + if ( item is BaseTrap && item.Parent == null && item.Map == currentMap ) + { + string typeName = item.GetType().Name.ToLower(); + int itemID = item.ItemID; + int hue = item.Hue; + string name = item.Name ?? ""; + + // Outputs identically to the Loot Chest format + op.WriteLine( "{0} {1} (Hue={2}; Name={3})", typeName, itemID, hue, name ); + op.WriteLine( "{0} {1} {2}", item.X, item.Y, item.Z ); + op.WriteLine(); + + count++; + } + } + } + + e.Mobile.SendMessage( "{0} traps exported! Check your Data/Decoration folder for {1}.", count, fileName ); + } + } +}