36#include "G3DPosition.hpp"
131 m_itemTargetEntry(0), m_pitch(0.0f), m_speed(0.0f)
136 m_targetMask(spellCastRequest.Target.Flags), m_objectTarget(nullptr), m_itemTarget(nullptr),
137 m_objectTargetGUID(spellCastRequest.Target.
Unit), m_itemTargetGUID(spellCastRequest.Target.
Item),
138 m_itemTargetEntry(0), m_pitch(0.0f), m_speed(0.0f), m_strTarget(spellCastRequest.Target.
Name)
475 EffectBasePoints[spellEffectInfo.EffectIndex] = spellEffectInfo.CalcBaseValue(caster,
nullptr, 0, -1);
506m_spellValue(new
SpellValue(m_spellInfo, caster)), _spellEvent(nullptr)
536 if (!originalCasterGUID.
IsEmpty())
663 Unit* unit =
nullptr;
719 Unit* redirect =
nullptr;
733 if (redirect && (redirect != target))
744 uint32 processedAreaEffectsMask = 0;
750 if (!spellEffectInfo.IsEffect())
782 return target.EffectMask & effectMask;
796 return target.EffectMask & effectMask && target.MissCondition != SPELL_MISS_IMMUNE && target.MissCondition != SPELL_MISS_IMMUNE2;
799 if (!anyNonImmuneTargetFound)
818 uint32 mask = (1 << spellEffectInfo.EffectIndex);
821 if (ihit->EffectMask & mask)
868 return uint64(std::floor(launchDelay * 1000.0f));
891 return targetInfo.TargetGUID == unit->GetGUID();
894 uint64 oldDelay = itr->TimeDelay;
895 itr->TimeDelay = hitDelay;
904 return itr.TimeDelay && itr.TimeDelay < smallest.TimeDelay;
930 if (effectMask & processedEffectMask)
936 if (effects[j].IsEffect() &&
945 effectMask |= 1 << j;
948 processedEffectMask |= effectMask;
988 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT_SRC");
1005 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT_DEST");
1019 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT");
1029 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target category");
1038 ABORT_MSG(
"Spell::SelectImplicitChannelTargets: received not implemented target reference type");
1043 if (!channeledSpell)
1100 ABORT_MSG(
"Spell::SelectImplicitChannelTargets: received not implemented target type");
1109 ABORT_MSG(
"Spell::SelectImplicitNearbyTargets: received not implemented target reference type");
1130 ABORT_MSG(
"Spell::SelectImplicitNearbyTargets: received not implemented selection check type");
1139 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));
1180 dest =
SpellDestination(st->target_X, st->target_Y, st->target_Z, st->target_Orientation);
1184 if (randomRadius > 0.0f)
1200 float randomRadius = 0.0f;
1240 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);
1251 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);
1262 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);
1271 if (randomRadius > 0.0f)
1282 ABORT_MSG(
"Spell::SelectImplicitNearbyTargets: received not implemented target object type");
1308 if (coneAngle == 0.0f)
1315 std::list<WorldObject*> targets;
1326 SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellConeTargetCheck> >(searcher, containerTypeMask,
m_caster,
m_caster, radius + extraSearchRadius);
1330 if (!targets.empty())
1369 if (ihit->EffectMask & (1 << spellEffectInfo.
EffectIndex))
1378 ABORT_MSG(
"Spell::SelectImplicitAreaTargets: received not implemented target reference type");
1400 ABORT_MSG(
"Spell::SelectImplicitAreaTargets: received not implemented target reference type");
1405 std::list<WorldObject*> targets;
1411 if (
Vehicle const* vehicleKit = unit->GetVehicleKit())
1413 if (
Unit* passenger = vehicleKit->GetPassenger(seat))
1414 targets.push_back(passenger);
1453 if (!targets.empty())
1460 else if (targets.size() > maxTargets)
1461 targets.resize(maxTargets);
1493 dest =
SpellDestination(st->target_X, st->target_Y, st->target_Z, st->target_Orientation, (
int32)st->target_mapId);
1495 dest =
SpellDestination(st->target_X, st->target_Y, st->target_Z, st->target_Orientation);
1508 float dist =
frand(minDist, maxDist);
1510 float angle =
rand_norm() *
static_cast<float>(
M_PI * 35.0f / 180.0f) -
static_cast<float>(
M_PI * 17.5f / 180.0f);
1517 liquidLevel = liquidData.
level;
1519 if (liquidLevel <= ground)
1527 if (ground + 0.75 > liquidLevel)
1545 float dist = spellEffectInfo.
CalcRadius(unitCaster, targetIndex);
1562 return static_cast<float>(
M_PI);
1565 return static_cast<float>(
M_PI / 2);
1567 return static_cast<float>(
M_PI / 4);
1569 return static_cast<float>(3 *
M_PI / 4);
1572 return static_cast<float>(-
M_PI / 2);
1574 return static_cast<float>(-
M_PI / 4);
1576 return static_cast<float>(-3 *
M_PI / 4);
1596 if (
WorldObject const* summoner = casterSummon->GetSummoner())
1612 dist = objSize + (dist - objSize);
1619 static float const DefaultTotemDistance = 3.0f;
1620 if (!spellEffectInfo.
HasRadius(targetIndex))
1621 dist = DefaultTotemDistance;
1662 float dist = spellEffectInfo.
CalcRadius(
nullptr, targetIndex);
1734 bool checkIfValid =
true;
1740 checkIfValid =
false;
1747 target = unitCaster->GetGuardianPet();
1751 if (unitCaster->IsSummon())
1752 target = unitCaster->ToTempSummon()->GetSummonerUnit();
1756 target = unitCaster->GetVehicleBase();
1767 if (vehicleBase->IsVehicle())
1772 if (!creatureCaster->GetTapList().empty())
1829 for (
size_t k = spellEffectInfo.
EffectIndex; k < m_spellInfo->GetEffects().
size(); ++k)
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);
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)
2183 if (!containerTypeMask)
2189 SearchTargets<Trinity::WorldObjectLastSearcher<Trinity::WorldObjectSpellNearbyTargetCheck>>(searcher, containerTypeMask,
m_caster,
m_caster, range);
2198 if (!containerTypeMask)
2205 SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellAreaTargetCheck>>(searcher, containerTypeMask,
m_caster, position, range + extraSearchRadius);
2212 float jumpRadius = 0.0f;
2238 float searchRadius = [&]()
2246 return jumpRadius * chainTargets;
2250 std::list<WorldObject*> tempTargets;
2253 tempTargets.remove(target);
2265 while (chainTargets)
2268 std::list<WorldObject*>::iterator foundItr = tempTargets.end();
2273 for (std::list<WorldObject*>::iterator itr = tempTargets.begin(); itr != tempTargets.end(); ++itr)
2277 uint32 deficit = unit->GetMaxHealth() - unit->GetHealth();
2281 maxHPDeficit = deficit;
2289 for (std::list<WorldObject*>::iterator itr = tempTargets.begin(); itr != tempTargets.end(); ++itr)
2291 bool isBestDistanceMatch = foundItr != tempTargets.end() ? chainSource->
GetDistanceOrder(*itr, *foundItr) : chainSource->
IsWithinDist(*itr, jumpRadius);
2292 if (!isBestDistanceMatch)
2305 if (foundItr == tempTargets.end())
2309 chainSource = *foundItr;
2311 targets.push_back(*foundItr);
2312 tempTargets.erase(foundItr);
2408 if (!spellEffectInfo.IsEffect() || !
CheckEffectTarget(target, spellEffectInfo, losPosition))
2409 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2422 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2431 ihit->EffectMask |= effectMask;
2444 targetInfo.
IsCrit =
false;
2460 return (target.EffectMask & effectMask) != 0;
2467 missileSource = previousTarget;
2469 targetInfo.
TimeDelay += previousTargetItr->TimeDelay;
2516 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2529 ihit->EffectMask |= effectMask;
2569 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2580 ihit->EffectMask |= effectMask;
2596 if (!spellEffectInfo.IsEffect())
2597 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2610 ihit->EffectMask |= effectMask;
2655 if (uniqueTargetInfo.MissCondition ==
SPELL_MISS_NONE && uniqueTargetInfo.EffectMask & (1 << effect))
2657 if (uniqueTargetInfo.TargetGUID == target)
2671 return targetInfo.MissCondition == SPELL_MISS_NONE && targetInfo.EffectMask & (1 << effect);
2679 return targetInfo.EffectMask & (1 << effect);
2687 return targetInfo.EffectMask & (1 << effect);
2695 return targetInfo.EffectMask & (1 << effect);
2761 if (unit->
IsAlive() != IsAlive)
2767 if (_spellHitTarget)
2783 if (_spellHitTarget)
2805 if (canEffectTrigger && !procAttacker && !procVictim)
2807 bool positive =
true;
2815 if (EffectMask && !(EffectMask & (1 << i)))
2875 bool hasHealing =
false;
2876 std::unique_ptr<DamageInfo> spellDamageInfo;
2877 std::unique_ptr<HealInfo> healInfo;
2893 spell->
m_healing = healInfo->GetEffectiveHeal();
2899 bool hasDamage =
false;
2928 damageInfo.
damage = victimCreature->CalculateDamageForSparring(damageInfo.
attacker, damageInfo.
damage);
2939 if (canEffectTrigger)
2947 if (!hasHealing && !hasDamage)
2953 if (canEffectTrigger)
2955 spellDamageInfo = std::make_unique<DamageInfo>(damageInfo,
NODAMAGE, spell->
m_attackType, hitMask);
2969 if (canEffectTrigger)
2995 if (unitCaster->IsPlayer())
2996 targetCreature->SetTappedBy(unitCaster);
3008 if (_spellHitTarget)
3012 if (
CreatureAI* hitTargetAI = cHitTarget->AI())
3022 if (
AuraApplication* aurApp = HitAura->GetApplicationOfTarget(_spellHitTarget->GetGUID()))
3025 uint32 effMask = EffectMask & aurApp->GetEffectsToApply();
3027 if ((effMask & (1 << i)) && aurApp->HasEffect(i))
3028 effMask &= ~(1 << i);
3031 _spellHitTarget->_ApplyAura(aurApp, effMask);
3033 if (aurApp->IsNeedClientUpdate() && aurApp->GetRemoveMode() ==
AURA_REMOVE_NONE)
3035 aurApp->ClientUpdate(
false);
3036 _spellHitTarget->RemoveVisibleAuraUpdate(aurApp);
3107 if (creatureTarget->IsEvadingAttacks())
3145 playerOwner->SetContestedPvP();
3146 playerOwner->UpdatePvP(
true);
3188 if (origCaster == unit || !origCaster->
IsFriendlyTo(unit))
3193 if (hitInfo.
EffectMask & (1 << auraSpellEffect.EffectIndex) &&
3194 auraSpellEffect.IsUnitOwnedAuraEffect() &&
3224 bool refresh =
false;
3272 if (
int32 period = auraEff->GetPeriod())
3312 int32 _duration = 0;
3318 .SetTriggeringSpell(
this)
3319 .SetCastDifficulty(i->triggeredSpell->Difficulty));
3320 TC_LOG_DEBUG(
"spells",
"Spell {} triggered spell {} by SPELL_AURA_ADD_TARGET_TRIGGER aura",
m_spellInfo->
Id, i->triggeredSpell->Id);
3324 if (i->triggeredSpell->GetDuration() == -1)
3334 triggeredAur->SetDuration(_duration);
3345 for (std::vector<int32>::const_iterator i = spellTriggered->begin(); i != spellTriggered->end(); ++i)
3364 uint32 channelAuraMask = 0;
3367 channelAuraMask |= 1 << spellEffectInfo.EffectIndex;
3369 channelAuraMask &= channelTargetEffectMask;
3372 if (channelAuraMask)
3384 if (targetInfo.MissCondition ==
SPELL_MISS_NONE && (channelTargetEffectMask & targetInfo.EffectMask))
3390 unitCaster->RemoveChannelObject(targetInfo.TargetGUID);
3396 if (channelAuraMask & targetInfo.EffectMask)
3402 targetInfo.EffectMask &= ~aurApp->GetEffectMask();
3405 unitCaster->RemoveChannelObject(targetInfo.TargetGUID);
3412 unitCaster->RemoveChannelObject(targetInfo.TargetGUID);
3417 channelTargetEffectMask &= ~targetInfo.EffectMask;
3423 return channelTargetEffectMask == 0;
3449 if (triggeredByAura)
3481 int32 param1 = 0, param2 = 0;
3499 if (param1 || param2)
3575 unitCaster->SetCurrentCastSpell(
this);
3584 if (caster->IsAIEnabled())
3587 if (willCastDirectly)
3651 Spell* lastSpellMod =
nullptr;
3686 sScriptMgr->OnPlayerSpellCast(playerCaster,
this, skipCheck);
3695 if (
CreatureAI* controlledAI = cControlled->AI())
3696 controlledAI->OwnerAttacked(target);
3727 int32 param1 = 0, param2 = 0;
3731 cleanupSpell(castResult, ¶m1, ¶m2);
3743 if (!my_trade->IsInAcceptProcess())
3759 if (spellEffectInfo.IsUnitOwnedAuraEffect())
3760 aura_effmask |= 1 << spellEffectInfo.EffectIndex;
3771 if (target->HasStrongerAuraWithDR(
m_spellInfo, caster))
3784 if (!creatureCaster->GetTarget().IsEmpty() && !creatureCaster->HasUnitFlag(
UNIT_FLAG_POSSESSED))
3786 creatureCaster->SetInFront(target);
3808 pet->DespawnOrUnsummon();
3862 creatureCaster->ReleaseSpellFocus(
this);
3877 if (unitCaster->HasUnitState(
UNIT_STATE_CASTING) && !unitCaster->IsNonMeleeSpellCast(
false,
false,
true))
3890 for (
int32 id : *spell_triggered)
3895 unitCaster->RemoveAurasDueToSpell(-
id);
3899 .SetTriggeringSpell(
this));
3960 if (caster->IsAIEnabled())
3964template <
class Container>
3968 target.PreprocessTarget(
this);
3972 if (target.EffectMask & (1 << spellEffectInfo.EffectIndex))
3973 target.DoTargetSpellHit(
this, spellEffectInfo);
3976 target.DoDamageAndTriggers(
this);
4005 else if (duration == -1)
4057 bool ignoreTargetInfoTimeDelay = single_missile;
4063 if (launchMoment > t_offset)
4064 return launchMoment;
4072 ignoreTargetInfoTimeDelay =
false;
4090 std::vector<TargetInfo> delayedTargets;
4093 if (ignoreTargetInfoTimeDelay || target.TimeDelay <= t_offset)
4095 target.TimeDelay = t_offset;
4096 delayedTargets.emplace_back(std::move(target));
4099 else if (!single_missile && (next_time == 0 || target.
TimeDelay < next_time))
4110 std::vector<GOTargetInfo> delayedGOTargets;
4113 if (ignoreTargetInfoTimeDelay || goTarget.TimeDelay <= t_offset)
4115 goTarget.TimeDelay = t_offset;
4116 delayedGOTargets.emplace_back(std::move(goTarget));
4119 else if (!single_missile && (next_time == 0 || goTarget.TimeDelay < next_time))
4120 next_time = goTarget.TimeDelay;
4131 modOwner->SetSpellModTakingSpell(
this,
false);
4160 if (!spellEffectInfo.IsEffect())
4301 if (creatureCaster->IsAIEnabled())
4302 creatureCaster->AI()->OnChannelFinished(
m_spellInfo);
4341 ((
Puppet*)charm)->UnSummon();
4345 creatureCaster->ReleaseSpellFocus(
this);
4390 packet.CastID = castId;
4391 packet.SpellID = spellInfo->
Id;
4392 packet.Reason = result;
4398 packet.FailedArg1 = *param1;
4400 packet.FailedArg1 = 0;
4404 packet.FailedArg1 = *param1;
4410 packet.FailedArg1 = *param1;
4414 switch (spellInfo->
Id)
4418 packet.FailedArg1 = 3905;
4422 packet.FailedArg1 = 3842;
4425 packet.FailedArg1 = 4075;
4428 packet.FailedArg1 = 0;
4436 packet.FailedArg1 = *param1;
4438 packet.FailedArg2 = *param2;
4442 if (spellInfo->
Totem[0])
4443 packet.FailedArg1 = spellInfo->
Totem[0];
4444 if (spellInfo->
Totem[1])
4445 packet.FailedArg2 = spellInfo->
Totem[1];
4451 packet.FailedArg1 = *param1;
4453 packet.FailedArg2 = *param2;
4466 if (param1 && param2)
4468 packet.FailedArg1 = *param1;
4469 packet.FailedArg2 = *param2;
4480 packet.FailedArg1 = *param1;
4486 if (
uint32 itemType = spellEffectInfo.ItemType)
4501 packet.FailedArg1 = *param1;
4507 packet.FailedArg1 = *param1;
4512 if (param1 && param2)
4514 packet.FailedArg1 = *param1;
4515 packet.FailedArg2 = *param2;
4519 packet.FailedArg1 = 0;
4520 packet.FailedArg2 = 0;
4524 if (param1 && param2)
4526 packet.FailedArg1 = *param1;
4527 packet.FailedArg2 = *param2;
4531 packet.FailedArg1 = 0;
4532 packet.FailedArg2 = 0;
4537 packet.FailedArg1 = *param1;
4539 packet.FailedArg1 = 0;
4542 packet.FailedArg1 = customError;
4546 packet.FailedArg1 = *param1;
4548 packet.FailedArg1 = 0;
4553 packet.FailedArg1 = *param1;
4558 if (spellInfo->
Reagent[i] <= 0)
4564 if (caster && !caster->
HasItemCount(itemid, itemcount))
4566 packet.FailedArg1 = itemid;
4573 packet.FailedArg2 = *param2;
4580 packet.FailedArg1 = -1;
4592 packet.FailedArg1 = *param1;
4649 packet.
Visual = spellVisual;
4679 uint32 schoolImmunityMask = 0;
4680 uint32 mechanicImmunityMask = 0;
4683 schoolImmunityMask =
m_timer!= 0 ? unitCaster->GetSchoolImmunityMask() : 0;
4687 if (schoolImmunityMask || mechanicImmunityMask)
4750 float baseCd = float(player->GetRuneBaseCooldown());
4751 castData.
RemainingRunes->Cooldowns.push_back((baseCd -
float(player->GetRuneCooldown(i))) / baseCd * 255);
4879 if (targetInfo.EffectMask == 0)
4885 data.
HitTargets.push_back(targetInfo.TargetGUID);
4892 data.
MissTargets.push_back(targetInfo.TargetGUID);
4893 data.
MissStatus.emplace_back(targetInfo.MissCondition, targetInfo.ReflectResult);
4898 data.
HitTargets.push_back(targetInfo.TargetGUID);
4901 data.
HitTargets.push_back(targetInfo.TargetGUID);
4910 uint32 ammoInventoryType = 0;
4911 uint32 ammoDisplayID = 0;
4921 else if (playerCaster->HasAura(46699))
4923 ammoDisplayID = 5996;
4930 uint32 nonRangedAmmoDisplayID = 0;
4931 uint32 nonRangedAmmoInventoryType = 0;
4934 if (
uint32 item_id = unitCaster->GetVirtualItemId(i))
4940 switch (itemEntry->SubclassID)
4943 ammoDisplayID =
sDB2Manager.GetItemDisplayId(item_id, unitCaster->GetVirtualItemAppearanceMod(i));
4944 ammoInventoryType = itemEntry->InventoryType;
4948 ammoDisplayID = 5996;
4952 ammoDisplayID = 5998;
4956 nonRangedAmmoDisplayID =
sDB2Manager.GetItemDisplayId(item_id, unitCaster->GetVirtualItemAppearanceMod(i));
4957 nonRangedAmmoInventoryType = itemEntry->InventoryType;
4968 if (!ammoDisplayID && !ammoInventoryType)
4970 ammoDisplayID = nonRangedAmmoDisplayID;
4971 ammoInventoryType = nonRangedAmmoInventoryType;
4975 return ammoDisplayID;
4984 switch (spellEffectInfo.Effect)
4989 spellInfo, spellEffectInfo.CalcValue(unitCaster,
nullptr, target,
nullptr, castItemEntry, castItemLevel),
5003 switch (spellEffectInfo.ApplyAuraName)
5008 spellInfo, spellEffectInfo.CalcValue(unitCaster,
nullptr, target,
nullptr, castItemEntry, castItemLevel),
5013 points +=
CalcPredictedHealing(triggered, unitCaster, target, castItemEntry, castItemLevel,
nullptr, withPeriodic).first;
5021 return { points, type };
5027 healPrediction.
Points = 0;
5035 healPrediction.
Points = points;
5036 healPrediction.
Type = type;
5039 static constexpr uint32 beaconSpellId = 53651;
5045 return aura->GetSpellInfo()->GetEffects().size() > EFFECT_1 && aura->GetSpellInfo()->GetEffect(EFFECT_1).TriggerSpell == beaconSpellId;
5050 healPrediction.
BeaconGUID = (*beacon)->GetOwner()->GetGUID();
5076 return log.Effect == effect;
5091 spellLogEffectPowerDrainParams.
Points = points;
5092 spellLogEffectPowerDrainParams.
PowerType = powerType;
5093 spellLogEffectPowerDrainParams.
Amplitude = amplitude;
5101 spellLogEffectExtraAttacksParams.
Victim = victim->
GetGUID();
5102 spellLogEffectExtraAttacksParams.
NumAttacks = numAttacks;
5121 spellLogEffectDurabilityDamageParams.
Victim = victim->
GetGUID();
5122 spellLogEffectDurabilityDamageParams.
ItemID = itemId;
5123 spellLogEffectDurabilityDamageParams.
Amount = amount;
5139 spellLogEffectTradeSkillItemParams.
ItemID = entry;
5147 spellLogEffectFeedPetParams.
ItemID = entry;
5171 spellLogEffectGenericVictimParams.
Victim = target->
GetGUID();
5183 failurePacket.
Reason = result;
5191 failedPacket.
Reason = result;
5226 uint32 channelAuraMask = 0;
5227 uint32 explicitTargetEffectMask = 0xFFFFFFFF;
5233 return target.TargetGUID == m_targets.GetUnitTargetGUID();
5236 explicitTargetEffectMask = explicitTargetItr->EffectMask;
5240 if (spellEffectInfo.IsEffect(
SPELL_EFFECT_APPLY_AURA) && (explicitTargetEffectMask & (1u << spellEffectInfo.EffectIndex)))
5241 channelAuraMask |= 1 << spellEffectInfo.EffectIndex;
5245 if (!(target.EffectMask & channelAuraMask))
5256 if (target.EffectMask & channelAuraMask)
5263 if (unitCaster->
m_unitData->ChannelObjects.size() == 1 && unitCaster->
m_unitData->ChannelObjects[0].IsUnit())
5264 if (!creatureCaster->HasSpellFocus(
this))
5279 if (schoolImmunityMask || mechanicImmunityMask)
5289 if (unitCaster->
m_unitData->ChannelObjects.size() == 1 && unitCaster->
m_unitData->ChannelObjects[0].IsUnit())
5302 std::string sentName;
5309 resurrectRequest.
Name = sentName;
5313 if (
CharmInfo* charmInfo = pet->GetCharmInfo())
5314 resurrectRequest.
PetNumber = charmInfo->GetPetNumber();
5343 bool expendable =
false;
5344 bool withoutCharges =
false;
5352 if (itemEffect->Charges)
5354 if (itemEffect->Charges < 0)
5362 (charges > 0) ? --charges : ++charges;
5369 withoutCharges = (charges == 0);
5373 if (expendable && withoutCharges)
5446 TC_LOG_ERROR(
"spells",
"Spell::TakePower: Unknown power type '{}'", powerType);
5458 return totalCost + (cost.Power == POWER_RUNES ? cost.Amount : 0);
5471 int32 readyRunes = 0;
5476 if (readyRunes < runeCost)
5492 return totalCost + (cost.Power == POWER_RUNES ? cost.Amount : 0);
5536 if (itemEffect->Charges < 0 && abs(charges) < 2)
5572 float threat = 0.0f;
5575 if (threatEntry->apPctMod != 0.0f)
5578 threat += threatEntry->flatMod;
5592 float threatToAdd = threat;
5629 if (!preventDefault)
5630 (this->*SpellEffectHandlers[spellEffectInfo.
Effect].
Value)();
5636 return spellEvent->GetSpell();
5747 bool checkForm =
true;
5800 return vehicleCheck;
5853 if (!unitCaster->IsFriendlyTo(auraEff->GetCaster()) && !target->HasAura(auraEff->GetId(), auraEff->GetCasterGUID()))
5857 if (!unitCaster->IsFriendlyTo(auraEff->GetCaster()) && (!target->HasAura(auraEff->GetId(), auraEff->GetCasterGUID()) || !unitCaster->HasAura(auraEff->GetId(), auraEff->GetCasterGUID())))
5895 if (!unitCaster->GetPetGUID().IsEmpty())
5902 if (!unitCaster->GetGuardianPet())
5921 if (player->InArena())
5997 uint32 approximateAuraEffectMask = 0;
5998 uint32 nonAuraEffectMask = 0;
6002 switch (spellEffectInfo.Effect)
6009 if (!unit || !unit->
HasAura(17743))
6034 if (!learn_spellproto)
6065 if (!learn_spellproto)
6082 if (
uint32 glyphId = spellEffectInfo.MiscValue)
6085 if (!glyphProperties)
6088 std::vector<uint32>
const* glyphBindableSpells =
sDB2Manager.GetGlyphBindableSpells(glyphId);
6089 if (!glyphBindableSpells)
6092 if (std::find(glyphBindableSpells->begin(), glyphBindableSpells->end(),
m_misc.SpellId) == glyphBindableSpells->end())
6095 if (std::vector<ChrSpecialization>
const* glyphRequiredSpecs =
sDB2Manager.GetGlyphRequiredSpecs(glyphId))
6100 if (std::find(glyphRequiredSpecs->begin(), glyphRequiredSpecs->end(), caster->
GetPrimarySpecialization()) == glyphRequiredSpecs->end())
6104 uint32 replacedGlyph = 0;
6107 if (std::vector<uint32>
const* activeGlyphBindableSpells =
sDB2Manager.GetGlyphBindableSpells(activeGlyphId))
6109 if (std::find(activeGlyphBindableSpells->begin(), activeGlyphBindableSpells->end(),
m_misc.SpellId) != activeGlyphBindableSpells->end())
6111 replacedGlyph = activeGlyphId;
6119 if (activeGlyphId == replacedGlyph)
6122 if (activeGlyphId == glyphId)
6219 Item* pTempItem =
nullptr;
6244 lockId = go->GetGOInfo()->GetLockId();
6252 lockId = itm->GetTemplate()->GetLockID();
6255 int32 reqSkillValue = 0;
6256 int32 skillValue = 0;
6277 return petInfo && !petInfo->Health;
6280 if (deadPetItr == petStable->
ActivePets.end())
6293 if (!SummonProperties)
6296 switch (SummonProperties->
Control)
6333 .SetOriginalCaster(pet->GetGUID())
6347 if (!spellEffectInfo.MiscValue)
6349 petSlot =
PetSaveMode(spellEffectInfo.CalcValue());
6354 if (activePet && !activePet->Health)
6372 if (creatureInfo && creatureInfo->
IsTameable(
true, creatureDifficulty))
6381 else if (!spellEffectInfo.MiscValue)
6423 uint32 mapId = map->GetId();
6424 Difficulty difficulty = map->GetDifficultyID();
6425 if (
InstanceLock const* mapLock = map->GetInstanceLock())
6429 if (!target->
Satisfy(
sObjectMgr->GetAccessRequirement(mapId, difficulty), mapId))
6561 if (!artifactEntry || artifactEntry->
ArtifactCategoryID != spellEffectInfo.MiscValue)
6590 if (
uint32 battlePetType = spellEffectInfo.MiscValue)
6591 if (!(battlePetType & (1 << battlePetSpecies->PetTypeEnum)))
6598 return a1->MaxQualityRoll < selector;
6624 if (spellEffectInfo.IsAura())
6625 approximateAuraEffectMask |= 1 << spellEffectInfo.EffectIndex;
6626 else if (spellEffectInfo.IsEffect())
6627 nonAuraEffectMask |= 1 << spellEffectInfo.EffectIndex;
6632 switch (spellEffectInfo.ApplyAuraName)
6670 if (target->GetTypeId() ==
TYPEID_UNIT && target->IsVehicle())
6673 if (target->IsMounted())
6676 if (!target->GetCharmerGUID().IsEmpty())
6679 if (target->GetOwner() && target->GetOwner()->GetTypeId() ==
TYPEID_PLAYER)
6683 if (value &&
int32(target->GetLevelForTarget(
m_caster)) > value)
6730 if (spellEffectInfo.IsTargetingArea())
6750 && (approximateAuraEffectMask & (1 << spellEffectInfo.EffectIndex))
6753 if (!target->IsHighestExclusiveAuraEffect(
m_spellInfo, spellEffectInfo.ApplyAuraName,
6755 approximateAuraEffectMask,
false))
6795 if (!owner->IsAlive())
6810 if (!creatureCaster->GetSpellHistory()->IsReady(
m_spellInfo))
6859 bool foundNotMechanic =
false;
6863 uint64 const mechanicMask = aurEff->GetSpellInfo()->GetAllEffectsMechanicMask();
6866 foundNotMechanic =
true;
6871 *param1 = aurEff->GetSpellEffectInfo().Mechanic;
6873 *param1 = aurEff->GetSpellInfo()->Mechanic;
6880 if (foundNotMechanic)
6902 if (usableWhileStunned)
6906 result = mechanicResult;
6911 result = mechanicResult;
6925 if (usableWhileFeared)
6929 result = mechanicResult;
6936 if (usableWhileConfused)
6940 result = mechanicResult;
6963 if (auraEffects.empty())
6973 *param1 = aurEff->GetSpellEffectInfo().Mechanic;
6975 *param1 = aurEff->GetSpellInfo()->Mechanic;
7026 bool isRatedBattleground =
false;
7027 bool isArena = !isRatedBattleground;
7068 if (!unitCaster->CanCastSpellWhileMoving(
m_spellInfo))
7101 if (!spellEffectInfo.IsAura())
7104 AuraType const& auraType = spellEffectInfo.ApplyAuraName;
7106 for (Unit::AuraEffectList::const_iterator auraIt = auras.begin(); auraIt != auras.end(); ++auraIt)
7116 if (
GetCaster() == (*auraIt)->GetCaster())
7121 if (abs(spellEffectInfo.CalcBaseValue(
m_caster, target, 0, -1)) <= abs((*auraIt)->GetAmount()))
7140 if (ihit->TargetGUID == targetguid)
7172 minRange *= minRange;
7173 maxRange *= maxRange;
7209 float rangeMod = 0.0f;
7210 float minRange = 0.0f;
7211 float maxRange = 0.0f;
7214 return { 0.0f, 100.0f };
7224 rangeMod = unitCaster->
GetMeleeRange(target ? target : unitCaster);
7228 float meleeRange = 0.0f;
7233 meleeRange = unitCaster->
GetMeleeRange(target ? target : unitCaster);
7244 minRange += rangeMod;
7250 rangeMod += 8.0f / 3.0f;
7255 maxRange *= ranged->GetTemplate()->GetRangedModRange() * 0.01f;
7260 maxRange += rangeMod;
7262 return { minRange, maxRange };
7287 TC_LOG_ERROR(
"spells",
"Spell::CheckPower: Unknown power type '{}'", cost.Power);
7329 if (itemEffect->LegacySlotIndex <
m_CastItem->
m_itemData->SpellCharges.size() && itemEffect->Charges)
7361 if (spellEffectInfo.MiscValue < 0 || spellEffectInfo.MiscValue >=
int8(
MAX_POWERS))
7410 if (targetItem->GetOwnerGUID() != player->
GetGUID())
7411 checkReagents =
true;
7438 if (itemEffect->Charges < 0 && abs(charges) < 2)
7470 for (
uint8 i = 0; i < 2; ++i)
7488 uint32 totemCategory = 2;
7489 for (
uint8 i = 0; i < 2; ++i)
7503 if (totemCategory != 0)
7510 switch (spellEffectInfo.Effect)
7528 if (spellEffectInfo.ItemType)
7534 uint32 createCount = std::clamp<uint32>(spellEffectInfo.CalcValue(), 1u, itemTemplate->
GetMaxStackSize());
7542 player->
SendEquipError(msg,
nullptr,
nullptr, spellEffectInfo.ItemType);
7552 player->
SendEquipError(msg,
nullptr,
nullptr, spellEffectInfo.ItemType);
7557 .SetTriggeringSpell(
this));
7579 player->
SendEquipError(msg,
nullptr,
nullptr, spellEffectInfo.ItemType);
7594 bool isItemUsable =
false;
7599 isItemUsable =
true;
7610 switch (enchantEntry->
Effect[s])
7632 if (targetItem->
GetOwner() != player)
7649 uint32 enchant_id = spellEffectInfo.MiscValue;
7685 if (!itemDisenchantLoot)
7709 if (param1 && param2)
7740 if (param1 && param2)
7784 uint32 itemId = spellEffectInfo.ItemType;
7792 if (itemEffect->LegacySlotIndex <= item->m_itemData->SpellCharges.size()
7793 && itemEffect->Charges != 0
7794 && item->GetSpellCharges(itemEffect->LegacySlotIndex) == itemEffect->Charges)
7808 if (!azeriteEmpoweredItem)
7811 bool hasSelections =
false;
7816 hasSelections =
true;
7856 return mainHandResult;
7863 return offHandResult;
7880 int32 delaytime = 500;
7882 int32 delayReduce = 100;
7886 if (delayReduce >= 100)
7889 AddPct(delaytime, -delayReduce);
7924 int32 delayReduce = 100;
7928 if (delayReduce >= 100)
7931 AddPct(delaytime, -delayReduce);
7948 dynObj->Delay(delaytime);
7962 return cost.Power == power;
8071 if (!gobCaster->GetGOInfo()->GetRequireLOS())
8080 switch (spellEffectInfo.
Effect)
8133 switch (spellEffectInfo.
Effect)
8217 TC_LOG_ERROR(
"spells",
"~SpellEvent: {} {} tried to delete non-deletable spell {}. Was not deleted, causes memory leak.",
8344 if (!spellEffectInfo.IsEffect())
8357 float multiplier = 1.0f;
8363 uint32 mask = target.EffectMask;
8364 if (!(mask & (1 << spellEffectInfo.EffectIndex)))
8384 Unit* unit =
nullptr;
8408 Unit* unit =
nullptr;
8507 bool reqKey =
false;
8511 switch (lockInfo->
Type[j])
8532 reqSkillValue = lockInfo->
Skill[j];
8539 skillValue = unitCaster->
GetLevel() * 5;
8546 if (skillValue < reqSkillValue)
8620 TC_LOG_DEBUG(
"spells",
"Spell::LoadScripts: Script `{}` for spell `{}` is loaded now", script->GetScriptName(),
m_spellInfo->
Id);
8630 script->OnPrecast();
8631 script->_FinishScriptCall();
8641 beforeCast.
Call(script);
8643 script->_FinishScriptCall();
8653 onCast.
Call(script);
8655 script->_FinishScriptCall();
8665 afterCast.
Call(script);
8667 script->_FinishScriptCall();
8681 retVal = tempResult;
8684 script->_FinishScriptCall();
8694 castTime = script->CalcCastTime(castTime);
8695 script->_FinishScriptCall();
8703 bool preventDefault =
false;
8732 script->_PrepareScriptCall(hookType);
8735 if (!script->_IsEffectPrevented(effIndex) && effectHandler.IsEffectAffected(
m_spellInfo, effIndex))
8736 effectHandler.Call(script, effIndex);
8738 if (!preventDefault)
8739 preventDefault = script->_IsDefaultEffectPrevented(effIndex);
8741 script->_FinishScriptCall();
8743 return preventDefault;
8752 onDispel.
Call(script, effIndex);
8754 script->_FinishScriptCall();
8765 beforeHit.
Call(script, missInfo);
8767 script->_FinishScriptCall();
8779 script->_FinishScriptCall();
8789 afterHit.
Call(script);
8791 script->_FinishScriptCall();
8801 calcCritChance.
Call(script, victim, critChance);
8803 script->_FinishScriptCall();
8813 calcDamage.
Call(script, victim,
damage, flatMod, pctMod);
8815 script->_FinishScriptCall();
8825 calcHealing.
Call(script, victim, healing, flatMod, pctMod);
8827 script->_FinishScriptCall();
8838 objectAreaTargetSelect.
Call(script, targets);
8840 script->_FinishScriptCall();
8851 objectTargetSelect.
Call(script, target);
8853 script->_FinishScriptCall();
8864 destinationTargetSelect.
Call(script, target);
8866 script->_FinishScriptCall();
8876 calculateResistAbsorb.
Call(script, damageInfo, resistAmount, absorbAmount);
8878 script->_FinishScriptCall();
8930 for (
AuraEffect const* aurEff : targetTriggers)
8939 int32 auraBaseAmount = aurEff->GetBaseAmount();
8942 chance *= aurEff->GetBase()->GetStackAmount();
8987 if (gcd >= MinGCD && gcd <= MaxGCD)
8992 int32 intGcd = gcd.count();
9036 std::stringstream sstr;
9037 sstr << std::boolalpha
9059 WorldObject const* src = targetAsSourceLocation ? target : source;
9060 WorldObject const* dst = targetAsSourceLocation ? source : target;
9080 _targetSelectionType(selectionType), _condSrcInfo(nullptr), _condList(condList), _objectType(objectType)
9083 _condSrcInfo = std::make_unique<ConditionSourceInfo>(
nullptr, caster);
9194 :
WorldObjectSpellTargetCheck(caster, caster, spellInfo, selectionType, condList, objectType), _range(range), _position(caster) { }
9199 if (dist <
_range && WorldObjectSpellTargetCheck::operator ()(target))
9210 :
WorldObjectSpellTargetCheck(caster, referer, spellInfo, selectionType, condList, objectType), _range(range), _position(position), _searchReason(searchReason) { }
9224 if (!isInsideCylinder)
9250 :
WorldObjectSpellAreaTargetCheck(range, caster, caster, caster, spellInfo, selectionType, condList, objectType), _coneSrc(coneSrc), _coneAngle(coneAngle), _lineWidth(lineWidth) { }
9276 :
WorldObjectSpellTargetCheck(caster, caster, spellInfo, selectionType, condList, objectType), _range(range), _position(position) { }
9292 :
WorldObjectSpellAreaTargetCheck(range, caster, caster, caster, spellInfo, selectionType, condList, objectType), _position(*srcPosition), _lineWidth(lineWidth)
9294 if (dstPosition && *srcPosition != *dstPosition)
9308 if (targets.size() <= maxTargets)
9330 std::array<std::ptrdiff_t, 1 << END> countsByPriority = {};
9331 std::vector<std::pair<WorldObject*, int32>> tempTargets;
9332 tempTargets.resize(targets.size());
9335 std::transform(targets.begin(), targets.end(), tempTargets.begin(), [&](
WorldObject* target)
9337 int32 negativePoints = 0;
9338 if (prioritizeGroupMembersOf && (!target->IsUnit() || target->ToUnit()->IsInRaidWith(prioritizeGroupMembersOf)))
9339 negativePoints |= 1 << NOT_GROUPED;
9341 if (prioritizePlayers && !target->IsPlayer() && (!target->IsCreature() || !target->ToCreature()->IsTreatedAsRaidUnit()))
9342 negativePoints |= 1 << NOT_PLAYER;
9344 if (!target->IsUnit() || target->ToUnit()->IsFullHealth())
9345 negativePoints |= 1 << NOT_INJURED;
9347 ++countsByPriority[negativePoints];
9348 return std::make_pair(target, negativePoints);
9351 std::sort(tempTargets.begin(), tempTargets.end(), [](std::pair<WorldObject*, int32>
const& left, std::pair<WorldObject*, int32>
const& right)
9353 return left.second < right.second;
9356 std::size_t foundTargets = 0;
9357 for (std::ptrdiff_t countForPriority : countsByPriority)
9359 if (foundTargets + countForPriority >= maxTargets)
9368 foundTargets += countForPriority;
9371 targets.resize(maxTargets);
9372 std::transform(tempTargets.begin(), tempTargets.begin() + maxTargets, targets.begin(), std::mem_fn(&std::pair<WorldObject*, int32>::first));
9383 Targets->SetUnitTarget(unitTarget);
9388 Targets->SetGOTarget(goTarget);
9406 if (triggeringSpell)
9433 return {
int32(SpellXSpellVisualID),
int32(ScriptVisualID) };
std::vector< Condition > ConditionContainer
@ CONDITION_SOURCE_TYPE_SPELL
DB2Storage< ItemEntry > sItemStore("Item.db2", &ItemLoadInfo::Instance)
DB2Storage< BattlePetBreedQualityEntry > sBattlePetBreedQualityStore("BattlePetBreedQuality.db2", &BattlePetBreedQualityLoadInfo::Instance)
DB2Storage< ArtifactEntry > sArtifactStore("Artifact.db2", &ArtifactLoadInfo::Instance)
DB2Storage< ChrClassesEntry > sChrClassesStore("ChrClasses.db2", &ChrClassesLoadInfo::Instance)
DB2Storage< LockEntry > sLockStore("Lock.db2", &LockLoadInfo::Instance)
DB2Storage< ChrSpecializationEntry > sChrSpecializationStore("ChrSpecialization.db2", &ChrSpecializationLoadInfo::Instance)
DB2Storage< BattlePetSpeciesEntry > sBattlePetSpeciesStore("BattlePetSpecies.db2", &BattlePetSpeciesLoadInfo::Instance)
DB2Storage< SummonPropertiesEntry > sSummonPropertiesStore("SummonProperties.db2", &SummonPropertiesLoadInfo::Instance)
DB2Storage< GlyphPropertiesEntry > sGlyphPropertiesStore("GlyphProperties.db2", &GlyphPropertiesLoadInfo::Instance)
DB2Storage< SpellItemEnchantmentEntry > sSpellItemEnchantmentStore("SpellItemEnchantment.db2", &SpellItemEnchantmentLoadInfo::Instance)
DB2Storage< TalentEntry > sTalentStore("Talent.db2", &TalentLoadInfo::Instance)
#define MAX_VEHICLE_SEATS
#define MAX_SPELL_REAGENTS
#define MAX_ITEM_ENCHANTMENT_EFFECTS
#define MAX_AZERITE_EMPOWERED_TIER
@ EnforceLineOfSightToChainTargets
@ ITEM_ENCHANTMENT_TYPE_USE_SPELL
@ ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET
#define MAX_ITEM_PROTO_SOCKETS
#define MAX_SPELL_EFFECTS
@ LandTargetedSpellOnTarget
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
#define ASSERT_NOTNULL(pointer)
@ GRID_MAP_TYPE_MASK_PLAYER
@ GRID_MAP_TYPE_MASK_CREATURE
@ GRID_MAP_TYPE_MASK_GAMEOBJECT
@ GRID_MAP_TYPE_MASK_CORPSE
#define VMAP_INVALID_HEIGHT_VALUE
@ PRISMATIC_ENCHANTMENT_SLOT
@ ITEM_SUBCLASS_WEAPON_CROSSBOW
@ ITEM_SUBCLASS_WEAPON_GUN
@ ITEM_SUBCLASS_WEAPON_BOW
@ ITEM_SUBCLASS_WEAPON_WAND
@ ITEM_SUBCLASS_WEAPON_THROWN
@ ITEM_SPELLTRIGGER_ON_USE
@ ITEM_FLAG_NO_REAGENT_COST
@ ITEM_FLAG_IS_PROSPECTABLE
#define TC_LOG_DEBUG(filterType__,...)
#define TC_LOG_ERROR(filterType__,...)
LootStore LootTemplates_Milling("milling_loot_template", "item entry (herb)", true)
LootStore LootTemplates_Prospecting("prospecting_loot_template", "item entry (ore)", true)
#define EXTRA_CELL_SEARCH_RADIUS
#define DEFAULT_PLAYER_BOUNDING_RADIUS
std::optional< T > Optional
Optional helper class to wrap optional values within.
constexpr uint32 PET_SUMMONING_DISORIENTATION
std::vector< ItemPosCount > ItemPosCountVec
float frand(float min, float max)
bool roll_chance_f(float chance)
bool roll_chance_i(int chance)
if(posix_memalign(&__mallocedMemory, __align, __size)) return NULL
@ SPELL_ATTR10_USES_RANGED_SLOT_COSMETIC_ONLY
@ SPELL_ATTR9_USABLE_IN_RATED_BATTLEGROUNDS
@ SPELL_ATTR9_SPECIAL_DELAY_CALCULATION
@ SPELL_ATTR9_NOT_USABLE_IN_ARENA
@ 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_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_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
@ TARGET_DEST_CHANNEL_CASTER
@ 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_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_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
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_TAPS_IMMEDIATELY
@ SPELL_AURA_DISABLE_CASTING_EXCEPT_ABILITIES
@ SPELL_AURA_DISABLE_ATTACKING_EXCEPT_ABILITIES
@ SPELL_AURA_OBS_MOD_HEALTH
@ SPELL_AURA_MOD_IGNORE_SHAPESHIFT
@ SPELL_AURA_PERIODIC_MANA_LEECH
@ SPELL_AURA_MOD_POSSESS_PET
@ SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS
@ SPELL_AURA_MOD_NO_ACTIONS
@ SPELL_AURA_PERIODIC_HEAL
@ SPELL_AURA_MOD_STUN_DISABLE_GRAVITY
@ SPELL_AURA_ADD_TARGET_TRIGGER
@ SPELL_AURA_MOD_GLOBAL_COOLDOWN_BY_HASTE_REGEN
@ SPELL_AURA_MOD_PACIFY_SILENCE
@ SPELL_AURA_PROVIDE_SPELL_FOCUS
@ SPELL_AURA_REDUCE_PUSHBACK
@ SPELL_AURA_INTERFERE_TARGETTING
@ SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ 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_IGNORE_POWER_AND_REAGENT_COST
Will ignore power and reagent cost.
@ 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_CAST_ITEM
Will not take away cast item or update related achievement criteria.
@ TRIGGERED_IGNORE_GCD
Will ignore GCD.
@ TRIGGERED_DISALLOW_PROC_EVENTS
Disallows proc events from triggered spell (default)
@ TRIGGERED_IGNORE_CASTER_AURAS
Will ignore caster aura restrictions or requirements.
@ TRIGGERED_DONT_REPORT_CAST_ERROR
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
@ TRIGGERED_IGNORE_SET_FACING
Will not adjust facing to target (if any)
@ SPELLVALUE_DURATION_PCT
@ SPELLVALUE_BASE_POINT_END
@ SPELLVALUE_PARENT_SPELL_TARGET_COUNT
@ SPELLVALUE_PARENT_SPELL_TARGET_INDEX
@ 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_BEFORE_CAST
@ SPELL_SCRIPT_HOOK_ON_RESIST_ABSORB_CALCULATION
@ SPELL_SCRIPT_HOOK_DESTINATION_TARGET_SELECT
@ SPELL_SCRIPT_HOOK_OBJECT_TARGET_SELECT
@ SPELL_SCRIPT_HOOK_EFFECT_HIT_TARGET
@ SPELL_SCRIPT_HOOK_CALC_CRIT_CHANCE
@ SPELL_SCRIPT_HOOK_ON_CAST
@ SPELL_SCRIPT_HOOK_ON_PRECAST
bool CanHaveGlobalCooldown(WorldObject const *caster)
void FillSpellCastFailedArgs(T &packet, ObjectGuid castId, SpellInfo const *spellInfo, SpellCastResult result, SpellCustomErrors customError, int32 *param1, int32 *param2, Player *caster)
static std::pair< int32, SpellHealPredictionType > CalcPredictedHealing(SpellInfo const *spellInfo, Unit const *unitCaster, Unit *target, uint32 castItemEntry, int32 castItemLevel, Spell *spell, bool withPeriodic)
NonDefaultConstructible< SpellEffectHandlerFn > SpellEffectHandlers[TOTAL_SPELL_EFFECTS]
@ SPELL_CAST_SOURCE_NORMAL
#define MAX_SPELL_RANGE_TOLERANCE
@ CAST_FLAG_EX_IGNORE_COOLDOWN
@ SPELL_EFFECT_HANDLE_LAUNCH_TARGET
@ SPELL_EFFECT_HANDLE_LAUNCH
@ SPELL_EFFECT_HANDLE_HIT
@ SPELL_EFFECT_HANDLE_HIT_TARGET
#define AOE_DAMAGE_TARGET_CAP
static const uint32 SPELL_INTERRUPT_NONPLAYER
@ CAST_FLAG_ADJUST_MISSILE
@ CAST_FLAG_HEAL_PREDICTION
@ CAST_FLAG_POWER_LEFT_SELF
@ CAST_FLAG_HAS_TRAJECTORY
#define TRAJECTORY_MISSILE_SIZE
@ SPELL_HEAL_PREDICTION_TARGET_AND_BEACON
@ SPELL_HEAL_PREDICTION_TARGET
@ SPELL_HEAL_PREDICTION_TARGET_PARTY
@ SPELL_HEAL_PREDICTION_TARGET_AND_CASTER
@ UNIT_FLAG2_ALLOW_CHEAT_SPELLS
@ MOVEMENTFLAG_STRAFE_LEFT
@ MOVEMENTFLAG_STRAFE_RIGHT
@ UNIT_FLAG_NON_ATTACKABLE
@ UNIT_FLAG_PLAYER_CONTROLLED
ProcFlagsHit createProcHitMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missCondition)
@ CURRENT_CHANNELED_SPELL
@ CURRENT_AUTOREPEAT_SPELL
@ UNIT_STATE_ATTACK_PLAYER
#define ARTIFACTS_ALL_WEAPONS_GENERAL_WEAPON_EQUIPPED_PASSIVE
float DegToRad(float degrees)
T RoundToInterval(T &num, T floor, T ceil)
constexpr std::underlying_type< E >::type AsUnderlyingType(E enumValue)
T CalculatePct(T base, U pct)
SpellInfo const * GetSpellInfo() const
ObjectGuid GetCastId() const
int32 GetMaxDuration() const
static Aura * TryRefreshStackOrCreate(AuraCreateInfo &createInfo, bool updateEffectMask=true)
void SetStackAmount(uint8 num)
int32 GetCastItemLevel() const
AuraEffectVector const & GetAuraEffects() const
int32 GetDuration() const
bool ModStackAmount(int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT, bool resetPeriodicTimer=true)
int32 CalcMaxDuration() const
void SetDuration(int32 duration, bool withMods=false)
ObjectGuid GetCastItemGUID() const
uint32 GetEffectMask() const
void SetMaxDuration(int32 duration)
static uint32 BuildEffectMaskForOwner(SpellInfo const *spellProto, uint32 availableEffectMask, WorldObject *owner)
int64 GetRespecCost() const
uint32 GetSelectedAzeritePower(int32 tier) const
virtual void Abort(uint64)
virtual bool IsDeletable() const
virtual bool Execute(uint64, uint32)
BattlePet * GetPet(ObjectGuid guid)
bool HasJournalLock() const
bool CanFlyIn()
Return if we can use mount in battlefield.
bool HasHeirloom(uint32 itemId) const
void InheritCombatStatesFrom(Unit const *who)
ObjectGuid GetOwnerGUID() const override
virtual void SpellHitTarget(WorldObject *, SpellInfo const *)
bool CanIgnoreLineOfSightWhenCastingOnMe() const
Loot * GetLootForPlayer(Player const *player) const override
bool isTappedBy(Player const *player) const
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)
void SetSpellCharges(uint8 index, int32 value)
Trinity::IteratorPair< ItemEffectEntry const *const * > GetEffects() const
uint32 GetEnchantmentId(EnchantmentSlot slot) const
int32 GetSpellCharges(uint8 index=0) const
ItemTemplate const * GetTemplate() const
SocketColor GetSocketColor(uint32 index) const
Player * GetOwner() const
ObjectGuid GetOwnerGUID() const
uint32 GetDisplayId(Player const *owner) const
ItemDisenchantLootEntry const * GetDisenchantLoot(Player const *owner) const
uint32 GetItemLevel(Player const *owner) const
AzeriteEmpoweredItem * ToAzeriteEmpoweredItem()
UF::UpdateField< UF::ItemData, 0, TYPEID_ITEM > m_itemData
int32 GetRequiredLevel() const
bool IsFitToSpellRequirements(SpellInfo const *spellInfo) 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()
static ObjectGuid const Empty
bool IsAnyTypeGameObject() const
std::string ToString() const
static char const * GetTypeName(HighGuid high)
bool IsGameObject() const
static ObjectGuid const TradeItem
static Creature * ToCreature(Object *o)
static Unit * ToUnit(Object *o)
static GameObject * ToGameObject(Object *o)
bool HasDynamicFlag(uint32 flag) const
static Corpse * ToCorpse(Object *o)
static ObjectGuid GetGUID(Object const *o)
static Player * ToPlayer(Object *o)
std::array< Optional< PetInfo >, MAX_ACTIVE_PETS > ActivePets
Player * GetOwner() const
static std::pair< PetStable::PetInfo const *, PetSaveMode > GetLoadPetInfo(PetStable const &stable, uint32 petEntry, uint32 petnumber, Optional< PetSaveMode > slot)
PetType getPetType() const
bool HaveInDiet(ItemTemplate const *item) const
static PhaseShift const & GetAlwaysVisiblePhaseShift()
ChrSpecialization GetPrimarySpecialization() const
void SendEquipError(InventoryResult msg, Item const *item1=nullptr, Item const *item2=nullptr, uint32 itemId=0) const
void SetSpellModTakingSpell(Spell *spell, bool apply)
bool Satisfy(AccessRequirement const *ar, uint32 target_map, TransferAbortParams *params=nullptr, bool report=false)
bool IsInSameRaidWith(Player const *p) const
bool HasItemFitToSpellRequirements(SpellInfo const *spellInfo, Item const *ignoreItem=nullptr) const
uint32 GetFreeInventorySpace() 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
bool IsGameMaster() const
void RemoveCurrency(uint32 id, int32 amount, CurrencyDestroyReason destroyReason=CurrencyDestroyReason::Cheat)
uint8 GetActiveTalentGroup() const
Player * GetSelectedPlayer() const
Item * GetWeaponForAttack(WeaponAttackType attackType, bool useable=false) const
bool HasSpell(uint32 spell) const override
Item * GetItemByGuid(ObjectGuid guid) const
void UpdatePvP(bool state, bool override=false)
Spell * m_spellModTakingSpell
InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 item, uint32 count, uint32 *no_space_count=nullptr) const
bool HasEnoughMoney(uint64 amount) const
ProcReflectDelayed(Unit *owner, ObjectGuid casterGuid)
bool Execute(uint64, uint32) override
void SetPitch(float pitch)
SpellDestination const * GetSrc() const
void SetItemTarget(Item *item)
void RemoveObjectTarget()
ObjectGuid m_objectTargetGUID
WorldObject * GetObjectTarget() const
ObjectGuid GetUnitTargetGUID() const
void ModDst(Position const &pos)
GameObject * GetGOTarget() const
void SetTradeItemTarget(Player *caster)
Corpse * GetCorpseTarget() const
void SetDst(float x, float y, float z, float orientation, uint32 mapId=MAPID_INVALID)
void SetSpeed(float speed)
void SetSrc(float x, float y, float z)
void SetTargetFlag(SpellCastTargetFlags flag)
SpellDestination const * GetDst() const
void SetGOTarget(GameObject *target)
void UpdateTradeSlotItem()
ObjectGuid GetCorpseTargetGUID() const
ObjectGuid GetObjectTargetGUID() const
void SetUnitTarget(Unit *target)
ObjectGuid GetItemTargetGUID() const
WorldObject * m_objectTarget
Item * GetItemTarget() const
uint32 GetTargetMask() const
uint32 GetItemTargetEntry() const
Unit * GetUnitTarget() const
ObjectGuid m_itemTargetGUID
void Update(WorldObject *caster)
void ModSrc(Position const &pos)
void Write(WorldPackets::Spells::SpellTargetData &data)
Position const * GetSrcPos() const
ObjectGuid GetGOTargetGUID() const
WorldLocation const * GetDstPos() const
bool HasRadius(SpellTargetIndex targetIndex) const
int32 CalcValue(WorldObject const *caster=nullptr, int32 const *basePoints=nullptr, Unit const *target=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
uint32 GetMissingTargetMask(bool srcSet=false, bool dstSet=false, uint32 mask=0) const
bool IsAreaAuraEffect() const
std::shared_ptr< std::vector< Condition > > ImplicitTargetConditions
bool IsTargetingArea() const
SpellEffectImplicitTargetTypes GetImplicitTargetType() const
EnumFlag< SpellEffectAttributes > EffectAttributes
SpellEffIndex EffectIndex
SpellImplicitTargetInfo TargetA
float CalcRadius(WorldObject *caster=nullptr, SpellTargetIndex targetIndex=SpellTargetIndex::TargetA, Spell *=nullptr) const
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
struct SpellInfo::@337 SqrtDamageAndHealingDiminishing
std::array< int32, MAX_SPELL_TOTEMS > Totem
uint32 GetMaxTicks() const
std::array< int32, MAX_SPELL_REAGENTS > Reagent
Optional< SpellPowerCost > CalcPowerCost(Powers powerType, bool optionalCost, WorldObject const *caster, SpellSchoolMask schoolMask, Spell *spell=nullptr) const
float GetMaxRange(bool positive=false, WorldObject *caster=nullptr, Spell *spell=nullptr) const
bool HasEffect(SpellEffectName effect) const
SpellCastResult CheckShapeshift(uint32 form) const
std::array< uint16, MAX_SPELL_TOTEMS > TotemCategory
uint64 GetAllEffectsMechanicMask() const
bool IsRequiringDeadTarget() const
int32 NumNonDiminishedTargets
uint64 GetMechanicImmunityMask(Unit const *caster) const
std::array< int16, MAX_SPELL_REAGENTS > ReagentCount
bool IsCooldownStartedOnEvent() const
EnumFlag< SpellAuraInterruptFlags > ChannelInterruptFlags
::Difficulty const Difficulty
SpellRangeEntry const * RangeEntry
uint32 CalcCastTime(Spell *spell=nullptr) const
SpellCastResult CheckLocation(uint32 map_id, uint32 zone_id, uint32 area_id, Player const *player=nullptr) const
uint32 GetRecoveryTime() const
DiminishingReturnsType GetDiminishingReturnsGroupType() const
uint64 GetAllowedMechanicMask() const
uint32 ExcludeCasterAuraState
float GetMinRange(bool positive=false) const
int32 GetMaxDuration() const
bool HasInitialAggro() const
DiminishingGroup GetDiminishingReturnsGroupForSpell() const
SpellCastResult CheckTarget(WorldObject const *caster, WorldObject const *target, bool implicit=true) const
EnumFlag< SpellInterruptFlags > InterruptFlags
bool IsAllowingDeadTarget() const
WeaponAttackType GetAttackType() const
SpellSchoolMask GetSchoolMask() const
std::vector< SpellReagentsCurrencyEntry const * > ReagentsCurrency
bool HasAttribute(SpellAttr0 attribute) const
bool IsNextMeleeSwingSpell() const
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
uint32 GetExplicitTargetMask() const
SpellCastResult CheckExplicitTarget(WorldObject const *caster, WorldObject const *target, Item const *itemTarget=nullptr) const
LocalizedString const * SpellName
bool NeedsExplicitUnitTarget() const
EnumFlag< SpellAuraInterruptFlags2 > ChannelInterruptFlags2
AuraType ExcludeCasterAuraType
bool IsAutoRepeatRangedSpell() const
bool IsMoveAllowedChannel() const
uint32 ExcludeCasterAuraSpell
bool HasAura(AuraType aura) const
bool IsTargetingArea() const
uint32 StartRecoveryCategory
bool IsPositiveEffect(uint8 effIndex) const
bool CanBeUsedInCombat(Unit const *caster) const
bool IsEffectAffected(SpellInfo const *spellInfo, uint8 effIndex) const
void Call(SpellScript *spellScript, SpellMissInfo missInfo) const
void Call(SpellScript *spellScript) const
SpellCastResult Call(SpellScript *spellScript) const
void Call(SpellScript *spellScript, Unit *victim, int32 &damageOrHealing, int32 &flatMod, float &pctMod) const
void Call(SpellScript *spellScript, SpellDestination &target) const
void Call(SpellScript *spellScript, SpellEffIndex effIndex) const
void Call(SpellScript *spellScript) const
void Call(SpellScript *spellScript, std::list< WorldObject * > &targets) const
void Call(SpellScript *spellScript, WorldObject *&target) const
void Call(SpellScript *spellScript, Unit const *victim, float &critChance) const
void Call(SpellScript *spellScript, DamageInfo const &damageInfo, uint32 &resistAmount, int32 &absorbAmount) const
int32 CalculateDamage(SpellEffectInfo const &spellEffectInfo, Unit const *target, float *var=nullptr) const
void SelectImplicitTargetObjectTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType)
SpellInfo const * GetSpellInfo() const
void ExecuteLogEffectTakeTargetPower(SpellEffectName effect, Unit *target, uint32 powerType, uint32 points, float amplitude)
float m_damageMultipliers[MAX_SPELL_EFFECTS]
SpellCastResult CheckItems(int32 *param1, int32 *param2) const
void ExecuteLogEffectSummonObject(SpellEffectName effect, WorldObject *obj)
void CallScriptAfterCastHandlers()
std::vector< SpellPowerCost > m_powerCost
void AddCorpseTarget(Corpse *target, uint32 effectMask)
uint64 CalculateDelayMomentForDst(float launchDelay) const
GameObject * SearchSpellFocus()
bool CheckSpellCancelsStun(int32 *param1) const
std::vector< SpellScript * > m_loadedScripts
GameObject * gameObjTarget
std::pair< float, float > GetMinMaxRange(bool strict) const
void PrepareTriggersExecutedOnHit()
SpellMissInfo targetMissInfo
bool m_referencedFromCurrentSpell
void PreprocessSpellLaunch(TargetInfo &targetInfo)
void UpdateDelayMomentForUnitTarget(Unit *unit, uint64 hitDelay)
bool CheckSpellCancelsNoActions(int32 *param1) const
bool HasPowerTypeCost(Powers power) const
void UpdateSpellHealPrediction(WorldPackets::Spells::SpellHealPrediction &healPrediction, bool withPeriodic)
void SelectImplicitTrajTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType)
void ExecuteLogEffectUnsummonObject(SpellEffectName effect, WorldObject *obj)
uint32 m_channelTargetEffectMask
void ExecuteLogEffectResurrect(SpellEffectName effect, Unit *target)
void cast(bool skipCheck=false)
void ExecuteLogEffectDestroyItem(SpellEffectName effect, uint32 entry)
void SendChannelStart(uint32 duration)
void ExecuteLogEffectOpenLock(SpellEffectName effect, Object *obj)
int64 GetCorpseTargetCountForEffect(SpellEffIndex effect) const
SpellCastTargets m_targets
void SelectImplicitNearbyTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, SpellTargetIndex targetIndex, uint32 effMask)
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(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 SetSpellValue(SpellValueMod mod, int32 value)
void HandleEffects(Unit *pUnitTarget, Item *pItemTarget, GameObject *pGoTarget, Corpse *pCorpseTarget, SpellEffectInfo const &spellEffectInfo, SpellEffectHandleMode mode)
void prepareDataForTriggerSystem()
void SearchAreaTargets(std::list< WorldObject * > &targets, SpellEffectInfo const &spellEffectInfo, float range, Position const *position, WorldObject *referer, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectionType, ConditionContainer const *condList, Trinity::WorldObjectSpellAreaTargetSearchReason searchReason)
SpellEffectHandleMode effectHandleMode
bool IsValidDeadOrAliveTarget(Unit const *target) const
int32 m_channeledDuration
SpellCastResult CheckMovement() const
void DoProcessTargetContainer(Container &targetContainer)
bool IsNeedSendToClient() const
WorldObject * SearchNearbyTarget(SpellEffectInfo const &spellEffectInfo, float range, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectionType, ConditionContainer const *condList=nullptr)
bool IsIgnoringCooldowns() const
void SelectImplicitDestDestTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, SpellTargetIndex targetIndex)
std::vector< TargetInfo > m_UniqueTargetInfo
SpellDestination m_destTargets[MAX_SPELL_EFFECTS]
void _handle_finish_phase()
void UpdateDelayMomentForDst(uint64 hitDelay)
bool CanExecuteTriggersOnHit(Unit *unit, SpellInfo const *triggeredByAura=nullptr) const
void PrepareTargetProcessing()
Trinity::unique_weak_ptr< Spell > GetWeakPtr() const
void SetExecutedCurrently(bool yes)
void AddUnitTarget(Unit *target, uint32 effectMask, bool checkIfValid=true, bool implicit=true, Position const *losPosition=nullptr)
ObjectGuid m_originalCastId
uint8 m_delayAtDamageCount
void SendChannelUpdate(uint32 time)
static Spell const * ExtractSpellFromEvent(BasicEvent *event)
ProcFlagsSpellType m_procSpellType
void ExecuteLogEffectExtraAttacks(SpellEffectName effect, Unit *victim, uint32 numAttacks)
WeaponAttackType m_attackType
void _cast(bool skipCheck=false)
void SendInterrupted(uint8 result)
bool IsProcDisabled() const
void SendSpellInterruptLog(Unit *victim, uint32 spellId)
bool IsFocusDisabled() const
int32 GetSpellCastDataAmmo()
ObjectGuid m_originalCasterGUID
WorldObject *const m_caster
int64 GetItemTargetCountForEffect(SpellEffIndex effect) const
std::string GetDebugInfo() const
bool UpdateChanneledTargetList()
void TriggerGlobalCooldown()
void ExecuteLogEffectDurabilityDamage(SpellEffectName effect, Unit *victim, int32 itemId, int32 amount)
void CallScriptCalcHealingHandlers(Unit *victim, int32 &healing, int32 &flatMod, float &pctMod)
void SendMountResult(MountResult result)
void AddGOTarget(GameObject *target, uint32 effectMask)
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, SpellCastVisual spellVisual, ObjectGuid cast_count, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE, int32 *param1=nullptr, int32 *param2=nullptr)
void HandleThreatSpells()
std::vector< CorpseTargetInfo > m_UniqueCorpseTargetInfo
void CancelGlobalCooldown()
bool CheckSpellCancelsAuraEffect(AuraType auraType, int32 *param1) const
void SearchChainTargets(std::list< WorldObject * > &targets, uint32 chainTargets, WorldObject *target, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectType, SpellEffectInfo const &spellEffectInfo, bool isChainHeal)
void SelectImplicitAreaTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, SpellTargetIndex targetIndex, uint32 effMask)
bool CheckSpellCancelsSilence(int32 *param1) const
void CallScriptOnCastHandlers()
void AddDestTarget(SpellDestination const &dest, uint32 effIndex)
int64 GetGameObjectTargetCountForEffect(SpellEffIndex effect) const
void _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 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 SelectSpellTargets()
bool CheckSpellCancelsConfuse(int32 *param1) const
SpellCastResult prepare(SpellCastTargets const &targets, AuraEffect const *triggeredByAura=nullptr)
SpellCastResult CheckCast(bool strict, int32 *param1=nullptr, int32 *param2=nullptr)
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 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
void SelectImplicitCasterObjectTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType)
void SetReferencedFromCurrent(bool yes)
void SelectEffectTypeImplicitTargets(SpellEffectInfo const &spellEffectInfo)
void update(uint32 difftime)
void SelectImplicitConeTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, SpellTargetIndex targetIndex, uint32 effMask)
uint64 GetDelayStart() const
bool CheckScriptEffectImplicitTargets(uint32 effIndex, uint32 effIndexToCheck)
ProcFlagsInit m_procVictim
std::vector< SpellLogEffect > _executeLogEffects
void CallScriptSuccessfulDispel(SpellEffIndex effIndex)
void DoEffectOnLaunchTarget(TargetInfo &targetInfo, float multiplier, SpellEffectInfo const &spellEffectInfo)
uint64 GetDelayMoment() const
void AddItemTarget(Item *item, uint32 effectMask)
int32 GetUnitTargetIndexForEffect(ObjectGuid const &target, SpellEffIndex effect) const
UsedSpellMods m_appliedMods
void CallScriptCalcCritChanceHandlers(Unit const *victim, float &chance)
SpellValue *const m_spellValue
void SelectImplicitChannelTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType)
void finish(SpellCastResult result=SPELL_CAST_OK)
bool CheckEffectTarget(Unit const *target, SpellEffectInfo const &spellEffectInfo, Position const *losPosition) const
void SendResurrectRequest(Player *target)
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 ==
float GetThreat(Unit const *who, bool includeOffline=false) const
Utility class to enable range for loop syntax for multimap.equal_range uses.
Trinity::unique_trackable_ptr companion class, replicating what std::weak_ptr is to std::shared_ptr.
void SetDiminishGroup(DiminishingGroup group)
void AddStaticApplication(Unit *target, uint32 effMask)
Unit * GetCharmed() const
void ClearUnitState(uint32 f)
uint32 GetChannelSpellId() const
void SetLastDamagedTargetGuid(ObjectGuid guid)
int32 ModifyPower(Powers power, int32 val, bool withPowerUpdate=true)
bool IsWithinBoundaryRadius(const Unit *obj) const
void RemoveGameObject(GameObject *gameObj, bool del)
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
uint32 GetSchoolImmunityMask() const
uint32 m_lastSanctuaryTime
static uint32 SpellCriticalHealingBonus(Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit *victim)
bool CanHaveThreatList() const
====================== THREAT & COMBAT ====================
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
int64 ModifyHealth(int64 val)
void SetCurrentCastSpell(Spell *pSpell)
void SetStandState(UnitStandStateType state, uint32 animKitID=0)
ThreatManager & GetThreatManager()
bool HasAuraTypeWithMiscvalue(AuraType auraType, int32 miscValue) const
void SetInCombatWith(Unit *enemy, bool addSecondUnitSuppressed=false)
UF::UpdateField< UF::UnitData, 0, TYPEID_UNIT > m_unitData
static void DealDamageMods(Unit const *attacker, Unit const *victim, uint32 &damage, uint32 *absorb)
uint64 GetMechanicImmunityMask() const
void CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=BASE_ATTACK, bool crit=false, bool blocked=false, Spell *spell=nullptr)
std::forward_list< AuraEffect * > AuraEffectList
bool IsInDisallowedMountForm() const
bool IsImmunedToSpell(SpellInfo const *spellInfo, WorldObject const *caster, bool requireImmunityPurgesEffectAttribute=false) const
void DealSpellDamage(SpellNonMeleeDamage const *damageInfo, bool durabilityLoss)
bool haveOffhandWeapon() const
Powers GetPowerType() const
bool HasUnitFlag(UnitFlags flags) const
ObjectGuid GetCharmedGUID() const
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
void UpdateInterruptMask()
void IncrDiminishing(SpellInfo const *auraSpellInfo)
void AddChannelObject(ObjectGuid guid)
void SetChannelSpellId(uint32 channelSpellId)
bool IsFullHealth() const
bool HasUnitFlag2(UnitFlags2 flags) const
float GetCombatReach() const override
int32 GetMaxPower(Powers power) const
int32 HealBySpell(HealInfo &healInfo, bool critical=false)
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage const *log)
bool IsStandState() const
bool IsSilenced(SpellSchoolMask schoolMask) const
TempSummon * ToTempSummon()
CharmInfo * GetCharmInfo()
ObjectGuid GetCharmerOrOwnerGUID() const override
float SpellCritChanceDone(Spell *spell, AuraEffect const *aurEff, SpellSchoolMask schoolMask, WeaponAttackType attackType=BASE_ATTACK) const
void SetChannelVisual(SpellCastVisual channelVisual)
virtual bool IsAffectedByDiminishingReturns() const
bool IsOnVehicle(Unit const *vehicle) const
bool IsCharmedOwnedByPlayerOrPlayer() const
virtual bool IsImmunedToSpellEffect(SpellInfo const *spellInfo, SpellEffectInfo const &spellEffectInfo, WorldObject const *caster, bool requireImmunityPurgesEffectAttribute=false) const
float SpellCritChanceTaken(Unit const *caster, Spell *spell, AuraEffect const *aurEff, SpellSchoolMask schoolMask, float doneChance, WeaponAttackType attackType=BASE_ATTACK) const
int32 CalculateAOEAvoidance(int32 damage, uint32 schoolMask, bool npcCaster) const
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
void RemoveDynObject(uint32 spellId)
AttackerSet const & getAttackers() const
void EngageWithTarget(Unit *who)
uint8 GetLevelForTarget(WorldObject const *) const override
int32 GetTotalAuraModifier(AuraType auraType) const
void RemoveAurasWithInterruptFlags(InterruptFlags flag, SpellInfo const *source=nullptr)
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
bool HasAuraWithMechanic(uint64 mechanicMask) const
virtual void setDeathState(DeathState s)
CombatManager & GetCombatManager()
bool HasAuraTypeWithAffectMask(AuraType auraType, SpellInfo const *affectedSpell) const
bool isAttackReady(WeaponAttackType type=BASE_ATTACK) const
bool ApplyDiminishingToDuration(SpellInfo const *auraSpellInfo, int32 &duration, WorldObject *caster, DiminishingLevels previousLevel) const
bool IsSpiritHealer() const
AuraList & GetSingleCastAuras()
AuraApplication * GetAuraApplication(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraApplication *except=nullptr) const
Vehicle * GetVehicleKit() const
void resetAttackTimer(WeaponAttackType type=BASE_ATTACK)
static void ProcSkillsAndAuras(Unit *actor, Unit *actionTarget, ProcFlagsInit const &typeMaskActor, ProcFlagsInit const &typeMaskActionTarget, ProcFlagsSpellType spellTypeMask, ProcFlagsSpellPhase spellPhaseMask, ProcFlagsHit hitMask, Spell *spell, DamageInfo *damageInfo, HealInfo *healInfo)
virtual bool IsEngaged() const
void ClearChannelObjects()
bool IsInPartyWith(Unit const *unit) const
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
int32 SpellHealingBonusDone(Unit *victim, SpellInfo const *spellProto, int32 healamount, DamageEffectType damagetype, SpellEffectInfo const &spellEffectInfo, uint32 stack=1, Spell *spell=nullptr, AuraEffect const *aurEff=nullptr) const
ObjectGuid GetTarget() const
ObjectGuid GetPetGUID() const
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
bool isLineOfSightCalcEnabled() const
static VMapManager2 * createOrGetVMapManager()
bool IsControllableVehicle() const
constexpr void WorldRelocate(WorldLocation const &loc)
constexpr uint32 GetMapId() const
Unit * GetMagicHitRedirectTarget(Unit *victim, SpellInfo const *spellInfo)
bool IsWithinDist2d(float x, float y, float dist) const
virtual void SendMessageToSet(WorldPacket const *data, bool self) const
virtual float GetCollisionHeight() const
Unit * GetCharmerOrOwner() const
void SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo missInfo)
bool IsWithinLOS(float x, float y, float z, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing) const
void SendCombatLogMessage(WorldPackets::CombatLog::CombatLogServerPacket *combatLog) const
void GetClosePoint(float &x, float &y, float &z, float size, float distance2d=0, float relAngle=0) const
float GetMapHeight(float x, float y, float z, bool vmap=true, float distanceToSearch=50.0f) const
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
float GetMapWaterOrGroundLevel(float x, float y, float z, float *ground=nullptr) const
bool IsValidAttackTarget(WorldObject const *target, SpellInfo const *bySpell=nullptr) const
float GetTransOffsetX() const
void MovePositionToFirstCollision(Position &pos, float dist, float angle)
PhaseShift & GetPhaseShift()
bool GetDistanceOrder(WorldObject const *obj1, WorldObject const *obj2, bool is3D=true) const
int32 ModSpellDuration(SpellInfo const *spellInfo, WorldObject const *target, int32 duration, bool positive, uint32 effectMask) const
std::string GetNameForLocaleIdx(LocaleConstant) const override
float GetTransOffsetY() const
float GetTransOffsetZ() const
int32 CalculateSpellDamage(Unit const *target, SpellEffectInfo const &spellEffectInfo, int32 const *basePoints=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
bool IsWithinLOSInMap(WorldObject const *obj, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing) const
virtual ObjectGuid GetTransGUID() 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
float GetVisibilityRange() const
virtual uint32 GetCastSpellXSpellVisualId(SpellInfo const *spellInfo) const
float GetSpellMinRangeForTarget(Unit const *target, SpellInfo const *spellInfo) const
SpellMissInfo SpellHitResult(Unit *victim, SpellInfo const *spellInfo, bool canReflect=false) const
float GetDistance(WorldObject const *obj) const
float GetTransOffsetO() const
MovementInfo m_movementInfo
void GetZoneAndAreaId(uint32 &zoneid, uint32 &areaid) const
float GetSpellMaxRangeForTarget(Unit const *target, SpellInfo const *spellInfo) const
bool IsWithinDist(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
bool IsFriendlyTo(WorldObject const *target) const
virtual float GetCombatReach() const
void ModSpellDurationTime(SpellInfo const *spellInfo, int32 &durationTime, Spell *spell=nullptr) const
Spells::SpellCastLogData LogData
std::vector< SpellLogEffect > const * Effects
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
ObjectGuid ResurrectOffererGUID
uint32 ResurrectOffererVirtualRealmAddress
WorldPacket const * Write() override
Optional< SpellTargetedHealPrediction > HealPrediction
Optional< SpellChannelStartInterruptImmunities > InterruptImmunities
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
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 Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
TC_GAME_API Corpse * GetCorpse(WorldObject const &u, ObjectGuid const &guid)
TC_GAME_API Creature * GetCreatureOrPetOrVehicle(WorldObject const &, ObjectGuid const &)
void RandomShuffle(Iterator begin, Iterator end)
Reorder the elements of the iterator range randomly.
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
constexpr IteratorPair< iterator, end_iterator > MakeIteratorPair(iterator first, end_iterator second)
void RandomResize(C &container, std::size_t requestedSize)
WorldObjectSpellAreaTargetSearchReason
void SelectRandomInjuredTargets(std::list< WorldObject * > &targets, size_t maxTargets, bool prioritizePlayers, Unit const *prioritizeGroupMembersOf)
CellCoord ComputeCellCoord(float x, float y)
constexpr std::size_t size()
AuraCreateInfo & SetBaseAmount(int32 const *bp)
AuraCreateInfo & SetCastItem(ObjectGuid const &guid, uint32 itemId, int32 itemLevel)
AuraCreateInfo & SetCasterGUID(ObjectGuid const &guid)
AuraCreateInfo & SetOwnerEffectMask(uint32 effMask)
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
int32 GetBaseRequiredLevel() const
bool HasFlag(ItemFlags flag) const
uint32 GetSubClass() const
std::array< uint8, MAX_LOCK_CASE > Type
std::array< uint16, MAX_LOCK_CASE > Skill
std::array< int32, MAX_LOCK_CASE > Index
uint32 GetMovementFlags() const
constexpr void SetOrientation(float orientation)
constexpr float GetPositionX() const
constexpr float GetPositionY() const
float GetExactDist2d(const float x, const float y) const
float GetRelativeAngle(float x, float y) const
float GetExactDist(float x, float y, float z) const
bool HasInLine(Position const *pos, float objSize, float width) const
bool HasInArc(float arcangle, Position const *pos, float border=2.0f) const
float GetAbsoluteAngle(float x, float y) const
constexpr void Relocate(float x, float y)
void GetPositionOffsetTo(Position const &endPos, Position &retOffset) const
constexpr float GetExactDistSq(float x, float y, float z) const
constexpr bool IsInDist(float x, float y, float z, float dist) const
void RelocateOffset(Position const &offset)
constexpr float GetOrientation() const
constexpr float GetPositionZ() const
uint32 SpellXSpellVisualID
void RelocateOffset(Position const &offset)
Position _transportOffset
void Relocate(Position const &pos)
ObjectGuid _transportGUID
std::array< uint8, MAX_ITEM_ENCHANTMENT_EFFECTS > Effect
EnumFlag< SpellItemEnchantmentFlags > GetFlags() const
Optional< std::vector< SpellLogEffectTradeSkillItemParams > > TradeSkillTargets
Optional< std::vector< SpellLogEffectFeedPetParams > > FeedPetTargets
Optional< std::vector< SpellLogEffectPowerDrainParams > > PowerDrainTargets
Optional< std::vector< SpellLogEffectDurabilityDamageParams > > DurabilityDamageTargets
Optional< std::vector< SpellLogEffectGenericVictimParams > > GenericVictimTargets
Optional< std::vector< SpellLogEffectExtraAttacksParams > > ExtraAttacksTargets
Optional< int32 > Duration
Optional< int32 > ParentSpellTargetIndex
int32 EffectBasePoints[MAX_SPELL_EFFECTS]
uint32 CustomBasePointsMask
uint32 MaxAffectedTargets
Optional< int32 > ParentSpellTargetCount
SpellValue(SpellInfo const *proto, WorldObject const *caster)
void DoTargetSpellHit(Spell *spell, SpellEffectInfo const &spellEffectInfo) override
void DoTargetSpellHit(Spell *spell, SpellEffectInfo const &spellEffectInfo) override
void DoTargetSpellHit(Spell *spell, SpellEffectInfo const &spellEffectInfo) override
void PreprocessTarget(Spell *spell) override
SpellMissInfo MissCondition
int32 AuraBasePoints[MAX_SPELL_EFFECTS]
void DoTargetSpellHit(Spell *spell, SpellEffectInfo const &spellEffectInfo) override
void DoDamageAndTriggers(Spell *spell) override
SpellMissInfo ReflectResult
PhaseShift const * i_phaseShift
WorldObjectSpellAreaTargetSearchReason _searchReason
bool operator()(WorldObject *target) const
Position const * _position
WorldObjectSpellAreaTargetCheck(float range, Position const *position, WorldObject *caster, WorldObject *referer, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer const *condList, SpellTargetObjectTypes objectType, WorldObjectSpellAreaTargetSearchReason searchReason=WorldObjectSpellAreaTargetSearchReason::Area)
WorldObjectSpellConeTargetCheck(Position const &coneSrc, float coneAngle, float lineWidth, float range, WorldObject *caster, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer const *condList, SpellTargetObjectTypes objectType)
bool operator()(WorldObject *target) const
WorldObjectSpellLineTargetCheck(Position const *srcPosition, Position const *dstPosition, float lineWidth, float range, WorldObject *caster, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer const *condList, SpellTargetObjectTypes objectType)
bool operator()(WorldObject *target) const
WorldObjectSpellNearbyTargetCheck(float range, WorldObject *caster, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer const *condList, SpellTargetObjectTypes objectType)
bool operator()(WorldObject *target)
Position const * _position
SpellTargetCheckTypes _targetSelectionType
WorldObjectSpellTargetCheck(WorldObject *caster, WorldObject *referer, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer const *condList, SpellTargetObjectTypes objectType)
~WorldObjectSpellTargetCheck()
std::unique_ptr< ConditionSourceInfo > _condSrcInfo
SpellInfo const * _spellInfo
bool operator()(WorldObject *target) const
ConditionContainer const * _condList
SpellTargetObjectTypes _objectType
Position const * _position
WorldObjectSpellTrajTargetCheck(float range, Position const *position, WorldObject *caster, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer const *condList, SpellTargetObjectTypes objectType)
bool operator()(WorldObject *target) const
int32 SpellXSpellVisualID
std::vector< ObjectGuid > HitTargets
SpellHealPrediction Predict
Optional< RuneData > RemainingRunes
CreatureImmunities Immunities
std::vector< SpellMissStatus > MissStatus
MissileTrajectoryResult MissileTrajectory
std::vector< ObjectGuid > MissTargets
ObjectGuid OriginalCastID
std::vector< SpellHitStatus > HitStatus
std::vector< SpellPowerData > RemainingPower
void Initialize(Unit const *unit)
MissileTrajectoryRequest MissileTrajectory
Optional< float > Orientation
Optional< TargetLocation > SrcLocation
Optional< TargetLocation > DstLocation
SpellHealPrediction Predict