Added static Enchantment Constants, Replaced cryptic Looting ID
This commit is contained in:
parent
1b32b00562
commit
7a7b9e88b2
@ -392,6 +392,38 @@ enum ENUM_ITEM_ID
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// ENCHANTMENT IDS
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
E_ENCHANTMENT_PROTECTION = 0,
|
||||||
|
E_ENCHANTMENT_FIRE_PROTECTION = 1,
|
||||||
|
E_ENCHANTMENT_FEATHER_FALLING = 2,
|
||||||
|
E_ENCHANTMENT_BLAST_PROTECTION = 3,
|
||||||
|
E_ENCHANTMENT_PROJECTILE_PROTECTION= 4,
|
||||||
|
E_ENCHANTMENT_RESPIRATION = 5,
|
||||||
|
E_ENCHANTMENT_AQUA_AFFINITY = 6,
|
||||||
|
E_ENCHANTMENT_THORNS = 7,
|
||||||
|
E_ENCHANTMENT_SHARPNESS = 16,
|
||||||
|
E_ENCHANTMENT_SMITE = 17,
|
||||||
|
E_ENCHANTMENT_BANE_OF_ARTHROPODS = 18,
|
||||||
|
E_ENCHANTMENT_KNOCKBACK = 19,
|
||||||
|
E_ENCHANTMENT_FIREASPECT = 20,
|
||||||
|
E_ENCHANTMENT_LOOTING = 21,
|
||||||
|
E_ENCHANTMENT_EFFICIENCY = 32,
|
||||||
|
E_ENCHANTMENT_SILKTOUCH = 33,
|
||||||
|
E_ENCHANTMENT_UNBREAKING = 34,
|
||||||
|
E_ENCHANTMENT_FORTUNE = 35,
|
||||||
|
E_ENCHANTMENT_POWER = 48,
|
||||||
|
E_ENCHANTMENT_PUNCH = 49,
|
||||||
|
E_ENCHANTMENT_FLAME = 50,
|
||||||
|
E_ENCHANTMENT_INFINITY = 51,
|
||||||
|
E_ENCHANTMENT_LUCKOFTHESEA = 61,
|
||||||
|
E_ENCHANTMENT_LURE = 62,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,7 @@ void cBlaze::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
|||||||
{
|
{
|
||||||
if (a_Killer->IsA("cPlayer") || a_Killer->IsA("cWolf"))
|
if (a_Killer->IsA("cPlayer") || a_Killer->IsA("cWolf"))
|
||||||
{
|
{
|
||||||
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(21);
|
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(E_ENCHANTMENT_LOOTING);
|
||||||
AddRandomDropItem(a_Drops, 0, 1 + LootingLevel, E_ITEM_BLAZE_ROD);
|
AddRandomDropItem(a_Drops, 0, 1 + LootingLevel, E_ITEM_BLAZE_ROD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ void cCavespider::Tick(float a_Dt, cChunk & a_Chunk)
|
|||||||
|
|
||||||
void cCavespider::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
void cCavespider::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||||
{
|
{
|
||||||
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(21);
|
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(E_ENCHANTMENT_LOOTING);
|
||||||
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_STRING);
|
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_STRING);
|
||||||
if (a_Killer->IsA("cPlayer") || a_Killer->IsA("cWolf"))
|
if (a_Killer->IsA("cPlayer") || a_Killer->IsA("cWolf"))
|
||||||
{
|
{
|
||||||
|
@ -48,7 +48,7 @@ void cChicken::Tick(float a_Dt, cChunk & a_Chunk)
|
|||||||
|
|
||||||
void cChicken::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
void cChicken::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||||
{
|
{
|
||||||
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(21);
|
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(E_ENCHANTMENT_LOOTING);
|
||||||
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_FEATHER);
|
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_FEATHER);
|
||||||
AddRandomDropItem(a_Drops, 1, 1, IsOnFire() ? E_ITEM_COOKED_CHICKEN : E_ITEM_RAW_CHICKEN);
|
AddRandomDropItem(a_Drops, 1, 1, IsOnFire() ? E_ITEM_COOKED_CHICKEN : E_ITEM_RAW_CHICKEN);
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ cCow::cCow(void) :
|
|||||||
|
|
||||||
void cCow::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
void cCow::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||||
{
|
{
|
||||||
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(21);
|
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(E_ENCHANTMENT_LOOTING);
|
||||||
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_LEATHER);
|
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_LEATHER);
|
||||||
AddRandomDropItem(a_Drops, 1, 3 + LootingLevel, IsOnFire() ? E_ITEM_STEAK : E_ITEM_RAW_BEEF);
|
AddRandomDropItem(a_Drops, 1, 3 + LootingLevel, IsOnFire() ? E_ITEM_STEAK : E_ITEM_RAW_BEEF);
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ void cCreeper::Tick(float a_Dt, cChunk & a_Chunk)
|
|||||||
|
|
||||||
void cCreeper::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
void cCreeper::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||||
{
|
{
|
||||||
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(21);
|
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(E_ENCHANTMENT_LOOTING);
|
||||||
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_GUNPOWDER);
|
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_GUNPOWDER);
|
||||||
|
|
||||||
if ((a_Killer != NULL) && (a_Killer->IsProjectile()))
|
if ((a_Killer != NULL) && (a_Killer->IsProjectile()))
|
||||||
|
@ -21,7 +21,7 @@ cEnderman::cEnderman(void) :
|
|||||||
|
|
||||||
void cEnderman::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
void cEnderman::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||||
{
|
{
|
||||||
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(21);
|
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(E_ENCHANTMENT_LOOTING);
|
||||||
AddRandomDropItem(a_Drops, 0, 1 + LootingLevel, E_ITEM_ENDER_PEARL);
|
AddRandomDropItem(a_Drops, 0, 1 + LootingLevel, E_ITEM_ENDER_PEARL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ cGhast::cGhast(void) :
|
|||||||
|
|
||||||
void cGhast::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
void cGhast::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||||
{
|
{
|
||||||
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(21);
|
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(E_ENCHANTMENT_LOOTING);
|
||||||
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_GUNPOWDER);
|
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_GUNPOWDER);
|
||||||
AddRandomDropItem(a_Drops, 0, 1 + LootingLevel, E_ITEM_GHAST_TEAR);
|
AddRandomDropItem(a_Drops, 0, 1 + LootingLevel, E_ITEM_GHAST_TEAR);
|
||||||
}
|
}
|
||||||
|
@ -140,7 +140,7 @@ void cHorse::OnRightClicked(cPlayer & a_Player)
|
|||||||
|
|
||||||
void cHorse::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
void cHorse::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||||
{
|
{
|
||||||
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(21);
|
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(E_ENCHANTMENT_LOOTING);
|
||||||
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_LEATHER);
|
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_LEATHER);
|
||||||
if (m_bIsSaddled)
|
if (m_bIsSaddled)
|
||||||
{
|
{
|
||||||
|
@ -23,7 +23,7 @@ cMooshroom::cMooshroom(void) :
|
|||||||
|
|
||||||
void cMooshroom::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
void cMooshroom::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||||
{
|
{
|
||||||
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(21);
|
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(E_ENCHANTMENT_LOOTING);
|
||||||
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_LEATHER);
|
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_LEATHER);
|
||||||
AddRandomDropItem(a_Drops, 1, 3 + LootingLevel, IsOnFire() ? E_ITEM_STEAK : E_ITEM_RAW_BEEF);
|
AddRandomDropItem(a_Drops, 1, 3 + LootingLevel, IsOnFire() ? E_ITEM_STEAK : E_ITEM_RAW_BEEF);
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ cPig::cPig(void) :
|
|||||||
|
|
||||||
void cPig::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
void cPig::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||||
{
|
{
|
||||||
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(21);
|
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(E_ENCHANTMENT_LOOTING);
|
||||||
AddRandomDropItem(a_Drops, 1, 3 + LootingLevel, IsOnFire() ? E_ITEM_COOKED_PORKCHOP : E_ITEM_RAW_PORKCHOP);
|
AddRandomDropItem(a_Drops, 1, 3 + LootingLevel, IsOnFire() ? E_ITEM_COOKED_PORKCHOP : E_ITEM_RAW_PORKCHOP);
|
||||||
if (m_bIsSaddled)
|
if (m_bIsSaddled)
|
||||||
{
|
{
|
||||||
|
@ -20,7 +20,7 @@ cSkeleton::cSkeleton(bool IsWither) :
|
|||||||
|
|
||||||
void cSkeleton::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
void cSkeleton::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||||
{
|
{
|
||||||
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(21);
|
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(E_ENCHANTMENT_LOOTING);
|
||||||
if (IsWither())
|
if (IsWither())
|
||||||
{
|
{
|
||||||
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_BONE);
|
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_BONE);
|
||||||
|
@ -20,7 +20,7 @@ cSlime::cSlime(int a_Size) :
|
|||||||
|
|
||||||
void cSlime::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
void cSlime::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||||
{
|
{
|
||||||
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(21);
|
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(E_ENCHANTMENT_LOOTING);
|
||||||
if (GetSize() == 1)
|
if (GetSize() == 1)
|
||||||
{
|
{
|
||||||
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_SLIMEBALL);
|
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_SLIMEBALL);
|
||||||
|
@ -18,7 +18,7 @@ cSpider::cSpider(void) :
|
|||||||
|
|
||||||
void cSpider::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
void cSpider::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||||
{
|
{
|
||||||
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(21);
|
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(E_ENCHANTMENT_LOOTING);
|
||||||
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_STRING);
|
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_STRING);
|
||||||
if (a_Killer->IsA("cPlayer") || a_Killer->IsA("cWolf"))
|
if (a_Killer->IsA("cPlayer") || a_Killer->IsA("cWolf"))
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,7 @@ cSquid::cSquid(void) :
|
|||||||
void cSquid::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
void cSquid::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||||
{
|
{
|
||||||
// Drops 0-3 Ink Sacs
|
// Drops 0-3 Ink Sacs
|
||||||
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(21);
|
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(E_ENCHANTMENT_LOOTING);
|
||||||
AddRandomDropItem(a_Drops, 0, 3 + LootingLevel, E_ITEM_DYE, E_META_DYE_BLACK);
|
AddRandomDropItem(a_Drops, 0, 3 + LootingLevel, E_ITEM_DYE, E_META_DYE_BLACK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ cWitch::cWitch(void) :
|
|||||||
|
|
||||||
void cWitch::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
void cWitch::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||||
{
|
{
|
||||||
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(21);
|
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(E_ENCHANTMENT_LOOTING);
|
||||||
MTRand r1;
|
MTRand r1;
|
||||||
int DropTypeCount = (r1.randInt() % 3) + 1;
|
int DropTypeCount = (r1.randInt() % 3) + 1;
|
||||||
for (int i = 0; i < DropTypeCount; i++)
|
for (int i = 0; i < DropTypeCount; i++)
|
||||||
|
@ -23,7 +23,7 @@ cZombie::cZombie(bool a_IsVillagerZombie) :
|
|||||||
|
|
||||||
void cZombie::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
void cZombie::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||||
{
|
{
|
||||||
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(21);
|
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(E_ENCHANTMENT_LOOTING);
|
||||||
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_ROTTEN_FLESH);
|
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_ROTTEN_FLESH);
|
||||||
cItems RareDrops;
|
cItems RareDrops;
|
||||||
RareDrops.Add(cItem(E_ITEM_IRON));
|
RareDrops.Add(cItem(E_ITEM_IRON));
|
||||||
|
@ -19,7 +19,7 @@ cZombiePigman::cZombiePigman(void) :
|
|||||||
|
|
||||||
void cZombiePigman::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
void cZombiePigman::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||||
{
|
{
|
||||||
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(21);
|
int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(E_ENCHANTMENT_LOOTING);
|
||||||
AddRandomDropItem(a_Drops, 0, 1 + LootingLevel, E_ITEM_ROTTEN_FLESH);
|
AddRandomDropItem(a_Drops, 0, 1 + LootingLevel, E_ITEM_ROTTEN_FLESH);
|
||||||
AddRandomDropItem(a_Drops, 0, 1 + LootingLevel, E_ITEM_GOLD_NUGGET);
|
AddRandomDropItem(a_Drops, 0, 1 + LootingLevel, E_ITEM_GOLD_NUGGET);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user