Beispiel #1
0
    public void PickUp(GameObject go)
    {
        if (this.gameObject != go)
        {
            return;
        }

        if (!_playerInventory.IsFull())
        {
            Item itemCopy = _item;
            _playerInventory.AddItem(itemCopy);
            GameController.errorMessage.AddMessage(string.Format("Picked up {0}", itemCopy.Name, Color.white));

            if (OlChapBehaviour.GetQuestProgression() == 2)
            {
                OlChapBehaviour.ContinuePorgression();
                ObjectiveText.SetObjectiveText("- Go back to the old man");
            }

            Destroy(this.gameObject);
            Destroy(_textScript.gameObject);
        }
        else
        {
            transform.parent.position = this.transform.position;
            _itemFlipAnimation.Play();
            GameController.errorMessage.AddMessage("Inventory is full!");
        }
    }
Beispiel #2
0
    public void DisplayQuestObjective()
    {
        _soundPlayer.PlayAudioClip(_playerObjective - 1);
        if (_playerObjective > 7)
        {
            _killPlayerTime = DateTime.Now.AddSeconds(3);
        }

        switch (_playerObjective)
        {
        case 1:
            GameController.uiCanvas.OpenDialogBox("Oh hello, yes you must be the new Forester, its good you’re here, the other forester… went missing… but enough about that, why don’t you head to the training ground for a little practice. We need to make sure you can defend yourself in the forest of course, so why don’t you try attacking the training dummies. You can use your sword to damage enemies up close & you can cast a spell to damage enemies from afar. Let’s see what you’ve got young one.");
            ObjectiveText.SetObjectiveText("- Find and attack the training dummies");
            break;

        case 2:
            GameController.uiCanvas.OpenDialogBox("Very good young one, you remind me of a younger version of myself hehehe, oh to be young again. Anyway it appears you’re more than capable of protecting yourself & that means that you can protect our little town too. Why don’t you try making your way into the forest now & showing me something you find there. Yes, you can find all sorts of useful things in there. Just don’t worry to much where they came from hehe oh.");
            ObjectiveText.SetObjectiveText("- Enter the portal");
            break;

        case 3:
            GameController.uiCanvas.OpenDialogBox("Ah you're back! I was beginning to get a little worried you wouldn’t return. It’s not that I doubt you, it’s just I’ve seen a lot of young adventurers walk into those forests but not many make it back. Say you look like you could use potion to restore your health or mana, you can take a look in the general store and buy all sorts of potions there. And if you’re looking for better equipment to take out with you, you should visit the blacksmith in town too. The blacksmith can make fine gear for you and you can even sell any weapons or armour you don’t want to him as well. Why don’t you make your way into town now and visit both stores. Hehe yes.");
            ObjectiveText.SetObjectiveText("- Talk to the merchant");
            break;

        case 4:
            GameController.uiCanvas.OpenDialogBox("Oh there you are, and am I glad to see you too. Those darn radishes are destroying the town’s crops. It just doesn’t make any sense why a Radish would want to destroy other plants, when it is a plant itself. Hmmm. Anyway now we really need your help, the town’s food supply is running short & I don’t think we’ll survive if the radishes destroy our crops again. We need you to teach those evil things a lesson. Go to the forest and make them pay I say! Also if you see any potatoes while you’re there do be a good boy and bring some back, OK? Oh I do love a good potato stew….. Why are you still here? C’mon on now there’s no time to waste, get going!");
            ObjectiveText.SetObjectiveText("- Enter the portal");
            break;

        case 5:
            GameController.uiCanvas.OpenDialogBox("Ah back again I see & I’ve not seen those Radishes around here either, great job teaching those Rascals a lesson. Hey, I wanted to tell you something actually. Word around town is that there is missing treasure somewhere deep within the forest. They say it’s a treasure chest that contains quite the pretty penny, worth a lot of gold indeed. Say why don’t you keep a look out for it, when you’re next in the forest? You never know when you might come across it, so just make sure to keep an eye out why don’t you.");
            ObjectiveText.SetObjectiveText("- Enter the portal");
            break;

        case 6:
            GameController.uiCanvas.OpenDialogBox("Ohhh heavens above! I can't get the warehouse door to open, I could have sworn I left the key pieces where I normally do, but they aren’t there! If I didn’t know any better I might suspect somebodies stolen them. Hmm but it could just be that I’m getting forgetful in my old age. Hmm. Could you take a look around for the key pieces? I’ll be sure to reward you if you find any! Thanks young one & good luck!");
            ObjectiveText.SetObjectiveText("- Enter the portal");
            break;

        case 7:
            GameController.uiCanvas.OpenDialogBox("Ah excellent! You found all the key pieces! I did say I’d reward you for that hehe, well funnily enough your reward is in the warehouse. Why don’t you be a good lad and open the door of the warehouse for me would you? You wouldn’t want to miss out on that reward ey, hehehe.");
            ObjectiveText.SetObjectiveText("- Go to the warhouse and open the door");
            break;

        case 8:
            GameController.uiCanvas.OpenDialogBox("Hehehe Well well well, you didn’t think I could keep someone as powerful as you in my town now would you? To tell you the truth young one, the other foresters never went missing, they all died by my hand! And your body will be a great addition to the collection hehehe. Now be a good lad young one & don’t make this difficult.");
            GameController.gameController.GetComponents <AudioSource>()[1].Stop();
            break;

        default:
            GameController.uiCanvas.OpenDialogBox("Insert hardcoded string here :-)");
            break;
        }
    }
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Player")
     {
         if (OlChapBehaviour.GetQuestProgression() == 1)
         {
             OlChapBehaviour.ContinuePorgression();
             ObjectiveText.SetObjectiveText("- Go back to the old man");
             Destroy(this.gameObject);
         }
     }
 }
Beispiel #5
0
    private void OpenShop(GameObject go)
    {
        if (this.gameObject != go)
        {
            return;
        }

        SetAllWindowsActive();

        if (OlChapBehaviour.GetQuestProgression() == 3)
        {
            OlChapBehaviour.ContinuePorgression();
            ObjectiveText.SetObjectiveText("- Return to the old man");
        }
    }
Beispiel #6
0
 //Death animation
 private void PlayDyingAnimation()
 {
     if (!_animator.GetBool("isDying"))
     {
         //Play death animation here lmao
         if (!_isMeleeEnemy && OlChapBehaviour.GetQuestProgression() == 4)
         {
             OlChapBehaviour.ContinuePorgression();
             ObjectiveText.SetObjectiveText("- Go back to the old man");
         }
         SetAnimationState(AnimationState.Dying);
         GetComponent <Collider>().enabled = false;
         GetComponent <DropLoot>().DropItems(this.transform);
     }
 }
Beispiel #7
0
    private void OpenChest(GameObject go)
    {
        if (this.gameObject != go)
        {
            return;
        }

        if (!_openChestAnimation.GetBool("isClicked"))
        {
            GetComponent <DropLoot>().DropItems(this.transform);
            _openChestAnimation.SetBool("isClicked", true);

            if (OlChapBehaviour.GetQuestProgression() == 5)
            {
                OlChapBehaviour.ContinuePorgression();
                ObjectiveText.SetObjectiveText("- Go back to the old man");
            }
        }
    }
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Player")
     {
         GameController.questProgress++;
         if (GameController.questProgress >= 5)
         {
             OlChapBehaviour.ContinuePorgression();
             ObjectiveText.SetObjectiveText("- Go back to the old man");
         }
         else
         {
             ObjectiveText.SetObjectiveText("- Find keys (" + GameController.questProgress + "/5)");
         }
         GetComponent <Collider>().enabled = false;
         GetComponent <Renderer>().enabled = false;
         GetComponent <AudioSource>().Play();
     }
 }
Beispiel #9
0
    private void TeleportPlayer()
    {
        if (Input.GetMouseButtonDown(0) && OlChapBehaviour.GetQuestProgression() > 1)
        {
            RaycastHit raycastHit = new RaycastHit();
            Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out raycastHit);
            if (raycastHit.transform.gameObject == this.gameObject)
            {
                if (GoToHubPortal)
                {
                    GameController.GoToHub();
                }
                else
                {
                    switch (OlChapBehaviour.GetQuestProgression())
                    {
                    case 2:
                        ObjectiveText.SetObjectiveText("- Kill and enemy and find an item");
                        break;

                    case 4:
                        ObjectiveText.SetObjectiveText("- Kill a radish");
                        break;

                    case 5:
                        ObjectiveText.SetObjectiveText("- Find and loot a chest");
                        break;

                    case 6:
                        ObjectiveText.SetObjectiveText("- Find keys (" + GameController.questProgress + "/5)");
                        break;
                    }
                    GameController.GoToLevel();
                }
            }
        }
    }
Beispiel #10
0
 // Start is called before the first frame update
 void Start()
 {
     objectiveTextScript = GameObject.Find("Canvas").transform.Find("TxtObjective").GetComponent <ObjectiveText>();
 }
Beispiel #11
0
 // Use this for initialization
 private void Start()
 {
     objectiveText = this;
 }
Beispiel #12
0
        public string ToSQL()
        {
            string sql = "REPLACE INTO questcache VALUES (";

            sql += Entry + ", ";
            sql += (int)Method + ", ";
            sql += Level + ", ";
            sql += MinLevel + ", ";
            sql += ZoneOrSort + ", ";
            sql += (int)Type + ", ";
            sql += SuggestedPlayers + ", ";
            sql += RepObjectiveFaction1 + ", ";
            sql += RepObjectiveValue1 + ", ";
            sql += RepObjectiveFaction2 + ", ";
            sql += RepObjectiveValue2 + ", ";
            sql += NextQuestID + ", ";
            sql += XPID + ", ";
            sql += RewardMoney + ", ";
            sql += RewardMoneyAtMaxLevel + ", ";
            sql += Spell + ", ";
            sql += SpellCast + ", ";
            sql += Honor + ", ";
            sql += HonorMultiplier + ", ";
            sql += SourceItemID + ", ";
            sql += (int)Flags + ", ";
            sql += Unk + ", ";
            sql += RewardTitleID + ", ";
            sql += PlayersSlain + ", ";
            sql += RewardTalentPoints + ", ";
            sql += RewardArenaPoints + ", ";
            sql += RewardSkillLineID + ", ";
            sql += RewardSkillPoints + ", ";
            sql += RewardFactionMask + ", ";
            sql += QuestGiverPortraitID + ", ";
            sql += QuestTurnInPortraitID + ", ";
            sql += RewardItem.ToSQL() + ", ";
            sql += RewardItemCount.ToSQL() + ", ";
            sql += RewardItemChoice.ToSQL() + ", ";
            sql += RewardItemChoiceCount.ToSQL() + ", ";
            sql += RewardRepFactionID.ToSQL() + ", ";
            sql += RewardRepValueID.ToSQL() + ", ";
            sql += RewardRepValue.ToSQL() + ", ";
            sql += PointMapID + ", ";
            sql += PointX + ", ";
            sql += PointY + ", ";
            sql += PointOption + ", ";
            sql += "'" + Title.ToSQL() + "', ";
            sql += "'" + ObjectiveText.ToSQL() + "', ";
            sql += "'" + Description.ToSQL() + "', ";
            sql += "'" + EndText.ToSQL() + "', ";
            sql += "'" + CompletionText.ToSQL() + "', ";
            sql += RequiredCreatureOrGOID.ToSQL() + ", ";
            sql += RequiredCreatureOrGOCount.ToSQL() + ", ";
            sql += ItemDropIntermediateID.ToSQL() + ", ";
            sql += ItemDropIntermediateCount.ToSQL() + ", ";
            sql += RequiredItemID.ToSQL() + ", ";
            sql += RequiredItemCount.ToSQL() + ", ";
            sql += CriteriaSpellID + ", ";
            sql += ObjectiveTexts.ToSQL() + ", ";
            sql += RewardCurrencyID.ToSQL() + ", ";
            sql += RewardCurrencyValue.ToSQL() + ", ";
            sql += RequiredCurrencyID.ToSQL() + ", ";
            sql += RequiredCurrencyValue.ToSQL() + ", ";
            sql += "'" + QuestGiverPortraitText.ToSQL() + "', ";
            sql += "'" + QuestGiverPortraitUnk.ToSQL() + "', ";
            sql += "'" + QuestTurnInPortraitText.ToSQL() + "', ";
            sql += "'" + QuestTurnInPortraitUnk.ToSQL() + "', ";
            sql += SoundField1 + ", ";
            sql += SoundField2 + ");";
            return(sql);
        }