mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Spells: Added option to override orientation for target types using spell_target_position table (#29551)
This commit is contained in:
1
sql/updates/world/master/2024_01_08_01_world.sql
Normal file
1
sql/updates/world/master/2024_01_08_01_world.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE `spell_target_position` ADD COLUMN `Orientation` float NULL AFTER `PositionZ`;
|
||||
@@ -1144,8 +1144,8 @@ void SpellMgr::LoadSpellTargetPositions()
|
||||
|
||||
mSpellTargetPositions.clear(); // need for reload case
|
||||
|
||||
// 0 1 2 3 4 5
|
||||
QueryResult result = WorldDatabase.Query("SELECT ID, EffectIndex, MapID, PositionX, PositionY, PositionZ FROM spell_target_position");
|
||||
// 0 1 2 3 4 5 6
|
||||
QueryResult result = WorldDatabase.Query("SELECT ID, EffectIndex, MapID, PositionX, PositionY, PositionZ, Orientation FROM spell_target_position");
|
||||
if (!result)
|
||||
{
|
||||
TC_LOG_INFO("server.loading", ">> Loaded 0 spell target coordinates. DB table `spell_target_position` is empty.");
|
||||
@@ -1193,11 +1193,16 @@ void SpellMgr::LoadSpellTargetPositions()
|
||||
continue;
|
||||
}
|
||||
|
||||
// target facing is in degrees for 6484 & 9268... (blizz sucks)
|
||||
if (spellInfo->GetEffect(effIndex).PositionFacing > 2 * M_PI)
|
||||
st.target_Orientation = spellInfo->GetEffect(effIndex).PositionFacing * float(M_PI) / 180;
|
||||
if (!fields[6].IsNull())
|
||||
st.target_Orientation = fields[6].GetFloat();
|
||||
else
|
||||
st.target_Orientation = spellInfo->GetEffect(effIndex).PositionFacing;
|
||||
{
|
||||
// target facing is in degrees for 6484 & 9268... (blizz sucks)
|
||||
if (spellInfo->GetEffect(effIndex).PositionFacing > 2 * float(M_PI))
|
||||
st.target_Orientation = spellInfo->GetEffect(effIndex).PositionFacing * float(M_PI) / 180;
|
||||
else
|
||||
st.target_Orientation = spellInfo->GetEffect(effIndex).PositionFacing;
|
||||
}
|
||||
|
||||
auto hasTarget = [&](Targets target)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user