本文整理汇总了C#中CrystalMpq.MpqFile.Open方法的典型用法代码示例。如果您正苦于以下问题:C# MpqFile.Open方法的具体用法?C# MpqFile.Open怎么用?C# MpqFile.Open使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CrystalMpq.MpqFile
的用法示例。
在下文中一共展示了MpqFile.Open方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QuestRange
public QuestRange(MpqFile file)
{
var stream = file.Open();
this.Time0 = new QuestTime(stream);
this.Time1 = new QuestTime(stream);
stream.Close();
}
示例2: GameBalance
public GameBalance(MpqFile file)
{
var stream = file.Open();
this.Header = new Header(stream);
this.Type = (BalanceType)stream.ReadValueS32();
Gbi = stream.ReadString(256, true);
Xls = stream.ReadString(256, true);
this.I0 = stream.ReadValueS32();
this.I1 = stream.ReadValueS32();
this.ItemType = stream.ReadSerializedData<ItemTypeTable>(); //536
stream.Position += 8;
this.Item = stream.ReadSerializedData<ItemTable>(); //552
stream.Position += 8;
this.Experience = stream.ReadSerializedData<ExperienceTable>(); //568
stream.Position += 8;
this.HelpCodes = stream.ReadSerializedData<HelpCodesTable>(); //584
stream.Position += 8;
this.MonsterLevel = stream.ReadSerializedData<MonsterLevelTable>(); //600
stream.Position += 8;
this.Affixes = stream.ReadSerializedData<AffixTable>(); //616
stream.Position += 8;
this.Heros = stream.ReadSerializedData<HeroTable>(); //632
stream.Position += 8;
this.MovementStyles = stream.ReadSerializedData<MovementStyleTable>(); //648
stream.Position += 8;
this.Labels = stream.ReadSerializedData<LabelGBIDTable>(); //664
stream.Position += 8;
this.LootDistribution = stream.ReadSerializedData<LootDistTable>(); //680
stream.Position += 8;
this.RareItemNames = stream.ReadSerializedData<RareItemNamesTable>(); //696
stream.Position += 8;
this.MonsterAffixes = stream.ReadSerializedData<MonsterAffixesTable>(); //712
stream.Position += 8;
this.RareMonsterNames = stream.ReadSerializedData<MonsterNamesTable>(); //728
stream.Position += 8;
this.SocketedEffects = stream.ReadSerializedData<SocketedEffectTable>(); //744
stream.Position += 8;
this.ItemEnhancement = stream.ReadSerializedData<ItemEnhancementTable>(); //760
stream.Position += 8;
this.ItemDrop = stream.ReadSerializedData<ItemDropTable>(); //776
stream.Position += 8;
this.ItemLevelMod = stream.ReadSerializedData<ItemLevelModTable>(); //792
stream.Position += 8;
this.QualityClass = stream.ReadSerializedData<QualityClassTable>(); //808
stream.Position += 8;
this.Hirelings = stream.ReadSerializedData<HirelingTable>(); //824
stream.Position += 8;
this.SetItemBonus = stream.ReadSerializedData<SetItemBonusTable>(); //840
stream.Position += 8;
this.EliteModifiers = stream.ReadSerializedData<EliteModTable>(); //856
stream.Position += 8;
this.ItemTiers = stream.ReadSerializedData<ItemTierTable>(); //872
stream.Position += 8;
this.PowerFormula = stream.ReadSerializedData<PowerFormulaTable>(); //888
stream.Position += 8;
this.Recipes = stream.ReadSerializedData<RecipeTable>(); //904
stream.Position += 8;
this.ScriptedAchievementEvents = stream.ReadSerializedData<ScriptedAchievementEventsTable>(); //920
stream.Close();
}
示例3: Power
public Power(MpqFile file)
{
var stream = file.Open();
this.Header = new Header(stream);
LuaName = stream.ReadString(64, true);
stream.Position += 4; // pad 1
Powerdef = new PowerDef(stream);
stream.Position = 440; // Seems like theres a bit of a gap - DarkLotus
I0 = stream.ReadValueS32();
I1 = stream.ReadValueS32();
Chararray2 = stream.ReadString(256, true);
ScriptFormulaCount = stream.ReadValueS32();
ScriptFormulaDetails = stream.ReadSerializedData<ScriptFormulaDetails>();
stream.Position += (3 * 4);
i3 = stream.ReadValueS32();
stream.Position += (3 * 4);
// TODO: please fix this - use our serializable-data readers instead! /raist
// TODO add a class for complied script so it can be deserialized properly. - DarkLotus
// none of the .pow appear to have any data here, and stream position appears to be correct, unsure - DarkLotus
var serCompliedScript = stream.GetSerializedDataPointer();
if (serCompliedScript.Size > 0)
{
long x = stream.Position;
stream.Position = serCompliedScript.Offset + 16;
var buf = new byte[serCompliedScript.Size];
stream.Read(buf, 0, serCompliedScript.Size);
stream.Position = x;
CompliedScript.AddRange(buf);
}
SNOQuestMetaData = stream.ReadValueS32();
stream.Close();
}
示例4: Conversation
public Conversation(MpqFile file)
{
MpqFileStream stream = file.Open();
this.Header = new Header(stream);
this.ConversationType = (ConversationTypes)stream.ReadValueS32();
this.I0 = stream.ReadValueS32();
this.I1 = stream.ReadValueS32();
this.SNOQuest = stream.ReadValueS32();
this.I2 = stream.ReadValueS32();
this.I3 = stream.ReadValueS32();
this.SNOConvPiggyback = stream.ReadValueS32();
this.SNOConvUnlock = stream.ReadValueS32();
this.I4 = stream.ReadValueS32();
this.Unknown = stream.ReadString(128, true);
this.SNOPrimaryNpc = stream.ReadValueS32();
this.SNOAltNpc1 = stream.ReadValueS32();
this.SNOAltNpc2 = stream.ReadValueS32();
this.SNOAltNpc3 = stream.ReadValueS32();
this.SNOAltNpc4 = stream.ReadValueS32();
this.I5 = stream.ReadValueS32();
stream.Position += (2 * 4);
RootTreeNodes = stream.ReadSerializedData<ConversationTreeNode>();
this.Unknown2 = stream.ReadString(256, true);
this.I6 = stream.ReadValueS32();
stream.Position += 12;
CompiledScript = Encoding.ASCII.GetString(stream.ReadSerializedByteArray());
stream.Position += 40;
this.SNOBossEncounter = stream.ReadValueS32();
stream.Close();
}
示例5: MarkerSet
public MarkerSet(MpqFile file)
{
var stream = file.Open();
Header = new Header(stream);
SNO = stream.ReadInt32();
unknown0 = stream.ReadInt32();
unknown1 = stream.ReadInt32();
serMarkers = new SerializeData(stream);
long x = stream.Position;
Markers = new Marker[serMarkers.Size / 208];
stream.Position = serMarkers.Offset + 16;
for (int i = 0; i < serMarkers.Size / 208; i++)
{
Markers[i] = new Marker(stream);
}
stream.Position = x;
stream.Position += (15 * 4); // pad 15
serNoSpawns = new SerializeData(stream);
stream.Position += (14 * 4);
aabb = new AABB_(stream);
i0 = stream.ReadInt32();
byte[] buf = new byte[256];
stream.Read(buf, 0, 256); filename = Encoding.ASCII.GetString(buf);
nLabel = stream.ReadInt32();
nSpecialIndexCount = stream.ReadInt32();
serSpecialIndexList = new SerializeData(stream);
stream.Close();
}
示例6: Quest
public Quest(MpqFile file)
{
MpqFileStream stream = file.Open();
Header = new Header(stream);
QuestType = (QuestType)stream.ReadValueS32();
NumberOfSteps = stream.ReadValueS32();
NumberOfCompletionSteps = stream.ReadValueS32();
I2 = stream.ReadValueS32();
I3 = stream.ReadValueS32();
I4 = stream.ReadValueS32();
I5 = stream.ReadValueS32();
QuestUnassignedStep = new QuestUnassignedStep(stream);
stream.Position += 8;
QuestSteps = stream.ReadSerializedData<QuestStep>();
stream.Position += 8;
QuestCompletionSteps = stream.ReadSerializedData<QuestCompletionStep>();
LevelRange1 = new QuestLevelRange(stream);
LevelRange2 = new QuestLevelRange(stream);
LevelRange3 = new QuestLevelRange(stream);
LevelRange4 = new QuestLevelRange(stream);
stream.Close();
}
示例7: MarkerSet
public MarkerSet(MpqFile file)
{
var stream = file.Open();
this.Header = new Header(stream);
this.Markers = stream.ReadSerializedData<Marker>();
stream.Position += (15 * 4);
var pointerSpawns = stream.GetSerializedDataPointer();
//TODO Load spawn locations
stream.Position += (14 * 4);
this.AABB = new AABB(stream);
int i0 = stream.ReadValueS32();
if (i0 != 0 && i0 != 1)
throw new System.Exception("Farmy thought this field is a bool, but apparently its not");
this.ContainsActorLocations = i0 == 1;
this.FileName = stream.ReadString(256, true);
this.NLabel = stream.ReadValueS32();
SpecialIndexCount = stream.ReadValueS32();
var pointerSpecialIndexList = stream.GetSerializedDataPointer();
// TODO Load PointerSpecialIndexList
stream.Close();
}
示例8: Recipe
public Recipe(MpqFile file)
{
var stream = file.Open();
this.Header = new Header(stream);
ItemSpecifierData = new ItemSpecifierData(stream);
stream.Close();
}
示例9: Scene
public Scene(MpqFile file)
{
var stream = file.Open();
this.Header = new Header(stream);
Int0 = stream.ReadValueS32();
this.AABBBounds = new AABB(stream);
this.AABBMarketSetBounds = new AABB(stream);
this.NavMesh = new NavMeshDef(stream);
this.Exclusions = stream.ReadSerializedInts();
stream.Position += (14 * 4);
this.Inclusions = stream.ReadSerializedInts();
stream.Position += (14 * 4);
this.MarkerSets = stream.ReadSerializedInts();
stream.Position += (14 * 4);
this.LookLink = stream.ReadString(64, true);
this.MsgTriggeredEvent = stream.ReadSerializedData<MsgTriggeredEvent>();
this.Int1 = stream.ReadValueS32();
stream.Position += (3 * 4);
this.NavZone = new NavZoneDef(stream);
this.SNOAppearance = stream.ReadValueS32();
this.SNOPhysMesh = stream.ReadValueS32();
stream.Close();
}
示例10: Scene
public Scene(MpqFile file)
{
var stream = file.Open();
this.Header = new Header(stream);
Int0 = stream.ReadValueS32();
this.AABBBounds = new AABB(stream);
this.AABBMarketSetBounds = new AABB(stream);
this.NavMesh = new NavMeshDef(stream); //load NavMeshDef
var exclusions = stream.GetSerializedDataPointer();
stream.Position += (14 * 4);
var inclusions = stream.GetSerializedDataPointer();
stream.Position += (14 * 4);
this.MarkerSets = stream.ReadSerializedInts();
stream.Position += (14 * 4);
this.LookLink = stream.ReadString(64, true);
// Maybe this is a list/array - DarkLotus
this.MsgTriggeredEvent = stream.ReadSerializedItem<MsgTriggeredEvent>();
this.Int1 = stream.ReadValueS32();
stream.Position += (3 * 4);
this.NavZone = new NavZoneDef(stream);
stream.Close();
}
示例11: QuestRange
public QuestRange(MpqFile file)
{
var stream = file.Open();
this.Header = new Header(stream);
this.Start = new QuestTime(stream);
this.End = new QuestTime(stream);
stream.Close();
}
示例12: ConversationList
public ConversationList(MpqFile file)
{
MpqFileStream stream = file.Open();
this.Header = new Header(stream);
stream.Position += (12);
ConversationListEntries = stream.ReadSerializedData<ConversationListEntry>();
stream.Close();
}
示例13: Recipe
public Recipe(MpqFile file)
{
var stream = file.Open();
this.Header = new Header(stream);
this.SNO = stream.ReadValueS32();
stream.Position += (2 * 4);
ItemSpecifierData = new ItemSpecifierData(stream);
stream.Close();
}
示例14: Actor
public Actor(MpqFile file)
{
var stream = file.Open();
stream.Seek(16, SeekOrigin.Begin);
this.ActorSNO = stream.ReadInt32();
stream.Position = 120;
this.AnimSetSNO = stream.ReadInt32();
stream.Close();
}
示例15: Tutorial
public Tutorial(MpqFile file)
{
var stream = file.Open();
this.Header = new Header(stream);
this.I0 = stream.ReadValueS32();
this.I1 = stream.ReadValueS32();
this.Time = stream.ReadValueS32();
stream.Close();
}