aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2015-04-04 16:04:40 +0200
committerShauren <shauren.trinity@gmail.com>2015-04-04 16:04:40 +0200
commitb66d2da2c735569be8ab5208660beef6a4facd33 (patch)
treed3de1828d025ab82cc037fe75361aeccf3dced08 /src/server/game/Spells
parente2abc9edf83af33797dcf41d1050aea518048b30 (diff)
Core/PacketIO: Updated and enabled SMSG_SPELL_CHANNEL_START and SMSG_SPELL_CHANNEL_UPDATE
Diffstat (limited to 'src/server/game/Spells')
-rw-r--r--src/server/game/Spells/Spell.cpp38
-rw-r--r--src/server/game/Spells/Spell.h2
2 files changed, 10 insertions, 30 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index a4b84e6a2eb..1df9fd000f6 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -4245,11 +4245,10 @@ void Spell::SendChannelUpdate(uint32 time)
m_caster->SetUInt32Value(UNIT_CHANNEL_SPELL, 0);
}
- WorldPacket data(SMSG_SPELL_CHANNEL_UPDATE, 8 + 4);
- data << m_caster->GetPackGUID();
- data << uint32(time);
-
- m_caster->SendMessageToSet(&data, true);
+ WorldPackets::Spells::SpellChannelUpdate spellChannelUpdate;
+ spellChannelUpdate.CasterGUID = m_caster->GetGUID();
+ spellChannelUpdate.TimeRemaining = time;
+ m_caster->SendMessageToSet(spellChannelUpdate.Write(), true);
}
void Spell::SendChannelStart(uint32 duration)
@@ -4259,30 +4258,11 @@ void Spell::SendChannelStart(uint32 duration)
if (m_UniqueTargetInfo.size() + m_UniqueGOTargetInfo.size() == 1) // this is for TARGET_SELECT_CATEGORY_NEARBY
channelTarget = !m_UniqueTargetInfo.empty() ? m_UniqueTargetInfo.front().targetGUID : m_UniqueGOTargetInfo.front().targetGUID;
- WorldPacket data(SMSG_SPELL_CHANNEL_START, (8 + 4 + 4));
- data << m_caster->GetPackGUID();
- data << uint32(m_spellInfo->Id);
- data << uint32(duration);
- data << uint8(0); // immunity (castflag & 0x04000000)
- /*
- if (immunity)
- {
- data << uint32(); // CastSchoolImmunities
- data << uint32(); // CastImmunities
- }
- */
- data << uint8(0); // healPrediction (castflag & 0x40000000)
- /*
- if (healPrediction)
- {
- data.appendPackGUID(channelTarget); // target packguid
- data << uint32(); // spellid
- data << uint8(0); // unk3
- if (unk3 == 2)
- data.append(); // unk packed guid (unused ?)
- }
- */
- m_caster->SendMessageToSet(&data, true);
+ WorldPackets::Spells::SpellChannelStart spellChannelStart;
+ spellChannelStart.CasterGUID = m_caster->GetGUID();
+ spellChannelStart.SpellID = m_spellInfo->Id;
+ spellChannelStart.ChannelDuration = duration;
+ m_caster->SendMessageToSet(spellChannelStart.Write(), true);
m_timer = duration;
if (!channelTarget.IsEmpty())
diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h
index 113ac31b461..9ddcc221e21 100644
--- a/src/server/game/Spells/Spell.h
+++ b/src/server/game/Spells/Spell.h
@@ -524,7 +524,7 @@ class Spell
void SetSpellValue(SpellValueMod mod, int32 value);
- SpellEffectInfoVector GetEffects() const { return _effects; }
+ SpellEffectInfoVector const& GetEffects() const { return _effects; }
SpellEffectInfo const* GetEffect(uint32 index) const
{
if (index >= _effects.size())