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:
Kitzunu
2020-08-31 11:55:09 +02:00
committed by GitHub
parent 38903b5dfb
commit 1f89282b22
325 changed files with 2348 additions and 2348 deletions
@@ -244,7 +244,7 @@ public:
void SendLavaWaves(bool start)
{
Unit* cr = NULL;
Unit* cr = nullptr;
for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
{
cr = ObjectAccessor::GetUnit(*me, *itr);
@@ -262,7 +262,7 @@ public:
{
if (pInstance)
{
Unit* cr = NULL;
Unit* cr = nullptr;
for (uint8 i = 0; i < 3; ++i)
if ((cr = ObjectAccessor::GetUnit(*me, pInstance->GetData64(DATA_TENEBRON+i))))
{
@@ -301,7 +301,7 @@ public:
{
if (pInstance)
{
Creature* cr = NULL;
Creature* cr = nullptr;
for (uint8 i = 0; i < 3; ++i)
if (dragons[i])
if ((cr = ObjectAccessor::GetCreature(*me, dragons[i])))
@@ -482,7 +482,7 @@ void boss_sartharion::boss_sartharionAI::HandleSartharionAbilities()
if (!urand(0,2))
Talk(SAY_SARTHARION_SPECIAL_4);
Creature* cr = NULL;
Creature* cr = nullptr;
summons.RemoveNotExisting();
uint8 rand = urand(0,4); // 5 - numer of cyclones
uint8 iter = 0;
@@ -514,7 +514,7 @@ void boss_sartharion::boss_sartharionAI::HandleSartharionAbilities()
if (me->HealthBelowPct(11))
{
Creature* cr = NULL;
Creature* cr = nullptr;
summons.RemoveNotExisting();
for (SummonList::iterator i = summons.begin(); i != summons.end(); ++i)
{
@@ -765,7 +765,7 @@ public:
case EVENT_MINIBOSS_SPAWN_HELPERS:
{
Talk(WHISPER_HATCH_EGGS);
Creature* cr = NULL;
Creature* cr = nullptr;
for (uint8 i = 0; i < 6; ++i)
{
if ((cr = me->SummonCreature(NPC_TWILIGHT_EGG, EggsPos[isSartharion ? i+6 : i].GetPositionX(), EggsPos[isSartharion ? i+6 : i].GetPositionY(), EggsPos[isSartharion ? i+6 : i].GetPositionZ(), EggsPos[isSartharion ? i+6 : i].GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000)))
@@ -781,7 +781,7 @@ public:
}
case EVENT_MINIBOSS_HATCH_EGGS:
{
Creature* cr = NULL;
Creature* cr = nullptr;
summons.RemoveNotExisting();
summons.DespawnEntry(NPC_TWILIGHT_WHELP);
for (SummonList::iterator i = summons.begin(); i != summons.end(); ++i)
@@ -374,8 +374,8 @@ class boss_halion : public CreatureScript
events.ScheduleEvent(EVENT_BREATH, urand(10000, 12000));
break;
case EVENT_ACTIVATE_FIREWALL:
instance->HandleGameObject(instance->GetData64(GO_FLAME_RING), false, NULL);
instance->HandleGameObject(instance->GetData64(GO_TWILIGHT_FLAME_RING), false, NULL);
instance->HandleGameObject(instance->GetData64(GO_FLAME_RING), false, nullptr);
instance->HandleGameObject(instance->GetData64(GO_TWILIGHT_FLAME_RING), false, nullptr);
break;
case EVENT_METEOR_STRIKE:
_livingEmberCount = summons.GetEntryCount(NPC_LIVING_EMBER);
@@ -988,7 +988,7 @@ class spell_halion_marks : public SpellScriptLoader
if (!GetTarget()->GetInstanceScript() || !GetTarget()->GetInstanceScript()->IsEncounterInProgress() || GetTarget()->GetMapId() != 724)
return;
GetTarget()->CastCustomSpell(_summonSpellId, SPELLVALUE_BASE_POINT1, GetAura()->GetStackAmount(), GetTarget(), TRIGGERED_FULL_MASK, NULL, NULL, GetCasterGUID());
GetTarget()->CastCustomSpell(_summonSpellId, SPELLVALUE_BASE_POINT1, GetAura()->GetStackAmount(), GetTarget(), TRIGGERED_FULL_MASK, nullptr, nullptr, GetCasterGUID());
}
void Register()
@@ -813,7 +813,7 @@ class spell_reflective_shield : public SpellScriptLoader
if( GetOwner() && attacker->GetGUID() != GetOwner()->GetGUID() )
{
int32 damage = (int32)(absorbAmount*0.25f);
GetOwner()->ToUnit()->CastCustomSpell(attacker, 33619, &damage, NULL, NULL, true);
GetOwner()->ToUnit()->CastCustomSpell(attacker, 33619, &damage, nullptr, nullptr, true);
}
}
@@ -522,7 +522,7 @@ public:
return;
}
Start(false, true, 0, NULL);
Start(false, true, 0, nullptr);
}
void DamageTaken(Unit*, uint32 &damage, DamageEffectType, SpellSchoolMask)
@@ -809,7 +809,7 @@ public:
break;
case EVENT_SHAMAN_SPELL_HEALING_WAVE:
{
Unit* target = NULL;
Unit* target = nullptr;
if( urand(0,1) )
{
target = DoSelectLowestHpFriendly(40.0f);
@@ -376,7 +376,7 @@ public:
pInstance->SetData(TYPE_ANUBARAK, DONE);
Player* plr = NULL;
Player* plr = nullptr;
if( !pInstance->instance->GetPlayers().isEmpty() )
plr = pInstance->instance->GetPlayers().begin()->GetSource();
@@ -82,7 +82,7 @@ struct boss_faction_championsAI : public ScriptedAI
const float dist_factor = (mAIType == AI_MELEE || mAIType == AI_PET ? 15.0f : 25.0f);
float mod_dist = dist_factor/(dist_factor + dist); // 0.2 .. 1.0
float mod_health = health > 40000 ? 2.0f : (60000-health)/10000.0f; // 2.0 .. 6.0
float mod_armor = (mAIType == AI_MELEE || mAIType == AI_PET) ? Unit::CalcArmorReducedDamage(me, target, 10000, NULL)/10000.0f : 1.0f;
float mod_armor = (mAIType == AI_MELEE || mAIType == AI_PET) ? Unit::CalcArmorReducedDamage(me, target, 10000, nullptr)/10000.0f : 1.0f;
return mod_dist * mod_health * mod_armor;
}
@@ -149,7 +149,7 @@ struct boss_faction_championsAI : public ScriptedAI
{
std::list<Creature *> lst = DoFindFriendlyMissingBuff(range, spell);
if( lst.empty() )
return NULL;
return nullptr;
std::list<Creature *>::const_iterator iter = lst.begin();
uint32 lowestHP = (*iter)->GetMaxHealth() - (*iter)->GetHealth();
for( std::list<Creature *>::const_iterator itr = lst.begin(); itr != lst.end(); ++itr )
@@ -185,7 +185,7 @@ struct boss_faction_championsAI : public ScriptedAI
if( target && target->getPowerType() == POWER_MANA && (!casting || target->HasUnitState(UNIT_STATE_CASTING)) && me->GetExactDist(target) <= range )
return target;
}
return NULL;
return nullptr;
}
void UpdateAI(uint32 diff)
@@ -1007,7 +1007,7 @@ public:
pInstance->SetData(TYPE_ICEHOWL, DONE);
Player* plr = NULL;
Player* plr = nullptr;
if( !pInstance->instance->GetPlayers().isEmpty() )
plr = pInstance->instance->GetPlayers().begin()->GetSource();
@@ -358,7 +358,7 @@ public:
c->DespawnOrUnsummon(10000);
if( Creature* c = instance->GetCreature(NPC_DreadscaleGUID) )
c->DespawnOrUnsummon(10000);
if( AchievementTimer+10 >= time(NULL) )
if( AchievementTimer+10 >= time(nullptr) )
DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, SPELL_JORMUNGAR_ACHIEV);
AchievementTimer = 0;
@@ -375,7 +375,7 @@ public:
}
else // first one died, start timer for achievement
{
AchievementTimer = time(NULL);
AchievementTimer = time(nullptr);
}
}
else
@@ -464,14 +464,14 @@ public:
HandleGameObject(GO_EnterGateGUID, true);
if( AchievementTimer+60 >= time(NULL) )
if( AchievementTimer+60 >= time(nullptr) )
DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, SPELL_RESILIENCE_WILL_FIX_IT_CREDIT);
AchievementTimer = 0;
SaveToDB();
}
else if( Counter == 1 )
AchievementTimer = time(NULL);
AchievementTimer = time(nullptr);
}
break;
case TYPE_FACTION_CHAMPIONS_START:
@@ -174,17 +174,17 @@ class boss_novos : public CreatureScript
{
case EVENT_SUMMON_FETID_TROLL:
if (Creature* trigger = summons.GetCreatureWithEntry(NPC_CRYSTAL_CHANNEL_TARGET))
trigger->CastSpell(trigger, SPELL_SUMMON_FETID_TROLL_CORPSE, true, NULL, NULL, me->GetGUID());
trigger->CastSpell(trigger, SPELL_SUMMON_FETID_TROLL_CORPSE, true, nullptr, nullptr, me->GetGUID());
events.ScheduleEvent(EVENT_SUMMON_FETID_TROLL, 3000);
break;
case EVENT_SUMMON_HULKING_CORPSE:
if (Creature* trigger = summons.GetCreatureWithEntry(NPC_CRYSTAL_CHANNEL_TARGET))
trigger->CastSpell(trigger, SPELL_SUMMON_HULKING_CORPSE, true, NULL, NULL, me->GetGUID());
trigger->CastSpell(trigger, SPELL_SUMMON_HULKING_CORPSE, true, nullptr, nullptr, me->GetGUID());
events.ScheduleEvent(EVENT_SUMMON_HULKING_CORPSE, 30000);
break;
case EVENT_SUMMON_SHADOWCASTER:
if (Creature* trigger = summons.GetCreatureWithEntry(NPC_CRYSTAL_CHANNEL_TARGET))
trigger->CastSpell(trigger, SPELL_SUMMON_RISEN_SHADOWCASTER, true, NULL, NULL, me->GetGUID());
trigger->CastSpell(trigger, SPELL_SUMMON_RISEN_SHADOWCASTER, true, nullptr, nullptr, me->GetGUID());
events.ScheduleEvent(EVENT_SUMMON_SHADOWCASTER, 10000);
break;
case EVENT_SUMMON_CRYSTAL_HANDLER:
@@ -193,7 +193,7 @@ class boss_novos : public CreatureScript
Talk(SAY_SUMMONING_ADDS);
Talk(EMOTE_SUMMONING_ADDS);
if (Creature* target = ObjectAccessor::GetCreature(*me, _stage ? _summonTargetLeftGUID : _summonTargetRightGUID))
target->CastSpell(target, SPELL_SUMMON_CRYSTAL_HANDLER, true, NULL, NULL, me->GetGUID());
target->CastSpell(target, SPELL_SUMMON_CRYSTAL_HANDLER, true, nullptr, nullptr, me->GetGUID());
_stage = _stage ? 0 : 1;
events.ScheduleEvent(EVENT_SUMMON_CRYSTAL_HANDLER, 20000);
}
@@ -203,7 +203,7 @@ public:
outroTimer = 0;
outroStep = 0;
T1 = NULL;
T1 = nullptr;
}
bool IsEncounterInProgress() const
@@ -1115,7 +1115,7 @@ public:
me->DeleteThreatList();
me->CombatStop(true);
me->LoadCreaturesAddon(true);
me->SetLootRecipient(NULL);
me->SetLootRecipient(nullptr);
me->ResetPlayerDamageReq();
me->SetLastDamagedTime(0);
}
@@ -864,7 +864,7 @@ class boss_prince_valanar_icc : public CreatureScript
{
case NPC_KINETIC_BOMB_TARGET:
summon->SetReactState(REACT_PASSIVE);
summon->CastSpell(summon, SPELL_KINETIC_BOMB, true, NULL, NULL, me->GetGUID());
summon->CastSpell(summon, SPELL_KINETIC_BOMB, true, nullptr, nullptr, me->GetGUID());
break;
case NPC_SHOCK_VORTEX:
summon->m_Events.AddEvent(new ShockVortexExplodeEvent(*summon), summon->m_Events.CalculateTime(4500));
@@ -1259,7 +1259,7 @@ class npc_ball_of_flame : public CreatureScript
{
if (action != ACTION_FLAME_BALL_CHASE || me->IsInCombat())
return;
Player* target = NULL;
Player* target = nullptr;
if (_chaseGUID)
target = ObjectAccessor::GetPlayer(*me, _chaseGUID);
if (!target)
@@ -319,7 +319,7 @@ class boss_blood_queen_lana_thel : public CreatureScript
break;
case EVENT_VAMPIRIC_BITE:
{
Player* target = NULL;
Player* target = nullptr;
float maxThreat = 0.0f;
const Map::PlayerList &pl = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
@@ -396,7 +396,7 @@ class boss_blood_queen_lana_thel : public CreatureScript
case EVENT_DELIRIOUS_SLASH:
if (!me->HasReactState(REACT_PASSIVE))
{
Unit* target = NULL;
Unit* target = nullptr;
if (_offtankGUID)
if (Unit* t = ObjectAccessor::GetUnit(*me, _offtankGUID))
if (t->IsAlive() && t->GetDistance(me) < 10.0f)
@@ -964,7 +964,7 @@ class spell_blood_queen_presence_of_the_darkfallen : public SpellScriptLoader
return;
if (InstanceScript* instance = GetHitUnit()->GetInstanceScript())
GetHitUnit()->CastSpell((Unit*)NULL, GetSpellInfo()->Effects[effIndex].TriggerSpell, true, NULL, NULL, instance->GetData64(DATA_BLOOD_QUEEN_LANA_THEL));
GetHitUnit()->CastSpell((Unit*)NULL, GetSpellInfo()->Effects[effIndex].TriggerSpell, true, nullptr, nullptr, instance->GetData64(DATA_BLOOD_QUEEN_LANA_THEL));
}
void Register()
@@ -1231,7 +1231,7 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader
bool Load()
{
// initialize variable
target = NULL;
target = nullptr;
return true;
}
@@ -206,7 +206,7 @@ class boss_festergut : public CreatureScript
// just cast and dont bother with target, conditions will handle it
++_inhaleCounter;
if (_inhaleCounter < 3)
me->CastSpell(me, gaseousBlight[_inhaleCounter], true, NULL, NULL, me->GetGUID());
me->CastSpell(me, gaseousBlight[_inhaleCounter], true, nullptr, nullptr, me->GetGUID());
}
events.ScheduleEvent(EVENT_INHALE_BLIGHT, 34000);
@@ -387,7 +387,7 @@ class PassengerController
public:
PassengerController()
{
ResetSlots(TEAM_HORDE, NULL);
ResetSlots(TEAM_HORDE, nullptr);
}
void ResetSlots(TeamId teamId, MotionTransport* t)
@@ -405,7 +405,7 @@ public:
return false;
bool summoned = false;
time_t now = time(NULL);
time_t now = time(nullptr);
for (int32 i = first; i <= last; ++i)
{
if (_respawnCooldowns[i] > now)
@@ -441,7 +441,7 @@ public:
void ClearSlot(PassengerSlots slot)
{
_controlledSlots[slot] = 0;
_respawnCooldowns[slot] = time(NULL) + _slotInfo[slot].Cooldown;
_respawnCooldowns[slot] = time(nullptr) + _slotInfo[slot].Cooldown;
}
private:
@@ -534,7 +534,7 @@ class npc_gunship : public CreatureScript
if (damage >= me->GetHealth())
{
JustDied(NULL);
JustDied(nullptr);
damage = me->GetHealth() - 1;
return;
}
@@ -574,7 +574,7 @@ class npc_gunship : public CreatureScript
a->SetDuration(0);
uint32 explosionSpell = isVictory ? SPELL_EXPLOSION_VICTORY : SPELL_EXPLOSION_WIPE;
if (MotionTransport* t = (me->GetTransport() ? me->GetTransport()->ToMotionTransport() : NULL))
if (MotionTransport* t = (me->GetTransport() ? me->GetTransport()->ToMotionTransport() : nullptr))
{
Transport::PassengerSet const& passengers = t->GetStaticPassengers();
for (Transport::PassengerSet::const_iterator itr = passengers.begin(); itr != passengers.end(); ++itr)
@@ -711,7 +711,7 @@ class npc_gunship : public CreatureScript
CreatureAI* GetAI(Creature* creature) const
{
if (!creature->GetTransport())
return NULL;
return nullptr;
return GetIcecrownCitadelAI<npc_gunshipAI>(creature);
}
@@ -730,7 +730,7 @@ class npc_high_overlord_saurfang_igb : public CreatureScript
_controller.ResetSlots(TEAM_HORDE, creature->GetTransport()->ToMotionTransport());
me->SetRegeneratingHealth(false);
me->m_CombatDistance = 70.0f;
_firstMageCooldown = time(NULL) + 45;
_firstMageCooldown = time(nullptr) + 45;
_axethrowersYellCooldown = time_t(0);
_rocketeersYellCooldown = time_t(0);
checkTimer = 1000;
@@ -795,7 +795,7 @@ class npc_high_overlord_saurfang_igb : public CreatureScript
}
else if (action == ACTION_SPAWN_MAGE)
{
time_t now = time(NULL);
time_t now = time(nullptr);
if (_firstMageCooldown > now)
_events.ScheduleEvent(EVENT_SUMMON_MAGE, (_firstMageCooldown - now) * IN_MILLISECONDS);
else
@@ -943,7 +943,7 @@ class npc_high_overlord_saurfang_igb : public CreatureScript
_controller.SummonCreatures(me, SLOT_MAGE_1, SLOT_MAGE_2);
_controller.SummonCreatures(me, SLOT_MARINE_1, Is25ManRaid() ? SLOT_MARINE_4 : SLOT_MARINE_2);
_controller.SummonCreatures(me, SLOT_SERGEANT_1, Is25ManRaid() ? SLOT_SERGEANT_2 : SLOT_SERGEANT_1);
if (MotionTransport* orgrimsHammer = (me->GetTransport() ? me->GetTransport()->ToMotionTransport() : NULL))
if (MotionTransport* orgrimsHammer = (me->GetTransport() ? me->GetTransport()->ToMotionTransport() : nullptr))
{
float x,y,z,o;
OrgrimsHammerTeleportPortal.GetPosition(x,y,z,o);
@@ -970,10 +970,10 @@ class npc_high_overlord_saurfang_igb : public CreatureScript
case EVENT_CHECK_RIFLEMAN:
if (_controller.SummonCreatures(me, SLOT_RIFLEMAN_1, Is25ManRaid() ? SLOT_RIFLEMAN_8 : SLOT_RIFLEMAN_4))
{
if (_axethrowersYellCooldown < time(NULL))
if (_axethrowersYellCooldown < time(nullptr))
{
Talk(SAY_SAURFANG_AXETHROWERS);
_axethrowersYellCooldown = time(NULL) + 5;
_axethrowersYellCooldown = time(nullptr) + 5;
}
}
_events.ScheduleEvent(EVENT_CHECK_RIFLEMAN, 1500);
@@ -981,10 +981,10 @@ class npc_high_overlord_saurfang_igb : public CreatureScript
case EVENT_CHECK_MORTAR:
if (_controller.SummonCreatures(me, SLOT_MORTAR_1, Is25ManRaid() ? SLOT_MORTAR_4 : SLOT_MORTAR_2))
{
if (_rocketeersYellCooldown < time(NULL))
if (_rocketeersYellCooldown < time(nullptr))
{
Talk(SAY_SAURFANG_ROCKETEERS);
_rocketeersYellCooldown = time(NULL) + 5;
_rocketeersYellCooldown = time(nullptr) + 5;
}
}
_events.ScheduleEvent(EVENT_CHECK_MORTAR, 1500);
@@ -1065,7 +1065,7 @@ class npc_muradin_bronzebeard_igb : public CreatureScript
_controller.ResetSlots(TEAM_ALLIANCE, creature->GetTransport()->ToMotionTransport());
me->SetRegeneratingHealth(false);
me->m_CombatDistance = 70.0f;
_firstMageCooldown = time(NULL) + 45;
_firstMageCooldown = time(nullptr) + 45;
_riflemanYellCooldown = time_t(0);
_mortarYellCooldown = time_t(0);
checkTimer = 1000;
@@ -1131,7 +1131,7 @@ class npc_muradin_bronzebeard_igb : public CreatureScript
}
else if (action == ACTION_SPAWN_MAGE)
{
time_t now = time(NULL);
time_t now = time(nullptr);
if (_firstMageCooldown > now)
_events.ScheduleEvent(EVENT_SUMMON_MAGE, (_firstMageCooldown - now) * IN_MILLISECONDS);
else
@@ -1282,7 +1282,7 @@ class npc_muradin_bronzebeard_igb : public CreatureScript
_controller.SummonCreatures(me, SLOT_MAGE_1, SLOT_MAGE_2);
_controller.SummonCreatures(me, SLOT_MARINE_1, Is25ManRaid() ? SLOT_MARINE_4 : SLOT_MARINE_2);
_controller.SummonCreatures(me, SLOT_SERGEANT_1, Is25ManRaid() ? SLOT_SERGEANT_2 : SLOT_SERGEANT_1);
if (MotionTransport* skybreaker = (me->GetTransport() ? me->GetTransport()->ToMotionTransport() : NULL))
if (MotionTransport* skybreaker = (me->GetTransport() ? me->GetTransport()->ToMotionTransport() : nullptr))
{
float x,y,z,o;
SkybreakerTeleportPortal.GetPosition(x,y,z,o);
@@ -1309,10 +1309,10 @@ class npc_muradin_bronzebeard_igb : public CreatureScript
case EVENT_CHECK_RIFLEMAN:
if (_controller.SummonCreatures(me, SLOT_RIFLEMAN_1, Is25ManRaid() ? SLOT_RIFLEMAN_8 : SLOT_RIFLEMAN_4))
{
if (_riflemanYellCooldown < time(NULL))
if (_riflemanYellCooldown < time(nullptr))
{
Talk(SAY_MURADIN_RIFLEMAN);
_riflemanYellCooldown = time(NULL) + 5;
_riflemanYellCooldown = time(nullptr) + 5;
}
}
_events.ScheduleEvent(EVENT_CHECK_RIFLEMAN, 1500);
@@ -1320,10 +1320,10 @@ class npc_muradin_bronzebeard_igb : public CreatureScript
case EVENT_CHECK_MORTAR:
if (_controller.SummonCreatures(me, SLOT_MORTAR_1, Is25ManRaid() ? SLOT_MORTAR_4 : SLOT_MORTAR_2))
{
if (_mortarYellCooldown < time(NULL))
if (_mortarYellCooldown < time(nullptr))
{
Talk(SAY_MURADIN_MORTAR);
_mortarYellCooldown = time(NULL) + 5;
_mortarYellCooldown = time(nullptr) + 5;
}
}
_events.ScheduleEvent(EVENT_CHECK_MORTAR, 1500);
@@ -1452,7 +1452,7 @@ void TriggerBurningPitch(Creature* c)
struct gunship_npc_AI : public ScriptedAI
{
gunship_npc_AI(Creature* creature) : ScriptedAI(creature), Instance(creature->GetInstanceScript()), Slot(NULL), Index(uint32(-1))
gunship_npc_AI(Creature* creature) : ScriptedAI(creature), Instance(creature->GetInstanceScript()), Slot(nullptr), Index(uint32(-1))
{
me->SetRegeneratingHealth(false);
}
@@ -1514,7 +1514,7 @@ protected:
struct npc_gunship_boarding_addAI : public ScriptedAI
{
npc_gunship_boarding_addAI(Creature* creature) : ScriptedAI(creature), Instance(creature->GetInstanceScript()), Slot(NULL), Index(uint32(-1))
npc_gunship_boarding_addAI(Creature* creature) : ScriptedAI(creature), Instance(creature->GetInstanceScript()), Slot(nullptr), Index(uint32(-1))
{
anyValid = true;
checkTimer = 1000;
@@ -2077,7 +2077,7 @@ class spell_igb_check_for_players : public SpellScriptLoader
void TriggerWipe()
{
if (!_playerCount)
GetCaster()->ToCreature()->AI()->JustDied(NULL);
GetCaster()->ToCreature()->AI()->JustDied(nullptr);
}
void TeleportPlayer(SpellEffIndex /*effIndex*/)
@@ -417,7 +417,7 @@ class boss_professor_putricide : public CreatureScript
instance->SetBossState(DATA_FESTERGUT, IN_PROGRESS);
me->SetFacingTo(festergutWatchPos.GetOrientation());
DoAction(ACTION_FESTERGUT_GAS);
c->CastSpell(c, SPELL_GASEOUS_BLIGHT_LARGE, true, NULL, NULL, c->GetGUID());
c->CastSpell(c, SPELL_GASEOUS_BLIGHT_LARGE, true, nullptr, nullptr, c->GetGUID());
}
else
{
@@ -982,7 +982,7 @@ class spell_putricide_unstable_experiment : public SpellScriptLoader
uint8 stage = creature->AI()->GetData(DATA_EXPERIMENT_STAGE);
creature->AI()->SetData(DATA_EXPERIMENT_STAGE, stage ? 0 : 1);
Creature* target = NULL;
Creature* target = nullptr;
std::list<Creature*> creList;
GetCreatureListWithEntryInGrid(creList, GetCaster(), NPC_ABOMINATION_WING_MAD_SCIENTIST_STALKER, 200.0f);
for (std::list<Creature*>::iterator itr = creList.begin(); itr != creList.end(); ++itr)
@@ -996,7 +996,7 @@ class spell_putricide_unstable_experiment : public SpellScriptLoader
if (aura->GetOwner() == target) // avoid assert(false) at any cost
aura->UpdateOwner(5000, target); // update whole aura so previous periodic ticks before refreshed by new one
GetCaster()->CastSpell(target, uint32(GetSpellInfo()->Effects[stage].CalcValue()), true, NULL, NULL, GetCaster()->GetGUID());
GetCaster()->CastSpell(target, uint32(GetSpellInfo()->Effects[stage].CalcValue()), true, nullptr, nullptr, GetCaster()->GetGUID());
}
void Register()
@@ -1094,7 +1094,7 @@ class spell_putricide_ooze_channel : public SpellScriptLoader
// this will let use safely use ToCreature() casts in entire script
bool Load()
{
_target = NULL;
_target = nullptr;
return GetCaster()->GetTypeId() == TYPEID_UNIT;
}
@@ -1218,7 +1218,7 @@ class spell_putricide_mutated_plague : public SpellScriptLoader
spell = sSpellMgr->GetSpellForDifficultyFromSpell(spell, GetTarget());
int32 healAmount = spell->Effects[EFFECT_0].CalcValue();
healAmount *= GetStackAmount();
GetTarget()->CastCustomSpell(healSpell, SPELLVALUE_BASE_POINT0, healAmount, GetTarget(), TRIGGERED_FULL_MASK, NULL, NULL, GetCasterGUID());
GetTarget()->CastCustomSpell(healSpell, SPELLVALUE_BASE_POINT0, healAmount, GetTarget(), TRIGGERED_FULL_MASK, nullptr, nullptr, GetCasterGUID());
}
void Register()
@@ -1361,7 +1361,7 @@ class spell_putricide_choking_gas_bomb : public SpellScriptLoader
continue;
uint32 spellId = uint32(GetSpellInfo()->Effects[i].CalcValue());
GetCaster()->CastSpell(GetCaster(), spellId, true, NULL, NULL, GetCaster()->GetGUID());
GetCaster()->CastSpell(GetCaster(), spellId, true, nullptr, nullptr, GetCaster()->GetGUID());
}
}
@@ -494,7 +494,7 @@ class spell_rotface_mutated_infection : public SpellScriptLoader
bool Load()
{
_target = NULL;
_target = nullptr;
return true;
}
@@ -656,7 +656,7 @@ class spell_rotface_large_ooze_combine : public SpellScriptLoader
if (Creature* cre = GetCaster()->ToCreature())
cre->AI()->DoAction(EVENT_STICKY_OOZE);
GetCaster()->CastSpell(GetCaster(), SPELL_UNSTABLE_OOZE_EXPLOSION, false, NULL, NULL, GetCaster()->GetGUID());
GetCaster()->CastSpell(GetCaster(), SPELL_UNSTABLE_OOZE_EXPLOSION, false, nullptr, nullptr, GetCaster()->GetGUID());
if (InstanceScript* instance = GetCaster()->GetInstanceScript())
instance->SetData(DATA_OOZE_DANCE_ACHIEVEMENT, uint32(false));
}
@@ -719,7 +719,7 @@ class spell_rotface_large_ooze_buff_combine : public SpellScriptLoader
if (Creature* cre = GetCaster()->ToCreature())
cre->AI()->DoAction(EVENT_STICKY_OOZE);
GetCaster()->CastSpell(GetCaster(), SPELL_UNSTABLE_OOZE_EXPLOSION, false, NULL, NULL, GetCaster()->GetGUID());
GetCaster()->CastSpell(GetCaster(), SPELL_UNSTABLE_OOZE_EXPLOSION, false, nullptr, nullptr, GetCaster()->GetGUID());
if (InstanceScript* instance = GetCaster()->GetInstanceScript())
instance->SetData(DATA_OOZE_DANCE_ACHIEVEMENT, uint32(false));
}
@@ -803,7 +803,7 @@ class spell_rotface_unstable_ooze_explosion : public SpellScriptLoader
// let Rotface handle the cast - caster dies before this executes
if (InstanceScript* script = GetCaster()->GetInstanceScript())
if (Creature* rotface = script->instance->GetCreature(script->GetData64(DATA_ROTFACE)))
rotface->CastSpell(x, y, z, triggered_spell_id, true/*, NULL, NULL, GetCaster()->GetGUID()*/); // caster not available on clientside, no log in such case
rotface->CastSpell(x, y, z, triggered_spell_id, true/*, nullptr, nullptr, GetCaster()->GetGUID()*/); // caster not available on clientside, no log in such case
}
void Register()
@@ -178,7 +178,7 @@ class FrostBombExplosion : public BasicEvent
bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/)
{
_owner->CastSpell((Unit*)NULL, SPELL_FROST_BOMB, false, NULL, NULL, _sindragosaGUID);
_owner->CastSpell((Unit*)NULL, SPELL_FROST_BOMB, false, nullptr, nullptr, _sindragosaGUID);
_owner->RemoveAurasDueToSpell(SPELL_FROST_BOMB_VISUAL);
return true;
}
@@ -440,7 +440,7 @@ class boss_sindragosa : public CreatureScript
events.ScheduleEvent(EVENT_AIR_MOVEMENT, 0);
break;
case POINT_AIR_PHASE:
me->CastCustomSpell(SPELL_ICE_TOMB_TARGET, SPELLVALUE_MAX_TARGETS, RAID_MODE<int32>(2, 5, 2, 6), NULL);
me->CastCustomSpell(SPELL_ICE_TOMB_TARGET, SPELLVALUE_MAX_TARGETS, RAID_MODE<int32>(2, 5, 2, 6), nullptr);
me->SetFacingTo(float(M_PI));
events.ScheduleEvent(EVENT_AIR_MOVEMENT_FAR, 0); // won't be processed during cast time anyway, so 0
events.ScheduleEvent(EVENT_FROST_BOMB, 7000);
@@ -686,9 +686,9 @@ class boss_the_lich_king : public CreatureScript
void KilledUnit(Unit* victim)
{
if (victim->GetTypeId() == TYPEID_PLAYER && !me->IsInEvadeMode() && _phase != PHASE_OUTRO && _lastTalkTimeKill+5 < time(NULL))
if (victim->GetTypeId() == TYPEID_PLAYER && !me->IsInEvadeMode() && _phase != PHASE_OUTRO && _lastTalkTimeKill+5 < time(nullptr))
{
_lastTalkTimeKill = time(NULL);
_lastTalkTimeKill = time(nullptr);
Talk(SAY_LK_KILL);
}
}
@@ -717,7 +717,7 @@ class boss_the_lich_king : public CreatureScript
events.RescheduleEvent(EVENT_START_ATTACK, 1000);
EntryCheckPredicate pred(NPC_STRANGULATE_VEHICLE);
summons.DoAction(ACTION_TELEPORT_BACK, pred);
if (!IsHeroic() && _phase != PHASE_OUTRO && me->IsInCombat() && _lastTalkTimeBuff+5 <= time(NULL))
if (!IsHeroic() && _phase != PHASE_OUTRO && me->IsInCombat() && _lastTalkTimeBuff+5 <= time(nullptr))
Talk(SAY_LK_FROSTMOURNE_ESCAPE);
}
break;
@@ -874,9 +874,9 @@ class boss_the_lich_king : public CreatureScript
void SpellHit(Unit* /*caster*/, SpellInfo const* spell)
{
if (spell->Id == HARVESTED_SOUL_BUFF && me->IsInCombat() && !IsHeroic() && _phase != PHASE_OUTRO && _lastTalkTimeBuff+5 <= time(NULL))
if (spell->Id == HARVESTED_SOUL_BUFF && me->IsInCombat() && !IsHeroic() && _phase != PHASE_OUTRO && _lastTalkTimeBuff+5 <= time(nullptr))
{
_lastTalkTimeBuff = time(NULL);
_lastTalkTimeBuff = time(nullptr);
Talk(SAY_LK_FROSTMOURNE_KILL);
}
}
@@ -1648,7 +1648,7 @@ class spell_the_lich_king_quake : public SpellScriptLoader
bool Load()
{
return GetCaster()->GetInstanceScript() != NULL;
return GetCaster()->GetInstanceScript() != nullptr;
}
void FilterTargets(std::list<WorldObject*>& targets)
@@ -1914,7 +1914,7 @@ class spell_the_lich_king_necrotic_plague : public SpellScriptLoader
CustomSpellValues values;
if (dispel)
values.AddSpellMod(SPELLVALUE_BASE_POINT1, AURA_REMOVE_BY_ENEMY_SPELL); // add as marker (spell has no effect 1)
GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, NULL, TRIGGERED_FULL_MASK, NULL, NULL, GetCasterGUID());
GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, NULL, TRIGGERED_FULL_MASK, nullptr, nullptr, GetCasterGUID());
if (Unit* caster = GetCaster())
caster->CastSpell(caster, SPELL_PLAGUE_SIPHON, true);
@@ -2021,7 +2021,7 @@ class spell_the_lich_king_necrotic_plague_jump : public SpellScriptLoader
CustomSpellValues values;
values.AddSpellMod(SPELLVALUE_AURA_STACK, GetStackAmount());
GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, NULL, TRIGGERED_FULL_MASK, NULL, NULL, GetCasterGUID());
GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, NULL, TRIGGERED_FULL_MASK, nullptr, nullptr, GetCasterGUID());
if (Unit* caster = GetCaster())
caster->CastSpell(caster, SPELL_PLAGUE_SIPHON, true);
}
@@ -2040,7 +2040,7 @@ class spell_the_lich_king_necrotic_plague_jump : public SpellScriptLoader
CustomSpellValues values;
values.AddSpellMod(SPELLVALUE_AURA_STACK, GetStackAmount());
values.AddSpellMod(SPELLVALUE_BASE_POINT1, AURA_REMOVE_BY_ENEMY_SPELL); // add as marker (spell has no effect 1)
GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, NULL, TRIGGERED_FULL_MASK, NULL, NULL, GetCasterGUID());
GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, NULL, TRIGGERED_FULL_MASK, nullptr, nullptr, GetCasterGUID());
if (Unit* caster = GetCaster())
caster->CastSpell(caster, SPELL_PLAGUE_SIPHON, true);
@@ -2365,7 +2365,7 @@ class npc_raging_spirit : public CreatureScript
if (Player* plr = ScriptedAI::SelectTargetFromPlayerList(100.0f, 0, true))
AttackStart(plr);
}
DoZoneInCombat(NULL, 150.0f);
DoZoneInCombat(nullptr, 150.0f);
}
break;
case EVENT_SOUL_SHRIEK:
@@ -2594,7 +2594,7 @@ class npc_valkyr_shadowguard : public CreatureScript
}
dropped = true;
_events.Reset();
/*Player* p = NULL;
/*Player* p = nullptr;
if (Vehicle* v = me->GetVehicleKit())
if (Unit* passenger = v->GetPassenger(0))
p = passenger->ToPlayer();*/
@@ -2652,7 +2652,7 @@ class npc_valkyr_shadowguard : public CreatureScript
break;
case EVENT_MOVE_TO_SIPHON_POS:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // just in case if passenger disappears so quickly that EVENT_MOVE_TO_DROP_POS is never executed
{ int32 bp0 = 80; me->CastCustomSpell(me, 1557, &bp0, NULL, NULL, true); }
{ int32 bp0 = 80; me->CastCustomSpell(me, 1557, &bp0, nullptr, nullptr, true); }
me->SetDisableGravity(true);
me->SetHover(true);
me->SetCanFly(true);
@@ -2661,7 +2661,7 @@ class npc_valkyr_shadowguard : public CreatureScript
break;
case EVENT_LIFE_SIPHON:
{
Unit* target = NULL;
Unit* target = nullptr;
Unit::AuraEffectList const& tauntAuras = me->GetAuraEffectsByType(SPELL_AURA_MOD_TAUNT);
if (!tauntAuras.empty())
for (Unit::AuraEffectList::const_reverse_iterator itr = tauntAuras.rbegin(); itr != tauntAuras.rend(); ++itr)
@@ -2771,7 +2771,7 @@ class spell_the_lich_king_valkyr_target_search : public SpellScriptLoader
bool Load()
{
_target = NULL;
_target = nullptr;
return true;
}
@@ -2967,7 +2967,7 @@ class spell_the_lich_king_vile_spirit_move_target_search : public SpellScriptLoa
bool Load()
{
_target = NULL;
_target = nullptr;
return GetCaster()->GetTypeId() == TYPEID_UNIT;
}
@@ -3057,14 +3057,14 @@ class spell_the_lich_king_harvest_soul : public SpellScriptLoader
bool Load()
{
return GetOwner()->GetInstanceScript() != NULL;
return GetOwner()->GetInstanceScript() != nullptr;
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
// m_originalCaster to allow stacking from different casters, meh
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH)
GetTarget()->CastSpell((Unit*)NULL, SPELL_HARVESTED_SOUL_LK_BUFF, true, NULL, NULL, GetTarget()->GetInstanceScript()->GetData64(DATA_THE_LICH_KING));
GetTarget()->CastSpell((Unit*)NULL, SPELL_HARVESTED_SOUL_LK_BUFF, true, nullptr, nullptr, GetTarget()->GetInstanceScript()->GetData64(DATA_THE_LICH_KING));
}
void Register()
@@ -3142,17 +3142,17 @@ class npc_strangulate_vehicle : public CreatureScript
if (summoner->GetTypeId() == TYPEID_PLAYER && !summoner->ToPlayer()->IsBeingTeleported() && summoner->FindMap() == me->GetMap())
{
if (buff)
summoner->CastSpell((Unit*)NULL, SPELL_HARVESTED_SOUL_LK_BUFF, true, NULL, NULL, _instance->GetData64(DATA_THE_LICH_KING));
summoner->CastSpell((Unit*)NULL, SPELL_HARVESTED_SOUL_LK_BUFF, true, nullptr, nullptr, _instance->GetData64(DATA_THE_LICH_KING));
me->CastSpell(summoner, SPELL_HARVEST_SOUL_TELEPORT_BACK, false);
}
else if (buff)
me->CastSpell((Unit*)NULL, SPELL_HARVESTED_SOUL_LK_BUFF, true, NULL, NULL, _instance->GetData64(DATA_THE_LICH_KING));
me->CastSpell((Unit*)NULL, SPELL_HARVESTED_SOUL_LK_BUFF, true, nullptr, nullptr, _instance->GetData64(DATA_THE_LICH_KING));
summoner->RemoveAurasDueToSpell(IsHeroic() ? SPELL_HARVEST_SOULS_TELEPORT : SPELL_HARVEST_SOUL_TELEPORT);
}
else
me->CastSpell((Unit*)NULL, SPELL_HARVESTED_SOUL_LK_BUFF, true, NULL, NULL, _instance->GetData64(DATA_THE_LICH_KING));
me->CastSpell((Unit*)NULL, SPELL_HARVESTED_SOUL_LK_BUFF, true, nullptr, nullptr, _instance->GetData64(DATA_THE_LICH_KING));
}
_events.Reset();
@@ -3400,7 +3400,7 @@ class spell_the_lich_king_restore_soul : public SpellScriptLoader
bool Load()
{
_instance = GetCaster()->GetInstanceScript();
return _instance != NULL;
return _instance != nullptr;
}
void FilterTargets(std::list<WorldObject*>& unitList)
@@ -165,7 +165,7 @@ class DelayedCastEvent : public BasicEvent
bool Execute(uint64 /*time*/, uint32 /*diff*/)
{
_trigger->CastSpell(_trigger, _spellId, false, NULL, NULL, _originalCaster);
_trigger->CastSpell(_trigger, _spellId, false, nullptr, nullptr, _originalCaster);
if (_despawnTime)
_trigger->DespawnOrUnsummon(_despawnTime);
return true;
@@ -861,7 +861,7 @@ class npc_valithria_cloud : public CreatureScript
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MoveIdle();
// must use originalCaster the same for all clouds to allow stacking
me->CastSpell(me, EMERALD_VIGOR, false, NULL, NULL, _instance->GetData64(DATA_VALITHRIA_DREAMWALKER));
me->CastSpell(me, EMERALD_VIGOR, false, nullptr, nullptr, _instance->GetData64(DATA_VALITHRIA_DREAMWALKER));
me->DespawnOrUnsummon(1000);
break;
default:
@@ -1169,7 +1169,7 @@ class spell_dreamwalker_twisted_nightmares : public SpellScriptLoader
return;
if (InstanceScript* instance = GetHitUnit()->GetInstanceScript())
GetHitUnit()->CastSpell((Unit*)NULL, GetSpellInfo()->Effects[effIndex].TriggerSpell, true, NULL, NULL, instance->GetData64(DATA_VALITHRIA_DREAMWALKER));
GetHitUnit()->CastSpell((Unit*)NULL, GetSpellInfo()->Effects[effIndex].TriggerSpell, true, nullptr, nullptr, instance->GetData64(DATA_VALITHRIA_DREAMWALKER));
}
void Register()
@@ -1196,7 +1196,7 @@ class spell_dreamwalker_nightmare_cloud : public SpellScriptLoader
bool Load()
{
_instance = GetOwner()->GetInstanceScript();
return _instance != NULL;
return _instance != nullptr;
}
void PeriodicTick(AuraEffect const* /*aurEff*/)
@@ -1326,7 +1326,7 @@ class spell_dreamwalker_summoner : public SpellScriptLoader
if (!GetHitUnit())
return;
GetHitUnit()->CastSpell(GetCaster(), GetSpellInfo()->Effects[effIndex].TriggerSpell, true, NULL, NULL, GetCaster()->GetInstanceScript()->GetData64(DATA_VALITHRIA_LICH_KING));
GetHitUnit()->CastSpell(GetCaster(), GetSpellInfo()->Effects[effIndex].TriggerSpell, true, nullptr, nullptr, GetCaster()->GetInstanceScript()->GetData64(DATA_VALITHRIA_LICH_KING));
}
void Register()
@@ -1410,7 +1410,7 @@ class spell_dreamwalker_summon_suppresser_effect : public SpellScriptLoader
if (!GetHitUnit())
return;
GetHitUnit()->CastSpell(GetCaster(), GetSpellInfo()->Effects[effIndex].TriggerSpell, true, NULL, NULL, GetCaster()->GetInstanceScript()->GetData64(DATA_VALITHRIA_LICH_KING));
GetHitUnit()->CastSpell(GetCaster(), GetSpellInfo()->Effects[effIndex].TriggerSpell, true, nullptr, nullptr, GetCaster()->GetInstanceScript()->GetData64(DATA_VALITHRIA_LICH_KING));
}
void Register()
@@ -874,7 +874,7 @@ class npc_crok_scourgebane : public CreatureScript
{
_wipeCheckTimer = 3000;
Player* player = NULL;
Player* player = nullptr;
acore::AnyPlayerInObjectRangeCheck check(me, 140.0f);
acore::PlayerSearcher<acore::AnyPlayerInObjectRangeCheck> searcher(me, player, check);
me->VisitNearbyWorldObject(140.0f, searcher);
@@ -1105,7 +1105,7 @@ class boss_sister_svalna : public CreatureScript
me->SetDisableGravity(false);
me->SetHover(false);
me->SetReactState(REACT_AGGRESSIVE);
DoZoneInCombat(NULL, 150.0f);
DoZoneInCombat(nullptr, 150.0f);
}
void SpellHitTarget(Unit* target, SpellInfo const* spell)
@@ -1353,7 +1353,7 @@ class npc_captain_arnath : public CreatureScript
private:
Creature* FindFriendlyCreature() const
{
Creature* target = NULL;
Creature* target = nullptr;
acore::MostHPMissingInRange u_check(me, 60.0f, 0);
acore::CreatureLastSearcher<acore::MostHPMissingInRange> searcher(me, target, u_check);
me->VisitNearbyGridObject(60.0f, searcher);
@@ -1882,7 +1882,7 @@ class npc_arthas_teleport_visual : public CreatureScript
return GetIcecrownCitadelAI<npc_arthas_teleport_visualAI>(creature);
// Default to no script
return NULL;
return nullptr;
}
};
@@ -2003,7 +2003,7 @@ class spell_icc_geist_alarm : public SpellScriptLoader
if (Creature* l = instance->instance->SummonCreature(NPC_VENGEFUL_FLESHREAPER, p))
{
bool hasTarget = false;
Unit* target = NULL;
Unit* target = nullptr;
if ((target = l->SelectNearestTarget(20.0f)))
hasTarget = true;
else
@@ -2999,7 +2999,7 @@ public:
if (uint32 e = events.GetEvent())
{
Unit* target = NULL;
Unit* target = nullptr;
if (sesi_spells[e-1].targetType == 1)
target = me->GetVictim();
else
@@ -615,7 +615,7 @@ CreatureAI* GetIcecrownCitadelAI(Creature* creature)
if (instance->GetInstanceScript())
if (instance->GetScriptId() == sObjectMgr->GetScriptId(ICCScriptName))
return new AI(creature);
return NULL;
return nullptr;
}
#endif // ICECROWN_CITADEL_H_
@@ -196,7 +196,7 @@ public:
me->DeleteThreatList();
me->CombatStop(true);
me->LoadCreaturesAddon(true);
me->SetLootRecipient(NULL);
me->SetLootRecipient(nullptr);
me->ResetPlayerDamageReq();
}
@@ -254,7 +254,7 @@ public:
if (!pInstance)
return;
GameObject *go = NULL;
GameObject *go = nullptr;
if (headMask & 0x1) // Kaddrak
if ((go = me->GetMap()->GetGameObject(pInstance->GetData64(GO_KADDRAK))))
activate ? go->SendCustomAnim(0) : go->SetGoState(GO_STATE_READY);
@@ -545,7 +545,7 @@ public:
SpeechPause += diff;
if (SpeechPause >= Conversation[SpeechCount].timer)
{
Creature* cs = NULL;
Creature* cs = nullptr;
switch (Conversation[SpeechCount].creature)
{
case NPC_BRANN: cs = me; break;
@@ -602,7 +602,7 @@ public:
void brann_bronzebeard::brann_bronzebeardAI::InitializeEvent()
{
Creature* cr = NULL;
Creature* cr = nullptr;
if ((cr = me->SummonCreature(NPC_KADDRAK, 923.7f, 326.9f, 219.5f, 2.1f, TEMPSUMMON_TIMED_DESPAWN, 580000)))
{
cr->SetInCombatWithZone();
@@ -497,7 +497,7 @@ public:
m_pInstance->SetData(TYPE_FREYA, IN_PROGRESS);
// HARD MODE CHECKS
Creature* elder = NULL;
Creature* elder = nullptr;
elder = ObjectAccessor::GetCreature(*me, m_pInstance->GetData64(NPC_ELDER_STONEBARK));
if (elder && elder->IsAlive())
{
@@ -270,7 +270,7 @@ public:
inside.push_back(tmp);
}
Player* t = NULL;
Player* t = nullptr;
if( outside.size() >= uint8(me->GetMap()->Is25ManRaid() ? 9 : 4) )
t = outside.at(urand(0, outside.size()-1));
else if( !inside.empty() )
@@ -598,7 +598,7 @@ public:
if (Unit* caster = GetCaster())
{
int32 damage = 100*pow(2.0f, (float)GetStackAmount());
caster->CastCustomSpell(GetTarget(), SPELL_SARONITE_VAPORS_DMG, &damage, NULL, NULL, true);
caster->CastCustomSpell(GetTarget(), SPELL_SARONITE_VAPORS_DMG, &damage, nullptr, nullptr, true);
}
}
@@ -630,7 +630,7 @@ public:
{
int32 mana = GetHitDamage()/2;
if (Unit* t = GetHitUnit())
caster->CastCustomSpell(t, SPELL_SARONITE_VAPORS_ENERGIZE, &mana, NULL, NULL, true);
caster->CastCustomSpell(t, SPELL_SARONITE_VAPORS_ENERGIZE, &mana, nullptr, nullptr, true);
}
}
@@ -449,7 +449,7 @@ public:
Creature* GetHelper(uint8 index)
{
return (Helpers[index] ? ObjectAccessor::GetCreature(*me, Helpers[index]) : NULL);
return (Helpers[index] ? ObjectAccessor::GetCreature(*me, Helpers[index]) : nullptr);
}
void SpawnHelpers()
@@ -387,7 +387,7 @@ public:
std::vector<uint64> playerGUIDs;
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
Player* temp = NULL;
Player* temp = nullptr;
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
{
@@ -432,7 +432,7 @@ public:
case EVENT_FOCUSED_EYEBEAM:
{
events.ScheduleEvent(EVENT_FOCUSED_EYEBEAM, 13000+rand()%5000);
Unit* target = NULL;
Unit* target = nullptr;
Map::PlayerList const& pList = me->GetMap()->GetPlayers();
for(auto itr = pList.begin(); itr != pList.end(); ++itr)
{
@@ -453,7 +453,7 @@ public:
case EVENT_SPAWN_FLAMES_INITIAL:
{
if (changeAllowedFlameSpreadTime)
allowedFlameSpreadTime = time(NULL);
allowedFlameSpreadTime = time(nullptr);
std::vector<Player*> pg;
Map::PlayerList const &pl = me->GetMap()->GetPlayers();
@@ -489,9 +489,9 @@ public:
break;
case EVENT_BERSERK_2:
{
Creature* VX001 = NULL;
Creature* LMK2 = NULL;
Creature* ACU = NULL;
Creature* VX001 = nullptr;
Creature* LMK2 = nullptr;
Creature* ACU = nullptr;
if ((VX001 = GetVX001()))
VX001->CastSpell(VX001, SPELL_BERSERK, true);
if ((LMK2 = GetLMK2()))
@@ -1158,7 +1158,7 @@ public:
break;
case EVENT_SPELL_NAPALM_SHELL:
{
Player* pTarget = NULL;
Player* pTarget = nullptr;
std::vector<Player*> pList;
Map::PlayerList const &pl = me->GetMap()->GetPlayers();
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
@@ -1793,7 +1793,7 @@ public:
float y = victim->GetPositionY() + 15.0f*sin(angle);
// check if there's magnetic core in line of movement
Creature* mc = NULL;
Creature* mc = nullptr;
std::list<Creature*> cl;
me->GetCreaturesWithEntryInRange(cl, me->GetExactDist2d(victim), NPC_MAGNETIC_CORE);
for( std::list<Creature*>::iterator itr = cl.begin(); itr != cl.end(); ++itr )
@@ -2316,7 +2316,7 @@ public:
{
npc_ulduar_flames_initialAI(Creature *pCreature) : NullCreatureAI(pCreature)
{
CreateTime = time(NULL);
CreateTime = time(nullptr);
events.Reset();
events.ScheduleEvent(EVENT_FLAMES_SPREAD, 5750);
if( Creature* flame = me->SummonCreature(NPC_FLAMES_SPREAD, me->GetPositionX(), me->GetPositionY(), 364.32f, 0.0f) )
@@ -2397,7 +2397,7 @@ public:
if( last )
{
float prevdist = 100.0f;
Player* target = NULL;
Player* target = nullptr;
Map::PlayerList const &pl = me->GetMap()->GetPlayers();
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
@@ -841,7 +841,7 @@ public:
if (!fixingGUID)
{
Creature* razorscale = NULL;
Creature* razorscale = nullptr;
if( uint64 rsGUID = pInstance->GetData64(TYPE_RAZORSCALE) )
razorscale = ObjectAccessor::GetCreature(*me, rsGUID);
@@ -890,7 +890,7 @@ public:
if( !pInstance )
return true;
Creature* rs = NULL;
Creature* rs = nullptr;
if( uint64 rsGUID = pInstance->GetData64(TYPE_RAZORSCALE) )
rs = ObjectAccessor::GetCreature(*go, rsGUID);
@@ -357,7 +357,7 @@ public:
{
if (m_pInstance)
return ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(entry));
return NULL;
return nullptr;
}
void JustSummoned(Creature* cr) { summons.Summon(cr); }
@@ -571,7 +571,7 @@ public:
events.SetPhase(EVENT_PHASE_OUTRO);
events.ScheduleEvent(EVENT_THORIM_OUTRO1, 2000, 0, EVENT_PHASE_OUTRO);
GameObject* go = NULL;
GameObject* go = nullptr;
if ((go = GetThorimObject(DATA_THORIM_FENCE)))
go->SetGoState(GO_STATE_ACTIVE);
@@ -656,7 +656,7 @@ public:
if (Player *p = itr->GetSource())
if (p->GetPositionX() > 2085 && p->GetPositionX() < 2185 && p->GetPositionY() < -214 && p->GetPositionY() > -305 && p->IsAlive() && p->GetPositionZ() < 425)
return p;
return NULL;
return nullptr;
}
void UpdateAI(uint32 diff)
@@ -1009,7 +1009,7 @@ public:
_checkTimer += diff;
if ((_checkTimer >= 1000 && _checkTimer < 10000) || _checkTimer >= 60000)
{
if (me->SelectNearbyTarget(NULL, 12.0f))
if (me->SelectNearbyTarget(nullptr, 12.0f))
{
me->CastSpell(me, SPELL_LIGHTNING_FIELD, true);
me->CastSpell(me, (me->GetEntry() == 33054 /*NPC_THORIM_TRAP_BUNNY*/ ? SPELL_PARALYTIC_FIELD_FIRST : SPELL_PARALYTIC_FIELD_SECOND), true);
@@ -1654,7 +1654,7 @@ public:
bool SelectT()
{
Player* target = NULL;
Player* target = nullptr;
Map::PlayerList const& pList = me->GetMap()->GetPlayers();
uint8 num = urand(0, pList.getSize()-1);
uint8 count = 0;
@@ -172,7 +172,7 @@ public:
void AttachHeart()
{
if (Unit* heart = me->GetVehicleKit() ? me->GetVehicleKit()->GetPassenger(HEART_VEHICLE_SEAT) : NULL)
if (Unit* heart = me->GetVehicleKit() ? me->GetVehicleKit()->GetPassenger(HEART_VEHICLE_SEAT) : nullptr)
heart->SetHealth(heart->GetMaxHealth());
else if (Creature* accessory = me->SummonCreature(NPC_XT002_HEART, *me, TEMPSUMMON_MANUAL_DESPAWN))
{
@@ -364,7 +364,7 @@ public:
case EVENT_START_SECOND_PHASE:
me->MonsterTextEmote("XT-002 Deconstructor's heart is exposed and leaking energy.", 0, true);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
if (Unit* heart = me->GetVehicleKit() ? me->GetVehicleKit()->GetPassenger(HEART_VEHICLE_SEAT) : NULL)
if (Unit* heart = me->GetVehicleKit() ? me->GetVehicleKit()->GetPassenger(HEART_VEHICLE_SEAT) : nullptr)
heart->GetAI()->DoAction(ACTION_AWAKEN_HEART);
events.ScheduleEvent(EVENT_RESTORE, 30000);
@@ -383,7 +383,7 @@ public:
me->SetByteValue(UNIT_FIELD_BYTES_1, 0, UNIT_STAND_STATE_STAND); // emerge
// Hide heart
if (Unit* heart = me->GetVehicleKit() ? me->GetVehicleKit()->GetPassenger(HEART_VEHICLE_SEAT) : NULL)
if (Unit* heart = me->GetVehicleKit() ? me->GetVehicleKit()->GetPassenger(HEART_VEHICLE_SEAT) : nullptr)
heart->GetAI()->DoAction(ACTION_HIDE_HEART);
events.ScheduleEvent(EVENT_REMOVE_EMOTE, 4000);
@@ -481,7 +481,7 @@ public:
void SendEnergyToCorner()
{
Unit* pile = NULL;
Unit* pile = nullptr;
uint8 num = urand(1,4);
for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
@@ -477,7 +477,7 @@ public:
void InformCloud()
{
Creature* cloud = NULL;
Creature* cloud = nullptr;
for (SummonList::const_iterator itr = summons.begin(); itr != summons.end();)
{
Creature* summon = ObjectAccessor::GetCreature(*me, *itr);
@@ -520,7 +520,7 @@ public:
void AddPortals()
{
_summonSpeed -= 0.1f;
Creature* cr = NULL;
Creature* cr = nullptr;
// Spawn Portals
for (uint8 i = 0; i < RAID_MODE(4, 10); ++i)
@@ -935,7 +935,7 @@ public:
_checkTimer += diff;
if (_checkTimer >= 500 && !_isSummoning)
{
Unit* who = me->SelectNearbyTarget(NULL, 6.0f);
Unit* who = me->SelectNearbyTarget(nullptr, 6.0f);
if (who && who->GetTypeId() == TYPEID_PLAYER && !me->HasAura(SPELL_SUMMON_GUARDIAN_OF_YS) && !who->HasAura(SPELL_HODIR_FLASH_FREEZE))
{
_isSummoning = true;
@@ -1533,7 +1533,7 @@ public:
Unit* SelectCorruptionTarget()
{
Player* target = NULL;
Player* target = nullptr;
Map::PlayerList const& pList = me->GetMap()->GetPlayers();
uint8 num = urand(0, pList.getSize()-1);
uint8 count = 0;
@@ -1589,7 +1589,7 @@ public:
Unit* SelectConstrictTarget()
{
Player *target = NULL;
Player *target = nullptr;
Map::PlayerList const& pList = me->GetMap()->GetPlayers();
uint8 num = urand(0, pList.getSize()-1);
uint8 count = 0;
@@ -2288,7 +2288,7 @@ class spell_yogg_saron_brain_link : public SpellScriptLoader
void HandleOnEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
PreventDefaultAction();
Player* target = NULL;
Player* target = nullptr;
Map::PlayerList const& pList = GetUnitOwner()->GetMap()->GetPlayers();
uint8 _offset = urand(0, pList.getSize()-1);
uint8 _counter = 0;
@@ -2395,7 +2395,7 @@ class spell_yogg_saron_destabilization_matrix : public SpellScriptLoader
void FilterTargets(std::list<WorldObject*>& targets)
{
WorldObject* target = NULL;
WorldObject* target = nullptr;
for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
if (!(*itr)->ToUnit()->HasAura(SPELL_DESTABILIZATION_MATRIX_ATTACK))
{
@@ -2439,7 +2439,7 @@ class spell_yogg_saron_titanic_storm : public SpellScriptLoader
void FilterTargets(std::list<WorldObject*>& targets)
{
WorldObject* target = NULL;
WorldObject* target = nullptr;
for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
if ((*itr)->ToUnit()->HasAura(SPELL_WEAKENED))
{
@@ -624,7 +624,7 @@ public:
{
instance->LoadGrid(364.0f, -16.0f); //make sure leviathan is loaded
m_leviathanTowers[type-EVENT_TOWER_OF_LIFE_DESTROYED] = data;
GameObject* gobj = NULL;
GameObject* gobj = nullptr;
if ((gobj = instance->GetGameObject(m_leviathanVisualTowers[type-EVENT_TOWER_OF_LIFE_DESTROYED][0])))
gobj->SetGoState(GO_STATE_ACTIVE);
if ((gobj = instance->GetGameObject(m_leviathanVisualTowers[type-EVENT_TOWER_OF_LIFE_DESTROYED][1])))
@@ -896,10 +896,10 @@ public:
}
else if (unit->GetTypeId() == TYPEID_UNIT && unit->GetAreaId() == 4656 /*Conservatory of Life*/)
{
if (time(NULL) > (m_conspeedatoryAttempt + DAY))
if (time(nullptr) > (m_conspeedatoryAttempt + DAY))
{
DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, 21597 /*CON-SPEED-ATORY_TIMED_CRITERIA*/);
m_conspeedatoryAttempt = time(NULL);
m_conspeedatoryAttempt = time(nullptr);
SaveToDB();
}
}
@@ -1127,7 +1127,7 @@ void instance_ulduar::instance_ulduar_InstanceMapScript::SpawnLeviathanEncounter
if (mode < VEHICLE_POS_NONE)
{
TempSummon* veh = NULL;
TempSummon* veh = nullptr;
for (uint8 i = 0; i < (instance->Is25ManRaid() ? 5 : 2); ++i)
{
if ((veh = instance->SummonCreature(NPC_SALVAGED_SIEGE_ENGINE, vehiclePositions[15*mode+i])))
@@ -190,7 +190,7 @@ public:
if (victim->GetEntry() == NPC_SCOURGE_HULK && instance)
{
instance->SetData(DATA_SVALA_ACHIEVEMENT, true);
instance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, 26555, 1, NULL);
instance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, 26555, 1, nullptr);
}
if (victim->GetTypeId() == TYPEID_PLAYER)
@@ -179,13 +179,13 @@ class instance_vault_of_archavon : public InstanceMapScript
switch (type)
{
case EVENT_ARCHAVON:
ArchavonDeath = time(NULL);
ArchavonDeath = time(nullptr);
break;
case EVENT_EMALON:
EmalonDeath = time(NULL);
EmalonDeath = time(nullptr);
break;
case EVENT_KORALON:
KoralonDeath = time(NULL);
KoralonDeath = time(nullptr);
break;
default:
return;
@@ -336,7 +336,7 @@ public:
void StartBossEncounter(uint8 uiBoss)
{
Creature* pBoss = NULL;
Creature* pBoss = nullptr;
switch(uiBoss)
{
@@ -581,7 +581,7 @@ public:
{
EnterEvadeMode(); //We make sure that the npc is not attacking the player!
me->SetReactState(REACT_PASSIVE);
StartFollow(pCaster->ToPlayer(), 0, NULL);
StartFollow(pCaster->ToPlayer(), 0, nullptr);
me->UpdateEntry(NPC_CAPTURED_BERLY_SORCERER, NULL, false);
DoCast(me, SPELL_COSMETIC_ENSLAVE_CHAINS_SELF, true);
me->DespawnOrUnsummon(45000);
@@ -545,7 +545,7 @@ class npc_minigob_manabonk : public CreatureScript
PlayerInDalaranList.push_back(player);
if (PlayerInDalaranList.empty())
return NULL;
return nullptr;
return acore::Containers::SelectRandomContainerElement(PlayerInDalaranList);
}
@@ -366,7 +366,7 @@ public:
if (phase)
randomWhisper();
Creature* cr = NULL;
Creature* cr = nullptr;
float x, y, z;
if (phase < 3)
{
@@ -101,7 +101,7 @@ public:
void setphase(short phase)
{
Unit* summoner = me->ToTempSummon() ? me->ToTempSummon()->GetSummoner() : NULL;
Unit* summoner = me->ToTempSummon() ? me->ToTempSummon()->GetSummoner() : nullptr;
if (!summoner || summoner->GetTypeId() != TYPEID_PLAYER)
return;
@@ -271,7 +271,7 @@ public:
me->MonsterTextEmote("Thane Banahogg appears upon the overlook to the southeast!", NULL, true);
break;
case QUEST_BFV_FINAL:
me->MonsterYell("Warriors of Jotunheim, I present to you, Blood Prince Sandoval!", LANG_UNIVERSAL, NULL);
me->MonsterYell("Warriors of Jotunheim, I present to you, Blood Prince Sandoval!", LANG_UNIVERSAL, nullptr);
me->MonsterTextEmote("Without warning, Prince Sandoval magically appears within Valhalas!", NULL, true);
break;
}
@@ -374,7 +374,7 @@ public:
if (attackTimer >= 1500)
{
if (!me->IsInCombat())
if (Unit* target = me->SelectNearbyTarget(NULL, 20.0f))
if (Unit* target = me->SelectNearbyTarget(nullptr, 20.0f))
AttackStart(target);
attackTimer = 0;
}
@@ -1266,7 +1266,7 @@ class npc_infra_green_bomber_generic : public CreatureScript
{
if (TempSummon* tempSummon = me->ToTempSummon())
return tempSummon->GetSummoner();
return NULL;
return nullptr;
}
void IsSummonedBy(Unit* summoner)
@@ -447,7 +447,7 @@ public:
Player* charmer = ObjectAccessor::GetPlayer(*me, playerGUID);
if (charmer && charmer->IsAlive() && me->GetDistance(charmer) < 20.0f)
return charmer;
return NULL;
return nullptr;
}
void UpdateAI(uint32 diff)
@@ -294,7 +294,7 @@ class npc_wg_queue : public CreatureScript
else
{
uint32 timer = wintergrasp->GetTimer() / 1000;
player->SendUpdateWorldState(4354, time(NULL) + timer);
player->SendUpdateWorldState(4354, time(nullptr) + timer);
if (timer < 15 * MINUTE)
{
AddGossipItemFor(player, GOSSIP_ICON_CHAT, "Queue for Wintergrasp.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
@@ -769,7 +769,7 @@ class go_wg_vehicle_teleporter : public GameObjectScript
if (Creature* teleportTrigger = passenger->SummonTrigger(go->GetPositionX()-60.0f, go->GetPositionY(), go->GetPositionZ()+1.0f, cVeh->GetOrientation(), 1000))
return teleportTrigger;
return NULL;
return nullptr;
}
void UpdateAI(uint32 diff)
@@ -822,7 +822,7 @@ class spell_wintergrasp_force_building : public SpellScriptLoader
{
PreventHitDefaultEffect(effIndex);
if (Unit* target = GetHitUnit())
target->CastSpell(target, GetEffectValue(), false, NULL, NULL, target->GetGUID());
target->CastSpell(target, GetEffectValue(), false, nullptr, nullptr, target->GetGUID());
}
void Register()