-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPrismGlobalNPC.cs
49 lines (46 loc) · 1.24 KB
/
PrismGlobalNPC.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace prismmod
{
internal class PrismGlobalNPC : GlobalNPC
{
public override void SetupShop(int type, Chest shop, ref int nextSlot)
{
if (type == NPCID.Dryad)
{
if (ModContent.GetInstance<PrismWorld>().downedGargantuanTortoise)
{
shop.item[nextSlot].SetDefaults(ModContent.ItemType<Items.Consumables.MechaEgg>());
nextSlot++;
}
}
}
/*public override void AI()
{
bool nearBoss = false;
foreach(NPC oNpc in Main.ncps[])
{
if()//Check distance
{
nearBoss = true;
}
}
if(!npc.boss&&nearBoss)
{
npc.life=0;
}
}*/
public override void NPCLoot(NPC npc)
{
if (npc.type == NPCID.Demon)
{
double chance = Main.rand.NextDouble();
if (chance <= 0.005)
{
Item.NewItem(npc.getRect(), mod.ItemType("CursedPan"), 1);
}
}
}
}
}