mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 13:16:23 +00:00
refactor(Core): replace NULL with nullptr (#4593)
This commit is contained in:
@@ -1051,7 +1051,7 @@ void Creature::SetLootRecipient(Unit* unit, bool withGroup)
|
||||
{
|
||||
// set the player whose group should receive the right
|
||||
// to loot the creature after it dies
|
||||
// should be set to NULL after the loot disappears
|
||||
// should be set to nullptr after the loot disappears
|
||||
|
||||
if (!unit)
|
||||
{
|
||||
@@ -2387,7 +2387,7 @@ void Creature::SendZoneUnderAttackMessage(Player* attacker)
|
||||
{
|
||||
WorldPacket data(SMSG_ZONE_UNDER_ATTACK, 4);
|
||||
data << (uint32)GetAreaId();
|
||||
sWorld->SendGlobalMessage(&data, NULL, (attacker->GetTeamId() == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE));
|
||||
sWorld->SendGlobalMessage(&data, nullptr, (attacker->GetTeamId() == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE));
|
||||
}
|
||||
|
||||
void Creature::SetInCombatWithZone()
|
||||
|
||||
@@ -1212,7 +1212,7 @@ void GameObject::ResetDoorOrButton()
|
||||
m_cooldownTime = 0;
|
||||
}
|
||||
|
||||
void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = false */, Unit* user /*=NULL*/)
|
||||
void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = false */, Unit* user /*=nullptr*/)
|
||||
{
|
||||
if (m_lootState != GO_READY)
|
||||
return;
|
||||
@@ -1667,7 +1667,7 @@ void GameObject::Use(Unit* user)
|
||||
|
||||
if (info->spellcaster.partyOnly)
|
||||
{
|
||||
Player const* caster = ObjectAccessor::GetObjectInOrOutOfWorld(GetOwnerGUID(), (Player*)NULL);
|
||||
Player const* caster = ObjectAccessor::GetObjectInOrOutOfWorld(GetOwnerGUID(), (Player*)nullptr);
|
||||
if (!caster || user->GetTypeId() != TYPEID_PLAYER || !user->ToPlayer()->IsInSameRaidWith(caster))
|
||||
return;
|
||||
}
|
||||
@@ -2029,7 +2029,7 @@ void GameObject::SetWorldRotationAngles(float z_rot, float y_rot, float x_rot)
|
||||
SetWorldRotation(G3D::Quat(G3D::Matrix3::fromEulerAnglesZYX(z_rot, y_rot, x_rot)));
|
||||
}
|
||||
|
||||
void GameObject::ModifyHealth(int32 change, Unit* attackerOrHealer /*= NULL*/, uint32 spellId /*= 0*/)
|
||||
void GameObject::ModifyHealth(int32 change, Unit* attackerOrHealer /*= nullptr*/, uint32 spellId /*= 0*/)
|
||||
{
|
||||
if (!IsDestructibleBuilding())
|
||||
return;
|
||||
@@ -2085,7 +2085,7 @@ void GameObject::ModifyHealth(int32 change, Unit* attackerOrHealer /*= NULL*/, u
|
||||
SetDestructibleState(newState, player, false);
|
||||
}
|
||||
|
||||
void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* eventInvoker /*= NULL*/, bool setHealth /*= false*/)
|
||||
void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* eventInvoker /*= nullptr*/, bool setHealth /*= false*/)
|
||||
{
|
||||
// the user calling this must know he is already operating on destructible gameobject
|
||||
ASSERT(GetGoType() == GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING);
|
||||
@@ -2303,7 +2303,7 @@ void GameObject::SetLootRecipient(Unit* unit)
|
||||
{
|
||||
// set the player whose group should receive the right
|
||||
// to loot the creature after it dies
|
||||
// should be set to NULL after the loot disappears
|
||||
// should be set to nullptr after the loot disappears
|
||||
|
||||
if (!unit)
|
||||
{
|
||||
@@ -2437,7 +2437,7 @@ void GameObject::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* t
|
||||
data->append(fieldBuffer);
|
||||
}
|
||||
|
||||
void GameObject::GetRespawnPosition(float& x, float& y, float& z, float* ori /* = NULL*/) const
|
||||
void GameObject::GetRespawnPosition(float& x, float& y, float& z, float* ori /* = nullptr*/) const
|
||||
{
|
||||
if (m_DBTableGuid)
|
||||
{
|
||||
|
||||
@@ -91,7 +91,7 @@ void AddItemsSetItem(Player* player, Item* item)
|
||||
}
|
||||
|
||||
// spell casted only if fit form requirement, in other case will casted at form change
|
||||
player->ApplyEquipSpell(spellInfo, NULL, true);
|
||||
player->ApplyEquipSpell(spellInfo, nullptr, true);
|
||||
eff->spells[y] = spellInfo;
|
||||
break;
|
||||
}
|
||||
@@ -142,8 +142,8 @@ void RemoveItemsSetItem(Player* player, ItemTemplate const* proto)
|
||||
if (eff->spells[z] && eff->spells[z]->Id == set->spells[x])
|
||||
{
|
||||
// spell can be not active if not fit form requirement
|
||||
player->ApplyEquipSpell(eff->spells[z], NULL, false);
|
||||
eff->spells[z] = NULL;
|
||||
player->ApplyEquipSpell(eff->spells[z], nullptr, false);
|
||||
eff->spells[z] = nullptr;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1075,7 +1075,7 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player, bool clo
|
||||
|
||||
Item* Item::CloneItem(uint32 count, Player const* player) const
|
||||
{
|
||||
// player CAN be NULL in which case we must not update random properties because that accesses player's item update queue
|
||||
// player CAN be nullptr in which case we must not update random properties because that accesses player's item update queue
|
||||
Item* newItem = CreateItem(GetEntry(), count, player, true, player ? GetItemRandomPropertyId() : 0);
|
||||
if (!newItem)
|
||||
return nullptr;
|
||||
@@ -1143,7 +1143,7 @@ void Item::DeleteRefundDataFromDB(SQLTransaction* trans)
|
||||
}
|
||||
}
|
||||
|
||||
void Item::SetNotRefundable(Player* owner, bool changestate /*=true*/, SQLTransaction* trans /*=NULL*/)
|
||||
void Item::SetNotRefundable(Player* owner, bool changestate /*=true*/, SQLTransaction* trans /*=nullptr*/)
|
||||
{
|
||||
if (!HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE))
|
||||
return;
|
||||
|
||||
@@ -2201,7 +2201,7 @@ void WorldObject::AddObjectToRemoveList()
|
||||
map->AddObjectToRemoveList(this);
|
||||
}
|
||||
|
||||
TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropertiesEntry const* properties /*= NULL*/, uint32 duration /*= 0*/, Unit* summoner /*= NULL*/, uint32 spellId /*= 0*/, uint32 vehId /*= 0*/)
|
||||
TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropertiesEntry const* properties /*= nullptr*/, uint32 duration /*= 0*/, Unit* summoner /*= nullptr*/, uint32 spellId /*= 0*/, uint32 vehId /*= 0*/)
|
||||
{
|
||||
uint32 mask = UNIT_MASK_SUMMON;
|
||||
if (properties)
|
||||
@@ -2305,14 +2305,14 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
|
||||
* @param list List to store pointers to summoned creatures.
|
||||
*/
|
||||
|
||||
void Map::SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list /*= NULL*/)
|
||||
void Map::SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list /*= nullptr*/)
|
||||
{
|
||||
std::vector<TempSummonData> const* data = sObjectMgr->GetSummonGroup(GetId(), SUMMONER_TYPE_MAP, group);
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
for (std::vector<TempSummonData>::const_iterator itr = data->begin(); itr != data->end(); ++itr)
|
||||
if (TempSummon* summon = SummonCreature(itr->entry, itr->pos, NULL, itr->time))
|
||||
if (TempSummon* summon = SummonCreature(itr->entry, itr->pos, nullptr, itr->time))
|
||||
if (list)
|
||||
list->push_back(summon);
|
||||
}
|
||||
@@ -2437,7 +2437,7 @@ Creature* WorldObject::SummonTrigger(float x, float y, float z, float ang, uint3
|
||||
* @param group Id of group to summon.
|
||||
* @param list List to store pointers to summoned creatures.
|
||||
*/
|
||||
void WorldObject::SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list /*= NULL*/)
|
||||
void WorldObject::SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list /*= nullptr*/)
|
||||
{
|
||||
ASSERT((GetTypeId() == TYPEID_GAMEOBJECT || GetTypeId() == TYPEID_UNIT) && "Only GOs and creatures can summon npc groups!");
|
||||
|
||||
@@ -2850,7 +2850,7 @@ void WorldObject::SetPhaseMask(uint32 newPhaseMask, bool update)
|
||||
UpdateObjectVisibility();
|
||||
}
|
||||
|
||||
void WorldObject::PlayDistanceSound(uint32 sound_id, Player* target /*= NULL*/)
|
||||
void WorldObject::PlayDistanceSound(uint32 sound_id, Player* target /*= nullptr*/)
|
||||
{
|
||||
WorldPacket data(SMSG_PLAY_OBJECT_SOUND, 4 + 8);
|
||||
data << uint32(sound_id);
|
||||
@@ -2861,7 +2861,7 @@ void WorldObject::PlayDistanceSound(uint32 sound_id, Player* target /*= NULL*/)
|
||||
SendMessageToSet(&data, true);
|
||||
}
|
||||
|
||||
void WorldObject::PlayDirectSound(uint32 sound_id, Player* target /*= NULL*/)
|
||||
void WorldObject::PlayDirectSound(uint32 sound_id, Player* target /*= nullptr*/)
|
||||
{
|
||||
WorldPacket data(SMSG_PLAY_SOUND, 4);
|
||||
data << uint32(sound_id);
|
||||
@@ -2871,7 +2871,7 @@ void WorldObject::PlayDirectSound(uint32 sound_id, Player* target /*= NULL*/)
|
||||
SendMessageToSet(&data, true);
|
||||
}
|
||||
|
||||
void WorldObject::PlayDirectMusic(uint32 music_id, Player* target /*= NULL*/)
|
||||
void WorldObject::PlayDirectMusic(uint32 music_id, Player* target /*= nullptr*/)
|
||||
{
|
||||
WorldPacket data(SMSG_PLAY_MUSIC, 4);
|
||||
data << uint32(music_id);
|
||||
@@ -2997,7 +2997,7 @@ struct WorldObjectChangeAccumulator
|
||||
|
||||
if (IS_PLAYER_GUID(guid))
|
||||
{
|
||||
//Caster may be NULL if DynObj is in removelist
|
||||
//Caster may be nullptr if DynObj is in removelist
|
||||
if (Player* caster = ObjectAccessor::FindPlayer(guid))
|
||||
if (caster->GetUInt64Value(PLAYER_FARSIGHT) == source->GetGUID())
|
||||
BuildPacket(caster);
|
||||
|
||||
@@ -1268,7 +1268,7 @@ void Pet::_LoadAuras(PreparedQueryResult result, uint32 timediff)
|
||||
int32 baseDamage[3];
|
||||
Field* fields = result->Fetch();
|
||||
uint64 caster_guid = fields[0].GetUInt64();
|
||||
// NULL guid stored - pet is the caster of the spell - see Pet::_SaveAuras
|
||||
// nullptr guid stored - pet is the caster of the spell - see Pet::_SaveAuras
|
||||
if (!caster_guid)
|
||||
caster_guid = GetGUID();
|
||||
uint32 spellid = fields[1].GetUInt32();
|
||||
@@ -1319,7 +1319,7 @@ void Pet::_LoadAuras(PreparedQueryResult result, uint32 timediff)
|
||||
else
|
||||
remaincharges = 0;
|
||||
|
||||
if (Aura* aura = Aura::TryCreate(spellInfo, effmask, this, NULL, &baseDamage[0], NULL, caster_guid))
|
||||
if (Aura* aura = Aura::TryCreate(spellInfo, effmask, this, nullptr, &baseDamage[0], nullptr, caster_guid))
|
||||
{
|
||||
if (!aura->CanBeSaved())
|
||||
{
|
||||
@@ -1781,7 +1781,7 @@ bool Pet::resetTalents()
|
||||
return true;
|
||||
}
|
||||
|
||||
void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/)
|
||||
void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= nullptr*/)
|
||||
{
|
||||
// not need after this call
|
||||
if (owner->ToPlayer()->HasAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS))
|
||||
@@ -2237,7 +2237,7 @@ void Pet::HandleAsynchLoadFailed(AsynchPetSummon* info, Player* player, uint8 as
|
||||
// we are almost at home...
|
||||
if (asynchLoadType == PET_LOAD_SUMMON_PET)
|
||||
{
|
||||
Unit* caster = ObjectAccessor::GetObjectInMap(info->m_casterGUID, map, (Unit*)NULL);
|
||||
Unit* caster = ObjectAccessor::GetObjectInMap(info->m_casterGUID, map, (Unit*)nullptr);
|
||||
if (!caster)
|
||||
caster = player;
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ void Totem::UnSummon(uint32 msTime)
|
||||
player->SendAutoRepeatCancel(this);
|
||||
|
||||
if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(GetUInt32Value(UNIT_CREATED_BY_SPELL)))
|
||||
player->SendCooldownEvent(spell, 0, NULL, false);
|
||||
player->SendCooldownEvent(spell, 0, nullptr, false);
|
||||
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
|
||||
@@ -837,7 +837,7 @@ void StaticTransport::Update(uint32 diff)
|
||||
|
||||
void StaticTransport::RelocateToProgress(uint32 progress)
|
||||
{
|
||||
TransportAnimationEntry const* curr = NULL, *next = nullptr;
|
||||
TransportAnimationEntry const* curr = nullptr, *next = nullptr;
|
||||
float percPos;
|
||||
if (m_goValue.Transport.AnimationInfo->GetAnimNode(progress, curr, next, percPos))
|
||||
{
|
||||
|
||||
@@ -1224,9 +1224,9 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama
|
||||
if (CanApplyResilience())
|
||||
{
|
||||
if (attackType != RANGED_ATTACK)
|
||||
Unit::ApplyResilience(victim, NULL, &damage, crit, CR_CRIT_TAKEN_MELEE);
|
||||
Unit::ApplyResilience(victim, nullptr, &damage, crit, CR_CRIT_TAKEN_MELEE);
|
||||
else
|
||||
Unit::ApplyResilience(victim, NULL, &damage, crit, CR_CRIT_TAKEN_RANGED);
|
||||
Unit::ApplyResilience(victim, nullptr, &damage, crit, CR_CRIT_TAKEN_RANGED);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1242,7 +1242,7 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama
|
||||
}
|
||||
|
||||
if (CanApplyResilience())
|
||||
Unit::ApplyResilience(victim, NULL, &damage, crit, CR_CRIT_TAKEN_SPELL);
|
||||
Unit::ApplyResilience(victim, nullptr, &damage, crit, CR_CRIT_TAKEN_SPELL);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -1354,7 +1354,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam
|
||||
// Calculate armor reduction
|
||||
if (IsDamageReducedByArmor((SpellSchoolMask)(damageInfo->damageSchoolMask)))
|
||||
{
|
||||
damageInfo->damage = Unit::CalcArmorReducedDamage(this, damageInfo->target, damage, NULL, 0, damageInfo->attackType);
|
||||
damageInfo->damage = Unit::CalcArmorReducedDamage(this, damageInfo->target, damage, nullptr, 0, damageInfo->attackType);
|
||||
damageInfo->cleanDamage += damage - damageInfo->damage;
|
||||
}
|
||||
else
|
||||
@@ -1473,7 +1473,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam
|
||||
|
||||
// attackType is checked already for BASE_ATTACK or OFF_ATTACK so it can't be RANGED_ATTACK here
|
||||
if (CanApplyResilience())
|
||||
Unit::ApplyResilience(victim, NULL, &resilienceReduction, (damageInfo->hitOutCome == MELEE_HIT_CRIT), CR_CRIT_TAKEN_MELEE);
|
||||
Unit::ApplyResilience(victim, nullptr, &resilienceReduction, (damageInfo->hitOutCome == MELEE_HIT_CRIT), CR_CRIT_TAKEN_MELEE);
|
||||
|
||||
resilienceReduction = damageInfo->damage - resilienceReduction;
|
||||
damageInfo->damage -= resilienceReduction;
|
||||
@@ -1548,7 +1548,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
|
||||
|
||||
// Call default DealDamage
|
||||
CleanDamage cleanDamage(damageInfo->cleanDamage, damageInfo->absorb, damageInfo->attackType, damageInfo->hitOutCome);
|
||||
Unit::DealDamage(this, victim, damageInfo->damage, &cleanDamage, DIRECT_DAMAGE, SpellSchoolMask(damageInfo->damageSchoolMask), NULL, durabilityLoss);
|
||||
Unit::DealDamage(this, victim, damageInfo->damage, &cleanDamage, DIRECT_DAMAGE, SpellSchoolMask(damageInfo->damageSchoolMask), nullptr, durabilityLoss);
|
||||
|
||||
// If this is a creature and it attacks from behind it has a probability to daze it's victim
|
||||
if (damageInfo->damage && ((damageInfo->hitOutCome == MELEE_HIT_CRIT || damageInfo->hitOutCome == MELEE_HIT_CRUSHING || damageInfo->hitOutCome == MELEE_HIT_NORMAL || damageInfo->hitOutCome == MELEE_HIT_GLANCING) &&
|
||||
@@ -3214,9 +3214,9 @@ float Unit::GetUnitCriticalChance(WeaponAttackType attackType, const Unit* victi
|
||||
|
||||
// reduce crit chance from Rating for players
|
||||
if (attackType != RANGED_ATTACK)
|
||||
Unit::ApplyResilience(victim, &crit, NULL, false, CR_CRIT_TAKEN_MELEE);
|
||||
Unit::ApplyResilience(victim, &crit, nullptr, false, CR_CRIT_TAKEN_MELEE);
|
||||
else
|
||||
Unit::ApplyResilience(victim, &crit, NULL, false, CR_CRIT_TAKEN_RANGED);
|
||||
Unit::ApplyResilience(victim, &crit, nullptr, false, CR_CRIT_TAKEN_RANGED);
|
||||
|
||||
// Apply crit chance from defence skill
|
||||
crit += (int32(GetMaxSkillValueForLevel(victim)) - int32(victim->GetDefenseSkillValue(this))) * 0.04f;
|
||||
@@ -3398,7 +3398,7 @@ void Unit::_UpdateAutoRepeatSpell()
|
||||
|
||||
void Unit::SetCurrentCastedSpell(Spell* pSpell)
|
||||
{
|
||||
ASSERT(pSpell); // NULL may be never passed here, use InterruptSpell or InterruptNonMeleeSpells
|
||||
ASSERT(pSpell); // nullptr may be never passed here, use InterruptSpell or InterruptNonMeleeSpells
|
||||
|
||||
CurrentSpellTypes CSpellType = pSpell->GetCurrentContainer();
|
||||
|
||||
@@ -3936,7 +3936,7 @@ void Unit::DeMorph()
|
||||
SetDisplayId(GetNativeDisplayId());
|
||||
}
|
||||
|
||||
Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount /*= NULL*/, Item* castItem /*= NULL*/, uint64 casterGUID /*= 0*/, bool periodicReset /*= false*/)
|
||||
Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount /*= nullptr*/, Item* castItem /*= nullptr*/, uint64 casterGUID /*= 0*/, bool periodicReset /*= false*/)
|
||||
{
|
||||
ASSERT(casterGUID || caster);
|
||||
if (!casterGUID)
|
||||
@@ -4570,7 +4570,7 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit*
|
||||
// Xinef: if stealer has same aura
|
||||
Aura* curAura = stealer->GetAura(aura->GetId());
|
||||
if (!curAura || (!curAura->IsPermanent() && curAura->GetDuration() < (int32)dur))
|
||||
if (Aura* newAura = Aura::TryRefreshStackOrCreate(aura->GetSpellInfo(), effMask, stealer, NULL, &baseDamage[0], NULL, aura->GetCasterGUID()))
|
||||
if (Aura* newAura = Aura::TryRefreshStackOrCreate(aura->GetSpellInfo(), effMask, stealer, nullptr, &baseDamage[0], nullptr, aura->GetCasterGUID()))
|
||||
{
|
||||
// created aura must not be single target aura,, so stealer won't loose it on recast
|
||||
if (newAura->IsSingleTarget())
|
||||
@@ -5657,7 +5657,7 @@ void Unit::AddGameObject(GameObject* gameObj)
|
||||
// Need disable spell use for owner
|
||||
if (createBySpell && createBySpell->IsCooldownStartedOnEvent())
|
||||
// note: item based cooldowns and cooldown spell mods with charges ignored (unknown existing cases)
|
||||
ToPlayer()->AddSpellAndCategoryCooldowns(createBySpell, 0, NULL, true);
|
||||
ToPlayer()->AddSpellAndCategoryCooldowns(createBySpell, 0, nullptr, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5972,7 +5972,7 @@ void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit* target, uint8 /*SwingType
|
||||
SendAttackStateUpdate(&dmgInfo);
|
||||
}
|
||||
|
||||
//victim may be NULL
|
||||
//victim may be nullptr
|
||||
bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown)
|
||||
{
|
||||
SpellInfo const* dummySpell = triggeredByAura->GetSpellInfo();
|
||||
@@ -6726,7 +6726,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
int32 total = CalculatePct(int32(damage), triggerAmount);
|
||||
int32 team = total / 5;
|
||||
int32 self = total - team;
|
||||
CastCustomSpell(this, 15290, &team, &self, NULL, true, castItem, triggeredByAura);
|
||||
CastCustomSpell(this, 15290, &team, &self, nullptr, true, castItem, triggeredByAura);
|
||||
return true; // no hidden cooldown
|
||||
}
|
||||
// Priest Tier 6 Trinket (Ashtongue Talisman of Acumen)
|
||||
@@ -7404,7 +7404,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
if (!victim || !victim->IsAlive())
|
||||
return false;
|
||||
|
||||
CastSpell(this, 71432, true, NULL, triggeredByAura);
|
||||
CastSpell(this, 71432, true, nullptr, triggeredByAura);
|
||||
|
||||
Aura const* dummy = GetAura(71432);
|
||||
if (!dummy || dummy->GetStackAmount() < (dummySpell->Id == 71406 ? 8 : 7))
|
||||
@@ -8104,7 +8104,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
continue;
|
||||
|
||||
basepoints0 = int32(CalculateSpellDamage(this, procSpell, i) * 0.4f);
|
||||
CastCustomSpell(this, triggered_spell_id, &basepoints0, nullptr, nullptr, true, NULL, triggeredByAura);
|
||||
CastCustomSpell(this, triggered_spell_id, &basepoints0, nullptr, nullptr, true, nullptr, triggeredByAura);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -8266,7 +8266,7 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, Sp
|
||||
return false;
|
||||
|
||||
int32 bp0 = int32(CalculatePct(GetMaxPower(POWER_MANA), spInfo->Effects[0].CalcValue()));
|
||||
CastCustomSpell(this, 67545, &bp0, nullptr, nullptr, true, NULL, triggeredByAura->GetEffect(EFFECT_0), GetGUID());
|
||||
CastCustomSpell(this, 67545, &bp0, nullptr, nullptr, true, nullptr, triggeredByAura->GetEffect(EFFECT_0), GetGUID());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -8707,14 +8707,14 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
ToPlayer()->AddSpellCooldown(stack_spell_id, 0, cooldown);
|
||||
}
|
||||
|
||||
CastSpell(this, stack_spell_id, true, NULL, triggeredByAura);
|
||||
CastSpell(this, stack_spell_id, true, nullptr, triggeredByAura);
|
||||
|
||||
Aura* dummy = GetAura(stack_spell_id);
|
||||
if (!dummy || dummy->GetStackAmount() < triggerAmount)
|
||||
return false;
|
||||
|
||||
RemoveAurasDueToSpell(stack_spell_id);
|
||||
CastSpell(victim, trigger_spell_id, true, NULL, triggeredByAura);
|
||||
CastSpell(victim, trigger_spell_id, true, nullptr, triggeredByAura);
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
@@ -9158,7 +9158,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
if (AuraEffect* aurEff = owner->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, 3220, 0))
|
||||
{
|
||||
basepoints0 = int32((aurEff->GetAmount() * owner->SpellBaseDamageBonusDone(SpellSchoolMask(SPELL_SCHOOL_MASK_MAGIC)) + 100.0f) / 100.0f); // TODO: Is it right?
|
||||
CastCustomSpell(this, trigger_spell_id, &basepoints0, &basepoints0, NULL, true, castItem, triggeredByAura);
|
||||
CastCustomSpell(this, trigger_spell_id, &basepoints0, &basepoints0, nullptr, true, castItem, triggeredByAura);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -9316,7 +9316,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
}
|
||||
|
||||
if(basepoints0)
|
||||
CastCustomSpell(target, triggerEntry->Id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura);
|
||||
CastCustomSpell(target, triggerEntry->Id, &basepoints0, nullptr, nullptr, true, castItem, triggeredByAura);
|
||||
else
|
||||
CastSpell(target, triggerEntry->Id, true, castItem, triggeredByAura);
|
||||
|
||||
@@ -10170,7 +10170,7 @@ void Unit::SetMinion(Minion* minion, bool apply)
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(minion->GetUInt32Value(UNIT_CREATED_BY_SPELL));
|
||||
|
||||
if (spellInfo && spellInfo->IsCooldownStartedOnEvent())
|
||||
ToPlayer()->AddSpellAndCategoryCooldowns(spellInfo, 0, NULL, true);
|
||||
ToPlayer()->AddSpellAndCategoryCooldowns(spellInfo, 0, nullptr, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -11417,7 +11417,7 @@ float Unit::SpellTakenCritChance(Unit const* caster, SpellInfo const* spellProto
|
||||
crit_chance += GetMaxPositiveAuraModifierByMiscMask(SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE, schoolMask);
|
||||
}
|
||||
|
||||
Unit::ApplyResilience(this, &crit_chance, NULL, false, CR_CRIT_TAKEN_SPELL);
|
||||
Unit::ApplyResilience(this, &crit_chance, nullptr, false, CR_CRIT_TAKEN_SPELL);
|
||||
}
|
||||
// scripted (increase crit chance ... against ... target by x%
|
||||
if (caster)
|
||||
@@ -11560,10 +11560,10 @@ float Unit::SpellTakenCritChance(Unit const* caster, SpellInfo const* spellProto
|
||||
if (attackType != RANGED_ATTACK)
|
||||
{
|
||||
// xinef: little hack, crit chance dont require caster to calculate, pass victim
|
||||
Unit::ApplyResilience(this, &crit_chance, NULL, false, CR_CRIT_TAKEN_MELEE);
|
||||
Unit::ApplyResilience(this, &crit_chance, nullptr, false, CR_CRIT_TAKEN_MELEE);
|
||||
}
|
||||
else
|
||||
Unit::ApplyResilience(this, &crit_chance, NULL, false, CR_CRIT_TAKEN_RANGED);
|
||||
Unit::ApplyResilience(this, &crit_chance, nullptr, false, CR_CRIT_TAKEN_RANGED);
|
||||
|
||||
// Apply crit chance from defence skill
|
||||
if (caster)
|
||||
@@ -15465,7 +15465,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
|
||||
|
||||
DamageInfo damageInfo = DamageInfo(actor, actionTarget, damage, procSpell, procSpell ? SpellSchoolMask(procSpell->SchoolMask) : SPELL_SCHOOL_MASK_NORMAL, SPELL_DIRECT_DAMAGE);
|
||||
HealInfo healInfo = HealInfo(actor, actionTarget, damage, procSpell, procSpell ? SpellSchoolMask(procSpell->SchoolMask) : SPELL_SCHOOL_MASK_NORMAL);
|
||||
ProcEventInfo eventInfo = ProcEventInfo(actor, actionTarget, target, procFlag, 0, 0, procExtra, NULL, &damageInfo, &healInfo, procAura);
|
||||
ProcEventInfo eventInfo = ProcEventInfo(actor, actionTarget, target, procFlag, 0, 0, procExtra, nullptr, &damageInfo, &healInfo, procAura);
|
||||
|
||||
ProcTriggeredList procTriggered;
|
||||
// Fill procTriggered list
|
||||
@@ -15522,7 +15522,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
|
||||
// Skip this auras
|
||||
if (isNonTriggerAura[aurEff->GetAuraType()])
|
||||
continue;
|
||||
// If not trigger by default and spellProcEvent == NULL - skip
|
||||
// If not trigger by default and spellProcEvent == nullptr - skip
|
||||
if (!isTriggerAura[aurEff->GetAuraType()] && triggerData.spellProcEvent == nullptr)
|
||||
continue;
|
||||
// Some spells must always trigger
|
||||
@@ -15808,7 +15808,7 @@ void Unit::GetProcAurasTriggeredOnEvent(std::list<AuraApplication*>& aurasTrigge
|
||||
void Unit::TriggerAurasProcOnEvent(CalcDamageInfo& damageInfo)
|
||||
{
|
||||
DamageInfo dmgInfo = DamageInfo(damageInfo);
|
||||
TriggerAurasProcOnEvent(nullptr, NULL, damageInfo.target, damageInfo.procAttacker, damageInfo.procVictim, 0, 0, damageInfo.procEx, NULL, &dmgInfo, nullptr);
|
||||
TriggerAurasProcOnEvent(nullptr, nullptr, damageInfo.target, damageInfo.procAttacker, damageInfo.procVictim, 0, 0, damageInfo.procEx, nullptr, &dmgInfo, nullptr);
|
||||
}
|
||||
|
||||
void Unit::TriggerAurasProcOnEvent(std::list<AuraApplication*>* myProcAuras, std::list<AuraApplication*>* targetProcAuras, Unit* actionTarget, uint32 typeMaskActor, uint32 typeMaskActionTarget, uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell* spell, DamageInfo* damageInfo, HealInfo* healInfo)
|
||||
@@ -16706,7 +16706,7 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura)
|
||||
if (Unit* target = nearMembers.front())
|
||||
{
|
||||
CastSpell(target, 41637 /*Dummy visual effect triggered by main spell cast*/, true);
|
||||
CastCustomSpell(target, spellProto->Id, &heal, nullptr, nullptr, true, NULL, triggeredByAura, caster_guid);
|
||||
CastCustomSpell(target, spellProto->Id, &heal, nullptr, nullptr, true, nullptr, triggeredByAura, caster_guid);
|
||||
if (Aura* aura = target->GetAura(spellProto->Id, caster->GetGUID()))
|
||||
aura->SetCharges(jumps);
|
||||
}
|
||||
@@ -16758,14 +16758,14 @@ bool Unit::HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura)
|
||||
float radius = triggeredByAura->GetSpellInfo()->Effects[triggeredByAura->GetEffIndex()].CalcRadius(caster);
|
||||
if (Unit* target = GetNextRandomRaidMemberOrPet(radius))
|
||||
{
|
||||
CastSpell(target, spellProto, true, NULL, triggeredByAura, caster_guid);
|
||||
CastSpell(target, spellProto, true, nullptr, triggeredByAura, caster_guid);
|
||||
if (Aura* aura = target->GetAura(spellProto->Id, caster->GetGUID()))
|
||||
aura->SetCharges(jumps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CastSpell(this, damageSpellId, true, NULL, triggeredByAura, caster_guid);
|
||||
CastSpell(this, damageSpellId, true, nullptr, triggeredByAura, caster_guid);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -16938,7 +16938,7 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
|
||||
victim->SetUInt32Value(PLAYER_SELF_RES_SPELL, ressSpellId);
|
||||
|
||||
// FORM_SPIRITOFREDEMPTION and related auras
|
||||
victim->CastSpell(victim, 27827, true, NULL, aurEff);
|
||||
victim->CastSpell(victim, 27827, true, nullptr, aurEff);
|
||||
spiritOfRedemption = true;
|
||||
}
|
||||
}
|
||||
@@ -17336,7 +17336,7 @@ void Unit::SetFeared(bool apply)
|
||||
caster = ObjectAccessor::GetUnit(*this, fearAuras.front()->GetCasterGUID());
|
||||
if (!caster)
|
||||
caster = getAttackerForHelper();
|
||||
GetMotionMaster()->MoveFleeing(caster, fearAuras.empty() ? sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY) : 0); // caster == NULL processed in MoveFleeing
|
||||
GetMotionMaster()->MoveFleeing(caster, fearAuras.empty() ? sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY) : 0); // caster == nullptr processed in MoveFleeing
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -18599,7 +18599,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
|
||||
bp0[j] = spellEntry->Effects[j].BasePoints;
|
||||
|
||||
bp0[i] = seatId;
|
||||
Aura::TryRefreshStackOrCreate(spellEntry, MAX_EFFECT_MASK, this, clicker, bp0, NULL, origCasterGUID);
|
||||
Aura::TryRefreshStackOrCreate(spellEntry, MAX_EFFECT_MASK, this, clicker, bp0, nullptr, origCasterGUID);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1274,11 +1274,11 @@ struct AttackPosition {
|
||||
{
|
||||
if (!val)
|
||||
{
|
||||
// _pos = NULL;
|
||||
// _pos = nullptr;
|
||||
_taken = false;
|
||||
return 0; // NULL
|
||||
return 0; // nullptr
|
||||
}
|
||||
return 0; // NULL
|
||||
return 0; // nullptr
|
||||
};
|
||||
Position _pos;
|
||||
bool _taken;
|
||||
|
||||
@@ -65,7 +65,7 @@ private:
|
||||
void InitMovementInfoForBase();
|
||||
|
||||
/// This method transforms supplied transport offsets into global coordinates
|
||||
void CalculatePassengerPosition(float& x, float& y, float& z, float* o /*= NULL*/) const override
|
||||
void CalculatePassengerPosition(float& x, float& y, float& z, float* o /*= nullptr*/) const override
|
||||
{
|
||||
TransportBase::CalculatePassengerPosition(x, y, z, o,
|
||||
GetBase()->GetPositionX(), GetBase()->GetPositionY(),
|
||||
@@ -73,7 +73,7 @@ private:
|
||||
}
|
||||
|
||||
/// This method transforms supplied global coordinates into local offsets
|
||||
void CalculatePassengerOffset(float& x, float& y, float& z, float* o /*= NULL*/) const override
|
||||
void CalculatePassengerOffset(float& x, float& y, float& z, float* o /*= nullptr*/) const override
|
||||
{
|
||||
TransportBase::CalculatePassengerOffset(x, y, z, o,
|
||||
GetBase()->GetPositionX(), GetBase()->GetPositionY(),
|
||||
|
||||
Reference in New Issue
Block a user