Example #1
0
        public override void OnKilledBy(Mobile mob)
        {
            base.OnKilledBy(mob);

            PlayerMobile pm = mob as PlayerMobile;

            if (pm != null && pm.Backpack != null)
            {
                if (QuestHelper.HasQuest <GreenWithEnvyQuest>(pm))
                {
                    // As Navrey Night-Eyes dies, you find and claim one of her eyes as proof of her demise.
                    pm.SendLocalizedMessage(1095155);

                    pm.Backpack.DropItem(new EyeOfNavrey());
                }

                if (!m_UsedPillars && 0.015 >= Utility.RandomDouble())
                {
                    Item reward;

                    switch (Utility.Random(3))
                    {
                    default:
                    case 0: reward = new NightEyes(); break;

                    case 1: reward = new TangleA(); break;

                    case 2: reward = new ScrollOfTranscendence(Utility.RandomSkill(), 3.0); break;
                    }

                    pm.Backpack.DropItem(reward);
                    pm.SendLocalizedMessage(502088);                       // A special gift has been placed in your backpack.
                }
            }
        }
Example #2
0
        private Item GiveAward()
        {
            if (0.05 > Utility.RandomDouble())
            {
                switch (Utility.Random(4))
                {
                case 0: return(new ExpiredVoucher());

                case 1: return(new ForgedArtwork());

                case 2: return(new LittleBlackBook());

                case 3: return(new SlimsShadowVeil());
                }
            }

            switch (Utility.Random(3))
            {
            default:
            case 0:
                return(new Skeletonkey());

            case 1:
                Item item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(false, false, true);

                int min, max;
                TreasureMapChest.GetRandomItemStat(out min, out max, 1.0);

                RunicReforging.GenerateRandomItem(item, 0, min, max, Map);
                return(item);

            case 2:
                return(ScrollOfTranscendence.CreateRandom(1, 10));
            }
        }
Example #3
0
        public override void OnDeath(Container c)
        {
            base.OnDeath(c);

            if (m_Spawner != null)
                m_Spawner.OnNavreyKilled();

            if (Utility.RandomBool())
                c.AddItem(new UntranslatedAncientTome());

            if (0.1 >= Utility.RandomDouble())
                c.AddItem(ScrollOfTranscendence.CreateRandom(30, 30));

            if (0.1 >= Utility.RandomDouble())
                c.AddItem(new TatteredAncientScroll());

            if (Utility.RandomDouble() < 0.10)
                c.DropItem(new LuckyCoin());

            if (Utility.RandomDouble() < 0.025)
                DistributeRandomArtifact(this, m_Artifact);

            // distribute quest items for the 'Green with Envy' quest given by Vernix
            List<DamageStore> rights = GetLootingRights();
            for (int i = rights.Count - 1; i >= 0; --i)
            {
                DamageStore ds = rights[i];
                if (!ds.m_HasRight)
                    rights.RemoveAt(i);
            }

            // for each with looting rights... give an eye of navrey if they have the quest
            foreach (DamageStore d in rights)
            {
                PlayerMobile pm = d.m_Mobile as PlayerMobile;
                if (null != pm)
                {
                    foreach (BaseQuest quest in pm.Quests)
                    {
                        if (quest is GreenWithEnvyQuest)
                        {
                            Container pack = pm.Backpack;
                            Item item = new EyeOfNavrey();
                            if (pack == null || !pack.TryDropItem(pm, item, false))
                                pm.BankBox.DropItem(item);
                            pm.SendLocalizedMessage(1095155); // As Navrey Night-Eyes dies, you find and claim one of her eyes as proof of her demise.
                            break;
                        }
                    }
                }
            }
        }
Example #4
0
        // distribute a reward to the puzzle solver
        private void GiveReward(Mobile m)
        {
            if (null == m)
            {
                return;
            }

            Item item = null;

            switch (Utility.Random(1))
            {
            case 0:
                item = ScrollOfTranscendence.CreateRandom(10, 10);
                break;

            case 1:
                // black bone container
                break;

            case 2:
                // red bone container
                break;

            case 3:
                // gruesome standard
                break;

            case 4:
                // bag of gems
                break;

            case 5:
                // random piece of spawn decoration
                break;
            }

            // drop the item in backpack or bankbox
            if (null != item)
            {
                Container pack = m.Backpack;
                if (null == pack || !pack.TryDropItem(m, item, false))
                {
                    m.BankBox.DropItem(item);
                }
            }
        }
Example #5
0
        private Item GiveReward(TradeEntry entry)
        {
            if (0.01 > Utility.RandomDouble())
            {
                switch (Utility.Random(2))
                {
                default:
                case 0: return(CityBook.GetRandom());

                case 1: return(new RewardSign());
                }
            }

            switch (Utility.Random(2))
            {
            default:
            case 1: return(RandomResource(entry));

            case 2: return(ScrollOfTranscendence.CreateRandom(1, 10));
            }
        }
Example #6
0
        public override void OnConfirmed(CollectionItem citem, int index)
        {
            Item item;

            if (citem.Type == typeof(VvVPotionKeg))
            {
                PotionType type;

                switch (index)
                {
                default:
                case 0: type = PotionType.GreaterStamina; break;

                case 1: type = PotionType.Supernova; break;

                case 2: type = PotionType.StatLossRemoval; break;

                case 3: type = PotionType.AntiParalysis; break;
                }

                item = new VvVPotionKeg(type);
            }
            else if (citem.Type == typeof(VvVSteedStatuette))
            {
                SteedType type = index == 5 || index == 6 ? SteedType.WarHorse : SteedType.Ostard;

                item = new VvVSteedStatuette(type, citem.Hue);
            }
            else if (citem.Type == typeof(VvVTrapKit))
            {
                VvVTrapType type;

                switch (index - 11)
                {
                default:
                case 0: type = VvVTrapType.Poison; break;

                case 1: type = VvVTrapType.Cold; break;

                case 2: type = VvVTrapType.Energy; break;

                case 3: type = VvVTrapType.Blade; break;

                case 4: type = VvVTrapType.Explosion; break;
                }

                item = new VvVTrapKit(type);
            }
            else if (citem.Type == typeof(VvVRobe) || citem.Type == typeof(VvVHairDye))
            {
                item = Activator.CreateInstance(citem.Type, citem.Hue) as Item;
            }
            else if (citem.Type == typeof(ScrollOfTranscendence))
            {
                item = ScrollOfTranscendence.CreateRandom(10, 10);
            }
            else
            {
                item = Activator.CreateInstance(citem.Type) as Item;
            }

            if (item != null)
            {
                VvVRewards.OnRewardItemCreated(User, item);

                if (User.Backpack == null || !User.Backpack.TryDropItem(User, item, false))
                {
                    User.SendLocalizedMessage(1074361); // The reward could not be given.  Make sure you have room in your pack.
                    item.Delete();
                }
                else
                {
                    if (User.AccessLevel == AccessLevel.Player)
                    {
                        PointsSystem.ViceVsVirtue.DeductPoints(User, citem.Points);
                    }

                    User.SendLocalizedMessage(1073621); // Your reward has been placed in your backpack.
                    User.PlaySound(0x5A7);
                }
            }
        }
Example #7
0
        public void OnSlice()
        {
            if (!m_Active || Deleted)
            {
                return;
            }

            if (m_Champion != null)
            {
                if (m_Champion.Deleted)
                {
                    RegisterDamageTo(m_Champion);

                    if (m_Champion is BaseChampion)
                    {
                        AwardArtifact(((BaseChampion)m_Champion).GetArtifact());
                    }

                    m_DamageEntries.Clear();

                    if (m_Altar != null)
                    {
                        m_Altar.Hue = 0x455;

                        if (m_Altar.Map == Map.Felucca)
                        {
                            new StarRoomGate(true, m_Altar.Location, m_Altar.Map);
                        }
                    }

                    m_Champion = null;
                    Stop();

                    m_HasBeenAdvanced = false;

                    BeginRestart(m_RestartDelay);
                }
                else
                {
                    if (m_Champion.Region != m_Region)
                    {
                        m_Champion.MoveToWorld(new Point3D(X, Y, Z - 15), Map);
                    }
                }
            }
            else
            {
                int kills = m_Kills;

                for (int i = 0; i < m_Creatures.Count; ++i)
                {
                    Mobile creature = m_Creatures[i];

                    if (creature.Deleted)
                    {
                        if (creature.Corpse != null && !creature.Corpse.Deleted)
                        {
                            ((Corpse)creature.Corpse).BeginDecay(TimeSpan.FromMinutes(1.0));
                        }

                        m_Creatures.RemoveAt(i);
                        --i;
                        ++m_Kills;

                        RegisterDamageTo(creature);

                        Mobile killer = creature.FindMostRecentDamager(false);

                        if (killer is BaseCreature)
                        {
                            killer = ((BaseCreature)killer).GetMaster();
                        }

                        if (killer is PlayerMobile && killer.Alive && killer.Region == m_Region)
                        {
                            if (creature.Fame > Utility.Random(1000000))
                            {
                                if (Map == Map.Felucca && Utility.RandomBool())
                                {
                                    PowerScroll ps = PowerScroll.CreateRandomNoCraft(5, 5);

                                    ps.LootType = LootType.Blessed;

                                    killer.SendLocalizedMessage(1049524);                                       // You have received a scroll of power!

                                    killer.AddToBackpack(ps);
                                }
                                else
                                {
                                    ScrollOfTranscendence sot;

                                    if (this.Map.Rules == MapRules.FeluccaRules)
                                    {
                                        sot = ScrollOfTranscendence.CreateRandom(6, 10);
                                    }
                                    else
                                    {
                                        sot = ScrollOfTranscendence.CreateRandom(1, 5);
                                    }

                                    killer.SendLocalizedMessage(1094936);                                       // You have received a Scroll of Transcendence!

                                    killer.AddToBackpack(sot);
                                }
                            }

                            int mobSubLevel = GetSubLevelFor(creature) + 1;

                            if (mobSubLevel >= 0)
                            {
                                bool gainedPath = false;

                                int pointsToGain = mobSubLevel * 40;

                                if (VirtueHelper.Award(killer, VirtueName.Valor, pointsToGain, ref gainedPath))
                                {
                                    if (gainedPath)
                                    {
                                        killer.SendLocalizedMessage(1054032);                                           // You have gained a path in Valor!
                                    }
                                    else
                                    {
                                        killer.SendLocalizedMessage(1054030);                                           // You have gained in Valor!
                                    }
                                    // No delay on Valor gains
                                }
                            }

                            #region Champion Monster Titles
                            int type = -1;

                            switch (m_Type)
                            {
                            case ChampionSpawnType.ColdBlood:
                                type = 0;
                                break;

                            case ChampionSpawnType.ForestLord:
                                type = 1;
                                break;

                            case ChampionSpawnType.Arachnid:
                                type = 2;
                                break;

                            case ChampionSpawnType.Abyss:
                                type = 3;
                                break;

                            case ChampionSpawnType.VerminHorde:
                                type = 4;
                                break;

                            case ChampionSpawnType.UnholyTerror:
                                type = 5;
                                break;

                            case ChampionSpawnType.SleepingDragon:
                                type = 6;
                                break;

                            case ChampionSpawnType.Corrupt:
                                type = 7;
                                break;

                            case ChampionSpawnType.Glade:
                                type = 8;
                                break;

                            case ChampionSpawnType.Unliving:
                                type = 9;
                                break;

                            case ChampionSpawnType.Pit:
                                type = 10;
                                break;
                            }

                            BaseCreature bc = creature as BaseCreature;

                            if (bc != null && type != -1)
                            {
                                bc.CalculateTitlesScore((PlayerMobile)killer, bc.SpawnLevel, type);
                            }
                            #endregion
                        }
                    }
                }

                // Only really needed once.
                if (m_Kills > kills)
                {
                    InvalidateProperties();
                }

                double n = m_Kills / (double)MaxKills;
                int    p = (int)(n * 100);

                if (p >= 90)
                {
                    AdvanceLevel();
                }
                else if (p > 0)
                {
                    SetWhiteSkullCount(p / 20);
                }

                if (DateTime.Now >= m_ExpireTime)
                {
                    Expire();
                }

                if (DateTime.Now >= m_KickTime)
                {
                    KickGhosts();
                }

                Respawn();
            }
        }