Beispiel #1
0
        private static void Resurrect_OnTick(object state)
        {
            object[]      states = (object[])state;
            PlayerMobile  owner  = (PlayerMobile)states[0];
            AutoResPotion arp    = (AutoResPotion)states[1];

            if (owner != null && !owner.Deleted && arp != null && !arp.Deleted)
            {
                if (owner.Alive || arp.m_Charges < 1)
                {
                    return;
                }

                owner.SendMessage("You died under the watch of the spirits, they have offered you another chance at life.");
                owner.Resurrect();

                arp.m_Charges--;

                arp.InvalidateProperties();

                if (arp.m_Charges < 1)
                {
                    arp.Delete();
                }
            }
        }
Beispiel #2
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!from.Alive)
            {
                return;
            }
            if (!this.IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
                return;
            }
            if (m_ResList != null && m_ResList.ContainsKey(from))
            {
                AutoResPotion arp = m_ResList[from];
                if (arp == null || arp.Deleted)
                {
                    m_ResList.Remove(from);
                }
                else
                {
                    from.SendMessage("你已经喝了一瓶复活水。");//The spirits watch you already.
                    return;
                }
            }


            if (m_ResList == null)
            {
                m_ResList = new Dictionary <Mobile, AutoResPotion>();
            }

            if (!m_ResList.ContainsKey(from))
            {
                if (!m_ResList.ContainsValue(this))
                {
                    m_ResList.Add(from, this);
                    BuffInfo.AddBuff(from, new BuffInfo((BuffIcon)1183, 1070928, 1112762));
                    from.PlaySound(0x53c);
                    from.FixedParticles(0x375A, 1, 17, 0x7DA, 93, 0x3, EffectLayer.Waist);

                    this.Name = "瓶口沾满了口水的重生药水";
                    this.Hue  = 91;
                    //this.Consume();
                    from.SendMessage("你感觉灵魂出窍,获得一次自动复活能力。");//You feel the spirits watching you, awaiting to send you back to your body.
                    return;
                }
                else
                {
                    from.SendMessage("明显被别人喝过了");//The spirits of this potion are watching another
                }
                return;
            }
            else
            {
                from.PlaySound(0x41e);
                from.SendMessage("  你已经喝了一瓶复活水。");//The spirits watch you already.
            }
        }
Beispiel #3
0
        private static void EventSink_Death(PlayerDeathEventArgs e)
        {
            PlayerMobile owner = e.Mobile as PlayerMobile;

            if (owner != null && !owner.Deleted)
            {
                if (owner.Alive)
                {
                    return;
                }

                if (m_ResList != null && m_ResList.ContainsKey(owner))
                {
                    AutoResPotion arp = m_ResList[owner];
                    if (arp == null || arp.Deleted)
                    {
                        m_ResList.Remove(owner);
                        return;
                    }
                    arp.m_Timer = Timer.DelayCall(m_Delay, new TimerStateCallback(Resurrect_OnTick), new object[] { owner, arp });
                    m_ResList.Remove(owner);
                }
            }
        }
Beispiel #4
0
            protected override void OnTick()
            {
                Item gem = Loot.RandomGem();
                Item reg = Loot.RandomPossibleReagent();

                Item equip;

                equip = Loot.RandomArmorOrShieldOrWeaponOrJewelry();

                if (m_Item != null)
                {
                    m_Item.IsDigging = false;
                }

                if (equip is BaseWeapon)
                {
                    BaseWeapon weapon = (BaseWeapon)equip;

                    int attributeCount;
                    int min, max;

                    GetRandomAOSStats(out attributeCount, out min, out max);

                    BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max);
                }
                else if (equip is BaseArmor)
                {
                    BaseArmor armor = (BaseArmor)equip;

                    int attributeCount;
                    int min, max;

                    GetRandomAOSStats(out attributeCount, out min, out max);

                    BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max);
                }
                else if (equip is BaseJewel)
                {
                    int attributeCount;
                    int min, max;

                    GetRandomAOSStats(out attributeCount, out min, out max);

                    BaseRunicTool.ApplyAttributesTo((BaseJewel)equip, attributeCount, min, max);
                }

                if (Utility.Random(100) < 45)
                {
                    switch (Utility.Random(16))
                    {
                    case 0:
                        Skeleton skel = new Skeleton();
                        skel.Location  = m_From.Location;
                        skel.Map       = m_From.Map;
                        skel.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            skel.IsParagon = true;
                        }

                        World.AddMobile(skel);
                        break;

                    case 1:
                        Ghoul ghoul = new Ghoul();
                        ghoul.Location  = m_From.Location;
                        ghoul.Map       = m_From.Map;
                        ghoul.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            ghoul.IsParagon = true;
                        }

                        World.AddMobile(ghoul);
                        break;

                    case 2:
                        Wraith wraith = new Wraith();
                        wraith.Location  = m_From.Location;
                        wraith.Map       = m_From.Map;
                        wraith.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            wraith.IsParagon = true;
                        }

                        World.AddMobile(wraith);
                        break;

                    case 3:
                        Lich lich = new Lich();
                        lich.Location  = m_From.Location;
                        lich.Map       = m_From.Map;
                        lich.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            lich.IsParagon = true;
                        }

                        World.AddMobile(lich);
                        break;

                    case 4:
                        LichLord lichl = new LichLord();
                        lichl.Location  = m_From.Location;
                        lichl.Map       = m_From.Map;
                        lichl.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            lichl.IsParagon = true;
                        }

                        World.AddMobile(lichl);
                        break;

                    case 5:
                        AncientLich alich = new AncientLich();
                        alich.Location  = m_From.Location;
                        alich.Map       = m_From.Map;
                        alich.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            alich.IsParagon = true;
                        }

                        World.AddMobile(alich);
                        break;

                    case 6:
                        Mummy mum = new Mummy();
                        mum.Location  = m_From.Location;
                        mum.Map       = m_From.Map;
                        mum.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            mum.IsParagon = true;
                        }

                        World.AddMobile(mum);
                        break;

                    case 7:
                        Zombie zom = new Zombie();
                        zom.Location  = m_From.Location;
                        zom.Map       = m_From.Map;
                        zom.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            zom.IsParagon = true;
                        }

                        World.AddMobile(zom);
                        break;

                    case 8:
                        SkeletalKnight sk = new SkeletalKnight();
                        sk.Location  = m_From.Location;
                        sk.Map       = m_From.Map;
                        sk.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            sk.IsParagon = true;
                        }

                        World.AddMobile(sk);
                        break;

                    case 9:
                        SkeletalMage sm = new SkeletalMage();
                        sm.Location  = m_From.Location;
                        sm.Map       = m_From.Map;
                        sm.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            sm.IsParagon = true;
                        }

                        World.AddMobile(sm);
                        break;

                    case 10:
                        BoneKnight bk = new BoneKnight();
                        bk.Location  = m_From.Location;
                        bk.Map       = m_From.Map;
                        bk.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            bk.IsParagon = true;
                        }

                        World.AddMobile(bk);
                        break;

                    case 11:
                        BoneMagi bm = new BoneMagi();
                        bm.Location  = m_From.Location;
                        bm.Map       = m_From.Map;
                        bm.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            bm.IsParagon = true;
                        }

                        World.AddMobile(bm);
                        break;

                    case 12:
                        Spectre spec = new Spectre();
                        spec.Location  = m_From.Location;
                        spec.Map       = m_From.Map;
                        spec.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            spec.IsParagon = true;
                        }

                        World.AddMobile(spec);
                        break;

                    case 13:
                        Shade shade = new Shade();
                        shade.Location  = m_From.Location;
                        shade.Map       = m_From.Map;
                        shade.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            shade.IsParagon = true;
                        }

                        World.AddMobile(shade);
                        break;

                    case 14:
                        Bogle bog = new Bogle();
                        bog.Location  = m_From.Location;
                        bog.Map       = m_From.Map;
                        bog.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            bog.IsParagon = true;
                        }

                        World.AddMobile(bog);
                        break;

                    case 15:
                        FrostDragon fDragon = new FrostDragon();
                        fDragon.PackGold(50000);
                        fDragon.Location  = m_From.Location;
                        fDragon.Map       = m_From.Map;
                        fDragon.Combatant = m_From;
                        if (Utility.Random(100) < 20)
                        {
                            fDragon.IsParagon = true;
                            fDragon.PackItem(new SoulweaponBox());
                        }
                        break;
                    }
                    m_From.SendMessage(6, "你驚醒了沉睡中的亡靈.");
                }
                else if (m_From.Skills[SkillName.Mining].Base < 15.0)
                {
                    if (Utility.Random(100) < 55)
                    {
                        m_From.SendMessage("你什麽都沒有挖掘到.");
                    }
                    else
                    {
                        switch (Utility.Random(3))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("你挖到了寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 35.0)
                {
                    if (Utility.Random(100) < 45)
                    {
                        m_From.SendMessage("你什麽都沒有挖掘到.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 4);
                        reg.Amount = Utility.RandomMinMax(2, 4);

                        switch (Utility.Random(5))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("你挖到了一些寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了一些藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 20, SpellbookType.Regular));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 5, SpellbookType.Necromancer));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 50.0)
                {
                    if (Utility.Random(100) < 35)
                    {
                        m_From.SendMessage("你什麽都沒有挖掘到.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 10);
                        reg.Amount = Utility.RandomMinMax(2, 10);

                        switch (Utility.Random(6))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("你挖到了一些寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了一些藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 40, SpellbookType.Regular));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 10, SpellbookType.Necromancer));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 75.0)
                {
                    if (Utility.Random(100) < 25)
                    {
                        m_From.SendMessage("你什麽都沒有挖掘到.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 20);
                        reg.Amount = Utility.RandomMinMax(2, 20);

                        switch (Utility.Random(7))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("你挖到了一些寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了一些藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 50, SpellbookType.Regular));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 13, SpellbookType.Necromancer));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;

                        case 6:
                            m_From.AddToBackpack(new BonePile());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 90.0)
                {
                    if (Utility.Random(100) < 15)
                    {
                        m_From.SendMessage("你什麽都沒有挖掘到.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 30);
                        reg.Amount = Utility.RandomMinMax(2, 30);

                        switch (Utility.Random(8))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("你挖到了一些寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了一些藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 63, SpellbookType.Regular));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 15, SpellbookType.Necromancer));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;

                        case 6:
                            m_From.AddToBackpack(new BonePile());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;

                        case 7:
                            m_From.AddToBackpack(new GraveItem());
                            m_From.SendMessage("你挖到了一些前人留下的寶藏.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 150.0)
                {
                    if (Utility.Random(10) < 1)//概率 zp
                    {
                        Item i;
                        switch (Utility.Random(13))
                        {
                        case 0: { i = new ArmoredNinjaBelt(); break; }

                        case 1: { i = new ButchersResolve(); break; }

                        case 2: { i = new FollowerOfTheOldLord(); break; }

                        case 3: { i = new SkirtOfTheAmazon(); break; }

                        case 4: { i = new HolyHammerOfExorcism(); break; }

                        case 5: { i = new ArmoredCloak(); break; }

                        case 6: { i = new SoulweaponBox(); break; }

                        default:
                        case 7:
                        case 8:
                        case 9:
                        case 10:
                        case 11:
                        case 12: { i = new AutoResPotion(); break; }
                        }
                        m_From.SendMessage(25, "你挖到了一些很有價值的東西.");
                        m_From.PlaySound(0x41e);
                        m_From.AddToBackpack(i);
                        m_From.SendGump(new totGump(i));
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 40);
                        reg.Amount = Utility.RandomMinMax(2, 40);

                        switch (Utility.Random(8))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("你挖到了一些寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了一些藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 63, SpellbookType.Regular));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 15, SpellbookType.Necromancer));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;

                        case 6:
                            m_From.AddToBackpack(new BonePile());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;

                        case 7:
                            m_From.AddToBackpack(new GraveItem());
                            m_From.SendMessage("你挖到了一些前人留下的寶藏.");
                            break;
                        }
                    }
                }
                else
                {
                    m_From.SendMessage("你什麽都沒有挖掘到.");
                }

                Stop();
            }