mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[6889] Backport some not client version specific changes and fixes from 303 branch.
This commit is contained in:
parent
480a935216
commit
3da9f3f4cc
56 changed files with 1998 additions and 377 deletions
|
|
@ -270,6 +270,7 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 origi
|
|||
m_triggeringContainer = triggeringContainer;
|
||||
m_referencedFromCurrentSpell = false;
|
||||
m_executedCurrently = false;
|
||||
m_delayStart = 0;
|
||||
m_delayAtDamageCount = 0;
|
||||
|
||||
m_applyMultiplierMask = 0;
|
||||
|
|
@ -2624,17 +2625,13 @@ void Spell::SendSpellStart()
|
|||
if(!IsNeedSendToClient())
|
||||
return;
|
||||
|
||||
sLog.outDebug("Sending SMSG_SPELL_START id=%u",m_spellInfo->Id);
|
||||
sLog.outDebug("Sending SMSG_SPELL_START id=%u", m_spellInfo->Id);
|
||||
|
||||
uint16 castFlags = CAST_FLAG_UNKNOWN1;
|
||||
uint32 castFlags = CAST_FLAG_UNKNOWN1;
|
||||
if(IsRangedSpell())
|
||||
castFlags |= CAST_FLAG_AMMO;
|
||||
|
||||
Unit * target;
|
||||
if(!m_targets.getUnitTarget())
|
||||
target = m_caster;
|
||||
else
|
||||
target = m_targets.getUnitTarget();
|
||||
Unit *target = m_targets.getUnitTarget() ? m_targets.getUnitTarget() : m_caster;
|
||||
|
||||
WorldPacket data(SMSG_SPELL_START, (8+8+4+4+2));
|
||||
if(m_CastItem)
|
||||
|
|
@ -2662,17 +2659,13 @@ void Spell::SendSpellGo()
|
|||
if(!IsNeedSendToClient())
|
||||
return;
|
||||
|
||||
sLog.outDebug("Sending SMSG_SPELL_GO id=%u",m_spellInfo->Id);
|
||||
sLog.outDebug("Sending SMSG_SPELL_GO id=%u", m_spellInfo->Id);
|
||||
|
||||
Unit * target;
|
||||
if(!m_targets.getUnitTarget())
|
||||
target = m_caster;
|
||||
else
|
||||
target = m_targets.getUnitTarget();
|
||||
Unit *target = m_targets.getUnitTarget() ? m_targets.getUnitTarget() : m_caster;
|
||||
|
||||
uint16 castFlags = CAST_FLAG_UNKNOWN3;
|
||||
uint32 castFlags = CAST_FLAG_UNKNOWN3;
|
||||
if(IsRangedSpell())
|
||||
castFlags |= CAST_FLAG_AMMO;
|
||||
castFlags |= CAST_FLAG_AMMO; // arrows/bullets visual
|
||||
|
||||
WorldPacket data(SMSG_SPELL_GO, 50); // guess size
|
||||
if(m_CastItem)
|
||||
|
|
@ -2773,7 +2766,7 @@ void Spell::SendLogExecute()
|
|||
data << uint32(count1); // count1 (effect count?)
|
||||
for(uint32 i = 0; i < count1; ++i)
|
||||
{
|
||||
data << uint32(m_spellInfo->Effect[0]); // spell effect?
|
||||
data << uint32(m_spellInfo->Effect[0]); // spell effect
|
||||
uint32 count2 = 1;
|
||||
data << uint32(count2); // count2 (target count?)
|
||||
for(uint32 j = 0; j < count2; ++j)
|
||||
|
|
@ -2897,7 +2890,7 @@ void Spell::SendChannelUpdate(uint32 time)
|
|||
|
||||
WorldPacket data( MSG_CHANNEL_UPDATE, 8+4 );
|
||||
data.append(m_caster->GetPackGUID());
|
||||
data << time;
|
||||
data << uint32(time);
|
||||
|
||||
((Player*)m_caster)->GetSession()->SendPacket( &data );
|
||||
}
|
||||
|
|
@ -2934,8 +2927,8 @@ void Spell::SendChannelStart(uint32 duration)
|
|||
{
|
||||
WorldPacket data( MSG_CHANNEL_START, (8+4+4) );
|
||||
data.append(m_caster->GetPackGUID());
|
||||
data << m_spellInfo->Id;
|
||||
data << duration;
|
||||
data << uint32(m_spellInfo->Id);
|
||||
data << uint32(duration);
|
||||
|
||||
((Player*)m_caster)->GetSession()->SendPacket( &data );
|
||||
}
|
||||
|
|
@ -2961,8 +2954,8 @@ void Spell::SendPlaySpellVisual(uint32 SpellID)
|
|||
return;
|
||||
|
||||
WorldPacket data(SMSG_PLAY_SPELL_VISUAL, 12);
|
||||
data << m_caster->GetGUID();
|
||||
data << SpellID;
|
||||
data << uint64(m_caster->GetGUID());
|
||||
data << uint32(SpellID); // spell visual id?
|
||||
((Player*)m_caster)->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
|
|
@ -3963,7 +3956,9 @@ uint8 Spell::CanCast(bool strict)
|
|||
|
||||
if(int32(m_targets.getUnitTarget()->getLevel()) > CalculateDamage(i,m_targets.getUnitTarget()))
|
||||
return SPELL_FAILED_HIGHLEVEL;
|
||||
};break;
|
||||
|
||||
break;
|
||||
}
|
||||
case SPELL_AURA_MOUNTED:
|
||||
{
|
||||
if (m_caster->IsInWater())
|
||||
|
|
@ -3996,7 +3991,9 @@ uint8 Spell::CanCast(bool strict)
|
|||
// can be casted at non-friendly unit or own pet/charm
|
||||
if(m_caster->IsFriendlyTo(m_targets.getUnitTarget()))
|
||||
return SPELL_FAILED_TARGET_FRIENDLY;
|
||||
};break;
|
||||
|
||||
break;
|
||||
}
|
||||
case SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED:
|
||||
case SPELL_AURA_FLY:
|
||||
{
|
||||
|
|
@ -4007,7 +4004,9 @@ uint8 Spell::CanCast(bool strict)
|
|||
GetVirtualMapForMapAndZone(m_caster->GetMapId(),m_caster->GetZoneId()) != 530)
|
||||
return SPELL_FAILED_NOT_HERE;
|
||||
}
|
||||
};break;
|
||||
|
||||
break;
|
||||
}
|
||||
case SPELL_AURA_PERIODIC_MANA_LEECH:
|
||||
{
|
||||
if (!m_targets.getUnitTarget())
|
||||
|
|
@ -4018,9 +4017,11 @@ uint8 Spell::CanCast(bool strict)
|
|||
|
||||
if(m_targets.getUnitTarget()->getPowerType()!=POWER_MANA)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
break;
|
||||
}
|
||||
default:break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4143,7 +4144,7 @@ uint8 Spell::CheckCasterAuras() const
|
|||
else if(m_caster->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED) && m_spellInfo->PreventionType==SPELL_PREVENTION_TYPE_PACIFY)
|
||||
prevented_reason = SPELL_FAILED_PACIFIED;
|
||||
|
||||
// Attr must make flag drop spell totally immuned from all effects
|
||||
// Attr must make flag drop spell totally immune from all effects
|
||||
if(prevented_reason)
|
||||
{
|
||||
if(school_immune || mechanic_immune || dispel_immune)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue