void cWitch::GetDrops(cItems & a_Drops, cEntity * a_Killer) { int LootingLevel = 0; if (a_Killer != nullptr) { LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting); } MTRand r1; int DropTypeCount = (r1.randInt() % 3) + 1; for (int i = 0; i < DropTypeCount; i++) { int DropType = r1.randInt() % 7; switch (DropType) { case 0: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_GLASS_BOTTLE); break; case 1: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_GLOWSTONE_DUST); break; case 2: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_GUNPOWDER); break; case 3: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_REDSTONE_DUST); break; case 4: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_SPIDER_EYE); break; case 5: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_STICK); break; case 6: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_SUGAR); break; } } AddRandomWeaponDropItem(a_Drops, LootingLevel); }
void cZombiePigman::GetDrops(cItems & a_Drops, cEntity * a_Killer) { int LootingLevel = 0; if (a_Killer != NULL) { LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting); } AddRandomDropItem(a_Drops, 0, 1 + LootingLevel, E_ITEM_ROTTEN_FLESH); AddRandomDropItem(a_Drops, 0, 1 + LootingLevel, E_ITEM_GOLD_NUGGET); cItems RareDrops; RareDrops.Add(cItem(E_ITEM_GOLD)); AddRandomRareDropItem(a_Drops, RareDrops, LootingLevel); AddRandomArmorDropItem(a_Drops, LootingLevel); AddRandomWeaponDropItem(a_Drops, LootingLevel); }
void cZombie::GetDrops(cItems & a_Drops, cEntity * a_Killer) { unsigned int LootingLevel = 0; if (a_Killer != nullptr) { LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting); } AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_ROTTEN_FLESH); cItems RareDrops; RareDrops.Add(cItem(E_ITEM_IRON)); RareDrops.Add(cItem(E_ITEM_CARROT)); RareDrops.Add(cItem(E_ITEM_POTATO)); AddRandomRareDropItem(a_Drops, RareDrops, LootingLevel); AddRandomArmorDropItem(a_Drops, LootingLevel); AddRandomWeaponDropItem(a_Drops, LootingLevel); }
void cSkeleton::GetDrops(cItems & a_Drops, cEntity * a_Killer) { int LootingLevel = 0; if (a_Killer != NULL) { LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting); } if (IsWither()) { AddRandomUncommonDropItem(a_Drops, 33.0f, E_ITEM_COAL); cItems RareDrops; RareDrops.Add(cItem(E_ITEM_HEAD, 1, 1)); AddRandomRareDropItem(a_Drops, RareDrops, LootingLevel); } else { AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_ARROW); } AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_BONE); AddRandomArmorDropItem(a_Drops, LootingLevel); AddRandomWeaponDropItem(a_Drops, LootingLevel); }