Advertisement
Guest User

My boss

a guest
Aug 24th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.22 KB | None | 0 0
  1. using Microsoft.Xna.Framework;
  2. using Terraria;
  3. using Terraria.ID;
  4. using Terraria.ModLoader;
  5. using DarkSouls;
  6. namespace DarkSouls.NPCs.Enemies
  7. {
  8.  
  9. public class AbysmalOolacileSorcerer : ModNPC
  10. {
  11. public int basicsoul;
  12. static int count;
  13. float customAi5;
  14. float customspawn1;
  15. float customspawn2;
  16. float customspawn3;
  17.  
  18.  
  19. public override void SetStaticDefaults()
  20. {
  21. DisplayName.SetDefault("Abysmal Oolacile Sorcerer");
  22. Main.npcFrameCount[npc.type] = 3;
  23. }
  24.  
  25.  
  26.  
  27.  
  28.  
  29. public override void SetDefaults()
  30. {
  31. npc.lifeMax = 56800;
  32. npc.damage = 96;
  33. npc.defense = 157;
  34. npc.knockBackResist = 0.3f;
  35. npc.width = 28;
  36. npc.height = 44;
  37. npc.aiStyle = 8;
  38. animationType = 29;
  39. npc.npcSlots = 180;
  40. npc.HitSound = SoundID.NPCHit1;
  41. npc.DeathSound = SoundID.NPCDeath6;
  42. npc.value = 370000;
  43. npc.boss = true;
  44. npc.timeLeft = 22500;
  45. }
  46.  
  47.  
  48.  
  49.  
  50. public override void AI()
  51. {
  52. if (Main.netMode != 1)
  53. {
  54. customAi5 += (Main.rand.Next(2, 5) * 0.1f) * npc.scale;
  55. if (customAi5 >= 10f)
  56. {
  57.  
  58. if ((customspawn1 < 30) && Main.rand.Next(130)==1)
  59. {
  60. int Spawned = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("ArmoredWraith"), 0, npc.whoAmI, 0, 200);
  61. Main.npc[Spawned].velocity.Y = -8;
  62. Main.npc[Spawned].velocity.X = Main.rand.Next(-10,10)/10;
  63. //npc.ai[5] = 20-Main.rand.Next(80);
  64. customspawn1 += 1f;
  65.  
  66. }
  67. if ((customspawn2 < 1) && Main.rand.Next(3500)==1)
  68. {
  69. int Spawned = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("ArmoredWraith"), 0, npc.whoAmI, 0, 200);
  70. Main.npc[Spawned].velocity.Y = -8;
  71. Main.npc[Spawned].velocity.X = Main.rand.Next(-10,10)/10;
  72. //npc.ai[5] = 20-Main.rand.Next(80);
  73. customspawn2 += 1f;
  74.  
  75. }
  76.  
  77.  
  78.  
  79. if ((customspawn3 < 1) && Main.rand.Next(2050)==1)
  80. {
  81. int Spawned = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("ArmoredWraith"), 0, npc.whoAmI, 0, 200);
  82. Main.npc[Spawned].velocity.Y = -8;
  83. Main.npc[Spawned].velocity.X = Main.rand.Next(-10,10)/10;
  84. //npc.ai[5] = 20-Main.rand.Next(80);
  85. customspawn3 += 1f;
  86.  
  87. }
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94. }
  95.  
  96. }
  97. }
  98. public override void HitEffect(int hitDirection, double damage)
  99. {
  100.  
  101. }
  102.  
  103. public override float SpawnChance(NPCSpawnInfo spawnInfo)
  104. {
  105. int x = spawnInfo.spawnTileX;
  106. int y = spawnInfo.spawnTileY;
  107. int tile = Main.tile[x, y].type;
  108. return Main.hardMode && NPC.downedMoonlord && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.1f : 0f;
  109. }
  110. public override void NPCLoot()
  111. {
  112.  
  113. if (Main.netMode != 1)
  114. {
  115. if (Main.expertMode)
  116. {
  117. basicsoul = 2;
  118. }
  119. else
  120. {
  121. basicsoul = 1;
  122. }
  123. count = basicsoul * 5000;
  124.  
  125. Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DarkSoul"), count);
  126.  
  127. }
  128. DarkSoulsWorld.downedTutorialBoss = true;
  129. }
  130.  
  131. }
  132. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement