IxiQuest Wiki
Advertisement
IxiQuest Wiki

Sometimes the default maps and even custom ones lack a certain mob location. I for one hate running around spamming /loc trying to find a location. Hopefully this helps and if there is an easier way please say!

For this example we'll say we're after a Fine Chain Tunic of the Savvy which drops from an astray hand in the Plane of Mischief. We check the Alla page and see there are multiple spawn groups and locations for this NPC:

Pom spawn example.png

Now I don't know PoM very well and I don't really want to be running around the entire zone spamming /loc trying to find these spawn points. Would be a lot easier if I could get these to show up on the in-game map.

Copy and paste this block from the Alla page into a text file and save it locally:

Pom spawn txt.png

Grab this PowerShell script and save it locally with a .ps1 extension:

 1 # Assemblies
 2 Add-Type -AssemblyName System.Windows.Forms
 3 Add-Type -AssemblyName PresentationFramework
 4 Add-Type -AssemblyName Microsoft.VisualBasic
 5 
 6 # Request the file path of the raw spawn data
 7 [void][System.Windows.MessageBox]::Show('Select the file you pasted the raw spawn data into on the next screen','File',0,64)
 8 $fileBrowser = New-Object System.Windows.Forms.OpenFileDialog
 9 [void]$fileBrowser.ShowDialog()
10 $fileBrowser.Dispose()
11 # Get the content of the raw file
12 $rawData = Get-Content -Path $fileBrowser.FileName
13 # Check for valid file data, it's a really shitty check but meh!
14 If(($rawData.Length -le 0) -or (($rawData -like '*Spawns every*') -eq $false)) {
15     [void][System.Windows.MessageBox]::Show('Error in data file, check you copied it correctly from the Alla site','Error',0,16)
16     Exit
17 }
18 
19 # Request NPC name for the map label
20 $mapNpcName = [Microsoft.VisualBasic.Interaction]::InputBox('Enter the NPC name for the map label, if there are multiple spawns the name will be incremented', 'Map label')
21 # Check for valid input
22 If($mapNpcName.Length -gt 0) {
23     # Map labels can't contain spaces, must be an underscore
24     $mapNPCName = $mapNpcName.Replace(' ','_')
25 } Else {
26     # No input so go with a default
27     $mapNPCName = 'default'
28 }
29 
30 # Request colour for the map label, defaults to black (0,0,0) if cancelled or OK'd with no selection
31 [void][System.Windows.MessageBox]::Show('Select a colour for the map labels on the next screen','Colour',0,64)
32 $colourDialog = New-Object System.Windows.Forms.ColorDialog
33 [void]$colourDialog.ShowDialog()
34 $colourDialog.Dispose()
35 
36 # Create the map file compatible output
37 $npcIncrement = 1
38 ForEach($line in $rawData) {
39     # Ignore any lines starting with "Spawns"
40     If($line.Substring(0,6) -ne 'Spawns') {
41     # Split the spawn group from the location, delimited with :
42         # Alla lists the loc as y, x, z so swap it around to x, y, z
43             # Invert the loc value, negative becomes positive etc. for X and Y but NOT Z
44     $mapOutput += "P $([int]((($line.Split(':'))[1]).Split('/'))[1]*-1).0000, $([int]((($line.Split(':'))[1]).Split('/'))[0]*-1).0000, $([int]((($line.Split(':'))[1]).Split('/'))[2]).0000,  $(($colourDialog.Color.R).ToString()), $(($colourDialog.Color.G).ToString()), $(($colourDialog.Color.B).ToString()),  2,  $($mapNPCName)_#$($npcIncrement)`r`n"
45     $npcIncrement ++
46     }
47 }
48 
49 cls
50 Write-Host 'Copy the text between the blocks into the map file with the suffix _1 (for example mischiefplane_1.txt)'
51 Write-Host '======================================================================================================='
52 Write-Host $mapOutput.Substring(0,$mapOutput.Length-2)
53 Write-Host '======================================================================================================='


Run the script, (you'll probably need to amend the PowerShell execution policy), works either via shell or ISE using desktop 5.1, not tried it on Core yet:

  1. Mapscript1.png
  2. Select the file you copied the text into when the file browser pops up
    1. Mapscript2.png
  3. Enter the label you want on the map, spaces are fine here and handled in the script
    1. Mapscript3 v2.png
  4. Mapscript4.png
  5. Pick a colour, we'll go with purple for this example
    1. Mapscript5.png
  6. Copy the output between the === block into the map file (back it up first if you want to be safe)
    1. Mapscript6.png
  7. Refresh the map in-game (open another map then back to the target map) and you should see the new labels
    1. Mapscript7.png


There's not a huge amount of error handling in the script nor did I spend long writing it but it's worked OK so far. No warranty implied etc! Any issues with it comment here or shout me in-game.


Advertisement