#W# Initial Commit: Avatars Conquest
This commit is contained in:
commit
5df497787a
7510 changed files with 416048 additions and 0 deletions
30
Scripts/Quests/QuestFunctions.cs
Normal file
30
Scripts/Quests/QuestFunctions.cs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Misc
|
||||
{
|
||||
class QuestFunctions
|
||||
{
|
||||
public static bool MonstersNearby( Mobile m )
|
||||
{
|
||||
bool inCombat = ( m.Combatant != null && m.InRange( m.Combatant.Location, 20 ) && m.Combatant.InLOS( m ) );
|
||||
|
||||
int monsters = 0;
|
||||
foreach ( Mobile monster in m.GetMobilesInRange( 8 ) )
|
||||
{
|
||||
if ( monster is BaseCreature && !(((BaseCreature)monster).GetMaster() is PlayerMobile) )
|
||||
monsters++;
|
||||
}
|
||||
|
||||
if ( monsters > 0 || inCombat )
|
||||
{
|
||||
m.SendMessage( "You cannot do that with enemies nearby!" );
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue