Added spell cast flags research.

This commit is contained in:
TOM_RUS 2011-05-10 16:10:32 +04:00
parent 6e1988bfc7
commit 4181b8f28b
5 changed files with 65 additions and 53 deletions

View file

@ -3588,12 +3588,12 @@ void Spell::SendSpellStart()
DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "Sending SMSG_SPELL_START id=%u", m_spellInfo->Id);
uint32 castFlags = CAST_FLAG_UNKNOWN1;
uint32 castFlags = CAST_FLAG_UNKNOWN2;
if (IsRangedSpell())
castFlags |= CAST_FLAG_AMMO;
if (m_spellInfo->runeCostID)
castFlags |= CAST_FLAG_UNKNOWN10;
castFlags |= CAST_FLAG_UNKNOWN19;
WorldPacket data(SMSG_SPELL_START, (8+8+4+4+2));
if (m_CastItem)
@ -3602,16 +3602,17 @@ void Spell::SendSpellStart()
data << m_caster->GetPackGUID();
data << m_caster->GetPackGUID();
data << uint8(m_cast_count); // pending spell cast?
data << uint8(m_cast_count); // pending spell cast
data << uint32(m_spellInfo->Id); // spellId
data << uint32(castFlags); // cast flags
data << uint32(m_timer); // delay?
data << m_targets;
if ( castFlags & CAST_FLAG_UNKNOWN6 ) // predicted power?
if (castFlags & CAST_FLAG_PREDICTED_POWER) // predicted power
data << uint32(0);
if ( castFlags & CAST_FLAG_UNKNOWN7 ) // rune cooldowns list
if (castFlags & CAST_FLAG_PREDICTED_RUNES) // predicted runes
{
uint8 v1 = 0;//m_runesState;
uint8 v2 = 0;//((Player*)m_caster)->GetRunesState();
@ -3626,13 +3627,13 @@ void Spell::SendSpellStart()
}
}
if ( castFlags & CAST_FLAG_AMMO )
if (castFlags & CAST_FLAG_AMMO) // projectile info
WriteAmmoToPacket(&data);
if ( castFlags & CAST_FLAG_UNKNOWN21 )
if (castFlags & CAST_FLAG_IMMUNITY) // cast immunity
{
data << uint32(0);
data << uint32(0);
data << uint32(0); // used for SetCastSchoolImmunities
data << uint32(0); // used for SetCastImmunities
}
m_caster->SendMessageToSet(&data, true);
@ -3641,25 +3642,25 @@ void Spell::SendSpellStart()
void Spell::SendSpellGo()
{
// not send invisible spell casting
if(!IsNeedSendToClient())
if (!IsNeedSendToClient())
return;
DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "Sending SMSG_SPELL_GO id=%u", m_spellInfo->Id);
uint32 castFlags = CAST_FLAG_UNKNOWN3;
if(IsRangedSpell())
uint32 castFlags = CAST_FLAG_UNKNOWN9;
if (IsRangedSpell())
castFlags |= CAST_FLAG_AMMO; // arrows/bullets visual
if((m_caster->GetTypeId() == TYPEID_PLAYER) && (m_caster->getClass() == CLASS_DEATH_KNIGHT) && m_spellInfo->runeCostID)
if ((m_caster->GetTypeId() == TYPEID_PLAYER) && (m_caster->getClass() == CLASS_DEATH_KNIGHT) && m_spellInfo->runeCostID)
{
castFlags |= CAST_FLAG_UNKNOWN10; // same as in SMSG_SPELL_START
castFlags |= CAST_FLAG_UNKNOWN6; // makes cooldowns visible
castFlags |= CAST_FLAG_UNKNOWN7; // rune cooldowns list
castFlags |= CAST_FLAG_UNKNOWN19; // same as in SMSG_SPELL_START
castFlags |= CAST_FLAG_PREDICTED_POWER; // makes cooldowns visible
castFlags |= CAST_FLAG_PREDICTED_RUNES; // rune cooldowns list
}
WorldPacket data(SMSG_SPELL_GO, 50); // guess size
if(m_CastItem)
if (m_CastItem)
data << m_CastItem->GetPackGUID();
else
data << m_caster->GetPackGUID();
@ -3668,16 +3669,16 @@ void Spell::SendSpellGo()
data << uint8(m_cast_count); // pending spell cast?
data << uint32(m_spellInfo->Id); // spellId
data << uint32(castFlags); // cast flags
data << uint32(WorldTimer::getMSTime()); // timestamp
data << uint32(WorldTimer::getMSTime()); // timestamp
WriteSpellGoTargets(&data);
data << m_targets;
if ( castFlags & CAST_FLAG_UNKNOWN6 ) // unknown wotlk, predicted power?
if (castFlags & CAST_FLAG_PREDICTED_POWER) // predicted power
data << uint32(0);
if ( castFlags & CAST_FLAG_UNKNOWN7 ) // rune cooldowns list
if (castFlags & CAST_FLAG_PREDICTED_RUNES) // predicted runes
{
uint8 v1 = m_runesState;
uint8 v2 = m_caster->getClass() == CLASS_DEATH_KNIGHT ? ((Player*)m_caster)->GetRunesState() : 0;
@ -3692,26 +3693,37 @@ void Spell::SendSpellGo()
}
}
if ( castFlags & CAST_FLAG_UNKNOWN4 ) // unknown wotlk
if (castFlags & CAST_FLAG_ADJUST_MISSILE) // adjust missile trajectory duration
{
data << float(0);
data << uint32(0);
}
if ( castFlags & CAST_FLAG_AMMO )
if (castFlags & CAST_FLAG_AMMO) // projectile info
WriteAmmoToPacket(&data);
if ( castFlags & CAST_FLAG_UNKNOWN5 ) // unknown wotlk
if (castFlags & CAST_FLAG_VISUAL_CHAIN) // spell visual chain effect
{
data << uint32(0);
data << uint32(0);
data << uint32(0); // SpellVisual.dbc id?
data << uint32(0); // overrides previous field if > 0 and violencelevel client cvar < 2
}
if ( m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION )
if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)
{
data << uint8(0); // The value increase for each time, can remind of a cast count for the spell
}
if (m_targets.m_targetMask & TARGET_FLAG_VISUAL_CHAIN) // probably used (or can be used) with CAST_FLAG_VISUAL_CHAIN flag
{
data << uint32(0); // count
//for(int = 0; i < count; ++i)
//{
// // position and guid?
// data << float(0) << float(0) << float(0) << uint64(0);
//}
}
m_caster->SendMessageToSet(&data, true);
}