4799 bool checkForm =
true;
4802 for (Unit::AuraEffectList::const_iterator i = ignore.begin(); i != ignore.end(); ++i)
4822 for (Unit::AuraEffectList::const_iterator blockItr = blockSpells.begin(); blockItr != blockSpells.end(); ++blockItr)
4826 bool reqCombat =
true;
4828 for (Unit::AuraEffectList::const_iterator j = stateAuras.begin(); j != stateAuras.end(); ++j)
4833 if ((*j)->GetMiscValue() == 1)
4877 return vehicleCheck;
4916 if (target != m_caster)
4954 if (!m_caster->GetGuardianPet())
4967 if (!m_caster->ToPlayer()->InBattleground())
4971 if (
Player* player = m_caster->ToPlayer())
4972 if (player->InArena())
4980 if (m_caster->GetTypeId() ==
TYPEID_UNIT || !m_caster->ToPlayer()->IsGameMaster())
4983 m_caster->GetZoneAndAreaId(zone, area);
4994 if (m_caster->IsInFlight())
5055 if (!unit || !unit->
HasAura(17743))
5085 if (!learn_spellproto)
5097 if (
Guild* guild = m_caster->ToPlayer()->GetGuild())
5098 if (guild->GetLeaderGUID() != m_caster->ToPlayer()->GetGUID())
5116 if (!learn_spellproto)
5128 if (m_caster->HasAura(gp->SpellID))
5152 if (m_caster->IsInCombat() || pet->
IsInCombat())
5172 if (strict && m_caster->IsScriptOverriden(
m_spellInfo, 6953))
5173 m_caster->RemoveMovementImpairingAuras();
5221 int32 skillValue = m_caster->ToPlayer()->GetSkillValue(skill);
5223 int32 ReqValue = (skillValue < 100 ? (TargetLevel-10) * 10 : TargetLevel * 5);
5224 if (ReqValue > skillValue)
5229 skillValue < sWorld->GetConfigMaxSkillValue() &&
5230 (ReqValue < 0 ? 0 : ReqValue) >
irand(skillValue - 25, skillValue + 37))
5249 if (
TradeData* pTrade = m_caster->ToPlayer()->GetTradeData())
5263 if (m_caster->ToPlayer()->InBattleground() &&
5271 lockId = go->GetGOInfo()->GetLockId();
5276 lockId = itm->GetTemplate()->GetLockID();
5279 int32 reqSkillValue = 0;
5280 int32 skillValue = 0;
5294 if ((canFailAtMax || skillValue < sWorld->GetConfigMaxSkillValue()) && reqSkillValue >
irand(skillValue - 25, skillValue + 37))
5312 if (!SummonProperties)
5314 switch (SummonProperties->
Category)
5317 if (!m_caster->GetPetGUID().IsEmpty())
5321 if (!m_caster->GetCharmGUID().IsEmpty())
5340 if (!m_caster->GetPetGUID().IsEmpty())
5352 if (!m_caster->GetCharmGUID().IsEmpty())
5360 if (!m_caster->GetTarget())
5364 if (!target || m_caster->ToPlayer() == target || (!target->IsInSameRaidWith(m_caster->ToPlayer()) &&
m_spellInfo->
Id != 48955))
5371 uint32 mapId = m_caster->GetMap()->GetId();
5372 Difficulty difficulty = m_caster->GetMap()->GetDifficultyID();
5374 if (InstancePlayerBind* targetBind = target->GetBoundInstance(mapId, difficulty))
5375 if (InstancePlayerBind* casterBind = m_caster->ToPlayer()->GetBoundInstance(mapId, difficulty))
5376 if (targetBind->perm && targetBind->save != casterBind->save)
5382 if (!target->Satisfy(
sObjectMgr->GetAccessRequirement(mapId, difficulty), mapId))
5393 Player* playerCaster = m_caster->ToPlayer();
5395 if (!(playerCaster->GetTarget()))
5398 Player* target = playerCaster->GetSelectedPlayer();
5401 !(target->GetSession()->GetRecruiterId() == playerCaster->GetSession()->GetAccountId() || target->GetSession()->GetAccountId() == playerCaster->GetSession()->GetRecruiterId()))
5411 if (
Battleground const* bg = m_caster->ToPlayer()->GetBattleground())
5437 if (
Battleground const* bg = m_caster->ToPlayer()->GetBattleground())
5449 if (m_caster->GetSpellHistory()->HasCooldown(talent->
SpellID))
5481 if (!m_caster->GetCharmerGUID().IsEmpty())
5487 if (!m_caster->GetPetGUID().IsEmpty())
5490 if (!m_caster->GetCharmGUID().IsEmpty())
5496 if (target->GetTypeId() ==
TYPEID_UNIT && target->IsVehicle())
5499 if (target->IsMounted())
5502 if (!target->GetCharmerGUID().IsEmpty())
5505 if (target->GetOwner() && target->GetOwner()->GetTypeId() ==
TYPEID_PLAYER)
5509 if (value &&
int32(target->getLevel()) > value)
5517 if (m_caster->IsInWater())
5521 bool allowMount = !m_caster->GetMap()->IsDungeon() || m_caster->GetMap()->IsBattlegroundOrArena();
5528 if (m_caster->IsInDisallowedMountForm())
5588 TradeData* my_trade = m_caster->ToPlayer()->GetTradeData();
5603 if (
Player* plrCaster = m_caster->ToPlayer())
5604 if (!plrCaster->GetComboPoints())
uint32 GetBaseItemLevel() const
Definition: ItemTemplate.h:667
bool HasStealthAura() const
Definition: Unit.h:1597
GameObject * focusObject
Definition: Spell.h:706
Definition: SharedDefines.h:1105
GameObject * SearchSpellFocus()
Definition: Spell.cpp:1945
Definition: Battleground.h:159
int32 MiscValue
Definition: SpellInfo.h:253
Definition: DBCStructure.h:37
uint32 GetLockID() const
Definition: ItemTemplate.h:687
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4240
SpellInfo const *const m_spellInfo
Definition: Spell.h:547
Unit *const m_caster
Definition: Spell.h:647
Definition: SharedDefines.h:1895
Difficulty
Definition: DBCEnums.h:402
uint32 Id
Definition: SpellInfo.h:329
SpellCastResult CallScriptCheckCastHandlers()
Definition: Spell.cpp:7086
Definition: SpellAuraDefines.h:188
bool IsDisabledFor(DisableType type, uint32 entry, Unit const *unit, uint8 flags)
Definition: DisableMgr.cpp:277
Unit * GetUnitTarget() const
Definition: Spell.cpp:222
Definition: SharedDefines.h:1408
Definition: SharedDefines.h:1106
Definition: SharedDefines.h:1477
Definition: SharedDefines.h:430
uint32 GetUInt32Value(uint16 index) const
Definition: Object.cpp:300
bool HasUnitMovementFlag(uint32 f) const
Definition: Unit.h:2109
Guardian * GetGuardianPet() const
Definition: Unit.cpp:7596
Definition: SpellAuraDefines.h:66
bool CanFlyIn()
Return if we can use mount in battlefield.
Definition: Battlefield.h:335
Will ignore caster aura states including combat requirements and death state.
Definition: Unit.h:473
Definition: SharedDefines.h:1401
Definition: SharedDefines.h:1322
Definition: SharedDefines.h:1376
bool IsPassive() const
Definition: SpellInfo.cpp:1403
Definition: PathGenerator.h:47
Player * GetOwner() const
Definition: Pet.cpp:1913
Definition: SharedDefines.h:1879
Definition: SharedDefines.h:1892
SpellCastResult CheckArenaAndRatedBattlegroundCastRules()
Definition: Spell.cpp:5779
SpellCastResult CheckItems()
Definition: Spell.cpp:5951
SpellCastResult CanOpenLock(uint32 effIndex, uint32 lockid, SkillType &skillid, int32 &reqSkillValue, int32 &skillValue)
Definition: Spell.cpp:6928
bool CanBeUsedInCombat() const
Definition: SpellInfo.cpp:1490
Map * GetMap() const
Definition: Object.h:543
Definition: SharedDefines.h:1351
Definition: SharedDefines.h:1294
Definition: SpellAuraDefines.h:335
DBCStorage< SummonPropertiesEntry > sSummonPropertiesStore(SummonPropertiesfmt)
SpellCustomErrors
Definition: SharedDefines.h:1541
uint32 SpellLevel
Definition: SpellInfo.h:375
Definition: SharedDefines.h:3883
#define M_PI
Definition: Common.h:163
Definition: SpellInfo.h:326
Definition: SharedDefines.h:1274
Definition: SharedDefines.h:1053
Definition: SharedDefines.h:1381
Definition: SharedDefines.h:1039
Definition: SharedDefines.h:28
Definition: SharedDefines.h:1072
Definition: SharedDefines.h:1383
SpellCastTargets m_targets
Definition: Spell.h:584
SpellCastResult CheckPower()
Definition: Spell.cpp:5913
Definition: SharedDefines.h:1084
Pet * ToPet()
Definition: Unit.h:2200
SpellCastResult CheckExplicitTarget(Unit const *caster, WorldObject const *target, Item const *itemTarget=NULL) const
Definition: SpellInfo.cpp:2026
Will ignore shapeshift checks.
Definition: Unit.h:472
bool HasAuraState(AuraStateType flag, SpellInfo const *spellProto=NULL, Unit const *Caster=NULL) const
Definition: Unit.cpp:7491
Definition: SharedDefines.h:1608
float GetMaxRange(bool positive=false, Unit *caster=NULL, Spell *spell=NULL) const
Definition: SpellInfo.cpp:2475
uint32 ApplyAuraName
Definition: SpellInfo.h:244
Item * GetItemTarget() const
Definition: Spell.h:203
AuraStateType
Definition: SharedDefines.h:1754
uint32 ExcludeCasterAuraSpell
Definition: SpellInfo.h:360
Definition: SharedDefines.h:1148
Definition: SharedDefines.h:1018
#define WORLD_TRIGGER
Definition: Unit.h:33
Definition: SharedDefines.h:1268
uint32 GetZoneId() const
Definition: Object.cpp:1525
SpellInfo const * m_triggeredByAuraSpell
Definition: Spell.h:826
int32 CalculateDamage(uint8 i, Unit const *target, float *var=nullptr) const
Definition: Spell.h:504
bool IsInCombat() const
Definition: Unit.h:1584
bool IsLocked() const
Definition: Item.h:306
Definition: SharedDefines.h:380
Loot loot
Definition: Creature.h:578
uint32 RequiresSpellFocus
Definition: SpellInfo.h:352
std::list< AuraEffect * > AuraEffectList
Definition: Unit.h:1322
Definition: SharedDefines.h:1391
bool IsAutoRepeat() const
Definition: Spell.h:591
Definition: DBCStructure.h:830
Definition: ObjectGuid.h:32
Definition: DisableMgr.h:47
SpellEffectInfo const * GetEffect(uint32 index) const
Definition: Spell.h:624
Definition: SharedDefines.h:1136
std::vector< uint8 > GetRawValue() const
Definition: ObjectGuid.cpp:127
Definition: SharedDefines.h:1038
arena_t NULL
Definition: jemalloc_internal.h:624
uint32 AuraInterruptFlags
Definition: SpellInfo.h:368
Definition: SpellAuraDefines.h:261
Definition: SharedDefines.h:1470
Definition: SharedDefines.h:1476
ObjectGuid GetCharmerGUID() const
Definition: Unit.h:1704
Definition: SharedDefines.h:362
WorldLocation const * GetDstPos() const
Definition: Spell.cpp:372
uint32 m_castItemEntry
Definition: Spell.h:550
Definition: UpdateFields.h:110
Will ignore Spell and Category cooldowns.
Definition: Unit.h:463
Definition: SharedDefines.h:1389
Definition: Creature.h:467
bool HasAuraTypeWithAffectMask(AuraType auratype, SpellInfo const *affectedSpell) const
Definition: Unit.cpp:4270
Not triggered.
Definition: Unit.h:461
Definition: SharedDefines.h:1423
Definition: SpellAuraDefines.h:62
Definition: SharedDefines.h:370
Item * m_CastItem
Definition: Spell.h:548
Definition: SharedDefines.h:4387
Definition: SharedDefines.h:1350
ObjectGuid GetPetGUID() const
Definition: Unit.h:1708
SpellCastResult CheckRange(bool strict)
Definition: Spell.cpp:5853
Definition: SharedDefines.h:1374
Definition: SharedDefines.h:1046
uint32 EffectIndex
Definition: SpellInfo.h:242
#define sObjectMgr
Definition: ObjectMgr.h:1567
uint32 ErrorTextId
Definition: ConditionMgr.h:206
ShapeshiftForm GetShapeshiftForm() const
Definition: Unit.h:1932
Definition: SharedDefines.h:1413
Definition: SharedDefines.h:1379
Definition: SharedDefines.h:1343
Definition: DBCEnums.h:398
Player * ToPlayer()
Definition: Object.h:191
Definition: SharedDefines.h:1370
bool CalculatePath(float destX, float destY, float destZ, bool forceDest=false, bool straightLine=false)
Definition: PathGenerator.cpp:57
Definition: SharedDefines.h:1405
uint8 getLevel() const
Definition: Unit.h:1408
DBCStorage< AreaTableEntry > sAreaTableStore(AreaTablefmt)
SpellImplicitTargetInfo TargetA
Definition: SpellInfo.h:257
Definition: SharedDefines.h:611
int32 irand(int32 min, int32 max)
Definition: Random.cpp:39
Definition: DynamicObject.h:35
Definition: SharedDefines.h:475
Definition: SpellAuraDefines.h:357
Powers getPowerType() const
Definition: Unit.h:1444
TypeID GetTypeId() const
Definition: Object.h:113
TC_GAME_API Player * FindPlayer(ObjectGuid const &)
Definition: ObjectAccessor.cpp:209
Definition: SharedDefines.h:1334
CreatureTemplate const * GetCreatureTemplate() const
Definition: Creature.h:558
Definition: SharedDefines.h:1369
uint32 TriggerSpell
Definition: SpellInfo.h:263
WorldObject * GetObjectTarget() const
Definition: Spell.cpp:282
Definition: SharedDefines.h:1111
uint32 ErrorType
Definition: ConditionMgr.h:205
SpellCastResult CheckTarget(Unit const *caster, WorldObject const *target, bool implicit=true) const
Definition: SpellInfo.cpp:1875
T min(const T &x, const T &y)
Definition: g3dmath.h:305
Definition: SharedDefines.h:1388
SpellHistory * GetSpellHistory()
Definition: Unit.h:1926
bool IsPotion() const
Definition: Item.h:384
Powers
Definition: SharedDefines.h:246
Definition: SharedDefines.h:1066
AttackerSet const & getAttackers() const
Definition: Unit.h:1377
Definition: SharedDefines.h:1292
Definition: SharedDefines.h:1280
Unit * m_originalCaster
Definition: Spell.h:653
SpellCastResult CheckShapeshift(uint32 form) const
Definition: SpellInfo.cpp:1665
uint32 ExcludeCasterAuraState
Definition: SpellInfo.h:356
Definition: SharedDefines.h:371
uint32 SpellFamilyName
Definition: SpellInfo.h:396
bool HasDst() const
Definition: Spell.h:229
int32 RequiredAreasID
Definition: SpellInfo.h:400
PathGenerator m_preGeneratedPath
Definition: Spell.h:830
uint32 GetSpell() const
Definition: TradeData.h:49
bool isLineOfSightCalcEnabled() const
Definition: IVMapManager.h:86
Definition: SharedDefines.h:1163
Targets GetTarget() const
Definition: SpellInfo.cpp:121
Definition: TradeData.h:34
Definition: SharedDefines.h:1425
bool IsAlive() const
Definition: Unit.h:1692
bool HasAttribute(SpellAttr0 attribute) const
Definition: SpellInfo.h:462
float GetPositionY() const
Definition: Position.h:105
Definition: SharedDefines.h:1183
TradeSlots
Definition: TradeData.h:23
G3D::int16 z
Definition: Vector3int16.h:46
void GetPosition(float &x, float &y) const
Definition: Position.h:109
Definition: SharedDefines.h:1337
bool IsTriggered() const
Definition: Spell.h:595
#define sSpellMgr
Definition: SpellMgr.h:756
Definition: SpellInfo.h:238
float GetPositionZ() const
Definition: Position.h:106
int32_t int32
Definition: Define.h:146
uint8 ConditionTarget
Definition: ConditionMgr.h:209
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition: Unit.h:1832
uint32_t uint32
Definition: Define.h:150
Definition: SpellInfo.h:52
Definition: SharedDefines.h:1342
bool IsFriendlyTo(Unit const *unit) const
Definition: Unit.cpp:7170
Definition: Battlefield.h:196
Will ignore mounted/on vehicle restrictions.
Definition: Unit.h:474
GameObjectTemplate const * GetGOInfo() const
Definition: GameObject.h:894
G3D::int16 y
Definition: Vector2int16.h:38
Definition: ConditionMgr.h:181
DBCStorage< GlyphPropertiesEntry > sGlyphPropertiesStore(GlyphPropertiesfmt)
SpellInfo const * GetSpellInfo() const
Definition: Spell.h:614
uint32 GetCurrentFoodBenefitLevel(uint32 itemlevel) const
Definition: Pet.cpp:1061
void SetPathLengthLimit(float distance)
Definition: PathGenerator.h:64
Definition: SharedDefines.h:4386
Definition: GameObject.h:880
Definition: DisableMgr.h:29
bool IsDungeon() const
Definition: DBCStructure.h:857
Definition: SpellAuraDefines.h:322
#define sConditionMgr
Definition: ConditionMgr.h:307
SpellEffectInfoVector const & GetEffects() const
Definition: Spell.h:623
uint32 GetAreaId() const
Definition: Object.cpp:1530
Will not adjust facing to target (if any)
Definition: Unit.h:471
Definition: SharedDefines.h:379
Definition: SharedDefines.h:1346
bool IsRaid() const
Definition: DBCStructure.h:860
Definition: SpellAuraDefines.h:124
Definition: DBCStructure.h:509
Definition: SharedDefines.h:1043
Definition: PathGenerator.h:46
bool AllowMount
Definition: Map.h:226
bool IsReady(SpellInfo const *spellInfo, uint32 itemId=0, bool ignoreCategoryCooldown=false) const
Definition: SpellHistory.cpp:262
Definition: SpellAuraDefines.h:390
uint32 CasterAuraState
Definition: SpellInfo.h:354
bool IsTargetingArea() const
Definition: SpellInfo.cpp:419
#define sBattlefieldMgr
Definition: BattlefieldMgr.h:67
Definition: SharedDefines.h:1489
Definition: SharedDefines.h:1297
Definition: SharedDefines.h:3934
Definition: PathGenerator.h:49
Definition: SharedDefines.h:1162
ObjectGuid const & GetGUID() const
Definition: Object.h:105
DBCStorage< TalentEntry > sTalentStore(Talentfmt)
Definition: SpellAuraDefines.h:187
Definition: SpellAuraDefines.h:237
Definition: SharedDefines.h:1473
Definition: SharedDefines.h:1013
Definition: ObjectGuid.h:33
bool isLooted() const
Definition: LootMgr.h:375
bool HaveInDiet(ItemTemplate const *item) const
Definition: Pet.cpp:1043
Definition: SharedDefines.h:1347
Definition: SharedDefines.h:1172
uint32 GetTargetMask() const
Definition: Spell.h:179
Definition: UpdateFields.h:109
DBCStorage< MapEntry > sMapStore(Mapfmt)
bool IsCritter() const
Definition: Unit.h:1580
uint32 Category
Definition: DBCStructure.h:1245
static ObjectGuid const TradeItem
Definition: ObjectGuid.h:197
Creature * ToCreature()
Definition: Object.h:194
Definition: SharedDefines.h:1273
Definition: SpellInfo.h:60
Definition: SharedDefines.h:1393
Definition: Battleground.h:160
Definition: SharedDefines.h:4627
SpellCastResult CheckLocation(uint32 map_id, uint32 zone_id, uint32 area_id, Player const *player=NULL) const
Definition: SpellInfo.cpp:1724
Definition: SharedDefines.h:1293
int32_t int32
Definition: g3dmath.h:167
Disallows proc events from triggered spell (default)
Definition: Unit.h:476
Definition: SharedDefines.h:1419
ObjectGuid GetItemTargetGUID() const
Definition: Spell.h:202
uint32 CasterAuraSpell
Definition: SpellInfo.h:358
static IVMapManager * createOrGetVMapManager()
Definition: VMapFactory.cpp:28
Definition: SharedDefines.h:3938
Definition: SharedDefines.h:1349
Definition: Battleground.h:235
Definition: UpdateFields.h:191
SpellCastResult
Definition: SharedDefines.h:1265
SkillType
Definition: SharedDefines.h:3881
const FieldDescriptor value
Definition: descriptor.h:1522
Definition: SharedDefines.h:1191
bool IsOutdoors(float x, float y, float z) const
Definition: Map.cpp:2388
Definition: SharedDefines.h:1357
bool NeedsExplicitUnitTarget() const
Definition: SpellInfo.cpp:1358
Definition: ConditionMgr.h:144
uint32_t uint32
Definition: g3dmath.h:168
Definition: SpellAuraDefines.h:267
Definition: SharedDefines.h:1480
SpellCustomErrors m_customError
Definition: Spell.h:586
G3D::int16 x
Definition: Vector2int16.h:37
Definition: SharedDefines.h:1364
SpellCastResult CheckVehicle(Unit const *caster) const
Definition: SpellInfo.cpp:2061
Definition: SharedDefines.h:1333
void ReducePathLenghtByDist(float dist)
Definition: PathGenerator.cpp:905
bool IsIgnoringCooldowns() const
Definition: Spell.h:596
bool HasFlag(uint16 index, uint32 flag) const
Definition: Object.cpp:1239
Definition: SharedDefines.h:1094
Definition: SharedDefines.h:175
bool HasGlobalCooldown() const
Definition: Spell.cpp:7351
float GetPositionX() const
Definition: Position.h:104
Definition: SharedDefines.h:1354
Definition: SharedDefines.h:1067
uint32 Effect
Definition: SpellInfo.h:243
TriggerCastFlags _triggeredCastFlags
Definition: Spell.h:821
Definition: SharedDefines.h:1353
Definition: SharedDefines.h:1335
SpellCastResult CheckCasterAuras() const
Definition: Spell.cpp:5644
Spell ** m_selfContainer
Definition: Spell.h:634
Definition: DBCStructure.h:1255
Definition: SharedDefines.h:1306
PathType GetPathType() const
Definition: PathGenerator.h:73
SkillType GetRequiredLootSkill() const
Definition: Creature.h:150
Definition: SharedDefines.h:1119
float GetObjectSize() const
Definition: Object.cpp:2656
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869
Definition: SharedDefines.h:2071
Definition: SharedDefines.h:1538
Definition: SharedDefines.h:1291
uint32 type
Definition: GameObject.h:37
Definition: SharedDefines.h:1279
Definition: SpellInfo.h:199
bool m_needComboPoints
Definition: Spell.h:685
Definition: SharedDefines.h:1328
Definition: SharedDefines.h:1282
bool IsEmpty() const
Definition: ObjectGuid.h:242
Definition: SharedDefines.h:1095
Definition: SharedDefines.h:373
Condition const * mLastFailedCondition
Definition: ConditionMgr.h:184
bool IsCooldownStartedOnEvent() const
Definition: SpellInfo.cpp:1470
Definition: SpellInfo.h:198
Definition: SharedDefines.h:248
GameObject * GetGOTarget() const
Definition: Spell.cpp:248
int32 MiscValueB
Definition: SpellInfo.h:254
Definition: SpellAuraDefines.h:138
uint32 SpellID
Definition: DBCStructure.h:1261
ItemTemplate const * GetTemplate() const
Definition: Item.cpp:547
Definition: DBCStructure.h:1242
Definition: SharedDefines.h:1430