예제 #1
0
		public void FinalizeDataHolder()
		{
			SpawnEntry = NPCMgr.GetSpawnEntry(SpawnId);
			if (SpawnEntry == null)
			{
				ContentHandler.OnInvalidDBData("{0} had an invalid SpawnId.", this);
			}
			else
			{
				var added = false;
				var cur = SpawnEntry.Waypoints.First;
				while (cur != null)
				{
					if (cur.Value.Id > Id)
					{
						Node = cur.List.AddBefore(cur, this);
						added = true;
						break;
					}
					else if (cur.Value.Id == Id)
					{
						ContentHandler.OnInvalidDBData("Found multiple Waypoints with the same Id {0} for SpawnEntry {1}", Id, SpawnEntry);
						return;
					}
					cur = cur.Next;
				}

				if (!added)
				{
					SpawnEntry.HasDefaultWaypoints = false;
					Node = SpawnEntry.Waypoints.AddLast(this);
				}
			}
		}
예제 #2
0
파일: SpawnPoint.cs 프로젝트: ray2006/WCell
		public SpawnPoint(SpawnEntry entry, Region region)
		{
			m_spawns = new List<Unit>();
			m_timer = new TimerEntry { Action = Spawn };
			m_timer.Stop();
			Region = region;
			SpawnEntry = entry;
		}
예제 #3
0
파일: NPCs.cs 프로젝트: ray2006/WCell
		public static void CreateTeleportNPC(NPCId id, Vector3 location, MapId regionId)
		{
			var spawn = new SpawnEntry
			{
				EntryId = id
			};
			spawn.FinalizeDataHolder();

			spawn.Spawned += npc =>
			{
				npc.Invulnerable++;
				npc.GossipMenu = WorldLocationMgr.CreateTeleMenu();
			};
		}
예제 #4
0
파일: NPCEntry.cs 프로젝트: WCellFR/WCellFR
		/// <summary>
		/// Creates but doesn't add the SpawnEntry
		/// </summary>
		public SpawnEntry CreateSpawnEntry(Vector3 location, int amount, int minRespawnSeconds, int maxRespawnSeconds, bool autoSpawn)
		{
			var entry = new SpawnEntry
			{
				EntryId = NPCId,
				Entry = this,
				MaxAmount = amount,
				RespawnSecondsMin = minRespawnSeconds,
				RespawnSecondsMax = maxRespawnSeconds,
				AutoSpawn = autoSpawn
			};

			entry.FinalizeDataHolder();
			return entry;
		}