From b93d1b5027afc55be3a5e1c882c023d400f2bbfa Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Mon, 25 Nov 2013 20:04:01 +0100 Subject: Implented Spawn Experience Orb packet. --- source/Protocol/Protocol125.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source/Protocol/Protocol125.cpp') diff --git a/source/Protocol/Protocol125.cpp b/source/Protocol/Protocol125.cpp index 54be65b12..3b753479d 100644 --- a/source/Protocol/Protocol125.cpp +++ b/source/Protocol/Protocol125.cpp @@ -17,6 +17,7 @@ Documentation: #include "../World.h" #include "ChunkDataSerializer.h" #include "../Entities/Entity.h" +#include "../Entities/ExpOrb.h" #include "../Mobs/Monster.h" #include "../Entities/Pickup.h" #include "../Entities/Player.h" @@ -72,6 +73,7 @@ enum PACKET_ENT_STATUS = 0x26, PACKET_ATTACH_ENTITY = 0x27, PACKET_METADATA = 0x28, + PACKET_SPAWN_EXPERIENCE_ORB = 0x1A, PACKET_EXPERIENCE = 0x2b, PACKET_PRE_CHUNK = 0x32, PACKET_MAP_CHUNK = 0x33, @@ -705,6 +707,22 @@ void cProtocol125::SendExperience(void) +void cProtocol125::SendExperienceOrb(const cEntity & a_Entity) +{ + 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()); + Flush(); +} + + + + + void cProtocol125::SendSoundEffect(const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch) { // Not needed in this protocol version -- cgit v1.2.3