public override void ReadBinary(ESPReader reader)
        {
            List <string> readTags = new List <string>();

            readTags.Add(reader.PeekTag());
            Marker.ReadBinary(reader);

            while (reader.BaseStream.Position < reader.BaseStream.Length)
            {
                string subTag = reader.PeekTag();

                switch (subTag)
                {
                case "INAM":
                    if (readTags.Contains("INAM"))
                    {
                        return;
                    }
                    if (Idle == null)
                    {
                        Idle = new RecordReference();
                    }

                    Idle.ReadBinary(reader);
                    break;

                case "SCHR":
                    if (readTags.Contains("SCHR"))
                    {
                        return;
                    }
                    if (Script == null)
                    {
                        Script = new EmbeddedScript();
                    }

                    Script.ReadBinary(reader);
                    break;

                case "TNAM":
                    if (readTags.Contains("TNAM"))
                    {
                        return;
                    }
                    if (Topic == null)
                    {
                        Topic = new RecordReference();
                    }

                    Topic.ReadBinary(reader);
                    break;

                default:
                    return;
                }

                readTags.Add(subTag);
            }
        }
        public override void ReadXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("StageFlags", false, out subEle))
            {
                if (StageFlags == null)
                {
                    StageFlags = new SimpleSubrecord <QuestStageFlags>();
                }

                StageFlags.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Conditions", false, out subEle))
            {
                if (Conditions == null)
                {
                    Conditions = new List <Condition>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    Condition temp = new Condition();
                    temp.ReadXML(e, master);
                    Conditions.Add(temp);
                }
            }
            if (ele.TryPathTo("LogEntry", false, out subEle))
            {
                if (LogEntry == null)
                {
                    LogEntry = new SimpleSubrecord <String>();
                }

                LogEntry.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Script", false, out subEle))
            {
                if (Script == null)
                {
                    Script = new EmbeddedScript();
                }

                Script.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("NextQuest", false, out subEle))
            {
                if (NextQuest == null)
                {
                    NextQuest = new RecordReference();
                }

                NextQuest.ReadXML(subEle, master);
            }
        }
Exemple #3
0
        public override void ReadXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("IdleTime", false, out subEle))
            {
                if (IdleTime == null)
                {
                    IdleTime = new SimpleSubrecord <Single>();
                }

                IdleTime.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ScriptMarker", false, out subEle))
            {
                if (ScriptMarker == null)
                {
                    ScriptMarker = new SubMarker();
                }

                ScriptMarker.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Idle", false, out subEle))
            {
                if (Idle == null)
                {
                    Idle = new RecordReference();
                }

                Idle.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Script", false, out subEle))
            {
                if (Script == null)
                {
                    Script = new EmbeddedScript();
                }

                Script.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Topic", false, out subEle))
            {
                if (Topic == null)
                {
                    Topic = new RecordReference();
                }

                Topic.ReadXML(subEle, master);
            }
        }
        public override void ReadBinary(ESPReader reader)
        {
            List <string> readTags = new List <string>();

            while (reader.BaseStream.Position < reader.BaseStream.Length)
            {
                string subTag = reader.PeekTag();

                switch (subTag)
                {
                case "NEXT":
                    if (readTags.Contains("NEXT"))
                    {
                        return;
                    }
                    if (EndScriptMarker == null)
                    {
                        EndScriptMarker = new SubMarker();
                    }

                    EndScriptMarker.ReadBinary(reader);
                    break;

                case "SCHR":
                    if (readTags.Contains("SCHR"))
                    {
                        return;
                    }
                    if (EmbeddedScript == null)
                    {
                        EmbeddedScript = new EmbeddedScript();
                    }

                    EmbeddedScript.ReadBinary(reader);
                    break;

                default:
                    return;
                }

                readTags.Add(subTag);
            }
        }
        public override void ReadXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("EndScriptMarker", false, out subEle))
            {
                if (EndScriptMarker == null)
                {
                    EndScriptMarker = new SubMarker();
                }

                EndScriptMarker.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("EmbeddedScript", false, out subEle))
            {
                if (EmbeddedScript == null)
                {
                    EmbeddedScript = new EmbeddedScript();
                }

                EmbeddedScript.ReadXML(subEle, master);
            }
        }
Exemple #6
0
        public override void ReadBinary(ESPReader reader)
        {
            List <string> readTags = new List <string>();

            while (reader.BaseStream.Position < reader.BaseStream.Length)
            {
                string subTag = reader.PeekTag();

                switch (subTag)
                {
                case "PRKE":
                    if (readTags.Contains("PRKE"))
                    {
                        return;
                    }
                    Header.ReadBinary(reader);
                    break;

                case "DATA":
                    if (readTags.Contains("DATA"))
                    {
                        return;
                    }

                    switch (Header.Type)
                    {
                    case PerkType.QuestStage:
                        EffectData = new PerkQuestStageData();
                        break;

                    case PerkType.Ability:
                        EffectData = new PerkAbilityData();
                        break;

                    case PerkType.EntryPoint:
                        EffectData = new PerkEntryPointData();
                        break;
                    }

                    EffectData.ReadBinary(reader);
                    break;

                case "PRKC":
                    if (Conditions == null)
                    {
                        Conditions = new List <PerkCondition>();
                    }

                    PerkCondition tempPRKC = new PerkCondition();
                    tempPRKC.ReadBinary(reader);
                    Conditions.Add(tempPRKC);
                    break;

                case "EPFT":
                    if (readTags.Contains("EPFT"))
                    {
                        return;
                    }
                    if (EntryPointFunctionType == null)
                    {
                        EntryPointFunctionType = new SimpleSubrecord <EntryPointFunctionType>();
                    }

                    EntryPointFunctionType.ReadBinary(reader);
                    break;

                case "EPFD":
                    if (readTags.Contains("EPFD"))
                    {
                        return;
                    }
                    switch (EntryPointFunctionType.Value)
                    {
                    case Enums.EntryPointFunctionType.None:
                        EntryPointFunctionData = new SimpleSubrecord <byte[]>();
                        break;

                    case Enums.EntryPointFunctionType.Float:
                        EntryPointFunctionData = new SimpleSubrecord <float>();
                        break;

                    case Enums.EntryPointFunctionType.FloatFloat:
                        EntryPointFunctionData = new EntryPointRandRange();
                        break;

                    case Enums.EntryPointFunctionType.LeveledItem:
                        EntryPointFunctionData = new RecordReference();
                        break;

                    case Enums.EntryPointFunctionType.Script:
                        EntryPointFunctionData = new SimpleSubrecord <byte[]>();
                        break;

                    case Enums.EntryPointFunctionType.ActorValueMult:
                        EntryPointFunctionData = new EntryPointActorValMult();
                        break;
                    }

                    EntryPointFunctionData.ReadBinary(reader);
                    break;

                case "EPF2":
                    if (readTags.Contains("EPF2"))
                    {
                        return;
                    }
                    if (ButtonLabel == null)
                    {
                        ButtonLabel = new SimpleSubrecord <String>();
                    }

                    ButtonLabel.ReadBinary(reader);
                    break;

                case "EPF3":
                    if (readTags.Contains("EPF3"))
                    {
                        return;
                    }
                    if (RunImmediately == null)
                    {
                        RunImmediately = new SimpleSubrecord <NoYesShort>();
                    }

                    RunImmediately.ReadBinary(reader);
                    break;

                case "SCHR":
                    if (readTags.Contains("SCHR"))
                    {
                        return;
                    }
                    if (Script == null)
                    {
                        Script = new EmbeddedScript();
                    }

                    Script.ReadBinary(reader);
                    break;

                case "PRKF":
                    if (readTags.Contains("PRKF"))
                    {
                        return;
                    }
                    if (EndMarker == null)
                    {
                        EndMarker = new SubMarker();
                    }

                    EndMarker.ReadBinary(reader);
                    break;

                default:
                    return;
                }

                readTags.Add(subTag);
            }
        }
Exemple #7
0
 public ReferencePatrolData(SimpleSubrecord <Single> IdleTime, SubMarker ScriptMarker, RecordReference Idle, EmbeddedScript Script, RecordReference Topic)
 {
     this.IdleTime     = IdleTime;
     this.ScriptMarker = ScriptMarker;
     this.Idle         = Idle;
     this.Script       = Script;
     this.Topic        = Topic;
 }
 public EmbeddedScript(EmbeddedScript copyObject)
 {
 }
        public override void ReadBinary(ESPReader reader)
        {
            List <string> readTags = new List <string>();

            while (reader.BaseStream.Position < reader.BaseStream.Length)
            {
                string subTag = reader.PeekTag();

                switch (subTag)
                {
                case "ITXT":
                    if (readTags.Contains("ITXT"))
                    {
                        return;
                    }
                    ItemText.ReadBinary(reader);
                    break;

                case "RNAM":
                    if (readTags.Contains("RNAM"))
                    {
                        return;
                    }
                    ResultText.ReadBinary(reader);
                    break;

                case "ANAM":
                    if (readTags.Contains("ANAM"))
                    {
                        return;
                    }
                    Flags.ReadBinary(reader);
                    break;

                case "INAM":
                    if (readTags.Contains("INAM"))
                    {
                        return;
                    }
                    if (DisplayNote == null)
                    {
                        DisplayNote = new RecordReference();
                    }

                    DisplayNote.ReadBinary(reader);
                    break;

                case "TNAM":
                    if (readTags.Contains("TNAM"))
                    {
                        return;
                    }
                    if (SubMenu == null)
                    {
                        SubMenu = new RecordReference();
                    }

                    SubMenu.ReadBinary(reader);
                    break;

                case "SCHR":
                    if (readTags.Contains("SCHR"))
                    {
                        return;
                    }
                    if (Script == null)
                    {
                        Script = new EmbeddedScript();
                    }

                    Script.ReadBinary(reader);
                    break;

                case "CTDA":
                    if (Conditions == null)
                    {
                        Conditions = new List <Condition>();
                    }

                    Condition tempCTDA = new Condition();
                    tempCTDA.ReadBinary(reader);
                    Conditions.Add(tempCTDA);
                    break;

                default:
                    return;
                }

                readTags.Add(subTag);
            }
        }
 public TerminalMenu(SimpleSubrecord <String> ItemText, SimpleSubrecord <String> ResultText, SimpleSubrecord <TerminalMenuFlags> Flags, RecordReference DisplayNote, RecordReference SubMenu, EmbeddedScript Script, List <Condition> Conditions)
 {
     this.ItemText    = ItemText;
     this.ResultText  = ResultText;
     this.Flags       = Flags;
     this.DisplayNote = DisplayNote;
     this.SubMenu     = SubMenu;
     this.Script      = Script;
     this.Conditions  = Conditions;
 }
 public DialogEndScript(SubMarker EndScriptMarker, EmbeddedScript EmbeddedScript)
 {
     this.EndScriptMarker = EndScriptMarker;
     this.EmbeddedScript  = EmbeddedScript;
 }
 public QuestLogEntry(SimpleSubrecord <QuestStageFlags> StageFlags, List <Condition> Conditions, SimpleSubrecord <String> LogEntry, EmbeddedScript Script, RecordReference NextQuest)
 {
     this.StageFlags = StageFlags;
     this.Conditions = Conditions;
     this.LogEntry   = LogEntry;
     this.Script     = Script;
     this.NextQuest  = NextQuest;
 }
 public QuestLogEntry()
 {
     Script = new EmbeddedScript();
 }
 public PackageEvent(RecordReference Idle, EmbeddedScript Script, RecordReference Topic)
 {
     this.Idle   = Idle;
     this.Script = Script;
     this.Topic  = Topic;
 }
Exemple #15
0
        public override void ReadXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("Header", false, out subEle))
            {
                if (Header == null)
                {
                    Header = new PerkEffectHeader();
                }

                Header.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("EffectData", false, out subEle))
            {
                switch (Header.Type)
                {
                case PerkType.QuestStage:
                    EffectData = new PerkQuestStageData();
                    break;

                case PerkType.Ability:
                    EffectData = new PerkAbilityData();
                    break;

                case PerkType.EntryPoint:
                    EffectData = new PerkEntryPointData();
                    break;
                }

                EffectData.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Conditions", false, out subEle))
            {
                if (Conditions == null)
                {
                    Conditions = new List <PerkCondition>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    PerkCondition temp = new PerkCondition();
                    temp.ReadXML(e, master);
                    Conditions.Add(temp);
                }
            }
            if (ele.TryPathTo("EntryPoint/FunctionType", false, out subEle))
            {
                if (EntryPointFunctionType == null)
                {
                    EntryPointFunctionType = new SimpleSubrecord <EntryPointFunctionType>();
                }

                EntryPointFunctionType.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("EntryPoint/FunctionData", false, out subEle))
            {
                switch (EntryPointFunctionType.Value)
                {
                case Enums.EntryPointFunctionType.None:
                    EntryPointFunctionData = new SimpleSubrecord <byte[]>();
                    break;

                case Enums.EntryPointFunctionType.Float:
                    EntryPointFunctionData = new SimpleSubrecord <float>();
                    break;

                case Enums.EntryPointFunctionType.FloatFloat:
                    EntryPointFunctionData = new EntryPointRandRange();
                    break;

                case Enums.EntryPointFunctionType.LeveledItem:
                    EntryPointFunctionData = new RecordReference();
                    break;

                case Enums.EntryPointFunctionType.Script:
                    EntryPointFunctionData = new SimpleSubrecord <byte[]>();
                    break;

                case Enums.EntryPointFunctionType.ActorValueMult:
                    EntryPointFunctionData = new EntryPointActorValMult();
                    break;
                }

                EntryPointFunctionData.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ButtonLabel", false, out subEle))
            {
                if (ButtonLabel == null)
                {
                    ButtonLabel = new SimpleSubrecord <String>();
                }

                ButtonLabel.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("RunImmediately", false, out subEle))
            {
                if (RunImmediately == null)
                {
                    RunImmediately = new SimpleSubrecord <NoYesShort>();
                }

                RunImmediately.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Script", false, out subEle))
            {
                if (Script == null)
                {
                    Script = new EmbeddedScript();
                }

                Script.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("EndMarker", false, out subEle))
            {
                if (EndMarker == null)
                {
                    EndMarker = new SubMarker();
                }

                EndMarker.ReadXML(subEle, master);
            }
        }
Exemple #16
0
 public PerkEffect(PerkEffectHeader Header, SimpleSubrecord <Byte[]> EffectData, List <PerkCondition> Conditions, SimpleSubrecord <EntryPointFunctionType> EntryPointFunctionType, SimpleSubrecord <Byte[]> EntryPointFunctionData, SimpleSubrecord <String> ButtonLabel, SimpleSubrecord <NoYesShort> RunImmediately, EmbeddedScript Script, SubMarker EndMarker)
 {
     this.Header                 = Header;
     this.EffectData             = EffectData;
     this.Conditions             = Conditions;
     this.EntryPointFunctionType = EntryPointFunctionType;
     this.EntryPointFunctionData = EntryPointFunctionData;
     this.ButtonLabel            = ButtonLabel;
     this.RunImmediately         = RunImmediately;
     this.Script                 = Script;
     this.EndMarker              = EndMarker;
 }
        public override void ReadXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("ItemText", false, out subEle))
            {
                if (ItemText == null)
                {
                    ItemText = new SimpleSubrecord <String>();
                }

                ItemText.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ResultText", false, out subEle))
            {
                if (ResultText == null)
                {
                    ResultText = new SimpleSubrecord <String>();
                }

                ResultText.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Flags", false, out subEle))
            {
                if (Flags == null)
                {
                    Flags = new SimpleSubrecord <TerminalMenuFlags>();
                }

                Flags.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("DisplayNote", false, out subEle))
            {
                if (DisplayNote == null)
                {
                    DisplayNote = new RecordReference();
                }

                DisplayNote.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("SubMenu", false, out subEle))
            {
                if (SubMenu == null)
                {
                    SubMenu = new RecordReference();
                }

                SubMenu.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Script", false, out subEle))
            {
                if (Script == null)
                {
                    Script = new EmbeddedScript();
                }

                Script.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Conditions", false, out subEle))
            {
                if (Conditions == null)
                {
                    Conditions = new List <Condition>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    Condition temp = new Condition();
                    temp.ReadXML(e, master);
                    Conditions.Add(temp);
                }
            }
        }