public IEnumerator QuestEvent()
    {
        if (clear)
        {
            return(false);
        }
        //Increase the progress of the Quest ID
        //The Function will automatic check If player have this quest(ID) in the Quest Slot or not.
        if (player)
        {
            QuestStatC qstat = player.GetComponent <QuestStatC>();
            if (qstat)
            {
                player.GetComponent <QuestStatC>().Progress(questId);
                if (npcAnimation)
                {
                    npcModel.GetComponent <Animation>().Play(npcAnimation.name);
                }
                clear = true;
                float wait = npcModel.GetComponent <Animation>()[npcAnimation.name].length;
                yield return(new WaitForSeconds(wait + 0.3f));

                if (disappearEffect)
                {
                    Instantiate(disappearEffect, transform.position, transform.rotation);
                }
                Destroy(gameObject);
            }
        }
    }
Exemplo n.º 2
0
    public void UpdateQuestDetails()
    {
        if (!player)
        {
            return;
        }
        db = database.GetComponent <QuestDataC>();
        QuestStatC pq = player.GetComponent <QuestStatC>();

        for (int a = 0; a < questName.Length; a++)
        {
            questName[a].GetComponent <Text>().text        = db.questData[pq.questSlot[a]].questName;
            questDescription[a].GetComponent <Text>().text = db.questData[pq.questSlot[a]].description + " (" + pq.questProgress[pq.questSlot[a]].ToString() + " / " + db.questData[pq.questSlot[a]].finishProgress + ")";
            if (pq.questSlot[a] > 0)
            {
                questDescription[a].gameObject.SetActive(true);
                cancelButton[a].SetActive(true);
            }
            else
            {
                questDescription[a].gameObject.SetActive(false);
                cancelButton[a].SetActive(false);
            }
        }
    }
Exemplo n.º 3
0
 // Token: 0x06000416 RID: 1046 RVA: 0x0001AC5C File Offset: 0x0001905C
 private void Start()
 {
     if (this.type == QuestProgressiveC.progressType.Auto)
     {
         this.player = GameObject.FindWithTag("Player");
         QuestStatC component = this.player.GetComponent <QuestStatC>();
         if (component)
         {
             this.player.GetComponent <QuestStatC>().Progress(this.questId);
         }
     }
 }
Exemplo n.º 4
0
    public void CancelQuest(int qid)
    {
        if (!player)
        {
            return;
        }
        QuestStatC pq = player.GetComponent <QuestStatC>();

        pq.questProgress[pq.questSlot[qid]] = 0;
        pq.questSlot[qid] = 0;
        pq.SortQuest();
        UpdateQuestDetails();
    }
Exemplo n.º 5
0
 void  OnTriggerEnter(Collider other)
 {
     if (other.tag == "Player" && type == progressType.Trigger)
     {
         //Increase the progress of the Quest ID
         //The Function will automatic check If player have this quest(ID) in the Quest Slot or not.
         QuestStatC qstat = other.GetComponent <QuestStatC>();
         if (qstat)
         {
             other.GetComponent <QuestStatC>().Progress(questId);
             Destroy(gameObject);
         }
     }
 }
Exemplo n.º 6
0
 void  Start()
 {
     if (type == progressType.Auto)
     {
         player = GameObject.FindWithTag("Player");
         //Increase the progress of the Quest ID
         //The Function will automatic check If player have this quest(ID) in the Quest Slot or not.
         QuestStatC qstat = player.GetComponent <QuestStatC>();
         if (qstat)
         {
             player.GetComponent <QuestStatC>().Progress(questId);
         }
     }
 }
 void  OnTriggerEnter(Collider other)
 {
     if (other.tag == "Player" && type == progressType.Trigger)
     {
         QuestStatC qstat = other.GetComponent <QuestStatC>();
         if (qstat)
         {
             bool c = other.GetComponent <QuestStatC>().Progress(questId);
             if (c)
             {
                 Destroy(gameObject);
             }
         }
     }
 }
Exemplo n.º 8
0
 // Token: 0x06000417 RID: 1047 RVA: 0x0001ACB4 File Offset: 0x000190B4
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Player" && this.type == QuestProgressiveC.progressType.Trigger)
     {
         QuestStatC component = other.GetComponent <QuestStatC>();
         if (component)
         {
             bool flag = other.GetComponent <QuestStatC>().Progress(this.questId);
             if (flag)
             {
                 UnityEngine.Object.Destroy(base.gameObject);
             }
         }
     }
 }
 void  Start()
 {
     if (type == progressType.Auto)
     {
         player = GameObject.FindWithTag("Player");
         if (!player)
         {
             return;
         }
         QuestStatC qstat = player.GetComponent <QuestStatC>();
         if (qstat)
         {
             player.GetComponent <QuestStatC>().Progress(questId);
         }
     }
 }
Exemplo n.º 10
0
 // Token: 0x0600042F RID: 1071 RVA: 0x0001BBEC File Offset: 0x00019FEC
 private void DeleteObj()
 {
     this.player = GameObject.FindWithTag("Player");
     if (this.player)
     {
         QuestStatC component = this.player.GetComponent <QuestStatC>();
         if (component)
         {
             bool flag = this.player.GetComponent <QuestStatC>().CheckQuestSlot(this.questId);
             int  num  = this.player.GetComponent <QuestStatC>().CheckQuestProgress(this.questId);
             if (flag && num >= this.progressAbove && num < this.progressBelow)
             {
                 UnityEngine.Object.Destroy(this.spawnObject);
             }
         }
     }
 }
Exemplo n.º 11
0
 // Token: 0x0600042E RID: 1070 RVA: 0x0001BB50 File Offset: 0x00019F50
 private void Deactivate()
 {
     this.player = GameObject.FindWithTag("Player");
     if (this.player)
     {
         QuestStatC component = this.player.GetComponent <QuestStatC>();
         if (component)
         {
             bool flag = this.player.GetComponent <QuestStatC>().CheckQuestSlot(this.questId);
             int  num  = this.player.GetComponent <QuestStatC>().CheckQuestProgress(this.questId);
             if (flag && num >= this.progressAbove && num < this.progressBelow)
             {
                 this.spawnObject.SetActive(false);
             }
         }
     }
 }
Exemplo n.º 12
0
 // Token: 0x0600042C RID: 1068 RVA: 0x0001B9F0 File Offset: 0x00019DF0
 private void Spawn()
 {
     this.player = GameObject.FindWithTag("Player");
     if (this.player)
     {
         QuestStatC component = this.player.GetComponent <QuestStatC>();
         if (component)
         {
             bool flag = this.player.GetComponent <QuestStatC>().CheckQuestSlot(this.questId);
             int  num  = this.player.GetComponent <QuestStatC>().CheckQuestProgress(this.questId);
             if (flag && num >= this.progressAbove && num < this.progressBelow)
             {
                 GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.spawnObject, base.transform.position, base.transform.rotation);
                 gameObject.name = this.spawnObject.name;
             }
         }
     }
 }
Exemplo n.º 13
0
    void Deactivate()
    {
        player = GameObject.FindWithTag("Player");
        if (player)
        {
            QuestStatC qstat = player.GetComponent <QuestStatC>();
            if (qstat)
            {
                bool letSpawn      = player.GetComponent <QuestStatC>().CheckQuestSlot(questId);
                int  checkProgress = player.GetComponent <QuestStatC>().CheckQuestProgress(questId);

                if (letSpawn && checkProgress >= progressAbove && checkProgress < progressBelow)
                {
                    spawnObject.SetActive(false);
                }
            }
        }
    }
Exemplo n.º 14
0
    void Spawn()
    {
        player = GameObject.FindWithTag("Player");
        if (player)
        {
            QuestStatC qstat = player.GetComponent <QuestStatC>();
            if (qstat)
            {
                bool letSpawn      = player.GetComponent <QuestStatC>().CheckQuestSlot(questId);
                int  checkProgress = player.GetComponent <QuestStatC>().CheckQuestProgress(questId);

                if (letSpawn && checkProgress >= progressAbove && checkProgress < progressBelow)
                {
                    GameObject m = Instantiate(spawnObject, transform.position, transform.rotation) as GameObject;
                    m.name = spawnObject.name;
                }
            }
        }
    }
Exemplo n.º 15
0
    void Deactivate()
    {
        player = GameObject.FindWithTag("Player");
        //The Function will automatic check If player have this quest(ID) in the Quest Slot or not.
        if (player)
        {
            QuestStatC qstat = player.GetComponent <QuestStatC>();
            if (qstat)
            {
                bool letSpawn      = player.GetComponent <QuestStatC>().CheckQuestSlot(questId);
                int  checkProgress = player.GetComponent <QuestStatC>().CheckQuestProgress(questId);

                if (letSpawn && checkProgress >= progressAbove && checkProgress < progressBelow)
                {
                    //Deactivate your spawnPrefab if player have this quest in the quest slot.
                    spawnObject.SetActive(false);
                }
            }
        }
    }
    public void Spawn()
    {
        player = GameObject.FindWithTag("Player");
        //The Function will automatic check If player have this quest(ID) in the Quest Slot or not.
        if (player)
        {
            QuestStatC qstat = player.GetComponent <QuestStatC>();
            if (qstat)
            {
                bool letSpawn      = player.GetComponent <QuestStatC>().CheckQuestSlot(questId);
                int  checkProgress = player.GetComponent <QuestStatC>().CheckQuestProgress(questId);

                if (letSpawn && checkProgress >= progressAbove && checkProgress < progressBelow)
                {
                    //Spawn your spawnPrefab if player have this quest in the quest slot.
                    GameObject m = (GameObject)Instantiate(spawnPrefab, transform.position, transform.rotation);
                    m.name = spawnPrefab.name;
                }
            }
        }
    }