本文整理汇总了C#中BaseCreature.SayTo方法的典型用法代码示例。如果您正苦于以下问题:C# BaseCreature.SayTo方法的具体用法?C# BaseCreature.SayTo怎么用?C# BaseCreature.SayTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseCreature
的用法示例。
在下文中一共展示了BaseCreature.SayTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnUsed
public bool OnUsed( Mobile from, BaseCreature pet )
{
if ( pet.GetStatMod( "[Tasty Treat] Str" ) != null )
{
from.SendLocalizedMessage( 1113051 ); // Your pet is still enjoying the last tasty treat!
return false;
}
else if ( DateTime.Now < pet.NextTastyTreat )
{
from.SendLocalizedMessage( 1113049 ); // Your pet is still recovering from the last tasty treat.
return false;
}
else
{
pet.SayTo( from, 1113050 ); // Your pet looks much happier.
pet.FixedEffect( 0x375A, 10, 15 );
pet.PlaySound( 0x1E7 );
AddEffect( pet );
pet.NextTastyTreat = DateTime.Now + Duration + Cooldown;
if ( this.Amount > 1 )
{
this.Amount -= 1;
from.Backpack.DropItem( this );
}
else
{
Delete();
}
return true;
}
}
示例2: OnUsed
public bool OnUsed( Mobile from, BaseCreature pet )
{
if ( m_UnderEffect.Contains( pet ) )
{
from.SendLocalizedMessage( 1113075 ); // Your pet is still under the effect of armor essence.
return false;
}
else if ( DateTime.Now < pet.NextArmorEssence )
{
from.SendLocalizedMessage( 1113076 ); // Your pet is still recovering from the last armor essence it consumed.
return false;
}
else
{
pet.SayTo( from, 1113050 ); // Your pet looks much happier.
pet.FixedEffect( 0x375A, 10, 15 );
pet.PlaySound( 0x1E7 );
List<ResistanceMod> mods = new List<ResistanceMod>();
mods.Add( new ResistanceMod( ResistanceType.Physical, 15 ) );
mods.Add( new ResistanceMod( ResistanceType.Fire, 10 ) );
mods.Add( new ResistanceMod( ResistanceType.Cold, 10 ) );
mods.Add( new ResistanceMod( ResistanceType.Poison, 10 ) );
mods.Add( new ResistanceMod( ResistanceType.Energy, 10 ) );
for ( int i = 0; i < mods.Count; i++ )
pet.AddResistanceMod( mods[i] );
m_UnderEffect.Add( pet );
Timer.DelayCall( Duration, new TimerCallback(
delegate
{
for ( int i = 0; i < mods.Count; i++ )
pet.RemoveResistanceMod( mods[i] );
m_UnderEffect.Remove( pet );
} ) );
pet.NextArmorEssence = DateTime.Now + Duration + Cooldown;
Delete();
return true;
}
}