tModLoader How to make item drop with normal rarity?

Planterologist

Terrarian
So , i'm new modder on tModLoader , and i want to make some items drop from 1 NPC :

more precisely :
I have Soul of Plantera (I'll call it SoP) at my mod , and i want to make it drop with 100% in an amount from 15 to 25 , but i didnt find way to do this right , and the only thing that I got - 1 SoP per 5 planteras (it means , about 20% to drop) , how to fix it and do all right?
code :


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Terraria.ModLoader;
using Terraria.ID;
using Terraria;

namespace Planterology.Properties.NPCs
{
public class GlobalNPC : Terraria.ModLoader.GlobalNPC
{
public override bool InstancePerEntity
{
get { return true; }
}

public override void NPCLoot(NPC npc)
{
if(Main.rand.Next(100) == 0)
{
if (npc.type == NPCID.Plantera)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PlanteraSoul"), 1);


}
}

}
}
}
 
wtf, you have 1% chance to drop. just remove if(Main.rand.Next(100) == 0) thing and change last num in Item.NewItem properties to Main.rand.Next(15, 26)
 
Back
Top Bottom