本文整理汇总了C#中System.IO.BinaryReader.ReadUnicodeString方法的典型用法代码示例。如果您正苦于以下问题:C# BinaryReader.ReadUnicodeString方法的具体用法?C# BinaryReader.ReadUnicodeString怎么用?C# BinaryReader.ReadUnicodeString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.BinaryReader
的用法示例。
在下文中一共展示了BinaryReader.ReadUnicodeString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
public static MissionObjective Read(BinaryReader br, Mission owner, XElement elem)
{
var mo = new MissionObjective
{
QuestId = br.ReadInt32(),
ObjectiveId = br.ReadInt32(),
Sequence = br.ReadByte(),
Owner = owner,
Requirements = new List<ObjectiveRequirement>(),
};
br.ReadBytes(1);
mo.ObjectiveName = br.ReadUnicodeString(65);
mo.MapName = br.ReadUnicodeString(65);
br.ReadBytes(2);
mo.WorldPosition = br.ReadInt32();
mo.ContinentObject = br.ReadInt32();
mo.LayerIndex = br.ReadByte();
br.ReadBytes(3);
mo.XP = br.ReadInt32();
mo.Credits = br.ReadInt32();
mo.AttribPoints = br.ReadInt32();
mo.SkillPoints = br.ReadInt32();
mo.ReturnToNPC = br.ReadInt32();
mo.XPIndex = br.ReadInt16();
mo.CreditsIndex = br.ReadInt16();
mo.XPScaler = br.ReadSingle();
mo.XPBalanceScaler = br.ReadSingle();
mo.CreditScaler = br.ReadSingle();
if (elem != null)
{
var obj = elem.Elements("Objective").SingleOrDefault(e => (UInt32)e.Attribute("sequence") == mo.Sequence);
if (obj != null)
{
mo.ExternalMapText = (String)obj.Element("ExternalText");
mo.Title = (String)obj.Element("Title");
mo.DefaultMapText = (String)obj.Element("DefaultText");
var cCountElem = obj.Element("CompleteCount");
mo.CompleteCount = (cCountElem == null || String.IsNullOrEmpty((String)cCountElem)) ? 0 : (Int32)cCountElem;
var req = obj.Elements("Requirement").ToList();
if (req.Any())
mo.Requirements.AddRange(req.Select(xElem => ObjectiveRequirement.Create(mo, xElem)).Where(requirement => requirement != null));
}
}
return mo;
}
示例2: Read
public static Skill Read(BinaryReader br)
{
var s = new Skill
{
Id = br.ReadUInt32(),
Class = br.ReadInt32(),
Race = br.ReadInt32(),
TargetType = br.ReadInt32(),
TargetSubType = br.ReadInt32(),
TargetObjectType = br.ReadInt32(),
AffectedTarget = br.ReadInt32(),
AffectedSubType = br.ReadInt32(),
AffectedObjectType = br.ReadInt32(),
StatusEffect = br.ReadInt32(),
SkillPrerequisite1 = br.ReadInt32(),
SkillPrerequisite2 = br.ReadInt32(),
SkillPrerequisite3 = br.ReadInt32(),
LocationTree = br.ReadByte(),
LocationLine = br.ReadByte(),
MinimumLevel = br.ReadByte(),
SkillType = br.ReadByte(),
Name = br.ReadUnicodeString(33),
Description = br.ReadUnicodeString(1025),
XMLName = br.ReadUnicodeString(65)
};
br.ReadBytes(2);
s.IsChain = br.ReadInt32();
s.IsSpray = br.ReadInt32();
s.OptionalAction = br.ReadByte();
s.MaxSkillLevel = br.ReadByte();
br.ReadBytes(2);
s.UseBodyForArc = br.ReadInt32();
s.GroupId = br.ReadInt32();
s.CategoryId = br.ReadInt32();
s.SummonedCreatureId = br.ReadInt32();
s.SkillOptional1 = br.ReadInt32();
s.SkillOptional2 = br.ReadInt32();
s.SkillOptional3 = br.ReadInt32();
s.SkillOptional4 = br.ReadInt32();
s.NumOfElements = br.ReadInt16();
br.ReadBytes(2);
s.Elements = s.NumOfElements > 0 ? new List<SkillElement>(s.NumOfElements) : new List<SkillElement>(0);
for (var i = 0; i < s.NumOfElements; ++i)
s.Elements.Add(SkillElement.Read(br));
return s;
}
示例3: Read
public static VehicleTrick Read(BinaryReader br)
{
return new VehicleTrick
{
Id = br.ReadInt32(),
VehicleId = br.ReadInt32(),
ExclusiveGroup = br.ReadByte(),
GroupId = br.ReadByte(),
FileName = br.ReadUnicodeString(65),
Description = br.ReadUnicodeString(33),
GroupDescription = br.ReadUnicodeString(33)
};
}
示例4: Read
public static CloneBaseSpecific Read(BinaryReader br)
{
return new CloneBaseSpecific
{
CloneBaseId = br.ReadInt32(),
Type = br.ReadInt32(),
TilesetFlags = br.ReadInt32(),
UniqueName = br.ReadUnicodeString(65),
ShortDesc = br.ReadUnicodeString(65),
LongDesc = br.ReadUnicodeString(257),
FxFileName = br.ReadUnicodeString(65),
IsGeneratable = br.ReadUInt32(),
IsTargetable = br.ReadUInt32(),
Available = br.ReadUInt32(),
InStores = br.ReadUInt32(),
InLootGenerator = br.ReadUInt32(),
BaseValue = br.ReadInt32(),
CommodityGroupType = br.ReadInt32(),
IsSellable = br.ReadUInt32() == 1
};
}
示例5: PrefixBase
public PrefixBase(BinaryReader br)
{
Id = br.ReadUInt32();
ObjectType = br.ReadInt32();
ValuePercent = br.ReadSingle();
IsComponent = br.ReadInt32();
Rarity = br.ReadSingle();
Race = br.ReadInt32();
Class = br.ReadInt32();
Name = br.ReadUnicodeString(51);
br.ReadBytes(2);
MassPercent = br.ReadSingle();
Skill = br.ReadInt32();
Ingredients = br.Read<Int32>(5);
BaseValue = br.ReadInt32();
IsGadgetOnly = br.ReadInt32();
LevelOffset = br.ReadInt16();
br.ReadBytes(2);
AttributeRequirementIncrease = br.ReadSingle();
RequiredCombat = br.ReadInt16();
RequiredPerception = br.ReadInt16();
RequiredTech = br.ReadInt16();
RequiredTheory = br.ReadInt16();
ItemRarity = br.ReadInt16();
br.ReadBytes(2);
Complexity = br.ReadInt32();
IsPrefix = br.ReadInt32();
PrefixName = br.ReadUnicodeString(33);
br.ReadBytes(2);
}
示例6: Read
public static HeadBody Read(BinaryReader br)
{
var hb = new HeadBody
{
Id = br.ReadInt32(),
CloneBase = br.ReadInt32(),
IsHead = br.ReadInt32(),
IsBody = br.ReadInt32(),
FileName = br.ReadUnicodeString(65)
};
br.ReadBytes(2);
hb.MaxTextures = br.ReadInt32();
return hb;
}
示例7: Read
public static HeadDetail Read(BinaryReader br)
{
var hd = new HeadDetail
{
Id = br.ReadInt32(),
HeadBody = br.ReadInt32(),
CloneBase = br.ReadInt32(),
FileName = br.ReadUnicodeString(65),
Type = br.ReadByte()
};
br.ReadByte();
hd.MaxTextures = br.ReadInt32();
hd.DisableHair = br.ReadInt32();
return hd;
}
示例8: Read
public static SimpleObjectSpecific Read(BinaryReader br)
{
return new SimpleObjectSpecific
{
Armor = br.ReadInt32(),
Skill1 = br.ReadInt32(),
Skill2 = br.ReadInt32(),
Skill3 = br.ReadInt32(),
SkillGroup1 = br.ReadInt32(),
SkillGroup2 = br.ReadInt32(),
SkillGroup3 = br.ReadInt32(),
CustomColor = br.ReadInt32(),
Faction = br.ReadInt32(),
Prefix = br.ReadInt32(),
RequiredClass = br.ReadInt32(),
Mass = br.ReadSingle(),
Alpha = br.ReadSingle(),
Scale = br.ReadSingle(),
RequiredLevel = br.ReadInt16(),
Flags = br.ReadInt16(),
SubType = br.ReadInt16(),
MinHitPoints = br.ReadInt16(),
MaxHitPoint = br.ReadInt16(),
RaceRegenRate = br.ReadInt16(),
RaceShieldFactor = br.ReadInt16(),
RequiredCombat = br.ReadInt16(),
RequiredPerception = br.ReadInt16(),
RequiredTech = br.ReadInt16(),
RequiredTheory = br.ReadInt16(),
InvSizeX = br.ReadByte(),
InvSizeY = br.ReadByte(),
RenderType = br.ReadByte(),
MaximumEnhancements = br.ReadByte(),
PhysicsName = br.ReadUnicodeString(65),
DamageArmor = DamageArray.Read(br),
Ingredients = br.Read<Int32>(5),
DisciplineRequirement = br.ReadInt32(),
DisciplineRanks = br.ReadInt32(),
MaximumGadgets = br.ReadInt16(),
RaceShieldRegenerate = br.ReadInt16(),
ItemRarity = br.ReadInt16(),
StackSize = br.ReadUInt16(),
MaxUses = br.ReadUInt16(),
IsNotTradeable = br.ReadBoolean(),
DropBrokenOnly = br.ReadBoolean(),
};
}
示例9: Read
public static CreatureSpecific Read(BinaryReader br)
{
var c = new CreatureSpecific
{
Speed = br.ReadSingle(),
VisionArc = br.ReadSingle(),
VisionRange = br.ReadSingle(),
HearingRange = br.ReadSingle(),
RotationSpeed = br.ReadSingle(),
PhysicsScale = br.ReadSingle(),
FlyingHeight = br.ReadSingle(),
AIBehavior = br.ReadInt32(),
IsNPC = br.ReadInt32(),
NPCCanGamble = br.ReadInt32(),
HasTurret = br.ReadInt32(),
TransformTime = br.ReadInt16(),
BaseLevel = br.ReadInt16(),
AttributeCombat = br.ReadInt16(),
AttributeTech = br.ReadInt16(),
AttributeTheory = br.ReadInt16(),
AttributePerception = br.ReadInt16(),
Flags = br.ReadByte(),
BossType = br.ReadByte(),
DifficultyAdjust = br.ReadInt16(),
BaseLootChance = br.ReadByte(),
Skills = new Dictionary<Byte, List<SkillSet>>()
};
br.ReadBytes(3);
c.XPPercent = br.ReadSingle();
c.Color1 = br.ReadInt32();
c.Color2 = br.ReadInt32();
c.Color3 = br.ReadInt32();
c.OffensiveBonus = br.ReadInt16();
c.DefensiveBonus = br.ReadInt16();
c.LootTableId = br.ReadInt32();
var asd = br.ReadInt32();
//if (asd != 0)
//Debugger.Break();
var introLen = br.ReadInt32();
c.NPCIntro = br.ReadUnicodeString(introLen);
var aiCount = br.ReadInt32();
for (var i = 0; i < aiCount; ++i)
{
var b = br.ReadByte();
c.Skills.Add(b, new List<SkillSet>(br.ReadInt32()));
for (var j = 0; j < c.Skills[b].Capacity; ++j)
c.Skills[b].Add(SkillSet.Read(br));
}
return c;
}
示例10: ReadStringEntry
/// <summary>
/// Reads String entry from the grammar file.
/// </summary>
/// <returns>String entry content.</returns>
private String ReadStringEntry(BinaryReader reader)
{
if (ReadEntryDataType(reader) != EntryDataType.String)
{
throw new FileLoadException(Resources.Grammar_StringEntryExpected);
}
m_EntryCount--;
return reader.ReadUnicodeString();
}
示例11: Load
/// <summary>
/// Loads grammar from the binary reader.
/// </summary>
private void Load(BinaryReader reader)
{
if (reader.ReadUnicodeString() != FileHeader)
{
throw new FileLoadException(Resources.Grammar_WrongFileHeader);
}
while (reader.PeekChar() != -1)
{
RecordDataType recordDataType = ReadNextRecord(reader);
switch (recordDataType)
{
case RecordDataType.Parameters:
ReadParameters(reader);
break;
case RecordDataType.TableCounts:
ReadTableCounts(reader);
break;
case RecordDataType.Initial:
ReadInitialStates(reader);
break;
case RecordDataType.Symbols:
ReadSymbols(reader);
break;
case RecordDataType.CharSets:
ReadCharSets(reader);
break;
case RecordDataType.Rules:
ReadRules(reader);
break;
case RecordDataType.DfaStates:
ReadDfaStates(reader);
break;
case RecordDataType.LRStates:
ReadLRStates(reader);
break;
default:
throw new FileLoadException(Resources.Grammar_InvalidRecordType);
}
}
m_DfaInitialState = m_DfaStateTable[m_DfaInitialStateIndex];
OptimizeDfaTransitionVectors();
}
示例12: Area
public Area(string path)
{
this.Props = new List<Prop>();
this.Events = new List<Event>();
using (var fs = new FileStream(path, FileMode.Open))
using (var br = new BinaryReader(fs))
{
Version = br.ReadInt16();
if (Version < 202)
throw new Exception("Invalid file version.");
br.Skip(0x02); // Unk
br.Skip(0x04); // Unk
AreaId = br.ReadInt16();
var regionId = br.ReadInt16(); // Unk
Server = br.ReadUnicodeString();
Name = br.ReadUnicodeString();
br.Skip(0x10); // Unk
var eventCount = br.ReadInt32();
var propCount = br.ReadInt32();
br.Skip(0x14); // Unk
X1 = br.ReadSingle();
br.Skip(0x04); // Unk
Y1 = br.ReadSingle();
br.Skip(0x0C); // Unk
X2 = br.ReadSingle();
br.Skip(0x04); // Unk
Y2 = br.ReadSingle();
br.Skip(0x0C); // Unk
if (Version == 203)
br.Skip(0x04); // Unk
var ver = br.ReadInt16();
br.Skip(0x02); // Unk
var propCountCheck = br.ReadInt32();
if (ver < 202 || propCount != propCountCheck)
throw new Exception("Reading error.");
for (int i = 0; i < propCount; ++i)
{
var prop = new Prop();
prop.ClassId = br.ReadInt32();
prop.PropId = br.ReadInt64();
prop.Name = br.ReadUnicodeString();
prop.X = br.ReadSingle();
prop.Y = br.ReadSingle();
br.Skip(0x04); // Unk (Z?)
var shapeCount = br.ReadByte();
br.Skip(0x04); // Unk
for (int j = 0; j < shapeCount; ++j)
{
var dirX1 = br.ReadSingle();
var dirX2 = br.ReadSingle();
var dirY1 = br.ReadSingle();
var dirY2 = br.ReadSingle();
var lenX = br.ReadSingle();
var lenY = br.ReadSingle();
br.Skip(0x04); // Unk
var posX = br.ReadSingle();
var posY = br.ReadSingle();
br.Skip(0x10); // Unk
prop.Shape.AddRange(GetShapeLines(dirX1, dirX2, dirY1, dirY2, lenX, lenY, posX, posY));
}
prop.Solid = (br.ReadByte() != 0);
br.ReadByte(); // Unk
prop.Scale = br.ReadSingle();
prop.Direction = br.ReadSingle();
br.Skip(0x40); // Unk
br.ReadUnicodeString(); // title
br.ReadUnicodeString(); // state
var parameterCount = br.ReadByte();
for (int k = 0; k < parameterCount; ++k)
{
var def = br.ReadByte();
var eventType = br.ReadInt32();
var signalType = br.ReadInt32();
var name = br.ReadUnicodeString();
var xml = br.ReadUnicodeString();
// Add identical parameters only once
var exists = false;
foreach (var param in prop.Parameters)
{
if (param.EventType == eventType && param.SignalType == signalType && param.Name == name && param.XML == xml)
{
exists = true;
break;
}
}
if (!exists)
prop.Parameters.Add(new PropParameter(eventType, signalType, name, xml));
}
// Filter Tir anniversary props
//.........这里部分代码省略.........
示例13: Region
public Region(string path)
{
this.Areas = new List<Area>();
using (var fs = new FileStream(path, FileMode.Open))
using (var br = new BinaryReader(fs))
{
Version = br.ReadInt32();
br.ReadInt32(); // Unk
RegionId = br.ReadInt32();
GroupId = br.ReadInt32();
ClientName = br.ReadUnicodeString();
CellSize = br.ReadInt32();
Sight = br.ReadByte();
var areaCount = br.ReadInt32();
br.Skip(0x40); // Unk
Scene = br.ReadUnicodeString();
br.Skip(0x2D); // Unk
Camera = br.ReadUnicodeString();
Light = br.ReadUnicodeString();
br.Skip(0x0C); // Unk
for (int i = 0; i < areaCount; ++i)
{
var areaName = br.ReadUnicodeString();
var area = new Area(Path.Combine(Path.GetDirectoryName(path), areaName + ".area"));
Areas.Add(area);
}
br.Skip(0x1B); // Unk
XML = br.ReadUnicodeString();
}
Name = ClientName;
//Name = Name.Replace("Tin_Beginner_Tutorial", "tir_beginner");
//Name = Name.Replace("Uladh_Cobh_to_Belfast", "cobh_to_belfast");
//Name = Name.Replace("Uladh_Belfast_to_Cobh", "belfast_to_cobh");
//Name = Name.Replace("Cobh_to_Belfast", "cobh_to_belfast_ocean");
//Name = Name.Replace("Belfast_to_Cobh", "belfast_to_cobh_ocean");
//Name = Name.Replace("MonsterRegion", "monster_region");
//Name = Name.Replace("Uladh_main", "tir");
//Name = Name.Replace("Uladh_TirCho_", "tir_");
//Name = Name.Replace("Uladh_Dunbarton", "dunbarton");
//Name = Name.Replace("Uladh_Dun_to_Tircho", "dugald_aisle");
//Name = Name.Replace("Ula_Tirnanog", "tnn");
//Name = Name.Replace("Ula_DgnHall_Dunbarton_before1", "rabbie_altar");
//Name = Name.Replace("Ula_DgnHall_Dunbarton_before2", "math_altar");
//Name = Name.Replace("MiscShop", "general");
//Name = Name.Replace("tir_ChiefHouse", "tir_duncan");
//Name = Name.Replace("Uladh_Dungeon_Black_Wolfs_Hall1", "ciar_altar");
//Name = Name.Replace("Uladh_Dungeon_Black_Wolfs_Hall2", "ciar_entrance");
//Name = Name.Replace("Uladh_Dungeon_Beginners_Hall1", "alby_altar");
//Name = Name.Replace("Uladh_Cobh_harbor", "cobh");
//Name = Name.Replace("Ula_DgnHall_Dunbarton_after", "rabbie_entrance");
//Name = Name.Replace("Ula_hardmode_DgnHall_TirChonaill_before", "alby_hard_altar");
//Name = Name.Replace("Ula_DgnArena_Tircho_Lobby", "alby_arena_lobby");
//Name = Name.Replace("Ula_DgnArena_Tircho_Arena", "alby_arena");
//Name = Name.Replace("Ula_Dun_to_Bangor", "gairech");
//Name = Name.Replace("Ula_Bangor", "bangor");
//Name = Name.Replace("Ula_DgnHall_Bangor_before1", "barri_altar");
//Name = Name.Replace("Ula_DgnHall_Bangor_before2", "barri_entrance_test");
//Name = Name.Replace("Ula_DgnHall_Bangor_after", "barri_entrance");
//Name = Name.Replace("tnn_ChiefHouse", "tnn_duncan");
//Name = Name.Replace("Ula_DgnHall_Tirnanog_before1", "albey_altar");
//Name = Name.Replace("Ula_DgnHall_Tirnanog_before2", "albey_altar_test");
//Name = Name.Replace("Ula_DgnHall_Tirnanog_after", "albey_altar_entrance");
//Name = Name.Replace("Sidhe_Sneachta_S", "sidhe_north");
//Name = Name.Replace("Sidhe_Sneachta_N", "sidhe_south");
//Name = Name.Replace("Ula_DgnHall_Danu_before", "fiodh_altar");
//Name = Name.Replace("Ula_DgnHall_Danu_after", "fiodh_entrance");
//Name = Name.Replace("Ula_", "");
//Name = Name.Replace("Emainmacha", "emain_macha");
//Name = Name.Replace("DgnHall_Coill_before", "coill_altar");
//Name = Name.Replace("DgnHall_Coill_after", "coill_entrance");
//Name = Name.Replace("emain_macha_Ceo", "ceo");
//Name = Name.Replace("DgnHall_Runda_before", "rundal_altar");
//Name = Name.Replace("DgnHall_Runda_after", "rundal_entrance");
//Name = Name.Replace("emain_macha_OidTobar_Hall", "ceo_cellar");
//Name = Name.Replace("Studio_Runda", "studio_rundal_boss");
//Name = Name.Replace("dunbarton_SchoolHall_before", "dunbarton_school_altar");
//Name = Name.Replace("dunbarton_School_LectureRoom", "dunbarton_school_library");
//Name = Name.Replace("Dgnhall_Peaca_before", "peaca_altar");
//Name = Name.Replace("Dgnhall_Peaca_after", "peaca_entrance");
//Name = Name.Replace("DgnHall_Tirnanog_G3_before", "baol_altar");
//Name = Name.Replace("DgnHall_Tirnanog_G3_after", "baol_entrance");
//Name = Name.Replace("Private_Wedding_waitingroom", "emain_macha_wedding_waiting");
//Name = Name.Replace("Private_Wedding_ceremonialhall", "emain_macha_wedding_ceremony");
//Name = Name.Replace("Dugald_Aisle_UserHouse", "dugald_userhouse");
//Name = Name.Replace("tnn_G3_Gairech_Hill", "tnn_gairech");
//Name = Name.Replace("Dugald_Aisle_UserCastleTest1", "user_castle_test_1");
//Name = Name.Replace("Dugald_Aisle_UserCastleTest2", "user_castle_test_2");
//Name = Name.Replace("tnn_G3", "tnn_bangor");
//Name = Regex.Replace(Name, "_TestRegion([0-9]+)", "test_region_$1");
//Name = Regex.Replace(Name, "dugald_userhouse_int_([0-9]+)", "user_house_int_$1");
//Name = Name.Replace("Dugald_Aisle_UserCastle_", "user_castle_");
//Name = Name.Replace("Dugald_Aisle_ModelHouse", "model_house");
//Name = Name.Replace("DgnArena_Dunbarton_Arena", "rabbie_battle_arena");
//Name = Name.Replace("DgnArena_Dunbarton_Lobby", "rabbie_battle_arena_lobby");
//Name = Name.Replace("DgnArena_Dunbarton_waitingroom", "rabbie_battle_arena_waiting");
//Name = Name.Replace("Iria_Harbor_01", "iria_harbor");
//.........这里部分代码省略.........
示例14: ReadStringFileInfo
private List<StringTable> ReadStringFileInfo(BinaryReader reader, long end)
{
var value = new List<StringTable>();
// Contains one or more string tables (one for each language),
// each string table contains one or more strings (key/value pairs mapping
// keys to strings for that language)
while (Stream.Position < end)
{
// Read the string table
var stringTable = new StringTable();
value.Add(stringTable);
var start = Stream.Position;
var versionInfo = reader.ReadVersionInfo();
if (versionInfo.Header.Type != VersionDataType.Text)
{
throw new VersionResourceFormatException();
}
var pair = uint.Parse(versionInfo.Key, NumberStyles.AllowHexSpecifier);
var codePage = Helpers.LoWord(pair);
var encoding = Encoding.GetEncoding(codePage);
var languageIdentifier = Helpers.HiWord(pair);
stringTable.Language = languageIdentifier;
stringTable.Encoding = encoding;
while (Stream.Position < start + versionInfo.Header.Length)
{
// Read the string data
var stringInfo = reader.ReadVersionInfo();
var text = reader.ReadUnicodeString();
reader.Align();
stringTable.Values.Add(stringInfo.Key, text);
}
}
return value;
}
示例15: Read
public static Mission Read(BinaryReader br)
{
var mi = new Mission
{
Id = br.ReadUInt32(),
Name = br.ReadUnicodeString(65),
Type = br.ReadByte(),
Objectives = new Dictionary<Byte, MissionObjective>()
};
br.ReadByte();
mi.NPC = br.ReadInt32();
mi.Priority = br.ReadInt32();
mi.ReqRace = br.ReadInt16();
mi.ReqClass = br.ReadInt16();
mi.ReqLevelMin = br.ReadInt32();
mi.ReqLevelMax = br.ReadInt32();
mi.ReqMissionId = br.Read<Int32>(4);
mi.IsRepeatable = br.ReadInt16();
br.ReadBytes(2);
mi.Item = br.Read<Int32>(4);
mi.ItemTemplate = br.Read<Int32>(4);
mi.ItemValue = br.Read<Single>(4);
mi.ItemIsKit = br.Read<Int16>(4);
mi.ItemQuantity = br.Read<Int32>(4);
mi.AutoAssing = br.ReadInt16();
mi.ActiveObjectiveOverride = br.ReadInt16();
mi.Continent = br.ReadInt32();
mi.Achievement = br.ReadInt32();
mi.Discipline = br.ReadInt32();
mi.DisciplineValue = br.ReadInt32();
mi.RewardDiscipline = br.ReadInt32();
mi.RewardDisciplineValue = br.ReadInt32();
mi.RewardUnassignedDisciplinePoints = br.ReadInt32();
mi.RequirementEventId = br.ReadInt32();
mi.TargetLevel = br.ReadInt16();
br.ReadBytes(2);
mi.RequirementsOred = br.ReadInt32();
mi.RequirementsNegative = br.ReadInt32();
mi.Region = br.ReadInt32();
mi.Pocket = br.ReadInt32();
mi.NumberOfObjectives = br.ReadByte();
br.ReadBytes(7);
XElement element = null;
var stream = AssetManager.GetStreamByName(String.Format("{0}.xml", mi.Name), "missions.glm") ??
AssetManager.GetStreamByName(String.Format("{0}.xml", mi.Name), "misc.glm");
if (stream != null)
{
using (stream)
{
var doc = XDocument.Load(stream);
Debug.Assert(doc != null);
element = doc.Element("Mission");
if (element != null)
{
mi.Title = (String)element.Element("Title");
mi.InternalName = (String)element.Element("Internal");
mi.Description = (String)element.Element("Description");
mi.OnLineAccept = (String)element.Element("OnLineAccept");
mi.OnLineReject = (String)element.Element("OnLineReject");
mi.NotCompleteText = (String)element.Element("NotCompleteText");
mi.CompleteText = (String)element.Element("CompleteText");
mi.FailText = (String)element.Element("FailText");
mi.CoreMission = (String)element.Element("CoreMission") != "0";
}
}
}
var numOfObjective = br.ReadInt32();
for (var i = 0; i < numOfObjective; ++i)
{
var obj = MissionObjective.Read(br, mi, element);
mi.Objectives.Add(obj.Sequence, obj);
}
return mi;
}