Fix TeleportUnits spells

This commit is contained in:
hondacrx
2017-07-07 11:09:03 -04:00
parent 5f763f47a6
commit 0437beccfd
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -765,7 +765,7 @@ namespace Game.Spells
if (st != null) if (st != null)
{ {
/// @todo fix this check /// @todo fix this check
if (m_spellInfo.HasEffect(SpellEffectName.TeleportUnitsOld) || m_spellInfo.HasEffect(SpellEffectName.Bind)) if (m_spellInfo.HasEffect(SpellEffectName.TeleportUnits) || m_spellInfo.HasEffect(SpellEffectName.Bind))
dest = new SpellDestination(st.target_X, st.target_Y, st.target_Z, st.target_Orientation, st.target_mapId); dest = new SpellDestination(st.target_X, st.target_Y, st.target_Z, st.target_Orientation, st.target_mapId);
else if (st.target_mapId == m_caster.GetMapId()) else if (st.target_mapId == m_caster.GetMapId())
dest = new SpellDestination(st.target_X, st.target_Y, st.target_Z, st.target_Orientation); dest = new SpellDestination(st.target_X, st.target_Y, st.target_Z, st.target_Orientation);
+6
View File
@@ -1492,6 +1492,12 @@ namespace Game.Entities
continue; continue;
} }
// target facing is in degrees for 6484 & 9268... (blizz sucks)
if (effect.PositionFacing > 2 * Math.PI)
st.target_Orientation = effect.PositionFacing * (float)Math.PI / 180;
else
st.target_Orientation = effect.PositionFacing;
if (effect.TargetA.GetTarget() == Targets.DestDb || effect.TargetB.GetTarget() == Targets.DestDb) if (effect.TargetA.GetTarget() == Targets.DestDb || effect.TargetB.GetTarget() == Targets.DestDb)
{ {
var key = new KeyValuePair<uint, uint>(spellId, effIndex); var key = new KeyValuePair<uint, uint>(spellId, effIndex);