Core/Spells: move Cannibalize and Carrion Feeder cast checks to SpellScripts.
This commit is contained in:
@@ -16180,6 +16180,26 @@ bool Unit::IsInRaidWith(Unit const* unit) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Unit::IsTargetMatchingCheck(Unit const* target, SpellTargetSelectionCheckTypes check) const
|
||||
{
|
||||
switch (check)
|
||||
{
|
||||
case TARGET_SELECT_CHECK_ENEMY:
|
||||
if (IsControlledByPlayer())
|
||||
return !IsFriendlyTo(target);
|
||||
else
|
||||
return IsHostileTo(target);
|
||||
case TARGET_SELECT_CHECK_ALLY:
|
||||
return IsFriendlyTo(target);
|
||||
case TARGET_SELECT_CHECK_PARTY:
|
||||
return IsInPartyWith(target);
|
||||
case TARGET_SELECT_CHECK_RAID:
|
||||
return IsInRaidWith(target);
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::GetRaidMember(std::list<Unit*> &nearMembers, float radius)
|
||||
{
|
||||
Player* owner = GetCharmerOrOwnerPlayerOrPlayerItself();
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "EventProcessor.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "DBCStructure.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "Path.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "Timer.h"
|
||||
@@ -1391,6 +1392,7 @@ class Unit : public WorldObject
|
||||
bool IsNeutralToAll() const;
|
||||
bool IsInPartyWith(Unit const* unit) const;
|
||||
bool IsInRaidWith(Unit const* unit) const;
|
||||
bool IsTargetMatchingCheck(Unit const* target, SpellTargetSelectionCheckTypes check) const;
|
||||
void GetPartyMemberInDist(std::list<Unit*> &units, float dist);
|
||||
void GetPartyMembers(std::list<Unit*> &units);
|
||||
void GetRaidMember(std::list<Unit*> &units, float dist);
|
||||
|
||||
Reference in New Issue
Block a user