示例#1
0
        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();
        }
示例#2
0
        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();
        }
示例#3
0
 private void Update()
 {
     if (!_audioSource.isPlaying)
     {
         _sfxStream?.Close();
     }
 }
示例#4
0
        public ConversationList(MpqFile file)
        {
            MpqFileStream stream = file.Open();

            this.Header             = new Header(stream);
            stream.Position        += (12);
            ConversationListEntries = stream.ReadSerializedData <ConversationListEntry>();
            stream.Close();
        }
示例#5
0
        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 += (2 * 4);
            SerializableDataPointer compiledScriptPointer = stream.GetSerializedDataPointer();

            stream.Position      += 44; // these bytes are unaccounted for in the xml
            this.SNOBossEncounter = stream.ReadValueS32();

            // reading compiled script, placed it here so i dont have to move the offset around
            CompiledScript  = new byte[compiledScriptPointer.Size];
            stream.Position = compiledScriptPointer.Offset + 16;
            stream.Read(CompiledScript, 0, compiledScriptPointer.Size);

            stream.Close();
        }
示例#6
0
        private void ChangeState(ClassSelectorState state)
        {
            if (_state != state)
            {
                _state = state;
                var stateInfo = _states[state];

                SetAnimator(_mainAnimator, stateInfo.Sprites, stateInfo.Fps, stateInfo.Loop, stateInfo.SortingOrderShift);
                SetAnimator(_overlayAnimator, stateInfo.OverlaySprites, stateInfo.Fps, stateInfo.Loop, stateInfo.SortingOrderShift, stateInfo.HideOnFinish, stateInfo.Material);

                if (!string.IsNullOrEmpty(_states[state].SfxPath))
                {
                    if (_audioSource.isPlaying)
                    {
                        _audioSource.Stop();
                        _sfxStream.Close();
                    }
                    _sfxStream        = Mpq.fs.OpenFile(_states[state].SfxPath);
                    _audioSource.clip = Wav.Load("sfx", true, _sfxStream);
                    _audioSource.Play();
                }
            }
        }