0.2.0 commit

This commit is contained in:
mikx
2025-02-11 16:04:10 -05:00
commit b861945511
28 changed files with 843 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria;
using Terraria.ModLoader.IO;
using static Terraria.GameContent.Bestiary.IL_BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions;
using Microsoft.Xna.Framework;
namespace tMx.NPCs.CustomLoot
{
public class FrozenTabletOnKill : GlobalNPC
{
public override void OnKill(NPC npc)
{
if (Main.rand.NextBool(3)) // ~33%
{
if (npc.type == NPCID.IceSlime
|| npc.type == NPCID.IceBat)
{
int dropItemType = ModContent.ItemType<Content.Items.Materials.FrozenTablet>();
int newItem = Item.NewItem(npc.GetSource_FromThis(), npc.Hitbox, dropItemType);
if (Main.netMode == NetmodeID.MultiplayerClient && newItem >= 0)
{
NetMessage.SendData(MessageID.SyncItem, -1, -1, null, newItem, 1f);
}
}
}
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria;
using Terraria.ModLoader.IO;
using static Terraria.GameContent.Bestiary.IL_BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions;
using Microsoft.Xna.Framework;
namespace tMx.NPCs.CustomLoot
{
public class MoltenTabletOnKill : GlobalNPC
{
public override void OnKill(NPC npc)
{
if (Main.rand.NextBool(3)) // ~33%
{
if (npc.type == NPCID.Hellbat
|| npc.type == NPCID.Lavabat
|| npc.type == NPCID.LavaSlime
|| npc.type == NPCID.FireImp)
{
int dropItemType = ModContent.ItemType<Content.Items.Materials.MoltenTablet>();
int newItem = Item.NewItem(npc.GetSource_FromThis(), npc.Hitbox, dropItemType);
if (Main.netMode == NetmodeID.MultiplayerClient && newItem >= 0)
{
NetMessage.SendData(MessageID.SyncItem, -1, -1, null, newItem, 1f);
}
}
}
}
}
}