コード例 #1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Potion.Deleted)
                {
                    return;
                }

                if (!m_Potion.IsChildOf(from.Backpack))
                {
                    from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
                }
                else if (targeted is BaseCreature)
                {
                    BaseCreature petPatient = targeted as BaseCreature;

                    if (!petPatient.IsDeadBondedPet)
                    {
                        from.SendLocalizedMessage(1112764); // This may only be used to resurrect dead pets.
                    }
                    else if (petPatient.Corpse != null && !petPatient.Corpse.Deleted)
                    {
                        from.SendLocalizedMessage(1113279); // That creature's spirit lacks cohesion. Try again in a few minutes.
                    }
                    else if (!from.InRange(petPatient, 2))
                    {
                        from.SendLocalizedMessage(501042); // Target is not close enough.
                    }
                    else if (!from.Alive)
                    {
                        from.SendLocalizedMessage(501040); // The resurrecter must be alive.
                    }
                    else if (!petPatient.IsDeadPet)
                    {
                        from.SendLocalizedMessage(1112764); // This may only be used to resurrect dead pets.
                    }
                    else if (petPatient.Map == null || !petPatient.Map.CanFit(petPatient.Location, 16, false, false))
                    {
                        from.SendLocalizedMessage(501042); // Target can not be resurrected at that location.
                    }
                    else
                    {
                        from.PlaySound(0x214);
                        from.FixedEffect(0x376A, 10, 16);
                        petPatient.ResurrectPet();
                        m_Potion.Delete();
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1112764); // This may only be used to resurrect dead pets.
                }
            }
コード例 #2
0
ファイル: ElixirOfRebirth.cs プロジェクト: nogu3ira/xrunuo
            protected override void OnTarget(Mobile from, object target)
            {
                if (m_Elixir.Deleted)
                {
                    return;
                }

                if (!m_Elixir.IsChildOf(from.Backpack))
                {
                    from.SendLocalizedMessage(1062334);                       // This item must be in your backpack to be used.
                }
                else if (target is BaseCreature)
                {
                    BaseCreature pet = target as BaseCreature;

                    if (!pet.IsDeadBondedPet)
                    {
                        from.SendLocalizedMessage(1112764);                           // This may only be used to resurrect dead pets.
                    }
                    else if (pet.Corpse != null && !pet.Corpse.Deleted)
                    {
                        from.SendLocalizedMessage(1113279);                           // That creature's spirit lacks cohesion. Try again in a few minutes.
                    }
                    else if (!from.CanSee(pet) || !from.InLOS(pet))
                    {
                        from.SendLocalizedMessage(503376);                           // Target cannot be seen.
                    }
                    else if (!from.InRange(pet, 12))
                    {
                        from.SendLocalizedMessage(500643);                           // Target is too far away.
                    }
                    else
                    {
                        pet.PlaySound(0x214);
                        pet.ResurrectPet();
                        m_Elixir.Delete();
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1112764);                       // This may only be used to resurrect dead pets.
                }
            }