User:Ferretwings/Quest fish

For those who may be interested in where the location data is taken from, this is found in Terraria 1.4.4.9 Projectile.cs   public void FishingCheck { ...     if (fisher.waterTilesCount < 75) // 75 tiles of water (minimum) needed, or nothing, not even trash, will be caught {       Main.player[this.owner].displayedFishingInfo = Language.GetTextValue("GameUI.NotEnoughWater"); }     else {       fisher.playerFishingConditions = Main.player[this.owner].GetFishingConditions; if (fisher.playerFishingConditions.BaitItemType == 2673) //if the bait is Truffle Worm, then Duke Fishron will be summoned {         ...        }        else {         // calculate fishing power // calculate water quality // factor in luck // determine bobber height level fisher.heightLevel = 0; if (Main.remixWorld) {           fisher.heightLevel = (double) fisher.Y >= Main.worldSurface * 0.5 ? ((double) fisher.Y >= Main.worldSurface ? ((double) fisher.Y >= Main.rockLayer ? (fisher.Y >= Main.maxTilesY - 300 ? 4 : 2) : 3) : 1) : 0; if (fisher.heightLevel == 2 && Main.rand.Next(2) == 0) fisher.heightLevel = 1; }         else fisher.heightLevel = (double) fisher.Y >= Main.worldSurface * 0.5 ? ((double) fisher.Y >= Main.worldSurface ? ((double) fisher.Y >= Main.rockLayer ? (fisher.Y >= Main.maxTilesY - 300 ? 4 : 3) : 2) : 1) : 0; // the exact height (as measured on a Depth Meter) would depend on the size of the world (small, medium, large) // sky/space = upper 50% of the world above 0 depth // surface = lower 50% of the world above 0 depth // underground = between 0 depth and Main.rockLayer // cavern = between Main.rockLayer and the bottom 300 tiles // hell = the bottom 300 tiles

this.FishingCheck_RollDropLevels(fisher.fishingLevel, out fisher.common, out fisher.uncommon, out fisher.rare, out fisher.veryrare, out fisher.legendary, out fisher.crate); this.FishingCheck_ProbeForQuestFish(ref fisher); // check if quest fish can be fished for this.FishingCheck_RollEnemySpawns(ref fisher);  // check for enemy spawns this.FishingCheck_RollItemDrop(ref fisher);     // determine what is actually caught bool flag = false; if (fisher.rolledItemDrop > 0) {           if (Main.player[this.owner].sonarPotion) {             Item newItem = new Item; newItem.SetDefaults(fisher.rolledItemDrop); newItem.position = this.position; PopupText.AssignAsSonarText(PopupText.NewText(PopupTextContext.SonarAlert, newItem, 1, true, false)); }           float fishingLevel = (float) fisher.fishingLevel; this.ai[1] = (float) Main.rand.Next(-240, -90) - fishingLevel; this.localAI[1] = (float) fisher.rolledItemDrop; this.netUpdate = true; flag = true; }         if (fisher.rolledEnemySpawn > 0)

private void FishingCheck_RollItemDrop(ref FishingAttempt fisher) {     bool flag1 = Main.player[this.owner].ZoneCorrupt; bool flag2 = Main.player[this.owner].ZoneCrimson; bool flag3 = Main.player[this.owner].ZoneJungle; bool flag4 = Main.player[this.owner].ZoneSnow; bool flag5 = Main.player[this.owner].ZoneDungeon; if (!NPC.downedBoss3) flag5 = false; if (Main.notTheBeesWorld && !Main.remixWorld && Main.rand.Next(2) == 0) flag3 = false; if (Main.remixWorld && fisher.heightLevel == 0) {       flag1 = false; flag2 = false; }     else if (flag1 & flag2) // if the world has both Corruption & Crimson {       if (Main.rand.Next(2) == 0) // select Corruption or Crimson - not both flag2 = false; else flag1 = false; }     if (fisher.rolledEnemySpawn > 0) // enemy spawned, nothing caught return; if (fisher.inLava) {       if (!fisher.CanFishInLava) return; if (fisher.crate && Main.rand.Next(6) == 0) // 1/6 chance for Obsidian/Hellstone Crate fisher.rolledItemDrop = Main.hardMode ? 4878 : 4877;       else if (fisher.legendary && Main.hardMode && Main.rand.Next(3) == 0) // 1/3 chance that one of the 4 will be caught fisher.rolledItemDrop = (int) Main.rand.NextFromList (new short[4]         {            (short) 4819, //Demon Conch            (short) 4820, //Bottomless Lava Bucket            (short) 4872, //Lava Absorbant Sponge            (short) 2331  //Obsidian Swordfish          }); else if (fisher.legendary && !Main.hardMode && Main.rand.Next(3) == 0) // 1/3 chance that one of the 3 will be caught fisher.rolledItemDrop = (int) Main.rand.NextFromList (new short[3]         {            (short) 4819, //Demon Conch            (short) 4820, //Bottomless Lava Bucket            (short) 4872  //Lava Absorbant Sponge          }); else if (fisher.veryrare) {         fisher.rolledItemDrop = 2312; //Flarefin Koi }       else {         if (!fisher.rare) return; fisher.rolledItemDrop = 2315; //Obsidifish }     }      else if (fisher.inHoney) {       if (fisher.rare || fisher.uncommon && Main.rand.Next(2) == 0) {         fisher.rolledItemDrop = 2314; //Honeyfin }       else {         if (!fisher.uncommon || fisher.questFish != 2451) return; fisher.rolledItemDrop = 2451; //Bumblebee Tuna }     }      else if (Main.rand.Next(50) > fisher.fishingLevel && Main.rand.Next(50) > fisher.fishingLevel && fisher.waterTilesCount < fisher.waterNeededToFish) {       fisher.rolledItemDrop = Main.rand.Next(2337, 2340); if (Main.rand.Next(8) != 0) return; fisher.rolledItemDrop = 5275; }     else if (fisher.crate) {       bool hardMode = Main.hardMode; if (fisher.rare & flag5) fisher.rolledItemDrop = hardMode ? 3984 : 3205;       else if (fisher.rare && (Main.player[this.owner].ZoneBeach || Main.remixWorld && fisher.heightLevel == 1 && ((double) fisher.Y >= Main.rockLayer && Main.rand.Next(2) == 0))) fisher.rolledItemDrop = hardMode ? 5003 : 5002;       else if (fisher.rare & flag1) fisher.rolledItemDrop = hardMode ? 3982 : 3203;       else if (fisher.rare & flag2) fisher.rolledItemDrop = hardMode ? 3983 : 3204;       else if (fisher.rare && Main.player[this.owner].ZoneHallow) fisher.rolledItemDrop = hardMode ? 3986 : 3207;       else if (fisher.rare & flag3) fisher.rolledItemDrop = hardMode ? 3987 : 3208;       else if (fisher.rare && Main.player[this.owner].ZoneSnow) fisher.rolledItemDrop = hardMode ? 4406 : 4405;       else if (fisher.rare && Main.player[this.owner].ZoneDesert) fisher.rolledItemDrop = hardMode ? 4408 : 4407;       else if (fisher.rare && fisher.heightLevel == 0) fisher.rolledItemDrop = hardMode ? 3985 : 3206;       else if (fisher.veryrare || fisher.legendary) fisher.rolledItemDrop = hardMode ? 3981 : 2336;       else if (fisher.uncommon) fisher.rolledItemDrop = hardMode ? 3980 : 2335;       else fisher.rolledItemDrop = hardMode ? 3979 : 2334;     }      else if (!NPC.combatBookWasUsed && Main.bloodMoon && (fisher.legendary && Main.rand.Next(3) == 0)) fisher.rolledItemDrop = 4382; else if (Main.bloodMoon && fisher.legendary && Main.rand.Next(2) == 0) fisher.rolledItemDrop = 5240; else if (fisher.legendary && Main.rand.Next(5) == 0) fisher.rolledItemDrop = 2423; else if (fisher.legendary && Main.rand.Next(5) == 0) fisher.rolledItemDrop = 3225; else if (fisher.legendary && Main.rand.Next(10) == 0) fisher.rolledItemDrop = 2420; else if (!fisher.legendary && !fisher.veryrare && (fisher.uncommon && Main.rand.Next(5) == 0)) {       fisher.rolledItemDrop = 3196; }     else {       bool flag6 = Main.player[this.owner].ZoneDesert; if (flag5) {         flag6 = false; if (fisher.rolledItemDrop == 0 && fisher.veryrare && Main.rand.Next(7) == 0) fisher.rolledItemDrop = 3000; }       else {         if (flag1) {           if (fisher.legendary && Main.hardMode && (Main.player[this.owner].ZoneSnow && fisher.heightLevel == 3) && Main.rand.Next(3) != 0) fisher.rolledItemDrop = 2429; else if (fisher.legendary && Main.hardMode && Main.rand.Next(2) == 0) fisher.rolledItemDrop = 3210; else if (fisher.rare) fisher.rolledItemDrop = 2330; else if (fisher.uncommon && fisher.questFish == 2454) fisher.rolledItemDrop = 2454; else if (fisher.uncommon && fisher.questFish == 2485) fisher.rolledItemDrop = 2485; else if (fisher.uncommon && fisher.questFish == 2457) fisher.rolledItemDrop = 2457; else if (fisher.uncommon) fisher.rolledItemDrop = 2318; }         else if (flag2) {           if (fisher.legendary && Main.hardMode && (Main.player[this.owner].ZoneSnow && fisher.heightLevel == 3) && Main.rand.Next(3) != 0) fisher.rolledItemDrop = 2429; else if (fisher.legendary && Main.hardMode && Main.rand.Next(2) == 0) fisher.rolledItemDrop = 3211; else if (fisher.uncommon && fisher.questFish == 2477) fisher.rolledItemDrop = 2477; else if (fisher.uncommon && fisher.questFish == 2463) fisher.rolledItemDrop = 2463; else if (fisher.uncommon) fisher.rolledItemDrop = 2319; else if (fisher.common) fisher.rolledItemDrop = 2305; }         else if (Main.player[this.owner].ZoneHallow) {           if (flag6 && Main.rand.Next(2) == 0) fisher.rolledItemDrop = !fisher.uncommon || fisher.questFish != 4393 ? (!fisher.uncommon || fisher.questFish != 4394 ? (!fisher.uncommon ? (Main.rand.Next(3) != 0 ? 4401 : 4402) : 4410) : 4394) : 4393; else if (fisher.legendary && Main.hardMode && (Main.player[this.owner].ZoneSnow && fisher.heightLevel == 3) && Main.rand.Next(3) != 0) fisher.rolledItemDrop = 2429; else if (fisher.legendary && Main.hardMode && Main.rand.Next(2) == 0) fisher.rolledItemDrop = 3209; else if (fisher.legendary && Main.hardMode && Main.rand.Next(3) != 0) fisher.rolledItemDrop = 5274; else if (fisher.heightLevel > 1 && fisher.veryrare) fisher.rolledItemDrop = 2317; else if (fisher.heightLevel > 1 && fisher.uncommon && fisher.questFish == 2465) fisher.rolledItemDrop = 2465; else if (fisher.heightLevel < 2 && fisher.uncommon && fisher.questFish == 2468) fisher.rolledItemDrop = 2468; else if (fisher.rare) fisher.rolledItemDrop = 2310; else if (fisher.uncommon && fisher.questFish == 2471) fisher.rolledItemDrop = 2471; else if (fisher.uncommon) fisher.rolledItemDrop = 2307; }         if (fisher.rolledItemDrop == 0 && Main.player[this.owner].ZoneGlowshroom && (fisher.uncommon && fisher.questFish == 2475)) fisher.rolledItemDrop = 2475; if (flag4 & flag3 && Main.rand.Next(2) == 0) flag4 = false; if (fisher.rolledItemDrop == 0 & flag4) {           if (fisher.heightLevel < 2 && fisher.uncommon && fisher.questFish == 2467) fisher.rolledItemDrop = 2467; else if (fisher.heightLevel == 1 && fisher.uncommon && fisher.questFish == 2470) fisher.rolledItemDrop = 2470; else if (fisher.heightLevel >= 2 && fisher.uncommon && fisher.questFish == 2484) fisher.rolledItemDrop = 2484; else if (fisher.heightLevel > 1 && fisher.uncommon && fisher.questFish == 2466) fisher.rolledItemDrop = 2466; else if (fisher.common && Main.rand.Next(12) == 0 || fisher.uncommon && Main.rand.Next(6) == 0) fisher.rolledItemDrop = 3197; else if (fisher.uncommon) fisher.rolledItemDrop = 2306; else if (fisher.common) fisher.rolledItemDrop = 2299; else if (fisher.heightLevel > 1 && Main.rand.Next(3) == 0) fisher.rolledItemDrop = 2309; }         if (fisher.rolledItemDrop == 0 & flag3) {           if (fisher.heightLevel == 1 && fisher.uncommon && fisher.questFish == 2452) fisher.rolledItemDrop = 2452; else if (fisher.heightLevel == 1 && fisher.uncommon && fisher.questFish == 2483) fisher.rolledItemDrop = 2483; else if (fisher.heightLevel == 1 && fisher.uncommon && fisher.questFish == 2488) fisher.rolledItemDrop = 2488; else if (fisher.heightLevel >= 1 && fisher.uncommon && fisher.questFish == 2486) fisher.rolledItemDrop = 2486; else if (fisher.heightLevel > 1 && fisher.uncommon) fisher.rolledItemDrop = 2311; else if (fisher.uncommon) fisher.rolledItemDrop = 2313; else if (fisher.common) fisher.rolledItemDrop = 2302; }       }        if (fisher.rolledItemDrop == 0) {         if (Main.remixWorld && fisher.heightLevel == 1 && ((double) fisher.Y >= Main.rockLayer && Main.rand.Next(3) == 0) || fisher.heightLevel <= 1 && (fisher.X < 380 || fisher.X > Main.maxTilesX - 380) && fisher.waterTilesCount > 1000) fisher.rolledItemDrop = !fisher.veryrare || Main.rand.Next(2) != 0 ? (!fisher.veryrare ? (!fisher.rare || Main.rand.Next(5) != 0 ? (!fisher.rare || Main.rand.Next(3) != 0 ? (!fisher.uncommon || fisher.questFish != 2480 ? (!fisher.uncommon || fisher.questFish != 2481 ? (!fisher.uncommon ? (!fisher.common || Main.rand.Next(2) != 0 ? (!fisher.common ? 2297 : 2300) : 2301) : 2316) : 2481) : 2480) : 2332) : 2438) : 2342) : 2341;         else if (flag6) fisher.rolledItemDrop = !fisher.uncommon || fisher.questFish != 4393 ? (!fisher.uncommon || fisher.questFish != 4394 ? (!fisher.uncommon ? (Main.rand.Next(3) != 0 ? 4401 : 4402) : 4410) : 4394) : 4393; }       if (fisher.rolledItemDrop != 0) return; if (fisher.heightLevel < 2 && fisher.uncommon && fisher.questFish == 2461) fisher.rolledItemDrop = 2461; else if (fisher.heightLevel == 0 && fisher.uncommon && fisher.questFish == 2453) fisher.rolledItemDrop = 2453; else if (fisher.heightLevel == 0 && fisher.uncommon && fisher.questFish == 2473) fisher.rolledItemDrop = 2473; else if (fisher.heightLevel == 0 && fisher.uncommon && fisher.questFish == 2476) fisher.rolledItemDrop = 2476; else if (fisher.heightLevel < 2 && fisher.uncommon && fisher.questFish == 2458) fisher.rolledItemDrop = 2458; else if (fisher.heightLevel < 2 && fisher.uncommon && fisher.questFish == 2459) fisher.rolledItemDrop = 2459; else if (fisher.heightLevel == 0 && fisher.uncommon) fisher.rolledItemDrop = 2304; else if (fisher.heightLevel > 0 && fisher.heightLevel < 3 && (fisher.uncommon && fisher.questFish == 2455)) fisher.rolledItemDrop = 2455; else if (fisher.heightLevel == 1 && fisher.uncommon && fisher.questFish == 2479) fisher.rolledItemDrop = 2479; else if (fisher.heightLevel == 1 && fisher.uncommon && fisher.questFish == 2456) fisher.rolledItemDrop = 2456; else if (fisher.heightLevel == 1 && fisher.uncommon && fisher.questFish == 2474) fisher.rolledItemDrop = 2474; else if (fisher.heightLevel > 1 && fisher.rare && Main.rand.Next(5) == 0) {         if (Main.hardMode && Main.rand.Next(2) == 0) fisher.rolledItemDrop = 2437; else fisher.rolledItemDrop = 2436; }       else if (fisher.heightLevel > 1 && fisher.legendary && Main.rand.Next(3) != 0) fisher.rolledItemDrop = 2308; else if (fisher.heightLevel > 1 && fisher.veryrare && Main.rand.Next(2) == 0) fisher.rolledItemDrop = 2320; else if (fisher.heightLevel > 1 && fisher.rare) fisher.rolledItemDrop = 2321; else if (fisher.heightLevel > 1 && fisher.uncommon && fisher.questFish == 2478) fisher.rolledItemDrop = 2478; else if (fisher.heightLevel > 1 && fisher.uncommon && fisher.questFish == 2450) fisher.rolledItemDrop = 2450; else if (fisher.heightLevel > 1 && fisher.uncommon && fisher.questFish == 2464) fisher.rolledItemDrop = 2464; else if (fisher.heightLevel > 1 && fisher.uncommon && fisher.questFish == 2469) fisher.rolledItemDrop = 2469; else if (fisher.heightLevel > 2 && fisher.uncommon && fisher.questFish == 2462) fisher.rolledItemDrop = 2462; else if (fisher.heightLevel > 2 && fisher.uncommon && fisher.questFish == 2482) fisher.rolledItemDrop = 2482; else if (fisher.heightLevel > 2 && fisher.uncommon && fisher.questFish == 2472) fisher.rolledItemDrop = 2472; else if (fisher.heightLevel > 2 && fisher.uncommon && fisher.questFish == 2460) fisher.rolledItemDrop = 2460; else if (fisher.heightLevel > 1 && fisher.uncommon && Main.rand.Next(4) != 0) fisher.rolledItemDrop = 2303; else if (fisher.heightLevel > 1 && (fisher.uncommon || fisher.common || Main.rand.Next(4) == 0)) {         if (Main.rand.Next(4) == 0) fisher.rolledItemDrop = 2303; else fisher.rolledItemDrop = 2309; }       else if (fisher.uncommon && fisher.questFish == 2487) fisher.rolledItemDrop = 2487; else if (fisher.waterTilesCount > 1000 && fisher.common) fisher.rolledItemDrop = 2298; else fisher.rolledItemDrop = 2290; }   }