From 7163670be1ee3507219d0ed22508e10b6e71a5be Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 12 Jan 2012 23:35:08 +0100 Subject: Core/Quests: Send currency rewards in quest packets --- src/server/game/Entities/Player/Player.cpp | 6 +++--- src/server/game/Quests/QuestDef.cpp | 12 ++++++------ src/server/game/Server/WorldPacket.h | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 498ff60478b..7fa604aeac3 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -19914,12 +19914,12 @@ bool Player::IsAffectedBySpellmod(SpellInfo const* spellInfo, SpellModifier* mod void Player::AddSpellMod(SpellModifier* mod, bool apply) { sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Player::AddSpellMod %d", mod->spellId); - uint16 opcode = (mod->type == SPELLMOD_FLAT) ? SMSG_SET_FLAT_SPELL_MODIFIER : SMSG_SET_PCT_SPELL_MODIFIER; + Opcodes opcode = Opcodes((mod->type == SPELLMOD_FLAT) ? SMSG_SET_FLAT_SPELL_MODIFIER : SMSG_SET_PCT_SPELL_MODIFIER); int i = 0; flag96 _mask = 0; uint32 modTypeCount = 0; // count of mods per one mod->op - WorldPacket data(Opcodes(opcode), 1); + WorldPacket data(opcode); data << uint32(1); // count of different mod->op's in packet size_t writePos = data.wpos(); data << uint32(modTypeCount); @@ -19937,7 +19937,7 @@ void Player::AddSpellMod(SpellModifier* mod, bool apply) if ((*itr)->type == mod->type && (*itr)->mask & _mask) val += (*itr)->value; val += apply ? mod->value : -(mod->value); - + data << uint8(eff); data << float(val); ++modTypeCount; diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 1b4613c5535..1a0b21c9615 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -133,7 +133,7 @@ Quest::Quest(Field* questRecord) for (int i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) RewardCurrencyId[i] = questRecord[132+i].GetUInt32(); - + for (int i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) RewardCurrencyCount[i] = questRecord[136+i].GetUInt32(); @@ -309,7 +309,7 @@ void Quest::BuildExtraQuestInfo(WorldPacket& data, Player* player) const data << uint32(GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles) data << uint32(0); // 4.x Unk - data << uint32(0); // 4.x Unk + data << float(0); // 4.x Unk data << uint32(GetBonusTalents()); // bonus talents data << uint32(0); // 4.x Unk data << uint32(0); // 4.x Unk @@ -333,10 +333,10 @@ void Quest::BuildExtraQuestInfo(WorldPacket& data, Player* player) const data << uint32(GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0) data << int32(GetRewSpellCast()); // casted spell - for (uint8 i = 0; i < 4; i++) - data << uint32(0); // 4.x Unk - for (uint8 i = 0; i < 4; i++) - data << uint32(0); // 4.x Unk + for (uint8 i = 0; i < QUEST_REWARD_CURRENCY_COUNT; i++) + data << uint32(RewardCurrencyId[i]); // 4.x Unk + for (uint8 i = 0; i < QUEST_REWARD_CURRENCY_COUNT; i++) + data << uint32(RewardCurrencyCount[i]); // 4.x Unk data << uint32(0); // 4.x Unk data << uint32(0); // 4.x Unk diff --git a/src/server/game/Server/WorldPacket.h b/src/server/game/Server/WorldPacket.h index e7bcbd8d7bf..a005a1b57fa 100644 --- a/src/server/game/Server/WorldPacket.h +++ b/src/server/game/Server/WorldPacket.h @@ -29,17 +29,17 @@ class WorldPacket : public ByteBuffer // just container for later use WorldPacket() : ByteBuffer(0), m_opcode(UNKNOWN_OPCODE) { - } - WorldPacket(Opcodes opcode, size_t res=200) : ByteBuffer(res), m_opcode(opcode) + + WorldPacket(Opcodes opcode, size_t res = 200) : ByteBuffer(res), m_opcode(opcode) { } // copy constructor - WorldPacket(const WorldPacket &packet) : ByteBuffer(packet), m_opcode(packet.m_opcode) + WorldPacket(WorldPacket const& packet) : ByteBuffer(packet), m_opcode(packet.m_opcode) { } - void Initialize(Opcodes opcode, size_t newres=200) + void Initialize(Opcodes opcode, size_t newres = 200) { clear(); _storage.reserve(newres); -- cgit v1.2.3