From 9265d346be7b4284cc8279726b9464138db83f7d Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Sun, 19 Dec 2021 07:53:53 -0300 Subject: [PATCH] fix(Core/GridNotifiers): fix tempsummons not finding nearby creatures (#9749) * fix(Core/GridNotifiers): fix tempsummons not finding nearby creatures * fix lord valathak being summoned along mor --- .../pending_db_world/rev_1639776045356880700.sql | 11 +++++++++++ src/server/game/Grids/Notifiers/GridNotifiers.h | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 data/sql/updates/pending_db_world/rev_1639776045356880700.sql diff --git a/data/sql/updates/pending_db_world/rev_1639776045356880700.sql b/data/sql/updates/pending_db_world/rev_1639776045356880700.sql new file mode 100644 index 000000000..0421624cb --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1639776045356880700.sql @@ -0,0 +1,11 @@ +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1639776045356880700'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=181045 AND `SourceGroup` IN (1, 5); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(22, 1, 181045, 1, 0, 29, 1, 16044, 30, 0, 0, 0, 0, '', 'Brazier of Beckoning only run SAI if Mor Grayhoof Trigger is near'), +(22, 5, 181045, 1, 0, 29, 1, 16048, 30, 0, 0, 0, 0, '', 'Brazier of Beckoning only run SAI if Lord Vathalak Trigger is near'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=181051 AND `SourceGroup` IN (1, 5); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(22, 1, 181051, 1, 0, 29, 1, 16044, 30, 0, 0, 0, 0, '', 'Brazier of Invocation only run SAI if Mor Grayhoof Trigger is near'), +(22, 5, 181051, 1, 0, 29, 1, 16048, 30, 0, 0, 0, 0, '', 'Brazier of Invocation only run SAI if Lord Vathalak Trigger is near'); diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 540d49112..3360415cd 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -1213,7 +1213,7 @@ namespace Acore bool operator()(Creature* u) { - if (u->GetEntry() == i_entry && u->IsAlive() == i_alive && i_obj.IsWithinDistInMap(u, i_range)) + if (u->GetEntry() == i_entry && u->IsAlive() == i_alive && i_obj.IsWithinDist(u, i_range) && i_obj.InSamePhase(u)) { i_range = i_obj.GetDistance(u); // use found unit range as new range limit for next check return true;