public override void OnDoubleClick(Mobile from) { if (IsLockedDown) { if (!from.InRange(this.Location, 2)) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. return; } //IHouse house = HousingHelper.FindHouseAt( from ); BaseHouse house = BaseHouse.FindHouseAt(from); if (house != null) { from.PublicOverheadMessage(MessageType.Regular, 0x3B2, 1071131); // Praying… if (m_CooldownList.Contains(from)) { from.SendLocalizedMessage(1071145); // In order to summon an undead again, you have to wait for at least 90 minutes. } else { Timer.DelayCall(TimeSpan.FromSeconds(5.0), new TimerCallback( delegate { // Add the skill mod SkillMod mod = new DefaultSkillMod(SkillName.SpiritSpeak, true, 5.0); mod.ObeyCap = true; from.AddSkillMod(mod); m_Table[from] = new BonusContext(Timer.DelayCall(Duration, new TimerStateCallback <Mobile>(RemoveEffect), from), mod); // Set the cooldown m_CooldownList.Add(from); Timer.DelayCall(Cooldown, new TimerCallback(delegate { m_CooldownList.Remove(from); })); // Spawn our undead friend :) SummonUndead(from); from.SendLocalizedMessage(1071148); // You feel a greater sense. })); } } else { from.SendLocalizedMessage(502436); // That is not accessible. } } else { from.SendLocalizedMessage(502692); // This must be in a house and be locked down to work. } }
public async Task Get_wi103193_price() { var logger = new Mock <ILogger <ProductPriceDataReader> >(); using (var client = new System.Net.Http.HttpClient()) { var productcode = 103193; var reader = new ProductPriceDataReader(client, logger.Object); var context = new BonusContext() { Items = new BonusProductEvent[] { new BonusProductEvent(productcode) } }; await reader.DoWork(context); context.Items[0].FromPriceInCents.ShouldBeGreaterThan(1000); } }
private static void RemoveEffect(Mobile m) { if (m_Table.ContainsKey(m)) { BonusContext context = m_Table[m]; if (context != null) { if (context.Timer != null) { context.Timer.Stop(); } if (context.Mod != null) { m.RemoveSkillMod(context.Mod); } } m.SendLocalizedMessage(1071146); // Your sense goes to normal. m_Table.Remove(m); } }
public override void OnDoubleClick( Mobile from ) { if ( IsLockedDown ) { if ( !from.InRange( this.Location, 2 ) ) { from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. return; } IHouse house = HousingHelper.FindHouseAt( from ); if ( house != null ) { from.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1071131 ); // Praying… if ( m_CooldownList.Contains( from ) ) { from.SendLocalizedMessage( 1071145 ); // In order to summon an undead again, you have to wait for at least 90 minutes. } else { Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerCallback( delegate { // Add the skill mod SkillMod mod = new DefaultSkillMod( SkillName.SpiritSpeak, true, 5.0 ); mod.ObeyCap = true; from.AddSkillMod( mod ); m_Table[from] = new BonusContext( Timer.DelayCall( Duration, new TimerStateCallback<Mobile>( RemoveEffect ), from ), mod ); // Set the cooldown m_CooldownList.Add( from ); Timer.DelayCall( Cooldown, new TimerCallback( delegate { m_CooldownList.Remove( from ); } ) ); // Spawn our undead friend :) SummonUndead( from ); from.SendLocalizedMessage( 1071148 ); // You feel a greater sense. } ) ); } } else from.SendLocalizedMessage( 502436 ); // That is not accessible. } else from.SendLocalizedMessage( 502692 ); // This must be in a house and be locked down to work. }