aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Spell.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2015-07-18 00:45:21 +0200
committerShauren <shauren.trinity@gmail.com>2015-07-18 00:45:21 +0200
commitf45ae7af431402e6d9e4aff488a4cc64b9dfffd3 (patch)
tree6c54bda7142685753cba36d6b2b19a489ffa1dea /src/server/game/Spells/Spell.cpp
parent85d637bab6baa237f5d2dd04d72a79f065e0b103 (diff)
Core/PacketIO: Updated spell packets
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rw-r--r--src/server/game/Spells/Spell.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 6eabf259171..5dd7a7cb2fe 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -643,7 +643,8 @@ m_spellValue(new SpellValue(caster->GetMap()->GetDifficultyID(), m_spellInfo)),
m_procEx = 0;
focusObject = NULL;
m_cast_count = 0;
- m_misc.Data = 0;
+ memset(m_misc.Raw.Data, 0, sizeof(m_misc.Raw.Data));
+ m_SpellVisual = m_spellInfo->GetSpellXSpellVisualId(caster->GetMap()->GetDifficultyID());
m_preCastSpell = 0;
m_triggeredByAuraSpell = NULL;
m_spellAura = NULL;
@@ -3704,7 +3705,7 @@ void Spell::SendCastResult(SpellCastResult result)
if (m_caster->ToPlayer()->GetSession()->PlayerLoading()) // don't send cast results at loading time
return;
- SendCastResult(m_caster->ToPlayer(), m_spellInfo, m_cast_count, result, m_customError, SMSG_CAST_FAILED, m_misc.Data);
+ SendCastResult(m_caster->ToPlayer(), m_spellInfo, m_cast_count, result, m_customError, SMSG_CAST_FAILED, m_misc.Raw.Data);
}
void Spell::SendPetCastResult(SpellCastResult result)
@@ -3716,10 +3717,10 @@ void Spell::SendPetCastResult(SpellCastResult result)
if (!owner || owner->GetTypeId() != TYPEID_PLAYER)
return;
- SendCastResult(owner->ToPlayer(), m_spellInfo, m_cast_count, result, SPELL_CUSTOM_ERROR_NONE, SMSG_PET_CAST_FAILED, m_misc.Data);
+ SendCastResult(owner->ToPlayer(), m_spellInfo, m_cast_count, result, SPELL_CUSTOM_ERROR_NONE, SMSG_PET_CAST_FAILED, m_misc.Raw.Data);
}
-void Spell::SendCastResult(Player* caster, SpellInfo const* spellInfo, uint8 cast_count, SpellCastResult result, SpellCustomErrors customError /*= SPELL_CUSTOM_ERROR_NONE*/, OpcodeServer opcode /*= SMSG_CAST_FAILED*/, uint32 misc /*= 0*/)
+void Spell::SendCastResult(Player* caster, SpellInfo const* spellInfo, uint8 cast_count, SpellCastResult result, SpellCustomErrors customError /*= SPELL_CUSTOM_ERROR_NONE*/, OpcodeServer opcode /*= SMSG_CAST_FAILED*/, uint32* misc /*= nullptr*/)
{
if (result == SPELL_CAST_OK)
return;
@@ -3830,10 +3831,11 @@ void Spell::SendCastResult(Player* caster, SpellInfo const* spellInfo, uint8 cas
packet.FailedArg1 = missingItem; // first missing item
break;
}
- case SPELL_FAILED_CANT_UNTALENT:
+ case SPELL_FAILED_CANT_UNTALENT:
{
- if (TalentEntry const* talent = sTalentStore.LookupEntry(misc))
- packet.FailedArg1 = talent->SpellID;
+ if (misc)
+ if (TalentEntry const* talent = sTalentStore.LookupEntry(misc[0]))
+ packet.FailedArg1 = talent->SpellID;
break;
}
// TODO: SPELL_FAILED_NOT_STANDING
@@ -3880,6 +3882,7 @@ void Spell::SendSpellStart()
castData.CasterUnit = m_caster->GetGUID();
castData.CastID = m_cast_count; // pending spell cast?
castData.SpellID = m_spellInfo->Id;
+ castData.SpellXSpellVisualID = m_SpellVisual;
castData.CastFlags = castFlags;
castData.CastTime = m_casttime;
@@ -3995,6 +3998,7 @@ void Spell::SendSpellGo()
castData.CasterUnit = m_caster->GetGUID();
castData.CastID = m_cast_count; // pending spell cast?
castData.SpellID = m_spellInfo->Id;
+ castData.SpellXSpellVisualID = m_SpellVisual;
castData.CastFlags = castFlags;
castData.CastTime = getMSTime();