Fixed Details Xoft gave.

Increased the range where orbs (should) track you.
Blazes give 10 xp now.
master
STRWarrior 2013-11-25 21:43:43 +01:00
parent dd76700d8d
commit 18b5ccbc08
12 changed files with 36 additions and 30 deletions

View File

@ -1885,9 +1885,9 @@ void cClientHandle::SendExperience(void)
void cClientHandle::SendExperienceOrb(const cEntity & a_Entity)
void cClientHandle::SendExperienceOrb(const cExpOrb & a_ExpOrb)
{
m_Protocol->SendExperienceOrb(a_Entity);
m_Protocol->SendExperienceOrb(a_ExpOrb);
}

View File

@ -25,6 +25,7 @@ class cChunkDataSerializer;
class cInventory;
class cMonster;
class cPawn;
class cExpOrb;
class cPickup;
class cPlayer;
class cProtocol;
@ -121,7 +122,7 @@ public:
void SendPlayerSpawn (const cPlayer & a_Player);
void SendRespawn (void);
void SendExperience (void);
void SendExperienceOrb (const cEntity & a_Entity);
void SendExperienceOrb (const cExpOrb & a_ExpOrb);
void SendSoundEffect (const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch); // a_Src coords are Block * 8
void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data);
void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock);

View File

@ -40,7 +40,7 @@ void cExpOrb::SpawnOn(cClientHandle & a_Client)
void cExpOrb::Tick(float a_Dt, cChunk & a_Chunk)
{
cPlayer * a_ClosestPlayer(m_World->FindClosestPlayer(Vector3f(GetPosition()), 3));
cPlayer * a_ClosestPlayer(m_World->FindClosestPlayer(Vector3f(GetPosition()), 4));
if (a_ClosestPlayer)
{
Vector3f a_PlayerPos(a_ClosestPlayer->GetPosition());

View File

@ -22,7 +22,7 @@ public:
virtual void SpawnOn(cClientHandle & a_Client) override;
// cExpOrb functions
short int GetReward(void) const { return m_Reward; }
int GetReward(void) const { return m_Reward; }
protected:
int m_Reward;

View File

@ -259,7 +259,7 @@ void cMonster::KilledBy(cEntity * a_Killer)
{
m_World->BroadcastSoundEffect(m_SoundDeath, (int)(GetPosX() * 8), (int)(GetPosY() * 8), (int)(GetPosZ() * 8), 1.0f, 0.8f);
}
int Exp;
int Reward;
switch (m_MobType)
{
// Animals
@ -273,7 +273,7 @@ void cMonster::KilledBy(cEntity * a_Killer)
case cMonster::mtOcelot:
case cMonster::mtWolf:
{
Exp = m_World->GetTickRandomNumber(2) + 1;
Reward = m_World->GetTickRandomNumber(2) + 1;
}
// Monsters
@ -290,25 +290,29 @@ void cMonster::KilledBy(cEntity * a_Killer)
case cMonster::mtSlime:
case cMonster::mtMagmaCube:
{
Exp = 6 + (m_World->GetTickRandomNumber(2));
Reward = 6 + (m_World->GetTickRandomNumber(2));
}
case cMonster::mtBlaze:
{
Reward = 10;
}
// Bosses
case cMonster::mtEnderDragon:
{
Exp = 12000;
Reward = 12000;
}
case cMonster::mtWither:
{
Exp = 50;
Reward = 50;
}
default:
{
Exp = 0;
Reward = 0;
}
}
m_World->SpawnExperienceOrb(GetPosX(), GetPosY(), GetPosZ(), Exp);
m_World->SpawnExperienceOrb(GetPosX(), GetPosY(), GetPosZ(), Reward);
m_DestroyTimer = 0;
}

View File

@ -16,6 +16,7 @@
class cExpOrb;
class cPlayer;
class cEntity;
class cWindow;
@ -86,7 +87,7 @@ public:
virtual void SendPlayerSpawn (const cPlayer & a_Player) = 0;
virtual void SendRespawn (void) = 0;
virtual void SendExperience (void) = 0;
virtual void SendExperienceOrb (const cEntity & a_Entity) = 0;
virtual void SendExperienceOrb (const cExpOrb & a_ExpOrb) = 0;
virtual void SendSoundEffect (const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch) = 0; // a_Src coords are Block * 8
virtual void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data) = 0;
virtual void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock) = 0;

View File

@ -707,15 +707,15 @@ void cProtocol125::SendExperience(void)
void cProtocol125::SendExperienceOrb(const cEntity & a_Entity)
void cProtocol125::SendExperienceOrb(const cExpOrb & a_ExpOrb)
{
cCSLock Lock(m_CSPacket);
WriteByte(PACKET_SPAWN_EXPERIENCE_ORB);
WriteInt(a_Entity.GetUniqueID());
WriteInt((int) a_Entity.GetPosX());
WriteInt((int) a_Entity.GetPosY());
WriteInt((int) a_Entity.GetPosZ());
WriteShort(((cExpOrb &)a_Entity).GetReward());
WriteInt(a_ExpOrb.GetUniqueID());
WriteInt((int) a_ExpOrb.GetPosX());
WriteInt((int) a_ExpOrb.GetPosY());
WriteInt((int) a_ExpOrb.GetPosZ());
WriteShort(a_ExpOrb.GetReward());
Flush();
}

View File

@ -63,7 +63,7 @@ public:
virtual void SendPlayerSpawn (const cPlayer & a_Player) override;
virtual void SendRespawn (void) override;
virtual void SendExperience (void) override;
virtual void SendExperienceOrb (const cEntity & a_Entity) override;
virtual void SendExperienceOrb (const cExpOrb & a_ExpOrb) override;
virtual void SendSoundEffect (const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch) override; // a_Src coords are Block * 8
virtual void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data) override;
virtual void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock) override;

View File

@ -610,14 +610,14 @@ void cProtocol172::SendExperience (void)
void cProtocol172::SendExperienceOrb(const cEntity & a_Entity)
void cProtocol172::SendExperienceOrb(const cExpOrb & a_ExpOrb)
{
cPacketizer Pkt(*this, 0x11);
Pkt.WriteVarInt(a_Entity.GetUniqueID());
Pkt.WriteInt((int) a_Entity.GetPosX());
Pkt.WriteInt((int) a_Entity.GetPosY());
Pkt.WriteInt((int) a_Entity.GetPosZ());
Pkt.WriteShort(((cExpOrb &)a_Entity).GetReward());
Pkt.WriteVarInt(a_ExpOrb.GetUniqueID());
Pkt.WriteInt((int) a_ExpOrb.GetPosX());
Pkt.WriteInt((int) a_ExpOrb.GetPosY());
Pkt.WriteInt((int) a_ExpOrb.GetPosZ());
Pkt.WriteShort(a_ExpOrb.GetReward());
}

View File

@ -73,7 +73,7 @@ public:
virtual void SendRespawn (void) override;
virtual void SendSoundEffect (const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch) override; // a_Src coords are Block * 8
virtual void SendExperience (void) override;
virtual void SendExperienceOrb (const cEntity & a_Entity) override;
virtual void SendExperienceOrb (const cExpOrb & a_ExpOrb) override;
virtual void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data) override;
virtual void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock) override;
virtual void SendSpawnMob (const cMonster & a_Mob) override;

View File

@ -476,10 +476,10 @@ void cProtocolRecognizer::SendExperience(void)
void cProtocolRecognizer::SendExperienceOrb(const cEntity & a_Entity)
void cProtocolRecognizer::SendExperienceOrb(const cExpOrb & a_ExpOrb)
{
ASSERT(m_Protocol != NULL);
m_Protocol->SendExperienceOrb(a_Entity);
m_Protocol->SendExperienceOrb(a_ExpOrb);
}

View File

@ -98,7 +98,7 @@ public:
virtual void SendPlayerSpawn (const cPlayer & a_Player) override;
virtual void SendRespawn (void) override;
virtual void SendExperience (void) override;
virtual void SendExperienceOrb (const cEntity & a_Entity) override;
virtual void SendExperienceOrb (const cExpOrb & a_ExpOrb) override;
virtual void SendSoundEffect (const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch) override;
virtual void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data) override;
virtual void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock) override;