Beispiel #1
0
        public void ConsumeCharge(RodOfResurrection rod, Mobile from)
        {
            --rod.Charges;

            if (rod.Charges == 0)
            {
                from.SendMessage("All of the magic has been drained from the rod.");
                rod.Delete();
            }
        }
Beispiel #2
0
        public void Target(Mobile m, Mobile from, RodOfResurrection rod)
        {
            if (!from.CanSee(m))
            {
                from.SendLocalizedMessage(500237);   // Target can not be seen.
            }
            else if (!from.Alive)
            {
                from.SendLocalizedMessage(501040);   // The resurrecter must be alive.
            }
            else if (m is PlayerMobile && m.Alive)
            {
                from.SendLocalizedMessage(501041);   // Target is not dead.
            }
            else if (!from.InRange(m, 2))
            {
                from.SendLocalizedMessage(501042);   // Target is not close enough.
            }
            else if (m.Map == null || !m.Map.CanFit(m.Location, 16, false, false))
            {
                from.SendLocalizedMessage(501042); // Target can not be resurrected at that location.
                m.SendLocalizedMessage(502391);    // Thou can not be resurrected there!
            }
            else if (m is PlayerMobile)
            {
                m.PlaySound(0x214);
                m.FixedEffect(0x376A, 10, 16);

                m.CloseGump(typeof(ResurrectGump));
                m.SendGump(new ResurrectGump(m, from));

                ConsumeCharge(rod, from);
            }
            else if (m is BaseCreature)
            {
                BaseCreature pet    = (BaseCreature)m;
                Mobile       master = pet.GetMaster();

                m.PlaySound(0x214);
                m.FixedEffect(0x376A, 10, 16);

                master.CloseGump(typeof(PetResurrectGump));
                master.SendGump(new PetResurrectGump(master, pet));

                ConsumeCharge(rod, from);
            }
        }
Beispiel #3
0
 public InternalTarget(Mobile owner, RodOfResurrection rod) : base(1, false, TargetFlags.Beneficial)
 {
     m_Owner = owner;
     m_Rod   = rod;
 }
Beispiel #4
0
        public void ItemTarget(Item hench, Mobile from, RodOfResurrection rod)
        {
            if (hench is HenchmanFighterItem)
            {
                HenchmanFighterItem friend = (HenchmanFighterItem)hench;

                if (friend.HenchDead > 0)
                {
                    friend.Name      = "fighter henchman";
                    friend.HenchDead = 0;
                    friend.InvalidateProperties();
                    from.PlaySound(0x214);
                    ConsumeCharge(rod, from);
                }
                else
                {
                    from.SendMessage("They are not dead.");
                }
            }
            else if (hench is HenchmanWizardItem)
            {
                HenchmanWizardItem friend = (HenchmanWizardItem)hench;

                if (friend.HenchDead > 0)
                {
                    friend.Name      = "wizard henchman";
                    friend.HenchDead = 0;
                    friend.InvalidateProperties();
                    from.PlaySound(0x214);
                    ConsumeCharge(rod, from);
                }
                else
                {
                    from.SendMessage("They are not dead.");
                }
            }
            else if (hench is HenchmanArcherItem)
            {
                HenchmanArcherItem friend = (HenchmanArcherItem)hench;

                if (friend.HenchDead > 0)
                {
                    friend.Name      = "archer henchman";
                    friend.HenchDead = 0;
                    friend.InvalidateProperties();
                    from.PlaySound(0x214);
                    ConsumeCharge(rod, from);
                }
                else
                {
                    from.SendMessage("They are not dead.");
                }
            }
            else if (hench is HenchmanMonsterItem)
            {
                HenchmanMonsterItem friend = (HenchmanMonsterItem)hench;

                if (friend.HenchDead > 0)
                {
                    friend.Name      = "creature henchman";
                    friend.HenchDead = 0;
                    friend.InvalidateProperties();
                    from.PlaySound(0x214);
                    ConsumeCharge(rod, from);
                }
                else
                {
                    from.SendMessage("They are not dead.");
                }
            }
            else
            {
                from.SendMessage("This spell didn't seem to work.");
            }
        }