本文整理汇总了C#中BaseCreature.GetMobilesInRange方法的典型用法代码示例。如果您正苦于以下问题:C# BaseCreature.GetMobilesInRange方法的具体用法?C# BaseCreature.GetMobilesInRange怎么用?C# BaseCreature.GetMobilesInRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseCreature
的用法示例。
在下文中一共展示了BaseCreature.GetMobilesInRange方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RoarAttack
public static void RoarAttack(BaseCreature from, Mobile target)
{
if (from.RoarAttack < 10 || from == null || target == null)
return;
int power = from.RoarAttack / 10;
int mindam = from.RoarAttack / 3;
int maxdam = from.RoarAttack / 2;
from.Say("*Roars*");
ArrayList targets = new ArrayList();
foreach (Mobile m in from.GetMobilesInRange(power))
{
if (m != from && from.CanBeHarmful(m))
targets.Add(m);
}
for (int i = 0; i < targets.Count; ++i)
{
Mobile m = (Mobile)targets[i];
if (m is BaseCreature)
{
BaseCreature bc = (BaseCreature)m;
// if (bc.Controlled == true && bc.ControlMaster != null)
// return;//////////////////////////////////////////////////////////////////////////////
// else
bc.BeginFlee(TimeSpan.FromSeconds(10.0));
AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 100, 0, 0, 0, 0);
}
}
}
示例2: CompileHelpersList
private void CompileHelpersList(BaseCreature pirate)
{
if (Owner == null)
return;
Party p = Party.Get(Owner);
List<DamageStore> rights = pirate.GetLootingRights();
IPooledEnumerable eable = pirate.GetMobilesInRange(19);
foreach (Mobile mob in eable)
{
if (mob == Owner || !(mob is PlayerMobile))
continue;
Party mobParty = Party.Get(mob);
//Add party memebers regardless of looting rights
if (p != null && mobParty != null && p == mobParty)
{
m_Helpers.Add(mob);
continue;
}
// add those with looting rights
for (int i = rights.Count - 1; i >= 0; --i)
{
DamageStore ds = rights[i];
if (ds.m_HasRight && ds.m_Mobile == mob)
{
m_Helpers.Add(ds.m_Mobile);
break;
}
}
}
eable.Free();
}
示例3: CheckSummonLimits
public static void CheckSummonLimits( BaseCreature creature )
{
ArrayList creatures = new ArrayList();
int limit = 6; // 6 creatures
int range = 5; // per 5x5 area
var eable = creature.GetMobilesInRange( range );
foreach ( Mobile mobile in eable )
{
if ( mobile != null && mobile.GetType() == creature.GetType() )
creatures.Add( mobile );
}
int amount = 0;
if ( creatures.Count > limit )
amount = creatures.Count - limit;
while ( amount > 0 )
{
for ( int i = 0; i < creatures.Count; i++ )
{
Mobile m = creatures[i] as Mobile;
if ( m != null && ( (BaseCreature) m ).Summoned )
{
if ( Utility.RandomBool() && amount > 0 )
{
m.Delete();
amount--;
}
}
}
}
}
示例4: DoMoves
public static void DoMoves( BaseCreature from, Mobile target )
{
switch ( Utility.Random( 3 ) )
{
case 0:
if ( Utility.Random( 500 ) <= from.RoarAttack )
{
int power;
int mindam;
int maxdam;
if ( from.RoarAttack > 3 )
{
mindam = from.RoarAttack / 3;
maxdam = from.RoarAttack / 2;
}
else
{
mindam = 1;
maxdam = 3;
}
if ( from.RoarAttack > 10 )
power = from.RoarAttack / 10;
else
power = 1;
ArrayList targets = new ArrayList();
foreach ( Mobile m in from.GetMobilesInRange( power ) )
{
if ( m != from )
targets.Add( m );
}
for ( int i = 0; i < targets.Count; ++i )
{
Mobile m = (Mobile)targets[i];
if ( m is BaseCreature )
{
BaseCreature bc = (BaseCreature)m;
bc.BeginFlee( TimeSpan.FromSeconds( 30.0 ) );
AOS.Damage( target, from, Utility.RandomMinMax( mindam, maxdam ), 20, 20, 20, 20, 20 );
}
}
}
break;
case 1:
if ( Utility.Random( 500 ) <= from.PetPoisonAttack )
{
Effects.SendLocationParticles( EffectItem.Create( target.Location, target.Map, EffectItem.DefaultDuration ), 0x36B0, 1, 14, 63, 7, 9915, 0 );
Effects.PlaySound( target.Location, target.Map, 0x229 );
int mindam;
int maxdam;
if ( from.PetPoisonAttack > 3 )
{
mindam = from.PetPoisonAttack / 3;
maxdam = from.PetPoisonAttack / 2;
}
else
{
mindam = 1;
maxdam = 3;
}
int level = from.PetPoisonAttack / 20;
if ( level > 5 )
level = 5;
target.ApplyPoison( from.ControlMaster, Poison.GetPoison( level ) );
AOS.Damage( target, from, Utility.RandomMinMax( mindam, maxdam ), 0, 0, 0, 0, 100 );
}
break;
case 2:
if ( Utility.Random( 500 ) <= from.FireBreathAttack )
{
int mindam;
int maxdam;
if ( from.PetPoisonAttack > 3 )
{
mindam = from.PetPoisonAttack / 3;
maxdam = from.PetPoisonAttack / 2;
}
else
{
mindam = 1;
maxdam = 3;
//.........这里部分代码省略.........
示例5: DoManaDrainAttack
//END STAM DRAIN ATTACK
//BEGIN MANA DRAIN ATTACK
public static void DoManaDrainAttack(BaseCreature mobile)
{
foreach (Mobile m in mobile.GetMobilesInRange( 3 ) )
if (m != null && m.Mana >= 50 && m.AccessLevel == AccessLevel.Player)
mobile.Mana += 5;
}
示例6: DoHitsDrainAttack
//END AIR AREA ATTACK
//BEGIN HITS DRAIN ATTACK
public static void DoHitsDrainAttack(BaseCreature mobile)
{
foreach (Mobile m in mobile.GetMobilesInRange( 3 ) )
if (m != null && m.Hits >= 50 && m.AccessLevel == AccessLevel.Player)
mobile.Hits += 2;
}
示例7: DoAirAreaAttack
//END WATER AREA ATTACK
//BEGIN AIR AREA ATTACK
public static void DoAirAreaAttack(BaseCreature mobile, Mobile player)
{
ArrayList list = new ArrayList();
foreach ( Mobile m in mobile.GetMobilesInRange( 10 ) )
{
if ( m == mobile || !m.CanBeHarmful( m ) )
continue;
if ( m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != mobile.Team) )
list.Add( m );
else if ( m.Player )
list.Add( m );
}
foreach ( Mobile m in list )
{
m.DoHarmful( m );
m.FixedParticles( 0x3728, 50, 50, 5052, EffectLayer.Waist );
m.PlaySound( 655 );
m.SendMessage( "Your lose your breath as the air hits you!" );
int toStrike = Utility.RandomMinMax( 25, 35 );
m.Damage( toStrike, mobile );
}
}
示例8: DoWaterAreaAttack
//END FIRE AREA ATTACK
//BEGIN WATER ATTACK
public static void DoWaterAreaAttack(BaseCreature mobile, Mobile player)
{
ArrayList list = new ArrayList();
foreach ( Mobile m in mobile.GetMobilesInRange( 10 ) )
{
if ( m == mobile || !m.CanBeHarmful( m ) )
continue;
if ( m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != mobile.Team) )
list.Add( m );
else if ( m.Player )
list.Add( m );
}
foreach ( Mobile m in list )
{
m.DoHarmful( m );
m.FixedParticles( 0x1fb7, 50, 50, 5052, EffectLayer.Waist );
m.PlaySound( 279 );
m.PlaySound( 280 );
m.SendMessage( "Your skin numbs as the cold freezes you!" );
//int toStrike = Utility.RandomMinMax( 25, 35 );
m.Damage( ((Utility.Random( 25, 35 )) - (m.ColdResistance /2)) );
//m.Damage( toStrike, mobile );
}
}
示例9: DoFireAreaAttack
//END HUMAN REVEALER
//BEGIN AREA FIRE ATTACK
public static void DoFireAreaAttack(BaseCreature mobile, Mobile player)
{
ArrayList list = new ArrayList();
foreach ( Mobile m in mobile.GetMobilesInRange( 10 ) )
{
if ( m == mobile || !m.CanBeHarmful( m ) )
continue;
if ( m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != mobile.Team) )
list.Add( m );
else if ( m.Player )
list.Add( m );
}
foreach ( Mobile m in list )
{
/*if ( CheckResisted( m ) )
{
m.DoHarmful( m );
int Strike = Utility.RandomMinMax( 5, 15 );
m.Damage( Strike, mobile );
m.SendMessage( "Your feel the heat of fire!" );
return;
}*/
m.DoHarmful( m );
m.FixedParticles( 0x3709, 10, 30, 5052, EffectLayer.Waist );
m.PlaySound( 0x208 );
m.SendMessage( "Your skin blisters as the fire burns you!" );
//int toStrike = Utility.RandomMinMax( 25, 35 );
m.Damage( ((Utility.Random( 25, 35 )) - (m.FireResistance /2)) );
//m.Damage( toStrike, mobile );
}
}
示例10: DoHumanReveal
public static void DoHumanReveal(BaseCreature mobile)
{
foreach (Mobile m in mobile.GetMobilesInRange( 10 ) )
if (m != null && m.Hidden && m.AccessLevel == AccessLevel.Player)
m.Hidden = false;
if( s_HumanTalked == false )
{
s_HumanTalked = true;
SayHumanRandom( humansay, mobile );
HumanSpamTimer t = new HumanSpamTimer();
t.Start();
}
}
示例11: DoRobotReveal
public static void DoRobotReveal(BaseCreature mobile)
{
foreach (Mobile m in mobile.GetMobilesInRange( 10 ) )
if (m != null && m.Hidden && m.AccessLevel == AccessLevel.Player)
m.Hidden = false;
if( s_RoboTalked == false )
{
s_RoboTalked = true;
SayRobotRandom( robotsay, mobile );
RobotSpamTimer t = new RobotSpamTimer();
t.Start();
}
}
示例12: DoMassProvoke
//END MASS PEACE
//BEGIN MASS PROVOKE
public static void DoMassProvoke(BaseCreature mobile, Mobile player)
{
ArrayList list = new ArrayList();
foreach ( Mobile m in mobile.GetMobilesInRange( 15 ) )
{
if ( m == mobile || !m.CanBeHarmful( m ) )
continue;
if ( m is BaseCreature )
list.Add( m );
else if ( m.Player )
list.Add( m );
}
foreach ( Mobile m in list )
{
m.DoHarmful( m );
player.Combatant = null;
m.Combatant = player;
m.PlaySound( 0x403 );
m.Emote("*you see {0} looks furious*", m.Name);
}
}
示例13: DoMassPeace
//END BOMBER
//BEGIN MASS PEACE
public static void DoMassPeace(BaseCreature mobile, Mobile player)
{
ArrayList list = new ArrayList();
foreach ( Mobile m in mobile.GetMobilesInRange( 15 ) )
{
if ( m == mobile || !m.CanBeHarmful( m ) )
continue;
if ( m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != mobile.Team) )
list.Add( m );
else if ( m.Player )
list.Add( m );
}
foreach ( Mobile m in list )
{
m.DoHarmful( m );
m.Combatant = null;
m.PlaySound( 0x418 );
m.Emote("*you see {0} looks peacful*", m.Name);
}
}
示例14: IcyWindAttack
public static void IcyWindAttack(BaseCreature from, Mobile target)
{
if (from.IcyWindAttack < 10 || from == null || target == null)
return;
Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x37CC, 1, 40, 97, 3, 9917, 0);
int mindam = from.IcyWindAttack / 3;
int maxdam = from.IcyWindAttack / 2;
ArrayList targets = new ArrayList();
foreach (Mobile m in from.GetMobilesInRange(from.IcyWindAttack / 10))
{
if (m != from && from.CanBeHarmful(m))
targets.Add(m);
}
for (int i = 0; i < targets.Count; ++i)
{
Mobile m = (Mobile)targets[i];
from.Say("Icy Wind Attack");
AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 0, 0, 100, 0, 0);
Slow.SlowWalk(m, 10);
}
}