本文整理汇总了C#中Server.Mobiles.BaseCreature.CanBeDamaged方法的典型用法代码示例。如果您正苦于以下问题:C# BaseCreature.CanBeDamaged方法的具体用法?C# BaseCreature.CanBeDamaged怎么用?C# BaseCreature.CanBeDamaged使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobiles.BaseCreature
的用法示例。
在下文中一共展示了BaseCreature.CanBeDamaged方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Target
public void Target( BaseCreature bc )
{
if ( !Caster.CanSee( bc ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
if ( !Caster.InRange( bc, 6 ) )
{
Caster.SendLocalizedMessage( 500643 ); // Target is too far away.
}
else if ( !Caster.CanBeHarmful( bc ) || !bc.CanBeDamaged() )
{
Caster.SendLocalizedMessage( 1074379 ); // You cannot charm that!
}
else if ( bc.Controlled || bc.Name == null )
{
Caster.SendLocalizedMessage( 1074379 ); // You cannot charm that!
}
else if ( bc is BaseChampion || bc.IsParagon || bc is Medusa || bc is Lurg || !SlayerGroup.GetEntryByName( SlayerName.Repond ).Slays( bc ) )
{
Caster.SendLocalizedMessage( 1074379 ); // You cannot charm that!
}
else if ( CheckSequence() )
{
double chance = Caster.Skills[SkillName.Spellweaving].Fixed / 1000;
chance += ( SpellweavingSpell.GetFocusLevel( Caster ) * 2 ) / 100;
if ( chance > Utility.RandomDouble() )
{
SpellHelper.Turn( Caster, bc );
bc.ControlSlots = 3;
bc.ActiveSpeed = 2;
bc.PassiveSpeed = 2;
bc.Owners.Add( Caster );
bc.SetControlMaster( Caster );
bc.IsBonded = false;
Caster.SendLocalizedMessage( 1072527 ); // You allure the humanoid to follow and protect you.
Caster.PlaySound( 0x5C4 );
}
else
{
bc.Combatant = Caster;
Caster.SendLocalizedMessage( 1072528 ); // The humanoid becomes enraged by your charming attempt and attacks you.
Caster.PlaySound( 0x5C5 );
}
}
FinishSequence();
}