Core/Spells: Spells with TARGET_SELECT_CATEGORY_NEARBY requires a valid target (#20954)

This commit is contained in:
joschiwald authored and Aokromes committed 2017-12-10 11:24:27 +01:00
1 parent 2cae35fe86
commit 9ea8214254
2 files changed
+55

No files matched your search

@@ -0,0 +1,37 @@
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry` IN (
8593,
13982,
29528,
31225,
31333,
34367,
39246,
42788,
44422,
44550,
44610,
46488,
47374,
47469,
47634,
47911,
48363,
49367,
55161,
56765,
57908,
65200,
65258,
65265,
70586,
77585);
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (29528,44610,46488,57908,70586);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(13,1,29528,0,0,31,0,3,16518,0,0,0,0,'',NULL),
(13,1,44610,0,0,31,0,3,24824,0,0,0,0,'','Allow spell Collect Data only on Iron Dwarf Relics'),
(13,1,46488,0,0,31,0,3,26817,0,0,0,0,'',NULL),
(13,1,46488,0,0,36,0,0, 0,0,1,0,0,'',NULL),
(13,1,57908,0,0,31,0,3,26631,0,0,0,0,'',NULL),
(13,1,57908,0,0,36,0,0, 0,0,1,0,0,'',NULL),
(13,1,70586,0,0,31,0,3,37852,0,0,0,0,'','Throw Quel''delar on Quel''delar skull');
+18
View File
@@ -1054,6 +1054,11 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
{
if (focusObject)
AddGOTarget(focusObject, effMask);
else
{
SendCastResult(SPELL_FAILED_BAD_IMPLICIT_TARGETS);
finish(false);
}
return;
}
break;
@@ -1066,6 +1071,11 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
CallScriptDestinationTargetSelectHandlers(dest, effIndex, targetType);
m_targets.SetDst(dest);
}
else
{
SendCastResult(SPELL_FAILED_BAD_IMPLICIT_TARGETS);
finish(false);
}
return;
}
break;
@@ -1078,6 +1088,8 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
if (!target)
{
TC_LOG_DEBUG("spells", "Spell::SelectImplicitNearbyTargets: cannot find nearby target for spell ID %u, effect %u", m_spellInfo->Id, effIndex);
SendCastResult(SPELL_FAILED_BAD_IMPLICIT_TARGETS);
finish(false);
return;
}
@@ -1085,6 +1097,8 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
if (!target)
{
TC_LOG_DEBUG("spells", "Spell::SelectImplicitNearbyTargets: OnObjectTargetSelect script hook for spell Id %u set NULL target, effect %u", m_spellInfo->Id, effIndex);
SendCastResult(SPELL_FAILED_BAD_IMPLICIT_TARGETS);
finish(false);
return;
}
@@ -1096,6 +1110,8 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
else
{
TC_LOG_DEBUG("spells", "Spell::SelectImplicitNearbyTargets: OnObjectTargetSelect script hook for spell Id %u set object of wrong type, expected unit, got %s, effect %u", m_spellInfo->Id, target->GetGUID().GetTypeName(), effMask);
SendCastResult(SPELL_FAILED_BAD_IMPLICIT_TARGETS);
finish(false);
return;
}
break;
@@ -1105,6 +1121,8 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
else
{
TC_LOG_DEBUG("spells", "Spell::SelectImplicitNearbyTargets: OnObjectTargetSelect script hook for spell Id %u set object of wrong type, expected gameobject, got %s, effect %u", m_spellInfo->Id, target->GetGUID().GetTypeName(), effMask);
SendCastResult(SPELL_FAILED_BAD_IMPLICIT_TARGETS);
finish(false);
return;
}
break;