コード例 #1
0
ファイル: WaypointEntry.cs プロジェクト: ray2006/WCell
		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;
		}