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

◆ GetAnglerReward_Bait()

void Terraria.Player.GetAnglerReward_Bait ( IEntitySource source,
int questsDone,
float rarityReduction,
ref GetItemSettings anglerRewardSettings )
inlineprivate

Definition at line 53046 of file Player.cs.

53047 {
53048 if (Main.rand.Next((int)(100f * rarityReduction)) > 50)
53049 {
53050 return;
53051 }
53052 Item item = new Item();
53053 if (Main.rand.Next((int)(15f * rarityReduction)) == 0)
53054 {
53055 item.SetDefaults(2676);
53056 }
53057 else if (Main.rand.Next((int)(5f * rarityReduction)) == 0)
53058 {
53059 item.SetDefaults(2675);
53060 }
53061 else
53062 {
53063 item.SetDefaults(2674);
53064 }
53065 if (Main.rand.Next(25) <= questsDone)
53066 {
53067 item.stack++;
53068 }
53069 if (Main.rand.Next(50) <= questsDone)
53070 {
53071 item.stack++;
53072 }
53073 if (Main.rand.Next(100) <= questsDone)
53074 {
53075 item.stack++;
53076 }
53077 if (Main.rand.Next(150) <= questsDone)
53078 {
53079 item.stack++;
53080 }
53081 if (Main.rand.Next(200) <= questsDone)
53082 {
53083 item.stack++;
53084 }
53085 if (Main.rand.Next(250) <= questsDone)
53086 {
53087 item.stack++;
53088 }
53089 item.position = base.Center;
53090 Item item2 = GetItem(whoAmI, item, GetItemSettings.NPCEntityToPlayerInventorySettings);
53091 if (item2.stack > 0)
53092 {
53093 int number = Item.NewItem(source, (int)position.X, (int)position.Y, width, height, item2.type, item2.stack, noBroadcast: false, 0, noGrabDelay: true);
53094 if (Main.netMode == 1)
53095 {
53096 NetMessage.SendData(21, -1, -1, null, number, 1f);
53097 }
53098 }
53099 }
Vector2 position
Definition Entity.cs:14
Item GetItem(int plr, Item newItem, GetItemSettings settings)
Definition Player.cs:37130

References System.item, Terraria.Main.netMode, Terraria.Item.NewItem(), Terraria.GetItemSettings.NPCEntityToPlayerInventorySettings, Terraria.Main.rand, Terraria.NetMessage.SendData(), and System.source.