This repository has been archived by the owner on Jan 24, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathNPCDrops.cs
89 lines (83 loc) · 2.19 KB
/
NPCDrops.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Tremor
{
public class NPCDrops : GlobalNPC
{
public static void Init()
{
VanillaWoFWeapons = new int[]
{
ItemID.LaserRifle,
ItemID.BreakerBlade,
ItemID.ClockworkAssaultRifle
};
VanillaWoFEmblems = new int[]
{
ItemID.WarriorEmblem,
ItemID.RangerEmblem,
ItemID.SorcererEmblem,
ItemID.SummonerEmblem,
Tremor.instance.ItemType("AlchemistEmblem"),
Tremor.instance.ItemType("ThrowerEmblem")
};
}
internal static int[] VanillaWoFWeapons;
internal static int[] VanillaWoFEmblems;
public override void NPCLoot(NPC npc)
{
switch (npc.type)
{
case NPCID.WallofFlesh:
bool dropEmblemAlchemist = Main.rand.NextBool(1, 5);
if (dropEmblemAlchemist)
{
if (Main.rand.NextBool(1, 7))
{
Item.NewItem(npc.position, npc.width, npc.height, ItemID.FleshMask);
}
if (Main.rand.NextBool(1, 7))
{
Item.NewItem(npc.position, npc.width, npc.height, 1365);
}
Item.NewItem(npc.position, npc.width, npc.height, Utils.SelectRandom(Main.rand, VanillaWoFEmblems));
Item.NewItem(npc.position, npc.width, npc.height, Utils.SelectRandom(Main.rand, VanillaWoFWeapons));
Item.NewItem(npc.position, npc.width, npc.height, ItemID.GoldCoin, Main.rand.Next(6, 10));
}
break;
}
}
}
public class BossBags : GlobalItem
{
public override bool PreOpenVanillaBag(string context, Player player, int arg)
{
if (context == "bossBag")
{
switch (arg)
{
case ItemID.WallOfFleshBossBag:
bool dropEmblemAlchemist = Main.rand.NextBool(1, 5);
if (dropEmblemAlchemist)
{
if (!player.extraAccessory)
{
player.QuickSpawnItem(ItemID.DemonHeart);
}
if (Main.rand.NextBool(1, 7))
{
player.QuickSpawnItem(ItemID.FleshMask);
}
player.QuickSpawnItem(Utils.SelectRandom(Main.rand, NPCDrops.VanillaWoFEmblems));
player.QuickSpawnItem(Utils.SelectRandom(Main.rand, NPCDrops.VanillaWoFWeapons));
player.QuickSpawnItem(ItemID.GoldCoin, Main.rand.Next(6, 10));
return false;
}
break;
}
}
return true;
}
}
}