Gaminator
Terrarian
So, I want to add some materials that drop when any hostile npc is killed in specific biomes, but none of the Zone options return true.
I went over all of them while killing a slime in a normal forest biome, but none of them worked.
(Yes it's for a Naruto mod)
I went over all of them while killing a slime in a normal forest biome, but none of them worked.
(Yes it's for a Naruto mod)
Code:
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
{
if (!npc.friendly)
{
// LeafScroll Drops
if (Main.player[Player.FindClosest(npc.position, npc.width, npc.height)].ZoneForest)
{
npcLoot.Add(ItemDropRule.Common(ModContent.ItemType<LeafScroll>(), 2, 1, 3));
}
// SandScroll Drops
if (Main.player[Player.FindClosest(npc.position, npc.width, npc.height)].ZoneDesert)
{
npcLoot.Add(ItemDropRule.Common(ModContent.ItemType<SandScroll>(), 2, 1, 3));
}
// CloudScroll Drops
if (Main.player[Player.FindClosest(npc.position, npc.width, npc.height)].ZoneSkyHeight)
{
npcLoot.Add(ItemDropRule.Common(ModContent.ItemType<CloudScroll>(), 2, 1, 3));
}
// MistScroll Drops
if (Main.player[Player.FindClosest(npc.position, npc.width, npc.height)].ZoneBeach)
{
npcLoot.Add(ItemDropRule.Common(ModContent.ItemType<MistScroll>(), 2, 1, 3));
}
// RockScroll Drops
if (Main.player[Player.FindClosest(npc.position, npc.width, npc.height)].ZoneRockLayerHeight)
{
npcLoot.Add(ItemDropRule.Common(ModContent.ItemType<RockScroll>(), 2, 1, 3));
}
}
}
Last edited: