*Fix build.
--HG-- branch : trunk
This commit is contained in:
+18
-27
@@ -6130,51 +6130,42 @@ void Spell::EffectSkinning(uint32 /*i*/)
|
|||||||
|
|
||||||
void Spell::EffectCharge(uint32 /*i*/)
|
void Spell::EffectCharge(uint32 /*i*/)
|
||||||
{
|
{
|
||||||
if (!unitTarget)
|
if(!m_caster)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Unit *target = m_targets.getUnitTarget();
|
||||||
|
if(!target)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
float x, y, z;
|
float x, y, z;
|
||||||
unitTarget->GetContactPoint(m_caster, x, y, z);
|
target->GetContactPoint(m_caster, x, y, z);
|
||||||
if (unitTarget->GetTypeId() != TYPEID_PLAYER)
|
m_caster->GetMotionMaster()->MoveCharge(x, y, z);
|
||||||
((Creature *)unitTarget)->StopMoving();
|
|
||||||
|
|
||||||
// Only send MOVEMENTFLAG_WALK_MODE, client has strange issues with other move flags
|
|
||||||
m_caster->SendMonsterMove(x, y, z, 0, m_caster->GetTypeId()==TYPEID_PLAYER ? MONSTER_MOVE_WALK : ((Creature*)m_caster)->GetMonsterMoveFlags(), 1);
|
|
||||||
|
|
||||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
|
||||||
m_caster->GetMap()->CreatureRelocation((Creature*)m_caster,x,y,z,m_caster->GetOrientation());
|
|
||||||
|
|
||||||
// not all charge effects used in negative spells
|
// not all charge effects used in negative spells
|
||||||
if (unitTarget != m_caster && !IsPositiveSpell(m_spellInfo->Id))
|
if ( !IsPositiveSpell(m_spellInfo->Id) && m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||||
m_caster->Attack(unitTarget,true);
|
m_caster->Attack(target, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spell::EffectCharge2(uint32 /*i*/)
|
void Spell::EffectCharge2(uint32 /*i*/)
|
||||||
{
|
{
|
||||||
float x, y, z;
|
float x, y, z;
|
||||||
if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)
|
if(m_targets.HasDst())
|
||||||
{
|
{
|
||||||
x = m_targets.m_destX;
|
x = m_targets.m_destX;
|
||||||
y = m_targets.m_destY;
|
y = m_targets.m_destY;
|
||||||
z = m_targets.m_destZ;
|
z = m_targets.m_destZ;
|
||||||
|
|
||||||
if (unitTarget->GetTypeId() != TYPEID_PLAYER)
|
|
||||||
((Creature *)unitTarget)->StopMoving();
|
|
||||||
}
|
}
|
||||||
else if (unitTarget && unitTarget != m_caster)
|
else if(Unit *target = m_targets.getUnitTarget())
|
||||||
unitTarget->GetContactPoint(m_caster, x, y, z);
|
{
|
||||||
|
target->GetContactPoint(m_caster, x, y, z);
|
||||||
|
// not all charge effects used in negative spells
|
||||||
|
if ( !IsPositiveSpell(m_spellInfo->Id) && m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||||
|
m_caster->Attack(target, true);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Only send MOVEMENTFLAG_WALK_MODE, client has strange issues with other move flags
|
m_caster->GetMotionMaster()->MoveCharge(x, y, z);
|
||||||
m_caster->SendMonsterMove(x, y, z, 0, m_caster->GetTypeId()==TYPEID_PLAYER ? MONSTER_MOVE_WALK : ((Creature*)m_caster)->GetMonsterMoveFlags(), 1);
|
|
||||||
|
|
||||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
|
||||||
m_caster->GetMap()->CreatureRelocation((Creature*)m_caster,x,y,z,m_caster->GetOrientation());
|
|
||||||
|
|
||||||
// not all charge effects used in negative spells
|
|
||||||
if (unitTarget && unitTarget != m_caster && !IsPositiveSpell(m_spellInfo->Id))
|
|
||||||
m_caster->Attack(unitTarget,true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spell::EffectKnockBack(uint32 i)
|
void Spell::EffectKnockBack(uint32 i)
|
||||||
|
|||||||
Reference in New Issue
Block a user