protected override void OnTick() { foreach (NetState state in m_Player.GetClientsInRange(15)) { if (m_Count % 2 != 0) { state.Mobile.PlaySound(287); } else { state.Mobile.PlaySound(288); } } m_Count++; if (m_Count == 2) { EffectTimer et = new EffectTimer(m_Player); et.Start(); } if (m_Count > 4) { Stop(); return; } }
private static void PlaySound( Mobile m, int index, bool toAll ) { Map map = m.Map; if ( map == null ) return; CommandLogging.WriteLine( m, "{0} {1} playing sound {2} (toAll={3})", m.AccessLevel, CommandLogging.Format( m ), index, toAll ); Packet p = new PlaySound( index, m.Location ); p.Acquire(); foreach ( NetState state in m.GetClientsInRange( 12 ) ) { if ( toAll || state.Mobile.CanSee( m ) ) state.Send( p ); } p.Release(); }
private static void SendToStaffMessage(Mobile from, string text) { Packet p = null; foreach (NetState ns in from.GetClientsInRange(8)) { Mobile mob = ns.Mobile; if (mob != null && mob.AccessLevel >= AccessLevel.GameMaster && mob.AccessLevel > from.AccessLevel) { if (p == null) p = Packet.Acquire(new UnicodeMessage(from.Serial, from.Body, MessageType.Regular, from.SpeechHue, 3, from.Language, from.Name, text)); ns.Send(p); } } Packet.Release(p); }
public override void OnPoisoned(Mobile from, Poison poison, Poison oldPoison) { if (poison != null) { foreach (NetState ns in from.GetClientsInRange(8)) { Mobile mob = ns.Mobile; if (mob == this) { this.LocalOverheadMessage(MessageType.Regular, 0x21, 1042857 + (poison.Level * 2)); } else { this.NonlocalOverheadMessage(MessageType.Regular, 0x21, 1042858 + (poison.Level * 2), GetNameUseBy(mob)); } } //this.LocalOverheadMessage(MessageType.Regular, 0x21, 1042857 + (poison.Level * 2)); //this.NonlocalOverheadMessage(MessageType.Regular, 0x21, 1042858 + (poison.Level * 2), DefaultName(from)); } }
private void SendToStaffMessage( Mobile from, string text ) { Packet p = null; foreach( NetState ns in from.GetClientsInRange( 8 ) ) { Mobile mob = ns.Mobile; if (mob != null && mob.AccessLevel >= AccessLevel.GameMaster && mob.AccessLevel > from.AccessLevel && mob.Party != this && !m_Listeners.Contains(mob) && !ActionCams.IsCamera(mob as PlayerMobile)) { if( p == null ) p = Packet.Acquire( new UnicodeMessage( from.Serial, from.Body, MessageType.Regular, from.SpeechHue, 3, from.Language, from.Name, text ) ); ns.Send( p ); } } Packet.Release( p ); }
public void SendPublicMessage( Mobile from, string text ) { SendToAll( new PartyTextMessage( true, from, text ) ); for ( int i = 0; i < m_Listeners.Count; ++i ) { Mobile mob = m_Listeners[i]; if ( mob.Party != this ) { m_Listeners[i].SendMessage( "[{0}]: {1}", from.Name, text ); } } Packet p = null; foreach ( GameClient ns in from.GetClientsInRange( 8 ) ) { Mobile mob = ns.Mobile; if ( mob != null && mob.AccessLevel >= AccessLevel.GameMaster && mob.AccessLevel > from.AccessLevel && mob.Party != this && !m_Listeners.Contains( mob ) ) { if ( p == null ) { p = Packet.Acquire( new UnicodeMessage( from.Serial, from.Body, MessageType.Regular, from.SpeechHue, 3, from.Language, from.Name, String.Format( "[Party]: {0}", text ) ) ); } ns.Send( p ); } } Packet.Release( p ); }
public void SendPrivateMessage( Mobile from, Mobile to, string text ) { to.Send( new PartyTextMessage( false, from, text ) ); for ( int i = 0; i < m_Listeners.Count; ++i ) { Mobile mob = (Mobile)m_Listeners[i]; if ( mob.Party != this ) ((Mobile)m_Listeners[i]).SendMessage( "[{0}]->[{1}]: {2}", from.Name, to.Name, text ); } Packet p = null; foreach ( NetState ns in from.GetClientsInRange( 8 ) ) { Mobile mob = ns.Mobile; if ( mob != null && mob.AccessLevel >= AccessLevel.GameMaster && mob.AccessLevel > from.AccessLevel && mob.Party != this && !m_Listeners.Contains( mob ) ) { if ( p == null ) p = new UnicodeMessage( from.Serial, from.Body, MessageType.Regular, from.SpeechHue, 3, from.Language, from.Name, String.Format( "[Party]->[{0}]: {1}", to.Name, text ) ); ns.Send( p ); } } }