Use to check if a mechanism is allowed to spawn an NPC of the provided type at the provided world coordinates. Checks nearby area to see if the Spawn Limitshave been reached.
2380 {
2381
2382
2386 Vector2
vector =
default(Vector2);
2387 for (int i = 0; i < 200; i++)
2388 {
2389 if (!Main.npc[i].active)
2390 {
2391 continue;
2392 }
2394 if (Main.npc[i].type ==
type)
2395 {
2397 }
2399 {
2400 if (Main.npc[i].type == 74 || Main.npc[i].type == 297 || Main.npc[i].type == 298)
2401 {
2403 }
2404 }
2406 {
2407 if (Main.npc[i].type == 46 || Main.npc[i].type == 540 || Main.npc[i].type == 303 || Main.npc[i].type == 337)
2408 {
2410 }
2411 }
2412 else if (
type == 362 ||
type == 364)
2413 {
2414 if (Main.npc[i].type == 362 || Main.npc[i].type == 363 || Main.npc[i].type == 364 || Main.npc[i].type == 365)
2415 {
2417 }
2418 }
2419 else if (
type == 602)
2420 {
2421 if (Main.npc[i].type == 602 || Main.npc[i].type == 603)
2422 {
2424 }
2425 }
2426 else if (
type == 608)
2427 {
2428 if (Main.npc[i].type == 608 || Main.npc[i].type == 609)
2429 {
2431 }
2432 }
2433 else if (
type == 616 ||
type == 617)
2434 {
2435 if (Main.npc[i].type == 616 || Main.npc[i].type == 617)
2436 {
2438 }
2439 }
2440 else if (
type == 55 && Main.npc[i].type == 230)
2441 {
2443 }
2445 {
2447 }
2449 {
2452 float num5 = Main.npc[i].position.X -
vector.X;
2453 float num4 = Main.npc[i].position.Y -
vector.Y;
2456 {
2458 }
2460 {
2462 }
2463 }
2464 }
2466 {
2467 return false;
2468 }
2469 return true;
2470 }
static bool[] IsDragonfly
If true for a given NPC type (F:Terraria.NPC.type), then that NPC is categorized as a dragonfly....
int type
The NPC ID of this NPC. The NPC ID is a unique number assigned to each NPC loaded into the game....