diff options
-rw-r--r-- | sql/updates/world/master/2017_12_10_00_world.sql | 37 | ||||
-rw-r--r-- | src/server/game/Spells/Spell.cpp | 18 |
2 files changed, 55 insertions, 0 deletions
diff --git a/sql/updates/world/master/2017_12_10_00_world.sql b/sql/updates/world/master/2017_12_10_00_world.sql new file mode 100644 index 00000000000..47ead119073 --- /dev/null +++ b/sql/updates/world/master/2017_12_10_00_world.sql @@ -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'); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 46f44c16744..715173c3ea6 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1080,6 +1080,11 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar { if (focusObject) AddGOTarget(focusObject, effMask); + else + { + SendCastResult(SPELL_FAILED_BAD_IMPLICIT_TARGETS); + finish(false); + } return; } break; @@ -1092,6 +1097,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; @@ -1104,6 +1114,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; } @@ -1111,6 +1123,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; } @@ -1122,6 +1136,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; @@ -1131,6 +1147,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; |