public void Target( Mobile m ) { if ( !Caster.CanSee( m ) ) { Caster.SendLocalizedMessage( 500237 ); // Target can not be seen. } else if ( m is Mobiles.BaseVendor || m is Mobiles.PlayerVendor || m is Mobiles.PlayerBarkeeper || m.AccessLevel > Caster.AccessLevel ) { Caster.SendLocalizedMessage( 501857 ); // This spell won't work on that! } else if ( CheckBSequence( m ) ) { SpellHelper.Turn( Caster, m ); Effects.SendLocationParticles( EffectItem.Create( new Point3D( m.X, m.Y, m.Z + 16 ), Caster.Map, EffectItem.DefaultDuration ), 0x376A, 10, 15, 5045 ); m.PlaySound( 0x3C4 ); m.Hidden = true; BuffInfo.RemoveBuff( m, BuffIcon.HidingAndOrStealth ); BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.Invisibility, 1075825 ) ); //Invisibility/Invisible RemoveTimer( m ); TimeSpan duration = TimeSpan.FromSeconds( ((6 * Caster.Skills.Magery.Fixed) / 50) + 1 ); Timer t = new InternalTimer( m, duration ); m_Table[m] = t; t.Start(); } FinishSequence(); }
public WildHorse( string name ) : base( name, 0xE2, 0x3EA0, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 ) { int random = Utility.Random( 4 ); Body = m_IDs[random * 2]; ItemID = m_IDs[random * 2 + 1]; BaseSoundID = 0xA8; SetStr( 22, 98 ); SetDex( 56, 75 ); SetInt( 6, 10 ); SetHits( 28, 45 ); SetMana( 0 ); SetDamage( 3, 4 ); SetDamageType( ResistanceType.Physical, 100 ); SetResistance( ResistanceType.Physical, 15, 20 ); SetSkill( SkillName.MagicResist, 25.1, 30.0 ); SetSkill( SkillName.Tactics, 29.3, 44.0 ); SetSkill( SkillName.Wrestling, 29.3, 44.0 ); Fame = 300; Karma = 300; Tamable = true; ControlSlots = 1; MinTameSkill = 29.1; Timer PondTimer = new InternalTimer(this); PondTimer.Start(); }
public static void BeginGuardOff( Mobile m, Mobile caster ) { if ( m_Table.ContainsKey( m.Serial ) ) { Timer timer = m_Table[m.Serial]; timer.Stop(); m_Table.Remove( m.Serial ); } List<ResistanceMod> mods = new List<ResistanceMod>(); mods.Add( new ResistanceMod( ResistanceType.Physical, -(m.PhysicalResistance / 2) ) ); mods.Add( new ResistanceMod( ResistanceType.Fire, -(m.FireResistance / 2) ) ); mods.Add( new ResistanceMod( ResistanceType.Cold, -(m.ColdResistance / 2) ) ); mods.Add( new ResistanceMod( ResistanceType.Poison, -(m.PoisonResistance / 2) ) ); mods.Add( new ResistanceMod( ResistanceType.Energy, -(m.EnergyResistance / 2) ) ); Double duration = ( BlueSpell.ScaleBySkill( caster, SkillName.Forensics ) * 3.0 ); InternalTimer timertostart = new InternalTimer( m, mods, duration ); timertostart.Start(); m_Table.Add( m.Serial, timertostart ); for ( int i = 0; i < mods.Count; ++i ) m.AddResistanceMod( mods[i] ); m.SendMessage( "Your guard has been lowered" ); }
public override void Drink( Mobile m ) { TimeSpan duration = TimeSpan.FromMinutes( 1 ); if (m.Hidden == false) { m.FixedParticles( 0x376A, 9, 32, 5007, EffectLayer.Waist ); m.PlaySound( 0x3C4 ); BuffInfo.RemoveBuff( m, BuffIcon.HidingAndOrStealth ); BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.Invisibility, 1075825 ) ); //Invisibility/Invisible BasePotion.PlayDrinkEffect( m ); this.Consume(); m.Hidden = true; RemoveTimer( m ); Timer t = new InternalTimer( m, duration ); m_Table[m] = t; t.Start(); } else { m.SendMessage( "An invisibility potion is already taking effect on your person." ); //An invisibility potion is already taking effect on your person. } }
public SGEFieldEast(Point3D from, Map map) : base(from, map) { Map = map; InternalTimer t = new InternalTimer(this); t.Start(); }
public static void ApplyProtectionEffect(Mobile target, Mobile caster) { if (caster != null && !caster.CanBeBeneficial(target, false)) return; //Stop the old protection timer, if we have any. StopTimer(target); // Temporary "easy way out" fix for stacking protection on server restarts. // I'll get to fixing this properly soon. I know the problems it causes // but this can't be abused as much in the meantime - Malik //if (target is PlayerMobile) // StopTimer(target); target.VirtualArmor += ArmorModValue; Timer protectionTimer = new InternalTimer(target); protectionTimer.Start(); //Register it with the list m_Timers.Add(target, protectionTimer); target.FixedParticles(0x373A, 10, 15, 5016, EffectLayer.Waist); target.PlaySound(493); }
public void Target( Mobile m ) { if ( !Caster.CanSee( m ) ) { Caster.SendLocalizedMessage( 500237 ); // Target can not be seen. } else if ( CheckBSequence( m ) ) { SpellHelper.Turn( Caster, m ); Effects.SendLocationParticles( EffectItem.Create( new Point3D( m.X, m.Y, m.Z + 16 ), Caster.Map, EffectItem.DefaultDuration ), 0x376A, 10, 15, 5045 ); m.PlaySound( 0x3C4 ); m.Hidden = true; RemoveTimer( m ); TimeSpan duration = TimeSpan.FromSeconds( Caster.Skills[SkillName.Magery].Value * 1.2 ); // 120% of magery Timer t = new InternalTimer( m, duration ); m_Table[m] = t; t.Start(); } FinishSequence(); }
public static void DoSleep( Mobile from, Mobile m ) { double alchemy = from.Skills.Alchemy.Value; double resist = m.Skills.MagicResist.Value; double enhancePotions = GetEnhancePotions( from ); int seconds = (int) ( alchemy + ( enhancePotions / 2 ) - ( resist + 40 ) ) / 10; if ( seconds > 0 ) { BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.Paralyze, 1095150, 1095151, TimeSpan.FromSeconds( seconds ), m, seconds.ToString() ) ); Timer t = new InternalTimer( m, DateTime.Now + TimeSpan.FromSeconds( seconds ) ); t.Start(); m_SleptTable[m] = t; m.ForcedWalk = true; } else { from.SendLocalizedMessage( 1095149 ); // Your target resists the exploding tar potion. m.SendLocalizedMessage( 1095148 ); // You resist the exploding tar potion. } }
public void Target( Mobile m ) { if ( !Caster.CanSee( m ) ) { Caster.SendLocalizedMessage( 500237 ); // Target can not be seen. } else if ( CheckBSequence( m ) ) { //Stop the old reflect timer, if we have any. StopTimer(m); m.MagicDamageAbsorb = 15; //to make sure it will reflect any spell. Timer protectionTimer = new InternalTimer(m); protectionTimer.Start(); //Register it with the list m_Timers.Add(m, protectionTimer); m.FixedParticles(0x373A, 10, 15, 5016, EffectLayer.Waist); m.PlaySound( Sound ); } FinishSequence(); }
public ChickenEggLayer() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 ) { Name = "egg laying chicken"; Body = 0xD0; BaseSoundID = 0x6E; SetStr( 5 ); SetDex( 15 ); SetInt( 5 ); SetHits( 3 ); SetMana( 0 ); SetDamage( 1 ); SetDamageType( ResistanceType.Physical, 100 ); SetResistance( ResistanceType.Physical, 1, 5 ); SetSkill( SkillName.MagicResist, 4.0 ); SetSkill( SkillName.Tactics, 5.0 ); SetSkill( SkillName.Wrestling, 5.0 ); Fame = 150; Karma = 0; VirtualArmor = 2; Tamable = true; ControlSlots = 1; MinTameSkill = -0.9; Timer PondTimer = new InternalTimer(this); PondTimer.Start(); }
public void Target( Mobile m ) { if ( !Caster.CanSee( m ) ) { Caster.SendAsciiMessage( "Target can not be seen." ); } else if ( CheckBSequence( m ) ) { SpellHelper.Turn( Caster, m ); Effects.SendLocationParticles( EffectItem.Create( new Point3D( m.X, m.Y, m.Z + 16 ), Caster.Map, EffectItem.DefaultDuration ), 0x376A, 10, 15, 5045 ); m.PlaySound( 0x203 ); m.Hidden = true; RemoveTimer( m ); TimeSpan duration = TimeSpan.FromSeconds( ((6 * Caster.Skills.Magery.Fixed) / 50) + 1 ); Timer t = new InternalTimer( m, duration ); m_Table[m] = t; t.Start(); } FinishSequence(); }
public static void AddTimer( Mobile m, TimeSpan duration ) { Timer t = new InternalTimer( m, duration ); m_Table[m] = t; t.Start(); }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadEncodedInt(); m_Timer = new InternalTimer( this, TimeSpan.Zero ); m_Timer.Start(); }
public GuardianTreasureChest( int itemID ) : base(itemID) { for ( int i = 0; i < 5; i++ ) Fill(); m_Timer = new InternalTimer( this ); m_Timer.Start(); }
public void DoTimer(Mobile from, SiegeCatapult weapon, IEntity target, Point3D targetloc, Item projectile, TimeSpan damagedelay, int step) { if (m_Timer != null) m_Timer.Stop(); if (step > 4 || step < 0) return; m_Timer = new InternalTimer(from, weapon, target, targetloc, projectile, damagedelay, step); m_Timer.Start(); }
public FactionObelisk(int itemid) : base(itemid) { Movable = false; timer = new InternalTimer(this); timer.Start(); FactionObelisks.Register(this); ObeliskUsers = new Dictionary<Account, DateTime>(); }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); /*int version = */ reader.ReadInt(); m_Timer = new InternalTimer( this ); m_Timer.Start(); }
public static void StartTimer( Mobile from, Mobile to ) { if ( !m_Table.Contains( to ) ) { Timer t = new InternalTimer( to, from ); t.Start(); m_Table[to] = t; } }
public void GiveToothAche(Mobile from, int seq) { if (toothache != null) toothache.Stop(); from.SendLocalizedMessage(1077388 + seq); if (seq < 5) { toothache = new InternalTimer(this, from, seq, TimeSpan.FromSeconds(15)); toothache.Start(); } }
public PersonalAttendant( string title ) : base( AIType.AI_Vendor, FightMode.None, 22, 1, 0.15, 0.2 ) { Title = title; Blessed = true; ControlSlots = 0; InitBody(); InitOutfit(); m_Timer = new InternalTimer( this, TimeSpan.FromSeconds( 2 ) ); m_Timer.Start(); }
public static void BeginImmunity( Mobile m, TimeSpan duration ) { Timer t = (Timer)m_Table[m]; if ( t != null ) t.Stop(); t = new InternalTimer( m, duration ); m_Table[m] = t; t.Start(); }
public static void BeginBleed( Mobile m, Mobile from ) { Timer t = (Timer)m_Table[m]; if ( t != null ) t.Stop(); t = new InternalTimer( from, m ); m_Table[m] = t; t.Start(); }
public SR_RuneGate( Point3D target, Map map ) : base( target, map ) { Map = map; if ( ShowFeluccaWarning && map == Map.Felucca ) ItemID = 0xDDA; Dispellable = false; InternalTimer t = new InternalTimer( this ); t.Start(); }
public static void BeginTalon( Mobile m, Mobile from, int damage ) { Timer t = (Timer) m_Table[m]; if ( t != null ) t.Stop(); t = new InternalTimer( from, m, damage ); m_Table[m] = t; t.Start(); }
public static void BeginConfidence( Mobile m ) { Timer t = (Timer)m_Table[m]; if ( t != null ) t.Stop(); t = new InternalTimer( m ); m_Table[m] = t; t.Start(); }
public MushroomGateCircle(Point3D target, Map map, int item) { m_ItemID=item; if ( ShowFeluccaWarning && map == Map.Felucca ) { Hue = 1175; ItemID=m_ItemID; } InternalTimer t = new InternalTimer( this ); t.Start(); }
public static void StartCountering( Mobile m ) { Timer t = (Timer)m_Table[m]; if ( t != null ) t.Stop(); t = new InternalTimer( m ); m_Table[m] = t; t.Start(); }
public static void BeginEvasion(Mobile m) { Timer t = (Timer)m_Table[m]; if (t != null) t.Stop(); t = new InternalTimer(m, GetEvadeDuration(m)); m_Table[m] = t; t.Start(); }
public static void BeginWound( Mobile m, TimeSpan duration ) { Timer t = (Timer)m_Table[m]; if ( t != null ) t.Stop(); t = new InternalTimer( m, duration ); m_Table[m] = t; t.Start(); m.YellowHealthbar = true; }
public FinalStone() : base() { ItemID = 5154; Name = "Final Stone(Timer)"; Movable = false; Visible = false; Weight = 0; StopTimer(this); Timer t = new InternalTimer(this); m_Timers[this] = t; t.Start(); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadEncodedInt(); switch (version) { case 1: { m_ForceDeactivate = reader.ReadBool(); goto case 0; } case 0: { int length = reader.ReadEncodedInt(); m_Spawners = new XmlSpawner[length]; for (int i = 0; i < length; i++) { var spawner = reader.ReadItem <XmlSpawner>(); if (spawner == null) { spawner = m_Entries[i].CreateSpawner(); spawner.SmartSpawning = true; } m_Spawners[i] = spawner; } break; } } m_Instance = this; m_SpawnTimer = new InternalTimer(this); m_SpawnTimer.Start(); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); m_Hits = reader.ReadInt(); m_MaxHits = reader.ReadInt(); m_MinHits = reader.ReadInt(); m_RegenDelay = reader.ReadTimeSpan(); m_EndTime = reader.ReadDateTime(); m_StartTime = reader.ReadDateTime(); m_OldLocation = reader.ReadPoint3D(); m_OldMap = reader.ReadMap(); if (m_Hits <= 0 && m_EndTime.Subtract(DateTime.Now) > TimeSpan.Zero) { InternalTimer timer = new InternalTimer(m_EndTime.Subtract(DateTime.Now), this); timer.Start(); } }
public override void OnDoubleClick(Mobile from) { if (_activated) { from.SendMessage("This candle is already burning!"); return; } if (IsLockedDown) { BaseHouse house = BaseHouse.FindHouseAt(from); if (house != null && house.IsCoOwner(from)) { if (ChargeTime <= 0) { if (Charges > 0) { Timer t = new InternalTimer(this); t.Start(); Charges--; _activated = true; from.SendMessage("A wonderful aroma fills the air!"); ChargeTime = MaxChargeTime; Ignite(); return; } } } else { from.SendLocalizedMessage(502436); // That is not accessible. } } else { from.SendLocalizedMessage(502692); // This must be in a house and be locked down to work. } base.OnDoubleClick(from); }
public override void OnHit(Mobile attacker, Mobile defender, int damage) { if (Registry.Contains(defender) || !Validate(attacker) || !CheckMana(attacker, true)) { return; } ClearCurrentAbility(attacker); attacker.SendLocalizedMessage(1063358); // You deliver a talon strike! defender.SendLocalizedMessage(1063359); // Your attacker delivers a talon strike! defender.FixedParticles(0x373A, 1, 17, 0x26BC, 0x662, 0, EffectLayer.Waist); Timer t = new InternalTimer(defender, (int)(10.0 * (attacker.Skills[SkillName.Ninjitsu].Value - 50.0) / 70.0 + 5), attacker); //5 - 15 damage t.Start(); Registry.Add(defender, t); }
protected virtual void ApplyEffect(PlayerMobile pm) { if (m_EffectDuration == TimeSpan.Zero) { m_EffectDuration = TimeSpan.FromMinutes(30); } InternalTimer t = new InternalTimer(pm, m_EffectType, m_EffectDuration); t.Start(); ThieveConsumableInfo info = new ThieveConsumableInfo(t, this.m_EffectType); if (EffectTable.ContainsKey(pm)) { RemoveEffect(pm, EffectTable[pm].Effect); } EffectTable.Add(pm, info); this.Consume(); }
protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } if (CookableFood.IsHeatSource(targeted)) { if (from.BeginAction(typeof(CookableFood))) { from.PlaySound(0x225); m_Item.Consume(); InternalTimer t = new InternalTimer(from, targeted as IPoint3D, from.Map, m_Item); t.Start(); } else { from.SendLocalizedMessage(500119); } } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } m_Item.Consume(); if (targeted is BowlFlour flour) { flour.Delete(); from.AddToBackpack(new CakeMix()); } else if (targeted is Campfire campfire) { from.PlaySound(0x225); var t = new InternalTimer(from, campfire); t.Start(); } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } if (targeted is BowlFlour) { m_Item.Delete(); ((BowlFlour)targeted).Delete(); from.AddToBackpack(new CakeMix()); } else if (targeted is Campfire) { from.PlaySound(0x225); m_Item.Delete(); InternalTimer t = new InternalTimer(from, (Campfire)targeted); t.Start(); } }
public override void OnHit(Mobile attacker, Mobile defender, int damage) { if (Registry.Contains(defender) || !this.Validate(attacker) || !this.CheckMana(attacker, true)) { return; } ClearCurrentAbility(attacker); attacker.SendLocalizedMessage(1063358); // You deliver a talon strike! defender.SendLocalizedMessage(1063359); // Your attacker delivers a talon strike! defender.FixedParticles(0x373A, 1, 17, 0x26BC, 0x662, 0, EffectLayer.Waist); Timer t = new InternalTimer(defender, (int)(10.0 * (attacker.Skills[SkillName.Ninjitsu].Value - 50.0) / 70.0 + 5), attacker); //5 - 15 damage BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.TalonStrike, 1028856, 1151309, TimeSpan.FromSeconds(5.0), defender, "40")); t.Start(); Registry.Add(defender, t); }
public static void BeginWound(Mobile m, TimeSpan duration) { if (m_Table.ContainsKey(m)) { EndWound(m, true); } if (m_EffectReduction.Contains(m)) { double d = duration.TotalSeconds; duration = TimeSpan.FromSeconds(d / 2); } Timer t = new InternalTimer(m, duration); m_Table[m] = t; t.Start(); m.YellowHealthbar = true; BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.MortalStrike, 1075810, 1075811, duration, m)); }
private void RestartTick() { if (m_TimerEnabled) { if (m_LastEvent + m_EventRate <= DateTime.UtcNow) { KickStart = true; m_LastEvent = DateTime.UtcNow; } if (m_RestartTimer != null) { m_RestartTimer.Stop(); } if (!m_Running && m_RestartTimer != null) { m_RestartTimer = new InternalTimer(this, TimeSpan.FromSeconds(1.0)); m_RestartTimer.Start(); } } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 1: { m_AcceptingPlayers = (bool)reader.ReadBool(); goto case 0; } case 0: { m_Running = (bool)reader.ReadBool(); m_StartLocation = (Point3D)reader.ReadPoint3D(); m_MapLocation = (Map)reader.ReadMap(); m_LastReset = (DateTime)reader.ReadDateTime(); m_TimerEnabled = (bool)reader.ReadBool(); m_EventRate = (TimeSpan)reader.ReadTimeSpan(); m_LastEvent = (DateTime)reader.ReadDateTime(); m_BroadcastHue = (int)reader.ReadInt(); break; } } if (version == 0) { m_LastReset = DateTime.UtcNow; } m_RestartTimer = new InternalTimer(this, TimeSpan.FromSeconds(1.0)); if (m_TimerEnabled) { m_RestartTimer.Start(); } }
public override void OnHit(Mobile attacker, Mobile defender, int damage) { if (!Validate(attacker) || !CheckMana(attacker, true)) { return; } ClearCurrentAbility(attacker); attacker.SendLocalizedMessage(1060165); // You have delivered a concussion! defender.SendLocalizedMessage(1060166); // You feel disoriented! defender.PlaySound(0x213); defender.FixedParticles(0x377A, 1, 32, 9949, 1153, 0, EffectLayer.Head); Effects.SendMovingParticles(new DummyEntity(Serial.Zero, new Point3D(defender.X, defender.Y, defender.Z + 10), defender.Map), new DummyEntity(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); defender.Damage(10, attacker); InternalTimer timer; int mana; if (m_Table.ContainsKey(defender)) { timer = m_Table[defender]; timer.Stop(); mana = timer.Mana; } else { mana = defender.Mana / 2; defender.Mana -= mana; } timer = m_Table[defender] = new InternalTimer(defender, mana); timer.Start(); }
public override void OnHit(Mobile attacker, Mobile defender, int damage) { if (!this.Validate(attacker) || !this.CheckMana(attacker, true)) { return; } ClearCurrentAbility(attacker); attacker.SendMessage("You attack with Nature's Fury"); defender.SendMessage("You are attacked by Nature's Fury"); defender.PlaySound(0x22F); defender.FixedParticles(0x36CB, 1, 9, 9911, 67, 5, EffectLayer.Head); defender.FixedParticles(0x374A, 1, 17, 9502, 1108, 4, (EffectLayer)255); if (!m_Table.Contains(defender)) { Timer t = new InternalTimer(defender, attacker); t.Start(); m_Table[defender] = t; } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } if (targeted is ILockpickable) { Item item = (Item)targeted; from.Direction = from.GetDirectionTo(item); if (((ILockpickable)targeted).Locked) { if (m_Table[from] != null) { from.SendLocalizedMessage(500119); // You must wait to perform another action. return; } from.PlaySound(0x241); InternalTimer t = new InternalTimer(from, (ILockpickable)targeted, m_Item); m_Table[from] = t; t.Start(); } else { // The door is not locked from.SendLocalizedMessage(502069); // This does not appear to be locked } } else { from.SendLocalizedMessage(501666); // You can't unlock that! } }
public void Target(Mobile tinker, Mobile assembly) { if (Deleted || !tinker.CanSee(this)) { return; } int number = -1; if (!tinker.CanSee(assembly)) { number = 500237; // Target can not be seen. } else if (assembly.Hits == assembly.HitsMax) { number = 1044281; // That being is not damaged! } else { if (!tinker.BeginAction(typeof(AssemblyRepairKit))) { number = 500310; // You are busy with something else } else { TimeSpan duration = TimeSpan.FromSeconds(8); InternalTimer t = new InternalTimer(this, tinker, assembly, duration); t.Start(); tinker.SendMessage("You begin to repair the assembly"); return; } } tinker.SendLocalizedMessage(number); }
public override void OnHit(Mobile attacker, Mobile defender, int damage) { if (!Validate(attacker) || !CheckMana(attacker, true)) { return; } ClearCurrentAbility(attacker); attacker.SendLocalizedMessage(1074374); // You attack your enemy with the force of nature! defender.SendLocalizedMessage(1074375); // You are assaulted with great force! defender.PlaySound(0x22F); defender.FixedParticles(0x36CB, 1, 9, 9911, 67, 5, EffectLayer.Head); defender.FixedParticles(0x374A, 1, 17, 9502, 1108, 4, (EffectLayer)255); if (!m_Table.Contains(defender)) { Timer t = new InternalTimer(defender, attacker); t.Start(); m_Table[defender] = t; } }
public MushroomGateCircle(Point3D target, Map map, int item) { m_ItemID = item; // AddComponent( new AddonComponent( 0xD10 ), 0, 0, 0 ); // AddComponent( new AddonComponent( 0x373A ), 0, 0, 1 ); // AddComponent( new AddonComponent( 0xD11 ), -1, 1, 0 ); // AddComponent( new AddonComponent( 0xD0C ), -0, 2, 0 ); // AddComponent( new AddonComponent( 0xD0D ), 1, 1, 0 ); // AddComponent( new AddonComponent( 0xD0E ), 2, 0, 0 ); // AddComponent( new AddonComponent( 0xD0F ), 1, -1, 0 ); // Map = map; if (ShowFeluccaWarning && map == Map.Felucca) { Hue = 1175; ItemID = m_ItemID; } // Dispellable = true; InternalTimer t = new InternalTimer(this); t.Start(); }
public override bool OnMoveOver(Mobile m) { if (m.Alive && (m.AccessLevel == AccessLevel.Player || !m.Hidden)) { if (m.Player) { if (m.Female) { Effects.PlaySound(Location, Map, Utility.RandomMinMax(0x53B, 0x53D)); } else { Effects.PlaySound(Location, Map, Utility.RandomMinMax(0x53E, 0x540)); } } if (m_Timer?.Running != true) { (m_Timer = new InternalTimer(m)).Start(); } } return(true); }
protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } if (CookableFood.IsHeatSource(targeted)) { if (from.BeginAction(typeof(CookableFood))) { from.PlaySound(0x225); m_Item.Consume(); InternalTimer t = new InternalTimer(from, targeted as IPoint3D, from.Map, m_Item); t.Start(); } else { from.SendMessage("Vous devez attendre avant de faire cuire à nouveau"); // You must wait to perform another action } } }
public override bool OnMoveOver(Mobile m) { if (m.Alive && (m.IsPlayer() || !m.Hidden)) { if (m.Player) { if (m.Female) { Effects.PlaySound(this.Location, this.Map, Utility.RandomMinMax(0x53B, 0x53D)); } else { Effects.PlaySound(this.Location, this.Map, Utility.RandomMinMax(0x53E, 0x540)); } } if (this.m_Timer == null || !this.m_Timer.Running) { (this.m_Timer = new InternalTimer(m)).Start(); } } return(true); }
protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } if (targeted is BowlFlour) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You made a cake mix"); if (m_Item.Parent == null) { new CakeMix().MoveToWorld(m_Item.Location, m_Item.Map); } else { from.AddToBackpack(new CakeMix()); } m_Item.Consume(); ((BowlFlour)targeted).Use(from); } else if (targeted is JarHoney) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You made a cookie mix"); if (m_Item.Parent == null) { new CookieMix().MoveToWorld(m_Item.Location, m_Item.Map); } else { from.AddToBackpack(new CookieMix()); } m_Item.Consume(); ((JarHoney)targeted).Consume(); } else if (IsHeatSource(targeted)) { if (from.BeginAction(typeof(Item))) { from.PlaySound(0x225); m_Item.Consume(); InternalTimer t = new InternalTimer(from, targeted as IPoint3D, from.Map, m_Item.MinSkill, m_Item.MaxSkill, m_Item.CookedFood); t.Start(); } else { from.SendLocalizedMessage(500119); } } }
protected override void OnTarget(Mobile from, object targeted) { BaseBoat bt = null; Point3D loc = new Point3D(); //Check we have a hook if (m_Hook == null) { return; } //first do all our validation *again* to thwart sneaky players! //Has to be in backpack and on a boat if (!m_Hook.IsChildOf(from.Backpack)) { from.SendMessage("That must be in your backpack to use it."); return; } bt = BaseBoat.FindBoatAt(from); if (bt == null || !bt.IsOnDeck(from)) { from.SendMessage("You must be on a boat to use this."); return; } bt = null; //Disallow the targetting of movable Items if (targeted is Item) { Item i = (Item)targeted; if (i.Movable == true) { from.SendMessage("You must grapple onto something more sturdy!"); return; } //this item is immovable, see if there's a boat at its location bt = BaseBoat.FindBoatAt(i); loc = i.Location; } // A static target is a good candidate else if (targeted is StaticTarget) { //see if there's a boat at its location StaticTarget st = (StaticTarget)targeted; // Boats seem to have both TileFlag.Surface and TileFlag.Impassable flags on different parts of the deck if ((st.Flags & TileFlag.Wet) == 0) { bt = BaseBoat.FindBoatAt(st.Location, from.Map, 16); loc = st.Location; } } //If bt is still null, something was targeted not on a ship. if (bt != null) { //Prevent targeting their own boat if (bt.IsOnDeck(from)) { from.SendMessage("You can't grapple the boat you are on!"); return; } if (bt.IsMoving) { //Play a "rope being thrown" type sound effect (bellows :P) Effects.PlaySound(from.Location, from.Map, 0x2B2); from.SendMessage("You fail to get a good hook into the boat."); return; } //If there any players who are alive then the hook gets pusehd back in ye olde water.. foreach (Mobile m in bt.GetMobilesOnDeck()) { if (m is PlayerMobile && m.Alive && m.AccessLevel <= AccessLevel.Player) { from.SendMessage("You grapple the boat, but the hook is tossed back into the water."); //Play a random water splashy sound effect! Effects.PlaySound(from.Location, from.Map, 36 + Utility.Random(3) + 1); return; } } //Success! from.SendMessage("You grapple the boat!"); //This is the bellows and double arrow hit played together :D Effects.PlaySound(from.Location, from.Map, 0x2B2); Effects.PlaySound(from.Location, from.Map, 0x523); //Consume the grappling hook m_Hook.Consume(); //Start the timer (approx the same time as the sound effects finish) InternalTimer t = new InternalTimer(from, bt); t.Start(); } else { from.SendMessage("That's not a boat!"); } }
public InternalItem() { InternalTimer t = new InternalTimer(this); t.Start(); }
public override void OnHit(Mobile attacker, Mobile defender, int damage) { if (!Validate(attacker)) //Mana check after check that there are targets { return; } ClearCurrentAbility(attacker); Map map = attacker.Map; if (map == null) { return; } BaseWeapon weapon = attacker.Weapon as BaseWeapon; if (weapon == null) { return; } ArrayList list = new ArrayList(); foreach (Mobile m in attacker.GetMobilesInRange(1)) { list.Add(m); } ArrayList targets = new ArrayList(); for (int i = 0; i < list.Count; ++i) { Mobile m = (Mobile)list[i]; if (m != defender && m != attacker && SpellHelper.ValidIndirectTarget(attacker, m)) { if (m == null || m.Deleted || m.Map != attacker.Map || !m.Alive || !attacker.CanSee(m) || !attacker.CanBeHarmful(m)) { continue; } if (!attacker.InRange(m, weapon.MaxRange)) { continue; } if (attacker.InLOS(m)) { targets.Add(m); } } } if (targets.Count > 0) { if (!CheckMana(attacker, true)) { return; } attacker.FixedEffect(0x3728, 10, 15); attacker.PlaySound(0x2A1); // 5-15 damage int amount = (int)(10.0 * ((Math.Max(attacker.Skills[SkillName.Bushido].Value, attacker.Skills[SkillName.Ninjitsu].Value) - 50.0) / 70.0 + 5)); for (int i = 0; i < targets.Count; ++i) { Mobile m = (Mobile)targets[i]; attacker.DoHarmful(m, true); Timer t = Registry[m] as Timer; if (t != null) { t.Stop(); Registry.Remove(m); } t = new InternalTimer(attacker, m, amount); t.Start(); Registry.Add(m, t); } Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(RepeatEffect), attacker); } }
public AwesomeDisturbingPortraitComponent() : base(0x2A5D) { m_Timer = new InternalTimer(this, TimeSpan.FromSeconds(1)); m_Timer.Start(); }
protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } if (IsHeatSource(targeted)) { if (from.BeginAction(typeof(Item))) { from.PlaySound(0x225); m_Item.Consume(); InternalTimer t = new InternalTimer(from, targeted as IPoint3D, from.Map, m_Item.MinSkill, m_Item.MaxSkill, m_Item.CookedFood); t.Start(); } else { from.SendLocalizedMessage(500119); } } else if (m_Item.Desc.Length > 80) { from.SendMessage("The pizza has enough toppings already."); return; } else if (targeted is Apple) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add apple to the pizza."); m_Item.Desc += ", apple"; ((Item)targeted).Consume(); } else if (targeted is Banana || targeted is Bananas) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add banana to the pizza."); m_Item.Desc += ", banana"; ((Item)targeted).Consume(); } else if (targeted is Cantaloupe) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add cantaloupe to the pizza."); m_Item.Desc += ", cantaloupe"; ((Item)targeted).Consume(); } else if (targeted is Coconut || targeted is SplitCoconut) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add coconut to the pizza."); m_Item.Desc += ", coconut"; ((Item)targeted).Consume(); } else if (targeted is Cucumber) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add cucumber to the pizza."); m_Item.Desc += ", cucumber"; ((Item)targeted).Consume(); } else if (targeted is Dates) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add dates to the pizza."); m_Item.Desc += ", date"; ((Item)targeted).Consume(); } else if (targeted is Grapes) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add grape to the pizza."); m_Item.Desc += ", grape"; ((Item)targeted).Consume(); } else if (targeted is HoneydewMelon) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add honeydew melon to the pizza."); m_Item.Desc += ", honeydew melon"; ((Item)targeted).Consume(); } else if (targeted is Lemon) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add lemon to the pizza."); m_Item.Desc += ", lemon"; ((Item)targeted).Consume(); } else if (targeted is Lime) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add lime to the pizza."); m_Item.Desc += ", lime"; ((Item)targeted).Consume(); } else if (targeted is Orange) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add orange to the pizza."); m_Item.Desc += ", orange"; ((Item)targeted).Consume(); } else if (targeted is Peach) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add peach to the pizza."); m_Item.Desc += ", peach"; ((Item)targeted).Consume(); } else if (targeted is Pear) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add pear to the pizza."); m_Item.Desc += ", pear"; ((Item)targeted).Consume(); } else if (targeted is Pumpkin) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add pumpkin to the pizza."); m_Item.Desc += ", pumpkin"; ((Item)targeted).Consume(); } else if (targeted is Tomato) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add tomato to the pizza."); m_Item.Desc += ", tomato"; ((Item)targeted).Consume(); } else if (targeted is Watermelon) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add watermelon to the pizza."); m_Item.Desc += ", watermelon"; ((Item)targeted).Consume(); } else if (targeted is RawBacon || targeted is Bacon) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add bacon to the pizza."); m_Item.Desc += ", bacon"; ((Item)targeted).Consume(); } else if (targeted is ChickenLeg || targeted is RawChickenLeg) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add chicken meat to the pizza."); m_Item.Desc += ", chicken"; ((Item)targeted).Consume(); } else if (targeted is CookedBird || targeted is RawBird) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add bird meat to the pizza."); m_Item.Desc += ", bird"; ((Item)targeted).Consume(); } else if (targeted is FishSteak || targeted is RawFishSteak) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add fish to the pizza."); m_Item.Desc += ", fish"; ((Item)targeted).Consume(); } else if (targeted is RawHamSlices || targeted is HamSlices) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add ham to the pizza."); m_Item.Desc += ", ham"; ((Item)targeted).Consume(); } else if (targeted is LambLeg || targeted is RawLambLeg) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add lamb meat to the pizza."); m_Item.Desc += ", lamb"; ((Item)targeted).Consume(); } else if (targeted is Ribs || targeted is RawRibs) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add ribs to the pizza."); m_Item.Desc += ", ribs"; ((Item)targeted).Consume(); } else if (targeted is Sausage) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add sausage to the pizza."); m_Item.Desc += ", sausage"; ((Item)targeted).Consume(); } else if (targeted is Dough) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You make the pizza a thick crust one."); m_Item.Desc += ", thick crust"; ((Item)targeted).Consume(); } else if (targeted is TanMushroom || targeted is RedMushroom) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add mushrooms to the pizza."); m_Item.Desc += ", mushrooms"; ((Item)targeted).Consume(); } else if (targeted is Silverleaf) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add silverleaf to the pizza."); m_Item.Desc += ", silverleaf"; ((Item)targeted).Consume(); } else if (targeted is Spam) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add spam to the pizza."); m_Item.Desc += ", spam"; ((Item)targeted).Consume(); } else if (targeted is Garlic) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add garlic to the pizza."); m_Item.Desc += ", garlic"; ((Item)targeted).Consume(); } else if (targeted is Ginseng) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add ginseng to the pizza."); m_Item.Desc += ", ginseng"; ((Item)targeted).Consume(); } else if (targeted is Cabbage) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add cabbage to the pizza."); m_Item.Desc += ", cabbage"; ((Item)targeted).Consume(); } else if (targeted is Carrot) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add carrot to the pizza."); m_Item.Desc += ", carrot"; ((Item)targeted).Consume(); } else if (targeted is Corn) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add corn to the pizza."); m_Item.Desc += ", corn"; ((Item)targeted).Consume(); } else if (targeted is Lettuce) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add lettuce to the pizza."); m_Item.Desc += ", lettuce"; ((Item)targeted).Consume(); } else if (targeted is Onion) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add onion to the pizza."); m_Item.Desc += ", onion"; ((Item)targeted).Consume(); } else if (targeted is Turnip) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add turnip to the pizza."); m_Item.Desc += ", turnip"; ((Item)targeted).Consume(); } else if (targeted is BrightEggs || targeted is EasterEggs) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add an easter egg to the pizza!"); m_Item.Desc += ", surprise!"; m_Item.Hue = ((Item)targeted).Hue; from.AddToBackpack(new Eggshells(m_Item.Hue)); ((Item)targeted).Consume(); } else if (targeted is Eggs) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add egg to the pizza."); m_Item.Desc += ", egg"; from.AddToBackpack(new Eggshells(m_Item.Hue)); ((Item)targeted).Consume(); } else if (targeted is FriedEggs) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add egg to the pizza."); m_Item.Desc += ", egg"; ((Item)targeted).Consume(); } else if (targeted is FishHeads) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add fish heads to the pizza."); m_Item.Desc += ", fish head"; ((Item)targeted).Consume(); } else if (targeted is CheeseWedgeSmall) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add extra cheese to the pizza."); m_Item.Desc += ", extra cheese"; ((Item)targeted).Consume(); } else if (targeted is RedRaspberry || targeted is BlackRaspberry) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add raspberries to the pizza."); m_Item.Desc += ", raspberry"; ((Item)targeted).Consume(); } else if (targeted is Strawberries) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add strawberries to the pizza."); m_Item.Desc += ", strawberry"; ((Item)targeted).Consume(); } else if (targeted is RawHam || targeted is Ham || targeted is RawBaconSlab || targeted is BaconSlab || targeted is CheeseWheel || targeted is CheeseWedge) { from.SendMessage("That portion is too large. Use a bladed object to cut it up first."); return; } try { if (targeted is FromageDeChevre || targeted is FromageDeChevreWedge || targeted is FromageDeBrebis || targeted is FromageDeBrebisWedge || targeted is FromageDeVache || targeted is FromageDeVacheWedge) { from.SendMessage("That portion is too large. Use a bladed object to cut it up first."); return; } else if (targeted is FromageDeVacheWedgeSmall) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add extra cheese to the pizza."); m_Item.Desc += ", extra cheese"; ((Item)targeted).Consume(); } else if (targeted is FromageDeChevreWedgeSmall) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add goat cheese to the pizza."); m_Item.Desc += ", goat cheese"; ((Item)targeted).Consume(); } else if (targeted is FromageDeBrebisWedgeSmall) { if (!((Item)targeted).Movable) { return; } from.SendMessage("You add sheep cheese to the pizza."); m_Item.Desc += ", sheep cheese"; ((Item)targeted).Consume(); } } catch { } }
public override void OnHit(Mobile attacker, Mobile defender, int damage) { if (!Validate(attacker)) //Mana check after check that there are targets { return; } ClearCurrentAbility(attacker); Map map = attacker.Map; if (map == null) { return; } BaseWeapon weapon = attacker.Weapon as BaseWeapon; if (weapon == null) { return; } List <Mobile> targets = new List <Mobile>(); foreach (IDamageable target in SpellHelper.AcquireIndirectTargets(attacker, attacker.Location, attacker.Map, 2)) { if (target is Mobile mobile) { targets.Add(mobile); } } if (targets.Count > 0) { if (!CheckMana(attacker, true)) { return; } attacker.FixedEffect(0x3728, 10, 15); attacker.PlaySound(0x2A1); if (m_Registry.ContainsKey(attacker)) { RemoveFromRegistry(attacker); } m_Registry[attacker] = new InternalTimer(attacker, targets); for (var index = 0; index < targets.Count; index++) { Mobile target = targets[index]; if (target is PlayerMobile pm) { BuffInfo.AddBuff(pm, new BuffInfo(BuffIcon.SplinteringEffect, 1153804, 1028852, TimeSpan.FromSeconds(2.0), pm)); } } if (defender is PlayerMobile && attacker is PlayerMobile) { defender.SendSpeedControl(SpeedControlType.WalkSpeed); BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.SplinteringEffect, 1153804, 1152144, TimeSpan.FromSeconds(2.0), defender)); Timer.DelayCall(TimeSpan.FromSeconds(2), mob => mob.SendSpeedControl(SpeedControlType.Disable), defender); } if (attacker is BaseCreature bc) { PetTrainingHelper.OnWeaponAbilityUsed(bc, SkillName.Ninjitsu); } } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } if (IsHeatSource(targeted)) { if (from.BeginAction(typeof(Item))) { from.PlaySound(0x225); m_Item.Consume(); InternalTimer t = new InternalTimer(from, targeted as IPoint3D, from.Map, m_Item.MinSkill, m_Item.MaxSkill, m_Item.CookedFood); t.Start(); } else { from.SendLocalizedMessage(500119); // You must wait to perform another action } } else if (targeted is Eggs) { if (!((Item)targeted).Movable) { return; } if (((Item)targeted).Parent == null) { new UnbakedQuiche().MoveToWorld(((Item)targeted).Location, ((Item)targeted).Map); } else { from.AddToBackpack(new UnbakedQuiche()); } if (m_Item.Parent == null) { new Eggshells(m_Item.Hue).MoveToWorld(m_Item.Location, (m_Item.Map)); } else { from.AddToBackpack(new Eggshells(m_Item.Hue)); } m_Item.Consume(); ((Item)targeted).Consume(); from.SendMessage("You made an unbaked quiche"); } else if (targeted is CheeseWedgeSmall) // plain pizza will target others to add ingredients. { if (!((Item)targeted).Movable) { return; } if (((Item)targeted).Parent == null) { new UncookedPizza("cheese").MoveToWorld(((Item)targeted).Location, ((Item)targeted).Map); } else { from.AddToBackpack(new UncookedPizza("cheese")); } m_Item.Consume(); ((Item)targeted).Consume(); from.SendMessage("You made an uncooked cheese pizza"); } else if (targeted is JarHoney) { if (!((Item)targeted).Movable) { return; } if (((Item)targeted).Parent == null) { new SweetDough().MoveToWorld(((Item)targeted).Location, ((Item)targeted).Map); } else { from.AddToBackpack(new SweetDough()); } m_Item.Consume(); ((Item)targeted).Consume(); from.SendMessage("You made a sweet dough"); } else if (targeted is ChickenLeg || targeted is RawChickenLeg) { if (!((Item)targeted).Movable) { return; } if (((Item)targeted).Parent == null) { new SweetDough().MoveToWorld(((Item)targeted).Location, ((Item)targeted).Map); } else { from.AddToBackpack(new UnbakedChickenPotPie()); } m_Item.Consume(); ((Item)targeted).Consume(); from.SendMessage("You made a chicken pot pie"); } else if (targeted is Apple) { if (!((Item)targeted).Movable) { return; } if (((Item)targeted).Parent == null) { new UnbakedApplePie().MoveToWorld(((Item)targeted).Location, ((Item)targeted).Map); } else { from.AddToBackpack(new UnbakedApplePie()); } m_Item.Consume(); ((Item)targeted).Consume(); from.SendMessage("You made an unbaked apple pie"); } else if (targeted is Peach) { if (!((Item)targeted).Movable) { return; } if (((Item)targeted).Parent == null) { new UnbakedPeachCobbler().MoveToWorld(((Item)targeted).Location, ((Item)targeted).Map); } else { from.AddToBackpack(new UnbakedPeachCobbler()); } m_Item.Consume(); ((Item)targeted).Consume(); from.SendMessage("You made an unbaked peach cobbler"); } else if (targeted is Pumpkin) { if (!((Item)targeted).Movable) { return; } if (((Item)targeted).Parent == null) { new UnbakedPumpkinPie().MoveToWorld(((Item)targeted).Location, ((Item)targeted).Map); } else { from.AddToBackpack(new UnbakedPumpkinPie()); } m_Item.Consume(); ((Item)targeted).Consume(); from.SendMessage("You made an unbaked pumpkin pie"); } else if (targeted is Lime) { if (!((Item)targeted).Movable) { return; } if (((Item)targeted).Parent == null) { new UnbakedKeyLimePie().MoveToWorld(((Item)targeted).Location, ((Item)targeted).Map); } else { from.AddToBackpack(new UnbakedKeyLimePie()); } m_Item.Consume(); ((Item)targeted).Consume(); from.SendMessage("You made an unbaked key lime pie"); } else if (targeted is Dough) { if (!((Item)targeted).Movable) { return; } if (((Item)targeted).Parent == null) { new UncookedFrenchBread().MoveToWorld(((Item)targeted).Location, ((Item)targeted).Map); } else { from.AddToBackpack(new UncookedFrenchBread()); } m_Item.Consume(); ((Item)targeted).Consume(); from.SendMessage("You ... add some more dough onto the dough"); } else if (targeted is UncookedFrenchBread) { if (!((Item)targeted).Movable) { return; } if (((Item)targeted).Parent == null) { new UncookedDonuts().MoveToWorld(((Item)targeted).Location, ((Item)targeted).Map); } else { from.AddToBackpack(new UncookedDonuts()); } m_Item.Consume(); ((Item)targeted).Consume(); from.SendMessage("You fumble around for a bit with even more dough, and eventually make these round doughy things"); } try { if (targeted is FromageDeVacheWedgeSmall) // plain pizza will target others to add ingredients. { if (!((Item)targeted).Movable) { return; } if (((Item)targeted).Parent == null) { new UncookedPizza("cheese").MoveToWorld(((Item)targeted).Location, ((Item)targeted).Map); } else { from.AddToBackpack(new UncookedPizza("cheese")); } m_Item.Consume(); ((Item)targeted).Consume(); from.SendMessage("You made an uncooked cheese pizza"); } else if (targeted is FromageDeBrebisWedgeSmall) // sheep cheese { if (!((Item)targeted).Movable) { return; } if (((Item)targeted).Parent == null) { new UncookedPizza("sheep cheese").MoveToWorld(((Item)targeted).Location, ((Item)targeted).Map); } else { from.AddToBackpack(new UncookedPizza("sheep cheese")); } m_Item.Consume(); ((Item)targeted).Consume(); from.SendMessage("You made an uncooked sheep cheese pizza"); } else if (targeted is FromageDeChevreWedgeSmall) // goat cheese { if (!((Item)targeted).Movable) { return; } if (((Item)targeted).Parent == null) { new UncookedPizza("goat cheese").MoveToWorld(((Item)targeted).Location, ((Item)targeted).Map); } else { from.AddToBackpack(new UncookedPizza("goat cheese")); } m_Item.Consume(); ((Item)targeted).Consume(); from.SendMessage("You made an uncooked goat cheese pizza"); } } catch { } }
public override void OnHit(Mobile attacker, Mobile defender, int damage) { if (!Validate(attacker)) //Mana check after check that there are targets { return; } ClearCurrentAbility(attacker); Map map = attacker.Map; if (map == null) { return; } BaseWeapon weapon = attacker.Weapon as BaseWeapon; if (weapon == null) { return; } List <Mobile> targets = new List <Mobile>(); targets.Add(defender); IPooledEnumerable eable = attacker.GetMobilesInRange(2); foreach (Mobile m in eable) { if (m != attacker && SpellHelper.ValidIndirectTarget(attacker, m)) { if (m == null || m.Deleted || m.Map != attacker.Map || !m.Alive || !attacker.CanSee(m) || !attacker.CanBeHarmful(m) || !attacker.InLOS(m)) { continue; } if (m is PlayerMobile) { BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.SplinteringEffect, 1153804, 1028852, TimeSpan.FromSeconds(2.0), m)); } targets.Add(m); } } eable.Free(); if (targets.Count > 0) { if (!CheckMana(attacker, true)) { return; } attacker.FixedEffect(0x3728, 10, 15); attacker.PlaySound(0x2A1); if (m_Registry.ContainsKey(attacker)) { RemoveFromRegistry(attacker); } m_Registry[attacker] = new InternalTimer(attacker, targets); if (defender is PlayerMobile) { defender.SendSpeedControl(SpeedControlType.WalkSpeed); BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.SplinteringEffect, 1153804, 1152144, TimeSpan.FromSeconds(2.0), defender)); Timer.DelayCall <Mobile>(TimeSpan.FromSeconds(2), mob => mob.SendSpeedControl(SpeedControlType.Disable), defender); } } }