public override void Run(Game_Server.Player _client, ushort _linkback)
        {
            Responses = new List <NpcDialogPacket>();
            AddAvatar();
            switch (_linkback)
            {
            case 0:
                if (_client.RebornCount == 0)
                {
                    if (_client.ProfessionLevel == 5 && _client.Level >= (_client.ProfessionType == Enum.ProfessionType.WaterTaoist ? 110 : 120))
                    {
                        AddText("Even bold adventurers eventually grow tired of their journeys. I help these heroes by offering them life anew.");
                        AddOption("I wish to reborn.", 1);
                        AddOption("I'm not tired!", 255);
                    }
                    else
                    {
                        AddText("Hello young one! I help people seek the ultimate goal of rebirth. ");
                        AddText("You are not yet experienced enough to undertake this adventure. Please come back later.");
                        AddOption("I will.", 255);
                    }
                }
                else
                {
                    AddText("I have helped you as much as I can. Even heroes have their limits.");
                    AddOption("Thanks", 255);
                }
                break;

            case 1:
                if (_client.RebornCount == 0 && _client.Level >= (_client.ProfessionType == Enum.ProfessionType.WaterTaoist ? 110 : 120))
                {
                    AddText("By accepting the gift of rebirth, you will start your life again. ");
                    AddText("You can unlock great strength as well as new skills in the process! ");
                    AddText("Are you sure you're ready to give up your current life? ");
                    AddOption("I'm ready.", 2);
                    AddOption("Not yet!", 255);
                }
                else
                {
                    AddText("Ooh my! Lets not get ahead of ourselves. You are not yet ready to become reborn.");
                    AddOption("Sorry.", 255);
                }
                break;

            case 2:
                if (_client.HasItem(Constants.CELESTIAL_STONE_ID))
                {
                    AddText("You can choose to either receive a gem of great power or bless your equipment for even greater strength. Which would you like?");
                    AddOption("Blessed Rebirth", 3);
                    AddOption("Gem Rebirth", 5);
                    AddOption("I'm not sure...", 255);
                }
                else
                {
                    AddText("Rebirth requires the unlocking of great power. Please make sure you have a CelestialStone before coming to me.");
                    AddOption("Sorry.", 255);
                }
                break;

            case 3:
            case 4:
                isBlessedRebirth = _linkback == 3;
                AddText("What profession would you like in your new life?");
                AddOption("Trojan", 11);
                AddOption("Warrior", 12);
                AddOption("Water Taoist", 13);
                AddOption("Fire Taoist", 14);
                AddOption("Archer", 15);
                AddOption("I'm not sure...", 255);
                break;

            case 5:
                AddText("What type of gem would you like?");
                AddOption("Phoenix Gem", 20);
                AddOption("Dragon Gem", 21);
                AddOption("Fury Gem", 22);
                AddOption("Rainbow Gem", 23);
                AddOption("More Options", 6);
                AddOption("I'm not sure...", 255);
                break;

            case 6:
                AddText("What type of gem would you like?");
                AddOption("Kylin Gem", 24);
                AddOption("Violet Gem", 25);
                AddOption("Moon Gem", 26);
                AddOption("Previous Options", 5);
                AddOption("I'm not sure...", 255);
                break;

            case 20:
            case 21:
            case 22:
            case 23:
            case 24:
            case 25:
            case 26:
                baseGemRequest = (byte)(_linkback % 10);
                _linkback      = 4;
                goto case 4;

            case 11:
            case 12:
            case 13:
            case 14:
            case 15:
                if (_client.ProfessionLevel == 5 && _client.RebornCount == 0 && _client.Level >= (_client.ProfessionType == Enum.ProfessionType.WaterTaoist ? 110 : 120))
                {
                    if (_client.HasItem(Constants.CELESTIAL_STONE_ID))
                    {
                        _client.DeleteItem(Constants.CELESTIAL_STONE_ID);
                        if (isBlessedRebirth)    //Bless random item.
                        {
                            Structures.ConquerItem item;
                            for (var tries = 0; tries < 50; tries++)
                            {
                                var loc = (ItemLocation)(Common.Random.Next(10));
                                item = _client.Equipment.GetItemBySlot(loc);
                                if (item != null && item.Bless == 0)
                                {
                                    item.Bless = 1; break;
                                }
                            }
                        }
                        else    //Give Super Gem
                        {
                            _client.CreateItem((uint)(BASE_GEM_ID + baseGemRequest * 10));
                        }

                        var path = (uint)_client.ProfessionType % 10 * 10 + (uint)_linkback % 10;
                        if (_client.ProfessionType == ProfessionType.Archer)
                        {
                            path = 50 + (uint)_linkback % 10;
                        }
                        foreach (var pathData in Database.ServerDatabase.Context.RebornPaths.GetRebornByPath(path))
                        {
                            if (pathData.IsForget)
                            {
                                _client.CombatManager.TryRemoveSkill(pathData.SkillId);
                            }
                            else
                            {
                                _client.CombatManager.AddOrUpdateSkill(pathData.SkillId, 0);
                            }
                        }
                        foreach (var skill in _client.CombatManager.skills.Values)
                        {
                            skill.Database.PreviousLevel = skill.Database.Level;
                            skill.Database.Level         = 0;
                            skill.Database.Experience    = 0;
                            skill.Save();
                            skill.Send(_client);
                        }

                        _client.Character.Profession1 = _client.Character.Profession;
                        switch (_linkback % 10)
                        {
                        case 1:
                            _client.Character.Profession = 11;
                            break;

                        case 2:
                            _client.Character.Profession = 21;
                            break;

                        case 3:
                            _client.Character.Profession = 132;
                            break;

                        case 4:
                            _client.Character.Profession = 142;
                            break;

                        case 5:
                            _client.Character.Profession = 41;
                            break;
                        }

                        #region Down Level Items
                        for (ItemLocation location = ItemLocation.Helmet; location < ItemLocation.Garment; location++)
                        {
                            Structures.ConquerItem item;
                            item = _client.Equipment.GetItemBySlot(location);
                            if (item != null)
                            {
                                item.DownLevelItem(); _client.Send(ItemInformationPacket.Create(item, ItemInfoAction.Update));
                            }
                        }
                        #endregion

                        #region Set Bonus Stats
                        _client.Character.Strength = 0;
                        _client.Character.Vitality = 8;
                        _client.Character.Agility  = 2;
                        _client.Character.Spirit   = 0;
                        switch (_client.Level)
                        {
                        case 110:
                        case 111:
                            _client.ExtraStats = 20;
                            break;

                        case 112:
                        case 113:
                            _client.ExtraStats = 21;
                            break;

                        case 114:
                        case 115:
                            _client.ExtraStats = 23;
                            break;

                        case 116:
                        case 117:
                            _client.ExtraStats = 26;
                            break;

                        case 118:
                        case 119:
                            _client.ExtraStats = 30;
                            break;

                        case 120:
                            _client.ExtraStats = (ushort)(_client.ProfessionType == ProfessionType.WaterTaoist ? 35 : 20);
                            break;

                        case 121:
                            _client.ExtraStats = (ushort)(_client.ProfessionType == ProfessionType.WaterTaoist ? 35 : 21);
                            break;

                        case 122:
                            _client.ExtraStats = (ushort)(_client.ProfessionType == ProfessionType.WaterTaoist ? 41 : 23);
                            break;

                        case 123:
                            _client.ExtraStats = (ushort)(_client.ProfessionType == ProfessionType.WaterTaoist ? 41 : 26);
                            break;

                        case 124:
                            _client.ExtraStats = (ushort)(_client.ProfessionType == ProfessionType.WaterTaoist ? 48 : 30);
                            break;

                        case 125:
                            _client.ExtraStats = (ushort)(_client.ProfessionType == ProfessionType.WaterTaoist ? 48 : 35);
                            break;

                        case 126:
                            _client.ExtraStats = (ushort)(_client.ProfessionType == ProfessionType.WaterTaoist ? 56 : 41);
                            break;

                        case 127:
                            _client.ExtraStats = (ushort)(_client.ProfessionType == ProfessionType.WaterTaoist ? 56 : 48);
                            break;

                        case 128:
                            _client.ExtraStats = (ushort)(_client.ProfessionType == ProfessionType.WaterTaoist ? 65 : 56);
                            break;

                        case 129:
                            _client.ExtraStats = 65;
                            break;

                        case 130:
                            _client.ExtraStats = 75;
                            break;
                        }
                        #endregion

                        _client.RebornCount = 1;
                        _client.Send(new UpdatePacket(_client.UID, UpdateType.Profession, _client.Character.Profession));
                        _client.Send(new UpdatePacket(_client.UID, UpdateType.Reborn, _client.RebornCount));
                        _client.SpawnPacket.RebornCount = 1;
                        _client.SendToScreen(_client.SpawnPacket, true);
                        _client.SetLevel(15);
                        _client.Experience = 0;
                        _client.Recalculate(true);
                        Managers.PlayerManager.SendToServer(new TalkPacket(ChatType.GM, _client.Name + " has been reborned successfully. Congratulations!"));
                        _client.Save();
                    }
                    else
                    {
                        AddText("Rebirth requires the unlocking of great power. Please make sure you have a CelestialStone before coming to me.");
                        AddOption("Sorry.", 255);
                    }
                }
                else
                {
                    AddText("Lets not get ahead of ourselves! You are not ready to achieve rebirth. Please come back later.");
                    AddOption("Sorry.", 255);
                }
                break;
            }
            AddFinish();
            Send();
        }
Beispiel #2
0
        public override void Run(Game_Server.Player client, ushort linkback)
        {
            Responses = new List <NpcDialogPacket>();
            AddAvatar();
            switch (linkback)
            {
                #region Initial Options
            case 0:
                if (client.ProfessionType == ProfessionType.Taoist && client.RebornCount == 0 || client.ProfessionType == ProfessionType.FireTaoist && client.RebornCount == 0 || client.ProfessionType == ProfessionType.WaterTaoist && client.RebornCount == 0)
                {
                    AddText("Most of the Taoists are little concerned with anything outside the pursuit of ");
                    AddText("advanced spiritual powers. You are gifted in harnessing your inner power, ");
                    AddText("but remember, the roots of success lie in thoroughness and attention to detail.");
                    AddOption("I want to get promoted.", 1);
                    AddOption("Learn basic skills.", 5); //Handles basic taoist skills
                    if (client.ProfessionLevel >= 2)     //Handles class specific skills
                    {
                        AddOption("Learn advanced skills.", 6);
                    }
                    AddOption("Okay. I see.", 255);
                }
                else if (client.ProfessionType == ProfessionType.Taoist && client.RebornCount == 0 || client.ProfessionType == ProfessionType.FireTaoist && client.RebornCount == 0 || client.ProfessionType == ProfessionType.WaterTaoist && client.RebornCount == 1)
                {
                    AddText("Most of the Taoists are little concerned with anything outside the pursuit of ");
                    AddText("advanced spiritual powers. You are gifted in harnessing your inner power, ");
                    AddText("but remember, the roots of success lie in thoroughness and attention to detail.");
                    AddOption("I want to get promoted.", 1);
                    AddOption("Learn basic skills.", 5); //Handles basic taoist skills
                    if (client.ProfessionLevel >= 2)     //Handles class specific skills
                    {
                        AddOption("Learn advanced skills.", 6);
                    }
                    AddOption("Reborn skills", 60);
                    AddOption("Okay. I see.", 255);
                }
                else if (client.ProfessionType != ProfessionType.Taoist && client.ProfessionType != ProfessionType.FireTaoist && client.ProfessionType != ProfessionType.WaterTaoist && client.RebornCount >= 1)
                {
                    AddText("I can help you learn the skills you need after you have been reborn.");
                    AddOption("Reborn skills.", 60);
                }
                else if (client.ProfessionType != ProfessionType.Taoist && client.ProfessionType != ProfessionType.FireTaoist && client.ProfessionType != ProfessionType.WaterTaoist && client.RebornCount == 0)
                {
                    AddText("The taoists` secrets are not to be trained to outsiders. Train elsewhere, master conqueror.");
                    AddOption("I see.", 255);
                }
                break;
                #endregion

                #region Promotion
            case 1:
                switch (client.ProfessionLevel)
                {
                case 0:
                    AddText("The single requirement of becoming an Taoist is a minimum level of 15.");
                    AddText(" Would you like to proceed?");
                    AddOption("Yes, please.", 2);
                    AddOption("No.", 255);
                    break;

                case 1:
                    AddText("A decision stands before you! Become an all powerful fire taoist or a merciful water taoist?");
                    AddOption("Water Taoist", 3);
                    AddOption("Fire Taoist", 4);
                    AddOption("No.", 255);
                    break;

                case 2:
                    if (client.ProfessionType == ProfessionType.FireTaoist)
                    {
                        AddText("You may promote to become a Fire Wizard at level 70.");
                    }
                    else
                    {
                        AddText("You may promote to become a Water Wizard at level 70.");
                    }
                    AddText(" I will require one Emerald, I hear they are dropped by");
                    AddText("  monsters in the desert. Are you ready for promotion?");
                    AddOption("I'm ready!", 2);
                    AddOption("I'm not sure...", 255);
                    break;

                case 3:
                    if (client.ProfessionType == ProfessionType.FireTaoist)
                    {
                        AddText("You may promote to become a Fire Master at level 100..");
                    }
                    else
                    {
                        AddText("You may promote to become a Water Master at level 100.");
                    }
                    AddText(" I will require one Meteor. Are you ready for promotion?");
                    AddOption("I'm ready!", 2);
                    AddOption("I'm not sure...", 255);
                    break;

                case 4:
                    if (client.ProfessionType == ProfessionType.FireTaoist)
                    {
                        AddText("You may promote to become a Fire Saint at level 100..");
                    }
                    else
                    {
                        AddText("You may promote to become a Water Saint at level 100.");
                    }
                    AddText(" I will require one Moon Box. Are you ready for promotion?");
                    AddOption("I'm ready!", 2);
                    AddOption("I'm not sure...", 255);
                    break;

                case 5:
                    AddText("You are a true Archer. I cannot promote you anymore!");
                    AddOption("I see.", 255);
                    break;
                }
                break;

            case 2:
                switch (client.ProfessionLevel)
                {
                case 0:        //level 15
                    if (client.Level >= 15)
                    {
                        AddText("You have been promoted! I have taught you an XP skill as a reward!");
                        client.CombatManager.AddOrUpdateSkill(SkillID.Thunder, 0);
                        client.Character.Profession++;
                        client.Send(new UpdatePacket(client.UID, UpdateType.Profession, client.Character.Profession));
                        client.Recalculate();
                        AddOption("Thank you!", 255);
                    }
                    else
                    {
                        AddText("You are not level 15, I will not promote you yet.");
                        AddOption("I'll work harder.", 255);
                    }
                    break;

                case 1:        //level 40
                    if (client.Level >= 40 && client.Agility >= 25 && client.Vitality >= 22 && client.Spirit >= 80)
                    {
                        AddText("You have been promoted!");
                        if (client.RebornCount == 1)
                        {
                            AddText("I've given you a special item to help commemorate the occasion!");
                            client.CreateItem(410077);        //poison blade - need to add stat
                        }
                        if (isFire)
                        {
                            client.Character.Profession = 142;
                        }
                        else
                        {
                            client.Character.Profession = 132;
                        }
                        client.Send(new UpdatePacket(client.UID, UpdateType.Profession, client.Character.Profession));
                        client.Recalculate();
                        AddOption("Thank you!", 255);
                    }
                    else
                    {
                        AddText("You must be level 40, I will not promote you yet.");
                        AddOption("I'll work harder.", 255);
                    }
                    break;

                case 2:        //level 70
                    if (client.Level >= 70 && client.HasItem(Constants.EMERALD_ID) && client.Agility >= 45 && client.Vitality >= 32 && client.Spirit >= 140)
                    {
                        client.DeleteItem(Constants.EMERALD_ID);
                        client.CreateItem(Constants.METEOR_ID);
                        AddText("You have been promoted!");
                        client.Character.Profession++;
                        client.Send(new UpdatePacket(client.UID, UpdateType.Profession, client.Character.Profession));
                        client.Recalculate();
                        AddOption("Thank you!", 255);
                    }
                    else
                    {
                        AddText("You must be level 70 and bring me an Emerald in order to be promoted!");
                        AddOption("I'll work harder.", 255);
                    }
                    break;

                case 3:        //level 100
                    if (client.Level >= 100 && client.HasItem(Constants.METEOR_ID) && client.Agility >= 60 && client.Vitality >= 42 && client.Spirit >= 205)
                    {
                        client.DeleteItem(Constants.METEOR_ID);
                        AddText("You have been promoted!");
                        switch (client.RebornCount)
                        {
                        case 0:
                            client.CreateItem(700031);            //normal rainbow gem
                            break;

                        default:
                            client.CreateItem(130087, 0, 0, 0, 255);            //unique 1 sock armor
                            break;
                        }
                        client.Character.Profession++;
                        client.Send(new UpdatePacket(client.UID, UpdateType.Profession, client.Character.Profession));
                        client.Recalculate();
                        AddOption("Thank you!", 255);
                    }
                    else
                    {
                        AddText("You must be level 100 and have a Meteor in order to be promoted!");
                        AddOption("I'll work harder.", 255);
                    }
                    break;

                case 4:        //level 110
                    if (client.Level >= 110 && client.HasItem(Constants.MOONBOX_ID) && client.Agility >= 65 && client.Vitality >= 47 && client.Spirit >= 225)
                    {
                        client.DeleteItem(Constants.MOONBOX_ID);
                        client.CreateItem(Constants.DRAGONBALL_ID);
                        AddText("You have been promoted!");
                        client.Character.Profession++;
                        client.Send(new UpdatePacket(client.UID, UpdateType.Profession, client.Character.Profession));
                        client.Recalculate();
                        AddOption("Thank you!", 255);
                    }
                    else
                    {
                        AddText("You must be level 110 and have a Moon Box in order to be promoted!");
                        AddOption("I'll work harder.", 255);
                    }
                    break;
                }
                break;

            case 3:
            case 4:
                isFire = linkback == 4;
                goto case 2;
                #endregion

                #region Learn Skills
            case 5:
                AddText("What skill would you like to learn?");
                AddOption("Basic Spells", 10);
                AddOption("Xp Skills", 11);
                AddOption("Fire", 12);
                AddOption("Meditation", 13);
                AddOption("Nothing.", 255);
                break;

            case 6:
                if (client.ProfessionType == ProfessionType.FireTaoist)
                {
                    AddText("What skill would you like to learn?");
                    AddOption("Fire Ring", 14);
                    AddOption("Fire Meteor", 15);
                    AddOption("Fire Circle", 16);
                    AddOption("Tornado", 17);
                }
                else if (client.ProfessionType == ProfessionType.WaterTaoist)
                {
                    AddText("What skill would you like to learn?");
                    AddOption("Healing Rain", 18);
                    AddOption("Star of Accuracy", 19);
                    AddOption("Magic Shield", 20);
                    AddOption("Stigma", 21);
                    AddOption("More skills", 30);
                }
                else
                {
                    AddText("What! You don't belong here. I can only teach these skills to advanced students.");
                }
                AddOption("Nevermind", 255);
                break;

            case 30:
                if (client.ProfessionType == ProfessionType.WaterTaoist)
                {
                    AddOption("Invisibility", 22);
                    AddOption("Pray", 23);
                    AddOption("Advanced Cure", 24);
                    AddOption("Nectar", 25);
                    AddOption("Previous skills", 6);
                }
                else
                {
                    AddText("What! You don't belong here. I can only teach these skills to advanced students.");
                }
                AddOption("Nevermind", 255);
                break;

                #region Basic Skills
            case 10:
                client.CombatManager.LearnNewSkill(SkillID.Cure);
                client.CombatManager.LearnNewSkill(SkillID.Thunder);
                AddText("Learned all basic spells.");
                AddOption("Thanks", 255);
                break;

            case 11:
                if (client.Level >= 15)
                {
                    client.CombatManager.LearnNewSkill(SkillID.Lightning);
                    if (client.Level >= 40)
                    {
                        client.CombatManager.LearnNewSkill(SkillID.Volcano);
                        if (client.ProfessionType == ProfessionType.WaterTaoist)
                        {
                            client.CombatManager.LearnNewSkill(SkillID.Revive);
                        }
                        if (client.Level >= 70)
                        {
                            client.CombatManager.LearnNewSkill(SkillID.SpeedLightning);
                        }
                    }

                    AddText("Learned all available XP skills");
                }
                else
                {
                    AddText("You must be at least level 15 to learn XP skills");
                }
                AddOption("Thanks", 255);
                break;

            case 12:
                if (client.Level >= 40 && client.CombatManager.KnowsSkillLevel(SkillID.Thunder, 4))
                {
                    client.CombatManager.LearnNewSkill(SkillID.Fire);
                    AddText("You have learned Fire successfully");
                }
                else
                {
                    AddText("You must be at least level 40 with level 4 Thunder to learn this skill");
                }
                AddOption("Thanks", 255);
                break;

            case 13:
                if (client.Level >= 44)
                {
                    client.CombatManager.LearnNewSkill(SkillID.Meditation);
                    AddText("You have learned Meditation successfully");
                }
                else
                {
                    AddText("You must be at least level 44 to learn this skill");
                }
                AddOption("Thanks", 255);
                break;
                #endregion

                #region Fire Skills
            case 14:
                if (client.Level >= 55 && client.ProfessionType == ProfessionType.FireTaoist)
                {
                    client.CombatManager.LearnNewSkill(SkillID.FireRing);
                    AddText("You have learned Fire Ring successfully");
                }
                else
                {
                    AddText("You must be at least level 55 to learn this skill");
                }
                AddOption("Thanks", 255);
                break;

            case 15:
                if (client.Level >= 52 && client.ProfessionType == ProfessionType.FireTaoist)
                {
                    client.CombatManager.LearnNewSkill(SkillID.FireMeteor);
                    AddText("You have learned Fire Meteor successfully");
                }
                else
                {
                    AddText("You must be at least level 52 to learn this skill");
                }
                AddOption("Thanks", 255);
                break;

            case 16:
                if (client.Level >= 65 && client.ProfessionType == ProfessionType.FireTaoist)
                {
                    client.CombatManager.LearnNewSkill(SkillID.FireCircle);
                    AddText("You have learned Fire Circle successfully");
                }
                else
                {
                    AddText("You must be at least level 65 to learn this skill");
                }
                AddOption("Thanks", 255);
                break;

            case 17:
                if (client.Level >= 90 && client.ProfessionType == ProfessionType.FireTaoist && client.CombatManager.KnowsSkillLevel(SkillID.Fire, 3))
                {
                    client.CombatManager.LearnNewSkill(SkillID.Tornado);
                    AddText("You have learned Tornado successfully");
                }
                else
                {
                    AddText("You must be at least level 90 with level 3 Fire to learn this skill");
                }
                AddOption("Thanks", 255);
                break;
                #endregion

                #region Water Skills
            case 18:
                if (client.Level >= 40 && client.ProfessionType == ProfessionType.WaterTaoist)
                {
                    client.CombatManager.LearnNewSkill(SkillID.HealingRain);
                    AddText("You have learned Healing Rain successfully");
                }
                else
                {
                    AddText("You must be at least level 40 to learn this skill");
                }
                AddOption("Thanks", 255);
                break;

            case 19:
                if (client.Level >= 45 && client.ProfessionType == ProfessionType.WaterTaoist)
                {
                    client.CombatManager.LearnNewSkill(SkillID.StarOfAccuracy);
                    AddText("You have learned Star of Accuracy successfully");
                }
                else
                {
                    AddText("You must be at least level 45 to learn this skill");
                }
                AddOption("Thanks", 255);
                break;

            case 20:
                if (client.Level >= 50 && client.ProfessionType == ProfessionType.WaterTaoist)
                {
                    client.CombatManager.LearnNewSkill(SkillID.MagicShield);
                    AddText("You have learned Magic Shield successfully");
                }
                else
                {
                    AddText("You must be at least level 50 to learn this skill");
                }
                AddOption("Thanks", 255);
                break;

            case 21:
                if (client.Level >= 55 && client.ProfessionType == ProfessionType.WaterTaoist)
                {
                    client.CombatManager.LearnNewSkill(SkillID.Stigma);
                    AddText("You have learned Stigma successfully");
                }
                else
                {
                    AddText("You must be at least level 55 to learn this skill");
                }
                AddOption("Thanks", 255);
                break;

            case 22:
                if (client.Level >= 60 && client.ProfessionType == ProfessionType.WaterTaoist)
                {
                    client.CombatManager.LearnNewSkill(SkillID.Invisiblity);
                    AddText("You have learned Invisibility successfully");
                }
                else
                {
                    AddText("You must be at least level 60 to learn this skill");
                }
                AddOption("Thanks", 255);
                break;

            case 23:
                if (client.Level >= 70 && client.ProfessionType == ProfessionType.WaterTaoist)
                {
                    client.CombatManager.LearnNewSkill(SkillID.Pray);
                    AddText("You have learned Pray successfully");
                }
                else
                {
                    AddText("You must be at least level 70 to learn this skill");
                }
                AddOption("Thanks", 255);
                break;

            case 24:
                if (client.Level >= 81 && client.ProfessionType == ProfessionType.WaterTaoist)
                {
                    client.CombatManager.LearnNewSkill(SkillID.AdvancedCure);
                    AddText("You have learned Advanced Cure successfully");
                }
                else
                {
                    AddText("You must be at least level 81 to learn this skill");
                }
                AddOption("Thanks", 255);
                break;

            case 25:
                if (client.Level >= 94 && client.ProfessionType == ProfessionType.WaterTaoist)
                {
                    client.CombatManager.LearnNewSkill(SkillID.Nectar);
                    AddText("You have learned Nectar successfully");
                }
                else
                {
                    AddText("You must be at least level 94 to learn this skill");
                }
                AddOption("Thanks", 255);
                break;
                #endregion

                #region Reborn Skills

                #region SummonGuard
            case 60:
                AddText("In order to learn Summon Guard, you will need to bring me a Rate 10 Gold Ore.");
                AddOption("Summon Guard", 70);
                break;

            case 70:
                if (client.RebornCount >= 1)
                {
                    if (client.HasItem(1072059))
                    {
                        if (client.CombatManager.KnowsSkill(SkillID.SummonGuard))
                        {
                            AddText("You already know Summon Guard.");
                            AddOption("I see", 255);
                        }
                        else
                        {
                            client.CombatManager.LearnNewSkill(SkillID.SummonGuard);
                            client.DeleteItem(1072059);
                            AddText("You have learned Summon Guard.");
                            AddOption("Thanks", 255);
                        }
                    }
                    else
                    {
                        AddText("Sorry, you do not have a Rate 10 Gold Ore.");
                        AddOption("I see", 255);
                    }
                }
                break;
                #endregion

                #endregion

                #endregion
            }
            AddFinish();
            Send();
        }
Beispiel #3
0
        public override void Run(Game_Server.Player client, ushort linkback)
        {
            Responses = new List <NpcDialogPacket>();
            AddAvatar();

            if (client.ProfessionType != ProfessionType.Archer)
            {
                AddText("Archers do not share their secrets of battle with others. I shall not teach you.");
                AddOption("I see.", 255);
                AddFinish();
                Send();
                return;
            }

            switch (linkback)
            {
                #region Initial Options
            case 0:
                AddText("Mercilessly fight your way to the top, my friend, because Archers are destined ");
                AddText("for greatness! Your swift mind will give you the ability to attack from afar, at a ");
                AddText("pace unmatched by any of your peers. So, what can I do for you?");

                AddOption("I want to get promoted.", 1);
                AddOption("Learn class skills.", 3);
                AddOption("Okay. I see.", 255);
                break;
                #endregion

                #region Promotion
            case 1:
                switch (client.ProfessionLevel)
                {
                case 0:
                    AddText("The single requirement of becoming an Archer is a minimum level of 15.");
                    AddText(" Would you like to proceed?");
                    AddOption("Yes, please.", 2);
                    AddOption("No.", 255);
                    break;

                case 1:
                    AddText("You may become a Eagle Archer at level 40. Do you want to continue?");
                    AddOption("Yes, I do.", 2);
                    AddOption("No.", 255);
                    break;

                case 2:
                    AddText("You may promote to Tiger Archer at level 70.");
                    AddText(" I will require one Emerald, I hear they are dropped by");
                    AddText("  monsters in the desert. Are you ready for promotion?");
                    AddOption("I'm ready!", 2);
                    AddOption("I'm not sure...", 255);
                    break;

                case 3:
                    AddText("You may promote to Dragon Archer at level 100.");
                    AddText(" I will require one Meteor. Are you ready for promotion?");
                    AddOption("I'm ready!", 2);
                    AddOption("I'm not sure...", 255);
                    break;

                case 4:
                    AddText("You may promote to Archer Master at level 110.");
                    AddText(" I will require one Moon Box. Are you ready for promotion?");
                    AddOption("I'm ready!", 2);
                    AddOption("I'm not sure...", 255);
                    break;

                case 5:
                    AddText("You are a true Archer. I cannot promote you anymore!");
                    AddOption("I see.", 255);
                    break;
                }
                break;

            case 2:
                switch (client.ProfessionLevel)
                {
                case 0:        //level 15
                    if (client.Level >= 15)
                    {
                        AddText("You have been promoted! I have taught you XP skills as a reward!");
                        client.CombatManager.LearnNewSkill(SkillID.Fly);
                        client.Character.Profession++;
                        client.Send(new UpdatePacket(client.UID, UpdateType.Profession, client.Character.Profession));
                        client.Recalculate();
                        AddOption("Thank you!", 255);
                    }
                    else
                    {
                        AddText("You are not level 15, I will not promote you yet.");
                        AddOption("I'll work harder.", 255);
                    }
                    break;

                case 1:        //level 40
                    if (client.Level >= 40 && client.Strength >= 25 && client.Agility >= 90 && client.Vitality >= 12)
                    {
                        AddText("You have been promoted!");
                        client.Character.Profession++;
                        client.Send(new UpdatePacket(client.UID, UpdateType.Profession, client.Character.Profession));
                        client.Recalculate();
                        AddOption("Thank you!", 255);
                    }
                    else
                    {
                        AddText("You must be level 40, I will not promote you yet.");
                        AddOption("I'll work harder.", 255);
                    }
                    break;

                case 2:        //level 70
                    if (client.Level >= 70 && client.HasItem(Constants.EMERALD_ID) && client.Strength >= 45 && client.Agility >= 150 && client.Vitality >= 2)
                    {
                        client.DeleteItem(Constants.EMERALD_ID);
                        client.CreateItem(Constants.METEOR_ID);
                        AddText("You have been promoted!");
                        client.Character.Profession++;
                        client.Send(new UpdatePacket(client.UID, UpdateType.Profession, client.Character.Profession));
                        client.Recalculate();
                        AddOption("Thank you!", 255);
                    }
                    else
                    {
                        AddText("You must be level 70 and bring me an Emerald in order to be promoted!");
                        AddOption("I'll work harder.", 255);
                    }
                    break;

                case 3:        //level 100
                    if (client.Level >= 100 && client.HasItem(Constants.METEOR_ID) && client.Strength >= 60 && client.Agility >= 215 && client.Vitality >= 32)
                    {
                        client.DeleteItem(Constants.METEOR_ID);
                        AddText("You have been promoted!");
                        switch (client.RebornCount)
                        {
                        case 0:
                            client.CreateItem(700031);            //normal rainbow gem
                            break;

                        default:
                            client.CreateItem(130087, 0, 0, 0, 255);            //unique 1 sock armor
                            break;
                        }
                        client.Character.Profession++;
                        client.Send(new UpdatePacket(client.UID, UpdateType.Profession, client.Character.Profession));
                        client.Recalculate();
                        AddOption("Thank you!", 255);
                    }
                    else
                    {
                        AddText("You must be level 100 and have a Meteor in order to be promoted!");
                        AddOption("I'll work harder.", 255);
                    }
                    break;

                case 4:        //level 110
                    if (client.Level >= 110 && client.HasItem(Constants.MOONBOX_ID) && client.Strength >= 68 && client.Agility >= 235 && client.Vitality >= 34)
                    {
                        client.DeleteItem(Constants.MOONBOX_ID);
                        client.CreateItem(Constants.DRAGONBALL_ID);
                        AddText("You have been promoted!");
                        client.Character.Profession++;
                        client.Send(new UpdatePacket(client.UID, UpdateType.Profession, client.Character.Profession));
                        client.Recalculate();
                        AddOption("Thank you!", 255);
                    }
                    else
                    {
                        AddText("You must be level 110 and have a Moon Box in order to be promoted!");
                        AddOption("I'll work harder.", 255);
                    }
                    break;
                }
                break;
                #endregion

                #region Learn Skills
            case 3:
                AddText("The Archer's Skills are numerous, varied and powerful. Which would you like to learn?");
                AddOption("Fly", 4);
                AddOption("Scatter", 5);
                AddOption("Rapid Fire", 6);
                AddOption("Intensify", 7);
                AddOption("Other Skills", 8);
                AddOption("Nothing.", 255);
                break;

            case 8:
                AddText("The Archer's Skills are numerous, varied and powerful. Which would you like to learn?");
                AddOption("Advanced Fly", 9);
                AddOption("Arrow Rain", 10);
                AddOption("Previous Skills", 3);
                AddOption("Nothing.", 255);
                break;

            case 4:
                if (client.Level >= 15)
                {
                    AddText("You have learned Fly successfully");
                    client.CombatManager.LearnNewSkill(SkillID.Fly);
                }
                else
                {
                    AddText("You must be at least level 15 to learn this skill!");
                }
                AddOption("Thanks", 255);
                break;

            case 5:
                if (client.Level >= 23)
                {
                    AddText("You have learned Scatter successfully");
                    client.CombatManager.LearnNewSkill(SkillID.Scatter);
                }
                else
                {
                    AddText("You must be at least level 23 to learn this skill!");
                }
                AddOption("Thanks", 255);
                break;

            case 6:
                if (client.Level >= 46)
                {
                    AddText("You have learned Rapid Fire successfully");
                    client.CombatManager.LearnNewSkill(SkillID.RapidFire);
                }
                else
                {
                    AddText("You must be at least level 46 to learn this skill!");
                }
                AddOption("Thanks", 255);
                break;

            case 7:
                if (client.Level >= 71)
                {
                    AddText("You have learned Intensify successfully");
                    client.CombatManager.LearnNewSkill(SkillID.Intensify);
                }
                else
                {
                    AddText("You must be at least level 71 to learn this skill!");
                }
                AddOption("Thanks", 255);
                break;

            case 9:
                if (client.Level >= 70)
                {
                    AddText("You have learned Advanced Fly successfully");
                    client.CombatManager.LearnNewSkill(SkillID.AdvancedFly);
                }
                else
                {
                    AddText("You must be at least level 70 to learn this skill!");
                }
                AddOption("Thanks", 255);
                break;

            case 10:
                if (client.Level >= 70)
                {
                    AddText("You have learned Arrow Rain successfully");
                    client.CombatManager.LearnNewSkill(SkillID.ArrowRain);
                }
                else
                {
                    AddText("You must be at least level 70 to learn this skill!");
                }
                AddOption("Thanks", 255);
                break;
                #endregion
            }
            AddFinish();
            Send();
        }
        public override void Run(Game_Server.Player _client, ushort _linkback)
        {
            Responses = new List <NpcDialogPacket>();
            AddAvatar();
            switch (_linkback)
            {
            case 0:
            {
                AddText("Hello! I can always succeed in upgrading item quality. But I`ll ask for a few more dragon balls than Artisan Wind. I can also upgrade item levels. How can I help you?");
                AddOption("Upgrade Quality", 1);
                AddOption("Upgrade Level", 2);
                AddOption("No thanks", 255);
                break;
            }

            case 1:
            {
                AddText("What item would you like me to upgrade the quality of?");
                AddOption("Helmet/Earrings/TaoCap ", 11);
                AddOption("Necklace/Bag ", 12);
                AddOption("Ring/Bracelet ", 16);
                AddOption("Weapon", 14);
                AddOption("Shield ", 15);
                AddOption("Armor ", 13);
                AddOption("Boots ", 18);
                AddOption("I changed my mind. ", 255);
                break;
            }

            case 2:
            {
                AddText("What item would you like me to upgrade the level of?");
                AddOption("Helmet/Earrings/TaoCap ", 31);
                AddOption("Necklace/Bag ", 32);
                AddOption("Ring/Bracelet ", 36);
                AddOption("Weapon", 34);
                AddOption("Shield ", 35);
                AddOption("Armor ", 33);
                AddOption("Boots ", 38);
                AddOption("I changed my mind. ", 255);
                break;
            }

            case 11:
            case 12:
            case 13:
            case 14:
            case 15:
            case 16:
            case 18:
            {
                var equipment = _client.Equipment.GetItemBySlot((Enum.ItemLocation)(_linkback % 10));
                if (equipment == null)
                {
                    AddText("There must be some mistake., You must be wearing an item before you may upgrade it!");
                    AddOption("Nevermind", 255);
                }
                else if (equipment.StaticID == equipment.GetNextItemQuality())
                {
                    AddText("There must be some mistake. This item cannot be upgraded further!");
                    AddOption("Nevermind", 255);
                }
                else
                {
                    var dbCost = 1 + 100 / equipment.ChanceToUpgradeQuality();
                    AddText("It will take " + dbCost + " DragonBalls to upgrade the quality of this item.");
                    AddOption("Upgrade it", (byte)(_linkback % 10 + 20));
                    AddOption("Never mind", 255);
                }
                break;
            }

            case 21:
            case 22:
            case 23:
            case 24:
            case 25:
            case 26:
            case 28:
            {
                var equipment = _client.Equipment.GetItemBySlot((Enum.ItemLocation)(_linkback % 10));
                if (equipment == null)
                {
                    AddText("There must be some mistake., You must be wearing an item before you may upgrade it!");
                    AddOption("Nevermind", 255);
                }
                else if (equipment.StaticID == equipment.GetNextItemQuality())
                {
                    AddText("There must be some mistake. This item cannot be upgraded!");
                    AddOption("Nevermind", 255);
                }
                else
                {
                    var dbCost = 1 + 100 / equipment.ChanceToUpgradeQuality();
                    if (!_client.HasItem(Constants.DRAGONBALL_ID, (uint)dbCost))
                    {
                        AddText("You do not have the required " + dbCost + " DragonBalls to upgrade quality!");
                        AddOption("Sorry", 255);
                    }
                    else
                    {
                        for (var i = 0; i < dbCost; i++)
                        {
                            _client.DeleteItem(Constants.DRAGONBALL_ID);
                        }
                        equipment.ChangeItemID(equipment.GetNextItemQuality());

                        if (Common.PercentSuccess(Constants.SOCKET_RATE * 2))
                        {
                            if (equipment.Gem1 == 0)
                            {
                                equipment.Gem1 = 255;
                                Managers.PlayerManager.SendToServer(new TalkPacket(ChatType.GM, "As a very lucky player, " + _client.Name + " has added the first socket to his/her " + equipment.BaseItem.Name));
                            }
                            else if (equipment.Gem2 == 0)
                            {
                                equipment.Gem2 = 255;
                                Managers.PlayerManager.SendToServer(new TalkPacket(ChatType.GM, "As a very lucky player, " + _client.Name + " has added the second socket to his/her " + equipment.BaseItem.Name));
                            }
                        }
                        equipment.Save();
                        _client.Send(ItemInformationPacket.Create(equipment, ItemInfoAction.Update));
                        _client.Recalculate();
                        AddText("The quality has been upgraded! Enjoy your new item.");
                        AddOption("Thanks!", 255);
                    }
                }
                break;
            }

            case 31:
            case 32:
            case 33:
            case 34:
            case 35:
            case 36:
            case 38:
            {
                var equipment = _client.Equipment.GetItemBySlot((Enum.ItemLocation)(_linkback % 10));
                if (equipment == null)
                {
                    AddText("There must be some mistake., You must be wearing an item before you may upgrade it!");
                    AddOption("Nevermind", 255);
                }
                else if (equipment.StaticID == equipment.GetNextItemLevel() || equipment.BaseItem.LevelReq >= 120)
                {
                    AddText("There must be some mistake. I cannot upgrade this item further.");
                    AddOption("Nevermind", 255);
                }
                else
                {
                    var metCost = 1 + 100 / equipment.ChanceToUpgradeLevel();
                    if (metCost > 40)
                    {
                        metCost = 40;
                    }
                    AddText("It will take " + metCost + " Meteors to upgrade the level of this item.");
                    AddOption("Upgrade it", (byte)(_linkback % 10 + 40));
                    AddOption("Never mind", 255);
                }
                break;
            }

            case 41:
            case 42:
            case 43:
            case 44:
            case 45:
            case 46:
            case 48:
            {
                var equipment = _client.Equipment.GetItemBySlot((Enum.ItemLocation)(_linkback % 10));
                if (equipment == null)
                {
                    AddText("There must be some mistake., You must be wearing an item before you may upgrade it!");
                    AddOption("Nevermind", 255);
                }
                else if (equipment.StaticID == equipment.GetNextItemLevel() || equipment.BaseItem.LevelReq >= 120)
                {
                    AddText("There must be some mistake. I cannot upgrade this item further.");
                    AddOption("Nevermind", 255);
                }
                else if (_client.Level < equipment.GetDBItemByStaticID(equipment.GetNextItemLevel()).LevelReq)
                {
                    AddText("You are too low level to wear the upgraded item!");
                    AddOption("Oops", 255);
                }
                else
                {
                    var metCost = 1 + 100 / equipment.ChanceToUpgradeLevel();
                    if (metCost > 40)
                    {
                        metCost = 40;
                    }
                    if (!_client.HasItem(Constants.METEOR_ID, (uint)metCost))
                    {
                        AddText("You do not have the required " + metCost + " Meteors to upgrade this item's level!");
                        AddOption("Sorry", 255);
                    }
                    else
                    {
                        for (var i = 0; i < metCost; i++)
                        {
                            _client.DeleteItem(Constants.METEOR_ID);
                        }
                        equipment.ChangeItemID(equipment.GetNextItemLevel());
                        if (Common.PercentSuccess(Constants.SOCKET_RATE))
                        {
                            if (equipment.Gem1 == 0)
                            {
                                equipment.Gem1 = 255;
                                Managers.PlayerManager.SendToServer(new TalkPacket(ChatType.GM, "As a very lucky player, " + _client.Name + " has added the first socket to his/her " + equipment.BaseItem.Name));
                            }
                            else if (equipment.Gem2 == 0)
                            {
                                equipment.Gem2 = 255;
                                Managers.PlayerManager.SendToServer(new TalkPacket(ChatType.GM, "As a very lucky player, " + _client.Name + " has added the second socket to his/her " + equipment.BaseItem.Name));
                            }
                        }
                        equipment.Save();
                        _client.Send(ItemInformationPacket.Create(equipment, ItemInfoAction.Update));
                        _client.Recalculate();
                        AddText("The level has been upgraded! Enjoy your new item.");
                        AddOption("Thanks!", 255);
                    }
                }
                break;
            }
            }
            AddFinish();
            Send();
        }
        public override void Run(Game_Server.Player client, ushort linkback)
        {
            Responses = new List <NpcDialogPacket>();
            AddAvatar();

            if (client.ProfessionType != ProfessionType.Warrior)
            {
                AddText("Warriors do not share their secrets of battle with others. I shall not teach you.");
                AddOption("I see.", 255);
                AddFinish();
                Send();
                return;
            }

            switch (linkback)
            {
                #region Initial Options
            case 0:
                AddText("To be a good Warrior, you must know your weapon, your armor be a 2nd");
                AddText(" skin, and use your shild to ward off your enemy! Remember, fortune favors");
                AddText(" the brave, and you must keep your head, even in the darkest hours. So, what");
                AddText(" can I do for you?");
                AddOption("I want to get promoted.", 1);
                AddOption("Learn class skills.", 3);
                AddOption("Okay. I see.", 255);
                break;
                #endregion

                #region Promotion
            case 1:
                switch (client.ProfessionLevel)
                {
                case 0:
                    AddText("The single requirement of becoming a Warrior is a minimum level of 15.");
                    AddText(" Would you like to proceed?");
                    AddOption("Yes, please.", 2);
                    AddOption("No.", 255);
                    break;

                case 1:
                    AddText("You may become a Brass Warrior at level 40. Do you want to continue?");
                    AddOption("Yes, I do.", 2);
                    AddOption("No.", 255);
                    break;

                case 2:
                    AddText("You may promote to Silver Warrior at level 70.");
                    AddText(" I will require one Emerald, I hear they are dropped by");
                    AddText("  monsters in the desert. Are you ready for promotion?");
                    AddOption("I'm ready!", 2);
                    AddOption("I'm not sure...", 255);
                    break;

                case 3:
                    AddText("You may promote to Gold Warrior at level 100.");
                    AddText(" I will require one Meteor. Are you ready for promotion?");
                    AddOption("I'm ready!", 2);
                    AddOption("I'm not sure...", 255);
                    break;

                case 4:
                    AddText("You may promote to Warrior Master at level 110.");
                    AddText(" I will require one Moon Box. Are you ready for promotion?");
                    AddOption("I'm ready!", 2);
                    AddOption("I'm not sure...", 255);
                    break;

                case 5:
                    AddText("You are a true Warrior. I cannot promote you anymore!");
                    AddOption("I see.", 255);
                    break;
                }
                break;

            case 2:
                switch (client.ProfessionLevel)
                {
                case 0:        //level 15
                    if (client.Level >= 15)
                    {
                        AddText("You have been promoted! I have taught you XP skills as a reward!");
                        client.CombatManager.LearnNewSkill(SkillID.Accuracy);
                        client.CombatManager.LearnNewSkill(SkillID.Shield);
                        client.CombatManager.LearnNewSkill(SkillID.Superman);
                        client.CombatManager.LearnNewSkill(SkillID.Roar);
                        client.Character.Profession++;
                        client.Send(new UpdatePacket(client.UID, UpdateType.Profession, client.Character.Profession));
                        client.Recalculate();
                        AddOption("Thank you!", 255);
                    }
                    else
                    {
                        AddText("You are not level 15, I will not promote you yet.");
                        AddOption("I'll work harder.", 255);
                    }
                    break;

                case 1:        //level 40
                    if (client.Level >= 40 && client.Strength >= 80 && client.Agility >= 25 && client.Vitality >= 20)
                    {
                        AddText("You have been promoted!");
                        client.Character.Profession++;
                        client.Send(new UpdatePacket(client.UID, UpdateType.Profession, client.Character.Profession));
                        client.Recalculate();
                        AddOption("Thank you!", 255);
                    }
                    else
                    {
                        AddText("You must be level 40, I will not promote you yet.");
                        AddOption("I'll work harder.", 255);
                    }
                    break;

                case 2:        //level 70
                    if (client.Level >= 70 && client.HasItem(Constants.EMERALD_ID) && client.Strength >= 140 && client.Agility >= 45 && client.Vitality >= 32)
                    {
                        client.DeleteItem(Constants.EMERALD_ID);
                        AddText("You have been promoted!");
                        client.CreateItem(Constants.METEOR_ID);        //meteor
                        client.Character.Profession++;
                        client.Send(new UpdatePacket(client.UID, UpdateType.Profession, client.Character.Profession));
                        client.Recalculate();
                        AddOption("Thank you!", 255);
                    }
                    else
                    {
                        AddText("You must be level 70 and bring me an Emerald in order to be promoted!");
                        AddOption("I'll work harder.", 255);
                    }
                    break;

                case 3:        //level 100
                    if (client.Level >= 100 && client.HasItem(Constants.METEOR_ID) && client.Strength >= 205 && client.Agility >= 60 && client.Vitality >= 42)
                    {
                        client.DeleteItem(Constants.METEOR_ID);
                        AddText("You have been promoted!");
                        switch (client.RebornCount)
                        {
                        case 0:
                            client.CreateItem(700031);            //normal rainbow gem
                            break;

                        default:
                            client.CreateItem(130087, 0, 0, 0, 255);            //unique 1 sock armor
                            break;
                        }
                        client.Character.Profession++;
                        client.Send(new UpdatePacket(client.UID, UpdateType.Profession, client.Character.Profession));
                        client.Recalculate();
                        AddOption("Thank you!", 255);
                    }
                    else
                    {
                        AddText("You must be level 100 and have a Meteor in order to be promoted!");
                        AddOption("I'll work harder.", 255);
                    }
                    break;

                case 4:        //level 110
                    if (client.Level >= 110 && client.HasItem(Constants.MOONBOX_ID) && client.Strength >= 225 && client.Agility >= 65 && client.Vitality >= 47)
                    {
                        client.DeleteItem(Constants.MOONBOX_ID);
                        client.CreateItem(Constants.DRAGONBALL_ID);
                        AddText("You have been promoted!");
                        client.Character.Profession++;
                        client.Send(new UpdatePacket(client.UID, UpdateType.Profession, client.Character.Profession));
                        client.Recalculate();
                        AddOption("Thank you!", 255);
                    }
                    else
                    {
                        AddText("You must be level 110 and have a Moon Box in order to be promoted!");
                        AddOption("I'll work harder.", 255);
                    }
                    break;
                }
                break;
                #endregion

                #region Learn Skills
            case 3:
                AddText("What skill would you like to learn?");
                AddOption("XP Skills", 4);
                AddOption("Dash", 5);
                AddOption("Nothing.", 255);
                break;

            case 4:
                if (client.Level >= 15)
                {
                    AddText("You have learned your XP skills successfully");
                    client.CombatManager.LearnNewSkill(SkillID.Accuracy);
                    client.CombatManager.LearnNewSkill(SkillID.Shield);
                    client.CombatManager.LearnNewSkill(SkillID.Superman);
                    client.CombatManager.LearnNewSkill(SkillID.Roar);
                }
                else
                {
                    AddText("You must be at least level 15 to learn these skills!");
                }
                AddOption("Thanks", 255);
                break;

            case 5:
                if (client.Level >= 63)
                {
                    AddText("You have learned Dash successfully");
                    client.CombatManager.LearnNewSkill(SkillID.Dash);
                }
                else
                {
                    AddText("You must be at least level 63 to learn this skill!");
                }
                AddOption("Thanks", 255);
                break;
                #endregion
            }
            AddFinish();
            Send();
        }
Beispiel #6
0
        public override void Run(Game_Server.Player client, ushort linkback)
        {
            Responses = new List <NpcDialogPacket>();
            AddAvatar();

            if (client.ProfessionType != ProfessionType.Trojan)
            {
                AddText("Trojans do not share their secrets of battle with others. I shall not teach you.");
                AddOption("I see.", 255);
                AddFinish();
                Send();
                return;
            }

            switch (linkback)
            {
                #region Initial Options
            case 0:
                AddText("Trojans can wield dual weapons, and fearlessly take on anyone in melee");
                AddText(" combat! Whatever the cost, always remember that courage is the foundation");
                AddText(" of victory! So, what can I do for you?");
                AddOption("I would like to get promoted.", 1);
                AddOption("I wish to learn skills.", 3);
                AddOption("Nothing.", 255);
                break;
                #endregion

                #region Promotion
            case 1:
                switch (client.ProfessionLevel)
                {
                case 0:
                    AddText("The single requirement of becoming a Trojan is a minimum level of 15.");
                    AddText(" Would you like to proceed?");
                    AddOption("Yes, please.", 2);
                    AddOption("No.", 255);
                    break;

                case 1:
                    AddText("You may become a Veteran Trojan at level 40. Do you want to continue?");
                    AddOption("Yes, I do.", 2);
                    AddOption("No.", 255);
                    break;

                case 2:
                    AddText("You may promote to Tiger Trojan at level 70.");
                    AddText(" I will require one Emerald, I hear they are dropped by");
                    AddText("  monsters in the desert. Are you ready for promotion?");
                    AddOption("I'm ready!", 2);
                    AddOption("I'm not sure...", 255);
                    break;

                case 3:
                    AddText("You may promote to Tiger Trojan at level 100.");
                    AddText(" I will require one Meteor. Are you ready for promotion?");
                    AddOption("I'm ready!", 2);
                    AddOption("I'm not sure...", 255);
                    break;

                case 4:
                    AddText("You may promote to Tiger Trojan at level 110.");
                    AddText(" I will require one Moon Box. Are you ready for promotion?");
                    AddOption("I'm ready!", 2);
                    AddOption("I'm not sure...", 255);
                    break;

                case 5:
                    AddText("You are a true Trojan. I cannot promote you anymore!");
                    AddOption("I see.", 255);
                    break;
                }
                break;

            case 2:
                switch (client.ProfessionLevel)
                {
                case 0:        //level 15
                    if (client.Level >= 15)
                    {
                        AddText("You have been promoted! I have taught you XP skills as a reward!");
                        client.CombatManager.LearnNewSkill(SkillID.Accuracy);
                        client.CombatManager.LearnNewSkill(SkillID.Cyclone);
                        client.Character.Profession++;
                        client.Send(new UpdatePacket(client.UID, UpdateType.Profession, client.Character.Profession));
                        client.Recalculate();
                        AddOption("Thank you!", 255);
                    }
                    else
                    {
                        AddText("You are not level 15, I will not promote you yet.");
                        AddOption("I'll work harder.", 255);
                    }
                    break;

                case 1:        //level 40
                    if (client.Level >= 40 && client.Strength >= 60 && client.Agility >= 25 && client.Vitality >= 25)
                    {
                        AddText("You have been promoted!");
                        if (client.RebornCount == 1)
                        {
                            AddText("I've given you a special item to help commemorate the occasion!");
                            client.CreateItem(410077);        //poison blade - need to add stat
                        }
                        client.Character.Profession++;
                        client.Send(new UpdatePacket(client.UID, UpdateType.Profession, client.Character.Profession));
                        client.Recalculate();
                        AddOption("Thank you!", 255);
                    }
                    else
                    {
                        if (client.Level >= 40)
                        {
                            AddText("It seems that you have forgot to set your stats after a reborn has been done. your Strength needs to be 60, Agility needs to have a minimum of 25, Vitality as a minimum of 25");
                            AddOption("How foolish of me, I'll set my stats first.", 255);
                            break;
                        }
                        else
                        {
                            AddText("You must be level 40, I will not promote you yet.");
                            AddOption("I'll work harder.", 255);
                        }
                    }
                    break;

                case 2:        //level 70
                    if (client.Level >= 70 && client.HasItem(Constants.EMERALD_ID) && client.Strength >= 110 && client.Agility >= 42 && client.Vitality >= 45)
                    {
                        client.DeleteItem(Constants.EMERALD_ID);
                        AddText("You have been promoted!");
                        client.CreateItem(Constants.METEOR_ID);        //meteor
                        client.Character.Profession++;
                        client.Send(new UpdatePacket(client.UID, UpdateType.Profession, client.Character.Profession));
                        client.Recalculate();
                        AddOption("Thank you!", 255);
                    }
                    else
                    {
                        if (client.Level >= 70)
                        {
                            AddText("It seems that you have forgot to set your stats after a reborn has been done. your Strength needs to be 110, Agility needs to have a minimum of 42, Vitality as a minimum of 45");
                            AddOption("How foolish of me, I'll set my stats first.", 255);
                            break;
                        }
                        else
                        {
                            AddText("You must be level 70 and bring me an Emerald in order to be promoted! ");
                            AddOption("I'll work harder.", 255);
                        }
                    }
                    break;

                case 3:        //level 100
                    if (client.Level >= 100 && client.HasItem(Constants.METEOR_ID) && client.Strength >= 110 && client.Agility >= 42 && client.Vitality >= 45)
                    {
                        client.DeleteItem(Constants.METEOR_ID);
                        AddText("You have been promoted!");
                        switch (client.RebornCount)
                        {
                        case 0:
                            client.CreateItem(700031);            //normal rainbow gem
                            break;

                        default:
                            client.CreateItem(130087, 0, 0, 0, 255);            //unique 1 sock armor
                            break;
                        }
                        client.Character.Profession++;
                        client.Send(new UpdatePacket(client.UID, UpdateType.Profession, client.Character.Profession));
                        client.Recalculate();
                        AddOption("Thank you!", 255);
                    }
                    else
                    {
                        if (client.Level >= 100)
                        {
                            AddText("It seems that you have forgot to set your stats after a reborn has been done. your Strength needs to be 110, Agility needs to have a minimum of 42, Vitality as a minimum of 45");
                            AddOption("How foolish of me, I'll set my stats first.", 255);
                            break;
                        }
                        else
                        {
                            AddText("You must be level 100 and bring me an Meteor in order to be promoted! ");
                            AddOption("I'll work harder.", 255);
                        }
                    }
                    break;

                case 4:        //level 110
                    if (client.Level >= 110 && client.HasItem(Constants.MOONBOX_ID) && client.Strength >= 170 && client.Agility >= 65 && client.Vitality >= 100)
                    {
                        client.DeleteItem(Constants.MOONBOX_ID);
                        client.CreateItem(Constants.DRAGONBALL_ID);
                        AddText("You have been promoted!");
                        client.Character.Profession++;
                        client.Send(new UpdatePacket(client.UID, UpdateType.Profession, client.Character.Profession));
                        client.Recalculate();
                        AddOption("Thank you!", 255);
                    }
                    else
                    {
                        if (client.Level >= 110)
                        {
                            AddText("It seems that you have forgot to set your stats after a reborn has been done. your Strength needs to be 170, Agility needs to have a minimum of 65, Vitality as a minimum of 100");
                            AddOption("How foolish of me, I'll set my stats first.", 255);
                            break;
                        }
                        else
                        {
                            AddText("You must be level 110 and bring me an Moon Box in order to be promoted! ");
                            AddOption("I'll work harder.", 255);
                        }
                    }
                    break;
                }
                break;
                #endregion

                #region Learn Skills
            case 3:
                AddText("What skill would you like to learn?");
                AddOption("XP Skills", 4);
                AddOption("Hercules", 5);
                AddOption("Spirit Healing", 6);
                AddOption("Robot", 7);
                AddOption("Nothing.", 255);
                break;

            case 4:
                if (client.Level >= 15)
                {
                    AddText("You have learned Cyclone and Accuracy successfully");
                    client.CombatManager.LearnNewSkill(SkillID.Cyclone);
                    client.CombatManager.LearnNewSkill(SkillID.Accuracy);
                }
                else
                {
                    AddText("You must be at least level 15 to learn these skills!");
                }
                AddOption("Thanks", 255);
                break;

            case 5:
                if (client.Level >= 40)
                {
                    AddText("You have learned Hercules successfully");
                    client.CombatManager.LearnNewSkill(SkillID.Hercules);
                }
                else
                {
                    AddText("You must be at least level 40 to learn this skill!");
                }
                AddOption("Thanks", 255);
                break;

            case 6:
                if (client.Level >= 40)
                {
                    AddText("You have learned Spirit Healing successfully");
                    client.CombatManager.LearnNewSkill(SkillID.SpiritHealing);
                }
                else
                {
                    AddText("You must be at least level 40 to learn this skill!");
                }
                AddOption("Thanks", 255);
                break;

            case 7:
                if (client.Level >= 40)
                {
                    AddText("You have learned Robot successfully");
                    client.CombatManager.LearnNewSkill(SkillID.Robot);
                }
                else
                {
                    AddText("You must be at least level 40 to learn this skill!");
                }
                AddOption("Thanks", 255);
                break;
                #endregion
            }
            AddFinish();
            Send();
        }
        public override void Run(Game_Server.Player _client, ushort _linkback)
        {
            Responses = new List <NpcDialogPacket>();
            AddAvatar();
            switch (_linkback)
            {
            case 0:
                AddText("The DragonBall is really a precious item.You can use it to reallot your attribute points after you have been reborned.");
                AddText("After reborning at 70 or above you can reallot your attribute points freely.");
                AddText(" Well, if you have a DragonBall, I can help you do that.");
                AddOption("Please help me.", 1);
                AddOption("Definitely.", 255);
                break;

            case 1:
                if (_client.RebornCount < 1)
                {
                    AddText("Please come back when you have been reborned at least once in your lifetime?");
                    AddOption("I see.", 255);
                    break;
                }
                if (_client.Level < 70)
                {
                    AddText("You must be level 70 or above to be able to reallot attribute points!");
                    AddOption("Thanks. I see.", 255);
                    break;
                }
                if (!_client.HasItem(1088000))
                {
                    AddText("Sorry, but you must pay one DragonBall come back when you have one!");
                    AddOption("I see!", 255);
                    break;
                }
                else if (hasAgreed)
                {
                    stats = (uint)(_client.Character.Strength + _client.Character.Vitality + _client.Character.Agility + _client.Character.Spirit + _client.ExtraStats);
                    _client.DeleteItem(1088000);

                    _client.Strength   = 0;
                    _client.Vitality   = 8;
                    _client.Agility    = 2;
                    _client.Spirit     = 0;
                    _client.ExtraStats = (ushort)(stats - 10);
                    _client.Recalculate(true);
                    _client.Save();

                    AddText("There you go, allot them as you wish!");
                    AddOption("I see!", 255);
                }
                else
                {
                    hasAgreed = true;
                    AddText("Are you sure you want to reallot your attribute points?");
                    AddOption("Yes.", (byte)_linkback);
                    AddOption("No thanks.", 255);
                }
                break;
            }
            AddFinish();
            Send();
        }
Beispiel #8
0
        public override void Run(Game_Server.Player _client, ushort _linkback)
        {
            Responses = new List <NpcDialogPacket>();
            AddAvatar();
            switch (_linkback)
            {
            case 0:

                if (_client.RebornCount != 0 && _client.Character.SecondQuest > 0 && _client.RebornCount < 2 && _client.Level >= (_client.ProfessionType == Enum.ProfessionType.WaterTaoist ? 110 : 120))
                {
                    if (_client.Character.SecondQuest > 0 && _client.RebornCount < 2 && _client.Level >= (_client.ProfessionType == Enum.ProfessionType.WaterTaoist ? 110 : 120))
                    {
                        AddText("Even bold adventurers eventually grow tired of their journeys. I help these heroes by offering them life anew.");
                        AddOption("I wish to reborn.", 1);
                        AddOption("I'm not tired!", 255);
                        break;
                    }
                    else
                    {
                        AddText("Hello young one! I help people seek the ultimate goal of rebirth. ");
                        AddText("You are not yet experienced enough to undertake this adventure. ");
                        AddOption("I will.", 255);
                    }
                    break;
                }
                else
                {
                    if (_client.RebornCount != 0 && _client.Character.SecondQuest == 0)
                    {
                        AddText("I cannot do the rebirth ritual if you do not open the gates of hell. Go talk to alex he will show you how..");
                        AddOption("Okay Thanks", 255);
                        break;
                    }
                    else
                    {
                        AddText("I have helped you as much as I can. Even heroes have their limits.");
                        AddOption("Thanks", 255);
                        break;
                    }
                }

            case 1:
                if (_client.RebornCount < 2 && _client.Character.SecondQuest > 0 && _client.Level >= (_client.ProfessionType == Enum.ProfessionType.WaterTaoist ? 110 : 120))
                {
                    AddText("By accepting the gift of rebirth, you will start your life again. ");
                    AddText("You can unlock great strength as well as new skills in the process! ");
                    AddText("Are you sure you're ready to give up your current life? ");
                    AddOption("I'm ready.", 2);
                    AddOption("Not yet!", 255);
                    break;
                }
                else
                {
                    AddText("Ooh my! Lets not get ahead of ourselves. You are not yet ready to become reborn.");
                    AddOption("Sorry.", 255);
                }
                break;

            case 2:
                if (_client.HasItem(Constants.EXEMPTION_TOKEN_ID))
                {
                    AddText("Are you sure you want to get second reborn and unlock new powers?");
                    AddOption("Yeah.", 5);
                    AddOption("I'm not sure...", 255);
                    break;
                }
                else
                {
                    AddText("Rebirth requires the unlocking of great power. Please make sure you have a ExemptionToken before coming to me.");
                    AddOption("Sorry.", 255);
                }
                break;

            case 5:
                AddText("What profession would you like in your new life?");
                AddOption("Trojan", 11);
                AddOption("Warrior", 12);
                AddOption("Water Taoist", 13);
                AddOption("Fire Taoist", 14);
                AddOption("Archer", 15);
                AddOption("I'm not sure...", 255);
                break;

            case 11:
            case 12:
            case 13:
            case 14:
            case 15:
                if (_client.RebornCount < 2 && _client.Character.SecondQuest > 0 && _client.Level >= (_client.ProfessionType == Enum.ProfessionType.WaterTaoist ? 110 : 120))
                {
                    if (_client.HasItem(Constants.EXEMPTION_TOKEN_ID))
                    {
                        _client.DeleteItem(Constants.EXEMPTION_TOKEN_ID);

                        var path = (((uint)_client.Character.Profession1 - 5) / 10) * 100 + (((uint)_client.Character.Profession - 5)) + (uint)_linkback % 10;
                        foreach (var pathData in Database.ServerDatabase.Context.RebornPaths.GetRebornByPath(path))
                        {
                            if (pathData.IsForget)
                            {
                                _client.CombatManager.TryRemoveSkill(pathData.SkillId);
                            }
                            else
                            {
                                _client.CombatManager.AddOrUpdateSkill(pathData.SkillId, 0);
                            }
                        }
                        foreach (var skill in _client.CombatManager.skills.Values)
                        {
                            skill.Database.PreviousLevel = skill.Database.Level;
                            skill.Database.Level         = 0;
                            skill.Database.Experience    = 0;
                            skill.Save();
                            skill.Send(_client);
                        }
                        _client.CombatManager.AddOrUpdateSkill(9876, 0);
                        _client.Character.Profession2 = _client.Character.Profession;
                        switch (_linkback % 10)
                        {
                        case 1:
                            _client.Character.Profession = 11;
                            break;

                        case 2:
                            _client.Character.Profession = 21;
                            break;

                        case 3:
                            _client.Character.Profession = 132;
                            break;

                        case 4:
                            _client.Character.Profession = 142;
                            break;

                        case 5:
                            _client.Character.Profession = 41;
                            break;
                        }

                        _client.RebornCount = 2;
                        _client.Send(new UpdatePacket(_client.UID, UpdateType.Profession, _client.Character.Profession));
                        _client.Send(new UpdatePacket(_client.UID, UpdateType.Reborn, _client.RebornCount));
                        _client.SpawnPacket.RebornCount = 1;
                        _client.SendToScreen(_client.SpawnPacket, true);

                        #region Down Level Items
                        for (ItemLocation location = ItemLocation.Helmet; location < ItemLocation.Garment; location++)
                        {
                            Structures.ConquerItem item;
                            item = _client.Equipment.GetItemBySlot(location);
                            if (item != null)
                            {
                                item.DownLevelItem(); _client.Send(ItemInformationPacket.Create(item, ItemInfoAction.Update));
                            }
                        }
                        #endregion

                        #region Set Bonus Stats
                        _client.Character.Strength = 0;
                        _client.Character.Vitality = 8;
                        _client.Character.Agility  = 2;
                        _client.Character.Spirit   = 0;
                        switch (_client.Level)
                        {
                        case 120:
                            _client.ExtraStats = (ushort)(20 + _client.ExtraStats);
                            break;

                        case 121:
                            _client.ExtraStats = (ushort)(21 + _client.ExtraStats);
                            break;

                        case 122:
                            _client.ExtraStats = (ushort)(23 + _client.ExtraStats);
                            break;

                        case 123:
                            _client.ExtraStats = (ushort)(26 + _client.ExtraStats);
                            break;

                        case 124:
                            _client.ExtraStats = (ushort)(30 + _client.ExtraStats);
                            break;

                        case 125:
                            _client.ExtraStats = (ushort)(35 + _client.ExtraStats);
                            break;

                        case 126:
                            _client.ExtraStats = (ushort)(41 + _client.ExtraStats);
                            break;

                        case 127:
                            _client.ExtraStats = (ushort)(48 + _client.ExtraStats);
                            break;

                        case 128:
                            _client.ExtraStats = (ushort)(56 + _client.ExtraStats);
                            break;

                        case 129:
                            _client.ExtraStats = (ushort)(65 + _client.ExtraStats);
                            break;

                        case 130:
                            _client.ExtraStats = (ushort)(75 + _client.ExtraStats);
                            break;
                        }
                        #endregion

                        if (_client.Level > 120)
                        {
                            _client.Character.PreviousLevel = _client.Level;
                        }
                        _client.SetLevel(15);
                        _client.Experience = 0;
                        _client.Recalculate(true);
                        Managers.PlayerManager.SendToServer(new TalkPacket(ChatType.GM, _client.Name + " has been reborned successfully. Congratulations!"));
                        _client.Save();
                    }
                    else
                    {
                        AddText("Rebirth requires the unlocking of great power. Please make sure you have a ExemptionToken before coming to me.");
                        AddOption("Sorry.", 255);
                    }
                }
                else
                {
                    AddText("Lets not get ahead of ourselves! You are not ready to achieve second rebirth. Please come back later.");
                    AddOption("Sorry.", 255);
                }
                break;
            }
            AddFinish();
            Send();
        }