Inheritance: Item, IWeapon, IFactionItem, ICraftable, ISlayer, IDurability, ISetItem
コード例 #1
0
ファイル: CurseWeapon.cs プロジェクト: Jascen/UOSmart
 public ExpireTimer(BaseWeapon weapon, TimeSpan delay, object state)
     : base(delay)
 {
     m_Caster = (Mobile)state;
     this.m_Weapon = weapon;
     this.Priority = TimerPriority.OneSecond;
 }
コード例 #2
0
		// note that this method will be called when attached to either a mobile or a weapon
		// when attached to a weapon, only that weapon will do additional damage
		// when attached to a mobile, any weapon the mobile wields will do additional damage
		public override void OnWeaponHit(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven)
		{
			// if it is still refractory then return
			if (DateTime.UtcNow < m_EndTime)
			{
				return;
			}

			int damage = 0;

			if (m_Damage > 0)
			{
				damage = Utility.Random(m_Damage);
			}

			if (defender != null && attacker != null && damage > 0)
			{
				defender.BoltEffect(0);

				//SpellHelper.Damage( TimeSpan.Zero, defender, attacker, damage, 0, 0, 0, 0, 100 );
				SpellHelper.Damage(TimeSpan.FromSeconds(1.0), defender, attacker, damage);

				m_EndTime = DateTime.UtcNow + Refractory;
			}
		}
コード例 #3
0
ファイル: Warlock.cs プロジェクト: greeduomacro/hubroot
        public void Capacitor(Mobile attacker, Mobile defender, BaseWeapon weapon)
        {
            if (Level >= PerkLevel.Fourth)
            {
                if (!(weapon is Fists) && !(weapon is BaseRanged) && weapon is BaseWeapon && Utility.RandomDouble() <= 0.10)
                {
                    int element = Utility.RandomMinMax(1, 4);

                    switch (element)
                    {
                        case 1:
                            {
                                weapon.DoLightning(attacker, defender);
                                break;
                            }
                        case 2:
                            {
                                weapon.DoMagicArrow(attacker, defender);
                                break;
                            }
                        case 3:
                            {
                                weapon.DoHarm(attacker, defender);
                                break;
                            }
                        case 4:
                            {
                                weapon.DoFireball(attacker, defender);
                                break;
                            }

                    }
                }
            }
        }
コード例 #4
0
		// note that this method will be called when attached to either a mobile or a weapon
		// when attached to a weapon, only that weapon will do additional damage
		// when attached to a mobile, any weapon the mobile wields will do additional damage
		public override void OnWeaponHit(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven)
		{
			// if it is still refractory then return
			if (DateTime.UtcNow < m_EndTime)
			{
				return;
			}

			int drain = 0;

			if (m_Drain > 0)
			{
				drain = Utility.Random(m_Drain);
			}

			if (defender != null && attacker != null && drain > 0)
			{
				defender.Stam -= drain;
				if (defender.Stam < 0)
				{
					defender.Stam = 0;
				}

				attacker.Stam += drain;
				if (attacker.Stam < 0)
				{
					attacker.Stam = 0;
				}

				m_EndTime = DateTime.UtcNow + Refractory;
			}
		}
コード例 #5
0
ファイル: EnchantGump.cs プロジェクト: Crome696/ServUO
        public EnchantSpellGump(Mobile caster, Item scroll, BaseWeapon weapon)
            : base(20, 20)
        {
            m_Caster = caster;
            m_Scroll = scroll;
            m_Weapon = weapon;

            int font = 0x7FFF;

            AddBackground(0, 0, 170, 200, 9270);
            AddAlphaRegion(10, 10, 150, 180);

            AddHtmlLocalized(20, 22, 150, 16, 1080133, font, false, false); //Select Enchant

            AddButton(20, 50, 9702, 9703, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(45, 50, 200, 16, 1079705, font, false, false); //Hit Lighting

            AddButton(20, 75, 9702, 9703, 2, GumpButtonType.Reply, 0);
            AddHtmlLocalized(45, 75, 200, 16, 1079703, font, false, false); //Hit Fireball

            AddButton(20, 100, 9702, 9703, 3, GumpButtonType.Reply, 0);
            AddHtmlLocalized(45, 100, 200, 16, 1079704, font, false, false); //Hit Harm

            AddButton(20, 125, 9702, 9703, 4, GumpButtonType.Reply, 0);
            AddHtmlLocalized(45, 125, 200, 16, 1079706, font, false, false); //Hit Magic Arrow

            AddButton(20, 150, 9702, 9703, 5, GumpButtonType.Reply, 0);
            AddHtmlLocalized(45, 150, 200, 16, 1079702, font, false, false); //Hit Dispel
        }
コード例 #6
0
			private bool IsSpecialWeapon( BaseWeapon weapon )
			{
				// Weapons repairable but not craftable

				if ( m_CraftSystem is DefTinkering )
				{
					return ( weapon is Cleaver )
						|| ( weapon is Hatchet )
						|| ( weapon is Pickaxe )
						|| ( weapon is ButcherKnife )
						|| ( weapon is SkinningKnife );
				}
				else if ( m_CraftSystem is DefCarpentry )
				{
					return ( weapon is Club )
						|| ( weapon is BlackStaff )
						|| ( weapon is MagicWand );
				}
				else if ( m_CraftSystem is DefBlacksmithy )
				{
					return ( weapon is Pitchfork );
				}

				return false;
			}
コード例 #7
0
			public ImmolatingWeaponEntry( int damage, BaseWeapon weapon, TimeSpan duration )
			{
				Damage = damage;
				
				Timer = new ExpireTimer( weapon, duration );
				Timer.Start();
			}
コード例 #8
0
ファイル: XmlFire.cs プロジェクト: greeduomacro/UO-Forever
		// note that this method will be called when attached to either a mobile or a weapon
		// when attached to a weapon, only that weapon will do additional damage
		// when attached to a mobile, any weapon the mobile wields will do additional damage
		public override void OnWeaponHit(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven)
		{
			// if it is still refractory then return
			if (DateTime.UtcNow < m_EndTime)
			{
				return;
			}

			int damage = 0;

			if (m_Damage > 0)
			{
				damage = Utility.Random(m_Damage);
			}

			if (defender != null && attacker != null && damage > 0)
			{
				attacker.MovingParticles(defender, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
				attacker.PlaySound(0x15E);

				//SpellHelper.Damage( TimeSpan.Zero, defender, attacker, damage, 0, 100, 0, 0, 0 );
				SpellHelper.Damage(TimeSpan.FromSeconds(1.0), defender, attacker, damage);

				m_EndTime = DateTime.UtcNow + Refractory;
			}
		}
コード例 #9
0
ファイル: ZuluCombat.cs プロジェクト: notsentient/RunZHA
        public static int CombatHit(Mobile Attacker, Mobile Defender, BaseWeapon Weapon, bool UseHitscript)
        {
            bool ApplyDamage = true;

            int Damage = 0;

            if (Weapon is BaseRanged)
                Damage = RangedHit(Attacker, Defender, Weapon, UseHitscript);
            else if (Weapon is BaseMeleeWeapon)
                Damage = MeleeHit(Attacker, Defender, Weapon);

            //(100-weaponType.Speed)/10

            //long Ticks = ((100 - Weapon.Speed) / 10) * TimeSpan.TicksPerMillisecond;

            if (UseHitscript)
            {
                ApplyDamage = HitscriptManager.Run(Weapon.Hitscript, Attacker, Defender, Weapon, ref Damage);
            }

            if (!ApplyDamage)
                Damage = 0;
            //Timer.DelayCall(new TimeSpan(Ticks), new TimerStateCallback(ApplyCombatDamage), Damage);

            if (Damage < 0)
                Damage = 0;

            Attacker.SendMessage("Returning Damage is {0}", Damage);

            return Damage;
        }
コード例 #10
0
		public SlayerSelectWeaponGump( BaseWeapon item ) : base( 0, 0 )
		{
			m_Item = item;

			this.Closable=true;
			this.Disposable=true;
			this.Dragable=true;
			this.Resizable=false;

			AddPage(0);
			AddBackground(131, 90, 185, 292, 9200);
			AddAlphaRegion(137, 96, 172, 25);
			AddAlphaRegion(137, 130, 172, 247);
			AddHtml( 137, 96, 172, 25, @"<BASEFONT COLOR=#FFFFFF><CENTER>Select A Slayer</CENTER></BASEFONT>", (bool)false, (bool)false);
			AddButton(145, 140, 4023, 4024, 1, GumpButtonType.Reply, 0);
			AddLabel(180, 140, 1152, @"Repond Slayer");
			AddButton(145, 170, 4023, 4024, 2, GumpButtonType.Reply, 0);
			AddLabel(180, 170, 1152, @"Reptile Slayer");
			AddButton(145, 200, 4023, 4024, 3, GumpButtonType.Reply, 0);
			AddLabel(180, 200, 1152, @"Demon Slayer");
			AddButton(145, 230, 4023, 4024, 4, GumpButtonType.Reply, 0);
			AddLabel(180, 230, 1152, @"Elemental Slayer");
			AddButton(145, 260, 4023, 4024, 5, GumpButtonType.Reply, 0);
			AddLabel(180, 260, 1152, @"Undead Slayer");
			AddButton(145, 290, 4023, 4024, 6, GumpButtonType.Reply, 0);
			AddLabel(180, 290, 1152, @"Arachnid Slayer");
			AddButton(145, 320, 4023, 4024, 7, GumpButtonType.Reply, 0);
			AddLabel(180, 320, 1152, @"Fey Slayer");
		}
コード例 #11
0
        public static bool Run(Mobile Attacker, Mobile Defender, BaseWeapon Weapon, ref int BaseDamage)
        {
            Effects.SendLocationParticles(EffectItem.Create(Defender.Location, Defender.Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 5042);
            Effects.PlaySound(Defender, Defender.Map, 0x201);

            bool Summoned = false;

            if (Defender is BaseCreature)
            {
                BaseCreature Creature = Defender as BaseCreature;
                Summoned = Creature.Summoned;
                if (Summoned)
                {
                    if(Attacker.NetState != null)
                        Attacker.PrivateOverheadMessage(Server.Network.MessageType.Regular, 0x03B2, true,
                            "Your weapon causes the creature to dissipate on impact!", Attacker.NetState);

                    Creature.Delete();
                    return true;
                }
            }

            ZuluUtil.WipeMods(Defender);

            Defender.Mana = 0;

            if (Weapon.DamageLevel == WeaponDamageLevel.Regular)
                BaseDamage += ZuluCombat.GetDamageLevel(WeaponDamageLevel.Devastation);

            return true;
        }
コード例 #12
0
ファイル: Monk.cs プロジェクト: greeduomacro/hubroot
        public void ShenStrike(Mobile attacker, Mobile defender, BaseWeapon weapon)
        {
            if (Level >= PerkLevel.Fifth)
            {
                if (weapon is Fists && Utility.RandomDouble() <= 0.10)
                {
                    int element = Utility.RandomMinMax(2, 4);

                    switch (element)
                    {
                        case 1:
                            {
                                weapon.DoLightning(attacker, defender);
                                break;
                            }
                        case 2:
                            {
                                weapon.DoMagicArrow(attacker, defender);
                                break;
                            }
                        case 3:
                            {
                                weapon.DoHarm(attacker, defender);
                                break;
                            }
                        case 4:
                            {
                                weapon.DoFireball(attacker, defender);
                                break;
                            }

                    }
                }
            }
        }
コード例 #13
0
		public override int OnHit( BaseWeapon weapon, int damageTaken )
		{
			if( weapon is PBWeapon )
				HitPoints -= 1;
			if( HitPoints == 0 )
				Hue = weapon.Hue;
			return 0;
		}
コード例 #14
0
ファイル: ImmolatingWeapon.cs プロジェクト: Ravenwolfe/xrunuo
        public static int GetImmolatingDamage( BaseWeapon w )
        {
            ImmolatingWeaponEntry iEntry = m_Table[w] as ImmolatingWeaponEntry;

            if ( iEntry != null )
                return iEntry.m_Damage;

            return 0;
        }
コード例 #15
0
		// note that this method will be called when attached to either a mobile or a weapon
		// when attached to a weapon, only that weapon will do additional damage
		// when attached to a mobile, any weapon the mobile wields will do additional damage
		public override void OnWeaponHit(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven)
		{
			// if it is still refractory then return
			if (DateTime.UtcNow < m_EndTime)
			{
				return;
			}

			if (m_Chance <= 0 || Utility.Random(100) > m_Chance)
			{
				return;
			}

			if (defender != null && attacker != null)
			{
				// spawn a minion
				object o = null;
				try
				{
					o = Activator.CreateInstance(SpawnerType.GetType(m_Minion));
				}
				catch
				{ }

				if (o is BaseCreature)
				{
					BaseCreature b = o as BaseCreature;
					b.MoveToWorld(attacker.Location, attacker.Map);

					if (attacker is PlayerMobile)
					{
						b.Controlled = true;
						b.ControlMaster = attacker;
					}

					b.Combatant = defender;

					// add it to the list of controlled mobs
					MinionList.Add(b);
				}
				else
				{
					if (o is Item)
					{
						((Item)o).Delete();
					}
					if (o is Mobile)
					{
						((Mobile)o).Delete();
					}
					// bad minion specification so delete the attachment
					Delete();
				}

				m_EndTime = DateTime.UtcNow + Refractory;
			}
		}
コード例 #16
0
ファイル: EnchantSpell.cs プロジェクト: Ravenwolfe/xrunuo
        public EnchantContext( GenericReader reader, BaseWeapon weapon )
        {
            m_Owner = reader.ReadMobile();
            m_Attribute = (WeaponAttribute) reader.ReadInt();
            m_SpellChanneling = reader.ReadBool();
            m_Timer = Timer.DelayCall( reader.ReadTimeSpan(), new TimerStateCallback<BaseWeapon>( EnchantSpell.RemoveEnchantContext ), weapon );

            weapon.EnchantContext = this;
        }
コード例 #17
0
		public void Use( Mobile from, BaseWeapon weapon )
		{
			BeginSwing();

			from.Direction = from.GetDirectionTo( GetWorldLocation() );
			weapon.PlaySwingAnimation( from );

			from.CheckSkill( weapon.Skill, m_MinSkill, m_MaxSkill );
		}
コード例 #18
0
ファイル: ImmolatingWeapon.cs プロジェクト: nathanvy/runuo
        public static int GetImmolatingDamage( BaseWeapon weapon )
        {
            ImmolatingWeaponEntry entry;

            if ( m_WeaponDamageTable.TryGetValue( weapon, out entry ) )
                return entry.m_Damage;

            return 0;
        }
コード例 #19
0
		public static int GetDamage( BaseWeapon weapon )
		{
			ImmolatingWeaponEntry entry = m_Table[ weapon ] as ImmolatingWeaponEntry;

			if( entry != null )
				return entry.Damage;

			return 0;
		}
コード例 #20
0
ファイル: Dragoon.cs プロジェクト: greeduomacro/hubroot
        public double LongArm(BaseWeapon weapon) 
        {
            if (Level >= PerkLevel.Fourth)
            {
                if (weapon.Layer == Layer.TwoHanded)
                    return 0.33;
            }

            return 0;
        }
コード例 #21
0
        public override void OnWeaponHit(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven)
        {
            if( Duration <= 0.0 || Chance < 1 || defender.Paralyzed )
                return;

            if( Chance >= Utility.RandomMinMax(0, 100) )
            {
                XmlAttach.AttachTo( defender, new XmlFreeze(Duration) );
                defender.PlaySound( 516 );
            }
        }
コード例 #22
0
ファイル: Marksman.cs プロジェクト: greeduomacro/hubroot
        public int QuickDraw(BaseWeapon weapon)
        {
            if (Level >= PerkLevel.Fourth)
            {
                if (weapon is BaseRanged)
                {                 
                    return 25;
                }
            }             

            return 0;
        }
コード例 #23
0
ファイル: Pugilist.cs プロジェクト: ITLongwell/Ulmeta
        public int Brawler(BaseWeapon weapon)
        {
            if (Level >= PerkLevel.Third)
            {
                if (weapon is Fists)
                {
                    return 25;
                }
            }

            return 0;
        }
コード例 #24
0
ファイル: CombateUtil.cs プロジェクト: evildude807/kaltar
        /**
         * Evento que ocorre quando um arco é equipado. Mesmo que seja um BaseWeapon, ainda nao fiz para as
         * demais armas.
         */
        public int alcanceBonus(Jogador jogador, BaseWeapon arma)
        {
            int bonus = 0;

            //Tiago, trocar pelo nome da habilidade correta
            if (jogador.getSistemaTalento().possuiHabilidadeTalento(IdHabilidadeTalento.olhosDeAguia))
            {
                bonus += 2;
            }

            return bonus;
        }
コード例 #25
0
ファイル: EnchantSpell .cs プロジェクト: g4idrijs/ServUO
        public static void AddEffects(Mobile from, BaseWeapon weapon)
        {
            if (m_EffectTable == null)
                m_EffectTable = new Dictionary<Mobile, List<BaseWeapon>>();

            if (!m_EffectTable.ContainsKey(from))
            {
                m_EffectTable[from] = new List<BaseWeapon>();
                m_EffectTable[from].Add(weapon);
            }
            else if (!m_EffectTable[from].Contains(weapon))
                m_EffectTable[from].Add(weapon);
        }
コード例 #26
0
ファイル: Legionnaire.cs プロジェクト: greeduomacro/hubroot
        /// <summary>
        /// Applies a 20% chance to dodge weapon attacks at <code>PerkLevel.Third</code>
        /// </summary>
        public bool TryDodge( BaseWeapon weapon )
        {
            if (Level >= PerkLevel.Second && ShieldEquipped)
            {
                if (Utility.RandomDouble() < 0.20)
                {
                    Player.SendMessage("You side-step your opponents attack, leading them through with your shield.");
                    return true;
                }
            }

            return false;
        }
コード例 #27
0
 public void PunchMongbat(Mobile from, BaseWeapon weapon)
 {
     if (!from.InRange(this, 1))
     {
         from.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "You are too far away to punch that thing.");
         return;
     }
     else
     {
         from.Direction = from.GetDirectionTo(GetWorldLocation());
         weapon.PlaySwingAnimation(from);
         Timer.DelayCall(TimeSpan.FromSeconds(0.75), new TimerCallback(OnMongbatPunch));
     }
 }
コード例 #28
0
        public static bool Run(ZuluHitscript Hitscript, Mobile Attacker, Mobile Defender, BaseWeapon Weapon, ref int BaseDamage)
        {
            bool RunDamage = true;

            try
            {
                Call HitscriptCall = HitscriptCalls[(int)Hitscript];

                HitscriptCall(Attacker, Defender, Weapon, ref BaseDamage);
            }
            catch { Console.WriteLine("Couldnt run hitscript {0}", Hitscript); }

            return RunDamage;
        }
コード例 #29
0
        public override void OnWeaponHit( Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven )
        {
            if( Damage < 1 || Chance < 1 )
                return;

            if( Chance >= Utility.RandomMinMax( 0, 100 ) )
            {
                if( Damage > 0 )
                {
                    SpellHelper.Damage( TimeSpan.Zero, defender, attacker, Damage, 0, 0, 0, 0, 100 );
                    defender.BoltEffect( 0 );
                }
            }
        }
コード例 #30
0
ファイル: ImmolatingWeapon.cs プロジェクト: Ravenwolfe/xrunuo
        public static void EndImmolating( BaseWeapon weapon, bool playSound )
        {
            ImmolatingWeaponEntry iEntry = m_Table[weapon] as ImmolatingWeaponEntry;

            if ( iEntry != null )
            {
                iEntry.m_Timer.Stop();

                if ( playSound )
                    iEntry.m_Owner.PlaySound( 0x27 );
            }

            weapon.Immolating = false;
            m_Table.Remove( weapon );
        }