30#include "G3DPosition.hpp"
129 m_targetMask(spellCastRequest.Target.Flags), m_objectTarget(nullptr), m_itemTarget(nullptr),
131 m_itemTargetEntry(0), m_pitch(0.0f), m_speed(0.0f)
260 std::array<char, 128>& name = data.
Name.emplace();
261 std::ranges::copy_n(
m_strTarget.begin(), std::min(std::ssize(
m_strTarget), std::ssize(name)), name.begin());
553m_spellInfo(
sSpellMgr->GetSpellForDifficultyFromSpell(info, caster)),
555, m_spellValue(new
SpellValue(m_spellInfo)), _spellEvent(nullptr)
586 if (!originalCasterGUID.
IsEmpty())
698 Unit* unit =
nullptr;
754 Unit* redirect =
nullptr;
768 if (redirect && (redirect != target))
779 uint32 processedEffectsMaskForSpell = 0;
784 if (!spellEffectInfo.IsEffect())
794 uint32 implicitTargetEffectMaskToSelect = [&]
796 uint32 effectMask = 1u << spellEffectInfo.EffectIndex;
801 for (
uint32 j = spellEffectInfo.EffectIndex + 1; j < effects.size(); ++j)
803 if (effects[j].IsEffect() &&
804 spellEffectInfo.TargetA.GetTarget() == effects[j].TargetA.GetTarget() &&
805 spellEffectInfo.TargetB.GetTarget() == effects[j].TargetB.GetTarget() &&
806 spellEffectInfo.ImplicitTargetConditions == effects[j].ImplicitTargetConditions &&
811 switch (targetInfo.GetSelectionCategory())
823 if (shouldCheckRadius(spellEffectInfo.TargetA) || shouldCheckRadius(spellEffectInfo.TargetB))
824 if (spellEffectInfo.CalcRadius(
m_caster) != effects[j].CalcRadius(
m_caster))
827 effectMask |= 1 << j;
834 implicitTargetEffectMaskToSelect &= ~processedEffectsMaskForSpell;
835 if (implicitTargetEffectMaskToSelect)
839 processedEffectsMaskForSpell |= implicitTargetEffectMaskToSelect;
852 if (implicitTargetEffectMaskToSelect
862 return target.
EffectMask & implicitTargetEffectMaskToSelect;
879 if (!anyNonImmuneTargetFound)
898 uint8 mask = (1 << spellEffectInfo.EffectIndex);
901 if (ihit->EffectMask & mask)
917 if (!targetInfo.ScaleAura && targetInfo.TargetGUID != m_caster->GetGUID())
998 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT_SRC");
1015 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT_DEST");
1029 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT");
1039 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target category");
1048 ABORT_MSG(
"Spell::SelectImplicitChannelTargets: received not implemented target reference type");
1053 if (!channeledSpell)
1065 if (target && target->
ToUnit())
1095 ABORT_MSG(
"Spell::SelectImplicitChannelTargets: received not implemented target type");
1104 ABORT_MSG(
"Spell::SelectImplicitNearbyTargets: received not implemented target reference type");
1125 ABORT_MSG(
"Spell::SelectImplicitNearbyTargets: received not implemented selection check type");
1134 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));
1197 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);
1208 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);
1219 TC_LOG_DEBUG(
"spells",
"Spell::SelectImplicitNearbyTargets: OnObjectTargetSelect script hook for spell Id {} set object of wrong type, expected corpse, got {}, effect {}",
m_spellInfo->
Id, target->
GetGUID().
GetTypeName(), effMask);
1233 ABORT_MSG(
"Spell::SelectImplicitNearbyTargets: received not implemented target object type");
1244 ABORT_MSG(
"Spell::SelectImplicitConeTargets: received not implemented target reference type");
1247 std::list<WorldObject*> targets;
1251 float coneAngle = float(
M_PI) / 2.f;
1255 if (G3D::fuzzyEq(radius, 0.f))
1265 SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellConeTargetCheck> >(searcher, containerTypeMask,
m_caster,
m_caster, radius + extraSearchRadius);
1269 if (!targets.empty())
1310 if (ihit->EffectMask & (1 << spellEffectInfo.
EffectIndex))
1319 ABORT_MSG(
"Spell::SelectImplicitAreaTargets: received not implemented target reference type");
1340 ABORT_MSG(
"Spell::SelectImplicitAreaTargets: received not implemented target reference type");
1343 std::list<WorldObject*> targets;
1346 if (G3D::fuzzyEq(radius, 0.f))
1355 if (!targets.empty())
1387 dest =
SpellDestination(playerCaster->m_homebindX, playerCaster->m_homebindY, playerCaster->m_homebindZ, playerCaster->GetOrientation(), playerCaster->m_homebindMapId);
1394 dest =
SpellDestination(st->target_X, st->target_Y, st->target_Z, st->target_Orientation, (
int32)st->target_mapId);
1396 dest =
SpellDestination(st->target_X, st->target_Y, st->target_Z, st->target_Orientation);
1409 float dist =
frand(minDist, maxDist);
1411 float angle = float(
rand_norm()) *
static_cast<float>(
M_PI * 35.0f / 180.0f) -
static_cast<float>(
M_PI * 17.5f / 180.0f);
1418 liquidLevel = liquidData.
level;
1420 if (liquidLevel <= ground)
1428 if (ground + 0.75 > liquidLevel)
1445 float dist = spellEffectInfo.
CalcRadius(unitCaster);
1467 dist = objSize + (dist - objSize) *
float(
rand_norm());
1474 static float const DefaultTotemDistance = 3.0f;
1476 dist = DefaultTotemDistance;
1513 float dist = spellEffectInfo.
CalcRadius(
nullptr);
1568 bool checkIfValid =
true;
1574 checkIfValid =
false;
1581 target = unitCaster->GetGuardianPet();
1585 if (unitCaster->IsSummon())
1586 target = unitCaster->ToTempSummon()->GetSummonerUnit();
1590 target = unitCaster->GetVehicleBase();
1601 if (vehicleBase->IsVehicle())
1653 if (effMask & (1 << k))
1657 std::list<WorldObject*> targets;
1664 for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
1676 if (x < 100000.0f && x > -100000.0f)
return x;
1677 if (x >= 100000.0f)
return 100000.0f;
1678 if (x <= 100000.0f)
return -100000.0f;
1695 std::list<WorldObject*> targets;
1698 SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellTrajTargetCheck> > (searcher,
GRID_MAP_TYPE_MASK_ALL,
m_caster, &srcPos, dist2d);
1699 if (targets.empty())
1705 float a = (srcToDestDelta - dist2d * b) / (dist2d * dist2d);
1713 bestDist = std::min(std::max(bestDist, triggerSpellInfo->GetMaxRange(
false)), std::min(dist2d, 300.0f));
1717 for (
auto itr = targets.begin(); itr != targets.end(); ++itr)
1724 if (unitCaster == *itr || unitCaster->
IsOnVehicle(unit) || unit->GetVehicle())
1734 float const size = std::max((*itr)->GetCombatReach(), 1.0f);
1736 float const dz = (*itr)->GetPositionZ() - srcPos.
m_positionZ;
1738 float const horizontalDistToTraj = std::fabs(objDist2d * std::sin(srcPos.
GetRelativeAngle(*itr)));
1739 float const sizeFactor = std::cos((horizontalDistToTraj / size) * (
M_PI / 2.0f));
1740 float const distToHitPoint = std::max(objDist2d * std::cos(srcPos.
GetRelativeAngle(*itr)) - size * sizeFactor, 0.0f);
1741 float const height = distToHitPoint * (a * distToHitPoint + b);
1746 if (distToHitPoint < bestDist)
1748 bestDist = distToHitPoint;
1753 if (dist2d > bestDist)
1768 switch (spellEffectInfo.
Effect)
1789 Player* player = ObjectAccessor::GetPlayer(map, targetGuid);
1794 if (player->IsImmunedToSpellEffect(spell->GetSpellInfo(), spellEffectInfo, nullptr))
1797 spell->HandleEffects(player, nullptr, nullptr, nullptr, spellEffectInfo, SPELL_EFFECT_HANDLE_HIT_TARGET);
1829 target = corpseTarget;
1896 retMask &=
sConditionMgr->GetSearcherTypeMaskForConditionList(*condList);
1900template<
class SEARCHER>
1909 if (searchInGrid || searchInWorld)
1929 if (!containerTypeMask)
1935 SearchTargets<Trinity::WorldObjectLastSearcher<Trinity::WorldObjectSpellNearbyTargetCheck>>(searcher, containerTypeMask,
m_caster,
m_caster, range);
1942 if (!containerTypeMask)
1949 SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellAreaTargetCheck>>(searcher, containerTypeMask,
m_caster, position, range + extraSearchRadius);
1955 float jumpRadius = 0.0f;
1983 float searchRadius = jumpRadius;
1985 searchRadius *= chainTargets;
1987 std::list<WorldObject*> tempTargets;
1989 tempTargets.remove(target);
1995 for (std::list<WorldObject*>::iterator itr = tempTargets.begin(); itr != tempTargets.end();)
1997 std::list<WorldObject*>::iterator checkItr = itr++;
1999 tempTargets.erase(checkItr);
2003 while (chainTargets)
2006 std::list<WorldObject*>::iterator foundItr = tempTargets.end();
2011 for (std::list<WorldObject*>::iterator itr = tempTargets.begin(); itr != tempTargets.end(); ++itr)
2015 uint32 deficit = unit->GetMaxHealth() - unit->GetHealth();
2019 maxHPDeficit = deficit;
2027 for (std::list<WorldObject*>::iterator itr = tempTargets.begin(); itr != tempTargets.end(); ++itr)
2029 if (foundItr == tempTargets.end())
2039 if (foundItr == tempTargets.end())
2042 tempTargets.erase(foundItr);
2043 targets.push_back(target);
2159 if (!spellEffectInfo.IsEffect() || !
CheckEffectTarget(target, spellEffectInfo, losPosition))
2160 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2173 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2182 ihit->EffectMask |= effectMask;
2183 ihit->ScaleAura =
false;
2188 ihit->ScaleAura =
true;
2202 targetInfo.
IsCrit =
false;
2265 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2277 ihit->EffectMask |= effectMask;
2311 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2322 ihit->EffectMask |= effectMask;
2338 if (!spellEffectInfo.IsEffect())
2339 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2349 if (targetGUID == ihit.TargetGUID)
2351 ihit.EffectMask |= effectMask;
2390 return targetInfo.EffectMask & (1 << effect);
2398 return targetInfo.EffectMask & (1 << effect);
2406 return targetInfo.EffectMask & (1 << effect);
2475 if (unit->
IsAlive() != IsAlive)
2481 if (_spellHitTarget)
2497 if (_spellHitTarget)
2521 if (canEffectTrigger && !procAttacker && !procVictim)
2523 bool positive =
true;
2531 if (EffectMask && !(EffectMask & (1 << i)))
2573 bool hasHealing =
false;
2574 std::unique_ptr<DamageInfo> spellDamageInfo;
2575 std::unique_ptr<HealInfo> healInfo;
2591 spell->
m_healing = healInfo->GetEffectiveHeal();
2597 bool hasDamage =
false;
2630 if (canEffectTrigger)
2638 if (!hasHealing && !hasDamage)
2644 if (canEffectTrigger)
2646 spellDamageInfo = std::make_unique<DamageInfo>(damageInfo,
NODAMAGE, spell->
m_attackType, hitMask);
2660 if (canEffectTrigger)
2695 if (_spellHitTarget)
2699 if (
CreatureAI* hitTargetAI = cHitTarget->AI())
2709 if (
AuraApplication* aurApp = HitAura->GetApplicationOfTarget(_spellHitTarget->GetGUID()))
2712 uint8 effMask = EffectMask & aurApp->GetEffectsToApply();
2714 if ((effMask & (1 << i)) && aurApp->HasEffect(i))
2715 effMask &= ~(1 << i);
2718 _spellHitTarget->_ApplyAura(aurApp, effMask);
2788 if (creatureTarget->IsEvadingAttacks())
2826 playerOwner->SetContestedPvP();
2827 playerOwner->UpdatePvP(
true);
2858 hitInfo.
AuraBasePoints[auraEffectInfo.EffectIndex] = auraEffectInfo.BasePoints;
2884 if (origCaster == unit || !origCaster->
IsFriendlyTo(unit))
2889 if (hitInfo.
EffectMask & (1 << auraSpellEffect.EffectIndex) &&
2890 auraSpellEffect.IsUnitOwnedAuraEffect() &&
2920 bool refresh =
false;
2935 .SetPeriodicReset(resetPeriodicTimer)
2991 int32 _duration = 0;
2997 TC_LOG_DEBUG(
"spells",
"Spell {} triggered spell {} by SPELL_AURA_ADD_TARGET_TRIGGER aura",
m_spellInfo->
Id, i->triggeredSpell->Id);
3001 if (i->triggeredSpell->GetDuration() == -1)
3011 triggeredAur->SetDuration(_duration);
3022 for (std::vector<int32>::const_iterator i = spellTriggered->begin(); i != spellTriggered->end(); ++i)
3039 uint8 channelAuraMask = 0;
3042 channelAuraMask |= 1 << spellEffectInfo.EffectIndex;
3044 channelAuraMask &= channelTargetEffectMask;
3047 if (channelAuraMask)
3059 if (targetInfo.MissCondition ==
SPELL_MISS_NONE && (channelTargetEffectMask & targetInfo.EffectMask))
3067 if (channelAuraMask & targetInfo.EffectMask)
3073 targetInfo.EffectMask &= ~aurApp->GetEffectMask();
3082 channelTargetEffectMask &= ~targetInfo.EffectMask;
3088 return channelTargetEffectMask == 0;
3132 if (triggeredByAura)
3164 uint32 param1 = 0, param2 = 0;
3182 if (param1 || param2)
3228 return movementResult;
3269 unitCaster->SetCurrentCastSpell(
this);
3278 if (caster->IsAIEnabled())
3357 Spell* lastSpellMod =
nullptr;
3392 sScriptMgr->OnPlayerSpellCast(playerCaster,
this, skipCheck);
3399 for (
Unit* controlled : playerCaster->m_Controlled)
3401 if (
CreatureAI* controlledAI = cControlled->AI())
3402 controlledAI->OwnerAttacked(target);
3433 uint32 param1 = 0, param2 = 0;
3437 cleanupSpell(castResult, ¶m1, ¶m2);
3449 if (!my_trade->IsInAcceptProcess())
3463 uint8 aura_effmask = 0;
3465 if (spellEffectInfo.IsUnitOwnedAuraEffect())
3466 aura_effmask |= 1 << spellEffectInfo.EffectIndex;
3478 if (target->HasStrongerAuraWithDR(
m_spellInfo, caster, triggered))
3491 if (!creatureCaster->GetTarget().IsEmpty() && !creatureCaster->HasUnitFlag(
UNIT_FLAG_POSSESSED))
3493 creatureCaster->SetInFront(target);
3513 pet->DespawnOrUnsummon();
3557 creatureCaster->ReleaseSpellFocus(
this);
3572 if (unitCaster->HasUnitState(
UNIT_STATE_CASTING) && !unitCaster->IsNonMeleeSpellCast(
false,
false,
true))
3585 for (
int32 id : *spell_triggered)
3590 unitCaster->RemoveAurasDueToSpell(-
id);
3629 if (caster->IsAIEnabled())
3633template <
class Container>
3637 target.PreprocessTarget(
this);
3641 if (target.EffectMask & (1 << spellEffectInfo.EffectIndex))
3642 target.DoTargetSpellHit(
this, spellEffectInfo);
3645 target.DoDamageAndTriggers(
this);
3667 else if (duration == -1)
3736 std::vector<TargetInfo> delayedTargets;
3739 if (single_missile || target.TimeDelay <= t_offset)
3741 target.TimeDelay = t_offset;
3742 delayedTargets.emplace_back(std::move(target));
3745 else if (next_time == 0 || target.
TimeDelay < next_time)
3756 std::vector<GOTargetInfo> delayedGOTargets;
3759 if (single_missile || goTarget.TimeDelay <= t_offset)
3761 goTarget.TimeDelay = t_offset;
3762 delayedGOTargets.emplace_back(std::move(goTarget));
3765 else if (next_time == 0 || goTarget.TimeDelay < next_time)
3766 next_time = goTarget.TimeDelay;
3777 modOwner->SetSpellModTakingSpell(
this,
false);
3806 if (!spellEffectInfo.IsEffect())
3823 unitCaster->ClearComboPoints();
3933 if (creatureCaster->IsAIEnabled())
3934 creatureCaster->AI()->OnChannelFinished(
m_spellInfo);
3969 ((
Puppet*)charm)->UnSummon();
3973 creatureCaster->ReleaseSpellFocus(
this);
3998 for (Unit::AuraEffectList::const_iterator i = vIgnoreReset.begin(); i != vIgnoreReset.end(); ++i)
4031 packet.CastID = castId;
4032 packet.SpellID = spellInfo->
Id;
4033 packet.Reason = result;
4039 packet.FailedArg1 = *param1;
4045 packet.FailedArg1 = *param1;
4049 switch (spellInfo->
Id)
4053 packet.FailedArg1 = 3905;
4057 packet.FailedArg1 = 3842;
4060 packet.FailedArg1 = 4075;
4063 packet.FailedArg1 = 0;
4071 packet.FailedArg1 = *param1;
4075 if (spellInfo->
Totem[0])
4076 packet.FailedArg1 = spellInfo->
Totem[0];
4077 else if (spellInfo->
Totem[1])
4078 packet.FailedArg1 = spellInfo->
Totem[1];
4084 packet.FailedArg1 = *param1;
4097 if (param1 && param2)
4099 packet.FailedArg1 = *param1;
4100 packet.FailedArg2 = *param2;
4110 packet.FailedArg1 = *param1;
4114 packet.FailedArg1 = *param1;
4118 packet.FailedArg1 = *param1;
4121 if (param1 && param2)
4123 packet.FailedArg1 = *param1;
4124 packet.FailedArg2 = *param2;
4128 if (param1 && param2)
4130 packet.FailedArg1 = *param1;
4131 packet.FailedArg2 = *param2;
4136 packet.FailedArg1 = *param1;
4139 packet.FailedArg1 = customError;
4143 packet.FailedArg1 = *param1;
4223 uint32 schoolImmunityMask = 0;
4224 uint32 mechanicImmunityMask = 0;
4227 schoolImmunityMask =
m_timer!= 0 ? unitCaster->GetSchoolImmunityMask() : 0;
4231 if (schoolImmunityMask || mechanicImmunityMask)
4268 castData.
Ammo.emplace();
4275 castData.
Immunities->School = schoolImmunityMask;
4276 castData.
Immunities->Value = mechanicImmunityMask;
4351 uint8 runeMaskAfterCast = player->GetRunesState();
4357 uint8 mask = (1 << i);
4358 if ((mask & runeMaskInitial) && !(mask & runeMaskAfterCast))
4361 float baseCd = float(player->GetRuneBaseCooldown(i));
4392 castData.
CastFlags &= ~CAST_FLAG_POWER_LEFT_SELF;
4402 uint32 ammoInventoryType = 0;
4403 uint32 ammoDisplayID = 0;
4427 ammoDisplayID = 5996;
4435 uint32 nonRangedAmmoDisplayID = 0;
4436 uint32 nonRangedAmmoInventoryType = 0;
4439 if (
uint32 item_id = unitCaster->GetVirtualItemId(i))
4445 switch (itemEntry->SubclassID)
4448 ammoDisplayID = itemEntry->DisplayInfoID;
4449 ammoInventoryType = itemEntry->InventoryType;
4453 ammoDisplayID = 5996;
4457 ammoDisplayID = 5998;
4461 nonRangedAmmoDisplayID = itemEntry->DisplayInfoID;
4462 nonRangedAmmoInventoryType = itemEntry->InventoryType;
4473 if (!ammoDisplayID && !ammoInventoryType)
4475 ammoDisplayID = nonRangedAmmoDisplayID;
4476 ammoInventoryType = nonRangedAmmoInventoryType;
4491 if (targetInfo.EffectMask == 0)
4509 missStatus.
TargetGUID = targetInfo.TargetGUID;
4510 missStatus.
Reason = targetInfo.MissCondition;
4547 data <<
uint32(effCount);
4553 data <<
uint32(spellEffectInfo.Effect);
4636 failurePacket.
Reason = result;
4642 failedPacket.
Reason = resultOther.value_or(result);
4681 data <<
uint32(duration);
4691 if (!creatureCaster->HasSpellFocus(
this))
4702 std::string sentName;
4708 data <<
uint32(sentName.size() + 1);
4739 bool expendable =
false;
4740 bool withoutCharges =
false;
4758 (charges > 0) ? --charges : ++charges;
4765 withoutCharges = (charges == 0);
4770 if (expendable && withoutCharges)
4841 TC_LOG_ERROR(
"spells",
"Spell::TakePower: Unknown power type '{}'", powerType);
4924 if (runeCost[i] > 0)
4949 runeCost[i] = runeCostData->
RuneCost[i];
4982 runeCost[baseRune]--;
5047 if (castItemTemplate && castItemTemplate->
GetId() == itemid)
5049 for (
uint32 s = 0; s < castItemTemplate->
Effects.size(); ++s)
5053 if (castItemTemplate->
Effects[s].Charges < 0 && abs(charges) < 2)
5086 float threat = 0.0f;
5089 if (threatEntry->apPctMod != 0.0f)
5092 threat += threatEntry->flatMod;
5106 float threatToAdd = threat;
5144 if (!preventDefault)
5217 bool checkForm =
true;
5244 bool reqCombat =
true;
5246 for (Unit::AuraEffectList::const_iterator j = stateAuras.begin(); j != stateAuras.end(); ++j)
5251 if ((*j)->GetMiscValue() == 1)
5280 if (unitCaster->GetTypeId() ==
TYPEID_PLAYER && unitCaster->ToPlayer()->isMoving() && (!unitCaster->IsCharmed() || !unitCaster->GetCharmerGUID().IsCreature()))
5296 return vehicleCheck;
5384 if (!unitCaster->GetGuardianPet())
5403 if (player->InArena())
5478 bool hasDispellableAura =
false;
5479 bool hasNonDispelEffect =
false;
5487 hasDispellableAura =
true;
5493 else if (spellEffectInfo.IsEffect())
5495 hasNonDispelEffect =
true;
5500 if (!hasNonDispelEffect && !hasDispellableAura && dispelMask && !
IsTriggered())
5507 if (!unitCaster->IsFriendlyTo(target))
5509 if (unitCaster->IsInSanctuary() || target->IsInSanctuary())
5513 if (!player || !player->
duel || target != player->
duel->Opponent)
5520 if (dispelList.empty())
5526 uint8 approximateAuraEffectMask = 0;
5527 uint8 nonAuraEffectMask = 0;
5531 switch (spellEffectInfo.Effect)
5545 SpellInfo const* learn_spellproto =
sSpellMgr->GetSpellInfo(spellEffectInfo.TriggerSpell);
5546 if (!learn_spellproto)
5566 SpellInfo const* learn_spellproto =
sSpellMgr->GetSpellInfo(spellEffectInfo.TriggerSpell);
5568 if (!learn_spellproto)
5581 uint32 glyphId = spellEffectInfo.MiscValue;
5617 if (target !=
m_caster && target->GetPowerType() !=
Powers(spellEffectInfo.MiscValue))
5682 int32 ReqValue = (skillValue < 100 ? (TargetLevel-10) * 10 : TargetLevel * 5);
5683 if (ReqValue > skillValue)
5699 Item* pTempItem =
nullptr;
5724 lockId = go->GetGOInfo()->GetLockId();
5732 int32 reqSkillValue = 0;
5733 int32 skillValue = 0;
5748 if ((canFailAtMax || skillValue < sWorld->GetConfigMaxSkillValue()) && reqSkillValue >
irand(skillValue - 25, skillValue + 37))
5772 if (!SummonProperties)
5775 switch (SummonProperties->
Control)
5811 pet->
CastSpell(pet, 32752, pet->GetGUID());
5828 if (!info.first->Health)
5838 if (creatureInfo && creatureInfo->
IsTameable(
true))
5847 else if (!spellEffectInfo.MiscValue)
5880 if (targetBind->perm && targetBind->save != casterBind->save)
5921 bool hasStealableAura =
false;
5923 for (Unit::VisibleAuraMap::const_iterator itr = visibleAuras.begin(); itr != visibleAuras.end(); ++itr)
5925 if (!itr->second->IsPositive())
5928 Aura const* aura = itr->second->GetBase();
5935 hasStealableAura =
true;
5939 if (!hasStealableAura)
5981 if (spellEffectInfo.IsAura())
5982 approximateAuraEffectMask |= 1 << spellEffectInfo.EffectIndex;
5983 else if (spellEffectInfo.IsEffect())
5984 nonAuraEffectMask |= 1 << spellEffectInfo.EffectIndex;
5989 switch (spellEffectInfo.ApplyAuraName)
6027 if (target->GetTypeId() ==
TYPEID_UNIT && target->IsVehicle())
6030 if (target->IsMounted())
6033 if (!target->GetCharmerGUID().IsEmpty())
6036 if (target->GetOwner() && target->GetOwner()->GetTypeId() ==
TYPEID_PLAYER)
6040 if (value &&
int32(target->GetLevel()) > value)
6096 if (spellEffectInfo.IsTargetingArea())
6114 if (!nonAuraEffectMask && (approximateAuraEffectMask & (1 << spellEffectInfo.EffectIndex)) && !
m_spellInfo->
IsTargetingArea())
6116 if (!target->IsHighestExclusiveAuraEffect(
m_spellInfo,
AuraType(spellEffectInfo.ApplyAuraName),
6156 if (!unitCaster->GetComboPoints())
6174 if (!owner->IsAlive() && !owner->IsGhouled())
6196 if (!creatureCaster->GetSpellHistory()->IsReady(
m_spellInfo))
6232 usableWhileStunned =
false;
6246 bool foundNotMechanic =
false;
6250 uint32 const mechanicMask = aurEff->GetSpellInfo()->GetAllEffectsMechanicMask();
6251 if (mechanicMask && !(mechanicMask &
GetSpellInfo()->GetAllowedMechanicMask()))
6253 foundNotMechanic =
true;
6258 *param1 = aurEff->GetSpellEffectInfo().Mechanic;
6260 *param1 = aurEff->GetSpellInfo()->Mechanic;
6267 if (foundNotMechanic)
6288 if (usableWhileStunned)
6292 result = mechanicResult;
6305 if (usableWhileFeared)
6309 result = mechanicResult;
6316 if (usableWhileConfused)
6320 result = mechanicResult;
6341 if (auraEffects.empty())
6346 SpellInfo const* auraInfo = aurEff->GetSpellInfo();
6352 *param1 = aurEff->GetSpellEffectInfo().
Mechanic;
6450 if (!spellEffectInfo.IsAura())
6453 AuraType const& auraType = spellEffectInfo.ApplyAuraName;
6455 for (Unit::AuraEffectList::const_iterator auraIt = auras.begin(); auraIt != auras.end(); ++auraIt)
6465 if (
GetCaster() == (*auraIt)->GetCaster())
6470 if (abs(spellEffectInfo.BasePoints) <= abs((*auraIt)->GetAmount()))
6489 if (ihit->TargetGUID == targetguid)
6514 float minRange, maxRange;
6522 minRange *= minRange;
6523 maxRange *= maxRange;
6558 float rangeMod = 0.0f;
6559 float minRange = 0.0f;
6560 float maxRange = 0.0f;
6563 return { 0.0f, 100.0f };
6573 rangeMod = unitCaster->
GetMeleeRange(target ? target : unitCaster);
6577 float meleeRange = 0.0f;
6582 meleeRange = unitCaster->
GetMeleeRange(target ? target : unitCaster);
6593 minRange += rangeMod;
6599 rangeMod += 8.0f / 3.0f;
6604 maxRange *= ranged->GetTemplate()->GetRangedModRange() * 0.01f;
6609 maxRange += rangeMod;
6611 return { minRange, maxRange };
6676 if (proto->
Effects[i].Charges)
6708 if (spellEffectInfo.MiscValue < 0 || spellEffectInfo.MiscValue >=
int8(
MAX_POWERS))
6757 if (targetItem->GetOwnerGUID() != player->
GetGUID())
6758 checkReagents =
true;
6781 if (proto->
Effects[s].Charges < 0 && abs(charges) < 2)
6814 *param1 = totemCategory;
6823 switch (spellEffectInfo.Effect)
6841 if (spellEffectInfo.ItemType)
6847 uint32 createCount = std::clamp<uint32>(spellEffectInfo.CalcValue(), 1u, itemTemplate->
GetMaxStackSize());
6855 player->
SendEquipError(msg,
nullptr,
nullptr, spellEffectInfo.ItemType);
6865 player->
SendEquipError(msg,
nullptr,
nullptr, spellEffectInfo.ItemType);
6891 player->
SendEquipError(msg,
nullptr,
nullptr, spellEffectInfo.ItemType);
6909 if (requiredLevel < m_spellInfo->BaseLevel)
6916 bool isItemUsable =
false;
6922 isItemUsable =
true;
6933 switch (enchantEntry->
Effect[s])
6955 if (targetItem->
GetOwner() != player)
6972 uint32 enchant_id = spellEffectInfo.MiscValue;
6987 if (requiredLevel < m_spellInfo->BaseLevel)
7013 if (item_disenchantskilllevel ==
uint32(-1))
7017 if (item_quality > 4 || item_quality < 2)
7043 if (param1 && param2)
7074 if (param1 && param2)
7159 uint32 item_id = spellEffectInfo.ItemType;
7168 if (proto->
Effects[x].Charges != 0 && item->GetSpellCharges(x) == proto->
Effects[x].Charges)
7200 return mainHandResult;
7207 return offHandResult;
7228 int32 delaytime = 500;
7230 int32 delayReduce = 100;
7233 if (delayReduce >= 100)
7236 AddPct(delaytime, -delayReduce);
7248 data <<
uint32(delaytime);
7275 int32 delayReduce = 100;
7278 if (delayReduce >= 100)
7281 AddPct(delaytime, -delayReduce);
7298 dynObj->Delay(delaytime);
7403 if (gobCaster->GetGOInfo()->IsIgnoringLOSChecks())
7412 switch (spellEffectInfo.
Effect)
7483 switch (spellEffectInfo.
Effect)
7567 TC_LOG_ERROR(
"spells",
"~SpellEvent: {} {} tried to delete non-deletable spell {}. Was not deleted, causes memory leak.",
7688 if (!spellEffectInfo.IsEffect())
7716 float multiplier = 1.0f;
7722 uint32 mask = target.EffectMask;
7723 if (!(mask & (1 << spellEffectInfo.EffectIndex)))
7743 Unit* unit =
nullptr;
7767 Unit* unit =
nullptr;
7793 if (targetAmount > 10)
7822 bool reqKey =
false;
7826 switch (lockInfo->
Type[j])
7847 reqSkillValue = lockInfo->
Skill[j];
7856 skillValue += spellEffectInfo.
CalcValue();
7858 if (skillValue < reqSkillValue)
7946 TC_LOG_DEBUG(
"spells",
"Spell::LoadScripts: Script `{}` for spell `{}` is loaded now", (*itr)->_GetScriptName()->c_str(),
m_spellInfo->
Id);
7956 auto hookItrEnd = (*scritr)->BeforeCast.end(), hookItr = (*scritr)->BeforeCast.begin();
7957 for (; hookItr != hookItrEnd; ++hookItr)
7958 (*hookItr).Call(*scritr);
7960 (*scritr)->_FinishScriptCall();
7969 auto hookItrEnd = (*scritr)->OnCast.end(), hookItr = (*scritr)->OnCast.begin();
7970 for (; hookItr != hookItrEnd; ++hookItr)
7971 (*hookItr).Call(*scritr);
7973 (*scritr)->_FinishScriptCall();
7982 auto hookItrEnd = (*scritr)->AfterCast.end(), hookItr = (*scritr)->AfterCast.begin();
7983 for (; hookItr != hookItrEnd; ++hookItr)
7984 (*hookItr).Call(*scritr);
7986 (*scritr)->_FinishScriptCall();
7996 auto hookItrEnd = (*scritr)->OnCheckCast.end(), hookItr = (*scritr)->OnCheckCast.begin();
7997 for (; hookItr != hookItrEnd; ++hookItr)
8001 retVal = tempResult;
8004 (*scritr)->_FinishScriptCall();
8012 bool preventDefault =
false;
8015 (*scritr)->_InitHit();
8022 effItr = (*scritr)->OnEffectLaunch.
begin();
8023 effEndItr = (*scritr)->OnEffectLaunch.
end();
8027 effItr = (*scritr)->OnEffectLaunchTarget.
begin();
8028 effEndItr = (*scritr)->OnEffectLaunchTarget.
end();
8032 effItr = (*scritr)->OnEffectHit.
begin();
8033 effEndItr = (*scritr)->OnEffectHit.
end();
8037 effItr = (*scritr)->OnEffectHitTarget.
begin();
8038 effEndItr = (*scritr)->OnEffectHitTarget.
end();
8045 (*scritr)->_PrepareScriptCall(hookType);
8046 for (; effItr != effEndItr; ++effItr)
8048 if (!(*scritr)->_IsEffectPrevented(effIndex) && (*effItr).IsEffectAffected(
m_spellInfo, effIndex))
8049 (*effItr).Call(*scritr, effIndex);
8051 if (!preventDefault)
8052 preventDefault = (*scritr)->_IsDefaultEffectPrevented(effIndex);
8054 (*scritr)->_FinishScriptCall();
8056 return preventDefault;
8064 auto hookItrEnd = (*scritr)->OnEffectSuccessfulDispel.end(), hookItr = (*scritr)->OnEffectSuccessfulDispel.begin();
8065 for (; hookItr != hookItrEnd; ++hookItr)
8066 hookItr->Call(*scritr, effIndex);
8068 (*scritr)->_FinishScriptCall();
8076 (*scritr)->_InitHit();
8078 auto hookItrEnd = (*scritr)->BeforeHit.end(), hookItr = (*scritr)->BeforeHit.begin();
8079 for (; hookItr != hookItrEnd; ++hookItr)
8080 (*hookItr).Call(*scritr, missInfo);
8082 (*scritr)->_FinishScriptCall();
8091 auto hookItrEnd = (*scritr)->OnHit.end(), hookItr = (*scritr)->OnHit.begin();
8092 for (; hookItr != hookItrEnd; ++hookItr)
8093 (*hookItr).Call(*scritr);
8095 (*scritr)->_FinishScriptCall();
8104 auto hookItrEnd = (*scritr)->AfterHit.end(), hookItr = (*scritr)->AfterHit.begin();
8105 for (; hookItr != hookItrEnd; ++hookItr)
8106 (*hookItr).Call(*scritr);
8108 (*scritr)->_FinishScriptCall();
8117 auto hookItrEnd = (*scritr)->OnObjectAreaTargetSelect.end(), hookItr = (*scritr)->OnObjectAreaTargetSelect.begin();
8118 for (; hookItr != hookItrEnd; ++hookItr)
8119 if (hookItr->IsEffectAffected(
m_spellInfo, effIndex) && targetType.
GetTarget() == hookItr->GetTarget())
8120 hookItr->Call(*scritr, targets);
8122 (*scritr)->_FinishScriptCall();
8131 auto hookItrEnd = (*scritr)->OnObjectTargetSelect.end(), hookItr = (*scritr)->OnObjectTargetSelect.begin();
8132 for (; hookItr != hookItrEnd; ++hookItr)
8133 if (hookItr->IsEffectAffected(
m_spellInfo, effIndex) && targetType.
GetTarget() == hookItr->GetTarget())
8134 hookItr->Call(*scritr, target);
8136 (*scritr)->_FinishScriptCall();
8145 auto hookItrEnd = (*scritr)->OnDestinationTargetSelect.end(), hookItr = (*scritr)->OnDestinationTargetSelect.begin();
8146 for (; hookItr != hookItrEnd; ++hookItr)
8147 if (hookItr->IsEffectAffected(
m_spellInfo, effIndex) && targetType.
GetTarget() == hookItr->GetTarget())
8148 hookItr->Call(*scritr, target);
8150 (*scritr)->_FinishScriptCall();
8158 for (HookType& hook : hooks)
8160 if (!hook.IsEffectAffected(spellInfo, effIndex))
8163 bool otherEffectHasSameTargetFunction = std::ranges::any_of(hooks, [&](HookType& other)
8165 return other.IsEffectAffected(spellInfo, effIndexToCheck) && hook.HasSameTargetFunctionAs(other);
8167 if (!otherEffectHasSameTargetFunction)
8176 if (!allEffectTargetScriptsAreShared(script->OnObjectTargetSelect,
m_spellInfo, effIndex, effIndexToCheck))
8179 if (!allEffectTargetScriptsAreShared(script->OnObjectTargetSelect,
m_spellInfo, effIndexToCheck, effIndex))
8182 if (!allEffectTargetScriptsAreShared(script->OnObjectAreaTargetSelect,
m_spellInfo, effIndex, effIndexToCheck))
8185 if (!allEffectTargetScriptsAreShared(script->OnObjectAreaTargetSelect,
m_spellInfo, effIndexToCheck, effIndex))
8197 if ((effMask & (1 << spellEffectInfo.EffectIndex)) && (!only_on_caster || (spellEffectInfo.TargetA.GetTarget() ==
TARGET_UNIT_CASTER)))
8213 for (
AuraEffect const* aurEff : targetTriggers)
8218 SpellInfo const* auraSpellInfo = aurEff->GetSpellInfo();
8219 if (
SpellInfo const* spellInfo =
sSpellMgr->GetSpellInfo(aurEff->GetSpellEffectInfo().TriggerSpell))
8223 int32 auraBaseAmount = aurEff->GetBaseAmount();
8226 chance *= aurEff->GetBase()->GetStackAmount();
8307 std::stringstream sstr;
8308 sstr << std::boolalpha
8324 auto hookItrEnd = (*scritr)->OnCalculateResistAbsorb.end(), hookItr = (*scritr)->OnCalculateResistAbsorb.begin();
8325 for (; hookItr != hookItrEnd; ++hookItr)
8326 hookItr->Call(*scritr, damageInfo, resistAmount, absorbAmount);
8328 (*scritr)->_FinishScriptCall();
8337 _targetSelectionType(selectionType), _condSrcInfo(nullptr), _condList(condList)
8340 _condSrcInfo = std::make_unique<ConditionSourceInfo>(
nullptr, caster);
8428 if (dist <
_range && WorldObjectSpellTargetCheck::operator ()(target))
8452 if (!isInsideCylinder)
8507 Targets->SetUnitTarget(unitTarget);
8512 Targets->SetGOTarget(goTarget);
@ CONDITION_SOURCE_TYPE_SPELL
std::vector< Condition * > ConditionContainer
@ ITEM_ENCHANTMENT_TYPE_USE_SPELL
@ ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET
@ ACHIEVEMENT_TIMED_TYPE_SPELL_CASTER
@ ACHIEVEMENT_TIMED_TYPE_ITEM
@ ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET
@ ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM
@ ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET
@ ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL
@ ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2
@ ENCHANTMENT_CAN_SOULBOUND
#define MAX_SPELL_REAGENTS
#define MAX_SPELL_EFFECTS
DBCStorage< SpellItemEnchantmentEntry > sSpellItemEnchantmentStore(SpellItemEnchantmentfmt)
DBCStorage< SummonPropertiesEntry > sSummonPropertiesStore(SummonPropertiesfmt)
DBCStorage< LockEntry > sLockStore(LockEntryfmt)
DBCStorage< ItemEntry > sItemStore(Itemfmt)
DBCStorage< SpellRuneCostEntry > sSpellRuneCostStore(SpellRuneCostfmt)
DBCStorage< MapEntry > sMapStore(MapEntryfmt)
DBCStorage< GlyphPropertiesEntry > sGlyphPropertiesStore(GlyphPropertiesfmt)
DBCStorage< AreaTableEntry > sAreaTableStore(AreaTableEntryfmt)
#define MAX_ITEM_ENCHANTMENT_EFFECTS
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 MAX_ITEM_PROTO_SOCKETS
#define MAX_ITEM_PROTO_SPELLS
#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)
constexpr bool CanStopMovementForSpellCasting(MovementGeneratorType type)
#define EXTRA_CELL_SEARCH_RADIUS
#define DEFAULT_PLAYER_BOUNDING_RADIUS
std::optional< T > Optional
Optional helper class to wrap optional values within.
std::vector< ItemPosCount > ItemPosCountVec
@ PLAYER_ALLOW_ONLY_ABILITY
float frand(float min, float max)
int32 irand(int32 min, int32 max)
bool roll_chance_f(float chance)
bool roll_chance_i(int chance)
if(posix_memalign(&__mallocedMemory, __align, __size)) return NULL
@ GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING
@ SPELL_ATTR7_IS_CHEAT_SPELL
@ SPELL_ATTR7_INTERRUPT_ONLY_NONPLAYER
@ SPELL_EFFECT_POWER_BURN
@ SPELL_EFFECT_SUMMON_PET
@ SPELL_EFFECT_DISENCHANT
@ SPELL_EFFECT_PROSPECTING
@ SPELL_EFFECT_ENCHANT_HELD_ITEM
@ SPELL_EFFECT_ENCHANT_ITEM
@ SPELL_EFFECT_GAMEOBJECT_REPAIR
@ SPELL_EFFECT_SUMMON_RAF_FRIEND
@ SPELL_EFFECT_WEAPON_DAMAGE
@ SPELL_EFFECT_APPLY_GLYPH
@ SPELL_EFFECT_SUMMON_PLAYER
@ SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER
@ SPELL_EFFECT_RESURRECT_PET
@ SPELL_EFFECT_CREATE_MANA_GEM
@ SPELL_EFFECT_SKIN_PLAYER_CORPSE
@ SPELL_EFFECT_ADD_EXTRA_ATTACKS
@ SPELL_EFFECT_ACTIVATE_RUNE
@ SPELL_EFFECT_CREATE_ITEM_2
@ SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL
@ SPELL_EFFECT_PERSISTENT_AREA_AURA
@ SPELL_EFFECT_POWER_DRAIN
@ SPELL_EFFECT_RESURRECT_NEW
@ SPELL_EFFECT_TALENT_SPEC_SELECT
@ SPELL_EFFECT_GAMEOBJECT_SET_DESTRUCTION_STATE
@ SPELL_EFFECT_GAMEOBJECT_DAMAGE
@ SPELL_EFFECT_LEARN_SPELL
@ SPELL_EFFECT_TELEPORT_UNITS
@ SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC
@ SPELL_EFFECT_CREATE_TAMED_PET
@ SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY
@ SPELL_EFFECT_STEAL_BENEFICIAL_BUFF
@ SPELL_EFFECT_CREATE_ITEM
@ SPELL_EFFECT_APPLY_AURA
@ SPELL_EFFECT_LEARN_PET_SPELL
#define CLASSMASK_WAND_USERS
@ SPELL_PREVENTION_TYPE_SILENCE
@ SPELL_PREVENTION_TYPE_PACIFY
@ SPELL_ATTR5_USABLE_WHILE_CONFUSED
@ SPELL_ATTR5_USABLE_WHILE_FEARED
@ SPELL_ATTR5_SKIP_CHECKCAST_LOS_CHECK
@ SPELL_ATTR5_NOT_USABLE_WHILE_CHARMED
@ SPELL_ATTR5_HASTE_AFFECT_DURATION
@ SPELL_ATTR5_USABLE_WHILE_STUNNED
@ TARGET_UNIT_PASSENGER_1
@ TARGET_UNIT_TARGET_CHAINHEAL_ALLY
@ TARGET_DEST_CASTER_RANDOM
@ TARGET_DEST_DYNOBJ_ENEMY
@ TARGET_UNIT_PASSENGER_6
@ TARGET_DEST_CASTER_FRONT_LEAP
@ TARGET_DEST_CHANNEL_TARGET
@ TARGET_DEST_CASTER_FRONT_LEFT
@ TARGET_DEST_CASTER_BACK_RIGHT
@ TARGET_DEST_DEST_RANDOM
@ TARGET_UNIT_PASSENGER_2
@ TARGET_UNIT_CHANNEL_TARGET
@ TARGET_DEST_CASTER_FISHING
@ TARGET_DEST_TARGET_RANDOM
@ TARGET_UNIT_PASSENGER_4
@ TARGET_UNIT_PASSENGER_7
@ TARGET_DEST_TARGET_ENEMY
@ TARGET_DEST_DYNOBJ_NONE
@ TARGET_DEST_DYNOBJ_ALLY
@ TARGET_UNIT_PASSENGER_5
@ TARGET_UNIT_PASSENGER_3
@ TARGET_DEST_CASTER_BACK_LEFT
@ TARGET_DEST_CASTER_SUMMON
@ TARGET_GAMEOBJECT_TARGET
@ TARGET_GAMEOBJECT_ITEM_TARGET
@ TARGET_DEST_CASTER_FRONT_RIGHT
@ TARGET_UNIT_PASSENGER_0
@ TARGET_DEST_CHANNEL_CASTER
@ SPELL_ATTR2_AUTOREPEAT_FLAG
@ SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS
@ SPELL_ATTR2_NOT_RESET_AUTO_ACTIONS
@ SPELL_ATTR2_ALLOW_LOW_LEVEL_BUFF
@ SPELL_ATTR2_FAIL_ON_ALL_TARGETS_IMMUNE
@ SPELL_ATTR1_REQUIRE_ALL_TARGETS
@ SPELL_ATTR1_CANT_BE_REFLECTED
@ SPELL_ATTR1_CHANNEL_TRACK_TARGET
@ SPELL_ATTR1_DISMISS_PET
@ SPELL_ATTR1_MELEE_COMBAT_START
@ SPELL_ATTR3_ONLY_TARGET_PLAYERS
@ SPELL_ATTR3_ONLY_TARGET_GHOSTS
@ SPELL_ATTR3_IGNORE_RESURRECTION_TIMER
@ SPELL_ATTR3_BATTLEGROUND
@ SPELL_ATTR3_CANT_TRIGGER_PROC
@ SPELL_ATTR3_REQ_OFFHAND
@ SPELL_ATTR3_COMPLETELY_BLOCKED
@ SPELL_DAMAGE_CLASS_RANGED
@ SPELL_DAMAGE_CLASS_MAGIC
@ SPELL_DAMAGE_CLASS_NONE
@ SPELL_DAMAGE_CLASS_MELEE
@ PETTAME_CANTCONTROLEXOTIC
@ SPELL_CUSTOM_ERROR_NONE
@ SPELL_CUSTOM_ERROR_GM_ONLY
@ SPELL_ATTR0_STOP_ATTACK_TARGET
@ SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY
@ SPELL_ATTR0_DISABLED_WHILE_ACTIVE
@ SPELL_ATTR0_CASTABLE_WHILE_DEAD
@ SPELL_ATTR0_OUTDOORS_ONLY
@ SPELL_ATTR0_ONLY_STEALTHED
@ SPELL_ATTR0_INDOORS_ONLY
@ SPELL_ATTR0_CASTABLE_WHILE_MOUNTED
constexpr SkillType SkillByLockType(LockType locktype)
@ 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_ITEM_AT_MAX_CHARGES
@ SPELL_FAILED_NOTHING_TO_DISPEL
@ SPELL_FAILED_FOOD_LOWLEVEL
@ SPELL_FAILED_WRONG_PET_FOOD
@ SPELL_FAILED_CUSTOM_ERROR
@ SPELL_FAILED_SUMMON_PENDING
@ SPELL_FAILED_BAD_IMPLICIT_TARGETS
@ SPELL_FAILED_NO_COMBO_POINTS
@ 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_NOTHING_TO_STEAL
@ SPELL_FAILED_NO_MOUNTS_ALLOWED
@ 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_TARGET_NOT_IN_INSTANCE
@ SPELL_FAILED_DONT_REPORT
@ SPELL_FAILED_ON_USE_ENCHANT
@ SPELL_FAILED_TARGET_AURASTATE
@ SPELL_FAILED_ONLY_BATTLEGROUNDS
@ SPELL_FAILED_NOT_IN_ARENA
@ SPELL_FAILED_ITEM_ALREADY_ENCHANTED
@ SPELL_FAILED_ONLY_STEALTHED
@ SPELL_FAILED_TARGET_IS_PLAYER_CONTROLLED
@ SPELL_FAILED_ONLY_ABOVEWATER
@ SPELL_FAILED_AURA_BOUNCED
@ SPELL_FAILED_CANT_BE_CHARMED
@ SPELL_FAILED_MAX_SOCKETS
@ SPELL_FAILED_CASTER_DEAD
@ SPELL_FAILED_BAD_TARGETS
@ SPELL_FAILED_CANT_BE_DISENCHANTED
@ SPELL_FAILED_ITEM_ENCHANT_TRADE_WINDOW
@ SPELL_FAILED_TOO_MANY_OF_ITEM
@ SPELL_FAILED_TARGET_UNSKINNABLE
@ SPELL_FAILED_UNIQUE_GLYPH
@ SPELL_FAILED_NEED_MORE_ITEMS
@ SPELL_FAILED_ONLY_OUTDOORS
@ SPELL_FAILED_LOW_CASTLEVEL
@ SPELL_FAILED_CANT_BE_PROSPECTED
@ SPELL_FAILED_LINE_OF_SIGHT
@ 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_ONLY_INDOORS
@ SPELL_FAILED_NOT_ON_TAXI
@ SPELL_FAILED_TARGET_FRIENDLY
@ SPELL_ATTR4_CAN_CAST_WHILE_CASTING
@ SPELL_ATTR4_AREA_TARGET_CHAIN
@ SPELL_ATTR4_USABLE_IN_ARENA
@ SPELL_ATTR4_PROC_ONLY_ON_CASTER
@ SPELL_ATTR4_NOT_USABLE_IN_ARENA
@ SPELL_ATTR4_CANT_TRIGGER_ITEM_SPELLS
@ SPELL_ATTR4_NOT_STEALABLE
@ CREATURE_TYPE_FLAG_COLLIDE_WITH_MISSILES
@ SPELL_ATTR6_NOT_RESET_SWING_IF_INSTANT
@ SPELL_ATTR6_IGNORE_CASTER_AURAS
@ SPELL_ATTR6_CAST_BY_CHARMER
@ SPELL_AURA_RETAIN_COMBO_POINTS
@ SPELL_AURA_PERIODIC_HASTE
@ SPELL_AURA_ABILITY_IGNORE_AURASTATE
@ SPELL_AURA_MOD_IGNORE_SHAPESHIFT
@ SPELL_AURA_PERIODIC_MANA_LEECH
@ SPELL_AURA_MOD_POSSESS_PET
@ SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS
@ SPELL_AURA_ABILITY_CONSUME_NO_AMMO
@ SPELL_AURA_CONVERT_RUNE
@ SPELL_AURA_ADD_TARGET_TRIGGER
@ SPELL_AURA_MOD_PACIFY_SILENCE
@ SPELL_AURA_REDUCE_PUSHBACK
@ SPELL_AURA_IGNORE_MELEE_RESET
@ SPELL_AURA_MOD_MAX_AFFECTED_TARGETS
@ SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED
@ SPELL_AURA_BLOCK_SPELL_FAMILY
@ SPELL_INTERRUPT_FLAG_PUSH_BACK
@ SPELL_INTERRUPT_FLAG_INTERRUPT
@ SPELL_INTERRUPT_FLAG_MOVEMENT
@ SPELLMOD_NOT_LOSE_CASTING_TIME
@ SPELLMOD_SPELL_COST_REFUND_ON_FAIL
@ SPELLMOD_GLOBAL_COOLDOWN
@ TARGET_FLAG_CORPSE_ALLY
@ TARGET_FLAG_UNIT_MINIPET
@ TARGET_FLAG_UNIT_PASSENGER
@ TARGET_FLAG_GAMEOBJECT_ITEM
@ TARGET_FLAG_DEST_LOCATION
@ TARGET_FLAG_SOURCE_LOCATION
@ TARGET_FLAG_CORPSE_ENEMY
@ TARGET_FLAG_CORPSE_MASK
@ TARGET_FLAG_GAMEOBJECT_MASK
@ TRIGGERED_IGNORE_EQUIPPED_ITEM_REQUIREMENT
Used when doing CastSpell with triggered == true.
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
@ TRIGGERED_IGNORE_POWER_AND_REAGENT_COST
Will ignore Spell and Category cooldowns.
@ TRIGGERED_DONT_RESET_PERIODIC_TIMER
Will ignore caster aura restrictions or requirements.
@ TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD
Will ignore GCD.
@ TRIGGERED_CAST_DIRECTLY
Will ignore combo point requirement.
@ TRIGGERED_IGNORE_TARGET_CHECK
Will ignore equipped item requirements.
@ TRIGGERED_IGNORE_CASTER_AURASTATE
Will ignore shapeshift checks.
@ TRIGGERED_IGNORE_AURA_SCALING
Will not take away cast item or update related achievement criteria.
@ TRIGGERED_IGNORE_CAST_IN_PROGRESS
Will ignore aura scaling.
@ TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE
Disallows proc events from triggered spell (default)
@ TRIGGERED_IGNORE_SHAPESHIFT
Will not adjust facing to target (if any)
@ TRIGGERED_IGNORE_AURA_INTERRUPT_FLAGS
In Spell::prepare, will be cast directly without setting containers for executed spell.
@ TRIGGERED_IGNORE_CAST_ITEM
Will ignore power and reagent cost.
@ TRIGGERED_IGNORE_COMBO_POINTS
Will not check if a current cast is in progress.
@ TRIGGERED_IGNORE_GCD
Not triggered.
@ TRIGGERED_DISALLOW_PROC_EVENTS
Will ignore caster aura states including combat requirements and death state.
@ TRIGGERED_IGNORE_CASTER_AURAS
Will ignore mounted/on vehicle restrictions.
@ TRIGGERED_DONT_REPORT_CAST_ERROR
Will allow periodic aura timers to keep ticking (instead of resetting)
@ TRIGGERED_IGNORE_SET_FACING
Will ignore interruptible aura's at cast.
@ SPELL_FACING_FLAG_INFRONT
@ AURA_INTERRUPT_FLAG_SPELL_ATTACK
@ AURA_INTERRUPT_FLAG_CAST
@ AURA_INTERRUPT_FLAG_TALK
@ AURA_INTERRUPT_FLAG_HITBYSPELL
@ AURA_INTERRUPT_FLAG_NOT_SEATED
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_TRAJ
@ TARGET_SELECT_CATEGORY_CHANNEL
@ TARGET_OBJECT_TYPE_UNIT
@ TARGET_OBJECT_TYPE_CORPSE
@ TARGET_OBJECT_TYPE_UNIT_AND_DEST
@ 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_PICKPOCKET
@ 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
@ 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_SPELL_PHASE_FINISH
@ PROC_FLAG_DONE_SPELL_RANGED_DMG_CLASS
@ PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS
@ PROC_FLAG_TAKEN_RANGED_AUTO_ATTACK
@ PROC_FLAG_DONE_PERIODIC
@ PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS
@ PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS
@ PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG
@ PROC_FLAG_TAKEN_SPELL_RANGED_DMG_CLASS
@ PROC_FLAG_TAKEN_PERIODIC
@ PROC_FLAG_DONE_MAINHAND_ATTACK
@ PROC_FLAG_DONE_RANGED_AUTO_ATTACK
@ PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_NEG
@ PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG
@ PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS
@ PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_POS
@ PROC_FLAG_TAKEN_SPELL_MELEE_DMG_CLASS
@ PROC_FLAG_DONE_TRAP_ACTIVATION
@ PROC_FLAG_DONE_OFFHAND_ATTACK
@ PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG
@ SPELL_SCRIPT_HOOK_AFTER_CAST
@ SPELL_SCRIPT_HOOK_EFFECT_HIT
@ SPELL_SCRIPT_HOOK_AFTER_HIT
@ SPELL_SCRIPT_HOOK_EFFECT_SUCCESSFUL_DISPEL
@ SPELL_SCRIPT_HOOK_EFFECT_LAUNCH
@ SPELL_SCRIPT_HOOK_OBJECT_AREA_TARGET_SELECT
@ SPELL_SCRIPT_HOOK_BEFORE_HIT
@ SPELL_SCRIPT_HOOK_CHECK_CAST
@ SPELL_SCRIPT_HOOK_EFFECT_LAUNCH_TARGET
@ 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_ON_CAST
bool CanHaveGlobalCooldown(WorldObject const *caster)
void FillSpellCastFailedArgs(T &packet, uint8 castId, SpellInfo const *spellInfo, SpellCastResult result, SpellCustomErrors customError, uint32 *param1, uint32 *param2)
SpellEffectHandlerFn SpellEffectHandlers[TOTAL_SPELL_EFFECTS]
#define MAX_SPELL_RANGE_TOLERANCE
void(Spell::*)() SpellEffectHandlerFn
@ SPELL_EFFECT_HANDLE_LAUNCH_TARGET
@ SPELL_EFFECT_HANDLE_LAUNCH
@ SPELL_EFFECT_HANDLE_HIT
@ SPELL_EFFECT_HANDLE_HIT_TARGET
static const uint32 SPELL_INTERRUPT_NONPLAYER
#define TRAJECTORY_MISSILE_SIZE
@ CAST_FLAG_ADJUST_MISSILE
@ CAST_FLAG_POWER_LEFT_SELF
@ CAST_FLAG_HAS_TRAJECTORY
@ UNIT_FLAG2_ALLOW_CHEAT_SPELLS
@ MOVEMENTFLAG_FALLING_FAR
@ UNIT_FLAG_NON_ATTACKABLE
@ UNIT_FLAG_PLAYER_CONTROLLED
uint32 createProcHitMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missCondition)
@ CURRENT_CHANNELED_SPELL
@ CURRENT_AUTOREPEAT_SPELL
@ UNIT_STATE_ATTACK_PLAYER
std::vector< DispelableAura > DispelChargesList
constexpr std::underlying_type< E >::type AsUnderlyingType(E enumValue)
T CalculatePct(T base, U pct)
SpellInfo const * GetSpellInfo() const
int32 GetMaxDuration() const
static Aura * TryRefreshStackOrCreate(AuraCreateInfo &createInfo, bool updateEffectMask=true)
void SetStackAmount(uint8 num)
int32 GetDuration() const
bool ModStackAmount(int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT, bool resetPeriodicTimer=true)
int32 CalcMaxDuration() const
uint8 GetEffectMask() const
void SetDuration(int32 duration, bool withMods=false)
SpellInfo const * GetSpellInfo() const
void SetMaxDuration(int32 duration)
static uint8 BuildEffectMaskForOwner(SpellInfo const *spellProto, uint8 availableEffectMask, WorldObject *owner)
virtual void Abort(uint64)
virtual bool IsDeletable() const
virtual bool Execute(uint64, uint32)
bool CanFlyIn()
Return if we can use mount in battlefield.
void InheritCombatStatesFrom(Unit const *who)
bool HasCorpseFlag(CorpseFlags flags) const
ObjectGuid GetOwnerGUID() const override
virtual void SpellHitTarget(WorldObject *, SpellInfo const *)
CreatureTemplate const * GetCreatureTemplate() const
void SetSpellFocus(Spell const *focusSpell, WorldObject const *target)
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
bool IsInRange(float x, float y, float z, float radius) const
GameobjectTypes GetGoType() const
ContainerType::iterator iterator
void SetState(ItemUpdateState state, Player *forplayer=nullptr)
void SetSpellCharges(uint8 index, int32 value)
uint32 GetEnchantmentId(EnchantmentSlot slot) const
int32 GetSpellCharges(uint8 index=0) const
ItemTemplate const * GetTemplate() const
bool IsWeaponVellum() const
bool IsArmorVellum() const
Player * GetOwner() const
ObjectGuid GetOwnerGUID() const
uint32 GetMaxStackCount() const
bool IsFitToSpellRequirements(SpellInfo const *spellInfo) const
bool HaveLootFor(uint32 loot_id) const
void AddFarSpellCallback(FarSpellCallback &&callback)
bool IsBattlegroundOrArena() const
GameObject * GetGameObject(ObjectGuid const &guid)
Difficulty GetDifficultyID() const
ZLiquidStatus GetLiquidStatus(uint32 phaseMask, float x, float y, float z, Optional< uint8 > ReqLiquidType, LiquidData *data=nullptr, float collisionHeight=2.03128f) const
MovementGeneratorType GetCurrentMovementGeneratorType() const
static ObjectGuid const Empty
static std::string_view GetTypeName(HighGuid high)
bool IsAnyTypeGameObject() const
void SetRawValue(uint64 guid)
uint64 GetRawValue() const
std::string ToString() const
bool IsGameObject() const
PackedGuidReader ReadAsPacked()
static Creature * ToCreature(Object *o)
PackedGuid const & GetPackGUID() const
static Unit * ToUnit(Object *o)
uint32 GetUInt32Value(uint16 index) const
static GameObject * ToGameObject(Object *o)
float GetFloatValue(uint16 index) const
static Corpse * ToCorpse(Object *o)
bool HasFlag(uint16 index, uint32 flag) const
static ObjectGuid GetGUID(Object const *o)
void SetUInt32Value(uint16 index, uint32 value)
static Player * ToPlayer(Object *o)
Player * GetOwner() const
bool HaveInDiet(ItemTemplate const *item) const
uint32 GetCurrentFoodBenefitLevel(uint32 itemlevel) const
static std::pair< PetStable::PetInfo const *, PetSaveMode > GetLoadPetInfo(PetStable const &stable, uint32 petEntry, uint32 petnumber, bool current)
void SetRuneCooldown(uint8 index, uint32 cooldown, bool casted=false)
void SendEquipError(InventoryResult msg, Item const *item1=nullptr, Item const *item2=nullptr, uint32 itemId=0) const
void SetSpellModTakingSpell(Spell *spell, bool apply)
bool IsInSameRaidWith(Player const *p) const
bool HasItemFitToSpellRequirements(SpellInfo const *spellInfo, Item const *ignoreItem=nullptr) const
uint32 GetFreeInventorySpace() const
void SetLastUsedRune(RuneType type)
bool IsImmunedToSpellEffect(SpellInfo const *spellInfo, SpellEffectInfo const &spellEffectInfo, WorldObject const *caster, bool requireImmunityPurgesEffectAttribute=false) const override
void SendDirectMessage(WorldPacket const *data) const
uint16 GetSkillValue(uint32 skill) const
Item * GetItemByEntry(uint32 entry) const
void UpdatePotionCooldown(Spell *spell=nullptr)
bool CanTameExoticPets() const
bool HasItemCount(uint32 item, uint32 count=1, bool inBankAlso=false) const
bool CanUseBattlegroundObject(GameObject *gameobject) const
bool InBattleground() const
void DurabilityPointLossForEquipSlot(EquipmentSlots slot)
PetStable * GetPetStable()
bool IsLoading() const override
bool HasItemTotemCategory(uint32 TotemCategory) const
uint8 GetRunesState() const
bool GetCommandStatus(uint32 command) const
void RestoreBaseRune(uint8 index)
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
Battleground * GetBattleground() const
TradeData * GetTradeData() const
RuneType GetCurrentRune(uint8 index) const
bool IsGameMaster() const
void ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell *spell=nullptr) const
void SendTameFailure(uint8 result)
uint32 GetRuneBaseCooldown(uint8 index) const
Player * GetSelectedPlayer() const
Item * GetWeaponForAttack(WeaponAttackType attackType, bool useable=false) const
std::unique_ptr< DuelInfo > duel
void SendMessageToSet(WorldPacket const *data, bool self) 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
uint32 GetLastPotionId() const
RuneType GetBaseRune(uint8 index) const
InstancePlayerBind * GetBoundInstance(uint32 mapid, Difficulty difficulty, bool withExpired=false)
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)
void Read(ByteBuffer &data, Unit *caster)
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
float CalcRadius(WorldObject *caster=nullptr, Spell *=nullptr) const
bool IsAreaAuraEffect() const
uint32 GetMissingTargetMask(bool srcSet=false, bool destSet=false, uint32 mask=0) const
int32 CalcValue(WorldObject const *caster=nullptr, int32 const *basePoints=nullptr) const
bool IsTargetingArea() const
SpellEffectImplicitTargetTypes GetImplicitTargetType() const
std::vector< Condition * > * ImplicitTargetConditions
SpellEffIndex EffectIndex
SpellImplicitTargetInfo TargetA
int32 CalcBaseValue(int32 value) 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 IsReady(SpellInfo const *spellInfo, uint32 itemId=0, bool ignoreCategoryCooldown=false) const
bool HasGlobalCooldown(SpellInfo const *spellInfo) const
void ResetCooldown(uint32 spellId, bool update=false)
void AddGlobalCooldown(SpellInfo const *spellInfo, uint32 duration)
bool HasCooldownOnHold(uint32 spellId) const
void CancelGlobalCooldown(SpellInfo const *spellInfo)
void HandleCooldowns(SpellInfo const *spellInfo, Item const *item, Spell *spell=nullptr)
SpellTargetCheckTypes GetCheckType() const
SpellTargetReferenceTypes GetReferenceType() const
SpellTargetSelectionCategories GetSelectionCategory() const
SpellTargetObjectTypes GetObjectType() const
float CalcDirectionAngle() const
Targets GetTarget() const
uint32 ChannelInterruptFlags
uint32 RequiresSpellFocus
std::array< int32, MAX_SPELL_REAGENTS > Reagent
SpellInfo const * GetFirstRankSpell() const
float GetMaxRange(bool positive=false, WorldObject *caster=nullptr, Spell *spell=nullptr) const
SpellCastResult CheckShapeshift(uint32 form) const
bool IsRequiringDeadTarget() const
std::array< uint32, 2 > TotemCategory
bool IsCooldownStartedOnEvent() const
SpellRangeEntry const * RangeEntry
uint32 GetDispelMask() const
uint32 CalcCastTime(Spell *spell=nullptr) const
SpellInfo const * GetAuraRankForLevel(uint8 level) const
uint32 GetRecoveryTime() const
uint32 ExcludeCasterAuraState
float GetMinRange(bool positive=false) const
int32 GetMaxDuration() const
bool HasInitialAggro() const
std::array< uint32, 2 > Totem
SpellCastResult CheckTarget(WorldObject const *caster, WorldObject const *target, bool implicit=true) const
std::array< uint32, 2 > SpellVisual
DiminishingGroup GetDiminishingReturnsGroupForSpell(bool triggered) const
bool CanBeUsedInCombat() const
bool IsAllowingDeadTarget() const
WeaponAttackType GetAttackType() const
SpellSchoolMask GetSchoolMask() const
std::array< uint32, MAX_SPELL_REAGENTS > ReagentCount
bool NeedsComboPoints() const
bool HasAttribute(SpellAttr0 attribute) const
bool IsNextMeleeSwingSpell() const
int32 CalcPowerCost(WorldObject const *caster, SpellSchoolMask schoolMask, Spell *spell=nullptr) const
bool SpellCancelsAuraEffect(AuraEffect const *aurEff) const
uint32 MaxAffectedTargets
int32 GetDuration() const
SpellCastResult CheckVehicle(Unit const *caster) const
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
int32 EquippedItemSubClassMask
uint32 GetExplicitTargetMask() const
SpellCastResult CheckExplicitTarget(WorldObject const *caster, WorldObject const *target, Item const *itemTarget=nullptr) const
uint32 GetMechanicImmunityMask(Unit *caster) const
bool NeedsExplicitUnitTarget() const
DiminishingReturnsType GetDiminishingReturnsGroupType(bool triggered) const
bool HasEffect(SpellEffects effect) const
bool IsAutoRepeatRangedSpell() const
SpellCastResult CheckLocation(uint32 map_id, uint32 zone_id, uint32 area_id, Player const *player=nullptr, bool strict=true) const
bool IsMoveAllowedChannel() const
bool IsRangedWeaponSpell() const
uint32 ExcludeCasterAuraSpell
bool HasAura(AuraType aura) const
bool IsTargetingArea() const
std::array< SpellEffectInfo, MAX_SPELL_EFFECTS > const & GetEffects() const
uint32 StartRecoveryCategory
std::array< char const *, 16 > SpellName
uint32 AuraInterruptFlags
bool IsBreakingStealth() const
bool IsPositiveEffect(uint8 effIndex) const
SpellInfo const * GetSpellInfo() const
float m_damageMultipliers[MAX_SPELL_EFFECTS]
bool CanExecuteTriggersOnHit(uint8 effMask, SpellInfo const *triggeredByAura=nullptr) const
void AssertEffectExecuteData() const
void CallScriptAfterCastHandlers()
void AddCorpseTarget(Corpse *target, uint32 effectMask)
GameObject * SearchSpellFocus()
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)
SpellCastResult CheckArenaCastRules() const
uint64 CalculateDelayMomentForDst() const
void SelectImplicitTrajTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType)
void cast(bool skipCheck=false)
void SendChannelStart(uint32 duration)
SpellCastTargets m_targets
bool CheckSpellCancelsAuraEffect(AuraType auraType, uint32 *param1) const
std::unique_ptr< PathGenerator > m_preGeneratedPath
void SendPetCastResult(SpellCastResult result)
void CallScriptBeforeHitHandlers(SpellMissInfo missInfo)
SpellCastResult CheckRuneCost(uint32 runeCostID) const
void InitEffectExecuteData(uint8 effIndex)
void SelectExplicitTargets()
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 ExecuteLogEffectSummonObject(uint8 effIndex, WorldObject *obj)
void prepareDataForTriggerSystem()
SpellEffectHandleMode effectHandleMode
bool IsValidDeadOrAliveTarget(Unit const *target) const
int32 m_channeledDuration
SpellCastResult CheckMovement() const
bool CheckSpellCancelsPacify(uint32 *param1) const
void DoProcessTargetContainer(Container &targetContainer)
WorldObject * SearchNearbyTarget(float range, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectionType, ConditionContainer *condList=nullptr)
bool IsNeedSendToClient() const
bool IsIgnoringCooldowns() const
std::vector< TargetInfo > m_UniqueTargetInfo
SpellDestination m_destTargets[MAX_SPELL_EFFECTS]
void UpdateSpellCastDataAmmo(WorldPackets::Spells::SpellAmmo &data)
void _handle_finish_phase()
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)
uint8 m_delayAtDamageCount
void SendChannelUpdate(uint32 time)
WeaponAttackType m_attackType
void _cast(bool skipCheck=false)
void SelectImplicitNearbyTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, uint32 effMask)
bool IsProcDisabled() const
bool IsFocusDisabled() const
ObjectGuid m_originalCasterGUID
WorldObject *const m_caster
int64 GetItemTargetCountForEffect(SpellEffIndex effect) const
std::string GetDebugInfo() const
bool UpdateChanneledTargetList()
void TriggerGlobalCooldown()
void ExecuteLogEffectOpenLock(uint8 effIndex, Object *obj)
void SendMountResult(MountResult result)
void AddGOTarget(GameObject *target, uint32 effectMask)
void HandleThreatSpells()
std::vector< CorpseTargetInfo > m_UniqueCorpseTargetInfo
void ExecuteLogEffectTakeTargetPower(uint8 effIndex, Unit *target, uint32 powerType, uint32 powerTaken, float gainMultiplier)
void CancelGlobalCooldown()
bool CheckSpellCancelsCharm(uint32 *param1) const
void SendInterrupted(SpellCastResult result, Optional< SpellCastResult > resultOther={})
void SelectImplicitCasterDestTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType)
uint32 GetSearcherTypeMask(SpellTargetObjectTypes objType, ConditionContainer *condList)
void CallScriptOnCastHandlers()
void AddDestTarget(SpellDestination const &dest, uint32 effIndex)
void SelectImplicitAreaTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, uint32 effMask)
int64 GetGameObjectTargetCountForEffect(SpellEffIndex effect) const
SpellCastResult CheckItems(uint32 *param1, uint32 *param2) const
void SelectImplicitCasterObjectTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, uint32 effMask)
void SelectImplicitTargetDestTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType)
void SelectEffectImplicitTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, uint32 effectMask)
ByteBuffer * m_effectExecuteData[MAX_SPELL_EFFECTS]
void _handle_immediate_phase()
void CallScriptBeforeCastHandlers()
SpellMissInfo PreprocessSpellHit(Unit *unit, bool scaleAura, TargetInfo &targetInfo)
SpellCustomErrors m_customError
bool CallScriptEffectHandlers(SpellEffIndex effIndex, SpellEffectHandleMode mode)
std::vector< GOTargetInfo > m_UniqueGOTargetInfo
void DoSpellEffectHit(Unit *unit, SpellEffectInfo const &spellEffectInfo, TargetInfo &targetInfo)
void SearchAreaTargets(std::list< WorldObject * > &targets, float range, Position const *position, WorldObject *referer, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectionType, ConditionContainer *condList)
HitTriggerSpellList m_hitTriggerSpells
void SetDelayStart(uint64 m_time)
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)
uint8 m_channelTargetEffectMask
CurrentSpellTypes GetCurrentContainer() const
SpellSchoolMask m_spellSchoolMask
void cancel(SpellCastResult result=SPELL_FAILED_INTERRUPTED, Optional< SpellCastResult > resultOther={})
WorldObject * GetCaster() const
void ExecuteLogEffectUnsummonObject(uint8 effIndex, WorldObject *obj)
void SelectImplicitChannelTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, uint32 effMask)
void SelectSpellTargets()
void ExecuteLogEffectInterruptCast(uint8 effIndex, Unit *victim, uint32 spellId)
SpellCastResult prepare(SpellCastTargets const &targets, AuraEffect const *triggeredByAura=nullptr)
void ExecuteLogEffectResurrect(uint8 effIndex, Unit *target)
bool IsChannelActive() const
SpellCastResult CheckCasterAuras(uint32 *param1) const
SpellCastResult CheckPetCast(Unit *target)
void RecalculateDelayMomentForDst()
Spell(WorldObject *caster, SpellInfo const *info, TriggerCastFlags triggerFlags, ObjectGuid originalCasterGUID=ObjectGuid::Empty)
void SelectImplicitChainTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, WorldObject *target, uint32 effMask)
SpellCastResult CallScriptCheckCastHandlers()
void ExecuteLogEffectCreateItem(uint8 effIndex, uint32 entry)
void InitExplicitTargets(SpellCastTargets const &targets)
WorldLocation * destTarget
SpellCastResult CanOpenLock(SpellEffectInfo const &spellEffectInfo, uint32 lockid, SkillType &skillid, int32 &reqSkillValue, int32 &skillValue)
uint8 m_applyMultiplierMask
void SetReferencedFromCurrent(bool yes)
void ExecuteLogEffectDestroyItem(uint8 effIndex, uint32 entry)
void SelectEffectTypeImplicitTargets(SpellEffectInfo const &spellEffectInfo)
bool CheckSpellCancelsStun(uint32 *param1) const
void update(uint32 difftime)
uint64 GetDelayStart() const
bool CheckScriptEffectImplicitTargets(uint32 effIndex, uint32 effIndexToCheck)
bool CheckSpellCancelsConfuse(uint32 *param1) const
void CallScriptSuccessfulDispel(SpellEffIndex effIndex)
void DoEffectOnLaunchTarget(TargetInfo &targetInfo, float multiplier, SpellEffectInfo const &spellEffectInfo)
uint64 GetDelayMoment() const
void AddItemTarget(Item *item, uint32 effectMask)
void SelectImplicitDestDestTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType)
UsedSpellMods m_appliedMods
SpellCastResult CheckCast(bool strict, uint32 *param1=nullptr, uint32 *param2=nullptr)
bool CheckSpellCancelsFear(uint32 *param1) const
void SelectImplicitConeTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, uint32 effMask)
ObjectGuid m_focusObjectGUID
SpellValue *const m_spellValue
void SearchChainTargets(std::list< WorldObject * > &targets, uint32 chainTargets, WorldObject *target, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectType, ConditionContainer *condList, bool isChainHeal)
bool CheckEffectTarget(Unit const *target, SpellEffectInfo const &spellEffectInfo, Position const *losPosition) const
void SendResurrectRequest(Player *target)
void SearchTargets(SEARCHER &searcher, uint32 containerMask, WorldObject *referer, Position const *pos, float radius)
std::vector< ItemTargetInfo > m_UniqueItemInfo
bool IsAutoActionResetSpell() const
bool CheckSpellCancelsSilence(uint32 *param1) const
void ExecuteLogEffectDurabilityDamage(uint8 effIndex, Unit *victim, int32 itemId, int32 slot)
ObjectGuid m_castItemGUID
int64 GetUnitTargetCountForEffect(SpellEffIndex effect) const
SpellCastResult CheckPower() const
void CallScriptDestinationTargetSelectHandlers(SpellDestination &target, SpellEffIndex effIndex, SpellImplicitTargetInfo const &targetType)
void ExecuteLogEffectExtraAttacks(uint8 effIndex, Unit *victim, uint32 attCount)
void finish(bool ok=true)
void UpdateSpellCastDataTargets(WorldPackets::Spells::SpellCastData &data)
Writes miss and hit targets for a SMSG_SPELL_GO packet.
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, uint8 castCount, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE, uint32 *param1=nullptr, uint32 *param2=nullptr)
void UpdateOriginalCasterPointer()
SpellInfo const *const m_spellInfo
bool HasGlobalCooldown() const
void FinishTargetProcessing()
void DoTriggersOnSpellHit(Unit *unit, uint8 effMask)
void CallScriptOnHitHandlers()
SpellCastResult CheckRange(bool strict) const
void CallScriptObjectTargetSelectHandlers(WorldObject *&target, SpellEffIndex effIndex, SpellImplicitTargetInfo const &targetType)
int32 CalculateDamage(SpellEffectInfo const &spellEffectInfo) const
void TakeRunePower(bool didHit)
void CallScriptObjectAreaTargetSelectHandlers(std::list< WorldObject * > &targets, SpellEffIndex effIndex, SpellImplicitTargetInfo const &targetType)
void SelectImplicitTargetObjectTargets(SpellEffectInfo const &spellEffectInfo, SpellImplicitTargetInfo const &targetType, uint32 effMask)
void CallScriptAfterHitHandlers()
bool CanAutoCast(Unit *target)
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 ==
Specialized variant of std::shared_ptr that enforces unique ownership and/or std::unique_ptr with std...
Trinity::unique_trackable_ptr companion class, replicating what std::weak_ptr is to std::shared_ptr.
void AddStaticApplication(Unit *target, uint8 effMask)
void SetDiminishGroup(DiminishingGroup group)
int32 ModifyHealth(int32 val)
Unit * GetCharmed() const
void ClearUnitState(uint32 f)
uint32 GetChannelSpellId() const
void SetLastDamagedTargetGuid(ObjectGuid guid)
int32 ModifyPower(Powers power, int32 val, bool withPowerUpdate=true)
void RemoveGameObject(GameObject *gameObj, bool del)
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
uint32 m_lastSanctuaryTime
void SetChannelObjectGuid(ObjectGuid guid)
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
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)
ThreatManager & GetThreatManager()
void SetInCombatWith(Unit *enemy, bool addSecondUnitSuppressed=false)
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except=0)
AuraApplication * GetAuraApplication(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraApplication *except=nullptr) const
void CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=BASE_ATTACK, bool crit=false, bool blocked=false, Spell *spell=nullptr)
void StopMoving(bool force=false)
bool IsInDisallowedMountForm() const
virtual bool IsImmunedToSpell(SpellInfo const *spellInfo, WorldObject const *caster, bool requireImmunityPurgesEffectAttribute=false) const
void DealSpellDamage(SpellNonMeleeDamage const *damageInfo, bool durabilityLoss)
bool haveOffhandWeapon() const
MotionMaster * GetMotionMaster()
Powers GetPowerType() const
bool HasUnitFlag(UnitFlags flags) const
ObjectGuid GetCharmedGUID() const
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
void UpdateInterruptMask()
void SetChannelSpellId(uint32 channelSpellId)
bool IsFullHealth() const
bool HasUnitFlag2(UnitFlags2 flags) const
bool HasAuraWithMechanic(uint32 mechanicMask) const
AuraEffect * IsScriptOverriden(SpellInfo const *spell, int32 script) const
float GetCombatReach() const override
int32 HealBySpell(HealInfo &healInfo, bool critical=false)
GameObject * GetGameObject(uint32 spellId) const
float SpellCritChanceTaken(Unit const *caster, SpellInfo const *spellInfo, SpellSchoolMask schoolMask, float doneChance, WeaponAttackType attackType=BASE_ATTACK, bool isPeriodic=false) const
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage const *log)
UnitFlags GetUnitFlags() const
bool IsStandState() const
CharmInfo * GetCharmInfo()
ObjectGuid GetCharmerOrOwnerGUID() const override
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Unit * GetMeleeHitRedirectTarget(Unit *victim, SpellInfo const *spellInfo=nullptr)
std::map< uint8, AuraApplication * > VisibleAuraMap
virtual bool IsAffectedByDiminishingReturns() const
float SpellCritChanceDone(SpellInfo const *spellInfo, SpellSchoolMask schoolMask, WeaponAttackType attackType=BASE_ATTACK, bool isPeriodic=false) const
bool IsOnVehicle(Unit const *vehicle) const
bool IsCharmedOwnedByPlayerOrPlayer() const
void SetLastManaUse(uint32 spellCastTime)
virtual bool IsImmunedToSpellEffect(SpellInfo const *spellInfo, SpellEffectInfo const &spellEffectInfo, WorldObject const *caster, bool requireImmunityPurgesEffectAttribute=false) const
static void ProcSkillsAndAuras(Unit *actor, Unit *actionTarget, uint32 typeMaskActor, uint32 typeMaskActionTarget, uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell *spell, DamageInfo *damageInfo, HealInfo *healInfo)
uint32 GetMaxPower(Powers power) const
void RemoveDynObject(uint32 spellId)
void GetDispellableAuraList(WorldObject const *caster, uint32 dispelMask, DispelChargesList &dispelList, bool isReflect=false) const
VisibleAuraMap const & GetVisibleAuras() const
void EngageWithTarget(Unit *who)
int32 GetTotalAuraModifier(AuraType auraType) const
bool ApplyDiminishingToDuration(SpellInfo const *auraSpellInfo, bool triggered, int32 &duration, WorldObject *caster, DiminishingLevels previousLevel) const
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
bool IsImmunedToDamage(SpellSchoolMask meleeSchoolMask) const
DeathState getDeathState() const
ObjectGuid GetChannelObjectGuid() const
ObjectGuid GetTransGUID() const override
int32 CalculateAOEAvoidance(int32 damage, uint32 schoolMask, ObjectGuid const &casterGuid) const
bool HasUnitState(const uint32 f) const
bool IsInRaidWith(Unit const *unit) const
DynamicObject * GetDynObject(uint32 spellId) const
float GetMeleeRange(Unit const *target) const
void SetStandState(UnitStandStateType state)
SpellHistory * GetSpellHistory()
void IncrDiminishing(SpellInfo const *auraSpellInfo, bool triggered)
bool IsControlledByPlayer() const
DiminishingLevels GetDiminishing(DiminishingGroup group) const
ObjectGuid GetCharmerGUID() const
virtual void setDeathState(DeathState s)
uint32 GetPower(Powers power) const
CombatManager & GetCombatManager()
bool HasAuraTypeWithAffectMask(AuraType auraType, SpellInfo const *affectedSpell) const
std::list< AuraEffect * > AuraEffectList
void RemoveMovementImpairingAuras(bool withRoot)
bool IsSpiritHealer() const
Vehicle * GetVehicleKit() const
Guardian * GetGuardianPet() const
void resetAttackTimer(WeaponAttackType type=BASE_ATTACK)
virtual bool IsEngaged() const
bool IsInPartyWith(Unit const *unit) const
static void DealDamageMods(Unit const *victim, uint32 &damage, uint32 *absorb)
ObjectGuid GetTarget() const
float GetTotalAttackPowerValue(WeaponAttackType attType) const
ObjectGuid GetPetGUID() const
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
bool isLineOfSightCalcEnabled() const
static VMapManager2 * createOrGetVMapManager()
bool IsControllableVehicle() const
Unit * GetMagicHitRedirectTarget(Unit *victim, SpellInfo const *spellInfo)
uint32 GetPhaseMask() const
bool IsWithinDist2d(float x, float y, float dist) const
virtual void SendMessageToSet(WorldPacket const *data, bool self) const
std::string const & GetNameForLocaleIdx(LocaleConstant) const override
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 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={ })
bool IsValidAttackTarget(WorldObject const *target, SpellInfo const *bySpell=nullptr) const
float GetTransOffsetX() const
void MovePositionToFirstCollision(Position &pos, float dist, float angle)
bool GetDistanceOrder(WorldObject const *obj1, WorldObject const *obj2, bool is3D=true) const
bool isInFront(WorldObject const *target, float arc=float(M_PI)) const
int32 ModSpellDuration(SpellInfo const *spellInfo, WorldObject const *target, int32 duration, bool positive, uint32 effectMask) const
float GetTransOffsetY() const
float GetTransOffsetZ() const
bool IsWithinLOSInMap(WorldObject const *obj, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing) const
virtual ObjectGuid GetTransGUID() const
bool isInBack(WorldObject const *target, float arc=float(M_PI)) 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
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
bool IsWithinDist(WorldObject const *obj, float dist2compare, bool is3D=true) const
void GetZoneAndAreaId(uint32 &zoneid, uint32 &areaid) const
float GetSpellMaxRangeForTarget(Unit const *target, SpellInfo const *spellInfo) const
bool IsFriendlyTo(WorldObject const *target) const
virtual float GetCombatReach() const
int32 CalculateSpellDamage(SpellEffectInfo const &spellEffectInfo, int32 const *basePoints=nullptr) const
void ModSpellDurationTime(SpellInfo const *spellInfo, int32 &durationTime, Spell *spell=nullptr) const
void push_back(value_type const &value)
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
@ RATE_POWER_RUNICPOWER_INCOME
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 Corpse * GetCorpse(WorldObject const &u, ObjectGuid const &guid)
TC_GAME_API Creature * GetCreatureOrPetOrVehicle(WorldObject const &, ObjectGuid const &)
void RandomResize(C &container, std::size_t requestedSize)
AuraCreateInfo & SetCastItemGUID(ObjectGuid const &guid)
AuraCreateInfo & SetBaseAmount(int32 const *bp)
AuraCreateInfo & SetOwnerEffectMask(uint8 effMask)
AuraCreateInfo & SetCasterGUID(ObjectGuid const &guid)
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)
Condition const * mLastFailedCondition
SkillType GetRequiredLootSkill() const
bool IsTameable(bool canTameExotic) const
bool CannotBeUsedUnderImmunity() const
uint32 GetRequiredSkillRank() const
std::array< ItemEffect, MAX_ITEM_PROTO_SPELLS > Effects
uint32 GetBaseItemLevel() const
uint32 GetQuality() const
uint32 GetMaxStackSize() const
SocketColor GetSocketColor(uint32 index) const
uint32 GetDisplayId() const
int32 GetRequiredLevel() const
uint32 GetItemLimitCategory() const
uint32 GetRequiredDisenchantSkill() const
bool HasFlag(ItemFlags flag) const
uint32 GetSubClass() const
::InventoryType GetInventoryType() const
uint32 Type[MAX_LOCK_CASE]
uint32 Index[MAX_LOCK_CASE]
uint32 Skill[MAX_LOCK_CASE]
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
float GetPositionZ() const
bool HasInLine(Position const *pos, float objSize, float width) const
float GetOrientation() const
bool HasInArc(float arcangle, Position const *pos, float border=2.0f) const
Streamer< XYZ > PositionXYZStream()
void SetOrientation(float orientation)
float GetPositionX() const
void GetPosition(float &x, float &y) const
void GetPositionOffsetTo(Position const &endPos, Position &retOffset) const
float GetPositionY() const
float GetExactDistSq(float x, float y, float z) const
void RelocateOffset(Position const &offset)
void Relocate(float x, float y)
void RelocateOffset(Position const &offset)
Position _transportOffset
void Relocate(Position const &pos)
ObjectGuid _transportGUID
uint32 Effect[MAX_ITEM_ENCHANTMENT_EFFECTS]
bool NoRunicPowerGain() const
SpellValue(SpellInfo const *proto)
int32 EffectBasePoints[MAX_SPELL_EFFECTS]
uint32 MaxAffectedTargets
void DoTargetSpellHit(Spell *spell, SpellEffectInfo const &spellEffectInfo) override
void DoTargetSpellHit(Spell *spell, SpellEffectInfo const &spellEffectInfo) override
void DoTargetSpellHit(Spell *spell, SpellEffectInfo const &spellEffectInfo) override
SpellInfo const * AuraSpellInfo
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
WorldObjectSpellAreaTargetCheck(float range, Position const *position, WorldObject *caster, WorldObject *referer, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer const *condList)
bool operator()(WorldObject *target) const
Position const * _position
WorldObjectSpellConeTargetCheck(float coneAngle, float range, WorldObject *caster, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer const *condList)
bool operator()(WorldObject *target) const
bool operator()(WorldObject *target)
WorldObjectSpellNearbyTargetCheck(float range, WorldObject *caster, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer const *condList)
Position const * _position
WorldObjectSpellTargetCheck(WorldObject *caster, WorldObject *referer, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer const *condList)
SpellTargetCheckTypes _targetSelectionType
~WorldObjectSpellTargetCheck()
std::unique_ptr< ConditionSourceInfo > _condSrcInfo
SpellInfo const * _spellInfo
bool operator()(WorldObject *target) const
ConditionContainer const * _condList
WorldObjectSpellTrajTargetCheck(float range, Position const *position, WorldObject *caster, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer const *condList)
Position const * _position
bool operator()(WorldObject *target) const
Optional< uint32 > RemainingPower
Optional< std::vector< SpellMissStatus > > MissStatus
Optional< RuneData > RemainingRunes
Optional< std::vector< ObjectGuid > > HitTargets
Optional< CreatureImmunities > Immunities
Optional< MissileTrajectoryResult > MissileTrajectory
Optional< uint8 > DestLocSpellCastIndex
Optional< SpellAmmo > Ammo
Optional< std::vector< TargetLocation > > TargetPoints
Optional< MissileTrajectoryRequest > MissileTrajectory
Optional< TargetLocation > SrcLocation
Optional< ObjectGuid > Unit
Optional< std::array< char, 128 > > Name
Optional< ObjectGuid > Item
Optional< TargetLocation > DstLocation