aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2012-01-12 23:35:08 +0100
committerShauren <shauren.trinity@gmail.com>2012-01-12 23:35:08 +0100
commit7163670be1ee3507219d0ed22508e10b6e71a5be (patch)
tree631ac9c558f637083a5767375a8851880e424acd /src
parente7c7158db0da55892983629e852ac6faf0f4f630 (diff)
Core/Quests: Send currency rewards in quest packets
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp6
-rwxr-xr-xsrc/server/game/Quests/QuestDef.cpp12
-rw-r--r--src/server/game/Server/WorldPacket.h8
3 files changed, 13 insertions, 13 deletions
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);