Core/SmartAI: added TARGET_OWNER_OR_SUMMONER, useful if you have a creature summoned by a spell, you can use Summoner as target

--HG--
branch : trunk
This commit is contained in:
Rat
2010-11-07 18:02:33 +01:00
parent 13559bde9f
commit 205736ea84
3 changed files with 11 additions and 1 deletions
@@ -1440,6 +1440,14 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder e, Unit* invoker)
l->push_back(target);
break;
}
case SMART_TARGET_OWNER_OR_SUMMONER:
{
if (!me) return NULL;
uint64 guid = me->GetCharmerOrOwnerGUID();
if (Unit* owner = ObjectAccessor::GetUnit(*me, guid))
l->push_back(owner);
break;
}
case SMART_TARGET_POSITION:
default:
return NULL;