36#include "G3DPosition.hpp"
78 _transportGUID(wObj.GetTransGUID()), _transportOffset(wObj.GetTransOffset())
99 m_itemTargetEntry(0), m_pitch(0.0f), m_speed(0.0f)
104 m_targetMask(spellCastRequest.Target.Flags), m_objectTarget(nullptr), m_itemTarget(nullptr),
105 m_objectTargetGUID(spellCastRequest.Target.
Unit), m_itemTargetGUID(spellCastRequest.Target.
Item),
106 m_itemTargetEntry(0), m_pitch(0.0f), m_speed(0.0f), m_strTarget(spellCastRequest.Target.
Name)
442 EffectBasePoints[spellEffectInfo.EffectIndex] = spellEffectInfo.CalcBaseValue(caster,
nullptr, 0, -1);
476m_spellValue(new
SpellValue(m_spellInfo, caster)), _spellEvent(nullptr)
510 if (!originalCasterGUID.
IsEmpty())
586 m_empower = std::make_unique<EmpowerData>();
644 Unit* unit =
nullptr;
700 Unit* redirect =
nullptr;
714 if (redirect && (redirect != target))
725 uint32 processedEffectsMaskForSpell = 0;
731 if (!spellEffectInfo.IsEffect())
741 uint32 implicitTargetEffectMaskToSelect = [&]
743 uint32 effectMask = 1u << spellEffectInfo.EffectIndex;
748 for (
uint32 j = spellEffectInfo.EffectIndex + 1; j < effects.size(); ++j)
750 if (effects[j].IsEffect() &&
751 spellEffectInfo.TargetA.GetTarget() == effects[j].TargetA.GetTarget() &&
752 spellEffectInfo.TargetB.GetTarget() == effects[j].TargetB.GetTarget() &&
753 spellEffectInfo.ImplicitTargetConditions == effects[j].ImplicitTargetConditions &&
759 switch (targetInfo.GetSelectionCategory())
772 if (shouldCheckRadius(spellEffectInfo.TargetA) || shouldCheckRadius(spellEffectInfo.TargetB))
777 effectMask |= 1 << j;
784 implicitTargetEffectMaskToSelect &= ~processedEffectsMaskForSpell;
785 if (implicitTargetEffectMaskToSelect)
789 processedEffectsMaskForSpell |= implicitTargetEffectMaskToSelect;
802 if (implicitTargetEffectMaskToSelect
812 return target.
EffectMask & implicitTargetEffectMaskToSelect;
834 uint32 mask = (1 << spellEffectInfo.EffectIndex);
837 if (ihit->EffectMask & mask)
853 if (!anyNonImmuneTargetFound)
899 return uint64(std::floor(launchDelay * 1000.0f));
922 return targetInfo.TargetGUID == unit->GetGUID();
925 uint64 oldDelay = itr->TimeDelay;
926 itr->TimeDelay = hitDelay;
935 return itr.TimeDelay && itr.TimeDelay < smallest.TimeDelay;
983 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT_SRC");
1000 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT_DEST");
1014 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT");
1024 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target category");
1033 ABORT_MSG(
"Spell::SelectImplicitChannelTargets: received not implemented target reference type");
1038 if (!channeledSpell)
1052 if (target && target->
IsUnit())
1084 ABORT_MSG(
"Spell::SelectImplicitChannelTargets: received not implemented target type");
1093 ABORT_MSG(
"Spell::SelectImplicitNearbyTargets: received not implemented target reference type");
1114 ABORT_MSG(
"Spell::SelectImplicitNearbyTargets: received not implemented selection check type");
1123 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));
1164 dest = st->GetPosition();
1168 if (randomRadius > 0.0f)
1184 float randomRadius = 0.0f;
1224 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);
1235 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);
1246 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);
1255 if (randomRadius > 0.0f)
1266 ABORT_MSG(
"Spell::SelectImplicitNearbyTargets: received not implemented target object type");
1277 ABORT_MSG(
"Spell::SelectImplicitConeTargets: received not implemented target reference type");
1285 if (coneAngle == 0.0f)
1292 std::list<WorldObject*> targets;
1303 SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellConeTargetCheck> >(searcher, containerTypeMask,
m_caster,
m_caster, radius.
Max + extraSearchRadius);
1307 if (!targets.empty())
1346 if (ihit->EffectMask & (1 << spellEffectInfo.
EffectIndex))
1355 ABORT_MSG(
"Spell::SelectImplicitAreaTargets: received not implemented target reference type");
1377 ABORT_MSG(
"Spell::SelectImplicitAreaTargets: received not implemented target reference type");
1382 std::list<WorldObject*> targets;
1388 if (
Vehicle const* vehicleKit = unit->GetVehicleKit())
1390 if (
Unit* passenger = vehicleKit->GetPassenger(seat))
1391 targets.push_back(passenger);
1410 for (
ThreatReference const* threatRef : unit->GetThreatManager().GetUnsortedThreatList())
1412 targets.push_back(threateningUnit);
1416 for (
ObjectGuid const& tapperGuid : creature->GetTapList())
1418 targets.push_back(tapper);
1442 if (!targets.empty())
1449 else if (targets.size() > maxTargets)
1450 targets.resize(maxTargets);
1484 dest = st->GetPosition();
1496 float dist =
frand(minDist, maxDist);
1498 float angle =
rand_norm() *
static_cast<float>(
M_PI * 35.0f / 180.0f) -
static_cast<float>(
M_PI * 17.5f / 180.0f);
1505 liquidLevel = liquidData.
level;
1507 if (liquidLevel <= ground)
1515 if (ground + 0.75 > liquidLevel)
1533 float dist = spellEffectInfo.
CalcRadius(unitCaster, targetIndex).
Max;
1550 return static_cast<float>(
M_PI);
1553 return static_cast<float>(
M_PI / 2);
1555 return static_cast<float>(
M_PI / 4);
1557 return static_cast<float>(3 *
M_PI / 4);
1560 return static_cast<float>(-
M_PI / 2);
1562 return static_cast<float>(-
M_PI / 4);
1564 return static_cast<float>(-3 *
M_PI / 4);
1584 if (
WorldObject const* summoner = casterSummon->GetSummoner())
1590 std::vector<SpellTargetPosition const*> positionsInRange;
1593 positionsInRange.push_back(&position);
1595 if (positionsInRange.empty())
1619 dist = objSize + (dist - objSize);
1626 static constexpr float DefaultTotemDistance = 3.0f;
1627 if (!spellEffectInfo.
HasRadius(targetIndex))
1628 dist = DefaultTotemDistance;
1656 "Spell::SelectImplicitTargetDestTargets - no explicit object target available!");
1673 float dist = spellEffectInfo.
CalcRadius(
nullptr, targetIndex).
Max;
1745 bool checkIfValid =
true;
1751 checkIfValid =
false;
1758 target = unitCaster->GetGuardianPet();
1762 if (unitCaster->IsSummon())
1763 target = unitCaster->ToTempSummon()->GetSummonerUnit();
1767 target = unitCaster->GetVehicleBase();
1778 if (vehicleBase->IsVehicle())
1783 if (!creatureCaster->GetTapList().empty())
1810 "Spell::SelectImplicitTargetObjectTargets - no explicit object or item target available!");
1842 if (effMask & (1 << k))
1846 std::list<WorldObject*> targets;
1855 for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
1872 if (x < 100000.0f && x > -100000.0f)
return x;
1873 if (x >= 100000.0f)
return 100000.0f;
1874 if (x <= 100000.0f)
return -100000.0f;
1891 std::list<WorldObject*> targets;
1894 SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellTrajTargetCheck> > (searcher,
GRID_MAP_TYPE_MASK_ALL,
m_caster, &srcPos, dist2d);
1895 if (targets.empty())
1901 float a = (srcToDestDelta - dist2d * b) / (dist2d * dist2d);
1909 bestDist = std::min(std::max(bestDist, triggerSpellInfo->GetMaxRange(
false)), std::min(dist2d, 300.0f));
1913 for (
auto itr = targets.begin(); itr != targets.end(); ++itr)
1920 if (unitCaster == *itr || unitCaster->
IsOnVehicle(unit) || unit->GetVehicle())
1930 float const size = std::max((*itr)->GetCombatReach(), 1.0f);
1932 float const dz = (*itr)->GetPositionZ() - srcPos.
m_positionZ;
1934 float const horizontalDistToTraj = std::fabs(objDist2d * std::sin(srcPos.
GetRelativeAngle(*itr)));
1935 float const sizeFactor = std::cos((horizontalDistToTraj / size) * (
M_PI / 2.0f));
1936 float const distToHitPoint = std::max(objDist2d * std::cos(srcPos.
GetRelativeAngle(*itr)) - size * sizeFactor, 0.0f);
1937 float const height = distToHitPoint * (a * distToHitPoint + b);
1942 if (distToHitPoint < bestDist)
1944 bestDist = distToHitPoint;
1949 if (dist2d > bestDist)
1966 std::list<WorldObject*> targets;
1985 ABORT_MSG(
"Spell::SelectImplicitLineTargets: received not implemented target reference type");
1996 SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellLineTargetCheck>>(searcher, containerTypeMask,
m_caster,
m_caster, radius.
Max);
2000 if (!targets.empty())
2005 if (maxTargets < targets.size())
2008 targets.resize(maxTargets);
2012 for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
2028 switch (spellEffectInfo.
Effect)
2049 Player* player = ObjectAccessor::GetPlayer(map, targetGuid);
2054 if (player->IsImmunedToSpellEffect(spell->GetSpellInfo(), spellEffectInfo, nullptr))
2057 spell->HandleEffects(player, nullptr, nullptr, nullptr, spellEffectInfo, SPELL_EFFECT_HANDLE_HIT_TARGET);
2089 target = corpseTarget;
2155 retMask &= ~GRID_MAP_TYPE_MASK_PLAYER;
2158 retMask &=
sConditionMgr->GetSearcherTypeMaskForConditionList(*condList);
2162template<
class SEARCHER>
2171 if (searchInGrid || searchInWorld)
2193 if (!containerTypeMask)
2207 if (!containerTypeMask)
2220 float jumpRadius = 0.0f;
2246 float searchRadius = [&]()
2254 return jumpRadius * chainTargets;
2258 std::list<WorldObject*> tempTargets;
2261 tempTargets.remove(target);
2273 while (chainTargets)
2276 std::list<WorldObject*>::iterator foundItr = tempTargets.end();
2281 for (std::list<WorldObject*>::iterator itr = tempTargets.begin(); itr != tempTargets.end(); ++itr)
2285 uint32 deficit = unit->GetMaxHealth() - unit->GetHealth();
2289 maxHPDeficit = deficit;
2297 for (std::list<WorldObject*>::iterator itr = tempTargets.begin(); itr != tempTargets.end(); ++itr)
2299 bool isBestDistanceMatch = foundItr != tempTargets.end() ? chainSource->
GetDistanceOrder(*itr, *foundItr) : chainSource->
IsWithinDist(*itr, jumpRadius);
2300 if (!isBestDistanceMatch)
2313 if (foundItr == tempTargets.end())
2317 chainSource = *foundItr;
2319 targets.push_back(*foundItr);
2320 tempTargets.erase(foundItr);
2441 if (!spellEffectInfo.IsEffect() || !
CheckEffectTarget(target, spellEffectInfo, losPosition))
2442 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2455 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2464 ihit->EffectMask |= effectMask;
2477 targetInfo.
IsCrit =
false;
2495 return (target.EffectMask & effectMask) != 0;
2502 missileSource = previousTarget;
2504 targetInfo.
TimeDelay += previousTargetItr->TimeDelay;
2561 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2574 ihit->EffectMask |= effectMask;
2614 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2625 ihit->EffectMask |= effectMask;
2641 if (!spellEffectInfo.IsEffect())
2642 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2655 ihit->EffectMask |= effectMask;
2700 if (uniqueTargetInfo.MissCondition ==
SPELL_MISS_NONE && uniqueTargetInfo.EffectMask & (1 << effect))
2702 if (uniqueTargetInfo.TargetGUID == target)
2724 return targetInfo.
EffectMask & (1 << effect);
2732 return targetInfo.
EffectMask & (1 << effect);
2740 return targetInfo.
EffectMask & (1 << effect);
2813 if (_spellHitTarget)
2829 if (_spellHitTarget)
2850 if (canEffectTrigger && !procAttacker && !procVictim)
2852 bool positive =
true;
2860 if (EffectMask && !(EffectMask & (1 << i)))
2876 bool hasHealing =
false;
2877 std::unique_ptr<DamageInfo> spellDamageInfo;
2878 std::unique_ptr<HealInfo> healInfo;
2894 spell->
m_healing = healInfo->GetEffectiveHeal();
2900 bool hasDamage =
false;
2930 damageInfo.
damage = victimCreature->CalculateDamageForSparring(damageInfo.
attacker, damageInfo.
damage);
2941 if (canEffectTrigger)
2949 if (!hasHealing && !hasDamage)
2955 if (canEffectTrigger)
2957 spellDamageInfo = std::make_unique<DamageInfo>(damageInfo,
NODAMAGE, spell->
m_attackType, ProcHitMask);
2974 if (canEffectTrigger)
3000 if (unitCaster->IsPlayer())
3001 targetCreature->SetTappedBy(unitCaster);
3013 if (_spellHitTarget)
3017 if (
CreatureAI* hitTargetAI = cHitTarget->AI())
3027 if (
AuraApplication* aurApp = HitAura->GetApplicationOfTarget(_spellHitTarget->GetGUID()))
3030 uint32 effMask = EffectMask & aurApp->GetEffectsToApply();
3032 if ((effMask & (1 << i)) && aurApp->HasEffect(i))
3033 effMask &= ~(1 << i);
3036 _spellHitTarget->_ApplyAura(aurApp, effMask);
3038 if (aurApp->IsNeedClientUpdate() && aurApp->GetRemoveMode() ==
AURA_REMOVE_NONE)
3040 aurApp->ClientUpdate(
false);
3041 _spellHitTarget->RemoveVisibleAuraUpdate(aurApp);
3112 if (creatureTarget->IsEvadingAttacks())
3150 playerOwner->SetContestedPvP();
3151 playerOwner->UpdatePvP(
true);
3193 if (origCaster == unit || !origCaster->
IsFriendlyTo(unit))
3198 if (hitInfo.
EffectMask & (1 << auraSpellEffect.EffectIndex) &&
3199 auraSpellEffect.IsUnitOwnedAuraEffect() &&
3232 bool refresh =
false;
3272 if (
int32 period = auraEff->GetPeriod())
3318 int32 _duration = 0;
3326 TC_LOG_DEBUG(
"spells",
"Spell {} triggered spell {} by SPELL_AURA_ADD_TARGET_TRIGGER aura",
m_spellInfo->
Id, i->triggeredSpell->Id);
3330 if (i->triggeredSpell->GetDuration() == -1)
3340 triggeredAur->SetDuration(_duration);
3351 for (std::vector<int32>::const_iterator i = spellTriggered->begin(); i != spellTriggered->end(); ++i)
3370 uint32 channelAuraMask = 0;
3373 channelAuraMask |= 1 << spellEffectInfo.EffectIndex;
3375 channelAuraMask &= channelTargetEffectMask;
3378 if (channelAuraMask)
3390 if (targetInfo.MissCondition ==
SPELL_MISS_NONE && (channelTargetEffectMask & targetInfo.EffectMask))
3396 unitCaster->RemoveChannelObject(targetInfo.TargetGUID);
3402 if (channelAuraMask & targetInfo.EffectMask)
3408 targetInfo.EffectMask &= ~aurApp->GetEffectMask();
3411 unitCaster->RemoveChannelObject(targetInfo.TargetGUID);
3418 unitCaster->RemoveChannelObject(targetInfo.TargetGUID);
3423 channelTargetEffectMask &= ~targetInfo.EffectMask;
3429 return channelTargetEffectMask == 0;
3455 if (triggeredByAura)
3487 int32 param1 = 0, param2 = 0;
3505 if (param1 || param2)
3546 return movementResult;
3594 unitCaster->SetCurrentCastSpell(
this);
3603 if (caster->IsAIEnabled())
3606 if (willCastDirectly)
3682 Spell* lastSpellMod =
nullptr;
3717 sScriptMgr->OnPlayerSpellCast(playerCaster,
this, skipCheck);
3724 for (
Unit* controlled : playerCaster->m_Controlled)
3726 if (
CreatureAI* controlledAI = cControlled->AI())
3727 controlledAI->OwnerAttacked(target);
3758 int32 param1 = 0, param2 = 0;
3762 cleanupSpell(castResult, ¶m1, ¶m2);
3774 if (!my_trade->IsInAcceptProcess())
3790 if (spellEffectInfo.IsUnitOwnedAuraEffect())
3791 aura_effmask |= 1 << spellEffectInfo.EffectIndex;
3802 if (target->HasStrongerAuraWithDR(
m_spellInfo, caster))
3815 if (!creatureCaster->GetTarget().IsEmpty() && !creatureCaster->HasUnitFlag(
UNIT_FLAG_POSSESSED))
3817 creatureCaster->SetInFront(target);
3839 pet->DespawnOrUnsummon();
3900 creatureCaster->ReleaseSpellFocus(
this);
3922 if (caster->IsAIEnabled())
3938 if (unitCaster->HasUnitState(
UNIT_STATE_CASTING) && !unitCaster->IsNonMeleeSpellCast(
false,
false,
true,
false,
true,
true))
3954 for (
int32 id : *spell_triggered)
3959 unitCaster->RemoveAurasDueToSpell(-
id);
3982template <
class Container>
3986 target.PreprocessTarget(
this);
3990 if (target.EffectMask & (1 << spellEffectInfo.EffectIndex))
3991 target.DoTargetSpellHit(
this, spellEffectInfo);
3994 target.DoDamageAndTriggers(
this);
4007 int32 originalDuration = duration;
4021 float ratio = float(duration) / float(originalDuration);
4024 for (std::size_t i = 0; i <
m_empower->StageDurations.size() - 1; ++i)
4027 totalExceptLastStage +=
m_empower->StageDurations[i];
4046 else if (duration == -1)
4098 bool ignoreTargetInfoTimeDelay = single_missile;
4104 if (launchMoment > t_offset)
4105 return launchMoment;
4113 ignoreTargetInfoTimeDelay =
false;
4131 std::vector<TargetInfo> delayedTargets;
4134 if (ignoreTargetInfoTimeDelay || target.TimeDelay <= t_offset)
4136 target.TimeDelay = t_offset;
4137 delayedTargets.emplace_back(std::move(target));
4140 else if (!single_missile && (next_time == 0 || target.
TimeDelay < next_time))
4151 std::vector<GOTargetInfo> delayedGOTargets;
4154 if (ignoreTargetInfoTimeDelay || goTarget.TimeDelay <= t_offset)
4156 goTarget.TimeDelay = t_offset;
4157 delayedGOTargets.emplace_back(std::move(goTarget));
4160 else if (!single_missile && (next_time == 0 || goTarget.TimeDelay < next_time))
4161 next_time = goTarget.TimeDelay;
4172 modOwner->SetSpellModTakingSpell(
this,
false);
4201 if (!spellEffectInfo.IsEffect())
4308 for (std::size_t i = 0; i <
m_empower->StageDurations.size(); ++i)
4315 return m_empower->StageDurations.size();
4318 if (completedStages !=
m_empower->CompletedStages)
4326 m_empower->CompletedStages = completedStages;
4328 unitCaster->SetSpellEmpowerStage(completedStages);
4349 if (creatureCaster->IsAIEnabled())
4350 creatureCaster->AI()->OnChannelFinished(
m_spellInfo);
4392 ((
Puppet*)charm)->UnSummon();
4396 creatureCaster->ReleaseSpellFocus(
this);
4457 packet.CastID = castId;
4458 packet.SpellID = spellInfo->
Id;
4459 packet.Reason = result;
4465 packet.FailedArg1 = *param1;
4467 packet.FailedArg1 = 0;
4471 packet.FailedArg1 = *param1;
4477 packet.FailedArg1 = *param1;
4481 switch (spellInfo->
Id)
4485 packet.FailedArg1 = 3905;
4489 packet.FailedArg1 = 3842;
4492 packet.FailedArg1 = 4075;
4495 packet.FailedArg1 = 0;
4503 packet.FailedArg1 = *param1;
4507 if (spellInfo->
Totem[0])
4508 packet.FailedArg1 = spellInfo->
Totem[0];
4509 else if (spellInfo->
Totem[1])
4510 packet.FailedArg1 = spellInfo->
Totem[1];
4516 packet.FailedArg1 = *param1;
4529 if (param1 && param2)
4531 packet.FailedArg1 = *param1;
4532 packet.FailedArg2 = *param2;
4542 packet.FailedArg1 = *param1;
4546 packet.FailedArg1 = *param1;
4550 packet.FailedArg1 = *param1;
4553 if (param1 && param2)
4555 packet.FailedArg1 = *param1;
4556 packet.FailedArg2 = *param2;
4560 if (param1 && param2)
4562 packet.FailedArg1 = *param1;
4563 packet.FailedArg2 = *param2;
4568 packet.FailedArg1 = *param1;
4571 packet.FailedArg1 = customError;
4575 packet.FailedArg1 = *param1;
4577 packet.FailedArg1 = 0;
4581 packet.FailedArg1 = *param1;
4586 packet.FailedArg1 = *param1;
4590 if constexpr (
requires { { packet.FailedBy } -> std::assignable_from<ObjectGuid>; })
4591 packet.FailedBy = failedBy;
4647 packet.
Visual = spellVisual;
4677 uint32 schoolImmunityMask = 0;
4678 uint32 mechanicImmunityMask = 0;
4681 schoolImmunityMask =
m_timer!= 0 ? unitCaster->GetSchoolImmunityMask() : 0;
4685 if (schoolImmunityMask || mechanicImmunityMask)
4748 float baseCd = float(player->GetRuneBaseCooldown());
4749 castData.
RemainingRunes->Cooldowns.push_back((baseCd -
float(player->GetRuneCooldown(i))) / baseCd * 255);
4874 if (targetInfo.EffectMask == 0)
4880 data.
HitTargets.push_back(targetInfo.TargetGUID);
4887 data.
MissTargets.push_back(targetInfo.TargetGUID);
4888 data.
MissStatus.emplace_back(targetInfo.MissCondition, targetInfo.ReflectResult);
4893 data.
HitTargets.push_back(targetInfo.TargetGUID);
4896 data.
HitTargets.push_back(targetInfo.TargetGUID);
4905 uint32 ammoInventoryType = 0;
4906 uint32 ammoDisplayID = 0;
4916 else if (playerCaster->HasAura(46699))
4918 ammoDisplayID = 5996;
4925 uint32 nonRangedAmmoDisplayID = 0;
4926 uint32 nonRangedAmmoInventoryType = 0;
4929 if (
uint32 item_id = unitCaster->GetVirtualItemId(i))
4935 switch (itemEntry->SubclassID)
4940 ammoDisplayID = itemAppearance->ItemDisplayInfoID;
4942 ammoInventoryType = itemEntry->InventoryType;
4946 ammoDisplayID = 5996;
4950 ammoDisplayID = 5998;
4956 nonRangedAmmoDisplayID = itemAppearance->ItemDisplayInfoID;
4958 nonRangedAmmoInventoryType = itemEntry->InventoryType;
4969 if (!ammoDisplayID && !ammoInventoryType)
4971 ammoDisplayID = nonRangedAmmoDisplayID;
4972 ammoInventoryType = nonRangedAmmoInventoryType;
4976 return ammoDisplayID;
4985 switch (spellEffectInfo.Effect)
4990 spellInfo, spellEffectInfo.CalcValue(unitCaster,
nullptr, target,
nullptr, castItemEntry, castItemLevel),
5004 switch (spellEffectInfo.ApplyAuraName)
5009 spellInfo, spellEffectInfo.CalcValue(unitCaster,
nullptr, target,
nullptr, castItemEntry, castItemLevel),
5010 DIRECT_DAMAGE, spellEffectInfo, 1, spell) * spellEffectInfo.GetPeriodicTickCount();
5014 points +=
CalcPredictedHealing(triggered, unitCaster, target, castItemEntry, castItemLevel,
nullptr, withPeriodic).first;
5022 return { points, type };
5028 healPrediction.
Points = 0;
5037 healPrediction.
Type = type;
5040 static constexpr uint32 beaconSpellId = 53651;
5046 return aura->GetSpellInfo()->GetEffects().size() > EFFECT_1 && aura->GetSpellInfo()->GetEffect(EFFECT_1).TriggerSpell == beaconSpellId;
5051 healPrediction.
BeaconGUID = (*beacon)->GetOwner()->GetGUID();
5077 return log.Effect == effect;
5092 spellLogEffectPowerDrainParams.
Points = points;
5093 spellLogEffectPowerDrainParams.
PowerType = powerType;
5094 spellLogEffectPowerDrainParams.
Amplitude = amplitude;
5102 spellLogEffectExtraAttacksParams.
Victim = victim->
GetGUID();
5103 spellLogEffectExtraAttacksParams.
NumAttacks = numAttacks;
5122 spellLogEffectDurabilityDamageParams.
Victim = victim->
GetGUID();
5123 spellLogEffectDurabilityDamageParams.
ItemID = itemId;
5124 spellLogEffectDurabilityDamageParams.
Amount = amount;
5140 spellLogEffectTradeSkillItemParams.
ItemID = entry;
5148 spellLogEffectFeedPetParams.
ItemID = entry;
5172 spellLogEffectGenericVictimParams.
Victim = target->
GetGUID();
5184 failurePacket.
Reason = result;
5193 failedPacket.
Reason = resultOther.value_or(result);
5220 spellEmpowerUpdate.
FailedBy = failedBy;
5224 spellEmpowerUpdate.
Status = 1;
5226 spellEmpowerUpdate.
Status = 4;
5235 spellChannelUpdate.
FailedBy = failedBy;
5251 uint32 channelAuraMask = 0;
5252 uint32 explicitTargetEffectMask = 0xFFFFFFFF;
5258 return target.TargetGUID == m_targets.GetUnitTargetGUID();
5261 explicitTargetEffectMask = explicitTargetItr->EffectMask;
5265 if (spellEffectInfo.IsEffect(
SPELL_EFFECT_APPLY_AURA) && (explicitTargetEffectMask & (1u << spellEffectInfo.EffectIndex)))
5266 channelAuraMask |= 1 << spellEffectInfo.EffectIndex;
5270 if (!(target.EffectMask & channelAuraMask))
5281 if (target.EffectMask & channelAuraMask)
5288 if (unitCaster->
m_unitData->ChannelObjects.size() == 1 && unitCaster->
m_unitData->ChannelObjects[0].IsUnit())
5289 if (!creatureCaster->HasSpellFocus(
this))
5301 if (schoolImmunityMask || mechanicImmunityMask)
5303 interruptImmunities.emplace();
5304 interruptImmunities->SchoolImmunities = schoolImmunityMask;
5305 interruptImmunities->Immunities = mechanicImmunityMask;
5310 healPrediction.emplace();
5311 if (unitCaster->
m_unitData->ChannelObjects.size() == 1 && unitCaster->
m_unitData->ChannelObjects[0].IsUnit())
5312 healPrediction->TargetGUID = unitCaster->
m_unitData->ChannelObjects[0];
5353 std::string sentName;
5364 resurrectRequest.
Name = sentName;
5368 if (
CharmInfo* charmInfo = pet->GetCharmInfo())
5369 resurrectRequest.
PetNumber = charmInfo->GetPetNumber();
5398 bool expendable =
false;
5399 bool withoutCharges =
false;
5406 if (itemEffect->Charges < 0)
5425 withoutCharges = (charges == 0);
5429 if (expendable && withoutCharges)
5478 if (cost.Amount < 0)
5502 unitCaster->
ModifyPower(cost.Power, -cost.Amount);
5549 return totalCost + (cost.Power == POWER_RUNES ? cost.Amount : 0);
5562 int32 readyRunes = 0;
5567 if (readyRunes < runeCost)
5586 return totalCost + (cost.Power == POWER_RUNES ? cost.Amount : 0);
5640 if (itemEffect->Charges < 0 && abs(charges) < 2)
5676 float threat = 0.0f;
5679 if (threatEntry->apPctMod != 0.0f)
5682 threat += threatEntry->flatMod;
5696 float threatToAdd = threat;
5733 if (!preventDefault)
5734 (this->*SpellEffectHandlers[spellEffectInfo.
Effect].
Value)();
5740 return spellEvent->GetSpell();
5847 bool checkForm =
true;
5896 bool hasInvalidMountAura = std::ranges::any_of(unitCaster->GetAuraEffectsByType(
SPELL_AURA_MOUNTED), [unitCaster](
AuraEffect const* mountEffect)
5898 uint32 mountType = mountEffect->GetSpellEffectInfo().MiscValueB;
5899 if (MountEntry const* mountEntry = sDB2Manager.GetMount(mountEffect->GetId()))
5900 mountType = mountEntry->MountTypeID;
5902 MountCapabilityEntry const* mountCapability = unitCaster->GetMountCapability(mountType);
5903 return !mountCapability || mountCapability->ID != uint32(mountEffect->GetAmount());
5906 if (!hasInvalidMountAura)
5916 return vehicleCheck;
5969 if (!unitCaster->IsFriendlyTo(auraEff->GetCaster()) && !target->HasAura(auraEff->GetId(), auraEff->GetCasterGUID()))
5973 if (!unitCaster->IsFriendlyTo(auraEff->GetCaster()) && !unitCaster->HasAura(auraEff->GetId(), auraEff->GetCasterGUID()))
5977 if (!target->HasAura(auraEff->GetId(), auraEff->GetCasterGUID()))
5981 if (!unitCaster->HasAura(auraEff->GetId(), auraEff->GetCasterGUID()))
6019 if (!unitCaster->GetPetGUID().IsEmpty())
6026 if (!unitCaster->GetGuardianPet())
6045 if (player->InArena())
6123 uint32 approximateAuraEffectMask = 0;
6124 uint32 nonAuraEffectMask = 0;
6128 switch (spellEffectInfo.Effect)
6135 if (!unit || !unit->
HasAura(17743))
6160 if (!learn_spellproto)
6191 if (!learn_spellproto)
6208 if (
uint32 glyphId = spellEffectInfo.MiscValue)
6211 if (!glyphProperties)
6214 std::vector<uint32>
const* glyphBindableSpells =
sDB2Manager.GetGlyphBindableSpells(glyphId);
6215 if (!glyphBindableSpells)
6221 if (std::vector<ChrSpecialization>
const* glyphRequiredSpecs =
sDB2Manager.GetGlyphRequiredSpecs(glyphId))
6230 uint32 replacedGlyph = 0;
6233 if (std::vector<uint32>
const* activeGlyphBindableSpells =
sDB2Manager.GetGlyphBindableSpells(activeGlyphId))
6237 replacedGlyph = activeGlyphId;
6245 if (activeGlyphId == replacedGlyph)
6248 if (activeGlyphId == glyphId)
6349 Item* pTempItem =
nullptr;
6374 lockId = go->GetGOInfo()->GetLockId();
6385 int32 reqSkillValue = 0;
6386 int32 skillValue = 0;
6410 return petInfo && !petInfo->Health;
6413 if (deadPetItr == petStable->
ActivePets.end())
6427 if (!SummonProperties)
6430 switch (SummonProperties->
Control)
6467 .SetOriginalCaster(pet->GetGUID())
6481 if (!spellEffectInfo.MiscValue)
6483 petSlot =
PetSaveMode(spellEffectInfo.CalcValueAsInt());
6488 if (activePet && !activePet->Health)
6506 if (creatureInfo && creatureInfo->
IsTameable(
true, creatureDifficulty))
6515 else if (!spellEffectInfo.MiscValue)
6557 uint32 mapId = map->GetId();
6558 Difficulty difficulty = map->GetDifficultyID();
6559 if (
InstanceLock const* mapLock = map->GetInstanceLock())
6692 if (!artifactEntry || artifactEntry->
ArtifactCategoryID != spellEffectInfo.MiscValue)
6721 if (
uint32 battlePetType = spellEffectInfo.MiscValue)
6722 if (!(battlePetType & (1 << battlePetSpecies->PetTypeEnum)))
6754 if (spellEffectInfo.IsAura())
6755 approximateAuraEffectMask |= 1 << spellEffectInfo.EffectIndex;
6756 else if (spellEffectInfo.IsEffect())
6757 nonAuraEffectMask |= 1 << spellEffectInfo.EffectIndex;
6762 switch (spellEffectInfo.ApplyAuraName)
6800 if (target->GetTypeId() ==
TYPEID_UNIT && target->IsVehicle())
6803 if (target->IsMounted())
6806 if (!target->GetCharmerGUID().IsEmpty())
6809 if (target->GetOwner() && target->GetOwner()->GetTypeId() ==
TYPEID_PLAYER)
6813 if (value && target->GetLevelForTarget(
m_caster) > value)
6860 if (spellEffectInfo.IsTargetingArea())
6880 && (approximateAuraEffectMask & (1 << spellEffectInfo.EffectIndex))
6883 if (!target->IsHighestExclusiveAuraEffect(
m_spellInfo, spellEffectInfo.ApplyAuraName,
6885 approximateAuraEffectMask,
false))
6925 if (!owner->IsAlive())
6940 if (!creatureCaster->GetSpellHistory()->IsReady(
m_spellInfo))
6981 bool foundNotMechanic =
false;
6985 uint64 const mechanicMask = aurEff->GetSpellInfo()->GetAllEffectsMechanicMask();
6986 if (mechanicMask && !(mechanicMask &
GetSpellInfo()->GetAllowedMechanicMask()))
6988 foundNotMechanic =
true;
6993 *param1 = aurEff->GetSpellEffectInfo().Mechanic;
6995 *param1 = aurEff->GetSpellInfo()->Mechanic;
7002 if (foundNotMechanic)
7024 if (usableWhileStunned)
7028 result = mechanicResult;
7033 result = mechanicResult;
7045 if (usableWhileFeared)
7049 result = mechanicResult;
7056 if (usableWhileConfused)
7060 result = mechanicResult;
7083 if (auraEffects.empty())
7093 *param1 = aurEff->GetSpellEffectInfo().Mechanic;
7095 *param1 = aurEff->GetSpellInfo()->Mechanic;
7146 bool isRatedBattleground =
false;
7147 bool isArena = !isRatedBattleground;
7182 if (!unitCaster->CanCastSpellWhileMoving(
m_spellInfo))
7219 if (!spellEffectInfo.IsAura())
7222 AuraType const& auraType = spellEffectInfo.ApplyAuraName;
7224 for (Unit::AuraEffectList::const_iterator auraIt = auras.begin(); auraIt != auras.end(); ++auraIt)
7234 if (
GetCaster() == (*auraIt)->GetCaster())
7239 if (abs(spellEffectInfo.CalcBaseValue(
m_caster, target, 0, -1)) <= abs((*auraIt)->GetAmount()))
7258 if (ihit->TargetGUID == targetguid)
7290 minRange *= minRange;
7291 maxRange *= maxRange;
7334 float rangeMod = 0.0f;
7339 range = { .
Min = 0.0f, .Max = 100.0f };
7351 rangeMod = unitCaster->
GetMeleeRange(target ? target : unitCaster);
7355 float meleeRange = 0.0f;
7360 meleeRange = unitCaster->
GetMeleeRange(target ? target : unitCaster);
7364 range.
Min += meleeRange;
7371 range.
Min += rangeMod;
7377 rangeMod += 8.0f / 3.0f;
7382 range.
Max *= ranged->GetTemplate()->GetRangedModRange() * 0.01f;
7387 range.
Max += rangeMod;
7414 TC_LOG_ERROR(
"spells",
"Spell::CheckPower: Unknown power type '{}'", cost.Power);
7489 if (spellEffectInfo.MiscValue < 0 || spellEffectInfo.MiscValue >=
int8(
MAX_POWERS))
7538 if (targetItem->GetOwnerGUID() != player->
GetGUID())
7539 checkReagents =
true;
7563 if (itemEffect->Charges < 0 && abs(charges) < 2)
7580 if (!player->
HasCurrency(reagentsCurrency->CurrencyTypesID, reagentsCurrency->CurrencyCount))
7586 *param2 = reagentsCurrency->CurrencyTypesID;
7612 *param1 = totemCategory;
7622 switch (spellEffectInfo.Effect)
7640 if (spellEffectInfo.ItemType)
7646 uint32 createCount = std::clamp<uint32>(spellEffectInfo.CalcValueAsInt(), 1u, itemTemplate->
GetMaxStackSize());
7654 player->
SendEquipError(msg,
nullptr,
nullptr, spellEffectInfo.ItemType);
7664 player->
SendEquipError(msg,
nullptr,
nullptr, spellEffectInfo.ItemType);
7669 .SetTriggeringSpell(
this));
7691 player->
SendEquipError(msg,
nullptr,
nullptr, spellEffectInfo.ItemType);
7709 if (requiredLevel < m_spellInfo->BaseLevel)
7716 bool isItemUsable =
false;
7721 isItemUsable =
true;
7732 switch (enchantEntry->
Effect[s])
7754 if (targetItem->
GetOwner() != player)
7771 uint32 enchant_id = spellEffectInfo.MiscValue;
7786 if (requiredLevel < m_spellInfo->BaseLevel)
7811 if (!disenchantSkillRequired)
7835 if (param1 && param2)
7866 if (param1 && param2)
7910 uint32 itemId = spellEffectInfo.ItemType;
7918 if (itemEffect->Charges != 0 && item->GetSpellCharges(itemEffect) == itemEffect->Charges)
7932 if (!azeriteEmpoweredItem)
7935 bool hasSelections =
false;
7940 hasSelections =
true;
7980 return mainHandResult;
7987 return offHandResult;
8004 int32 delaytime = 500;
8006 float delayReduce = 100.0f;
8010 if (delayReduce >= 100)
8013 AddPct(delaytime, -delayReduce);
8048 float delayReduce = 100.0f;
8052 if (delayReduce >= 100)
8055 AddPct(delaytime, -delayReduce);
8070 Unit* unit = unitCaster;
8071 if (unitCaster->
GetGUID() != targetInfo.TargetGUID)
8083 dynObj->Delay(delaytime);
8205 if (!gobCaster->GetGOInfo()->GetRequireLOS())
8214 switch (spellEffectInfo.
Effect)
8267 switch (spellEffectInfo.
Effect)
8331 m_empower->IsReleasedByClient = release;
8343 return passedTime >=
m_empower->MinHoldTime;
8372 TC_LOG_ERROR(
"spells",
"~SpellEvent: {} {} tried to delete non-deletable spell {}. Was not deleted, causes memory leak.",
8499 if (!spellEffectInfo.IsEffect())
8512 float multiplier = 1.0f;
8518 uint32 mask = target.EffectMask;
8519 if (!(mask & (1 << spellEffectInfo.EffectIndex)))
8543 Unit* unit =
nullptr;
8571 Unit* unit =
nullptr;
8670 bool reqKey =
false;
8674 switch (lockInfo->
Type[j])
8695 reqSkillValue = lockInfo->
Skill[j];
8702 skillValue = unitCaster->
GetLevel() * 5;
8709 if (skillValue < reqSkillValue)
8783 TC_LOG_DEBUG(
"spells",
"Spell::LoadScripts: Script `{}` for spell `{}` is loaded now", script->GetScriptName(),
m_spellInfo->
Id);
8793 script->OnPrecast();
8794 script->_FinishScriptCall();
8804 beforeCast.Call(script);
8806 script->_FinishScriptCall();
8816 onCast.Call(script);
8818 script->_FinishScriptCall();
8828 afterCast.Call(script);
8830 script->_FinishScriptCall();
8844 retVal = tempResult;
8847 script->_FinishScriptCall();
8857 castTime = script->CalcCastTime(castTime);
8858 script->_FinishScriptCall();
8866 bool preventDefault =
false;
8895 script->_PrepareScriptCall(hookType);
8898 if (!script->_IsEffectPrevented(effIndex) && effectHandler.IsEffectAffected(
m_spellInfo, effIndex))
8899 effectHandler.Call(script, effIndex);
8901 if (!preventDefault)
8902 preventDefault = script->_IsDefaultEffectPrevented(effIndex);
8904 script->_FinishScriptCall();
8906 return preventDefault;
8915 onDispel.Call(script, effIndex);
8917 script->_FinishScriptCall();
8928 beforeHit.Call(script, missInfo);
8930 script->_FinishScriptCall();
8942 script->_FinishScriptCall();
8952 afterHit.Call(script);
8954 script->_FinishScriptCall();
8964 calcCritChance.Call(script, victim, critChance);
8966 script->_FinishScriptCall();
8976 calcDamage.Call(script, spellEffectInfo, victim, damage, flatMod, pctMod);
8978 script->_FinishScriptCall();
8988 calcHealing.Call(script, spellEffectInfo, victim, healing, flatMod, pctMod);
8990 script->_FinishScriptCall();
9000 if (objectAreaTargetSelect.IsEffectAffected(
m_spellInfo, effIndex) && targetType.
GetTarget() == objectAreaTargetSelect.GetTarget())
9001 objectAreaTargetSelect.Call(script, targets);
9003 script->_FinishScriptCall();
9013 if (objectTargetSelect.IsEffectAffected(
m_spellInfo, effIndex) && targetType.
GetTarget() == objectTargetSelect.GetTarget())
9014 objectTargetSelect.Call(script, target);
9016 script->_FinishScriptCall();
9026 if (destinationTargetSelect.IsEffectAffected(
m_spellInfo, effIndex) && targetType.
GetTarget() == destinationTargetSelect.GetTarget())
9027 destinationTargetSelect.Call(script, target);
9029 script->_FinishScriptCall();
9039 calculateResistAbsorb.Call(script, damageInfo, resistAmount, absorbAmount);
9041 script->_FinishScriptCall();
9051 empowerStageCompleted.Call(script, completedStagesCount);
9053 script->_FinishScriptCall();
9063 empowerStageCompleted.Call(script, completedStagesCount);
9065 script->_FinishScriptCall();
9073 for (HookType
const& hook : hooks)
9075 if (!hook.IsEffectAffected(spellInfo, effIndex))
9078 bool otherEffectHasSameTargetFunction = std::ranges::any_of(hooks, [&](HookType
const& other)
9080 return other.IsEffectAffected(spellInfo, effIndexToCheck) && hook.HasSameTargetFunctionAs(other);
9082 if (!otherEffectHasSameTargetFunction)
9091 if (!allEffectTargetScriptsAreShared(script->OnObjectTargetSelect,
m_spellInfo, effIndex, effIndexToCheck))
9094 if (!allEffectTargetScriptsAreShared(script->OnObjectTargetSelect,
m_spellInfo, effIndexToCheck, effIndex))
9097 if (!allEffectTargetScriptsAreShared(script->OnObjectAreaTargetSelect,
m_spellInfo, effIndex, effIndexToCheck))
9100 if (!allEffectTargetScriptsAreShared(script->OnObjectAreaTargetSelect,
m_spellInfo, effIndexToCheck, effIndex))
9108 auto itr = std::ranges::find(
m_loadedScripts, type, [](
SpellScript* script) -> std::type_info
const& {
return typeid(*script); });
9141 for (
AuraEffect const* aurEff : targetTriggers)
9152 int32 chance = aurEff->GetSpellEffectInfo().CalcValueAsInt(unitCaster, &auraBaseAmount);
9153 chance *= aurEff->GetBase()->GetStackAmount();
9198 if (gcd >= MinGCD && gcd <= MaxGCD)
9203 int32 intGcd = gcd.count();
9247 std::stringstream sstr;
9248 sstr << std::boolalpha
9270 WorldObject const* src = targetAsSourceLocation ? target : source;
9271 WorldObject const* dst = targetAsSourceLocation ? source : target;
9299 _targetSelectionType(selectionType), _condSrcInfo(nullptr), _condList(condList), _objectType(objectType)
9302 _condSrcInfo = std::make_unique<ConditionSourceInfo>(
nullptr, caster);
9403 :
WorldObjectSpellTargetCheck(caster, caster, spellInfo, selectionType, condList, objectType), _range(range), _position(caster) { }
9408 if (dist <
_range && WorldObjectSpellTargetCheck::operator ()(target))
9419 :
WorldObjectSpellTargetCheck(caster, referer, spellInfo, selectionType, condList, objectType), _range(range), _position(position), _searchReason(searchReason) { }
9434 if (!isInsideCylinder)
9460 :
WorldObjectSpellAreaTargetCheck(range, caster, caster, caster, spellInfo, selectionType, condList, objectType), _coneSrc(coneSrc), _coneAngle(coneAngle), _lineWidth(lineWidth) { }
9486 :
WorldObjectSpellTargetCheck(caster, caster, spellInfo, selectionType, condList, objectType), _range(range), _position(position) { }
9502 :
WorldObjectSpellAreaTargetCheck(range, caster, caster, caster, spellInfo, selectionType, condList, objectType), _position(*srcPosition), _lineWidth(lineWidth)
9504 if (dstPosition && *srcPosition != *dstPosition)
9518 if (targets.size() <= maxTargets)
9540 std::array<std::ptrdiff_t, 1 << END> countsByPriority = {};
9541 std::vector<std::pair<WorldObject*, int32>> tempTargets(targets.size());
9544 std::ranges::transform(targets, tempTargets.begin(), [&](
WorldObject* target)
9546 int32 negativePoints = 0;
9547 if (prioritizeGroupMembersOf && (!target->IsUnit() || !target->ToUnit()->IsInRaidWith(prioritizeGroupMembersOf)))
9548 negativePoints |= 1 << NOT_GROUPED;
9550 if (prioritizePlayers && !target->IsPlayer() && (!target->IsCreature() || !target->ToCreature()->IsTreatedAsRaidUnit()))
9551 negativePoints |= 1 << NOT_PLAYER;
9553 if (!target->IsUnit() || target->ToUnit()->IsFullHealth())
9554 negativePoints |= 1 << NOT_INJURED;
9556 ++countsByPriority[negativePoints];
9557 return std::make_pair(target, negativePoints);
9560 std::ranges::sort(tempTargets, {}, Trinity::TupleElement<1>);
9562 std::size_t foundTargets = 0;
9563 for (std::ptrdiff_t countForPriority : countsByPriority)
9565 if (foundTargets + countForPriority >= maxTargets)
9574 foundTargets += countForPriority;
9577 targets.resize(maxTargets);
9578 std::ranges::transform(tempTargets.begin(), tempTargets.begin() + maxTargets, targets.begin(), Trinity::TupleElement<0>);
9583 if (targets.size() <= maxTargets)
9586 std::vector<std::pair<WorldObject*, int32>> prioritizedTargets(targets.size());
9589 std::ranges::transform(targets, prioritizedTargets.begin(), [&](
WorldObject* target)
9592 for (std::size_t i = 0; i < rules.size(); ++i)
9593 if (rules[i].Rule(target))
9594 score |= 1 << (rules.size() - 1 - i);
9596 return std::make_pair(target, score);
9600 std::ranges::sort(prioritizedTargets, std::ranges::greater(), Trinity::TupleElement<1>);
9602 int32 tieScore = prioritizedTargets[maxTargets - 1].second;
9605 if (prioritizedTargets[maxTargets].second == tieScore)
9607 auto toShuffle = std::equal_range(prioritizedTargets.begin(), prioritizedTargets.end(), std::pair<WorldObject*, int32>(
nullptr, tieScore),
9608 [](std::pair<WorldObject*, int32>
const& target1, std::pair<WorldObject*, int32>
const& target2) { return target1.second > target2.second; });
9614 targets.resize(maxTargets);
9615 std::ranges::transform(prioritizedTargets.begin(), prioritizedTargets.begin() + maxTargets, targets.begin(), Trinity::TupleElement<0>);
9626 Targets->SetUnitTarget(unitTarget);
9631 Targets->SetGOTarget(goTarget);
9649 if (triggeringSpell)
9669 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)
DB2Storage< ItemAppearanceEntry > sItemAppearanceStore("ItemAppearance.db2", &ItemAppearanceLoadInfo::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
@ 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)
@ MOVEMENTFLAG_STRAFE_LEFT
@ MOVEMENTFLAG_STRAFE_RIGHT
#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(float chance, PseudoRandomDistributionState &state)
@ 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
@ 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
#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
@ 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_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_INTERRUPTED_COMBAT
@ 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_TARGET_AURASTATE
@ 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_REFLECT_SPELLS
@ 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_ALL_TARGETING
@ SPELL_AURA_INTERFERE_ENEMY_TARGETING
@ SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ SPELLVALUE_PARENT_SPELL_TARGET_COUNT
@ SPELLVALUE_PARENT_SPELL_TARGET_INDEX
double SpellEffectValue
This is a double instead of float to be able to store full range of int32.
@ TARGET_FLAG_CORPSE_ALLY
@ TARGET_FLAG_UNIT_MINIPET
@ TARGET_FLAG_UNIT_PASSENGER
@ 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_SUPPRESS_CASTER_ANIM
Will not play cast animations on caster.
@ 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
@ SPELLVALUE_BASE_POINT_END
@ 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)
static std::pair< SpellEffectValue, SpellHealPredictionType > CalcPredictedHealing(SpellInfo const *spellInfo, Unit const *unitCaster, Unit *target, uint32 castItemEntry, int32 castItemLevel, Spell *spell, bool withPeriodic)
void FillSpellCastFailedArgs(T &packet, ObjectGuid castId, SpellInfo const *spellInfo, SpellCastResult result, SpellCustomErrors customError, int32 *param1, int32 *param2, ObjectGuid const &failedBy)
NonDefaultConstructible< SpellEffectHandlerFn > SpellEffectHandlers[TOTAL_SPELL_EFFECTS]
#define SPELL_EMPOWER_HARDCODED_GCD
@ SPELL_CAST_SOURCE_NORMAL
#define MAX_SPELL_RANGE_TOLERANCE
@ CAST_FLAG_EX_SUPPRESS_CASTER_ANIM
@ CAST_FLAG_EX_DONT_CONSUME_CHARGES
@ 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
@ 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)
#define VMAP_INVALID_HEIGHT_VALUE
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
ObjectGuid const & GetGUID() 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)
bool HasCorpseFlag(CorpseFlags flags) const
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
GameObject * ToGameObject()
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 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
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
SpellEffectValue CalcValue(WorldObject const *caster=nullptr, SpellEffectValue 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
bool IsAreaAuraEffect() const
std::shared_ptr< std::vector< Condition > > ImplicitTargetConditions
bool IsTargetingArea() const
SpellEffectImplicitTargetTypes GetImplicitTargetType() const
int32 CalcValueAsInt(WorldObject const *caster=nullptr, SpellEffectValue const *basePoints=nullptr, Unit const *target=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
SpellRange CalcRadius(WorldObject const *caster=nullptr, SpellTargetIndex targetIndex=SpellTargetIndex::TargetA, Spell *spell=nullptr) 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
void HandleCooldowns(SpellInfo const *spellInfo, uint32 itemId, Spell *spell=nullptr)
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)
bool HasCooldownOnHold(uint32 spellId) const
void CancelGlobalCooldown(SpellInfo const *spellInfo)
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
std::array< int32, MAX_SPELL_REAGENTS > Reagent
SpellRange GetMinMaxRange(bool positive=false, WorldObject const *caster=nullptr, Spell *spell=nullptr) const
Optional< SpellPowerCost > CalcPowerCost(Powers powerType, bool optionalCost, WorldObject const *caster, SpellSchoolMask schoolMask, Spell *spell=nullptr) const
float GetMaxRange(bool positive=false, WorldObject const *caster=nullptr, Spell *spell=nullptr) const
SpellCastResult CheckShapeshift(uint32 form) const
std::array< uint16, MAX_SPELL_TOTEMS > TotemCategory
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
uint32 ExcludeCasterAuraState
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
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
struct SpellInfo::@328 SqrtDamageAndHealingDiminishing
bool HasEffect(SpellEffects effect) const
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
SpellState getState() const
SpellScript * GetScriptByType(std::type_info const &type) const
SpellInfo const * GetSpellInfo() const
float m_damageMultipliers[MAX_SPELL_EFFECTS]
SpellCastResult CheckItems(int32 *param1, int32 *param2) const
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
void SendInterrupted(SpellCastResult result, Optional< SpellCastResult > resultOther={}, ObjectGuid const &failedBy=ObjectGuid::Empty)
GameObject * gameObjTarget
void PrepareTriggersExecutedOnHit()
SpellMissInfo targetMissInfo
bool m_referencedFromCurrentSpell
void ExecuteLogEffectTakeTargetPower(SpellEffects effect, Unit *target, Powers powerType, uint32 points, float amplitude)
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)
uint32 m_channelTargetEffectMask
void cast(bool skipCheck=false)
void SendChannelStart(uint32 duration)
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)
SpellCastResult CheckRuneCost() const
void ExecuteLogEffectExtraAttacks(SpellEffects effect, Unit *victim, uint32 numAttacks)
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()
SpellEffectHandleMode effectHandleMode
bool IsValidDeadOrAliveTarget(Unit const *target) const
SpellCastResult CheckMovement() const
std::unique_ptr< EmpowerData > m_empower
void DoProcessTargetContainer(Container &targetContainer)
void ExecuteLogEffectDurabilityDamage(SpellEffects effect, Unit *victim, int32 itemId, int32 amount)
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::pair< ProcFlagsInit, ProcFlagsInit > FinalizeDataForTriggerSystem(bool positive) const
std::vector< TargetInfo > m_UniqueTargetInfo
SpellDestination m_destTargets[MAX_SPELL_EFFECTS]
void ExecuteLogEffectCreateItem(SpellEffects effect, uint32 entry)
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)
void SearchAreaTargets(std::list< WorldObject * > &targets, SpellEffectInfo const &spellEffectInfo, SpellRange range, Position const *position, WorldObject *referer, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectionType, ConditionContainer const *condList, Trinity::WorldObjectSpellAreaTargetSearchReason searchReason)
ProcFlagsSpellType m_procSpellType
void cancel(SpellCastResult result=SPELL_FAILED_INTERRUPTED, Optional< SpellCastResult > resultOther={}, ObjectGuid const &failedBy=ObjectGuid::Empty)
WeaponAttackType m_attackType
void _cast(bool skipCheck=false)
bool IsProcDisabled() const
SpellEffectValue CalculateDamage(SpellEffectInfo const &spellEffectInfo, Unit const *target, float *var=nullptr) 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 ExecuteLogEffectOpenLock(SpellEffects effect, Object *obj)
void SendMountResult(MountResult result)
void AddGOTarget(GameObject *target, uint32 effectMask)
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
SpellEffectValue effectValue
void CallScriptOnCastHandlers()
void AddDestTarget(SpellDestination const &dest, uint32 effIndex)
int64 GetGameObjectTargetCountForEffect(SpellEffIndex effect) const
void SetEmpowerReleasedByClient(bool release)
void SendChannelUpdate(uint32 time, Optional< SpellCastResult > result={}, ObjectGuid const &failedBy=ObjectGuid::Empty)
void SelectImplicitCasterObjectTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, uint32 effMask)
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 ExecuteLogEffectDestroyItem(SpellEffects effect, uint32 entry)
void DoSpellEffectHit(Unit *unit, SpellEffectInfo const &spellEffectInfo, TargetInfo &targetInfo)
HitTriggerSpellList m_hitTriggerSpells
void ExecuteLogEffectSummonObject(SpellEffects effect, WorldObject *obj)
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 SelectImplicitChannelTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, uint32 effMask)
void SelectSpellTargets()
SpellRange GetMinMaxRange(bool strict) const
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(SpellEffects effect)
void SelectImplicitChainTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, WorldObject *target, uint32 effMask)
int32 CallScriptCalcCastTimeHandlers(int32 originalCastTime)
SpellCastResult CallScriptCheckCastHandlers()
void CallScriptCalcHealingHandlers(SpellEffectInfo const &spellEffectInfo, Unit *victim, int32 &healing, int32 &flatMod, float &pctMod)
std::vector< T > & GetExecuteLogEffectTargets(SpellEffects effect, Optional< std::vector< T > > SpellLogEffect::*member)
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 SetReferencedFromCurrent(bool yes)
void SelectEffectTypeImplicitTargets(SpellEffectInfo const &spellEffectInfo)
static void SendCastResult(Player const *caster, SpellInfo const *spellInfo, SpellCastVisual spellVisual, ObjectGuid cast_count, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE, int32 *param1=nullptr, int32 *param2=nullptr)
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
void CallScriptEmpowerCompletedHandlers(int32 completedStagesCount)
void CallScriptCalcCritChanceHandlers(Unit const *victim, float &chance)
ObjectGuid m_focusObjectGUID
SpellValue *const m_spellValue
Scripting::v2::ActionResultSetter< SpellCastResult > m_scriptResult
void finish(SpellCastResult result=SPELL_CAST_OK)
bool CheckEffectTarget(Unit const *target, SpellEffectInfo const &spellEffectInfo, Position const *losPosition) const
void SendResurrectRequest(Player *target)
void SelectEffectImplicitTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, SpellTargetIndex targetIndex, uint32 effectMask)
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
void ExecuteLogEffectUnsummonObject(SpellEffects effect, WorldObject *obj)
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.
void ExecuteLogEffectResurrect(SpellEffects effect, Unit *target)
SpellInfo const *const m_spellInfo
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 SelectImplicitTargetObjectTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, uint32 effMask)
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.
Specialized variant of std::shared_ptr that enforces unique ownership and/or std::unique_ptr with std...
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
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true, bool skipChanneledAllowingActions=false) 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)
void DelayOwnedAuras(uint32 spellId, ObjectGuid caster, int32 delaytime)
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)
void StopMoving(bool force=false)
std::forward_list< AuraEffect * > AuraEffectList
bool IsInDisallowedMountForm() const
void DealSpellDamage(SpellNonMeleeDamage const *damageInfo, bool durabilityLoss)
bool haveOffhandWeapon() const
MotionMaster * GetMotionMaster()
Powers GetPowerType() const
bool HasUnitFlag(UnitFlags flags) const
ObjectGuid GetCharmedGUID() 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)
GameObject * GetGameObject(uint32 spellId) const
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage const *log)
bool IsStandState() const
bool IsSilenced(SpellSchoolMask schoolMask) const
TempSummon * ToTempSummon()
CharmInfo * GetCharmInfo()
ObjectGuid GetCharmerOrOwnerGUID() const override
Unit * GetMeleeHitRedirectTarget(Unit *victim, SpellInfo const *spellInfo=nullptr)
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
void SetChannelSpellData(uint32 startTimeMs, uint32 durationMs)
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
void RemoveDynObject(uint32 spellId)
AttackerSet const & getAttackers() const
void SetSpellEmpowerStage(int8 stage)
float GetTotalAuraModifier(AuraType auraType) const
bool HasAuraType(AuraType auraType) const
void EngageWithTarget(Unit *who)
bool IsImmunedToSpell(SpellInfo const *spellInfo, uint32 effectMask, WorldObject const *caster, bool requireImmunityPurgesEffectAttribute=false) const
uint8 GetLevelForTarget(WorldObject const *) const override
void RemoveAurasWithInterruptFlags(InterruptFlags flag, SpellInfo const *source=nullptr)
void RemoveAppliedAuras(std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
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 HasUnitMovementFlag(MovementFlags f) 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
static VMapManager * createOrGetVMapManager()
bool isLineOfSightCalcEnabled() const
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
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
bool IsInRange2d(Position const *pos, float minRange, float maxRange) 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
SpellMissInfo SpellHitResult(Unit *victim, SpellInfo const *spellInfo, bool canReflect, bool canImmune) const
int32 ModSpellDuration(SpellInfo const *spellInfo, WorldObject const *target, int32 duration, bool positive, uint32 effectMask) const
std::string GetNameForLocaleIdx(LocaleConstant) const override
SpellRange GetSpellMinMaxRangeForTarget(Unit const *target, SpellInfo const *spellInfo) 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
bool IsInRange3d(Position const *pos, float minRange, float maxRange) const
virtual uint32 GetCastSpellXSpellVisualId(SpellInfo const *spellInfo) const
float GetDistance(WorldObject const *obj) const
MovementInfo m_movementInfo
void GetZoneAndAreaId(uint32 &zoneid, uint32 &areaid) 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
ObjectGuid FailedBy
Unit that caused the spell to fail, set for SPELL_FAILED_INTERRUPTED_COMBAT.
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
ObjectGuid FailedBy
Unit that caused the spell to fail, set for SPELL_FAILED_INTERRUPTED_COMBAT.
std::vector< Duration< Milliseconds, uint32 > > StageDurations
Duration< Milliseconds, int32 > TimeRemaining
WorldPacket const * Write() override
ObjectGuid FailedBy
Unit that caused the spell to fail, set for SPELL_FAILED_INTERRUPTED_COMBAT.
WorldPacket const * Write() override
ObjectGuid FailedBy
Unit that caused the spell to fail, set for SPELL_FAILED_INTERRUPTED_COMBAT.
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 Corpse * GetCorpse(WorldObject const &u, ObjectGuid const &guid)
TC_GAME_API Creature * GetCreatureOrPetOrVehicle(WorldObject const &, ObjectGuid const &)
ItemModifiedAppearanceEntry const * GetItemModifiedAppearance(uint32 itemId, uint32 appearanceModId)
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)
void SortTargetsWithPriorityRules(std::list< WorldObject * > &targets, size_t maxTargets, std::span< TargetPriorityRule const > rules)
struct advstd::ranges::Contains contains
AuraCreateInfo & SetSpellVisual(SpellCastVisual const &spellVisual)
AuraCreateInfo & SetCastItem(ObjectGuid const &guid, uint32 itemId, int32 itemLevel)
AuraCreateInfo & SetCasterGUID(ObjectGuid const &guid)
AuraCreateInfo & SetBaseAmount(SpellEffectValue const *bp)
AuraCreateInfo & SetIsRefresh(bool *isRefresh)
AuraCreateInfo & SetOwnerEffectMask(uint32 effMask)
AuraCreateInfo & SetStackAmount(int32 stackAmount)
AuraCreateInfo & SetPeriodicReset(bool reset)
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius)
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius)
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
MovementFlags 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
Position GetPositionOffsetTo(Position const &endPos) 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 GetPosition(float &x, float &y) const
constexpr void Relocate(float x, float y)
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
uint32 CustomBasePointsMask
uint32 MaxAffectedTargets
Optional< int32 > ParentSpellTargetCount
SpellEffectValue EffectBasePoints[MAX_SPELL_EFFECTS]
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
SpellEffectValue AuraBasePoints[MAX_SPELL_EFFECTS]
void DoTargetSpellHit(Spell *spell, SpellEffectInfo const &spellEffectInfo) override
void DoDamageAndTriggers(Spell *spell) override
SpellMissInfo ReflectResult
WorldObjectSpellAreaTargetSearchReason _searchReason
bool operator()(WorldObject *target) const
Position const * _position
WorldObjectSpellAreaTargetCheck(SpellRange range, Position const *position, WorldObject *caster, WorldObject *referer, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer const *condList, SpellTargetObjectTypes objectType, WorldObjectSpellAreaTargetSearchReason searchReason=WorldObjectSpellAreaTargetSearchReason::Area)
bool operator()(WorldObject *target) const
WorldObjectSpellConeTargetCheck(Position const &coneSrc, float coneAngle, float lineWidth, SpellRange range, WorldObject *caster, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer const *condList, SpellTargetObjectTypes objectType)
WorldObjectSpellLineTargetCheck(Position const *srcPosition, Position const *dstPosition, float lineWidth, SpellRange 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