30#include "G3DPosition.hpp"
509m_spellInfo(
sSpellMgr->GetSpellForDifficultyFromSpell(info, caster)),
511, m_spellValue(new
SpellValue(m_spellInfo)), _spellEvent(nullptr)
542 if (!originalCasterGUID.
IsEmpty())
661 Unit* unit =
nullptr;
717 Unit* redirect =
nullptr;
731 if (redirect && (redirect != target))
742 uint32 processedEffectsMaskForSpell = 0;
747 if (!spellEffectInfo.IsEffect())
757 uint32 implicitTargetEffectMaskToSelect = [&]
759 uint32 effectMask = 1u << spellEffectInfo.EffectIndex;
764 for (
uint32 j = spellEffectInfo.EffectIndex + 1; j < effects.size(); ++j)
766 if (effects[j].IsEffect() &&
767 spellEffectInfo.TargetA.GetTarget() == effects[j].TargetA.GetTarget() &&
768 spellEffectInfo.TargetB.GetTarget() == effects[j].TargetB.GetTarget() &&
769 spellEffectInfo.ImplicitTargetConditions == effects[j].ImplicitTargetConditions &&
774 switch (targetInfo.GetSelectionCategory())
786 if (shouldCheckRadius(spellEffectInfo.TargetA) || shouldCheckRadius(spellEffectInfo.TargetB))
787 if (spellEffectInfo.CalcRadius(
m_caster) != effects[j].CalcRadius(
m_caster))
790 effectMask |= 1 << j;
797 implicitTargetEffectMaskToSelect &= ~processedEffectsMaskForSpell;
798 if (implicitTargetEffectMaskToSelect)
802 processedEffectsMaskForSpell |= implicitTargetEffectMaskToSelect;
815 if (implicitTargetEffectMaskToSelect
825 return target.
EffectMask & implicitTargetEffectMaskToSelect;
842 if (!anyNonImmuneTargetFound)
861 uint8 mask = (1 << spellEffectInfo.EffectIndex);
864 if (ihit->EffectMask & mask)
880 if (!targetInfo.ScaleAura && targetInfo.TargetGUID != m_caster->GetGUID())
961 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT_SRC");
978 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT_DEST");
992 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT");
1002 ABORT_MSG(
"Spell::SelectEffectImplicitTargets: received not implemented select target category");
1011 ABORT_MSG(
"Spell::SelectImplicitChannelTargets: received not implemented target reference type");
1016 if (!channeledSpell)
1028 if (target && target->
ToUnit())
1058 ABORT_MSG(
"Spell::SelectImplicitChannelTargets: received not implemented target type");
1067 ABORT_MSG(
"Spell::SelectImplicitNearbyTargets: received not implemented target reference type");
1088 ABORT_MSG(
"Spell::SelectImplicitNearbyTargets: received not implemented selection check type");
1097 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));
1160 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);
1171 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);
1182 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);
1196 ABORT_MSG(
"Spell::SelectImplicitNearbyTargets: received not implemented target object type");
1207 ABORT_MSG(
"Spell::SelectImplicitConeTargets: received not implemented target reference type");
1210 std::list<WorldObject*> targets;
1214 float coneAngle = float(
M_PI) / 2.f;
1218 if (G3D::fuzzyEq(radius, 0.f))
1228 SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellConeTargetCheck> >(searcher, containerTypeMask,
m_caster,
m_caster, radius + extraSearchRadius);
1232 if (!targets.empty())
1273 if (ihit->EffectMask & (1 << spellEffectInfo.
EffectIndex))
1282 ABORT_MSG(
"Spell::SelectImplicitAreaTargets: received not implemented target reference type");
1303 ABORT_MSG(
"Spell::SelectImplicitAreaTargets: received not implemented target reference type");
1306 std::list<WorldObject*> targets;
1309 if (G3D::fuzzyEq(radius, 0.f))
1318 if (!targets.empty())
1350 dest =
SpellDestination(playerCaster->m_homebindX, playerCaster->m_homebindY, playerCaster->m_homebindZ, playerCaster->GetOrientation(), playerCaster->m_homebindMapId);
1357 dest =
SpellDestination(st->target_X, st->target_Y, st->target_Z, st->target_Orientation, (
int32)st->target_mapId);
1359 dest =
SpellDestination(st->target_X, st->target_Y, st->target_Z, st->target_Orientation);
1372 float dist =
frand(minDist, maxDist);
1374 float angle = float(
rand_norm()) *
static_cast<float>(
M_PI * 35.0f / 180.0f) -
static_cast<float>(
M_PI * 17.5f / 180.0f);
1381 liquidLevel = liquidData.
level;
1383 if (liquidLevel <= ground)
1391 if (ground + 0.75 > liquidLevel)
1408 float dist = spellEffectInfo.
CalcRadius(unitCaster);
1430 dist = objSize + (dist - objSize) *
float(
rand_norm());
1437 static float const DefaultTotemDistance = 3.0f;
1439 dist = DefaultTotemDistance;
1476 float dist = spellEffectInfo.
CalcRadius(
nullptr);
1531 bool checkIfValid =
true;
1537 checkIfValid =
false;
1544 target = unitCaster->GetGuardianPet();
1548 if (unitCaster->IsSummon())
1549 target = unitCaster->ToTempSummon()->GetSummonerUnit();
1553 target = unitCaster->GetVehicleBase();
1564 if (vehicleBase->IsVehicle())
1616 if (effMask & (1 << k))
1620 std::list<WorldObject*> targets;
1627 for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
1639 if (x < 100000.0f && x > -100000.0f)
return x;
1640 if (x >= 100000.0f)
return 100000.0f;
1641 if (x <= 100000.0f)
return -100000.0f;
1658 std::list<WorldObject*> targets;
1661 SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellTrajTargetCheck> > (searcher,
GRID_MAP_TYPE_MASK_ALL,
m_caster, &srcPos, dist2d);
1662 if (targets.empty())
1668 float a = (srcToDestDelta - dist2d * b) / (dist2d * dist2d);
1676 bestDist = std::min(std::max(bestDist, triggerSpellInfo->GetMaxRange(
false)), std::min(dist2d, 300.0f));
1680 for (
auto itr = targets.begin(); itr != targets.end(); ++itr)
1687 if (unitCaster == *itr || unitCaster->
IsOnVehicle(unit) || unit->GetVehicle())
1697 float const size = std::max((*itr)->GetCombatReach(), 1.0f);
1699 float const dz = (*itr)->GetPositionZ() - srcPos.
m_positionZ;
1701 float const horizontalDistToTraj = std::fabs(objDist2d * std::sin(srcPos.
GetRelativeAngle(*itr)));
1702 float const sizeFactor = std::cos((horizontalDistToTraj / size) * (
M_PI / 2.0f));
1703 float const distToHitPoint = std::max(objDist2d * std::cos(srcPos.
GetRelativeAngle(*itr)) - size * sizeFactor, 0.0f);
1704 float const height = distToHitPoint * (a * distToHitPoint + b);
1709 if (distToHitPoint < bestDist)
1711 bestDist = distToHitPoint;
1716 if (dist2d > bestDist)
1731 switch (spellEffectInfo.
Effect)
1752 Player* player = ObjectAccessor::GetPlayer(map, targetGuid);
1757 if (player->IsImmunedToSpellEffect(spell->GetSpellInfo(), spellEffectInfo, nullptr))
1760 spell->HandleEffects(player, nullptr, nullptr, nullptr, spellEffectInfo, SPELL_EFFECT_HANDLE_HIT_TARGET);
1792 target = corpseTarget;
1859 retMask &=
sConditionMgr->GetSearcherTypeMaskForConditionList(*condList);
1863template<
class SEARCHER>
1872 if (searchInGrid || searchInWorld)
1892 if (!containerTypeMask)
1898 SearchTargets<Trinity::WorldObjectLastSearcher<Trinity::WorldObjectSpellNearbyTargetCheck>>(searcher, containerTypeMask,
m_caster,
m_caster, range);
1905 if (!containerTypeMask)
1912 SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellAreaTargetCheck>>(searcher, containerTypeMask,
m_caster, position, range + extraSearchRadius);
1918 float jumpRadius = 0.0f;
1946 float searchRadius = jumpRadius;
1948 searchRadius *= chainTargets;
1950 std::list<WorldObject*> tempTargets;
1952 tempTargets.remove(target);
1958 for (std::list<WorldObject*>::iterator itr = tempTargets.begin(); itr != tempTargets.end();)
1960 std::list<WorldObject*>::iterator checkItr = itr++;
1962 tempTargets.erase(checkItr);
1966 while (chainTargets)
1969 std::list<WorldObject*>::iterator foundItr = tempTargets.end();
1974 for (std::list<WorldObject*>::iterator itr = tempTargets.begin(); itr != tempTargets.end(); ++itr)
1978 uint32 deficit = unit->GetMaxHealth() - unit->GetHealth();
1982 maxHPDeficit = deficit;
1990 for (std::list<WorldObject*>::iterator itr = tempTargets.begin(); itr != tempTargets.end(); ++itr)
1992 if (foundItr == tempTargets.end())
2002 if (foundItr == tempTargets.end())
2005 tempTargets.erase(foundItr);
2006 targets.push_back(target);
2122 if (!spellEffectInfo.IsEffect() || !
CheckEffectTarget(target, spellEffectInfo, losPosition))
2123 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2136 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2145 ihit->EffectMask |= effectMask;
2146 ihit->ScaleAura =
false;
2151 ihit->ScaleAura =
true;
2165 targetInfo.
IsCrit =
false;
2228 if (!spellEffectInfo.IsEffect())
2229 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2232 switch (spellEffectInfo.Effect)
2238 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2256 ihit->EffectMask |= effectMask;
2289 if (!spellEffectInfo.IsEffect())
2290 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2301 ihit->EffectMask |= effectMask;
2317 if (!spellEffectInfo.IsEffect())
2318 effectMask &= ~(1 << spellEffectInfo.EffectIndex);
2328 if (targetGUID == ihit.TargetGUID)
2330 ihit.EffectMask |= effectMask;
2369 return targetInfo.EffectMask & (1 << effect);
2377 return targetInfo.EffectMask & (1 << effect);
2385 return targetInfo.EffectMask & (1 << effect);
2454 if (unit->
IsAlive() != IsAlive)
2460 if (_spellHitTarget)
2476 if (_spellHitTarget)
2500 if (canEffectTrigger && !procAttacker && !procVictim)
2502 bool positive =
true;
2510 if (EffectMask && !(EffectMask & (1 << i)))
2552 bool hasHealing =
false;
2553 std::unique_ptr<DamageInfo> spellDamageInfo;
2554 std::unique_ptr<HealInfo> healInfo;
2570 spell->
m_healing = healInfo->GetEffectiveHeal();
2576 bool hasDamage =
false;
2609 if (canEffectTrigger)
2617 if (!hasHealing && !hasDamage)
2623 if (canEffectTrigger)
2625 spellDamageInfo = std::make_unique<DamageInfo>(damageInfo,
NODAMAGE, spell->
m_attackType, hitMask);
2639 if (canEffectTrigger)
2674 if (_spellHitTarget)
2678 if (
CreatureAI* hitTargetAI = cHitTarget->AI())
2688 if (
AuraApplication* aurApp = HitAura->GetApplicationOfTarget(_spellHitTarget->GetGUID()))
2691 uint8 effMask = EffectMask & aurApp->GetEffectsToApply();
2693 if ((effMask & (1 << i)) && aurApp->HasEffect(i))
2694 effMask &= ~(1 << i);
2697 _spellHitTarget->_ApplyAura(aurApp, effMask);
2767 if (creatureTarget->IsEvadingAttacks())
2805 playerOwner->SetContestedPvP();
2806 playerOwner->UpdatePvP(
true);
2837 hitInfo.
AuraBasePoints[auraEffectInfo.EffectIndex] = auraEffectInfo.BasePoints;
2863 if (origCaster == unit || !origCaster->
IsFriendlyTo(unit))
2868 if (hitInfo.
EffectMask & (1 << auraSpellEffect.EffectIndex) &&
2869 auraSpellEffect.IsUnitOwnedAuraEffect() &&
2899 bool refresh =
false;
2914 .SetPeriodicReset(resetPeriodicTimer)
2970 int32 _duration = 0;
2976 TC_LOG_DEBUG(
"spells",
"Spell {} triggered spell {} by SPELL_AURA_ADD_TARGET_TRIGGER aura",
m_spellInfo->
Id, i->triggeredSpell->Id);
2980 if (i->triggeredSpell->GetDuration() == -1)
2990 triggeredAur->SetDuration(_duration);
3001 for (std::vector<int32>::const_iterator i = spellTriggered->begin(); i != spellTriggered->end(); ++i)
3018 uint8 channelAuraMask = 0;
3021 channelAuraMask |= 1 << spellEffectInfo.EffectIndex;
3023 channelAuraMask &= channelTargetEffectMask;
3026 if (channelAuraMask)
3038 if (targetInfo.MissCondition ==
SPELL_MISS_NONE && (channelTargetEffectMask & targetInfo.EffectMask))
3046 if (channelAuraMask & targetInfo.EffectMask)
3052 targetInfo.EffectMask &= ~aurApp->GetEffectMask();
3061 channelTargetEffectMask &= ~targetInfo.EffectMask;
3067 return channelTargetEffectMask == 0;
3111 if (triggeredByAura)
3143 uint32 param1 = 0, param2 = 0;
3161 if (param1 || param2)
3207 return movementResult;
3248 unitCaster->SetCurrentCastSpell(
this);
3257 if (caster->IsAIEnabled())
3326 Spell* lastSpellMod =
nullptr;
3361 sScriptMgr->OnPlayerSpellCast(playerCaster,
this, skipCheck);
3368 for (
Unit* controlled : playerCaster->m_Controlled)
3370 if (
CreatureAI* controlledAI = cControlled->AI())
3371 controlledAI->OwnerAttacked(target);
3402 uint32 param1 = 0, param2 = 0;
3406 cleanupSpell(castResult, ¶m1, ¶m2);
3418 if (!my_trade->IsInAcceptProcess())
3432 uint8 aura_effmask = 0;
3434 if (spellEffectInfo.IsUnitOwnedAuraEffect())
3435 aura_effmask |= 1 << spellEffectInfo.EffectIndex;
3447 if (target->HasStrongerAuraWithDR(
m_spellInfo, caster, triggered))
3460 if (!creatureCaster->GetTarget().IsEmpty() && !creatureCaster->HasUnitFlag(
UNIT_FLAG_POSSESSED))
3462 creatureCaster->SetInFront(target);
3482 pet->DespawnOrUnsummon();
3526 creatureCaster->ReleaseSpellFocus(
this);
3541 if (unitCaster->HasUnitState(
UNIT_STATE_CASTING) && !unitCaster->IsNonMeleeSpellCast(
false,
false,
true))
3554 for (
int32 id : *spell_triggered)
3559 unitCaster->RemoveAurasDueToSpell(-
id);
3598 if (caster->IsAIEnabled())
3602template <
class Container>
3606 target.PreprocessTarget(
this);
3610 if (target.EffectMask & (1 << spellEffectInfo.EffectIndex))
3611 target.DoTargetSpellHit(
this, spellEffectInfo);
3614 target.DoDamageAndTriggers(
this);
3636 else if (duration == -1)
3705 std::vector<TargetInfo> delayedTargets;
3708 if (single_missile || target.TimeDelay <= t_offset)
3710 target.TimeDelay = t_offset;
3711 delayedTargets.emplace_back(std::move(target));
3714 else if (next_time == 0 || target.
TimeDelay < next_time)
3725 std::vector<GOTargetInfo> delayedGOTargets;
3728 if (single_missile || goTarget.TimeDelay <= t_offset)
3730 goTarget.TimeDelay = t_offset;
3731 delayedGOTargets.emplace_back(std::move(goTarget));
3734 else if (next_time == 0 || goTarget.TimeDelay < next_time)
3735 next_time = goTarget.TimeDelay;
3746 modOwner->SetSpellModTakingSpell(
this,
false);
3775 if (!spellEffectInfo.IsEffect())
3792 unitCaster->ClearComboPoints();
3902 if (creatureCaster->IsAIEnabled())
3903 creatureCaster->AI()->OnChannelFinished(
m_spellInfo);
3938 ((
Puppet*)charm)->UnSummon();
3942 creatureCaster->ReleaseSpellFocus(
this);
3967 for (Unit::AuraEffectList::const_iterator i = vIgnoreReset.begin(); i != vIgnoreReset.end(); ++i)
3999 data <<
uint8(castCount);
4001 data <<
uint8(result);
4016 switch (spellInfo->
Id)
4044 if (spellInfo->
Totem[0])
4046 if (spellInfo->
Totem[1])
4068 if (param1 && param2)
4088 if (
uint32 itemType = spellEffectInfo.ItemType)
4102 data <<
uint32(customError);
4113 if (spellInfo->
Reagent[i] <= 0)
4121 missingItem = itemid;
4126 data <<
uint32(missingItem);
4143 if (param1 && param2)
4155 if (param1 && param2)
4183 WriteCastResultInfo(data, caster, spellInfo, castCount, result, customError, param1, param2);
4252 uint32 schoolImmunityMask = 0;
4253 uint32 mechanicImmunityMask = 0;
4256 schoolImmunityMask =
m_timer!= 0 ? unitCaster->GetSchoolImmunityMask() : 0;
4260 if (schoolImmunityMask || mechanicImmunityMask)
4297 castData.
Ammo.emplace();
4304 castData.
Immunities->School = schoolImmunityMask;
4305 castData.
Immunities->Value = mechanicImmunityMask;
4380 uint8 runeMaskAfterCast = player->GetRunesState();
4386 uint8 mask = (1 << i);
4387 if ((mask & runeMaskInitial) && !(mask & runeMaskAfterCast))
4390 float baseCd = float(player->GetRuneBaseCooldown(i));
4421 castData.
CastFlags &= ~CAST_FLAG_POWER_LEFT_SELF;
4431 uint32 ammoInventoryType = 0;
4432 uint32 ammoDisplayID = 0;
4456 ammoDisplayID = 5996;
4464 uint32 nonRangedAmmoDisplayID = 0;
4465 uint32 nonRangedAmmoInventoryType = 0;
4468 if (
uint32 item_id = unitCaster->GetVirtualItemId(i))
4474 switch (itemEntry->SubclassID)
4477 ammoDisplayID = itemEntry->DisplayInfoID;
4478 ammoInventoryType = itemEntry->InventoryType;
4482 ammoDisplayID = 5996;
4486 ammoDisplayID = 5998;
4490 nonRangedAmmoDisplayID = itemEntry->DisplayInfoID;
4491 nonRangedAmmoInventoryType = itemEntry->InventoryType;
4502 if (!ammoDisplayID && !ammoInventoryType)
4504 ammoDisplayID = nonRangedAmmoDisplayID;
4505 ammoInventoryType = nonRangedAmmoInventoryType;
4520 if (targetInfo.EffectMask == 0)
4538 missStatus.
TargetGUID = targetInfo.TargetGUID;
4539 missStatus.
Reason = targetInfo.MissCondition;
4576 data <<
uint32(effCount);
4582 data <<
uint32(spellEffectInfo.Effect);
4665 data <<
uint8(result);
4672 data <<
uint8(resultOther.value_or(result));
4711 data <<
uint32(duration);
4721 if (!creatureCaster->HasSpellFocus(
this))
4732 std::string sentName;
4738 data <<
uint32(sentName.size() + 1);
4769 bool expendable =
false;
4770 bool withoutCharges =
false;
4788 (charges > 0) ? --charges : ++charges;
4795 withoutCharges = (charges == 0);
4800 if (expendable && withoutCharges)
4871 TC_LOG_ERROR(
"spells",
"Spell::TakePower: Unknown power type '{}'", powerType);
4954 if (runeCost[i] > 0)
4979 runeCost[i] = runeCostData->
RuneCost[i];
5012 runeCost[baseRune]--;
5077 if (castItemTemplate && castItemTemplate->
ItemId == itemid)
5083 if (castItemTemplate->
Effects[s].Charges < 0 && abs(charges) < 2)
5116 float threat = 0.0f;
5119 if (threatEntry->apPctMod != 0.0f)
5122 threat += threatEntry->flatMod;
5136 float threatToAdd = threat;
5174 if (!preventDefault)
5247 bool checkForm =
true;
5274 bool reqCombat =
true;
5276 for (Unit::AuraEffectList::const_iterator j = stateAuras.begin(); j != stateAuras.end(); ++j)
5281 if ((*j)->GetMiscValue() == 1)
5310 if (unitCaster->GetTypeId() ==
TYPEID_PLAYER && unitCaster->ToPlayer()->isMoving() && (!unitCaster->IsCharmed() || !unitCaster->GetCharmerGUID().IsCreature()))
5326 return vehicleCheck;
5414 if (!unitCaster->GetGuardianPet())
5433 if (player->InArena())
5508 bool hasDispellableAura =
false;
5509 bool hasNonDispelEffect =
false;
5517 hasDispellableAura =
true;
5523 else if (spellEffectInfo.IsEffect())
5525 hasNonDispelEffect =
true;
5530 if (!hasNonDispelEffect && !hasDispellableAura && dispelMask && !
IsTriggered())
5537 if (!unitCaster->IsFriendlyTo(target))
5539 if (unitCaster->IsInSanctuary() || target->IsInSanctuary())
5543 if (!player || !player->
duel || target != player->
duel->Opponent)
5550 if (dispelList.empty())
5556 uint8 approximateAuraEffectMask = 0;
5557 uint8 nonAuraEffectMask = 0;
5561 switch (spellEffectInfo.Effect)
5575 SpellInfo const* learn_spellproto =
sSpellMgr->GetSpellInfo(spellEffectInfo.TriggerSpell);
5576 if (!learn_spellproto)
5596 SpellInfo const* learn_spellproto =
sSpellMgr->GetSpellInfo(spellEffectInfo.TriggerSpell);
5598 if (!learn_spellproto)
5611 uint32 glyphId = spellEffectInfo.MiscValue;
5647 if (target !=
m_caster && target->GetPowerType() !=
Powers(spellEffectInfo.MiscValue))
5712 int32 ReqValue = (skillValue < 100 ? (TargetLevel-10) * 10 : TargetLevel * 5);
5713 if (ReqValue > skillValue)
5729 Item* pTempItem =
nullptr;
5754 lockId = go->GetGOInfo()->GetLockId();
5762 int32 reqSkillValue = 0;
5763 int32 skillValue = 0;
5778 if ((canFailAtMax || skillValue < sWorld->GetConfigMaxSkillValue()) && reqSkillValue >
irand(skillValue - 25, skillValue + 37))
5802 if (!SummonProperties)
5805 switch (SummonProperties->
Control)
5841 pet->
CastSpell(pet, 32752, pet->GetGUID());
5858 if (!info.first->Health)
5868 if (creatureInfo && creatureInfo->
IsTameable(
true))
5877 else if (!spellEffectInfo.MiscValue)
5910 if (targetBind->perm && targetBind->save != casterBind->save)
5951 bool hasStealableAura =
false;
5953 for (Unit::VisibleAuraMap::const_iterator itr = visibleAuras.begin(); itr != visibleAuras.end(); ++itr)
5955 if (!itr->second->IsPositive())
5958 Aura const* aura = itr->second->GetBase();
5965 hasStealableAura =
true;
5969 if (!hasStealableAura)
6011 if (spellEffectInfo.IsAura())
6012 approximateAuraEffectMask |= 1 << spellEffectInfo.EffectIndex;
6013 else if (spellEffectInfo.IsEffect())
6014 nonAuraEffectMask |= 1 << spellEffectInfo.EffectIndex;
6019 switch (spellEffectInfo.ApplyAuraName)
6057 if (target->GetTypeId() ==
TYPEID_UNIT && target->IsVehicle())
6060 if (target->IsMounted())
6063 if (!target->GetCharmerGUID().IsEmpty())
6066 if (target->GetOwner() && target->GetOwner()->GetTypeId() ==
TYPEID_PLAYER)
6070 if (value &&
int32(target->GetLevel()) > value)
6126 if (spellEffectInfo.IsTargetingArea())
6144 if (!nonAuraEffectMask && (approximateAuraEffectMask & (1 << spellEffectInfo.EffectIndex)) && !
m_spellInfo->
IsTargetingArea())
6146 if (!target->IsHighestExclusiveAuraEffect(
m_spellInfo,
AuraType(spellEffectInfo.ApplyAuraName),
6186 if (!unitCaster->GetComboPoints())
6204 if (!owner->IsAlive() && !owner->IsGhouled())
6226 if (!creatureCaster->GetSpellHistory()->IsReady(
m_spellInfo))
6262 usableWhileStunned =
false;
6276 bool foundNotMechanic =
false;
6280 uint32 const mechanicMask = aurEff->GetSpellInfo()->GetAllEffectsMechanicMask();
6281 if (mechanicMask && !(mechanicMask &
GetSpellInfo()->GetAllowedMechanicMask()))
6283 foundNotMechanic =
true;
6288 *param1 = aurEff->GetSpellEffectInfo().Mechanic;
6290 *param1 = aurEff->GetSpellInfo()->Mechanic;
6297 if (foundNotMechanic)
6318 if (usableWhileStunned)
6322 result = mechanicResult;
6335 if (usableWhileFeared)
6339 result = mechanicResult;
6346 if (usableWhileConfused)
6350 result = mechanicResult;
6371 if (auraEffects.empty())
6376 SpellInfo const* auraInfo = aurEff->GetSpellInfo();
6382 *param1 = aurEff->GetSpellEffectInfo().
Mechanic;
6480 if (!spellEffectInfo.IsAura())
6483 AuraType const& auraType = spellEffectInfo.ApplyAuraName;
6485 for (Unit::AuraEffectList::const_iterator auraIt = auras.begin(); auraIt != auras.end(); ++auraIt)
6495 if (
GetCaster() == (*auraIt)->GetCaster())
6500 if (abs(spellEffectInfo.BasePoints) <= abs((*auraIt)->GetAmount()))
6519 if (ihit->TargetGUID == targetguid)
6544 float minRange, maxRange;
6552 minRange *= minRange;
6553 maxRange *= maxRange;
6588 float rangeMod = 0.0f;
6589 float minRange = 0.0f;
6590 float maxRange = 0.0f;
6593 return { 0.0f, 100.0f };
6603 rangeMod = unitCaster->
GetMeleeRange(target ? target : unitCaster);
6607 float meleeRange = 0.0f;
6612 meleeRange = unitCaster->
GetMeleeRange(target ? target : unitCaster);
6623 minRange += rangeMod;
6629 rangeMod += 8.0f / 3.0f;
6634 maxRange *= ranged->GetTemplate()->RangedModRange * 0.01f;
6639 maxRange += rangeMod;
6641 return { minRange, maxRange };
6706 if (proto->
Effects[i].Charges)
6738 if (spellEffectInfo.MiscValue < 0 || spellEffectInfo.MiscValue >=
int8(
MAX_POWERS))
6787 if (targetItem->GetOwnerGUID() != player->
GetGUID())
6788 checkReagents =
true;
6811 if (proto->
Effects[s].Charges < 0 && abs(charges) < 2)
6829 for (
uint8 i = 0; i < 2; ++i)
6847 for (
uint8 i = 0; i < 2; ++i)
6867 switch (spellEffectInfo.Effect)
6885 if (spellEffectInfo.ItemType)
6891 uint32 createCount = std::clamp<uint32>(spellEffectInfo.CalcValue(), 1u, itemTemplate->
GetMaxStackSize());
6899 player->
SendEquipError(msg,
nullptr,
nullptr, spellEffectInfo.ItemType);
6909 player->
SendEquipError(msg,
nullptr,
nullptr, spellEffectInfo.ItemType);
6935 player->
SendEquipError(msg,
nullptr,
nullptr, spellEffectInfo.ItemType);
6953 if (requiredLevel < m_spellInfo->BaseLevel)
6960 bool isItemUsable =
false;
6966 isItemUsable =
true;
6977 switch (enchantEntry->
Effect[s])
6999 if (targetItem->
GetOwner() != player)
7016 uint32 enchant_id = spellEffectInfo.MiscValue;
7031 if (requiredLevel < m_spellInfo->BaseLevel)
7057 if (item_disenchantskilllevel ==
uint32(-1))
7061 if (item_quality > 4 || item_quality < 2)
7087 if (param1 && param2)
7118 if (param1 && param2)
7203 uint32 item_id = spellEffectInfo.ItemType;
7212 if (pProto->
Effects[x].Charges != 0 && pitem->GetSpellCharges(x) == pProto->
Effects[x].Charges)
7244 return mainHandResult;
7251 return offHandResult;
7272 int32 delaytime = 500;
7274 int32 delayReduce = 100;
7277 if (delayReduce >= 100)
7280 AddPct(delaytime, -delayReduce);
7292 data <<
uint32(delaytime);
7319 int32 delayReduce = 100;
7322 if (delayReduce >= 100)
7325 AddPct(delaytime, -delayReduce);
7342 dynObj->Delay(delaytime);
7442 if (gobCaster->GetGOInfo()->IsIgnoringLOSChecks())
7451 switch (spellEffectInfo.
Effect)
7584 TC_LOG_ERROR(
"spells",
"~SpellEvent: {} {} tried to delete non-deletable spell {}. Was not deleted, causes memory leak.",
7705 if (!spellEffectInfo.IsEffect())
7733 float multiplier = 1.0f;
7739 uint32 mask = target.EffectMask;
7740 if (!(mask & (1 << spellEffectInfo.EffectIndex)))
7760 Unit* unit =
nullptr;
7784 Unit* unit =
nullptr;
7810 if (targetAmount > 10)
7839 bool reqKey =
false;
7843 switch (lockInfo->
Type[j])
7864 reqSkillValue = lockInfo->
Skill[j];
7873 skillValue += spellEffectInfo.
CalcValue();
7875 if (skillValue < reqSkillValue)
7961 TC_LOG_DEBUG(
"spells",
"Spell::LoadScripts: Script `{}` for spell `{}` is loaded now", (*itr)->_GetScriptName()->c_str(),
m_spellInfo->
Id);
7971 auto hookItrEnd = (*scritr)->BeforeCast.end(), hookItr = (*scritr)->BeforeCast.begin();
7972 for (; hookItr != hookItrEnd; ++hookItr)
7973 (*hookItr).Call(*scritr);
7975 (*scritr)->_FinishScriptCall();
7984 auto hookItrEnd = (*scritr)->OnCast.end(), hookItr = (*scritr)->OnCast.begin();
7985 for (; hookItr != hookItrEnd; ++hookItr)
7986 (*hookItr).Call(*scritr);
7988 (*scritr)->_FinishScriptCall();
7997 auto hookItrEnd = (*scritr)->AfterCast.end(), hookItr = (*scritr)->AfterCast.begin();
7998 for (; hookItr != hookItrEnd; ++hookItr)
7999 (*hookItr).Call(*scritr);
8001 (*scritr)->_FinishScriptCall();
8011 auto hookItrEnd = (*scritr)->OnCheckCast.end(), hookItr = (*scritr)->OnCheckCast.begin();
8012 for (; hookItr != hookItrEnd; ++hookItr)
8016 retVal = tempResult;
8019 (*scritr)->_FinishScriptCall();
8027 bool preventDefault =
false;
8030 (*scritr)->_InitHit();
8037 effItr = (*scritr)->OnEffectLaunch.
begin();
8038 effEndItr = (*scritr)->OnEffectLaunch.
end();
8042 effItr = (*scritr)->OnEffectLaunchTarget.
begin();
8043 effEndItr = (*scritr)->OnEffectLaunchTarget.
end();
8047 effItr = (*scritr)->OnEffectHit.
begin();
8048 effEndItr = (*scritr)->OnEffectHit.
end();
8052 effItr = (*scritr)->OnEffectHitTarget.
begin();
8053 effEndItr = (*scritr)->OnEffectHitTarget.
end();
8060 (*scritr)->_PrepareScriptCall(hookType);
8061 for (; effItr != effEndItr; ++effItr)
8063 if (!(*scritr)->_IsEffectPrevented(effIndex) && (*effItr).IsEffectAffected(
m_spellInfo, effIndex))
8064 (*effItr).Call(*scritr, effIndex);
8066 if (!preventDefault)
8067 preventDefault = (*scritr)->_IsDefaultEffectPrevented(effIndex);
8069 (*scritr)->_FinishScriptCall();
8071 return preventDefault;
8079 auto hookItrEnd = (*scritr)->OnEffectSuccessfulDispel.end(), hookItr = (*scritr)->OnEffectSuccessfulDispel.begin();
8080 for (; hookItr != hookItrEnd; ++hookItr)
8081 hookItr->Call(*scritr, effIndex);
8083 (*scritr)->_FinishScriptCall();
8091 (*scritr)->_InitHit();
8093 auto hookItrEnd = (*scritr)->BeforeHit.end(), hookItr = (*scritr)->BeforeHit.begin();
8094 for (; hookItr != hookItrEnd; ++hookItr)
8095 (*hookItr).Call(*scritr, missInfo);
8097 (*scritr)->_FinishScriptCall();
8106 auto hookItrEnd = (*scritr)->OnHit.end(), hookItr = (*scritr)->OnHit.begin();
8107 for (; hookItr != hookItrEnd; ++hookItr)
8108 (*hookItr).Call(*scritr);
8110 (*scritr)->_FinishScriptCall();
8119 auto hookItrEnd = (*scritr)->AfterHit.end(), hookItr = (*scritr)->AfterHit.begin();
8120 for (; hookItr != hookItrEnd; ++hookItr)
8121 (*hookItr).Call(*scritr);
8123 (*scritr)->_FinishScriptCall();
8132 auto hookItrEnd = (*scritr)->OnObjectAreaTargetSelect.end(), hookItr = (*scritr)->OnObjectAreaTargetSelect.begin();
8133 for (; hookItr != hookItrEnd; ++hookItr)
8134 if (hookItr->IsEffectAffected(
m_spellInfo, effIndex) && targetType.
GetTarget() == hookItr->GetTarget())
8135 hookItr->Call(*scritr, targets);
8137 (*scritr)->_FinishScriptCall();
8146 auto hookItrEnd = (*scritr)->OnObjectTargetSelect.end(), hookItr = (*scritr)->OnObjectTargetSelect.begin();
8147 for (; hookItr != hookItrEnd; ++hookItr)
8148 if (hookItr->IsEffectAffected(
m_spellInfo, effIndex) && targetType.
GetTarget() == hookItr->GetTarget())
8149 hookItr->Call(*scritr, target);
8151 (*scritr)->_FinishScriptCall();
8160 auto hookItrEnd = (*scritr)->OnDestinationTargetSelect.end(), hookItr = (*scritr)->OnDestinationTargetSelect.begin();
8161 for (; hookItr != hookItrEnd; ++hookItr)
8162 if (hookItr->IsEffectAffected(
m_spellInfo, effIndex) && targetType.
GetTarget() == hookItr->GetTarget())
8163 hookItr->Call(*scritr, target);
8165 (*scritr)->_FinishScriptCall();
8173 for (HookType& hook : hooks)
8175 if (!hook.IsEffectAffected(spellInfo, effIndex))
8178 bool otherEffectHasSameTargetFunction = std::ranges::any_of(hooks, [&](HookType& other)
8180 return other.IsEffectAffected(spellInfo, effIndexToCheck) && hook.HasSameTargetFunctionAs(other);
8182 if (!otherEffectHasSameTargetFunction)
8191 if (!allEffectTargetScriptsAreShared(script->OnObjectTargetSelect,
m_spellInfo, effIndex, effIndexToCheck))
8194 if (!allEffectTargetScriptsAreShared(script->OnObjectTargetSelect,
m_spellInfo, effIndexToCheck, effIndex))
8197 if (!allEffectTargetScriptsAreShared(script->OnObjectAreaTargetSelect,
m_spellInfo, effIndex, effIndexToCheck))
8200 if (!allEffectTargetScriptsAreShared(script->OnObjectAreaTargetSelect,
m_spellInfo, effIndexToCheck, effIndex))
8212 if ((effMask & (1 << spellEffectInfo.EffectIndex)) && (!only_on_caster || (spellEffectInfo.TargetA.GetTarget() ==
TARGET_UNIT_CASTER)))
8228 for (
AuraEffect const* aurEff : targetTriggers)
8233 SpellInfo const* auraSpellInfo = aurEff->GetSpellInfo();
8234 if (
SpellInfo const* spellInfo =
sSpellMgr->GetSpellInfo(aurEff->GetSpellEffectInfo().TriggerSpell))
8238 int32 auraBaseAmount = aurEff->GetBaseAmount();
8241 chance *= aurEff->GetBase()->GetStackAmount();
8322 std::stringstream sstr;
8323 sstr << std::boolalpha
8339 auto hookItrEnd = (*scritr)->OnCalculateResistAbsorb.end(), hookItr = (*scritr)->OnCalculateResistAbsorb.begin();
8340 for (; hookItr != hookItrEnd; ++hookItr)
8341 hookItr->Call(*scritr, damageInfo, resistAmount, absorbAmount);
8343 (*scritr)->_FinishScriptCall();
8352 _targetSelectionType(selectionType), _condSrcInfo(nullptr), _condList(condList)
8355 _condSrcInfo = std::make_unique<ConditionSourceInfo>(
nullptr, caster);
8443 if (dist <
_range && WorldObjectSpellTargetCheck::operator ()(target))
8467 if (!isInsideCylinder)
8522 Targets->SetUnitTarget(unitTarget);
8527 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)
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)
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)
ZLiquidStatus GetLiquidStatus(uint32 phaseMask, float x, float y, float z, Optional< uint8 > ReqLiquidType, LiquidData *data=nullptr, float collisionHeight=2.03128f) const
Difficulty GetDifficulty() 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 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 SendEquipError(InventoryResult msg, Item *pItem, Item *pItem2=nullptr, uint32 itemid=0) 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
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 SetSrc(float x, float y, float z)
void SetTargetFlag(SpellCastTargetFlags flag)
SpellDestination const * GetDst() const
float GetElevation() 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)
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
static void WriteCastResultInfo(WorldPacket &data, Player *caster, SpellInfo const *spellInfo, uint8 castCount, SpellCastResult result, SpellCustomErrors customError, uint32 *param1=nullptr, uint32 *param2=nullptr)
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)
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)
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
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
virtual std::string const & GetNameForLocaleIdx(LocaleConstant) 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 Initialize(uint16 opcode, size_t newres=200)
void push_back(value_type const &value)
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
LocaleConstant GetSessionDbLocaleIndex() const
uint32 GetRecruiterId() const
uint32 GetAccountId() const
@ SMSG_SPELL_FAILED_OTHER
@ 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
std::array< ItemEffect, MAX_ITEM_PROTO_SPELLS > Effects
uint32 GetMaxStackSize() const
std::array< _Socket, MAX_ITEM_PROTO_SOCKETS > Socket
uint32 RequiredDisenchantSkill
bool HasFlag(ItemFlags flag) 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< TargetLocation > SrcLocation
Optional< ObjectGuid > Unit
Optional< ObjectGuid > Item
Optional< TargetLocation > DstLocation
Optional< std::string > Name