diff options
author | TheJumper <maximilian.springer@web.de> | 2014-02-22 22:57:40 +0100 |
---|---|---|
committer | TheJumper <maximilian.springer@web.de> | 2014-02-22 22:57:40 +0100 |
commit | 90574d083da08ccd6699bdad403601e282d73b89 (patch) | |
tree | c067f5041bab30081d31ae9b7b9858c00709ba9b /src/Mobs/Monster.cpp | |
parent | Fixed Looting segment fault - a_Killer can be NULL (diff) | |
download | cuberite-90574d083da08ccd6699bdad403601e282d73b89.tar cuberite-90574d083da08ccd6699bdad403601e282d73b89.tar.gz cuberite-90574d083da08ccd6699bdad403601e282d73b89.tar.bz2 cuberite-90574d083da08ccd6699bdad403601e282d73b89.tar.lz cuberite-90574d083da08ccd6699bdad403601e282d73b89.tar.xz cuberite-90574d083da08ccd6699bdad403601e282d73b89.tar.zst cuberite-90574d083da08ccd6699bdad403601e282d73b89.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Mobs/Monster.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index 777b78c63..c81f46d6a 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -909,6 +909,34 @@ void cMonster::AddRandomRareDropItem(cItems & a_Drops, cItems & a_Items, short a +void cMonster::AddRandomArmorDropItem(cItems & a_Drops, short a_LootingLevel) +{ + MTRand r1; + if (r1.randInt() % 200 < (17 + (a_LootingLevel * 2))) + { + if (!GetEquippedHelmet().IsEmpty()) a_Drops.push_back(GetEquippedHelmet()); + } + + if (r1.randInt() % 200 < (17 + (a_LootingLevel * 2))) + { + if (!GetEquippedChestplate().IsEmpty()) a_Drops.push_back(GetEquippedChestplate()); + } + + if (r1.randInt() % 200 < (17 + (a_LootingLevel * 2))) + { + if (!GetEquippedLeggings().IsEmpty()) a_Drops.push_back(GetEquippedLeggings()); + } + + if (r1.randInt() % 200 < (17 + (a_LootingLevel * 2))) + { + if (!GetEquippedBoots().IsEmpty()) a_Drops.push_back(GetEquippedBoots()); + } +} + + + + + void cMonster::HandleDaylightBurning(cChunk & a_Chunk) { if (!m_BurnsInDaylight) |