本文整理汇总了C#中Server.SpeechEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# SpeechEventArgs类的具体用法?C# SpeechEventArgs怎么用?C# SpeechEventArgs使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SpeechEventArgs类属于Server命名空间,在下文中一共展示了SpeechEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnSpeech
public override void OnSpeech(SpeechEventArgs e)
{
if (!e.Handled && e.Mobile.InRange(this.Location, 12))
{
}
base.OnSpeech(e);
}
示例2: EventSink_Speech
public static void EventSink_Speech( SpeechEventArgs args )
{
Mobile from = args.Mobile;
int[] keywords = args.Keywords;
for( int i = 0; i < keywords.Length; ++i )
{
switch( keywords[i] )
{
case 0x002A: // *i resign from my guild*
{
if( from.Guild != null )
((Guild)from.Guild).RemoveMember( from );
break;
}
case 0x0032: // *i must consider my sins*
{
from.SendMessage( "Short Term Murders : {0}", from.ShortTermMurders );
from.SendMessage( "Long Term Murders : {0}", from.Kills );
break;
}
}
}
}
示例3: EventSink_Speech
public static void EventSink_Speech( SpeechEventArgs args )
{
string said = args.Speech.ToLower();
Mobile from = args.Mobile;
switch( said )
{
case( "i wish to duel" ):
{
if ( from.Region is DuelRegion || DuelGump.Exists( from ) || ((PlayerMobile)from).SentRequest || ((PlayerMobile)from).RecievedRequest )
{
from.SendAsciiMessage( "You are too busy to duel someone else." );
}
else if ( !from.Alive )
{
from.SendMessage( "You cannot duel while dead." );
}
else if ( from.Aggressed.Count != 0 || from.Aggressors.Count != 0 )
{
from.SendMessage( "You cannot duel while in combat." );
}
else if ( from.Hits != from.HitsMax )
{
from.SendMessage( "You need to heal before offering a duel." );
}
else
{
from.Target = new DuelTarget( from );
((PlayerMobile)from).SentRequest = true;
}
break;
}
}
}
示例4: EventSink_Speech
public static void EventSink_Speech( SpeechEventArgs args )
{
Mobile from = args.Mobile;
int[] keywords = args.Keywords;
for ( int i = 0; i < keywords.Length; ++i )
{
switch ( keywords[i] )
{
case 0x002A: // *i resign from my guild*
{
if ( from.Guild is Guild && from.Guild != null )
((Guild)from.Guild).RemoveMember( from );
break;
}
/*case 0x0032: // "*i must consider my sins*
{
if ( from.Kills == 0 )
from.SendLocalizedMessage( 502122 );
else if ( from.Kills <= 4 )
from.SendLocalizedMessage( 502125 );
else if ( from.Kills >= 5 )
from.SendLocalizedMessage( 502123 );
break;
}*/
}
}
string lower = args.Speech.ToLower();
if ( lower.IndexOf( "view updates" ) != -1 )
{
Server.Gumps.UpdatesGump.ShowUpdates( from );
}
}
示例5: OnSpeech
public override void OnSpeech(SpeechEventArgs e)
{
bool isMatch = false;
Mobile from = e.Mobile;
string keyword = this.Name + " silence";
if (keyword != null && e.Speech.ToLower().IndexOf(keyword.ToLower()) >= 0)
{
isMatch = true;
if (!isMatch)
return;
from.SendGump(new ElementQuestGump3(from));
from.AddToBackpack(new ElementAir());
e.Handled = true;
}
base.OnSpeech(e);
}
示例6: OnSpeech
public static void OnSpeech( SpeechEventArgs e )
{
if ( m_HearAll.Count > 0 )
{
string lowercase = e.Speech.ToLower();
if ( lowercase == "i wish to lock this down" ||
lowercase == "i wish to release this" ||
lowercase == "i wish to secure this" ||
lowercase == "all follow me" ||
lowercase == "all attack" ||
lowercase == "all kill" ||
lowercase == "all stay" ||
lowercase == "all guard me" ||
lowercase == "bank" ||
lowercase == "guards" )
return;
string msg = String.Format( "({0}): {1}", e.Mobile.Name, e.Speech );
for ( int i = 0; i < m_HearAll.Count; i++ )
{
if ( m_HearAll[i] != e.Mobile && m_HearAll[i].AccessLevel >= e.Mobile.AccessLevel )
m_HearAll[i].SendMessage( msg );
}
}
}
示例7: OnSpeech
public override void OnSpeech( SpeechEventArgs e )
{
base.OnSpeech( e );
Mobile from = e.Mobile;
if ( from == Parent && m_UsesRemaining > 0 )
{
if ( GetFlag( GlacialSpells.Freeze ) && e.Speech.ToLower().IndexOf( "an ex del" ) > -1 )
{
m_CurrentSpell = GlacialSpells.Freeze;
from.NetState.Send( new PlaySound( 0xF6, from.Location ) );
}
else if ( GetFlag( GlacialSpells.IceStrike ) && e.Speech.ToLower().IndexOf( "in corp del" ) > -1 )
{
m_CurrentSpell = GlacialSpells.IceStrike;
from.NetState.Send( new PlaySound( 0xF7, from.Location ) );
}
else if ( GetFlag( GlacialSpells.IceBall ) && e.Speech.ToLower().IndexOf( "des corp del" ) > -1 )
{
m_CurrentSpell = GlacialSpells.IceBall;
from.NetState.Send( new PlaySound( 0xF8, from.Location ) );
}
}
}
示例8: OnSpeech
public override void OnSpeech( SpeechEventArgs args )
{
if( !args.Handled && args.Mobile.InRange( this.Location, 2 ) )
{
Mobile m = args.Mobile;
if( args.Speech.IndexOf( "play" ) > -1 && args.Speech.IndexOf( "game" ) > -1 )
{
if( m_Gamer != null )
{
Say( String.Format( "Hiyo! {0} is already taking {1} turn. Wait till {2} done!", m_Gamer.RawName, m_Gamer.Female ? "her" : "his", m_Gamer.Female ? "she\'s" : "he\'s" ) );
}
else if( m_Board == null || m_Board.Deleted )
{
Say( "Uh... nevermind! Someone stole my dartboard!" );
}
else
{
Direction = GetDirectionTo( m );
Say( "Aha! We have a taker! Here\'s a pair of knives, see what you can do!" );
m_Gamer = m;
new InternalTimer( m, this ).Start();
}
}
}
base.OnSpeech( args );
}
示例9: CheckSpeech
public static bool CheckSpeech(BaseCreature m_Mobile, SpeechEventArgs e)
{
string response = null;
Region reg = Region.Find(m_Mobile.Location, m_Mobile.Map);
//Check Job
//Check Region
if (reg.Name == "Britain")
{
if (m_Mobile.Sophistication == SophisticationLevel.High)
response = BritainHigh(m_Mobile, e);
else if (m_Mobile.Sophistication == SophisticationLevel.Medium)
response = BritainMedium(m_Mobile, e);
else if (m_Mobile.Sophistication == SophisticationLevel.Low)
response = BritainLow(m_Mobile, e);
}
//Check World
if (m_Mobile.Sophistication == SophisticationLevel.High)
response = BritanniaHigh(m_Mobile, e);
else if (m_Mobile.Sophistication == SophisticationLevel.Medium)
response = BritanniaMedium(m_Mobile, e);
else if (m_Mobile.Sophistication == SophisticationLevel.Low)
response = BritanniaLow(m_Mobile, e);
if (response != null)
return true;
else
return false;
}
示例10: HandleSpeech
private static void HandleSpeech( SpeechEventArgs e )
{
ArrayList houses = new ArrayList(BaseHouse.GetHouses( e.Mobile ));
foreach( BaseHouse house in houses )
{
if (!RUOVersion.RegionContains(house.Region, e.Mobile))
continue;
if ( house is TownHouse )
house.OnSpeech( e );
/*
if ( house.Owner == e.Mobile
&& e.Speech.ToLower() == "create rental contract"
&& CanRent( e.Mobile, house, true ) )
{
e.Mobile.AddToBackpack( new RentalContract() );
e.Mobile.SendMessage( "A rental contract has been placed in your bag." );
}
*/
if ( house.Owner == e.Mobile && e.Speech.ToLower() == "check storage" )
{
int count;
e.Mobile.SendMessage( "You have {0} lockdowns and {1} secures available.", RemainingSecures( house ), RemainingLocks( house ) );
if ( (count = AllRentalLocks( house )) != 0 )
e.Mobile.SendMessage( "Current rentals are using {0} of your lockdowns.", count );
if ( (count = AllRentalSecures( house )) != 0 )
e.Mobile.SendMessage( "Current rentals are using {0} of your secures.", count );
}
}
}
示例11: EventSink_Speech
public static void EventSink_Speech( SpeechEventArgs e )
{
WriteLine( e.Mobile, "{0}: {1}", LogManager.Format( e.Mobile ), e.Speech );
if( ConsoleEnabled )
Console.WriteLine( e.Mobile.Name + String.Format( " ({0}): ", ((Account)e.Mobile.Account).Username ) + e.Speech );
}
示例12: OnSpeech
static void OnSpeech(SpeechEventArgs e)
{
var playerMobile = e.Mobile as PlayerMobile;
if (playerMobile != null && isAFK(playerMobile))
{
SetBack(playerMobile);
}
}
示例13: OnSpeech
public override void OnSpeech( SpeechEventArgs m )
{
if ( m.Mobile.InRange( this, 5 ) )
{
Say( String.Format( "Hi {0}! My name is Jamal. I am supposed to be a Quest NPC.", m.Mobile.Name ) );
Say( String.Format( "Sorry, but this Quest is currently not working." ) );
}
}
示例14: OnSpeech
public override void OnSpeech(SpeechEventArgs e)
{
if (!e.Handled && Parent is Mobile)
{
Mobile m = Parent as Mobile;
if (e.Mobile.Serial != m.Serial)
return;
string theirwords = e.Speech;
theirwords.ToLower();
int chant = 99;
for (int i = 0; i < m_ShrineMantra.Length; i++)
{
if (theirwords == m_ShrineMantra[i])
chant = i;
}
if (chant >= m_ShrineMantra.Length)
return;
bool disabled = false;
Point3D[] place = m_BritanniaShrines;
if (e.Mobile.Map == Map.Ilshenar)
{
if (!AllowIlshenarShrines)
disabled = true;
else
place = m_IllshShrines;
}
else if (e.Mobile.Map != Map.Felucca && e.Mobile.Map != Map.Trammel)
disabled = true;
if (disabled == true)
return;
bool rightplace = false;
foreach (Mobile mobile in e.Mobile.Map.GetMobilesInRange(place[chant], 5))
if (mobile != null)
if (mobile.Serial == e.Mobile.Serial)
rightplace = true;
if (rightplace == true)
{
GiveBonus(chant, e.Mobile);
e.Handled = true;
}
}
}
示例15: EventSink_Speech
public static void EventSink_Speech( SpeechEventArgs args )
{
Mobile from = args.Mobile;
int[] keywords = args.Keywords;
if ( from is PlayerMobile )
{
PlayerMobile player = from as PlayerMobile;
if ( args.Speech.ToLower().Equals("trick or treat"))
{
Item[] items = from.Backpack.FindItemsByType( typeof( TrickOrTreatBag ) );
if ( items.Length == 0 )
{
from.SendMessage ("You need a goodie bag to go trick or treating!");
}
else
{
bool foundbag = false;
foreach( TrickOrTreatBag tb in items )
{
if ( tb.Uses > 0 )
{
foreach ( Mobile m in from.GetMobilesInRange( 3 ) ) // TODO: Validate range
{
if ( !m.Player && m.Body.IsHuman && ( m is BaseVendor ) )
{
if (m is BaseCreature && (((BaseCreature)m).IsHumanInTown() ) )
{
from.Direction = from.GetDirectionTo( m );
m.Direction = m.GetDirectionTo( from );
TrickOrTreat.GiveTreat( from, m, tb );
tb.ConsumeUse( from );
return;
}
}
}
foundbag = true;
break;
}
}
if ( !foundbag )
{
from.SendMessage("You don't have any uses left on your goodie bags");
}
}
}
}
}