protected override void OnTick() { int damage = 2 + Utility.Random( 3 ); if (m_Target.Deleted || !m_Target.Alive) { DoExpire(); return; } m_Target.PlaySound( 0x133 ); m_Target.Damage( damage, m_Mobile ); m_Target.SendLocalizedMessage( 1070825 ); // The creature continues to rage! Blood blood = new Blood(); blood.ItemID = Utility.Random( 0x122A, 5 ); blood.MoveToWorld( m_Target.Location, m_Target.Map ); if ( m_Count >= m_CountMax ) { DoExpire(); return; } m_Count++; }
protected override void OnTick() { if( !LegalGrappling(attacker) || !LegalGrappling(defender) ) return; Blood blood = new Blood(); blood.ItemID = Utility.Random( 0x122A, 5 ); Map map = defender.Map; bool validLocation = false; Point3D loc = defender.Location; for( int i = 0; !validLocation && i < 10; i++ ) { int x = defender.X + Utility.RandomMinMax( 0, 2 ) - 1; int y = defender.Y + Utility.RandomMinMax( 0, 2 ) - 1; int z = map.GetAverageZ( x, y ); if( validLocation = map.CanFit( x, y, defender.Z, 16, false, false ) ) loc = new Point3D( x, y, defender.Z ); else if( validLocation = map.CanFit( x, y, z, 16, false, false ) ) loc = new Point3D( x, y, z ); } blood.MoveToWorld( loc, map ); defender.PlaySound( 0x133 ); defender.Damage( (int)( Math.Max( 10, Math.Min( 50, ( attacker.Str / 10 ) ) ) ), attacker ); if( attacker.MeleeAttackType != MeleeAttackType.PermanentGrapple ) reps--; if( reps < 1 || !LegalGrappling( attacker ) || !LegalGrappling( defender ) ) return; new GrappleTimer( attacker, defender, reps ).Start(); }
public static void DoBleed(Mobile m, Mobile from, int level, bool blooddrinker) { if (m.Alive) { int damage = Utility.RandomMinMax(level, level * 2); if (!m.Player) damage *= 2; m.PlaySound(0x133); AOS.Damage(m, from, damage, false, 0, 0, 0, 0, 0, 0, 100, false, false, false); if (blooddrinker && from.Hits < from.HitsMax) { from.SendLocalizedMessage(1113606); //The blood drinker effect heals you. from.Heal(damage); } Blood blood = new Blood(); blood.ItemID = Utility.Random(0x122A, 5); blood.MoveToWorld(m.Location, m.Map); } else { EndBleed(m, false); } }
public override void OnMovement(Mobile m, Point3D oldLocation) { if (DateTime.UtcNow >= LastSpit && m.InRange(Location, 6) && m.CanSee(this)) { PublicOverheadMessage(MessageType.Emote, 61, true, "*spits*"); Effects.PlaySound(m.Location, m.Map, 0x19C); Timer.DelayCall( TimeSpan.FromMilliseconds(100), () => { int bloodID = Utility.RandomMinMax(4650, 4655); new MovingEffectInfo(this, m, m.Map, bloodID, 60).MovingImpact( info => { var blood = new Blood { Name = "slime", ItemID = bloodID, Hue = 61 }; blood.MoveToWorld(info.Target.Location, info.Map); Effects.PlaySound(info.Target, info.Map, 0x028); }); }); LastSpit = DateTime.UtcNow + TimeSpan.FromSeconds(10); } base.OnMovement(m, oldLocation); }
public static void DoBleed( Mobile m, Mobile from, int level ) { if ( m.Alive ) { int damage = Utility.RandomMinMax( level, level * 2 ); if ( !m.IsPlayer ) damage *= 2; m.PlaySound( 0x133 ); m.Damage( damage, from ); Blood blood = new Blood(); blood.ItemID = Utility.Random( 0x122A, 5 ); blood.MoveToWorld( m.Location, m.Map ); BaseWeapon weapon = from.Weapon as BaseWeapon; if ( weapon != null && weapon.WeaponAttributes[WeaponAttribute.BloodDrinker] != 0 && from.Hits < from.HitsMax ) { from.FixedParticles( 0x375A, 1, 10, 0x1AE9, 0x21, 0x2, EffectLayer.Head ); from.SendLocalizedMessage( 1113606 ); // The blood drinker effect heals you. from.Hits += damage; } } else { EndBleed( m, false ); } }
public override void OnMovement(Mobile m, Point3D oldLocation) { if (DateTime.UtcNow >= NextSlime && Alive) { var blood = new Blood {Hue = 61}; blood.MoveToWorld(Location, Map); NextSlime = DateTime.UtcNow + TimeSpan.FromSeconds(2); } base.OnMovement(m, oldLocation); }
public static void DoBleed( Mobile m, Mobile from, int level ) { if ( m.Alive ) { m.PlaySound( 0x133 ); m.Damage( level, from ); Blood blood = new Blood(); blood.ItemID = Utility.Random( 0x122A, 5 ); blood.MoveToWorld( m.Location, m.Map ); } else EndBleed( m, false ); }
public override void ExecuteTrap( Mobile from ) { base.ExecuteTrap( from ); from.Damage( Utility.RandomMinMax( 20, 30 ), this.Owner ); Effects.SendMovingEffect( this.Door, from, 0xF42, 18, 1, false, false ); from.PlaySound( 0x234 ); Blood bl = new Blood(); bl.ItemID = Utility.Random( 0x122A, 5 ); bl.MoveToWorld( from.Location, from.Map ); }
public override void OnDoubleClick(Mobile from) { if (DateTime.UtcNow >= LastUsed && ParentEntity != null && ParentEntity == from) { int range = Utility.RandomMinMax(5, 7); int zOffset = from.Mounted ? 20 : 10; Point3D src = from.Location.Clone3D(0, 0, zOffset); var points = src.GetAllPointsInRange(from.Map, range, range); Effects.PlaySound(from.Location, from.Map, 0x19C); Timer.DelayCall( TimeSpan.FromMilliseconds(100), () => { foreach (Point3D trg in points) { int bloodID = Utility.RandomMinMax(4650, 4655); new MovingEffectInfo(src, trg.Clone3D(0, 0, 2), from.Map, bloodID).MovingImpact( info => { var blood = new Blood { ItemID = bloodID }; blood.MoveToWorld(info.Target.Location, info.Map); Effects.PlaySound(info.Target, info.Map, 0x028); }); } }); LastUsed = DateTime.UtcNow + TimeSpan.FromMinutes(30); } else if (ParentEntity == null || from != ParentEntity) { from.SendMessage(54, "You must be wearing this to use it."); return; } else { var nextuse = LastUsed - DateTime.UtcNow; from.SendMessage("You cannot use this again for another " + nextuse.Minutes + " minutes."); } base.OnDoubleClick(from); }
public static void DoBleed(Mobile m) { if (m.Alive) { m.PlaySound(0x133); Blood blood = new Blood(); blood.ItemID = Utility.Random(0x122A, 5); blood.MoveToWorld(m.Location, m.Map); } else { EndBleed(m, false); } }
public override void OnDoubleClick(Mobile from) { if (ParentEntity != null && ParentEntity == from) { from.PublicOverheadMessage(MessageType.Label, 54, true, "*You see " + from.Name + " rubbing his bracelet furiously*"); int range = Utility.RandomMinMax(5, 7); int zOffset = from.Mounted ? 20 : 10; Point3D src = from.Location.Clone3D(0, 0, zOffset); var points = src.GetAllPointsInRange(from.Map, 0, range); Effects.PlaySound(from.Location, from.Map, 0x19C); Timer.DelayCall( TimeSpan.FromMilliseconds(100), () => { foreach (Point3D trg in points) { int bloodID = Utility.RandomMinMax(4650, 4655); new MovingEffectInfo(src, trg.Clone3D(0, 0, 2), from.Map, bloodID, 1152).MovingImpact( info => { var blood = new Blood { ItemID = bloodID, Hue = 1153 }; blood.MoveToWorld(info.Target.Location, info.Map); Effects.PlaySound(info.Target, info.Map, 0x028); }); } }); } else if (ParentEntity == null || from != ParentEntity) { from.SendMessage(54, "You must be wearing this to use it."); return; } base.OnDoubleClick(from); }
public void Activate( Mobile from ) { ItemID += 1; if (from != null) from.Direction = Direction.Down; if (ItemID >= 0x124D) { // blood int amount = Utility.RandomMinMax(3, 7); for (int i = 0; i < amount; i++) { int x = X + Utility.RandomMinMax(-1, 1); int y = Y + Utility.RandomMinMax(-1, 1); int z = Z; if (!Map.CanFit(x, y, z, 1, false, false, true)) { z = Map.GetAverageZ(x, y); if (!Map.CanFit(x, y, z, 1, false, false, true)) continue; } Blood blood = new Blood(Utility.RandomMinMax(0x122C, 0x122F)); blood.MoveToWorld(new Point3D(x, y, z), Map); } if (from.Female) from.PlaySound(Utility.RandomMinMax(0x150, 0x153)); else from.PlaySound(Utility.RandomMinMax(0x15A, 0x15D)); from.LocalOverheadMessage(MessageType.Regular, 0, 501777); // Hmm... you suspect that if you used this again, it might hurt. SpellHelper.Damage(TimeSpan.Zero, from, Utility.RandomMinMax(7, 20)); Timer.DelayCall<Mobile>(TimeSpan.FromSeconds(1), new TimerStateCallback<Mobile>(Deactivate), from); } }
public virtual void Activate( AddonComponent c, Mobile from ) { if ( c.ItemID == 0x125E ) c.ItemID = 0x1269; else c.ItemID = 0x1245; // blood int amount = Utility.RandomMinMax( 3, 7 ); for ( int i = 0; i < amount; i++ ) { int x = c.X + Utility.RandomMinMax( -1, 1 ); int y = c.Y + Utility.RandomMinMax( -1, 1 ); int z = c.Z; if ( !c.Map.CanFit( x, y, z, 1, false, false, true ) ) { z = c.Map.GetAverageZ( x, y ); if ( !c.Map.CanFit( x, y, z, 1, false, false, true ) ) continue; } Blood blood = new Blood( Utility.RandomMinMax( 0x122C, 0x122F ) ); blood.MoveToWorld( new Point3D( x, y, z ), c.Map ); } if ( from.Female ) from.PlaySound( Utility.RandomMinMax( 0x150, 0x153 ) ); else from.PlaySound( Utility.RandomMinMax( 0x15A, 0x15D ) ); from.LocalOverheadMessage( MessageType.Regular, 0, 501777 ); // Hmm... you suspect that if you used this again, it might hurt. SpellHelper.Damage( TimeSpan.Zero, from, Utility.Dice( 2, 10, 5 ) ); Timer.DelayCall( TimeSpan.FromSeconds( 0.5 ), TimeSpan.FromSeconds( 0.5 ), 2, new TimerStateCallback( Deactivate ), c ); }
public static void DoBleed(Mobile m, Mobile from, int level) { if (m.Alive) { int damage = Utility.RandomMinMax(level, level * 2); if (!m.Player) damage *= 2; m.PlaySound(0x133); m.Damage(damage, from); Blood blood = new Blood(); blood.ItemID = Utility.Random(0x122A, 5); blood.MoveToWorld(m.Location, m.Map); } else { EndBleed(m, false); } }
public void BloodEffect(int range, Mobile m) { int zOffset = m.Mounted ? 20 : 10; Point3D src = m.Location.Clone3D(0, 0, zOffset); Point3D[] points = src.GetAllPointsInRange(m.Map, 0, range); Effects.PlaySound(m.Location, m.Map, 0x19C); Timer.DelayCall( TimeSpan.FromMilliseconds(100), () => { foreach (Point3D trg in points) { int bloodID = Utility.RandomMinMax(4650, 4655); new MovingEffectInfo(src, trg.Clone3D(0, 0, 2), m.Map, bloodID) .MovingImpact( info => { var blood = new Blood { ItemID = bloodID }; blood.MoveToWorld(info.Target.Location, info.Map); Effects.PlaySound(info.Target, info.Map, 0x028); }); } }); }
public static void DoBleed( Mobile m, Mobile from, int level, bool leeches ) { #endregion if ( m.Alive ) { int damage = Utility.RandomMinMax( level, level * 2 ); #region SA if ( leeches ) { from.Hits += damage; from.SendLocalizedMessage( 1113606 ); // The blood drinker effect heals you. } #endregion if ( !m.Player ) damage *= 2; m.PlaySound( 0x133 ); m.Damage( damage, from ); Blood blood = new Blood(); blood.ItemID = Utility.Random( 0x122A, 5 ); blood.MoveToWorld( m.Location, m.Map ); } else { EndBleed( m, false ); } }
private static void FinishBlood3Launch( object state ) { object[] states = (object[])state; Mobile from = (Mobile)states[0]; Point3D endBlood3Loc = (Point3D)states[1]; Map map = (Map)states[2]; Mobile killed = (Mobile)states[3]; if ( map == null || map == Map.Internal ) return; Effects.PlaySound( endBlood3Loc, map, 458 ); Item blood = new Blood( 0x122D ); blood.Movable = false; blood.MoveToWorld( endBlood3Loc, map ); }
protected override void OnTick() { if (this.m_Mobile == null || this.m_Mobile.Map == null || this.m_Mobile.Deleted || !this.m_Mobile.Alive || this.m_Mobile.Map == Map.Internal) { this.Stop(); } else { if (this.m_Location != this.m_Mobile.Location) { int amount = Utility.RandomMinMax(0, 7); for (int i = 0; i < amount; i++) { int x = this.m_Mobile.X + Utility.RandomMinMax(-1, 1); int y = this.m_Mobile.Y + Utility.RandomMinMax(-1, 1); int z = this.m_Mobile.Z; if (!this.m_Mobile.Map.CanFit(x, y, z, 1, false, false, true)) { z = this.m_Mobile.Map.GetAverageZ(x, y); if (!this.m_Mobile.Map.CanFit(x, y, z, 1, false, false, true)) { continue; } } Blood blood = new Blood(Utility.RandomMinMax(0x122C, 0x122F)); blood.MoveToWorld(new Point3D(x, y, z), this.m_Mobile.Map); } this.m_Location = this.m_Mobile.Location; } } }
public void DoAbilityNoxiousBlood(BaseCreature target, BaseMetaPet pet) { int range = Utility.RandomMinMax(3, 5); int zOffset = 10; Point3D src = pet.Location.Clone3D(0, 0, zOffset); Point3D[] points = src.GetAllPointsInRange(pet.Map, range, range); Effects.PlaySound(pet.Location, pet.Map, 0x19C); Timer.DelayCall( TimeSpan.FromMilliseconds(100), () => { foreach (Point3D trg in points) { int bloodID = Utility.RandomMinMax(4650, 4655); new MovingEffectInfo(src, trg.Clone3D(0, 0, 2), pet.Map, bloodID, 1367).MovingImpact( info => { var blood = new Blood { ItemID = bloodID, Hue = 1368 }; blood.MoveToWorld(info.Target.Location, info.Map); Effects.PlaySound(info.Target, info.Map, 0x028); }); } foreach ( Mobile mobile in pet.Location.GetMobilesInRange(pet.Map, range) .Where(m => m is BaseCreature && !m.IsControlled()).Take(4)) { var num = (int) Math.Floor((float) Level / 2); if (num == 5) num = 4; mobile.ApplyPoison(pet, Poison.GetPoison(num)); } Experience ++; if (Experience >= NextLevelExperience) { LevelUpNoxiousBlood(pet.ControlMaster); } }); NextUse = DateTime.UtcNow + CoolDown; }
void ICarvable.Carve(Mobile from, Item item) { Point3D loc = this.Location; if (this.ParentContainer != null) { if (this.ParentMobile != null) { if (this.ParentMobile != from) { from.SendMessage("You can't carve that there"); return; } loc = this.ParentMobile.Location; } else { loc = this.ParentContainer.Location; if (!from.InRange(loc, 1)) { from.SendMessage("That is too far away."); return; } } } //add blood Blood blood = new Blood(Utility.Random(0x122A, 5), Utility.Random(15 * 60, 5 * 60)); blood.MoveToWorld(loc, Map); //add meat Jerky jerky = new Jerky(m_IOBAlignment); if (this.ParentContainer == null) { jerky.MoveToWorld(loc, Map); } else { this.ParentContainer.DropItem(jerky); } this.Delete(); }
public override void OnHit(Mobile attacker, Mobile defender, double damageBonus) { int bombwhere = Utility.Random(7); switch (bombwhere) { case 0: defender.FixedParticles(0x375A, 1, 30, 2405, 78, 0, EffectLayer.Head); defender.PlaySound(814); break; case 1: defender.FixedParticles(0x37B9, 1, 30, 2406, 85, 0, EffectLayer.RightHand); defender.PlaySound(1088); break; case 2: defender.FixedParticles(0x376A, 1, 31, 2404, 80, 0, EffectLayer.LeftHand); defender.PlaySound(814); break; case 3: defender.FixedParticles(0x37C4, 1, 31, 2405, 88, 0, EffectLayer.Waist); defender.PlaySound(1088); break; case 4: defender.FixedParticles(0x3728, 1, 30, 2406, 88, 0, EffectLayer.LeftFoot); defender.PlaySound(814); break; case 5: defender.FixedParticles(0x3779, 1, 30, 2404, 85, 0, EffectLayer.RightFoot); defender.PlaySound(1088); break; case 6: defender.FixedParticles(0x376A, 1, 31, 2405, 80, 0, EffectLayer.CenterFeet); defender.PlaySound(814); break; } for (int x = defender.X - 5; x <= defender.X + 5; x++) { for (int y = defender.Y - 5; y <= defender.Y + 5; y++) { Blood g = new Blood(); g.Visible = false; g.MoveToWorld(new Point3D(x, y, defender.Z), defender.Map); switch (Utility.Random(20)) { case 0: { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x375A, 1, 30, 2405, 88); Effects.PlaySound(g, g.Map, 814); break; } case 1: { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x37B9, 1, 30, 2406, 85); Effects.PlaySound(g, g.Map, 1088); break; } case 2: { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x376A, 1, 31, 2405, 80); Effects.PlaySound(g, g.Map, 814); break; } case 3: { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x37C4, 1, 31, 2405, 88); Effects.PlaySound(g, g.Map, 1088); break; } case 4: { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3728, 1, 30, 2406, 88); Effects.PlaySound(g, g.Map, 814); break; } case 5: { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x37B9, 1, 30, 2406, 85); Effects.PlaySound(g, g.Map, 1088); break; } case 6: { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x376A, 1, 31, 2404, 80); Effects.PlaySound(g, g.Map, 814); break; } case 7: { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x37C4, 1, 31, 2406, 88); Effects.PlaySound(g, g.Map, 1088); break; } case 8: { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3728, 1, 30, 2405, 85); Effects.PlaySound(g, g.Map, 814); break; } case 9: { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x37B9, 1, 30, 2404, 88); Effects.PlaySound(g, g.Map, 1088); break; } case 10: { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x376A, 1, 31, 2406, 88); Effects.PlaySound(g, g.Map, 814); break; } case 11: { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3779, 1, 31, 2405, 85); Effects.PlaySound(g, g.Map, 1088); break; } default: break; } } } int explosionDamage = Utility.Random(30, 10); ArrayList targets = new ArrayList(); IPooledEnumerable eable = defender.Map.GetMobilesInRange(new Point3D(defender.Location), 5); foreach (Mobile m in eable) { targets.Add(m); } eable.Free(); if (targets.Count > 0) { explosionDamage /= targets.Count; for (int i = 0; i < targets.Count; ++i) { Mobile m = (Mobile)targets[i]; m.Damage(explosionDamage); m.FixedParticles(0x37C4, 1, 31, 2405, 85, 0, EffectLayer.CenterFeet); m.PlaySound(1088); } } base.OnHit(attacker, defender, damageBonus); }
public override void OnHit(Mobile attacker, Mobile defender, double damageBonus) { int bombwhere = Utility.Random(7); switch (bombwhere) { case 0: defender.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head); break; case 1: defender.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.RightHand); break; case 2: defender.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.LeftHand); break; case 3: defender.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Waist); break; case 4: defender.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.LeftFoot); break; case 5: defender.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.RightFoot); break; case 6: defender.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.CenterFeet); break; } for (int x = defender.X - 5; x <= defender.X + 5; x++) { for (int y = defender.Y - 5; y <= defender.Y + 5; y++) { Blood g = new Blood(); g.Visible = false; g.MoveToWorld(new Point3D(x, y, defender.Z), defender.Map); switch (Utility.Random(10)) { case 0: // Fire column { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052); Effects.PlaySound(g, g.Map, 0x208); break; } case 1: // Explosion { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36BD, 20, 10, 5044); Effects.PlaySound(g, g.Map, 0x307); break; } case 2: { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36FE, 10, 10, 5052); break; } default: break; } } } int explosionDamage = Utility.Random(30, 10); ArrayList targets = new ArrayList(); IPooledEnumerable eable = defender.Map.GetMobilesInRange(new Point3D(defender.Location), 5); foreach (Mobile m in eable) { targets.Add(m); } eable.Free(); if (targets.Count > 0) { explosionDamage /= targets.Count; for (int i = 0; i < targets.Count; ++i) { Mobile m = (Mobile)targets[i]; m.Damage(explosionDamage); m.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.CenterFeet); m.PlaySound(0x208); } } base.OnHit(attacker, defender, damageBonus); }
protected override void OnTick() { if (m_Addict == null || m_Addict.Deleted) { Stop(); return; } if (!m_Addict.Alive) return; if (m_Addict.Map == Map.Internal) return; if (m_Addict is PlayerMobile && (m_Addict as PlayerMobile).Reforging) return; if (m_RecoveryCount >= HungerMax) { m_Addict.SendMessage(2006, "You have successfully recovered from your addiction to " + m_Crave.ToLower() + "."); XmlAddiction addAtt = XmlAttach.FindAttachment(m_Addict, typeof(XmlAddiction)) as XmlAddiction; if (addAtt != null) { if (addAtt.Addictions.Contains(this)) addAtt.Addictions.Remove(this); } Stop(); return; } if (Hunger < HungerMax / 2) { int statLoss = HungerMax - m_Addict.ManaMax - m_Addict.StamMax; if (statLoss < 5) statLoss = 5; if (Hunger <= 0) { XmlHits withdrawal1 = new XmlHits(0 - statLoss, HungerMax * 10); withdrawal1.Name = "Severe Withdrawal"; XmlAttach.AttachTo(m_Addict, withdrawal1); XmlHue withdrawal2 = new XmlHue(2419, HungerMax * 10); withdrawal2.Name = "Severe Withdrawal"; XmlAttach.AttachTo(m_Addict, withdrawal2); m_Addict.SendMessage(37, "You grow weak and pale with your desire for " + m_Crave.ToLower() + "."); m_RecoveryCount++; } if (m_Crave == "Tobacco") { XmlDex withdrawal = new XmlDex(0 - statLoss, HungerMax * 1); withdrawal.Name = "Tobacco Withdrawal"; XmlAttach.AttachTo(m_Addict, withdrawal); m_Addict.SendMessage(37, "You've developed the shakes!"); } else if (m_Crave == "Swampweed") { XmlInt withdrawal = new XmlInt(0 - statLoss, HungerMax * 10); withdrawal.Name = "Swampweed Withdrawal"; XmlAttach.AttachTo(m_Addict, withdrawal); m_Addict.SendMessage(37, "You have a splitting migraine!"); } else if (m_Crave == "Qat") { XmlStam withdrawal = new XmlStam(0 - statLoss, HungerMax * 10); withdrawal.Name = "Qat Withdrawal"; XmlAttach.AttachTo(m_Addict, withdrawal); m_Addict.SendMessage(37, "You feel lethargic."); } else if (m_Crave == "Banestone") { XmlMana withdrawal1 = new XmlMana(0 - statLoss, HungerMax * 10); withdrawal1.Name = "Banestone Withdrawal"; XmlAttach.AttachTo(m_Addict, withdrawal1); XmlInt withdrawal2 = new XmlInt(0 - statLoss, HungerMax * 10); withdrawal2.Name = "Banestone Withdrawal"; XmlAttach.AttachTo(m_Addict, withdrawal2); if (Utility.RandomBool()) { new TripFoe.TripFoeTimer(m_Addict, 3); m_Addict.Emote("*collapses, thrashing violently!*"); } else { int damage = (HungerMax - Hunger); if(damage < 1) damage = 1; if(m_Addict.HitsMax / 10 < 1) damage = 1; else damage = damage / (m_Addict.HitsMax / 10); m_Addict.PlaySound(0x133); m_Addict.Damage(damage, m_Addict); Blood blood = new Blood(); blood.ItemID = Utility.Random(0x122A, 5); blood.MoveToWorld(m_Addict.Location, m_Addict.Map); m_Addict.Emote("*blood flows from " + (m_Addict.Female ? "her" : "his") + " nose as " + (m_Addict.Female ? "her" : "his") + " eyes roll to the back of " + (m_Addict.Female ? "her" : "his") + " head!*"); } m_Addict.SendMessage(1609, "You are wracked with seizures!"); } else if (m_Crave == "Opium") { XmlDex withdrawal = new XmlDex(0 - statLoss, HungerMax * 10); withdrawal.Name = "Opium Withdrawal"; XmlAttach.AttachTo(m_Addict, withdrawal); m_Addict.Hunger--; m_Addict.SendMessage(37, "You feel a gnawing hunger."); } } Hunger--; if (Hunger < 0) Hunger = 0; base.OnTick(); }
public static void DoBleed( Mobile m, Mobile from, int level ) { if ( m.Alive ) { int damage = Utility.RandomMinMax( level, level * ((IKhaerosMobile)from).Feats.GetFeatLevel(FeatList.BleedingStrike) ); m.PlaySound( 0x133 ); m.Damage( damage, from ); Blood blood = new Blood(); blood.ItemID = Utility.Random( 0x122A, 5 ); blood.MoveToWorld( m.Location, m.Map ); } else { EndBleed( m, false ); } }
void ICarvable.Carve(Mobile from, Item item) { Point3D loc = this.Location; if (this.ParentContainer != null) { if (this.ParentMobile != null) { if (this.ParentMobile != from) { from.SendMessage("You can't carve that there"); return; } loc = this.ParentMobile.Location; } else { loc = this.ParentContainer.Location; if (!from.InRange(loc, 1)) { from.SendMessage("That is too far away."); return; } } } //add blood Blood blood = new Blood(Utility.Random(0x122A, 5), Utility.Random(15 * 60, 5 * 60)); blood.MoveToWorld(loc, Map); //add meat Jerky jerky = new Jerky(m_IOBAlignment); Jerky jerky2 = new Jerky(m_IOBAlignment); Jerky jerky3 = new Jerky(m_IOBAlignment); BodyPart heart = new BodyPart(BodyPart.Part.HEART); BodyPart liver = new BodyPart(BodyPart.Part.LIVER); BodyPart ent = new BodyPart(BodyPart.Part.ENTRAILS); if (this.ParentContainer == null) { jerky.MoveToWorld(loc, Map); jerky2.MoveToWorld(loc, Map); jerky3.MoveToWorld(loc, Map); heart.MoveToWorld(loc, Map); liver.MoveToWorld(loc, Map); ent.MoveToWorld(loc, Map); } else { this.ParentContainer.DropItem(jerky); this.ParentContainer.DropItem(jerky2); this.ParentContainer.DropItem(jerky3); this.ParentContainer.DropItem(heart); this.ParentContainer.DropItem(liver); this.ParentContainer.DropItem(ent); } this.Delete(); }
public override void OnReceivedAttack(bool melee, bool parried, Mobile attacker) { if (attacker.Weapon is BaseRanged) { int damage = Utility.RandomMinMax(1,attacker.RawStr); PlaySound(0x133); Damage(damage, attacker); Blood blood = new Blood(); blood.ItemID = Utility.Random(0x122A, 5); blood.MoveToWorld(Location, Map); if (Utility.RandomBool()) AIObject.Action = ActionType.Flee; } base.OnReceivedAttack(melee, parried, attacker); }
public override void OnAfterMove(Point3D oldLocation) { Blood gooPuddle = new Blood(); gooPuddle.ItemID = Utility.Random(0x122A, 5); gooPuddle.Name = "slime"; gooPuddle.Hue = 0x14; gooPuddle.MoveToWorld(oldLocation, this.Map); }
public void TakeDamage(Mobile from, int damage) { if (from == null) { return; } if (damage < 1) { damage = 1; } //Break if (damage >= m_HitPoints) { Effects.PlaySound(Location, Map, 0x11B); m_HitPoints = 0; PlayerMobile player = from as PlayerMobile; BaseBoat playerBoat = BaseBoat.FindBoatAt(player.Location, player.Map); int doubloonValue = 10; switch (m_CrateType) { case CrateType.Bronze: doubloonValue = Utility.RandomMinMax(10, 25); break; case CrateType.Silver: doubloonValue = Utility.RandomMinMax(25, 100); break; case CrateType.Gold: doubloonValue = Utility.RandomMinMax(100, 250); break; } if (player != null && playerBoat != null) { if (!playerBoat.Deleted) { if (playerBoat.DepositDoubloons(doubloonValue)) { Doubloon doubloonPile = new Doubloon(doubloonValue); player.SendSound(doubloonPile.GetDropSound()); doubloonPile.Delete(); //playerBoat.doubloonsEarned += doubloonValue; player.SendMessage("You have recovered " + doubloonValue.ToString() + " doubloons worth of materials in the cargo! The coins have been placed in your ship's hold."); } else { player.SendMessage("You have earned doubloons, but alas there was not enough room in your ship's hold to place them all!"); } } } Point3D startLocation = Location; IEntity effectStartLocation = new Entity(Serial.Zero, Location, Map); Effects.SendLocationParticles(effectStartLocation, Utility.RandomList(0x36BD, 0x36BF, 0x36CB, 0x36BC), 30, 7, 0, 0, 5044, 0); int debrisCount = Utility.RandomMinMax(6, 8); for (int a = 0; a < debrisCount; a++) { int itemId; Point3D endLocation; IEntity effectEndLocation; if (Utility.RandomDouble() <= .80) { itemId = Utility.RandomList(7041, 7044, 7053, 7067, 7068, 7069, 7070, 7604, 7605); endLocation = new Point3D(X + Utility.RandomMinMax(-3, 3), Y + Utility.RandomMinMax(-3, 3), Z + 5); effectEndLocation = new Entity(Serial.Zero, endLocation, Map); } else { itemId = Utility.RandomList(3117, 3118, 3119, 3120); endLocation = new Point3D(X + Utility.RandomMinMax(-2, 2), Y + Utility.RandomMinMax(-2, 2), Z); effectEndLocation = new Entity(Serial.Zero, endLocation, Map); } Effects.SendMovingEffect(effectStartLocation, effectEndLocation, itemId, 5, 0, false, false, 0, 0); double distance = Utility.GetDistanceToSqrt(startLocation, endLocation); double destinationDelay = (double)distance * .16; double explosionDelay = ((double)distance * .16) + 1; Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate { if (this == null) { return; } Blood debris = new Blood(); debris.Name = "debris"; debris.ItemID = itemId; debris.MoveToWorld(endLocation, Map); Effects.PlaySound(endLocation, Map, 0x027); }); } Delete(); } //Damage else { int debrisCount = Utility.RandomMinMax(1, 2); for (int a = 0; a < debrisCount; a++) { int itemId = Utility.RandomList(7041, 7044, 7053, 7067, 7068, 7069, 7070, 7604, 7605); Blood debris = new Blood(); debris.Name = "debris"; debris.ItemID = itemId; Point3D endLocation = new Point3D(X + Utility.RandomMinMax(-2, 2), Y + Utility.RandomMinMax(-2, 2), Z + 5); debris.MoveToWorld(endLocation, Map); Effects.PlaySound(endLocation, Map, 0x027); } //Wood Breaking Sound Effects.PlaySound(Location, Map, Utility.RandomList(0x11D)); //0x3B7, 0x3B5, 0x3B1 m_HitPoints -= damage; } }
public virtual void FinishThrow(Mobile m, Mobile target) { if (m != null && !m.Deleted && target != null) { var blood = new Blood(); blood.MoveToWorld(target.Location, target.Map); target.Damage(45, this); CantWalk = false; } }
public bool ReceivePrize(Mobile from, int seed) { Item i = null; string text = ""; /* Rewards * Sandals ~ Hued [2651, 2662] :::: 0.5% * Spellbook ~ Hued [2651, 2662] :::: 0.5% * UncutCloth ~ Hued [2651, 2662] :::: 1% * Stuffed Easter Bunny Statue Hued [1150] :::: 1.5% * Dragon Coin ~ Amount [10-25] :::: 3% * Magic Weapon (Might + random others) 5% * RabbitBomb ~ 5% * Random Skill Manual ~ 5% * Another Easter Egg 10% * * Explosion ~ (5-15 damage) :::: 25.5% * Gold ~ Amount [50-199] :::: 43% * */ if (seed <= 25) { text = "You receive Easter Sandals!"; i = new Sandals(); i.Hue = Utility.RandomList(2651, 2662); i.Name = "Easter Sandals"; } else if (seed <= 75) { text = "You receive an Easter Spellbook!"; i = new Spellbook(); i.Hue = Utility.RandomList(2651, 2662); i.Name = "Easter Spellbook"; } else if (seed <= 125) { text = "You receive some Easter Cloth!"; i = new UncutCloth(); i.Hue = Utility.RandomList(2651, 2662); i.Amount = 8; } else if (seed <= 225) { text = "You receive a stuffed Easter Bunny!"; i = new StuffedEasterBunny(); } else if (seed <= 600) { text = "You receive some Dragon Coins!"; i = new DragonCoin(); i.Amount = Utility.Random(25, 50); } else if (seed <= 850) { text = "You receive a magical weapon!"; BaseWeapon wep = Loot.RandomWeapon(); if (wep != null) { wep.AccuracyLevel = (WeaponAccuracyLevel)Utility.RandomMinMax(1, 5); wep.DamageLevel = (WeaponDamageLevel)Utility.RandomMinMax(1, 5); wep.DurabilityLevel = (WeaponDurabilityLevel)Utility.RandomMinMax(1, 5); } i = wep; } else if (seed <= 3150) { text = "You receive more easter eggs!"; i = new EasterEgg(); } else if (seed <= 5750) { Point3D loc = this.GetWorldLocation(); Map facet = this.Map; text = "You receive remorse!"; if (from.CanBeDamaged()) { Effects.SendLocationEffect(loc, facet, 0x36BD, 15, 10); Effects.PlaySound(from.Location, from.Map, 0x246); from.PublicOverheadMessage(MessageType.Regular, 0, false, "*Looks remorseful*"); AOS.Damage(from, Utility.Random(10, 20), 0, 100, 0, 0, 0); Blood blood = new Blood(); blood.MoveToWorld(from.Location, from.Map); } } else if (seed <= 6000) { text = "You receive a large amount of gold."; i = new Gold(); i.Amount = Utility.RandomMinMax(750, 1250); from.SendSound(0x2e6); } else if (seed <= 6500) { text = "You receive a moderate amount of gold."; i = new Gold(); i.Amount = Utility.RandomMinMax(400, 600); from.SendSound(0x2e5); } else { text = "You receive a small amount of gold."; i = new Gold(); i.Amount = Utility.RandomMinMax(200, 300); from.SendSound(0x2e4); } if (text.Length > 0) { from.SendMessage(text); } if (i != null) { if (!from.AddToBackpack(i)) { i.Delete(); from.SendMessage("You don't have enough room in your backpack. Please make room and try again."); return(false); } } return(true); }
public static void DoBleed( Mobile m ) { Blood blood = new Blood(); blood.ItemID = Utility.Random( 0x122A, 5 ); blood.MoveToWorld( m.Location, m.Map ); }
protected override void OnTick() { if ( m_Location != m_Mobile.Location ) { int amount = Utility.RandomMinMax( 0, 7 ); for ( int i = 0; i < amount; i++ ) { int x = m_Mobile.X + Utility.RandomMinMax( -1, 1 ); int y = m_Mobile.Y + Utility.RandomMinMax( -1, 1 ); int z = m_Mobile.Z; if ( !m_Mobile.Map.CanFit( x, y, z, 1, false, false, true ) ) { z = m_Mobile.Map.GetAverageZ( x, y ); if ( !m_Mobile.Map.CanFit( x, y, z, 1, false, false, true ) ) continue; } Blood blood = new Blood( Utility.RandomMinMax( 0x122C, 0x122F ) ); blood.MoveToWorld( new Point3D( x, y, z ), m_Mobile.Map ); } m_Location = m_Mobile.Location; } }
public void DoInjury(Injury inj) { if (m_Player == null || m_Player.Deleted) { Delete(); return; } if (m_Player is PlayerMobile && (m_Player as PlayerMobile).RessSick) return; bool hasInjury = false; foreach (InjuryTimer iT in CurrentInjuries) { if (iT.Injury == inj) { hasInjury = true; continue; } } if (!hasInjury) return; switch (inj) { case Injury.Bloodied: { int dmg = Utility.RandomMinMax(1, 5); if (m_Player.Hits - dmg < 1) dmg = m_Player.Hits - (m_Player.Hits - 1); m_Player.Damage(dmg); Blood newBlood = new Blood(); newBlood.MoveToWorld(m_Player.Location, m_Player.Map); m_Player.SendMessage(37, "You're bleeding."); break; } case Injury.BrokenBack: { int pMin = 120 - m_Player.StamMax - m_Player.ManaMax; if (pMin < 15) pMin = 15; XmlParalyze newParalysis = new XmlParalyze(pMin); newParalysis.Name = "Injury Paralysis"; XmlAttach.AttachTo(m_Player, newParalysis); m_Player.SendMessage(37, "You are wracked with paralytic back spasms and cannot move!"); m_Player.Emote("*spasms!*"); break; } case Injury.BrokenJaw: { ArrayList muteAtt = XmlAttach.FindAttachments(m_Player, typeof(XmlBackground)); bool attached = false; foreach (XmlBackground att in muteAtt) { if (att.Background == BackgroundList.Mute) attached = true; } if (!attached) { int muteTime = 180 - m_Player.StamMax - m_Player.ManaMax; if (muteTime < 20) muteTime = 20; XmlBackground newMute = new XmlBackground(BackgroundList.Mute, 1, muteTime); newMute.Name = "Injury Mute"; XmlAttach.AttachTo(m_Player, newMute); m_Player.SendMessage(37, "Your jaw is broken, causing you great pain and rendering you unable to speak."); } break; } case Injury.BrokenLeftArm: { Item LeftArmItem = m_Player.FindItemOnLayer(Layer.TwoHanded); if (LeftArmItem != null && !LeftArmItem.Deleted && m_Player.Alive) { LeftArmItem.MoveToWorld(m_Player.Location, m_Player.Map); m_Player.PlaySound(LeftArmItem.GetDropSound()); if (LeftArmItem.Name != null && LeftArmItem.Name != "") m_Player.Emote("*drops " + LeftArmItem.Name + " due to " + (m_Player.Female ? "her" : "his") + " wounds*"); } //Remainder is handled in PlayerMobile.cs break; } case Injury.BrokenLeftLeg: { ArrayList lameAtts = XmlAttach.FindAttachments(m_Player, typeof(XmlBackground)); bool attached = false; foreach (XmlBackground att in lameAtts) { if (att.Background == BackgroundList.Lame) attached = true; } if (!attached) { int lameTime = 100 - m_Player.StamMax - m_Player.ManaMax; if (lameTime < 5) lameTime = 5; XmlBackground lameAtt = new XmlBackground(BackgroundList.Lame, 1, lameTime); lameAtt.Name = "Injury Left Lame"; XmlAttach.AttachTo(m_Player, lameAtt); m_Player.SendMessage(37, "Your left leg is broken, hindering your movement."); } break; } case Injury.BrokenNeck: { if (Utility.RandomMinMax(1, 100) > Utility.RandomMinMax(1 + (m_Player.ManaMax / 2), 100 + m_Player.ManaMax)) { int pMin = 120 - m_Player.StamMax - m_Player.ManaMax; if (pMin < 15) pMin = 15; XmlParalyze parAtt = new XmlParalyze(pMin); parAtt.Name = "Injury Paralysis Neck"; XmlAttach.AttachTo(m_Player, parAtt); m_Player.SendMessage(37, "Your neck is broken, and your body is paralyzed with pain!"); m_Player.Emote("*spasms!*"); } break; } case Injury.BrokenRightArm: { Item RightArmItem = m_Player.FindItemOnLayer(Layer.OneHanded); if (RightArmItem == null || RightArmItem.Deleted) RightArmItem = m_Player.FindItemOnLayer(Layer.FirstValid); if ((RightArmItem == null || RightArmItem.Deleted) && m_Player.FindItemOnLayer(Layer.TwoHanded) is BaseWeapon) RightArmItem = m_Player.FindItemOnLayer(Layer.TwoHanded); if (RightArmItem != null && !RightArmItem.Deleted && m_Player.Alive) { RightArmItem.MoveToWorld(m_Player.Location, m_Player.Map); m_Player.PlaySound(RightArmItem.GetDropSound()); if (RightArmItem.Name != null && RightArmItem.Name != "") m_Player.Emote("*drops " + RightArmItem.Name + " due to " + (m_Player.Female ? "her" : "his") + " wounds*"); } //Remainder is handled in PlayerMobile.cs break; } case Injury.BrokenRightLeg: { ArrayList lameAtts = XmlAttach.FindAttachments(m_Player, typeof(XmlBackground)); bool attached = false; foreach (XmlBackground att in lameAtts) { if (att.Background == BackgroundList.Lame) attached = true; } if (!attached) { int lameTime = 100 - m_Player.StamMax - m_Player.ManaMax; if (lameTime < 5) lameTime = 5; XmlBackground lameAtt = new XmlBackground(BackgroundList.Lame, 1, lameTime); lameAtt.Name = "Injury Right Lame"; XmlAttach.AttachTo(m_Player, lameAtt); m_Player.SendMessage(37, "Your right leg is broken, hindering your movement."); } break; } case Injury.Bruised: { bool alreadyBruised = false; foreach (StatMod mod in m_Player.StatMods) { if (mod.Name.ToLower().Contains("bruise")) { alreadyBruised = true; continue; } } if (!alreadyBruised) { int bruiseTime = 180 - m_Player.StamMax - m_Player.ManaMax; if (bruiseTime < 20) bruiseTime = 20; XmlHits bruising = new XmlHits(Utility.RandomMinMax(1, 10) * -1, bruiseTime); bruising.Name = "Bruise"; XmlAttach.AttachTo(m_Player, bruising); m_Player.SendMessage("You are badly bruised."); } break; } case Injury.DeepCut: { int HPLoss = m_Player.HitsMax / Utility.RandomMinMax(10, 20); if (m_Player.Hits - HPLoss <= 0) break; else if ( m_Player.Hits - HPLoss > 0 ) { m_Player.Damage(HPLoss); m_Player.SendMessage(37, "You have been cut deeply, and continue to bleed."); Blood newBlood = new Blood(); newBlood.MoveToWorld(m_Player.Location, m_Player.Map); m_Player.PlaySound(0x050); } break; } case Injury.Exhausted: { int StamLoss = 0; if (m_Player is PlayerMobile) { double numerator = m_Player.StamMax; StamLoss = (int)(numerator / (m_Player as PlayerMobile).Level); } else StamLoss = Utility.Random(1, 10); if (m_Player.StamMax - StamLoss < 1) StamLoss = m_Player.Stam - 1; m_Player.Stam -= StamLoss; if(Utility.RandomMinMax(1,100) > 90) m_Player.SendMessage(37, "You are exhausted, drained of " + StamLoss.ToString() + " stamina."); break; } case Injury.FracturedLeftArm: { //Handled in BaseWeapon and BaseShield.cs break; } case Injury.FracturedLeftLeg: { if (Utility.RandomBool() && m_Player.Stam - 1 > 0) m_Player.Stam--; //Handled in PlayerMobile.cs break; } case Injury.FracturedRibs: { int damage = Utility.RandomMinMax(1, 10); if (m_Player.Hits - damage > 0) { m_Player.Damage(damage); if(Utility.RandomMinMax(1,100) < 25) m_Player.SendMessage(37, "Your ribs are fractured, making movement painful and even debilitating!"); } break; } case Injury.FracturedRightArm: { //Handled in BaseWeapon.cs break; } case Injury.FracturedRightLeg: { if (Utility.RandomBool() && m_Player.Stam - 1 > 0) m_Player.Stam--; //Handled in PlayerMobile.cs break; } case Injury.FracturedSkull: { m_Player.Mana = 0; int intLoss = (-1 * (m_Player.RawInt - m_Player.ManaMax)) / 10; if(intLoss > 0) intLoss = 0; XmlAttach.AttachTo(m_Player, new XmlInt(intLoss, InjuryLevel * 100)); m_Player.SendMessage(37, "Your skull is fractured, causing you to feel dizzy and confused!"); break; } case Injury.InternalBleeding: { int HPLoss = m_Player.HitsMax / Utility.RandomMinMax(10, 20); if (m_Player.Hits - HPLoss > 0) { m_Player.Damage(HPLoss); } m_Player.SendMessage(37, "You are bleeding internally!"); m_Player.PlaySound(m_Player.Female ? 813 : 1087); m_Player.Say("*pukes*"); if (!m_Player.Mounted) m_Player.Animate(32, 5, 1, true, false, 0); Point3D p = new Point3D(m_Player.Location); switch (m_Player.Direction) { case Direction.North: p.Y--; break; case Direction.South: p.Y++; break; case Direction.East: p.X++; break; case Direction.West: p.X--; break; case Direction.Right: p.X++; p.Y--; break; case Direction.Down: p.X++; p.Y++; break; case Direction.Left: p.X--; p.Y++; break; case Direction.Up: p.X--; p.Y--; break; default: break; } p.Z = m_Player.Map.GetAverageZ(p.X, p.Y); bool canFit = Server.Spells.SpellHelper.AdjustField(ref p, m_Player.Map, 12, false); if (canFit) { Puke puke = new Puke(); puke.Name = "blood"; puke.Hue = Utility.RandomList(1157, 1609, 2206, 2778, 2795); puke.Map = m_Player.Map; puke.Location = p; } if (CombatSystemAttachment.GetCSA(m_Player).CruiseControl) { CombatSystemAttachment.GetCSA(m_Player).DisableAutoCombat(); m_Player.SendMessage("It is difficult for you focus on combat right now."); } break; } case Injury.LaceratedTorso: { int HPLoss = m_Player.HitsMax / Utility.RandomMinMax(10, 20); if (m_Player.Hits - HPLoss > 0) { m_Player.Damage(HPLoss); m_Player.SendMessage(37, "You are severely injured!"); } break; } case Injury.MajorConcussion: { m_Player.Mana = 0; if (m_Player.Warmode) m_Player.Warmode = false; if (m_Player.Mount != null && !(m_Player.Mount as BaseCreature).Deleted && Utility.RandomMinMax(1, 100) > ( 50 - ( m_Player.HitsMax - m_Player.Hits))) { IMount mount = m_Player.Mount; mount.Rider = null; if (m_Player is PlayerMobile) { PlayerMobile pm = m_Player as PlayerMobile; if (pm.DismountedTimer != null) pm.DismountedTimer.Stop(); pm.DismountedTimer = new Misc.Dismount.DismountTimer(pm, 1); pm.DismountedTimer.Start(); Spells.SpellHelper.Damage(TimeSpan.FromTicks(1), pm, pm, Utility.RandomMinMax(1, 6)); pm.Emote("*falls from {0} mount*", pm.Female == true ? "her" : "his"); } else { m_Player.Emote("*falls off " + (m_Player.Female == true ? "her" : "his") + " mount!*"); if (m_Player is Soldier) (mount as BaseCreature).Kill(); } } if (Utility.RandomMinMax(1, 100) > 95) { CombatSystemAttachment csa = CombatSystemAttachment.GetCSA(m_Player); csa.DoTrip(1); } if (Utility.RandomMinMax(1, 100) > 25) XmlAttach.AttachTo(m_Player, new XmlBackground(BackgroundList.Deaf, 1, 5)); if(Utility.RandomMinMax(1,100) > 95) m_Player.SendMessage(37, "You are severely concussed!"); break; } case Injury.MassiveBleeding: { foreach (Item item in m_Player.Items) { if (Utility.RandomMinMax(1, 100) > 75) { XmlAttach.AttachTo(item, new XmlHue(1157, 30)); continue; } } XmlAttach.AttachTo(m_Player, new XmlHue(2419, 30)); XmlAttach.AttachTo(m_Player, new XmlHits(-1 * Utility.RandomMinMax(1, InjuryLevel), InjuryLevel * 100)); Blood newBlood = new Blood(); newBlood.MoveToWorld(m_Player.Location, m_Player.Map); m_Player.Mana = 0; break; } case Injury.MinorConcussion: { m_Player.Mana = 0; switch(Utility.RandomMinMax(1,3)) { case 1: if (m_Player.Warmode) { m_Player.Warmode = false; if(Utility.RandomMinMax(1,100) > 90) m_Player.SendMessage(37, "You are concussed!"); } break; case 2: { if (m_Player.Mount != null && !(m_Player.Mount as BaseCreature).Deleted && Utility.RandomMinMax(1, 100) > ( 50 - ( m_Player.HitsMax - m_Player.Hits))) { IMount mount = m_Player.Mount; mount.Rider = null; if (m_Player is PlayerMobile) { PlayerMobile pm = m_Player as PlayerMobile; if (pm.DismountedTimer != null) pm.DismountedTimer.Stop(); pm.DismountedTimer = new Misc.Dismount.DismountTimer(pm, 1); pm.DismountedTimer.Start(); Spells.SpellHelper.Damage(TimeSpan.FromTicks(1), pm, pm, Utility.RandomMinMax(1, 6)); pm.Emote("*falls from {0} mount*", pm.Female == true ? "her" : "his"); } else { m_Player.Emote("*falls off " + (m_Player.Female == true ? "her" : "his") + " mount!*"); if (m_Player is Soldier) (mount as BaseCreature).Kill(); } } break; } case 3: { if (Utility.RandomMinMax(1, 100) > 95) { CombatSystemAttachment csa = CombatSystemAttachment.GetCSA(m_Player); csa.DoTrip(1); m_Player.SendMessage(37, "You are concussed!"); } break; } } break; } case Injury.MinorCut: { int dmg = Utility.RandomMinMax(1, 3); if (m_Player.Hits - dmg > 0) { m_Player.Damage(dmg); m_Player.SendMessage(37, "You have been cut, and are still bleeding."); } break; } case Injury.BrokenSkull: { m_Player.Mana = 0; int intLoss = (-1 * (m_Player.RawInt - m_Player.ManaMax)) / 10; if (intLoss > 0) intLoss = 0; XmlAttach.AttachTo(m_Player, new XmlInt(intLoss, InjuryLevel * 100)); new EyeRaking.EyeRakingTimer(m_Player, 10); m_Player.SendMessage("You have been blinded!"); m_Player.SendMessage(37, "Your skull is broken, causing your perception to fade in and out!"); break; } case Injury.Winded: { m_Player.Mana -= Utility.RandomMinMax(1, 10); int stamDmg = Utility.RandomMinMax(1, 5); if (m_Player.Stam - stamDmg > 0) m_Player.Stam -= stamDmg; else m_Player.Stam = 1; m_Player.SendMessage(37, "You're winded."); break; } default: break; } }
public void DoBleed(Mobile m, Mobile from, int level) { if (m.Alive) { int damage = Utility.RandomMinMax(level, level * 2); if (!m.Player) damage *= 2; m.PlaySound(0x133); AOS.Damage(m, from, damage, false, 0, 0, 0, 0, 0, 0, 100, false, false, false); Blood blood = new Blood(); blood.ItemID = Utility.Random(0x122A, 5); blood.MoveToWorld(m.Location, m.Map); } else { EndBleed(m, false); RemoveEffects(); BuffInfo.RemoveBuff(m, BuffIcon.SplinteringEffect); } }