Core/Spells: fixed focusing the correct target when a channel spell has a caster and a unit target at once

This commit is contained in:
Ovahlord committed 2018-10-11 19:48:59 +02:00
1 parent f90c7801d5
commit f0972517e8
2 files changed
+19 -5

No files matched your search

+5 -4
View File
@@ -51,8 +51,8 @@ UPDATE `creature_template` SET `minlevel`= 88, `maxlevel`= 88, `exp`= 3, `factio
UPDATE `creature_template` SET `unit_flags`= 33555200, `flags_extra`= 128, `ScriptName`= 'npc_conclave_of_wind_ravenous_creeper_trigger' WHERE `entry`= 45813;
-- Soothing Breeze
UPDATE `creature_template` SET `unit_flags`= 33554432, `flags_extra`= 128 WHERE `entry`= 46246;
-- North Wind
UPDATE `creature_template` SET `unit_flags`= 33554432, `flags_extra`= 128 WHERE `entry`= 47926;
-- North Wind, East Wind and West Wind
UPDATE `creature_template` SET `unit_flags`= 33554432, `flags_extra`= 128, `InhabitType`= 4 WHERE `entry` IN (47926, 47924, 47925);
-- Ravenous Creeper
UPDATE `creature_template` SET `ScriptName`= 'npc_conclave_of_wind_ravenous_creeper' WHERE `entry`= 45812;
-- Tornado
@@ -107,7 +107,8 @@ DELETE FROM `spell_script_names` WHERE `ScriptName` IN
('spell_conclave_of_wind_winds_pre_effect_warning',
'spell_conclave_of_wind_teleport_to_center',
'spell_conclave_of_wind_winds',
'spell_conclave_of_wind_wind_blast');
'spell_conclave_of_wind_wind_blast',
'spell_conclave_of_wind_wind_blast_triggered');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(96508, 'spell_conclave_of_wind_winds_pre_effect_warning'),
@@ -126,7 +127,7 @@ INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(93182, 'spell_conclave_of_wind_winds'),
(93183, 'spell_conclave_of_wind_winds'),
(86193, 'spell_conclave_of_wind_wind_blast'),
(85480, 'spell_conclave_of_wind_wind_blast');
(85480, 'spell_conclave_of_wind_wind_blast_triggered');
DELETE FROM `conditions` WHERE `SourceEntry` IN (89844, 89843) AND `SourceTypeOrReferenceId`= 13;
+14 -1
View File
@@ -4518,8 +4518,21 @@ void Spell::SendChannelStart(uint32 duration)
{
ObjectGuid channelTarget = m_targets.GetObjectTargetGUID();
if (!channelTarget && !m_spellInfo->NeedsExplicitUnitTarget())
if (m_UniqueTargetInfo.size() + m_UniqueGOTargetInfo.size() == 1) // this is for TARGET_SELECT_CATEGORY_NEARBY
{
// this is for TARGET_SELECT_CATEGORY_NEARBY
if (m_UniqueTargetInfo.size() + m_UniqueGOTargetInfo.size() == 1)
channelTarget = !m_UniqueTargetInfo.empty() ? m_UniqueTargetInfo.front().targetGUID : m_UniqueGOTargetInfo.front().targetGUID;
else
{
// We assume that when we have a channel spell with more than one unique unit target that there is a caster and a target.
// We don't want the caster but the target so we are looking for a non-caster entry within the target list
for (auto itr : m_UniqueTargetInfo)
{
if (itr.targetGUID != m_caster->GetGUID())
channelTarget = itr.targetGUID;
}
}
}
WorldPacket data(MSG_CHANNEL_START, (8+4+4));
data << m_caster->GetPackGUID();