Example #1
0
        public void Load(String Slot)
        {
            if (Slot == null)
            {
                Slot = "AutoSave";
            }

            bool WasSaved;

            if (Slot != "AutoSave")
            {
                String fixer;
                {
                    XmlDocument File = new XmlDocument();
                    File.Load("Saves\\" + Slot + "\\Profile.xml");

                    XmlElement root = File.DocumentElement;
                    XmlNode    Item = root.SelectSingleNode("//Profile");
                    fixer = Item["MapName"].InnerText;
                }
                WasSaved = System.IO.File.Exists("Saves\\" + Slot + "\\" + fixer + "\\Saved.xml");
                Engine.Singleton.CurrentLevel.Name = fixer;
            }

            else
            {
                WasSaved = System.IO.File.Exists("Saves\\" + Slot + "\\" + Engine.Singleton.CurrentLevel.Name + "\\Saved.xml");
            }

            TriggerManager.RemoveAll();
            while (Engine.Singleton.ObjectManager.Objects.Count > 0)
            {
                int q = 0;

                if (Engine.Singleton.ObjectManager.Objects[0] is Character && (Engine.Singleton.ObjectManager.Objects[0] as Character) == Engine.Singleton.HumanController.Character)
                {
                    q = 1;

                    if (Engine.Singleton.ObjectManager.Objects.Count == 1)
                    {
                        break;
                    }
                }


                Engine.Singleton.ObjectManager.Destroy(Engine.Singleton.ObjectManager.Objects[q]);
            }

            //*************************************************************//
            //                                                             //
            //                            ITEMY                            //
            //                                                             //
            //*************************************************************//

            if (System.IO.File.Exists("Saves\\" + Slot + "\\" + CurrentLevel.Name + "\\Items.xml"))
            {
                XmlDocument File = new XmlDocument();
                File.Load("Saves\\" + Slot + "\\" + CurrentLevel.Name + "\\Items.xml");

                XmlElement  root  = File.DocumentElement;
                XmlNodeList Items = root.SelectNodes("//items/item");

                foreach (XmlNode item in Items)
                {
                    if (item["DescribedProfile"].InnerText != "")
                    {
                        Described newDescribed = new Described(Gra.Items.I[item["DescribedProfile"].InnerText]);
                        Vector3   Position     = new Vector3();

                        Quaternion Orientation = new Quaternion(float.Parse(item["Orientation_w"].InnerText), float.Parse(item["Orientation_x"].InnerText), float.Parse(item["Orientation_y"].InnerText), float.Parse(item["Orientation_z"].InnerText));
                        newDescribed.Orientation = Orientation;

                        Position.x              = float.Parse(item["Position_x"].InnerText);
                        Position.y              = float.Parse(item["Position_y"].InnerText);
                        Position.z              = float.Parse(item["Position_z"].InnerText);
                        newDescribed.Position   = Position;
                        newDescribed.Activatorr = item["Activator"].InnerText;
                        newDescribed.PrzypiszMetode();

                        if (newDescribed.IsContainer && WasSaved)
                        {
                            newDescribed.Container.Gold = int.Parse(item["ContainerGold"].InnerText);

                            XmlNodeList No_oN = item["ContainerItems"].ChildNodes;

                            newDescribed.Container.Contains = new List <DescribedProfile>();

                            foreach (XmlNode o_o in No_oN)
                            {
                                newDescribed.Container.Contains.Add(Gra.Items.I[o_o["ContainerItem"].InnerText]);
                            }
                        }

                        Engine.Singleton.ObjectManager.Add(newDescribed);
                    }

                    if (item["ItemSword"].InnerText != "")
                    {
                        Described newDescribed = new Described(Gra.Items.I[item["ItemSword"].InnerText]);
                        Vector3   Position     = new Vector3();

                        Quaternion Orientation = new Quaternion(float.Parse(item["Orientation_w"].InnerText), float.Parse(item["Orientation_x"].InnerText), float.Parse(item["Orientation_y"].InnerText), float.Parse(item["Orientation_z"].InnerText));
                        newDescribed.Orientation = Orientation;

                        Position.x              = float.Parse(item["Position_x"].InnerText);
                        Position.y              = float.Parse(item["Position_y"].InnerText);
                        Position.z              = float.Parse(item["Position_z"].InnerText);
                        newDescribed.Position   = Position;
                        newDescribed.Activatorr = item["Activator"].InnerText;
                        newDescribed.PrzypiszMetode();

                        Engine.Singleton.ObjectManager.Add(newDescribed);
                    }
                }
            }

            //*************************************************************//
            //                                                             //
            //                            NPCs                             //
            //                                                             //
            //*************************************************************//

            if (System.IO.File.Exists("Saves\\" + Slot + "\\" + CurrentLevel.Name + "\\NPCs.xml"))
            {
                XmlDocument File = new XmlDocument();
                File.Load("Saves\\" + Slot + "\\" + CurrentLevel.Name + "\\NPCs.xml");

                XmlElement  root  = File.DocumentElement;
                XmlNodeList Items = root.SelectNodes("//npcs//npc");

                foreach (XmlNode item in Items)
                {
                    Character newCharacter = new Character(CharacterProfileManager.C[item["ProfileName"].InnerText]);
                    Vector3   Position     = new Vector3();

                    Quaternion Orientation = new Quaternion(float.Parse(item["Orientation_w"].InnerText), float.Parse(item["Orientation_x"].InnerText), float.Parse(item["Orientation_y"].InnerText), float.Parse(item["Orientation_z"].InnerText));
                    newCharacter.Orientation = Orientation;

                    Position.x            = float.Parse(item["Position_x"].InnerText);
                    Position.y            = float.Parse(item["Position_y"].InnerText);
                    Position.z            = float.Parse(item["Position_z"].InnerText);
                    newCharacter.Position = Position;

                    if (WasSaved)
                    {
                        newCharacter.Statistics = new Statistics(
                            int.Parse(item["WalkaWrecz"].InnerText), int.Parse(item["Krzepa"].InnerText),
                            int.Parse(item["Opanowanie"].InnerText), int.Parse(item["Odpornosc"].InnerText),
                            int.Parse(item["Zrecznosc"].InnerText), int.Parse(item["Charyzma"].InnerText),
                            int.Parse(item["Zywotnosc"].InnerText), int.Parse(item["Ataki"].InnerText));
                        newCharacter.Statistics.aktualnaZywotnosc = int.Parse(item["aktualnaZywotnosc"].InnerText);
                        newCharacter.State        = (Enemy.StateTypes) int.Parse((item["State"].InnerText));
                        newCharacter.Profile.Gold = ulong.Parse(item["Gold"].InnerText);
                        List <DescribedProfile> Inventory = new List <DescribedProfile>();
                        XmlNodeList             inv       = item["Inventory"].ChildNodes;
                        foreach (XmlNode invItem in inv)
                        {
                            Inventory.Add(Gra.Items.I[invItem["InventoryItem"].InnerText].Clone());
                        }
                        newCharacter.Inventory = Inventory;
                    }

                    Engine.Singleton.ObjectManager.Add(newCharacter);
                }
            }

            //*************************************************************//
            //                                                             //
            //                           ENEMIES                           //
            //                                                             //
            //*************************************************************//

            if (System.IO.File.Exists("Saves\\" + Slot + "\\" + CurrentLevel.Name + "\\Enemies.xml"))
            {
                XmlDocument File = new XmlDocument();
                File.Load("Saves\\" + Slot + "\\" + CurrentLevel.Name + "\\Enemies.xml");

                XmlElement  root  = File.DocumentElement;
                XmlNodeList Items = root.SelectNodes("//enemies//enemy");

                foreach (XmlNode item in Items)
                {
                    Enemy   newCharacter = new Enemy(Gra.CharacterProfileManager.E[item["ProfileName"].InnerText], false, Gra.CharacterProfileManager.E[item["ProfileName"].InnerText].ZasiegWzroku, Gra.CharacterProfileManager.E[item["ProfileName"].InnerText].ZasiegOgolny);
                    Vector3 Position     = new Vector3();

                    Quaternion Orientation = new Quaternion(float.Parse(item["Orientation_w"].InnerText), float.Parse(item["Orientation_x"].InnerText), float.Parse(item["Orientation_y"].InnerText), float.Parse(item["Orientation_z"].InnerText));
                    newCharacter.Orientation = Orientation;

                    Position.x            = float.Parse(item["Position_x"].InnerText);
                    Position.y            = float.Parse(item["Position_y"].InnerText);
                    Position.z            = float.Parse(item["Position_z"].InnerText);
                    newCharacter.Position = Position;

                    if (WasSaved)
                    {
                        newCharacter.Statistics = new Statistics(
                            int.Parse(item["WalkaWrecz"].InnerText), int.Parse(item["Krzepa"].InnerText),
                            int.Parse(item["Opanowanie"].InnerText), int.Parse(item["Odpornosc"].InnerText),
                            int.Parse(item["Zrecznosc"].InnerText), int.Parse(item["Charyzma"].InnerText),
                            int.Parse(item["Zywotnosc"].InnerText), int.Parse(item["Ataki"].InnerText));
                        newCharacter.Statistics.aktualnaZywotnosc = int.Parse(item["aktualnaZywotnosc"].InnerText);
                        newCharacter.State = (Enemy.StateTypes) int.Parse((item["State"].InnerText));
                    }

                    Engine.Singleton.ObjectManager.Add(newCharacter);
                }
            }

            //*************************************************************//
            //                                                             //
            //                        TWOJ PROFIL                          //
            //                                                             //
            //*************************************************************//

            if (WasSaved)
            {
                XmlDocument File = new XmlDocument();
                File.Load("Saves\\" + Slot + "\\Profile.xml");

                XmlElement root = File.DocumentElement;
                XmlNode    Item = root.SelectSingleNode("//Profile");

                Character ch = HumanController.Character;
                ch.Profile.Gold = ulong.Parse(Item["Gold"].InnerText);
                ch.Profile.Exp  = int.Parse(Item["Exp"].InnerText);
                ch.Position     = new Vector3(float.Parse(Item["Position_x"].InnerText),
                                              float.Parse(Item["Position_y"].InnerText),
                                              float.Parse(Item["Position_z"].InnerText));
                ch.Orientation = new Quaternion(float.Parse(Item["Orientation_w"].InnerText),
                                                float.Parse(Item["Orientation_x"].InnerText),
                                                float.Parse(Item["Orientation_y"].InnerText),
                                                float.Parse(Item["Orientation_z"].InnerText));
                ch.Statistics = new Statistics(
                    int.Parse(Item["WalkaWrecz"].InnerText), int.Parse(Item["Krzepa"].InnerText),
                    int.Parse(Item["Opanowanie"].InnerText), int.Parse(Item["Odpornosc"].InnerText),
                    int.Parse(Item["Zrecznosc"].InnerText), int.Parse(Item["Charyzma"].InnerText),
                    int.Parse(Item["Zywotnosc"].InnerText), int.Parse(Item["Ataki"].InnerText));
                ch.Statistics.aktualnaZywotnosc = int.Parse(Item["aktualnaZywotnosc"].InnerText);
                ch.State     = (Enemy.StateTypes) int.Parse((Item["State"].InnerText));
                ch.Inventory = new List <DescribedProfile>();

                XmlNodeList invItems = Item["Inventory"].ChildNodes;

                foreach (XmlNode invItem in invItems)
                {
                    ch.Inventory.Add(Gra.Items.I[invItem["ProfileName"].InnerText].Clone());

                    if (bool.Parse(invItem["IsEquipment"].InnerText))
                    {
                        ch.Inventory[ch.Inventory.Count - 1].IsEquipment = true;
                        ch.Sword = ch.Inventory[ch.Inventory.Count - 1] as ItemSword;
                    }
                }

                if (Slot != "AutoSave")
                {
                    CurrentLevel.DeleteWithAutoSave = false;
                    CurrentLevel.LoadNewMap         = true;
                    CurrentLevel.NewMapName         = Item["MapName"].InnerText;
                    CurrentLevel.NewMapNav          = "Karczmanav";

                    Gra.Quests.Reload();

                    XmlNodeList quests = Item["Quests"].ChildNodes;

                    foreach (XmlNode quest in quests)
                    {
                        Quest q = Gra.Quests.Q[quest["QuestName"].InnerText];
                        q.IsFinished = bool.Parse(quest["IsFinished"].InnerText);
                        q.KilledEnemies.Clear();

                        XmlNodeList killedEnemies = quest["KilledEnemies"].ChildNodes;

                        foreach (XmlNode killedEnemy in killedEnemies)
                        {
                            q.KilledEnemies.Add(killedEnemy["EnemyName"].InnerText, int.Parse(killedEnemy["Amount"].InnerText));
                        }

                        ch.ActiveQuests.Add(Gra.Quests.Q[quest["QuestName"].InnerText]);
                    }
                }
            }

            //*************************************************************//
            //                                                             //
            //                           DIALOGI                           //
            //                                                             //
            //*************************************************************//

            if (Slot != "AutoSave")
            {
                XmlDocument File = new XmlDocument();
                File.Load("Saves\\" + Slot + "\\Dialogi.xml");

                XmlElement  root  = File.DocumentElement;
                XmlNodeList Items = root.SelectNodes("//Dialogi//Dialog");

                foreach (XmlNode Item in Items)
                {
                    String id = Item["DialogID"].InnerText;
                    Dialog d  = Conversations.D[id];

                    XmlNodeList talkEdges = Item["TalkEdges"].ChildNodes;

                    foreach (XmlNode talkEdge in talkEdges)
                    {
                        String   edgeid = talkEdge["EdgeID"].InnerText;
                        TalkEdge e      = d.Edges[edgeid];

                        e.FirstTalk = bool.Parse(talkEdge["FirstTalk"].InnerText);
                        e.Other     = bool.Parse(talkEdge["Other"].InnerText);
                    }
                }
            }

            //*************************************************************//
            //                                                             //
            //                         WAYPOINTS                           //
            //                                                             //
            //*************************************************************//

            Engine.Singleton.CurrentLevel.WayPoints.Clear();

            if (System.IO.File.Exists("Media\\Maps\\" + CurrentLevel.Name + "\\Waypoints.xml"))
            {
                XmlDocument File = new XmlDocument();
                File.Load("Media\\Maps\\" + CurrentLevel.Name + "\\Waypoints.xml");

                XmlElement  root  = File.DocumentElement;
                XmlNodeList Items = root.SelectNodes("//waypoints//waypoint");

                foreach (XmlNode item in Items)
                {
                    WayPoint newWP = new WayPoint();
                    newWP.DisplayName = item["DisplayName"].InnerText;
                    Vector3 pos = new Vector3(float.Parse(item["Position_x"].InnerText),
                                              float.Parse(item["Position_y"].InnerText),
                                              float.Parse(item["Position_z"].InnerText));
                    newWP.Position = pos;

                    Engine.Singleton.CurrentLevel.WayPoints.Add(newWP);
                    Engine.Singleton.ObjectManager.Add(newWP);
                }
            }

            TriggerManager.Load();
        }
Example #2
0
        public Conversations()
        {
            D = new Dictionary <String, Dialog>();

            if (File.Exists("Media\\Others\\Dialogi.xml"))
            {
                XmlDocument File1 = new XmlDocument();
                File1.Load("Media\\Others\\Dialogi.xml");
                XmlElement  root  = File1.DocumentElement;
                XmlNodeList Items = root.SelectNodes("//Dialogs//Dialog");

                foreach (XmlNode item in Items)
                {
                    Dialog justDialog = new Dialog();

                    XmlNodeList TalkReactions = item["Reactions"].ChildNodes;

                    foreach (XmlNode tr in TalkReactions)
                    {
                        TalkReaction justReaction = new TalkReaction();
                        justDialog.Reactions.Add(tr["TalkReactionID"].InnerText, justReaction);
                    }

                    XmlNodeList TalkReplies = item["Replies"].ChildNodes;

                    foreach (XmlNode rep in TalkReplies)
                    {
                        TalkReply justReply = new TalkReply();
                        justReply.IsEnding = bool.Parse(rep["IsEnding"].InnerText);

                        float dur = float.Parse(rep["Duration"].InnerText);
                        justReply.Text.Add(new TalkText((rep["Text"].InnerText), dur, rep["Sound"].InnerText));


                        if (!justReply.IsEnding)
                        {
                            justReply.Reaction = justDialog.Reactions[rep["TalkReaction"].InnerText];
                        }

                        justDialog.Replies.Add(rep["TalkReplyID"].InnerText, justReply);
                    }

                    XmlNodeList TalkNodes = item["Nodes"].ChildNodes;

                    foreach (XmlNode tn in TalkNodes)
                    {
                        TalkNode justNode = new TalkNode();

                        float dur = float.Parse(tn["Duration"].InnerText);
                        justNode.Text.Add(new TalkText((tn["Text"].InnerText), dur, tn["Sound"].InnerText));

                        XmlNodeList RepliesInNode = tn["NodeReplies"].ChildNodes;

                        foreach (XmlNode rin in RepliesInNode)
                        {
                            justNode.Replies.Add(justDialog.Replies[rin["ReplyID"].InnerText]);
                        }

                        XmlNodeList       ActionsInNode = tn["Actions"].ChildNodes;
                        List <ActionType> actionList    = new List <ActionType>();

                        foreach (XmlNode ain in ActionsInNode)
                        {
                            actionList.Add((ActionType)int.Parse(ain["ActionType"].InnerText));
                        }

                        justNode.AddActions(actionList);

                        if (tn["TalkEdges"].ChildNodes.Count > 0)
                        {
                            XmlNodeList nodelist = tn["TalkEdges"].ChildNodes;

                            foreach (XmlNode nod in nodelist)
                            {
                                justDialog.EdgesToNodes.Add(nod["TalkEdgeID"].InnerText, tn["TalkNodeID"].InnerText);
                            }
                        }

                        justNode.Quest = tn["QuestID"].InnerText;
                        if (tn["PrizeNPC"].InnerText != "")
                        {
                            justNode.PrizeNPC = PrizeManager.P[tn["PrizeNPC"].InnerText];
                        }

                        if (tn["PrizePlayer"].InnerText != "")
                        {
                            justNode.PrizePlayer = PrizeManager.P[tn["PrizePlayer"].InnerText];
                        }

                        if (tn["PrizePlayerRemove"].InnerText != "")
                        {
                            justNode.PrizePlayerRemove = PrizeManager.P[tn["PrizePlayerRemove"].InnerText];
                        }

                        if (tn["Activator"].InnerText != "" && tn["Activator"].InnerText != null)
                        {
                            justNode.Activatorr = tn["Activator"].InnerText;
                        }
                        else
                        {
                            justNode.Activatorr = "";
                        }
                        justNode.PrzypiszMetode();
                        justNode.DialogID = item["DialogID"].InnerText;
                        justDialog.Nodes.Add(tn["TalkNodeID"].InnerText, justNode);
                    }

                    XmlNodeList TalkEdges = item["Edges"].ChildNodes;

                    foreach (XmlNode te in TalkEdges)
                    {
                        TalkEdge justEdge = new TalkEdge(justDialog.Nodes[te["ToWhere"].InnerText]);
                        justEdge.ID = te["TalkEdgeID"].InnerText;
                        XmlNodeList      ConditionsInEdge = te["Conditions"].ChildNodes;
                        List <Condition> listaWarunkow    = new List <Condition>();

                        foreach (XmlNode cin in ConditionsInEdge)
                        {
                            listaWarunkow.Add((Condition)int.Parse(cin["ConditionType"].InnerText));
                        }

                        justEdge.AddConditions(listaWarunkow);

                        while (justDialog.EdgesToNodes.ContainsKey(te["TalkEdgeID"].InnerText))
                        {
                            justDialog.Nodes[justDialog.EdgesToNodes[te["TalkEdgeID"].InnerText]].Edges.Add(justEdge);
                            justDialog.EdgesToNodes.Remove(te["TalkEdgeID"].InnerText);
                        }

                        justEdge.Quest      = te["ConditionQuestID"].InnerText;
                        justEdge.AmountGold = int.Parse(te["GoldRequired"].InnerText);

                        justDialog.Edges.Add(te["TalkEdgeID"].InnerText, justEdge);
                        justDialog.Reactions[te["FromWhere"].InnerText].Edges.Add(justDialog.Edges[te["TalkEdgeID"].InnerText]);
                    }

                    justDialog.ID = item["DialogID"].InnerText;
                    D.Add(item["DialogID"].InnerText, justDialog);
                }
            }
        }
Example #3
0
        public Conversations()
        {
            D = new Dictionary<String, Dialog>();

            if (File.Exists("Media\\Others\\Dialogi.xml"))
            {
                XmlDocument File1 = new XmlDocument();
                File1.Load("Media\\Others\\Dialogi.xml");
                XmlElement root = File1.DocumentElement;
                XmlNodeList Items = root.SelectNodes("//Dialogs//Dialog");

                foreach (XmlNode item in Items)
                {
                    Dialog justDialog = new Dialog();

                    XmlNodeList TalkReactions = item["Reactions"].ChildNodes;

                    foreach (XmlNode tr in TalkReactions)
                    {
                        TalkReaction justReaction = new TalkReaction();
                        justDialog.Reactions.Add(tr["TalkReactionID"].InnerText, justReaction);
                    }

                    XmlNodeList TalkReplies = item["Replies"].ChildNodes;

                    foreach (XmlNode rep in TalkReplies)
                    {
                        TalkReply justReply = new TalkReply();
                        justReply.IsEnding = bool.Parse(rep["IsEnding"].InnerText);

                        float dur = float.Parse(rep["Duration"].InnerText);
                        justReply.Text.Add(new TalkText((rep["Text"].InnerText), dur, rep["Sound"].InnerText));

                        if (!justReply.IsEnding)
                            justReply.Reaction = justDialog.Reactions[rep["TalkReaction"].InnerText];

                        justDialog.Replies.Add(rep["TalkReplyID"].InnerText, justReply);
                    }

                    XmlNodeList TalkNodes = item["Nodes"].ChildNodes;

                    foreach (XmlNode tn in TalkNodes)
                    {
                        TalkNode justNode = new TalkNode();

                        float dur = float.Parse(tn["Duration"].InnerText);
                        justNode.Text.Add(new TalkText((tn["Text"].InnerText), dur, tn["Sound"].InnerText));

                        XmlNodeList RepliesInNode = tn["NodeReplies"].ChildNodes;

                        foreach (XmlNode rin in RepliesInNode)
                        {
                            justNode.Replies.Add(justDialog.Replies[rin["ReplyID"].InnerText]);
                        }

                        XmlNodeList ActionsInNode = tn["Actions"].ChildNodes;
                        List<ActionType> actionList = new List<ActionType>();

                        foreach (XmlNode ain in ActionsInNode)
                        {
                            actionList.Add((ActionType)int.Parse(ain["ActionType"].InnerText));
                        }

                        justNode.AddActions(actionList);

                        if (tn["TalkEdges"].ChildNodes.Count > 0)
                        {
                            XmlNodeList nodelist = tn["TalkEdges"].ChildNodes;

                            foreach (XmlNode nod in nodelist)
                                justDialog.EdgesToNodes.Add(nod["TalkEdgeID"].InnerText, tn["TalkNodeID"].InnerText);
                        }

                        justNode.Quest = tn["QuestID"].InnerText;
                        if (tn["PrizeNPC"].InnerText != "")
                            justNode.PrizeNPC = PrizeManager.P[tn["PrizeNPC"].InnerText];

                        if (tn["PrizePlayer"].InnerText != "")
                            justNode.PrizePlayer = PrizeManager.P[tn["PrizePlayer"].InnerText];

                        if (tn["PrizePlayerRemove"].InnerText != "")
                            justNode.PrizePlayerRemove = PrizeManager.P[tn["PrizePlayerRemove"].InnerText];

                        if (tn["Activator"].InnerText != "" && tn["Activator"].InnerText != null)
                            justNode.Activatorr = tn["Activator"].InnerText;
                        else
                            justNode.Activatorr = "";
                        justNode.PrzypiszMetode();
                        justNode.DialogID = item["DialogID"].InnerText;
                        justDialog.Nodes.Add(tn["TalkNodeID"].InnerText, justNode);
                    }

                    XmlNodeList TalkEdges = item["Edges"].ChildNodes;

                    foreach (XmlNode te in TalkEdges)
                    {
                        TalkEdge justEdge = new TalkEdge(justDialog.Nodes[te["ToWhere"].InnerText]);
                        justEdge.ID = te["TalkEdgeID"].InnerText;
                        XmlNodeList ConditionsInEdge = te["Conditions"].ChildNodes;
                        List<Condition> listaWarunkow = new List<Condition>();

                        foreach (XmlNode cin in ConditionsInEdge)
                        {
                            listaWarunkow.Add((Condition)int.Parse(cin["ConditionType"].InnerText));
                        }

                        justEdge.AddConditions(listaWarunkow);

                        while (justDialog.EdgesToNodes.ContainsKey(te["TalkEdgeID"].InnerText))
                        {
                            justDialog.Nodes[justDialog.EdgesToNodes[te["TalkEdgeID"].InnerText]].Edges.Add(justEdge);
                            justDialog.EdgesToNodes.Remove(te["TalkEdgeID"].InnerText);
                        }

                        justEdge.Quest = te["ConditionQuestID"].InnerText;
                        justEdge.AmountGold = int.Parse(te["GoldRequired"].InnerText);

                        justDialog.Edges.Add(te["TalkEdgeID"].InnerText, justEdge);
                        justDialog.Reactions[te["FromWhere"].InnerText].Edges.Add(justDialog.Edges[te["TalkEdgeID"].InnerText]);
                    }

                    justDialog.ID = item["DialogID"].InnerText;
                    D.Add(item["DialogID"].InnerText, justDialog);
                }
            }
        }