Beispiel #1
0
    void InformQuestTurnInPoint()
    {
        QuestGiver target = quest.QuestTurnInPoint.GetComponent <QuestGiver>();

        if (target.Quest != null) //if the target has a quest to give
        {
            string     questTurnInPointName = quest.QuestTurnInPoint.name;
            GameObject questTurnInPointGo   = quest.QuestTurnInPoint.gameObject;

            //Below will construct the path of the Conversation_NAME-5
            string result = StringHelperClass.ConstructConversationPath(questTurnInPointName);
            //Below will load a QuestGiver's (that is the QuestTurnInPoint of this Quest) Conversation_NAME-5,
            dialogueManager.SetupNewDialogue(questTurnInPointGo, result);
            //We then need to change the TurnInPoint's QuestGiver's NPC_UI to show a question mark...
            NPC_UI turnInPointNPC_UI = questTurnInPointGo.GetComponentInChildren <NPC_UI>();
            turnInPointNPC_UI.ChangeQuestStatus("?", true);
            Debug.Log("Changed ? to true from QuestGiver");

            //...and update boolean value so he can act correctly
            target.amTurnInPoint = true;

            //...and send him the Quest that this object is holding.
            target.ForeignQuest = quest;
        }
    }
    /*All Conversation_NAME-5's are to load a conversation that acknowledges
     * that it is the Turn-in point of a Quest. Thus, you must turn in a Quest
     * before you can start a Quest on the same QuestGiver.
     */
    void InformQuestTurnInPoint()
    {
        if (Quest.QuestTurnInPoint.name != "Bird") //the bird is special => he dies and never comes back.
        {
            QuestGiver target = Quest.QuestTurnInPoint.GetComponent <QuestGiver>();
            if (target.Quest != null && this.Quest.QuestStatus) //if the target has a quest to give && the assigning QuestGiver's quest is complete(just needs to be turned in)
            {
                string     questTurnInPointName = Quest.QuestTurnInPoint.name;
                GameObject questTurnInPointGo   = Quest.QuestTurnInPoint.gameObject;

                //Below will construct the path of the Conversation_NAME-5 which acknowledges that this is the turn in point of another's completed quest
                string result = StringHelperClass.ConstructConversationPath(questTurnInPointName);
                //Below will load a QuestGiver's (that is the QuestTurnInPoint of this Quest)
                //Conversation_NAME-5,
                dialogueManager.SetupNewDialogue(questTurnInPointGo, result);
                //We then need to change the TurnInPoint's QuestGiver's NPC_UI to show a question mark
                NPC_UI turnInPointNPC_UI = questTurnInPointGo.GetComponentInChildren <NPC_UI>();
                turnInPointNPC_UI.ChangeQuestStatus("?", true);
                //Debug.Log("Changed ? to true from QuestGiver");

                //And update boolean value so he can act correctly
                target.amTurnInPoint = true;
            }
        }
    }