mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-02 10:33:46 +00:00
refactor(Core): NULL -> nullptr (#3275)
* NULL to nullptr * NULL to nullptr * NULL to nullptr * NULL to nullptr * NULL to nullptr Co-authored-by: Francesco Borzì <borzifrancesco@gmail.com> Co-authored-by: Stefano Borzì <stefanoborzi32@gmail.com>
This commit is contained in:
@@ -370,7 +370,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
|
||||
AuraEffect::AuraEffect(Aura* base, uint8 effIndex, int32 *baseAmount, Unit* caster):
|
||||
m_base(base), m_spellInfo(base->GetSpellInfo()),
|
||||
m_baseAmount(baseAmount ? *baseAmount : m_spellInfo->Effects[effIndex].BasePoints), m_critChance(0),
|
||||
m_oldAmount(0), m_isAuraEnabled(true), m_channelData(NULL), m_spellmod(NULL), m_periodicTimer(0), m_tickNumber(0), m_effIndex(effIndex),
|
||||
m_oldAmount(0), m_isAuraEnabled(true), m_channelData(nullptr), m_spellmod(nullptr), m_periodicTimer(0), m_tickNumber(0), m_effIndex(effIndex),
|
||||
m_canBeRecalculated(true), m_isPeriodic(false)
|
||||
{
|
||||
CalculatePeriodic(caster, true, false);
|
||||
@@ -386,7 +386,7 @@ m_canBeRecalculated(true), m_isPeriodic(false)
|
||||
// Xinef: channel data structure
|
||||
if (caster)
|
||||
if (Spell* spell = caster->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
|
||||
m_channelData = new ChannelTargetData(caster->GetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT), spell->m_targets.HasDst() ? spell->m_targets.GetDst() : NULL);
|
||||
m_channelData = new ChannelTargetData(caster->GetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT), spell->m_targets.HasDst() ? spell->m_targets.GetDst() : nullptr);
|
||||
}
|
||||
|
||||
AuraEffect::~AuraEffect()
|
||||
@@ -440,7 +440,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster)
|
||||
{
|
||||
int32 amount;
|
||||
// default amount calculation
|
||||
amount = m_spellInfo->Effects[m_effIndex].CalcValue(caster, &m_baseAmount, NULL);
|
||||
amount = m_spellInfo->Effects[m_effIndex].CalcValue(caster, &m_baseAmount, nullptr);
|
||||
|
||||
// check item enchant aura cast
|
||||
if (!amount && caster)
|
||||
@@ -579,7 +579,7 @@ void AuraEffect::CalculatePeriodicData()
|
||||
}
|
||||
|
||||
if (GetCaster())
|
||||
SetCritChance(CalcPeriodicCritChance(GetCaster(), (GetBase()->GetType() == UNIT_AURA_TYPE ? GetBase()->GetUnitOwner() : NULL)));
|
||||
SetCritChance(CalcPeriodicCritChance(GetCaster(), (GetBase()->GetType() == UNIT_AURA_TYPE ? GetBase()->GetUnitOwner() : nullptr)));
|
||||
}
|
||||
|
||||
void AuraEffect::CalculatePeriodic(Unit* caster, bool create, bool load)
|
||||
@@ -620,7 +620,7 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool create, bool load)
|
||||
if (m_amplitude <= 0)
|
||||
m_amplitude = 1000;
|
||||
|
||||
Player* modOwner = caster ? caster->GetSpellModOwner() : NULL;
|
||||
Player* modOwner = caster ? caster->GetSpellModOwner() : nullptr;
|
||||
|
||||
// Apply casting time mods
|
||||
if (m_amplitude)
|
||||
@@ -1033,7 +1033,7 @@ float AuraEffect::CalcPeriodicCritChance(Unit const* caster, Unit const* target)
|
||||
{
|
||||
if ((*itr)->IsAffectedOnSpell(GetSpellInfo()))
|
||||
{
|
||||
critChance = modOwner->SpellDoneCritChance(NULL, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), (GetSpellInfo()->DmgClass == SPELL_DAMAGE_CLASS_RANGED ? RANGED_ATTACK : BASE_ATTACK), true);
|
||||
critChance = modOwner->SpellDoneCritChance(nullptr, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), (GetSpellInfo()->DmgClass == SPELL_DAMAGE_CLASS_RANGED ? RANGED_ATTACK : BASE_ATTACK), true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1043,7 +1043,7 @@ float AuraEffect::CalcPeriodicCritChance(Unit const* caster, Unit const* target)
|
||||
// Rupture - since 3.3.3 can crit
|
||||
case SPELLFAMILY_ROGUE:
|
||||
if (GetSpellInfo()->SpellFamilyFlags[0] & 0x100000)
|
||||
critChance = modOwner->SpellDoneCritChance(NULL, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), BASE_ATTACK, true);
|
||||
critChance = modOwner->SpellDoneCritChance(nullptr, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), BASE_ATTACK, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1356,7 +1356,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
|
||||
{
|
||||
int32 HotWMod = (*i)->GetAmount() / 2; // For each 2% Intelligence, you get 1% stamina and 1% attack power.
|
||||
|
||||
target->CastCustomSpell(target, HotWSpellId, &HotWMod, NULL, NULL, true, NULL, this, target->GetGUID());
|
||||
target->CastCustomSpell(target, HotWSpellId, &HotWMod, nullptr, nullptr, true, NULL, this, target->GetGUID());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1386,7 +1386,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
|
||||
if (AuraEffect const* aurEff = target->GetDummyAuraEffect(SPELLFAMILY_GENERIC, 2851, 0))
|
||||
{
|
||||
int32 bp = aurEff->GetAmount();
|
||||
target->CastCustomSpell(target, 48420, &bp, NULL, NULL, true);
|
||||
target->CastCustomSpell(target, 48420, &bp, nullptr, nullptr, true);
|
||||
}
|
||||
break;
|
||||
case FORM_DIREBEAR:
|
||||
@@ -1395,13 +1395,13 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
|
||||
if (AuraEffect const* aurEff = target->GetDummyAuraEffect(SPELLFAMILY_GENERIC, 2851, 0))
|
||||
{
|
||||
int32 bp = aurEff->GetAmount();
|
||||
target->CastCustomSpell(target, 48418, &bp, NULL, NULL, true);
|
||||
target->CastCustomSpell(target, 48418, &bp, nullptr, nullptr, true);
|
||||
}
|
||||
// Survival of the Fittest
|
||||
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DRUID, 961, 0))
|
||||
{
|
||||
int32 bp = aurEff->GetSpellInfo()->Effects[EFFECT_2].CalcValue();
|
||||
target->CastCustomSpell(target, 62069, &bp, NULL, NULL, true, 0, this, target->GetGUID());
|
||||
target->CastCustomSpell(target, 62069, &bp, nullptr, nullptr, true, 0, this, target->GetGUID());
|
||||
}
|
||||
break;
|
||||
case FORM_MOONKIN:
|
||||
@@ -1409,7 +1409,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
|
||||
if (AuraEffect const* aurEff = target->GetDummyAuraEffect(SPELLFAMILY_GENERIC, 2851, 0))
|
||||
{
|
||||
int32 bp = aurEff->GetAmount();
|
||||
target->CastCustomSpell(target, 48421, &bp, NULL, NULL, true);
|
||||
target->CastCustomSpell(target, 48421, &bp, nullptr, nullptr, true);
|
||||
}
|
||||
break;
|
||||
// Master Shapeshifter - Tree of Life
|
||||
@@ -1417,7 +1417,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
|
||||
if (AuraEffect const* aurEff = target->GetDummyAuraEffect(SPELLFAMILY_GENERIC, 2851, 0))
|
||||
{
|
||||
int32 bp = aurEff->GetAmount();
|
||||
target->CastCustomSpell(target, 48422, &bp, NULL, NULL, true);
|
||||
target->CastCustomSpell(target, 48422, &bp, nullptr, nullptr, true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1441,7 +1441,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
|
||||
}
|
||||
|
||||
const Unit::AuraEffectList& shapeshifts = target->GetAuraEffectsByType(SPELL_AURA_MOD_SHAPESHIFT);
|
||||
AuraEffect* newAura = NULL;
|
||||
AuraEffect* newAura = nullptr;
|
||||
// Iterate through all the shapeshift auras that the target has, if there is another aura with SPELL_AURA_MOD_SHAPESHIFT, then this aura is being removed due to that one being applied
|
||||
for (Unit::AuraEffectList::const_iterator itr = shapeshifts.begin(); itr != shapeshifts.end(); ++itr)
|
||||
{
|
||||
@@ -1906,7 +1906,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo
|
||||
{
|
||||
int32 basePoints = int32(std::min(oldPower, FurorChance));
|
||||
target->SetPower(POWER_ENERGY, 0);
|
||||
target->CastCustomSpell(target, 17099, &basePoints, NULL, NULL, true, NULL, this);
|
||||
target->CastCustomSpell(target, 17099, &basePoints, nullptr, nullptr, true, NULL, this);
|
||||
break;
|
||||
}
|
||||
case FORM_BEAR:
|
||||
@@ -2864,7 +2864,7 @@ void AuraEffect::HandleAuraFeatherFall(AuraApplication const* aurApp, uint8 mode
|
||||
|
||||
// start fall from current height
|
||||
if (!apply && target->GetTypeId() == TYPEID_PLAYER)
|
||||
target->ToPlayer()->SetFallInformation(time(NULL), target->GetPositionZ());
|
||||
target->ToPlayer()->SetFallInformation(time(nullptr), target->GetPositionZ());
|
||||
}
|
||||
|
||||
void AuraEffect::HandleAuraHover(AuraApplication const* aurApp, uint8 mode, bool apply) const
|
||||
@@ -5081,7 +5081,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
||||
if( aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE )
|
||||
return;
|
||||
|
||||
Player* player = NULL;
|
||||
Player* player = nullptr;
|
||||
acore::AnyPlayerInObjectRangeCheck checker(target, 10.0f);
|
||||
acore::PlayerSearcher<acore::AnyPlayerInObjectRangeCheck> searcher(target, player, checker);
|
||||
target->VisitNearbyWorldObject(10.0f, searcher);
|
||||
@@ -5137,7 +5137,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
||||
SpellInfo const* spell = sSpellMgr->GetSpellInfo(spellId);
|
||||
|
||||
for (uint32 i = 0; i < spell->StackAmount; ++i)
|
||||
caster->CastSpell(target, spell->Id, true, NULL, NULL, GetCasterGUID());
|
||||
caster->CastSpell(target, spell->Id, true, nullptr, nullptr, GetCasterGUID());
|
||||
break;
|
||||
}
|
||||
target->RemoveAurasDueToSpell(spellId);
|
||||
@@ -5151,7 +5151,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
||||
{
|
||||
SpellInfo const* spell = sSpellMgr->GetSpellInfo(spellId);
|
||||
for (uint32 i = 0; i < spell->StackAmount; ++i)
|
||||
caster->CastSpell(target, spell->Id, true, NULL, NULL, GetCasterGUID());
|
||||
caster->CastSpell(target, spell->Id, true, nullptr, nullptr, GetCasterGUID());
|
||||
break;
|
||||
}
|
||||
target->RemoveAurasDueToSpell(spellId);
|
||||
@@ -5315,7 +5315,7 @@ void AuraEffect::HandleChannelDeathItem(AuraApplication const* aurApp, uint8 mod
|
||||
if (msg != EQUIP_ERR_OK)
|
||||
{
|
||||
count-=noSpaceForCount;
|
||||
plCaster->SendEquipError(msg, NULL, NULL, GetSpellInfo()->Effects[m_effIndex].ItemType);
|
||||
plCaster->SendEquipError(msg, nullptr, nullptr, GetSpellInfo()->Effects[m_effIndex].ItemType);
|
||||
if (count == 0)
|
||||
return;
|
||||
}
|
||||
@@ -5323,7 +5323,7 @@ void AuraEffect::HandleChannelDeathItem(AuraApplication const* aurApp, uint8 mod
|
||||
Item* newitem = plCaster->StoreNewItem(dest, GetSpellInfo()->Effects[m_effIndex].ItemType, true);
|
||||
if (!newitem)
|
||||
{
|
||||
plCaster->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL);
|
||||
plCaster->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, nullptr);
|
||||
return;
|
||||
}
|
||||
plCaster->SendNewItem(newitem, count, true, true);
|
||||
@@ -5477,7 +5477,7 @@ void AuraEffect::HandleAuraLinked(AuraApplication const* aurApp, uint8 mode, boo
|
||||
return;
|
||||
// If amount avalible cast with basepoints (Crypt Fever for example)
|
||||
if (GetAmount())
|
||||
caster->CastCustomSpell(target, triggeredSpellId, &m_amount, NULL, NULL, true, NULL, this);
|
||||
caster->CastCustomSpell(target, triggeredSpellId, &m_amount, nullptr, nullptr, true, NULL, this);
|
||||
else
|
||||
caster->CastSpell(target, triggeredSpellId, true, NULL, this);
|
||||
}
|
||||
@@ -5730,7 +5730,7 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster)
|
||||
uint32 auraId = auraSpellInfo->Id;
|
||||
|
||||
// specific code for cases with no trigger spell provided in field
|
||||
if (triggeredSpellInfo == NULL)
|
||||
if (triggeredSpellInfo == nullptr)
|
||||
{
|
||||
switch (auraSpellInfo->SpellFamilyName)
|
||||
{
|
||||
@@ -5904,7 +5904,7 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster)
|
||||
{
|
||||
// Mana Tide
|
||||
case 16191:
|
||||
target->CastCustomSpell(target, triggerSpellId, &m_amount, NULL, NULL, true, NULL, this);
|
||||
target->CastCustomSpell(target, triggerSpellId, &m_amount, nullptr, nullptr, true, NULL, this);
|
||||
return;
|
||||
// Poison (Grobbulus)
|
||||
case 28158:
|
||||
@@ -5933,14 +5933,14 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster)
|
||||
case 69508:
|
||||
{
|
||||
if (caster)
|
||||
caster->CastSpell(target, triggerSpellId, true, NULL, NULL, caster->GetGUID());
|
||||
caster->CastSpell(target, triggerSpellId, true, nullptr, nullptr, caster->GetGUID());
|
||||
return;
|
||||
}
|
||||
// Trial of the Crusader, Jaraxxus, Spinning Pain Spike
|
||||
case 66283:
|
||||
{
|
||||
const int32 dmg = target->GetMaxHealth()/2;
|
||||
target->CastCustomSpell(target, 66316, &dmg, NULL, NULL, true);
|
||||
target->CastCustomSpell(target, 66316, &dmg, nullptr, nullptr, true);
|
||||
return;
|
||||
}
|
||||
// Violet Hold, Moragg, Ray of Suffering, Ray of Pain
|
||||
@@ -5992,7 +5992,7 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster)
|
||||
case 56654:
|
||||
case 58882:
|
||||
int32 amount = int32(target->GetMaxPower(POWER_MANA) * GetAmount() / 100.0f);
|
||||
target->CastCustomSpell(target, triggerSpellId, &amount, NULL, NULL, true);
|
||||
target->CastCustomSpell(target, triggerSpellId, &amount, nullptr, nullptr, true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -6394,7 +6394,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
|
||||
if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_DRUID && GetSpellInfo()->SpellIconID == 2864)
|
||||
{
|
||||
uint32 tickNumber = GetTickNumber()-1;
|
||||
int32 tempAmount = m_spellInfo->Effects[m_effIndex].CalcValue(caster, &m_baseAmount, NULL);
|
||||
int32 tempAmount = m_spellInfo->Effects[m_effIndex].CalcValue(caster, &m_baseAmount, nullptr);
|
||||
|
||||
float drop = 2.0f;
|
||||
|
||||
@@ -6534,7 +6534,7 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con
|
||||
if (manaFeedVal > 0)
|
||||
{
|
||||
int32 feedAmount = CalculatePct(gainedAmount, manaFeedVal);
|
||||
caster->CastCustomSpell(caster, 32554, &feedAmount, NULL, NULL, true, NULL, this);
|
||||
caster->CastCustomSpell(caster, 32554, &feedAmount, nullptr, nullptr, true, NULL, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6691,7 +6691,7 @@ void AuraEffect::HandleProcTriggerSpellWithValueAuraProc(AuraApplication* aurApp
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleProcTriggerSpellWithValueAuraProc: Triggering spell %u with value %d from aura %u proc", triggeredSpellInfo->Id, basepoints0, GetId());
|
||||
#endif
|
||||
triggerCaster->CastCustomSpell(triggerTarget, triggerSpellId, &basepoints0, NULL, NULL, true, NULL, this);
|
||||
triggerCaster->CastCustomSpell(triggerTarget, triggerSpellId, &basepoints0, nullptr, nullptr, true, NULL, this);
|
||||
}
|
||||
else {
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
@@ -6800,7 +6800,7 @@ void AuraEffect::HandleRaidProcFromChargeWithValueAuraProc(AuraApplication* aurA
|
||||
|
||||
if (Unit* triggerTarget = target->GetNextRandomRaidMemberOrPet(radius))
|
||||
{
|
||||
target->CastCustomSpell(triggerTarget, GetId(), &value, NULL, NULL, true, NULL, this, GetCasterGUID());
|
||||
target->CastCustomSpell(triggerTarget, GetId(), &value, nullptr, nullptr, true, NULL, this, GetCasterGUID());
|
||||
if (Aura* aura = triggerTarget->GetAura(GetId(), GetCasterGUID()))
|
||||
aura->SetCharges(jumps);
|
||||
}
|
||||
@@ -6810,5 +6810,5 @@ void AuraEffect::HandleRaidProcFromChargeWithValueAuraProc(AuraApplication* aurA
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleRaidProcFromChargeWithValueAuraProc: Triggering spell %u from aura %u proc", triggerSpellId, GetId());
|
||||
#endif
|
||||
target->CastCustomSpell(target, triggerSpellId, &value, NULL, NULL, true, NULL, this, GetCasterGUID());
|
||||
target->CastCustomSpell(target, triggerSpellId, &value, nullptr, nullptr, true, NULL, this, GetCasterGUID());
|
||||
}
|
||||
|
||||
@@ -177,8 +177,8 @@ void AuraApplication::_HandleEffect(uint8 effIndex, bool apply)
|
||||
SpellGroupStackFlags sFlag = sSpellMgr->GetGroupStackFlags(groupId);
|
||||
if (!aurEff->IsPeriodic() && (sFlag & SPELL_GROUP_STACK_FLAG_EFFECT_EXCLUSIVE))
|
||||
{
|
||||
AuraApplication* strongestApp = apply ? this : NULL;
|
||||
AuraEffect* strongestEff = apply ? aurEff : NULL;
|
||||
AuraApplication* strongestApp = apply ? this : nullptr;
|
||||
AuraEffect* strongestEff = apply ? aurEff : nullptr;
|
||||
int32 amount = apply ? abs(aurEff->GetAmount()) : 0;
|
||||
Unit* target = GetTarget();
|
||||
Unit::AuraEffectList const& auraList = target->GetAuraEffectsByType(aurEff->GetAuraType());
|
||||
@@ -322,13 +322,13 @@ Aura* Aura::TryRefreshStackOrCreate(SpellInfo const* spellproto, uint8 tryEffMas
|
||||
*refresh = false;
|
||||
uint8 effMask = Aura::BuildEffectMaskForOwner(spellproto, tryEffMask, owner);
|
||||
if (!effMask)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
if (Aura* foundAura = owner->ToUnit()->_TryStackingOrRefreshingExistingAura(spellproto, effMask, caster, baseAmount, castItem, casterGUID, periodicReset))
|
||||
{
|
||||
// we've here aura, which script triggered removal after modding stack amount
|
||||
// check the state here, so we won't create new Aura object
|
||||
if (foundAura->IsRemoved())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
if (refresh)
|
||||
*refresh = true;
|
||||
@@ -346,7 +346,7 @@ Aura* Aura::TryCreate(SpellInfo const* spellproto, uint8 tryEffMask, WorldObject
|
||||
ASSERT(tryEffMask <= MAX_EFFECT_MASK);
|
||||
uint8 effMask = Aura::BuildEffectMaskForOwner(spellproto, tryEffMask, owner);
|
||||
if (!effMask)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return Create(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID);
|
||||
}
|
||||
|
||||
@@ -373,9 +373,9 @@ Aura* Aura::Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owne
|
||||
if (!owner->IsInWorld() || ((Unit*)owner)->IsDuringRemoveFromWorld())
|
||||
// owner not in world so don't allow to own not self casted single target auras
|
||||
if (casterGUID != owner->GetGUID() && spellproto->IsSingleTarget())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
Aura* aura = NULL;
|
||||
Aura* aura = nullptr;
|
||||
switch (owner->GetTypeId())
|
||||
{
|
||||
case TYPEID_UNIT:
|
||||
@@ -387,17 +387,17 @@ Aura* Aura::Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owne
|
||||
break;
|
||||
default:
|
||||
ABORT();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
// aura can be removed in Unit::_AddAura call
|
||||
if (aura->IsRemoved())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return aura;
|
||||
}
|
||||
|
||||
Aura::Aura(SpellInfo const* spellproto, WorldObject* owner, Unit* caster, Item* castItem, uint64 casterGUID) :
|
||||
m_spellInfo(spellproto), m_casterGuid(casterGUID ? casterGUID : caster->GetGUID()),
|
||||
m_castItemGuid(castItem ? castItem->GetGUID() : 0),m_castItemEntry(castItem ? castItem->GetEntry() : 0), m_applyTime(time(NULL)),
|
||||
m_castItemGuid(castItem ? castItem->GetGUID() : 0),m_castItemEntry(castItem ? castItem->GetEntry() : 0), m_applyTime(time(nullptr)),
|
||||
m_owner(owner), m_timeCla(0), m_updateTargetMapInterval(0),
|
||||
m_casterLevel(caster ? caster->getLevel() : m_spellInfo->SpellLevel), m_procCharges(0), m_stackAmount(1),
|
||||
m_isRemoved(false), m_isSingleTarget(false), m_isUsingCharges(false)
|
||||
@@ -418,7 +418,7 @@ AuraScript* Aura::GetScriptByName(std::string const& scriptName) const
|
||||
for (std::list<AuraScript*>::const_iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end(); ++itr)
|
||||
if ((*itr)->_GetScriptName()->compare(scriptName) == 0)
|
||||
return *itr;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Aura::_InitEffects(uint8 effMask, Unit* caster, int32 *baseAmount)
|
||||
@@ -429,7 +429,7 @@ void Aura::_InitEffects(uint8 effMask, Unit* caster, int32 *baseAmount)
|
||||
if (effMask & (uint8(1) << i))
|
||||
m_effects[i] = new AuraEffect(this, i, baseAmount ? baseAmount + i : NULL, caster);
|
||||
else
|
||||
m_effects[i] = NULL;
|
||||
m_effects[i] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -486,7 +486,7 @@ void Aura::_ApplyForTarget(Unit* target, Unit* caster, AuraApplication * auraApp
|
||||
{
|
||||
if (m_spellInfo->IsCooldownStartedOnEvent())
|
||||
{
|
||||
Item* castItem = m_castItemGuid ? caster->ToPlayer()->GetItemByGuid(m_castItemGuid) : NULL;
|
||||
Item* castItem = m_castItemGuid ? caster->ToPlayer()->GetItemByGuid(m_castItemGuid) : nullptr;
|
||||
caster->ToPlayer()->AddSpellAndCategoryCooldowns(m_spellInfo, castItem ? castItem->GetEntry() : 0, NULL, true);
|
||||
}
|
||||
}
|
||||
@@ -728,8 +728,8 @@ void Aura::UpdateOwner(uint32 diff, WorldObject* owner)
|
||||
Unit* caster = GetCaster();
|
||||
// Apply spellmods for channeled auras
|
||||
// used for example when triggered spell of spell:10 is modded
|
||||
Spell* modSpell = NULL;
|
||||
Player* modOwner = NULL;
|
||||
Spell* modSpell = nullptr;
|
||||
Player* modOwner = nullptr;
|
||||
if (caster)
|
||||
{
|
||||
modOwner = caster->GetSpellModOwner();
|
||||
@@ -808,7 +808,7 @@ void Aura::Update(uint32 diff, Unit* caster)
|
||||
|
||||
int32 Aura::CalcMaxDuration(Unit* caster) const
|
||||
{
|
||||
Player* modOwner = NULL;
|
||||
Player* modOwner = nullptr;
|
||||
int32 maxDuration;
|
||||
|
||||
if (caster)
|
||||
@@ -1252,7 +1252,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
if (*itr < 0)
|
||||
target->RemoveAurasDueToSpell(-(*itr));
|
||||
else if (removeMode != AURA_REMOVE_BY_DEATH)
|
||||
target->CastSpell(target, *itr, true, NULL, NULL, GetCasterGUID());
|
||||
target->CastSpell(target, *itr, true, nullptr, nullptr, GetCasterGUID());
|
||||
}
|
||||
}
|
||||
if (std::vector<int32> const* spellTriggered = sSpellMgr->GetSpellLinked(GetId() + SPELL_LINK_AURA))
|
||||
@@ -1382,7 +1382,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, DOT);
|
||||
|
||||
int32 basepoints0 = damage;
|
||||
caster->CastCustomSpell(target, 64801, &basepoints0, NULL, NULL, true, NULL, GetEffect(0));
|
||||
caster->CastCustomSpell(target, 64801, &basepoints0, nullptr, nullptr, true, NULL, GetEffect(0));
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1400,8 +1400,8 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
int32 basepoints0 = aurEff->GetAmount() * GetEffect(0)->GetTotalTicks() * int32(damage) / 100;
|
||||
int32 heal = int32(CalculatePct(basepoints0, 15));
|
||||
|
||||
caster->CastCustomSpell(target, 63675, &basepoints0, NULL, NULL, true, NULL, GetEffect(0));
|
||||
caster->CastCustomSpell(caster, 75999, &heal, NULL, NULL, true, NULL, GetEffect(0));
|
||||
caster->CastCustomSpell(target, 63675, &basepoints0, nullptr, nullptr, true, NULL, GetEffect(0));
|
||||
caster->CastCustomSpell(caster, 75999, &heal, nullptr, nullptr, true, NULL, GetEffect(0));
|
||||
}
|
||||
}
|
||||
// Power Word: Shield
|
||||
@@ -1412,7 +1412,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
{
|
||||
// instantly heal m_amount% of the absorb-value
|
||||
int32 heal = glyph->GetAmount() * GetEffect(0)->GetAmount()/100;
|
||||
caster->CastCustomSpell(GetUnitOwner(), 56160, &heal, NULL, NULL, true, 0, GetEffect(0));
|
||||
caster->CastCustomSpell(GetUnitOwner(), 56160, &heal, nullptr, nullptr, true, 0, GetEffect(0));
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1433,7 +1433,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
if (GetCasterGUID() == target->GetGUID())
|
||||
break;
|
||||
|
||||
AuraEffect* aurEff = NULL;
|
||||
AuraEffect* aurEff = nullptr;
|
||||
// Ebon Plaguebringer / Crypt Fever
|
||||
Unit::AuraEffectList const& TalentAuras = caster->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
|
||||
for (Unit::AuraEffectList::const_iterator itr = TalentAuras.begin(); itr != TalentAuras.end(); ++itr)
|
||||
@@ -1589,7 +1589,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 178, 1))
|
||||
{
|
||||
int32 basepoints0 = aurEff->GetAmount() * caster->GetCreateMana() / 100;
|
||||
caster->CastCustomSpell(caster, 64103, &basepoints0, NULL, NULL, true, NULL, GetEffect(0));
|
||||
caster->CastCustomSpell(caster, 64103, &basepoints0, nullptr, nullptr, true, NULL, GetEffect(0));
|
||||
}
|
||||
}
|
||||
// Power word: shield
|
||||
@@ -1622,7 +1622,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
multiplier += 0.5f;
|
||||
|
||||
int32 basepoints0 = int32(CalculatePct(caster->GetMaxPower(POWER_MANA), multiplier));
|
||||
caster->CastCustomSpell(caster, 47755, &basepoints0, NULL, NULL, true);
|
||||
caster->CastCustomSpell(caster, 47755, &basepoints0, nullptr, nullptr, true);
|
||||
}
|
||||
// effect on aura target
|
||||
if (AuraEffect const* aurEff = aura->GetEffect(1))
|
||||
@@ -1636,7 +1636,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
case POWER_MANA:
|
||||
{
|
||||
int32 basepoints0 = int32(CalculatePct(target->GetMaxPower(POWER_MANA), 2));
|
||||
caster->CastCustomSpell(target, 63654, &basepoints0, NULL, NULL, true);
|
||||
caster->CastCustomSpell(target, 63654, &basepoints0, nullptr, nullptr, true);
|
||||
break;
|
||||
}
|
||||
case POWER_RAGE: triggeredSpellId = 63653; break;
|
||||
@@ -1837,7 +1837,7 @@ bool Aura::IsAuraStronger(Aura const* newAura) const
|
||||
if (!thisEffect)
|
||||
continue;
|
||||
|
||||
AuraEffect* newEffect = NULL;
|
||||
AuraEffect* newEffect = nullptr;
|
||||
for (uint8 j = EFFECT_0; j < MAX_SPELL_EFFECTS; ++j)
|
||||
{
|
||||
newEffect = newAura->GetEffect(j);
|
||||
@@ -1988,7 +1988,7 @@ bool Aura::CanStackWith(Aura const* existingAura, bool remove) const
|
||||
|
||||
if (VehicleAura1 && VehicleAura2)
|
||||
{
|
||||
Vehicle* veh = NULL;
|
||||
Vehicle* veh = nullptr;
|
||||
if (GetOwner()->ToUnit())
|
||||
veh = GetOwner()->ToUnit()->GetVehicleKit();
|
||||
|
||||
@@ -2027,7 +2027,7 @@ bool Aura::IsProcOnCooldown() const
|
||||
{
|
||||
/*if (m_procCooldown)
|
||||
{
|
||||
if (m_procCooldown > time(NULL))
|
||||
if (m_procCooldown > time(nullptr))
|
||||
return true;
|
||||
}*/
|
||||
return false;
|
||||
@@ -2035,7 +2035,7 @@ bool Aura::IsProcOnCooldown() const
|
||||
|
||||
void Aura::AddProcCooldown(uint32 /*msec*/)
|
||||
{
|
||||
//m_procCooldown = time(NULL) + msec;
|
||||
//m_procCooldown = time(nullptr) + msec;
|
||||
}
|
||||
|
||||
void Aura::PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInfo)
|
||||
@@ -2111,7 +2111,7 @@ bool Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventI
|
||||
if (eventInfo.GetDamageInfo())
|
||||
{
|
||||
WeaponAttackType attType = eventInfo.GetDamageInfo()->GetAttackType();
|
||||
Item* item = NULL;
|
||||
Item* item = nullptr;
|
||||
if (attType == BASE_ATTACK)
|
||||
item = target->ToPlayer()->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
|
||||
else if (attType == OFF_ATTACK)
|
||||
|
||||
@@ -171,8 +171,8 @@ class Aura
|
||||
// Helpers for targets
|
||||
ApplicationMap const & GetApplicationMap() {return m_applications;}
|
||||
void GetApplicationList(std::list<AuraApplication*> & applicationList) const;
|
||||
const AuraApplication * GetApplicationOfTarget (uint64 guid) const { ApplicationMap::const_iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return NULL; }
|
||||
AuraApplication * GetApplicationOfTarget (uint64 guid) { ApplicationMap::iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return NULL; }
|
||||
const AuraApplication * GetApplicationOfTarget (uint64 guid) const { ApplicationMap::const_iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return nullptr; }
|
||||
AuraApplication * GetApplicationOfTarget (uint64 guid) { ApplicationMap::iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return nullptr; }
|
||||
bool IsAppliedOnTarget(uint64 guid) const { return m_applications.find(guid) != m_applications.end(); }
|
||||
|
||||
void SetNeedClientUpdateForTargets() const;
|
||||
|
||||
@@ -105,8 +105,8 @@ void SpellDestination::RelocateOffset(Position const& offset)
|
||||
|
||||
SpellCastTargets::SpellCastTargets() : m_elevation(0), m_speed(0), m_strTarget()
|
||||
{
|
||||
m_objectTarget = NULL;
|
||||
m_itemTarget = NULL;
|
||||
m_objectTarget = nullptr;
|
||||
m_itemTarget = nullptr;
|
||||
|
||||
m_objectTargetGUID = 0;
|
||||
m_itemTargetGUID = 0;
|
||||
@@ -230,7 +230,7 @@ Unit* SpellCastTargets::GetUnitTarget() const
|
||||
{
|
||||
if (m_objectTarget)
|
||||
return m_objectTarget->ToUnit();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void SpellCastTargets::SetUnitTarget(Unit* target)
|
||||
@@ -260,7 +260,7 @@ GameObject* SpellCastTargets::GetGOTarget() const
|
||||
{
|
||||
if (m_objectTarget)
|
||||
return m_objectTarget->ToGameObject();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -289,7 +289,7 @@ Corpse* SpellCastTargets::GetCorpseTarget() const
|
||||
{
|
||||
if (m_objectTarget)
|
||||
return m_objectTarget->ToCorpse();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void SpellCastTargets::SetCorpseTarget(Corpse* target)
|
||||
@@ -314,7 +314,7 @@ uint64 SpellCastTargets::GetObjectTargetGUID() const
|
||||
|
||||
void SpellCastTargets::RemoveObjectTarget()
|
||||
{
|
||||
m_objectTarget = NULL;
|
||||
m_objectTarget = nullptr;
|
||||
m_objectTargetGUID = 0LL;
|
||||
m_targetMask &= ~(TARGET_FLAG_UNIT_MASK | TARGET_FLAG_CORPSE_MASK | TARGET_FLAG_GAMEOBJECT_MASK);
|
||||
}
|
||||
@@ -457,7 +457,7 @@ void SpellCastTargets::SetDstChannel(SpellDestination const& spellDest)
|
||||
|
||||
WorldObject* SpellCastTargets::GetObjectTargetChannel(Unit* caster) const
|
||||
{
|
||||
return m_objectTargetGUIDChannel ? ((m_objectTargetGUIDChannel == caster->GetGUID()) ? caster : ObjectAccessor::GetWorldObject(*caster, m_objectTargetGUIDChannel)) : NULL;
|
||||
return m_objectTargetGUIDChannel ? ((m_objectTargetGUIDChannel == caster->GetGUID()) ? caster : ObjectAccessor::GetWorldObject(*caster, m_objectTargetGUIDChannel)) : nullptr;
|
||||
}
|
||||
|
||||
bool SpellCastTargets::HasDstChannel() const
|
||||
@@ -472,9 +472,9 @@ SpellDestination const* SpellCastTargets::GetDstChannel() const
|
||||
|
||||
void SpellCastTargets::Update(Unit* caster)
|
||||
{
|
||||
m_objectTarget = m_objectTargetGUID ? ((m_objectTargetGUID == caster->GetGUID()) ? caster : ObjectAccessor::GetWorldObject(*caster, m_objectTargetGUID)) : NULL;
|
||||
m_objectTarget = m_objectTargetGUID ? ((m_objectTargetGUID == caster->GetGUID()) ? caster : ObjectAccessor::GetWorldObject(*caster, m_objectTargetGUID)) : nullptr;
|
||||
|
||||
m_itemTarget = NULL;
|
||||
m_itemTarget = nullptr;
|
||||
if (caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
Player* player = caster->ToPlayer();
|
||||
@@ -548,7 +548,7 @@ m_caster((info->HasAttribute(SPELL_ATTR6_CAST_BY_CHARMER) && caster->GetCharmerO
|
||||
{
|
||||
m_customError = SPELL_CUSTOM_ERROR_NONE;
|
||||
m_skipCheck = skipCheck;
|
||||
m_selfContainer = NULL;
|
||||
m_selfContainer = nullptr;
|
||||
m_referencedFromCurrentSpell = false;
|
||||
m_executedCurrently = false;
|
||||
m_needComboPoints = m_spellInfo->NeedsComboPoints();
|
||||
@@ -599,7 +599,7 @@ m_caster((info->HasAttribute(SPELL_ATTR6_CAST_BY_CHARMER) && caster->GetCharmerO
|
||||
{
|
||||
m_originalCaster = ObjectAccessor::GetUnit(*m_caster, m_originalCasterGUID);
|
||||
if (m_originalCaster && !m_originalCaster->IsInWorld())
|
||||
m_originalCaster = NULL;
|
||||
m_originalCaster = nullptr;
|
||||
}
|
||||
|
||||
m_spellState = SPELL_STATE_NULL;
|
||||
@@ -607,13 +607,13 @@ m_caster((info->HasAttribute(SPELL_ATTR6_CAST_BY_CHARMER) && caster->GetCharmerO
|
||||
if (info->HasAttribute(SPELL_ATTR4_CAN_CAST_WHILE_CASTING))
|
||||
_triggeredCastFlags = TriggerCastFlags(uint32(_triggeredCastFlags) | TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_CAST_DIRECTLY);
|
||||
|
||||
m_CastItem = NULL;
|
||||
m_CastItem = nullptr;
|
||||
m_castItemGUID = 0;
|
||||
|
||||
unitTarget = NULL;
|
||||
itemTarget = NULL;
|
||||
gameObjTarget = NULL;
|
||||
destTarget = NULL;
|
||||
unitTarget = nullptr;
|
||||
itemTarget = nullptr;
|
||||
gameObjTarget = nullptr;
|
||||
destTarget = nullptr;
|
||||
damage = 0;
|
||||
effectHandleMode = SPELL_EFFECT_HANDLE_LAUNCH;
|
||||
m_diminishLevel = DIMINISHING_LEVEL_1;
|
||||
@@ -623,13 +623,13 @@ m_caster((info->HasAttribute(SPELL_ATTR6_CAST_BY_CHARMER) && caster->GetCharmerO
|
||||
m_procAttacker = 0;
|
||||
m_procVictim = 0;
|
||||
m_procEx = 0;
|
||||
focusObject = NULL;
|
||||
focusObject = nullptr;
|
||||
m_cast_count = 0;
|
||||
m_glyphIndex = 0;
|
||||
m_preCastSpell = 0;
|
||||
m_triggeredByAuraSpell = NULL;
|
||||
m_spellAura = NULL;
|
||||
m_pathFinder = NULL; // pussywizard
|
||||
m_triggeredByAuraSpell = nullptr;
|
||||
m_spellAura = nullptr;
|
||||
m_pathFinder = nullptr; // pussywizard
|
||||
_scriptsLoaded = false;
|
||||
|
||||
//Auto Shot & Shoot (wand)
|
||||
@@ -678,7 +678,7 @@ Spell::~Spell()
|
||||
// Clean the reference to avoid later crash.
|
||||
// If this error is repeating, we may have to add an ASSERT to better track down how we get into this case.
|
||||
sLog->outError("SPELL: deleting spell for spell ID %u. However, spell still referenced.", m_spellInfo->Id);
|
||||
*m_selfContainer = NULL;
|
||||
*m_selfContainer = nullptr;
|
||||
}
|
||||
|
||||
delete m_spellValue;
|
||||
@@ -709,7 +709,7 @@ void Spell::InitExplicitTargets(SpellCastTargets const& targets)
|
||||
// try to select correct unit target if not provided by client or by serverside cast
|
||||
if (neededTargets & (TARGET_FLAG_UNIT_MASK))
|
||||
{
|
||||
Unit* unit = NULL;
|
||||
Unit* unit = nullptr;
|
||||
// try to use player selection as a target
|
||||
if (Player* playerCaster = m_caster->ToPlayer())
|
||||
{
|
||||
@@ -777,7 +777,7 @@ void Spell::SelectExplicitTargets()
|
||||
redirect = m_caster->GetMeleeHitRedirectTarget(target, m_spellInfo);
|
||||
break;
|
||||
default:
|
||||
redirect = NULL;
|
||||
redirect = nullptr;
|
||||
break;
|
||||
}
|
||||
if (redirect && (redirect != target))
|
||||
@@ -1214,7 +1214,7 @@ void Spell::SelectImplicitConeTargets(SpellEffIndex effIndex, SpellImplicitTarge
|
||||
|
||||
void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType, uint32 effMask)
|
||||
{
|
||||
Unit* referer = NULL;
|
||||
Unit* referer = nullptr;
|
||||
switch (targetType.GetReferenceType())
|
||||
{
|
||||
case TARGET_REFERENCE_TYPE_SRC:
|
||||
@@ -1245,7 +1245,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
|
||||
if (!referer)
|
||||
return;
|
||||
|
||||
Position const* center = NULL;
|
||||
Position const* center = nullptr;
|
||||
switch (targetType.GetReferenceType())
|
||||
{
|
||||
case TARGET_REFERENCE_TYPE_SRC:
|
||||
@@ -1698,7 +1698,7 @@ void Spell::SelectImplicitDestDestTargets(SpellEffIndex effIndex, SpellImplicitT
|
||||
|
||||
void Spell::SelectImplicitCasterObjectTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType)
|
||||
{
|
||||
WorldObject* target = NULL;
|
||||
WorldObject* target = nullptr;
|
||||
bool checkIfValid = true;
|
||||
|
||||
switch (targetType.GetTarget())
|
||||
@@ -1994,7 +1994,7 @@ void Spell::SelectEffectTypeImplicitTargets(uint8 effIndex)
|
||||
if (!targetMask)
|
||||
return;
|
||||
|
||||
WorldObject* target = NULL;
|
||||
WorldObject* target = nullptr;
|
||||
|
||||
switch (m_spellInfo->Effects[effIndex].GetImplicitTargetType())
|
||||
{
|
||||
@@ -2117,10 +2117,10 @@ void Spell::SearchTargets(SEARCHER& searcher, uint32 containerMask, Unit* refere
|
||||
|
||||
WorldObject* Spell::SearchNearbyTarget(float range, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectionType, ConditionList* condList)
|
||||
{
|
||||
WorldObject* target = NULL;
|
||||
WorldObject* target = nullptr;
|
||||
uint32 containerTypeMask = GetSearcherTypeMask(objectType, condList);
|
||||
if (!containerTypeMask)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
acore::WorldObjectSpellNearbyTargetCheck check(range, m_caster, m_spellInfo, selectionType, condList);
|
||||
acore::WorldObjectLastSearcher<acore::WorldObjectSpellNearbyTargetCheck> searcher(m_caster, target, check, containerTypeMask);
|
||||
SearchTargets<acore::WorldObjectLastSearcher<acore::WorldObjectSpellNearbyTargetCheck> > (searcher, containerTypeMask, m_caster, m_caster, range);
|
||||
@@ -2577,7 +2577,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
||||
// can't use default call because of threading, do stuff as fast as possible
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (farMask & (1 << i))
|
||||
HandleEffects(effectUnit, NULL, NULL, i, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
HandleEffects(effectUnit, nullptr, nullptr, i, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2608,12 +2608,12 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
||||
m_damage = target->damage;
|
||||
m_healing = -target->damage;
|
||||
|
||||
m_spellAura = NULL; // Set aura to null for every target-make sure that pointer is not used for unit without aura applied
|
||||
m_spellAura = nullptr; // Set aura to null for every target-make sure that pointer is not used for unit without aura applied
|
||||
|
||||
//Spells with this flag cannot trigger if effect is casted on self
|
||||
bool canEffectTrigger = !m_spellInfo->HasAttribute(SPELL_ATTR3_CANT_TRIGGER_PROC) && unitTarget->CanProc() && (CanExecuteTriggersOnHit(mask) || missInfo == SPELL_MISS_IMMUNE2);
|
||||
bool reflectedSpell = missInfo == SPELL_MISS_REFLECT;
|
||||
Unit* spellHitTarget = NULL;
|
||||
Unit* spellHitTarget = nullptr;
|
||||
|
||||
if (missInfo == SPELL_MISS_NONE) // In case spell hit target, do all effect on that target
|
||||
spellHitTarget = unitTarget;
|
||||
@@ -2637,7 +2637,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
||||
if (missInfo2 != SPELL_MISS_MISS)
|
||||
m_caster->SendSpellMiss(spellHitTarget, m_spellInfo->Id, missInfo2);
|
||||
m_damage = 0;
|
||||
spellHitTarget = NULL;
|
||||
spellHitTarget = nullptr;
|
||||
|
||||
// Xinef: if missInfo2 is MISS_EVADE, override base missinfo data
|
||||
if (missInfo2 == SPELL_MISS_EVADE)
|
||||
@@ -2717,7 +2717,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
||||
if (crit)
|
||||
{
|
||||
procEx |= PROC_EX_CRITICAL_HIT;
|
||||
addhealth = Unit::SpellCriticalHealingBonus(caster, m_spellInfo, addhealth, NULL);
|
||||
addhealth = Unit::SpellCriticalHealingBonus(caster, m_spellInfo, addhealth, nullptr);
|
||||
}
|
||||
else
|
||||
procEx |= PROC_EX_NORMAL_HIT;
|
||||
@@ -3118,11 +3118,11 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
|
||||
}
|
||||
|
||||
if (effectMask & (1 << effectNumber))
|
||||
HandleEffects(unit, NULL, NULL, effectNumber, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
HandleEffects(unit, nullptr, nullptr, effectNumber, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
}
|
||||
|
||||
if( sanct_effect >= 0 && (effectMask & (1<<sanct_effect)) )
|
||||
HandleEffects(unit, NULL, NULL, sanct_effect, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
HandleEffects(unit, nullptr, nullptr, sanct_effect, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
|
||||
return SPELL_MISS_NONE;
|
||||
}
|
||||
@@ -3221,7 +3221,7 @@ void Spell::DoAllEffectOnTarget(GOTargetInfo* target)
|
||||
|
||||
for (uint32 effectNumber = 0; effectNumber < MAX_SPELL_EFFECTS; ++effectNumber)
|
||||
if (effectMask & (1 << effectNumber))
|
||||
HandleEffects(NULL, NULL, go, effectNumber, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
HandleEffects(nullptr, NULL, go, effectNumber, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
|
||||
// xinef: inform ai about spellhit
|
||||
go->AI()->SpellHit(m_caster, m_spellInfo);
|
||||
@@ -3242,7 +3242,7 @@ void Spell::DoAllEffectOnTarget(ItemTargetInfo* target)
|
||||
|
||||
for (uint32 effectNumber = 0; effectNumber < MAX_SPELL_EFFECTS; ++effectNumber)
|
||||
if (effectMask & (1 << effectNumber))
|
||||
HandleEffects(NULL, target->item, NULL, effectNumber, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
HandleEffects(nullptr, target->item, NULL, effectNumber, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
|
||||
CallScriptOnHitHandlers();
|
||||
|
||||
@@ -3271,7 +3271,7 @@ bool Spell::UpdateChanneledTargetList()
|
||||
for(int i = EFFECT_0; i <= EFFECT_2; ++i)
|
||||
if (channelAuraMask & (1<<i) && m_spellInfo->Effects[i].RadiusEntry)
|
||||
{
|
||||
range = m_spellInfo->Effects[i].CalcRadius(NULL, NULL);
|
||||
range = m_spellInfo->Effects[i].CalcRadius(nullptr, nullptr);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3600,7 +3600,7 @@ void Spell::cancel(bool bySelf)
|
||||
|
||||
SetReferencedFromCurrent(false);
|
||||
if (m_selfContainer && *m_selfContainer == this)
|
||||
*m_selfContainer = NULL;
|
||||
*m_selfContainer = nullptr;
|
||||
|
||||
m_caster->RemoveDynObject(m_spellInfo->Id);
|
||||
if (m_spellInfo->IsChanneled()) // if not channeled then the object for the current cast wasn't summoned yet
|
||||
@@ -3615,7 +3615,7 @@ void Spell::cancel(bool bySelf)
|
||||
void Spell::cast(bool skipCheck)
|
||||
{
|
||||
Player* modOwner = m_caster->GetSpellModOwner();
|
||||
Spell* lastMod = NULL;
|
||||
Spell* lastMod = nullptr;
|
||||
if (modOwner)
|
||||
{
|
||||
lastMod = modOwner->m_spellModTakingSpell;
|
||||
@@ -3995,7 +3995,7 @@ uint64 Spell::handle_delayed(uint64 t_offset)
|
||||
|
||||
void Spell::_handle_immediate_phase()
|
||||
{
|
||||
m_spellAura = NULL;
|
||||
m_spellAura = nullptr;
|
||||
// initialize Diminishing Returns Data
|
||||
m_diminishLevel = DIMINISHING_LEVEL_1;
|
||||
m_diminishGroup = DIMINISHING_NONE;
|
||||
@@ -4013,7 +4013,7 @@ void Spell::_handle_immediate_phase()
|
||||
continue;
|
||||
|
||||
// call effect handlers to handle destination hit
|
||||
HandleEffects(NULL, NULL, NULL, j, SPELL_EFFECT_HANDLE_HIT);
|
||||
HandleEffects(nullptr, nullptr, nullptr, j, SPELL_EFFECT_HANDLE_HIT);
|
||||
}
|
||||
|
||||
// process items
|
||||
@@ -4757,7 +4757,7 @@ void Spell::SendLogExecute()
|
||||
data.append(*m_effectExecuteData[i]);
|
||||
|
||||
delete m_effectExecuteData[i];
|
||||
m_effectExecuteData[i] = NULL;
|
||||
m_effectExecuteData[i] = nullptr;
|
||||
}
|
||||
m_caster->SendMessageToSet(&data, true);
|
||||
}
|
||||
@@ -4963,9 +4963,9 @@ void Spell::TakeCastItem()
|
||||
|
||||
// prevent crash at access to deleted m_targets.GetItemTarget
|
||||
if (m_CastItem == m_targets.GetItemTarget())
|
||||
m_targets.SetItemTarget(NULL);
|
||||
m_targets.SetItemTarget(nullptr);
|
||||
|
||||
m_CastItem = NULL;
|
||||
m_CastItem = nullptr;
|
||||
m_castItemGUID = 0;
|
||||
}
|
||||
}
|
||||
@@ -5184,7 +5184,7 @@ void Spell::TakeReagents()
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
ItemTemplate const* castItemTemplate = m_CastItem ? m_CastItem->GetTemplate() : NULL;
|
||||
ItemTemplate const* castItemTemplate = m_CastItem ? m_CastItem->GetTemplate() : nullptr;
|
||||
|
||||
// do not take reagents for these item casts
|
||||
if (castItemTemplate && castItemTemplate->Flags & ITEM_FLAG_NO_REAGENT_COST)
|
||||
@@ -5216,13 +5216,13 @@ void Spell::TakeReagents()
|
||||
}
|
||||
}
|
||||
|
||||
m_CastItem = NULL;
|
||||
m_CastItem = nullptr;
|
||||
m_castItemGUID = 0;
|
||||
}
|
||||
|
||||
// if GetItemTarget is also spell reagent
|
||||
if (m_targets.GetItemTargetEntry() == itemid)
|
||||
m_targets.SetItemTarget(NULL);
|
||||
m_targets.SetItemTarget(nullptr);
|
||||
|
||||
p_caster->DestroyItemCount(itemid, itemcount, true);
|
||||
}
|
||||
@@ -5292,7 +5292,7 @@ void Spell::HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGOT
|
||||
#endif
|
||||
|
||||
// we do not need DamageMultiplier here.
|
||||
damage = CalculateSpellDamage(i, NULL);
|
||||
damage = CalculateSpellDamage(i, nullptr);
|
||||
|
||||
bool preventDefault = CallScriptEffectHandlers((SpellEffIndex)i, mode);
|
||||
|
||||
@@ -5439,7 +5439,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
if (instanceScript->IsEncounterInProgress())
|
||||
{
|
||||
if (Group* group = m_caster->ToPlayer()->GetGroup())
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
if (Player* member = itr->GetSource())
|
||||
if (member->IsInMap(m_caster))
|
||||
if (Unit* victim = member->GetVictim())
|
||||
@@ -5599,7 +5599,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
m_caster->GetZoneAndAreaId(zone, area);
|
||||
|
||||
SpellCastResult locRes= m_spellInfo->CheckLocation(m_caster->GetMapId(), zone, area,
|
||||
m_caster->GetTypeId() == TYPEID_PLAYER ? m_caster->ToPlayer() : NULL);
|
||||
m_caster->GetTypeId() == TYPEID_PLAYER ? m_caster->ToPlayer() : nullptr);
|
||||
if (locRes != SPELL_CAST_OK)
|
||||
return locRes;
|
||||
}
|
||||
@@ -5926,7 +5926,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
|| (m_spellInfo->Effects[i].TargetA.GetTarget() == TARGET_GAMEOBJECT_TARGET && !m_targets.GetGOTarget()))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
Item* pTempItem = NULL;
|
||||
Item* pTempItem = nullptr;
|
||||
if (m_targets.GetTargetMask() & TARGET_FLAG_TRADE_ITEM)
|
||||
{
|
||||
if (TradeData* pTrade = m_caster->ToPlayer()->GetTradeData())
|
||||
@@ -5946,7 +5946,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
{
|
||||
if (m_targets.GetGOTarget() && m_targets.GetGOTarget()->GetEntry() == 179697)
|
||||
{
|
||||
if (!m_caster->ToPlayer()->CanUseBattlegroundObject(NULL))
|
||||
if (!m_caster->ToPlayer()->CanUseBattlegroundObject(nullptr))
|
||||
return SPELL_FAILED_TRY_AGAIN;
|
||||
}
|
||||
else if (m_caster->ToPlayer()->InBattleground() && // In Battleground players can use only flags and banners, or Gurubashi chest
|
||||
@@ -6036,7 +6036,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->getClass() == CLASS_WARLOCK && strict)
|
||||
if (Pet* pet = m_caster->ToPlayer()->GetPet())
|
||||
pet->CastSpell(pet, 32752, true, NULL, NULL, pet->GetGUID()); //starting cast, trigger pet stun (cast by pet so it doesn't attack player)
|
||||
pet->CastSpell(pet, 32752, true, nullptr, nullptr, pet->GetGUID()); //starting cast, trigger pet stun (cast by pet so it doesn't attack player)
|
||||
break;
|
||||
}
|
||||
case SPELL_EFFECT_SUMMON_PLAYER:
|
||||
@@ -6051,7 +6051,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
// Xinef: Implement summon pending error
|
||||
if (target->GetSummonExpireTimer() > time(NULL))
|
||||
if (target->GetSummonExpireTimer() > time(nullptr))
|
||||
return SPELL_FAILED_SUMMON_PENDING;
|
||||
|
||||
// check if our map is dungeon
|
||||
@@ -6091,7 +6091,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
// Xinef: Implement summon pending error
|
||||
if (target->GetSummonExpireTimer() > time(NULL))
|
||||
if (target->GetSummonExpireTimer() > time(nullptr))
|
||||
return SPELL_FAILED_SUMMON_PENDING;
|
||||
|
||||
break;
|
||||
@@ -6887,7 +6887,7 @@ SpellCastResult Spell::CheckItems()
|
||||
// TODO: Needs review
|
||||
if (pProto && !(pProto->ItemLimitCategory))
|
||||
{
|
||||
p_caster->SendEquipError(msg, NULL, NULL, m_spellInfo->Effects[i].ItemType);
|
||||
p_caster->SendEquipError(msg, nullptr, nullptr, m_spellInfo->Effects[i].ItemType);
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
}
|
||||
else
|
||||
@@ -6896,7 +6896,7 @@ SpellCastResult Spell::CheckItems()
|
||||
return SPELL_FAILED_TOO_MANY_OF_ITEM;
|
||||
else if (!(target->ToPlayer()->HasItemCount(m_spellInfo->Effects[i].ItemType)))
|
||||
{
|
||||
p_caster->SendEquipError(msg, NULL, NULL, m_spellInfo->Effects[i].ItemType);
|
||||
p_caster->SendEquipError(msg, nullptr, nullptr, m_spellInfo->Effects[i].ItemType);
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
}
|
||||
else
|
||||
@@ -6921,7 +6921,7 @@ SpellCastResult Spell::CheckItems()
|
||||
InventoryResult msg = p_caster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, m_spellInfo->Effects[i].ItemType, 1);
|
||||
if (msg != EQUIP_ERR_OK)
|
||||
{
|
||||
p_caster->SendEquipError(msg, NULL, NULL, m_spellInfo->Effects[i].ItemType);
|
||||
p_caster->SendEquipError(msg, nullptr, nullptr, m_spellInfo->Effects[i].ItemType);
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
}
|
||||
}
|
||||
@@ -7225,7 +7225,7 @@ SpellCastResult Spell::CheckSpellFocus()
|
||||
CellCoord p(acore::ComputeCellCoord(m_caster->GetPositionX(), m_caster->GetPositionY()));
|
||||
Cell cell(p);
|
||||
|
||||
GameObject* ok = NULL;
|
||||
GameObject* ok = nullptr;
|
||||
acore::GameObjectFocusCheck go_check(m_caster, m_spellInfo->RequiresSpellFocus);
|
||||
acore::GameObjectSearcher<acore::GameObjectFocusCheck> checker(m_caster, ok, go_check);
|
||||
|
||||
@@ -7338,7 +7338,7 @@ bool Spell::UpdatePointers()
|
||||
{
|
||||
m_originalCaster = ObjectAccessor::GetUnit(*m_caster, m_originalCasterGUID);
|
||||
if (m_originalCaster && !m_originalCaster->IsInWorld())
|
||||
m_originalCaster = NULL;
|
||||
m_originalCaster = nullptr;
|
||||
}
|
||||
|
||||
if (m_castItemGUID && m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -7349,7 +7349,7 @@ bool Spell::UpdatePointers()
|
||||
return false;
|
||||
}
|
||||
else
|
||||
m_CastItem = NULL;
|
||||
m_CastItem = nullptr;
|
||||
|
||||
m_targets.Update(m_caster);
|
||||
|
||||
@@ -7358,7 +7358,7 @@ bool Spell::UpdatePointers()
|
||||
return true;
|
||||
|
||||
// cache last transport
|
||||
WorldObject* transport = NULL;
|
||||
WorldObject* transport = nullptr;
|
||||
|
||||
// update effect destinations (in case of moved transport dest target)
|
||||
for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex)
|
||||
@@ -7502,7 +7502,7 @@ bool Spell::CheckEffectTarget(Unit const* target, uint32 eff) const
|
||||
|
||||
default: // normal case
|
||||
// Get GO cast coordinates if original caster -> GO
|
||||
WorldObject* caster = NULL;
|
||||
WorldObject* caster = nullptr;
|
||||
if (IS_GAMEOBJECT_GUID(m_originalCasterGUID))
|
||||
caster = m_caster->GetMap()->GetGameObject(m_originalCasterGUID);
|
||||
if (!caster)
|
||||
@@ -7681,7 +7681,7 @@ void Spell::HandleLaunchPhase()
|
||||
if (!m_spellInfo->Effects[i].IsEffect())
|
||||
continue;
|
||||
|
||||
HandleEffects(NULL, NULL, NULL, i, SPELL_EFFECT_HANDLE_LAUNCH);
|
||||
HandleEffects(nullptr, nullptr, nullptr, i, SPELL_EFFECT_HANDLE_LAUNCH);
|
||||
}
|
||||
|
||||
float multiplier[MAX_SPELL_EFFECTS];
|
||||
@@ -7738,7 +7738,7 @@ void Spell::HandleLaunchPhase()
|
||||
|
||||
void Spell::DoAllEffectOnLaunchTarget(TargetInfo& targetInfo, float* multiplier, bool firstTarget)
|
||||
{
|
||||
Unit* unit = NULL;
|
||||
Unit* unit = nullptr;
|
||||
// In case spell hit target, do all effect on that target
|
||||
if (targetInfo.missCondition == SPELL_MISS_NONE)
|
||||
unit = m_caster->GetGUID() == targetInfo.targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, targetInfo.targetGUID);
|
||||
@@ -7756,7 +7756,7 @@ void Spell::DoAllEffectOnLaunchTarget(TargetInfo& targetInfo, float* multiplier,
|
||||
m_damage = 0;
|
||||
m_healing = 0;
|
||||
|
||||
HandleEffects(unit, NULL, NULL, i, SPELL_EFFECT_HANDLE_LAUNCH_TARGET);
|
||||
HandleEffects(unit, nullptr, nullptr, i, SPELL_EFFECT_HANDLE_LAUNCH_TARGET);
|
||||
|
||||
if (m_damage > 0)
|
||||
{
|
||||
@@ -7822,11 +7822,11 @@ void Spell::DoAllEffectOnLaunchTarget(TargetInfo& targetInfo, float* multiplier,
|
||||
int32 basepoints = 0;
|
||||
m_damage = 0;
|
||||
|
||||
HandleEffects(target, NULL, NULL, ssEffect, SPELL_EFFECT_HANDLE_LAUNCH_TARGET);
|
||||
HandleEffects(target, nullptr, nullptr, ssEffect, SPELL_EFFECT_HANDLE_LAUNCH_TARGET);
|
||||
|
||||
basepoints = (targetInfo.crit ? Unit::SpellCriticalDamageBonus(m_caster, m_spellInfo, m_damage, target) : m_damage);
|
||||
m_damage = mdmg;
|
||||
m_caster->CastCustomSpell(target, 26654, &basepoints, NULL, NULL, true);
|
||||
m_caster->CastCustomSpell(target, 26654, &basepoints, nullptr, nullptr, true);
|
||||
|
||||
if (m_spellInfo->Id != 44949)
|
||||
aur->DropCharge();
|
||||
@@ -8273,7 +8273,7 @@ void Spell::PrepareTriggersExecutedOnHit()
|
||||
// this possibly needs fixing
|
||||
int32 auraBaseAmount = (*i)->GetBaseAmount();
|
||||
// proc chance is stored in effect amount
|
||||
int32 chance = m_caster->CalculateSpellDamage(NULL, auraSpellInfo, auraSpellIdx, &auraBaseAmount);
|
||||
int32 chance = m_caster->CalculateSpellDamage(nullptr, auraSpellInfo, auraSpellIdx, &auraBaseAmount);
|
||||
// build trigger and add to the list
|
||||
HitTriggerSpell spellTriggerInfo;
|
||||
spellTriggerInfo.triggeredSpell = spellInfo;
|
||||
@@ -8389,9 +8389,9 @@ WorldObjectSpellTargetCheck::WorldObjectSpellTargetCheck(Unit* caster, Unit* ref
|
||||
_targetSelectionType(selectionType), _condList(condList)
|
||||
{
|
||||
if (condList)
|
||||
_condSrcInfo = new ConditionSourceInfo(NULL, caster);
|
||||
_condSrcInfo = new ConditionSourceInfo(nullptr, caster);
|
||||
else
|
||||
_condSrcInfo = NULL;
|
||||
_condSrcInfo = nullptr;
|
||||
}
|
||||
|
||||
WorldObjectSpellTargetCheck::~WorldObjectSpellTargetCheck()
|
||||
|
||||
@@ -393,11 +393,11 @@ class Spell
|
||||
uint32 GetSearcherTypeMask(SpellTargetObjectTypes objType, ConditionList* condList);
|
||||
template<class SEARCHER> void SearchTargets(SEARCHER& searcher, uint32 containerMask, Unit* referer, Position const* pos, float radius);
|
||||
|
||||
WorldObject* SearchNearbyTarget(float range, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectionType, ConditionList* condList = NULL);
|
||||
WorldObject* SearchNearbyTarget(float range, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectionType, ConditionList* condList = nullptr);
|
||||
void SearchAreaTargets(std::list<WorldObject*>& targets, float range, Position const* position, Unit* referer, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectionType, ConditionList* condList);
|
||||
void SearchChainTargets(std::list<WorldObject*>& targets, uint32 chainTargets, WorldObject* target, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectType, SpellTargetSelectionCategories selectCategory, ConditionList* condList, bool isChainHeal);
|
||||
|
||||
void prepare(SpellCastTargets const* targets, AuraEffect const* triggeredByAura = NULL);
|
||||
void prepare(SpellCastTargets const* targets, AuraEffect const* triggeredByAura = nullptr);
|
||||
void cancel(bool bySelf = false);
|
||||
void update(uint32 difftime);
|
||||
void cast(bool skipCheck = false);
|
||||
@@ -691,7 +691,7 @@ class Spell
|
||||
int32 chance;
|
||||
};
|
||||
|
||||
bool CanExecuteTriggersOnHit(uint8 effMask, SpellInfo const* triggeredByAura = NULL) const;
|
||||
bool CanExecuteTriggersOnHit(uint8 effMask, SpellInfo const* triggeredByAura = nullptr) const;
|
||||
void PrepareTriggersExecutedOnHit();
|
||||
typedef std::list<HitTriggerSpell> HitTriggerSpellList;
|
||||
HitTriggerSpellList m_hitTriggerSpells;
|
||||
|
||||
@@ -410,7 +410,7 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
|
||||
// Conflagrate - consumes Immolate or Shadowflame
|
||||
else if (m_spellInfo->TargetAuraState == AURA_STATE_CONFLAGRATE)
|
||||
{
|
||||
AuraEffect const* aura = NULL; // found req. aura for damage calculation
|
||||
AuraEffect const* aura = nullptr; // found req. aura for damage calculation
|
||||
|
||||
Unit::AuraEffectList const &mPeriodic = unitTarget->GetAuraEffectsByType(SPELL_AURA_PERIODIC_DAMAGE);
|
||||
for (Unit::AuraEffectList::const_iterator i = mPeriodic.begin(); i != mPeriodic.end(); ++i)
|
||||
@@ -463,7 +463,7 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
|
||||
if (AuraEffect* aurEff = owner->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARLOCK, 214, 0))
|
||||
{
|
||||
int32 bp0 = aurEff->GetId() == 54037 ? 4 : 8;
|
||||
m_caster->CastCustomSpell(m_caster, 54425, &bp0, NULL, NULL, true);
|
||||
m_caster->CastCustomSpell(m_caster, 54425, &bp0, nullptr, nullptr, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -706,7 +706,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
case 17731:
|
||||
case 69294:
|
||||
{
|
||||
if( !gameObjTarget || gameObjTarget->GetRespawnTime() > time(NULL) )
|
||||
if( !gameObjTarget || gameObjTarget->GetRespawnTime() > time(nullptr) )
|
||||
return;
|
||||
|
||||
gameObjTarget->SetRespawnTime(10);
|
||||
@@ -963,7 +963,7 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex)
|
||||
m_caster->ToPlayer()->RemoveSpellCooldown(spellInfo->Id);
|
||||
|
||||
// original caster guid only for GO cast
|
||||
m_caster->CastSpell(targets, spellInfo, &values, TriggerCastFlags(TRIGGERED_FULL_MASK&~TRIGGERED_NO_PERIODIC_RESET), NULL, NULL, m_originalCasterGUID);
|
||||
m_caster->CastSpell(targets, spellInfo, &values, TriggerCastFlags(TRIGGERED_FULL_MASK&~TRIGGERED_NO_PERIODIC_RESET), nullptr, nullptr, m_originalCasterGUID);
|
||||
}
|
||||
|
||||
void Spell::EffectTriggerMissileSpell(SpellEffIndex effIndex)
|
||||
@@ -1018,7 +1018,7 @@ void Spell::EffectTriggerMissileSpell(SpellEffIndex effIndex)
|
||||
m_caster->ToPlayer()->RemoveSpellCooldown(spellInfo->Id);
|
||||
|
||||
// original caster guid only for GO cast
|
||||
m_caster->CastSpell(targets, spellInfo, &values, TRIGGERED_FULL_MASK, NULL, NULL, m_originalCasterGUID);
|
||||
m_caster->CastSpell(targets, spellInfo, &values, TRIGGERED_FULL_MASK, nullptr, nullptr, m_originalCasterGUID);
|
||||
}
|
||||
|
||||
void Spell::EffectForceCast(SpellEffIndex effIndex)
|
||||
@@ -1050,7 +1050,7 @@ void Spell::EffectForceCast(SpellEffIndex effIndex)
|
||||
break;
|
||||
case 52463: // Hide In Mine Car
|
||||
case 52349: // Overtake
|
||||
unitTarget->CastCustomSpell(unitTarget, spellInfo->Id, &damage, NULL, NULL, true, NULL, NULL, m_originalCasterGUID);
|
||||
unitTarget->CastCustomSpell(unitTarget, spellInfo->Id, &damage, nullptr, nullptr, true, nullptr, nullptr, m_originalCasterGUID);
|
||||
return;
|
||||
case 72378: // Blood Nova
|
||||
case 73058: // Blood Nova
|
||||
@@ -1405,7 +1405,7 @@ void Spell::EffectSendEvent(SpellEffIndex effIndex)
|
||||
&& effectHandleMode != SPELL_EFFECT_HANDLE_HIT)
|
||||
return;
|
||||
|
||||
WorldObject* target = NULL;
|
||||
WorldObject* target = nullptr;
|
||||
|
||||
// call events for object target if present
|
||||
if (effectHandleMode == SPELL_EFFECT_HANDLE_HIT_TARGET)
|
||||
@@ -1524,8 +1524,8 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit::AuraEffectList const& RejorRegr = unitTarget->GetAuraEffectsByType(SPELL_AURA_PERIODIC_HEAL);
|
||||
// find most short by duration
|
||||
AuraEffect* forcedTargetAura = NULL;
|
||||
AuraEffect* targetAura = NULL;
|
||||
AuraEffect* forcedTargetAura = nullptr;
|
||||
AuraEffect* targetAura = nullptr;
|
||||
for (Unit::AuraEffectList::const_iterator i = RejorRegr.begin(); i != RejorRegr.end(); ++i)
|
||||
{
|
||||
if ((*i)->GetSpellInfo()->SpellFamilyName == SPELLFAMILY_DRUID
|
||||
@@ -1668,7 +1668,7 @@ void Spell::DoCreateItem(uint8 /*effIndex*/, uint32 itemId)
|
||||
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(newitemid);
|
||||
if (!pProto)
|
||||
{
|
||||
player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL);
|
||||
player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1750,7 +1750,7 @@ void Spell::DoCreateItem(uint8 /*effIndex*/, uint32 itemId)
|
||||
else
|
||||
{
|
||||
// if not created by another reason from full inventory or unique items amount limitation
|
||||
player->SendEquipError(msg, NULL, NULL, newitemid);
|
||||
player->SendEquipError(msg, nullptr, nullptr, newitemid);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1763,7 +1763,7 @@ void Spell::DoCreateItem(uint8 /*effIndex*/, uint32 itemId)
|
||||
// was it successful? return error if not
|
||||
if (!pItem)
|
||||
{
|
||||
player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL);
|
||||
player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2243,9 +2243,9 @@ void Spell::EffectSummonChangeItem(SpellEffIndex effIndex)
|
||||
|
||||
// prevent crash at access and unexpected charges counting with item update queue corrupt
|
||||
if (m_CastItem == m_targets.GetItemTarget())
|
||||
m_targets.SetItemTarget(NULL);
|
||||
m_targets.SetItemTarget(nullptr);
|
||||
|
||||
m_CastItem = NULL;
|
||||
m_CastItem = nullptr;
|
||||
m_castItemGUID = 0;
|
||||
|
||||
player->StoreItem(dest, pNewItem, true);
|
||||
@@ -2263,9 +2263,9 @@ void Spell::EffectSummonChangeItem(SpellEffIndex effIndex)
|
||||
|
||||
// prevent crash at access and unexpected charges counting with item update queue corrupt
|
||||
if (m_CastItem == m_targets.GetItemTarget())
|
||||
m_targets.SetItemTarget(NULL);
|
||||
m_targets.SetItemTarget(nullptr);
|
||||
|
||||
m_CastItem = NULL;
|
||||
m_CastItem = nullptr;
|
||||
m_castItemGUID = 0;
|
||||
|
||||
player->BankItem(dest, pNewItem, true);
|
||||
@@ -2286,9 +2286,9 @@ void Spell::EffectSummonChangeItem(SpellEffIndex effIndex)
|
||||
|
||||
// prevent crash at access and unexpected charges counting with item update queue corrupt
|
||||
if (m_CastItem == m_targets.GetItemTarget())
|
||||
m_targets.SetItemTarget(NULL);
|
||||
m_targets.SetItemTarget(nullptr);
|
||||
|
||||
m_CastItem = NULL;
|
||||
m_CastItem = nullptr;
|
||||
m_castItemGUID = 0;
|
||||
|
||||
player->EquipItem(dest, pNewItem, true);
|
||||
@@ -2346,7 +2346,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
|
||||
if (Player* modOwner = m_originalCaster->GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration);
|
||||
|
||||
TempSummon* summon = NULL;
|
||||
TempSummon* summon = nullptr;
|
||||
|
||||
// determine how many units should be summoned
|
||||
uint32 numSummons;
|
||||
@@ -2657,11 +2657,11 @@ void Spell::EffectDispel(SpellEffIndex effIndex)
|
||||
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->GetCategory() == SPELLCATEGORY_DEVOUR_MAGIC)
|
||||
{
|
||||
int32 heal_amount = m_spellInfo->Effects[EFFECT_1].CalcValue();
|
||||
m_caster->CastCustomSpell(m_caster, 19658, &heal_amount, NULL, NULL, true);
|
||||
m_caster->CastCustomSpell(m_caster, 19658, &heal_amount, nullptr, nullptr, true);
|
||||
// Glyph of Felhunter
|
||||
if (Unit* owner = m_caster->GetOwner())
|
||||
if (owner->GetAura(56249))
|
||||
owner->CastCustomSpell(owner, 19658, &heal_amount, NULL, NULL, true);
|
||||
owner->CastCustomSpell(owner, 19658, &heal_amount, nullptr, nullptr, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2799,7 +2799,7 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/)
|
||||
// not scale value for item based reward (/10 value expected)
|
||||
if (m_CastItem)
|
||||
{
|
||||
unitTarget->ToPlayer()->RewardHonor(NULL, 1, damage/10, false);
|
||||
unitTarget->ToPlayer()->RewardHonor(nullptr, 1, damage/10, false);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %d honor points (item %u) for player: %u", m_spellInfo->Id, damage/10, m_CastItem->GetEntry(), unitTarget->ToPlayer()->GetGUIDLow());
|
||||
#endif
|
||||
@@ -2810,7 +2810,7 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/)
|
||||
if (damage <= 50)
|
||||
{
|
||||
uint32 honor_reward = acore::Honor::hk_honor_at_level(unitTarget->getLevel(), float(damage));
|
||||
unitTarget->ToPlayer()->RewardHonor(NULL, 1, honor_reward, false);
|
||||
unitTarget->ToPlayer()->RewardHonor(nullptr, 1, honor_reward, false);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %u honor points (scale) to player: %u", m_spellInfo->Id, honor_reward, unitTarget->ToPlayer()->GetGUIDLow());
|
||||
#endif
|
||||
@@ -2818,7 +2818,7 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/)
|
||||
else
|
||||
{
|
||||
//maybe we have correct honor_gain in damage already
|
||||
unitTarget->ToPlayer()->RewardHonor(NULL, 1, damage, false);
|
||||
unitTarget->ToPlayer()->RewardHonor(nullptr, 1, damage, false);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %u honor points (non scale) for player: %u", m_spellInfo->Id, damage, unitTarget->ToPlayer()->GetGUIDLow());
|
||||
#endif
|
||||
@@ -2859,7 +2859,7 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex)
|
||||
// and add a scroll
|
||||
DoCreateItem(effIndex, m_spellInfo->Effects[effIndex].ItemType);
|
||||
itemTarget=NULL;
|
||||
m_targets.SetItemTarget(NULL);
|
||||
m_targets.SetItemTarget(nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3757,7 +3757,7 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex)
|
||||
else
|
||||
{
|
||||
delete linkedGO;
|
||||
linkedGO = NULL;
|
||||
linkedGO = nullptr;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -3789,7 +3789,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
||||
|
||||
uint32 spell_id = roll_chance_i(20) ? 8854 : 8855;
|
||||
|
||||
m_caster->CastSpell(m_caster, spell_id, true, NULL);
|
||||
m_caster->CastSpell(m_caster, spell_id, true, nullptr);
|
||||
return;
|
||||
}
|
||||
// Brittle Armor - need remove one 24575 Brittle Armor aura
|
||||
@@ -3886,7 +3886,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
||||
|
||||
uint8 bag = 19;
|
||||
uint8 slot = 0;
|
||||
Item* item = NULL;
|
||||
Item* item = nullptr;
|
||||
|
||||
while (bag) // 256 = 0 due to var type
|
||||
{
|
||||
@@ -3930,7 +3930,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
||||
if (m_caster->getGender() > 0)
|
||||
gender = "her";
|
||||
sprintf(buf, "%s rubs %s [Decahedral Dwarven Dice] between %s hands and rolls. One %u and one %u.", m_caster->GetName().c_str(), gender, gender, urand(1, 10), urand(1, 10));
|
||||
m_caster->MonsterTextEmote(buf, NULL);
|
||||
m_caster->MonsterTextEmote(buf, nullptr);
|
||||
break;
|
||||
}
|
||||
// Roll 'dem Bones - Worn Troll Dice
|
||||
@@ -3941,7 +3941,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
||||
if (m_caster->getGender() > 0)
|
||||
gender = "her";
|
||||
sprintf(buf, "%s causually tosses %s [Worn Troll Dice]. One %u and one %u.", m_caster->GetName().c_str(), gender, urand(1, 6), urand(1, 6));
|
||||
m_caster->MonsterTextEmote(buf, NULL);
|
||||
m_caster->MonsterTextEmote(buf, nullptr);
|
||||
break;
|
||||
}
|
||||
// Death Knight Initiate Visual
|
||||
@@ -4069,7 +4069,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
||||
// proc a spellcast
|
||||
if (Aura* chargesAura = m_caster->GetAura(59907))
|
||||
{
|
||||
m_caster->CastSpell(unitTarget, spell_heal, true, NULL, NULL, m_caster->ToTempSummon()->GetSummonerGUID());
|
||||
m_caster->CastSpell(unitTarget, spell_heal, true, nullptr, nullptr, m_caster->ToTempSummon()->GetSummonerGUID());
|
||||
if (chargesAura->ModCharges(-1))
|
||||
m_caster->ToTempSummon()->UnSummon();
|
||||
}
|
||||
@@ -4098,14 +4098,14 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
||||
Creature* totem = unitTarget->GetMap()->GetCreature(unitTarget->m_SummonSlot[slot]);
|
||||
if (totem && totem->IsTotem())
|
||||
{
|
||||
m_caster->CastCustomSpell(totem, 55277, &basepoints0, NULL, NULL, true);
|
||||
m_caster->CastCustomSpell(totem, 55277, &basepoints0, nullptr, nullptr, true);
|
||||
}
|
||||
}
|
||||
// Glyph of Stoneclaw Totem
|
||||
if (AuraEffect* aur=unitTarget->GetAuraEffect(63298, 0))
|
||||
{
|
||||
basepoints0 *= aur->GetAmount();
|
||||
m_caster->CastCustomSpell(unitTarget, 55277, &basepoints0, NULL, NULL, true);
|
||||
m_caster->CastCustomSpell(unitTarget, 55277, &basepoints0, nullptr, nullptr, true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -4610,7 +4610,7 @@ void Spell::EffectFeedPet(SpellEffIndex effIndex)
|
||||
player->DestroyItemCount(foodItem, count, true);
|
||||
// TODO: fix crash when a spell has two effects, both pointed at the same item target
|
||||
|
||||
m_caster->CastCustomSpell(pet, m_spellInfo->Effects[effIndex].TriggerSpell, &benefit, NULL, NULL, true);
|
||||
m_caster->CastCustomSpell(pet, m_spellInfo->Effects[effIndex].TriggerSpell, &benefit, nullptr, nullptr, true);
|
||||
}
|
||||
|
||||
void Spell::EffectDismissPet(SpellEffIndex effIndex)
|
||||
@@ -4961,7 +4961,7 @@ void Spell::EffectCharge(SpellEffIndex /*effIndex*/)
|
||||
|
||||
// charge changes fall time
|
||||
if( m_caster->GetTypeId() == TYPEID_PLAYER )
|
||||
m_caster->ToPlayer()->SetFallInformation(time(NULL), m_caster->GetPositionZ());
|
||||
m_caster->ToPlayer()->SetFallInformation(time(nullptr), m_caster->GetPositionZ());
|
||||
|
||||
if (m_pathFinder)
|
||||
{
|
||||
@@ -5082,7 +5082,7 @@ void Spell::EffectLeapBack(SpellEffIndex effIndex)
|
||||
|
||||
// xinef: changes fall time
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
m_caster->ToPlayer()->SetFallInformation(time(NULL), m_caster->GetPositionZ());
|
||||
m_caster->ToPlayer()->SetFallInformation(time(nullptr), m_caster->GetPositionZ());
|
||||
}
|
||||
|
||||
void Spell::EffectQuestClear(SpellEffIndex effIndex)
|
||||
@@ -5268,7 +5268,7 @@ void Spell::EffectDestroyAllTotems(SpellEffIndex /*effIndex*/)
|
||||
}
|
||||
ApplyPct(mana, damage);
|
||||
if (mana)
|
||||
m_caster->CastCustomSpell(m_caster, 39104, &mana, NULL, NULL, true);
|
||||
m_caster->CastCustomSpell(m_caster, 39104, &mana, nullptr, nullptr, true);
|
||||
}
|
||||
|
||||
void Spell::EffectDurabilityDamage(SpellEffIndex effIndex)
|
||||
@@ -5471,7 +5471,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
|
||||
else
|
||||
{
|
||||
delete linkedGO;
|
||||
linkedGO = NULL;
|
||||
linkedGO = nullptr;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -5968,7 +5968,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const*
|
||||
|
||||
//TempSummonType summonType = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN;
|
||||
Map* map = caster->GetMap();
|
||||
TempSummon* summon = NULL;
|
||||
TempSummon* summon = nullptr;
|
||||
|
||||
for (uint32 count = 0; count < numGuardians; ++count)
|
||||
{
|
||||
@@ -6184,7 +6184,7 @@ void Spell::EffectRechargeManaGem(SpellEffIndex /*effIndex*/)
|
||||
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(item_id);
|
||||
if (!pProto)
|
||||
{
|
||||
player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL);
|
||||
player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -329,12 +329,12 @@ SpellEffectInfo::SpellEffectInfo(SpellEntry const* spellEntry, SpellInfo const*
|
||||
Mechanic = Mechanics(spellEntry->EffectMechanic[effIndex]);
|
||||
TargetA = SpellImplicitTargetInfo(spellEntry->EffectImplicitTargetA[effIndex]);
|
||||
TargetB = SpellImplicitTargetInfo(spellEntry->EffectImplicitTargetB[effIndex]);
|
||||
RadiusEntry = spellEntry->EffectRadiusIndex[effIndex] ? sSpellRadiusStore.LookupEntry(spellEntry->EffectRadiusIndex[effIndex]) : NULL;
|
||||
RadiusEntry = spellEntry->EffectRadiusIndex[effIndex] ? sSpellRadiusStore.LookupEntry(spellEntry->EffectRadiusIndex[effIndex]) : nullptr;
|
||||
ChainTarget = spellEntry->EffectChainTarget[effIndex];
|
||||
ItemType = spellEntry->EffectItemType[effIndex];
|
||||
TriggerSpell = spellEntry->EffectTriggerSpell[effIndex];
|
||||
SpellClassMask = spellEntry->EffectSpellClassMask[effIndex];
|
||||
ImplicitTargetConditions = NULL;
|
||||
ImplicitTargetConditions = nullptr;
|
||||
}
|
||||
|
||||
bool SpellEffectInfo::IsEffect() const
|
||||
@@ -509,7 +509,7 @@ int32 SpellEffectInfo::CalcBaseValue(int32 value) const
|
||||
float SpellEffectInfo::CalcValueMultiplier(Unit* caster, Spell* spell) const
|
||||
{
|
||||
float multiplier = ValueMultiplier;
|
||||
if (Player* modOwner = (caster ? caster->GetSpellModOwner() : NULL))
|
||||
if (Player* modOwner = (caster ? caster->GetSpellModOwner() : nullptr))
|
||||
modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_VALUE_MULTIPLIER, multiplier, spell);
|
||||
return multiplier;
|
||||
}
|
||||
@@ -517,14 +517,14 @@ float SpellEffectInfo::CalcValueMultiplier(Unit* caster, Spell* spell) const
|
||||
float SpellEffectInfo::CalcDamageMultiplier(Unit* caster, Spell* spell) const
|
||||
{
|
||||
float multiplier = DamageMultiplier;
|
||||
if (Player* modOwner = (caster ? caster->GetSpellModOwner() : NULL))
|
||||
if (Player* modOwner = (caster ? caster->GetSpellModOwner() : nullptr))
|
||||
modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_DAMAGE_MULTIPLIER, multiplier, spell);
|
||||
return multiplier;
|
||||
}
|
||||
|
||||
bool SpellEffectInfo::HasRadius() const
|
||||
{
|
||||
return RadiusEntry != NULL;
|
||||
return RadiusEntry != nullptr;
|
||||
}
|
||||
|
||||
float SpellEffectInfo::CalcRadius(Unit* caster, Spell* spell) const
|
||||
@@ -756,7 +756,7 @@ SpellEffectInfo::StaticData SpellEffectInfo::_data[TOTAL_SPELL_EFFECTS] =
|
||||
SpellInfo::SpellInfo(SpellEntry const* spellEntry)
|
||||
{
|
||||
Id = spellEntry->Id;
|
||||
CategoryEntry = spellEntry->Category ? sSpellCategoryStore.LookupEntry(spellEntry->Category) : NULL;
|
||||
CategoryEntry = spellEntry->Category ? sSpellCategoryStore.LookupEntry(spellEntry->Category) : nullptr;
|
||||
Dispel = spellEntry->Dispel;
|
||||
Mechanic = spellEntry->Mechanic;
|
||||
Attributes = spellEntry->Attributes;
|
||||
@@ -782,7 +782,7 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry)
|
||||
TargetAuraSpell = spellEntry->targetAuraSpell;
|
||||
ExcludeCasterAuraSpell = spellEntry->excludeCasterAuraSpell;
|
||||
ExcludeTargetAuraSpell = spellEntry->excludeTargetAuraSpell;
|
||||
CastTimeEntry = spellEntry->CastingTimeIndex ? sSpellCastTimesStore.LookupEntry(spellEntry->CastingTimeIndex) : NULL;
|
||||
CastTimeEntry = spellEntry->CastingTimeIndex ? sSpellCastTimesStore.LookupEntry(spellEntry->CastingTimeIndex) : nullptr;
|
||||
RecoveryTime = spellEntry->RecoveryTime;
|
||||
CategoryRecoveryTime = spellEntry->CategoryRecoveryTime;
|
||||
StartRecoveryCategory = spellEntry->StartRecoveryCategory;
|
||||
@@ -796,7 +796,7 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry)
|
||||
MaxLevel = spellEntry->maxLevel;
|
||||
BaseLevel = spellEntry->baseLevel;
|
||||
SpellLevel = spellEntry->spellLevel;
|
||||
DurationEntry = spellEntry->DurationIndex ? sSpellDurationStore.LookupEntry(spellEntry->DurationIndex) : NULL;
|
||||
DurationEntry = spellEntry->DurationIndex ? sSpellDurationStore.LookupEntry(spellEntry->DurationIndex) : nullptr;
|
||||
PowerType = spellEntry->powerType;
|
||||
ManaCost = spellEntry->manaCost;
|
||||
ManaCostPerlevel = spellEntry->manaCostPerlevel;
|
||||
@@ -804,7 +804,7 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry)
|
||||
ManaPerSecondPerLevel = spellEntry->manaPerSecondPerLevel;
|
||||
ManaCostPercentage = spellEntry->ManaCostPercentage;
|
||||
RuneCostID = spellEntry->runeCostID;
|
||||
RangeEntry = spellEntry->rangeIndex ? sSpellRangeStore.LookupEntry(spellEntry->rangeIndex) : NULL;
|
||||
RangeEntry = spellEntry->rangeIndex ? sSpellRangeStore.LookupEntry(spellEntry->rangeIndex) : nullptr;
|
||||
Speed = spellEntry->speed;
|
||||
StackAmount = spellEntry->StackAmount;
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
@@ -837,7 +837,7 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry)
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
Effects[i] = SpellEffectInfo(spellEntry, this, i);
|
||||
ExplicitTargetMask = _GetExplicitTargetMask();
|
||||
ChainEntry = NULL;
|
||||
ChainEntry = nullptr;
|
||||
|
||||
// Mine
|
||||
_isStackableWithRanks = false;
|
||||
@@ -1404,7 +1404,7 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const
|
||||
return SPELL_CAST_OK;
|
||||
|
||||
bool actAsShifted = false;
|
||||
SpellShapeshiftEntry const* shapeInfo = NULL;
|
||||
SpellShapeshiftEntry const* shapeInfo = nullptr;
|
||||
if (form > 0)
|
||||
{
|
||||
shapeInfo = sSpellShapeshiftStore.LookupEntry(form);
|
||||
@@ -2420,7 +2420,7 @@ int32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask, S
|
||||
|
||||
bool SpellInfo::IsRanked() const
|
||||
{
|
||||
return ChainEntry != NULL;
|
||||
return ChainEntry != nullptr;
|
||||
}
|
||||
|
||||
uint8 SpellInfo::GetRank() const
|
||||
@@ -2439,19 +2439,19 @@ SpellInfo const* SpellInfo::GetFirstRankSpell() const
|
||||
SpellInfo const* SpellInfo::GetLastRankSpell() const
|
||||
{
|
||||
if (!ChainEntry)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return ChainEntry->last;
|
||||
}
|
||||
SpellInfo const* SpellInfo::GetNextRankSpell() const
|
||||
{
|
||||
if (!ChainEntry)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return ChainEntry->next;
|
||||
}
|
||||
SpellInfo const* SpellInfo::GetPrevRankSpell() const
|
||||
{
|
||||
if (!ChainEntry)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return ChainEntry->prev;
|
||||
}
|
||||
|
||||
@@ -2478,7 +2478,7 @@ SpellInfo const* SpellInfo::GetAuraRankForLevel(uint8 level) const
|
||||
if (!needRankSelection)
|
||||
return this;
|
||||
|
||||
for (SpellInfo const* nextSpellInfo = this; nextSpellInfo != NULL; nextSpellInfo = nextSpellInfo->GetPrevRankSpell())
|
||||
for (SpellInfo const* nextSpellInfo = this; nextSpellInfo != nullptr; nextSpellInfo = nextSpellInfo->GetPrevRankSpell())
|
||||
{
|
||||
// if found appropriate level
|
||||
if (uint32(level + 10) >= nextSpellInfo->SpellLevel)
|
||||
@@ -2488,7 +2488,7 @@ SpellInfo const* SpellInfo::GetAuraRankForLevel(uint8 level) const
|
||||
}
|
||||
|
||||
// not found
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool SpellInfo::IsRankOf(SpellInfo const* spellInfo) const
|
||||
@@ -2804,7 +2804,7 @@ void SpellInfo::_UnloadImplicitTargetConditionLists()
|
||||
for (uint8 j = i; j < MAX_SPELL_EFFECTS; ++j)
|
||||
{
|
||||
if (Effects[j].ImplicitTargetConditions == cur)
|
||||
Effects[j].ImplicitTargetConditions = NULL;
|
||||
Effects[j].ImplicitTargetConditions = nullptr;
|
||||
}
|
||||
delete cur;
|
||||
}
|
||||
|
||||
@@ -254,10 +254,10 @@ public:
|
||||
flag96 SpellClassMask;
|
||||
std::list<Condition*>* ImplicitTargetConditions;
|
||||
|
||||
SpellEffectInfo() : _spellInfo(NULL), _effIndex(0), Effect(0), ApplyAuraName(0), Amplitude(0), DieSides(0),
|
||||
SpellEffectInfo() : _spellInfo(nullptr), _effIndex(0), Effect(0), ApplyAuraName(0), Amplitude(0), DieSides(0),
|
||||
RealPointsPerLevel(0), BasePoints(0), PointsPerComboPoint(0), ValueMultiplier(0), DamageMultiplier(0),
|
||||
BonusMultiplier(0), MiscValue(0), MiscValueB(0), Mechanic(MECHANIC_NONE), RadiusEntry(NULL), ChainTarget(0),
|
||||
ItemType(0), TriggerSpell(0), ImplicitTargetConditions(NULL) {}
|
||||
BonusMultiplier(0), MiscValue(0), MiscValueB(0), Mechanic(MECHANIC_NONE), RadiusEntry(nullptr), ChainTarget(0),
|
||||
ItemType(0), TriggerSpell(0), ImplicitTargetConditions(nullptr) {}
|
||||
SpellEffectInfo(SpellEntry const* spellEntry, SpellInfo const* spellInfo, uint8 effIndex);
|
||||
|
||||
bool IsEffect() const;
|
||||
@@ -270,13 +270,13 @@ public:
|
||||
bool IsFarDestTargetEffect() const;
|
||||
bool IsUnitOwnedAuraEffect() const;
|
||||
|
||||
int32 CalcValue(Unit const* caster = NULL, int32 const* basePoints = NULL, Unit const* target = NULL) const;
|
||||
int32 CalcValue(Unit const* caster = NULL, int32 const* basePoints = NULL, Unit const* target = nullptr) const;
|
||||
int32 CalcBaseValue(int32 value) const;
|
||||
float CalcValueMultiplier(Unit* caster, Spell* spell = NULL) const;
|
||||
float CalcDamageMultiplier(Unit* caster, Spell* spell = NULL) const;
|
||||
float CalcValueMultiplier(Unit* caster, Spell* spell = nullptr) const;
|
||||
float CalcDamageMultiplier(Unit* caster, Spell* spell = nullptr) const;
|
||||
|
||||
bool HasRadius() const;
|
||||
float CalcRadius(Unit* caster = NULL, Spell* = NULL) const;
|
||||
float CalcRadius(Unit* caster = NULL, Spell* = nullptr) const;
|
||||
|
||||
uint32 GetProvidedTargetMask() const;
|
||||
uint32 GetMissingTargetMask(bool srcSet = false, bool destSet = false, uint32 mask = 0) const;
|
||||
@@ -453,9 +453,9 @@ public:
|
||||
bool IsAuraExclusiveBySpecificPerCasterWith(SpellInfo const* spellInfo) const;
|
||||
|
||||
SpellCastResult CheckShapeshift(uint32 form) const;
|
||||
SpellCastResult CheckLocation(uint32 map_id, uint32 zone_id, uint32 area_id, Player const* player = NULL) const;
|
||||
SpellCastResult CheckLocation(uint32 map_id, uint32 zone_id, uint32 area_id, Player const* player = nullptr) const;
|
||||
SpellCastResult CheckTarget(Unit const* caster, WorldObject const* target, bool implicit = true) const;
|
||||
SpellCastResult CheckExplicitTarget(Unit const* caster, WorldObject const* target, Item const* itemTarget = NULL) const;
|
||||
SpellCastResult CheckExplicitTarget(Unit const* caster, WorldObject const* target, Item const* itemTarget = nullptr) const;
|
||||
bool CheckTargetCreatureType(Unit const* target) const;
|
||||
|
||||
// xinef: aura stacking
|
||||
@@ -477,17 +477,17 @@ public:
|
||||
SpellSpecificType GetSpellSpecific() const;
|
||||
|
||||
float GetMinRange(bool positive = false) const;
|
||||
float GetMaxRange(bool positive = false, Unit* caster = NULL, Spell* spell = NULL) const;
|
||||
float GetMaxRange(bool positive = false, Unit* caster = NULL, Spell* spell = nullptr) const;
|
||||
|
||||
int32 GetDuration() const;
|
||||
int32 GetMaxDuration() const;
|
||||
|
||||
uint32 GetMaxTicks() const;
|
||||
|
||||
uint32 CalcCastTime(Unit* caster = NULL, Spell* spell = NULL) const;
|
||||
uint32 CalcCastTime(Unit* caster = NULL, Spell* spell = nullptr) const;
|
||||
uint32 GetRecoveryTime() const;
|
||||
|
||||
int32 CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask, Spell* spell = NULL) const;
|
||||
int32 CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask, Spell* spell = nullptr) const;
|
||||
|
||||
bool IsRanked() const;
|
||||
uint8 GetRank() const;
|
||||
|
||||
@@ -548,7 +548,7 @@ SpellChainNode const* SpellMgr::GetSpellChainNode(uint32 spell_id) const
|
||||
{
|
||||
SpellChainMap::const_iterator itr = mSpellChains.find(spell_id);
|
||||
if (itr == mSpellChains.end())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return &itr->second;
|
||||
}
|
||||
@@ -639,7 +639,7 @@ SpellLearnSkillNode const* SpellMgr::GetSpellLearnSkill(uint32 spell_id) const
|
||||
if (itr != mSpellLearnSkills.end())
|
||||
return &itr->second;
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SpellTargetPosition const* SpellMgr::GetSpellTargetPosition(uint32 spell_id, SpellEffIndex effIndex) const
|
||||
@@ -647,7 +647,7 @@ SpellTargetPosition const* SpellMgr::GetSpellTargetPosition(uint32 spell_id, Spe
|
||||
SpellTargetPositionMap::const_iterator itr = mSpellTargetPositions.find(std::make_pair(spell_id, effIndex));
|
||||
if (itr != mSpellTargetPositions.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SpellGroupStackFlags SpellMgr::GetGroupStackFlags(uint32 groupid) const
|
||||
@@ -723,7 +723,7 @@ SpellProcEventEntry const* SpellMgr::GetSpellProcEvent(uint32 spellId) const
|
||||
SpellProcEventMap::const_iterator itr = mSpellProcEventMap.find(spellId);
|
||||
if (itr != mSpellProcEventMap.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellInfo const* spellProto, SpellProcEventEntry const* spellProcEvent, uint32 EventProcFlag, SpellInfo const* procSpell, uint32 procFlags, uint32 procExtra, bool active) const
|
||||
@@ -788,7 +788,7 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellInfo const* spellProto, Spell
|
||||
procEvent_procEx = spellProcEvent->procEx;
|
||||
|
||||
// For melee triggers
|
||||
if (procSpell == NULL)
|
||||
if (procSpell == nullptr)
|
||||
{
|
||||
// Check (if set) for school (melee attack have Normal school)
|
||||
if (spellProcEvent->schoolMask && (spellProcEvent->schoolMask & SPELL_SCHOOL_MASK_NORMAL) == 0)
|
||||
@@ -859,7 +859,7 @@ SpellProcEntry const* SpellMgr::GetSpellProcEntry(uint32 spellId) const
|
||||
SpellProcMap::const_iterator itr = mSpellProcMap.find(spellId);
|
||||
if (itr != mSpellProcMap.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool SpellMgr::CanSpellTriggerProcOnEvent(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo) const
|
||||
@@ -940,7 +940,7 @@ SpellBonusEntry const* SpellMgr::GetSpellBonusData(uint32 spellId) const
|
||||
if (itr2 != mSpellBonusMap.end())
|
||||
return &itr2->second;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SpellThreatEntry const* SpellMgr::GetSpellThreatEntry(uint32 spellID) const
|
||||
@@ -955,7 +955,7 @@ SpellThreatEntry const* SpellMgr::GetSpellThreatEntry(uint32 spellID) const
|
||||
if (itr != mSpellThreatMap.end())
|
||||
return &itr->second;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
float SpellMgr::GetSpellMixologyBonus(uint32 spellId) const
|
||||
@@ -978,7 +978,7 @@ PetAura const* SpellMgr::GetPetAura(uint32 spell_id, uint8 eff) const
|
||||
if (itr != mSpellPetAuraMap.end())
|
||||
return &itr->second;
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SpellEnchantProcEntry const* SpellMgr::GetSpellEnchantProcEvent(uint32 enchId) const
|
||||
@@ -986,7 +986,7 @@ SpellEnchantProcEntry const* SpellMgr::GetSpellEnchantProcEvent(uint32 enchId) c
|
||||
SpellEnchantProcEventMap::const_iterator itr = mSpellEnchantProcEventMap.find(enchId);
|
||||
if (itr != mSpellEnchantProcEventMap.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool SpellMgr::IsArenaAllowedEnchancment(uint32 ench_id) const
|
||||
@@ -997,7 +997,7 @@ bool SpellMgr::IsArenaAllowedEnchancment(uint32 ench_id) const
|
||||
const std::vector<int32>* SpellMgr::GetSpellLinked(int32 spell_id) const
|
||||
{
|
||||
SpellLinkedMap::const_iterator itr = mSpellLinkedMap.find(spell_id);
|
||||
return itr != mSpellLinkedMap.end() ? &(itr->second) : NULL;
|
||||
return itr != mSpellLinkedMap.end() ? &(itr->second) : nullptr;
|
||||
}
|
||||
|
||||
PetLevelupSpellSet const* SpellMgr::GetPetLevelupSpellList(uint32 petFamily) const
|
||||
@@ -1006,7 +1006,7 @@ PetLevelupSpellSet const* SpellMgr::GetPetLevelupSpellList(uint32 petFamily) con
|
||||
if (itr != mPetLevelupSpellMap.end())
|
||||
return &itr->second;
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PetDefaultSpellsEntry const* SpellMgr::GetPetDefaultSpellsEntry(int32 id) const
|
||||
@@ -1014,7 +1014,7 @@ PetDefaultSpellsEntry const* SpellMgr::GetPetDefaultSpellsEntry(int32 id) const
|
||||
PetDefaultSpellsMap::const_iterator itr = mPetDefaultSpellsMap.find(id);
|
||||
if (itr != mPetDefaultSpellsMap.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SpellAreaMapBounds SpellMgr::GetSpellAreaMapBounds(uint32 spell_id) const
|
||||
@@ -1186,7 +1186,7 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
|
||||
void SpellMgr::UnloadSpellInfoChains()
|
||||
{
|
||||
for (SpellChainMap::iterator itr = mSpellChains.begin(); itr != mSpellChains.end(); ++itr)
|
||||
mSpellInfoMap[itr->first]->ChainEntry = NULL;
|
||||
mSpellInfoMap[itr->first]->ChainEntry = nullptr;
|
||||
|
||||
mSpellChains.clear();
|
||||
}
|
||||
@@ -1202,7 +1202,7 @@ void SpellMgr::LoadSpellTalentRanks()
|
||||
if (!talentInfo)
|
||||
continue;
|
||||
|
||||
SpellInfo const* lastSpell = NULL;
|
||||
SpellInfo const* lastSpell = nullptr;
|
||||
for (uint8 rank = MAX_TALENT_RANK - 1; rank > 0; --rank)
|
||||
{
|
||||
if (talentInfo->RankID[rank])
|
||||
@@ -1222,7 +1222,7 @@ void SpellMgr::LoadSpellTalentRanks()
|
||||
continue;
|
||||
}
|
||||
|
||||
SpellInfo const* prevSpell = NULL;
|
||||
SpellInfo const* prevSpell = nullptr;
|
||||
for (uint8 rank = 0; rank < MAX_TALENT_RANK; ++rank)
|
||||
{
|
||||
uint32 spellId = talentInfo->RankID[rank];
|
||||
@@ -1242,7 +1242,7 @@ void SpellMgr::LoadSpellTalentRanks()
|
||||
node.rank = rank + 1;
|
||||
|
||||
node.prev = prevSpell;
|
||||
node.next = node.rank < MAX_TALENT_RANK ? GetSpellInfo(talentInfo->RankID[node.rank]) : NULL;
|
||||
node.next = node.rank < MAX_TALENT_RANK ? GetSpellInfo(talentInfo->RankID[node.rank]) : nullptr;
|
||||
|
||||
mSpellChains[spellId] = node;
|
||||
mSpellInfoMap[spellId]->ChainEntry = &mSpellChains[spellId];
|
||||
@@ -1351,7 +1351,7 @@ void SpellMgr::LoadSpellRanks()
|
||||
++itr;
|
||||
if (itr == rankChain.end())
|
||||
{
|
||||
mSpellChains[addedSpell].next = NULL;
|
||||
mSpellChains[addedSpell].next = nullptr;
|
||||
break;
|
||||
}
|
||||
else
|
||||
@@ -2329,7 +2329,7 @@ bool LoadPetDefaultSpells_helper(CreatureTemplate const* cInfo, PetDefaultSpells
|
||||
return false;
|
||||
|
||||
// remove duplicates with levelupSpells if any
|
||||
if (PetLevelupSpellSet const* levelupSpells = cInfo->family ? sSpellMgr->GetPetLevelupSpellList(cInfo->family) : NULL)
|
||||
if (PetLevelupSpellSet const* levelupSpells = cInfo->family ? sSpellMgr->GetPetLevelupSpellList(cInfo->family) : nullptr)
|
||||
{
|
||||
for (uint8 j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
|
||||
{
|
||||
@@ -2658,7 +2658,7 @@ void SpellMgr::LoadSpellInfoStore()
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
UnloadSpellInfoStore();
|
||||
mSpellInfoMap.resize(sSpellStore.GetNumRows(), NULL);
|
||||
mSpellInfoMap.resize(sSpellStore.GetNumRows(), nullptr);
|
||||
|
||||
for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i)
|
||||
{
|
||||
@@ -2693,7 +2693,7 @@ void SpellMgr::LoadSpellSpecificAndAuraState()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
SpellInfo* spellInfo = NULL;
|
||||
SpellInfo* spellInfo = nullptr;
|
||||
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
|
||||
{
|
||||
spellInfo = mSpellInfoMap[i];
|
||||
@@ -2785,7 +2785,7 @@ void SpellMgr::LoadSpellCustomAttr()
|
||||
mTalentSpellAdditionalSet.insert(learnSpell->Id);
|
||||
}
|
||||
|
||||
SpellInfo* spellInfo = NULL;
|
||||
SpellInfo* spellInfo = nullptr;
|
||||
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
|
||||
{
|
||||
spellInfo = mSpellInfoMap[i];
|
||||
@@ -3268,7 +3268,7 @@ void SpellMgr::LoadDbcDataCorrections()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
SpellEntry* spellInfo = NULL;
|
||||
SpellEntry* spellInfo = nullptr;
|
||||
for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i)
|
||||
{
|
||||
spellInfo = (SpellEntry*)sSpellStore.LookupEntry(i);
|
||||
|
||||
@@ -685,7 +685,7 @@ class SpellMgr
|
||||
SpellAreaForAreaMapBounds GetSpellAreaForAreaMapBounds(uint32 area_id) const;
|
||||
|
||||
// SpellInfo object management
|
||||
SpellInfo const* GetSpellInfo(uint32 spellId) const { return spellId < GetSpellInfoStoreSize() ? mSpellInfoMap[spellId] : NULL; }
|
||||
SpellInfo const* GetSpellInfo(uint32 spellId) const { return spellId < GetSpellInfoStoreSize() ? mSpellInfoMap[spellId] : nullptr; }
|
||||
uint32 GetSpellInfoStoreSize() const { return mSpellInfoMap.size(); }
|
||||
|
||||
// Talent Additional Set
|
||||
|
||||
@@ -385,7 +385,7 @@ WorldLocation const* SpellScript::GetExplTargetDest()
|
||||
{
|
||||
if (m_spell->m_targets.HasDst())
|
||||
return m_spell->m_targets.GetDstPos();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void SpellScript::SetExplTargetDest(WorldLocation& loc)
|
||||
@@ -418,7 +418,7 @@ Unit* SpellScript::GetHitUnit()
|
||||
if (!IsInTargetHook())
|
||||
{
|
||||
sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitUnit was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
return m_spell->unitTarget;
|
||||
}
|
||||
@@ -428,12 +428,12 @@ Creature* SpellScript::GetHitCreature()
|
||||
if (!IsInTargetHook())
|
||||
{
|
||||
sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitCreature was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
if (m_spell->unitTarget)
|
||||
return m_spell->unitTarget->ToCreature();
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Player* SpellScript::GetHitPlayer()
|
||||
@@ -441,12 +441,12 @@ Player* SpellScript::GetHitPlayer()
|
||||
if (!IsInTargetHook())
|
||||
{
|
||||
sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitPlayer was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
if (m_spell->unitTarget)
|
||||
return m_spell->unitTarget->ToPlayer();
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Item* SpellScript::GetHitItem()
|
||||
@@ -454,7 +454,7 @@ Item* SpellScript::GetHitItem()
|
||||
if (!IsInTargetHook())
|
||||
{
|
||||
sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitItem was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
return m_spell->itemTarget;
|
||||
}
|
||||
@@ -464,7 +464,7 @@ GameObject* SpellScript::GetHitGObj()
|
||||
if (!IsInTargetHook())
|
||||
{
|
||||
sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitGObj was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
return m_spell->gameObjTarget;
|
||||
}
|
||||
@@ -474,7 +474,7 @@ WorldLocation* SpellScript::GetHitDest()
|
||||
if (!IsInEffectHook())
|
||||
{
|
||||
sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitDest was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
return m_spell->destTarget;
|
||||
}
|
||||
@@ -524,12 +524,12 @@ Aura* SpellScript::GetHitAura()
|
||||
if (!IsInTargetHook())
|
||||
{
|
||||
sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitAura was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
if (!m_spell->m_spellAura)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
if (m_spell->m_spellAura->IsRemoved())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return m_spell->m_spellAura;
|
||||
}
|
||||
|
||||
@@ -894,7 +894,7 @@ void AuraScript::EffectProcHandler::Call(AuraScript* auraScript, AuraEffect cons
|
||||
bool AuraScript::_Load(Aura* aura)
|
||||
{
|
||||
m_aura = aura;
|
||||
_PrepareScriptCall((AuraScriptHookType)SPELL_SCRIPT_STATE_LOADING, NULL);
|
||||
_PrepareScriptCall((AuraScriptHookType)SPELL_SCRIPT_STATE_LOADING, nullptr);
|
||||
bool load = Load();
|
||||
_FinishScriptCall();
|
||||
return load;
|
||||
@@ -1141,7 +1141,7 @@ Unit* AuraScript::GetTarget() const
|
||||
sLog->outError("TSCR: Script: `%s` Spell: `%u` AuraScript::GetTarget called in a hook in which the call won't have effect!", m_scriptName->c_str(), m_scriptSpellId);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AuraApplication const* AuraScript::GetTargetApplication() const
|
||||
|
||||
@@ -49,7 +49,7 @@ class _SpellScript
|
||||
virtual bool _Validate(SpellInfo const* entry);
|
||||
|
||||
public:
|
||||
_SpellScript() : m_currentScriptState(SPELL_SCRIPT_STATE_NONE), m_scriptName(NULL), m_scriptSpellId(0) {}
|
||||
_SpellScript() : m_currentScriptState(SPELL_SCRIPT_STATE_NONE), m_scriptName(nullptr), m_scriptSpellId(0) {}
|
||||
virtual ~_SpellScript() {}
|
||||
virtual void _Register();
|
||||
virtual void _Unload();
|
||||
@@ -619,11 +619,11 @@ class AuraScript : public _SpellScript
|
||||
#define PrepareAuraScript(CLASSNAME) AURASCRIPT_FUNCTION_TYPE_DEFINES(CLASSNAME) AURASCRIPT_FUNCTION_CAST_DEFINES(CLASSNAME)
|
||||
|
||||
public:
|
||||
AuraScript() : _SpellScript(), m_aura(NULL), m_auraApplication(NULL), m_defaultActionPrevented(false)
|
||||
AuraScript() : _SpellScript(), m_aura(nullptr), m_auraApplication(nullptr), m_defaultActionPrevented(false)
|
||||
{}
|
||||
bool _Validate(SpellInfo const* entry);
|
||||
bool _Load(Aura* aura);
|
||||
void _PrepareScriptCall(AuraScriptHookType hookType, AuraApplication const* aurApp = NULL);
|
||||
void _PrepareScriptCall(AuraScriptHookType hookType, AuraApplication const* aurApp = nullptr);
|
||||
void _FinishScriptCall();
|
||||
bool _IsDefaultActionPrevented();
|
||||
private:
|
||||
@@ -847,7 +847,7 @@ class AuraScript : public _SpellScript
|
||||
bool HasEffectType(AuraType type) const;
|
||||
|
||||
// AuraScript interface - functions which are redirecting to AuraApplication class
|
||||
// Do not call these in hooks in which AuraApplication is not avalible, otherwise result will differ from expected (the functions will return NULL)
|
||||
// Do not call these in hooks in which AuraApplication is not avalible, otherwise result will differ from expected (the functions will return nullptr)
|
||||
|
||||
// returns currently processed target of an aura
|
||||
// Return value does not need to be NULL-checked, the only situation this will (always)
|
||||
|
||||
Reference in New Issue
Block a user