mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
Implement CAST_FLAG_HEAL_PREDICTION
This commit is contained in:
parent
d52b124382
commit
87f092ed3d
2 changed files with 26 additions and 7 deletions
|
|
@ -4031,7 +4031,7 @@ void Spell::SendSpellStart()
|
||||||
|
|
||||||
DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "Sending SMSG_SPELL_START id=%u", m_spellInfo->Id);
|
DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "Sending SMSG_SPELL_START id=%u", m_spellInfo->Id);
|
||||||
|
|
||||||
uint32 castFlags = CAST_FLAG_UNKNOWN2;
|
uint32 castFlags = CAST_FLAG_HAS_TRAJECTORY;
|
||||||
if (m_spellInfo->runeCostID)
|
if (m_spellInfo->runeCostID)
|
||||||
castFlags |= CAST_FLAG_UNKNOWN19;
|
castFlags |= CAST_FLAG_UNKNOWN19;
|
||||||
|
|
||||||
|
|
@ -4040,6 +4040,12 @@ void Spell::SendSpellStart()
|
||||||
m_spellInfo->powerType != POWER_HEALTH)
|
m_spellInfo->powerType != POWER_HEALTH)
|
||||||
castFlags |= CAST_FLAG_PREDICTED_POWER;
|
castFlags |= CAST_FLAG_PREDICTED_POWER;
|
||||||
|
|
||||||
|
if (m_casttime && (IsSpellHaveEffect(m_spellInfo, SPELL_EFFECT_HEAL) || IsSpellHaveEffect(m_spellInfo, SPELL_EFFECT_HEAL_PCT)) ||
|
||||||
|
IsSpellHaveAura(m_spellInfo, SPELL_AURA_PERIODIC_HEAL))
|
||||||
|
{
|
||||||
|
castFlags |= CAST_FLAG_HEAL_PREDICTION;
|
||||||
|
}
|
||||||
|
|
||||||
WorldPacket data(SMSG_SPELL_START, (8 + 8 + 4 + 4 + 2));
|
WorldPacket data(SMSG_SPELL_START, (8 + 8 + 4 + 4 + 2));
|
||||||
if (m_CastItem)
|
if (m_CastItem)
|
||||||
data << m_CastItem->GetPackGUID();
|
data << m_CastItem->GetPackGUID();
|
||||||
|
|
@ -4089,11 +4095,24 @@ void Spell::SendSpellStart()
|
||||||
|
|
||||||
if (castFlags & CAST_FLAG_HEAL_PREDICTION)
|
if (castFlags & CAST_FLAG_HEAL_PREDICTION)
|
||||||
{
|
{
|
||||||
uint8 unk = 0;
|
uint8 type = DOT;
|
||||||
data << uint32(0);
|
int32 amt = 0;
|
||||||
data << uint8(unk);
|
for (int i = 0; i < MAX_EFFECT_INDEX; ++i)
|
||||||
if (unk == 2)
|
{
|
||||||
data << ObjectGuid().WriteAsPacked();
|
if (m_spellInfo->GetSpellEffectIdByIndex(SpellEffectIndex(i)) == SPELL_EFFECT_HEAL || m_spellInfo->GetSpellEffectIdByIndex(SpellEffectIndex(i)) == SPELL_EFFECT_HEAL_PCT)
|
||||||
|
{
|
||||||
|
type = 0;
|
||||||
|
Unit* target = m_targets.getUnitTarget() ? m_targets.getUnitTarget() : m_caster;
|
||||||
|
amt = CalculateDamage(SpellEffectIndex(i), target);
|
||||||
|
amt = m_caster->SpellHealingBonusDone(target, m_spellInfo, amt, HEAL);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
data << uint32(amt);
|
||||||
|
data << uint8(type);
|
||||||
|
if (type == DOT)
|
||||||
|
data << m_caster->GetPackGUID();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_caster->SendMessageToSet(&data, true);
|
m_caster->SendMessageToSet(&data, true);
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ enum SpellCastFlags
|
||||||
{
|
{
|
||||||
CAST_FLAG_NONE = 0x00000000,
|
CAST_FLAG_NONE = 0x00000000,
|
||||||
CAST_FLAG_HIDDEN_COMBATLOG = 0x00000001, // hide in combat log?
|
CAST_FLAG_HIDDEN_COMBATLOG = 0x00000001, // hide in combat log?
|
||||||
CAST_FLAG_UNKNOWN2 = 0x00000002,
|
CAST_FLAG_HAS_TRAJECTORY = 0x00000002,
|
||||||
CAST_FLAG_UNKNOWN3 = 0x00000004,
|
CAST_FLAG_UNKNOWN3 = 0x00000004,
|
||||||
CAST_FLAG_UNKNOWN4 = 0x00000008,
|
CAST_FLAG_UNKNOWN4 = 0x00000008,
|
||||||
CAST_FLAG_UNKNOWN5 = 0x00000010,
|
CAST_FLAG_UNKNOWN5 = 0x00000010,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue