Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ StatusFromNPC()

void Terraria.Player.StatusFromNPC ( NPC npc)
inline

Definition at line 21364 of file Player.cs.

21365 {
21366 if (Main.expertMode && ((npc.type == 266 && Main.rand.Next(3) == 0) || npc.type == 267))
21367 {
21368 int num = Main.rand.Next(9);
21369 if (num == 2 || num == 4)
21370 {
21371 num = Main.rand.Next(9);
21372 }
21373 float num2 = (float)Main.rand.Next(75, 150) * 0.01f;
21374 switch (num)
21375 {
21376 case 0:
21377 AddBuff(20, (int)(60f * num2 * 3.5f));
21378 break;
21379 case 1:
21380 AddBuff(22, (int)(60f * num2 * 2f));
21381 break;
21382 case 2:
21383 AddBuff(23, (int)(60f * num2 * 0.5f));
21384 break;
21385 case 3:
21386 AddBuff(30, (int)(60f * num2 * 5f));
21387 break;
21388 case 4:
21389 AddBuff(31, (int)(60f * num2 * 1f));
21390 break;
21391 case 5:
21392 AddBuff(32, (int)(60f * num2 * 3.5f));
21393 break;
21394 case 6:
21395 AddBuff(33, (int)(60f * num2 * 7.5f));
21396 break;
21397 case 7:
21398 AddBuff(35, (int)(60f * num2 * 1f));
21399 break;
21400 case 8:
21401 AddBuff(36, (int)((double)(60f * num2) * 6.5));
21402 break;
21403 }
21404 }
21405 if (npc.type == 530 || npc.type == 531)
21406 {
21407 AddBuff(70, Main.rand.Next(240, 241));
21408 }
21409 if (npc.type == 159 || npc.type == 158)
21410 {
21411 AddBuff(30, Main.rand.Next(300, 600));
21412 }
21413 if (npc.type == 525)
21414 {
21415 AddBuff(39, 240);
21416 }
21417 if (npc.type == 526)
21418 {
21419 AddBuff(69, 420);
21420 }
21421 if (npc.type == 527)
21422 {
21423 AddBuff(31, 840);
21424 }
21425 if (Main.expertMode && (npc.type == 49 || npc.type == 93 || npc.type == 51 || npc.type == 152 || npc.type == 634) && Main.rand.Next(10) == 0)
21426 {
21427 AddBuff(148, Main.rand.Next(1800, 5400));
21428 }
21429 if (Main.expertMode && npc.type == 222)
21430 {
21431 AddBuff(20, Main.rand.Next(60, 240));
21432 }
21433 if (Main.expertMode && (npc.type == 210 || npc.type == 211))
21434 {
21435 AddBuff(20, Main.rand.Next(60, 180));
21436 }
21437 if (Main.expertMode && npc.type == 35)
21438 {
21439 AddBuff(30, Main.rand.Next(180, 300));
21440 }
21441 if (Main.expertMode && npc.type == 36 && Main.rand.Next(2) == 0)
21442 {
21443 AddBuff(32, Main.rand.Next(30, 60));
21444 }
21445 if (npc.type >= 269 && npc.type <= 272)
21446 {
21447 if (Main.rand.Next(3) == 0)
21448 {
21449 AddBuff(30, 600);
21450 }
21451 else if (Main.rand.Next(3) == 0)
21452 {
21453 AddBuff(32, 300);
21454 }
21455 }
21456 if (npc.type >= 273 && npc.type <= 276 && Main.rand.Next(2) == 0)
21457 {
21458 AddBuff(36, 600);
21459 }
21460 if (npc.type >= 277 && npc.type <= 280)
21461 {
21462 AddBuff(24, 600);
21463 }
21464 if (npc.type == 371)
21465 {
21466 AddBuff(103, 60 * Main.rand.Next(3, 8));
21467 }
21468 if (npc.type == 370 && Main.expertMode)
21469 {
21470 int num3 = Utils.SelectRandom<int>(Main.rand, 0, 148, 30);
21471 if (num3 != 0)
21472 {
21473 AddBuff(num3, 60 * Main.rand.Next(3, 11));
21474 }
21475 }
21476 if (((npc.type == 1 && npc.netID == -6) || npc.type == 81 || npc.type == 79 || npc.type == 183 || npc.type == 630) && Main.rand.Next(4) == 0)
21477 {
21478 AddBuff(22, 900);
21479 }
21480 if ((npc.type == 23 || npc.type == 25) && Main.rand.Next(3) == 0)
21481 {
21482 AddBuff(24, 420);
21483 }
21484 if ((npc.type == 34 || npc.type == 83 || npc.type == 84 || npc.type == 179 || npc.type == 289) && Main.rand.Next(3) == 0)
21485 {
21486 AddBuff(23, 240);
21487 }
21488 if ((npc.type == 104 || npc.type == 102) && Main.rand.Next(8) == 0)
21489 {
21490 AddBuff(30, 2700);
21491 }
21492 if (npc.type == 75 && Main.rand.Next(10) == 0)
21493 {
21494 AddBuff(35, 420);
21495 }
21496 if ((npc.type == 163 || npc.type == 238 || npc.type == 236 || npc.type == 237) && Main.rand.Next(10) == 0)
21497 {
21498 AddBuff(70, 240);
21499 }
21500 if ((npc.type == 79 || npc.type == 103 || npc.type == 630) && Main.rand.Next(5) == 0)
21501 {
21502 AddBuff(35, 420);
21503 }
21504 if ((npc.type == 75 || npc.type == 78 || npc.type == 82) && Main.rand.Next(8) == 0)
21505 {
21506 AddBuff(32, 900);
21507 }
21508 if ((npc.type == 93 || npc.type == 109 || npc.type == 80) && Main.rand.Next(14) == 0)
21509 {
21510 AddBuff(31, 300);
21511 }
21512 if (npc.type >= 305 && npc.type <= 314 && Main.rand.Next(10) == 0)
21513 {
21514 AddBuff(33, 3600);
21515 }
21516 if (npc.type == 77 && Main.rand.Next(6) == 0)
21517 {
21518 AddBuff(36, 7200);
21519 }
21520 if (npc.type == 112 && Main.rand.Next(20) == 0)
21521 {
21522 AddBuff(33, 18000);
21523 }
21524 if (npc.type == 182 && Main.rand.Next(25) == 0)
21525 {
21526 AddBuff(33, 7200);
21527 }
21528 if (npc.type == 141 && Main.rand.Next(2) == 0)
21529 {
21530 AddBuff(20, 600);
21531 }
21532 if (npc.type == 147 && !frozen && Main.rand.Next(12) == 0)
21533 {
21534 AddBuff(46, 600);
21535 }
21536 if (npc.type == 150)
21537 {
21538 if (Main.rand.Next(2) == 0)
21539 {
21540 AddBuff(46, 900);
21541 }
21542 if (!frozen && Main.rand.Next(35) == 0)
21543 {
21544 AddBuff(47, 60);
21545 }
21546 else if (!frozen && Main.expertMode && Main.rand.Next(35) == 0)
21547 {
21548 AddBuff(47, 60);
21549 }
21550 }
21551 if (npc.type == 184)
21552 {
21553 AddBuff(46, 1200);
21554 if (!frozen && Main.rand.Next(15) == 0)
21555 {
21556 AddBuff(47, 60);
21557 }
21558 else if (!frozen && Main.expertMode && Main.rand.Next(25) == 0)
21559 {
21560 AddBuff(47, 60);
21561 }
21562 }
21563 }
void AddBuff(int type, int timeToAdd, bool quiet=true, bool foodHack=false)
Definition Player.cs:4441

References Terraria.Main.expertMode, Terraria.NPC.netID, Terraria.Main.rand, and Terraria.NPC.type.