Esempio n. 1
0
        public override bool OnBeforeDeath()
        {
            BoneKnight rm = new BoneKnight();

            rm.Team         = Team;
            rm.Combatant    = Combatant;
            rm.NoKillAwards = true;

            if (rm.Backpack == null)
            {
                Backpack pack = new Backpack();
                pack.Movable = false;
                rm.AddItem(pack);
            }

            for (int i = 0; i < 2; i++)
            {
                LootPack.FilthyRich.Generate(this, rm.Backpack, true, LootPack.GetLuckChanceForKiller(this));
                LootPack.FilthyRich.Generate(this, rm.Backpack, false, LootPack.GetLuckChanceForKiller(this));
            }

            Effects.PlaySound(this, Map, GetDeathSound());
            Effects.SendLocationEffect(Location, Map, 0x3709, 30, 10, 0x835, 0);
            rm.MoveToWorld(Location, Map);

            Delete();
            return(false);
        }
        public static int GetArtifactChance(Mobile boss)
        {
            if (!Core.AOS)
            {
                return(0);
            }

            int luck = LootPack.GetLuckChanceForKiller(boss);
            int chance;

            // Luck must be capped to 1200
            if (luck > 1200)
            {
                luck = 1200;
            }

            if (boss is DemonKnight)
            {
                chance = 1500 + (luck / 5);
            }
            else
            {
                chance = 750 + (luck / 10);
            }

            return(chance);
        }
        public override bool OnBeforeDeath()
        {
            BoneMagi rm = new BoneMagi();

            rm.Team         = this.Team;
            rm.Combatant    = this.Combatant;
            rm.NoKillAwards = true;

            if (rm.Backpack == null)
            {
                Backpack pack = new Backpack();
                pack.Movable = false;
                rm.AddItem(pack);
            }

            ArrayList list = GetLootingRights(this.DamageEntries, this.HitsMax);

            for (int i = 0; i < 2; i++)
            {
                LootPack.FilthyRich.Generate(this, rm.Backpack, true, LootPack.GetLuckChanceForKiller(this), list);
                LootPack.FilthyRich.Generate(this, rm.Backpack, false, LootPack.GetLuckChanceForKiller(this), list);
            }

            Effects.PlaySound(this, Map, GetDeathSound());
            Effects.SendLocationEffect(Location, Map, 0x3709, 30, 10, 0x835, 0);
            rm.MoveToWorld(Location, Map);

            Delete();
            return(false);
        }
Esempio n. 4
0
        public static int GetArtifactChance(Mobile boss)
        {
            if (!Core.AOS)
            {
                return(0);
            }

            int luck   = LootPack.GetLuckChanceForKiller(boss);
            int chance = 1500 + (luck / 5);             //Same as DemonKnight

            return(chance);
        }
Esempio n. 5
0
        public static int GetArtifactChance(Mobile boss)
        {
            if (!Core.AOS)
            {
                return(0);
            }

            var luck = LootPack.GetLuckChanceForKiller(boss);
            int chance;

            if (boss is DemonKnight)
            {
                chance = 1500 + luck / 5;
            }
            else
            {
                chance = 750 + luck / 10;
            }

            return(chance);
        }
Esempio n. 6
0
        public void OnSlice()
        {
            if (!m_Active || Deleted)
            {
                return;
            }

            if (m_Champion != null)
            {
                if (m_Champion.Deleted)
                {
                    if (m_Altar != null)
                    {
                        m_Altar.Hue = 0x455;
                        new StarRoomGate(true, m_Altar.Location, m_Altar.Map);
                    }

                    m_Champion = null;
                    Stop();

                    m_IsValorUsed = false;

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

                        m.Delete();
                    }

                    BeginRestart(m_RestartDelay);
                }
            }
            else
            {
                for (int i = 0; i < m_Creatures.Count; ++i)
                {
                    Mobile m = (Mobile)m_Creatures[i];

                    if (m.Deleted)
                    {
                        PlayerMobile pm = GetPlayerFromMobileKiller(m.LastKiller);

                        if (pm != null && !pm.Deleted && pm.Alive)
                        {
                            int luck = LootPack.GetLuckChanceForKiller(m);

                            int chance = 150 + (luck / 5);

                            if (chance > Utility.Random(200000))
                            {
                                PowerScroll ps = PowerScroll.CreateRandomNoCraft(5, 5);

                                ps.LootType = Spells.SpellHelper.IsFeluccaT2A(Map, Location) ? LootType.Blessed : LootType.Cursed;

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

                                pm.AddToBackpack(ps);
                            }
                        }

                        m_Creatures.RemoveAt(i);
                        --i;
                        ++m_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();
                }

                Respawn();
            }
        }