*Update spell selection.
--HG-- branch : trunk
This commit is contained in:
@@ -181,7 +181,7 @@ inline void Trinity::DynamicObjectUpdater::VisitHelper(Unit* target)
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(i_dynobject.GetSpellId());
|
||||
uint32 eff_index = i_dynobject.GetEffIndex();
|
||||
if(spellInfo->EffectImplicitTargetB[eff_index] == TARGET_DEST_DYNOBJ_ALLY
|
||||
|| spellInfo->EffectImplicitTargetB[eff_index] == TARGET_UNIT_AREA_ALLY_GROUND)
|
||||
|| spellInfo->EffectImplicitTargetB[eff_index] == TARGET_UNIT_AREA_ALLY_DST)
|
||||
{
|
||||
if(!i_check->IsFriendlyTo(target))
|
||||
return;
|
||||
|
||||
+2
-2
@@ -1721,8 +1721,8 @@ void Pet::ToggleAutocast(uint32 spellid, bool apply)
|
||||
return;
|
||||
|
||||
//if(const SpellEntry *tempSpell = GetSpellStore()->LookupEntry(spellid))
|
||||
// if(tempSpell->EffectImplicitTargetA[0] != TARGET_ALL_AROUND_CASTER
|
||||
// && tempSpell->EffectImplicitTargetA[0] != TARGET_CHAIN_DAMAGE)
|
||||
// if(tempSpell->EffectImplicitTargetA[0] != TARGET_SRC_CASTER
|
||||
// && tempSpell->EffectImplicitTargetA[0] != TARGET_UNIT_TARGET_ENEMY)
|
||||
// return;
|
||||
|
||||
PetSpellMap::const_iterator itr = m_spells.find((uint16)spellid);
|
||||
|
||||
@@ -194,7 +194,7 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
|
||||
|
||||
for(uint32 i = 0; i < 3;i++)
|
||||
{
|
||||
if(spellInfo->EffectImplicitTargetA[i] == TARGET_ALL_ENEMY_IN_AREA || spellInfo->EffectImplicitTargetA[i] == TARGET_ALL_ENEMY_IN_AREA_INSTANT || spellInfo->EffectImplicitTargetA[i] == TARGET_DEST_DYNOBJ_ENEMY)
|
||||
if(spellInfo->EffectImplicitTargetA[i] == TARGET_UNIT_AREA_ENEMY_SRC || spellInfo->EffectImplicitTargetA[i] == TARGET_UNIT_AREA_ENEMY_DST || spellInfo->EffectImplicitTargetA[i] == TARGET_DEST_DYNOBJ_ENEMY)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+25
-52
@@ -788,64 +788,42 @@ enum SpellImmunity
|
||||
|
||||
enum Targets
|
||||
{
|
||||
TARGET_SELF = 1,
|
||||
TARGET_UNIT_CASTER = 1,
|
||||
TARGET_RANDOM_ENEMY_CHAIN_IN_AREA = 2, // only one spell has that, but regardless, it's a target type after all
|
||||
//TARGET_UNIT_NEARBY_ENEMY
|
||||
TARGET_UNIT_SINGLE_UNKNOWN = 3,
|
||||
TARGET_UNIT_NEARBY_ALLY = 4,
|
||||
TARGET_PET = 5,
|
||||
TARGET_UNIT_NEARBY_ENEMY = 2, // only one spell has that, but regardless, it's a target type after all
|
||||
TARGET_UNIT_NEARBY_ALLY = 3,
|
||||
TARGET_UNIT_NEARBY_ALLY_UNK = 4,
|
||||
TARGET_UNIT_PET = 5,
|
||||
TARGET_CHAIN_DAMAGE = 6,
|
||||
TARGET_UNIT_TARGET_ENEMY = 6,
|
||||
TARGET_UNIT_AREA_ENTRY = 7,
|
||||
TARGET_AREAEFFECT_CUSTOM = 8,
|
||||
TARGET_UNIT_AREA_ENTRY_GROUND = 8,
|
||||
TARGET_INNKEEPER_COORDINATES = 9, // uses in teleport to innkeeper spells
|
||||
//TARGET_DEST_HOME
|
||||
TARGET_UNIT_AREA_ENTRY_SRC = 7,
|
||||
TARGET_UNIT_AREA_ENTRY_DST = 8,
|
||||
TARGET_DST_HOME = 9, // uses in teleport to innkeeper spells
|
||||
TARGET_UNIT_TARGET_DEST_CASTER = 11, // teleport target to caster
|
||||
TARGET_ALL_ENEMY_IN_AREA = 15,
|
||||
TARGET_UNIT_AREA_ENEMY = 15,
|
||||
TARGET_ALL_ENEMY_IN_AREA_INSTANT = 16,
|
||||
TARGET_UNIT_AREA_ENEMY_GROUND = 16,
|
||||
TARGET_TABLE_X_Y_Z_COORDINATES = 17, // uses in teleport spells and some other
|
||||
//TARGET_DEST_TABLE
|
||||
TARGET_EFFECT_SELECT = 18, // highly depends on the spell effect
|
||||
TARGET_DEST_CASTER_GROUND = 18,
|
||||
TARGET_ALL_PARTY_AROUND_CASTER = 20,
|
||||
TARGET_UNIT_AREA_ENEMY_SRC = 15,
|
||||
TARGET_UNIT_AREA_ENEMY_DST = 16,
|
||||
TARGET_DST_DB = 17, // uses in teleport spells and some other
|
||||
TARGET_DST_CASTER = 18,
|
||||
TARGET_UNIT_PARTY_CASTER = 20,
|
||||
TARGET_SINGLE_FRIEND = 21,
|
||||
TARGET_UNIT_TARGET_ALLY = 21,
|
||||
TARGET_ALL_AROUND_CASTER = 22, // used only in TargetA, target selection dependent from TargetB
|
||||
TARGET_DEST_CASTER = 22,
|
||||
TARGET_SRC_CASTER = 22,
|
||||
TARGET_GAMEOBJECT = 23,
|
||||
//TARGET_OBJECT_OPEN
|
||||
TARGET_IN_FRONT_OF_CASTER = 24,
|
||||
TARGET_UNIT_CONE_ENEMY = 24,
|
||||
TARGET_DUELVSPLAYER = 25,
|
||||
TARGET_UNIT_TARGET_ANY = 25,
|
||||
TARGET_GAMEOBJECT_ITEM = 26,
|
||||
//TARGET_OBJECT_ITEM_PICKLOCK
|
||||
TARGET_UNIT_MASTER = 27,
|
||||
TARGET_DEST_DYNOBJ_ENEMY = 28,
|
||||
TARGET_DEST_DYNOBJ_ALLY = 29, // only for effect 27
|
||||
TARGET_ALL_FRIENDLY_UNITS_AROUND_CASTER = 30, // in TargetB used only with TARGET_ALL_AROUND_CASTER and in self casting range in TargetA
|
||||
TARGET_UNIT_AREA_ALLY = 30,
|
||||
TARGET_ALL_FRIENDLY_UNITS_IN_AREA = 31,
|
||||
TARGET_UNIT_AREA_ALLY_GROUND = 31,
|
||||
TARGET_UNIT_AREA_ALLY_SRC = 30, // in TargetB used only with TARGET_SRC_CASTER and in self casting range in TargetA
|
||||
TARGET_UNIT_AREA_ALLY_DST = 31,
|
||||
TARGET_MINION = 32,
|
||||
//TARGET_DEST_SUMMON
|
||||
TARGET_ALL_PARTY = 33,
|
||||
TARGET_UNIT_AREA_PARTY = 33,
|
||||
TARGET_ALL_PARTY_AROUND_CASTER_2 = 34, // used in Tranquility
|
||||
TARGET_UNIT_AREA_PARTY_GROUND = 34,
|
||||
TARGET_SINGLE_PARTY = 35,
|
||||
TARGET_UNIT_AREA_PARTY_SRC = 33,
|
||||
TARGET_UNIT_AREA_PARTY_DST = 34, // used in Tranquility
|
||||
TARGET_UNIT_TARGET_PARTY = 35,
|
||||
TARGET_DEST_CASTER_RANDOM_UNKNOWN = 36, //unknown
|
||||
TARGET_AREAEFFECT_PARTY = 37,
|
||||
TARGET_UNIT_PARTY_TARGET = 37,
|
||||
TARGET_SCRIPT = 38,
|
||||
//TARGET_UNIT_NEARBY_ENTRY
|
||||
TARGET_UNIT_NEARBY_ENTRY = 38,
|
||||
TARGET_UNIT_CASTER_FISHING = 39,
|
||||
TARGET_OBJECT_USE = 40,
|
||||
TARGET_DEST_CASTER_FRONT_LEFT = 41, //earth totem
|
||||
@@ -853,28 +831,23 @@ enum Targets
|
||||
TARGET_DEST_CASTER_BACK_RIGHT = 43, //air totem
|
||||
TARGET_DEST_CASTER_FRONT_RIGHT = 44, //fire totem
|
||||
TARGET_UNIT_CHAINHEAL = 45,
|
||||
TARGET_SCRIPT_COORDINATES = 46,
|
||||
//TARGET_DEST_NEARBY_ENTRY
|
||||
TARGET_DST_NEARBY_ENTRY = 46,
|
||||
TARGET_DEST_CASTER_FRONT = 47,
|
||||
TARGET_DEST_CASTER_BACK = 48,
|
||||
TARGET_DEST_CASTER_RIGHT = 49,
|
||||
TARGET_DEST_CASTER_LEFT = 50,
|
||||
TARGET_OBJECT_AREA = 51,
|
||||
TARGET_AREAEFFECT_CUSTOM_2 = 52,
|
||||
//TARGET_DUMMY
|
||||
TARGET_CURRENT_ENEMY_COORDINATES = 53, // set unit coordinates as dest, only 16 target B imlemented
|
||||
TARGET_DEST_TARGET_ENEMY = 53,
|
||||
TARGET_UNIT_CONE_ENEMY_UNKNOWN = 54,
|
||||
TARGET_OBJECT_AREA_SRC = 51,
|
||||
TARGET_OBJECT_AREA_DST = 52,
|
||||
TARGET_DST_TARGET_ENEMY = 53, // set unit coordinates as dest, only 16 target B imlemented
|
||||
TARGET_UNIT_CONE_ENEMY_UNKNOWN = 54, // 180 degree, or different angle
|
||||
TARGET_DEST_CASTER_FRONT_LEAP = 55, // for a leap spell
|
||||
TARGET_UNIT_RAID = 56,
|
||||
TARGET_SINGLE_FRIEND_2 = 57,
|
||||
TARGET_UNIT_RAID_CASTER = 56,
|
||||
TARGET_UNIT_TARGET_RAID = 57,
|
||||
TARGET_UNIT_NEARBY_RAID = 58,
|
||||
TARGET_UNIT_CONE_ALLY = 59,
|
||||
TARGET_UNIT_AREA_SCRIPT = 60,
|
||||
TARGET_AREAEFFECT_PARTY_AND_CLASS = 61,
|
||||
TARGET_UNIT_CONE_ENTRY = 60,
|
||||
TARGET_UNIT_CLASS_TARGET = 61,
|
||||
TARGET_TEST = 62, // for a test spell
|
||||
TARGET_DUELVSPLAYER_COORDINATES = 63,
|
||||
TARGET_DEST_TARGET_ANY = 63,
|
||||
TARGET_DEST_TARGET_FRONT = 64,
|
||||
TARGET_DEST_TARGET_BACK = 65, // uses in teleport behind spells
|
||||
@@ -900,7 +873,7 @@ enum Targets
|
||||
TARGET_DEST_DEST_FRONT_RIGHT = 85,
|
||||
TARGET_DEST_DEST_RANDOM = 86,
|
||||
TARGET_DEST_DEST = 87,
|
||||
TARGET_UNIT_AREA_ALL_CHANNEL = 88,
|
||||
TARGET_DEST_DYNOBJ_NONE = 88,
|
||||
TARGET_DEST_TRAJ = 89,
|
||||
TARGET_UNIT_MINIPET = 90,
|
||||
TARGET_CORPSE_AREA_ENEMY_PLAYER = 93,
|
||||
|
||||
+500
-462
File diff suppressed because it is too large
Load Diff
+25
-19
@@ -75,11 +75,14 @@ enum SpellRangeFlag
|
||||
|
||||
enum SpellNotifyPushType
|
||||
{
|
||||
PUSH_NONE = 0,
|
||||
PUSH_IN_FRONT,
|
||||
PUSH_IN_BACK,
|
||||
PUSH_IN_LINE,
|
||||
PUSH_DEST_CENTER,
|
||||
PUSH_TARGET_CENTER,
|
||||
PUSH_SRC_CENTER,
|
||||
PUSH_DST_CENTER,
|
||||
PUSH_CASTER_CENTER,
|
||||
PUSH_CHAIN,
|
||||
};
|
||||
|
||||
bool IsQuestTameSpell(uint32 spellId);
|
||||
@@ -111,28 +114,30 @@ class SpellCastTargets
|
||||
|
||||
m_itemTargetEntry = target.m_itemTargetEntry;
|
||||
|
||||
//m_srcX = target.m_srcX;
|
||||
//m_srcY = target.m_srcY;
|
||||
//m_srcZ = target.m_srcZ;
|
||||
m_srcX = target.m_srcX;
|
||||
m_srcY = target.m_srcY;
|
||||
m_srcZ = target.m_srcZ;
|
||||
|
||||
m_mapId = -1;
|
||||
m_destX = target.m_destX;
|
||||
m_destY = target.m_destY;
|
||||
m_destZ = target.m_destZ;
|
||||
m_hasDest = target.m_hasDest;
|
||||
|
||||
m_strTarget = target.m_strTarget;
|
||||
|
||||
m_targetMask = target.m_targetMask;
|
||||
|
||||
m_mapId = -1;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
uint64 getUnitTargetGUID() const { return m_unitTargetGUID; }
|
||||
Unit *getUnitTarget() const { return m_unitTarget; }
|
||||
void setUnitTarget(Unit *target);
|
||||
void setDestination(float x, float y, float z, bool send = true, int32 mapId = -1);
|
||||
void setDestination(Unit *target, bool send = true);
|
||||
void setSrc(float x, float y, float z);
|
||||
void setSrc(WorldObject *target);
|
||||
void setDestination(float x, float y, float z, int32 mapId = -1);
|
||||
void setDestination(WorldObject *target);
|
||||
|
||||
uint64 getGOTargetGUID() const { return m_GOTargetGUID; }
|
||||
GameObject *getGOTarget() const { return m_GOTarget; }
|
||||
@@ -154,14 +159,14 @@ class SpellCastTargets
|
||||
}
|
||||
|
||||
bool IsEmpty() const { return m_GOTargetGUID==0 && m_unitTargetGUID==0 && m_itemTarget==0 && m_CorpseTargetGUID==0; }
|
||||
bool HasDest() const { return m_hasDest; }
|
||||
bool HasSrc() const { return m_targetMask & TARGET_FLAG_SOURCE_LOCATION; }
|
||||
bool HasDst() const { return m_targetMask & TARGET_FLAG_DEST_LOCATION; }
|
||||
|
||||
void Update(Unit* caster);
|
||||
|
||||
float m_srcX, m_srcY, m_srcZ;
|
||||
int32 m_mapId;
|
||||
float m_destX, m_destY, m_destZ;
|
||||
bool m_hasDest;
|
||||
int32 m_mapId;
|
||||
std::string m_strTarget;
|
||||
|
||||
uint32 m_targetMask;
|
||||
@@ -368,10 +373,13 @@ class Spell
|
||||
void WriteAmmoToPacket( WorldPacket * data );
|
||||
void FillTargetMap();
|
||||
|
||||
void SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap);
|
||||
void SetTargetMap(uint32 i, uint32 cur);
|
||||
|
||||
Unit* SelectMagnetTarget();
|
||||
bool CheckTarget( Unit* target, uint32 eff, bool hitPhase );
|
||||
bool CheckTarget(Unit* target, uint32 eff);
|
||||
|
||||
void CheckSrc() { if(!m_targets.HasSrc()) m_targets.setSrc(m_caster); }
|
||||
void CheckDst() { if(!m_targets.HasDst()) m_targets.setDestination(m_caster); }
|
||||
|
||||
void SendCastResult(uint8 result);
|
||||
void SendSpellStart();
|
||||
@@ -547,11 +555,9 @@ class Spell
|
||||
void DoAllEffectOnTarget(GOTargetInfo *target);
|
||||
void DoAllEffectOnTarget(ItemTargetInfo *target);
|
||||
bool IsAliveUnitPresentInTargetList();
|
||||
void SearchAreaTarget(std::list<Unit*> &data, float radius, const uint32 &type,
|
||||
SpellTargets TargetType, uint32 entry = 0);
|
||||
void SearchChainTarget(std::list<Unit*> &data, float radius, uint32 unMaxTargets,
|
||||
SpellTargets TargetType);
|
||||
Unit* SearchNearbyTarget(float radius, SpellTargets TargetType, uint32 entry = 0);
|
||||
void SearchAreaTarget(std::list<Unit*> &unitList, float radius, const uint32 type, SpellTargets TargetType, uint32 entry = 0);
|
||||
void SearchChainTarget(std::list<Unit*> &unitList, float radius, uint32 unMaxTargets, SpellTargets TargetType);
|
||||
WorldObject* SearchNearbyTarget(float range, SpellTargets TargetType);
|
||||
bool IsValidSingleTargetEffect(Unit const* target, Targets type) const;
|
||||
bool IsValidSingleTargetSpell(Unit const* target) const;
|
||||
void CalculateDamageDoneForAllTargets();
|
||||
|
||||
@@ -1960,7 +1960,7 @@ void Spell::EffectTriggerSpell(uint32 i)
|
||||
bool instant = false;
|
||||
for(uint32 j = i+1; j < 3; ++j)
|
||||
{
|
||||
if(m_spellInfo->Effect[j]==SPELL_EFFECT_INSTAKILL && m_spellInfo->EffectImplicitTargetA[j]==TARGET_SELF)
|
||||
if(m_spellInfo->Effect[j]==SPELL_EFFECT_INSTAKILL && m_spellInfo->EffectImplicitTargetA[j]==TARGET_UNIT_CASTER)
|
||||
{
|
||||
instant = true;
|
||||
break;
|
||||
@@ -2007,7 +2007,7 @@ void Spell::EffectTeleportUnits(uint32 i)
|
||||
return;
|
||||
|
||||
// If not exist data for dest location - return
|
||||
if(!m_targets.HasDest())
|
||||
if(!m_targets.HasDst())
|
||||
{
|
||||
sLog.outError( "Spell::EffectTeleportUnits - does not have destination for spell ID %u\n", m_spellInfo->Id );
|
||||
return;
|
||||
@@ -2031,7 +2031,7 @@ void Spell::EffectTeleportUnits(uint32 i)
|
||||
unitTarget->SendMessageToSet(&data, false);
|
||||
}
|
||||
|
||||
// post effects for TARGET_TABLE_X_Y_Z_COORDINATES
|
||||
// post effects for TARGET_DST_DB
|
||||
switch ( m_spellInfo->Id )
|
||||
{
|
||||
// Dimensional Ripper - Everlook
|
||||
@@ -5463,7 +5463,7 @@ void Spell::EffectMomentMove(uint32 i)
|
||||
if(unitTarget->isInFlight())
|
||||
return;
|
||||
|
||||
if(!m_targets.HasDest())
|
||||
if(!m_targets.HasDst())
|
||||
return;
|
||||
|
||||
uint32 mapid = m_caster->GetMapId();
|
||||
|
||||
+83
-59
@@ -98,35 +98,64 @@ SpellMgr::SpellMgr()
|
||||
case TARGET_UNIT_MASTER:
|
||||
case TARGET_UNIT_PET:
|
||||
case TARGET_UNIT_PARTY_CASTER:
|
||||
case TARGET_UNIT_RAID:
|
||||
case TARGET_UNIT_RAID_CASTER:
|
||||
SpellTargetType[i] = TARGET_TYPE_UNIT_CASTER;
|
||||
break;
|
||||
case TARGET_UNIT_MINIPET:
|
||||
case TARGET_UNIT_TARGET_ALLY:
|
||||
case TARGET_UNIT_TARGET_RAID:
|
||||
case TARGET_UNIT_TARGET_ANY:
|
||||
case TARGET_UNIT_SINGLE_UNKNOWN:
|
||||
case TARGET_UNIT_TARGET_ENEMY:
|
||||
case TARGET_UNIT_TARGET_PARTY:
|
||||
case TARGET_UNIT_PARTY_TARGET:
|
||||
case TARGET_UNIT_CLASS_TARGET:
|
||||
case TARGET_UNIT_CHAINHEAL:
|
||||
SpellTargetType[i] = TARGET_TYPE_UNIT_TARGET;
|
||||
break;
|
||||
case TARGET_UNIT_CHANNEL:
|
||||
case TARGET_DEST_CHANNEL:
|
||||
SpellTargetType[i] = TARGET_TYPE_CHANNEL;
|
||||
case TARGET_UNIT_NEARBY_ENEMY:
|
||||
case TARGET_UNIT_NEARBY_ALLY:
|
||||
case TARGET_UNIT_NEARBY_ALLY_UNK:
|
||||
case TARGET_UNIT_NEARBY_ENTRY:
|
||||
case TARGET_UNIT_NEARBY_RAID:
|
||||
SpellTargetType[i] = TARGET_TYPE_UNIT_NEARBY;
|
||||
break;
|
||||
case TARGET_UNIT_AREA_ENEMY_GROUND:
|
||||
case TARGET_UNIT_AREA_ENEMY:
|
||||
case TARGET_UNIT_AREA_ALLY_GROUND:
|
||||
case TARGET_UNIT_AREA_ALLY:
|
||||
case TARGET_UNIT_AREA_ENTRY_GROUND:
|
||||
case TARGET_UNIT_AREA_ENTRY:
|
||||
case TARGET_UNIT_AREA_PARTY_GROUND:
|
||||
case TARGET_UNIT_AREA_PARTY:
|
||||
SpellTargetType[i] = TARGET_TYPE_AREA_DEST;
|
||||
case TARGET_UNIT_AREA_ENEMY_SRC:
|
||||
case TARGET_UNIT_AREA_ALLY_SRC:
|
||||
case TARGET_UNIT_AREA_ENTRY_SRC:
|
||||
case TARGET_UNIT_AREA_PARTY_SRC:
|
||||
case TARGET_OBJECT_AREA_SRC:
|
||||
SpellTargetType[i] = TARGET_TYPE_AREA_SRC;
|
||||
break;
|
||||
case TARGET_DEST_TARGET_ENEMY:
|
||||
case TARGET_UNIT_AREA_ENEMY_DST:
|
||||
case TARGET_UNIT_AREA_ALLY_DST:
|
||||
case TARGET_UNIT_AREA_ENTRY_DST:
|
||||
case TARGET_UNIT_AREA_PARTY_DST:
|
||||
case TARGET_OBJECT_AREA_DST:
|
||||
SpellTargetType[i] = TARGET_TYPE_AREA_DST;
|
||||
break;
|
||||
case TARGET_UNIT_CONE_ENEMY:
|
||||
case TARGET_UNIT_CONE_ALLY:
|
||||
case TARGET_UNIT_CONE_ENTRY:
|
||||
case TARGET_UNIT_CONE_ENEMY_UNKNOWN:
|
||||
SpellTargetType[i] = TARGET_TYPE_AREA_CONE;
|
||||
break;
|
||||
case TARGET_DST_CASTER:
|
||||
case TARGET_SRC_CASTER:
|
||||
case TARGET_MINION:
|
||||
case TARGET_DEST_CASTER_FRONT_LEAP:
|
||||
case TARGET_DEST_CASTER_FRONT:
|
||||
case TARGET_DEST_CASTER_BACK:
|
||||
case TARGET_DEST_CASTER_RIGHT:
|
||||
case TARGET_DEST_CASTER_LEFT:
|
||||
case TARGET_DEST_CASTER_FRONT_LEFT:
|
||||
case TARGET_DEST_CASTER_BACK_LEFT:
|
||||
case TARGET_DEST_CASTER_BACK_RIGHT:
|
||||
case TARGET_DEST_CASTER_FRONT_RIGHT:
|
||||
case TARGET_DEST_CASTER_RANDOM:
|
||||
case TARGET_DEST_CASTER_RADIUS:
|
||||
SpellTargetType[i] = TARGET_TYPE_DEST_CASTER;
|
||||
break;
|
||||
case TARGET_DST_TARGET_ENEMY:
|
||||
case TARGET_DEST_TARGET_ANY:
|
||||
case TARGET_DEST_TARGET_FRONT:
|
||||
case TARGET_DEST_TARGET_BACK:
|
||||
@@ -140,25 +169,11 @@ SpellMgr::SpellMgr()
|
||||
case TARGET_DEST_TARGET_RADIUS:
|
||||
SpellTargetType[i] = TARGET_TYPE_DEST_TARGET;
|
||||
break;
|
||||
case TARGET_DEST_CASTER_GROUND:
|
||||
case TARGET_DEST_CASTER:
|
||||
case TARGET_DEST_CASTER_FRONT_LEFT:
|
||||
case TARGET_DEST_CASTER_BACK_LEFT:
|
||||
case TARGET_DEST_CASTER_BACK_RIGHT:
|
||||
case TARGET_DEST_CASTER_FRONT_RIGHT:
|
||||
case TARGET_DEST_CASTER_FRONT:
|
||||
case TARGET_MINION:
|
||||
case TARGET_DEST_CASTER_FRONT_LEAP:
|
||||
case TARGET_DEST_CASTER_BACK:
|
||||
case TARGET_DEST_CASTER_RIGHT:
|
||||
case TARGET_DEST_CASTER_LEFT:
|
||||
case TARGET_DEST_CASTER_RANDOM:
|
||||
case TARGET_DEST_CASTER_RADIUS:
|
||||
SpellTargetType[i] = TARGET_TYPE_DEST_CASTER;
|
||||
break;
|
||||
case TARGET_DEST_DYNOBJ_ENEMY:
|
||||
case TARGET_DEST_DYNOBJ_ALLY:
|
||||
case TARGET_DEST_DYNOBJ_NONE:
|
||||
case TARGET_DEST_DEST:
|
||||
case TARGET_DEST_TRAJ:
|
||||
case TARGET_DEST_DEST_FRONT_LEFT:
|
||||
case TARGET_DEST_DEST_BACK_LEFT:
|
||||
case TARGET_DEST_DEST_BACK_RIGHT:
|
||||
@@ -170,6 +185,15 @@ SpellMgr::SpellMgr()
|
||||
case TARGET_DEST_DEST_RANDOM:
|
||||
SpellTargetType[i] = TARGET_TYPE_DEST_DEST;
|
||||
break;
|
||||
case TARGET_DST_DB:
|
||||
case TARGET_DST_HOME:
|
||||
case TARGET_DST_NEARBY_ENTRY:
|
||||
SpellTargetType[i] = TARGET_TYPE_DEST_SPECIAL;
|
||||
break;
|
||||
case TARGET_UNIT_CHANNEL:
|
||||
case TARGET_DEST_CHANNEL:
|
||||
SpellTargetType[i] = TARGET_TYPE_CHANNEL;
|
||||
break;
|
||||
default:
|
||||
SpellTargetType[i] = TARGET_TYPE_DEFAULT;
|
||||
}
|
||||
@@ -179,20 +203,20 @@ SpellMgr::SpellMgr()
|
||||
{
|
||||
switch(i)
|
||||
{
|
||||
case TARGET_UNIT_AREA_ENEMY_GROUND:
|
||||
case TARGET_UNIT_AREA_ENEMY:
|
||||
case TARGET_UNIT_AREA_ALLY_GROUND:
|
||||
case TARGET_UNIT_AREA_ALLY:
|
||||
case TARGET_UNIT_AREA_ENTRY_GROUND:
|
||||
case TARGET_UNIT_AREA_ENTRY:
|
||||
case TARGET_UNIT_AREA_PARTY_GROUND:
|
||||
case TARGET_UNIT_AREA_PARTY:
|
||||
case TARGET_UNIT_AREA_ENEMY_DST:
|
||||
case TARGET_UNIT_AREA_ENEMY_SRC:
|
||||
case TARGET_UNIT_AREA_ALLY_DST:
|
||||
case TARGET_UNIT_AREA_ALLY_SRC:
|
||||
case TARGET_UNIT_AREA_ENTRY_DST:
|
||||
case TARGET_UNIT_AREA_ENTRY_SRC:
|
||||
case TARGET_UNIT_AREA_PARTY_DST:
|
||||
case TARGET_UNIT_AREA_PARTY_SRC:
|
||||
case TARGET_UNIT_PARTY_TARGET:
|
||||
case TARGET_UNIT_PARTY_CASTER:
|
||||
case TARGET_UNIT_CONE_ENEMY:
|
||||
case TARGET_UNIT_CONE_ALLY:
|
||||
case TARGET_UNIT_CONE_ENEMY_UNKNOWN:
|
||||
case TARGET_UNIT_RAID:
|
||||
case TARGET_UNIT_RAID_CASTER:
|
||||
IsAreaEffectTarget[i] = true;
|
||||
break;
|
||||
default:
|
||||
@@ -486,16 +510,16 @@ bool IsPositiveTarget(uint32 targetA, uint32 targetB)
|
||||
// non-positive targets
|
||||
switch(targetA)
|
||||
{
|
||||
case TARGET_CHAIN_DAMAGE:
|
||||
case TARGET_ALL_ENEMY_IN_AREA:
|
||||
case TARGET_ALL_ENEMY_IN_AREA_INSTANT:
|
||||
case TARGET_IN_FRONT_OF_CASTER:
|
||||
case TARGET_UNIT_TARGET_ENEMY:
|
||||
case TARGET_UNIT_AREA_ENEMY_SRC:
|
||||
case TARGET_UNIT_AREA_ENEMY_DST:
|
||||
case TARGET_UNIT_CONE_ENEMY:
|
||||
case TARGET_DEST_DYNOBJ_ENEMY:
|
||||
case TARGET_CURRENT_ENEMY_COORDINATES:
|
||||
case TARGET_DST_TARGET_ENEMY:
|
||||
case TARGET_UNIT_CHANNEL:
|
||||
return false;
|
||||
case TARGET_ALL_AROUND_CASTER:
|
||||
return (targetB == TARGET_ALL_PARTY || targetB == TARGET_ALL_FRIENDLY_UNITS_AROUND_CASTER);
|
||||
case TARGET_SRC_CASTER:
|
||||
return (targetB == TARGET_UNIT_AREA_PARTY_SRC || targetB == TARGET_UNIT_AREA_ALLY_SRC);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -608,12 +632,12 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
|
||||
return false;
|
||||
case SPELL_AURA_PERIODIC_DAMAGE: // used in positive spells also.
|
||||
// part of negative spell if casted at self (prevent cancel)
|
||||
if(spellproto->EffectImplicitTargetA[effIndex] == TARGET_SELF)
|
||||
if(spellproto->EffectImplicitTargetA[effIndex] == TARGET_UNIT_CASTER)
|
||||
return false;
|
||||
break;
|
||||
case SPELL_AURA_MOD_DECREASE_SPEED: // used in positive spells also
|
||||
// part of positive spell if casted at self
|
||||
if(spellproto->EffectImplicitTargetA[effIndex] != TARGET_SELF)
|
||||
if(spellproto->EffectImplicitTargetA[effIndex] != TARGET_UNIT_CASTER)
|
||||
return false;
|
||||
// but not this if this first effect (don't found batter check)
|
||||
if(spellproto->Attributes & 0x4000000 && effIndex==0)
|
||||
@@ -864,7 +888,7 @@ void SpellMgr::LoadSpellTargetPositions()
|
||||
bool found = false;
|
||||
for(int i = 0; i < 3; ++i)
|
||||
{
|
||||
if( spellInfo->EffectImplicitTargetA[i]==TARGET_TABLE_X_Y_Z_COORDINATES || spellInfo->EffectImplicitTargetB[i]==TARGET_TABLE_X_Y_Z_COORDINATES )
|
||||
if( spellInfo->EffectImplicitTargetA[i]==TARGET_DST_DB || spellInfo->EffectImplicitTargetB[i]==TARGET_DST_DB )
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
@@ -872,7 +896,7 @@ void SpellMgr::LoadSpellTargetPositions()
|
||||
}
|
||||
if(!found)
|
||||
{
|
||||
sLog.outErrorDb("Spell (Id: %u) listed in `spell_target_position` does not have target TARGET_TABLE_X_Y_Z_COORDINATES (17).",Spell_ID);
|
||||
sLog.outErrorDb("Spell (Id: %u) listed in `spell_target_position` does not have target TARGET_DST_DB (17).",Spell_ID);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1931,10 +1955,10 @@ void SpellMgr::LoadSpellScriptTarget()
|
||||
/*bool targetfound = false;
|
||||
for(int i = 0; i <3; ++i)
|
||||
{
|
||||
if( spellProto->EffectImplicitTargetA[i]==TARGET_SCRIPT ||
|
||||
spellProto->EffectImplicitTargetB[i]==TARGET_SCRIPT ||
|
||||
spellProto->EffectImplicitTargetA[i]==TARGET_SCRIPT_COORDINATES ||
|
||||
spellProto->EffectImplicitTargetB[i]==TARGET_SCRIPT_COORDINATES )
|
||||
if( spellProto->EffectImplicitTargetA[i]==TARGET_UNIT_NEARBY_ENTRY ||
|
||||
spellProto->EffectImplicitTargetB[i]==TARGET_UNIT_NEARBY_ENTRY ||
|
||||
spellProto->EffectImplicitTargetA[i]==TARGET_DST_NEARBY_ENTRY ||
|
||||
spellProto->EffectImplicitTargetB[i]==TARGET_DST_NEARBY_ENTRY )
|
||||
{
|
||||
targetfound = true;
|
||||
break;
|
||||
@@ -1942,7 +1966,7 @@ void SpellMgr::LoadSpellScriptTarget()
|
||||
}
|
||||
if(!targetfound)
|
||||
{
|
||||
sLog.outErrorDb("Table `spell_script_target`: spellId %u listed for TargetEntry %u does not have any implicit target TARGET_SCRIPT(38) or TARGET_SCRIPT_COORDINATES (46).",spellId,targetEntry);
|
||||
sLog.outErrorDb("Table `spell_script_target`: spellId %u listed for TargetEntry %u does not have any implicit target TARGET_UNIT_NEARBY_ENTRY(38) or TARGET_DST_NEARBY_ENTRY (46).",spellId,targetEntry);
|
||||
continue;
|
||||
}*/
|
||||
|
||||
@@ -2008,13 +2032,13 @@ void SpellMgr::LoadSpellScriptTarget()
|
||||
bool found = false;
|
||||
for(int j=0; j<3; ++j)
|
||||
{
|
||||
if( spellInfo->EffectImplicitTargetA[j] == TARGET_SCRIPT || spellInfo->EffectImplicitTargetA[j] != TARGET_SELF && spellInfo->EffectImplicitTargetB[j] == TARGET_SCRIPT )
|
||||
if( spellInfo->EffectImplicitTargetA[j] == TARGET_UNIT_NEARBY_ENTRY || spellInfo->EffectImplicitTargetA[j] != TARGET_UNIT_CASTER && spellInfo->EffectImplicitTargetB[j] == TARGET_UNIT_NEARBY_ENTRY )
|
||||
{
|
||||
SpellScriptTarget::const_iterator lower = spellmgr.GetBeginSpellScriptTarget(spellInfo->Id);
|
||||
SpellScriptTarget::const_iterator upper = spellmgr.GetEndSpellScriptTarget(spellInfo->Id);
|
||||
if(lower==upper)
|
||||
{
|
||||
sLog.outErrorDb("Spell (ID: %u) has effect EffectImplicitTargetA/EffectImplicitTargetB = %u (TARGET_SCRIPT), but does not have record in `spell_script_target`",spellInfo->Id,TARGET_SCRIPT);
|
||||
sLog.outErrorDb("Spell (ID: %u) has effect EffectImplicitTargetA/EffectImplicitTargetB = %u (TARGET_UNIT_NEARBY_ENTRY), but does not have record in `spell_script_target`",spellInfo->Id,TARGET_UNIT_NEARBY_ENTRY);
|
||||
break; // effects of spell
|
||||
}
|
||||
}
|
||||
@@ -2091,7 +2115,7 @@ void SpellMgr::LoadSpellPetAuras()
|
||||
continue;
|
||||
}
|
||||
|
||||
PetAura pa(pet, aura, spellInfo->EffectImplicitTargetA[i] == TARGET_PET, spellInfo->EffectBasePoints[i] + spellInfo->EffectBaseDice[i]);
|
||||
PetAura pa(pet, aura, spellInfo->EffectImplicitTargetA[i] == TARGET_UNIT_PET, spellInfo->EffectBasePoints[i] + spellInfo->EffectBaseDice[i]);
|
||||
mSpellPetAuraMap[spell] = pa;
|
||||
}
|
||||
|
||||
|
||||
+6
-2
@@ -248,11 +248,15 @@ enum SpellSelectTargetTypes
|
||||
TARGET_TYPE_DEFAULT,
|
||||
TARGET_TYPE_UNIT_CASTER,
|
||||
TARGET_TYPE_UNIT_TARGET,
|
||||
TARGET_TYPE_CHANNEL,
|
||||
TARGET_TYPE_AREA_DEST,
|
||||
TARGET_TYPE_UNIT_NEARBY,
|
||||
TARGET_TYPE_AREA_SRC,
|
||||
TARGET_TYPE_AREA_DST,
|
||||
TARGET_TYPE_AREA_CONE,
|
||||
TARGET_TYPE_DEST_CASTER,
|
||||
TARGET_TYPE_DEST_TARGET,
|
||||
TARGET_TYPE_DEST_DEST,
|
||||
TARGET_TYPE_DEST_SPECIAL,
|
||||
TARGET_TYPE_CHANNEL,
|
||||
};
|
||||
|
||||
//Some SpellFamilyFlags
|
||||
|
||||
+1
-1
@@ -11064,7 +11064,7 @@ void CharmInfo::InitCharmCreateSpells()
|
||||
if(!spellInfo) onlyselfcast = false;
|
||||
for(uint32 i = 0;i<3 && onlyselfcast;++i) //non existent spell will not make any problems as onlyselfcast would be false -> break right away
|
||||
{
|
||||
if(spellInfo->EffectImplicitTargetA[i] != TARGET_SELF && spellInfo->EffectImplicitTargetA[i] != 0)
|
||||
if(spellInfo->EffectImplicitTargetA[i] != TARGET_UNIT_CASTER && spellInfo->EffectImplicitTargetA[i] != 0)
|
||||
onlyselfcast = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user