本文整理汇总了C#中Server.SpeechEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# SpeechEventArgs类的具体用法?C# SpeechEventArgs怎么用?C# SpeechEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpeechEventArgs类属于Server命名空间,在下文中一共展示了SpeechEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnSpeech
public override void OnSpeech(SpeechEventArgs e)
{
if (!e.Handled && e.Mobile.InRange(this.Location, 12))
{
}
base.OnSpeech(e);
}
开发者ID:FreeReign,项目名称:forkuo,代码行数:7,代码来源:VIPVendor.cs
示例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;
}
}
}
}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:27,代码来源:Keywords.cs
示例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;
}
}
}
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:34,代码来源:Keywords.cs
示例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 );
}
}
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:35,代码来源:Keywords.cs
示例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);
}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:25,代码来源:Eole.cs
示例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 );
}
}
}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:27,代码来源:HearAll.cs
示例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 ) );
}
}
}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:25,代码来源:GlacialStaff.cs
示例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 );
}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:30,代码来源:DartGameNPC.cs
示例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;
}
开发者ID:Godkong,项目名称:RunUO,代码行数:31,代码来源:BaseSpeech.cs
示例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 );
}
}
}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:33,代码来源:General.cs
示例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 );
}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:7,代码来源:WorldSpeechLogging.cs
示例12: OnSpeech
static void OnSpeech(SpeechEventArgs e)
{
var playerMobile = e.Mobile as PlayerMobile;
if (playerMobile != null && isAFK(playerMobile))
{
SetBack(playerMobile);
}
}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:8,代码来源:AFK.cs
示例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." ) );
}
}
开发者ID:greeduomacro,项目名称:DimensionsNewAge,代码行数:8,代码来源:Jamal.cs
示例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;
}
}
}
开发者ID:greeduomacro,项目名称:annox,代码行数:58,代码来源:AnkhPendant.cs
示例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");
}
}
}
}
}
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:58,代码来源:TrickOrTreat.cs
示例16: OnSpeech
public override void OnSpeech( SpeechEventArgs e )
{
Mobile from = e.Mobile;
if (XmlScript.HasTrigger(this, TriggerName.onSpeech) && UberScriptTriggers.Trigger(this, e.Mobile, TriggerName.onSpeech, null, e.Speech))
{
return;
}
if ( !e.Handled && from is PlayerMobile && from.InRange( this.Location, 2 ) && WasNamed( e.Speech ) )
{
PlayerMobile pm = (PlayerMobile)from;
if ( e.HasKeyword( 0x0004 ) ) // *join* | *member*
{
if ( pm.NpcGuild == this.NpcGuild )
SayTo( from, 501047 ); // Thou art already a member of our guild.
else if ( pm.NpcGuild != NpcGuild.None )
SayTo( from, 501046 ); // Thou must resign from thy other guild first.
else if (pm.Young || pm.GameTime < JoinGameAge || (pm.CreationTime + JoinAge) > DateTime.UtcNow)
{
SayTo(from, 501048); // You are too young to join my guild...
if (pm.GameTime < JoinGameAge)
{
pm.LocalOverheadMessage(MessageType.Regular, 38, false, "Your gametime (" + pm.GameTime + ") must reach " + JoinGameAge + " before you can join.");
}
else if ((pm.CreationTime + JoinAge) > DateTime.UtcNow)
{
pm.LocalOverheadMessage(MessageType.Regular, 38, false, "You must wait 7 days after creating your character to join. That will be at " + (pm.CreationTime + JoinAge) + " server time." );
}
}
else if (CheckCustomReqs(pm))
SayPriceTo(from);
e.Handled = true;
}
else if ( e.HasKeyword( 0x0005 ) ) // *resign* | *quit*
{
if ( pm.NpcGuild != this.NpcGuild )
{
SayTo( from, 501052 ); // Thou dost not belong to my guild!
}
else if ( (pm.NpcGuildJoinTime + QuitAge) > DateTime.UtcNow || (pm.NpcGuildGameTime + QuitGameAge) > pm.GameTime )
{
SayTo( from, 501053 ); // You just joined my guild! You must wait a week to resign.
}
else
{
SayTo( from, 501054 ); // I accept thy resignation.
pm.NpcGuild = NpcGuild.None;
}
e.Handled = true;
}
}
base.OnSpeech( e );
}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:57,代码来源:BaseGuildmaster.cs
示例17: Respond
public static void Respond(SpeechEventArgs e, Mobile r, string input)
{
if (SpeechCheck(e, "job", "what do you do"))
res(r, "I am a living library of the arcane arts.");
else if (SpeechCheck(e, "abbey"))
res(r, "Oh, I haven't been to my abbey in ages.");
else if (SpeechCheck(e, "ability", "abilities"))
res(r, "One must have born propensity for magic, a natural ability if you will.");
else if (SpeechCheck(e, "arcane", "art"))
res(r, "The arcane art is one of keeping mystical secrets.");
else if (SpeechCheck(e, "cast", "casting"))
res(r, "Just close your eyes, say the words, and visualize. You may need your Spellbook for assistance.");
else if (SpeechCheck(e, "component", "supplies"))
res(r, "Reagents and a heavy spellbook are all the components one needs.");
else if (SpeechCheck(e, "craft"))
res(r, "The craft of a mage takes many years to learn.");
else if (SpeechCheck(e, "des mani"))
res(r, "The words to weaken an opponent.");
else if (SpeechCheck(e, "empath"))
res(r, "I know not what someone feels nor do I wish to.");
else if (SpeechCheck(e, "ether"))
res(r, "I have heard rumors of ether, but have never seen it myself.");
else if (SpeechCheck(e, "guild"))
res(r, "Join the Mage's Guild, and you'll receive discounts on reagents.");
else if (SpeechCheck(e, "in lor"))
res(r, "Night Sight is very handy when reagent hunting.");
else if (SpeechCheck(e, "in mani"))
res(r, "You shall hear these words quite often on a battlefield.");
else if (SpeechCheck(e, "in mani ylem"))
res(r, "No, I am not very hungry.");
else if (SpeechCheck(e, "in por ylem"))
res(r, "Beginning mages use this spell quite often.");
else if (SpeechCheck(e, "ingredients"))
res(r, "Which reagent are you referring to?");
else if (SpeechCheck(e, "reagent"))
res(r, "Reagents are the basis for all magic.");
else if (SpeechCheck(e, "res wis"))
res(r, "The Feeblemind spell truly isn't that useful.");
else if (SpeechCheck(e, "relvinian"))
res(r, "I think you have been in the sun too long.");
else if (SpeechCheck(e, "scroll"))
res(r, "Oh yes, always carry a few extra scrolls. One never knows.");
else if (SpeechCheck(e, "skill"))
res(r, "One needs to dedicate himself to the arcane arts to acquire great skill.");
else if (SpeechCheck(e, "spell"))
res(r, "One can never practice any spell enough.");
else if (SpeechCheck(e, "spellbook", "spell book", "spells"))
res(r, "Never leave town without your spellbook.");
else if (SpeechCheck(e, "talent"))
res(r, "I feel that one must have a natural talent when it comes to casting spells.");
else if (SpeechCheck(e, "uus jux"))
res(r, "Clumsy is one of the first spells that one learns. Quite easy to cast.");
else
Humans.Respond(e, r, input);
}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:56,代码来源:MageShop.cs
示例18: EventSink_Speech
private static void EventSink_Speech( SpeechEventArgs e )
{
Mobile from = e.Mobile;
if ( from.AccessLevel > AccessLevel.Player )
return;
if ( !NameVerification.Validate( e.Speech, 0, int.MaxValue, true, true, false, int.MaxValue, m_Exceptions, m_Disallowed, m_StartDisallowed ) )
e.Blocked = !OnProfanityDetected( from, e.Speech );
}
开发者ID:zerodowned,项目名称:angelisland,代码行数:10,代码来源:ProfanityProtection.cs
示例19: OnSpeech
public override void OnSpeech(SpeechEventArgs e)
{
base.OnSpeech (e);
if ( !e.Mobile.Hidden || e.Mobile.AccessLevel <= AccessLevel.Player )
{
m_TextHue = e.Hue;
m_String = String.Format( "{0} said {1}", e.Mobile.Name, e.Speech );
}
}
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:10,代码来源:CrystalBall.cs
示例20: OnSpeech
public override void OnSpeech(SpeechEventArgs e)
{
if (e.Mobile.InRange(this, 6))
{
if (Insensitive.Contains(e.Speech, "guards"))
{
if (base.Combatant != null)
{
if (!(base.InLOS(base.Combatant)))
{
base.Say("Je mùj!");
Point3D from = (Point3D)this.Location;
Point3D to = new Point3D((Point3D)base.Combatant.Location);
base.Location = to;
Effects.SendLocationParticles(EffectItem.Create(from, base.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
Effects.SendLocationParticles(EffectItem.Create(to, base.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);
base.PlaySound(0x1FE);
}
}
else if (AdvancedGuardsCommand)
{
foreach (Mobile m in base.GetMobilesInRange(base.RangePerception))
{
if (m is PlayerMobile && !(m.Hidden) && m.Alive && m.AccessLevel == AccessLevel.Player)
{
if ((m.Kills > 5) || (m.Criminal))
{
base.Combatant = m;
base.Warmode = true;
if (!(base.InLOS(m)))
{
base.Say("Je mùj!");
Point3D fromt = (Point3D)this.Location;
Point3D tot = new Point3D((Point3D)base.Combatant.Location);
base.Location = tot;
Effects.SendLocationParticles(EffectItem.Create(fromt, base.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
Effects.SendLocationParticles(EffectItem.Create(tot, base.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);
base.PlaySound(0x1FE);
}
break;
}
}
}
}
}
else
{
base.OnSpeech(e);
}
}
}
开发者ID:greeduomacro,项目名称:uodarktimes-1,代码行数:55,代码来源:BaseGoodGuard.cs
注:本文中的Server.SpeechEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论