-
Notifications
You must be signed in to change notification settings - Fork 2
/
NPCTweaks.cs
72 lines (64 loc) · 1.72 KB
/
NPCTweaks.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
using System;
using Terraria;
using Terraria.GameContent.ItemDropRules;
using Terraria.ID;
using Terraria.ModLoader;
using static Terraria.ModLoader.ModContent;
namespace VanillaTweaks
{
public class NPCTweaks : GlobalNPC
{
public override void SetDefaults(NPC npc)
{
switch (npc.type)
{
case NPCID.GoldBird:
case NPCID.GoldBunny:
case NPCID.GoldButterfly:
case NPCID.GoldFrog:
case NPCID.GoldGrasshopper:
case NPCID.GoldMouse:
case NPCID.SquirrelGold: //Why Re-Logic why???
case NPCID.GoldWorm:
case NPCID.GoldDragonfly:
case NPCID.GoldLadyBug:
case NPCID.GoldWaterStrider:
case NPCID.GoldSeahorse:
case NPCID.GoldGoldfishWalker:
case NPCID.GoldGoldfish:
npc.value = 10000f;
break;
}
}
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
{
switch(npc.type)
{
case NPCID.ZombieEskimo:
case NPCID.ArmedZombieEskimo:
if (GetInstance<ServerConfig>().SnowArmorDropTweak)
{
int[] eskimoOptions = new int[] { (int)ItemID.EskimoHood, (int)ItemID.EskimoCoat, (int)ItemID.EskimoPants };
foreach (var rule in npcLoot.Get(false))
{
if (rule is OneFromOptionsDropRule drop)
{
if (drop.dropIds[0] == eskimoOptions[0] &&
drop.dropIds[1] == eskimoOptions[1] &&
drop.dropIds[2] == eskimoOptions[2])
{
npcLoot.Remove(drop);
var expertRule = new OneFromOptionsDropRule(5, 1, eskimoOptions);
var normalRule = new OneFromOptionsDropRule(10, 1, eskimoOptions);
var newDrop = new DropBasedOnExpertMode(normalRule, expertRule);
npcLoot.Add(newDrop);
}
}
}
}
break;
}
}
}
}