0.2.0 commit
This commit is contained in:
35
NPCs/CustomLoot/FrozenTabletOnKill.cs
Normal file
35
NPCs/CustomLoot/FrozenTabletOnKill.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
37
NPCs/CustomLoot/MoltenTabletOnKill.cs
Normal file
37
NPCs/CustomLoot/MoltenTabletOnKill.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user