Exemplo n.º 1
0
        public override void OnCast()
        {
            if( CheckSequence() )
            {
                ArrayList targets = new ArrayList();

                foreach ( Mobile m in Caster.GetMobilesInRange( 3 ) )
                {
                    if ( Caster.CanBeBeneficial( m, false, true ) && !(m is Golem) )
                        targets.Add( m );
                }

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

                    int amount = (int)( Caster.Skills[SkillName.Musicianship].Base * 0.1 );
                    string str = "str";

                    double duration = ( Caster.Skills[SkillName.Musicianship].Base * 0.15 );

                    StatMod mod = new StatMod( StatType.Str, str, + amount, TimeSpan.FromSeconds( duration ) );

                    m.AddStatMod( mod );

                    m.FixedParticles( 0x375A, 10, 15, 5017, 0x224, 3, EffectLayer.Waist );
                }
            }

            FinishSequence();
        }
Exemplo n.º 2
0
		private void DefineMods()
		{
			m_SkillMod0 = new DefaultSkillMod( SkillName.Magery, true, 20 ); 
			m_SkillMod1 = new DefaultSkillMod( SkillName.EvalInt, true, 20 ); 
			m_SkillMod2 = new DefaultSkillMod( SkillName.Necromancy, true, 20 ); 
                        		m_SkillMod3 = new DefaultSkillMod( SkillName.Inscribe, true, 20 );
			m_StatMod0 = new StatMod( StatType.Int, "MasterSandals", 20, TimeSpan.Zero ); 
		}
Exemplo n.º 3
0
		private void DefineMods()
		{
			m_SkillMod0 = new DefaultSkillMod( SkillName.Stealth, true, 20 ); 
			m_SkillMod1 = new DefaultSkillMod( SkillName.Hiding, true, 20 ); 
			m_SkillMod2 = new DefaultSkillMod( SkillName.Stealing, true, 20 );
                        		m_SkillMod3 = new DefaultSkillMod( SkillName.Fencing, true, 20 );  
			m_StatMod0 = new StatMod( StatType.Dex, "RogueSandals", 15, TimeSpan.Zero ); 
		}
Exemplo n.º 4
0
		private void DefineMods()
		{
			m_SkillMod0 = new DefaultSkillMod( SkillName.Archery, true, 20 );
			m_SkillMod1 = new DefaultSkillMod( SkillName.Tactics, true, 20 );
			m_SkillMod2 = new DefaultSkillMod( SkillName.Anatomy, true, 20 );
			m_StatMod0 = new StatMod( StatType.Dex, "ArcheryPvPDex", 20, TimeSpan.Zero );
			m_StatMod1 = new StatMod( StatType.Str, "ArcheryPvPStr", 20, TimeSpan.Zero );
		}
        public override void OnAdded(object parent)
        {
            if (parent is Mobile)
            {
                Mobile from = (Mobile)parent;

                m_StatMod90 = new StatMod(StatType.Int, "MOD90", -1000, TimeSpan.Zero);
                from.AddStatMod(m_StatMod90);
            }
            base.OnAdded(parent);
        }
Exemplo n.º 6
0
        public StatMod GetStatMod(string name)
        {
            for (int i = 0; i < m_StatMods.Count; ++i)
            {
                StatMod check = m_StatMods[i];

                if (check.Name == name)
                {
                    return(check);
                }
            }

            return(null);
        }
Exemplo n.º 7
0
        public bool RemoveStatMod(string name)
        {
            for (int i = 0; i < m_StatMods.Count; ++i)
            {
                StatMod check = m_StatMods[i];

                if (check.Name == name)
                {
                    m_StatMods.RemoveAt(i);
                    CheckStatTimers();
                    Delta(MobileDelta.Stat | GetStatDelta(check.Type));
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 8
0
        public void AddStatMod(StatMod mod)
        {
            for (int i = 0; i < m_StatMods.Count; ++i)
            {
                StatMod check = m_StatMods[i];

                if (check.Name == mod.Name)
                {
                    Delta(MobileDelta.Stat | GetStatDelta(check.Type));
                    m_StatMods.RemoveAt(i);
                    break;
                }
            }

            m_StatMods.Add(mod);
            Delta(MobileDelta.Stat | GetStatDelta(mod.Type));
            CheckStatTimers();
        }
Exemplo n.º 9
0
        protected override void OnTarget(Mobile from, object target)
        {
            if (target is Mobile && target != from)
            {
                Mobile defender = target as Mobile;
                Mobile attacker = from;

                attacker.SendLocalizedMessage(1060165);
                defender.SendLocalizedMessage(1060166);

                defender.PlaySound(0x213);
                defender.FixedParticles(0x377A, 1, 32, 9949, 1153, 0, EffectLayer.Head);

                Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(defender.X, defender.Y, defender.Z + 10), defender.Map), new Entity(Serial.Zero, new Point3D(defender.X, defender.Y, defender.Z + 20), defender.Map), 0x36FE, 1, 0, false, false, 1133, 3, 9501, 1, 0, EffectLayer.Waist, 0x100);

                int damage = 10; // Base

                if (defender.HitsMax > 0)
                {
                    double hitsPercent = ((double)defender.Hits / (double)defender.HitsMax) * 100.0;

                    double manaPercent = 0;

                    if (defender.ManaMax > 0)
                        manaPercent = ((double)defender.Mana / (double)defender.ManaMax) * 100.0;

                    damage += Math.Min((int)(Math.Abs(hitsPercent - manaPercent) / 4), 20);
                }

                defender.Damage(damage + Utility.RandomMinMax(4, 8), attacker);
                attacker.DoHarmful(defender);

                StatMod intLoss = new StatMod(StatType.Int, "intloss", defender.Int / 3, TimeSpan.FromSeconds(30));
                defender.AddStatMod(intLoss);

                ((Player)from).NextRaceAbility = TimeSpan.FromMinutes(0.5);
            }

            else
            {
                from.SendMessage("You can not attack that.");
            }
        }
Exemplo n.º 10
0
        public override bool Use(Mobile from)
        {
            if (from.BeginAction(typeof(ClarityPotion)))
            {
                int amount = Utility.Dice(3, 3, 3);
                int time   = Utility.RandomMinMax(5, 30);

                from.PlaySound(0x2D6);

                if (from.Body.IsHuman)
                {
                    from.Animate(34, 5, 1, true, false, 0);
                }

                from.FixedParticles(0x375A, 10, 15, 5011, EffectLayer.Head);
                from.PlaySound(0x1EB);

                StatMod mod = from.GetStatMod("Concussion");

                if (mod != null)
                {
                    from.RemoveStatMod("Concussion");
                    from.Mana -= mod.Offset;
                }

                from.PlaySound(0x1EE);
                from.AddStatMod(new StatMod(StatType.Int, "clarity-potion", amount, TimeSpan.FromMinutes(time)));

                Timer.DelayCall(TimeSpan.FromMinutes(time), delegate()
                {
                    from.EndAction(typeof(ClarityPotion));
                });

                return(true);
            }

            return(false);
        }
Exemplo n.º 11
0
        /// <summary>
        /// Computes the total modified offset for the specified stat type. Expired <see cref="StatMod" /> instances are removed.
        /// </summary>
        public int GetStatOffset(StatType type)
        {
            int offset = 0;

            for (int i = 0; i < m_StatMods.Count; ++i)
            {
                StatMod mod = m_StatMods[i];

                if (mod.HasElapsed())
                {
                    m_StatMods.RemoveAt(i);
                    Delta(MobileDelta.Stat | GetStatDelta(mod.Type));
                    CheckStatTimers();

                    --i;
                }
                else if ((mod.Type & type) != 0)
                {
                    offset += mod.Offset;
                }
            }

            return(offset);
        }
Exemplo n.º 12
0
        public void AddStatMod( StatMod mod )
        {
            if (m_StatMods == null)
                m_StatMods = new ArrayList(4);

            for ( int i = 0; i < m_StatMods.Count; ++i )
            {
                StatMod check = (StatMod)m_StatMods[i];

                if ( check.Name == mod.Name )
                {
                    Delta( MobileDelta.Stat | GetStatDelta( check.Type ) );
                    m_StatMods.RemoveAt( i );
                    break;
                }
            }

            m_StatMods.Add( mod );
            Delta( MobileDelta.Stat | GetStatDelta( mod.Type ) );
            CheckStatTimers();
        }
Exemplo n.º 13
0
        /**
         * Evento invocado quando uma criatura é invocada por um jogador.
         */
        public void OnSummon(Jogador caster, BaseCreature creature, ref Point3D p, ref TimeSpan duration)
        {
            SistemaTalento st = caster.getSistemaTalento();

            //Aumenta o duração
            if (st.possuiHabilidadeTalento(IdHabilidadeTalento.conjuracaoExtendida))
            {
                caster.SendMessage("Duracao normal: {0}", duration);

                double totalDuracaoSegundos = duration.TotalSeconds * 1.5;
                duration = TimeSpan.FromSeconds(totalDuracaoSegundos);

                caster.SendMessage("Duracao alterada: {0}", duration);
            }

            //Aumenta a resistencia das conjurações
            if (st.possuiHabilidadeTalento(IdHabilidadeTalento.conjuracaoResistente))
            {
                creature.AddResistanceMod(new ResistanceMod(ResistanceType.Cold, 5));
                creature.AddResistanceMod(new ResistanceMod(ResistanceType.Energy, 5));
                creature.AddResistanceMod(new ResistanceMod(ResistanceType.Fire, 5));
                creature.AddResistanceMod(new ResistanceMod(ResistanceType.Physical, 5));
                creature.AddResistanceMod(new ResistanceMod(ResistanceType.Poison, 5));

                caster.SendMessage("Bonus resistencia");
            }

            //Aumenta os atributos da conjuração
            if (st.possuiHabilidadeTalento(IdHabilidadeTalento.conjuracaoResistente))
            {
                HabilidadeNode node = st.getHabilidades()[IdHabilidadeTalento.conjuracaoResistente];

                StatMod statusBonus = new StatMod(StatType.All, "TalentoConjuracaoForte", node.Nivel * 10, TimeSpan.FromDays(99));
                creature.AddStatMod(statusBonus);

                caster.SendMessage("Bonus Status");
            }
        }
Exemplo n.º 14
0
        public void AddVampireStatMod( StatMod mod )
        {
            AddStatMod( mod );

            if( mod.Offset > 0 )
            {

                if( mod.Type == StatType.StamMax )
                    Stam += mod.Offset;
                else if( mod.Type == StatType.ManaMax )
                    Mana += mod.Offset;
            }
        }
Exemplo n.º 15
0
     		public override void OnDoubleClick( Mobile from ) 
		{ 
			VampGloves gloves = from.FindItemOnLayer( Layer.Gloves ) as VampGloves;
			VampHelm helm = from.FindItemOnLayer( Layer.Helm ) as VampHelm;
			VampLegs legs = from.FindItemOnLayer( Layer.Pants ) as VampLegs;
			VampArms arms = from.FindItemOnLayer( Layer.Arms ) as VampArms;
			VampGorget gorget = from.FindItemOnLayer( Layer.Neck ) as VampGorget;
			VampEarrings earrings = from.FindItemOnLayer( Layer.Earrings ) as VampEarrings;
			VampRing ring = from.FindItemOnLayer( Layer.Ring ) as VampRing;
			VampBracelet bracelet = from.FindItemOnLayer( Layer.Bracelet ) as VampBracelet;

                        if ( Parent != from ) 
                        { 
                                from.SendMessage( "The Shroud of Dracula must be equiped to be used." ); 
                        } 

			else if ( from.Mounted == true )
			{
				from.SendMessage( "You cannot be mounted while trying to transform!" );
			}

			else if ( gloves == null || helm == null || legs == null || arms == null || gorget == null || earrings == null || ring == null || bracelet == null )
			{
				from.SendMessage( "You must have all the pieces of the Vampire equiped to transform!" );
			}

                        else if ( this.Transformed == false )
                        { 
				
				LootType = LootType.Blessed;
               			from.SendMessage( "You pull the hood over your head." );
				from.PlaySound( 0x220 );
				//from.Title = "the True Vampire";
				from.BodyMod = 146;
				from.NameHue = 39;
				from.HueMod = 1;
				from.DisplayGuildTitle = false; 
				this.Transformed = true; 
				ItemID = 9860;
				from.RemoveItem(this);
              			from.EquipItem(this);

				m_StatMod0 = new StatMod( StatType.Str, "MOD0", 25, TimeSpan.Zero );
				m_StatMod1 = new StatMod( StatType.Int, "MOD1", 25, TimeSpan.Zero );
				m_StatMod2 = new StatMod( StatType.Dex, "MOD2", 25, TimeSpan.Zero );
				from.AddStatMod( m_StatMod0 );
				from.AddStatMod( m_StatMod1 );
				from.AddStatMod( m_StatMod2 );
                        
			}
			else
			{
				from.SendMessage( "You lower the hood." );
				from.PlaySound( 0x220 );
				//from.Title = null;
				from.BodyMod = 0x0;
				from.NameHue = -1;
				from.HueMod = -1;
				from.DisplayGuildTitle = true;
				this.Transformed = false;
				ItemID = 0x1F03;
				from.RemoveItem(this);
              			from.EquipItem(this);
				from.RemoveStatMod( "MOD0" );
				from.RemoveStatMod( "MOD1" );
				from.RemoveStatMod( "MOD2" );
			}
		}
Exemplo n.º 16
0
		public virtual void BladeBlessing_OnTarget( Mobile from, object target )
		{
			if( !from.CanSee( target ) )
			{
				from.SendLocalizedMessage( 500237 ); //Target cannot be seen.
			}
			else if( target is BaseWeapon )
			{
				BaseWeapon wep = (BaseWeapon)target;
				
				wep.MaxHitPoints += Utility.RandomMinMax( 80, 120 );
				wep.HitPoints = wep.MaxHitPoints;
				wep.LootType = LootType.Blessed;
				
				from.FixedParticles( 0x373A, 10, 15, 5018, EffectLayer.Waist );
				from.PlaySound( 0x1EA );
				
				this.Delete();
			}
			else if( target is Mobile )
			{
				Mobile m = (Mobile)target;
				PlayerMobile pm = (PlayerMobile)m;
				
				if( pm.Karma >= 1500 )
				{
					m_StatMod0 = new StatMod( StatType.All, "statbonus", 15, TimeSpan.FromMinutes( 5 ) );
					pm.AddStatMod( m_StatMod0 );
					
					m_TimedSkillMod0 = new TimedSkillMod( SkillName.Tactics, true, 10, dateTime );
					from.AddSkillMod( m_TimedSkillMod0 );
					
					this.Delete();
				}
				else
				{
					from.SendMessage( "You are not worthy of this blessing." );
				}
			}
			else
			{
				from.SendMessage( "This spell would not work on that." );
			}
		}
Exemplo n.º 17
0
        public void HandleVampireStatMod( StatMod mod, int offset, StatType type, string name )
        {
            if( mod != null && mod.Offset != offset )
            {
                RemoveStatMod( name );

                if( offset != 0 )
                    AddVampireStatMod( new StatMod( type, name, offset, TimeSpan.FromDays( 20 ) ) );
            }

            else if( mod == null && offset != 0 )
                AddVampireStatMod( new StatMod( type, name, offset, TimeSpan.FromDays( 20 ) ) );
        }
Exemplo n.º 18
0
		public void AddStatMod(StatMod mod)
		{
			for (int i = 0; i < m_StatMods.Count; ++i)
			{
				StatMod check = (StatMod)m_StatMods[i];

				if (check.Name == mod.Name)
				{
					Delta(MobileDelta.Stat | GetStatDelta(check.Type));
					m_StatMods.RemoveAt(i);
					break;
				}
			}

			m_StatMods.Add(mod);
			Delta(MobileDelta.Stat | GetStatDelta(mod.Type));
			CheckStatTimers();

			if (StatChange != null)
				StatChange(this, mod.Type);
		}