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 processedAreaEffectsMask = 0;
731 if (!spellEffectInfo.IsEffect())
761 bool noTargetFound = std::ranges::none_of(
m_UniqueTargetInfo, [effectMask = 1u << spellEffectInfo.EffectIndex](
TargetInfo const& target)
763 return target.EffectMask & effectMask;
785 uint32 mask = (1 << spellEffectInfo.EffectIndex);
788 if (ihit->EffectMask & mask)
804 if (!anyNonImmuneTargetFound)
850 return uint64(std::floor(launchDelay * 1000.0f));
873 return targetInfo.TargetGUID == unit->GetGUID();
876 uint64 oldDelay = itr->TimeDelay;
877 itr->TimeDelay = hitDelay;
886 return itr.TimeDelay && itr.TimeDelay < smallest.TimeDelay;
912 if (effectMask & processedEffectMask)
918 if (effects[j].IsEffect() &&
927 effectMask |= 1 << j;
930 processedEffectMask |= effectMask;
970 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT_SRC");
987 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT_DEST");
1001 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT");
1011 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target category");
1020 ABORT_MSG(
"Spell::SelectImplicitChannelTargets: received not implemented target reference type");
1025 if (!channeledSpell)
1072 ABORT_MSG(
"Spell::SelectImplicitChannelTargets: received not implemented target type");
1081 ABORT_MSG(
"Spell::SelectImplicitNearbyTargets: received not implemented target reference type");
1102 ABORT_MSG(
"Spell::SelectImplicitNearbyTargets: received not implemented selection check type");
1111 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));
1152 dest = st->GetPosition();
1156 if (randomRadius > 0.0f)
1172 float randomRadius = 0.0f;
1212 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);
1223 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);
1234 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);
1243 if (randomRadius > 0.0f)
1254 ABORT_MSG(
"Spell::SelectImplicitNearbyTargets: received not implemented target object type");
1265 ABORT_MSG(
"Spell::SelectImplicitConeTargets: received not implemented target reference type");
1273 if (coneAngle == 0.0f)
1280 std::list<WorldObject*> targets;
1291 SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellConeTargetCheck> >(searcher, containerTypeMask,
m_caster,
m_caster, radius.
Max + extraSearchRadius);
1295 if (!targets.empty())
1334 if (ihit->EffectMask & (1 << spellEffectInfo.
EffectIndex))
1343 ABORT_MSG(
"Spell::SelectImplicitAreaTargets: received not implemented target reference type");
1365 ABORT_MSG(
"Spell::SelectImplicitAreaTargets: received not implemented target reference type");
1370 std::list<WorldObject*> targets;
1376 if (
Vehicle const* vehicleKit = unit->GetVehicleKit())
1378 if (
Unit* passenger = vehicleKit->GetPassenger(seat))
1379 targets.push_back(passenger);
1398 for (
ThreatReference const* threatRef : unit->GetThreatManager().GetUnsortedThreatList())
1400 targets.push_back(threateningUnit);
1404 for (
ObjectGuid const& tapperGuid : creature->GetTapList())
1406 targets.push_back(tapper);
1430 if (!targets.empty())
1437 else if (targets.size() > maxTargets)
1438 targets.resize(maxTargets);
1472 dest = st->GetPosition();
1484 float dist =
frand(minDist, maxDist);
1486 float angle =
rand_norm() *
static_cast<float>(
M_PI * 35.0f / 180.0f) -
static_cast<float>(
M_PI * 17.5f / 180.0f);
1493 liquidLevel = liquidData.
level;
1495 if (liquidLevel <= ground)
1503 if (ground + 0.75 > liquidLevel)
1521 float dist = spellEffectInfo.
CalcRadius(unitCaster, targetIndex).
Max;
1538 return static_cast<float>(
M_PI);
1541 return static_cast<float>(
M_PI / 2);
1543 return static_cast<float>(
M_PI / 4);
1545 return static_cast<float>(3 *
M_PI / 4);
1548 return static_cast<float>(-
M_PI / 2);
1550 return static_cast<float>(-
M_PI / 4);
1552 return static_cast<float>(-3 *
M_PI / 4);
1572 if (
WorldObject const* summoner = casterSummon->GetSummoner())
1578 std::vector<SpellTargetPosition const*> positionsInRange;
1581 positionsInRange.push_back(&position);
1583 if (positionsInRange.empty())
1607 dist = objSize + (dist - objSize);
1614 static constexpr float DefaultTotemDistance = 3.0f;
1615 if (!spellEffectInfo.
HasRadius(targetIndex))
1616 dist = DefaultTotemDistance;
1644 "Spell::SelectImplicitTargetDestTargets - no explicit object target available!");
1661 float dist = spellEffectInfo.
CalcRadius(
nullptr, targetIndex).
Max;
1733 bool checkIfValid =
true;
1739 checkIfValid =
false;
1746 target = unitCaster->GetGuardianPet();
1750 if (unitCaster->IsSummon())
1751 target = unitCaster->ToTempSummon()->GetSummonerUnit();
1755 target = unitCaster->GetVehicleBase();
1766 if (vehicleBase->IsVehicle())
1771 if (!creatureCaster->GetTapList().empty())
1798 "Spell::SelectImplicitTargetObjectTargets - no explicit object or item target available!");
1830 if (effMask & (1 << k))
1834 std::list<WorldObject*> targets;
1843 for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
1860 if (x < 100000.0f && x > -100000.0f)
return x;
1861 if (x >= 100000.0f)
return 100000.0f;
1862 if (x <= 100000.0f)
return -100000.0f;
1879 std::list<WorldObject*> targets;
1882 SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellTrajTargetCheck> > (searcher,
GRID_MAP_TYPE_MASK_ALL,
m_caster, &srcPos, dist2d);
1883 if (targets.empty())
1889 float a = (srcToDestDelta - dist2d * b) / (dist2d * dist2d);
1897 bestDist = std::min(std::max(bestDist, triggerSpellInfo->GetMaxRange(
false)), std::min(dist2d, 300.0f));
1901 for (
auto itr = targets.begin(); itr != targets.end(); ++itr)
1908 if (unitCaster == *itr || unitCaster->
IsOnVehicle(unit) || unit->GetVehicle())
1918 float const size = std::max((*itr)->GetCombatReach(), 1.0f);
1920 float const dz = (*itr)->GetPositionZ() - srcPos.
m_positionZ;
1922 float const horizontalDistToTraj = std::fabs(objDist2d * std::sin(srcPos.
GetRelativeAngle(*itr)));
1923 float const sizeFactor = std::cos((horizontalDistToTraj / size) * (
M_PI / 2.0f));
1924 float const distToHitPoint = std::max(objDist2d * std::cos(srcPos.
GetRelativeAngle(*itr)) - size * sizeFactor, 0.0f);
1925 float const height = distToHitPoint * (a * distToHitPoint + b);
1930 if (distToHitPoint < bestDist)
1932 bestDist = distToHitPoint;
1937 if (dist2d > bestDist)
1954 std::list<WorldObject*> targets;
1973 ABORT_MSG(
"Spell::SelectImplicitLineTargets: received not implemented target reference type");
1984 SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellLineTargetCheck>>(searcher, containerTypeMask,
m_caster,
m_caster, radius.
Max);
1988 if (!targets.empty())
1993 if (maxTargets < targets.size())
1996 targets.resize(maxTargets);
2000 for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
2016 switch (spellEffectInfo.
Effect)
2037 Player* player = ObjectAccessor::GetPlayer(map, targetGuid);
2042 if (player->IsImmunedToSpellEffect(spell->GetSpellInfo(), spellEffectInfo, nullptr))
2045 spell->HandleEffects(player, nullptr, nullptr, nullptr, spellEffectInfo, SPELL_EFFECT_HANDLE_HIT_TARGET);
2077 target = corpseTarget;
2143 retMask &= ~GRID_MAP_TYPE_MASK_PLAYER;
2146 retMask &=
sConditionMgr->GetSearcherTypeMaskForConditionList(*condList);
2150template<
class SEARCHER>
2159 if (searchInGrid || searchInWorld)
2186 if (!containerTypeMask)
2200 if (!containerTypeMask)
2213 float jumpRadius = 0.0f;
2239 float searchRadius = [&]()
2247 return jumpRadius * chainTargets;
2251 std::list<WorldObject*> tempTargets;
2254 tempTargets.remove(target);
2266 while (chainTargets)
2269 std::list<WorldObject*>::iterator foundItr = tempTargets.end();
2274 for (std::list<WorldObject*>::iterator itr = tempTargets.begin(); itr != tempTargets.end(); ++itr)
2278 uint32 deficit = unit->GetMaxHealth() - unit->GetHealth();
2282 maxHPDeficit = deficit;
2290 for (std::list<WorldObject*>::iterator itr = tempTargets.begin(); itr != tempTargets.end(); ++itr)
2292 bool isBestDistanceMatch = foundItr != tempTargets.end() ? chainSource->
GetDistanceOrder(*itr, *foundItr) : chainSource->
IsWithinDist(*itr, jumpRadius);
2293 if (!isBestDistanceMatch)
2306 if (foundItr == tempTargets.end())
2310 chainSource = *foundItr;
2312 targets.push_back(*foundItr);
2313 tempTargets.erase(foundItr);
2434 if (!spellEffectInfo.IsEffect() || !
CheckEffectTarget(target, spellEffectInfo, losPosition))
2435 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2448 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2457 ihit->EffectMask |= effectMask;
2470 targetInfo.
IsCrit =
false;
2488 return (target.EffectMask & effectMask) != 0;
2495 missileSource = previousTarget;
2497 targetInfo.
TimeDelay += previousTargetItr->TimeDelay;
2549 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2562 ihit->EffectMask |= effectMask;
2602 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2613 ihit->EffectMask |= effectMask;
2629 if (!spellEffectInfo.IsEffect())
2630 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2643 ihit->EffectMask |= effectMask;
2688 if (uniqueTargetInfo.MissCondition ==
SPELL_MISS_NONE && uniqueTargetInfo.EffectMask & (1 << effect))
2690 if (uniqueTargetInfo.TargetGUID == target)
2712 return targetInfo.
EffectMask & (1 << effect);
2720 return targetInfo.
EffectMask & (1 << effect);
2728 return targetInfo.
EffectMask & (1 << effect);
2800 if (_spellHitTarget)
2816 if (_spellHitTarget)
2837 if (canEffectTrigger && !procAttacker && !procVictim)
2839 bool positive =
true;
2847 if (EffectMask && !(EffectMask & (1 << i)))
2863 bool hasHealing =
false;
2864 std::unique_ptr<DamageInfo> spellDamageInfo;
2865 std::unique_ptr<HealInfo> healInfo;
2881 spell->
m_healing = healInfo->GetEffectiveHeal();
2887 bool hasDamage =
false;
2917 damageInfo.
damage = victimCreature->CalculateDamageForSparring(damageInfo.
attacker, damageInfo.
damage);
2928 if (canEffectTrigger)
2936 if (!hasHealing && !hasDamage)
2942 if (canEffectTrigger)
2944 spellDamageInfo = std::make_unique<DamageInfo>(damageInfo,
NODAMAGE, spell->
m_attackType, ProcHitMask);
2961 if (canEffectTrigger)
2987 if (unitCaster->IsPlayer())
2988 targetCreature->SetTappedBy(unitCaster);
3000 if (_spellHitTarget)
3004 if (
CreatureAI* hitTargetAI = cHitTarget->AI())
3014 if (
AuraApplication* aurApp = HitAura->GetApplicationOfTarget(_spellHitTarget->GetGUID()))
3017 uint32 effMask = EffectMask & aurApp->GetEffectsToApply();
3019 if ((effMask & (1 << i)) && aurApp->HasEffect(i))
3020 effMask &= ~(1 << i);
3023 _spellHitTarget->_ApplyAura(aurApp, effMask);
3025 if (aurApp->IsNeedClientUpdate() && aurApp->GetRemoveMode() ==
AURA_REMOVE_NONE)
3027 aurApp->ClientUpdate(
false);
3028 _spellHitTarget->RemoveVisibleAuraUpdate(aurApp);
3099 if (creatureTarget->IsEvadingAttacks())
3137 playerOwner->SetContestedPvP();
3138 playerOwner->UpdatePvP(
true);
3180 if (origCaster == unit || !origCaster->
IsFriendlyTo(unit))
3185 if (hitInfo.
EffectMask & (1 << auraSpellEffect.EffectIndex) &&
3186 auraSpellEffect.IsUnitOwnedAuraEffect() &&
3219 bool refresh =
false;
3259 if (
int32 period = auraEff->GetPeriod())
3305 int32 _duration = 0;
3313 TC_LOG_DEBUG(
"spells",
"Spell {} triggered spell {} by SPELL_AURA_ADD_TARGET_TRIGGER aura",
m_spellInfo->
Id, i->triggeredSpell->Id);
3317 if (i->triggeredSpell->GetDuration() == -1)
3327 triggeredAur->SetDuration(_duration);
3338 for (std::vector<int32>::const_iterator i = spellTriggered->begin(); i != spellTriggered->end(); ++i)
3357 uint32 channelAuraMask = 0;
3360 channelAuraMask |= 1 << spellEffectInfo.EffectIndex;
3362 channelAuraMask &= channelTargetEffectMask;
3365 if (channelAuraMask)
3377 if (targetInfo.MissCondition ==
SPELL_MISS_NONE && (channelTargetEffectMask & targetInfo.EffectMask))
3383 unitCaster->RemoveChannelObject(targetInfo.TargetGUID);
3389 if (channelAuraMask & targetInfo.EffectMask)
3395 targetInfo.EffectMask &= ~aurApp->GetEffectMask();
3398 unitCaster->RemoveChannelObject(targetInfo.TargetGUID);
3405 unitCaster->RemoveChannelObject(targetInfo.TargetGUID);
3410 channelTargetEffectMask &= ~targetInfo.EffectMask;
3416 return channelTargetEffectMask == 0;
3442 if (triggeredByAura)
3474 int32 param1 = 0, param2 = 0;
3492 if (param1 || param2)
3533 return movementResult;
3581 unitCaster->SetCurrentCastSpell(
this);
3590 if (caster->IsAIEnabled())
3593 if (willCastDirectly)
3662 Spell* lastSpellMod =
nullptr;
3697 sScriptMgr->OnPlayerSpellCast(playerCaster,
this, skipCheck);
3704 for (
Unit* controlled : playerCaster->m_Controlled)
3706 if (
CreatureAI* controlledAI = cControlled->AI())
3707 controlledAI->OwnerAttacked(target);
3738 int32 param1 = 0, param2 = 0;
3742 cleanupSpell(castResult, ¶m1, ¶m2);
3754 if (!my_trade->IsInAcceptProcess())
3770 if (spellEffectInfo.IsUnitOwnedAuraEffect())
3771 aura_effmask |= 1 << spellEffectInfo.EffectIndex;
3782 if (target->HasStrongerAuraWithDR(
m_spellInfo, caster))
3795 if (!creatureCaster->GetTarget().IsEmpty() && !creatureCaster->HasUnitFlag(
UNIT_FLAG_POSSESSED))
3797 creatureCaster->SetInFront(target);
3819 pet->DespawnOrUnsummon();
3880 creatureCaster->ReleaseSpellFocus(
this);
3902 if (caster->IsAIEnabled())
3918 if (unitCaster->HasUnitState(
UNIT_STATE_CASTING) && !unitCaster->IsNonMeleeSpellCast(
false,
false,
true))
3934 for (
int32 id : *spell_triggered)
3939 unitCaster->RemoveAurasDueToSpell(-
id);
3962template <
class Container>
3966 target.PreprocessTarget(
this);
3970 if (target.EffectMask & (1 << spellEffectInfo.EffectIndex))
3971 target.DoTargetSpellHit(
this, spellEffectInfo);
3974 target.DoDamageAndTriggers(
this);
3987 int32 originalDuration = duration;
4001 float ratio = float(duration) / float(originalDuration);
4004 for (std::size_t i = 0; i <
m_empower->StageDurations.size() - 1; ++i)
4007 totalExceptLastStage +=
m_empower->StageDurations[i];
4026 else if (duration == -1)
4078 bool ignoreTargetInfoTimeDelay = single_missile;
4084 if (launchMoment > t_offset)
4085 return launchMoment;
4093 ignoreTargetInfoTimeDelay =
false;
4111 std::vector<TargetInfo> delayedTargets;
4114 if (ignoreTargetInfoTimeDelay || target.TimeDelay <= t_offset)
4116 target.TimeDelay = t_offset;
4117 delayedTargets.emplace_back(std::move(target));
4120 else if (!single_missile && (next_time == 0 || target.
TimeDelay < next_time))
4131 std::vector<GOTargetInfo> delayedGOTargets;
4134 if (ignoreTargetInfoTimeDelay || goTarget.TimeDelay <= t_offset)
4136 goTarget.TimeDelay = t_offset;
4137 delayedGOTargets.emplace_back(std::move(goTarget));
4140 else if (!single_missile && (next_time == 0 || goTarget.TimeDelay < next_time))
4141 next_time = goTarget.TimeDelay;
4152 modOwner->SetSpellModTakingSpell(
this,
false);
4181 if (!spellEffectInfo.IsEffect())
4291 for (std::size_t i = 0; i <
m_empower->StageDurations.size(); ++i)
4298 return m_empower->StageDurations.size();
4301 if (completedStages !=
m_empower->CompletedStages)
4309 m_empower->CompletedStages = completedStages;
4311 unitCaster->SetSpellEmpowerStage(completedStages);
4332 if (creatureCaster->IsAIEnabled())
4333 creatureCaster->AI()->OnChannelFinished(
m_spellInfo);
4375 ((
Puppet*)charm)->UnSummon();
4379 creatureCaster->ReleaseSpellFocus(
this);
4446 packet.CastID = castId;
4447 packet.SpellID = spellInfo->
Id;
4448 packet.Reason = result;
4454 packet.FailedArg1 = *param1;
4456 packet.FailedArg1 = 0;
4460 packet.FailedArg1 = *param1;
4466 packet.FailedArg1 = *param1;
4470 switch (spellInfo->
Id)
4474 packet.FailedArg1 = 3905;
4478 packet.FailedArg1 = 3842;
4481 packet.FailedArg1 = 4075;
4484 packet.FailedArg1 = 0;
4492 packet.FailedArg1 = *param1;
4494 packet.FailedArg2 = *param2;
4498 if (spellInfo->
Totem[0])
4499 packet.FailedArg1 = spellInfo->
Totem[0];
4500 if (spellInfo->
Totem[1])
4501 packet.FailedArg2 = spellInfo->
Totem[1];
4507 packet.FailedArg1 = *param1;
4509 packet.FailedArg2 = *param2;
4522 if (param1 && param2)
4524 packet.FailedArg1 = *param1;
4525 packet.FailedArg2 = *param2;
4536 packet.FailedArg1 = *param1;
4542 if (
uint32 itemType = spellEffectInfo.ItemType)
4557 packet.FailedArg1 = *param1;
4563 packet.FailedArg1 = *param1;
4568 if (param1 && param2)
4570 packet.FailedArg1 = *param1;
4571 packet.FailedArg2 = *param2;
4575 packet.FailedArg1 = 0;
4576 packet.FailedArg2 = 0;
4580 if (param1 && param2)
4582 packet.FailedArg1 = *param1;
4583 packet.FailedArg2 = *param2;
4587 packet.FailedArg1 = 0;
4588 packet.FailedArg2 = 0;
4593 packet.FailedArg1 = *param1;
4595 packet.FailedArg1 = 0;
4598 packet.FailedArg1 = customError;
4602 packet.FailedArg1 = *param1;
4604 packet.FailedArg1 = 0;
4609 packet.FailedArg1 = *param1;
4614 if (spellInfo->
Reagent[i] <= 0)
4620 if (caster && !caster->
HasItemCount(itemid, itemcount))
4622 packet.FailedArg1 = itemid;
4629 packet.FailedArg2 = *param2;
4634 if (caster && !caster->
HasCurrency(reagentsCurrency->CurrencyTypesID, reagentsCurrency->CurrencyCount))
4636 packet.FailedArg1 = -1;
4637 packet.FailedArg2 = reagentsCurrency->CurrencyTypesID;
4648 packet.FailedArg1 = *param1;
4705 packet.
Visual = spellVisual;
4735 uint32 schoolImmunityMask = 0;
4736 uint32 mechanicImmunityMask = 0;
4739 schoolImmunityMask =
m_timer!= 0 ? unitCaster->GetSchoolImmunityMask() : 0;
4743 if (schoolImmunityMask || mechanicImmunityMask)
4806 float baseCd = float(player->GetRuneBaseCooldown());
4807 castData.
RemainingRunes->Cooldowns.push_back((baseCd -
float(player->GetRuneCooldown(i))) / baseCd * 255);
4932 if (targetInfo.EffectMask == 0)
4938 data.
HitTargets.push_back(targetInfo.TargetGUID);
4945 data.
MissTargets.push_back(targetInfo.TargetGUID);
4946 data.
MissStatus.emplace_back(targetInfo.MissCondition, targetInfo.ReflectResult);
4951 data.
HitTargets.push_back(targetInfo.TargetGUID);
4954 data.
HitTargets.push_back(targetInfo.TargetGUID);
4963 uint32 ammoInventoryType = 0;
4964 uint32 ammoDisplayID = 0;
4974 else if (playerCaster->HasAura(46699))
4976 ammoDisplayID = 5996;
4983 uint32 nonRangedAmmoDisplayID = 0;
4984 uint32 nonRangedAmmoInventoryType = 0;
4987 if (
uint32 item_id = unitCaster->GetVirtualItemId(i))
4993 switch (itemEntry->SubclassID)
4998 ammoDisplayID = itemAppearance->ItemDisplayInfoID;
5000 ammoInventoryType = itemEntry->InventoryType;
5004 ammoDisplayID = 5996;
5008 ammoDisplayID = 5998;
5014 nonRangedAmmoDisplayID = itemAppearance->ItemDisplayInfoID;
5016 nonRangedAmmoInventoryType = itemEntry->InventoryType;
5027 if (!ammoDisplayID && !ammoInventoryType)
5029 ammoDisplayID = nonRangedAmmoDisplayID;
5030 ammoInventoryType = nonRangedAmmoInventoryType;
5034 return ammoDisplayID;
5043 switch (spellEffectInfo.Effect)
5048 spellInfo, spellEffectInfo.CalcValue(unitCaster,
nullptr, target,
nullptr, castItemEntry, castItemLevel),
5062 switch (spellEffectInfo.ApplyAuraName)
5067 spellInfo, spellEffectInfo.CalcValue(unitCaster,
nullptr, target,
nullptr, castItemEntry, castItemLevel),
5068 DIRECT_DAMAGE, spellEffectInfo, 1, spell) * spellEffectInfo.GetPeriodicTickCount();
5072 points +=
CalcPredictedHealing(triggered, unitCaster, target, castItemEntry, castItemLevel,
nullptr, withPeriodic).first;
5080 return { points, type };
5086 healPrediction.
Points = 0;
5095 healPrediction.
Type = type;
5098 static constexpr uint32 beaconSpellId = 53651;
5104 return aura->GetSpellInfo()->GetEffects().size() > EFFECT_1 && aura->GetSpellInfo()->GetEffect(EFFECT_1).TriggerSpell == beaconSpellId;
5109 healPrediction.
BeaconGUID = (*beacon)->GetOwner()->GetGUID();
5135 return log.Effect == effect;
5150 spellLogEffectPowerDrainParams.
Points = points;
5151 spellLogEffectPowerDrainParams.
PowerType = powerType;
5152 spellLogEffectPowerDrainParams.
Amplitude = amplitude;
5160 spellLogEffectExtraAttacksParams.
Victim = victim->
GetGUID();
5161 spellLogEffectExtraAttacksParams.
NumAttacks = numAttacks;
5180 spellLogEffectDurabilityDamageParams.
Victim = victim->
GetGUID();
5181 spellLogEffectDurabilityDamageParams.
ItemID = itemId;
5182 spellLogEffectDurabilityDamageParams.
Amount = amount;
5198 spellLogEffectTradeSkillItemParams.
ItemID = entry;
5206 spellLogEffectFeedPetParams.
ItemID = entry;
5230 spellLogEffectGenericVictimParams.
Victim = target->
GetGUID();
5242 failurePacket.
Reason = result;
5250 failedPacket.
Reason = result;
5279 spellEmpowerUpdate.
Status = 1;
5281 spellEmpowerUpdate.
Status = 4;
5305 uint32 channelAuraMask = 0;
5306 uint32 explicitTargetEffectMask = 0xFFFFFFFF;
5312 return target.TargetGUID == m_targets.GetUnitTargetGUID();
5315 explicitTargetEffectMask = explicitTargetItr->EffectMask;
5319 if (spellEffectInfo.IsEffect(
SPELL_EFFECT_APPLY_AURA) && (explicitTargetEffectMask & (1u << spellEffectInfo.EffectIndex)))
5320 channelAuraMask |= 1 << spellEffectInfo.EffectIndex;
5324 if (!(target.EffectMask & channelAuraMask))
5335 if (target.EffectMask & channelAuraMask)
5342 if (unitCaster->
m_unitData->ChannelObjects.size() == 1 && unitCaster->
m_unitData->ChannelObjects[0].IsUnit())
5343 if (!creatureCaster->HasSpellFocus(
this))
5355 if (schoolImmunityMask || mechanicImmunityMask)
5357 interruptImmunities.emplace();
5358 interruptImmunities->SchoolImmunities = schoolImmunityMask;
5359 interruptImmunities->Immunities = mechanicImmunityMask;
5364 healPrediction.emplace();
5365 if (unitCaster->
m_unitData->ChannelObjects.size() == 1 && unitCaster->
m_unitData->ChannelObjects[0].IsUnit())
5366 healPrediction->TargetGUID = unitCaster->
m_unitData->ChannelObjects[0];
5407 std::string sentName;
5418 resurrectRequest.
Name = sentName;
5422 if (
CharmInfo* charmInfo = pet->GetCharmInfo())
5423 resurrectRequest.
PetNumber = charmInfo->GetPetNumber();
5452 bool expendable =
false;
5453 bool withoutCharges =
false;
5458 if (itemEffect->Charges)
5460 if (itemEffect->Charges < 0)
5479 withoutCharges = (charges == 0);
5483 if (expendable && withoutCharges)
5532 if (cost.Amount < 0)
5556 unitCaster->
ModifyPower(cost.Power, -cost.Amount);
5603 return totalCost + (cost.Power == POWER_RUNES ? cost.Amount : 0);
5616 int32 readyRunes = 0;
5621 if (readyRunes < runeCost)
5640 return totalCost + (cost.Power == POWER_RUNES ? cost.Amount : 0);
5694 if (itemEffect->Charges < 0 && abs(charges) < 2)
5730 float threat = 0.0f;
5733 if (threatEntry->apPctMod != 0.0f)
5736 threat += threatEntry->flatMod;
5750 float threatToAdd = threat;
5787 if (!preventDefault)
5788 (this->*SpellEffectHandlers[spellEffectInfo.
Effect].
Value)();
5794 return spellEvent->GetSpell();
5905 bool checkForm =
true;
5954 bool hasInvalidMountAura = std::ranges::any_of(unitCaster->GetAuraEffectsByType(
SPELL_AURA_MOUNTED), [unitCaster](
AuraEffect const* mountEffect)
5956 uint32 mountType = mountEffect->GetSpellEffectInfo().MiscValueB;
5957 if (MountEntry const* mountEntry = sDB2Manager.GetMount(mountEffect->GetId()))
5958 mountType = mountEntry->MountTypeID;
5960 MountCapabilityEntry const* mountCapability = unitCaster->GetMountCapability(mountType);
5961 return !mountCapability || mountCapability->ID != uint32(mountEffect->GetAmount());
5964 if (!hasInvalidMountAura)
5974 return vehicleCheck;
6027 if (!unitCaster->IsFriendlyTo(auraEff->GetCaster()) && !target->HasAura(auraEff->GetId(), auraEff->GetCasterGUID()))
6031 if (!unitCaster->IsFriendlyTo(auraEff->GetCaster()) && !unitCaster->HasAura(auraEff->GetId(), auraEff->GetCasterGUID()))
6035 if (!target->HasAura(auraEff->GetId(), auraEff->GetCasterGUID()))
6039 if (!unitCaster->HasAura(auraEff->GetId(), auraEff->GetCasterGUID()))
6077 if (!unitCaster->GetPetGUID().IsEmpty())
6084 if (!unitCaster->GetGuardianPet())
6103 if (player->InArena())
6179 uint32 approximateAuraEffectMask = 0;
6180 uint32 nonAuraEffectMask = 0;
6184 switch (spellEffectInfo.Effect)
6191 if (!unit || !unit->
HasAura(17743))
6216 if (!learn_spellproto)
6247 if (!learn_spellproto)
6264 if (
uint32 glyphId = spellEffectInfo.MiscValue)
6267 if (!glyphProperties)
6270 std::vector<uint32>
const* glyphBindableSpells =
sDB2Manager.GetGlyphBindableSpells(glyphId);
6271 if (!glyphBindableSpells)
6277 if (std::vector<ChrSpecialization>
const* glyphRequiredSpecs =
sDB2Manager.GetGlyphRequiredSpecs(glyphId))
6286 uint32 replacedGlyph = 0;
6289 if (std::vector<uint32>
const* activeGlyphBindableSpells =
sDB2Manager.GetGlyphBindableSpells(activeGlyphId))
6293 replacedGlyph = activeGlyphId;
6301 if (activeGlyphId == replacedGlyph)
6304 if (activeGlyphId == glyphId)
6405 Item* pTempItem =
nullptr;
6430 lockId = go->GetGOInfo()->GetLockId();
6441 int32 reqSkillValue = 0;
6442 int32 skillValue = 0;
6466 return petInfo && !petInfo->Health;
6469 if (deadPetItr == petStable->
ActivePets.end())
6483 if (!SummonProperties)
6486 switch (SummonProperties->
Control)
6523 .SetOriginalCaster(pet->GetGUID())
6537 if (!spellEffectInfo.MiscValue)
6539 petSlot =
PetSaveMode(spellEffectInfo.CalcValueAsInt());
6544 if (activePet && !activePet->Health)
6562 if (creatureInfo && creatureInfo->
IsTameable(
true, creatureDifficulty))
6571 else if (!spellEffectInfo.MiscValue)
6613 uint32 mapId = map->GetId();
6614 Difficulty difficulty = map->GetDifficultyID();
6615 if (
InstanceLock const* mapLock = map->GetInstanceLock())
6619 if (!target->
Satisfy(
sObjectMgr->GetAccessRequirement(mapId, difficulty), mapId))
6751 if (!artifactEntry || artifactEntry->
ArtifactCategoryID != spellEffectInfo.MiscValue)
6780 if (
uint32 battlePetType = spellEffectInfo.MiscValue)
6781 if (!(battlePetType & (1 << battlePetSpecies->PetTypeEnum)))
6813 if (spellEffectInfo.IsAura())
6814 approximateAuraEffectMask |= 1 << spellEffectInfo.EffectIndex;
6815 else if (spellEffectInfo.IsEffect())
6816 nonAuraEffectMask |= 1 << spellEffectInfo.EffectIndex;
6821 switch (spellEffectInfo.ApplyAuraName)
6859 if (target->GetTypeId() ==
TYPEID_UNIT && target->IsVehicle())
6862 if (target->IsMounted())
6865 if (!target->GetCharmerGUID().IsEmpty())
6868 if (target->GetOwner() && target->GetOwner()->GetTypeId() ==
TYPEID_PLAYER)
6872 if (value && target->GetLevelForTarget(
m_caster) > value)
6919 if (spellEffectInfo.IsTargetingArea())
6939 && (approximateAuraEffectMask & (1 << spellEffectInfo.EffectIndex))
6942 if (!target->IsHighestExclusiveAuraEffect(
m_spellInfo, spellEffectInfo.ApplyAuraName,
6944 approximateAuraEffectMask,
false))
6984 if (!owner->IsAlive())
6999 if (!creatureCaster->GetSpellHistory()->IsReady(
m_spellInfo))
7048 bool foundNotMechanic =
false;
7052 uint64 const mechanicMask = aurEff->GetSpellInfo()->GetAllEffectsMechanicMask();
7053 if (mechanicMask && !(mechanicMask &
GetSpellInfo()->GetAllowedMechanicMask()))
7055 foundNotMechanic =
true;
7060 *param1 = aurEff->GetSpellEffectInfo().Mechanic;
7062 *param1 = aurEff->GetSpellInfo()->Mechanic;
7069 if (foundNotMechanic)
7091 if (usableWhileStunned)
7095 result = mechanicResult;
7100 result = mechanicResult;
7112 if (usableWhileFeared)
7116 result = mechanicResult;
7123 if (usableWhileConfused)
7127 result = mechanicResult;
7150 if (auraEffects.empty())
7160 *param1 = aurEff->GetSpellEffectInfo().Mechanic;
7162 *param1 = aurEff->GetSpellInfo()->Mechanic;
7213 bool isRatedBattleground =
false;
7214 bool isArena = !isRatedBattleground;
7249 if (!unitCaster->CanCastSpellWhileMoving(
m_spellInfo))
7286 if (!spellEffectInfo.IsAura())
7289 AuraType const& auraType = spellEffectInfo.ApplyAuraName;
7291 for (Unit::AuraEffectList::const_iterator auraIt = auras.begin(); auraIt != auras.end(); ++auraIt)
7301 if (
GetCaster() == (*auraIt)->GetCaster())
7306 if (abs(spellEffectInfo.CalcBaseValue(
m_caster, target, 0, -1)) <= abs((*auraIt)->GetAmount()))
7325 if (ihit->TargetGUID == targetguid)
7357 minRange *= minRange;
7358 maxRange *= maxRange;
7401 float rangeMod = 0.0f;
7415 rangeMod = unitCaster->
GetMeleeRange(target ? target : unitCaster);
7419 float meleeRange = 0.0f;
7424 meleeRange = unitCaster->
GetMeleeRange(target ? target : unitCaster);
7428 range.
Min += meleeRange;
7435 range.
Min += rangeMod;
7441 rangeMod += 8.0f / 3.0f;
7446 range.
Max *= ranged->GetTemplate()->GetRangedModRange() * 0.01f;
7451 range.
Max += rangeMod;
7478 TC_LOG_ERROR(
"spells",
"Spell::CheckPower: Unknown power type '{}'", cost.Power);
7553 if (spellEffectInfo.MiscValue < 0 || spellEffectInfo.MiscValue >=
int8(
MAX_POWERS))
7602 if (targetItem->GetOwnerGUID() != player->
GetGUID())
7603 checkReagents =
true;
7627 if (itemEffect->Charges < 0 && abs(charges) < 2)
7644 if (!player->
HasCurrency(reagentsCurrency->CurrencyTypesID, reagentsCurrency->CurrencyCount))
7650 *param2 = reagentsCurrency->CurrencyTypesID;
7676 *param1 = totemCategory;
7686 switch (spellEffectInfo.Effect)
7704 if (spellEffectInfo.ItemType)
7710 uint32 createCount = std::clamp<uint32>(spellEffectInfo.CalcValueAsInt(), 1u, itemTemplate->
GetMaxStackSize());
7718 player->
SendEquipError(msg,
nullptr,
nullptr, spellEffectInfo.ItemType);
7728 player->
SendEquipError(msg,
nullptr,
nullptr, spellEffectInfo.ItemType);
7733 .SetTriggeringSpell(
this));
7755 player->
SendEquipError(msg,
nullptr,
nullptr, spellEffectInfo.ItemType);
7773 if (requiredLevel < m_spellInfo->BaseLevel)
7780 bool isItemUsable =
false;
7785 isItemUsable =
true;
7796 switch (enchantEntry->
Effect[s])
7818 if (targetItem->
GetOwner() != player)
7835 uint32 enchant_id = spellEffectInfo.MiscValue;
7850 if (requiredLevel < m_spellInfo->BaseLevel)
7875 if (!disenchantSkillRequired)
7899 if (param1 && param2)
7930 if (param1 && param2)
7974 uint32 itemId = spellEffectInfo.ItemType;
7982 if (itemEffect->Charges != 0 && item->GetSpellCharges(itemEffect) == itemEffect->Charges)
7996 if (!azeriteEmpoweredItem)
7999 bool hasSelections =
false;
8004 hasSelections =
true;
8044 return mainHandResult;
8051 return offHandResult;
8068 int32 delaytime = 500;
8070 float delayReduce = 100.0f;
8074 if (delayReduce >= 100)
8077 AddPct(delaytime, -delayReduce);
8112 float delayReduce = 100.0f;
8116 if (delayReduce >= 100)
8119 AddPct(delaytime, -delayReduce);
8134 Unit* unit = unitCaster;
8135 if (unitCaster->
GetGUID() != targetInfo.TargetGUID)
8147 dynObj->Delay(delaytime);
8266 if (!gobCaster->GetGOInfo()->GetRequireLOS())
8275 switch (spellEffectInfo.
Effect)
8328 switch (spellEffectInfo.
Effect)
8392 m_empower->IsReleasedByClient = release;
8404 return passedTime >=
m_empower->MinHoldTime;
8433 TC_LOG_ERROR(
"spells",
"~SpellEvent: {} {} tried to delete non-deletable spell {}. Was not deleted, causes memory leak.",
8560 if (!spellEffectInfo.IsEffect())
8573 float multiplier = 1.0f;
8579 uint32 mask = target.EffectMask;
8580 if (!(mask & (1 << spellEffectInfo.EffectIndex)))
8604 Unit* unit =
nullptr;
8632 Unit* unit =
nullptr;
8731 bool reqKey =
false;
8735 switch (lockInfo->
Type[j])
8756 reqSkillValue = lockInfo->
Skill[j];
8763 skillValue = unitCaster->
GetLevel() * 5;
8770 if (skillValue < reqSkillValue)
8844 TC_LOG_DEBUG(
"spells",
"Spell::LoadScripts: Script `{}` for spell `{}` is loaded now", script->GetScriptName(),
m_spellInfo->
Id);
8854 script->OnPrecast();
8855 script->_FinishScriptCall();
8865 beforeCast.Call(script);
8867 script->_FinishScriptCall();
8877 onCast.Call(script);
8879 script->_FinishScriptCall();
8889 afterCast.Call(script);
8891 script->_FinishScriptCall();
8905 retVal = tempResult;
8908 script->_FinishScriptCall();
8918 castTime = script->CalcCastTime(castTime);
8919 script->_FinishScriptCall();
8927 bool preventDefault =
false;
8956 script->_PrepareScriptCall(hookType);
8959 if (!script->_IsEffectPrevented(effIndex) && effectHandler.IsEffectAffected(
m_spellInfo, effIndex))
8960 effectHandler.Call(script, effIndex);
8962 if (!preventDefault)
8963 preventDefault = script->_IsDefaultEffectPrevented(effIndex);
8965 script->_FinishScriptCall();
8967 return preventDefault;
8976 onDispel.Call(script, effIndex);
8978 script->_FinishScriptCall();
8989 beforeHit.Call(script, missInfo);
8991 script->_FinishScriptCall();
9003 script->_FinishScriptCall();
9013 afterHit.Call(script);
9015 script->_FinishScriptCall();
9025 calcCritChance.Call(script, victim, critChance);
9027 script->_FinishScriptCall();
9037 calcDamage.Call(script, spellEffectInfo, victim, damage, flatMod, pctMod);
9039 script->_FinishScriptCall();
9049 calcHealing.Call(script, spellEffectInfo, victim, healing, flatMod, pctMod);
9051 script->_FinishScriptCall();
9061 if (objectAreaTargetSelect.IsEffectAffected(
m_spellInfo, effIndex) && targetType.
GetTarget() == objectAreaTargetSelect.GetTarget())
9062 objectAreaTargetSelect.Call(script, targets);
9064 script->_FinishScriptCall();
9074 if (objectTargetSelect.IsEffectAffected(
m_spellInfo, effIndex) && targetType.
GetTarget() == objectTargetSelect.GetTarget())
9075 objectTargetSelect.Call(script, target);
9077 script->_FinishScriptCall();
9087 if (destinationTargetSelect.IsEffectAffected(
m_spellInfo, effIndex) && targetType.
GetTarget() == destinationTargetSelect.GetTarget())
9088 destinationTargetSelect.Call(script, target);
9090 script->_FinishScriptCall();
9100 calculateResistAbsorb.Call(script, damageInfo, resistAmount, absorbAmount);
9102 script->_FinishScriptCall();
9112 empowerStageCompleted.Call(script, completedStagesCount);
9114 script->_FinishScriptCall();
9124 empowerStageCompleted.Call(script, completedStagesCount);
9126 script->_FinishScriptCall();
9134 for (HookType
const& hook : hooks)
9136 if (!hook.IsEffectAffected(spellInfo, effIndex))
9139 bool otherEffectHasSameTargetFunction = std::ranges::any_of(hooks, [&](HookType
const& other)
9141 return other.IsEffectAffected(spellInfo, effIndexToCheck) && hook.HasSameTargetFunctionAs(other);
9143 if (!otherEffectHasSameTargetFunction)
9152 if (!allEffectTargetScriptsAreShared(script->OnObjectTargetSelect,
m_spellInfo, effIndex, effIndexToCheck))
9155 if (!allEffectTargetScriptsAreShared(script->OnObjectTargetSelect,
m_spellInfo, effIndexToCheck, effIndex))
9158 if (!allEffectTargetScriptsAreShared(script->OnObjectAreaTargetSelect,
m_spellInfo, effIndex, effIndexToCheck))
9161 if (!allEffectTargetScriptsAreShared(script->OnObjectAreaTargetSelect,
m_spellInfo, effIndexToCheck, effIndex))
9169 auto itr = std::ranges::find(
m_loadedScripts, type, [](
SpellScript* script) -> std::type_info
const& {
return typeid(*script); });
9202 for (
AuraEffect const* aurEff : targetTriggers)
9213 int32 chance = aurEff->GetSpellEffectInfo().CalcValueAsInt(unitCaster, &auraBaseAmount);
9214 chance *= aurEff->GetBase()->GetStackAmount();
9259 if (gcd >= MinGCD && gcd <= MaxGCD)
9264 int32 intGcd = gcd.count();
9308 std::stringstream sstr;
9309 sstr << std::boolalpha
9331 WorldObject const* src = targetAsSourceLocation ? target : source;
9332 WorldObject const* dst = targetAsSourceLocation ? source : target;
9360 _targetSelectionType(selectionType), _condSrcInfo(nullptr), _condList(condList), _objectType(objectType)
9363 _condSrcInfo = std::make_unique<ConditionSourceInfo>(
nullptr, caster);
9464 :
WorldObjectSpellTargetCheck(caster, caster, spellInfo, selectionType, condList, objectType), _range(range), _position(caster) { }
9469 if (dist <
_range && WorldObjectSpellTargetCheck::operator ()(target))
9480 :
WorldObjectSpellTargetCheck(caster, referer, spellInfo, selectionType, condList, objectType), _range(range), _position(position), _searchReason(searchReason) { }
9495 if (!isInsideCylinder)
9521 :
WorldObjectSpellAreaTargetCheck(range, caster, caster, caster, spellInfo, selectionType, condList, objectType), _coneSrc(coneSrc), _coneAngle(coneAngle), _lineWidth(lineWidth) { }
9547 :
WorldObjectSpellTargetCheck(caster, caster, spellInfo, selectionType, condList, objectType), _range(range), _position(position) { }
9563 :
WorldObjectSpellAreaTargetCheck(range, caster, caster, caster, spellInfo, selectionType, condList, objectType), _position(*srcPosition), _lineWidth(lineWidth)
9565 if (dstPosition && *srcPosition != *dstPosition)
9579 if (targets.size() <= maxTargets)
9601 std::array<std::ptrdiff_t, 1 << END> countsByPriority = {};
9602 std::vector<std::pair<WorldObject*, int32>> tempTargets(targets.size());
9605 std::ranges::transform(targets, tempTargets.begin(), [&](
WorldObject* target)
9607 int32 negativePoints = 0;
9608 if (prioritizeGroupMembersOf && (!target->IsUnit() || !target->ToUnit()->IsInRaidWith(prioritizeGroupMembersOf)))
9609 negativePoints |= 1 << NOT_GROUPED;
9611 if (prioritizePlayers && !target->IsPlayer() && (!target->IsCreature() || !target->ToCreature()->IsTreatedAsRaidUnit()))
9612 negativePoints |= 1 << NOT_PLAYER;
9614 if (!target->IsUnit() || target->ToUnit()->IsFullHealth())
9615 negativePoints |= 1 << NOT_INJURED;
9617 ++countsByPriority[negativePoints];
9618 return std::make_pair(target, negativePoints);
9621 std::ranges::sort(tempTargets, {}, Trinity::TupleElement<1>);
9623 std::size_t foundTargets = 0;
9624 for (std::ptrdiff_t countForPriority : countsByPriority)
9626 if (foundTargets + countForPriority >= maxTargets)
9635 foundTargets += countForPriority;
9638 targets.resize(maxTargets);
9639 std::ranges::transform(tempTargets.begin(), tempTargets.begin() + maxTargets, targets.begin(), Trinity::TupleElement<0>);
9644 if (targets.size() <= maxTargets)
9647 std::vector<std::pair<WorldObject*, int32>> prioritizedTargets(targets.size());
9650 std::ranges::transform(targets, prioritizedTargets.begin(), [&](
WorldObject* target)
9653 for (std::size_t i = 0; i < rules.size(); ++i)
9654 if (rules[i].Rule(target))
9655 score |= 1 << (rules.size() - 1 - i);
9657 return std::make_pair(target, score);
9661 std::ranges::sort(prioritizedTargets, std::ranges::greater(), Trinity::TupleElement<1>);
9663 int32 tieScore = prioritizedTargets[maxTargets - 1].second;
9666 if (prioritizedTargets[maxTargets].second == tieScore)
9668 auto toShuffle = std::equal_range(prioritizedTargets.begin(), prioritizedTargets.end(), std::pair<WorldObject*, int32>(
nullptr, tieScore),
9669 [](std::pair<WorldObject*, int32>
const& target1, std::pair<WorldObject*, int32>
const& target2) { return target1.second > target2.second; });
9675 targets.resize(maxTargets);
9676 std::ranges::transform(prioritizedTargets.begin(), prioritizedTargets.begin() + maxTargets, targets.begin(), Trinity::TupleElement<0>);
9687 Targets->SetUnitTarget(unitTarget);
9692 Targets->SetGOTarget(goTarget);
9710 if (triggeringSpell)
9730 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)
#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(T chance)
@ SPELL_ATTR10_USES_RANGED_SLOT_COSMETIC_ONLY
@ SPELL_ATTR9_NOT_IN_ARENA
@ SPELL_ATTR9_IGNORE_DEFAULT_RATED_BATTLEGROUND_RESTRICTIONS
@ SPELL_ATTR9_ITEM_CAST_GRANTS_SKILL_GAIN
@ SPELL_ATTR9_MISSILE_SPEED_IS_DELAY_IN_SEC
@ SPELL_ATTR9_FORCE_DEST_LOCATION
@ SPELL_ATTR9_IGNORE_TOTEM_REQUIREMENTS_FOR_CASTING
@ SPELL_ATTR9_FORCE_CORPSE_TARGET
@ SPELL_ATTR9_ONLY_WHEN_ILLEGALLY_MOUNTED
@ SPELL_ATTR7_ALWAYS_CAST_LOG
@ SPELL_ATTR7_CAN_CAUSE_INTERRUPT
@ SPELL_ATTR7_RESET_SWING_TIMER_AT_SPELL_START
@ SPELL_ATTR7_ALLOW_SPELL_REFLECTION
@ SPELL_ATTR7_TREAT_AS_NPC_AOE
@ SPELL_ATTR7_REPORT_SPELL_FAILURE_TO_UNIT_TARGET
@ SPELL_ATTR7_DEBUG_SPELL
#define CLASSMASK_WAND_USERS
@ SPELL_PREVENTION_TYPE_SILENCE
@ SPELL_PREVENTION_TYPE_NO_ACTIONS
@ SPELL_PREVENTION_TYPE_PACIFY
@ GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING
@ SPELL_ATTR5_TREAT_AS_AREA_EFFECT
@ SPELL_ATTR5_ALLOW_WHILE_STUNNED
@ SPELL_ATTR5_ALLOW_WHILE_FLEEING
@ SPELL_ATTR5_ALWAYS_LINE_OF_SIGHT
@ SPELL_ATTR5_MELEE_CHAIN_TARGETING
@ SPELL_ATTR5_ALWAYS_AOE_LINE_OF_SIGHT
@ SPELL_ATTR5_NOT_ON_PLAYER
@ SPELL_ATTR5_NOT_AVAILABLE_WHILE_CHARMED
@ SPELL_ATTR5_ALLOW_WHILE_CONFUSED
@ TARGET_UNIT_PASSENGER_1
@ TARGET_UNIT_TARGET_CHAINHEAL_ALLY
@ TARGET_DEST_CASTER_RANDOM
@ TARGET_DEST_CASTER_GROUND_2
@ TARGET_UNIT_CONE_180_DEG_ENEMY
@ TARGET_DEST_DYNOBJ_ENEMY
@ TARGET_DEST_DEST_TARGET_TOWARDS_CASTER
@ TARGET_UNIT_PASSENGER_6
@ TARGET_DEST_DEST_GROUND
@ TARGET_DEST_CASTER_FRONT_LEAP
@ TARGET_UNIT_CASTER_AND_PASSENGERS
@ TARGET_DEST_CHANNEL_TARGET
@ TARGET_DEST_CASTER_FRONT_LEFT
@ TARGET_DEST_CASTER_BACK_RIGHT
@ TARGET_DEST_CASTER_GROUND
@ TARGET_UNIT_SRC_AREA_FURTHEST_ENEMY
@ TARGET_UNIT_CASTER_AND_SUMMONS
@ TARGET_DEST_NEARBY_ENTRY_OR_DB
@ TARGET_UNIT_AREA_THREAT_LIST
@ TARGET_UNIT_PASSENGER_2
@ TARGET_UNIT_CHANNEL_TARGET
@ TARGET_DEST_CASTER_FISHING
@ TARGET_UNIT_TARGET_TAP_LIST
@ TARGET_UNIT_PASSENGER_4
@ TARGET_UNIT_PASSENGER_7
@ TARGET_DEST_TARGET_ENEMY
@ TARGET_DEST_DYNOBJ_NONE
@ TARGET_DEST_DYNOBJ_ALLY
@ TARGET_UNIT_TARGET_ALLY_OR_RAID
@ TARGET_DEST_CASTER_MOVEMENT_DIRECTION
@ TARGET_UNIT_AREA_TAP_LIST
@ TARGET_UNIT_PASSENGER_5
@ TARGET_UNIT_PASSENGER_3
@ TARGET_DEST_CASTER_BACK_LEFT
@ TARGET_DEST_CASTER_SUMMON
@ TARGET_GAMEOBJECT_TARGET
@ TARGET_DEST_TARGET_ALLY
@ TARGET_GAMEOBJECT_ITEM_TARGET
@ TARGET_DEST_CASTER_FRONT_RIGHT
@ TARGET_UNIT_OWN_CRITTER
@ TARGET_UNIT_PASSENGER_0
@ CORPSE_DYNFLAG_LOOTABLE
@ SPELL_ATTR2_AUTO_REPEAT
@ SPELL_ATTR2_CHAIN_FROM_CASTER
@ SPELL_ATTR2_ENCHANT_OWN_ITEM_ONLY
@ SPELL_ATTR2_DO_NOT_REPORT_SPELL_FAILURE
@ SPELL_ATTR2_NOT_AN_ACTION
@ SPELL_ATTR2_ALLOW_LOW_LEVEL_BUFF
@ SPELL_ATTR2_INITIATE_COMBAT_POST_CAST_ENABLES_AUTO_ATTACK
@ SPELL_ATTR2_NO_ACTIVE_PETS
@ SPELL_ATTR2_IGNORE_LINE_OF_SIGHT
@ SPELL_ATTR2_FAIL_ON_ALL_TARGETS_IMMUNE
@ SPELL_ATTR2_DO_NOT_RESET_COMBAT_TIMERS
@ SPELL_ATTR1_REQUIRE_ALL_TARGETS
@ SPELL_ATTR1_IS_SELF_CHANNELLED
@ SPELL_ATTR1_TRACK_TARGET_IN_CHANNEL
@ SPELL_ATTR1_FAILURE_BREAKS_STEALTH
@ SPELL_ATTR1_IS_CHANNELLED
@ SPELL_ATTR1_NO_REFLECTION
@ SPELL_ATTR1_INITIATES_COMBAT_ENABLES_AUTO_ATTACK
@ SPELL_ATTR1_DISMISS_PET_FIRST
@ SPELL_ATTR1_DISCOUNT_POWER_ON_MISS
@ SPELL_ATTR3_TREAT_AS_PERIODIC
@ SPELL_ATTR3_ONLY_BATTLEGROUNDS
@ SPELL_ATTR3_ONLY_ON_GHOSTS
@ SPELL_ATTR3_NO_RES_TIMER
@ SPELL_ATTR3_DO_NOT_TRIGGER_TARGET_STAND
@ SPELL_ATTR3_PVP_ENABLING
@ SPELL_ATTR3_REQUIRES_MAIN_HAND_WEAPON
@ SPELL_ATTR3_REQUIRES_OFF_HAND_WEAPON
@ SPELL_ATTR3_COMPLETELY_BLOCKED
@ SPELL_ATTR3_ONLY_ON_PLAYER
@ SPELL_DAMAGE_CLASS_RANGED
@ SPELL_DAMAGE_CLASS_MAGIC
@ SPELL_DAMAGE_CLASS_NONE
@ SPELL_DAMAGE_CLASS_MELEE
@ SPELL_EFFECT_CREATE_HEIRLOOM_ITEM
@ SPELL_EFFECT_SUMMON_PET
@ SPELL_EFFECT_DISENCHANT
@ SPELL_EFFECT_PROSPECTING
@ SPELL_EFFECT_ENCHANT_HELD_ITEM
@ SPELL_EFFECT_GIVE_ARTIFACT_POWER_NO_BONUS
@ SPELL_EFFECT_ENCHANT_ITEM
@ SPELL_EFFECT_CREATE_LOOT
@ SPELL_EFFECT_GAMEOBJECT_REPAIR
@ SPELL_EFFECT_SUMMON_RAF_FRIEND
@ SPELL_EFFECT_WEAPON_DAMAGE
@ SPELL_EFFECT_APPLY_GLYPH
@ SPELL_EFFECT_NORMALIZED_WEAPON_DMG
@ SPELL_EFFECT_SUMMON_PLAYER
@ SPELL_EFFECT_RESPEC_AZERITE_EMPOWERED_ITEM
@ SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER
@ SPELL_EFFECT_RESURRECT_PET
@ SPELL_EFFECT_SKIN_PLAYER_CORPSE
@ SPELL_EFFECT_RECHARGE_ITEM
@ SPELL_EFFECT_ADD_EXTRA_ATTACKS
@ SPELL_EFFECT_CHANGE_ACTIVE_COMBAT_TRAIT_CONFIG
@ SPELL_EFFECT_CHANGE_BATTLEPET_QUALITY
@ SPELL_EFFECT_WEAPON_PERCENT_DAMAGE
@ SPELL_EFFECT_GRANT_BATTLEPET_LEVEL
@ SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL
@ SPELL_EFFECT_PERSISTENT_AREA_AURA
@ SPELL_EFFECT_TELEPORT_WITH_SPELL_VISUAL_KIT_LOADING_SCREEN
@ SPELL_EFFECT_UNLOCK_GUILD_VAULT_TAB
@ SPELL_EFFECT_DISMISS_PET
@ SPELL_EFFECT_TALENT_SPEC_SELECT
@ SPELL_EFFECT_GRANT_BATTLEPET_EXPERIENCE
@ SPELL_EFFECT_GAMEOBJECT_SET_DESTRUCTION_STATE
@ SPELL_EFFECT_GAMEOBJECT_DAMAGE
@ SPELL_EFFECT_LEARN_SPELL
@ SPELL_EFFECT_GIVE_ARTIFACT_POWER
@ SPELL_EFFECT_REMOVE_TALENT
@ SPELL_EFFECT_TELEPORT_UNITS
@ SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC
@ SPELL_EFFECT_CREATE_TAMED_PET
@ SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY
@ SPELL_EFFECT_STEAL_BENEFICIAL_BUFF
@ SPELL_EFFECT_CREATE_ITEM
@ SPELL_EFFECT_APPLY_AURA
@ SPELL_EFFECT_LEARN_PET_SPELL
@ SPELL_CUSTOM_ERROR_NONE
@ SPELL_CUSTOM_ERROR_GM_ONLY
@ SPELL_ATTR0_ONLY_INDOORS
@ SPELL_ATTR0_ONLY_OUTDOORS
@ SPELL_ATTR0_ALLOW_WHILE_MOUNTED
@ SPELL_ATTR0_COOLDOWN_ON_EVENT
@ SPELL_ATTR0_NO_IMMUNITIES
@ SPELL_ATTR0_CANCELS_AUTO_ATTACK_COMBAT
@ SPELL_ATTR0_USES_RANGED_SLOT
@ SPELL_ATTR0_ALLOW_CAST_WHILE_DEAD
@ SPELL_ATTR0_ONLY_STEALTHED
@ SPELL_ATTR12_START_COOLDOWN_ON_CAST_START
@ SPELL_ATTR12_IGNORE_CASTING_DISABLED
@ SPELL_FAILED_TARGET_NOT_LOOTED
@ SPELL_FAILED_UNIT_NOT_INFRONT
@ SPELL_FAILED_NEED_EXOTIC_AMMO
@ SPELL_FAILED_NOT_INFRONT
@ SPELL_FAILED_FISHING_TOO_LOW
@ SPELL_FAILED_CANT_BE_MILLED
@ SPELL_FAILED_NOT_MOUNTED
@ SPELL_FAILED_EQUIPPED_ITEM_CLASS_OFFHAND
@ SPELL_FAILED_AFFECTING_COMBAT
@ SPELL_FAILED_CASTER_AURASTATE
@ SPELL_FAILED_EQUIPPED_ITEM_CLASS
@ SPELL_FAILED_WRONG_ARTIFACT_EQUIPPED
@ SPELL_FAILED_ITEM_AT_MAX_CHARGES
@ SPELL_FAILED_TARGET_NOT_PLAYER
@ SPELL_FAILED_CANT_UNTALENT
@ SPELL_FAILED_NOT_IN_RATED_BATTLEGROUND
@ SPELL_FAILED_FOOD_LOWLEVEL
@ SPELL_FAILED_GLYPH_INVALID_SPEC
@ SPELL_FAILED_ALREADY_HAVE_PET
@ SPELL_FAILED_WRONG_PET_FOOD
@ SPELL_FAILED_CUSTOM_ERROR
@ SPELL_FAILED_SUMMON_PENDING
@ SPELL_FAILED_BAD_IMPLICIT_TARGETS
@ SPELL_FAILED_CANT_UPGRADE_BATTLE_PET
@ SPELL_FAILED_ALREADY_HAVE_SUMMON
@ SPELL_FAILED_ALREADY_AT_FULL_POWER
@ SPELL_FAILED_NOT_TRADEABLE
@ SPELL_FAILED_ITEM_NOT_READY
@ SPELL_FAILED_TOO_SHALLOW
@ SPELL_FAILED_NOT_TRADING
@ SPELL_FAILED_NO_CHARGES_REMAIN
@ SPELL_FAILED_ITEM_NOT_FOUND
@ SPELL_FAILED_OUT_OF_RANGE
@ SPELL_FAILED_NOT_IN_BATTLEGROUND
@ SPELL_FAILED_EQUIPPED_ITEM
@ SPELL_FAILED_NOT_BEHIND
@ SPELL_FAILED_ALREADY_AT_FULL_HEALTH
@ SPELL_FAILED_PREVENTED_BY_MECHANIC
@ SPELL_FAILED_ALREADY_HAVE_CHARM
@ SPELL_FAILED_AZERITE_EMPOWERED_NO_CHOICES_TO_UNDO
@ SPELL_FAILED_DONT_REPORT
@ SPELL_FAILED_CANT_BE_SALVAGED_SKILL
@ SPELL_FAILED_AZERITE_EMPOWERED_ONLY
@ SPELL_FAILED_ON_USE_ENCHANT
@ SPELL_FAILED_WRONG_BATTLE_PET_TYPE
@ SPELL_FAILED_ONLY_BATTLEGROUNDS
@ SPELL_FAILED_NOT_IN_ARENA
@ SPELL_FAILED_ITEM_ALREADY_ENCHANTED
@ SPELL_FAILED_ONLY_STEALTHED
@ SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW
@ SPELL_FAILED_TARGET_IS_PLAYER_CONTROLLED
@ SPELL_FAILED_NO_ARTIFACT_EQUIPPED
@ SPELL_FAILED_ONLY_ABOVEWATER
@ SPELL_FAILED_TARGETS_DEAD
@ SPELL_FAILED_AURA_BOUNCED
@ SPELL_FAILED_GLYPH_NO_SPEC
@ SPELL_FAILED_CANT_BE_CHARMED
@ SPELL_FAILED_MAX_SOCKETS
@ SPELL_FAILED_CASTER_DEAD
@ SPELL_FAILED_BAD_TARGETS
@ SPELL_FAILED_ITEM_ENCHANT_TRADE_WINDOW
@ SPELL_FAILED_GLYPH_EXCLUSIVE_CATEGORY
@ SPELL_FAILED_TOO_MANY_OF_ITEM
@ SPELL_FAILED_CANT_BE_SALVAGED
@ SPELL_FAILED_TARGET_UNSKINNABLE
@ SPELL_FAILED_NO_ACTIONS
@ SPELL_FAILED_UNIQUE_GLYPH
@ SPELL_FAILED_NEED_MORE_ITEMS
@ SPELL_FAILED_ONLY_OUTDOORS
@ SPELL_FAILED_NO_VALID_TARGETS
@ SPELL_FAILED_INVALID_GLYPH
@ SPELL_FAILED_LOW_CASTLEVEL
@ SPELL_FAILED_CANT_BE_PROSPECTED
@ SPELL_FAILED_ONLY_MOUNTED
@ SPELL_FAILED_LINE_OF_SIGHT
@ SPELL_FAILED_VISION_OBSCURED
@ SPELL_FAILED_EQUIPPED_ITEM_CLASS_MAINHAND
@ SPELL_FAILED_SPELL_IN_PROGRESS
@ SPELL_FAILED_TARGET_LOCKED_TO_RAID_INSTANCE
@ SPELL_FAILED_REQUIRES_SPELL_FOCUS
@ SPELL_FAILED_TOTEM_CATEGORY
@ SPELL_FAILED_SPELL_UNAVAILABLE
@ SPELL_FAILED_REQUIRES_AREA
@ SPELL_FAILED_INTERRUPTED
@ SPELL_FAILED_ONLY_INDOORS
@ SPELL_FAILED_NOT_ON_TAXI
@ SPELL_FAILED_TARGET_FRIENDLY
@ SPELL_ATTR13_PERIODIC_REFRESH_EXTENDS_DURATION
constexpr SkillType SkillByLockType(LockType locktype)
@ SPELL_ATTR4_BOUNCY_CHAIN_MISSILES
@ SPELL_ATTR4_IGNORE_DEFAULT_ARENA_RESTRICTIONS
@ SPELL_ATTR4_SUPPRESS_WEAPON_PROCS
@ SPELL_ATTR4_CLASS_TRIGGER_ONLY_ON_TARGET
@ SPELL_ATTR4_NOT_IN_ARENA_OR_RATED_BATTLEGROUND
@ SPELL_ATTR4_USE_FACING_FROM_SPELL
@ SPELL_ATTR4_AURA_NEVER_BOUNCES
@ SPELL_ATTR4_AURA_BOUNCE_FAILS_SPELL
@ SPELL_ATTR4_ALLOW_CAST_WHILE_CASTING
@ CREATURE_TYPE_FLAG_COLLIDE_WITH_MISSILES
@ SPELL_ATTR8_ONLY_PLAYERS_CAN_CAST_THIS_SPELL
@ SPELL_ATTR8_IGNORE_SANCTUARY
@ SPELL_ATTR8_HEAL_PREDICTION
@ SPELL_ATTR8_CAN_HIT_AOE_UNTARGETABLE
@ SPELL_ATTR8_HASTE_AFFECTS_DURATION
@ SPELL_ATTR8_AURA_POINTS_ON_CLIENT
@ SPELL_ATTR8_REQUIRES_LOCATION_TO_BE_ON_LIQUID_SURFACE
@ SPELL_ATTR6_ORIGINATE_FROM_CONTROLLER
@ SPELL_ATTR6_DOESNT_RESET_SWING_TIMER_IF_INSTANT
@ SPELL_ATTR6_DO_NOT_CONSUME_RESOURCES
@ SPELL_ATTR6_TAPS_IMMEDIATELY
@ SPELL_AURA_DISABLE_CASTING_EXCEPT_ABILITIES
@ SPELL_AURA_DISABLE_ATTACKING_EXCEPT_ABILITIES
@ SPELL_AURA_OBS_MOD_HEALTH
@ SPELL_AURA_MOD_IGNORE_SHAPESHIFT
@ SPELL_AURA_PERIODIC_MANA_LEECH
@ SPELL_AURA_MOD_POSSESS_PET
@ SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS
@ SPELL_AURA_MOD_NO_ACTIONS
@ SPELL_AURA_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_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, Player *caster)
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
@ MOVEMENTFLAG_STRAFE_LEFT
@ MOVEMENTFLAG_STRAFE_RIGHT
@ UNIT_FLAG_NON_ATTACKABLE
@ UNIT_FLAG_PLAYER_CONTROLLED
ProcFlagsHit createProcHitMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missCondition)
@ CURRENT_CHANNELED_SPELL
@ CURRENT_AUTOREPEAT_SPELL
@ UNIT_STATE_ATTACK_PLAYER
#define ARTIFACTS_ALL_WEAPONS_GENERAL_WEAPON_EQUIPPED_PASSIVE
float DegToRad(float degrees)
T RoundToInterval(T &num, T floor, T ceil)
constexpr std::underlying_type< E >::type AsUnderlyingType(E enumValue)
T CalculatePct(T base, U pct)
#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)
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
bool HasDynamicFlag(uint32 flag) const
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 Satisfy(AccessRequirement const *ar, uint32 target_map, TransferAbortParams *params=nullptr, bool report=false)
bool IsInSameRaidWith(Player const *p) const
bool HasItemFitToSpellRequirements(SpellInfo const *spellInfo, Item const *ignoreItem=nullptr) const
ObjectGuid GetSummonedBattlePetGUID() const
bool IsImmunedToSpellEffect(SpellInfo const *spellInfo, SpellEffectInfo const &spellEffectInfo, WorldObject const *caster, bool requireImmunityPurgesEffectAttribute=false) const override
void SetRuneCooldown(uint8 index, uint32 cooldown)
void SendDirectMessage(WorldPacket const *data) const
uint16 GetSkillValue(uint32 skill) const
void UpdatePotionCooldown(Spell *spell=nullptr)
bool CanTameExoticPets() const
uint32 GetRuneBaseCooldown() const
bool HasItemCount(uint32 item, uint32 count=1, bool inBankAlso=false) const
bool HasCurrency(uint32 id, uint32 amount) const
bool CanUseBattlegroundObject(GameObject *gameobject) const
bool InBattleground() const
Item * GetItemByEntry(uint32 entry, ItemSearchLocation where=ItemSearchLocation::Default) const
std::vector< uint32 > const & GetGlyphs(uint8 spec) const
PetStable * GetPetStable()
bool IsLoading() const override
bool HasItemTotemCategory(uint32 TotemCategory) const
uint8 GetRunesState() const
bool GetCommandStatus(uint32 command) const
bool HasSummonPending() const
WorldSession * GetSession() const
void CastItemCombatSpell(DamageInfo const &damageInfo)
bool CanNoReagentCast(SpellInfo const *spellInfo) const
uint32 DestroyItemCount(uint32 item, uint32 count, bool update, bool unequip_check=false)
uint32 GetRuneCooldown(uint8 index) const
void SendTameFailure(PetTameResult result)
Battleground * GetBattleground() const
TradeData * GetTradeData() const
uint32 GetFreeInventorySlotCount(EnumFlag< ItemSearchLocation > location=ItemSearchLocation::Inventory) const
bool IsGameMaster() const
void RemoveCurrency(uint32 id, int32 amount, CurrencyDestroyReason destroyReason=CurrencyDestroyReason::Cheat)
uint8 GetActiveTalentGroup() const
Player * GetSelectedPlayer() const
Item * GetWeaponForAttack(WeaponAttackType attackType, bool useable=false) const
bool HasSpell(uint32 spell) const override
Item * GetItemByGuid(ObjectGuid guid) const
void UpdatePvP(bool state, bool override=false)
Spell * m_spellModTakingSpell
InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 item, uint32 count, uint32 *no_space_count=nullptr) const
bool HasEnoughMoney(uint64 amount) const
ProcReflectDelayed(Unit *owner, ObjectGuid casterGuid)
bool Execute(uint64, uint32) override
void SetPitch(float pitch)
SpellDestination const * GetSrc() const
void SetItemTarget(Item *item)
void RemoveObjectTarget()
ObjectGuid m_objectTargetGUID
WorldObject * GetObjectTarget() const
ObjectGuid GetUnitTargetGUID() const
void ModDst(Position const &pos)
GameObject * GetGOTarget() const
void SetTradeItemTarget(Player *caster)
Corpse * GetCorpseTarget() const
void SetDst(float x, float y, float z, float orientation, uint32 mapId=MAPID_INVALID)
void SetSpeed(float speed)
void SetSrc(float x, float y, float z)
void SetTargetFlag(SpellCastTargetFlags flag)
SpellDestination const * GetDst() const
void SetGOTarget(GameObject *target)
void UpdateTradeSlotItem()
ObjectGuid GetCorpseTargetGUID() const
ObjectGuid GetObjectTargetGUID() const
void SetUnitTarget(Unit *target)
ObjectGuid GetItemTargetGUID() const
WorldObject * m_objectTarget
Item * GetItemTarget() const
uint32 GetTargetMask() const
uint32 GetItemTargetEntry() const
Unit * GetUnitTarget() const
ObjectGuid m_itemTargetGUID
void Update(WorldObject *caster)
void ModSrc(Position const &pos)
void Write(WorldPackets::Spells::SpellTargetData &data)
Position const * GetSrcPos() const
ObjectGuid GetGOTargetGUID() const
WorldLocation const * GetDstPos() const
bool HasRadius(SpellTargetIndex targetIndex) const
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
bool HasGlobalCooldown(SpellInfo const *spellInfo) const
void ResetCooldown(uint32 spellId, bool update=false)
bool IsReady(SpellInfo const *spellInfo, uint32 itemId=0) const
void AddGlobalCooldown(SpellInfo const *spellInfo, Duration duration)
void RestoreCharge(uint32 chargeCategoryId)
void CancelGlobalCooldown(SpellInfo const *spellInfo)
void HandleCooldowns(SpellInfo const *spellInfo, Item const *item, Spell *spell=nullptr)
bool HasCooldown(SpellInfo const *spellInfo, uint32 itemId=0) const
SpellTargetCheckTypes GetCheckType() const
SpellTargetReferenceTypes GetReferenceType() const
SpellTargetSelectionCategories GetSelectionCategory() const
SpellTargetObjectTypes GetObjectType() const
float CalcDirectionAngle() const
Targets GetTarget() const
uint32 RequiresSpellFocus
std::array< int32, MAX_SPELL_TOTEMS > Totem
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
bool HasEffect(SpellEffectName effect) const
SpellCastResult CheckShapeshift(uint32 form) const
std::array< uint16, MAX_SPELL_TOTEMS > TotemCategory
uint64 GetAllEffectsMechanicMask() const
bool IsRequiringDeadTarget() const
int32 NumNonDiminishedTargets
uint64 GetMechanicImmunityMask(Unit const *caster) const
std::vector< Milliseconds > EmpowerStageThresholds
std::array< int16, MAX_SPELL_REAGENTS > ReagentCount
bool IsCooldownStartedOnEvent() const
EnumFlag< SpellAuraInterruptFlags > ChannelInterruptFlags
::Difficulty const Difficulty
SpellRangeEntry const * RangeEntry
uint32 CalcCastTime(Spell *spell=nullptr) const
SpellCastResult CheckLocation(uint32 map_id, uint32 zone_id, uint32 area_id, Player const *player=nullptr) const
uint32 GetRecoveryTime() const
DiminishingReturnsType GetDiminishingReturnsGroupType() const
uint32 ExcludeCasterAuraState
int32 GetMaxDuration() const
bool HasInitialAggro() const
DiminishingGroup GetDiminishingReturnsGroupForSpell() const
SpellCastResult CheckTarget(WorldObject const *caster, WorldObject const *target, bool implicit=true) const
struct SpellInfo::@326 SqrtDamageAndHealingDiminishing
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
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
void SelectImplicitTargetObjectTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType)
SpellInfo const * GetSpellInfo() const
float m_damageMultipliers[MAX_SPELL_EFFECTS]
SpellCastResult CheckItems(int32 *param1, int32 *param2) const
void ExecuteLogEffectSummonObject(SpellEffectName effect, WorldObject *obj)
void CallScriptAfterCastHandlers()
std::vector< SpellPowerCost > m_powerCost
void AddCorpseTarget(Corpse *target, uint32 effectMask)
uint64 CalculateDelayMomentForDst(float launchDelay) const
GameObject * SearchSpellFocus()
bool CheckSpellCancelsStun(int32 *param1) const
std::vector< SpellScript * > m_loadedScripts
GameObject * gameObjTarget
void PrepareTriggersExecutedOnHit()
SpellMissInfo targetMissInfo
bool m_referencedFromCurrentSpell
void PreprocessSpellLaunch(TargetInfo &targetInfo)
void UpdateDelayMomentForUnitTarget(Unit *unit, uint64 hitDelay)
bool CheckSpellCancelsNoActions(int32 *param1) const
bool HasPowerTypeCost(Powers power) const
void UpdateSpellHealPrediction(WorldPackets::Spells::SpellHealPrediction &healPrediction, bool withPeriodic)
void SelectImplicitTrajTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType)
void ExecuteLogEffectUnsummonObject(SpellEffectName effect, WorldObject *obj)
uint32 m_channelTargetEffectMask
void ExecuteLogEffectResurrect(SpellEffectName effect, Unit *target)
void cast(bool skipCheck=false)
void ExecuteLogEffectDestroyItem(SpellEffectName effect, uint32 entry)
void SendChannelStart(uint32 duration)
void ExecuteLogEffectOpenLock(SpellEffectName effect, Object *obj)
int64 GetCorpseTargetCountForEffect(SpellEffIndex effect) const
SpellCastTargets m_targets
void SelectImplicitNearbyTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, SpellTargetIndex targetIndex, uint32 effMask)
static bool CanIncreaseRangeByMovement(Unit const *unit)
std::unique_ptr< PathGenerator > m_preGeneratedPath
Difficulty GetCastDifficulty() const
void CallScriptBeforeHitHandlers(SpellMissInfo missInfo)
void SelectEffectImplicitTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, SpellTargetIndex targetIndex, uint32 &processedEffectMask)
SpellCastResult CheckRuneCost() const
void CallScriptCalcDamageHandlers(SpellEffectInfo const &spellEffectInfo, Unit *victim, int32 &damage, int32 &flatMod, float &pctMod)
void SelectExplicitTargets()
SpellCastResult CanOpenLock(SpellEffectInfo const &effect, uint32 lockid, SkillType &skillid, int32 &reqSkillValue, int32 &skillValue)
void DoTriggersOnSpellHit(Unit *unit)
TriggerCastFlags _triggeredCastFlags
bool IsAutoRepeat() const
void HandleEffects(Unit *pUnitTarget, Item *pItemTarget, GameObject *pGoTarget, Corpse *pCorpseTarget, SpellEffectInfo const &spellEffectInfo, SpellEffectHandleMode mode)
void prepareDataForTriggerSystem()
SpellEffectHandleMode effectHandleMode
bool IsValidDeadOrAliveTarget(Unit const *target) const
SpellCastResult CheckMovement() const
std::unique_ptr< EmpowerData > m_empower
void DoProcessTargetContainer(Container &targetContainer)
bool IsNeedSendToClient() const
WorldObject * SearchNearbyTarget(SpellEffectInfo const &spellEffectInfo, float range, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectionType, ConditionContainer const *condList=nullptr)
bool IsIgnoringCooldowns() const
void SelectImplicitDestDestTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, SpellTargetIndex targetIndex)
std::pair< ProcFlagsInit, ProcFlagsInit > FinalizeDataForTriggerSystem(bool positive) const
std::vector< TargetInfo > m_UniqueTargetInfo
SpellDestination m_destTargets[MAX_SPELL_EFFECTS]
void _handle_finish_phase()
void UpdateDelayMomentForDst(uint64 hitDelay)
bool CanExecuteTriggersOnHit(Unit *unit, SpellInfo const *triggeredByAura=nullptr) const
void PrepareTargetProcessing()
Trinity::unique_weak_ptr< Spell > GetWeakPtr() const
void SetExecutedCurrently(bool yes)
void AddUnitTarget(Unit *target, uint32 effectMask, bool checkIfValid=true, bool implicit=true, Position const *losPosition=nullptr)
bool IsEmpowerSpell() const
ObjectGuid m_originalCastId
uint8 m_delayAtDamageCount
static Spell const * ExtractSpellFromEvent(BasicEvent *event)
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 ExecuteLogEffectExtraAttacks(SpellEffectName effect, Unit *victim, uint32 numAttacks)
WeaponAttackType m_attackType
void ExecuteLogEffectTakeTargetPower(SpellEffectName effect, Unit *target, Powers powerType, uint32 points, float amplitude)
void _cast(bool skipCheck=false)
void SendInterrupted(uint8 result)
bool IsProcDisabled() const
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 ExecuteLogEffectDurabilityDamage(SpellEffectName effect, Unit *victim, int32 itemId, int32 amount)
void SendMountResult(MountResult result)
void AddGOTarget(GameObject *target, uint32 effectMask)
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, SpellCastVisual spellVisual, ObjectGuid cast_count, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE, int32 *param1=nullptr, int32 *param2=nullptr)
void HandleThreatSpells()
std::vector< CorpseTargetInfo > m_UniqueCorpseTargetInfo
void CancelGlobalCooldown()
bool CheckSpellCancelsAuraEffect(AuraType auraType, int32 *param1) const
void SearchChainTargets(std::list< WorldObject * > &targets, uint32 chainTargets, WorldObject *target, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectType, SpellEffectInfo const &spellEffectInfo, bool isChainHeal)
void SelectImplicitAreaTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, SpellTargetIndex targetIndex, uint32 effMask)
bool CheckSpellCancelsSilence(int32 *param1) const
SpellEffectValue effectValue
void CallScriptOnCastHandlers()
void AddDestTarget(SpellDestination const &dest, uint32 effIndex)
int64 GetGameObjectTargetCountForEffect(SpellEffIndex effect) const
void SetEmpowerReleasedByClient(bool release)
void _handle_immediate_phase()
void CallScriptBeforeCastHandlers()
bool CheckSpellCancelsCharm(int32 *param1) const
SpellCustomErrors m_customError
void SelectImplicitLineTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, SpellTargetIndex targetIndex, uint32 effMask)
bool CallScriptEffectHandlers(SpellEffIndex effIndex, SpellEffectHandleMode mode)
std::vector< GOTargetInfo > m_UniqueGOTargetInfo
void DoSpellEffectHit(Unit *unit, SpellEffectInfo const &spellEffectInfo, TargetInfo &targetInfo)
HitTriggerSpellList m_hitTriggerSpells
void SetSpellValue(CastSpellExtraArgsInit::SpellValueOverride const &value)
void SelectImplicitTargetDestTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, SpellTargetIndex targetIndex)
void SetDelayStart(uint64 m_time)
void CallScriptOnPrecastHandler()
void SelectImplicitCasterDestTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, SpellTargetIndex targetIndex)
SpellEffectInfo const * effectInfo
Unit * GetUnitCasterForEffectHandlers() const
SpellInfo const * m_triggeredByAuraSpell
uint64 handle_delayed(uint64 t_offset)
void CallScriptOnResistAbsorbCalculateHandlers(DamageInfo const &damageInfo, uint32 &resistAmount, int32 &absorbAmount)
bool CheckSpellCancelsPacify(int32 *param1) const
CurrentSpellTypes GetCurrentContainer() const
uint32 m_applyMultiplierMask
SpellSchoolMask m_spellSchoolMask
void SendSpellExecuteLog()
Optional< int32 > GetPowerTypeCostAmount(Powers power) const
WorldObject * GetCaster() const
void SendChannelUpdate(uint32 time, Optional< SpellCastResult > result={})
void SelectSpellTargets()
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(SpellEffectName effect)
void SelectImplicitChainTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, WorldObject *target, uint32 effMask)
int32 CallScriptCalcCastTimeHandlers(int32 originalCastTime)
SpellCastResult CallScriptCheckCastHandlers()
void ExecuteLogEffectCreateItem(SpellEffectName effect, uint32 entry)
void CallScriptCalcHealingHandlers(SpellEffectInfo const &spellEffectInfo, Unit *victim, int32 &healing, int32 &flatMod, float &pctMod)
void InitExplicitTargets(SpellCastTargets const &targets)
bool IsWithinLOS(WorldObject const *source, WorldObject const *target, bool targetAsSourceLocation, VMAP::ModelIgnoreFlags ignoreFlags) const
void SendPetCastResult(SpellCastResult result, int32 *param1=nullptr, int32 *param2=nullptr) const
WorldLocation * destTarget
bool CheckSpellCancelsFear(int32 *param1) const
bool CanReleaseEmpowerSpell() const
bool m_scriptWaitsForSpellHit
void SelectImplicitCasterObjectTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType)
void SetReferencedFromCurrent(bool yes)
void SelectEffectTypeImplicitTargets(SpellEffectInfo const &spellEffectInfo)
void update(uint32 difftime)
void SelectImplicitConeTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, SpellTargetIndex targetIndex, uint32 effMask)
uint64 GetDelayStart() const
bool CheckScriptEffectImplicitTargets(uint32 effIndex, uint32 effIndexToCheck)
ProcFlagsInit m_procVictim
std::vector< SpellLogEffect > _executeLogEffects
void CallScriptSuccessfulDispel(SpellEffIndex effIndex)
void DoEffectOnLaunchTarget(TargetInfo &targetInfo, float multiplier, SpellEffectInfo const &spellEffectInfo)
uint64 GetDelayMoment() const
void AddItemTarget(Item *item, uint32 effectMask)
int32 GetUnitTargetIndexForEffect(ObjectGuid const &target, SpellEffIndex effect) const
void CallScriptEmpowerCompletedHandlers(int32 completedStagesCount)
void CallScriptCalcCritChanceHandlers(Unit const *victim, float &chance)
SpellValue *const m_spellValue
void SelectImplicitChannelTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType)
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 MovePosition(Position &pos, WorldObject const *from, float dist, float angle) const
SpellMissInfo PreprocessSpellHit(Unit *unit, TargetInfo &targetInfo)
SpellCastResult CheckCasterAuras(int32 *param1) const
static uint32 GetSearcherTypeMask(SpellInfo const *spellInfo, SpellEffectInfo const &spellEffectInfo, SpellTargetObjectTypes objType, ConditionContainer const *condList)
static void SearchTargets(SEARCHER &searcher, uint32 containerMask, WorldObject *referer, Position const *pos, float radius)
std::vector< ItemTargetInfo > m_UniqueItemInfo
bool IsAutoActionResetSpell() const
ProcFlagsInit m_procAttacker
ObjectGuid m_castItemGUID
SpellCastVisual m_SpellVisual
Spell(WorldObject *caster, SpellInfo const *info, TriggerCastFlags triggerFlags, ObjectGuid originalCasterGUID=ObjectGuid::Empty, ObjectGuid originalCastId=ObjectGuid::Empty)
int64 GetUnitTargetCountForEffect(SpellEffIndex effect) const
SpellCastResult CheckPower() const
void CallScriptDestinationTargetSelectHandlers(SpellDestination &target, SpellEffIndex effIndex, SpellImplicitTargetInfo const &targetType)
void UpdateSpellCastDataTargets(WorldPackets::Spells::SpellCastData &data)
Writes miss and hit targets for a SMSG_SPELL_GO packet.
SpellInfo const *const m_spellInfo
std::vector< T > & GetExecuteLogEffectTargets(SpellEffectName effect, Optional< std::vector< T > > SpellLogEffect::*member)
bool HasGlobalCooldown() const
void FinishTargetProcessing()
void CallScriptOnHitHandlers()
SpellCastResult CheckRange(bool strict) const
void CallScriptObjectTargetSelectHandlers(WorldObject *&target, SpellEffIndex effIndex, SpellImplicitTargetInfo const &targetType)
void TakeRunePower(bool didHit)
void CallScriptObjectAreaTargetSelectHandlers(std::list< WorldObject * > &targets, SpellEffIndex effIndex, SpellImplicitTargetInfo const &targetType)
SpellCastResult CheckArenaAndRatedBattlegroundCastRules()
void CallScriptAfterHitHandlers()
bool CanAutoCast(Unit *target)
ObjectGuid GetSummonerGUID() const
void ForwardThreatForAssistingMe(Unit *assistant, float baseAmount, SpellInfo const *spell=nullptr, bool ignoreModifiers=false)
== AFFECT OTHERS' THREAT LISTS ==
void AddThreat(Unit *target, float amount, SpellInfo const *spell=nullptr, bool ignoreModifiers=false, bool ignoreRedirects=false)
== AFFECT MY THREAT LIST ==
Utility class to enable range for loop syntax for multimap.equal_range uses.
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
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)
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
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
void UpdateInterruptMask()
void IncrDiminishing(SpellInfo const *auraSpellInfo)
void AddChannelObject(ObjectGuid guid)
void SetChannelSpellId(uint32 channelSpellId)
bool IsFullHealth() const
bool HasUnitFlag2(UnitFlags2 flags) const
float GetCombatReach() const override
int32 GetMaxPower(Powers power) const
int32 HealBySpell(HealInfo &healInfo, bool critical=false)
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage const *log)
bool IsStandState() const
bool IsSilenced(SpellSchoolMask schoolMask) const
TempSummon * ToTempSummon()
CharmInfo * GetCharmInfo()
ObjectGuid GetCharmerOrOwnerGUID() const override
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
bool HasUnitMovementFlag(uint32 f) 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 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
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
Optional< SpellTargetedHealPrediction > HealPrediction
Duration< Milliseconds, uint32 > EmpowerDuration
Duration< Milliseconds, uint32 > MinHoldTime
std::vector< Duration< Milliseconds, uint32 > > StageDurations
std::vector< ObjectGuid > Targets
Optional< SpellChannelStartInterruptImmunities > InterruptImmunities
Duration< Milliseconds, uint32 > HoldAtMaxTime
WorldPacket const * Write() override
std::vector< Duration< Milliseconds, uint32 > > StageDurations
Duration< Milliseconds, int32 > TimeRemaining
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
LocaleConstant GetSessionDbLocaleIndex() const
uint32 GetRecruiterId() const
uint32 GetAccountId() const
CollectionMgr * GetCollectionMgr() const
BattlePets::BattlePetMgr * GetBattlePetMgr() const
uint32 GetVirtualRealmAddress()
static constexpr uint16 MAX_BATTLE_PET_LEVEL
bool IsDisabledFor(DisableType type, uint32 entry, WorldObject const *ref, uint8 flags)
TC_GAME_API WorldObject * GetWorldObject(WorldObject const &, ObjectGuid const &)
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
TC_GAME_API GameObject * GetGameObject(WorldObject const &u, ObjectGuid const &guid)
TC_GAME_API Player * FindPlayer(ObjectGuid const &)
TC_GAME_API Player * GetPlayer(Map const *, ObjectGuid const &guid)
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
TC_GAME_API Corpse * GetCorpse(WorldObject const &u, ObjectGuid const &guid)
TC_GAME_API Creature * GetCreatureOrPetOrVehicle(WorldObject const &, ObjectGuid const &)
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)
CellCoord ComputeCellCoord(float x, float y)
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 VisitGridObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
bool IsPetSpecialization() const
Condition const * mLastFailedCondition
CreatureDifficulty const * GetDifficulty(Difficulty difficulty) const
bool IsTameable(bool canTameExotic, CreatureDifficulty const *creatureDifficulty) const
uint32 GetNoDamageImmune() const
uint8 GlyphExclusiveCategoryID
uint32 GetRequiredSkillRank() const
uint32 GetBaseItemLevel() const
uint32 GetMaxStackSize() const
InventoryType GetInventoryType() const
uint8 GetArtifactID() const
uint32 GetItemLimitCategory() const
bool HasFlag(ItemFlags flag) const
uint32 GetSubClass() const
std::array< uint8, MAX_LOCK_CASE > Type
std::array< uint16, MAX_LOCK_CASE > Skill
std::array< int32, MAX_LOCK_CASE > Index
uint32 GetMovementFlags() const
constexpr void SetOrientation(float orientation)
constexpr float GetPositionX() const
constexpr float GetPositionY() const
float GetExactDist2d(const float x, const float y) const
float GetRelativeAngle(float x, float y) const
float GetExactDist(float x, float y, float z) const
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