Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.88 KB | None | 0 0
  1. using System;
  2. using Terraria;
  3. using Terraria.ID;
  4. using Expeditions;
  5.  
  6. namespace HuntingExpedition
  7. {
  8.     class CaptainCrew : ModExpedition
  9.     {
  10.         public override void SetDefaults()
  11.         {
  12.             expedition.name = "Storming the Ship";
  13.             SetNPCHead(NPCID.Pirate);
  14.             expedition.difficulty = 4;
  15.            
  16.             expedition.conditionDescriptionCountable = "Take over a pirate ship with less than 10 pirates left";
  17.             expedition.conditionCountedMax = 1;
  18.             expedition.ctgSlay = true;
  19.         }
  20.         public override void AddItemsOnLoad()
  21.         {
  22.             AddRewardItem(ItemID.LuckyCoin, 1);
  23.             AddRewardItem(ItemID.Cutlass, 1);
  24.             AddRewardItem(ItemID.PirateStaff, 1);
  25.             AddRewardItem(ItemID.GoldCoin, 23);
  26.         }
  27.         public override string Description(bool complete)
  28.         {
  29.             return "Yarr, lassey! I know me crew had a stash o treasures b'fore I was sent off the plank! Time to get back our due from these lard brained gobshytes!";
  30.         }
  31.         public override void OnKillNPC(NPC npc, Player player, ref bool cond1, ref bool cond2, ref bool cond3, bool condCount)
  32.         {
  33.             int npcCount = 0;
  34.             for(int i = 0; i < 200; i++)
  35.             {
  36.                NPC npcType = Main.npc[i];
  37.                if (npcType.type == 212 || npcType.type == 213 || npcType.type == 214 || npcType.type == 215 || npcType.type == 216)
  38.                {
  39.                    npcCount++;
  40.                }
  41.             }
  42.             if(npc.type == NPCID.PirateShip && npcCount <= 10)
  43.             {
  44.                 expedition.conditionCounted += 1;
  45.             }
  46.         }
  47.         public override bool CheckPrerequisites(Player player, ref bool cond1, ref bool cond2, ref bool cond3, bool condCount)
  48.         {
  49.             if(Main.invasionSize > 0 && Main.invasionType == 3)
  50.             {
  51.                 return NPC.FindFirstNPC(NPCID.Pirate) >= 0 ;
  52.             }
  53.             else if(expedition.conditionCounted > 0)
  54.             {
  55.                 return NPC.FindFirstNPC(NPCID.Pirate) >= 0;
  56.             }
  57.             return false;
  58.         }
  59.     }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement