Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using Terraria;
- using Terraria.ID;
- using Expeditions;
- namespace HuntingExpedition
- {
- class CaptainCrew : ModExpedition
- {
- public override void SetDefaults()
- {
- expedition.name = "Storming the Ship";
- SetNPCHead(NPCID.Pirate);
- expedition.difficulty = 4;
- expedition.conditionDescriptionCountable = "Take over a pirate ship with less than 10 pirates left";
- expedition.conditionCountedMax = 1;
- expedition.ctgSlay = true;
- }
- public override void AddItemsOnLoad()
- {
- AddRewardItem(ItemID.LuckyCoin, 1);
- AddRewardItem(ItemID.Cutlass, 1);
- AddRewardItem(ItemID.PirateStaff, 1);
- AddRewardItem(ItemID.GoldCoin, 23);
- }
- public override string Description(bool complete)
- {
- 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!";
- }
- public override void OnKillNPC(NPC npc, Player player, ref bool cond1, ref bool cond2, ref bool cond3, bool condCount)
- {
- int npcCount = 0;
- for(int i = 0; i < 200; i++)
- {
- NPC npcType = Main.npc[i];
- if (npcType.type == 212 || npcType.type == 213 || npcType.type == 214 || npcType.type == 215 || npcType.type == 216)
- {
- npcCount++;
- }
- }
- if(npc.type == NPCID.PirateShip && npcCount <= 10)
- {
- expedition.conditionCounted += 1;
- }
- }
- public override bool CheckPrerequisites(Player player, ref bool cond1, ref bool cond2, ref bool cond3, bool condCount)
- {
- if(Main.invasionSize > 0 && Main.invasionType == 3)
- {
- return NPC.FindFirstNPC(NPCID.Pirate) >= 0 ;
- }
- else if(expedition.conditionCounted > 0)
- {
- return NPC.FindFirstNPC(NPCID.Pirate) >= 0;
- }
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement