Exemple #1
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (m_Pet.Deleted || !m_Pet.IsBonded || !m_Pet.IsDeadPet)
            {
                return;
            }

            Mobile from = state.Mobile;

            if (info.ButtonID == 1)
            {
                if (m_Pet.Map == null || !m_Pet.Map.CanFit(m_Pet.Location, 16, false, false))
                {
                    from.SendLocalizedMessage(503256);                       // You fail to resurrect the creature.
                    return;
                }

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

                for (int i = 0; i < m_Pet.Skills.Length; ++i)                   // Decrease all skills on pet.
                {
                    m_Pet.Skills[i].Base -= 0.2;
                }
            }
        }
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (m_Pet.Deleted || !m_Pet.IsBonded || !m_Pet.IsDeadPet)
            {
                return;
            }

            Mobile from = state.Mobile;

            if (info.ButtonID == 1)
            {
                if (m_Pet.Map == null || !m_Pet.Map.CanFit(m_Pet.Location, 16, false, false))
                {
                    from.SendLocalizedMessage(503256); // You fail to resurrect the creature.
                }
                else
                {
                    if (UberScriptFunctions.Methods.TAKEGOLDFROM(null, from, _price))
                    {
                        m_Pet.PlaySound(0x214);
                        m_Pet.FixedEffect(0x376A, 10, 16);
                        m_Pet.ResurrectPet();
                    }
                    else
                    {
                        from.SendMessage("You can't afford that!");
                    }
                }
            }
        }
Exemple #3
0
        public override void Execute(CommandEventArgs e, object obj)
        {
            Mobile mob  = (Mobile)obj;
            Mobile from = e.Mobile;

            if (m_Value)
            {
                if (!mob.Alive)
                {
                    LogFailure("They are already dead.");
                }
                else if (!mob.CanBeDamaged())
                {
                    LogFailure("They cannot be harmed.");
                }
                else
                {
                    CommandLogging.WriteLine(from, "{0} {1} killing {2}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(mob));
                    //mob.Kill();
                    mob.BoltEffect(0);
                    mob.Damage(10000, from);
                    AddResponse("They have been killed.");
                }
            }
            else
            {
                if (mob.IsDeadBondedPet)
                {
                    BaseCreature bc = mob as BaseCreature;

                    if (bc != null)
                    {
                        CommandLogging.WriteLine(from, "{0} {1} resurrecting {2}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(mob));

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

                        bc.ResurrectPet();

                        AddResponse("It has been resurrected.");
                    }
                }
                else if (!mob.Alive)
                {
                    CommandLogging.WriteLine(from, "{0} {1} resurrecting {2}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(mob));

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

                    mob.Resurrect();
                    Server.Misc.Death.Penalty(mob, false);

                    AddResponse("They have been resurrected.");
                }
                else
                {
                    LogFailure("They are not dead.");
                }
            }
        }
Exemple #4
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m is BaseCreature)
            {
                BaseCreature    bc      = m as BaseCreature;
                TrainingProfile profile = PetTrainingHelper.GetTrainingProfile(bc);

                if (bc.Controlled && bc.ControlMaster != null && bc.ControlMaster.InRange(bc.Location, 25) &&
                    profile != null && profile.HasBegunTraining && profile.TrainingProgress < profile.TrainingProgressMax)
                {
                    profile.TrainingProgress = profile.TrainingProgressMax;
                    bc.FixedEffect(0x375A, 10, 30);

                    if (bc.ControlMaster is PlayerMobile)
                    {
                        NewAnimalLoreGump gump = bc.ControlMaster.FindGump <NewAnimalLoreGump>();

                        if (gump != null)
                        {
                            gump.Refresh();
                        }
                        else
                        {
                            BaseGump.SendGump(new NewAnimalLoreGump((PlayerMobile)bc.ControlMaster, bc));
                        }
                    }
                }
            }

            return(true);
        }
Exemple #5
0
        public void OnTick(BaseCreature lizard, Mobile owner)
        {
            if (lizard != null && lizard.Controlled)
            {
                lizard.Frozen = false;

                m_Timer.Stop();
                m_Timer = null;
            }
            else
                lizard.FixedEffect(0x376A, 1, 32);
        }
Exemple #6
0
        public bool OnUsed(Mobile from, BaseCreature pet)
        {
            if (m_UnderEffect.Contains(pet))
            {
                from.SendLocalizedMessage(1113075);                   // Your pet is still under the effect of armor essence.
                return(false);
            }
            else if (DateTime.Now < pet.NextArmorEssence)
            {
                from.SendLocalizedMessage(1113076);                   // Your pet is still recovering from the last armor essence it consumed.
                return(false);
            }
            else
            {
                pet.SayTo(from, 1113050);                   // Your pet looks much happier.

                pet.FixedEffect(0x375A, 10, 15);
                pet.PlaySound(0x1E7);

                List <ResistanceMod> mods = new List <ResistanceMod>();

                mods.Add(new ResistanceMod(ResistanceType.Physical, 15));
                mods.Add(new ResistanceMod(ResistanceType.Fire, 10));
                mods.Add(new ResistanceMod(ResistanceType.Cold, 10));
                mods.Add(new ResistanceMod(ResistanceType.Poison, 10));
                mods.Add(new ResistanceMod(ResistanceType.Energy, 10));

                for (int i = 0; i < mods.Count; i++)
                {
                    pet.AddResistanceMod(mods[i]);
                }

                m_UnderEffect.Add(pet);

                Timer.DelayCall(Duration, new TimerCallback(
                                    delegate
                {
                    for (int i = 0; i < mods.Count; i++)
                    {
                        pet.RemoveResistanceMod(mods[i]);
                    }

                    m_UnderEffect.Remove(pet);
                }));

                pet.NextArmorEssence = DateTime.Now + Duration + Cooldown;

                Delete();

                return(true);
            }
        }
        public void RezAPet(Mobile f, object t)
        {
            BaseCreature c = t as BaseCreature;

            if (c == null)
            {
                f.SendMessage("That's not a pet.");
                return;
            }

            if (c.Map == Map.Felucca)
            {
                f.SendMessage("That does not work in Felucca.");
            }
            if (m_Charges < 1)
            {
                this.Delete();
                f.SendMessage("That wand is used up already.");
            }
            else if (!c.Controlled)
            {
                f.SendMessage("That's not a pet.");
            }
            else if (c.ControlMaster != f)
            {
                f.SendMessage("That's not your pet.");
            }
            else if (!c.IsDeadPet)
            {
                f.SendMessage("That pet is still alive.");
            }
            else if (!c.InRange(f.Location, 3))
            {
                f.SendMessage("Your pet needs to be closer to you for the wand to work.");
            }
            else if (c.Map == null || !c.Map.CanFit(c.Location, 16, false, false))
            {
                f.SendMessage("You can not resurrect the pet at that location.");
            }
            else
            {
                c.PlaySound(0x214);
                c.FixedEffect(0x376A, 10, 16);
                c.ResurrectPet();
                Charges--;
                if (m_Charges <= 0)
                {
                    this.Delete();
                    f.SendMessage("That wand used up its last charge.");
                }
            }
        }
        public virtual void OnTarget(Mobile from, object obj)
        {
            Mobile mob;

            if (obj is Corpse)
            {
                Corpse corpse = obj as Corpse;
                mob = corpse.Owner;
            }
            else
            {
                mob = obj as Mobile;
            }

            if (mob == null)
            {
                from.SendMessage("This is not a living being!");
                return;
            }

            if (mob is BaseCreature && mob.IsDeadBondedPet)
            {
                BaseCreature bc = mob as BaseCreature;
                bc.PlaySound(0x214);
                bc.FixedEffect(0x376A, 10, 16);
                bc.ResurrectPet();

                this.Consume();
                from.Emote("*recites a scroll of resurrection*");
                from.SendMessage("The creature was brought back to life.");
            }

            if (mob is PlayerMobile)
            {
                if (mob.Alive)
                {
                    from.SendMessage("This creature is not dead!");
                    return;
                }
                else
                {
                    mob.PlaySound(0x214);
                    mob.FixedEffect(0x376A, 10, 16);
                    mob.Resurrect();
                }

                this.Consume();
                from.Emote("*recites a scroll of resurrection*");
                from.SendMessage("This person was brought back to life.");
            }
        }
Exemple #9
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (m_Pet.Deleted || !m_Pet.IsBonded || !m_Pet.IsDeadPet)
            {
                return;
            }

            var from = state.Mobile;

            if (info.ButtonID == 1)
            {
                if (m_Pet.Map?.CanFit(m_Pet.Location, 16, false, false) != true)
                {
                    from.SendLocalizedMessage(503256); // You fail to resurrect the creature.
                    return;
                }

                if (m_Pet.Region?.IsPartOf("Khaldun") == true) // TODO: Confirm for pets, as per Bandage's script.
                {
                    from.SendLocalizedMessage(
                        1010395
                        ); // The veil of death in this area is too strong and resists thy efforts to restore life.
                    return;
                }

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

                double decreaseAmount;

                if (from == m_Pet.ControlMaster)
                {
                    decreaseAmount = 0.1;
                }
                else
                {
                    decreaseAmount = 0.2;
                }

                for (var i = 0; i < m_Pet.Skills.Length; ++i) // Decrease all skills on pet.
                {
                    m_Pet.Skills[i].Base -= decreaseAmount;
                }

                if (!m_Pet.IsDeadPet && m_HitsScalar > 0)
                {
                    m_Pet.Hits = (int)(m_Pet.HitsMax * m_HitsScalar);
                }
            }
        }
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (m_Pet.Deleted || !m_Pet.IsBonded || !m_Pet.IsDeadPet)
            {
                return;
            }

            Mobile from = state.Mobile;

            if (info.ButtonID == 1)
            {
                if (m_Pet.Map == null || !m_Pet.Map.CanFit(m_Pet.Location, 16, false, false))
                {
                    from.SendLocalizedMessage(503256);                       // You fail to resurrect the creature.
                    return;
                }
                else if (m_Pet.Region != null && m_Pet.Region.IsPartOf("Khaldun")) //TODO: Confirm for pets, as per Bandage's script.
                {
                    from.SendLocalizedMessage(1010395);                            // The veil of death in this area is too strong and resists thy efforts to restore life.
                    return;
                }

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

                int Penalty = m_Pet.CalculatePenalty(from);

                for (int i = 0; i < Penalty; ++i)
                {
                    m_Pet.Skills[Utility.RandomList(1, 16, 25, 26, 27, 30, 43, 46)].Base -= 0.1;
                }

                /*
                 *              double decreaseAmount;
                 *
                 *              if( from == m_Pet.ControlMaster )
                 *                      decreaseAmount = 0.1;
                 *              else
                 *                      decreaseAmount = 0.2;
                 *
                 *              for ( int i = 0; i < m_Pet.Skills.Length; ++i )	//Decrease all skills on pet.
                 *                      m_Pet.Skills[i].Base -= decreaseAmount;
                 */
                if (!m_Pet.IsDeadPet && m_HitsScalar > 0)
                {
                    m_Pet.Hits = (int)(m_Pet.HitsMax * m_HitsScalar);
                }
            }
        }
Exemple #11
0
        public void OnTick(BaseCreature lizard, Mobile owner)
        {
            if (lizard != null && lizard.Controlled)
            {
                lizard.Frozen = false;

                m_Timer.Stop();
                m_Timer = null;
            }
            else
            {
                lizard.FixedEffect(0x376A, 1, 32);
            }
        }
Exemple #12
0
        public void RezAPet(Mobile f, object t)
        {
            if (!(t is BaseCreature))
            {
                f.SendMessage("That's not a pet!");
                return;
            }

            BaseCreature c = t as BaseCreature;

            if (c == null)
            {
                return;
            }

            if (!c.Controlled)
            {
                f.SendMessage("That's not a pet!");
            }
            else if (c.ControlMaster != f)
            {
                f.SendMessage("That's not your pet!");
            }
            else if (!c.IsDeadPet)
            {
                f.SendMessage("That pet is already alive!");
            }
            else if (!c.InRange(this.GetWorldLocation(), 2))
            {
                f.SendMessage("Your pet need to be closer to the stone for the magic to work.");
            }
            else if (c.Map == null || !c.Map.CanFit(c.Location, 16, false, false))
            {
                f.SendLocalizedMessage(503256); // You fail to resurrect the creature.
            }
            else if (ChargePlayer((PlayerMobile)f))
            {
                c.PlaySound(0x214);
                c.FixedEffect(0x376A, 10, 16);
                c.ResurrectPet();

                for (int i = 0; i < c.Skills.Length; ++i)       //Decrease all skills on pet.
                {
                    c.Skills[i].Base -= 0.2;
                }
            }
        }
Exemple #13
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m is BaseCreature)
            {
                BaseCreature    bc      = m as BaseCreature;
                TrainingProfile profile = PetTrainingHelper.GetTrainingProfile(bc);

                if (bc.Controlled && bc.ControlMaster != null && bc.ControlMaster.InRange(bc.Location, 25) &&
                    !bc.IsBonded)
                {
                    bc.IsBonded = true;
                    bc.FixedEffect(0x375A, 10, 30);
                }
            }

            return(true);
        }
        public void DoAbilityDoubleStrike(BaseCreature target, Mobile attacker)
        {
            attacker.PublicOverheadMessage(MessageType.Label, 34, true, "Power flows through your veins.");

            IWeapon weapon = attacker.Weapon;

            target.PlaySound(0x3BB);
            target.FixedEffect(0x37B9, 244, 25);

            // Swing again:

            // If no combatant, wrong map, one of us is a ghost, or cannot see, or deleted, then stop combat
            if (target.Deleted || attacker.Deleted || target.Map != attacker.Map || !target.Alive ||
                !attacker.Alive || !attacker.CanSee(target))
            {
                attacker.Combatant = null;
                return;
            }

            if (weapon == null)
            {
                return;
            }

            if (!attacker.InRange(target, weapon.MaxRange))
            {
                return;
            }

            if (attacker.InLOS(target))
            {
                BaseWeapon.InDoubleStrike = true;
                attacker.RevealingAction();
                attacker.NextCombatTime   = Core.TickCount + (int)weapon.OnSwing(attacker, target).TotalMilliseconds;
                BaseWeapon.InDoubleStrike = false;
            }

            Experience++;
            if (Experience >= NextLevelExperience)
            {
                LevelUpDoubleStrike(_Owner);
            }

            NextUse = DateTime.UtcNow + CoolDown;
        }
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (m_Pet.Deleted || !m_Pet.IsBonded || !m_Pet.IsDeadPet)
            {
                return;
            }

            Mobile from = state.Mobile;

            if (info.ButtonID == 1)
            {
                if (m_Pet.Map == null || !m_Pet.Map.CanFit(m_Pet.Location, 16, CanFitFlags.requireSurface))
                {
                    from.SendLocalizedMessage(503256);                       // You fail to resurrect the creature.
                    return;
                }

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

//				double decreaseAmount;

//				if( from == m_Pet.ControlMaster )
//					decreaseAmount = 0.1;
//				else
//					decreaseAmount = 0.2;

//				for ( int i = 0; i < m_Pet.Skills.Length; ++i )	//Decrease all skills on pet.
//					m_Pet.Skills[i].Base -= decreaseAmount;

                if (m_Pet.BondedDeadPetStatLossTime > DateTime.Now)
                {
                    // Reduce all skills on pet by 10%
                    for (int i = 0; i < m_Pet.Skills.Length; ++i)
                    {
                        m_Pet.Skills[i].Base -= (m_Pet.Skills[i].Base * .1);
                    }
                }
            }
        }
            protected override void OnTarget(Mobile m, object obj)
            {
                if (obj is Mobile)
                {
                    Mobile mob = (Mobile)obj;

                    if (mob.IsDeadBondedPet)
                    {
                        BaseCreature bc = mob as BaseCreature;

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

                            bc.ResurrectPet();

                            m.SendMessage("Your pet has been resurrected.");
                        }
                    }
                }
            }
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (m_Pet.Deleted || !m_Pet.IsBonded || !m_Pet.IsDeadPet)
            {
                return;
            }

            Mobile from = state.Mobile;

            if (info.ButtonID == 1)
            {
                if (m_Pet.Map == null || !m_Pet.Map.CanFit(m_Pet.Location, 16, false, false))
                {
                    from.SendLocalizedMessage(503256); // You fail to resurrect the creature.
                }
                else if (m_Pet.Region != null && m_Pet.Region.IsPartOf("Khaldun"))
                {
                    from.SendLocalizedMessage(1010395);
                }
                // The veil of death in this area is too strong and resists thy efforts to restore life.
                else
                {
                    m_Pet.PlaySound(0x214);
                    m_Pet.FixedEffect(0x376A, 10, 16);
                    m_Pet.ResurrectPet();

                    double decreaseAmount = @from == m_Pet.ControlMaster ? 0.01 : 0.02;

                    for (int i = 0; i < m_Pet.Skills.Length; ++i) //Decrease all skills on pet.
                    {
                        m_Pet.Skills[i].Base -= (decreaseAmount * m_Pet.Skills[i].Base);
                    }

                    if (!m_Pet.IsDeadPet && m_HitsScalar > 0)
                    {
                        m_Pet.Hits = (int)(m_Pet.HitsMax * m_HitsScalar);
                    }
                }
            }
        }
Exemple #18
0
        public bool OnUsed(Mobile from, BaseCreature pet)
        {
            if (pet.GetStatMod("[Tasty Treat] Str") != null)
            {
                from.SendLocalizedMessage(1113051);                   // Your pet is still enjoying the last tasty treat!
                return(false);
            }
            else if (DateTime.Now < pet.NextTastyTreat)
            {
                from.SendLocalizedMessage(1113049);                   // Your pet is still recovering from the last tasty treat.
                return(false);
            }
            else
            {
                pet.SayTo(from, 1113050);                   // Your pet looks much happier.

                pet.FixedEffect(0x375A, 10, 15);
                pet.PlaySound(0x1E7);

                AddEffect(pet);

                pet.NextTastyTreat = DateTime.Now + Duration + Cooldown;

                if (this.Amount > 1)
                {
                    this.Amount -= 1;
                    from.Backpack.DropItem(this);
                }
                else
                {
                    Delete();
                }

                return(true);
            }
        }
Exemple #19
0
 private void ResurrectPet()
 {
     m_Follower.PlaySound(0x214);
     m_Follower.FixedEffect(0x376A, 10, 16);
     m_Follower.ResurrectPet();
 }
        public bool OnUsed( Mobile from, BaseCreature pet )
        {
            if ( m_UnderEffect.Contains( pet ) )
            {
                from.SendLocalizedMessage( 1113075 ); // Your pet is still under the effect of armor essence.
                return false;
            }
            else if ( DateTime.Now < pet.NextArmorEssence )
            {
                from.SendLocalizedMessage( 1113076 ); // Your pet is still recovering from the last armor essence it consumed.
                return false;
            }
            else
            {
                pet.SayTo( from, 1113050 ); // Your pet looks much happier.

                pet.FixedEffect( 0x375A, 10, 15 );
                pet.PlaySound( 0x1E7 );

                List<ResistanceMod> mods = new List<ResistanceMod>();

                mods.Add( new ResistanceMod( ResistanceType.Physical, 15 ) );
                mods.Add( new ResistanceMod( ResistanceType.Fire, 10 ) );
                mods.Add( new ResistanceMod( ResistanceType.Cold, 10 ) );
                mods.Add( new ResistanceMod( ResistanceType.Poison, 10 ) );
                mods.Add( new ResistanceMod( ResistanceType.Energy, 10 ) );

                for ( int i = 0; i < mods.Count; i++ )
                    pet.AddResistanceMod( mods[i] );

                m_UnderEffect.Add( pet );

                Timer.DelayCall( Duration, new TimerCallback(
                    delegate
                    {
                        for ( int i = 0; i < mods.Count; i++ )
                            pet.RemoveResistanceMod( mods[i] );

                        m_UnderEffect.Remove( pet );
                    } ) );

                pet.NextArmorEssence = DateTime.Now + Duration + Cooldown;

                Delete();

                return true;
            }
        }
Exemple #21
0
 public override void OnClick()
 {
     m_Creature.PlaySound(0x214);
     m_Creature.FixedEffect(0x376A, 10, 16);
     m_Creature.ResurrectPet();
 }
Exemple #22
0
        public bool OnUsed( Mobile from, BaseCreature pet )
        {
            if ( pet.GetStatMod( "[Tasty Treat] Str" ) != null )
            {
                from.SendLocalizedMessage( 1113051 ); // Your pet is still enjoying the last tasty treat!
                return false;
            }
            else if ( DateTime.Now < pet.NextTastyTreat )
            {
                from.SendLocalizedMessage( 1113049 ); // Your pet is still recovering from the last tasty treat.
                return false;
            }
            else
            {
                pet.SayTo( from, 1113050 ); // Your pet looks much happier.

                pet.FixedEffect( 0x375A, 10, 15 );
                pet.PlaySound( 0x1E7 );

                AddEffect( pet );

                pet.NextTastyTreat = DateTime.Now + Duration + Cooldown;

                if ( this.Amount > 1 )
                {
                    this.Amount -= 1;
                    from.Backpack.DropItem( this );
                }
                else
                {
                    Delete();
                }

                return true;
            }
        }
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (m_Pet.Deleted || !m_Pet.IsBonded || !m_Pet.IsDeadPet)
            {
                return;
            }

            Mobile from = state.Mobile;

            if (info.ButtonID == 1)
            {
                if (m_Pet.Map == null || !m_Pet.Map.CanFit(m_Pet.Location, 16, false, false))
                {
                    from.SendLocalizedMessage(503256);                       // You fail to resurrect the creature.
                    return;
                }
                else if (m_Pet.Region != null && m_Pet.Region.IsPartOf("Khaldun")) //TODO: Confirm for pets, as per Bandage's script.
                {
                    from.SendLocalizedMessage(1010395);                            // The veil of death in this area is too strong and resists thy efforts to restore life.
                    return;
                }

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

                #region SA
                if (m_Healer != null)
                {
                    int         toheal = 0;
                    VirtueLevel level  = VirtueHelper.GetLevel(m_Healer, VirtueName.Compassion);

                    switch (level)
                    {
                    case VirtueLevel.Seeker: toheal = AOS.Scale(m_Pet.HitsMax, 5); break;

                    case VirtueLevel.Follower: toheal = AOS.Scale(m_Pet.HitsMax, 10); break;

                    case VirtueLevel.Knight: toheal = AOS.Scale(m_Pet.HitsMax, 20); break;
                    }

                    if (toheal > 200)
                    {
                        toheal = 200;
                    }

                    m_Pet.Hits = toheal;
                }
                #endregion

                double decreaseAmount;

                if (from == m_Pet.ControlMaster)
                {
                    decreaseAmount = 0.1;
                }
                else
                {
                    decreaseAmount = 0.2;
                }

                for (int i = 0; i < m_Pet.Skills.Length; ++i)                   //Decrease all skills on pet.
                {
                    m_Pet.Skills[i].Base -= decreaseAmount;
                }

                if (!m_Pet.IsDeadPet && m_HitsScalar > 0)
                {
                    m_Pet.Hits = (int)(m_Pet.HitsMax * m_HitsScalar);
                }
            }
        }
Exemple #24
0
        public static void OnVirtueUsed(Mobile from)
        {
            if (VirtueHelper.GetLevel(from, VirtueName.Humility) < VirtueLevel.Seeker)
            {
                from.SendLocalizedMessage(1155812); // You must be at least a Seeker of Humility to Invoke this ability.
            }
            else if (from.Alive)
            {
                from.SendLocalizedMessage(1155817); // Target the pet you wish to embrace with your Humility.
                from.BeginTarget(
                    10,
                    false,
                    TargetFlags.None,
                    (m, targeted) =>
                {
                    if (targeted is BaseCreature)
                    {
                        BaseCreature bc = (BaseCreature)targeted;

                        if (!bc.Alive)
                        {
                            from.SendLocalizedMessage(1155815);     // You cannot embrace Humility on the dead!
                        }
                        else if (VirtueHelper.GetLevel(m, VirtueName.Humility) < VirtueLevel.Seeker)
                        {
                            from.SendLocalizedMessage(1155812);     // You must be at least a Seeker of Humility to Invoke this ability.
                        }
                        else if (!bc.Controlled && !bc.Summoned)
                        {
                            from.SendLocalizedMessage(1155813);     // You can only embrace your Humility on a pet.
                        }
                        else if (ActiveTable.ContainsKey(bc))
                        {
                            from.SendLocalizedMessage(1156047);     // That pet has already embraced Humility.
                        }
                        else
                        {
                            VirtueHelper.Atrophy(from, VirtueName.Humility, 3200);

                            from.SendLocalizedMessage(1155818);     // You have lost some Humility.

                            ActiveTable[bc] = from;

                            m.PrivateOverheadMessage(
                                MessageType.Regular,
                                1150,
                                1155819,
                                from.NetState);     // *Your pet surges with the power of your Humility!*

                            bc.FixedEffect(0x373A, 10, 16);

                            BuffInfo.AddBuff(
                                from,
                                new BuffInfo(
                                    BuffIcon.Humility,
                                    1156049,
                                    1156050,
                                    TimeSpan.FromMinutes(20),
                                    from,
                                    string.Format("{0}\t{1}", bc.Name, GetRegenBonus(bc))));     // Pet: ~1_NAME~<br>+~2_VAL~ HPR<br>

                            CheckTimer();
                            bc.ResetStatTimers();

                            Timer.DelayCall(
                                TimeSpan.FromMinutes(20),
                                mob =>
                            {
                                if (mob != null && ActiveTable.ContainsKey(mob))
                                {
                                    Mobile user = ActiveTable[mob];
                                    ActiveTable.Remove(mob);

                                    BuffInfo.RemoveBuff(user, BuffIcon.Humility);

                                    user.PrivateOverheadMessage(
                                        MessageType.Regular,
                                        1150,
                                        1155823,
                                        from.NetState);         // *Your pet's power returns to normal*

                                    CheckTimer();
                                }
                            },
                                bc);
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1155813);     // You can only embrace your Humility on a pet.
                    }
                });
            }
        }
Exemple #25
0
        public void Target(Mobile m)
        {
            //STARTMOD
            if (m is BaseCreature)
            {
                BaseCreature m_Pet = (BaseCreature)m;

                if (m_Pet.IsDeadBondedPet)
                {
                    m_Pet.PlaySound(0x214);
                    m_Pet.FixedEffect(0x376A, 10, 16);
                    m_Pet.ResurrectPet();
                    Misc.Titles.AwardFame(Caster, 500, true);
                    return;
                }
            }
            //ENDMOD

            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (m == Caster)
            {
                Caster.SendLocalizedMessage(501039);                   // Thou can not resurrect thyself.
            }
            else if (!Caster.Alive)
            {
                Caster.SendLocalizedMessage(501040);                   // The resurrecter must be alive.
            }
            else if (m.Alive)
            {
                Caster.SendLocalizedMessage(501041);                   // Target is not dead.
            }
            else if (!Caster.InRange(m, 1))
            {
                Caster.SendLocalizedMessage(501042);                   // Target is not close enough.
            }
            else if (!m.Player)
            {
                Caster.SendLocalizedMessage(501043);                   // Target is not a being.
            }
            else if (m.Map == null || !m.Map.CanFit(m.Location, 16, false, false))
            {
                Caster.SendLocalizedMessage(501042);              // Target can not be resurrected at that location.
                m.SendLocalizedMessage(502391);                   // Thou can not be resurrected there!
            }
            else if (m.Region != null && m.Region.Name == "Khaldun")
            {
                Caster.SendLocalizedMessage(1010395);                   // The veil of death in this area is too strong and resists thy efforts to restore life.
            }
            else if (CheckBSequence(m, true))
            {
                SpellHelper.Turn(Caster, m);

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

                TAVUtilities.FindCorpse(m);

                if (Caster is TeiravonMobile)
                {
                    TeiravonMobile TAV = (TeiravonMobile)Caster;

                    int expTo = m.HitsMax * TAV.PlayerLevel / 2;

                    if (TAV.HasFeat(TeiravonMobile.Feats.HealersOath))
                    {
                        expTo *= 3;
                    }

                    if (Misc.Titles.AwardExp(TAV, expTo))
                    {
                        TAV.SendMessage("You have gained {0} experience.", expTo);
                    }
                    Misc.Titles.AwardFame(Caster, (int)(m.Fame * .1), true);
                }

                m.Resurrect();
                Misc.Titles.AwardFame(m, -(int)(m.Fame * .1), true);
            }

            FinishSequence();
        }