Originally Posted by
miceiken
I need them for the minimap files. Suppose I could use WoW's internal functions but I have the feeling this will go smoother. And yes, it's possible to open them while WoW is open, how else would you be able to run multiple instances of WoW?
Yes it's possible and i'm using CrystalMpq, there's no need to open 10 MPQ archives, you just need to open one - art.MPQ, this is how i'm doing:
Code:
public class Mpq
{
private static BlpLib.BlpFile _exampleBlp;
private static readonly MpqArchive Archive = new MpqArchive(Helpers.WowInstallPath + "\\Data\\art.MPQ", false);
private static MpqFile _file;
private static MpqFileStream _stream;
public static readonly Dictionary<string, Image> Images = new Dictionary<string, Image>();
public static Image GetImage(string mapName, string continent)
{
try
{
string str = "World\\Minimaps\\" + continent + "\\" + mapName;
if (!Images.ContainsKey(str))
{
_file = Archive.FindFile(str);
_stream = _file.Open();
_exampleBlp = new BlpLib.BlpFile(_stream);
var bmp = _exampleBlp.GetBitmap(0);
Images.Add(str, bmp);
_stream.Close();
_exampleBlp.Close();
}
return Images[str];
}
catch
{
}
return null;
}
}
Using:
Code:
Image minimap = Mpq.GetImage("map31_31.blp", "Azeroth");