Core/Spells: Added option to override orientation for target types using spell_target_position table
Port From (https://github.com/TrinityCore/TrinityCore/commit/e8849ca5a14719e7d395db7907bac26705f25dbf)
This commit is contained in:
@@ -989,8 +989,8 @@ namespace Game.Entities
|
|||||||
|
|
||||||
mSpellTargetPositions.Clear(); // need for reload case
|
mSpellTargetPositions.Clear(); // need for reload case
|
||||||
|
|
||||||
// 0 1 2 3 4 5
|
// 0 1 2 3 4 5 6
|
||||||
SQLResult result = DB.World.Query("SELECT ID, EffectIndex, MapID, PositionX, PositionY, PositionZ FROM spell_target_position");
|
SQLResult result = DB.World.Query("SELECT ID, EffectIndex, MapID, PositionX, PositionY, PositionZ, Orientation FROM spell_target_position");
|
||||||
if (result.IsEmpty())
|
if (result.IsEmpty())
|
||||||
{
|
{
|
||||||
Log.outInfo(LogFilter.ServerLoading, "Loaded 0 spell target coordinates. DB table `spell_target_position` is empty.");
|
Log.outInfo(LogFilter.ServerLoading, "Loaded 0 spell target coordinates. DB table `spell_target_position` is empty.");
|
||||||
@@ -1035,11 +1035,16 @@ namespace Game.Entities
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!result.IsNull(6))
|
||||||
|
st.target_Orientation = result.Read<float>(6);
|
||||||
|
else
|
||||||
|
{
|
||||||
// target facing is in degrees for 6484 & 9268... (blizz sucks)
|
// target facing is in degrees for 6484 & 9268... (blizz sucks)
|
||||||
if (spellInfo.GetEffect(effIndex).PositionFacing > 2 * Math.PI)
|
if (spellInfo.GetEffect(effIndex).PositionFacing > 2 * MathF.PI)
|
||||||
st.target_Orientation = spellInfo.GetEffect(effIndex).PositionFacing * (float)Math.PI / 180;
|
st.target_Orientation = spellInfo.GetEffect(effIndex).PositionFacing * MathF.PI / 180;
|
||||||
else
|
else
|
||||||
st.target_Orientation = spellInfo.GetEffect(effIndex).PositionFacing;
|
st.target_Orientation = spellInfo.GetEffect(effIndex).PositionFacing;
|
||||||
|
}
|
||||||
|
|
||||||
bool hasTarget(Targets target)
|
bool hasTarget(Targets target)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user