本文整理汇总了C#中Map.CanSpawnMobile方法的典型用法代码示例。如果您正苦于以下问题:C# Map.CanSpawnMobile方法的具体用法?C# Map.CanSpawnMobile怎么用?C# Map.CanSpawnMobile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map
的用法示例。
在下文中一共展示了Map.CanSpawnMobile方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Effect
public void Effect( Point3D loc, Map map, bool checkMulti )
{
if ( Factions.Sigil.ExistsOn( Caster ) )
{
Caster.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
}
else if ( map == null || (!Core.AOS && Caster.Map != map) )
{
Caster.SendLocalizedMessage( 1005569 ); // You can not recall to another facet.
}
else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.RecallFrom ) )
{
}
else if ( !SpellHelper.CheckTravel( Caster, map, loc, TravelCheckType.RecallTo ) )
{
}
else if ( map == Map.Felucca && Caster is PlayerMobile && ((PlayerMobile)Caster).Young )
{
Caster.SendLocalizedMessage( 1049543 ); // You decide against traveling to Felucca while you are still young.
}
//else if ( Caster.Kills >= 5 && map != Map.Felucca )
//{
// Caster.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
//}
else if ( Caster.Criminal )
{
Caster.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
}
else if ( SpellHelper.CheckCombat( Caster ) )
{
Caster.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
}
else if ( Server.Misc.WeightOverloading.IsOverloaded( Caster ) )
{
Caster.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
}
else if ( !map.CanSpawnMobile( loc.X, loc.Y, loc.Z ) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( (checkMulti && SpellHelper.CheckMulti( loc, map )) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( m_Book != null && m_Book.CurCharges <= 0 )
{
Caster.SendLocalizedMessage( 502412 ); // There are no charges left on that item.
}
else if ( CheckSequence() )
{
BaseCreature.TeleportPets( Caster, loc, map, true );
if ( m_Book != null )
--m_Book.CurCharges;
Caster.PlaySound( 0x1FC );
Caster.MoveToWorld( loc, map );
Caster.PlaySound( 0x1FC );
}
FinishSequence();
}
示例2: FindValidSpawnLocation
public static bool FindValidSpawnLocation(Map map, ref Point3D p, bool surroundingsOnly)
{
if (map == null) //sanity
return false;
if (!surroundingsOnly)
{
if (map.CanSpawnMobile(p)) //p's fine.
{
p = new Point3D(p);
return true;
}
int z = map.GetAverageZ(p.X, p.Y);
if (map.CanSpawnMobile(p.X, p.Y, z))
{
p = new Point3D(p.X, p.Y, z);
return true;
}
}
int offset = Utility.Random(8) * 2;
for (int i = 0; i < m_Offsets.Length; i += 2)
{
int x = p.X + m_Offsets[(offset + i) % m_Offsets.Length];
int y = p.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];
if (map.CanSpawnMobile(x, y, p.Z))
{
p = new Point3D(x, y, p.Z);
return true;
}
else
{
int z = map.GetAverageZ(x, y);
if (map.CanSpawnMobile(x, y, z))
{
p = new Point3D(x, y, z);
return true;
}
}
}
return false;
}
示例3: Effect
public void Effect(Point3D loc, Map map, bool checkMulti)
{
if (Factions.Sigil.ExistsOn(this.Caster))
{
this.Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
}
else if (map == null || (!Core.AOS && this.Caster.Map != map))
{
this.Caster.SendLocalizedMessage(1005569); // You can not recall to another facet.
}
else if (!SpellHelper.CheckTravel(this.Caster, TravelCheckType.RecallFrom))
{
}
else if (!SpellHelper.CheckTravel(this.Caster, map, loc, TravelCheckType.RecallTo))
{
}
else if (map == Map.Felucca && this.Caster is PlayerMobile && ((PlayerMobile)this.Caster).Young)
{
this.Caster.SendLocalizedMessage(1049543); // You decide against traveling to Felucca while you are still young.
}
else if (this.Caster.Kills >= 5 && map != Map.Felucca)
{
this.Caster.SendLocalizedMessage(1019004); // You are not allowed to travel there.
}
else if (this.Caster.Criminal)
{
this.Caster.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
}
else if (SpellHelper.CheckCombat(this.Caster))
{
this.Caster.SendLocalizedMessage(1061282); // You cannot use the Sacred Journey ability to flee from combat.
}
else if (Server.Misc.WeightOverloading.IsOverloaded(this.Caster))
{
this.Caster.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
}
else if (!map.CanSpawnMobile(loc.X, loc.Y, loc.Z))
{
this.Caster.SendLocalizedMessage(501942); // That location is blocked.
}
else if ((checkMulti && SpellHelper.CheckMulti(loc, map)))
{
this.Caster.SendLocalizedMessage(501942); // That location is blocked.
}
else if (this.m_Book != null && this.m_Book.CurCharges <= 0)
{
this.Caster.SendLocalizedMessage(502412); // There are no charges left on that item.
}
else if (this.CheckSequence())
{
BaseCreature.TeleportPets(this.Caster, loc, map, true);
if (this.m_Book != null)
--this.m_Book.CurCharges;
Effects.SendLocationParticles(EffectItem.Create(this.Caster.Location, this.Caster.Map, EffectItem.DefaultDuration), 0, 0, 0, 5033);
this.Caster.PlaySound(0x1FC);
this.Caster.MoveToWorld(loc, map);
this.Caster.PlaySound(0x1FC);
}
this.FinishSequence();
}
示例4: Effect
public void Effect( Point3D loc, Map map, bool checkMulti )
{
if ( Factions.Sigil.ExistsOn( Caster ) )
{
Caster.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
}
else if ( map == null || (!Core.AOS && Caster.Map != map) )
{
Caster.SendLocalizedMessage( 1005570 ); // You can not gate to another facet.
}
else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.GateFrom ) )
{
}
else if ( !SpellHelper.CheckTravel( Caster, map, loc, TravelCheckType.GateTo ) )
{
}
else if ( map == Map.Felucca && Caster is PlayerMobile && ((PlayerMobile)Caster).Young )
{
Caster.SendLocalizedMessage( 1049543 ); // You decide against traveling to Felucca while you are still young.
}
else if ( Caster.Kills >= 5 && map != Map.Felucca )
{
Caster.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
}
else if ( Caster.Criminal )
{
Caster.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
}
else if ( SpellHelper.CheckCombat( Caster ) )
{
Caster.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
}
else if ( !map.CanSpawnMobile( loc.X, loc.Y, loc.Z ) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( (checkMulti && SpellHelper.CheckMulti( loc, map )) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( Core.SE && ( GateExistsAt( map, loc ) || GateExistsAt( Caster.Map, Caster.Location ) ) ) // SE restricted stacking gates
{
Caster.SendLocalizedMessage( 1071242 ); // There is already a gate there.
}
else if ( CheckSequence() )
{
Caster.SendLocalizedMessage( 501024 ); // You open a magical gate to another location
Effects.PlaySound( Caster.Location, Caster.Map, 0x20E );
InternalItem firstGate = new InternalItem( loc, map );
firstGate.MoveToWorld( Caster.Location, Caster.Map );
Effects.PlaySound( loc, map, 0x20E );
InternalItem secondGate = new InternalItem( Caster.Location, Caster.Map );
secondGate.MoveToWorld( loc, map );
}
FinishSequence();
}
示例5: Effect
public void Effect( Point3D loc, Map map, bool checkMulti )
{
if ( map == null || (!Core.AOS && Caster.Map != map) )
{
Caster.SendLocalizedMessage( 1005569 ); // You can not recall to another facet.
}
else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.RecallFrom ) )
{
}
else if ( !SpellHelper.CheckTravel( Caster, map, loc, TravelCheckType.RecallTo ) )
{
}
else if ( Caster.Kills >= 5 && map != Map.Felucca )
{
Caster.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
}
else if ( Caster.Criminal )
{
Caster.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
}
else if ( SpellHelper.CheckCombat( Caster ) )
{
Caster.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
}
else if ( Server.Misc.WeightOverloading.IsOverloaded( Caster ) )
{
Caster.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
}
else if ( !map.CanSpawnMobile( loc.X, loc.Y, loc.Z ) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( (checkMulti && SpellHelper.CheckMulti( loc, map )) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( m_Book != null && m_Book.CurCharges <= 0 )
{
Caster.SendLocalizedMessage( 502412 ); // There are no charges left on that item.
}
else if ( CheckSequence() )
{
BaseCreature.TeleportPets( Caster, loc, map, true );
if ( m_Book != null )
--m_Book.CurCharges;
Caster.PlaySound( 0x19 );
Effects.SendLocationParticles( Caster, 0xC87, 9, 10, 5025 );
Caster.Map = map;
Caster.Location = loc;
Caster.PlaySound( 0x19 );
Effects.SendLocationParticles( Caster, 0xC87, 9, 10, 5025 );
}
FinishSequence();
}
示例6: Spawn
public static BaseCreature Spawn( int level, Point3D p, Map map, Mobile target, bool guardian )
{
if ( map == null )
return null;
BaseCreature c = Spawn( level, p, guardian );
if ( c != null )
{
bool spawned = false;
for ( int i = 0; !spawned && i < 10; ++i )
{
int x = p.X - 3 + Utility.Random( 7 );
int y = p.Y - 3 + Utility.Random( 7 );
if ( map.CanSpawnMobile( x, y, p.Z ) )
{
c.MoveToWorld( new Point3D( x, y, p.Z ), map );
spawned = true;
}
else
{
int z = map.GetAverageZ( x, y );
if ( map.CanSpawnMobile( x, y, z ) )
{
c.MoveToWorld( new Point3D( x, y, z ), map );
spawned = true;
}
}
}
if ( !spawned )
{
c.Delete();
return null;
}
if ( target != null )
c.Combatant = target;
return c;
}
return null;
}
示例7: Effect
public void Effect( Point3D loc, Map map, bool checkMulti )
{
if ( map == null || (!Core.AOS && Caster.Map != map) )
{
Caster.SendLocalizedMessage( 1005569 ); // You can not recall to another facet.
}
else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.RecallFrom ) )
{
}
else if ( !SpellHelper.CheckTravel( Caster, map, loc, TravelCheckType.RecallTo ) )
{
}
else if ( Caster.Kills >= 5 && map != Map.Felucca )
{
Caster.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
}
else if ( Caster.Criminal )
{
Caster.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
}
else if ( SpellHelper.CheckCombat( Caster ) )
{
Caster.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
}
else if ( Server.Misc.WeightOverloading.IsOverloaded( Caster ) )
{
Caster.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
}
else if ( !map.CanSpawnMobile( loc.X, loc.Y, loc.Z ) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( (checkMulti && SpellHelper.CheckMulti( loc, map )) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( m_Book != null && m_Book.CurCharges <= 0 )
{
Caster.SendLocalizedMessage( 502412 ); // There are no charges left on that item.
}
else if ( CheckSequence() )
{
BaseCreature.TeleportPets( Caster, loc, map, true );
if ( m_Book != null )
--m_Book.CurCharges;
Caster.PlaySound( 143 );
Caster.Map = map;
Caster.Location = loc;
Caster.FixedParticles( 0x3779, 1, 30, 9964, 3, 3, EffectLayer.Waist );
IEntity from = new Entity( Serial.Zero, new Point3D( Caster.X, Caster.Y, Caster.Z ), Caster.Map );
IEntity to = new Entity( Serial.Zero, new Point3D( Caster.X, Caster.Y, Caster.Z + 50 ), Caster.Map );
Effects.SendMovingParticles( from, to, 0x20F2, 2, 1, false, false, 0, 3, 9501, 1, 0, EffectLayer.Head, 0x100 );
Caster.PlaySound( 144 );
}
FinishSequence();
}
示例8: Effect
public void Effect( Point3D loc, Map map, bool checkMulti )
{
if ( map == null || (!Core.AOS && Caster.Map != map) )
{
Caster.SendLocalizedMessage( 1005570 ); // You can not gate to another facet.
}
else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.GateFrom ) )
{
}
else if ( !SpellHelper.CheckTravel( Caster, map, loc, TravelCheckType.GateTo ) )
{
}
else if ( Caster.Kills >= 5 && map != Map.Felucca )
{
Caster.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
}
else if ( Caster.Criminal )
{
Caster.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
}
else if ( SpellHelper.CheckCombat( Caster ) )
{
Caster.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
}
else if ( !map.CanSpawnMobile( loc.X, loc.Y, loc.Z ) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( (checkMulti && SpellHelper.CheckMulti( loc, map )) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( CheckSequence() )
{
Caster.SendMessage( "You open a mystical portal in a mushroom circle" ); // You open a magical gate to another location
Effects.PlaySound( Caster.Location, Caster.Map, 0x1 );
int mushx;
int mushy;
int mushz;
InternalItem firstGatea = new InternalItem( loc, map );
mushx=Caster.X;
mushy=Caster.Y;
mushz=Caster.Z;
firstGatea.ItemID=0xD10;
Point3D mushxyz = new Point3D(mushx,mushy,mushz);
firstGatea.MoveToWorld( mushxyz, Caster.Map );
InternalItem firstGateb = new InternalItem( loc, map );
mushx=Caster.X;
mushy=Caster.Y;
firstGateb.ItemID=0x373A;
mushz=Caster.Z+1;
Point3D mushxyza = new Point3D(mushx,mushy,mushz);
firstGateb.MoveToWorld( mushxyza, Caster.Map );
InternalItem firstGatec = new InternalItem( loc, map );
mushx=Caster.X-1;
firstGatec.ItemID=0xD11;
mushy=Caster.Y+1;
mushz=Caster.Z;
Point3D mushxyzb = new Point3D(mushx,mushy,mushz);
firstGatec.MoveToWorld( mushxyzb, Caster.Map );
InternalItem firstGated = new InternalItem( loc, map);
firstGated.ItemID=0xD0C;
mushx=Caster.X;
mushy=Caster.Y+2;
mushz=Caster.Z;
Point3D mushxyzc = new Point3D(mushx,mushy,mushz);
firstGated.MoveToWorld( mushxyzc, Caster.Map );
InternalItem firstGatee = new InternalItem( loc, map );
mushx=Caster.X+1;
firstGatee.ItemID=0xD0D;
mushy=Caster.Y+1;
mushz=Caster.Z;
Point3D mushxyzd = new Point3D(mushx,mushy,mushz);
firstGatee.MoveToWorld( mushxyzd, Caster.Map );
InternalItem firstGatef = new InternalItem( loc, map );
firstGatef.ItemID=0xD0E;
mushx=Caster.X+2;
mushy=Caster.Y;
mushz=Caster.Z;
Point3D mushxyze = new Point3D(mushx,mushy,mushz);
firstGatef.MoveToWorld( mushxyze, Caster.Map );
InternalItem firstGateg = new InternalItem( loc, map );
mushx=Caster.X+1;
firstGateg.ItemID=0xD0F;
mushy=Caster.Y-1;
mushz=Caster.Z;
Point3D mushxyzf = new Point3D(mushx,mushy,mushz);
firstGateg.MoveToWorld( mushxyzf, Caster.Map );
Effects.PlaySound( loc, map, 0x1 );
InternalItem secondGatea = new InternalItem( Caster.Location, Caster.Map );
mushx=loc.X;
mushy=loc.Y;
//.........这里部分代码省略.........
示例9: Effect
public void Effect(Point3D loc, Map map, bool checkMulti)
{
if (map == null || (!Core.AOS && Caster.Map != map))
{
Caster.SendLocalizedMessage(1005569); // You can not recall to another facet.
}
else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.RecallFrom))
{
}
else if (!SpellHelper.CheckTravel(Caster, map, loc, TravelCheckType.RecallTo))
{
}
else if (Caster.Kills >= 5 && map != Map.Felucca)
{
Caster.SendLocalizedMessage(1019004); // You are not allowed to travel there.
}
else if (Caster.Criminal)
{
Caster.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
}
else if (SpellHelper.CheckCombat(Caster))
{
Caster.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
}
else if (Server.Misc.WeightOverloading.IsOverloaded(Caster))
{
Caster.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
}
else if (!map.CanSpawnMobile(loc.X, loc.Y, loc.Z))
{
Caster.SendLocalizedMessage(501942); // That location is blocked.
}
else if ((checkMulti && SpellHelper.CheckMulti(loc, map)))
{
Caster.SendLocalizedMessage(501942); // That location is blocked.
}
else if (m_Book != null && m_Book.CurCharges <= 0)
{
Caster.SendLocalizedMessage(502412); // There are no charges left on that item.
}
else if (BaseBoat.FindBoatAt(loc, map, 16) != null)
{
//plasma: If this is a boat, disallow
Caster.SendLocalizedMessage(501942); // That location is blocked.
}
else if (IsSpecial(loc) || IsSpecial(Caster.Location))
{
Caster.SendLocalizedMessage(501942); // That location is blocked.
}
else if (CheckSequence())
{
InternalTimer t = new InternalTimer(this, Caster, loc, m_Book);
t.Start();
}
FinishSequence();
}
示例10: Effect
public void Effect(Point3D loc, Map map, bool checkMulti)
{
var champregion = Region.Find(loc, map).GetRegion(typeof(ChampionSpawn)) as ChampionSpawnRegion;
if (Sigil.ExistsOn(Caster))
{
Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
}
else if (map == null || (!Caster.EraAOS && Caster.Map != map))
{
Caster.SendLocalizedMessage(1005570); // You can not gate to another facet.
}
else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.GateFrom))
{ }
else if (!SpellHelper.CheckTravel(Caster, map, loc, TravelCheckType.GateTo))
{ }
//else if ( map == Map.Felucca && Caster is PlayerMobile && ((PlayerMobile)Caster).Young )
//{
// Caster.SendLocalizedMessage( 1049543 ); // You decide against traveling to Felucca while you are still young.
//}
//else if ( Caster.Kills >= Mobile.MurderCount && map != Map.Felucca )
//{
// Caster.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
//}
else if (Caster.Criminal)
{
Caster.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
}
else if (SpellHelper.CheckCombat(Caster))
{
Caster.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
}
else if (!map.CanSpawnMobile(loc.X, loc.Y, loc.Z))
{
Caster.SendLocalizedMessage(501942); // That location is blocked.
}
else if ((checkMulti && SpellHelper.CheckMulti(loc, map)))
{
Caster.SendLocalizedMessage(501942); // That location is blocked.
}
else if ((!Caster.Alive || (Caster is PlayerMobile && ((PlayerMobile)Caster).Young)) && champregion != null &&
!champregion.CanSpawn())
{
Caster.SendLocalizedMessage(501942); // That location is blocked.
}
else if ((Region.Find(loc, map).IsPartOf(typeof(GuardedRegion))) && Caster.InCombat(TimeSpan.FromSeconds(60.0)) && Caster.Kills >= 5 && Faction.Find(Caster) != null && Caster.AccessLevel == AccessLevel.Player)
{
Caster.SendMessage(54, "You cannot enter town as a murderer and having recently been in combat!");
}
else if ( /*Core.SE &&*/ (GateExistsAt(map, loc) || GateExistsAt(Caster.Map, Caster.Location)))
// SE restricted stacking gates
{
Caster.SendLocalizedMessage(1071242); // There is already a gate there.
}
else if (CheckSequence())
{
Caster.SendLocalizedMessage(501024); // You open a magical gate to another location
Effects.PlaySound(Caster.Location, Caster.Map, 0x20E);
var firstGate = new InternalItem(loc, map);
firstGate.MoveToWorld(Caster.Location, Caster.Map);
Effects.PlaySound(loc, map, 0x20E);
var secondGate = new InternalItem(Caster.Location, Caster.Map);
secondGate.MoveToWorld(loc, map);
firstGate.Link = secondGate;
secondGate.Link = firstGate;
}
FinishSequence();
}
示例11: GetSpawnPosition
public static Point3D GetSpawnPosition(Point3D from, Map map, int range)
{
if (map == null)
return from;
for (int i = 0; i < 10; i ++)
{
int x = from.X + Utility.Random(range);
int y = from.Y + Utility.Random(range);
int z = map.GetAverageZ(x, y);
if (Utility.RandomBool())
x *= -1;
if (Utility.RandomBool())
y *= -1;
Point3D p = new Point3D(x, y, from.Z);
if (map.CanSpawnMobile(p) && map.LineOfSight(from, p))
return p;
p = new Point3D(x, y, z);
if (map.CanSpawnMobile(p) && map.LineOfSight(from, p))
return p;
}
return from;
}
示例12: Effect
public void Effect( Point3D loc, Map map, bool checkMulti )
{
if ( Factions.Sigil.ExistsOn( Caster ) )
{
Caster.SendAsciiMessage( "You can't do that while carrying the sigil." );
}
else if ( map == null || (!Core.AOS && Caster.Map != map) )
{
Caster.SendAsciiMessage( "You can not gate to another facet." );
}
else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.GateFrom ) )
{
}
else if ( !SpellHelper.CheckTravel( Caster, map, loc, TravelCheckType.GateTo ) )
{
}
else if ( map == Map.Felucca && Caster is PlayerMobile && ((PlayerMobile)Caster).Young )
{
Caster.SendAsciiMessage( "You decide against traveling to Felucca while you are still young." );
}
else if ( Caster.Kills >= 5 && map != Map.Felucca )
{
Caster.SendAsciiMessage( "You are not allowed to travel there." );
}
else if ( Caster.Criminal )
{
Caster.SendAsciiMessage( 0x22, "Thou'rt a criminal and cannot escape so easily." );
}
else if ( SpellHelper.CheckCombat( Caster ) )
{
Caster.SendAsciiMessage( 0x22, "Wouldst thou flee during the heat of battle?" );
}
else if ( !map.CanSpawnMobile( loc.X, loc.Y, loc.Z ) )
{
Caster.SendAsciiMessage( "That location is blocked." );
}
else if ( (checkMulti && SpellHelper.CheckMulti( loc, map )) )
{
Caster.SendAsciiMessage( "That location is blocked." );
}
else if ( CheckSequence() )
{
Caster.SendAsciiMessage( "You open a magical gate to another location." );
Effects.PlaySound( Caster.Location, Caster.Map, 0x20E );
InternalItem firstGate = new InternalItem( loc, map );
firstGate.MoveToWorld( Caster.Location, Caster.Map );
Effects.PlaySound( loc, map, 0x20E );
InternalItem secondGate = new InternalItem( Caster.Location, Caster.Map );
secondGate.MoveToWorld( loc, map );
}
FinishSequence();
}
示例13: Effect
public void Effect( Point3D loc, Map map, bool checkMulti )
{
if ( map == null || (!Core.AOS && Caster.Map != map) )
{
Caster.SendLocalizedMessage( 1005570 ); // You can not gate to another facet.
}
else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.GateFrom ) )
{
}
else if ( !SpellHelper.CheckTravel( Caster, map, loc, TravelCheckType.GateTo ) )
{
}
else if ( Caster.Kills >= 5 && map != Map.Felucca )
{
Caster.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
}
else if ( Caster.Criminal )
{
Caster.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
}
else if ( SpellHelper.CheckCombat( Caster ) )
{
Caster.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
}
else if ( !map.CanSpawnMobile( loc.X, loc.Y, loc.Z ) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( (checkMulti && SpellHelper.CheckMulti( loc, map )) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if (IsSpecial(loc) || IsSpecial(Caster.Location))
{
Caster.SendLocalizedMessage(501942); // That location is blocked.
}
else if (CheckSequence())
{
Caster.SendLocalizedMessage(501024); // You open a magical gate to another location
Effects.PlaySound(Caster.Location, Caster.Map, 0x20E);
InternalItem firstGate = new InternalItem(loc, map);
firstGate.MoveToWorld(Caster.Location, Caster.Map);
Effects.PlaySound(loc, map, 0x20E);
InternalItem secondGate = new InternalItem(Caster.Location, Caster.Map);
secondGate.MoveToWorld(loc, map);
}
FinishSequence();
}
示例14: Effect
public void Effect( Point3D loc, Map map, bool checkMulti )
{
if ( map == null || (!Core.AOS && Caster.Map != map) )
{
Caster.SendLocalizedMessage( 1005570 ); // You can not gate to another facet.
}
else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.GateFrom ) )
{
}
else if ( !SpellHelper.CheckTravel( Caster, map, loc, TravelCheckType.GateTo ) )
{
}
else if ( Caster.Kills >= 5 && map != Map.Felucca )
{
Caster.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
}
else if ( Caster.Criminal )
{
Caster.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
}
else if ( SpellHelper.CheckCombat( Caster ) )
{
Caster.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
}
else if ( !map.CanSpawnMobile( loc.X, loc.Y, loc.Z ) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( (checkMulti && SpellHelper.CheckMulti( loc, map )) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( CheckSequence() )
{
Caster.SendMessage( "The clouds open a magical gate to another place" ); // You open a magical gate to another location
Effects.PlaySound( Caster.Location, Caster.Map, 0x482 );
int gravx;
int gravy;
int gravz;
InternalItem firstGatea = new InternalItem( loc, map ); //Top Middle item
gravx=Caster.X-1;
gravy=Caster.Y-1;
gravz=Caster.Z;
firstGatea.ItemID=14138;
firstGatea.Hue = 1174;
Point3D gravxyz = new Point3D(gravx,gravy,gravz);
firstGatea.MoveToWorld( gravxyz, Caster.Map );
InternalItem firstGateb = new InternalItem( loc, map );
gravx=Caster.X;
gravy=Caster.Y;
firstGateb.ItemID=6899; //Moongate
firstGateb.Hue=1153;
gravz=Caster.Z;
Point3D gravxyza = new Point3D(gravx,gravy,gravz);
firstGateb.MoveToWorld( gravxyza, Caster.Map );
InternalItem firstGatec = new InternalItem( loc, map );
gravx=Caster.X-1;
firstGatec.ItemID=14138;
firstGatec.Hue = 1174;
gravy=Caster.Y+1;
gravz=Caster.Z;
Point3D gravxyzb = new Point3D(gravx,gravy,gravz);
firstGatec.MoveToWorld( gravxyzb, Caster.Map );
InternalItem firstGateg = new InternalItem( loc, map );
gravx=Caster.X+1;
firstGateg.ItemID=14138;
firstGateg.Hue = 1174;
gravy=Caster.Y-1;
gravz=Caster.Z;
Point3D gravxyzf = new Point3D(gravx,gravy,gravz);
firstGateg.MoveToWorld( gravxyzf, Caster.Map );
InternalItem firstGatee = new InternalItem( loc, map );
gravx=Caster.X+1;
firstGatee.ItemID=14170;
firstGatee.Hue = 1174;
gravy=Caster.Y+1;
gravz=Caster.Z;
Point3D gravxyzd = new Point3D(gravx,gravy,gravz);
firstGatee.MoveToWorld( gravxyzd, Caster.Map );
//Effects.PlaySound( loc, map, 0x482 );
Caster.PlaySound( 0x212 );
Caster.PlaySound( 0x206 );
InternalItem secondGatea = new InternalItem( Caster.Location, Caster.Map );
gravx=loc.X-1;
gravy=loc.Y-1;
gravz=loc.Z;
secondGatea.ItemID=14138;
secondGatea.Hue = 1151;
Point3D gravaxyz = new Point3D(gravx,gravy,gravz);
secondGatea.MoveToWorld( gravaxyz, map);
InternalItem secondGateb = new InternalItem( Caster.Location, Caster.Map );
gravx=loc.X;
gravy=loc.Y;
secondGateb.ItemID=6899; //Moongate
secondGateb.Hue = 1153;
gravz=loc.Z;
//.........这里部分代码省略.........
示例15: Effect
public void Effect( Point3D loc, Map map, bool checkMulti )
{
ChampionSpawnRegion champregion = Region.Find( loc, map ).GetRegion( typeof( ChampionSpawn ) ) as ChampionSpawnRegion;
CustomRegion customRegion = Region.Find(loc, map) as CustomRegion;
if (Factions.Sigil.ExistsOn(Caster))
Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
//else if ( map == null || (!Core.AOS && Caster.Map != map) )
// Caster.SendLocalizedMessage( 1005569 ); // You can not recall to another facet.
else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.RecallFrom))
{
}
else if (!SpellHelper.CheckTravel(Caster, map, loc, TravelCheckType.RecallTo))
{
}
else if (SpellHelper.IsWind(loc, map) && Caster.Skills[SkillName.Magery].Base < 70.0)
Caster.SendLocalizedMessage(503382); // You are not worthy of entrance to the city of Wind!
else if (Caster.Criminal)
Caster.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
else if (SpellHelper.CheckCombat(Caster))
Caster.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
else if ((Region.Find(loc, map).IsPartOf(typeof(GuardedRegion))) && Caster.InCombat(TimeSpan.FromSeconds(60.0)) && Caster.Kills >= 5 && Faction.Find(Caster) != null && Caster.AccessLevel == AccessLevel.Player)
{
Caster.SendMessage(54, "You cannot enter town as a murderer and having recently been in combat!");
}
else if (Server.Misc.WeightOverloading.IsOverloaded(Caster))
Caster.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
else if (!map.CanSpawnMobile(loc.X, loc.Y, loc.Z, false))
Caster.SendLocalizedMessage(501942); // That location is blocked.
else if ((checkMulti && SpellHelper.CheckMulti(loc, map)))
Caster.SendLocalizedMessage(501942); // That location is blocked.
else if ((!Caster.Alive || (Caster is PlayerMobile && ((PlayerMobile)Caster).Young)) && champregion != null && !champregion.CanSpawn())
Caster.SendLocalizedMessage(501942); // That location is blocked.
else if (m_Book != null && m_Book.CurCharges <= 0)
Caster.SendLocalizedMessage(502412); // There are no charges left on that item.
else if (customRegion != null && customRegion.Controller != null && customRegion.Controller.NoMounts && Caster.Mounted)
Caster.SendMessage("You cannot travel there while mounted!");
else if (customRegion != null && customRegion.Controller != null && customRegion.Controller.NoPets && Caster.Followers > 0)
Caster.SendMessage("Sorry, but no pets are allowed in that region at this time (including your mount).");
else if (CheckSequence())
{
BaseCreature.TeleportPets(Caster, loc, map, true);
if (m_Book != null)
--m_Book.CurCharges;
Caster.PlaySound(0x1FC);
Caster.MoveToWorld(loc, map);
Caster.PlaySound(0x1FC);
}
FinishSequence();
}