From 53a469a52b72e0a5e55e2d7f8c92be766247a50b Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 4 Jul 2014 18:03:59 +0200 Subject: [PATCH 1/4] DB/Skills: Corrected languages for night elves, taurens and blood elves --- .../world/2014_07_04_00_world_playercreateinfo_skills.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sql/updates/world/2014_07_04_00_world_playercreateinfo_skills.sql diff --git a/sql/updates/world/2014_07_04_00_world_playercreateinfo_skills.sql b/sql/updates/world/2014_07_04_00_world_playercreateinfo_skills.sql new file mode 100644 index 0000000000..b058e32079 --- /dev/null +++ b/sql/updates/world/2014_07_04_00_world_playercreateinfo_skills.sql @@ -0,0 +1,5 @@ +DELETE FROM `playercreateinfo_skills` WHERE `skill` IN (113,115,137); +INSERT INTO `playercreateinfo_skills` VALUES +(512,0,137,0,'Language: Thalassian'), +(8,0,113,0,'Language: Darnassian'), +(32,0,115,0,'Language: Taurahe'); From 4302226a853811f1346ca96a78af0e649cdb4580 Mon Sep 17 00:00:00 2001 From: jackpoz Date: Fri, 4 Jul 2014 22:00:46 +0200 Subject: [PATCH 2/4] Core/Spells: Fix Charge pathing Fallback to "straight path" pathing when raycast doesn't find a valid path. Fixes #7931 --- src/server/game/Spells/Spell.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 0e0443cc67..1407a4975d 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5046,12 +5046,19 @@ SpellCastResult Spell::CheckCast(bool strict) //target->GetContactPoint(m_caster, pos.m_positionX, pos.m_positionY, pos.m_positionZ); Position pos = target->GetFirstCollisionPosition(CONTACT_DISTANCE, target->GetRelativeAngle(m_caster)); + //first try with raycast, if it fails fall back to normal path m_preGeneratedPath.SetPathLengthLimit(m_spellInfo->GetMaxRange(true) * 1.5f); bool result = m_preGeneratedPath.CalculatePath(pos.m_positionX, pos.m_positionY, pos.m_positionZ + target->GetObjectSize(), false, true); if (m_preGeneratedPath.GetPathType() & PATHFIND_SHORT) return SPELL_FAILED_OUT_OF_RANGE; else if (!result || m_preGeneratedPath.GetPathType() & PATHFIND_NOPATH) - return SPELL_FAILED_NOPATH; + { + result = m_preGeneratedPath.CalculatePath(pos.m_positionX, pos.m_positionY, pos.m_positionZ + target->GetObjectSize(), false, false); + if (m_preGeneratedPath.GetPathType() & PATHFIND_SHORT) + return SPELL_FAILED_OUT_OF_RANGE; + else if (!result || m_preGeneratedPath.GetPathType() & PATHFIND_NOPATH) + return SPELL_FAILED_NOPATH; + } } break; } From 124398feefc64fe77ab01f469fbde645edbeb80f Mon Sep 17 00:00:00 2001 From: Trisjdc Date: Fri, 4 Jul 2014 22:22:28 +0100 Subject: [PATCH 3/4] Core/Spells: Improve charge path logic, get a point to the target and then reduce it by the necessary distance --- src/server/game/Movement/PathGenerator.cpp | 38 ++++++++++++++++++++++ src/server/game/Movement/PathGenerator.h | 2 ++ src/server/game/Spells/Spell.cpp | 14 ++++---- 3 files changed, 48 insertions(+), 6 deletions(-) diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index d6912bac7c..3140fc2329 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -882,3 +882,41 @@ float PathGenerator::Dist3DSqr(G3D::Vector3 const& p1, G3D::Vector3 const& p2) c { return (p1 - p2).squaredLength(); } + +void PathGenerator::ReducePathLenghtByDist(float dist) +{ + if (GetPathType() == PATHFIND_BLANK) + { + TC_LOG_ERROR("maps", "PathGenerator::ReducePathLenghtByDist called before path was built"); + return; + } + + if (_pathPoints.size() < 2) // path building failure + return; + + uint32 i = _pathPoints.size(); + G3D::Vector3 nextVec = _pathPoints[--i]; + while (i > 0) + { + G3D::Vector3 currVec = _pathPoints[--i]; + G3D::Vector3 diffVec = (nextVec - currVec); + float len = diffVec.length(); + if (len > dist) + { + float step = dist / len; + // same as nextVec + _pathPoints[i + 1] -= diffVec * step; + _pathPoints.resize(i + 2); + break; + } + else if (i == 0) // at second point + { + _pathPoints[1] = _pathPoints[0]; + _pathPoints.resize(2); + break; + } + + dist -= len; + nextVec = currVec; // we're going backwards + } +} diff --git a/src/server/game/Movement/PathGenerator.h b/src/server/game/Movement/PathGenerator.h index 6e0d72ec8d..a9a13c3725 100644 --- a/src/server/game/Movement/PathGenerator.h +++ b/src/server/game/Movement/PathGenerator.h @@ -72,6 +72,8 @@ class PathGenerator PathType GetPathType() const { return _type; } + void ReducePathLenghtByDist(float dist); // path must be already built + private: dtPolyRef _pathPolyRefs[MAX_PATH_LENGTH]; // array of detour polygon references diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 1407a4975d..0d7dd8819a 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5043,22 +5043,24 @@ SpellCastResult Spell::CheckCast(bool strict) if (!target) return SPELL_FAILED_DONT_REPORT; - //target->GetContactPoint(m_caster, pos.m_positionX, pos.m_positionY, pos.m_positionZ); - Position pos = target->GetFirstCollisionPosition(CONTACT_DISTANCE, target->GetRelativeAngle(m_caster)); + float objSize = target->GetObjectSize(); + float range = m_spellInfo->GetMaxRange(true, m_caster, this) * 1.5f + objSize; // can't be overly strict - //first try with raycast, if it fails fall back to normal path - m_preGeneratedPath.SetPathLengthLimit(m_spellInfo->GetMaxRange(true) * 1.5f); - bool result = m_preGeneratedPath.CalculatePath(pos.m_positionX, pos.m_positionY, pos.m_positionZ + target->GetObjectSize(), false, true); + m_preGeneratedPath.SetPathLengthLimit(range); + // first try with raycast, if it fails fall back to normal path + bool result = m_preGeneratedPath.CalculatePath(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ() + target->GetObjectSize(), false, true); if (m_preGeneratedPath.GetPathType() & PATHFIND_SHORT) return SPELL_FAILED_OUT_OF_RANGE; else if (!result || m_preGeneratedPath.GetPathType() & PATHFIND_NOPATH) { - result = m_preGeneratedPath.CalculatePath(pos.m_positionX, pos.m_positionY, pos.m_positionZ + target->GetObjectSize(), false, false); + result = m_preGeneratedPath.CalculatePath(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ() + target->GetObjectSize(), false, false); if (m_preGeneratedPath.GetPathType() & PATHFIND_SHORT) return SPELL_FAILED_OUT_OF_RANGE; else if (!result || m_preGeneratedPath.GetPathType() & PATHFIND_NOPATH) return SPELL_FAILED_NOPATH; } + + m_preGeneratedPath.ReducePathLenghtByDist(objSize); // move back } break; } From 2042b095266cabd79b26d8325d4dee600260d4c9 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sat, 5 Jul 2014 08:28:32 +0200 Subject: [PATCH 4/4] DB/Creature: Fix Abyssal Flamewalker By mario-64 and dr-j, closes #10699 --- sql/updates/world/2014_07_05_00_world_misc.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sql/updates/world/2014_07_05_00_world_misc.sql diff --git a/sql/updates/world/2014_07_05_00_world_misc.sql b/sql/updates/world/2014_07_05_00_world_misc.sql new file mode 100644 index 0000000000..027a23802b --- /dev/null +++ b/sql/updates/world/2014_07_05_00_world_misc.sql @@ -0,0 +1,7 @@ +-- +DELETE FROM smart_scripts WHERE entryorguid in (25001,25002,24999) AND event_type=6; +UPDATE `smart_scripts` SET `id`=1 WHERE `entryorguid`=25001 AND `id`=0 AND `action_param1` =12744; +DELETE FROM smart_scripts WHERE entryorguid in (25001) AND `id`>0; + +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(25001,0,0,0,11,0,100,0,0,0,0,0,11,45227,0,0,0,0,0,1,0,0,0,0,0,0,0,'Abyssal Flamewalker - On spawn - Cast Abyssal Meteor Fall');