// Token: 0x0600001B RID: 27 RVA: 0x000033B0 File Offset: 0x000015B0
        public static void SetupRufusInteraction()
        {
            GameObject gameObject = GameObject.Find("Dialogue_Rufus/NPC/DialogueTree_1_Initial");
            bool       flag       = gameObject != null;

            if (flag)
            {
                DialogueTreeController component = gameObject.GetComponent <DialogueTreeController>();
                bool flag2 = component != null;
                if (flag2)
                {
                    Graph            graph            = component.graph;
                    List <Node>      allNodes         = graph.allNodes;
                    StatementNodeExt statementNodeExt = allNodes.FirstOrDefault((Node n) => n != null && n is StatementNodeExt && ((StatementNodeExt)n).statement.text.Contains("Elatt however... I’ve had the honor to speak with him. He is very real. Having a god that was once man is comforting.")) as StatementNodeExt;
                    bool             flag3            = statementNodeExt != null;
                    if (flag3)
                    {
                        ActionNode actionNode = graph.AddNode <ActionNode>();
                        GiveReward giveReward = new GiveReward();
                        actionNode.action         = giveReward;
                        giveReward.RewardReceiver = GiveReward.Receiver.Instigator;
                        NodeCanvas.Tasks.Actions.ItemQuantity itemQuantity = new NodeCanvas.Tasks.Actions.ItemQuantity();
                        itemQuantity.Item = new BBParameter <ItemReference>(new ItemReference
                        {
                            ItemID = Templar.Instance.prayerInstance.ItemID
                        });
                        itemQuantity.Quantity = 1;
                        giveReward.ItemReward = new List <NodeCanvas.Tasks.Actions.ItemQuantity>
                        {
                            itemQuantity
                        };
                        statementNodeExt.outConnections[0] = Connection.Create(statementNodeExt, actionNode, -1, -1);
                        FinishNode finishNode = graph.AddNode <FinishNode>();
                        allNodes.Add(finishNode);
                        graph.ConnectNodes(actionNode, finishNode, -1, -1);
                    }
                }
            }
        }
        public static void OnActivate(NPCInteraction __instance)
        {
            try
            {
                //SoroboreanTravelAgency.Instance.MyLogger.LogDebug(__instance.ActorLocKey);
                Character character = CharacterManager.Instance.GetCharacter(CharacterManager.Instance.PlayerCharacters.Values[0]);
                if (character == null)
                {
                    return;
                }
                if (StoreManager.Instance.IsDlcInstalled(OTWStoreAPI.DLCs.Soroboreans))
                {
                    return;
                }
                AreaEnum areaN = (AreaEnum)AreaManager.Instance.GetAreaIndexFromSceneName(SceneManagerHelper.ActiveSceneName);
                if (!SoroboreanTravelAgency.StartAreaToTravel.ContainsKey(areaN))
                {
                    return;
                }
                SoroboreanTravelAgency.TravelDayCost = (int)(float)SoroboreanTravelAgency.Instance.MyConfig.GetValue("Travel Day Cost"); // 80 - 100 - 120
                if (areaN == AreaEnum.Levant)                                                                                            // TODO: check quest "Blood under the Sun"
                {
                    SoroboreanTravelAgency.TravelDayCost = (int)(SoroboreanTravelAgency.TravelDayCost * 1.75);                           // 140 - 175 - 210
                }
                // TODO: HallowPeaceGuardBlock
                if (__instance.ActorLocKey == "name_unpc_caravantrader_01")
                {
                    var graphOwner = __instance.NPCDialogue.DialogueController;
                    var graph      = (Graph)graphOwner.GetType().BaseType.GetField("_graph", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(graphOwner as GraphOwner <DialogueTreeExt>);
                    var nodes      = typeof(Graph).GetField("_nodes", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(graph as Graph) as List <Node>;
                    var firstNode  = (nodes.First(n => n.GetType().Name == "MultipleChoiceNodeExt") as MultipleChoiceNodeExt);

                    if (SoroboreanTravelAgency.DialogIsSet)
                    {
                        foreach (var node in graph.allNodes.Where(n => n.tag == "SoroboreanTravelAgency").ToList())
                        {
                            graph.RemoveNode(node);
                        }
                        firstNode.availableChoices.RemoveAll(c => c.statement.meta == "TRAVEL");
                    }

                    int cnt = firstNode.availableChoices.Count - 2;
                    firstNode.availableChoices.Insert(cnt, new MultipleChoiceNodeExt.Choice(new Statement("I want to travel, please.", GlobalAudioManager.Sounds.BGM_Empty, "TRAVEL")));
                    StatementNodeExt nStart = graph.AddNode <StatementNodeExt>();
                    nStart.tag       = "SoroboreanTravelAgency";
                    nStart.statement = new Statement($"Where do you want to go?");
                    nStart.SetActorName(__instance.ActorLocKey);

                    StatementNodeExt nResultMoneyBad = graph.AddNode <StatementNodeExt>();
                    nResultMoneyBad.tag       = "SoroboreanTravelAgency";
                    nResultMoneyBad.statement = new Statement("Sorry, you don't have enough silver. Come back when you can afford it!");
                    nResultMoneyBad.SetActorName(__instance.ActorLocKey);
                    StatementNodeExt nResultRationsBad = graph.AddNode <StatementNodeExt>();
                    nResultRationsBad.tag       = "SoroboreanTravelAgency";
                    nResultRationsBad.statement = new Statement("Sorry, you don't have enough rations to travel this far.");
                    nResultRationsBad.SetActorName(__instance.ActorLocKey);
                    StatementNodeExt nCancel = graph.AddNode <StatementNodeExt>();
                    nCancel.tag       = "SoroboreanTravelAgency";
                    nCancel.statement = new Statement("See you soon!");
                    nCancel.SetActorName(__instance.ActorLocKey);
                    FinishNode nFinish = graph.AddNode <FinishNode>();
                    nFinish.tag = "SoroboreanTravelAgency";
                    StatementNodeExt nNoDestination = graph.AddNode <StatementNodeExt>();
                    nNoDestination.tag       = "SoroboreanTravelAgency";
                    nNoDestination.statement = new Statement("Sorry, you have not discovered any other town... You can only travel to places you visited at least once!");
                    nNoDestination.SetActorName(__instance.ActorLocKey);

                    bool hasEntry = false;
                    MultipleChoiceNodeExt nChoose = graph.AddNode <MultipleChoiceNodeExt>();
                    nChoose.tag = "SoroboreanTravelAgency";
                    foreach (StrTravel travel in SoroboreanTravelAgency.StartAreaToTravel[areaN])
                    {
                        //if (!QuestEventManager.Instance.HasQuestEvent(SoroboreanTravelAgency.AreaToQuestEvent[travel.TargetArea]))
                        if (!(bool)SoroboreanTravelAgency.Instance.MyConfig.GetValue(travel.TargetArea + "Visited"))
                        {
                            continue; // This town has not been visited yet
                        }

                        hasEntry = true;
                        string areaLabel = travel.TargetArea.ToString();
                        if (travel.TargetArea == AreaEnum.CierzoVillage)
                        {
                            areaLabel = "Cierzo";
                        }
                        int    rationsCost = travel.DurationDays;
                        int    moneyCost   = travel.DurationDays * SoroboreanTravelAgency.TravelDayCost;
                        string msgCost     = $"{areaLabel} ({moneyCost} silver and {rationsCost} rations).";
                        if (travel.DurationDays == 0)
                        {
                            rationsCost = 0;
                            moneyCost   = SoroboreanTravelAgency.TravelDayCost;
                            msgCost     = $"{areaLabel} ({moneyCost} silver).";
                        }
                        nChoose.availableChoices.Add(new MultipleChoiceNodeExt.Choice(new Statement(msgCost)));

                        ConditionNode nCheckMoney = graph.AddNode <ConditionNode>();
                        nCheckMoney.tag       = "SoroboreanTravelAgency";
                        nCheckMoney.condition = new Condition_OwnsItem()
                        {
                            character = character,
                            item      = new ItemReference {
                                ItemID = 9000010
                            },
                            minAmount = moneyCost
                        };
                        ConditionNode nCheckRations = graph.AddNode <ConditionNode>();
                        nCheckRations.tag       = "SoroboreanTravelAgency";
                        nCheckRations.condition = new Condition_OwnsItem()
                        {
                            character = character,
                            item      = new ItemReference {
                                ItemID = 4100550
                            },                                             // Travel Ration
                            minAmount = rationsCost
                        };
                        graph.ConnectNodes(nChoose, nCheckMoney);

                        ActionNode nWishRent = graph.AddNode <ActionNode>();
                        nWishRent.tag = "SoroboreanTravelAgency";
                        ActionList actions = new ActionList();
                        actions.AddAction(new NodeCanvas.Tasks.Actions.PlaySound()
                        {
                            Sound = GlobalAudioManager.Sounds.UI_MERCHANT_CompleteTransaction
                        });
                        actions.AddAction(new NodeCanvas.Tasks.Actions.FadeOut()
                        {
                            fadeTime = 1.0f
                        });
                        actions.AddAction(new SetTravelArea()
                        {
                            Script     = SoroboreanTravelAgency.Instance,
                            TargetArea = travel.TargetArea
                        });
                        actions.AddAction(new AreaSwitchPlayersTime()
                        {
                            Character    = new BBParameter <Character>(character),
                            Area         = travel.TargetArea,
                            IncreaseTime = travel.DurationDays * 24
                        });
                        actions.AddAction(new NodeCanvas.Tasks.Actions.RemoveItem()
                        {
                            fromCharacter = new BBParameter <Character>(character),
                            Items         = new List <BBParameter <ItemReference> >()
                            {
                                new ItemReference {
                                    ItemID = 9000010
                                }, new ItemReference {
                                    ItemID = 4100550
                                }
                            },
                            Amount = new List <BBParameter <int> >()
                            {
                                new BBParameter <int>(moneyCost), new BBParameter <int>(rationsCost)
                            },
                        });
                        nWishRent.action = actions;
                        graph.ConnectNodes(nCheckMoney, nCheckRations);
                        graph.ConnectNodes(nCheckMoney, nResultMoneyBad);
                        graph.ConnectNodes(nCheckRations, nWishRent);
                        graph.ConnectNodes(nCheckRations, nResultRationsBad);
                        graph.ConnectNodes(nWishRent, nFinish);
                    }
                    if (hasEntry)
                    {
                        graph.ConnectNodes(firstNode, nStart, cnt);
                        nChoose.availableChoices.Add(new MultipleChoiceNodeExt.Choice(new Statement("Changed my mind.")));
                        graph.ConnectNodes(nStart, nChoose);
                        graph.ConnectNodes(nChoose, nCancel);
                    }
                    else
                    {
                        graph.ConnectNodes(firstNode, nNoDestination, cnt);
                    }

                    graph.ConnectNodes(nResultMoneyBad, nFinish);
                    graph.ConnectNodes(nResultRationsBad, nFinish);
                    graph.ConnectNodes(nNoDestination, nFinish);
                    graph.ConnectNodes(nCancel, nFinish);//*/

                    SoroboreanTravelAgency.DialogIsSet = true;
                }
            }
            catch (Exception ex)
            {
                SoroboreanTravelAgency.Instance.MyLogger.LogError(ex.Message);
            }
        }
Пример #3
0
        // Token: 0x06000006 RID: 6 RVA: 0x000022B4 File Offset: 0x000004B4
        public static void SetupTrainerClientSide(GameObject juggernautGameObject, int trainerViewID)
        {
            GameObject gameObject = new GameObject("UNPC_The Juggernaut");

            gameObject.transform.position             = JuggernautTrainer.TrainerLocation;
            juggernautGameObject.transform.parent     = gameObject.transform;
            juggernautGameObject.transform.position   = gameObject.transform.position;
            juggernautGameObject.transform.rotation   = Quaternion.Euler(0f, 220.5518f, 0f);
            juggernautGameObject.transform.localScale = new Vector3(1.15f, 1.15f, 1.15f);
            UnityEngine.Object.DestroyImmediate(juggernautGameObject.GetComponent <StartingEquipment>());
            Character component = juggernautGameObject.GetComponent <Character>();

            component.Stats.enabled = false;
            Weapon currentWeapon = component.CurrentWeapon;
            bool   flag          = currentWeapon != null && currentWeapon.TwoHanded;

            if (flag)
            {
                component.LeftHandEquipment = component.CurrentWeapon;
                component.LeftHandChanged();
            }
            component.Sheathed = false;
            GameObject gameObject2 = UnityEngine.Object.Instantiate(Resources.Load("editor/templates/TrainerTemplate")) as GameObject;

            gameObject2.transform.parent   = juggernautGameObject.transform;
            gameObject2.transform.position = juggernautGameObject.transform.position;
            gameObject2.transform.rotation = juggernautGameObject.transform.rotation;
            DialogueActor componentInChildren = gameObject2.GetComponentInChildren <DialogueActor>();

            componentInChildren.SetName("The Juggernaut");
            Trainer componentInChildren2 = gameObject2.GetComponentInChildren <Trainer>();

            At.SetValue <UID>(JuggernautMod.juggernautTreeInstance.UID, typeof(Trainer), componentInChildren2, "m_skillTreeUID");
            DialogueTreeController componentInChildren3 = gameObject2.GetComponentInChildren <DialogueTreeController>();
            Graph graph = componentInChildren3.graph;
            List <DialogueTree.ActorParameter> list = At.GetValue(typeof(DialogueTree), graph as DialogueTree, "_actorParameters") as List <DialogueTree.ActorParameter>;

            list[0].actor = componentInChildren;
            list[0].name  = componentInChildren.name;
            List <Node>      list2            = At.GetValue(typeof(Graph), graph, "_nodes") as List <Node>;
            StatementNodeExt statementNodeExt = graph.AddNode <StatementNodeExt>();

            statementNodeExt.statement = new Statement("What do you want, peasant?");
            statementNodeExt.SetActorName(componentInChildren.name);
            MultipleChoiceNodeExt multipleChoiceNodeExt = graph.AddNode <MultipleChoiceNodeExt>();

            multipleChoiceNodeExt.availableChoices.Add(new MultipleChoiceNodeExt.Choice
            {
                statement = new Statement
                {
                    text = "I wish to become a legend like you!"
                }
            });
            multipleChoiceNodeExt.availableChoices.Add(new MultipleChoiceNodeExt.Choice
            {
                statement = new Statement
                {
                    text = "Who are you?"
                }
            });
            ActionNode actionNode = list2[1] as ActionNode;

            (actionNode.action as TrainDialogueAction).Trainer = new BBParameter <Trainer>(componentInChildren2);
            StatementNodeExt statementNodeExt2 = graph.AddNode <StatementNodeExt>();

            statementNodeExt2.statement = new Statement("Hah! Like you don't know... Everyone knows me, I'm a living legend known as \"The Juggernaut\"!");
            statementNodeExt2.SetActorName(componentInChildren.name);
            list2.Clear();
            list2.Add(statementNodeExt);
            list2.Add(multipleChoiceNodeExt);
            list2.Add(actionNode);
            list2.Add(statementNodeExt2);
            graph.primeNode = statementNodeExt;
            graph.ConnectNodes(statementNodeExt, multipleChoiceNodeExt, -1, -1);
            graph.ConnectNodes(multipleChoiceNodeExt, actionNode, 0, -1);
            graph.ConnectNodes(multipleChoiceNodeExt, statementNodeExt2, 1, -1);
            graph.ConnectNodes(statementNodeExt2, statementNodeExt, -1, -1);
            gameObject.SetActive(true);
        }
Пример #4
0
        public static void DebugDialogue(Node p_node, int p_level, NodeCanvas.Status p_status = NodeCanvas.Status.Running)
        {
            string strTab = "";

            for (int i = 0; i < p_level; i++)
            {
                strTab += " |-";
            }
            strTab += " ";
            if (p_node.GetType().Name == "StatementNodeExt")
            {
                StatementNodeExt n   = p_node as StatementNodeExt;
                string           msg = n.statement.text;
                if (msg.Length > 60)
                {
                    msg = msg.Substring(0, 60) + "...";
                }
                OLogger.Log($"{strTab}{n.ID}: SAY \"{msg}\"");
                //OLogger.Log($"{strTab} outConnectionType={n.outConnectionType.GetType().Name}");
                //OLogger.Log($"{strTab} isBreakpoint={n.isBreakpoint}");
                //OLogger.Log($"{strTab} allowAsPrime={n.allowAsPrime}");
            }
            else if (p_node.GetType().Name == "MultipleChoiceNodeExt")
            {
                MultipleChoiceNodeExt n = p_node as MultipleChoiceNodeExt;
                OLogger.Log($"{strTab}{n.ID}: MCH");
                foreach (var choice in n.availableChoices)
                {
                    int targetNodeId = n.availableChoices.IndexOf(choice);
                    if (targetNodeId >= 0 && n.outConnections.Count > targetNodeId)
                    {
                        targetNodeId = n.outConnections[targetNodeId].targetNode.ID;
                    }
                    OLogger.Log($"{strTab}> {choice.condition?.name}\"{choice.condition?.GetType().Name} {choice.statement.text}\" --> {targetNodeId}");
                }
            }
            else if (p_node.GetType().Name == "ConditionNode")
            {
                ConditionNode n   = p_node as ConditionNode;
                string        msg = $"{strTab}{n.ID}: CND";
                if (n.condition != null)
                {
                    /*switch (n.condition.GetType().Name)
                     * {
                     *  default:
                     *      break;
                     * }*/
                    msg += $" {n.condition.GetType().Name}";
                }
                OLogger.Log(msg);
            }
            // TODO : MultipleConditionNode
            else if (p_node.GetType().Name == "ActionNode")
            {
                ActionNode n = p_node as ActionNode;
                OLogger.Log($"{strTab}{n.ID}: ACT {n.action?.GetType().Name} ");
                if (n.action.GetType().Name == "BranchDialogue")
                {
                    OLogger.Log($"{(n.action as BranchDialogue).dialogueStarter.ToString()}");
                }
            }
            else if (p_node.GetType().Name == "FinishNode")
            {
                FinishNode n = p_node as FinishNode;
                OLogger.Log($"{strTab}{n.ID}: END");
            }
            else
            {
                OLogger.Log($"{strTab}{p_node.ID}: [{p_node.GetType().Name}]");
            }

            foreach (var conn in p_node.outConnections)
            {
                DebugDialogue(conn.targetNode, p_level + 1, conn.status);
            }
        }
Пример #5
0
        public static void OnActivate(NPCInteraction __instance)
        {
            try
            {
                AreaEnum areaN = (AreaEnum)AreaManager.Instance.GetAreaIndexFromSceneName(SceneManagerHelper.ActiveSceneName);
                if (!InnRentStash.StashAreaToQuestEvent.ContainsKey(areaN) || CharacterManager.Instance.PlayerCharacters.Count == 0)
                {
                    return;
                }
                Character character = CharacterManager.Instance.GetCharacter(CharacterManager.Instance.PlayerCharacters.Values[0]);
                if (character == null)
                {
                    return;
                }
                if (__instance.ActorLocKey != InnRentStash.StashAreaToQuestEvent[areaN].NpcName)
                {
                    return;
                }
                var graphOwner = __instance.NPCDialogue.DialogueController;
                var graph      = (Graph)graphOwner.GetType().BaseType.GetField("_graph", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(graphOwner as GraphOwner <DialogueTreeExt>);
                var nodes      = typeof(Graph).GetField("_nodes", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(graph as Graph) as List <Node>;
                var firstNode  = nodes.First(n => n.GetType().Name == "MultipleChoiceNodeExt") as MultipleChoiceNodeExt;

                foreach (var node in graph.allNodes.Where(n => n.tag == "InnRentStash").ToList())
                {
                    graph.RemoveNode(node);
                }
                firstNode.availableChoices.RemoveAll(c => c.statement.meta == "RENT");

                //TreeNode<Node>.DebugDialogue(nodes[0], 0);

                /* Un dialogue c'est: afficher un texte + action(optionnel) + choix(optionnel)
                 *
                 * Outil de conversion Graph --> ma structure
                 */
                firstNode.availableChoices.Insert(1, new MultipleChoiceNodeExt.Choice(new Statement("I want to rent a stash, please.", GlobalAudioManager.Sounds.BGM_Empty, "RENT")));
                StatementNodeExt nStart = graph.AddNode <StatementNodeExt>();
                nStart.tag       = "InnRentStash";
                nStart.statement = new Statement($"Of course! Renting a stash costs only {InnRentStash.Instance.ConfigRentPrice.Value} silver for one week.");
                nStart.SetActorName(__instance.ActorLocKey);
                MultipleChoiceNodeExt nChoose = graph.AddNode <MultipleChoiceNodeExt>();
                nChoose.tag = "InnRentStash";
                nChoose.availableChoices.Add(new MultipleChoiceNodeExt.Choice(new Statement("Sh*t up and take my money!")));
                nChoose.availableChoices.Add(new MultipleChoiceNodeExt.Choice(new Statement("I will be back.")));
                ConditionNode nCheckMoney = graph.AddNode <ConditionNode>();
                nCheckMoney.tag       = "InnRentStash";
                nCheckMoney.condition = new Condition_OwnsItem()
                {
                    character = character,
                    item      = new ItemReference {
                        ItemID = 9000010
                    },
                    minAmount = InnRentStash.Instance.ConfigRentPrice.Value
                };
                ConditionNode nCheckHouse = graph.AddNode <ConditionNode>();
                nCheckHouse.tag       = "InnRentStash";
                nCheckHouse.condition = new Condition_QuestEventOccured()
                {
                    QuestEventRef = new QuestEventReference {
                        EventUID = InnRentStash.StashAreaToQuestEvent[areaN].PlayerHouseQuestEventUID
                    }
                };
                StatementNodeExt nCheckHouseBad = graph.AddNode <StatementNodeExt>();
                nCheckHouseBad.tag       = "InnRentStash";
                nCheckHouseBad.statement = new Statement("You have a house, no need to rent a stash anymore.");
                nCheckHouseBad.SetActorName(__instance.ActorLocKey);
                ConditionNode nCheckAlready = graph.AddNode <ConditionNode>();
                nCheckAlready.tag       = "InnRentStash";
                nCheckAlready.condition = new Condition_QuestEventOccured()
                {
                    QuestEventRef = new QuestEventReference {
                        EventUID = InnRentStash.StashAreaToQuestEvent[areaN].QuestEvent.EventUID
                    }
                };
                StatementNodeExt nCheckAlreadyBad = graph.AddNode <StatementNodeExt>();
                nCheckAlreadyBad.tag       = "InnRentStash";
                nCheckAlreadyBad.statement = new Statement("You've already rented a stash for the week! Just use it.");
                nCheckAlreadyBad.SetActorName(__instance.ActorLocKey);

                ActionNode nWishRent = graph.AddNode <ActionNode>();
                nWishRent.tag = "InnRentStash";
                ActionList action = new ActionList();
                action.AddAction(new NodeCanvas.Tasks.Actions.RemoveItem()
                {
                    fromCharacter = new BBParameter <Character>(character),
                    Items         = new List <BBParameter <ItemReference> >()
                    {
                        new ItemReference {
                            ItemID = 9000010
                        }
                    },
                    Amount = new List <BBParameter <int> >()
                    {
                        new BBParameter <int>(InnRentStash.Instance.ConfigRentPrice.Value)
                    },
                });
                action.AddAction(new NodeCanvas.Tasks.Actions.SendQuestEvent()
                {
                    QuestEventRef = new QuestEventReference {
                        EventUID = InnRentStash.StashAreaToQuestEvent[areaN].QuestEvent.EventUID
                    }
                });
                action.AddAction(new NodeCanvas.Tasks.Actions.PlaySound()
                {
                    Sound = GlobalAudioManager.Sounds.UI_MERCHANT_CompleteTransaction
                });
                nWishRent.action = action;

                StatementNodeExt nResultOk = graph.AddNode <StatementNodeExt>();
                nResultOk.tag       = "InnRentStash";
                nResultOk.statement = new Statement("Thanks, I've unlocked the stash for you.");
                nResultOk.SetActorName(__instance.ActorLocKey);
                StatementNodeExt nResultBad = graph.AddNode <StatementNodeExt>();
                nResultBad.tag       = "InnRentStash";
                nResultBad.statement = new Statement("Sorry, you don't have enough silver. Come back when you can afford it!");
                nResultBad.SetActorName(__instance.ActorLocKey);
                StatementNodeExt nCancel = graph.AddNode <StatementNodeExt>();
                nCancel.tag       = "InnRentStash";
                nCancel.statement = new Statement("See you soon!");
                nCancel.SetActorName(__instance.ActorLocKey);
                FinishNode nFinish = graph.AddNode <FinishNode>();
                nFinish.tag = "InnRentStash";

                graph.ConnectNodes(firstNode, nCheckHouse, 1);       // Check if the player owns the house of the town
                graph.ConnectNodes(nCheckHouse, nCheckHouseBad);     // The player owns it --> exit
                graph.ConnectNodes(nCheckHouse, nCheckAlready);      // Check if the player has already a rent ongoing in the town
                graph.ConnectNodes(nCheckAlready, nCheckAlreadyBad); // The player already has the rent --> exit
                graph.ConnectNodes(nCheckAlready, nStart);           // All checks successfull, we can show the pricefor the rent
                graph.ConnectNodes(nStart, nChoose);                 // Show the choices for the player (to rent or not)
                graph.ConnectNodes(nChoose, nCheckMoney);            // Check if the player has enough money
                graph.ConnectNodes(nChoose, nCancel);                // The player doesn't want to rent --> exit
                graph.ConnectNodes(nCheckMoney, nWishRent);          // The player has enough money, go activate the rent
                graph.ConnectNodes(nCheckMoney, nResultBad);         // The player doesn't have enough money --> exit
                graph.ConnectNodes(nWishRent, nResultOk);            // Activate the rent!

                graph.ConnectNodes(nCheckHouseBad, nFinish);
                graph.ConnectNodes(nCheckAlreadyBad, nFinish);
                graph.ConnectNodes(nResultBad, nFinish);
                graph.ConnectNodes(nResultOk, nFinish);
                graph.ConnectNodes(nCancel, nFinish);//*/
            }
            catch (Exception ex)
            {
                InnRentStash.MyLogger.LogError("OnActivate: " + ex.Message);
            }
        }