Exemplo n.º 1
0
 public WayPoint( WayPoint prev )
     : this()
 {
     if ( prev != null )
     {
         prev.NextPoint = this;
     }
 }
Exemplo n.º 2
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch( version )
			{
				case 0:
				{
					m_Next = reader.ReadItem() as WayPoint;
					break;
				}
			}
		}
Exemplo n.º 3
0
		/// <summary>
		/// Moves the NPC to the specified location
		/// </summary>
		/// <param name="to">The location the NPC should move to</param>
		public void GoTo( Point2D to )
		{
			AI = AIType.AI_Melee;

			m_NextMove = new Point3D( to, Z );

			if ( m_Piece is Knight )
			{
				WayPoint end = new WayPoint();
				WayPoint start = new WayPoint();

				end.MoveToWorld( m_NextMove, Map );

				// This is a knight, so do L shaped move
				int dx = to.X - X;
				int dy = to.Y - Y;

				Point3D p = Location; // Point3D is a value type

				if ( Math.Abs( dx ) == 1 )
					p.X += dx;
				else
					p.Y += dy;

				start.MoveToWorld( p, Map );
				start.NextPoint = end;

				CurrentWayPoint = start;

				m_WayPoints.Add( start );
				m_WayPoints.Add( end );
			}
			else
			{
				WayPoint wp = new WayPoint();
				wp.MoveToWorld( m_NextMove, Map );
				CurrentWayPoint = wp;

				m_WayPoints.Add( wp );
			}

			Paralyzed = false;
		}
Exemplo n.º 4
0
        public static void DeplacerMobile(Mobile m, Point3D p)
        {
            if (m == null) return;
            BaseCreature b = null;
            if(m is BaseCreature) b = (BaseCreature)m;
            if (b == null) return;

            if (b.AI == AIType.AI_None) b.AI = AIType.AI_Melee;

            if (b.CurrentWayPoint != null && b.CurrentWayPoint.Name == "TmpPoint")
                b.CurrentWayPoint.Delete();

            b.CurrentSpeed = 0.2;

            WayPoint point = new WayPoint();
            point.Name = "TmpPoint";
            point.MoveToWorld(p, b.Map);
            point.NextPoint = point;
            b.CurrentWayPoint = point;
        }
Exemplo n.º 5
0
        protected override void OnTarget( Mobile from, object targeted )
        {
            IPoint3D t = targeted as IPoint3D;
            if( t == null )
                return;

            Point3D loc = new Point3D( t );

            m_Man.AI = AIType.AI_Melee;
            m_Man.m_NextMove = loc;

            WayPoint GoHere = new WayPoint();
            GoHere.Map = from.Map;
            GoHere.Location = loc;
            m_Man.CurrentWayPoint = GoHere;
            m_Man.CantWalk = false;
            m_Man.Say( "I will gladly move here for you Master" );
            m_Man.m_WayPoints.Add( GoHere );
            from.SendGump( new MannequinControl( m_Man, from, 1 ) );
        }
Exemplo n.º 6
0
		public WayPointSeqTarget( WayPoint last ) : base( -1, true, TargetFlags.None )
		{
			m_Last = last;
		}
Exemplo n.º 7
0
		protected override void OnTarget( Mobile from, object targeted )
		{
			if ( targeted is WayPoint )
			{
				if ( m_Last != null )
					m_Last.NextPoint = (WayPoint)targeted;
			}
			else if ( targeted is IPoint3D )
			{
				Point3D p = new Point3D( (IPoint3D)targeted );

				WayPoint point = new WayPoint( m_Last );
				point.MoveToWorld( p, from.Map );

				from.Target = new WayPointSeqTarget( point );
				from.SendMessage( "Target the position of the next way point in the sequence, or target a way point link the newest way point to." );
			}
			else
			{
				from.SendMessage( "Target a position, or another way point." );
			}
		}
Exemplo n.º 8
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
			bool haveproximityrange = false;
			bool hasnewobjectinfo = false;
			int tmpSpawnListSize = 0;
			ArrayList tmpSubGroup = null;
			ArrayList tmpSequentialResetTime = null;
			ArrayList tmpSequentialResetTo = null;
			ArrayList tmpKillsNeeded = null;
			ArrayList tmpRequireSurface = null;
			ArrayList tmpRestrictKillsToSubgroup = null;
			ArrayList tmpClearOnAdvance = null;
			ArrayList tmpMinDelay = null;
			ArrayList tmpMaxDelay = null;
			ArrayList tmpNextSpawn = null;
			ArrayList tmpDisableSpawn = null;
			ArrayList tmpPackRange = null;
			ArrayList tmpSpawnsPer = null;

			switch( version )
			{
				case 30:
					{
						m_AllowNPCTriggering = reader.ReadBool();
						goto case 29;
					}
				case 29:
					{
						tmpSpawnListSize = reader.ReadInt();
						tmpSpawnsPer = new ArrayList( tmpSpawnListSize );
						for( int i = 0; i < tmpSpawnListSize; ++i )
						{
							int spawnsper = reader.ReadInt();

							tmpSpawnsPer.Add( spawnsper );

						}
						goto case 28;
					}
				case 28:
					{
						if( version < 29 )
							tmpSpawnListSize = reader.ReadInt();

						tmpPackRange = new ArrayList( tmpSpawnListSize );
						for( int i = 0; i < tmpSpawnListSize; ++i )
						{
							int packrange = reader.ReadInt();

							tmpPackRange.Add( packrange );

						}
						goto case 27;
					}
				case 27:
					{
						if( version < 28 )
							tmpSpawnListSize = reader.ReadInt();

						tmpDisableSpawn = new ArrayList( tmpSpawnListSize );
						for( int i = 0; i < tmpSpawnListSize; ++i )
						{
							bool disablespawn = reader.ReadBool();

							tmpDisableSpawn.Add( disablespawn );

						}
						goto case 26;
					}
				case 26:
					{
						m_SpawnOnTrigger = reader.ReadBool();
						m_FirstModified = reader.ReadDateTime();
						m_LastModified = reader.ReadDateTime();
						goto case 25;
					}
				case 25:
					{
						goto case 24;
					}
				case 24:
					{
						if( version < 27 )
							tmpSpawnListSize = reader.ReadInt();
						tmpRestrictKillsToSubgroup = new ArrayList( tmpSpawnListSize );
						tmpClearOnAdvance = new ArrayList( tmpSpawnListSize );
						tmpMinDelay = new ArrayList( tmpSpawnListSize );
						tmpMaxDelay = new ArrayList( tmpSpawnListSize );
						tmpNextSpawn = new ArrayList( tmpSpawnListSize );
						for( int i = 0; i < tmpSpawnListSize; ++i )
						{
							bool restrictkills = reader.ReadBool();
							bool clearadvance = reader.ReadBool();
							double mind = reader.ReadDouble();
							double maxd = reader.ReadDouble();
							DateTime nextspawn = reader.ReadDeltaTime();

							tmpRestrictKillsToSubgroup.Add( restrictkills );
							tmpClearOnAdvance.Add( clearadvance );
							tmpMinDelay.Add( mind );
							tmpMaxDelay.Add( maxd );
							tmpNextSpawn.Add( nextspawn );
						}

						bool hasitems = reader.ReadBool();

						if( hasitems )
						{
							m_ShowBoundsItems = reader.ReadItemList();
						}
						goto case 23;
					}
				case 23:
					{
						IsInactivated = reader.ReadBool();
						SmartSpawning = reader.ReadBool();

						goto case 22;
					}
				case 22:
					{
						SkillTrigger = reader.ReadString();    // note this will also register the skill
						m_skill_that_triggered = (SkillName)reader.ReadInt();
						m_FreeRun = reader.ReadBool();
						m_mob_who_triggered = reader.ReadMobile();
						goto case 21;
					}
				case 21:
					{
						m_DespawnTime = reader.ReadTimeSpan();
						goto case 20;
					}
				case 20:
					{
						if( version < 24 )
							tmpSpawnListSize = reader.ReadInt();
						tmpRequireSurface = new ArrayList( tmpSpawnListSize );
						for( int i = 0; i < tmpSpawnListSize; ++i )
						{
							bool requiresurface = reader.ReadBool();
							tmpRequireSurface.Add( requiresurface );
						}
						goto case 19;
					}
				case 19:
					{
						m_ConfigFile = reader.ReadString();
						m_OnHold = reader.ReadBool();
						m_HoldSequence = reader.ReadBool();
						m_FirstModifiedBy = reader.ReadString();
						m_LastModifiedBy = reader.ReadString();
						// deserialize the keyword tag list
						int tagcount = reader.ReadInt();
						m_KeywordTagList = new ArrayList( tagcount );
						for( int i = 0; i < tagcount; i++ )
						{
							BaseXmlSpawner.KeywordTag tag = new BaseXmlSpawner.KeywordTag( null, this );
							tag.Deserialize( reader );
						}
						goto case 18;
					}
				case 18:
					{
						m_AllowGhostTriggering = reader.ReadBool();
						goto case 17;
					}
				case 17:
					{
						if( version < 25 )
						{
							// the textentrybooks are deleted on deserialization so no need to track them
							reader.ReadItem();
						}
						goto case 16;
					}
				case 16:
					{
						hasnewobjectinfo = true;
						m_SequentialSpawning = reader.ReadInt();
						TimeSpan seqdelay = reader.ReadTimeSpan();
						m_SeqEnd = DateTime.Now + seqdelay;
						if( version < 20 )
						{
							tmpSpawnListSize = reader.ReadInt();
						}
						tmpSubGroup = new ArrayList( tmpSpawnListSize );
						tmpSequentialResetTime = new ArrayList( tmpSpawnListSize );
						tmpSequentialResetTo = new ArrayList( tmpSpawnListSize );
						tmpKillsNeeded = new ArrayList( tmpSpawnListSize );
						for( int i = 0; i < tmpSpawnListSize; ++i )
						{
							int subgroup = reader.ReadInt();
							double resettime = reader.ReadDouble();
							int resetto = reader.ReadInt();
							int killsneeded = reader.ReadInt();
							tmpSubGroup.Add( subgroup );
							tmpSequentialResetTime.Add( resettime );
							tmpSequentialResetTo.Add( resetto );
							tmpKillsNeeded.Add( killsneeded );
						}
						m_RegionName = reader.ReadString();	// 2004.02.08 :: Omega Red
						goto case 15;
					}
				case 15:
					{
						m_ExternalTriggering = reader.ReadBool();
						m_ExternalTrigger = reader.ReadBool();
						goto case 14;
					}
				case 14:
					{
						m_NoItemTriggerName = reader.ReadString();
						goto case 13;
					}
				case 13:
					{
						m_GumpState = reader.ReadString();
						goto case 12;
					}
				case 12:
					{
						int todtype = reader.ReadInt();
						switch( todtype )
						{
							case (int)TODModeType.Gametime:
								m_TODMode = TODModeType.Gametime;
								break;
							case (int)TODModeType.Realtime:
								m_TODMode = TODModeType.Realtime;
								break;
						}
						goto case 11;
					}
				case 11:
					{
						m_KillReset = reader.ReadInt();
						m_skipped = reader.ReadBool();
						m_spawncheck = reader.ReadInt();
						goto case 10;
					}
				case 10:
					{
						m_SetPropertyItem = reader.ReadItem();
						goto case 9;
					}
				case 9:
					{
						m_TriggerProbability = reader.ReadDouble();
						goto case 8;
					}
				case 8:
					{
						m_MobPropertyName = reader.ReadString();
						m_MobTriggerName = reader.ReadString();
						m_PlayerPropertyName = reader.ReadString();
						goto case 7;
					}
				case 7:
					{
						m_SpeechTrigger = reader.ReadString();
						goto case 6;
					}
				case 6:
					{
						m_ItemTriggerName = reader.ReadString();
						goto case 5;
					}
				case 5:
					{
						m_ProximityTriggerMessage = reader.ReadString();
						m_ObjectPropertyItem = reader.ReadItem();
						m_ObjectPropertyName = reader.ReadString();
						m_killcount = reader.ReadInt();
						goto case 4;
					}
				case 4:
					{
						haveproximityrange = true;
						m_ProximityRange = reader.ReadInt();
						m_ProximityTriggerSound = reader.ReadInt();
						m_proximityActivated = reader.ReadBool();
						m_durActivated = reader.ReadBool();
						m_refractActivated = reader.ReadBool();
						m_StackAmount = reader.ReadInt();
						m_TODStart = reader.ReadTimeSpan();
						m_TODEnd = reader.ReadTimeSpan();
						m_MinRefractory = reader.ReadTimeSpan();
						m_MaxRefractory = reader.ReadTimeSpan();
						if( m_refractActivated == true )
						{
							TimeSpan delay = reader.ReadTimeSpan();
							DoTimer3( delay );
						}
						if( m_durActivated == true )
						{
							TimeSpan delay = reader.ReadTimeSpan();
							DoTimer2( delay );
						}
						goto case 3;
					}
				case 3:
					{
						m_ShowContainerStatic = reader.ReadItem() as Static;
						goto case 2;
					}
				case 2:
					{
						m_Duration = reader.ReadTimeSpan();
						goto case 1;
					}
				case 1:
					{
						m_UniqueId = reader.ReadString();
						m_HomeRangeIsRelative = reader.ReadBool();
						goto case 0;
					}
				case 0:
					{
						m_Name = reader.ReadString();
						// backward compatibility with old name storage
						if( m_Name != null && m_Name != String.Empty ) Name = m_Name;
						m_X = reader.ReadInt();
						m_Y = reader.ReadInt();
						m_Width = reader.ReadInt();
						m_Height = reader.ReadInt();
						if( m_Width == m_Height )
							m_SpawnRange = m_Width / 2;
						else
							m_SpawnRange = -1;
						if( !haveproximityrange )
						{
							m_ProximityRange = -1;
						}
						m_WayPoint = reader.ReadItem() as WayPoint;
						m_Group = reader.ReadBool();
						m_MinDelay = reader.ReadTimeSpan();
						m_MaxDelay = reader.ReadTimeSpan();
						m_Count = reader.ReadInt();
						m_Team = reader.ReadInt();
						m_HomeRange = reader.ReadInt();
						m_Running = reader.ReadBool();

						if( m_Running == true )
						{
							TimeSpan delay = reader.ReadTimeSpan();
							DoTimer( delay );
						}

						// Read in the size of the spawn object list
						int SpawnListSize = reader.ReadInt();
						m_SpawnObjects = new ArrayList( SpawnListSize );
						for( int i = 0; i < SpawnListSize; ++i )
						{
							string TypeName = reader.ReadString();
							int TypeMaxCount = reader.ReadInt();

							SpawnObject TheSpawnObject = new SpawnObject( TypeName, TypeMaxCount );

							m_SpawnObjects.Add( TheSpawnObject );

							string typeName = BaseXmlSpawner.ParseObjectType( TypeName );
							// does it have a substitution that might change its validity?
							// if so then let it go

							if( typeName == null || ((SpawnerType.GetType( typeName ) == null) &&
								(!BaseXmlSpawner.IsTypeOrItemKeyword( typeName ) && typeName.IndexOf( '{' ) == -1 && !typeName.StartsWith( "*" ) && !typeName.StartsWith( "#" ))) )
							{
								if( m_WarnTimer == null )
									m_WarnTimer = new WarnTimer2();

								m_WarnTimer.Add( Location, Map, TypeName );

								this.status_str = "invalid type: " + typeName;
							}

							// Read in the number of spawns already
							int SpawnedCount = reader.ReadInt();

							TheSpawnObject.SpawnedObjects = new ArrayList( SpawnedCount );

							for( int x = 0; x < SpawnedCount; ++x )
							{
								int serial = reader.ReadInt();
								if( serial < -1 )
								{
									// minusone is reserved for unknown types by default
									//  minustwo on is used for referencing keyword tags
									int tagserial = -1 * (serial + 2);
									// get the tag with that serial and add it
									BaseXmlSpawner.KeywordTag t = BaseXmlSpawner.GetFromTagList( this, tagserial );
									if( t != null )
									{
										TheSpawnObject.SpawnedObjects.Add( t );
									}
								}
								else
								{
									IEntity e = World.FindEntity( serial );

									if( e != null )
										TheSpawnObject.SpawnedObjects.Add( e );
								}
							}
						}
						// now have to reintegrate the later version spawnobject information into the earlier version desered objects
						if( hasnewobjectinfo && tmpSpawnListSize == SpawnListSize )
						{
							for( int i = 0; i < SpawnListSize; ++i )
							{
								SpawnObject so = (SpawnObject)m_SpawnObjects[i];

								so.SubGroup = (int)tmpSubGroup[i];
								so.SequentialResetTime = (double)tmpSequentialResetTime[i];
								so.SequentialResetTo = (int)tmpSequentialResetTo[i];
								so.KillsNeeded = (int)tmpKillsNeeded[i];
								if( version > 19 )
									so.RequireSurface = (bool)tmpRequireSurface[i];
								bool restrictkills = false;
								bool clearadvance = true;
								double mind = -1;
								double maxd = -1;
								DateTime nextspawn = DateTime.MinValue;
								if( version > 23 )
								{
									restrictkills = (bool)tmpRestrictKillsToSubgroup[i];
									clearadvance = (bool)tmpClearOnAdvance[i];
									mind = (double)tmpMinDelay[i];
									maxd = (double)tmpMaxDelay[i];
									nextspawn = (DateTime)tmpNextSpawn[i];
								}
								so.RestrictKillsToSubgroup = restrictkills;
								so.ClearOnAdvance = clearadvance;
								so.MinDelay = mind;
								so.MaxDelay = maxd;
								so.NextSpawn = nextspawn;

								bool disablespawn = false;
								if( version > 26 )
								{
									disablespawn = (bool)tmpDisableSpawn[i];
								}
								so.Disabled = disablespawn;

								int packrange = -1;
								if( version > 27 )
								{
									packrange = (int)tmpPackRange[i];
								}
								so.PackRange = packrange;

								int spawnsper = 1;
								if( version > 28 )
								{
									spawnsper = (int)tmpSpawnsPer[i];
								}
								so.SpawnsPerTick = spawnsper;

							}
						}

						break;
					}
			}
		}
Exemplo n.º 9
0
 public WayPointSeqTarget(WayPoint last)
     : base(-1, true, TargetFlags.None)
 {
     m_Last = last;
 }
Exemplo n.º 10
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch( version )
            {

                case 2:
                    {
                        alignment = (Alignment)reader.ReadInt();
                        goto case 1;
                    }

                case 1:
                    {
                        TimeSpan deleteTime = TimeSpan.Zero;

                        if( version >= 1 )
                            deleteTime = reader.ReadTimeSpan();

                        if( deleteTime > TimeSpan.Zero || LastOwner != null && !Controlled && !IsStabled )
                        {
                            if( deleteTime <= TimeSpan.Zero || deleteTime > TimeSpan.FromDays(3.0) )
                                deleteTime = TimeSpan.FromDays(3.0);

                            m_DeleteTimer = new DeleteTimer(this, deleteTime);
                            m_DeleteTimer.Start();
                        }

                        goto case 0;
                    }

                case 0:
                    {
                        m_CurrentAI = (AIType)reader.ReadInt();
                        m_DefaultAI = (AIType)reader.ReadInt();

                        m_iRangePerception = reader.ReadInt();
                        m_iRangeFight = reader.ReadInt();
                        m_iRangeHome = reader.ReadInt();

                        m_iTeam = reader.ReadInt();

                        m_dActiveSpeed = reader.ReadDouble();
                        m_dPassiveSpeed = reader.ReadDouble();
                        m_dCurrentSpeed = reader.ReadDouble();

                        if( m_iRangePerception == OldRangePerception )
                            m_iRangePerception = DefaultRangePerception;

                        m_pHome.X = reader.ReadInt();
                        m_pHome.Y = reader.ReadInt();
                        m_pHome.Z = reader.ReadInt();

                        int i, iCount;

                        iCount = reader.ReadInt();
                        for( i = 0; i < iCount; i++ )
                        {
                            string str = reader.ReadString();
                            Type type = Type.GetType(str);

                            if( type != null )
                            {
                                m_arSpellAttack.Add(type);
                            }
                        }

                        iCount = reader.ReadInt();
                        for( i = 0; i < iCount; i++ )
                        {
                            string str = reader.ReadString();
                            Type type = Type.GetType(str);

                            if( type != null )
                            {
                                m_arSpellDefense.Add(type);
                            }
                        }

                        m_FightMode = (FightMode)reader.ReadInt();
                        m_bControlled = reader.ReadBool();
                        m_ControlMaster = reader.ReadMobile();
                        m_ControlTarget = reader.ReadMobile();
                        m_ControlDest = reader.ReadPoint3D();
                        m_ControlOrder = (OrderType)reader.ReadInt();
                        m_dMinTameSkill = reader.ReadDouble();
                        m_bTamable = reader.ReadBool();
                        m_bSummoned = reader.ReadBool();

                        if( m_bSummoned )
                        {
                            m_SummonEnd = reader.ReadDeltaTime();
                            new UnsummonTimer(m_ControlMaster, this, m_SummonEnd - DateTime.Now).Start();
                        }

                        m_iControlSlots = reader.ReadInt();
                        m_Loyalty = reader.ReadInt();
                        m_CurrentWayPoint = reader.ReadItem() as WayPoint;
                        m_SummonMaster = reader.ReadMobile();
                        m_HitsMax = reader.ReadInt();
                        m_StamMax = reader.ReadInt();
                        m_ManaMax = reader.ReadInt();
                        m_DamageMin = reader.ReadInt();
                        m_DamageMax = reader.ReadInt();
                        m_PhysicalResistance = reader.ReadInt();
                        m_PhysicalDamage = reader.ReadInt();
                        m_FireResistance = reader.ReadInt();
                        m_FireDamage = reader.ReadInt();
                        m_ColdResistance = reader.ReadInt();
                        m_ColdDamage = reader.ReadInt();
                        m_PoisonResistance = reader.ReadInt();
                        m_PoisonDamage = reader.ReadInt();
                        m_EnergyResistance = reader.ReadInt();
                        m_EnergyDamage = reader.ReadInt();
                        m_Owners = reader.ReadStrongMobileList();
                        m_IsDeadPet = reader.ReadBool();
                        m_IsBonded = reader.ReadBool();
                        m_BondingBegin = reader.ReadDateTime();
                        m_OwnerAbandonTime = reader.ReadDateTime();
                        m_HasGeneratedLoot = reader.ReadBool();

                        bool hasFriends = reader.ReadBool();

                        if( hasFriends )
                            m_Friends = reader.ReadStrongMobileList();
                        else
                            m_Friends = new List<Mobile>();

                        m_RemoveIfUntamed = reader.ReadBool();
                        m_RemoveStep = reader.ReadInt();
                        _spawner = reader.ReadItem();
                        _spawnerHome = reader.ReadPoint3D();

                        break;
                    }
            }

            double activeSpeed = m_dActiveSpeed;
            double passiveSpeed = m_dPassiveSpeed;

            SpeedInfo.GetSpeeds(this, ref activeSpeed, ref passiveSpeed);

            bool isStandardActive = false;
            for( int i = 0; !isStandardActive && i < m_StandardActiveSpeeds.Length; ++i )
                isStandardActive = (m_dActiveSpeed == m_StandardActiveSpeeds[i]);

            bool isStandardPassive = false;
            for( int i = 0; !isStandardPassive && i < m_StandardPassiveSpeeds.Length; ++i )
                isStandardPassive = (m_dPassiveSpeed == m_StandardPassiveSpeeds[i]);

            if( isStandardActive && m_dCurrentSpeed == m_dActiveSpeed )
                m_dCurrentSpeed = activeSpeed;
            else if( isStandardPassive && m_dCurrentSpeed == m_dPassiveSpeed )
                m_dCurrentSpeed = passiveSpeed;

            if( isStandardActive )
                m_dActiveSpeed = activeSpeed;

            if( isStandardPassive )
                m_dPassiveSpeed = passiveSpeed;

            if( Core.AOS && NameHue == 0x35 )
                NameHue = -1;

            CheckStatTimers();

            ChangeAIType(m_CurrentAI);

            AddFollowers();
        }
Exemplo n.º 11
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			m_CurrentAI = (AIType)reader.ReadInt();
			m_DefaultAI = (AIType)reader.ReadInt();

			m_iRangePerception = reader.ReadInt();
			m_iRangeFight = reader.ReadInt();

			m_iTeam = reader.ReadInt();

			m_dActiveSpeed = reader.ReadDouble();
			m_dPassiveSpeed = reader.ReadDouble();
			m_dCurrentSpeed = reader.ReadDouble();

			if ( m_iRangePerception == OldRangePerception )
				m_iRangePerception = DefaultRangePerception;

			m_pHome.X = reader.ReadInt();
			m_pHome.Y = reader.ReadInt();
			m_pHome.Z = reader.ReadInt();

			if ( version >= 1 )
			{
				m_iRangeHome = reader.ReadInt();

				int i, iCount;

				iCount = reader.ReadInt();
				for ( i=0; i< iCount; i++ )
				{
					string str = reader.ReadString();
					Type type = Type.GetType( str );

					if ( type != null )
					{
						m_arSpellAttack.Add( type );
					}
				}

				iCount = reader.ReadInt();
				for ( i=0; i< iCount; i++ )
				{
					string str = reader.ReadString();
					Type type = Type.GetType( str );

					if ( type != null )
					{
						m_arSpellDefense.Add( type );
					}
				}
			}
			else
			{
				m_iRangeHome = 0;
			}

			if ( version >= 2 )
			{
				m_FightMode = ( FightMode )reader.ReadInt();

				m_bControlled = reader.ReadBool();
				m_ControlMaster = reader.ReadMobile();
				m_ControlTarget = reader.ReadMobile();
				m_ControlDest = reader.ReadPoint3D();
				m_ControlOrder = (OrderType) reader.ReadInt();

				m_dMinTameSkill = reader.ReadDouble();

				if ( version < 9 )
					reader.ReadDouble();

				m_bTamable = reader.ReadBool();
				m_bSummoned = reader.ReadBool();

				if ( m_bSummoned )
				{
					m_SummonEnd = reader.ReadDeltaTime();
					new UnsummonTimer( m_ControlMaster, this, m_SummonEnd - DateTime.Now ).Start();
				}

				m_iControlSlots = reader.ReadInt();
			}
			else
			{
				m_FightMode = FightMode.Closest;

				m_bControlled = false;
				m_ControlMaster = null;
				m_ControlTarget = null;
				m_ControlOrder = OrderType.None;
			}

			if ( version >= 3 )
				m_Loyalty = reader.ReadInt();
			else
				m_Loyalty = MaxLoyalty; // Wonderfully Happy

			if ( version >= 4 )
				m_CurrentWayPoint = reader.ReadItem() as WayPoint;

			if ( version >= 5 )
				m_SummonMaster = reader.ReadMobile();

			if ( version >= 6 )
			{
				m_HitsMax = reader.ReadInt();
				m_StamMax = reader.ReadInt();
				m_ManaMax = reader.ReadInt();
				m_DamageMin = reader.ReadInt();
				m_DamageMax = reader.ReadInt();
			}

			if ( version >= 7 )
			{
				m_PhysicalResistance = reader.ReadInt();
				m_PhysicalDamage = reader.ReadInt();

				m_FireResistance = reader.ReadInt();
				m_FireDamage = reader.ReadInt();

				m_ColdResistance = reader.ReadInt();
				m_ColdDamage = reader.ReadInt();

				m_PoisonResistance = reader.ReadInt();
				m_PoisonDamage = reader.ReadInt();

				m_EnergyResistance = reader.ReadInt();
				m_EnergyDamage = reader.ReadInt();
			}

			if ( version >= 8 )
				m_Owners = reader.ReadStrongMobileList();
			else
				m_Owners = new List<Mobile>();

			if ( version >= 10 )
			{
				m_IsDeadPet = reader.ReadBool();
				m_IsBonded = reader.ReadBool();
				m_BondingBegin = reader.ReadDateTime();
				m_OwnerAbandonTime = reader.ReadDateTime();
			}

			if ( version >= 11 )
				m_HasGeneratedLoot = reader.ReadBool();
			else
				m_HasGeneratedLoot = true;

			if ( version >= 12 )
				m_Paragon = reader.ReadBool();
			else
				m_Paragon = false;

			if ( version >= 13 && reader.ReadBool() )
				m_Friends = reader.ReadStrongMobileList();
			else if ( version < 13 && m_ControlOrder >= OrderType.Unfriend )
				++m_ControlOrder;

			if ( version < 16 && Loyalty != MaxLoyalty )
				Loyalty *= 10;

			double activeSpeed = m_dActiveSpeed;
			double passiveSpeed = m_dPassiveSpeed;

			SpeedInfo.GetSpeeds( this, ref activeSpeed, ref passiveSpeed );

			bool isStandardActive = false;
			for ( int i = 0; !isStandardActive && i < m_StandardActiveSpeeds.Length; ++i )
				isStandardActive = ( m_dActiveSpeed == m_StandardActiveSpeeds[i] );

			bool isStandardPassive = false;
			for ( int i = 0; !isStandardPassive && i < m_StandardPassiveSpeeds.Length; ++i )
				isStandardPassive = ( m_dPassiveSpeed == m_StandardPassiveSpeeds[i] );

			if ( isStandardActive && m_dCurrentSpeed == m_dActiveSpeed )
				m_dCurrentSpeed = activeSpeed;
			else if ( isStandardPassive && m_dCurrentSpeed == m_dPassiveSpeed )
				m_dCurrentSpeed = passiveSpeed;

			if ( isStandardActive && !m_Paragon )
				m_dActiveSpeed = activeSpeed;

			if ( isStandardPassive && !m_Paragon )
				m_dPassiveSpeed = passiveSpeed;

			if ( version >= 14 )
			{
				m_RemoveIfUntamed = reader.ReadBool();
				m_RemoveStep = reader.ReadInt();
			}

			TimeSpan deleteTime = TimeSpan.Zero;

			if ( version >= 17 )
				deleteTime = reader.ReadTimeSpan();

			if ( deleteTime > TimeSpan.Zero || LastOwner != null && !Controlled && !IsStabled )
			{
				if ( deleteTime == TimeSpan.Zero )
					deleteTime = TimeSpan.FromDays( 3.0 );

				m_DeleteTimer = new DeleteTimer( this, deleteTime );
				m_DeleteTimer.Start();
			}

			if( version <= 14 && m_Paragon && Hue == 0x31 )
			{
				Hue = Paragon.Hue; //Paragon hue fixed, should now be 0x501.
			}

			CheckStatTimers();

			ChangeAIType(m_CurrentAI);

			AddFollowers();

			if ( IsAnimatedDead )
				Spells.Necromancy.AnimateDeadSpell.Register( m_SummonMaster, this );
		}
Exemplo n.º 12
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            int test = 0;

            if (version > 57)
            {
                m_Orders = new List<OrderInfo>();
                int orderCount = reader.ReadInt();
                for (int i = 0; i < orderCount; i++)
                {
                    OrderInfo newOrder = new OrderInfo("", 1, 1, this);
                    OrderInfo.Deserialize(reader, newOrder);
                    m_Orders.Add(newOrder);
                }
            }

            if (version > 55)
            {
                m_Deadly = reader.ReadInt();
            }

            if (version > 54)
            {
                m_Nation = (Nation)reader.ReadInt();
                m_Government = (GovernmentEntity)reader.ReadItem();
                m_Organization = (CustomGuildStone)reader.ReadItem();
            }

            if( version > 53 )
                m_AuraType = (AuraType)reader.ReadInt();

            if( version > 52 )
                m_CustomBreathType = (CustomBreathType)reader.ReadInt();

            if( version > 51 )
                m_ManeuverResistance = reader.ReadInt();

            if( version > 50 )
            {
                m_CantInterrupt = reader.ReadBool();
                m_CantParry = reader.ReadBool();
                m_HasNoCorpse = reader.ReadBool();
            }

            if( version > 49 )
            {
                int count = reader.ReadInt();

                for( int i = 0; i < count; i++ )
                    m_SecondaryWikiConfigs.Add( reader.ReadString() );

                count = reader.ReadInt();

                for( int i = 0; i < count; i++ )
                {
                    XMLEventType eventType = (XMLEventType)reader.ReadInt();
                    List<string> list = new List<string>();
                    int codeCount = reader.ReadInt();

                    for( int a = 0; a < codeCount; a++ )
                        list.Add( reader.ReadString() );

                    m_XMLEventsDatabase.Add( eventType, list );
                }
            }

            if( version > 48 )
                m_RangedAttackType = (RangedAttackType)reader.ReadInt();

            if( version > 47 )
                m_CustomSkinnableParts = reader.ReadStrongItemList();

            if( version > 46 )
            {
                m_NoWoundedMovePenalty = reader.ReadBool();
                m_MeleeAttackType = (MeleeAttackType)reader.ReadInt();
            }

            if( version > 45 )
                m_WikiConfig = reader.ReadString();

            if( version > 44 )
            {
                m_Technique = reader.ReadString();
                m_TechniqueLevel = reader.ReadInt();
            }

            if( version > 43 )
                m_StableTicket = reader.ReadItem();

            if( version > 41 )
                m_StabledOwner = reader.ReadMobile();

            if( version > 40 )
                m_ReceivedNewLoot = reader.ReadBool();

            if( version > 39 )
            {
                m_TimeOfDeath = reader.ReadDeltaTime();

                if( reader.ReadBool() )
                    BeginRess( reader.ReadDeltaTime() - DateTime.Now, this.Corpse );

                m_Lives = reader.ReadInt();
            }

            if( version > 38 )
                m_ReleaseTime = reader.ReadDateTime();

            if( version > 37 )
                m_MarkedForTermination = reader.ReadBool();

            if( version > 36 )
            {
                m_FavouriteStance = reader.ReadString();
                m_FavouriteManeuver = reader.ReadString();
            }

            if( version > 34 )
                m_CombatStyles = new CombatStyles( reader );

            if( version > 32 )
                m_Feats = new Feats( reader, true );

            if( version > 33 )
                m_FixedScales = reader.ReadBool();

            if( version > 31 )
            {
                m_NoDeathCondition = reader.ReadBool();
                m_NoDeath = reader.ReadBool();
                m_NoDeathMsg = reader.ReadString();
                m_NoDeathSound = reader.ReadInt();
            }

            if( version > 30 )
                this.Frozen = reader.ReadBool();

            if( version > 27 )
            {
                m_VanishTime = reader.ReadDateTime();
                m_VanishEmote = reader.ReadString();
            }

            m_CreatureGroup = (CreatureGroup)reader.ReadInt();

            if( version < 29 )
            {
                test = reader.ReadInt();
                m_IsSneaky = test > 0;
            }

            else
                m_IsSneaky = reader.ReadBool();

            if( version < 29 )
            {
                test = reader.ReadInt();
                m_TakesLifeOnKill = test > 0;
            }

            else
                m_TakesLifeOnKill = reader.ReadBool();

            m_Description = reader.ReadString();

            m_Intimidated = reader.ReadInt();

            if( version < 29 )
            {
                test = reader.ReadInt();
                m_IsHuntingHound = test > 0;
            }

            else
                m_IsHuntingHound = reader.ReadBool();

            m_XPScale = reader.ReadInt();

            m_StatScale = reader.ReadInt();

            m_SkillScale = reader.ReadInt();

            m_Level = reader.ReadInt();

            m_XP = reader.ReadInt();

            m_NextLevel = reader.ReadInt();

            if( version < 29 )
            {
                test = reader.ReadInt();
                m_Warned = test > 0;
            }

            else
                m_Warned = reader.ReadBool();

            m_WarningTime = reader.ReadDateTime();

            m_BribingTime = reader.ReadDateTime();

            m_EmployerFeatLevel = reader.ReadInt();

            m_TargetsName = reader.ReadString();

            m_Employer = reader.ReadMobile();

            m_HiringTime = reader.ReadDateTime();

            if( version < 29 )
            {
                test = reader.ReadInt();
                m_Bribed = test > 0;
            }

            else
                m_Bribed = reader.ReadBool();

            m_LastSeen = reader.ReadDateTime();

            if( version < 29 )
            {
                test = reader.ReadInt();
                m_CanBeInformant = test > 0;
            }

            else
                m_CanBeInformant = reader.ReadBool();

            m_CurrentAI = (AIType)reader.ReadInt();
            m_DefaultAI = (AIType)reader.ReadInt();

            m_iRangePerception = reader.ReadInt();
            m_iRangeFight = reader.ReadInt();

            m_iTeam = reader.ReadInt();

            m_dActiveSpeed = reader.ReadDouble();
            m_dPassiveSpeed = reader.ReadDouble();
            m_dCurrentSpeed = reader.ReadDouble();

            if ( m_iRangePerception == OldRangePerception )
                m_iRangePerception = DefaultRangePerception;

            m_pHome.X = reader.ReadInt();
            m_pHome.Y = reader.ReadInt();
            m_pHome.Z = reader.ReadInt();

            if ( version >= 1 )
            {
                m_iRangeHome = reader.ReadInt();

                int i, iCount;

                iCount = reader.ReadInt();
                for ( i=0; i< iCount; i++ )
                {
                    string str = reader.ReadString();
                    Type type = Type.GetType( str );

                    if ( type != null )
                    {
                        m_arSpellAttack.Add( type );
                    }
                }

                iCount = reader.ReadInt();
                for ( i=0; i< iCount; i++ )
                {
                    string str = reader.ReadString();
                    Type type = Type.GetType( str );

                    if ( type != null )
                    {
                        m_arSpellDefense.Add( type );
                    }
                }
            }
            else
            {
                m_iRangeHome = 0;
            }

            if ( version >= 2 )
            {
                m_FightMode = ( FightMode )reader.ReadInt();

                m_bControlled = reader.ReadBool();
                m_ControlMaster = reader.ReadMobile();
                m_ControlTarget = reader.ReadMobile();
                m_ControlDest = reader.ReadPoint3D();
                m_ControlOrder = (OrderType) reader.ReadInt();

                m_dMinTameSkill = reader.ReadDouble();

                if ( version < 9 )
                    reader.ReadDouble();

                m_bTamable = reader.ReadBool();
                m_bSummoned = reader.ReadBool();

                if ( m_bSummoned )
                {
                    m_SummonEnd = reader.ReadDeltaTime();
                    new UnsummonTimer( m_ControlMaster, this, m_SummonEnd - DateTime.Now ).Start();
                }

                m_iControlSlots = reader.ReadInt();
            }
            else
            {
                m_FightMode = FightMode.Closest;

                m_bControlled = false;
                m_ControlMaster = null;
                m_ControlTarget = null;
                m_ControlOrder = OrderType.None;
            }

            if ( version >= 3 )
                m_Loyalty = reader.ReadInt();
            else
                m_Loyalty = MaxLoyalty; // Wonderfully Happy

            if ( version >= 4 )
                m_CurrentWayPoint = reader.ReadItem() as WayPoint;

            if ( version >= 5 )
                m_SummonMaster = reader.ReadMobile();

            if ( version >= 6 )
            {
                //m_HitsMax = reader.ReadInt();
                //m_StamMax = reader.ReadInt();
                //m_ManaMax = reader.ReadInt();
                m_DamageMin = reader.ReadInt();
                m_DamageMax = reader.ReadInt();
            }

            if ( version >= 7 )
            {
                m_PhysicalResistance = reader.ReadInt();
                m_PhysicalDamage = reader.ReadInt();

                m_FireResistance = reader.ReadInt();
                m_FireDamage = reader.ReadInt();

                m_ColdResistance = reader.ReadInt();
                m_ColdDamage = reader.ReadInt();

                m_PoisonResistance = reader.ReadInt();
                m_PoisonDamage = reader.ReadInt();

                m_EnergyResistance = reader.ReadInt();
                m_EnergyDamage = reader.ReadInt();
            }

            if ( version >= 8 )
                m_Owners = reader.ReadStrongMobileList();
            else
                m_Owners = new List<Mobile>();

            if ( version >= 10 )
            {
                m_IsDeadPet = reader.ReadBool();
                m_IsBonded = reader.ReadBool();
                m_BondingBegin = reader.ReadDateTime();
                m_OwnerAbandonTime = reader.ReadDateTime();
            }

            if ( version >= 11 )
                m_HasGeneratedLoot = reader.ReadBool();
            else
                m_HasGeneratedLoot = true;

            if ( version >= 12 )
                m_Paragon = reader.ReadBool();
            else
                m_Paragon = false;

            if ( version >= 13 && reader.ReadBool() )
                m_Friends = reader.ReadStrongMobileList();
            else if ( version < 13 && m_ControlOrder >= OrderType.Unfriend )
                ++m_ControlOrder;

            if ( version < 16 )
                Loyalty *= 10;

            double activeSpeed = m_dActiveSpeed;
            double passiveSpeed = m_dPassiveSpeed;

            SpeedInfo.GetSpeeds( this, ref activeSpeed, ref passiveSpeed );

            bool isStandardActive = false;
            for ( int i = 0; !isStandardActive && i < m_StandardActiveSpeeds.Length; ++i )
                isStandardActive = ( m_dActiveSpeed == m_StandardActiveSpeeds[i] );

            bool isStandardPassive = false;
            for ( int i = 0; !isStandardPassive && i < m_StandardPassiveSpeeds.Length; ++i )
                isStandardPassive = ( m_dPassiveSpeed == m_StandardPassiveSpeeds[i] );

            if ( isStandardActive && m_dCurrentSpeed == m_dActiveSpeed )
                m_dCurrentSpeed = activeSpeed;
            else if ( isStandardPassive && m_dCurrentSpeed == m_dPassiveSpeed )
                m_dCurrentSpeed = passiveSpeed;

            if ( isStandardActive && !m_Paragon )
                m_dActiveSpeed = activeSpeed;

            if ( isStandardPassive && !m_Paragon )
                m_dPassiveSpeed = passiveSpeed;

            if ( version >= 14 )
            {
                m_RemoveIfUntamed = reader.ReadBool();
                m_RemoveStep = reader.ReadInt();
            }

            if( version <= 14 && m_Paragon && Hue == 0x31 )
            {
                Hue = Paragon.Hue; //Paragon hue fixed, should now be 0x501.
            }

            m_BluntResistance = reader.ReadInt();
            m_BluntDamage = reader.ReadInt();
            m_SlashingResistance = reader.ReadInt();
            m_SlashingDamage = reader.ReadInt();
            m_PiercingResistance = reader.ReadInt();
            m_PiercingDamage = reader.ReadInt();

            CheckStatTimers();

            Timer.DelayCall( TimeSpan.FromSeconds( 5 ), new TimerCallback( WaitToChangeAI ) );

            AddFollowers();

            if ( IsAnimatedDead )
                Spells.Necromancy.AnimateDeadSpell.Register( m_SummonMaster, this );

            if( this.Level < 1 )
                this.Level = 1;

            if( this.Blessed && this.Alive )
                this.CanBeInformant = true;

            m_Intimidated = 0;

            if( !( this is Mercenary ) && version < 34 && this.Level > 1 )
            {
                int bonus = this.Level / 2;
                int rest = this.Level % 2;

                this.DamageMax += bonus + rest;
                this.DamageMin += bonus;
            }

            LevelSystem.FixStatsAndSkills( this );

            m_Deserialized = true;
        }
Exemplo n.º 13
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
                case 2:
				case 1:
				{
					key_KeyVal = reader.ReadUInt();
					key_Description = reader.ReadString();
					key_Max = reader.ReadInt();
					key_Delay = TimeSpan.Parse(reader.ReadString());
					i_Door = reader.ReadItem();

					goto case 0;
				}
				case 0:
				{
                    m_WalkingRange = reader.ReadInt();
					m_WayPoint = reader.ReadItem() as WayPoint;
					m_MinDelay = reader.ReadTimeSpan();
					m_MaxDelay = reader.ReadTimeSpan();
					m_Count = reader.ReadInt();
					m_Team = reader.ReadInt();
					m_HomeRange = reader.ReadInt();
					m_Running = reader.ReadBool();

                    if (version == 1)
                        m_WalkingRange = m_HomeRange;

					TimeSpan ts = TimeSpan.Zero;

					if ( m_Running )
						ts = reader.ReadDeltaTime() - DateTime.Now;
					
					int size = reader.ReadInt();

					m_CreaturesName = new ArrayList( size );

					for ( int i = 0; i < size; ++i )
					{
						string typeName = reader.ReadString();

						m_CreaturesName.Add( typeName );

						if ( SpawnerType.GetType( typeName ) == null )
						{
							if ( m_WarnTimer == null )
								m_WarnTimer = new gWarnTimer();

							m_WarnTimer.Add( Location, Map, typeName );
						}
					}

					int count = reader.ReadInt();

					m_Creatures = new ArrayList( count );

					for ( int i = 0; i < count; ++i )
					{
						IEntity e = World.FindEntity( reader.ReadInt() );

						if ( e != null )
							m_Creatures.Add( e );
					}

					if ( m_Running )
						DoTimer( ts );

					break;
				}
			}
		}
        public override void OnResponse( NetState state, RelayInfo info )
        {
            Mobile from = state.Mobile;
            switch ( info.ButtonID )
            {
            case 0:
            {

                                    from.CloseGump( typeof( StartStopCovetram ) );
                from.SendGump( new CityInvasion( from ) );
                                    break;
                             }
            case 1:
            {
            Point3D loc = new Point3D( 568, 1311, 0 );

            WayPoint point = new WayPoint();
            WayPoint point1 = new WayPoint();
            WayPoint point2 = new WayPoint();
            WayPoint point3 = new WayPoint();
            WayPoint point4 = new WayPoint();
            WayPoint point5 = new WayPoint();
            WayPoint point6 = new WayPoint();
            WayPoint point7 = new WayPoint();
            WayPoint point8 = new WayPoint();
            WayPoint point9 = new WayPoint();

            WayPoint point10 = new WayPoint();
            WayPoint point11 = new WayPoint();
            WayPoint point12 = new WayPoint();
            WayPoint point13 = new WayPoint();
            WayPoint point14 = new WayPoint();
            WayPoint point15 = new WayPoint();
            WayPoint point16 = new WayPoint();
            WayPoint point17 = new WayPoint();
            WayPoint point18 = new WayPoint();
            WayPoint point19 = new WayPoint();

            WayPoint point20 = new WayPoint();
            WayPoint point21 = new WayPoint();
            WayPoint point22 = new WayPoint();
            WayPoint point23 = new WayPoint();
            WayPoint point24 = new WayPoint();
            WayPoint point25 = new WayPoint();
            WayPoint point26 = new WayPoint();
            WayPoint point27 = new WayPoint();
            WayPoint point28 = new WayPoint();
            WayPoint point29 = new WayPoint();

            WayPoint point30 = new WayPoint();
            WayPoint point31 = new WayPoint();
            WayPoint point32 = new WayPoint();
            WayPoint point33 = new WayPoint();
            WayPoint point34 = new WayPoint();
            WayPoint point35 = new WayPoint();
            WayPoint point36 = new WayPoint();
            WayPoint point37 = new WayPoint();

            point.Name = "CoveInvasionTrammel";
            point1.Name = "CoveInvasionTrammel";
            point2.Name = "CoveInvasionTrammel";
            point3.Name = "CoveInvasionTrammel";
            point4.Name = "CoveInvasionTrammel";
            point5.Name = "CoveInvasionTrammel";
            point6.Name = "CoveInvasionTrammel";
            point7.Name = "CoveInvasionTrammel";
            point8.Name = "CoveInvasionTrammel";
            point9.Name = "CoveInvasionTrammel";

            point10.Name = "CoveInvasionTrammel";
            point11.Name = "CoveInvasionTrammel";
            point12.Name = "CoveInvasionTrammel";
            point13.Name = "CoveInvasionTrammel";
            point14.Name = "CoveInvasionTrammel";
            point15.Name = "CoveInvasionTrammel";
            point16.Name = "CoveInvasionTrammel";
            point17.Name = "CoveInvasionTrammel";
            point18.Name = "CoveInvasionTrammel";
            point19.Name = "CoveInvasionTrammel";

            point20.Name = "CoveInvasionTrammel";
            point21.Name = "CoveInvasionTrammel";
            point22.Name = "CoveInvasionTrammel";
            point23.Name = "CoveInvasionTrammel";
            point24.Name = "CoveInvasionTrammel";
            point25.Name = "CoveInvasionTrammel";
            point26.Name = "CoveInvasionTrammel";
            point27.Name = "CoveInvasionTrammel";
            point28.Name = "CoveInvasionTrammel";
            point29.Name = "CoveInvasionTrammel";

            point30.Name = "CoveInvasionTrammel";
            point31.Name = "CoveInvasionTrammel";
            point32.Name = "CoveInvasionTrammel";
            point33.Name = "CoveInvasionTrammel";
            point34.Name = "CoveInvasionTrammel";
            point35.Name = "CoveInvasionTrammel";
            point36.Name = "CoveInvasionTrammel";
            point37.Name = "CoveInvasionTrammel";

            Spawner spawner1 = new Spawner( 4, 5, 15, 0, 4, "OrcBomber" );
            spawner1.MoveToWorld( new Point3D( 2322, 1127, 0 ), Map.Trammel );
            spawner1.WayPoint = point;
            point.MoveToWorld( new Point3D( 2313, 1169, 0 ), Map.Trammel );
            point.NextPoint = point1;
            point1.MoveToWorld( new Point3D( 2285, 1210, 0 ), Map.Trammel );
            point1.NextPoint = point2;
            point2.MoveToWorld( new Point3D( 2253, 1210, 0 ), Map.Trammel );
            point2.NextPoint = point3;
            point3.MoveToWorld( new Point3D( 2236, 1216, 0 ), Map.Trammel );
            point3.NextPoint = point4;
            point4.MoveToWorld( new Point3D( 2236, 1196, 0 ), Map.Trammel );
            point4.NextPoint = point5;
            point5.MoveToWorld( new Point3D( 2243, 1196, 0 ), Map.Trammel );
            point5.NextPoint = point6;
            point6.MoveToWorld( new Point3D( 2243, 1182, 0 ), Map.Trammel );
            point6.NextPoint = point7;
            point7.MoveToWorld( new Point3D( 2227, 1166, 0 ), Map.Trammel );
            point7.NextPoint = point8;
            point8.MoveToWorld( new Point3D( 2221, 1205, 0 ), Map.Trammel );
            point8.NextPoint = point9;
            point9.MoveToWorld( new Point3D( 2237, 1210, 0 ), Map.Trammel );
            point9.NextPoint = point2;
              			spawner1.Name = "CoveInvasionTrammel";
            spawner1.Respawn();

            Spawner spawner2 = new Spawner( 4, 5, 15, 0, 10, "Orc" );
            spawner2.MoveToWorld( new Point3D(  2348, 1214, 0  ), Map.Trammel );
            spawner2.WayPoint = point10;
            point10.MoveToWorld( new Point3D(  2285, 1210, 0  ), Map.Trammel );
            point10.NextPoint = point11;
            point11.MoveToWorld( new Point3D(  2268, 1210, 0  ), Map.Trammel );
            point11.NextPoint = point12;
            point12.MoveToWorld( new Point3D(  2268, 1231, 0  ), Map.Trammel );
            point12.NextPoint = point13;
            point13.MoveToWorld( new Point3D(  2251, 1231, 0  ), Map.Trammel );
            point13.NextPoint = point14;
            point14.MoveToWorld( new Point3D(  2251, 1214, 0  ), Map.Trammel );
            point14.NextPoint = point15;
            point15.MoveToWorld( new Point3D( 2234, 1211, 0 ), Map.Trammel );
            point15.NextPoint = point16;
            point16.MoveToWorld( new Point3D( 2210, 1200, 0 ), Map.Trammel );
            point16.NextPoint = point17;
            point17.MoveToWorld( new Point3D( 2210, 1177, 0 ), Map.Trammel );
            point17.NextPoint = point18;
            point18.MoveToWorld( new Point3D( 2240, 1177, 0 ), Map.Trammel );
            point18.NextPoint = point19;
            point19.MoveToWorld( new Point3D( 2276, 1211, 0 ), Map.Trammel );
            point19.NextPoint = point11;
            spawner2.Name = "CoveInvasionTrammel";
            spawner2.Respawn();

            Spawner spawner3 = new Spawner( 6, 5, 15, 0, 0, "Orc" );
            spawner3.MoveToWorld( new Point3D( 2210, 1274, 0 ), Map.Trammel );
            spawner3.WayPoint = point20;
            point20.MoveToWorld( new Point3D( 2284, 1268, 0 ), Map.Trammel );
            point20.NextPoint = point21;
            point21.MoveToWorld( new Point3D( 2294, 1207, 0 ), Map.Trammel );
            point21.NextPoint = point22;
            point22.MoveToWorld( new Point3D( 2286, 1186, 0 ), Map.Trammel );
            point22.NextPoint = point23;
            point23.MoveToWorld( new Point3D( 2286, 1218, 0 ), Map.Trammel );
            point23.NextPoint = point22;
            spawner3.Name = "CoveInvasionTrammel";
            spawner3.Respawn();

            Spawner spawner4 = new Spawner( 4, 5, 15, 0, 20, "Orc" );
            spawner4.MoveToWorld( new Point3D( 2364, 1205, 5 ), Map.Trammel );
            spawner4.WayPoint = point24;
            point24.MoveToWorld( new Point3D( 2285, 1210, 0 ), Map.Trammel );
            point24.NextPoint = point25;
            point25.MoveToWorld( new Point3D( 2275, 1209, 0 ), Map.Trammel );
            point25.NextPoint = point26;
            point26.MoveToWorld( new Point3D( 2275, 1203, 0 ), Map.Trammel );
            point26.NextPoint = point27;
            point27.MoveToWorld( new Point3D( 2272, 1200, 2 ), Map.Trammel );
            point27.NextPoint = point28;
            point28.MoveToWorld( new Point3D( 2272, 1196, 20 ), Map.Trammel );
            point28.NextPoint = point29;
            point29.MoveToWorld( new Point3D( 2282, 1200, 20 ), Map.Trammel );
            point29.NextPoint = point30;
            point30.MoveToWorld( new Point3D( 2282, 1187, 20 ), Map.Trammel );
            point30.NextPoint = point31;
            point31.MoveToWorld( new Point3D( 2282, 1222, 20 ), Map.Trammel );
            point31.NextPoint = point32;
            point32.MoveToWorld( new Point3D( 2290, 1222, 20 ), Map.Trammel );
            point32.NextPoint = point33;
            point33.MoveToWorld( new Point3D( 2287, 1228, 20 ), Map.Trammel );
            point33.NextPoint = point34;
            point34.MoveToWorld( new Point3D( 2280, 1224, 20 ), Map.Trammel );
            point34.NextPoint = point35;
            point35.MoveToWorld( new Point3D( 2280, 1227, 7 ), Map.Trammel );
            point35.NextPoint = point36;
            point36.MoveToWorld( new Point3D( 2283, 1233, 0 ), Map.Trammel );
            point36.NextPoint = point37;
            point37.MoveToWorld( new Point3D( 2273, 1233, 0 ), Map.Trammel );
            point37.NextPoint = point26;
            spawner4.Name = "CoveInvasionTrammel";
            spawner4.Respawn();

            Spawner spawner5 = new Spawner( 4, 5, 15, 0, 8, "OrcishLord" );
            spawner5.MoveToWorld( new Point3D( 2219, 1117, 17 ), Map.Trammel );
                        spawner5.Name = "CoveInvasionTrammel";
            spawner5.Respawn();

                        Spawner spawner6 = new Spawner( 3, 5, 15, 0, 8, "OrcishMage" );
            spawner6.MoveToWorld( new Point3D( 2322, 1127, 0 ), Map.Trammel );
                        spawner6.Name = "CoveInvasionTrammel";
            spawner6.Respawn();

                        Spawner spawner7 = new Spawner( 3, 5, 15, 0, 8, "OrcishLord" );
            spawner7.MoveToWorld( new Point3D( 2348, 1214, 0 ), Map.Trammel );
                        spawner7.Name = "CoveInvasionTrammel";
            spawner7.Respawn();

                        Spawner spawner8 = new Spawner( 3, 5, 15, 0, 8, "OrcishMage" );
            spawner8.MoveToWorld( new Point3D( 2210, 1274, 0 ), Map.Trammel );
                        spawner8.Name = "CoveInvasionTrammel";
            spawner8.Respawn();

                        Spawner spawner9 = new Spawner( 3, 5, 15, 0, 8, "OrcishLord" );
            spawner9.MoveToWorld( new Point3D( 2364, 1205, 5 ), Map.Trammel );
                        spawner9.Name = "CoveInvasionTrammel";
            spawner9.Respawn();

                        Spawner spawner10 = new Spawner( 3, 5, 15, 0, 20, "OrcScout" );
            spawner10.MoveToWorld( new Point3D( 2348, 1214, 0 ), Map.Trammel );
                        spawner10.Name = "CoveInvasionTrammel";
            spawner10.Respawn();

                        Spawner spawner11 = new Spawner( 1, 5, 15, 0, 1, "OrcCamp" );
            spawner11.MoveToWorld( new Point3D( 2348, 1214, 0 ), Map.Trammel );
                        spawner11.Name = "CoveInvasionTrammel";
            spawner11.Respawn();

                        Spawner spawner12 = new Spawner( 2, 5, 15, 0, 8, "OrcishLord" );
            spawner12.MoveToWorld( new Point3D( 2225, 1168, 0 ), Map.Trammel );
                        spawner12.Name = "CoveInvasionTrammel";
            spawner12.Respawn();

                        Spawner spawner13 = new Spawner( 2, 5, 15, 0, 8, "OrcishMage" );
            spawner13.MoveToWorld( new Point3D( 2216, 1190, 0 ), Map.Trammel );
                        spawner13.Name = "CoveInvasionTrammel";
            spawner13.Respawn();

                        Spawner spawner14 = new Spawner( 2, 5, 15, 0, 8, "OrcishLord" );
            spawner14.MoveToWorld( new Point3D( 2234, 1210, 0 ), Map.Trammel );
                        spawner14.Name = "CoveInvasionTrammel";
            spawner14.Respawn();

                        Spawner spawner15 = new Spawner( 2, 5, 15, 0, 8, "OrcishMage" );
            spawner15.MoveToWorld( new Point3D( 2277, 1200, 20 ), Map.Trammel );
                        spawner15.Name = "CoveInvasionTrammel";
            spawner15.Respawn();

                        Spawner spawner16 = new Spawner( 1, 5, 15, 0, 1, "OrcCamp" );
            spawner16.MoveToWorld( new Point3D( 2295, 1203, 0 ), Map.Trammel );
                        spawner16.Name = "CoveInvasionTrammel";
            spawner16.Respawn();

                        Spawner spawner17 = new Spawner( 10, 5, 15, 0, 25, "Orc" );
            spawner17.MoveToWorld( new Point3D( 2295, 1203, 0 ), Map.Trammel );
                        spawner17.Name = "CoveInvasionTrammel";
            spawner17.Respawn();

                        Spawner spawner18 = new Spawner( 1, 5, 15, 0, 1, "OrcCamp" );
            spawner18.MoveToWorld( new Point3D( 2301, 1229, 0 ), Map.Trammel );
                        spawner18.Name = "CoveInvasionTrammel";
            spawner18.Respawn();

                        Spawner spawner19 = new Spawner( 1, 5, 15, 0, 1, "OrcCamp" );
            spawner19.MoveToWorld( new Point3D( 2223, 1151, 0 ), Map.Trammel );
                        spawner19.Name = "CoveInvasionTrammel";
            spawner19.Respawn();

                        Spawner spawner20 = new Spawner( 10, 5, 15, 0, 15, "Orc" );
            spawner20.MoveToWorld( new Point3D( 2224, 1181, 0 ), Map.Trammel );
                        spawner20.Name = "CoveInvasionTrammel";
            spawner20.Respawn();

                        Spawner spawner21 = new Spawner( 10, 5, 15, 0, 15, "Orc" );
            spawner21.MoveToWorld( new Point3D( 2247, 1219, 0 ), Map.Trammel );
                        spawner21.Name = "CoveInvasionTrammel";
            spawner21.Respawn();

                        Spawner spawner22 = new Spawner( 5, 5, 15, 0, 15, "Orc" );
            spawner22.MoveToWorld( new Point3D( 2224, 1181, 0 ), Map.Trammel );
                        spawner22.Name = "CoveInvasionTrammel";
            spawner22.Respawn();

                        Spawner spawner23 = new Spawner( 3, 5, 15, 0, 10, "OrcScout" );
            spawner23.MoveToWorld( new Point3D( 2299, 1252, 0 ), Map.Trammel );
                        spawner23.Name = "CoveInvasionTrammel";
            spawner23.Respawn();

                        Spawner spawner24 = new Spawner( 3, 5, 15, 0, 8, "OrcishMage" );
            spawner24.MoveToWorld( new Point3D( 2257, 1204, 0 ), Map.Trammel );
                        spawner24.Name = "CoveInvasionTrammel";
            spawner24.Respawn();

                        Spawner spawner25 = new Spawner( 5, 5, 15, 0, 10, "Orc" );
            spawner25.MoveToWorld( new Point3D( 2222, 1129, 0 ), Map.Trammel );
                        spawner25.Name = "CoveInvasionTrammel";
            spawner25.Respawn();

                        Spawner spawner26 = new Spawner( 5, 5, 15, 0, 10, "Orc" );
            spawner26.MoveToWorld( new Point3D( 2271, 1218, 0 ), Map.Trammel );
                        spawner26.Name = "CoveInvasionTrammel";
            spawner26.Respawn();

                        Spawner spawner27 = new Spawner( 5, 5, 15, 0, 10, "Orc" );
            spawner27.MoveToWorld( new Point3D( 2233, 1240, 0 ), Map.Trammel );
                        spawner27.Name = "CoveInvasionTrammel";
            spawner27.Respawn();

                        Spawner spawner28 = new Spawner( 2, 5, 15, 0, 5, "OrcBomber" );
            spawner28.MoveToWorld( new Point3D( 2289, 1222, 20 ), Map.Trammel );
                        spawner28.Name = "CoveInvasionTrammel";
            spawner28.Respawn();

                        Spawner spawner29 = new Spawner( 2, 5, 15, 0, 5, "OrcBomber" );
            spawner29.MoveToWorld( new Point3D( 2281, 1192, 20 ), Map.Trammel );
                        spawner29.Name = "CoveInvasionTrammel";
            spawner29.Respawn();

                        Spawner spawner30 = new Spawner( 1, 5, 15, 0, 1, "OrcCamp" );
            spawner30.MoveToWorld( new Point3D( 2303, 1131, 0 ), Map.Trammel );
                        spawner30.Name = "CoveInvasionTrammel";
            spawner30.Respawn();

                        Spawner spawner31 = new Spawner( 5, 5, 15, 0, 10, "Orc" );
            spawner31.MoveToWorld( new Point3D( 2292, 1110, 0 ), Map.Trammel );
                        spawner31.Name = "CoveInvasionTrammel";
            spawner31.Respawn();

                        Spawner spawner32 = new Spawner( 5, 5, 15, 0, 10, "Orc" );
            spawner32.MoveToWorld( new Point3D( 2347, 1151, 5 ), Map.Trammel );
                        spawner32.Name = "CoveInvasionTrammel";
            spawner32.Respawn();

                        Spawner spawner33 = new Spawner( 5, 5, 15, 0, 10, "Orc" );
            spawner32.MoveToWorld( new Point3D( 2361, 1183, 10 ), Map.Trammel );
                        spawner33.Name = "CoveInvasionTrammel";
            spawner33.Respawn();

                        Spawner spawner34 = new Spawner( 5, 5, 15, 0, 10, "Orc" );
            spawner34.MoveToWorld( new Point3D( 2351, 1245, 10 ), Map.Trammel );
                        spawner34.Name = "CoveInvasionTrammel";
            spawner34.Respawn();

                        Spawner spawner35 = new Spawner( 1, 2, 2, 0, 2, "LordOrcalis" );
            spawner35.MoveToWorld( new Point3D( 2213, 1115, 40 ), Map.Trammel );
                        spawner35.Name = "CoveInvasionTrammel";
            spawner35.Respawn();

                        Spawner spawner36 = new Spawner( 2, 5, 15, 0, 5, "OrcBomber" );
            spawner36.MoveToWorld( new Point3D( 2270, 1127, 40 ), Map.Trammel );
                        spawner36.Name = "CoveInvasionTrammel";
            spawner36.Respawn();

                        Spawner spawner37 = new Spawner( 3, 5, 15, 0, 10, "OrcScout" );
            spawner37.MoveToWorld( new Point3D( 2270, 1127, 40 ), Map.Trammel );
                        spawner37.Name = "CoveInvasionTrammel";
            spawner37.Respawn();

                        Spawner spawner38 = new Spawner( 10, 20, 20, 0, 20, "OrcBomber" );
            spawner38.MoveToWorld( new Point3D( 2253, 1193, -2 ), Map.Trammel );
                        spawner38.Name = "CoveInvasionTrammel";
            spawner38.Respawn();

                        Spawner spawner39 = new Spawner( 10, 20, 20, 0, 20, "OrcBomber" );
            spawner39.MoveToWorld( new Point3D( 2225, 1141, 0 ), Map.Trammel );
                        spawner39.Name = "CoveInvasionTrammel";
            spawner39.Respawn();

                                           World.Broadcast( 33, true, "Cove Trammel is under invasion." );
                       from.SendGump( new CityInvasion( from ) );
                                   	 break;
                            }
            case 2:
            {
            CoveInvasionStone covetram = new CoveInvasionStone();
            covetram.StopCoveTrammel();
                                          World.Broadcast( 33, true, "Cove Trammel's invasion was successfully beaten back. No more invaders are left in the city." );
                      from.SendGump( new CityInvasion( from ) );
                                   	break;
                }
            }
        }
Exemplo n.º 15
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			m_CurrentAI = (AIType)reader.ReadInt();
			m_DefaultAI = (AIType)reader.ReadInt();

			m_iRangePerception = reader.ReadInt();
			m_iRangeFight = reader.ReadInt();

			m_iTeam = reader.ReadInt();

			m_dActiveSpeed = reader.ReadDouble();
			m_dPassiveSpeed = reader.ReadDouble();
			m_dCurrentSpeed = reader.ReadDouble();

			if ( m_iRangePerception == OldRangePerception )
				m_iRangePerception = DefaultRangePerception;

			m_Home.X = reader.ReadInt();
			m_Home.Y = reader.ReadInt();
			m_Home.Z = reader.ReadInt();
            

			if ( version >= 1 )
			{
				m_iRangeHome = reader.ReadInt();

				int i, iCount;

				iCount = reader.ReadInt();
				for ( i=0; i< iCount; i++ )
				{
					string str = reader.ReadString();
					Type type = Type.GetType( str );

					if ( type != null )
					{
						m_arSpellAttack.Add( type );
					}
				}

				iCount = reader.ReadInt();
				for ( i=0; i< iCount; i++ )
				{
					string str = reader.ReadString();
					Type type = Type.GetType( str );

					if ( type != null )
					{
						m_arSpellDefense.Add( type );
					}
				}
			}
			else
			{
				m_iRangeHome = 0;
			}

			if ( version >= 2 )
			{
				m_FightMode = ( FightMode )reader.ReadInt();

				m_bControlled = reader.ReadBool();
				m_ControlMaster = reader.ReadMobile();
				m_ControlTarget = reader.ReadMobile();
				m_ControlDest = reader.ReadPoint3D();
				m_ControlOrder = (OrderType) reader.ReadInt();

				m_dMinTameSkill = reader.ReadDouble();

				if ( version < 9 )
					reader.ReadDouble();

				m_bTamable = reader.ReadBool();
				m_bSummoned = reader.ReadBool();

				if ( m_bSummoned )
				{
					m_SummonEnd = reader.ReadDeltaTime();
					new UnsummonTimer( m_ControlMaster, this, m_SummonEnd - DateTime.UtcNow ).Start();
				}

				m_iControlSlots = reader.ReadInt();
			}
			else
			{
				m_FightMode = FightMode.Closest;

				m_bControlled = false;
				m_ControlMaster = null;
				m_ControlTarget = null;
				m_ControlOrder = OrderType.None;
			}

			if ( version >= 3 )
				m_Loyalty = reader.ReadInt();
			else
				m_Loyalty = MaxLoyalty; // Wonderfully Happy

			if ( version >= 4 )
				m_CurrentWayPoint = reader.ReadItem() as WayPoint;

			if ( version >= 5 )
				m_SummonMaster = reader.ReadMobile();

			if ( version >= 6 )
			{
				m_HitsMax = reader.ReadInt();
				m_StamMax = reader.ReadInt();
				m_ManaMax = reader.ReadInt();
				m_DamageMin = reader.ReadInt();
				m_DamageMax = reader.ReadInt();
			}

			if ( version >= 7 )
			{
				m_PhysicalResistance = reader.ReadInt();
				m_PhysicalDamage = reader.ReadInt();

				m_FireResistance = reader.ReadInt();
				m_FireDamage = reader.ReadInt();

				m_ColdResistance = reader.ReadInt();
				m_ColdDamage = reader.ReadInt();

				m_PoisonResistance = reader.ReadInt();
				m_PoisonDamage = reader.ReadInt();

				m_EnergyResistance = reader.ReadInt();
				m_EnergyDamage = reader.ReadInt();
			}

			if ( version >= 8 )
				m_Owners = reader.ReadStrongMobileList();
			else
				m_Owners = new List<Mobile>();


			if ( version >= 10 )
			{
				m_IsDeadPet = reader.ReadBool();
				m_IsBonded = reader.ReadBool();
				m_BondingBegin = reader.ReadDateTime();
				m_OwnerAbandonTime = reader.ReadDateTime();
			}

			if ( version >= 11 )
				m_HasGeneratedLoot = reader.ReadBool();
			else
				m_HasGeneratedLoot = true;

			if ( version >= 12 )
			{
				m_Paragon = reader.ReadBool();
				if ( m_Paragon )
					SolidHueOverride = Paragon.Hue;
			}
			else
				m_Paragon = false;

			if ( version >= 13 && reader.ReadBool() )
				m_Friends = reader.ReadStrongMobileList();
			else if ( version < 13 && m_ControlOrder >= OrderType.Unfriend )
				++m_ControlOrder;

			if ( version < 16 && Loyalty != MaxLoyalty )
				Loyalty *= 10;

			double activeSpeed = m_dActiveSpeed;
			double passiveSpeed = m_dPassiveSpeed;

			SpeedInfo.GetSpeeds( this, ref activeSpeed, ref passiveSpeed );

			bool isStandardActive = false;
			for ( int i = 0; !isStandardActive && i < m_StandardActiveSpeeds.Length; ++i )
				isStandardActive = ( m_dActiveSpeed == m_StandardActiveSpeeds[i] );

			bool isStandardPassive = false;
			for ( int i = 0; !isStandardPassive && i < m_StandardPassiveSpeeds.Length; ++i )
				isStandardPassive = ( m_dPassiveSpeed == m_StandardPassiveSpeeds[i] );

			if ( isStandardActive && m_dCurrentSpeed == m_dActiveSpeed )
				m_dCurrentSpeed = activeSpeed;
			else if ( isStandardPassive && m_dCurrentSpeed == m_dPassiveSpeed )
				m_dCurrentSpeed = passiveSpeed;

			if ( isStandardActive && !m_Paragon && !m_Corrupt)
				m_dActiveSpeed = activeSpeed;

            if (isStandardPassive && !m_Paragon && !m_Corrupt)
				m_dPassiveSpeed = passiveSpeed;

			if ( version >= 14 )
			{
				m_RemoveIfUntamed = reader.ReadBool();
				m_RemoveStep = reader.ReadInt();
			}

			TimeSpan deleteTime = TimeSpan.Zero;

			if ( version >= 17 )
				deleteTime = reader.ReadTimeSpan();

			if ( ( deleteTime > TimeSpan.Zero || LastOwner != null ) && !Controlled && !IsStabled )
			{
				if ( deleteTime == TimeSpan.Zero )
					deleteTime = TimeSpan.FromDays( 3.0 );

				m_DeleteTimer = new DeleteTimer( this, deleteTime );
				m_DeleteTimer.Start();
			}

			if ( version >= 18 )
				m_StabledDate = reader.ReadDeltaTime();
/*
			if( version <= 14 && m_Paragon && Hue == 0x31 )
			{
				Hue = Paragon.Hue; //Paragon hue fixed, should now be 0x501.
			}
*/
			if ( version >= 19 )
				m_HomeMap = reader.ReadMap();

			if ( version >= 20 )
				m_CorpseNameOverride = reader.ReadString();

            if (version == 21 || version == 22) // NO LONGER USED!
            {
                m_KillCriminals = reader.ReadBool();
                m_KillMurderers = reader.ReadBool();
                m_InnocentDefault = reader.ReadBool();
                m_Pseu_KeepKillCredit = reader.ReadBool();
                m_PoisonCustomChance = reader.ReadDouble();
                m_PoisonCustomImmune = Poison.GetPoison(reader.ReadInt());
                m_PoisonCustomHit = Poison.GetPoison(reader.ReadInt());
                m_CanBreathCustom = reader.ReadBool();
                m_BreathDamageCustom = reader.ReadInt();
                m_BreathCustomDelay = reader.ReadDouble();
                m_Pseu_SpellDelay = reader.ReadTimeSpan();
                m_BardImmuneCustom = reader.ReadBool();
                m_Pseu_EQPlayerAllowed = reader.ReadBool();
                m_Pseu_AllowFizzle = reader.ReadBool();
                m_Pseu_AllowInterrupts = reader.ReadBool();
                m_Pseu_CanBeHealed = reader.ReadBool();
                m_WeaponDamage = reader.ReadBool();
                m_TakesNormalDamage = reader.ReadBool();
                m_PowerWords = reader.ReadBool();
                m_ClearHandsOnCast = reader.ReadBool();
                m_Pseu_ConsumeReagents = reader.ReadBool();
                m_Pseu_SpellBookRequired = reader.ReadBool();
                m_Speaks = reader.ReadBool();
            }
            if (version == 22) // NO LONGER USED!
            {
                m_FreelyLootable = reader.ReadBool();
                m_AutoDispelCustom = reader.ReadBool();
                m_AutoDispelChanceCustom = reader.ReadDouble();
                m_AlwaysMurdererCustom = reader.ReadBool();
                m_IsScaryToPetsCustom = reader.ReadBool();
            }
            if (version >= 23)
            {
                ExtSaveFlag flags = (ExtSaveFlag)reader.ReadInt();

                if (GetExtSaveFlag(flags, ExtSaveFlag.KillCriminals))
                    m_KillCriminals = true;
                if (GetExtSaveFlag(flags, ExtSaveFlag.KillMurderers))
                    m_KillMurderers = true;
                if (GetExtSaveFlag(flags, ExtSaveFlag.InnocentDefault))
                    m_InnocentDefault = true;
                if (GetExtSaveFlag(flags, ExtSaveFlag.Pseu_KeepKillCredit))
                    m_Pseu_KeepKillCredit = true;
                if (GetExtSaveFlag(flags, ExtSaveFlag.CanBreathCustom))
                    m_CanBreathCustom = true;
                if (GetExtSaveFlag(flags, ExtSaveFlag.BardImmuneCustom))
                    m_BardImmuneCustom = true;
                if (GetExtSaveFlag(flags, ExtSaveFlag.Pseu_EQPlayerAllowed))
                    m_Pseu_EQPlayerAllowed = true;
                if (GetExtSaveFlag(flags, ExtSaveFlag.Pseu_AllowFizzle))
                    m_Pseu_AllowFizzle = false;
                if (GetExtSaveFlag(flags, ExtSaveFlag.Pseu_AllowInterrupts))
                    m_Pseu_AllowInterrupts = true;
                if (GetExtSaveFlag(flags, ExtSaveFlag.Pseu_CanBeHealed))
                    m_Pseu_CanBeHealed = false;
                if (GetExtSaveFlag(flags, ExtSaveFlag.Pseu_CanUseGates))
                    m_Pseu_CanUseGates = false;
                if (GetExtSaveFlag(flags, ExtSaveFlag.Pseu_CanUseRecall))
                    m_Pseu_CanUseRecall = false;
                if (GetExtSaveFlag(flags, ExtSaveFlag.Pseu_CanAttackInnocents))
                    m_Pseu_CanAttackInnocents = false;
                if (GetExtSaveFlag(flags, ExtSaveFlag.ReduceSpeedWithDamage))
                    m_ReduceSpeedWithDamageCustom = false;
                if (GetExtSaveFlag(flags, ExtSaveFlag.WeaponDamage))
                    m_WeaponDamage = true;
                if (GetExtSaveFlag(flags, ExtSaveFlag.TakesNormalDamage))
                    m_TakesNormalDamage = true;
                if (GetExtSaveFlag(flags, ExtSaveFlag.PowerWords))
                    m_PowerWords = true;
                if (GetExtSaveFlag(flags, ExtSaveFlag.ClearHandsOnCast))
                    m_ClearHandsOnCast = true;
                if (GetExtSaveFlag(flags, ExtSaveFlag.Pseu_ConsumeReagents))
                    m_Pseu_ConsumeReagents = true;
                if (GetExtSaveFlag(flags, ExtSaveFlag.Pseu_SpellBookRequired))
                    m_Pseu_SpellBookRequired = true;
                if (GetExtSaveFlag(flags, ExtSaveFlag.Speaks))
                     m_Speaks = false;
                if (GetExtSaveFlag(flags, ExtSaveFlag.FreelyLootable))
                    m_FreelyLootable = true;
                if (GetExtSaveFlag(flags, ExtSaveFlag.AutoDispelCustom))
                    m_AutoDispelCustom = true;
                if (GetExtSaveFlag(flags, ExtSaveFlag.AlwaysMurdererCustom))
                    m_AlwaysMurdererCustom = true;
                if (GetExtSaveFlag(flags, ExtSaveFlag.IsScaryToPetsCustom))
                    m_IsScaryToPetsCustom = true;

                m_PoisonCustomChance = reader.ReadDouble();
                m_PoisonCustomImmune = Poison.GetPoison(reader.ReadInt());
                m_PoisonCustomHit = Poison.GetPoison(reader.ReadInt());
                m_BreathDamageCustom = reader.ReadInt();
                m_BreathCustomDelay = reader.ReadDouble();
                m_Pseu_SpellDelay = reader.ReadTimeSpan();
                m_AutoDispelChanceCustom = reader.ReadDouble();

                if (version >= 24)
                {
                    if (GetExtSaveFlag(flags, ExtSaveFlag.Account))
                    {
                        string username = reader.ReadString();
                        AccountDeserializateInfos.Add(new AccountDeserializeInfo(this, username));
                    }
                }

                if (version >= 25)
                {
                    if (GetExtSaveFlag(flags, ExtSaveFlag.SkillGainMultiplier))
                        m_SkillGainMultiplier = reader.ReadDouble();
                }

                if (version >= 26)
                {
                    SpecialTitle = reader.ReadString();
                    TitleHue = reader.ReadInt();
                }

                if (version >= 27)
                {
                    Alignment = (Alignment)reader.ReadInt();
                }

                if (version >= 28)
                {
                    m_Corrupt = reader.ReadBool();
                    if (m_Corrupt)
                        SolidHueOverride = HalloweenCorruption.Hue;
                }
                else
                    m_Corrupt = false;
            }

			CheckStatTimers();

			ChangeAIType(m_CurrentAI);

			AddFollowers();
		}
Exemplo n.º 16
0
        public static void AddWaypoints()
        {
            var one = VoidPoolController.InstanceTram;
            var two = VoidPoolController.InstanceFel;

            if (one == null || two == null)
                return;

            foreach (var w in one.WaypointsA.Where(w => w != null && !w.Deleted)) w.Delete();
            foreach (var w in one.WaypointsB.Where(w => w != null && !w.Deleted)) w.Delete();

            foreach(var w in two.WaypointsA.Where(w => w != null && !w.Deleted)) w.Delete();
            foreach (var w in two.WaypointsB.Where(w => w != null && !w.Deleted)) w.Delete();

            // patha
            var wp = new WayPoint();
            wp.MoveToWorld(new Point3D(5590, 2024, 0), Map.Trammel);
            one.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5590, 2024, 0), Map.Felucca);
            two.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5578, 2029, 0), Map.Trammel);
            one.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5578, 2029, 0), Map.Felucca);
            two.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5566, 2027, 0), Map.Trammel);
            one.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5566, 2027, 0), Map.Felucca);
            two.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5555, 2021, 0), Map.Trammel);
            one.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5555, 2021, 0), Map.Felucca);
            two.WaypointsA.Add(wp);

            wp = new WayPoint();
            wp.MoveToWorld(new Point3D(5545, 2015, 0), Map.Trammel);
            one.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5545, 2015, 0), Map.Felucca);
            two.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5537, 2020, 0), Map.Trammel);
            one.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5537, 2020, 0), Map.Felucca);
            two.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5527, 2015, 0), Map.Trammel);
            one.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5527, 2015, 0), Map.Felucca);
            two.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5509, 2005, 0), Map.Trammel);
            one.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5509, 2005, 0), Map.Felucca);
            two.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5500, 1998, 0), Map.Trammel);
            one.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5500, 1998, 0), Map.Felucca);
            two.WaypointsA.Add(wp);

            // pathb
            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5469, 2016, 0), Map.Trammel);
            one.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5469, 2016, 0), Map.Felucca);
            two.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5478, 2025, 0), Map.Trammel);
            one.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5478, 2025, 0), Map.Felucca);
            two.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5484, 2029, 0), Map.Trammel);
            one.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5484, 2029, 0), Map.Felucca);
            two.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5490, 2027, 0), Map.Trammel);
            one.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5490, 2027, 0), Map.Felucca);
            two.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5504, 2027, 0), Map.Trammel);
            one.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5504, 2027, 0), Map.Felucca);
            two.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5516, 2020, 0), Map.Trammel);
            one.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5516, 2020, 0), Map.Felucca);
            two.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5524, 2012, 0), Map.Trammel);
            one.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5524, 2012, 0), Map.Felucca);
            two.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5513, 2005, 0), Map.Trammel);
            one.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5513, 2005, 0), Map.Felucca);
            two.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5502, 2004, 0), Map.Trammel);
            one.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5502, 2004, 0), Map.Felucca);
            two.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5500, 1998, 0), Map.Trammel);
            one.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5500, 1998, 0), Map.Felucca);
            two.WaypointsB.Add(wp);

            for (int i = 0; i < one.WaypointsA.Count; i++)
            {
                WayPoint waypoint = one.WaypointsA[i];

                if (i < one.WaypointsA.Count - 1)
                    waypoint.NextPoint = one.WaypointsA[i + 1];
            }

            for (int i = 0; i < one.WaypointsB.Count; i++)
            {
                WayPoint waypoint = one.WaypointsB[i];

                if (i < one.WaypointsB.Count - 1)
                    waypoint.NextPoint = one.WaypointsB[i + 1];
            }

            for (int i = 0; i < two.WaypointsA.Count; i++)
            {
                WayPoint waypoint = two.WaypointsA[i];

                if (i < two.WaypointsA.Count - 1)
                    waypoint.NextPoint = two.WaypointsA[i + 1];
            }

            for (int i = 0; i < two.WaypointsB.Count; i++)
            {
                WayPoint waypoint = two.WaypointsB[i];

                if (i < two.WaypointsB.Count - 1)
                    waypoint.NextPoint = two.WaypointsB[i + 1];
            }

            one.WaypointACount = one.WaypointsA.Count;
            one.WaypointBCount = one.WaypointsB.Count;

            two.WaypointACount = two.WaypointsA.Count;
            two.WaypointBCount = two.WaypointsB.Count;
        }
Exemplo n.º 17
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			m_CurrentAI = (AIType)reader.ReadInt();
			m_DefaultAI = (AIType)reader.ReadInt();

			m_iRangePerception = reader.ReadInt();
			m_iRangeFight = reader.ReadInt();

			m_iTeam = reader.ReadInt();

			m_dActiveSpeed = reader.ReadDouble();
			m_dPassiveSpeed = reader.ReadDouble();
			m_dCurrentSpeed = reader.ReadDouble();

			double activeSpeed = m_dActiveSpeed;
			double passiveSpeed = m_dPassiveSpeed;

			SpeedInfo.GetSpeeds( this, ref activeSpeed, ref passiveSpeed );

			bool isStandardActive = false;
			for ( int i = 0; !isStandardActive && i < m_StandardActiveSpeeds.Length; ++i )
				isStandardActive = ( m_dActiveSpeed == m_StandardActiveSpeeds[i] );

			bool isStandardPassive = false;
			for ( int i = 0; !isStandardPassive && i < m_StandardPassiveSpeeds.Length; ++i )
				isStandardPassive = ( m_dPassiveSpeed == m_StandardPassiveSpeeds[i] );

			if ( isStandardActive && m_dCurrentSpeed == m_dActiveSpeed )
				m_dCurrentSpeed = activeSpeed;
			else if ( isStandardPassive && m_dCurrentSpeed == m_dPassiveSpeed )
				m_dCurrentSpeed = passiveSpeed;

			if ( isStandardActive )
				m_dActiveSpeed = activeSpeed;

			if ( isStandardPassive )
				m_dPassiveSpeed = passiveSpeed;

			if ( m_iRangePerception == OldRangePerception )
				m_iRangePerception = DefaultRangePerception;

			m_pHome.X = reader.ReadInt();
			m_pHome.Y = reader.ReadInt();
			m_pHome.Z = reader.ReadInt();

			if ( version >= 1 )
			{
				m_iRangeHome = reader.ReadInt();
                m_arSpellAttack = ReadTypeArray(reader);
                m_arSpellDefense = ReadTypeArray(reader);
			}
			else
			{
				m_iRangeHome = 0;
			}

			if ( version >= 2 )
			{
				m_FightMode = ( FightMode )reader.ReadInt();

				m_bControlled = reader.ReadBool();
				m_ControlMaster = reader.ReadMobile();
				m_ControlTarget = reader.ReadMobile();
				m_ControlDest = reader.ReadPoint3D();
				m_ControlOrder = (OrderType) reader.ReadInt();

				m_dMinTameSkill = reader.ReadDouble();

				if ( version < 9 )
					reader.ReadDouble();

				m_bTamable = reader.ReadBool();
				m_bSummoned = reader.ReadBool();

				if ( m_bSummoned )
				{
					m_SummonEnd = reader.ReadDeltaTime();
					new UnsummonTimer( m_ControlMaster, this, m_SummonEnd - DateTime.Now ).Start();
				}

				m_iControlSlots = reader.ReadInt();
			}
			else
			{
				m_FightMode = FightMode.Closest;

				m_bControlled = false;
				m_ControlMaster = null;
				m_ControlTarget = null;
				m_ControlOrder = OrderType.None;
			}

			if ( version >= 3 )
				m_Loyalty = (PetLoyalty)reader.ReadInt();
			else
				m_Loyalty = PetLoyalty.WonderfullyHappy;

			if ( version >= 4 )
				m_CurrentWayPoint = reader.ReadItem() as WayPoint;

			if ( version >= 5 )
				m_SummonMaster = reader.ReadMobile();

			if ( version >= 6 )
			{
				m_HitsMax = reader.ReadInt();
				m_StamMax = reader.ReadInt();
				m_ManaMax = reader.ReadInt();
				m_DamageMin = reader.ReadInt();
				m_DamageMax = reader.ReadInt();
			}

			if ( version >= 7 )
			{
				m_PhysicalResistance = reader.ReadInt();
				m_PhysicalDamage = reader.ReadInt();

				m_FireResistance = reader.ReadInt();
				m_FireDamage = reader.ReadInt();

				m_ColdResistance = reader.ReadInt();
				m_ColdDamage = reader.ReadInt();

				m_PoisonResistance = reader.ReadInt();
				m_PoisonDamage = reader.ReadInt();

				m_EnergyResistance = reader.ReadInt();
				m_EnergyDamage = reader.ReadInt();
			}

			if (version >= 8)
			{
				m_Owners = reader.ReadMobileList();
				if (m_Owners.Count == 0) m_Owners = null;
			}

			if ( version >= 10 )
			{
				m_IsDeadPet = reader.ReadBool();
				m_IsBonded = reader.ReadBool();
				m_BondingBegin = reader.ReadDateTime();
				m_OwnerAbandonTime = reader.ReadDateTime();
			}

			if ( version >= 11 )
				m_HasGeneratedLoot = reader.ReadBool();
			else
				m_HasGeneratedLoot = true;

			if ( version >= 12 )
				m_Paragon = reader.ReadBool();
			else
				m_Paragon = false;

			if ( version >= 13 && reader.ReadBool() )
				m_Friends = reader.ReadMobileList();
			else if ( version < 13 && m_ControlOrder >= OrderType.Unfriend )
				++m_ControlOrder;

			if ( version >= 14 )
			{
				m_RemoveIfUntamed = reader.ReadBool();
				m_RemoveStep = reader.ReadInt();
			}

// *** Added for Valor ***
			if ( version >= 14 )
			{
				m_IsChampionMonster = reader.ReadBool();
				m_SpawnLevel = reader.ReadInt();
			}
// *** ***

			CheckStatTimers();

			ChangeAIType(m_CurrentAI);

			AddFollowers();

			if ( IsAnimatedDead )
				Spells.Necromancy.AnimateDeadSpell.Register( m_SummonMaster, this );
		}
Exemplo n.º 18
0
 public ScheduleEntry()
 {
     waypoint = null;
     activity = ScheduleAct.None;
 }
Exemplo n.º 19
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
                case 4:
                    {
                        m_WalkingRange = reader.ReadInt();

                        goto case 3;
                    }
                case 3:
                case 2:
                    {
                        m_WayPoint = reader.ReadItem() as WayPoint;

                        goto case 1;
                    }

                case 1:
                    {
                        m_Group = reader.ReadBool();

                        goto case 0;
                    }

                case 0:
                    {
                        m_MinDelay = reader.ReadTimeSpan();
                        m_MaxDelay = reader.ReadTimeSpan();
                        m_Count = reader.ReadInt();
                        m_Team = reader.ReadInt();
                        m_HomeRange = reader.ReadInt();
                        m_Running = reader.ReadBool();

                        TimeSpan ts = TimeSpan.Zero;

                        if (m_Running)
                            ts = reader.ReadDeltaTime() - DateTime.Now;

                        int size = reader.ReadInt();

                        m_SpawnNames = new List<string>(size);

                        for (int i = 0; i < size; ++i)
                        {
                            string creatureString = reader.ReadString();

                            m_SpawnNames.Add(creatureString);
                            string typeName = ParseType(creatureString);

                            if (ScriptCompiler.FindTypeByName(typeName) == null)
                            {
                                if (m_WarnTimer == null)
                                    m_WarnTimer = new WarnTimer();

                                m_WarnTimer.Add(Location, Map, typeName);
                            }
                        }

                        int count = reader.ReadInt();

                        m_Spawned = new List<ISpawnable>(count);

                        for (int i = 0; i < count; ++i)
                        {
                            ISpawnable e = World.FindEntity(reader.ReadInt()) as ISpawnable;

                            if (e != null)
                            {
                                e.Spawner = this;
                                m_Spawned.Add(e);
                            }
                        }

                        if (m_Running)
                            DoTimer(ts);

                        break;
                    }
            }

            if (version < 3 && Weight == 0)
                Weight = -1;
        }
Exemplo n.º 20
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 2:
                    {
                        m_WayPoint = reader.ReadItem() as WayPoint;

                        goto case 1;
                    }

                case 1:
                    {
                        m_Group = reader.ReadBool();

                        goto case 0;
                    }

                case 0:
                    {
                        m_MinDelay = reader.ReadTimeSpan();
                        m_MaxDelay = reader.ReadTimeSpan();
                        m_Count = reader.ReadInt();
                        m_Team = reader.ReadInt();
                        m_HomeRange = reader.ReadInt();
                        m_Running = reader.ReadBool();

                        TimeSpan ts = TimeSpan.Zero;

                        if ( m_Running )
                        {
                            ts = reader.ReadDeltaTime() - DateTime.Now;
                        }

                        int size = reader.ReadInt();

                        m_CreaturesName = new ArrayList( size );

                        for ( int i = 0; i < size; ++i )
                        {
                            string typeName = reader.ReadString();

                            m_CreaturesName.Add( typeName );

                            if ( SpawnerType.GetType( typeName ) == null )
                            {
                                if ( m_WarnTimer == null )
                                {
                                    m_WarnTimer = new WarnTimer();
                                }

                                m_WarnTimer.Add( Location, Map, typeName );
                            }
                        }

                        int count = reader.ReadInt();

                        m_Creatures = new ArrayList( count );

                        for ( int i = 0; i < count; ++i )
                        {
                            IEntity e = World.Instance.FindEntity( reader.ReadInt() );

                            if ( e != null )
                            {
                                m_Creatures.Add( e );
                            }
                        }

                        if ( m_Running )
                        {
                            DoTimer( ts );
                        }

                        break;
                    }
            }
        }
Exemplo n.º 21
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            if ( version >= 16 && version <= 18 )
                reader.ReadItem(); // spawner

            m_CurrentAI = (AIType) reader.ReadInt();
            m_DefaultAI = (AIType) reader.ReadInt();

            m_iRangePerception = reader.ReadInt();
            m_iRangeFight = reader.ReadInt();

            m_iTeam = reader.ReadInt();

            m_dActiveSpeed = reader.ReadDouble();
            m_dPassiveSpeed = reader.ReadDouble();
            m_dCurrentSpeed = reader.ReadDouble();

            double activeSpeed = m_dActiveSpeed;
            double passiveSpeed = m_dPassiveSpeed;

            SpeedInfo.GetSpeeds( this, ref activeSpeed, ref passiveSpeed );

            bool isStandardActive = false;
            for ( int i = 0; !isStandardActive && i < m_StandardActiveSpeeds.Length; ++i )
            {
                isStandardActive = ( m_dActiveSpeed == m_StandardActiveSpeeds[i] );
            }

            bool isStandardPassive = false;
            for ( int i = 0; !isStandardPassive && i < m_StandardPassiveSpeeds.Length; ++i )
            {
                isStandardPassive = ( m_dPassiveSpeed == m_StandardPassiveSpeeds[i] );
            }

            if ( isStandardActive && m_dCurrentSpeed == m_dActiveSpeed )
            {
                m_dCurrentSpeed = activeSpeed;
            }
            else if ( isStandardPassive && m_dCurrentSpeed == m_dPassiveSpeed )
            {
                m_dCurrentSpeed = passiveSpeed;
            }

            if ( isStandardActive )
            {
                m_dActiveSpeed = activeSpeed;
            }

            if ( isStandardPassive )
            {
                m_dPassiveSpeed = passiveSpeed;
            }

            if ( m_iRangePerception == OldRangePerception )
            {
                m_iRangePerception = DefaultRangePerception;
            }

            m_pHome.X = reader.ReadInt();
            m_pHome.Y = reader.ReadInt();
            m_pHome.Z = reader.ReadInt();

            if ( version >= 1 )
            {
                m_iRangeHome = reader.ReadInt();

                if ( version < 25 )
                {
                    int i, iCount;

                    iCount = reader.ReadInt();
                    for ( i = 0; i < iCount; i++ )
                        reader.ReadString();

                    iCount = reader.ReadInt();
                    for ( i = 0; i < iCount; i++ )
                        reader.ReadString();
                }
            }
            else
            {
                m_iRangeHome = 0;
            }

            if ( version >= 2 )
            {
                m_FightMode = (FightMode) reader.ReadInt();

                m_bControlled = reader.ReadBool();
                m_ControlMaster = reader.ReadMobile();
                m_ControlTarget = reader.ReadMobile();
                m_ControlDest = reader.ReadPoint3D();
                m_ControlOrder = (OrderType) reader.ReadInt();

                m_dMinTameSkill = reader.ReadDouble();

                if ( version < 9 )
                    reader.ReadDouble();

                m_bTamable = reader.ReadBool();
                m_bSummoned = reader.ReadBool();

                if ( m_bSummoned )
                {
                    m_SummonEnd = reader.ReadDeltaTime();
                    new UnsummonTimer( m_ControlMaster, this, m_SummonEnd - DateTime.Now ).Start();
                }

                m_iControlSlots = reader.ReadInt();
            }
            else
            {
                m_FightMode = FightMode.Closest;

                m_bControlled = false;
                m_ControlMaster = null;
                m_ControlTarget = null;
                m_ControlOrder = OrderType.None;
            }

            if ( version >= 3 )
                m_Loyalty = (PetLoyalty) reader.ReadInt();
            else
                m_Loyalty = PetLoyalty.WonderfullyHappy;

            if ( version >= 4 )
                m_CurrentWayPoint = reader.ReadItem() as WayPoint;

            if ( version >= 5 )
                m_SummonMaster = reader.ReadMobile();

            if ( version >= 6 )
            {
                m_HitsMax = reader.ReadInt();
                m_StamMax = reader.ReadInt();
                m_ManaMax = reader.ReadInt();
                m_DamageMin = reader.ReadInt();
                m_DamageMax = reader.ReadInt();
            }

            if ( version >= 7 )
            {
                m_PhysicalResistance = reader.ReadInt();
                m_PhysicalDamage = reader.ReadInt();

                m_FireResistance = reader.ReadInt();
                m_FireDamage = reader.ReadInt();

                m_ColdResistance = reader.ReadInt();
                m_ColdDamage = reader.ReadInt();

                m_PoisonResistance = reader.ReadInt();
                m_PoisonDamage = reader.ReadInt();

                m_EnergyResistance = reader.ReadInt();
                m_EnergyDamage = reader.ReadInt();
            }

            if ( version >= 8 )
                m_Owners = reader.ReadStrongMobileList();
            else
                m_Owners = new List<Mobile>();

            if ( version >= 10 )
            {
                m_IsDeadPet = reader.ReadBool();
                m_IsBonded = reader.ReadBool();
                m_BondingBegin = reader.ReadDateTime();
                m_OwnerAbandonTime = reader.ReadDateTime();
            }

            if ( version >= 11 )
                m_HasGeneratedLoot = reader.ReadBool();
            else
                m_HasGeneratedLoot = true;

            if ( version >= 12 )
            {
                m_Paragon = reader.ReadBool();
                m_IsChampionMonster = reader.ReadBool();
            }
            else
            {
                m_Paragon = false;
                m_IsChampionMonster = false;
            }

            if ( version >= 13 && reader.ReadBool() )
                m_Friends = reader.ReadStrongMobileList();
            else if ( version < 13 && m_ControlOrder >= OrderType.Unfriend )
                ++m_ControlOrder;

            if ( version >= 14 )
                m_SpawnLevel = reader.ReadInt();
            else
                m_SpawnLevel = 0;

            if ( version >= 15 )
                m_ChampionType = (ChampionSpawnType) reader.ReadInt();

            if ( version >= 17 )
                m_StolenFrom = reader.ReadBool();

            if ( version >= 18 )
            {
                int count = reader.ReadInt();

                for ( int i = 0; i < count; i++ )
                {
                    Item rummaged = reader.ReadItem();
                    Mobile owner = reader.ReadMobile();

                    if ( rummaged != null && owner != null )
                        m_RummagedItems.Add( rummaged, owner );
                }
            }

            if ( version >= 20 )
            {
                m_IsMinichampMonster = reader.ReadBool();
                m_MinichampType = (MiniChampType) reader.ReadInt();
            }

            if ( version >= 21 )
            {
                m_NextTastyTreat = reader.ReadDateTime();
            }

            if ( version >= 22 )
            {
                m_Petrified = reader.ReadBool();

                if ( m_Petrified )
                {
                    m_StatueAnimation = reader.ReadInt();
                    m_StatueFrames = reader.ReadInt();

                    Frozen = true;
                    HueMod = 2401;
                }
            }

            if ( version >= 23 )
            {
                m_NextArmorEssence = reader.ReadDateTime();
            }

            if ( version >= 24 )
            {
                m_IsGolem = reader.ReadBool();
            }
            else
            {
                m_IsGolem = this is Golem;
            }

            CheckStatTimers();

            ChangeAIType( m_CurrentAI );

            AddFollowers();

            if ( IsAnimatedDead )
                Spells.Necromancy.AnimateDeadSpell.Register( m_SummonMaster, this );

            if ( Controlled )
                Skills.Cap = 15000;
        }
Exemplo n.º 22
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            m_Creatures = new Dictionary<IEntity, SpawnerEntry>();

            if ( version < 7 )
                m_Entries = new List<SpawnerEntry>();

            switch ( version )
            {
                case 7:
                {
                    int size = reader.ReadInt();

                    m_Entries = new List<SpawnerEntry>( size );

                    for ( int i = 0; i < size; ++i )
                        m_Entries.Add( new SpawnerEntry( this, reader ) );

                    goto case 4; //Skip the other crap
                }
                case 6:
                {
                    int size = reader.ReadInt();

                    bool addentries = m_Entries.Count == 0;

                    for ( int i = 0; i < size; ++i )
                        if ( addentries )
                            m_Entries.Add( new SpawnerEntry( String.Empty, 100, reader.ReadInt() ) );
                        else
                            m_Entries[i].CreaturesMaxCount = reader.ReadInt();

                    goto case 5;
                }
                case 5:
                {
                    int size = reader.ReadInt();

                    bool addentries = m_Entries.Count == 0;

                    for ( int i = 0; i < size; ++i )
                        if ( addentries )
                            m_Entries.Add( new SpawnerEntry( String.Empty, reader.ReadInt(), 1 ) );
                        else
                            m_Entries[i].CreaturesProbability = reader.ReadInt();

                    goto case 4;
                }
                case 4:
                {
                    m_WalkingRange = reader.ReadInt();

                    goto case 3;
                }
                case 3:
                case 2:
                {
                    m_WayPoint = reader.ReadItem() as WayPoint;

                    goto case 1;
                }

                case 1:
                {
                    m_Group = reader.ReadBool();

                    goto case 0;
                }

                case 0:
                {
                    m_MinDelay = reader.ReadTimeSpan();
                    m_MaxDelay = reader.ReadTimeSpan();
                    m_Count = reader.ReadInt();
                    m_Team = reader.ReadInt();
                    m_HomeRange = reader.ReadInt();
                    m_Running = reader.ReadBool();

                    TimeSpan ts = TimeSpan.Zero;

                    if ( m_Running )
                        ts = reader.ReadDeltaTime() - DateTime.Now;

                    if ( version < 7 )
                    {
                        int size = reader.ReadInt();

                        bool addentries = m_Entries.Count == 0;

                        for ( int i = 0; i < size; ++i )
                        {
                            string typeName = reader.ReadString();

                            if ( addentries )
                                m_Entries.Add( new SpawnerEntry( typeName, 100, 1 ) );
                            else
                                m_Entries[i].CreaturesName = typeName;

                            if ( SpawnerType.GetType( typeName ) == null )
                            {
                                if ( m_WarnTimer == null )
                                    m_WarnTimer = new WarnTimer();

                                m_WarnTimer.Add( Location, Map, typeName );
                            }
                        }

                        int count = reader.ReadInt();

                        for ( int i = 0; i < count; ++i )
                        {
                            IEntity e = reader.ReadEntity();

                            if ( e != null )
                            {
                                if ( e is BaseCreature )
                                    ((BaseCreature)e).RemoveIfUntamed = true;

                                if ( e is Item )
                                    ((Item)e).Spawner = this;
                                else if ( e is Mobile )
                                    ((Mobile)e).Spawner = this;

                                for ( int j = 0;j < m_Entries.Count; j++ )
                                {
                                    if ( SpawnerType.GetType( m_Entries[j].CreaturesName ) == e.GetType() )
                                    {
                                        m_Entries[j].Creatures.Add( e );
                                        m_Creatures.Add( e, m_Entries[j] );
                                        break;
                                    }
                                }
                            }
                        }
                    }

                    DoTimer( ts );

                    break;
                }
            }

            if ( version < 4 )
                m_WalkingRange = m_HomeRange;
        }
Exemplo n.º 23
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            m_CurrentAI = (AIType)reader.ReadInt();
            m_DefaultAI = (AIType)reader.ReadInt();

            m_iRangePerception = reader.ReadInt();
            m_iRangeFight = reader.ReadInt();

            m_iTeam = reader.ReadInt();

            m_dActiveSpeed = reader.ReadDouble();
            m_dPassiveSpeed = reader.ReadDouble();
            m_dCurrentSpeed = reader.ReadDouble();

            double activeSpeed = m_dActiveSpeed;
            double passiveSpeed = m_dPassiveSpeed;

            SpeedInfo.GetSpeeds( this, ref activeSpeed, ref passiveSpeed );

            bool isStandardActive = false;
            for ( int i = 0; !isStandardActive && i < m_StandardActiveSpeeds.Length; ++i )
                isStandardActive = ( m_dActiveSpeed == m_StandardActiveSpeeds[i] );

            bool isStandardPassive = false;
            for ( int i = 0; !isStandardPassive && i < m_StandardPassiveSpeeds.Length; ++i )
                isStandardPassive = ( m_dPassiveSpeed == m_StandardPassiveSpeeds[i] );

            if ( isStandardActive && m_dCurrentSpeed == m_dActiveSpeed )
                m_dCurrentSpeed = activeSpeed;
            else if ( isStandardPassive && m_dCurrentSpeed == m_dPassiveSpeed )
                m_dCurrentSpeed = passiveSpeed;

            if ( isStandardActive )
                m_dActiveSpeed = activeSpeed;

            if ( isStandardPassive )
                m_dPassiveSpeed = passiveSpeed;

            if ( m_iRangePerception == OldRangePerception )
                m_iRangePerception = DefaultRangePerception;

            m_pHome.X = reader.ReadInt();
            m_pHome.Y = reader.ReadInt();
            m_pHome.Z = reader.ReadInt();

            if ( version >= 1 )
            {
                m_iRangeHome = reader.ReadInt();

                int i, iCount;

                iCount = reader.ReadInt();
                for ( i=0; i< iCount; i++ )
                {
                    string str = reader.ReadString();
                    Type type = Type.GetType( str );

                    if ( type != null )
                    {
                        m_arSpellAttack.Add( type );
                    }
                }

                iCount = reader.ReadInt();
                for ( i=0; i< iCount; i++ )
                {
                    string str = reader.ReadString();
                    Type type = Type.GetType( str );

                    if ( type != null )
                    {
                        m_arSpellDefense.Add( type );
                    }
                }
            }
            else
            {
                m_iRangeHome = 0;
            }

            if ( version >= 2 )
            {
                m_FightMode = ( FightMode )reader.ReadInt();

                m_bControled = reader.ReadBool();
                m_ControlMaster = reader.ReadMobile();
                m_ControlTarget = reader.ReadMobile();
                m_ControlDest = reader.ReadPoint3D();
                m_ControlOrder = (OrderType) reader.ReadInt();

                m_dMinTameSkill = reader.ReadDouble();

                if ( version < 9 )
                    reader.ReadDouble();

                m_bTamable = reader.ReadBool();
                m_bSummoned = reader.ReadBool();

                if ( m_bSummoned )
                {
                    m_SummonEnd = reader.ReadDeltaTime();
                    new UnsummonTimer( m_ControlMaster, this, m_SummonEnd - DateTime.Now ).Start();
                }

                m_iControlSlots = reader.ReadInt();
            }
            else
            {
                m_FightMode = FightMode.Closest;

                m_bControled = false;
                m_ControlMaster = null;
                m_ControlTarget = null;
                m_ControlOrder = OrderType.None;
            }

            if ( version >= 3 )
                m_Loyalty = (PetLoyalty)reader.ReadInt();
            else
                m_Loyalty = PetLoyalty.WonderfullyHappy;

            if ( version >= 4 )
                m_CurrentWayPoint = reader.ReadItem() as WayPoint;

            if ( version >= 5 )
                m_SummonMaster = reader.ReadMobile();

            if ( version >= 6 )
            {
                m_HitsMax = reader.ReadInt();
                m_StamMax = reader.ReadInt();
                m_ManaMax = reader.ReadInt();
                m_DamageMin = reader.ReadInt();
                m_DamageMax = reader.ReadInt();
            }

            if ( version >= 7 )
            {
                m_PhysicalResistance = reader.ReadInt();
                m_PhysicalDamage = reader.ReadInt();

                m_FireResistance = reader.ReadInt();
                m_FireDamage = reader.ReadInt();

                m_ColdResistance = reader.ReadInt();
                m_ColdDamage = reader.ReadInt();

                m_PoisonResistance = reader.ReadInt();
                m_PoisonDamage = reader.ReadInt();

                m_EnergyResistance = reader.ReadInt();
                m_EnergyDamage = reader.ReadInt();
            }

            if ( version >= 8 )
                m_Owners = reader.ReadMobileList();
            else
                m_Owners = new ArrayList();

            if ( version >= 10 )
            {
                m_IsDeadPet = reader.ReadBool();
                m_IsBonded = reader.ReadBool();
                m_BondingBegin = reader.ReadDateTime();
                m_OwnerAbandonTime = reader.ReadDateTime();
            }

            if ( version >= 11 )
                m_HasGeneratedLoot = reader.ReadBool();
            else
                m_HasGeneratedLoot = true;

                // temporary mod for conversion
                //reader.ReadTimeSpan();
                //m_Paragon = reader.ReadBool();

            if ( version >= 12 )
                m_Paragon = reader.ReadBool();
            else
                m_Paragon = false;

            if ( version >= 13 && reader.ReadBool() )
                m_Friends = reader.ReadMobileList();
            else if ( version < 13 && m_ControlOrder >= OrderType.Unfriend )
                ++m_ControlOrder;

            CheckStatTimers();

            ChangeAIType(m_CurrentAI);

            // ARTEGORDONMOD
            // PlayerRangeSensitiveMod
            if ( version >= 14 )
            {
                TimeSpan restartDeactivationdelay = reader.ReadTimeSpan();
                if(m_AI != null) {
                    m_AI.m_RestartDeactivationdelay = restartDeactivationdelay;
                }
            }

            if ( m_IsBonded == true )
                m_IsBonded = false;

            AddFollowers();

            if ( IsAnimatedDead )
                Spells.Necromancy.AnimateDeadSpell.Register( m_SummonMaster, this );
        }
Exemplo n.º 24
0
		public static void Initialize()
		{
			XmlSpawner.LoadSettings( new XmlSpawner.AssignSettingsHandler( AssignSettings ), "XmlSpawner" );

			// initialize the default waypoint name
			WayPoint tmpwaypoint = new WayPoint();
			if( tmpwaypoint != null )
			{
				defwaypointname = tmpwaypoint.Name;
				tmpwaypoint.Delete();
			}
			// 2004.02.08 :: Omega Red
			// initialize m_Region fields after world load (now, regions are loaded)
			// Now this gets handled in OnTick

			int count = 0;
			int regional = 0;
			//int timercount=0;

			foreach( Item item in World.Items.Values )
			{
				if( item is XmlSpawner )
				{
					count++;
					XmlSpawner spawner = ((XmlSpawner)item);

					if( spawner.RegionName != null && spawner.RegionName != string.Empty )
					{
						spawner.RegionName = spawner.RegionName;	// invoke set(RegionName)
						regional++;
					}

					// check for smart spawning and restart timers after deser if needed
					// note, HasActiveSectors will recalculate the sector list and UseSectorActivate property
					bool recalc_sectors = spawner.HasActiveSectors;
					/*
										if(spawner.SmartSpawning && spawner.IsInactivated && !spawner.UseSectorActivate)
										{
											spawner.DoSectorTimer(TimeSpan.FromSeconds(1));
											timercount++;
										}
					*/
					// add in the totalitem mod to keep them from adding to container counts
					//spawner.TotalItems = -1;
					//spawner.UpdateTotal(spawner, TotalType.Items, -1);

					spawner.RestoreISpawner();
				}
			}

			// start the global smartspawning timer
			if( SmartSpawningSystemEnabled )
			{
				DoGlobalSectorTimer( TimeSpan.FromSeconds( 1 ) );
			}

			// standard commands
			CommandSystem.Register( "XmlSpawnerShowAll", AccessLevel.Administrator, new CommandEventHandler( ShowSpawnPoints_OnCommand ) );
			CommandSystem.Register( "XmlSpawnerHideAll", AccessLevel.Administrator, new CommandEventHandler( HideSpawnPoints_OnCommand ) );
			CommandSystem.Register( "XmlSpawnerWipe", AccessLevel.Administrator, new CommandEventHandler( Wipe_OnCommand ) );
			CommandSystem.Register( "XmlSpawnerWipeAll", AccessLevel.Administrator, new CommandEventHandler( WipeAll_OnCommand ) );
			CommandSystem.Register( "XmlSpawnerLoad", DiskAccessLevel, new CommandEventHandler( Load_OnCommand ) );
			CommandSystem.Register( "XmlSpawnerSave", DiskAccessLevel, new CommandEventHandler( Save_OnCommand ) );
			CommandSystem.Register( "XmlSpawnerSaveAll", DiskAccessLevel, new CommandEventHandler( SaveAll_OnCommand ) );
			//added respawn commands
			CommandSystem.Register( "XmlSpawnerRespawn", AccessLevel.Administrator, new CommandEventHandler( Respawn_OnCommand ) );
			CommandSystem.Register( "XmlSpawnerRespawnAll", AccessLevel.Administrator, new CommandEventHandler( RespawnAll_OnCommand ) );

			// ok, I'm lazy. I dont like all that typing, so these are two aliases for the longer commands
			CommandSystem.Register( "XmlShow", AccessLevel.Administrator, new CommandEventHandler( ShowSpawnPoints_OnCommand ) );
			CommandSystem.Register( "XmlHide", AccessLevel.Administrator, new CommandEventHandler( HideSpawnPoints_OnCommand ) );

			CommandSystem.Register( "XmlHome", AccessLevel.GameMaster, new CommandEventHandler( XmlHome_OnCommand ) );
			CommandSystem.Register( "XmlUnLoad", DiskAccessLevel, new CommandEventHandler( UnLoad_OnCommand ) );
			CommandSystem.Register( "XmlSpawnerUnLoad", DiskAccessLevel, new CommandEventHandler( UnLoad_OnCommand ) );
			CommandSystem.Register( "XmlLoad", DiskAccessLevel, new CommandEventHandler( Load_OnCommand ) );
			//CommandSystem.Register( "XmlLoadHere", DiskAccessLevel, new CommandEventHandler( LoadHere_OnCommand ) );
			//CommandSystem.Register( "XmlNewLoad", DiskAccessLevel, new CommandEventHandler( NewLoad_OnCommand ) );
			//CommandSystem.Register( "XmlNewLoadHere", DiskAccessLevel, new CommandEventHandler( NewLoadHere_OnCommand ) );
			CommandSystem.Register( "XmlSave", DiskAccessLevel, new CommandEventHandler( Save_OnCommand ) );
			CommandSystem.Register( "XmlSaveAll", DiskAccessLevel, new CommandEventHandler( SaveAll_OnCommand ) );
			//CommandSystem.Register( "XmlSaveOld", DiskAccessLevel, new CommandEventHandler( SaveOld_OnCommand ) );
			//CommandSystem.Register( "XmlImportSpawners", DiskAccessLevel, new CommandEventHandler( XmlImportSpawners_OnCommand ) );
			//CommandSystem.Register( "XmlImportMSF", DiskAccessLevel, new CommandEventHandler( XmlImportMSF_OnCommand ) );
			//CommandSystem.Register( "XmlImportMap", DiskAccessLevel, new CommandEventHandler( XmlImportMap_OnCommand ) );
			//CommandSystem.Register( "XmlDefaults", AccessLevel.Administrator, new CommandEventHandler( XmlDefaults_OnCommand ) );
			//CommandSystem.Register( "XmlGet", AccessLevel.GameMaster, new CommandEventHandler( XmlGetValue_OnCommand ) );
			//TargetCommands.Register( new XmlSetCommand() );
			//CommandSystem.Register( "XmlSet", AccessLevel.GameMaster, new CommandEventHandler( XmlSetValue_OnCommand ) );
			//CommandSystem.Register( "OptimalSmartSpawning", AccessLevel.Administrator, new CommandEventHandler( OptimalSmartSpawning_OnCommand ) );
			//CommandSystem.Register( "SmartStat", AccessLevel.GameMaster, new CommandEventHandler( SmartStat_OnCommand ) );
			//CommandSystem.Register( "XmlGo", AccessLevel.GameMaster, new CommandEventHandler( SpawnEditorGo_OnCommand ) );
			//CommandSystem.Register( "TagList", AccessLevel.Administrator, new CommandEventHandler( ShowTagList_OnCommand ) );

#if(TRACE)
			CommandSystem.Register( "XmlMake", AccessLevel.Administrator, new CommandEventHandler( XmlMake_OnCommand ) );
			CommandSystem.Register( "XmlTrace", AccessLevel.Administrator, new CommandEventHandler( XmlTrace_OnCommand ) );
			CommandSystem.Register( "XmlResetTrace", AccessLevel.Administrator, new CommandEventHandler( XmlResetTrace_OnCommand ) );
#endif

		}
Exemplo n.º 25
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
                case 4:
                    {
                        m_WalkingRange = reader.ReadInt();
                        m_SpawnID = reader.ReadInt();
                        m_CountA = reader.ReadInt();
                        m_CountB = reader.ReadInt();
                        m_CountC = reader.ReadInt();
                        m_CountD = reader.ReadInt();
                        m_CountE = reader.ReadInt();

                        goto case 3;
                    }
                case 3:
                case 2:
                    {
                        m_WayPoint = reader.ReadItem() as WayPoint;

                        goto case 1;
                    }

                case 1:
                    {
                        m_Group = reader.ReadBool();

                        goto case 0;
                    }

                case 0:
                    {
                        m_MinDelay = reader.ReadTimeSpan();
                        m_MaxDelay = reader.ReadTimeSpan();
                        m_Count = reader.ReadInt();
                        m_Team = reader.ReadInt();
                        m_HomeRange = reader.ReadInt();
                        m_Running = reader.ReadBool();

                        TimeSpan ts = TimeSpan.Zero;

                        if (m_Running)
                            ts = reader.ReadDeltaTime() - DateTime.Now;

                        int size = reader.ReadInt();
                        m_CreaturesName = new List<string>(size);
                        for (int i = 0; i < size; ++i)
                        {
                            string creatureString = reader.ReadString();

                            m_CreaturesName.Add(creatureString);
                            string typeName = ParseType(creatureString);

                            if (ScriptCompiler.FindTypeByName(typeName) == null)
                            {
                                if (m_WarnTimer == null)
                                    m_WarnTimer = new WarnTimer();

                                m_WarnTimer.Add(Location, Map, typeName);
                            }
                        }

                        int sizeA = reader.ReadInt();
                        m_CreaturesNameA = new List<string>(sizeA);
                        for (int i = 0; i < sizeA; ++i)
                        {
                            string creatureString = reader.ReadString();

                            m_CreaturesNameA.Add(creatureString);
                            string typeName = ParseType(creatureString);

                            if (ScriptCompiler.FindTypeByName(typeName) == null)
                            {
                                if (m_WarnTimer == null)
                                    m_WarnTimer = new WarnTimer();

                                m_WarnTimer.Add(Location, Map, typeName);
                            }
                        }

                        int sizeB = reader.ReadInt();
                        m_CreaturesNameB = new List<string>(sizeB);
                        for (int i = 0; i < sizeB; ++i)
                        {
                            string creatureString = reader.ReadString();

                            m_CreaturesNameB.Add(creatureString);
                            string typeName = ParseType(creatureString);

                            if (ScriptCompiler.FindTypeByName(typeName) == null)
                            {
                                if (m_WarnTimer == null)
                                    m_WarnTimer = new WarnTimer();

                                m_WarnTimer.Add(Location, Map, typeName);
                            }
                        }

                        int sizeC = reader.ReadInt();
                        m_CreaturesNameC = new List<string>(sizeC);
                        for (int i = 0; i < sizeC; ++i)
                        {
                            string creatureString = reader.ReadString();

                            m_CreaturesNameC.Add(creatureString);
                            string typeName = ParseType(creatureString);

                            if (ScriptCompiler.FindTypeByName(typeName) == null)
                            {
                                if (m_WarnTimer == null)
                                    m_WarnTimer = new WarnTimer();

                                m_WarnTimer.Add(Location, Map, typeName);
                            }
                        }

                        int sizeD = reader.ReadInt();
                        m_CreaturesNameD = new List<string>(sizeD);
                        for (int i = 0; i < sizeD; ++i)
                        {
                            string creatureString = reader.ReadString();

                            m_CreaturesNameD.Add(creatureString);
                            string typeName = ParseType(creatureString);

                            if (ScriptCompiler.FindTypeByName(typeName) == null)
                            {
                                if (m_WarnTimer == null)
                                    m_WarnTimer = new WarnTimer();

                                m_WarnTimer.Add(Location, Map, typeName);
                            }
                        }

                        int sizeE = reader.ReadInt();
                        m_CreaturesNameE = new List<string>(sizeE);
                        for (int i = 0; i < sizeE; ++i)
                        {
                            string creatureString = reader.ReadString();

                            m_CreaturesNameE.Add(creatureString);
                            string typeName = ParseType(creatureString);

                            if (ScriptCompiler.FindTypeByName(typeName) == null)
                            {
                                if (m_WarnTimer == null)
                                    m_WarnTimer = new WarnTimer();

                                m_WarnTimer.Add(Location, Map, typeName);
                            }
                        }

                        int count = reader.ReadInt();
                        m_Creatures = new List<IEntity>(count);
                        for (int i = 0; i < count; ++i)
                        {
                            IEntity e = World.FindEntity(reader.ReadInt());

                            if (e != null)
                                m_Creatures.Add(e);
                        }

                        int countA = reader.ReadInt();
                        m_CreaturesA = new List<IEntity>(countA);
                        for (int i = 0; i < countA; ++i)
                        {
                            IEntity e = World.FindEntity(reader.ReadInt());

                            if (e != null)
                                m_CreaturesA.Add(e);
                        }

                        int countB = reader.ReadInt();
                        m_CreaturesB = new List<IEntity>(countB);
                        for (int i = 0; i < countB; ++i)
                        {
                            IEntity e = World.FindEntity(reader.ReadInt());

                            if (e != null)
                                m_CreaturesB.Add(e);
                        }

                        int countC = reader.ReadInt();
                        m_CreaturesC = new List<IEntity>(countC);
                        for (int i = 0; i < countC; ++i)
                        {
                            IEntity e = World.FindEntity(reader.ReadInt());

                            if (e != null)
                                m_CreaturesC.Add(e);
                        }

                        int countD = reader.ReadInt();
                        m_CreaturesD = new List<IEntity>(countD);
                        for (int i = 0; i < countD; ++i)
                        {
                            IEntity e = World.FindEntity(reader.ReadInt());

                            if (e != null)
                                m_CreaturesD.Add(e);
                        }

                        int countE = reader.ReadInt();
                        m_CreaturesE = new List<IEntity>(countE);
                        for (int i = 0; i < countE; ++i)
                        {
                            IEntity e = World.FindEntity(reader.ReadInt());

                            if (e != null)
                                m_CreaturesE.Add(e);
                        }

                        if (m_Running)
                            DoTimer(ts);

                        break;
                    }
            }

            if (version < 3 && Weight == 0)
                Weight = -1;
        }
Exemplo n.º 26
0
		public void InitSpawn( int x, int y, int width, int height, string name, int maxCount, TimeSpan minDelay, TimeSpan maxDelay, TimeSpan duration,
			int proximityRange, int proximityTriggerSound, int amount, int team, int homeRange, bool isRelativeHomeRange, SpawnObject[] objectsToSpawn,
			TimeSpan minRefractory, TimeSpan maxRefractory, TimeSpan todstart, TimeSpan todend, Item objectPropertyItem, string objectPropertyName, string proximityMessage,
			string itemTriggerName, string noitemTriggerName, string speechTrigger, string mobTriggerName, string mobPropertyName, string playerPropertyName, double triggerProbability,
			Item setPropertyItem, bool isGroup, TODModeType todMode, int killReset, bool externalTriggering, int sequentialSpawning, string regionName, bool allowghost, bool allownpc, bool spawnontrigger,
			string configfile, TimeSpan despawnTime, string skillTrigger, bool smartSpawning, WayPoint wayPoint )
		{

			Visible = false;
			Movable = false;
			m_X = x;
			m_Y = y;
			m_Width = width;
			m_Height = height;

			// init spawn range if compatible
			if( width == height )
				m_SpawnRange = width / 2;
			else
				m_SpawnRange = -1;
			m_Running = true;
			m_Group = isGroup;

			if( (name != null) && (name.Length > 0) )
				Name = name;
			else
				Name = "Spawner";

			m_MinDelay = minDelay;
			m_MaxDelay = maxDelay;

			// duration and proximity range parameter
			m_MinRefractory = minRefractory;
			m_MaxRefractory = maxRefractory;
			m_TODStart = todstart;
			m_TODEnd = todend;
			m_TODMode = todMode;
			m_KillReset = killReset;
			m_Duration = duration;
			m_DespawnTime = despawnTime;
			m_ProximityRange = proximityRange;
			m_ProximityTriggerSound = proximityTriggerSound;
			m_proximityActivated = false;
			m_durActivated = false;
			m_refractActivated = false;
			m_Count = maxCount;
			m_Team = team;
			m_StackAmount = amount;
			m_HomeRange = homeRange;
			m_HomeRangeIsRelative = isRelativeHomeRange;
			m_ObjectPropertyItem = objectPropertyItem;
			m_ObjectPropertyName = objectPropertyName;
			m_ProximityTriggerMessage = proximityMessage;
			m_ItemTriggerName = itemTriggerName;
			m_NoItemTriggerName = noitemTriggerName;
			m_SpeechTrigger = speechTrigger;
			SkillTrigger = skillTrigger;        // note this will register the skill as well
			m_MobTriggerName = mobTriggerName;
			m_MobPropertyName = mobPropertyName;
			m_PlayerPropertyName = playerPropertyName;
			m_TriggerProbability = triggerProbability;
			m_SetPropertyItem = setPropertyItem;
			m_ExternalTriggering = externalTriggering;
			m_ExternalTrigger = false;
			m_SequentialSpawning = sequentialSpawning;
			RegionName = regionName;
			m_AllowGhostTriggering = allowghost;
			m_AllowNPCTriggering = allownpc;
			m_SpawnOnTrigger = spawnontrigger;
			m_SmartSpawning = smartSpawning;
			ConfigFile = configfile;
			m_WayPoint = wayPoint;

			// set the totalitem property to -1 so that it doesnt show up in the item count of containers
			//TotalItems = -1;
			//UpdateTotal(this, TotalType.Items, -1);

			// Create the array of spawned objects
			m_SpawnObjects = new ArrayList();

			// Assign the list of objects to spawn
			SpawnObjects = objectsToSpawn;

			// Kick off the process
			DoTimer( TimeSpan.FromSeconds( 1 ) );
		}
		public override void OnResponse( NetState state, RelayInfo info )
		{
			Mobile from = state.Mobile;
			switch ( info.ButtonID ) 
		{ 
		case 0:
		{ 
                                    from.CloseGump( typeof( StartStopMontorilsh ) ); 
		        from.SendGump( new CityInvasion( from ) );
                                    break;  
                             }  
		case 1:
		{
			Point3D loc = new Point3D( 568, 1311, 0 );
			WayPoint point = new WayPoint();
			WayPoint point1 = new WayPoint();
			WayPoint point2 = new WayPoint();
			//WayPoint point3 = new WayPoint();

			point.Name = "MontorInvasionIlshenar";
			point1.Name = "MontorInvasionIlshenar";
			point2.Name = "MontorInvasionIlshenar";

			Spawner spawner1 = new Spawner( 1, 1440, 1441, 0, 6, "OrcBrute" );
			spawner1.MoveToWorld( new Point3D(  950, 284, -90  ), Map.Malas );
			spawner1.WayPoint = point;
			point.MoveToWorld( new Point3D(  950, 265, -90  ), Map.Malas );
			point.NextPoint = point2;
			point2.MoveToWorld( new Point3D(  950, 275, -90  ), Map.Malas );
          			spawner1.Name = "MontorInvasionIlshenar";
			spawner1.Respawn();

			Spawner spawner2 = new Spawner( 1, 1440, 1441, 0, 6, "OrcBomber" );
			spawner2.MoveToWorld( new Point3D(  952, 284, -90  ), Map.Malas );
			spawner2.WayPoint = point1;
			point1.MoveToWorld( new Point3D(  952, 265, -90  ), Map.Malas );
			spawner2.Name = "MontorInvasionIlshenar";
			spawner2.Respawn();

			Spawner spawner3 = new Spawner( 1, 1440, 1441, 0, 6, "Savage" );
			spawner3.MoveToWorld( new Point3D(  950, 244, -90  ), Map.Malas );
			spawner3.WayPoint = point;
			spawner3.Name = "MontorInvasionIlshenar";
			spawner3.Respawn();

			Spawner spawner4 = new Spawner( 1, 1440, 1441, 0, 6, "SavageRider" );
			spawner4.MoveToWorld( new Point3D(  952, 244, -90  ), Map.Malas );
			spawner4.WayPoint = point1;
			spawner4.Name = "MontorInvasionIlshenar";
			spawner4.Respawn();

                                           World.Broadcast( 33, true, "Montor Ilshenar is under invasion." );
		               from.SendGump( new CityInvasion( from ) );
                                   	 break; 
                            }  
		case 2:
		{
			MontorInvasionStone monilsh = new MontorInvasionStone();
			monilsh.StopMontorIlshenar();
                                          World.Broadcast( 33, true, "Montor Ilshenar's invasion was successfully beaten back. No more invaders are left in the city." );
		              from.SendGump( new CityInvasion( from ) );
                                   	break; 
				}
			}
		}
Exemplo n.º 28
0
 public ScheduleEntry(WayPoint w, ScheduleAct a)
 {
     waypoint = w;
     activity = a;
 }
Exemplo n.º 29
0
		public void LoadXmlConfig( string filename )
		{
			if( filename == null || filename.Length <= 0 ) return;
			// Check if the file exists
			if( System.IO.File.Exists( filename ) == true )
			{
				FileStream fs = null;
				try
				{
					fs = File.Open( filename, FileMode.Open, FileAccess.Read );
				}
				catch { }

				if( fs == null )
				{
					status_str = String.Format( "Unable to open {0} for loading", filename );
					return;
				}

				// Create the data set
				DataSet ds = new DataSet( XmlDataSetName );

				// Read in the file
				bool fileerror = false;
				try
				{
					ds.ReadXml( fs );
				}
				catch { fileerror = true; }
				// close the file
				fs.Close();
				if( fileerror )
				{
					Console.WriteLine( "XmlSpawner: Error in XML config file '{0}'", filename );
					return;
				}

				// Check that at least a single table was loaded
				if( ds.Tables != null && ds.Tables.Count > 0 )
				{
					if( ds.Tables[XmlTableName] != null && ds.Tables[XmlTableName].Rows.Count > 0 )
					{
						foreach( DataRow dr in ds.Tables[XmlTableName].Rows )
						{
							bool valid_entry;
							string strEntry = null;
							bool boolEntry = true;
							double doubleEntry = 0;
							int intEntry = 0;

							valid_entry = true;
							try { strEntry = (string)dr["Name"]; }
							catch { valid_entry = false; }
							if( valid_entry ) { Name = strEntry; }

							valid_entry = true;
							try { intEntry = int.Parse( (string)dr["X"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_X = intEntry; }

							valid_entry = true;
							try { intEntry = int.Parse( (string)dr["Y"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_Y = intEntry; }

							valid_entry = true;
							try { intEntry = int.Parse( (string)dr["Width"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_Width = intEntry; }

							valid_entry = true;
							try { intEntry = int.Parse( (string)dr["Height"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_Height = intEntry; }

							valid_entry = true;
							try { intEntry = int.Parse( (string)dr["CentreX"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { X = intEntry; }

							valid_entry = true;
							try { intEntry = int.Parse( (string)dr["CentreY"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { Y = intEntry; }

							valid_entry = true;
							try { intEntry = int.Parse( (string)dr["CentreZ"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { Z = intEntry; }

							valid_entry = true;
							try { intEntry = int.Parse( (string)dr["SequentialSpawning"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_SequentialSpawning = intEntry; }

							valid_entry = true;
							try { intEntry = int.Parse( (string)dr["ProximityRange"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_ProximityRange = intEntry; }

							valid_entry = true;
							try { strEntry = (string)dr["ProximityTriggerMessage"]; }
							catch { valid_entry = false; }
							if( valid_entry ) { m_ProximityTriggerMessage = strEntry; }

							valid_entry = true;
							try { strEntry = (string)dr["SpeechTrigger"]; }
							catch { valid_entry = false; }
							if( valid_entry ) { m_SpeechTrigger = strEntry; }

							valid_entry = true;
							try { strEntry = (string)dr["SkillTrigger"]; }
							catch { valid_entry = false; }
							if( valid_entry ) { m_SkillTrigger = strEntry; }

							valid_entry = true;
							try { intEntry = int.Parse( (string)dr["ProximityTriggerSound"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_ProximityTriggerSound = intEntry; }

							valid_entry = true;
							try { strEntry = (string)dr["ItemTriggerName"]; }
							catch { valid_entry = false; }
							if( valid_entry ) { m_ItemTriggerName = strEntry; }

							valid_entry = true;
							try { strEntry = (string)dr["NoItemTriggerName"]; }
							catch { valid_entry = false; }
							if( valid_entry ) { m_NoItemTriggerName = strEntry; }

							// check for the delayinsec entry
							bool delayinsec = false;
							try { delayinsec = bool.Parse( (string)dr["DelayInSec"] ); }
							catch { }

							valid_entry = true;
							try { doubleEntry = double.Parse( (string)dr["MinDelay"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { if( delayinsec ) m_MinDelay = TimeSpan.FromSeconds( doubleEntry ); else m_MinDelay = TimeSpan.FromMinutes( doubleEntry ); }

							valid_entry = true;
							try { doubleEntry = double.Parse( (string)dr["MaxDelay"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { if( delayinsec ) m_MaxDelay = TimeSpan.FromSeconds( doubleEntry ); else m_MaxDelay = TimeSpan.FromMinutes( doubleEntry ); }

							valid_entry = true;
							try { doubleEntry = double.Parse( (string)dr["Duration"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_Duration = TimeSpan.FromMinutes( doubleEntry ); }

							valid_entry = true;
							try { doubleEntry = double.Parse( (string)dr["DespawnTime"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_DespawnTime = TimeSpan.FromHours( doubleEntry ); }

							valid_entry = true;
							try { doubleEntry = double.Parse( (string)dr["MinRefractory"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_MinRefractory = TimeSpan.FromMinutes( doubleEntry ); }

							valid_entry = true;
							try { doubleEntry = double.Parse( (string)dr["MaxRefractory"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_MaxRefractory = TimeSpan.FromMinutes( doubleEntry ); }

							valid_entry = true;
							try { doubleEntry = double.Parse( (string)dr["TODStart"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_TODStart = TimeSpan.FromMinutes( doubleEntry ); }

							valid_entry = true;
							try { doubleEntry = double.Parse( (string)dr["TODEnd"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_TODEnd = TimeSpan.FromMinutes( doubleEntry ); }

							valid_entry = true;
							try { intEntry = int.Parse( (string)dr["TODMode"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_TODMode = (TODModeType)intEntry; }

							valid_entry = true;
							try { intEntry = int.Parse( (string)dr["Amount"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_StackAmount = intEntry; }

							valid_entry = true;
							try { intEntry = int.Parse( (string)dr["MaxCount"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_Count = intEntry; }

							valid_entry = true;
							try { intEntry = int.Parse( (string)dr["Range"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_HomeRange = intEntry; }

							valid_entry = true;
							try { intEntry = int.Parse( (string)dr["Team"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_Team = intEntry; }

							valid_entry = true;
							try { strEntry = (string)dr["WayPoint"]; }
							catch { valid_entry = false; }
							if( valid_entry ) { m_WayPoint = GetWaypoint( strEntry ); }

							valid_entry = true;
							try { intEntry = int.Parse( (string)dr["KillReset"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_KillReset = intEntry; }

							valid_entry = true;
							try { doubleEntry = double.Parse( (string)dr["TriggerProbability"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_TriggerProbability = doubleEntry; }

							valid_entry = true;
							try { boolEntry = bool.Parse( (string)dr["ExternalTriggering"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_ExternalTriggering = boolEntry; }

							valid_entry = true;
							try { boolEntry = bool.Parse( (string)dr["IsGroup"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_Group = boolEntry; }

							valid_entry = true;
							try { boolEntry = bool.Parse( (string)dr["IsHomeRangeRelative"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_HomeRangeIsRelative = boolEntry; }

							valid_entry = true;
							try { boolEntry = bool.Parse( (string)dr["AllowGhostTriggering"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_AllowGhostTriggering = boolEntry; }

							valid_entry = true;
							try { boolEntry = bool.Parse( (string)dr["AllowNPCTriggering"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_AllowNPCTriggering = boolEntry; }

							valid_entry = true;
							try { boolEntry = bool.Parse( (string)dr["SpawnOnTrigger"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_SpawnOnTrigger = boolEntry; }

							valid_entry = true;
							try { boolEntry = bool.Parse( (string)dr["SmartSpawning"] ); }
							catch { valid_entry = false; }
							if( valid_entry ) { m_SmartSpawning = boolEntry; }

							valid_entry = true;
							try { strEntry = (string)dr["RegionName"]; }
							catch { valid_entry = false; }
							if( valid_entry )
							{
								RegionName = strEntry;
							}

							valid_entry = true;
							try { strEntry = (string)dr["PlayerPropertyName"]; }
							catch { valid_entry = false; }
							if( valid_entry )
							{
								m_PlayerPropertyName = strEntry;
							}

							valid_entry = true;
							try { strEntry = (string)dr["MobPropertyName"]; }
							catch { valid_entry = false; }
							if( valid_entry )
							{
								m_MobPropertyName = strEntry;
							}

							valid_entry = true;
							try { strEntry = (string)dr["MobTriggerName"]; }
							catch { valid_entry = false; }
							if( valid_entry )
							{
								m_MobTriggerName = strEntry;
							}

							valid_entry = true;
							try { strEntry = (string)dr["ObjectPropertyName"]; }
							catch { valid_entry = false; }
							if( valid_entry )
							{
								m_ObjectPropertyName = strEntry;
							}

							valid_entry = true;
							try { strEntry = (string)dr["ObjectPropertyItemName"]; }
							catch { valid_entry = false; }
							if( valid_entry )
							{
								string[] typeargs = strEntry.Split( ",".ToCharArray(), 2 );
								string typestr = null;
								string namestr = strEntry;

								if( typeargs.Length > 1 )
								{
									namestr = typeargs[0];
									typestr = typeargs[1];
								}
								m_ObjectPropertyItem = BaseXmlSpawner.FindItemByName( this, namestr, typestr );
							}

							valid_entry = true;
							try { strEntry = (string)dr["SetPropertyItemName"]; }
							catch { valid_entry = false; }
							if( valid_entry )
							{
								string[] typeargs = strEntry.Split( ",".ToCharArray(), 2 );
								string typestr = null;
								string namestr = strEntry;

								if( typeargs.Length > 1 )
								{
									namestr = typeargs[0];
									typestr = typeargs[1];
								}
								m_SetPropertyItem = BaseXmlSpawner.FindItemByName( this, namestr, typestr );
							}

							valid_entry = true;
							try { strEntry = (string)dr["Name"]; }
							catch { valid_entry = false; }
							if( valid_entry ) { Name = strEntry; }

							valid_entry = true;
							try { strEntry = (string)dr["Map"]; }
							catch { valid_entry = false; }
							if( valid_entry )
							{
								// Convert the xml map value to a real map object
								try
								{
									Map = Map.Parse( strEntry );
								}
								catch { }
							}

							// try loading the new spawn specifications first
							SpawnObject[] Spawns = new SpawnObject[0];
							bool havenew = true;
							valid_entry = true;
							try { Spawns = SpawnObject.LoadSpawnObjectsFromString2( (string)dr["Objects2"] ); }
							catch { havenew = false; }
							if( !havenew )
							{
								// try loading the new spawn specifications
								try { Spawns = SpawnObject.LoadSpawnObjectsFromString( (string)dr["Objects"] ); }
								catch { valid_entry = false; }
								// can only have one of these defined
							}
							if( valid_entry )
							{

								// clear existing spawns
								RemoveSpawnObjects();

								// Create the new array of spawned objects
								m_SpawnObjects = new ArrayList();

								// Assign the list of objects to spawn
								SpawnObjects = Spawns;
							}
						}
					}
				}
			}
		}
Exemplo n.º 30
0
 public NextPointTarget(WayPoint pt)
     : base(-1, false, TargetFlags.None)
 {
     m_Point = pt;
 }
Exemplo n.º 31
0
		public XmlSpawner( Guid uniqueId, int x, int y, int width, int height, string name, int maxCount, TimeSpan minDelay, TimeSpan maxDelay, TimeSpan duration,
			int proximityRange, int proximityTriggerSound, int amount, int team, int homeRange, bool isRelativeHomeRange, SpawnObject[] spawnObjects,
			TimeSpan minRefractory, TimeSpan maxRefractory, TimeSpan todstart, TimeSpan todend, Item objectPropertyItem, string objectPropertyName, string proximityMessage,
			string itemTriggerName, string noitemTriggerName, string speechTrigger, string mobTriggerName, string mobPropertyName, string playerPropertyName, double triggerProbability,
			Item setPropertyItem, bool isGroup, TODModeType todMode, int killReset, bool externalTriggering, int sequentialSpawning, string regionName,
			bool allowghost, bool allownpc, bool spawnontrigger, string configfile, TimeSpan despawnTime, string skillTrigger, bool smartSpawning, WayPoint wayPoint )
			: base( BaseItemId )
		{
			m_UniqueId = uniqueId.ToString();
			InitSpawn( x, y, width, height, name, maxCount, minDelay, maxDelay, duration,
				proximityRange, proximityTriggerSound, amount, team, homeRange, isRelativeHomeRange, spawnObjects, minRefractory, maxRefractory, todstart, todend,
				objectPropertyItem, objectPropertyName, proximityMessage, itemTriggerName, noitemTriggerName, speechTrigger, mobTriggerName, mobPropertyName, playerPropertyName,
				triggerProbability, setPropertyItem, isGroup, todMode, killReset, externalTriggering, sequentialSpawning, regionName, allowghost, allownpc, spawnontrigger, configfile,
				despawnTime, skillTrigger, smartSpawning, wayPoint );
		}
		public override void OnResponse( NetState state, RelayInfo info )
		{
			Mobile from = state.Mobile;
			switch ( info.ButtonID ) 
		{ 
		case 0:
		{ 
                                    from.CloseGump( typeof( StartStopMaginciafel ) ); 
		        from.SendGump( new CityInvasion( from ) );
                                    break;  
                             }  
		case 1:
		{
			Point3D loc = new Point3D( 568, 1311, 0 );

			WayPoint point = new WayPoint();
			WayPoint point1 = new WayPoint();
			WayPoint point2 = new WayPoint();
			WayPoint point3 = new WayPoint();
			WayPoint point4 = new WayPoint();
			WayPoint point5 = new WayPoint();
			WayPoint point6 = new WayPoint();
			WayPoint point7 = new WayPoint();
			WayPoint point8 = new WayPoint();
			WayPoint point9 = new WayPoint();

			WayPoint point10 = new WayPoint();
			WayPoint point11 = new WayPoint();
			/*WayPoint point12 = new WayPoint();
			WayPoint point13 = new WayPoint();
			WayPoint point14 = new WayPoint();
			WayPoint point15 = new WayPoint();
			WayPoint point16 = new WayPoint();
			WayPoint point17 = new WayPoint();
			WayPoint point18 = new WayPoint();
			WayPoint point19 = new WayPoint();

			WayPoint point20 = new WayPoint();
			WayPoint point21 = new WayPoint();
			WayPoint point22 = new WayPoint();
			WayPoint point23 = new WayPoint();
			WayPoint point24 = new WayPoint();
			WayPoint point25 = new WayPoint();
			WayPoint point26 = new WayPoint();
			WayPoint point27 = new WayPoint();
			WayPoint point28 = new WayPoint();
			WayPoint point29 = new WayPoint();

			WayPoint point30 = new WayPoint();
			WayPoint point31 = new WayPoint();
			WayPoint point32 = new WayPoint();
			WayPoint point33 = new WayPoint();
			WayPoint point34 = new WayPoint();
			WayPoint point35 = new WayPoint();
			WayPoint point36 = new WayPoint();
			WayPoint point37 = new WayPoint();
			WayPoint point38 = new WayPoint();
			WayPoint point39 = new WayPoint();

			WayPoint point40 = new WayPoint();
			WayPoint point41 = new WayPoint();
			WayPoint point42 = new WayPoint();
			WayPoint point43 = new WayPoint();
			WayPoint point44 = new WayPoint();
			WayPoint point45 = new WayPoint();
			WayPoint point46 = new WayPoint();
			WayPoint point47 = new WayPoint();
			WayPoint point48 = new WayPoint();
			WayPoint point49 = new WayPoint();

			WayPoint point50 = new WayPoint();
			WayPoint point51 = new WayPoint();
			WayPoint point52 = new WayPoint();
			WayPoint point53 = new WayPoint();
			WayPoint point54 = new WayPoint();
			WayPoint point55 = new WayPoint();
			WayPoint point56 = new WayPoint();
			WayPoint point57 = new WayPoint();
			WayPoint point58 = new WayPoint();
			WayPoint point59 = new WayPoint();

			WayPoint point60 = new WayPoint();
			WayPoint point61 = new WayPoint();
			WayPoint point62 = new WayPoint();
			WayPoint point63 = new WayPoint();
			WayPoint point64 = new WayPoint();
			WayPoint point65 = new WayPoint();
			WayPoint point66 = new WayPoint();
			WayPoint point67 = new WayPoint();
			WayPoint point68 = new WayPoint();
			WayPoint point69 = new WayPoint();

			WayPoint point70 = new WayPoint();
			WayPoint point71 = new WayPoint();
			WayPoint point72 = new WayPoint();
			WayPoint point73 = new WayPoint();
			WayPoint point74 = new WayPoint();
			WayPoint point75 = new WayPoint();
			WayPoint point76 = new WayPoint();
			WayPoint point77 = new WayPoint();
			WayPoint point78 = new WayPoint();
			WayPoint point79 = new WayPoint();
			WayPoint point80 = new WayPoint();
			WayPoint point81 = new WayPoint();

			WayPoint point82 = new WayPoint();
			WayPoint point83 = new WayPoint();
			WayPoint point84 = new WayPoint();
			WayPoint point85 = new WayPoint();
			WayPoint point86 = new WayPoint();
			WayPoint point87 = new WayPoint();
			WayPoint point88 = new WayPoint();
			WayPoint point89 = new WayPoint();
			WayPoint point90 = new WayPoint();
			WayPoint point91 = new WayPoint();
			WayPoint point92 = new WayPoint();
			WayPoint point93 = new WayPoint();

			WayPoint point94 = new WayPoint();
			WayPoint point95 = new WayPoint();
			WayPoint point96 = new WayPoint();
			WayPoint point97 = new WayPoint();
			WayPoint point98 = new WayPoint();
			WayPoint point99 = new WayPoint();
			WayPoint point100 = new WayPoint();
			WayPoint point101 = new WayPoint();
			WayPoint point102 = new WayPoint();
			WayPoint point103 = new WayPoint();
			WayPoint point104 = new WayPoint();
			WayPoint point105 = new WayPoint();

			WayPoint point106 = new WayPoint();
			WayPoint point107 = new WayPoint();
			WayPoint point108 = new WayPoint();
			WayPoint point109 = new WayPoint();
			WayPoint point110 = new WayPoint();
			WayPoint point111 = new WayPoint();
			WayPoint point112 = new WayPoint();
			WayPoint point113 = new WayPoint();
			WayPoint point114 = new WayPoint();
			WayPoint point115 = new WayPoint();
			WayPoint point116 = new WayPoint();
			WayPoint point117 = new WayPoint();
			WayPoint point118 = new WayPoint();
			WayPoint point119 = new WayPoint();
			WayPoint point120 = new WayPoint();*/

			point.Name = "MaginciaInvasionFelucca";
			point1.Name = "MaginciaInvasionFelucca";
			point2.Name = "MaginciaInvasionFelucca";
			point3.Name = "MaginciaInvasionFelucca";
			point4.Name = "MaginciaInvasionFelucca";
			point5.Name = "MaginciaInvasionFelucca";
			point6.Name = "MaginciaInvasionFelucca";
			point7.Name = "MaginciaInvasionFelucca";
			point8.Name = "MaginciaInvasionFelucca";
			point9.Name = "MaginciaInvasionFelucca";

			point10.Name = "MaginciaInvasionFelucca";
			point11.Name = "MaginciaInvasionFelucca";
			/*point12.Name = "MaginciaInvasionFelucca";
			point13.Name = "MaginciaInvasionFelucca";
			point14.Name = "MaginciaInvasionFelucca";
			point15.Name = "MaginciaInvasionFelucca";
			point16.Name = "MaginciaInvasionFelucca";
			point17.Name = "MaginciaInvasionFelucca";
			point18.Name = "MaginciaInvasionFelucca";
			point19.Name = "MaginciaInvasionFelucca";

			point20.Name = "MaginciaInvasionFelucca";
			point21.Name = "MaginciaInvasionFelucca";
			point22.Name = "MaginciaInvasionFelucca";
			point23.Name = "MaginciaInvasionFelucca";
			point24.Name = "MaginciaInvasionFelucca";
			point25.Name = "MaginciaInvasionFelucca";
			point26.Name = "MaginciaInvasionFelucca";
			point27.Name = "MaginciaInvasionFelucca";
			point28.Name = "MaginciaInvasionFelucca";
			point29.Name = "MaginciaInvasionFelucca";

			point30.Name = "MaginciaInvasionFelucca";
			point31.Name = "MaginciaInvasionFelucca";
			point32.Name = "MaginciaInvasionFelucca";
			point33.Name = "MaginciaInvasionFelucca";
			point34.Name = "MaginciaInvasionFelucca";
			point35.Name = "MaginciaInvasionFelucca";
			point36.Name = "MaginciaInvasionFelucca";
			point37.Name = "MaginciaInvasionFelucca";
			point38.Name = "MaginciaInvasionFelucca";
			point39.Name = "MaginciaInvasionFelucca";

			point40.Name = "MaginciaInvasionFelucca";
			point41.Name = "MaginciaInvasionFelucca";
			point42.Name = "MaginciaInvasionFelucca";
			point43.Name = "MaginciaInvasionFelucca";
			point44.Name = "MaginciaInvasionFelucca";
			point45.Name = "MaginciaInvasionFelucca";
			point46.Name = "MaginciaInvasionFelucca";
			point47.Name = "MaginciaInvasionFelucca";
			point48.Name = "MaginciaInvasionFelucca";
			point49.Name = "MaginciaInvasionFelucca";

			point50.Name = "MaginciaInvasionFelucca";
			point51.Name = "MaginciaInvasionFelucca";
			point52.Name = "MaginciaInvasionFelucca";
			point53.Name = "MaginciaInvasionFelucca";
			point54.Name = "MaginciaInvasionFelucca";
			point55.Name = "MaginciaInvasionFelucca";
			point56.Name = "MaginciaInvasionFelucca";
			point57.Name = "MaginciaInvasionFelucca";
			point58.Name = "MaginciaInvasionFelucca";
			point59.Name = "MaginciaInvasionFelucca";

			point60.Name = "MaginciaInvasionFelucca";
			point61.Name = "MaginciaInvasionFelucca";
			point62.Name = "MaginciaInvasionFelucca";
			point63.Name = "MaginciaInvasionFelucca";
			point64.Name = "MaginciaInvasionFelucca";
			point65.Name = "MaginciaInvasionFelucca";
			point66.Name = "MaginciaInvasionFelucca";
			point67.Name = "MaginciaInvasionFelucca";
			point68.Name = "MaginciaInvasionFelucca";
			point69.Name = "MaginciaInvasionFelucca";

			point70.Name = "MaginciaInvasionFelucca";
			point71.Name = "MaginciaInvasionFelucca";
			point72.Name = "MaginciaInvasionFelucca";
			point73.Name = "MaginciaInvasionFelucca";
			point74.Name = "MaginciaInvasionFelucca";
			point75.Name = "MaginciaInvasionFelucca";
			point76.Name = "MaginciaInvasionFelucca";
			point77.Name = "MaginciaInvasionFelucca";
			point78.Name = "MaginciaInvasionFelucca";
			point79.Name = "MaginciaInvasionFelucca";
			point80.Name = "MaginciaInvasionFelucca";
			point81.Name = "MaginciaInvasionFelucca";

			point82.Name = "MaginciaInvasionFelucca";
			point83.Name = "MaginciaInvasionFelucca";
			point84.Name = "MaginciaInvasionFelucca";
			point85.Name = "MaginciaInvasionFelucca";
			point86.Name = "MaginciaInvasionFelucca";
			point87.Name = "MaginciaInvasionFelucca";
			point88.Name = "MaginciaInvasionFelucca";
			point89.Name = "MaginciaInvasionFelucca";
			point90.Name = "MaginciaInvasionFelucca";
			point91.Name = "MaginciaInvasionFelucca";
			point92.Name = "MaginciaInvasionFelucca";
			point93.Name = "MaginciaInvasionFelucca";

			point94.Name = "MaginciaInvasionFelucca";
			point95.Name = "MaginciaInvasionFelucca";
			point96.Name = "MaginciaInvasionFelucca";
			point97.Name = "MaginciaInvasionFelucca";
			point98.Name = "MaginciaInvasionFelucca";
			point99.Name = "MaginciaInvasionFelucca";
			point100.Name = "MaginciaInvasionFelucca";
			point101.Name = "MaginciaInvasionFelucca";
			point102.Name = "MaginciaInvasionFelucca";
			point103.Name = "MaginciaInvasionFelucca";
			point104.Name = "MaginciaInvasionFelucca";
			point105.Name = "MaginciaInvasionFelucca";

			point106.Name = "MaginciaInvasionFelucca";
			point107.Name = "MaginciaInvasionFelucca";
			point108.Name = "MaginciaInvasionFelucca";
			point109.Name = "MaginciaInvasionFelucca";
			point110.Name = "MaginciaInvasionFelucca";
			point111.Name = "MaginciaInvasionFelucca";
			point112.Name = "MaginciaInvasionFelucca";
			point113.Name = "MaginciaInvasionFelucca";
			point114.Name = "MaginciaInvasionFelucca";
			point115.Name = "MaginciaInvasionFelucca";
			point116.Name = "MaginciaInvasionFelucca";
			point117.Name = "MaginciaInvasionFelucca";
			point118.Name = "MaginciaInvasionFelucca";
			point119.Name = "MaginciaInvasionFelucca";
			point120.Name = "MaginciaInvasionFelucca";*/

			GuardedRegion reg = from.Region as GuardedRegion;

			if ( reg == null )
			{
				from.SendMessage( 33, "You are not in the guarded part of Magincia, Felucca." );
				from.SendMessage( 33, "You will have to go there and use [toggleguarded to turn the guards off." );
			}
			 else if ( reg.Disabled )
                                           {
				from.SendMessage( 3, "The guards in this region have not changed." );
                                           }
			else if ( !reg.Disabled )
                                           {
				reg.Disabled = !reg.Disabled;
			              from.SendMessage( 3, "The guards in this region have been disabled." );
                                           }
                                           if ( DummyMessage  && reg != null )
                                          {
				from.SendMessage( 33, "If you are not in the guarded part of Magincia, Felucca." );
				from.SendMessage( 33, "You will have to go there and use [toggleguarded to turn the guards off." );
                                          }
			Spawner spawner1 = new Spawner( 4, 5, 15, 0, 10, "OrcBomber" );
			spawner1.MoveToWorld( new Point3D(  3654, 2070, 20  ), Map.Felucca );
			spawner1.WayPoint = point;
			point.MoveToWorld( new Point3D(  3708, 2090, 5  ), Map.Felucca );
			point.NextPoint = point1;
			point1.MoveToWorld( new Point3D(  3707, 2180, 20  ), Map.Felucca );
			point1.NextPoint = point2;
			point2.MoveToWorld( new Point3D(  3675, 2180, 20  ), Map.Felucca );
			point2.NextPoint = point3;
			point3.MoveToWorld( new Point3D(  3675, 2235, 20  ), Map.Felucca );
			point3.NextPoint = point4;
			point4.MoveToWorld( new Point3D(  3741, 2235, 20  ), Map.Felucca );
			point4.NextPoint = point5;
			point5.MoveToWorld( new Point3D(  3741, 2188, 20  ), Map.Felucca );
			point5.NextPoint = point6;
			point6.MoveToWorld( new Point3D(  3707, 2188, 20  ), Map.Felucca );
			point6.NextPoint = point7;
			point7.MoveToWorld( new Point3D(  3707, 2180, 20  ), Map.Felucca );
			point7.NextPoint = point8;
			point8.MoveToWorld( new Point3D(  3675, 2180, 20  ), Map.Felucca );
			point8.NextPoint = point9;
			point9.MoveToWorld( new Point3D(  3675, 2115, 20  ), Map.Felucca );
			point9.NextPoint = point10;
			point10.MoveToWorld( new Point3D(  3754, 2115, 20  ), Map.Felucca );
			point10.NextPoint = point11;
			point11.MoveToWorld( new Point3D(  3708, 2115, 20  ), Map.Felucca );
			point11.NextPoint = point;
          	spawner1.Name = "MaginciaInvasionFelucca";
			spawner1.Respawn();

            Spawner spawner2 = new Spawner(4, 5, 15, 0, 8, "OrcishLord");
            spawner2.MoveToWorld(new Point3D(3797, 2263, 40), Map.Felucca);
            spawner2.Name = "MaginciaInvasionFelucca";
            spawner2.Respawn();

            Spawner spawner3 = new Spawner(4, 5, 15, 0, 8, "OrcCaptain");
            spawner3.MoveToWorld(new Point3D(3796, 2262, 40), Map.Felucca);
            spawner3.Name = "MaginciaInvasionFelucca";
            spawner3.Respawn();

            Spawner spawner4 = new Spawner(4, 5, 15, 0, 8, "OrcSoldier");
            spawner4.MoveToWorld(new Point3D(3797, 2262, 40), Map.Felucca);
            spawner4.Name = "MaginciaInvasionFelucca";
            spawner4.Respawn();

            Spawner spawner5 = new Spawner(4, 5, 15, 0, 8, "OrcishMage");
            spawner5.MoveToWorld(new Point3D(3798, 2262, 40), Map.Felucca);
            spawner5.Name = "MaginciaInvasionFelucca";
            spawner5.Respawn();

            Spawner spawner6 = new Spawner(1, 2, 2, 0, 2, "OrcKing");
            spawner6.MoveToWorld(new Point3D(3799, 2262, 40), Map.Felucca);
            spawner6.Name = "MaginciaInvasionFelucca";
            spawner6.Respawn();

            Spawner spawner7 = new Spawner(10, 5, 15, 0, 8, "Orc");
            spawner7.MoveToWorld(new Point3D(3798, 2262, 40), Map.Felucca);
            spawner7.Name = "MaginciaInvasionFelucca";
            spawner7.Respawn();

            Spawner spawner8 = new Spawner(1, 5, 15, 0, 1, "OrcCamp");
            spawner8.MoveToWorld(new Point3D(3739, 2255, 20), Map.Felucca);
            spawner8.Name = "MaginciaInvasionFelucca";
            spawner8.Respawn();

            Spawner spawner41 = new Spawner(1, 5, 15, 0, 1, "OrcCamp");
            spawner41.MoveToWorld(new Point3D(3752, 2237, 20), Map.Felucca);
            spawner41.Name = "MaginciaInvasionFelucca";
            spawner41.Respawn();

            Spawner spawner9 = new Spawner(2, 5, 15, 0, 5, "OrcBomber");
            spawner9.MoveToWorld(new Point3D(3744, 2237, 20), Map.Felucca);
            spawner9.Name = "MaginciaInvasionFelucca";
            spawner9.Respawn();

            Spawner spawner10 = new Spawner(2, 5, 15, 0, 5, "OrcBomber");
            spawner10.MoveToWorld(new Point3D(3739, 2251, 20), Map.Felucca);
            spawner10.Name = "MaginciaInvasionFelucca";
            spawner10.Respawn();

            Spawner spawner11 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner11.MoveToWorld(new Point3D(3727, 2224, 20), Map.Felucca);
            spawner11.Name = "MaginciaInvasionFelucca";
            spawner11.Respawn();

            Spawner spawner12 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner12.MoveToWorld(new Point3D(3727, 2224, 20), Map.Felucca);
            spawner12.Name = "MaginciaInvasionFelucca";
            spawner12.Respawn();

            Spawner spawner13 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner13.MoveToWorld(new Point3D(3727, 2220, 20), Map.Felucca);
            spawner13.Name = "MaginciaInvasionFelucca";
            spawner13.Respawn();

            Spawner spawner14 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner14.MoveToWorld(new Point3D(3727, 2220, 20), Map.Felucca);
            spawner14.Name = "MaginciaInvasionFelucca";
            spawner14.Respawn();

            Spawner spawner15 = new Spawner(3, 5, 15, 0, 20, "OrcScout");
            spawner15.MoveToWorld(new Point3D(3764, 2237, 30), Map.Felucca);
            spawner15.Name = "MaginciaInvasionFelucca";
            spawner15.Respawn();

            Spawner spawner16 = new Spawner(3, 5, 15, 0, 20, "OrcScout");
            spawner16.MoveToWorld(new Point3D(3752, 2260, 30), Map.Felucca);
            spawner16.Name = "MaginciaInvasionFelucca";
            spawner16.Respawn();

            Spawner spawner17 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner17.MoveToWorld(new Point3D(3700, 2250, 20), Map.Felucca);
            spawner17.Name = "MaginciaInvasionFelucca";
            spawner17.Respawn();

            Spawner spawner18 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner18.MoveToWorld(new Point3D(3700, 2250, 20), Map.Felucca);
            spawner18.Name = "MaginciaInvasionFelucca";
            spawner18.Respawn();

            Spawner spawner19 = new Spawner(20, 5, 15, 0, 8, "Orc");
            spawner19.MoveToWorld(new Point3D(3715, 2235, 20), Map.Felucca);
            spawner19.Name = "MaginciaInvasionFelucca";
            spawner19.Respawn();

            Spawner spawner20 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner20.MoveToWorld(new Point3D(3700, 2221, 41), Map.Felucca);
            spawner20.Name = "MaginciaInvasionFelucca";
            spawner20.Respawn();

            Spawner spawner21 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner21.MoveToWorld(new Point3D(3700, 2221, 41), Map.Felucca);
            spawner21.Name = "MaginciaInvasionFelucca";
            spawner21.Respawn();

            Spawner spawner22 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner22.MoveToWorld(new Point3D(3700, 2221, 20), Map.Felucca);
            spawner22.Name = "MaginciaInvasionFelucca";
            spawner22.Respawn();

            Spawner spawner23 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner23.MoveToWorld(new Point3D(3700, 2221, 20), Map.Felucca);
            spawner23.Name = "MaginciaInvasionFelucca";
            spawner23.Respawn();

            Spawner spawner24 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner24.MoveToWorld(new Point3D(3690, 2226, 20), Map.Felucca);
            spawner24.Name = "MaginciaInvasionFelucca";
            spawner24.Respawn();

            Spawner spawner25 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner25.MoveToWorld(new Point3D(3690, 2226, 20), Map.Felucca);
            spawner25.Name = "MaginciaInvasionFelucca";
            spawner25.Respawn();

            Spawner spawner26 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner26.MoveToWorld(new Point3D(3666, 2234, 20), Map.Felucca);
            spawner26.Name = "MaginciaInvasionFelucca";
            spawner26.Respawn();

            Spawner spawner27 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner27.MoveToWorld(new Point3D(3666, 2234, 20), Map.Felucca);
            spawner27.Name = "MaginciaInvasionFelucca";
            spawner27.Respawn();

            Spawner spawner28 = new Spawner(20, 5, 15, 0, 8, "Orc");
            spawner28.MoveToWorld(new Point3D(3676, 2238, 20), Map.Felucca);
            spawner28.Name = "MaginciaInvasionFelucca";
            spawner28.Respawn();

            Spawner spawner29 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner29.MoveToWorld(new Point3D(3667, 2254, 20), Map.Felucca);
            spawner29.Name = "MaginciaInvasionFelucca";
            spawner29.Respawn();

            Spawner spawner30 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner30.MoveToWorld(new Point3D(3667, 2254, 20), Map.Felucca);
            spawner30.Name = "MaginciaInvasionFelucca";
            spawner30.Respawn();

            Spawner spawner31 = new Spawner(2, 5, 15, 0, 5, "OrcBomber");
            spawner31.MoveToWorld(new Point3D(3676, 2238, 20), Map.Felucca);
            spawner31.Name = "MaginciaInvasionFelucca";
            spawner31.Respawn();

            Spawner spawner32 = new Spawner(2, 5, 15, 0, 5, "OrcBomber");
            spawner32.MoveToWorld(new Point3D(3715, 2235, 20), Map.Felucca);
            spawner32.Name = "MaginciaInvasionFelucca";
            spawner32.Respawn();

            Spawner spawner33 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner33.MoveToWorld(new Point3D(3684, 2252, 20), Map.Felucca);
            spawner33.Name = "MaginciaInvasionFelucca";
            spawner33.Respawn();

            Spawner spawner34 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner34.MoveToWorld(new Point3D(3684, 2252, 20), Map.Felucca);
            spawner34.Name = "MaginciaInvasionFelucca";
            spawner34.Respawn();

            Spawner spawner35 = new Spawner(20, 5, 15, 0, 8, "Orc");
            spawner35.MoveToWorld(new Point3D(3674, 2286, -2), Map.Felucca);
            spawner35.Name = "MaginciaInvasionFelucca";
            spawner35.Respawn();

            Spawner spawner36 = new Spawner(3, 5, 15, 0, 20, "OrcScout");
            spawner36.MoveToWorld(new Point3D(3674, 2286, -2), Map.Felucca);
            spawner36.Name = "MaginciaInvasionFelucca";
            spawner36.Respawn();

            Spawner spawner37 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner37.MoveToWorld(new Point3D(3660, 2188, 20), Map.Felucca);
            spawner37.Name = "MaginciaInvasionFelucca";
            spawner37.Respawn();

            Spawner spawner38 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner38.MoveToWorld(new Point3D(3660, 2188, 20), Map.Felucca);
            spawner38.Name = "MaginciaInvasionFelucca";
            spawner38.Respawn();

            Spawner spawner39 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner39.MoveToWorld(new Point3D(3694, 2163, 20), Map.Felucca);
            spawner39.Name = "MaginciaInvasionFelucca";
            spawner39.Respawn();

            Spawner spawner40 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner40.MoveToWorld(new Point3D(3694, 2163, 20), Map.Felucca);
            spawner40.Name = "MaginciaInvasionFelucca";
            spawner40.Respawn();

            Spawner spawner42 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner42.MoveToWorld(new Point3D(3731, 2149, 20), Map.Felucca);
            spawner42.Name = "MaginciaInvasionFelucca";
            spawner42.Respawn();

            Spawner spawner43 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner43.MoveToWorld(new Point3D(3731, 2149, 20), Map.Felucca);
            spawner43.Name = "MaginciaInvasionFelucca";
            spawner43.Respawn();

            Spawner spawner44 = new Spawner(20, 5, 15, 0, 8, "Orc");
            spawner44.MoveToWorld(new Point3D(3710, 2162, 20), Map.Felucca);
            spawner44.Name = "MaginciaInvasionFelucca";
            spawner44.Respawn();

            Spawner spawner45 = new Spawner(1, 5, 15, 0, 1, "OrcCamp");
            spawner45.MoveToWorld(new Point3D(3715, 2147, 20), Map.Felucca);
            spawner45.Name = "MaginciaInvasionFelucca";
            spawner45.Respawn();

            Spawner spawner46 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner46.MoveToWorld(new Point3D(3718, 2127, 20), Map.Felucca);
            spawner46.Name = "MaginciaInvasionFelucca";
            spawner46.Respawn();

            Spawner spawner47 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner47.MoveToWorld(new Point3D(3718, 2127, 20), Map.Felucca);
            spawner47.Name = "MaginciaInvasionFelucca";
            spawner47.Respawn();

            Spawner spawner48 = new Spawner(20, 5, 15, 0, 8, "Orc");
            spawner48.MoveToWorld(new Point3D(3698, 2108, 20), Map.Felucca);
            spawner48.Name = "MaginciaInvasionFelucca";
            spawner48.Respawn();

            Spawner spawner49 = new Spawner(3, 5, 15, 0, 10, "OrcCamp");
            spawner49.MoveToWorld(new Point3D(3667, 2107, 20), Map.Felucca);
            spawner49.Name = "MaginciaInvasionFelucca";
            spawner49.Respawn();

            /*Spawner spawner50 = new Spawner(2, 5, 15, 0, 8, "OrcishMage");
            spawner50.MoveToWorld(new Point3D(3718, 2127, 20), Map.Felucca);
            spawner50.Name = "MaginciaInvasionFelucca";
            spawner50.Respawn();

            Spawner spawner51 = new Spawner(2, 5, 15, 0, 8, "OrcishLord");
            spawner51.MoveToWorld(new Point3D(3718, 2127, 20), Map.Felucca);
            spawner51.Name = "MaginciaInvasionFelucca";
            spawner51.Respawn();

			/*Spawner spawner2 = new Spawner( 4, 5, 15, 0, 15, "Orc" );
			spawner2.MoveToWorld( new Point3D(  2694, 466, 18  ), Map.Felucca );
			spawner2.WayPoint = point12;
			point12.MoveToWorld( new Point3D(  2662, 469, 15  ), Map.Felucca );
			point12.NextPoint = point13;
			point13.MoveToWorld( new Point3D(  2625, 469, 15  ), Map.Felucca );
			point13.NextPoint = point14;
			point14.MoveToWorld( new Point3D(  2613, 507, 15  ), Map.Felucca );
			point14.NextPoint = point15;
			point15.MoveToWorld( new Point3D(  2558, 513, 15  ), Map.Felucca );
			point15.NextPoint = point16;
			point16.MoveToWorld( new Point3D(  2558, 496, 0  ), Map.Felucca );
			point16.NextPoint = point17;
			point17.MoveToWorld( new Point3D(  2576, 479, 0  ), Map.Felucca );
			point17.NextPoint = point18;
			point18.MoveToWorld( new Point3D(  2558, 496, 0  ), Map.Felucca );
			point18.NextPoint = point19;
			point19.MoveToWorld( new Point3D(  2558, 528, 15  ), Map.Felucca );
			point19.NextPoint = point20;
			point20.MoveToWorld( new Point3D(  2569, 537, 15  ), Map.Felucca );
			point20.NextPoint = point21;
			point21.MoveToWorld( new Point3D(  2599, 531, 15  ), Map.Felucca );
			point21.NextPoint = point22;
			point22.MoveToWorld( new Point3D(  2599, 504, 0  ), Map.Felucca );
			point22.NextPoint = point23;
			point23.MoveToWorld( new Point3D(  2606, 502, 0  ), Map.Felucca );
			point23.NextPoint = point24;
			point24.MoveToWorld( new Point3D(  2604, 496, 20  ), Map.Felucca );
			point24.NextPoint = point25;
			point25.MoveToWorld( new Point3D(  2578, 500, 22  ), Map.Felucca );
			point25.NextPoint = point26;
			point26.MoveToWorld( new Point3D(  2582, 493, 40  ), Map.Felucca );
			point26.NextPoint = point27;
			point27.MoveToWorld( new Point3D(  2609, 469, 40  ), Map.Felucca );
			point27.NextPoint = point28;
			point28.MoveToWorld( new Point3D(  2602, 466, 60  ), Map.Felucca );
			point28.NextPoint = point29;
			point29.MoveToWorld( new Point3D(  2604, 453, 60  ), Map.Felucca );
			point29.NextPoint = point30;
			point30.MoveToWorld( new Point3D(  2591, 457, 60  ), Map.Felucca );
			point30.NextPoint = point31;
			point31.MoveToWorld( new Point3D(  2604, 453, 60  ), Map.Felucca );
			point31.NextPoint = point32;
			point32.MoveToWorld( new Point3D(  2602, 466, 60  ), Map.Felucca );
			point32.NextPoint = point33;
			point33.MoveToWorld( new Point3D(  2609, 469, 40  ), Map.Felucca );
			point33.NextPoint = point34;
			point34.MoveToWorld( new Point3D(  2582, 493, 40   ), Map.Felucca );
			point34.NextPoint = point35;
			point35.MoveToWorld( new Point3D(  2578, 500, 22  ), Map.Felucca );
			point35.NextPoint = point36;
			point36.MoveToWorld( new Point3D(  2604, 496, 20  ), Map.Felucca );
			point36.NextPoint = point37;
			point37.MoveToWorld( new Point3D(  2606, 502, 0  ), Map.Felucca );
			point37.NextPoint = point14;
			spawner2.Name = "MaginciaInvasionFelucca";
			spawner2.Respawn();

			Spawner spawner3 = new Spawner( 6, 5, 15, 0, 10, "Orc" );
			spawner3.MoveToWorld( new Point3D(  2555, 370, 15  ), Map.Felucca );
			spawner3.WayPoint = point38;
			point38.MoveToWorld( new Point3D(  2532, 389, 15  ), Map.Felucca );
			point38.NextPoint = point39;
			point39.MoveToWorld( new Point3D(  2510, 386, 15  ), Map.Felucca );
			point39.NextPoint = point40;
			point40.MoveToWorld( new Point3D(  2500, 419, 15  ), Map.Felucca );
			point40.NextPoint = point41;
			point41.MoveToWorld( new Point3D(  2445, 419, 15  ), Map.Felucca );
			point41.NextPoint = point42;
			point42.MoveToWorld( new Point3D(  2445, 447, 15  ), Map.Felucca );
			point42.NextPoint = point43;
			point43.MoveToWorld( new Point3D(  2501, 444, 15  ), Map.Felucca );
			point43.NextPoint = point44;
			point44.MoveToWorld( new Point3D(  2501, 485, 15  ), Map.Felucca );
			point44.NextPoint = point45;
			point45.MoveToWorld( new Point3D(  2469, 483, 15  ), Map.Felucca );
			point45.NextPoint = point46;
			point46.MoveToWorld( new Point3D(  2469, 461, 15  ), Map.Felucca );
			point46.NextPoint = point47;
			point47.MoveToWorld( new Point3D(  2476, 461, 15  ), Map.Felucca );
			point47.NextPoint = point48;
			point48.MoveToWorld( new Point3D(  2476, 435, 15  ), Map.Felucca );
			point48.NextPoint = point49;
			point49.MoveToWorld( new Point3D(  2467, 435, 15  ), Map.Felucca );
			point49.NextPoint = point50;
			point50.MoveToWorld( new Point3D(  2467, 418, 15  ), Map.Felucca );
			point50.NextPoint = point51;
			point51.MoveToWorld( new Point3D(  2500, 419, 15  ), Map.Felucca );
			point51.NextPoint = point39;
			spawner3.Name = "MaginciaInvasionFelucca";
			spawner3.Respawn();

			Spawner spawner4 = new Spawner( 4, 5, 15, 0, 50, "Orc" );
			spawner4.MoveToWorld( new Point3D(  2598, 747, 0  ), Map.Felucca );
			spawner4.WayPoint = point52;
			point52.MoveToWorld( new Point3D(  2579, 690, 0  ), Map.Felucca );
			point52.NextPoint = point53;
			point53.MoveToWorld( new Point3D(  2561, 623, 0  ), Map.Felucca );
			point53.NextPoint = point54;
			point54.MoveToWorld( new Point3D(  2513, 620, 0  ), Map.Felucca );
			point54.NextPoint = point55;
			point55.MoveToWorld( new Point3D(  2517, 562, 0  ), Map.Felucca );
			point55.NextPoint = point56;
			point56.MoveToWorld( new Point3D(  2486, 564, 5  ), Map.Felucca );
			point56.NextPoint = point57;
			point57.MoveToWorld( new Point3D(  2486, 544, 0  ), Map.Felucca );
			point57.NextPoint = point58;
			point58.MoveToWorld( new Point3D(  2465, 543, 0  ), Map.Felucca );
			point58.NextPoint = point59;
			point59.MoveToWorld( new Point3D(  2465, 528, 15  ), Map.Felucca );
			point59.NextPoint = point60;
			point60.MoveToWorld( new Point3D(  2455, 528, 15  ), Map.Felucca );
			point60.NextPoint = point61;
			point61.MoveToWorld( new Point3D(  2455, 513, 15  ), Map.Felucca );
			point61.NextPoint = point62;
			point62.MoveToWorld( new Point3D(  2475, 513, 15  ), Map.Felucca );
			point62.NextPoint = point63;
			point63.MoveToWorld( new Point3D(  2475, 528, 15  ), Map.Felucca );
			point63.NextPoint = point60;
			spawner4.Name = "MaginciaInvasionFelucca";
			spawner4.Respawn();

			Spawner spawner5 = new Spawner( 6, 5, 15, 0, 4, "Orc" );
			spawner5.MoveToWorld( new Point3D(  2579, 376, 5  ), Map.Felucca );
			spawner5.WayPoint = point65;
			point64.MoveToWorld( new Point3D(  2579, 398, 15  ), Map.Felucca );
			point64.NextPoint = point65;
			point65.MoveToWorld( new Point3D(  2623, 437, 15  ), Map.Felucca );
			point65.NextPoint = point66;
			point66.MoveToWorld( new Point3D(  2617, 506, 15  ), Map.Felucca );
			point66.NextPoint = point67;
			point67.MoveToWorld( new Point3D(  2562, 513, 15  ), Map.Felucca );
			point67.NextPoint = point68;
			point68.MoveToWorld( new Point3D(  2551, 501, 15  ), Map.Felucca );
			point68.NextPoint = point69;
			point69.MoveToWorld( new Point3D(  2525, 501, 15  ), Map.Felucca );
			point69.NextPoint = point70;
			point70.MoveToWorld( new Point3D(  2525, 516, 0  ), Map.Felucca );
			point70.NextPoint = point71;
			point71.MoveToWorld( new Point3D(  2489, 516, 0  ), Map.Felucca );
			point71.NextPoint = point72;
			point72.MoveToWorld( new Point3D(  2489, 482, 15  ), Map.Felucca );
			point72.NextPoint = point73;
			point73.MoveToWorld( new Point3D(  2500, 484, 15  ), Map.Felucca );
			point73.NextPoint = point74;
			point74.MoveToWorld( new Point3D(  2500, 442, 15  ), Map.Felucca );
			point74.NextPoint = point75;
			point75.MoveToWorld( new Point3D(  2514, 442, 15  ), Map.Felucca );
			point75.NextPoint = point76;
			point76.MoveToWorld( new Point3D(  2514, 419, 15  ), Map.Felucca );
			point76.NextPoint = point77;
			point77.MoveToWorld( new Point3D(  2445, 419, 15  ), Map.Felucca );
			point77.NextPoint = point78;
			point78.MoveToWorld( new Point3D(  2444, 444, 15  ), Map.Felucca );
			point78.NextPoint = point79;
			point79.MoveToWorld( new Point3D(  2531, 444, 15  ), Map.Felucca );
			point79.NextPoint = point69;
			spawner5.Name = "MaginciaInvasionFelucca";
			spawner5.Respawn();

			Spawner spawner6 = new Spawner( 1, 5, 15, 0, 0, "OrcishLord" );
			spawner6.MoveToWorld( new Point3D(  2420, 420, 15  ), Map.Felucca );
			spawner6.WayPoint = point80;
			point80.MoveToWorld( new Point3D(  2489, 419, 15  ), Map.Felucca );
			point80.NextPoint = point81;
			point81.MoveToWorld( new Point3D(  2491, 442, 15  ), Map.Felucca );
			point81.NextPoint = point82;
			point82.MoveToWorld( new Point3D(  2476, 442, 15  ), Map.Felucca );
			point82.NextPoint = point83;
			point83.MoveToWorld( new Point3D(  2475, 460, 15  ), Map.Felucca );
			point83.NextPoint = point84;
			point84.MoveToWorld( new Point3D(  2467, 460, 15  ), Map.Felucca );
			point84.NextPoint = point85;
			point85.MoveToWorld( new Point3D(  2469, 481, 15  ), Map.Felucca );
			point85.NextPoint = point86;
			point86.MoveToWorld( new Point3D(  2491, 481, 15  ), Map.Felucca );
			point86.NextPoint = point87;
			point87.MoveToWorld( new Point3D(  2488, 564, 5  ), Map.Felucca );
			point87.NextPoint = point88;
			point88.MoveToWorld( new Point3D(  2514, 561, 0  ), Map.Felucca );
			point88.NextPoint = point89;
			point89.MoveToWorld( new Point3D(  2516, 529, 0  ), Map.Felucca );
			point89.NextPoint = point90;
			point90.MoveToWorld( new Point3D(  2489, 529, 0  ), Map.Felucca );
			point90.NextPoint = point91;
			point91.MoveToWorld( new Point3D(  2489, 493, 15  ), Map.Felucca );
			point91.NextPoint = point92;
			point92.MoveToWorld( new Point3D(  2504, 482, 15  ), Map.Felucca );
			point92.NextPoint = point80;
			spawner6.Name = "MaginciaInvasionFelucca";
			spawner6.Respawn();

			Spawner spawner7 = new Spawner( 1, 5, 15, 0, 0, "OrcCaptain" );
			spawner7.MoveToWorld( new Point3D(  1351, 1757, 17  ), Map.Felucca );
			spawner7.WayPoint = point93;
			point93.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point93.NextPoint = point94;
			point94.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point94.NextPoint = point95;
			point95.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point95.NextPoint = point96;
			point96.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point96.NextPoint = point97;
			point97.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point97.NextPoint = point98;
			point98.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point98.NextPoint = point99;
			point99.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point99.NextPoint = point100;
			point100.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point100.NextPoint = point101;
			point101.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point101.NextPoint = point102;
			point102.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point102.NextPoint = point103;
			spawner7.Name = "MaginciaInvasionFelucca";
			spawner7.Respawn();

			Spawner spawner8 = new Spawner( 1, 10, 20, 0, 10, "OrcBrute" );
			spawner8.MoveToWorld( new Point3D(  1370, 1749, 3  ), Map.Felucca );
			spawner8.WayPoint = point103;
			point103.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point103.NextPoint = point104;
			point104.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point104.NextPoint = point105;
			point105.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point105.NextPoint = point106;
			point106.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point106.NextPoint = point107;
			point107.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point107.NextPoint = point108;
			point108.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point108.NextPoint = point109;
			point109.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point109.NextPoint = point110;
			point110.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point110.NextPoint = point111;
			point111.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point111.NextPoint = point112;
			point112.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point112.NextPoint = point113;
			point113.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point113.NextPoint = point114;
			point114.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point114.NextPoint = point115;
			point115.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point125.NextPoint = point116;
			point116.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point116.NextPoint = point117;
			point117.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point117.NextPoint = point118;
			point118.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point118.NextPoint = point119;
			point119.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point119.NextPoint = point120;
			point120.MoveToWorld( new Point3D(  2491, 419, 15  ), Map.Felucca );
			point120.NextPoint = point103;
			spawner8.Name = "MaginciaInvasionFelucca";
			spawner8.Respawn();*/

                                           World.Broadcast( 33, true, "Magincia Felucca is under invasion." );
		               from.SendGump( new CityInvasion( from ) );
                                   	 break; 
                            }  
		case 2:
		{
			GuardedRegion reg = from.Region as GuardedRegion;

			if ( reg == null )
			{
				from.SendMessage( 33, "You are not in a The guarded part of Magincia, Felucca." );
				from.SendMessage( 33, "You will have to go there and use [toggleguarded to turn the guards on." );
			}
                                           else if ( !reg.Disabled )
                                           {
				from.SendMessage( 3, "The guards in THIS region have not changed." );
                                           }

                                           else if ( reg.Disabled )
                                           {
			              reg.Disabled = !reg.Disabled;
			              from.SendMessage( 3, "The guards in THIS region have been enabled." );
                                           }
                                           if ( DummyMessage && reg != null  )
                                          {
				from.SendMessage( 33, "If you are not in a The guarded part of Magincia, Felucca." );
				from.SendMessage( 33, "You will have to go there and use [toggleguarded to turn the guards on." );
                                           }
			              MaginciaInvasionStone maginciafel = new MaginciaInvasionStone();
			              maginciafel.StopMaginciaFelucca();
                                                        World.Broadcast( 33, true, "Magincia Felucca's invasion was successfully beaten back. No more invaders are left in the city." );
		                            from.SendGump( new CityInvasion( from ) );
                                   	              break; 
				}
			}
		}
Exemplo n.º 33
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 3:
				{
					m_SpawnRange = reader.ReadInt();
					m_SpawnID = reader.ReadInt();
					m_DeSpawn = reader.ReadInt();
					m_PlayerRangeSensitive = reader.ReadInt();
					m_SubCountA = reader.ReadInt();
					m_SubCountB = reader.ReadInt();
					m_SubCountC = reader.ReadInt();
					m_SubCountD = reader.ReadInt();
					m_SubCountE = reader.ReadInt();

					goto case 2;
				}
				case 2:
				{
					m_WayPoint = reader.ReadItem() as WayPoint;

					goto case 1;
				}
				case 1:
				{
					m_Group = reader.ReadBool();

					goto case 0;
				}
				case 0:
				{
					m_MinDelay = reader.ReadTimeSpan();
					m_MaxDelay = reader.ReadTimeSpan();
					m_Count = reader.ReadInt();
					m_Team = reader.ReadInt();
					m_HomeRange = reader.ReadInt();
					m_Running = reader.ReadBool();
					TimeSpan ts = TimeSpan.Zero;
					if ( m_Running )
						ts = reader.ReadDeltaTime() - DateTime.Now;
 
					int size = reader.ReadInt();
					m_CreaturesName = new ArrayList( size );
					for ( int i = 0; i < size; ++i )
					{
						string typeName = reader.ReadString();
						m_CreaturesName.Add( typeName );
						if ( SpawnerType.GetType( typeName ) == null )
						{
							if ( m_WarnTimer == null )
								m_WarnTimer = new WarnTimer();
							m_WarnTimer.Add( Location, Map, typeName );
						}
					}

					int sizeA = reader.ReadInt();
					m_SubSpawnerA = new ArrayList( sizeA );
					for ( int i = 0; i < sizeA; ++i )
					{
						string typeNameA = reader.ReadString();
						m_SubSpawnerA.Add( typeNameA );
						if ( SpawnerType.GetType( typeNameA ) == null )
						{
							if ( m_WarnTimer == null )
								m_WarnTimer = new WarnTimer();
							m_WarnTimer.Add( Location, Map, typeNameA );
						}
					}

					int sizeB = reader.ReadInt();
					m_SubSpawnerB = new ArrayList( sizeB );
					for ( int i = 0; i < sizeB; ++i )
					{
						string typeNameB = reader.ReadString();
						m_SubSpawnerB.Add( typeNameB );
						if ( SpawnerType.GetType( typeNameB ) == null )
						{
							if ( m_WarnTimer == null )
								m_WarnTimer = new WarnTimer();
							m_WarnTimer.Add( Location, Map, typeNameB );
						}
					}

					int sizeC = reader.ReadInt();
					m_SubSpawnerC = new ArrayList( sizeC );
					for ( int i = 0; i < sizeC; ++i )
					{
						string typeNameC = reader.ReadString();
						m_SubSpawnerC.Add( typeNameC );
						if ( SpawnerType.GetType( typeNameC ) == null )
						{
							if ( m_WarnTimer == null )
								m_WarnTimer = new WarnTimer();
							m_WarnTimer.Add( Location, Map, typeNameC );
						}
					}

					int sizeD = reader.ReadInt();
					m_SubSpawnerD = new ArrayList( sizeD );
					for ( int i = 0; i < sizeD; ++i )
					{
						string typeNameD = reader.ReadString();
						m_SubSpawnerD.Add( typeNameD );
						if ( SpawnerType.GetType( typeNameD ) == null )
						{
							if ( m_WarnTimer == null )
								m_WarnTimer = new WarnTimer();
							m_WarnTimer.Add( Location, Map, typeNameD );
						}
					}

					int sizeE = reader.ReadInt();
					m_SubSpawnerE = new ArrayList( sizeE );
					for ( int i = 0; i < sizeE; ++i )
					{
						string typeNameE = reader.ReadString();
						m_SubSpawnerE.Add( typeNameE );
						if ( SpawnerType.GetType( typeNameE ) == null )
						{
							if ( m_WarnTimer == null )
								m_WarnTimer = new WarnTimer();
							m_WarnTimer.Add( Location, Map, typeNameE );
						}
					}

					int count = reader.ReadInt();
					m_Creatures = new ArrayList( count );
					for ( int i = 0; i < count; ++i )
					{
						IEntity e = World.FindEntity( reader.ReadInt() );
						if ( e != null )
							m_Creatures.Add( e );
					}

					int countA = reader.ReadInt();
					m_SubCreaturesA = new ArrayList( countA );
					for ( int i = 0; i < countA; ++i )
					{
						IEntity eA = World.FindEntity( reader.ReadInt() );
						if ( eA != null )
							m_SubCreaturesA.Add( eA );
					}

					int countB = reader.ReadInt();
					m_SubCreaturesB = new ArrayList( countB );
					for ( int i = 0; i < countB; ++i )
					{
						IEntity eB = World.FindEntity( reader.ReadInt() );
						if ( eB != null )
							m_SubCreaturesB.Add( eB );
					}

					int countC = reader.ReadInt();
					m_SubCreaturesC = new ArrayList( countC );
					for ( int i = 0; i < countC; ++i )
					{
						IEntity eC = World.FindEntity( reader.ReadInt() );
						if ( eC != null )
							m_SubCreaturesC.Add( eC );
					}

					int countD = reader.ReadInt();
					m_SubCreaturesD = new ArrayList( countD );
					for ( int i = 0; i < countD; ++i )
					{
						IEntity eD = World.FindEntity( reader.ReadInt() );
						if ( eD != null )
						m_SubCreaturesD.Add( eD );
					}

					int countE = reader.ReadInt();
					m_SubCreaturesE = new ArrayList( countE );
					for ( int i = 0; i < countE; ++i )
					{
						IEntity eE = World.FindEntity( reader.ReadInt() );
						if ( eE != null )
						m_SubCreaturesE.Add( eE );
					}

					if ( m_Running )
						DoTimer( ts );

					break;
				}
			}

			m_SpawnRange = ( version <= 2 ? m_HomeRange : m_SpawnRange );
		}
Exemplo n.º 34
0
		public NextPointTarget( WayPoint pt ) : base( -1, false, TargetFlags.None )
		{
			m_Point = pt;
		}