36#include "G3DPosition.hpp"
77 _transportGUID(wObj.GetTransGUID()), _transportOffset(wObj.GetTransOffset())
101 m_itemTargetEntry(0), m_pitch(0.0f), m_speed(0.0f)
106 m_targetMask(spellCastRequest.Target.Flags), m_objectTarget(nullptr), m_itemTarget(nullptr),
107 m_objectTargetGUID(spellCastRequest.Target.
Unit), m_itemTargetGUID(spellCastRequest.Target.
Item),
108 m_itemTargetEntry(0), m_pitch(0.0f), m_speed(0.0f), m_strTarget(spellCastRequest.Target.
Name)
445 EffectBasePoints[spellEffectInfo.EffectIndex] = spellEffectInfo.CalcBaseValue(caster,
nullptr, 0, -1);
476m_spellValue(new
SpellValue(m_spellInfo, caster)), _spellEvent(nullptr)
507 if (!originalCasterGUID.
IsEmpty())
576 m_empower = std::make_unique<EmpowerData>();
634 Unit* unit =
nullptr;
690 Unit* redirect =
nullptr;
704 if (redirect && (redirect != target))
715 uint32 processedAreaEffectsMask = 0;
721 if (!spellEffectInfo.IsEffect())
751 bool noTargetFound = std::ranges::none_of(
m_UniqueTargetInfo, [effectMask = 1u << spellEffectInfo.EffectIndex](
TargetInfo const& target)
753 return target.EffectMask & effectMask;
775 uint32 mask = (1 << spellEffectInfo.EffectIndex);
778 if (ihit->EffectMask & mask)
794 if (!anyNonImmuneTargetFound)
840 return uint64(std::floor(launchDelay * 1000.0f));
863 return targetInfo.TargetGUID == unit->GetGUID();
866 uint64 oldDelay = itr->TimeDelay;
867 itr->TimeDelay = hitDelay;
876 return itr.TimeDelay && itr.TimeDelay < smallest.TimeDelay;
902 if (effectMask & processedEffectMask)
908 if (effects[j].IsEffect() &&
917 effectMask |= 1 << j;
920 processedEffectMask |= effectMask;
960 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT_SRC");
977 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT_DEST");
991 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT");
1001 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target category");
1010 ABORT_MSG(
"Spell::SelectImplicitChannelTargets: received not implemented target reference type");
1015 if (!channeledSpell)
1062 ABORT_MSG(
"Spell::SelectImplicitChannelTargets: received not implemented target type");
1071 ABORT_MSG(
"Spell::SelectImplicitNearbyTargets: received not implemented target reference type");
1092 ABORT_MSG(
"Spell::SelectImplicitNearbyTargets: received not implemented selection check type");
1101 TC_LOG_DEBUG(
"spells",
"Spell::SelectImplicitNearbyTargets: no conditions entry for target with TARGET_CHECK_ENTRY of spell ID {}, effect {} - selecting default targets",
m_spellInfo->
Id,
uint32(spellEffectInfo.
EffectIndex));
1142 dest = st->GetPosition();
1146 if (randomRadius > 0.0f)
1162 float randomRadius = 0.0f;
1202 TC_LOG_DEBUG(
"spells",
"Spell::SelectImplicitNearbyTargets: OnObjectTargetSelect script hook for spell Id {} set object of wrong type, expected unit, got {}, effect {}",
m_spellInfo->
Id, target->
GetGUID().
GetTypeName(), effMask);
1213 TC_LOG_DEBUG(
"spells",
"Spell::SelectImplicitNearbyTargets: OnObjectTargetSelect script hook for spell Id {} set object of wrong type, expected gameobject, got {}, effect {}",
m_spellInfo->
Id, target->
GetGUID().
GetTypeName(), effMask);
1224 TC_LOG_DEBUG(
"spells",
"Spell::SelectImplicitNearbyTargets: OnObjectTargetSelect script hook for spell Id {} set object of wrong type, expected corpse, got {}, effect {}",
m_spellInfo->
Id, target->
GetGUID().
GetTypeName(), effMask);
1233 if (randomRadius > 0.0f)
1244 ABORT_MSG(
"Spell::SelectImplicitNearbyTargets: received not implemented target object type");
1270 if (coneAngle == 0.0f)
1277 std::list<WorldObject*> targets;
1288 SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellConeTargetCheck> >(searcher, containerTypeMask,
m_caster,
m_caster, radius + extraSearchRadius);
1292 if (!targets.empty())
1331 if (ihit->EffectMask & (1 << spellEffectInfo.
EffectIndex))
1340 ABORT_MSG(
"Spell::SelectImplicitAreaTargets: received not implemented target reference type");
1362 ABORT_MSG(
"Spell::SelectImplicitAreaTargets: received not implemented target reference type");
1367 std::list<WorldObject*> targets;
1373 if (
Vehicle const* vehicleKit = unit->GetVehicleKit())
1375 if (
Unit* passenger = vehicleKit->GetPassenger(seat))
1376 targets.push_back(passenger);
1395 for (
ThreatReference const* threatRef : unit->GetThreatManager().GetUnsortedThreatList())
1397 targets.push_back(threateningUnit);
1401 for (
ObjectGuid const& tapperGuid : creature->GetTapList())
1403 targets.push_back(tapper);
1427 if (!targets.empty())
1434 else if (targets.size() > maxTargets)
1435 targets.resize(maxTargets);
1469 dest = st->GetPosition();
1482 float dist =
frand(minDist, maxDist);
1484 float angle =
rand_norm() *
static_cast<float>(
M_PI * 35.0f / 180.0f) -
static_cast<float>(
M_PI * 17.5f / 180.0f);
1491 liquidLevel = liquidData.
level;
1493 if (liquidLevel <= ground)
1501 if (ground + 0.75 > liquidLevel)
1519 float dist = spellEffectInfo.
CalcRadius(unitCaster, targetIndex);
1536 return static_cast<float>(
M_PI);
1539 return static_cast<float>(
M_PI / 2);
1541 return static_cast<float>(
M_PI / 4);
1543 return static_cast<float>(3 *
M_PI / 4);
1546 return static_cast<float>(-
M_PI / 2);
1548 return static_cast<float>(-
M_PI / 4);
1550 return static_cast<float>(-3 *
M_PI / 4);
1570 if (
WorldObject const* summoner = casterSummon->GetSummoner())
1576 std::vector<SpellTargetPosition const*> positionsInRange;
1579 positionsInRange.push_back(&position);
1581 if (positionsInRange.empty())
1605 dist = objSize + (dist - objSize);
1612 static constexpr float DefaultTotemDistance = 3.0f;
1613 if (!spellEffectInfo.
HasRadius(targetIndex))
1614 dist = DefaultTotemDistance;
1642 "Spell::SelectImplicitTargetDestTargets - no explicit object target available!");
1659 float dist = spellEffectInfo.
CalcRadius(
nullptr, targetIndex);
1731 bool checkIfValid =
true;
1737 checkIfValid =
false;
1744 target = unitCaster->GetGuardianPet();
1748 if (unitCaster->IsSummon())
1749 target = unitCaster->ToTempSummon()->GetSummonerUnit();
1753 target = unitCaster->GetVehicleBase();
1764 if (vehicleBase->IsVehicle())
1769 if (!creatureCaster->GetTapList().empty())
1796 "Spell::SelectImplicitTargetObjectTargets - no explicit object or item target available!");
1827 for (
size_t k = spellEffectInfo.
EffectIndex; k < m_spellInfo->GetEffects().
size(); ++k)
1828 if (effMask & (1 << k))
1832 std::list<WorldObject*> targets;
1841 for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
1858 if (x < 100000.0f && x > -100000.0f)
return x;
1859 if (x >= 100000.0f)
return 100000.0f;
1860 if (x <= 100000.0f)
return -100000.0f;
1877 std::list<WorldObject*> targets;
1880 SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellTrajTargetCheck> > (searcher,
GRID_MAP_TYPE_MASK_ALL,
m_caster, &srcPos, dist2d);
1881 if (targets.empty())
1887 float a = (srcToDestDelta - dist2d * b) / (dist2d * dist2d);
1895 bestDist = std::min(std::max(bestDist, triggerSpellInfo->GetMaxRange(
false)), std::min(dist2d, 300.0f));
1899 for (
auto itr = targets.begin(); itr != targets.end(); ++itr)
1906 if (unitCaster == *itr || unitCaster->
IsOnVehicle(unit) || unit->GetVehicle())
1916 float const size = std::max((*itr)->GetCombatReach(), 1.0f);
1918 float const dz = (*itr)->GetPositionZ() - srcPos.
m_positionZ;
1920 float const horizontalDistToTraj = std::fabs(objDist2d * std::sin(srcPos.
GetRelativeAngle(*itr)));
1921 float const sizeFactor = std::cos((horizontalDistToTraj /
size) * (
M_PI / 2.0f));
1922 float const distToHitPoint = std::max(objDist2d * std::cos(srcPos.
GetRelativeAngle(*itr)) -
size * sizeFactor, 0.0f);
1923 float const height = distToHitPoint * (a * distToHitPoint + b);
1928 if (distToHitPoint < bestDist)
1930 bestDist = distToHitPoint;
1935 if (dist2d > bestDist)
1952 std::list<WorldObject*> targets;
1971 ABORT_MSG(
"Spell::SelectImplicitLineTargets: received not implemented target reference type");
1982 SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellLineTargetCheck>>(searcher, containerTypeMask,
m_caster,
m_caster, radius);
1986 if (!targets.empty())
1991 if (maxTargets < targets.size())
1994 targets.resize(maxTargets);
1998 for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
2014 switch (spellEffectInfo.
Effect)
2035 Player* player = ObjectAccessor::GetPlayer(map, targetGuid);
2040 if (player->IsImmunedToSpellEffect(spell->GetSpellInfo(), spellEffectInfo, nullptr))
2043 spell->HandleEffects(player, nullptr, nullptr, nullptr, spellEffectInfo, SPELL_EFFECT_HANDLE_HIT_TARGET);
2075 target = corpseTarget;
2141 retMask &= ~GRID_MAP_TYPE_MASK_PLAYER;
2144 retMask &=
sConditionMgr->GetSearcherTypeMaskForConditionList(*condList);
2148template<
class SEARCHER>
2157 if (searchInGrid || searchInWorld)
2184 if (!containerTypeMask)
2190 SearchTargets<Trinity::WorldObjectLastSearcher<Trinity::WorldObjectSpellNearbyTargetCheck>>(searcher, containerTypeMask,
m_caster,
m_caster, range);
2199 if (!containerTypeMask)
2206 SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellAreaTargetCheck>>(searcher, containerTypeMask,
m_caster, position, range + extraSearchRadius);
2213 float jumpRadius = 0.0f;
2239 float searchRadius = [&]()
2247 return jumpRadius * chainTargets;
2251 std::list<WorldObject*> tempTargets;
2254 tempTargets.remove(target);
2266 while (chainTargets)
2269 std::list<WorldObject*>::iterator foundItr = tempTargets.end();
2274 for (std::list<WorldObject*>::iterator itr = tempTargets.begin(); itr != tempTargets.end(); ++itr)
2278 uint32 deficit = unit->GetMaxHealth() - unit->GetHealth();
2282 maxHPDeficit = deficit;
2290 for (std::list<WorldObject*>::iterator itr = tempTargets.begin(); itr != tempTargets.end(); ++itr)
2292 bool isBestDistanceMatch = foundItr != tempTargets.end() ? chainSource->
GetDistanceOrder(*itr, *foundItr) : chainSource->
IsWithinDist(*itr, jumpRadius);
2293 if (!isBestDistanceMatch)
2306 if (foundItr == tempTargets.end())
2310 chainSource = *foundItr;
2312 targets.push_back(*foundItr);
2313 tempTargets.erase(foundItr);
2409 if (!spellEffectInfo.IsEffect() || !
CheckEffectTarget(target, spellEffectInfo, losPosition))
2410 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2423 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2432 ihit->EffectMask |= effectMask;
2445 targetInfo.
IsCrit =
false;
2461 return (target.EffectMask & effectMask) != 0;
2468 missileSource = previousTarget;
2470 targetInfo.
TimeDelay += previousTargetItr->TimeDelay;
2517 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2530 ihit->EffectMask |= effectMask;
2570 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2581 ihit->EffectMask |= effectMask;
2597 if (!spellEffectInfo.IsEffect())
2598 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2611 ihit->EffectMask |= effectMask;
2656 if (uniqueTargetInfo.MissCondition ==
SPELL_MISS_NONE && uniqueTargetInfo.EffectMask & (1 << effect))
2658 if (uniqueTargetInfo.TargetGUID == target)
2672 return targetInfo.MissCondition == SPELL_MISS_NONE && targetInfo.EffectMask & (1 << effect);
2680 return targetInfo.EffectMask & (1 << effect);
2688 return targetInfo.EffectMask & (1 << effect);
2696 return targetInfo.EffectMask & (1 << effect);
2768 if (_spellHitTarget)
2784 if (_spellHitTarget)
2805 if (canEffectTrigger && !procAttacker && !procVictim)
2807 bool positive =
true;
2815 if (EffectMask && !(EffectMask & (1 << i)))
2875 bool hasHealing =
false;
2876 std::unique_ptr<DamageInfo> spellDamageInfo;
2877 std::unique_ptr<HealInfo> healInfo;
2893 spell->
m_healing = healInfo->GetEffectiveHeal();
2899 bool hasDamage =
false;
2928 damageInfo.
damage = victimCreature->CalculateDamageForSparring(damageInfo.
attacker, damageInfo.
damage);
2939 if (canEffectTrigger)
2947 if (!hasHealing && !hasDamage)
2953 if (canEffectTrigger)
2955 spellDamageInfo = std::make_unique<DamageInfo>(damageInfo,
NODAMAGE, spell->
m_attackType, ProcHitMask);
2969 if (canEffectTrigger)
2995 if (unitCaster->IsPlayer())
2996 targetCreature->SetTappedBy(unitCaster);
3008 if (_spellHitTarget)
3012 if (
CreatureAI* hitTargetAI = cHitTarget->AI())
3022 if (
AuraApplication* aurApp = HitAura->GetApplicationOfTarget(_spellHitTarget->GetGUID()))
3025 uint32 effMask = EffectMask & aurApp->GetEffectsToApply();
3027 if ((effMask & (1 << i)) && aurApp->HasEffect(i))
3028 effMask &= ~(1 << i);
3031 _spellHitTarget->_ApplyAura(aurApp, effMask);
3033 if (aurApp->IsNeedClientUpdate() && aurApp->GetRemoveMode() ==
AURA_REMOVE_NONE)
3035 aurApp->ClientUpdate(
false);
3036 _spellHitTarget->RemoveVisibleAuraUpdate(aurApp);
3107 if (creatureTarget->IsEvadingAttacks())
3145 playerOwner->SetContestedPvP();
3146 playerOwner->UpdatePvP(
true);
3188 if (origCaster == unit || !origCaster->
IsFriendlyTo(unit))
3193 if (hitInfo.
EffectMask & (1 << auraSpellEffect.EffectIndex) &&
3194 auraSpellEffect.IsUnitOwnedAuraEffect() &&
3224 bool refresh =
false;
3263 if (
int32 period = auraEff->GetPeriod())
3309 int32 _duration = 0;
3315 .SetTriggeringSpell(
this)
3316 .SetCastDifficulty(i->triggeredSpell->Difficulty));
3317 TC_LOG_DEBUG(
"spells",
"Spell {} triggered spell {} by SPELL_AURA_ADD_TARGET_TRIGGER aura",
m_spellInfo->
Id, i->triggeredSpell->Id);
3321 if (i->triggeredSpell->GetDuration() == -1)
3331 triggeredAur->SetDuration(_duration);
3342 for (std::vector<int32>::const_iterator i = spellTriggered->begin(); i != spellTriggered->end(); ++i)
3361 uint32 channelAuraMask = 0;
3364 channelAuraMask |= 1 << spellEffectInfo.EffectIndex;
3366 channelAuraMask &= channelTargetEffectMask;
3369 if (channelAuraMask)
3381 if (targetInfo.MissCondition ==
SPELL_MISS_NONE && (channelTargetEffectMask & targetInfo.EffectMask))
3387 unitCaster->RemoveChannelObject(targetInfo.TargetGUID);
3393 if (channelAuraMask & targetInfo.EffectMask)
3399 targetInfo.EffectMask &= ~aurApp->GetEffectMask();
3402 unitCaster->RemoveChannelObject(targetInfo.TargetGUID);
3409 unitCaster->RemoveChannelObject(targetInfo.TargetGUID);
3414 channelTargetEffectMask &= ~targetInfo.EffectMask;
3420 return channelTargetEffectMask == 0;
3446 if (triggeredByAura)
3478 int32 param1 = 0, param2 = 0;
3496 if (param1 || param2)
3537 return movementResult;
3585 unitCaster->SetCurrentCastSpell(
this);
3594 if (caster->IsAIEnabled())
3597 if (willCastDirectly)
3659 Spell* lastSpellMod =
nullptr;
3694 sScriptMgr->OnPlayerSpellCast(playerCaster,
this, skipCheck);
3703 if (
CreatureAI* controlledAI = cControlled->AI())
3704 controlledAI->OwnerAttacked(target);
3735 int32 param1 = 0, param2 = 0;
3739 cleanupSpell(castResult, ¶m1, ¶m2);
3751 if (!my_trade->IsInAcceptProcess())
3767 if (spellEffectInfo.IsUnitOwnedAuraEffect())
3768 aura_effmask |= 1 << spellEffectInfo.EffectIndex;
3779 if (target->HasStrongerAuraWithDR(
m_spellInfo, caster))
3792 if (!creatureCaster->GetTarget().IsEmpty() && !creatureCaster->HasUnitFlag(
UNIT_FLAG_POSSESSED))
3794 creatureCaster->SetInFront(target);
3816 pet->DespawnOrUnsummon();
3877 creatureCaster->ReleaseSpellFocus(
this);
3891 if (unitCaster->HasUnitState(
UNIT_STATE_CASTING) && !unitCaster->IsNonMeleeSpellCast(
false,
false,
true))
3907 for (
int32 id : *spell_triggered)
3912 unitCaster->RemoveAurasDueToSpell(-
id);
3916 .SetTriggeringSpell(
this));
3977 if (caster->IsAIEnabled())
3981template <
class Container>
3985 target.PreprocessTarget(
this);
3989 if (target.EffectMask & (1 << spellEffectInfo.EffectIndex))
3990 target.DoTargetSpellHit(
this, spellEffectInfo);
3993 target.DoDamageAndTriggers(
this);
4006 int32 originalDuration = duration;
4020 float ratio = float(duration) / float(originalDuration);
4023 for (std::size_t i = 0; i <
m_empower->StageDurations.size() - 1; ++i)
4026 totalExceptLastStage +=
m_empower->StageDurations[i];
4045 else if (duration == -1)
4097 bool ignoreTargetInfoTimeDelay = single_missile;
4103 if (launchMoment > t_offset)
4104 return launchMoment;
4112 ignoreTargetInfoTimeDelay =
false;
4130 std::vector<TargetInfo> delayedTargets;
4133 if (ignoreTargetInfoTimeDelay || target.TimeDelay <= t_offset)
4135 target.TimeDelay = t_offset;
4136 delayedTargets.emplace_back(std::move(target));
4139 else if (!single_missile && (next_time == 0 || target.
TimeDelay < next_time))
4150 std::vector<GOTargetInfo> delayedGOTargets;
4153 if (ignoreTargetInfoTimeDelay || goTarget.TimeDelay <= t_offset)
4155 goTarget.TimeDelay = t_offset;
4156 delayedGOTargets.emplace_back(std::move(goTarget));
4159 else if (!single_missile && (next_time == 0 || goTarget.TimeDelay < next_time))
4160 next_time = goTarget.TimeDelay;
4171 modOwner->SetSpellModTakingSpell(
this,
false);
4200 if (!spellEffectInfo.IsEffect())
4332 for (std::size_t i = 0; i <
m_empower->StageDurations.size(); ++i)
4339 return m_empower->StageDurations.size();
4342 if (completedStages !=
m_empower->CompletedStages)
4350 m_empower->CompletedStages = completedStages;
4352 unitCaster->SetSpellEmpowerStage(completedStages);
4373 if (creatureCaster->IsAIEnabled())
4374 creatureCaster->AI()->OnChannelFinished(
m_spellInfo);
4416 ((
Puppet*)charm)->UnSummon();
4420 creatureCaster->ReleaseSpellFocus(
this);
4478 packet.CastID = castId;
4479 packet.SpellID = spellInfo->
Id;
4480 packet.Reason = result;
4486 packet.FailedArg1 = *param1;
4488 packet.FailedArg1 = 0;
4492 packet.FailedArg1 = *param1;
4498 packet.FailedArg1 = *param1;
4502 switch (spellInfo->
Id)
4506 packet.FailedArg1 = 3905;
4510 packet.FailedArg1 = 3842;
4513 packet.FailedArg1 = 4075;
4516 packet.FailedArg1 = 0;
4524 packet.FailedArg1 = *param1;
4526 packet.FailedArg2 = *param2;
4530 if (spellInfo->
Totem[0])
4531 packet.FailedArg1 = spellInfo->
Totem[0];
4532 if (spellInfo->
Totem[1])
4533 packet.FailedArg2 = spellInfo->
Totem[1];
4539 packet.FailedArg1 = *param1;
4541 packet.FailedArg2 = *param2;
4554 if (param1 && param2)
4556 packet.FailedArg1 = *param1;
4557 packet.FailedArg2 = *param2;
4568 packet.FailedArg1 = *param1;
4574 if (
uint32 itemType = spellEffectInfo.ItemType)
4589 packet.FailedArg1 = *param1;
4595 packet.FailedArg1 = *param1;
4600 if (param1 && param2)
4602 packet.FailedArg1 = *param1;
4603 packet.FailedArg2 = *param2;
4607 packet.FailedArg1 = 0;
4608 packet.FailedArg2 = 0;
4612 if (param1 && param2)
4614 packet.FailedArg1 = *param1;
4615 packet.FailedArg2 = *param2;
4619 packet.FailedArg1 = 0;
4620 packet.FailedArg2 = 0;
4625 packet.FailedArg1 = *param1;
4627 packet.FailedArg1 = 0;
4630 packet.FailedArg1 = customError;
4634 packet.FailedArg1 = *param1;
4636 packet.FailedArg1 = 0;
4641 packet.FailedArg1 = *param1;
4646 if (spellInfo->
Reagent[i] <= 0)
4652 if (caster && !caster->
HasItemCount(itemid, itemcount))
4654 packet.FailedArg1 = itemid;
4661 packet.FailedArg2 = *param2;
4668 packet.FailedArg1 = -1;
4680 packet.FailedArg1 = *param1;
4737 packet.
Visual = spellVisual;
4767 uint32 schoolImmunityMask = 0;
4768 uint32 mechanicImmunityMask = 0;
4771 schoolImmunityMask =
m_timer!= 0 ? unitCaster->GetSchoolImmunityMask() : 0;
4775 if (schoolImmunityMask || mechanicImmunityMask)
4838 float baseCd = float(player->GetRuneBaseCooldown());
4839 castData.
RemainingRunes->Cooldowns.push_back((baseCd -
float(player->GetRuneCooldown(i))) / baseCd * 255);
4967 if (targetInfo.EffectMask == 0)
4973 data.
HitTargets.push_back(targetInfo.TargetGUID);
4980 data.
MissTargets.push_back(targetInfo.TargetGUID);
4981 data.
MissStatus.emplace_back(targetInfo.MissCondition, targetInfo.ReflectResult);
4986 data.
HitTargets.push_back(targetInfo.TargetGUID);
4989 data.
HitTargets.push_back(targetInfo.TargetGUID);
4998 uint32 ammoInventoryType = 0;
4999 uint32 ammoDisplayID = 0;
5009 else if (playerCaster->HasAura(46699))
5011 ammoDisplayID = 5996;
5018 uint32 nonRangedAmmoDisplayID = 0;
5019 uint32 nonRangedAmmoInventoryType = 0;
5022 if (
uint32 item_id = unitCaster->GetVirtualItemId(i))
5028 switch (itemEntry->SubclassID)
5031 ammoDisplayID =
sDB2Manager.GetItemDisplayId(item_id, unitCaster->GetVirtualItemAppearanceMod(i));
5032 ammoInventoryType = itemEntry->InventoryType;
5036 ammoDisplayID = 5996;
5040 ammoDisplayID = 5998;
5044 nonRangedAmmoDisplayID =
sDB2Manager.GetItemDisplayId(item_id, unitCaster->GetVirtualItemAppearanceMod(i));
5045 nonRangedAmmoInventoryType = itemEntry->InventoryType;
5056 if (!ammoDisplayID && !ammoInventoryType)
5058 ammoDisplayID = nonRangedAmmoDisplayID;
5059 ammoInventoryType = nonRangedAmmoInventoryType;
5063 return ammoDisplayID;
5072 switch (spellEffectInfo.Effect)
5077 spellInfo, spellEffectInfo.CalcValue(unitCaster,
nullptr, target,
nullptr, castItemEntry, castItemLevel),
5091 switch (spellEffectInfo.ApplyAuraName)
5096 spellInfo, spellEffectInfo.CalcValue(unitCaster,
nullptr, target,
nullptr, castItemEntry, castItemLevel),
5101 points +=
CalcPredictedHealing(triggered, unitCaster, target, castItemEntry, castItemLevel,
nullptr, withPeriodic).first;
5109 return { points, type };
5115 healPrediction.
Points = 0;
5123 healPrediction.
Points = points;
5124 healPrediction.
Type = type;
5127 static constexpr uint32 beaconSpellId = 53651;
5133 return aura->GetSpellInfo()->GetEffects().size() > EFFECT_1 && aura->GetSpellInfo()->GetEffect(EFFECT_1).TriggerSpell == beaconSpellId;
5138 healPrediction.
BeaconGUID = (*beacon)->GetOwner()->GetGUID();
5164 return log.Effect == effect;
5179 spellLogEffectPowerDrainParams.
Points = points;
5180 spellLogEffectPowerDrainParams.
PowerType = powerType;
5181 spellLogEffectPowerDrainParams.
Amplitude = amplitude;
5189 spellLogEffectExtraAttacksParams.
Victim = victim->
GetGUID();
5190 spellLogEffectExtraAttacksParams.
NumAttacks = numAttacks;
5209 spellLogEffectDurabilityDamageParams.
Victim = victim->
GetGUID();
5210 spellLogEffectDurabilityDamageParams.
ItemID = itemId;
5211 spellLogEffectDurabilityDamageParams.
Amount = amount;
5227 spellLogEffectTradeSkillItemParams.
ItemID = entry;
5235 spellLogEffectFeedPetParams.
ItemID = entry;
5259 spellLogEffectGenericVictimParams.
Victim = target->
GetGUID();
5271 failurePacket.
Reason = result;
5279 failedPacket.
Reason = result;
5307 spellEmpowerUpdate.
Status = 1;
5309 spellEmpowerUpdate.
Status = 4;
5333 uint32 channelAuraMask = 0;
5334 uint32 explicitTargetEffectMask = 0xFFFFFFFF;
5340 return target.TargetGUID == m_targets.GetUnitTargetGUID();
5343 explicitTargetEffectMask = explicitTargetItr->EffectMask;
5347 if (spellEffectInfo.IsEffect(
SPELL_EFFECT_APPLY_AURA) && (explicitTargetEffectMask & (1u << spellEffectInfo.EffectIndex)))
5348 channelAuraMask |= 1 << spellEffectInfo.EffectIndex;
5352 if (!(target.EffectMask & channelAuraMask))
5363 if (target.EffectMask & channelAuraMask)
5370 if (unitCaster->
m_unitData->ChannelObjects.size() == 1 && unitCaster->
m_unitData->ChannelObjects[0].IsUnit())
5371 if (!creatureCaster->HasSpellFocus(
this))
5382 if (schoolImmunityMask || mechanicImmunityMask)
5384 interruptImmunities.emplace();
5385 interruptImmunities->SchoolImmunities = schoolImmunityMask;
5386 interruptImmunities->Immunities = mechanicImmunityMask;
5391 healPrediction.emplace();
5392 if (unitCaster->
m_unitData->ChannelObjects.size() == 1 && unitCaster->
m_unitData->ChannelObjects[0].IsUnit())
5393 healPrediction->TargetGUID = unitCaster->
m_unitData->ChannelObjects[0];
5434 std::string sentName;
5445 resurrectRequest.
Name = sentName;
5449 if (
CharmInfo* charmInfo = pet->GetCharmInfo())
5450 resurrectRequest.
PetNumber = charmInfo->GetPetNumber();
5479 bool expendable =
false;
5480 bool withoutCharges =
false;
5485 if (itemEffect->Charges)
5487 if (itemEffect->Charges < 0)
5506 withoutCharges = (charges == 0);
5510 if (expendable && withoutCharges)
5559 if (cost.Amount < 0)
5583 unitCaster->
ModifyPower(cost.Power, -cost.Amount);
5630 return totalCost + (cost.Power == POWER_RUNES ? cost.Amount : 0);
5643 int32 readyRunes = 0;
5648 if (readyRunes < runeCost)
5667 return totalCost + (cost.Power == POWER_RUNES ? cost.Amount : 0);
5721 if (itemEffect->Charges < 0 && abs(charges) < 2)
5757 float threat = 0.0f;
5760 if (threatEntry->apPctMod != 0.0f)
5763 threat += threatEntry->flatMod;
5777 float threatToAdd = threat;
5814 if (!preventDefault)
5815 (this->*SpellEffectHandlers[spellEffectInfo.
Effect].
Value)();
5821 return spellEvent->GetSpell();
5932 bool checkForm =
true;
5981 bool hasInvalidMountAura = std::ranges::any_of(unitCaster->GetAuraEffectsByType(
SPELL_AURA_MOUNTED), [unitCaster](
AuraEffect const* mountEffect)
5983 uint32 mountType = mountEffect->GetSpellEffectInfo().MiscValueB;
5984 if (MountEntry const* mountEntry = sDB2Manager.GetMount(mountEffect->GetId()))
5985 mountType = mountEntry->MountTypeID;
5987 MountCapabilityEntry const* mountCapability = unitCaster->GetMountCapability(mountType);
5988 return !mountCapability || mountCapability->ID != uint32(mountEffect->GetAmount());
5991 if (!hasInvalidMountAura)
6001 return vehicleCheck;
6054 if (!unitCaster->IsFriendlyTo(auraEff->GetCaster()) && !target->HasAura(auraEff->GetId(), auraEff->GetCasterGUID()))
6058 if (!unitCaster->IsFriendlyTo(auraEff->GetCaster()) && (!target->HasAura(auraEff->GetId(), auraEff->GetCasterGUID()) || !unitCaster->HasAura(auraEff->GetId(), auraEff->GetCasterGUID())))
6096 if (!unitCaster->GetPetGUID().IsEmpty())
6103 if (!unitCaster->GetGuardianPet())
6122 if (player->InArena())
6198 uint32 approximateAuraEffectMask = 0;
6199 uint32 nonAuraEffectMask = 0;
6203 switch (spellEffectInfo.Effect)
6210 if (!unit || !unit->
HasAura(17743))
6235 if (!learn_spellproto)
6266 if (!learn_spellproto)
6283 if (
uint32 glyphId = spellEffectInfo.MiscValue)
6286 if (!glyphProperties)
6289 std::vector<uint32>
const* glyphBindableSpells =
sDB2Manager.GetGlyphBindableSpells(glyphId);
6290 if (!glyphBindableSpells)
6293 if (std::find(glyphBindableSpells->begin(), glyphBindableSpells->end(),
m_misc.SpellId) == glyphBindableSpells->end())
6296 if (std::vector<ChrSpecialization>
const* glyphRequiredSpecs =
sDB2Manager.GetGlyphRequiredSpecs(glyphId))
6301 if (std::find(glyphRequiredSpecs->begin(), glyphRequiredSpecs->end(), caster->
GetPrimarySpecialization()) == glyphRequiredSpecs->end())
6305 uint32 replacedGlyph = 0;
6308 if (std::vector<uint32>
const* activeGlyphBindableSpells =
sDB2Manager.GetGlyphBindableSpells(activeGlyphId))
6310 if (std::find(activeGlyphBindableSpells->begin(), activeGlyphBindableSpells->end(),
m_misc.SpellId) != activeGlyphBindableSpells->end())
6312 replacedGlyph = activeGlyphId;
6320 if (activeGlyphId == replacedGlyph)
6323 if (activeGlyphId == glyphId)
6420 Item* pTempItem =
nullptr;
6445 lockId = go->GetGOInfo()->GetLockId();
6453 lockId = itm->GetTemplate()->GetLockID();
6456 int32 reqSkillValue = 0;
6457 int32 skillValue = 0;
6478 return petInfo && !petInfo->Health;
6481 if (deadPetItr == petStable->
ActivePets.end())
6494 if (!SummonProperties)
6497 switch (SummonProperties->
Control)
6534 .SetOriginalCaster(pet->GetGUID())
6548 if (!spellEffectInfo.MiscValue)
6550 petSlot =
PetSaveMode(spellEffectInfo.CalcValue());
6555 if (activePet && !activePet->Health)
6573 if (creatureInfo && creatureInfo->
IsTameable(
true, creatureDifficulty))
6582 else if (!spellEffectInfo.MiscValue)
6624 uint32 mapId = map->GetId();
6625 Difficulty difficulty = map->GetDifficultyID();
6626 if (
InstanceLock const* mapLock = map->GetInstanceLock())
6630 if (!target->
Satisfy(
sObjectMgr->GetAccessRequirement(mapId, difficulty), mapId))
6762 if (!artifactEntry || artifactEntry->
ArtifactCategoryID != spellEffectInfo.MiscValue)
6791 if (
uint32 battlePetType = spellEffectInfo.MiscValue)
6792 if (!(battlePetType & (1 << battlePetSpecies->PetTypeEnum)))
6799 return a1->MaxQualityRoll < selector;
6825 if (spellEffectInfo.IsAura())
6826 approximateAuraEffectMask |= 1 << spellEffectInfo.EffectIndex;
6827 else if (spellEffectInfo.IsEffect())
6828 nonAuraEffectMask |= 1 << spellEffectInfo.EffectIndex;
6833 switch (spellEffectInfo.ApplyAuraName)
6871 if (target->GetTypeId() ==
TYPEID_UNIT && target->IsVehicle())
6874 if (target->IsMounted())
6877 if (!target->GetCharmerGUID().IsEmpty())
6880 if (target->GetOwner() && target->GetOwner()->GetTypeId() ==
TYPEID_PLAYER)
6884 if (value &&
int32(target->GetLevelForTarget(
m_caster)) > value)
6931 if (spellEffectInfo.IsTargetingArea())
6951 && (approximateAuraEffectMask & (1 << spellEffectInfo.EffectIndex))
6954 if (!target->IsHighestExclusiveAuraEffect(
m_spellInfo, spellEffectInfo.ApplyAuraName,
6956 approximateAuraEffectMask,
false))
6996 if (!owner->IsAlive())
7011 if (!creatureCaster->GetSpellHistory()->IsReady(
m_spellInfo))
7060 bool foundNotMechanic =
false;
7064 uint64 const mechanicMask = aurEff->GetSpellInfo()->GetAllEffectsMechanicMask();
7067 foundNotMechanic =
true;
7072 *param1 = aurEff->GetSpellEffectInfo().Mechanic;
7074 *param1 = aurEff->GetSpellInfo()->Mechanic;
7081 if (foundNotMechanic)
7103 if (usableWhileStunned)
7107 result = mechanicResult;
7112 result = mechanicResult;
7124 if (usableWhileFeared)
7128 result = mechanicResult;
7135 if (usableWhileConfused)
7139 result = mechanicResult;
7162 if (auraEffects.empty())
7172 *param1 = aurEff->GetSpellEffectInfo().Mechanic;
7174 *param1 = aurEff->GetSpellInfo()->Mechanic;
7225 bool isRatedBattleground =
false;
7226 bool isArena = !isRatedBattleground;
7261 if (!unitCaster->CanCastSpellWhileMoving(
m_spellInfo))
7294 if (!spellEffectInfo.IsAura())
7297 AuraType const& auraType = spellEffectInfo.ApplyAuraName;
7299 for (Unit::AuraEffectList::const_iterator auraIt = auras.begin(); auraIt != auras.end(); ++auraIt)
7309 if (
GetCaster() == (*auraIt)->GetCaster())
7314 if (abs(spellEffectInfo.CalcBaseValue(
m_caster, target, 0, -1)) <= abs((*auraIt)->GetAmount()))
7333 if (ihit->TargetGUID == targetguid)
7365 minRange *= minRange;
7366 maxRange *= maxRange;
7409 float rangeMod = 0.0f;
7410 float minRange = 0.0f;
7411 float maxRange = 0.0f;
7414 return { 0.0f, 100.0f };
7424 rangeMod = unitCaster->
GetMeleeRange(target ? target : unitCaster);
7428 float meleeRange = 0.0f;
7433 meleeRange = unitCaster->
GetMeleeRange(target ? target : unitCaster);
7444 minRange += rangeMod;
7450 rangeMod += 8.0f / 3.0f;
7455 maxRange *= ranged->GetTemplate()->GetRangedModRange() * 0.01f;
7460 maxRange += rangeMod;
7462 return { minRange, maxRange };
7487 TC_LOG_ERROR(
"spells",
"Spell::CheckPower: Unknown power type '{}'", cost.Power);
7562 if (spellEffectInfo.MiscValue < 0 || spellEffectInfo.MiscValue >=
int8(
MAX_POWERS))
7611 if (targetItem->GetOwnerGUID() != player->
GetGUID())
7612 checkReagents =
true;
7636 if (itemEffect->Charges < 0 && abs(charges) < 2)
7685 *param1 = totemCategory;
7695 switch (spellEffectInfo.Effect)
7713 if (spellEffectInfo.ItemType)
7719 uint32 createCount = std::clamp<uint32>(spellEffectInfo.CalcValue(), 1u, itemTemplate->
GetMaxStackSize());
7727 player->
SendEquipError(msg,
nullptr,
nullptr, spellEffectInfo.ItemType);
7737 player->
SendEquipError(msg,
nullptr,
nullptr, spellEffectInfo.ItemType);
7742 .SetTriggeringSpell(
this));
7764 player->
SendEquipError(msg,
nullptr,
nullptr, spellEffectInfo.ItemType);
7782 if (requiredLevel < m_spellInfo->BaseLevel)
7789 bool isItemUsable =
false;
7794 isItemUsable =
true;
7805 switch (enchantEntry->
Effect[s])
7827 if (targetItem->
GetOwner() != player)
7844 uint32 enchant_id = spellEffectInfo.MiscValue;
7859 if (requiredLevel < m_spellInfo->BaseLevel)
7884 if (!disenchantSkillRequired)
7908 if (param1 && param2)
7939 if (param1 && param2)
7983 uint32 itemId = spellEffectInfo.ItemType;
7991 if (itemEffect->Charges != 0 && item->GetSpellCharges(itemEffect) == itemEffect->Charges)
8005 if (!azeriteEmpoweredItem)
8008 bool hasSelections =
false;
8013 hasSelections =
true;
8053 return mainHandResult;
8060 return offHandResult;
8077 int32 delaytime = 500;
8079 int32 delayReduce = 100;
8083 if (delayReduce >= 100)
8086 AddPct(delaytime, -delayReduce);
8121 int32 delayReduce = 100;
8125 if (delayReduce >= 100)
8128 AddPct(delaytime, -delayReduce);
8145 dynObj->Delay(delaytime);
8264 if (!gobCaster->GetGOInfo()->GetRequireLOS())
8273 switch (spellEffectInfo.
Effect)
8326 switch (spellEffectInfo.
Effect)
8390 m_empower->IsReleasedByClient = release;
8402 return passedTime >=
m_empower->MinHoldTime;
8431 TC_LOG_ERROR(
"spells",
"~SpellEvent: {} {} tried to delete non-deletable spell {}. Was not deleted, causes memory leak.",
8558 if (!spellEffectInfo.IsEffect())
8571 float multiplier = 1.0f;
8577 uint32 mask = target.EffectMask;
8578 if (!(mask & (1 << spellEffectInfo.EffectIndex)))
8598 Unit* unit =
nullptr;
8622 Unit* unit =
nullptr;
8721 bool reqKey =
false;
8725 switch (lockInfo->
Type[j])
8746 reqSkillValue = lockInfo->
Skill[j];
8753 skillValue = unitCaster->
GetLevel() * 5;
8760 if (skillValue < reqSkillValue)
8834 TC_LOG_DEBUG(
"spells",
"Spell::LoadScripts: Script `{}` for spell `{}` is loaded now", script->GetScriptName(),
m_spellInfo->
Id);
8844 script->OnPrecast();
8845 script->_FinishScriptCall();
8855 beforeCast.
Call(script);
8857 script->_FinishScriptCall();
8867 onCast.
Call(script);
8869 script->_FinishScriptCall();
8879 afterCast.
Call(script);
8881 script->_FinishScriptCall();
8895 retVal = tempResult;
8898 script->_FinishScriptCall();
8908 castTime = script->CalcCastTime(castTime);
8909 script->_FinishScriptCall();
8917 bool preventDefault =
false;
8946 script->_PrepareScriptCall(hookType);
8949 if (!script->_IsEffectPrevented(effIndex) && effectHandler.IsEffectAffected(
m_spellInfo, effIndex))
8950 effectHandler.Call(script, effIndex);
8952 if (!preventDefault)
8953 preventDefault = script->_IsDefaultEffectPrevented(effIndex);
8955 script->_FinishScriptCall();
8957 return preventDefault;
8966 onDispel.
Call(script, effIndex);
8968 script->_FinishScriptCall();
8979 beforeHit.
Call(script, missInfo);
8981 script->_FinishScriptCall();
8993 script->_FinishScriptCall();
9003 afterHit.
Call(script);
9005 script->_FinishScriptCall();
9015 calcCritChance.
Call(script, victim, critChance);
9017 script->_FinishScriptCall();
9027 calcDamage.
Call(script, spellEffectInfo, victim,
damage, flatMod, pctMod);
9029 script->_FinishScriptCall();
9039 calcHealing.
Call(script, spellEffectInfo, victim, healing, flatMod, pctMod);
9041 script->_FinishScriptCall();
9052 objectAreaTargetSelect.
Call(script, targets);
9054 script->_FinishScriptCall();
9065 objectTargetSelect.
Call(script, target);
9067 script->_FinishScriptCall();
9078 destinationTargetSelect.
Call(script, target);
9080 script->_FinishScriptCall();
9090 calculateResistAbsorb.
Call(script, damageInfo, resistAmount, absorbAmount);
9092 script->_FinishScriptCall();
9102 empowerStageCompleted.
Call(script, completedStagesCount);
9104 script->_FinishScriptCall();
9114 empowerStageCompleted.
Call(script, completedStagesCount);
9116 script->_FinishScriptCall();
9124 for (HookType
const& hook : hooks)
9126 if (!hook.IsEffectAffected(spellInfo, effIndex))
9129 bool otherEffectHasSameTargetFunction = std::ranges::any_of(hooks, [&](HookType
const& other)
9131 return other.IsEffectAffected(spellInfo, effIndexToCheck) && hook.HasSameTargetFunctionAs(other);
9133 if (!otherEffectHasSameTargetFunction)
9142 if (!allEffectTargetScriptsAreShared(script->OnObjectTargetSelect,
m_spellInfo, effIndex, effIndexToCheck))
9145 if (!allEffectTargetScriptsAreShared(script->OnObjectTargetSelect,
m_spellInfo, effIndexToCheck, effIndex))
9148 if (!allEffectTargetScriptsAreShared(script->OnObjectAreaTargetSelect,
m_spellInfo, effIndex, effIndexToCheck))
9151 if (!allEffectTargetScriptsAreShared(script->OnObjectAreaTargetSelect,
m_spellInfo, effIndexToCheck, effIndex))
9184 for (
AuraEffect const* aurEff : targetTriggers)
9193 int32 auraBaseAmount = aurEff->GetBaseAmount();
9196 chance *= aurEff->GetBase()->GetStackAmount();
9241 if (gcd >= MinGCD && gcd <= MaxGCD)
9246 int32 intGcd = gcd.count();
9290 std::stringstream sstr;
9291 sstr << std::boolalpha
9313 WorldObject const* src = targetAsSourceLocation ? target : source;
9314 WorldObject const* dst = targetAsSourceLocation ? source : target;
9342 _targetSelectionType(selectionType), _condSrcInfo(nullptr), _condList(condList), _objectType(objectType)
9345 _condSrcInfo = std::make_unique<ConditionSourceInfo>(
nullptr, caster);
9446 :
WorldObjectSpellTargetCheck(caster, caster, spellInfo, selectionType, condList, objectType), _range(range), _position(caster) { }
9451 if (dist <
_range && WorldObjectSpellTargetCheck::operator ()(target))
9462 :
WorldObjectSpellTargetCheck(caster, referer, spellInfo, selectionType, condList, objectType), _range(range), _position(position), _searchReason(searchReason) { }
9476 if (!isInsideCylinder)
9502 :
WorldObjectSpellAreaTargetCheck(range, caster, caster, caster, spellInfo, selectionType, condList, objectType), _coneSrc(coneSrc), _coneAngle(coneAngle), _lineWidth(lineWidth) { }
9528 :
WorldObjectSpellTargetCheck(caster, caster, spellInfo, selectionType, condList, objectType), _range(range), _position(position) { }
9544 :
WorldObjectSpellAreaTargetCheck(range, caster, caster, caster, spellInfo, selectionType, condList, objectType), _position(*srcPosition), _lineWidth(lineWidth)
9546 if (dstPosition && *srcPosition != *dstPosition)
9560 if (targets.size() <= maxTargets)
9582 std::array<std::ptrdiff_t, 1 << END> countsByPriority = {};
9583 std::vector<std::pair<WorldObject*, int32>> tempTargets;
9584 tempTargets.resize(targets.size());
9587 std::ranges::transform(targets, tempTargets.begin(), [&](
WorldObject* target)
9589 int32 negativePoints = 0;
9590 if (prioritizeGroupMembersOf && (!target->IsUnit() || target->ToUnit()->IsInRaidWith(prioritizeGroupMembersOf)))
9591 negativePoints |= 1 << NOT_GROUPED;
9593 if (prioritizePlayers && !target->IsPlayer() && (!target->IsCreature() || !target->ToCreature()->IsTreatedAsRaidUnit()))
9594 negativePoints |= 1 << NOT_PLAYER;
9596 if (!target->IsUnit() || target->ToUnit()->IsFullHealth())
9597 negativePoints |= 1 << NOT_INJURED;
9599 ++countsByPriority[negativePoints];
9600 return std::make_pair(target, negativePoints);
9603 std::ranges::sort(tempTargets, {}, Trinity::TupleElement<1>);
9605 std::size_t foundTargets = 0;
9606 for (std::ptrdiff_t countForPriority : countsByPriority)
9608 if (foundTargets + countForPriority >= maxTargets)
9617 foundTargets += countForPriority;
9620 targets.resize(maxTargets);
9621 std::ranges::transform(tempTargets.begin(), tempTargets.begin() + maxTargets, targets.begin(), Trinity::TupleElement<0>);
9632 Targets->SetUnitTarget(unitTarget);
9637 Targets->SetGOTarget(goTarget);
9655 if (triggeringSpell)
9675 return {
int32(SpellXSpellVisualID),
int32(ScriptVisualID) };
std::vector< Condition > ConditionContainer
@ CONDITION_SOURCE_TYPE_SPELL
DB2Storage< ItemEntry > sItemStore("Item.db2", &ItemLoadInfo::Instance)
DB2Storage< BattlePetBreedQualityEntry > sBattlePetBreedQualityStore("BattlePetBreedQuality.db2", &BattlePetBreedQualityLoadInfo::Instance)
DB2Storage< ArtifactEntry > sArtifactStore("Artifact.db2", &ArtifactLoadInfo::Instance)
DB2Storage< ChrClassesEntry > sChrClassesStore("ChrClasses.db2", &ChrClassesLoadInfo::Instance)
DB2Storage< LockEntry > sLockStore("Lock.db2", &LockLoadInfo::Instance)
DB2Storage< ChrSpecializationEntry > sChrSpecializationStore("ChrSpecialization.db2", &ChrSpecializationLoadInfo::Instance)
DB2Storage< BattlePetSpeciesEntry > sBattlePetSpeciesStore("BattlePetSpecies.db2", &BattlePetSpeciesLoadInfo::Instance)
DB2Storage< SummonPropertiesEntry > sSummonPropertiesStore("SummonProperties.db2", &SummonPropertiesLoadInfo::Instance)
DB2Storage< GlyphPropertiesEntry > sGlyphPropertiesStore("GlyphProperties.db2", &GlyphPropertiesLoadInfo::Instance)
DB2Storage< SpellItemEnchantmentEntry > sSpellItemEnchantmentStore("SpellItemEnchantment.db2", &SpellItemEnchantmentLoadInfo::Instance)
DB2Storage< TalentEntry > sTalentStore("Talent.db2", &TalentLoadInfo::Instance)
#define MAX_VEHICLE_SEATS
#define MAX_SPELL_REAGENTS
#define MAX_ITEM_ENCHANTMENT_EFFECTS
#define MAX_AZERITE_EMPOWERED_TIER
@ DontFailSpellOnTargetingFailure
@ EnforceLineOfSightToChainTargets
@ ITEM_ENCHANTMENT_TYPE_USE_SPELL
@ ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET
#define MAX_ITEM_PROTO_SOCKETS
@ LandTargetedSpellOnTarget
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
#define ASSERT_NOTNULL(pointer)
@ GRID_MAP_TYPE_MASK_PLAYER
@ GRID_MAP_TYPE_MASK_CREATURE
@ GRID_MAP_TYPE_MASK_GAMEOBJECT
@ GRID_MAP_TYPE_MASK_CORPSE
#define VMAP_INVALID_HEIGHT_VALUE
@ PRISMATIC_ENCHANTMENT_SLOT
@ ITEM_SUBCLASS_WEAPON_CROSSBOW
@ ITEM_SUBCLASS_WEAPON_GUN
@ ITEM_SUBCLASS_WEAPON_BOW
@ ITEM_SUBCLASS_WEAPON_WAND
@ ITEM_SUBCLASS_WEAPON_THROWN
@ ITEM_SPELLTRIGGER_ON_USE
@ ITEM_FLAG_NO_REAGENT_COST
@ ITEM_FLAG_IS_PROSPECTABLE
#define TC_LOG_DEBUG(filterType__, message__,...)
#define TC_LOG_ERROR(filterType__, message__,...)
LootStore LootTemplates_Milling("milling_loot_template", "item entry (herb)", true)
LootStore LootTemplates_Prospecting("prospecting_loot_template", "item entry (ore)", true)
constexpr bool CanStopMovementForSpellCasting(MovementGeneratorType type)
#define EXTRA_CELL_SEARCH_RADIUS
#define DEFAULT_PLAYER_BOUNDING_RADIUS
std::optional< T > Optional
Optional helper class to wrap optional values within.
constexpr uint32 PET_SUMMONING_DISORIENTATION
std::vector< ItemPosCount > ItemPosCountVec
float frand(float min, float max)
bool roll_chance_f(float chance)
bool roll_chance_i(int chance)
if(posix_memalign(&__mallocedMemory, __align, __size)) return NULL
@ SPELL_ATTR10_USES_RANGED_SLOT_COSMETIC_ONLY
@ SPELL_ATTR9_NOT_IN_ARENA
@ SPELL_ATTR9_IGNORE_DEFAULT_RATED_BATTLEGROUND_RESTRICTIONS
@ SPELL_ATTR9_ITEM_CAST_GRANTS_SKILL_GAIN
@ SPELL_ATTR9_MISSILE_SPEED_IS_DELAY_IN_SEC
@ SPELL_ATTR9_FORCE_DEST_LOCATION
@ SPELL_ATTR9_IGNORE_TOTEM_REQUIREMENTS_FOR_CASTING
@ SPELL_ATTR9_FORCE_CORPSE_TARGET
@ SPELL_ATTR9_ONLY_WHEN_ILLEGALLY_MOUNTED
@ SPELL_ATTR7_ALWAYS_CAST_LOG
@ SPELL_ATTR7_CAN_CAUSE_INTERRUPT
@ SPELL_ATTR7_RESET_SWING_TIMER_AT_SPELL_START
@ SPELL_ATTR7_ALLOW_SPELL_REFLECTION
@ SPELL_ATTR7_TREAT_AS_NPC_AOE
@ SPELL_ATTR7_REPORT_SPELL_FAILURE_TO_UNIT_TARGET
@ SPELL_ATTR7_DEBUG_SPELL
#define CLASSMASK_WAND_USERS
@ SPELL_PREVENTION_TYPE_SILENCE
@ SPELL_PREVENTION_TYPE_NO_ACTIONS
@ SPELL_PREVENTION_TYPE_PACIFY
@ GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING
@ SPELL_ATTR5_TREAT_AS_AREA_EFFECT
@ SPELL_ATTR5_ALLOW_WHILE_STUNNED
@ SPELL_ATTR5_ALLOW_WHILE_FLEEING
@ SPELL_ATTR5_ALWAYS_LINE_OF_SIGHT
@ SPELL_ATTR5_MELEE_CHAIN_TARGETING
@ SPELL_ATTR5_ALWAYS_AOE_LINE_OF_SIGHT
@ SPELL_ATTR5_NOT_ON_PLAYER
@ SPELL_ATTR5_NOT_AVAILABLE_WHILE_CHARMED
@ SPELL_ATTR5_ALLOW_WHILE_CONFUSED
@ TARGET_UNIT_PASSENGER_1
@ TARGET_UNIT_TARGET_CHAINHEAL_ALLY
@ TARGET_DEST_CASTER_RANDOM
@ TARGET_DEST_CASTER_GROUND_2
@ TARGET_UNIT_CONE_180_DEG_ENEMY
@ TARGET_DEST_DYNOBJ_ENEMY
@ TARGET_DEST_DEST_TARGET_TOWARDS_CASTER
@ TARGET_UNIT_PASSENGER_6
@ TARGET_DEST_DEST_GROUND
@ TARGET_DEST_CASTER_FRONT_LEAP
@ TARGET_UNIT_CASTER_AND_PASSENGERS
@ TARGET_DEST_CHANNEL_TARGET
@ TARGET_DEST_CASTER_FRONT_LEFT
@ TARGET_DEST_CASTER_BACK_RIGHT
@ TARGET_DEST_CASTER_GROUND
@ TARGET_UNIT_SRC_AREA_FURTHEST_ENEMY
@ TARGET_UNIT_CASTER_AND_SUMMONS
@ TARGET_DEST_NEARBY_ENTRY_OR_DB
@ TARGET_UNIT_AREA_THREAT_LIST
@ TARGET_UNIT_PASSENGER_2
@ TARGET_UNIT_CHANNEL_TARGET
@ TARGET_DEST_CASTER_FISHING
@ TARGET_UNIT_TARGET_TAP_LIST
@ TARGET_UNIT_PASSENGER_4
@ TARGET_UNIT_PASSENGER_7
@ TARGET_DEST_TARGET_ENEMY
@ TARGET_DEST_DYNOBJ_NONE
@ TARGET_DEST_DYNOBJ_ALLY
@ TARGET_UNIT_TARGET_ALLY_OR_RAID
@ TARGET_DEST_CASTER_MOVEMENT_DIRECTION
@ TARGET_UNIT_AREA_TAP_LIST
@ TARGET_UNIT_PASSENGER_5
@ TARGET_UNIT_PASSENGER_3
@ TARGET_DEST_CASTER_BACK_LEFT
@ TARGET_DEST_CASTER_SUMMON
@ TARGET_GAMEOBJECT_TARGET
@ TARGET_DEST_TARGET_ALLY
@ TARGET_GAMEOBJECT_ITEM_TARGET
@ TARGET_DEST_CASTER_FRONT_RIGHT
@ TARGET_UNIT_OWN_CRITTER
@ TARGET_UNIT_PASSENGER_0
@ CORPSE_DYNFLAG_LOOTABLE
@ SPELL_ATTR2_AUTO_REPEAT
@ SPELL_ATTR2_CHAIN_FROM_CASTER
@ SPELL_ATTR2_ENCHANT_OWN_ITEM_ONLY
@ SPELL_ATTR2_DO_NOT_REPORT_SPELL_FAILURE
@ SPELL_ATTR2_NOT_AN_ACTION
@ SPELL_ATTR2_ALLOW_LOW_LEVEL_BUFF
@ SPELL_ATTR2_INITIATE_COMBAT_POST_CAST_ENABLES_AUTO_ATTACK
@ SPELL_ATTR2_NO_ACTIVE_PETS
@ SPELL_ATTR2_IGNORE_LINE_OF_SIGHT
@ SPELL_ATTR2_FAIL_ON_ALL_TARGETS_IMMUNE
@ SPELL_ATTR2_DO_NOT_RESET_COMBAT_TIMERS
@ SPELL_ATTR1_REQUIRE_ALL_TARGETS
@ SPELL_ATTR1_IS_SELF_CHANNELLED
@ SPELL_ATTR1_TRACK_TARGET_IN_CHANNEL
@ SPELL_ATTR1_FAILURE_BREAKS_STEALTH
@ SPELL_ATTR1_IS_CHANNELLED
@ SPELL_ATTR1_NO_REFLECTION
@ SPELL_ATTR1_INITIATES_COMBAT_ENABLES_AUTO_ATTACK
@ SPELL_ATTR1_DISMISS_PET_FIRST
@ SPELL_ATTR1_DISCOUNT_POWER_ON_MISS
@ SPELL_ATTR3_TREAT_AS_PERIODIC
@ SPELL_ATTR3_ONLY_BATTLEGROUNDS
@ SPELL_ATTR3_ONLY_ON_GHOSTS
@ SPELL_ATTR3_NO_RES_TIMER
@ SPELL_ATTR3_DO_NOT_TRIGGER_TARGET_STAND
@ SPELL_ATTR3_PVP_ENABLING
@ SPELL_ATTR3_REQUIRES_MAIN_HAND_WEAPON
@ SPELL_ATTR3_REQUIRES_OFF_HAND_WEAPON
@ SPELL_ATTR3_COMPLETELY_BLOCKED
@ SPELL_ATTR3_ONLY_ON_PLAYER
@ SPELL_DAMAGE_CLASS_RANGED
@ SPELL_DAMAGE_CLASS_MAGIC
@ SPELL_DAMAGE_CLASS_NONE
@ SPELL_DAMAGE_CLASS_MELEE
@ SPELL_EFFECT_CREATE_HEIRLOOM_ITEM
@ SPELL_EFFECT_SUMMON_PET
@ SPELL_EFFECT_DISENCHANT
@ SPELL_EFFECT_PROSPECTING
@ SPELL_EFFECT_ENCHANT_HELD_ITEM
@ SPELL_EFFECT_GIVE_ARTIFACT_POWER_NO_BONUS
@ SPELL_EFFECT_ENCHANT_ITEM
@ SPELL_EFFECT_CREATE_LOOT
@ SPELL_EFFECT_GAMEOBJECT_REPAIR
@ SPELL_EFFECT_SUMMON_RAF_FRIEND
@ SPELL_EFFECT_WEAPON_DAMAGE
@ SPELL_EFFECT_APPLY_GLYPH
@ SPELL_EFFECT_NORMALIZED_WEAPON_DMG
@ SPELL_EFFECT_SUMMON_PLAYER
@ SPELL_EFFECT_RESPEC_AZERITE_EMPOWERED_ITEM
@ SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER
@ SPELL_EFFECT_RESURRECT_PET
@ SPELL_EFFECT_SKIN_PLAYER_CORPSE
@ SPELL_EFFECT_RECHARGE_ITEM
@ SPELL_EFFECT_ADD_EXTRA_ATTACKS
@ SPELL_EFFECT_CHANGE_ACTIVE_COMBAT_TRAIT_CONFIG
@ SPELL_EFFECT_CHANGE_BATTLEPET_QUALITY
@ SPELL_EFFECT_WEAPON_PERCENT_DAMAGE
@ SPELL_EFFECT_GRANT_BATTLEPET_LEVEL
@ SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL
@ SPELL_EFFECT_PERSISTENT_AREA_AURA
@ SPELL_EFFECT_TELEPORT_WITH_SPELL_VISUAL_KIT_LOADING_SCREEN
@ SPELL_EFFECT_UNLOCK_GUILD_VAULT_TAB
@ SPELL_EFFECT_DISMISS_PET
@ SPELL_EFFECT_TALENT_SPEC_SELECT
@ SPELL_EFFECT_GRANT_BATTLEPET_EXPERIENCE
@ SPELL_EFFECT_GAMEOBJECT_SET_DESTRUCTION_STATE
@ SPELL_EFFECT_GAMEOBJECT_DAMAGE
@ SPELL_EFFECT_LEARN_SPELL
@ SPELL_EFFECT_GIVE_ARTIFACT_POWER
@ SPELL_EFFECT_REMOVE_TALENT
@ SPELL_EFFECT_TELEPORT_UNITS
@ SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC
@ SPELL_EFFECT_CREATE_TAMED_PET
@ SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY
@ SPELL_EFFECT_STEAL_BENEFICIAL_BUFF
@ SPELL_EFFECT_CREATE_ITEM
@ SPELL_EFFECT_APPLY_AURA
@ SPELL_EFFECT_LEARN_PET_SPELL
@ SPELL_CUSTOM_ERROR_NONE
@ SPELL_CUSTOM_ERROR_GM_ONLY
@ SPELL_ATTR0_ONLY_INDOORS
@ SPELL_ATTR0_ONLY_OUTDOORS
@ SPELL_ATTR0_ALLOW_WHILE_MOUNTED
@ SPELL_ATTR0_COOLDOWN_ON_EVENT
@ SPELL_ATTR0_NO_IMMUNITIES
@ SPELL_ATTR0_CANCELS_AUTO_ATTACK_COMBAT
@ SPELL_ATTR0_USES_RANGED_SLOT
@ SPELL_ATTR0_ALLOW_CAST_WHILE_DEAD
@ SPELL_ATTR0_ONLY_STEALTHED
@ SPELL_ATTR12_START_COOLDOWN_ON_CAST_START
@ SPELL_ATTR12_IGNORE_CASTING_DISABLED
@ SPELL_FAILED_TARGET_NOT_LOOTED
@ SPELL_FAILED_UNIT_NOT_INFRONT
@ SPELL_FAILED_NEED_EXOTIC_AMMO
@ SPELL_FAILED_NOT_INFRONT
@ SPELL_FAILED_FISHING_TOO_LOW
@ SPELL_FAILED_CANT_BE_MILLED
@ SPELL_FAILED_NOT_MOUNTED
@ SPELL_FAILED_EQUIPPED_ITEM_CLASS_OFFHAND
@ SPELL_FAILED_AFFECTING_COMBAT
@ SPELL_FAILED_CASTER_AURASTATE
@ SPELL_FAILED_EQUIPPED_ITEM_CLASS
@ SPELL_FAILED_WRONG_ARTIFACT_EQUIPPED
@ SPELL_FAILED_ITEM_AT_MAX_CHARGES
@ SPELL_FAILED_TARGET_NOT_PLAYER
@ SPELL_FAILED_CANT_UNTALENT
@ SPELL_FAILED_NOT_IN_RATED_BATTLEGROUND
@ SPELL_FAILED_FOOD_LOWLEVEL
@ SPELL_FAILED_GLYPH_INVALID_SPEC
@ SPELL_FAILED_ALREADY_HAVE_PET
@ SPELL_FAILED_WRONG_PET_FOOD
@ SPELL_FAILED_CUSTOM_ERROR
@ SPELL_FAILED_SUMMON_PENDING
@ SPELL_FAILED_BAD_IMPLICIT_TARGETS
@ SPELL_FAILED_CANT_UPGRADE_BATTLE_PET
@ SPELL_FAILED_ALREADY_HAVE_SUMMON
@ SPELL_FAILED_ALREADY_AT_FULL_POWER
@ SPELL_FAILED_NOT_TRADEABLE
@ SPELL_FAILED_ITEM_NOT_READY
@ SPELL_FAILED_TOO_SHALLOW
@ SPELL_FAILED_NOT_TRADING
@ SPELL_FAILED_NO_CHARGES_REMAIN
@ SPELL_FAILED_ITEM_NOT_FOUND
@ SPELL_FAILED_OUT_OF_RANGE
@ SPELL_FAILED_NOT_IN_BATTLEGROUND
@ SPELL_FAILED_EQUIPPED_ITEM
@ SPELL_FAILED_NOT_BEHIND
@ SPELL_FAILED_ALREADY_AT_FULL_HEALTH
@ SPELL_FAILED_PREVENTED_BY_MECHANIC
@ SPELL_FAILED_ALREADY_HAVE_CHARM
@ SPELL_FAILED_AZERITE_EMPOWERED_NO_CHOICES_TO_UNDO
@ SPELL_FAILED_DONT_REPORT
@ SPELL_FAILED_CANT_BE_SALVAGED_SKILL
@ SPELL_FAILED_AZERITE_EMPOWERED_ONLY
@ SPELL_FAILED_ON_USE_ENCHANT
@ SPELL_FAILED_WRONG_BATTLE_PET_TYPE
@ SPELL_FAILED_ONLY_BATTLEGROUNDS
@ SPELL_FAILED_NOT_IN_ARENA
@ SPELL_FAILED_ITEM_ALREADY_ENCHANTED
@ SPELL_FAILED_ONLY_STEALTHED
@ SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW
@ SPELL_FAILED_TARGET_IS_PLAYER_CONTROLLED
@ SPELL_FAILED_NO_ARTIFACT_EQUIPPED
@ SPELL_FAILED_ONLY_ABOVEWATER
@ SPELL_FAILED_TARGETS_DEAD
@ SPELL_FAILED_AURA_BOUNCED
@ SPELL_FAILED_GLYPH_NO_SPEC
@ SPELL_FAILED_CANT_BE_CHARMED
@ SPELL_FAILED_MAX_SOCKETS
@ SPELL_FAILED_CASTER_DEAD
@ SPELL_FAILED_BAD_TARGETS
@ SPELL_FAILED_ITEM_ENCHANT_TRADE_WINDOW
@ SPELL_FAILED_GLYPH_EXCLUSIVE_CATEGORY
@ SPELL_FAILED_TOO_MANY_OF_ITEM
@ SPELL_FAILED_CANT_BE_SALVAGED
@ SPELL_FAILED_TARGET_UNSKINNABLE
@ SPELL_FAILED_NO_ACTIONS
@ SPELL_FAILED_UNIQUE_GLYPH
@ SPELL_FAILED_NEED_MORE_ITEMS
@ SPELL_FAILED_ONLY_OUTDOORS
@ SPELL_FAILED_NO_VALID_TARGETS
@ SPELL_FAILED_INVALID_GLYPH
@ SPELL_FAILED_LOW_CASTLEVEL
@ SPELL_FAILED_CANT_BE_PROSPECTED
@ SPELL_FAILED_ONLY_MOUNTED
@ SPELL_FAILED_LINE_OF_SIGHT
@ SPELL_FAILED_VISION_OBSCURED
@ SPELL_FAILED_EQUIPPED_ITEM_CLASS_MAINHAND
@ SPELL_FAILED_SPELL_IN_PROGRESS
@ SPELL_FAILED_TARGET_LOCKED_TO_RAID_INSTANCE
@ SPELL_FAILED_REQUIRES_SPELL_FOCUS
@ SPELL_FAILED_TOTEM_CATEGORY
@ SPELL_FAILED_SPELL_UNAVAILABLE
@ SPELL_FAILED_REQUIRES_AREA
@ SPELL_FAILED_INTERRUPTED
@ SPELL_FAILED_ONLY_INDOORS
@ SPELL_FAILED_NOT_ON_TAXI
@ SPELL_FAILED_TARGET_FRIENDLY
@ SPELL_ATTR13_PERIODIC_REFRESH_EXTENDS_DURATION
constexpr SkillType SkillByLockType(LockType locktype)
@ SPELL_ATTR4_BOUNCY_CHAIN_MISSILES
@ SPELL_ATTR4_IGNORE_DEFAULT_ARENA_RESTRICTIONS
@ SPELL_ATTR4_SUPPRESS_WEAPON_PROCS
@ SPELL_ATTR4_CLASS_TRIGGER_ONLY_ON_TARGET
@ SPELL_ATTR4_NOT_IN_ARENA_OR_RATED_BATTLEGROUND
@ SPELL_ATTR4_USE_FACING_FROM_SPELL
@ SPELL_ATTR4_AURA_NEVER_BOUNCES
@ SPELL_ATTR4_AURA_BOUNCE_FAILS_SPELL
@ SPELL_ATTR4_ALLOW_CAST_WHILE_CASTING
@ CREATURE_TYPE_FLAG_COLLIDE_WITH_MISSILES
@ SPELL_ATTR8_ONLY_PLAYERS_CAN_CAST_THIS_SPELL
@ SPELL_ATTR8_IGNORE_SANCTUARY
@ SPELL_ATTR8_HEAL_PREDICTION
@ SPELL_ATTR8_CAN_HIT_AOE_UNTARGETABLE
@ SPELL_ATTR8_HASTE_AFFECTS_DURATION
@ SPELL_ATTR8_AURA_POINTS_ON_CLIENT
@ SPELL_ATTR8_REQUIRES_LOCATION_TO_BE_ON_LIQUID_SURFACE
@ SPELL_ATTR6_ORIGINATE_FROM_CONTROLLER
@ SPELL_ATTR6_DOESNT_RESET_SWING_TIMER_IF_INSTANT
@ SPELL_ATTR6_DO_NOT_CONSUME_RESOURCES
@ SPELL_ATTR6_TAPS_IMMEDIATELY
@ SPELL_AURA_DISABLE_CASTING_EXCEPT_ABILITIES
@ SPELL_AURA_DISABLE_ATTACKING_EXCEPT_ABILITIES
@ SPELL_AURA_OBS_MOD_HEALTH
@ SPELL_AURA_MOD_IGNORE_SHAPESHIFT
@ SPELL_AURA_PERIODIC_MANA_LEECH
@ SPELL_AURA_MOD_POSSESS_PET
@ SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS
@ SPELL_AURA_MOD_NO_ACTIONS
@ SPELL_AURA_PERIODIC_HEAL
@ SPELL_AURA_MOD_STUN_DISABLE_GRAVITY
@ SPELL_AURA_ADD_TARGET_TRIGGER
@ SPELL_AURA_MOD_GLOBAL_COOLDOWN_BY_HASTE_REGEN
@ SPELL_AURA_MOD_PACIFY_SILENCE
@ SPELL_AURA_PROVIDE_SPELL_FOCUS
@ SPELL_AURA_REDUCE_PUSHBACK
@ SPELL_AURA_INTERFERE_TARGETTING
@ SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ SPELLVALUE_BASE_POINT_END
@ SPELLVALUE_PARENT_SPELL_TARGET_COUNT
@ SPELLVALUE_PARENT_SPELL_TARGET_INDEX
@ TARGET_FLAG_CORPSE_ALLY
@ TARGET_FLAG_UNIT_MINIPET
@ TARGET_FLAG_GAMEOBJECT_ITEM
@ TARGET_FLAG_DEST_LOCATION
@ TARGET_FLAG_SOURCE_LOCATION
@ TARGET_FLAG_CORPSE_ENEMY
@ TARGET_FLAG_CORPSE_MASK
@ TARGET_FLAG_GAMEOBJECT_MASK
@ TRIGGERED_IGNORE_EQUIPPED_ITEM_REQUIREMENT
Will ignore equipped item requirements.
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
@ TRIGGERED_DONT_RESET_PERIODIC_TIMER
Will allow periodic aura timers to keep ticking (instead of resetting)
@ TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD
Will ignore Spell and Category cooldowns.
@ TRIGGERED_CAST_DIRECTLY
In Spell::prepare, will be cast directly without setting containers for executed spell.
@ TRIGGERED_IGNORE_TARGET_CHECK
Will ignore most target checks (mostly DBC target checks)
@ TRIGGERED_IGNORE_CASTER_AURASTATE
Will ignore caster aura states including combat requirements and death state.
@ TRIGGERED_IGNORE_CAST_IN_PROGRESS
Will not check if a current cast is in progress.
@ TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE
Will ignore mounted/on vehicle restrictions.
@ TRIGGERED_IGNORE_SHAPESHIFT
Will ignore shapeshift checks.
@ TRIGGERED_IGNORE_POWER_COST
Will ignore power and reagent cost.
@ TRIGGERED_IGNORE_CAST_ITEM
Will not take away cast item or update related achievement criteria.
@ TRIGGERED_IGNORE_REAGENT_COST
Will ignore reagent cost.
@ TRIGGERED_IGNORE_GCD
Will ignore GCD.
@ TRIGGERED_DISALLOW_PROC_EVENTS
Disallows proc events from triggered spell (default)
@ TRIGGERED_IGNORE_CASTER_AURAS
Will ignore caster aura restrictions or requirements.
@ TRIGGERED_DONT_REPORT_CAST_ERROR
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
@ TRIGGERED_IGNORE_CAST_TIME
Will always be instantly cast.
@ TRIGGERED_IS_TRIGGERED_MASK
Will be recognized by Spell::IsTriggered as triggered.
@ TRIGGERED_IGNORE_SET_FACING
Will not adjust facing to target (if any)
@ SPELLVALUE_DURATION_PCT
@ SPELL_FACING_FLAG_INFRONT
uint32 GetTargetFlagMask(SpellTargetObjectTypes objType)
@ TARGET_CHECK_RAID_CLASS
@ EFFECT_IMPLICIT_TARGET_CASTER
@ EFFECT_IMPLICIT_TARGET_EXPLICIT
@ TARGET_SELECT_CATEGORY_CONE
@ TARGET_SELECT_CATEGORY_AREA
@ TARGET_SELECT_CATEGORY_DEFAULT
@ TARGET_SELECT_CATEGORY_NEARBY
@ TARGET_SELECT_CATEGORY_NYI
@ TARGET_SELECT_CATEGORY_LINE
@ TARGET_SELECT_CATEGORY_TRAJ
@ TARGET_SELECT_CATEGORY_CHANNEL
@ TARGET_OBJECT_TYPE_UNIT
@ TARGET_OBJECT_TYPE_CORPSE
@ TARGET_OBJECT_TYPE_UNIT_AND_DEST
@ TARGET_OBJECT_TYPE_NONE
@ TARGET_OBJECT_TYPE_DEST
@ TARGET_OBJECT_TYPE_GOBJ
@ TARGET_OBJECT_TYPE_CORPSE_ALLY
@ TARGET_OBJECT_TYPE_CORPSE_ENEMY
@ TARGET_OBJECT_TYPE_GOBJ_ITEM
@ SPELL_ATTR0_CU_REQ_TARGET_FACING_CASTER
@ SPELL_ATTR0_CU_REQ_CASTER_BEHIND_TARGET
@ SPELL_ATTR0_CU_CONE_BACK
@ SPELL_ATTR0_CU_NEEDS_AMMO_DATA
@ SPELL_ATTR0_CU_CONE_LINE
@ SPELL_ATTR0_CU_NO_INITIAL_THREAT
@ TARGET_REFERENCE_TYPE_SRC
@ TARGET_REFERENCE_TYPE_TARGET
@ TARGET_REFERENCE_TYPE_LAST
@ TARGET_REFERENCE_TYPE_CASTER
@ TARGET_REFERENCE_TYPE_DEST
@ PROC_SPELL_PHASE_FINISH
@ SPELL_GROUP_STACK_RULE_EXCLUSIVE_FROM_SAME_CASTER
@ SPELL_GROUP_STACK_RULE_EXCLUSIVE
@ SPELL_GROUP_STACK_RULE_DEFAULT
@ SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT
@ SPELL_GROUP_STACK_RULE_EXCLUSIVE_HIGHEST
@ PROC_SPELL_TYPE_MASK_ALL
@ PROC_SPELL_TYPE_NO_DMG_HEAL
@ PROC_FLAG_DEAL_MELEE_ABILITY
@ PROC_FLAG_TAKE_HARMFUL_PERIODIC
@ PROC_FLAG_MAIN_HAND_WEAPON_SWING
@ PROC_FLAG_TAKE_ANY_DAMAGE
@ PROC_FLAG_TAKE_HELPFUL_ABILITY
@ PROC_FLAG_DEAL_RANGED_ABILITY
@ PROC_FLAG_TAKE_HELPFUL_SPELL
@ PROC_FLAG_DEAL_HELPFUL_ABILITY
@ PROC_FLAG_DEAL_RANGED_ATTACK
@ PROC_FLAG_TAKE_HARMFUL_SPELL
@ PROC_FLAG_TAKE_MELEE_ABILITY
@ PROC_FLAG_DEAL_HARMFUL_ABILITY
@ PROC_FLAG_DEAL_HARMFUL_PERIODIC
@ PROC_FLAG_OFF_HAND_WEAPON_SWING
@ PROC_FLAG_DEAL_HELPFUL_SPELL
@ PROC_FLAG_DEAL_HELPFUL_PERIODIC
@ PROC_FLAG_DEAL_HARMFUL_SPELL
@ PROC_FLAG_TAKE_RANGED_ABILITY
@ PROC_FLAG_TAKE_HELPFUL_PERIODIC
@ PROC_FLAG_TAKE_RANGED_ATTACK
@ PROC_FLAG_TAKE_HARMFUL_ABILITY
@ PROC_FLAG_2_CAST_SUCCESSFUL
@ SPELL_SCRIPT_HOOK_AFTER_CAST
@ SPELL_SCRIPT_HOOK_EFFECT_HIT
@ SPELL_SCRIPT_HOOK_AFTER_HIT
@ SPELL_SCRIPT_HOOK_EFFECT_SUCCESSFUL_DISPEL
@ SPELL_SCRIPT_HOOK_CALC_HEALING
@ SPELL_SCRIPT_HOOK_EFFECT_LAUNCH
@ SPELL_SCRIPT_HOOK_OBJECT_AREA_TARGET_SELECT
@ SPELL_SCRIPT_HOOK_BEFORE_HIT
@ SPELL_SCRIPT_HOOK_CALC_DAMAGE
@ SPELL_SCRIPT_HOOK_CHECK_CAST
@ SPELL_SCRIPT_HOOK_EFFECT_LAUNCH_TARGET
@ SPELL_SCRIPT_HOOK_CALC_CAST_TIME
@ SPELL_SCRIPT_HOOK_EMPOWER_STAGE_COMPLETED
@ SPELL_SCRIPT_HOOK_EMPOWER_COMPLETED
@ SPELL_SCRIPT_HOOK_BEFORE_CAST
@ SPELL_SCRIPT_HOOK_ON_RESIST_ABSORB_CALCULATION
@ SPELL_SCRIPT_HOOK_DESTINATION_TARGET_SELECT
@ SPELL_SCRIPT_HOOK_OBJECT_TARGET_SELECT
@ SPELL_SCRIPT_HOOK_EFFECT_HIT_TARGET
@ SPELL_SCRIPT_HOOK_CALC_CRIT_CHANCE
@ SPELL_SCRIPT_HOOK_ON_CAST
@ SPELL_SCRIPT_HOOK_ON_PRECAST
bool CanHaveGlobalCooldown(WorldObject const *caster)
void FillSpellCastFailedArgs(T &packet, ObjectGuid castId, SpellInfo const *spellInfo, SpellCastResult result, SpellCustomErrors customError, int32 *param1, int32 *param2, Player *caster)
static std::pair< int32, SpellHealPredictionType > CalcPredictedHealing(SpellInfo const *spellInfo, Unit const *unitCaster, Unit *target, uint32 castItemEntry, int32 castItemLevel, Spell *spell, bool withPeriodic)
NonDefaultConstructible< SpellEffectHandlerFn > SpellEffectHandlers[TOTAL_SPELL_EFFECTS]
#define SPELL_EMPOWER_HARDCODED_GCD
@ SPELL_CAST_SOURCE_NORMAL
#define MAX_SPELL_RANGE_TOLERANCE
@ CAST_FLAG_EX_IGNORE_COOLDOWN
@ SPELL_EFFECT_HANDLE_LAUNCH_TARGET
@ SPELL_EFFECT_HANDLE_LAUNCH
@ SPELL_EFFECT_HANDLE_HIT
@ SPELL_EFFECT_HANDLE_HIT_TARGET
#define AOE_DAMAGE_TARGET_CAP
static const uint32 SPELL_INTERRUPT_NONPLAYER
@ CAST_FLAG_ADJUST_MISSILE
@ CAST_FLAG_HEAL_PREDICTION
@ CAST_FLAG_POWER_LEFT_SELF
@ CAST_FLAG_HAS_TRAJECTORY
#define TRAJECTORY_MISSILE_SIZE
#define SPELL_EMPOWER_HOLD_TIME_AT_MAX
@ SPELL_HEAL_PREDICTION_TARGET_AND_BEACON
@ SPELL_HEAL_PREDICTION_TARGET
@ SPELL_HEAL_PREDICTION_TARGET_PARTY
@ SPELL_HEAL_PREDICTION_TARGET_AND_CASTER
@ UNIT_FLAG2_ALLOW_CHEAT_SPELLS
@ MOVEMENTFLAG_STRAFE_LEFT
@ MOVEMENTFLAG_STRAFE_RIGHT
@ UNIT_FLAG_NON_ATTACKABLE
@ UNIT_FLAG_PLAYER_CONTROLLED
ProcFlagsHit createProcHitMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missCondition)
@ CURRENT_CHANNELED_SPELL
@ CURRENT_AUTOREPEAT_SPELL
@ UNIT_STATE_ATTACK_PLAYER
#define ARTIFACTS_ALL_WEAPONS_GENERAL_WEAPON_EQUIPPED_PASSIVE
float DegToRad(float degrees)
T RoundToInterval(T &num, T floor, T ceil)
constexpr std::underlying_type< E >::type AsUnderlyingType(E enumValue)
T CalculatePct(T base, U pct)
SpellInfo const * GetSpellInfo() const
int32 GetMaxDuration() const
static Aura * TryRefreshStackOrCreate(AuraCreateInfo &createInfo, bool updateEffectMask=true)
int32 GetCastItemLevel() const
Trinity::IteratorPair< DBStorageIterator< AuraEffect * > > GetAuraEffects()
int32 GetDuration() const
int32 CalcMaxDuration() const
void SetDuration(int32 duration, bool withMods=false)
ObjectGuid GetCastItemGUID() const
uint32 GetEffectMask() const
void SetMaxDuration(int32 duration)
static uint32 BuildEffectMaskForOwner(SpellInfo const *spellProto, uint32 availableEffectMask, WorldObject *owner)
int64 GetRespecCost() const
uint32 GetSelectedAzeritePower(int32 tier) const
virtual void Abort(uint64)
virtual bool IsDeletable() const
virtual bool Execute(uint64, uint32)
BattlePet * GetPet(ObjectGuid guid)
bool HasJournalLock() const
bool CanFlyIn()
Return if we can use mount in battlefield.
bool HasHeirloom(uint32 itemId) const
void InheritCombatStatesFrom(Unit const *who)
ObjectGuid GetOwnerGUID() const override
virtual void SpellHitTarget(WorldObject *, SpellInfo const *)
bool CanIgnoreLineOfSightWhenCastingOnMe() const
Loot * GetLootForPlayer(Player const *player) const override
void SetSpellFocus(Spell const *focusSpell, WorldObject const *target)
constexpr bool HasFlag(T flag) const
void AddEvent(BasicEvent *event, Milliseconds e_time, bool set_addtime=true)
void ModifyEventTime(BasicEvent *event, Milliseconds newTime)
Milliseconds CalculateTime(Milliseconds t_offset) const
virtual void SpellHit(WorldObject *, SpellInfo const *)
virtual void SpellHitTarget(WorldObject *, SpellInfo const *)
GameObjectTemplate const * GetGOInfo() const
GameObjectAI * AI() const
GameobjectTypes GetGoType() const
void SetState(ItemUpdateState state, Player *forplayer=nullptr)
std::span< ItemEffectEntry const *const > GetEffects() const
uint32 GetSocketColor(uint32 index) const
uint32 GetEnchantmentId(EnchantmentSlot slot) const
ItemTemplate const * GetTemplate() const
Optional< uint16 > GetDisenchantSkillRequired() const
void SetSpellCharges(ItemEffectEntry const *effect, int32 value)
Player * GetOwner() const
ObjectGuid GetOwnerGUID() const
uint32 GetDisplayId(Player const *owner) const
uint32 GetItemLevel(Player const *owner) const
AzeriteEmpoweredItem * ToAzeriteEmpoweredItem()
int32 GetRequiredLevel() const
bool IsFitToSpellRequirements(SpellInfo const *spellInfo) const
int32 GetSpellCharges(ItemEffectEntry const *effect=nullptr) const
bool HaveLootFor(uint32 loot_id) const
void AddFarSpellCallback(FarSpellCallback &&callback)
ZLiquidStatus GetLiquidStatus(PhaseShift const &phaseShift, float x, float y, float z, Optional< map_liquidHeaderTypeFlags > ReqLiquidType={}, LiquidData *data=nullptr, float collisionHeight=2.03128f)
bool IsBattleground() const
ObjectGuid::LowType GenerateLowGuid()
GameObject * GetGameObject(ObjectGuid const &guid)
Difficulty GetDifficultyID() const
InstanceMap * ToInstanceMap()
MovementGeneratorType GetCurrentMovementGeneratorType() const
static ObjectGuid const Empty
static std::string_view GetTypeName(HighGuid high)
bool IsAnyTypeGameObject() const
std::string ToString() const
bool IsGameObject() const
static ObjectGuid const TradeItem
static Creature * ToCreature(Object *o)
static Unit * ToUnit(Object *o)
static GameObject * ToGameObject(Object *o)
bool HasDynamicFlag(uint32 flag) const
static Corpse * ToCorpse(Object *o)
static ObjectGuid GetGUID(Object const *o)
static Player * ToPlayer(Object *o)
std::array< Optional< PetInfo >, MAX_ACTIVE_PETS > ActivePets
Player * GetOwner() const
static std::pair< PetStable::PetInfo const *, PetSaveMode > GetLoadPetInfo(PetStable const &stable, uint32 petEntry, uint32 petnumber, Optional< PetSaveMode > slot)
PetType getPetType() const
bool HaveInDiet(ItemTemplate const *item) const
static PhaseShift const & GetAlwaysVisiblePhaseShift()
ChrSpecialization GetPrimarySpecialization() const
void SendEquipError(InventoryResult msg, Item const *item1=nullptr, Item const *item2=nullptr, uint32 itemId=0) const
void SetSpellModTakingSpell(Spell *spell, bool apply)
bool Satisfy(AccessRequirement const *ar, uint32 target_map, TransferAbortParams *params=nullptr, bool report=false)
bool IsInSameRaidWith(Player const *p) const
bool HasItemFitToSpellRequirements(SpellInfo const *spellInfo, Item const *ignoreItem=nullptr) const
ObjectGuid GetSummonedBattlePetGUID() const
bool IsImmunedToSpellEffect(SpellInfo const *spellInfo, SpellEffectInfo const &spellEffectInfo, WorldObject const *caster, bool requireImmunityPurgesEffectAttribute=false) const override
void SetRuneCooldown(uint8 index, uint32 cooldown)
void SendDirectMessage(WorldPacket const *data) const
uint16 GetSkillValue(uint32 skill) const
void UpdatePotionCooldown(Spell *spell=nullptr)
bool CanTameExoticPets() const
uint32 GetRuneBaseCooldown() const
bool HasItemCount(uint32 item, uint32 count=1, bool inBankAlso=false) const
bool HasCurrency(uint32 id, uint32 amount) const
bool CanUseBattlegroundObject(GameObject *gameobject) const
bool InBattleground() const
Item * GetItemByEntry(uint32 entry, ItemSearchLocation where=ItemSearchLocation::Default) const
std::vector< uint32 > const & GetGlyphs(uint8 spec) const
PetStable * GetPetStable()
bool IsLoading() const override
bool HasItemTotemCategory(uint32 TotemCategory) const
uint8 GetRunesState() const
bool GetCommandStatus(uint32 command) const
bool HasSummonPending() const
WorldSession * GetSession() const
void CastItemCombatSpell(DamageInfo const &damageInfo)
bool CanNoReagentCast(SpellInfo const *spellInfo) const
uint32 DestroyItemCount(uint32 item, uint32 count, bool update, bool unequip_check=false)
uint32 GetRuneCooldown(uint8 index) const
void SendTameFailure(PetTameResult result)
Battleground * GetBattleground() const
TradeData * GetTradeData() const
uint32 GetFreeInventorySlotCount(EnumFlag< ItemSearchLocation > location=ItemSearchLocation::Inventory) const
bool IsGameMaster() const
void RemoveCurrency(uint32 id, int32 amount, CurrencyDestroyReason destroyReason=CurrencyDestroyReason::Cheat)
uint8 GetActiveTalentGroup() const
Player * GetSelectedPlayer() const
Item * GetWeaponForAttack(WeaponAttackType attackType, bool useable=false) const
bool HasSpell(uint32 spell) const override
Item * GetItemByGuid(ObjectGuid guid) const
void UpdatePvP(bool state, bool override=false)
Spell * m_spellModTakingSpell
InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 item, uint32 count, uint32 *no_space_count=nullptr) const
bool HasEnoughMoney(uint64 amount) const
ProcReflectDelayed(Unit *owner, ObjectGuid casterGuid)
bool Execute(uint64, uint32) override
void SetPitch(float pitch)
SpellDestination const * GetSrc() const
void SetItemTarget(Item *item)
void RemoveObjectTarget()
ObjectGuid m_objectTargetGUID
WorldObject * GetObjectTarget() const
ObjectGuid GetUnitTargetGUID() const
void ModDst(Position const &pos)
GameObject * GetGOTarget() const
void SetTradeItemTarget(Player *caster)
Corpse * GetCorpseTarget() const
void SetDst(float x, float y, float z, float orientation, uint32 mapId=MAPID_INVALID)
void SetSpeed(float speed)
void SetSrc(float x, float y, float z)
void SetTargetFlag(SpellCastTargetFlags flag)
SpellDestination const * GetDst() const
void SetGOTarget(GameObject *target)
void UpdateTradeSlotItem()
ObjectGuid GetCorpseTargetGUID() const
ObjectGuid GetObjectTargetGUID() const
void SetUnitTarget(Unit *target)
ObjectGuid GetItemTargetGUID() const
WorldObject * m_objectTarget
Item * GetItemTarget() const
uint32 GetTargetMask() const
uint32 GetItemTargetEntry() const
Unit * GetUnitTarget() const
ObjectGuid m_itemTargetGUID
void Update(WorldObject *caster)
void ModSrc(Position const &pos)
void Write(WorldPackets::Spells::SpellTargetData &data)
Position const * GetSrcPos() const
ObjectGuid GetGOTargetGUID() const
WorldLocation const * GetDstPos() const
bool HasRadius(SpellTargetIndex targetIndex) const
int32 CalcValue(WorldObject const *caster=nullptr, int32 const *basePoints=nullptr, Unit const *target=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
uint32 GetMissingTargetMask(bool srcSet=false, bool dstSet=false, uint32 mask=0) const
float CalcRadius(WorldObject *caster=nullptr, SpellTargetIndex targetIndex=SpellTargetIndex::TargetA, Spell *spell=nullptr) const
Optional< std::pair< float, float > > CalcRadiusBounds(WorldObject *caster, SpellTargetIndex targetIndex, Spell *spell) const
bool IsAreaAuraEffect() const
std::shared_ptr< std::vector< Condition > > ImplicitTargetConditions
bool IsTargetingArea() const
SpellEffectImplicitTargetTypes GetImplicitTargetType() const
EnumFlag< SpellEffectAttributes > EffectAttributes
SpellEffIndex EffectIndex
SpellImplicitTargetInfo TargetA
SpellImplicitTargetInfo TargetB
bool IsDeletable() const override
Trinity::unique_trackable_ptr< Spell > m_Spell
std::string GetDebugInfo() const
void Abort(uint64 e_time) override
Trinity::unique_weak_ptr< Spell > GetSpellWeakPtr() const
bool Execute(uint64 e_time, uint32 p_time) override
Spell const * GetSpell() const
bool HasGlobalCooldown(SpellInfo const *spellInfo) const
void ResetCooldown(uint32 spellId, bool update=false)
bool IsReady(SpellInfo const *spellInfo, uint32 itemId=0) const
void AddGlobalCooldown(SpellInfo const *spellInfo, Duration duration)
void RestoreCharge(uint32 chargeCategoryId)
void CancelGlobalCooldown(SpellInfo const *spellInfo)
void HandleCooldowns(SpellInfo const *spellInfo, Item const *item, Spell *spell=nullptr)
bool HasCooldown(SpellInfo const *spellInfo, uint32 itemId=0) const
SpellTargetCheckTypes GetCheckType() const
SpellTargetReferenceTypes GetReferenceType() const
SpellTargetSelectionCategories GetSelectionCategory() const
SpellTargetObjectTypes GetObjectType() const
float CalcDirectionAngle() const
Targets GetTarget() const
uint32 RequiresSpellFocus
std::array< int32, MAX_SPELL_TOTEMS > Totem
uint32 GetMaxTicks() const
std::array< int32, MAX_SPELL_REAGENTS > Reagent
Optional< SpellPowerCost > CalcPowerCost(Powers powerType, bool optionalCost, WorldObject const *caster, SpellSchoolMask schoolMask, Spell *spell=nullptr) const
float GetMaxRange(bool positive=false, WorldObject *caster=nullptr, Spell *spell=nullptr) const
bool HasEffect(SpellEffectName effect) const
SpellCastResult CheckShapeshift(uint32 form) const
std::array< uint16, MAX_SPELL_TOTEMS > TotemCategory
uint64 GetAllEffectsMechanicMask() const
bool IsRequiringDeadTarget() const
int32 NumNonDiminishedTargets
uint64 GetMechanicImmunityMask(Unit const *caster) const
std::vector< Milliseconds > EmpowerStageThresholds
std::array< int16, MAX_SPELL_REAGENTS > ReagentCount
bool IsCooldownStartedOnEvent() const
EnumFlag< SpellAuraInterruptFlags > ChannelInterruptFlags
::Difficulty const Difficulty
SpellRangeEntry const * RangeEntry
uint32 CalcCastTime(Spell *spell=nullptr) const
SpellCastResult CheckLocation(uint32 map_id, uint32 zone_id, uint32 area_id, Player const *player=nullptr) const
uint32 GetRecoveryTime() const
DiminishingReturnsType GetDiminishingReturnsGroupType() const
uint64 GetAllowedMechanicMask() const
uint32 ExcludeCasterAuraState
float GetMinRange(bool positive=false) const
int32 GetMaxDuration() const
bool HasInitialAggro() const
DiminishingGroup GetDiminishingReturnsGroupForSpell() const
SpellCastResult CheckTarget(WorldObject const *caster, WorldObject const *target, bool implicit=true) const
EnumFlag< SpellInterruptFlags > InterruptFlags
bool IsAllowingDeadTarget() const
WeaponAttackType GetAttackType() const
SpellSchoolMask GetSchoolMask() const
std::vector< SpellReagentsCurrencyEntry const * > ReagentsCurrency
bool HasAttribute(SpellAttr0 attribute) const
bool IsNextMeleeSwingSpell() const
struct SpellInfo::@327 SqrtDamageAndHealingDiminishing
bool SpellCancelsAuraEffect(AuraEffect const *aurEff) const
uint32 MaxAffectedTargets
int32 GetDuration() const
SpellCastResult CheckVehicle(Unit const *caster) const
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
std::vector< SpellEffectInfo > const & GetEffects() const
int32 EquippedItemSubClassMask
bool IsEmpowerSpell() const
uint32 GetExplicitTargetMask() const
SpellCastResult CheckExplicitTarget(WorldObject const *caster, WorldObject const *target, Item const *itemTarget=nullptr) const
LocalizedString const * SpellName
bool NeedsExplicitUnitTarget() const
EnumFlag< SpellAuraInterruptFlags2 > ChannelInterruptFlags2
AuraType ExcludeCasterAuraType
bool IsAutoRepeatRangedSpell() const
bool IsMoveAllowedChannel() const
uint32 ExcludeCasterAuraSpell
bool HasAura(AuraType aura) const
bool IsTargetingArea() const
uint32 StartRecoveryCategory
bool IsPositiveEffect(uint8 effIndex) const
bool CanBeUsedInCombat(Unit const *caster) const
bool IsEffectAffected(SpellInfo const *spellInfo, uint8 effIndex) const
void Call(SpellScript *spellScript, SpellMissInfo missInfo) const
void Call(SpellScript *spellScript) const
SpellCastResult Call(SpellScript *spellScript) const
void Call(SpellScript *spellScript, SpellEffectInfo const &spellEffectInfo, Unit *victim, int32 &damageOrHealing, int32 &flatMod, float &pctMod) const
void Call(SpellScript *spellScript, SpellDestination &target) const
void Call(SpellScript *spellScript, SpellEffIndex effIndex) const
void Call(SpellScript *spellScript, int32 completedStagesCount) const
void Call(SpellScript *spellScript) const
void Call(SpellScript *spellScript, std::list< WorldObject * > &targets) const
void Call(SpellScript *spellScript, WorldObject *&target) const
void Call(SpellScript *spellScript, Unit const *victim, float &critChance) const
void Call(SpellScript *spellScript, DamageInfo const &damageInfo, uint32 &resistAmount, int32 &absorbAmount) const
SpellState getState() const
int32 CalculateDamage(SpellEffectInfo const &spellEffectInfo, Unit const *target, float *var=nullptr) const
void SelectImplicitTargetObjectTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType)
SpellInfo const * GetSpellInfo() const
float m_damageMultipliers[MAX_SPELL_EFFECTS]
SpellCastResult CheckItems(int32 *param1, int32 *param2) const
void ExecuteLogEffectSummonObject(SpellEffectName effect, WorldObject *obj)
void CallScriptAfterCastHandlers()
std::vector< SpellPowerCost > m_powerCost
void AddCorpseTarget(Corpse *target, uint32 effectMask)
uint64 CalculateDelayMomentForDst(float launchDelay) const
GameObject * SearchSpellFocus()
bool CheckSpellCancelsStun(int32 *param1) const
std::vector< SpellScript * > m_loadedScripts
GameObject * gameObjTarget
std::pair< float, float > GetMinMaxRange(bool strict) const
void PrepareTriggersExecutedOnHit()
SpellMissInfo targetMissInfo
bool m_referencedFromCurrentSpell
void PreprocessSpellLaunch(TargetInfo &targetInfo)
void UpdateDelayMomentForUnitTarget(Unit *unit, uint64 hitDelay)
bool CheckSpellCancelsNoActions(int32 *param1) const
bool HasPowerTypeCost(Powers power) const
void UpdateSpellHealPrediction(WorldPackets::Spells::SpellHealPrediction &healPrediction, bool withPeriodic)
void SelectImplicitTrajTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType)
void ExecuteLogEffectUnsummonObject(SpellEffectName effect, WorldObject *obj)
uint32 m_channelTargetEffectMask
void ExecuteLogEffectResurrect(SpellEffectName effect, Unit *target)
void cast(bool skipCheck=false)
void ExecuteLogEffectDestroyItem(SpellEffectName effect, uint32 entry)
void SendChannelStart(uint32 duration)
void ExecuteLogEffectOpenLock(SpellEffectName effect, Object *obj)
int64 GetCorpseTargetCountForEffect(SpellEffIndex effect) const
SpellCastTargets m_targets
void SelectImplicitNearbyTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, SpellTargetIndex targetIndex, uint32 effMask)
static bool CanIncreaseRangeByMovement(Unit const *unit)
std::unique_ptr< PathGenerator > m_preGeneratedPath
Difficulty GetCastDifficulty() const
void CallScriptBeforeHitHandlers(SpellMissInfo missInfo)
void SelectEffectImplicitTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, SpellTargetIndex targetIndex, uint32 &processedEffectMask)
SpellCastResult CheckRuneCost() const
void CallScriptCalcDamageHandlers(SpellEffectInfo const &spellEffectInfo, Unit *victim, int32 &damage, int32 &flatMod, float &pctMod)
void SelectExplicitTargets()
SpellCastResult CanOpenLock(SpellEffectInfo const &effect, uint32 lockid, SkillType &skillid, int32 &reqSkillValue, int32 &skillValue)
void DoTriggersOnSpellHit(Unit *unit)
TriggerCastFlags _triggeredCastFlags
bool IsAutoRepeat() const
void HandleEffects(Unit *pUnitTarget, Item *pItemTarget, GameObject *pGoTarget, Corpse *pCorpseTarget, SpellEffectInfo const &spellEffectInfo, SpellEffectHandleMode mode)
void prepareDataForTriggerSystem()
void SearchAreaTargets(std::list< WorldObject * > &targets, SpellEffectInfo const &spellEffectInfo, float range, Position const *position, WorldObject *referer, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectionType, ConditionContainer const *condList, Trinity::WorldObjectSpellAreaTargetSearchReason searchReason)
SpellEffectHandleMode effectHandleMode
bool IsValidDeadOrAliveTarget(Unit const *target) const
int32 m_channeledDuration
SpellCastResult CheckMovement() const
std::unique_ptr< EmpowerData > m_empower
void DoProcessTargetContainer(Container &targetContainer)
bool IsNeedSendToClient() const
WorldObject * SearchNearbyTarget(SpellEffectInfo const &spellEffectInfo, float range, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectionType, ConditionContainer const *condList=nullptr)
bool IsIgnoringCooldowns() const
void SelectImplicitDestDestTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, SpellTargetIndex targetIndex)
std::vector< TargetInfo > m_UniqueTargetInfo
SpellDestination m_destTargets[MAX_SPELL_EFFECTS]
void _handle_finish_phase()
void UpdateDelayMomentForDst(uint64 hitDelay)
bool CanExecuteTriggersOnHit(Unit *unit, SpellInfo const *triggeredByAura=nullptr) const
void PrepareTargetProcessing()
Trinity::unique_weak_ptr< Spell > GetWeakPtr() const
void SetExecutedCurrently(bool yes)
void AddUnitTarget(Unit *target, uint32 effectMask, bool checkIfValid=true, bool implicit=true, Position const *losPosition=nullptr)
bool IsEmpowerSpell() const
ObjectGuid m_originalCastId
uint8 m_delayAtDamageCount
static Spell const * ExtractSpellFromEvent(BasicEvent *event)
ProcFlagsSpellType m_procSpellType
void ExecuteLogEffectExtraAttacks(SpellEffectName effect, Unit *victim, uint32 numAttacks)
WeaponAttackType m_attackType
void ExecuteLogEffectTakeTargetPower(SpellEffectName effect, Unit *target, Powers powerType, uint32 points, float amplitude)
void _cast(bool skipCheck=false)
void SendInterrupted(uint8 result)
bool IsProcDisabled() const
void SendSpellInterruptLog(Unit *victim, uint32 spellId)
bool IsFocusDisabled() const
int32 GetSpellCastDataAmmo()
ObjectGuid m_originalCasterGUID
WorldObject *const m_caster
int64 GetItemTargetCountForEffect(SpellEffIndex effect) const
std::string GetDebugInfo() const
bool UpdateChanneledTargetList()
void TriggerGlobalCooldown()
void ExecuteLogEffectDurabilityDamage(SpellEffectName effect, Unit *victim, int32 itemId, int32 amount)
void SendMountResult(MountResult result)
void AddGOTarget(GameObject *target, uint32 effectMask)
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, SpellCastVisual spellVisual, ObjectGuid cast_count, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE, int32 *param1=nullptr, int32 *param2=nullptr)
void HandleThreatSpells()
std::vector< CorpseTargetInfo > m_UniqueCorpseTargetInfo
void CancelGlobalCooldown()
bool CheckSpellCancelsAuraEffect(AuraType auraType, int32 *param1) const
void SearchChainTargets(std::list< WorldObject * > &targets, uint32 chainTargets, WorldObject *target, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectType, SpellEffectInfo const &spellEffectInfo, bool isChainHeal)
void SelectImplicitAreaTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, SpellTargetIndex targetIndex, uint32 effMask)
bool CheckSpellCancelsSilence(int32 *param1) const
void CallScriptOnCastHandlers()
void AddDestTarget(SpellDestination const &dest, uint32 effIndex)
int64 GetGameObjectTargetCountForEffect(SpellEffIndex effect) const
void SetEmpowerReleasedByClient(bool release)
void _handle_immediate_phase()
void CallScriptBeforeCastHandlers()
bool CheckSpellCancelsCharm(int32 *param1) const
SpellCustomErrors m_customError
void SelectImplicitLineTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, SpellTargetIndex targetIndex, uint32 effMask)
bool CallScriptEffectHandlers(SpellEffIndex effIndex, SpellEffectHandleMode mode)
std::vector< GOTargetInfo > m_UniqueGOTargetInfo
void DoSpellEffectHit(Unit *unit, SpellEffectInfo const &spellEffectInfo, TargetInfo &targetInfo)
HitTriggerSpellList m_hitTriggerSpells
void SetSpellValue(CastSpellExtraArgsInit::SpellValueOverride const &value)
void SelectImplicitTargetDestTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, SpellTargetIndex targetIndex)
void SetDelayStart(uint64 m_time)
void CallScriptOnPrecastHandler()
void SelectImplicitCasterDestTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, SpellTargetIndex targetIndex)
SpellEffectInfo const * effectInfo
Unit * GetUnitCasterForEffectHandlers() const
SpellInfo const * m_triggeredByAuraSpell
uint64 handle_delayed(uint64 t_offset)
void CallScriptOnResistAbsorbCalculateHandlers(DamageInfo const &damageInfo, uint32 &resistAmount, int32 &absorbAmount)
bool CheckSpellCancelsPacify(int32 *param1) const
CurrentSpellTypes GetCurrentContainer() const
uint32 m_applyMultiplierMask
SpellSchoolMask m_spellSchoolMask
void SendSpellExecuteLog()
Optional< int32 > GetPowerTypeCostAmount(Powers power) const
WorldObject * GetCaster() const
void SendChannelUpdate(uint32 time, Optional< SpellCastResult > result={})
void SelectSpellTargets()
bool CheckSpellCancelsConfuse(int32 *param1) const
SpellCastResult prepare(SpellCastTargets const &targets, AuraEffect const *triggeredByAura=nullptr)
SpellCastResult CheckCast(bool strict, int32 *param1=nullptr, int32 *param2=nullptr)
void CallScriptEmpowerStageCompletedHandlers(int32 completedStagesCount)
bool IsChannelActive() const
SpellCastResult CheckPetCast(Unit *target)
void RecalculateDelayMomentForDst()
SpellLogEffect & GetExecuteLogEffect(SpellEffectName effect)
void SelectImplicitChainTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, WorldObject *target, uint32 effMask)
int32 CallScriptCalcCastTimeHandlers(int32 originalCastTime)
SpellCastResult CallScriptCheckCastHandlers()
void ExecuteLogEffectCreateItem(SpellEffectName effect, uint32 entry)
Optional< Scripting::v2::ActionResultSetter< SpellCastResult > > m_scriptResult
void CallScriptCalcHealingHandlers(SpellEffectInfo const &spellEffectInfo, Unit *victim, int32 &healing, int32 &flatMod, float &pctMod)
void InitExplicitTargets(SpellCastTargets const &targets)
bool IsWithinLOS(WorldObject const *source, WorldObject const *target, bool targetAsSourceLocation, VMAP::ModelIgnoreFlags ignoreFlags) const
void SendPetCastResult(SpellCastResult result, int32 *param1=nullptr, int32 *param2=nullptr) const
WorldLocation * destTarget
bool CheckSpellCancelsFear(int32 *param1) const
bool CanReleaseEmpowerSpell() const
bool m_scriptWaitsForSpellHit
void SelectImplicitCasterObjectTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType)
void SetReferencedFromCurrent(bool yes)
void SelectEffectTypeImplicitTargets(SpellEffectInfo const &spellEffectInfo)
void update(uint32 difftime)
void SelectImplicitConeTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, SpellTargetIndex targetIndex, uint32 effMask)
uint64 GetDelayStart() const
bool CheckScriptEffectImplicitTargets(uint32 effIndex, uint32 effIndexToCheck)
ProcFlagsInit m_procVictim
std::vector< SpellLogEffect > _executeLogEffects
void CallScriptSuccessfulDispel(SpellEffIndex effIndex)
void DoEffectOnLaunchTarget(TargetInfo &targetInfo, float multiplier, SpellEffectInfo const &spellEffectInfo)
uint64 GetDelayMoment() const
void AddItemTarget(Item *item, uint32 effectMask)
int32 GetUnitTargetIndexForEffect(ObjectGuid const &target, SpellEffIndex effect) const
UsedSpellMods m_appliedMods
void CallScriptEmpowerCompletedHandlers(int32 completedStagesCount)
void CallScriptCalcCritChanceHandlers(Unit const *victim, float &chance)
SpellValue *const m_spellValue
void SelectImplicitChannelTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType)
void finish(SpellCastResult result=SPELL_CAST_OK)
bool CheckEffectTarget(Unit const *target, SpellEffectInfo const &spellEffectInfo, Position const *losPosition) const
void SendResurrectRequest(Player *target)
void MovePosition(Position &pos, WorldObject const *from, float dist, float angle) const
SpellMissInfo PreprocessSpellHit(Unit *unit, TargetInfo &targetInfo)
SpellCastResult CheckCasterAuras(int32 *param1) const
static uint32 GetSearcherTypeMask(SpellInfo const *spellInfo, SpellEffectInfo const &spellEffectInfo, SpellTargetObjectTypes objType, ConditionContainer const *condList)
static void SearchTargets(SEARCHER &searcher, uint32 containerMask, WorldObject *referer, Position const *pos, float radius)
std::vector< ItemTargetInfo > m_UniqueItemInfo
bool IsAutoActionResetSpell() const
ProcFlagsInit m_procAttacker
ObjectGuid m_castItemGUID
SpellCastVisual m_SpellVisual
Spell(WorldObject *caster, SpellInfo const *info, TriggerCastFlags triggerFlags, ObjectGuid originalCasterGUID=ObjectGuid::Empty, ObjectGuid originalCastId=ObjectGuid::Empty)
int64 GetUnitTargetCountForEffect(SpellEffIndex effect) const
SpellCastResult CheckPower() const
void CallScriptDestinationTargetSelectHandlers(SpellDestination &target, SpellEffIndex effIndex, SpellImplicitTargetInfo const &targetType)
void UpdateSpellCastDataTargets(WorldPackets::Spells::SpellCastData &data)
Writes miss and hit targets for a SMSG_SPELL_GO packet.
SpellInfo const *const m_spellInfo
std::vector< T > & GetExecuteLogEffectTargets(SpellEffectName effect, Optional< std::vector< T > > SpellLogEffect::*member)
bool HasGlobalCooldown() const
void FinishTargetProcessing()
void CallScriptOnHitHandlers()
SpellCastResult CheckRange(bool strict) const
void CallScriptObjectTargetSelectHandlers(WorldObject *&target, SpellEffIndex effIndex, SpellImplicitTargetInfo const &targetType)
void TakeRunePower(bool didHit)
void CallScriptObjectAreaTargetSelectHandlers(std::list< WorldObject * > &targets, SpellEffIndex effIndex, SpellImplicitTargetInfo const &targetType)
SpellCastResult CheckArenaAndRatedBattlegroundCastRules()
void CallScriptAfterHitHandlers()
bool CanAutoCast(Unit *target)
ObjectGuid GetSummonerGUID() const
void ForwardThreatForAssistingMe(Unit *assistant, float baseAmount, SpellInfo const *spell=nullptr, bool ignoreModifiers=false)
== AFFECT OTHERS' THREAT LISTS ==
void AddThreat(Unit *target, float amount, SpellInfo const *spell=nullptr, bool ignoreModifiers=false, bool ignoreRedirects=false)
== AFFECT MY THREAT LIST ==
Utility class to enable range for loop syntax for multimap.equal_range uses.
Trinity::unique_trackable_ptr companion class, replicating what std::weak_ptr is to std::shared_ptr.
void SetDiminishGroup(DiminishingGroup group)
void AddStaticApplication(Unit *target, uint32 effMask)
Unit * GetCharmed() const
void ClearUnitState(uint32 f)
uint32 GetChannelSpellId() const
void SetLastDamagedTargetGuid(ObjectGuid guid)
int32 ModifyPower(Powers power, int32 val, bool withPowerUpdate=true)
bool IsWithinBoundaryRadius(const Unit *obj) const
void RemoveGameObject(GameObject *gameObj, bool del)
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
uint32 GetSchoolImmunityMask() const
uint32 m_lastSanctuaryTime
static uint32 SpellCriticalHealingBonus(Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit *victim)
bool CanHaveThreatList() const
====================== THREAT & COMBAT ====================
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
int64 ModifyHealth(int64 val)
void SetCurrentCastSpell(Spell *pSpell)
void SetStandState(UnitStandStateType state, uint32 animKitID=0)
ThreatManager & GetThreatManager()
bool HasAuraTypeWithMiscvalue(AuraType auraType, int32 miscValue) const
void SetInCombatWith(Unit *enemy, bool addSecondUnitSuppressed=false)
static void DealDamageMods(Unit const *attacker, Unit const *victim, uint32 &damage, uint32 *absorb)
uint64 GetMechanicImmunityMask() const
void CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=BASE_ATTACK, bool crit=false, bool blocked=false, Spell *spell=nullptr)
std::forward_list< AuraEffect * > AuraEffectList
bool IsInDisallowedMountForm() const
bool IsImmunedToSpell(SpellInfo const *spellInfo, WorldObject const *caster, bool requireImmunityPurgesEffectAttribute=false) const
void DealSpellDamage(SpellNonMeleeDamage const *damageInfo, bool durabilityLoss)
bool haveOffhandWeapon() const
MotionMaster * GetMotionMaster()
Powers GetPowerType() const
bool HasUnitFlag(UnitFlags flags) const
ObjectGuid GetCharmedGUID() const
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
void UpdateInterruptMask()
void IncrDiminishing(SpellInfo const *auraSpellInfo)
void AddChannelObject(ObjectGuid guid)
void SetChannelSpellId(uint32 channelSpellId)
bool IsFullHealth() const
bool HasUnitFlag2(UnitFlags2 flags) const
float GetCombatReach() const override
int32 GetMaxPower(Powers power) const
int32 HealBySpell(HealInfo &healInfo, bool critical=false)
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage const *log)
bool IsStandState() const
bool IsSilenced(SpellSchoolMask schoolMask) const
TempSummon * ToTempSummon()
CharmInfo * GetCharmInfo()
ObjectGuid GetCharmerOrOwnerGUID() const override
float SpellCritChanceDone(Spell *spell, AuraEffect const *aurEff, SpellSchoolMask schoolMask, WeaponAttackType attackType=BASE_ATTACK) const
void SetChannelVisual(SpellCastVisual channelVisual)
virtual bool IsAffectedByDiminishingReturns() const
bool IsOnVehicle(Unit const *vehicle) const
bool IsCharmedOwnedByPlayerOrPlayer() const
virtual bool IsImmunedToSpellEffect(SpellInfo const *spellInfo, SpellEffectInfo const &spellEffectInfo, WorldObject const *caster, bool requireImmunityPurgesEffectAttribute=false) const
float SpellCritChanceTaken(Unit const *caster, Spell *spell, AuraEffect const *aurEff, SpellSchoolMask schoolMask, float doneChance, WeaponAttackType attackType=BASE_ATTACK) const
int32 CalculateAOEAvoidance(int32 damage, uint32 schoolMask, bool npcCaster) const
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
bool HasUnitMovementFlag(uint32 f) const
void RemoveDynObject(uint32 spellId)
AttackerSet const & getAttackers() const
void SetSpellEmpowerStage(int8 stage)
void EngageWithTarget(Unit *who)
uint8 GetLevelForTarget(WorldObject const *) const override
int32 GetTotalAuraModifier(AuraType auraType) const
void RemoveAurasWithInterruptFlags(InterruptFlags flag, SpellInfo const *source=nullptr)
UF::UpdateField< UF::UnitData, int32(WowCS::EntityFragment::CGObject), TYPEID_UNIT > m_unitData
int32 GetPower(Powers power) const
float GetTotalAttackPowerValue(WeaponAttackType attType, bool includeWeapon=true) const
bool IsImmunedToDamage(SpellSchoolMask meleeSchoolMask) const
DeathState getDeathState() const
bool HasUnitState(const uint32 f) const
bool IsInRaidWith(Unit const *unit) const
DynamicObject * GetDynObject(uint32 spellId) const
int32 GetProcChainLength() const
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
float GetMeleeRange(Unit const *target) const
SpellHistory * GetSpellHistory()
bool IsControlledByPlayer() const
DiminishingLevels GetDiminishing(DiminishingGroup group) const
ObjectGuid GetCharmerGUID() const
virtual void setDeathState(DeathState s)
CombatManager & GetCombatManager()
bool HasAuraTypeWithAffectMask(AuraType auraType, SpellInfo const *affectedSpell) const
bool isAttackReady(WeaponAttackType type=BASE_ATTACK) const
bool ApplyDiminishingToDuration(SpellInfo const *auraSpellInfo, int32 &duration, WorldObject *caster, DiminishingLevels previousLevel) const
bool IsSpiritHealer() const
AuraList & GetSingleCastAuras()
AuraApplication * GetAuraApplication(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraApplication *except=nullptr) const
Vehicle * GetVehicleKit() const
void resetAttackTimer(WeaponAttackType type=BASE_ATTACK)
static void ProcSkillsAndAuras(Unit *actor, Unit *actionTarget, ProcFlagsInit const &typeMaskActor, ProcFlagsInit const &typeMaskActionTarget, ProcFlagsSpellType spellTypeMask, ProcFlagsSpellPhase spellPhaseMask, ProcFlagsHit hitMask, Spell *spell, DamageInfo *damageInfo, HealInfo *healInfo)
virtual bool IsEngaged() const
void ClearChannelObjects()
bool IsInPartyWith(Unit const *unit) const
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
int32 SpellHealingBonusDone(Unit *victim, SpellInfo const *spellProto, int32 healamount, DamageEffectType damagetype, SpellEffectInfo const &spellEffectInfo, uint32 stack=1, Spell *spell=nullptr, AuraEffect const *aurEff=nullptr) const
ObjectGuid GetTarget() const
ObjectGuid GetPetGUID() const
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
bool isLineOfSightCalcEnabled() const
static VMapManager2 * createOrGetVMapManager()
bool IsControllableVehicle() const
constexpr uint32 GetMapId() const
Unit * GetMagicHitRedirectTarget(Unit *victim, SpellInfo const *spellInfo)
void MovePosition(Position &pos, float dist, float angle, float maxHeightChange=6.0f) const
bool IsWithinDist2d(float x, float y, float dist) const
virtual void SendMessageToSet(WorldPacket const *data, bool self) const
virtual float GetCollisionHeight() const
Unit * GetCharmerOrOwner() const
void SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo missInfo)
bool IsWithinLOS(float x, float y, float z, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing) const
void SendCombatLogMessage(WorldPackets::CombatLog::CombatLogServerPacket *combatLog) const
void GetClosePoint(float &x, float &y, float &z, float size, float distance2d=0, float relAngle=0) const
float GetMapHeight(float x, float y, float z, bool vmap=true, float distanceToSearch=50.0f) const
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
float GetMapWaterOrGroundLevel(float x, float y, float z, float *ground=nullptr) const
bool IsValidAttackTarget(WorldObject const *target, SpellInfo const *bySpell=nullptr) const
PhaseShift & GetPhaseShift()
bool GetDistanceOrder(WorldObject const *obj1, WorldObject const *obj2, bool is3D=true) const
int32 ModSpellDuration(SpellInfo const *spellInfo, WorldObject const *target, int32 duration, bool positive, uint32 effectMask) const
std::string GetNameForLocaleIdx(LocaleConstant) const override
int32 CalculateSpellDamage(Unit const *target, SpellEffectInfo const &spellEffectInfo, int32 const *basePoints=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
bool IsWithinLOSInMap(WorldObject const *obj, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing) const
Player * GetSpellModOwner() const
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
bool IsValidAssistTarget(WorldObject const *target, SpellInfo const *bySpell=nullptr) const
void MovePositionToFirstCollision(Position &pos, float dist, float angle) const
float GetVisibilityRange() const
virtual uint32 GetCastSpellXSpellVisualId(SpellInfo const *spellInfo) const
float GetSpellMinRangeForTarget(Unit const *target, SpellInfo const *spellInfo) const
SpellMissInfo SpellHitResult(Unit *victim, SpellInfo const *spellInfo, bool canReflect=false) const
float GetDistance(WorldObject const *obj) const
MovementInfo m_movementInfo
void GetZoneAndAreaId(uint32 &zoneid, uint32 &areaid) const
float GetSpellMaxRangeForTarget(Unit const *target, SpellInfo const *spellInfo) const
bool IsWithinDist(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
bool IsFriendlyTo(WorldObject const *target) const
virtual float GetCombatReach() const
void ModSpellDurationTime(SpellInfo const *spellInfo, int32 &durationTime, Spell *spell=nullptr) const
Spells::SpellCastLogData LogData
std::vector< SpellLogEffect > const * Effects
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
ObjectGuid ResurrectOffererGUID
uint32 ResurrectOffererVirtualRealmAddress
WorldPacket const * Write() override
Optional< SpellTargetedHealPrediction > HealPrediction
Optional< SpellChannelStartInterruptImmunities > InterruptImmunities
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
Optional< SpellTargetedHealPrediction > HealPrediction
Duration< Milliseconds, uint32 > EmpowerDuration
Duration< Milliseconds, uint32 > MinHoldTime
std::vector< Duration< Milliseconds, uint32 > > StageDurations
std::vector< ObjectGuid > Targets
Optional< SpellChannelStartInterruptImmunities > InterruptImmunities
Duration< Milliseconds, uint32 > HoldAtMaxTime
WorldPacket const * Write() override
std::vector< Duration< Milliseconds, uint32 > > StageDurations
Duration< Milliseconds, int32 > TimeRemaining
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
LocaleConstant GetSessionDbLocaleIndex() const
uint32 GetRecruiterId() const
uint32 GetAccountId() const
CollectionMgr * GetCollectionMgr() const
BattlePets::BattlePetMgr * GetBattlePetMgr() const
uint32 GetVirtualRealmAddress()
static constexpr uint16 MAX_BATTLE_PET_LEVEL
bool IsDisabledFor(DisableType type, uint32 entry, WorldObject const *ref, uint8 flags)
TC_GAME_API WorldObject * GetWorldObject(WorldObject const &, ObjectGuid const &)
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
TC_GAME_API GameObject * GetGameObject(WorldObject const &u, ObjectGuid const &guid)
TC_GAME_API Player * FindPlayer(ObjectGuid const &)
TC_GAME_API Player * GetPlayer(Map const *, ObjectGuid const &guid)
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
TC_GAME_API Corpse * GetCorpse(WorldObject const &u, ObjectGuid const &guid)
TC_GAME_API Creature * GetCreatureOrPetOrVehicle(WorldObject const &, ObjectGuid const &)
void RandomShuffle(Iterator begin, Iterator end)
Reorder the elements of the iterator range randomly.
auto SelectRandomContainerElement(C const &container) -> std::add_const_t< decltype(*std::ranges::begin(container))> &
constexpr IteratorPair< iterator, end_iterator > MakeIteratorPair(iterator first, end_iterator second)
void RandomResize(C &container, std::size_t requestedSize)
WorldObjectSpellAreaTargetSearchReason
void SelectRandomInjuredTargets(std::list< WorldObject * > &targets, size_t maxTargets, bool prioritizePlayers, Unit const *prioritizeGroupMembersOf)
CellCoord ComputeCellCoord(float x, float y)
constexpr std::size_t size()
AuraCreateInfo & SetBaseAmount(int32 const *bp)
AuraCreateInfo & SetCastItem(ObjectGuid const &guid, uint32 itemId, int32 itemLevel)
AuraCreateInfo & SetCasterGUID(ObjectGuid const &guid)
AuraCreateInfo & SetIsRefresh(bool *isRefresh)
AuraCreateInfo & SetOwnerEffectMask(uint32 effMask)
AuraCreateInfo & SetStackAmount(int32 stackAmount)
AuraCreateInfo & SetPeriodicReset(bool reset)
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
bool IsPetSpecialization() const
Condition const * mLastFailedCondition
CreatureDifficulty const * GetDifficulty(Difficulty difficulty) const
bool IsTameable(bool canTameExotic, CreatureDifficulty const *creatureDifficulty) const
uint32 GetNoDamageImmune() const
uint8 GlyphExclusiveCategoryID
uint32 GetRequiredSkillRank() const
uint32 GetBaseItemLevel() const
uint32 GetMaxStackSize() const
InventoryType GetInventoryType() const
uint8 GetArtifactID() const
uint32 GetItemLimitCategory() const
bool HasFlag(ItemFlags flag) const
uint32 GetSubClass() const
std::array< uint8, MAX_LOCK_CASE > Type
std::array< uint16, MAX_LOCK_CASE > Skill
std::array< int32, MAX_LOCK_CASE > Index
uint32 GetMovementFlags() const
constexpr void SetOrientation(float orientation)
constexpr float GetPositionX() const
constexpr float GetPositionY() const
float GetExactDist2d(const float x, const float y) const
float GetRelativeAngle(float x, float y) const
float GetExactDist(float x, float y, float z) const
bool HasInLine(Position const *pos, float objSize, float width) const
bool HasInArc(float arcangle, Position const *pos, float border=2.0f) const
float GetAbsoluteAngle(float x, float y) const
constexpr void Relocate(float x, float y)
void GetPositionOffsetTo(Position const &endPos, Position &retOffset) const
constexpr float GetExactDistSq(float x, float y, float z) const
constexpr bool IsInDist(float x, float y, float z, float dist) const
void RelocateOffset(Position const &offset)
constexpr float GetOrientation() const
constexpr float GetPositionZ() const
uint32 SpellXSpellVisualID
void RelocateOffset(Position const &offset)
Position _transportOffset
void Relocate(Position const &pos)
ObjectGuid _transportGUID
std::array< uint8, MAX_ITEM_ENCHANTMENT_EFFECTS > Effect
EnumFlag< SpellItemEnchantmentFlags > GetFlags() const
Optional< std::vector< SpellLogEffectTradeSkillItemParams > > TradeSkillTargets
Optional< std::vector< SpellLogEffectFeedPetParams > > FeedPetTargets
Optional< std::vector< SpellLogEffectPowerDrainParams > > PowerDrainTargets
Optional< std::vector< SpellLogEffectDurabilityDamageParams > > DurabilityDamageTargets
Optional< std::vector< SpellLogEffectGenericVictimParams > > GenericVictimTargets
Optional< std::vector< SpellLogEffectExtraAttacksParams > > ExtraAttacksTargets
Optional< int32 > Duration
Optional< int32 > ParentSpellTargetIndex
int32 EffectBasePoints[MAX_SPELL_EFFECTS]
uint32 CustomBasePointsMask
uint32 MaxAffectedTargets
Optional< int32 > ParentSpellTargetCount
SpellValue(SpellInfo const *proto, WorldObject const *caster)
void DoTargetSpellHit(Spell *spell, SpellEffectInfo const &spellEffectInfo) override
void DoTargetSpellHit(Spell *spell, SpellEffectInfo const &spellEffectInfo) override
void DoTargetSpellHit(Spell *spell, SpellEffectInfo const &spellEffectInfo) override
void PreprocessTarget(Spell *spell) override
SpellMissInfo MissCondition
int32 AuraBasePoints[MAX_SPELL_EFFECTS]
void DoTargetSpellHit(Spell *spell, SpellEffectInfo const &spellEffectInfo) override
void DoDamageAndTriggers(Spell *spell) override
SpellMissInfo ReflectResult
PhaseShift const * i_phaseShift
WorldObjectSpellAreaTargetSearchReason _searchReason
bool operator()(WorldObject *target) const
Position const * _position
WorldObjectSpellAreaTargetCheck(float range, Position const *position, WorldObject *caster, WorldObject *referer, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer const *condList, SpellTargetObjectTypes objectType, WorldObjectSpellAreaTargetSearchReason searchReason=WorldObjectSpellAreaTargetSearchReason::Area)
WorldObjectSpellConeTargetCheck(Position const &coneSrc, float coneAngle, float lineWidth, float range, WorldObject *caster, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer const *condList, SpellTargetObjectTypes objectType)
bool operator()(WorldObject *target) const
WorldObjectSpellLineTargetCheck(Position const *srcPosition, Position const *dstPosition, float lineWidth, float range, WorldObject *caster, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer const *condList, SpellTargetObjectTypes objectType)
bool operator()(WorldObject *target) const
WorldObjectSpellNearbyTargetCheck(float range, WorldObject *caster, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer const *condList, SpellTargetObjectTypes objectType)
bool operator()(WorldObject *target)
Position const * _position
SpellTargetCheckTypes _targetSelectionType
WorldObjectSpellTargetCheck(WorldObject *caster, WorldObject *referer, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer const *condList, SpellTargetObjectTypes objectType)
~WorldObjectSpellTargetCheck()
std::unique_ptr< ConditionSourceInfo > _condSrcInfo
SpellInfo const * _spellInfo
bool operator()(WorldObject *target) const
ConditionContainer const * _condList
SpellTargetObjectTypes _objectType
Position const * _position
WorldObjectSpellTrajTargetCheck(float range, Position const *position, WorldObject *caster, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer const *condList, SpellTargetObjectTypes objectType)
bool operator()(WorldObject *target) const
int32 SpellXSpellVisualID
std::vector< ObjectGuid > HitTargets
SpellHealPrediction Predict
Optional< RuneData > RemainingRunes
CreatureImmunities Immunities
std::vector< SpellMissStatus > MissStatus
MissileTrajectoryResult MissileTrajectory
std::vector< ObjectGuid > MissTargets
ObjectGuid OriginalCastID
std::vector< SpellHitStatus > HitStatus
std::vector< SpellPowerData > RemainingPower
void Initialize(Unit const *unit)
MissileTrajectoryRequest MissileTrajectory
Optional< float > Orientation
Optional< TargetLocation > SrcLocation
Optional< TargetLocation > DstLocation