Fixed some additional found nullptrs

This commit is contained in:
Antz 2016-09-21 20:49:06 +01:00 committed by Antz
parent 2e925eddd5
commit 2d960a4b1c
36 changed files with 303 additions and 303 deletions

View file

@ -658,8 +658,8 @@ void BattleGround::EndBattleGround(Team winner)
{ {
this->RemoveFromBGFreeSlotQueue(); this->RemoveFromBGFreeSlotQueue();
ArenaTeam* winner_arena_team = nullptr; ArenaTeam* winner_arena_team = NULL;
ArenaTeam* loser_arena_team = nullptr; ArenaTeam* loser_arena_team = NULL;
uint32 loser_rating = 0; uint32 loser_rating = 0;
uint32 winner_rating = 0; uint32 winner_rating = 0;
WorldPacket data; WorldPacket data;

View file

@ -427,12 +427,12 @@ void BattleGroundEY::EventPlayerDroppedFlag(Player* source)
if (source->GetTeam() == ALLIANCE) if (source->GetTeam() == ALLIANCE)
{ {
UpdateWorldState(WORLD_STATE_EY_NETHERSTORM_FLAG_STATE_ALLIANCE, 1); UpdateWorldState(WORLD_STATE_EY_NETHERSTORM_FLAG_STATE_ALLIANCE, 1);
SendMessageToAll(LANG_BG_EY_DROPPED_FLAG, CHAT_MSG_BG_SYSTEM_ALLIANCE, nullptr); SendMessageToAll(LANG_BG_EY_DROPPED_FLAG, CHAT_MSG_BG_SYSTEM_ALLIANCE, NULL);
} }
else else
{ {
UpdateWorldState(WORLD_STATE_EY_NETHERSTORM_FLAG_STATE_HORDE, 1); UpdateWorldState(WORLD_STATE_EY_NETHERSTORM_FLAG_STATE_HORDE, 1);
SendMessageToAll(LANG_BG_EY_DROPPED_FLAG, CHAT_MSG_BG_SYSTEM_HORDE, nullptr); SendMessageToAll(LANG_BG_EY_DROPPED_FLAG, CHAT_MSG_BG_SYSTEM_HORDE, NULL);
} }
} }

View file

@ -1999,7 +1999,7 @@ bool ChatHandler::HandleGroupgoCommand(char* args)
return false; return false;
} }
for (GroupReference* itr = grp->GetFirstMember(); itr != nullptr; itr = itr->next()) for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
{ {
Player* pl = itr->getSource(); Player* pl = itr->getSource();

View file

@ -2445,7 +2445,7 @@ bool ChatHandler::HandleItemMoveCommand(char* args)
if (!pParam1) if (!pParam1)
return false; return false;
char* pParam2 = strtok(nullptr, " "); char* pParam2 = strtok(NULL, " ");
if (!pParam2) if (!pParam2)
return false; return false;
@ -3392,7 +3392,7 @@ bool ChatHandler::HandleWpShowCommand(char* args)
} }
Creature* wpOwner; ///< Npc that is moving Creature* wpOwner; ///< Npc that is moving
TemporarySummonWaypoint* wpTarget = nullptr; // Define here for wp-info command TemporarySummonWaypoint* wpTarget = NULL; // Define here for wp-info command
// Show info for the selected waypoint (Step one: get moving npc) // Show info for the selected waypoint (Step one: get moving npc)
if (subCmd == "info") if (subCmd == "info")
@ -3429,7 +3429,7 @@ bool ChatHandler::HandleWpShowCommand(char* args)
wpOwner = targetCreature; wpOwner = targetCreature;
// Get the path // Get the path
WaypointPath* wpPath = nullptr; WaypointPath* wpPath = NULL;
if (wpOrigin != PATH_NO_PATH) // Might have been provided by param if (wpOrigin != PATH_NO_PATH) // Might have been provided by param
wpPath = sWaypointMgr.GetPathFromOrigin(wpOwner->GetEntry(), wpOwner->GetGUIDLow(), wpPathId, wpOrigin); wpPath = sWaypointMgr.GetPathFromOrigin(wpOwner->GetEntry(), wpOwner->GetGUIDLow(), wpPathId, wpOrigin);
else else
@ -5092,7 +5092,7 @@ bool ChatHandler::HandleMmapPathCommand(char* args)
if (strcmp(para, "go") == 0) if (strcmp(para, "go") == 0)
{ {
followPath = true; followPath = true;
para = strtok(nullptr, " "); para = strtok(NULL, " ");
if (para && strcmp(para, "straight") == 0) if (para && strcmp(para, "straight") == 0)
useStraightPath = true; useStraightPath = true;
} }

View file

@ -2581,7 +2581,7 @@ bool ChatHandler::HandleLearnCommand(char* args)
if (!spell || !sSpellStore.LookupEntry(spell)) if (!spell || !sSpellStore.LookupEntry(spell))
return false; return false;
bool allRanks = ExtractLiteralArg(&args, "all") != nullptr; bool allRanks = ExtractLiteralArg(&args, "all") != NULL;
if (!allRanks && *args) // can be fail also at syntax error if (!allRanks && *args) // can be fail also at syntax error
return false; return false;
@ -3978,7 +3978,7 @@ bool ChatHandler::HandleDieCommand(char* /*args*/)
if (target->IsAlive()) if (target->IsAlive())
{ {
player->DealDamage(target, target->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false); player->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
} }
return true; return true;
@ -4014,7 +4014,7 @@ bool ChatHandler::HandleDamageCommand(char* args)
// flat melee damage without resistance/etc reduction // flat melee damage without resistance/etc reduction
if (!*args) if (!*args)
{ {
player->DealDamage(target, damage, nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false); player->DealDamage(target, damage, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
if (target != player) if (target != player)
player->SendAttackStateUpdate(HITINFO_NORMALSWING2, target, SPELL_SCHOOL_MASK_NORMAL, damage, 0, 0, VICTIMSTATE_NORMAL, 0); player->SendAttackStateUpdate(HITINFO_NORMALSWING2, target, SPELL_SCHOOL_MASK_NORMAL, damage, 0, 0, VICTIMSTATE_NORMAL, 0);
return true; return true;
@ -4046,7 +4046,7 @@ bool ChatHandler::HandleDamageCommand(char* args)
damage -= absorb + resist; damage -= absorb + resist;
player->DealDamageMods(target, damage, &absorb); player->DealDamageMods(target, damage, &absorb);
player->DealDamage(target, damage, nullptr, DIRECT_DAMAGE, schoolmask, nullptr, false); player->DealDamage(target, damage, NULL, DIRECT_DAMAGE, schoolmask, NULL, false);
player->SendAttackStateUpdate(HITINFO_NORMALSWING2, target, schoolmask, damage, absorb, resist, VICTIMSTATE_NORMAL, 0); player->SendAttackStateUpdate(HITINFO_NORMALSWING2, target, schoolmask, damage, absorb, resist, VICTIMSTATE_NORMAL, 0);
return true; return true;
} }
@ -6441,7 +6441,7 @@ bool ChatHandler::HandleCastCommand(char* args)
return false; return false;
} }
bool triggered = ExtractLiteralArg(&args, "triggered") != nullptr; bool triggered = ExtractLiteralArg(&args, "triggered") != NULL;
if (!triggered && *args) // can be fail also at syntax error if (!triggered && *args) // can be fail also at syntax error
return false; return false;

View file

@ -59,7 +59,7 @@ void MotionMaster::Initialize()
if (m_owner->GetTypeId() == TYPEID_UNIT && !m_owner->hasUnitState(UNIT_STAT_CONTROLLED)) if (m_owner->GetTypeId() == TYPEID_UNIT && !m_owner->hasUnitState(UNIT_STAT_CONTROLLED))
{ {
MovementGenerator* movement = FactorySelector::selectMovementGenerator((Creature*)m_owner); MovementGenerator* movement = FactorySelector::selectMovementGenerator((Creature*)m_owner);
push(movement == nullptr ? &si_idleMovement : movement); push(movement == NULL ? &si_idleMovement : movement);
top()->Initialize(*m_owner); top()->Initialize(*m_owner);
if (top()->GetMovementGeneratorType() == WAYPOINT_MOTION_TYPE) if (top()->GetMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
(static_cast<WaypointMovementGenerator<Creature>*>(top()))->InitializeWaypointPath(*((Creature*)(m_owner)), 0, PATH_NO_PATH, 0, 0); (static_cast<WaypointMovementGenerator<Creature>*>(top()))->InitializeWaypointPath(*((Creature*)(m_owner)), 0, PATH_NO_PATH, 0, 0);

View file

@ -121,7 +121,7 @@ class MotionMaster : private std::stack<MovementGenerator*>
void MoveTaxiFlight(uint32 path, uint32 pathnode); void MoveTaxiFlight(uint32 path, uint32 pathnode);
void MoveDistract(uint32 timeLimit); void MoveDistract(uint32 timeLimit);
void MoveJump(float x, float y, float z, float horizontalSpeed, float max_height, uint32 id = 0); void MoveJump(float x, float y, float z, float horizontalSpeed, float max_height, uint32 id = 0);
void MoveDestination(float x, float y, float z, float o, float horizontalSpeed, float max_height, Unit* target = nullptr); void MoveDestination(float x, float y, float z, float o, float horizontalSpeed, float max_height, Unit* target = NULL);
void MoveFall(); void MoveFall();
void MoveFlyOrLand(uint32 id, float x, float y, float z, bool liftOff); void MoveFlyOrLand(uint32 id, float x, float y, float z, bool liftOff);

View file

@ -1451,7 +1451,7 @@ bool WorldObject::isInBack(WorldObject const* target, float distance, float arc)
return IsWithinDist(target, distance) && !HasInArc(2 * M_PI_F - arc, target); return IsWithinDist(target, distance) && !HasInArc(2 * M_PI_F - arc, target);
} }
void WorldObject::GetRandomPoint(float x, float y, float z, float distance, float& rand_x, float& rand_y, float& rand_z, float minDist /*=0.0f*/, float const* ori /*=nullptr*/) const void WorldObject::GetRandomPoint(float x, float y, float z, float distance, float& rand_x, float& rand_y, float& rand_z, float minDist /*=0.0f*/, float const* ori /*=NULL*/) const
{ {
if (distance == 0) if (distance == 0)
{ {
@ -1490,7 +1490,7 @@ void WorldObject::UpdateGroundPositionZ(float x, float y, float& z) const
{ z = new_z + 0.05f; } // just to be sure that we are not a few pixel under the surface { z = new_z + 0.05f; } // just to be sure that we are not a few pixel under the surface
} }
void WorldObject::UpdateAllowedPositionZ(float x, float y, float& z, Map* atMap /*=nullptr*/) const void WorldObject::UpdateAllowedPositionZ(float x, float y, float& z, Map* atMap /*=NULL*/) const
{ {
if (!atMap) if (!atMap)
atMap = GetMap(); atMap = GetMap();
@ -1761,7 +1761,7 @@ Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, floa
if (!cinfo) if (!cinfo)
{ {
sLog.outErrorDb("WorldObject::SummonCreature: Creature (Entry: %u) not existed for summoner: %s. ", id, GetGuidStr().c_str()); sLog.outErrorDb("WorldObject::SummonCreature: Creature (Entry: %u) not existed for summoner: %s. ", id, GetGuidStr().c_str());
return nullptr; return NULL;
} }
TemporarySummon* pCreature = new TemporarySummon(GetObjectGuid()); TemporarySummon* pCreature = new TemporarySummon(GetObjectGuid());
@ -1778,7 +1778,7 @@ Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, floa
if (!pCreature->Create(GetMap()->GenerateLocalLowGuid(cinfo->GetHighGuid()), pos, cinfo, team)) if (!pCreature->Create(GetMap()->GenerateLocalLowGuid(cinfo->GetHighGuid()), pos, cinfo, team))
{ {
delete pCreature; delete pCreature;
return nullptr; return NULL;
} }
pCreature->SetRespawnCoord(pos); pCreature->SetRespawnCoord(pos);

View file

@ -545,9 +545,9 @@ class WorldObject : public Object
bool IsPositionValid() const; bool IsPositionValid() const;
void UpdateGroundPositionZ(float x, float y, float& z) const; void UpdateGroundPositionZ(float x, float y, float& z) const;
void UpdateAllowedPositionZ(float x, float y, float& z, Map* atMap = nullptr) const; void UpdateAllowedPositionZ(float x, float y, float& z, Map* atMap = NULL) const;
void GetRandomPoint(float x, float y, float z, float distance, float& rand_x, float& rand_y, float& rand_z, float minDist = 0.0f, float const* ori = nullptr) const; void GetRandomPoint(float x, float y, float z, float distance, float& rand_x, float& rand_y, float& rand_z, float minDist = 0.0f, float const* ori = NULL) const;
uint32 GetMapId() const { return m_mapId; } uint32 GetMapId() const { return m_mapId; }
uint32 GetInstanceId() const { return m_InstanceId; } uint32 GetInstanceId() const { return m_InstanceId; }

View file

@ -9544,7 +9544,7 @@ void ObjectMgr::LoadActiveEntities(Map* _map)
{ {
_map = sMapMgr.FindMap(continents[i]); _map = sMapMgr.FindMap(continents[i]);
if (!_map) if (!_map)
_map = sMapMgr.CreateMap(continents[i], nullptr); _map = sMapMgr.CreateMap(continents[i], NULL);
if (_map) if (_map)
LoadActiveEntities(_map); LoadActiveEntities(_map);

View file

@ -832,7 +832,7 @@ class ObjectMgr
void LoadTrainerTemplates(); void LoadTrainerTemplates();
void LoadTrainers() { LoadTrainers("npc_trainer", false); } void LoadTrainers() { LoadTrainers("npc_trainer", false); }
/// @param _map Map* of the map for which to load active entities. If nullptr active entities on continents are loaded /// @param _map Map* of the map for which to load active entities. If NULL active entities on continents are loaded
void LoadActiveEntities(Map* _map); void LoadActiveEntities(Map* _map);
void LoadVehicleAccessory(); void LoadVehicleAccessory();

View file

@ -132,7 +132,7 @@ void PetAI::UpdateAI(const uint32 diff)
return; return;
Unit* owner = m_creature->GetCharmerOrOwner(); Unit* owner = m_creature->GetCharmerOrOwner();
Unit* victim = nullptr; Unit* victim = NULL;
if (!((Pet*)m_creature)->isControlled()) if (!((Pet*)m_creature)->isControlled())
m_creature->SelectHostileTarget(); m_creature->SelectHostileTarget();

View file

@ -4140,14 +4140,14 @@ void Player::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c
{ {
for (int i = 0; i < EQUIPMENT_SLOT_END; ++i) for (int i = 0; i < EQUIPMENT_SLOT_END; ++i)
{ {
if (m_items[i] == nullptr) if (m_items[i] == NULL)
continue; continue;
m_items[i]->BuildCreateUpdateBlockForPlayer(data, target); m_items[i]->BuildCreateUpdateBlockForPlayer(data, target);
} }
for (int i = INVENTORY_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i) for (int i = INVENTORY_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i)
{ {
if (m_items[i] == nullptr) if (m_items[i] == NULL)
continue; continue;
m_items[i]->BuildCreateUpdateBlockForPlayer(data, target); m_items[i]->BuildCreateUpdateBlockForPlayer(data, target);
@ -6321,7 +6321,7 @@ void Player::CheckAreaExploreAndOutdoor()
if (!shapeShift || (shapeShift->Stances || shapeShift->StancesNot) && !IsNeedCastSpellAtFormApply(spellInfo, GetShapeshiftForm())) if (!shapeShift || (shapeShift->Stances || shapeShift->StancesNot) && !IsNeedCastSpellAtFormApply(spellInfo, GetShapeshiftForm()))
continue; continue;
CastSpell(this, itr->first, true, nullptr); CastSpell(this, itr->first, true, NULL);
} }
} }
else if (sWorld.getConfig(CONFIG_BOOL_VMAP_INDOOR_CHECK) && !isGameMaster()) else if (sWorld.getConfig(CONFIG_BOOL_VMAP_INDOOR_CHECK) && !isGameMaster())

View file

@ -83,7 +83,7 @@ SpellSpecific GetSpellSpecific(uint32 spellId);
// Different spell properties // Different spell properties
inline float GetSpellRadius(SpellRadiusEntry const* radius) { return (radius ? radius->Radius : 0); } inline float GetSpellRadius(SpellRadiusEntry const* radius) { return (radius ? radius->Radius : 0); }
uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell = nullptr); uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell = NULL);
uint32 GetSpellCastTimeForBonus(SpellEntry const* spellProto, DamageEffectType damagetype); uint32 GetSpellCastTimeForBonus(SpellEntry const* spellProto, DamageEffectType damagetype);
float CalculateDefaultCoefficient(SpellEntry const* spellProto, DamageEffectType const damagetype); float CalculateDefaultCoefficient(SpellEntry const* spellProto, DamageEffectType const damagetype);
inline float GetSpellMinRange(SpellRangeEntry const* range, bool friendly = false) inline float GetSpellMinRange(SpellRangeEntry const* range, bool friendly = false)

View file

@ -981,8 +981,8 @@ uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDa
{ {
SpellEntry const* shareSpell = (*itr)->GetSpellProto(); SpellEntry const* shareSpell = (*itr)->GetSpellProto();
uint32 shareDamage = uint32(damage*(*itr)->GetModifier()->m_amount / 100.0f); uint32 shareDamage = uint32(damage*(*itr)->GetModifier()->m_amount / 100.0f);
DealDamageMods(shareTarget, shareDamage, nullptr); DealDamageMods(shareTarget, shareDamage, NULL);
DealDamage(shareTarget, shareDamage, nullptr, damagetype, GetSpellSchoolMask(shareSpell), shareSpell, false); DealDamage(shareTarget, shareDamage, NULL, damagetype, GetSpellSchoolMask(shareSpell), shareSpell, false);
} }
} }
} }
@ -12307,13 +12307,13 @@ Unit* Unit::TakePossessOf(SpellEntry const* spellEntry, SummonPropertiesEntry co
if (!cinfo) if (!cinfo)
{ {
sLog.outErrorDb("WorldObject::SummonCreature: Creature (Entry: %u) not existed for summoner: %s. ", creatureEntry, GetGuidStr().c_str()); sLog.outErrorDb("WorldObject::SummonCreature: Creature (Entry: %u) not existed for summoner: %s. ", creatureEntry, GetGuidStr().c_str());
return nullptr; return NULL;
} }
if (GetCharm()) if (GetCharm())
{ {
sLog.outError("Unit::TakePossessOf> There is already a charmed creature for %s its : %s. ", GetGuidStr().c_str(), GetCharm()->GetGuidStr().c_str()); sLog.outError("Unit::TakePossessOf> There is already a charmed creature for %s its : %s. ", GetGuidStr().c_str(), GetCharm()->GetGuidStr().c_str());
return nullptr; return NULL;
} }
TemporarySummon* pCreature = new TemporarySummon(GetObjectGuid()); TemporarySummon* pCreature = new TemporarySummon(GetObjectGuid());
@ -12326,10 +12326,10 @@ Unit* Unit::TakePossessOf(SpellEntry const* spellEntry, SummonPropertiesEntry co
if (!pCreature->Create(GetMap()->GenerateLocalLowGuid(cinfo->GetHighGuid()), pos, cinfo)) if (!pCreature->Create(GetMap()->GenerateLocalLowGuid(cinfo->GetHighGuid()), pos, cinfo))
{ {
delete pCreature; delete pCreature;
return nullptr; return NULL;
} }
Player* player = GetTypeId() == TYPEID_PLAYER ? static_cast<Player*>(this): nullptr; Player* player = GetTypeId() == TYPEID_PLAYER ? static_cast<Player*>(this): NULL;
pCreature->setFaction(getFaction()); // set same faction than player pCreature->setFaction(getFaction()); // set same faction than player
pCreature->SetRespawnCoord(pos); // set spawn coord pCreature->SetRespawnCoord(pos); // set spawn coord
@ -12383,7 +12383,7 @@ Unit* Unit::TakePossessOf(SpellEntry const* spellEntry, SummonPropertiesEntry co
bool Unit::TakePossessOf(Unit* possessed) bool Unit::TakePossessOf(Unit* possessed)
{ {
Player* player = nullptr; Player* player = NULL;
if (GetTypeId() == TYPEID_PLAYER) if (GetTypeId() == TYPEID_PLAYER)
player = static_cast<Player *>(this); player = static_cast<Player *>(this);
@ -12394,7 +12394,7 @@ bool Unit::TakePossessOf(Unit* possessed)
SetCharm(possessed); SetCharm(possessed);
Creature* possessedCreature = nullptr; Creature* possessedCreature = NULL;
if (possessed->GetTypeId() == TYPEID_UNIT) if (possessed->GetTypeId() == TYPEID_UNIT)
possessedCreature = static_cast<Creature *>(possessed); possessedCreature = static_cast<Creature *>(possessed);
@ -12438,7 +12438,7 @@ bool Unit::TakePossessOf(Unit* possessed)
void Unit::ResetControlState(bool attackCharmer /*= true*/) void Unit::ResetControlState(bool attackCharmer /*= true*/)
{ {
Player* player = nullptr; Player* player = NULL;
if (GetTypeId() == TYPEID_PLAYER) if (GetTypeId() == TYPEID_PLAYER)
player = static_cast<Player *>(this); player = static_cast<Player *>(this);

View file

@ -94,7 +94,7 @@ class ThreatRefStatusChangeEvent : public UnitBaseEvent
ThreatManager* iThreatManager; ThreatManager* iThreatManager;
public: public:
ThreatRefStatusChangeEvent(uint32 pType) : UnitBaseEvent(pType), iThreatManager(NULL) ThreatRefStatusChangeEvent(uint32 pType) : UnitBaseEvent(pType), iThreatManager(NULL)
{ iHostileReference = nullptr; } { iHostileReference = NULL; }
ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference) : UnitBaseEvent(pType), iThreatManager(NULL) ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference) : UnitBaseEvent(pType), iThreatManager(NULL)
{ iHostileReference = pHostileReference; } { iHostileReference = pHostileReference; }

View file

@ -179,7 +179,7 @@ void OutdoorPvPEP::HandleObjectiveComplete(uint32 eventId, const std::list<Playe
if ((*itr) && (*itr)->GetTeam() == team) if ((*itr) && (*itr)->GetTeam() == team)
{ {
(*itr)->KilledMonsterCredit(credit); (*itr)->KilledMonsterCredit(credit);
(*itr)->RewardHonor(nullptr, 1, HONOR_REWARD_PLAGUELANDS); (*itr)->RewardHonor(NULL, 1, HONOR_REWARD_PLAGUELANDS);
} }
} }
} }

View file

@ -1034,7 +1034,7 @@ ChatChannelsEntry const* GetChannelEntryFor(uint32 channel_id)
if (ch && ch->ChannelID == channel_id) if (ch && ch->ChannelID == channel_id)
return ch; return ch;
} }
return nullptr; return NULL;
} }
bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredTotemCategoryId) bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredTotemCategoryId)

View file

@ -877,7 +877,7 @@ void WorldSession::SetAccountData(AccountDataType type, time_t time_, const std:
} }
else else
{ {
// _player can be nullptr and packet received after logout but m_GUID still store correct guid // _player can be NULL and packet received after logout but m_GUID still store correct guid
if (!m_GUIDLow) if (!m_GUIDLow)
return; return;

View file

@ -83,7 +83,7 @@ Channel* ChannelMgr::GetChannel(const std::string& name, Player* p, bool pkt)
p->GetSession()->SendPacket(&data); p->GetSession()->SendPacket(&data);
} }
return nullptr; return NULL;
} }
else else
return i->second; return i->second;

View file

@ -311,7 +311,7 @@ ChatCommand* ChatHandler::getCommandTable()
{ "setphase", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectPhaseCommand, "", NULL }, { "setphase", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectPhaseCommand, "", NULL },
{ "target", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectTargetCommand, "", NULL }, { "target", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectTargetCommand, "", NULL },
{ "turn", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectTurnCommand, "", NULL }, { "turn", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectTurnCommand, "", NULL },
{ nullptr, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "", NULL }
}; };
static ChatCommand guildCommandTable[] = static ChatCommand guildCommandTable[] =

View file

@ -335,7 +335,7 @@ CreatureLinkingInfo const* CreatureLinkingMgr::GetLinkedTriggerInformation(uint3
return &(iter->second); return &(iter->second);
} }
return nullptr; return NULL;
} }
// Function to add slave-NPCs to the holder // Function to add slave-NPCs to the holder
@ -453,7 +453,7 @@ void CreatureLinkingHolder::DoCreatureLinkingEvent(CreatureLinkingEvent eventTyp
{ {
if (pInfo->linkingFlag & reverseEventFlagFilter) if (pInfo->linkingFlag & reverseEventFlagFilter)
{ {
Creature* pMaster = nullptr; Creature* pMaster = NULL;
if (pInfo->mapId != INVALID_MAP_ID) // entry case if (pInfo->mapId != INVALID_MAP_ID) // entry case
{ {
BossGuidMapBounds finds = m_masterGuid.equal_range(pInfo->masterId); BossGuidMapBounds finds = m_masterGuid.equal_range(pInfo->masterId);
@ -635,7 +635,7 @@ bool CreatureLinkingHolder::IsSlaveInRangeOfBoss(Creature const* pBoss, float sX
bool CreatureLinkingHolder::IsRespawnReady(uint32 dbLowGuid, Map* _map) const bool CreatureLinkingHolder::IsRespawnReady(uint32 dbLowGuid, Map* _map) const
{ {
time_t respawnTime = _map->GetPersistentState()->GetCreatureRespawnTime(dbLowGuid); time_t respawnTime = _map->GetPersistentState()->GetCreatureRespawnTime(dbLowGuid);
return (!respawnTime || respawnTime <= time(NULL)) && CanSpawn(dbLowGuid, _map, nullptr, 0.0f, 0.0f); return (!respawnTime || respawnTime <= time(NULL)) && CanSpawn(dbLowGuid, _map, NULL, 0.0f, 0.0f);
} }
// Function to check if a passive spawning condition is met // Function to check if a passive spawning condition is met
@ -717,7 +717,7 @@ bool CreatureLinkingHolder::TryFollowMaster(Creature* pCreature)
if (!pInfo || !(pInfo->linkingFlag & FLAG_FOLLOW)) if (!pInfo || !(pInfo->linkingFlag & FLAG_FOLLOW))
return false; return false;
Creature* pMaster = nullptr; Creature* pMaster = NULL;
if (pInfo->mapId != INVALID_MAP_ID) // entry case if (pInfo->mapId != INVALID_MAP_ID) // entry case
{ {
BossGuidMapBounds finds = m_masterGuid.equal_range(pInfo->masterId); BossGuidMapBounds finds = m_masterGuid.equal_range(pInfo->masterId);

View file

@ -236,7 +236,7 @@ class TerrainInfo : public Referencable<AtomicLong>
float GetWaterLevel(float x, float y, float z, float* pGround = NULL) const; float GetWaterLevel(float x, float y, float z, float* pGround = NULL) const;
float GetWaterOrGroundLevel(float x, float y, float z, float* pGround = NULL, bool swim = false) const; float GetWaterOrGroundLevel(float x, float y, float z, float* pGround = NULL, bool swim = false) const;
bool IsInWater(float x, float y, float z, GridMapLiquidData* data = 0) const; bool IsInWater(float x, float y, float z, GridMapLiquidData* data = 0) const;
bool IsSwimmable(float x, float y, float pZ, float radius = 1.5f, GridMapLiquidData* data = nullptr) const; bool IsSwimmable(float x, float y, float pZ, float radius = 1.5f, GridMapLiquidData* data = NULL) const;
bool IsUnderWater(float x, float y, float z) const; bool IsUnderWater(float x, float y, float z) const;
GridMapLiquidStatus getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, GridMapLiquidData* data = 0) const; GridMapLiquidStatus getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, GridMapLiquidData* data = 0) const;

View file

@ -65,7 +65,7 @@ Map::~Map()
m_persistentState->SetUsedByMapState(NULL); // field pointer can be deleted after this m_persistentState->SetUsedByMapState(NULL); // field pointer can be deleted after this
delete i_data; delete i_data;
i_data = nullptr; i_data = NULL;
// unload instance specific navigation data // unload instance specific navigation data
MMAP::MMapFactory::createOrGetMMapManager()->unloadMapInstance(m_TerrainData->GetMapId(), GetInstanceId()); MMAP::MMapFactory::createOrGetMMapManager()->unloadMapInstance(m_TerrainData->GetMapId(), GetInstanceId());
@ -2127,7 +2127,7 @@ bool Map::GetHeightInRange(uint32 phasemask, float x, float y, float& z, float m
VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager(); VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager();
if (!vmgr->isLineOfSightCalcEnabled()) if (!vmgr->isLineOfSightCalcEnabled())
vmgr = nullptr; vmgr = NULL;
if (vmgr) if (vmgr)
{ {

View file

@ -97,11 +97,11 @@ Map* MapManager::CreateMap(uint32 id, const WorldObject* obj)
{ {
Guard _guard(*this); Guard _guard(*this);
Map* m = nullptr; Map* m = NULL;
const MapEntry* entry = sMapStore.LookupEntry(id); const MapEntry* entry = sMapStore.LookupEntry(id);
if (!entry) if (!entry)
return nullptr; return NULL;
if (entry->Instanceable()) if (entry->Instanceable())
{ {
@ -115,7 +115,7 @@ Map* MapManager::CreateMap(uint32 id, const WorldObject* obj)
{ {
// create regular non-instanceable map // create regular non-instanceable map
m = FindMap(id); m = FindMap(id);
if (m == nullptr) if (m == NULL)
{ {
m = new WorldMap(id, i_gridCleanUpDelay); m = new WorldMap(id, i_gridCleanUpDelay);
// add map into container // add map into container

View file

@ -66,7 +66,7 @@ namespace MMAP
delete[] mapList; delete[] mapList;
} }
bool MMapFactory::IsPathfindingEnabled(uint32 mapId, const Unit* unit = nullptr) bool MMapFactory::IsPathfindingEnabled(uint32 mapId, const Unit* unit = NULL)
{ {
if (!sWorld.getConfig(CONFIG_BOOL_MMAP_ENABLED)) if (!sWorld.getConfig(CONFIG_BOOL_MMAP_ENABLED))
return false; return false;

View file

@ -121,7 +121,7 @@ void WorldSession::HandlePetAction(WorldPacket& recv_data)
((Pet*)pet)->SetIsRetreating(); ((Pet*)pet)->SetIsRetreating();
((Pet*)pet)->SetSpellOpener(); ((Pet*)pet)->SetSpellOpener();
Unit* targetUnit = targetGuid ? _player->GetMap()->GetUnit(targetGuid) : nullptr; Unit* targetUnit = targetGuid ? _player->GetMap()->GetUnit(targetGuid) : NULL;
if (targetUnit && targetUnit != pet && targetUnit->IsTargetableForAttack() && targetUnit->isInAccessablePlaceFor((Creature*)pet)) if (targetUnit && targetUnit != pet && targetUnit->IsTargetableForAttack() && targetUnit->isInAccessablePlaceFor((Creature*)pet))
{ {
@ -201,7 +201,7 @@ void WorldSession::HandlePetAction(WorldPacket& recv_data)
((Pet*)pet)->SetIsRetreating(); ((Pet*)pet)->SetIsRetreating();
((Pet*)pet)->SetSpellOpener(); ((Pet*)pet)->SetSpellOpener();
Unit* unit_target = targetGuid ? _player->GetMap()->GetUnit(targetGuid) : nullptr; Unit* unit_target = targetGuid ? _player->GetMap()->GetUnit(targetGuid) : NULL;
// do not cast unknown spells // do not cast unknown spells
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellid); SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellid);

View file

@ -1077,7 +1077,7 @@ bool ScriptAction::GetScriptProcessTargets(WorldObject* pOrigSource, WorldObject
if (m_script->IsCreatureBuddy()) if (m_script->IsCreatureBuddy())
{ {
Creature* pCreatureBuddy = nullptr; Creature* pCreatureBuddy = NULL;
if (m_script->data_flags & SCRIPT_FLAG_BUDDY_IS_DESPAWNED) if (m_script->data_flags & SCRIPT_FLAG_BUDDY_IS_DESPAWNED)
{ {
@ -1585,7 +1585,7 @@ bool ScriptAction::HandleScriptStep()
} }
// bitmask: 0/1=target-player, 0/2=with distance dependent, 0/4=map wide, 0/8=zone wide // bitmask: 0/1=target-player, 0/2=with distance dependent, 0/4=map wide, 0/8=zone wide
Player* pSoundTarget = nullptr; Player* pSoundTarget = NULL;
if (m_script->playSound.flags & 1) if (m_script->playSound.flags & 1)
{ {
pSoundTarget = GetPlayerTargetOrSourceAndLog(pSource, pTarget); pSoundTarget = GetPlayerTargetOrSourceAndLog(pSource, pTarget);
@ -1944,7 +1944,7 @@ bool ScriptAction::HandleScriptStep()
((Creature*)pSource)->AI()->SendAIEventAround(AIEventType(m_script->sendAIEvent.eventType), (Unit*)pTarget, 0, float(m_script->sendAIEvent.radius)); ((Creature*)pSource)->AI()->SendAIEventAround(AIEventType(m_script->sendAIEvent.eventType), (Unit*)pTarget, 0, float(m_script->sendAIEvent.radius));
// else if no radius and target is creature send AI event to target // else if no radius and target is creature send AI event to target
else if (pTarget->GetTypeId() == TYPEID_UNIT) else if (pTarget->GetTypeId() == TYPEID_UNIT)
((Creature*)pSource)->AI()->SendAIEvent(AIEventType(m_script->sendAIEvent.eventType), nullptr, (Creature*)pTarget); ((Creature*)pSource)->AI()->SendAIEvent(AIEventType(m_script->sendAIEvent.eventType), NULL, (Creature*)pTarget);
break; break;
} }
case SCRIPT_COMMAND_TURN_TO: // 36 case SCRIPT_COMMAND_TURN_TO: // 36
@ -2001,7 +2001,7 @@ bool ScriptAction::HandleScriptStep()
orientation = m_script->o; orientation = m_script->o;
pSource->GetRandomPoint(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), m_script->moveDynamic.maxDist, x, y, z, pSource->GetRandomPoint(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), m_script->moveDynamic.maxDist, x, y, z,
m_script->moveDynamic.minDist, (orientation == 0.0f ? nullptr : &orientation)); m_script->moveDynamic.minDist, (orientation == 0.0f ? NULL : &orientation));
z = std::max(z, pTarget->GetPositionZ()); z = std::max(z, pTarget->GetPositionZ());
pSource->UpdateAllowedPositionZ(x, y, z); pSource->UpdateAllowedPositionZ(x, y, z);
} }

View file

@ -2349,7 +2349,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
if (target && target != m_caster) if (target && target != m_caster)
{ {
// Can only be casted on group's members or its pets // Can only be casted on group's members or its pets
Group* pGroup = nullptr; Group* pGroup = NULL;
Unit* owner = m_caster->GetCharmerOrOwner(); Unit* owner = m_caster->GetCharmerOrOwner();
Unit* targetOwner = target->GetCharmerOrOwner(); Unit* targetOwner = target->GetCharmerOrOwner();
@ -2527,7 +2527,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
case TARGET_AREAEFFECT_PARTY: case TARGET_AREAEFFECT_PARTY:
{ {
Unit* owner = m_caster->GetCharmerOrOwner(); Unit* owner = m_caster->GetCharmerOrOwner();
Player* pTarget = nullptr; Player* pTarget = NULL;
if (owner) if (owner)
{ {
@ -2553,13 +2553,13 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
} }
} }
Group* pGroup = pTarget ? pTarget->GetGroup() : nullptr; Group* pGroup = pTarget ? pTarget->GetGroup() : NULL;
if (pGroup) if (pGroup)
{ {
uint8 subgroup = pTarget->GetSubGroup(); uint8 subgroup = pTarget->GetSubGroup();
for (GroupReference* itr = pGroup->GetFirstMember(); itr != nullptr; itr = itr->next()) for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
{ {
Player* Target = itr->getSource(); Player* Target = itr->getSource();
@ -2675,12 +2675,12 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
case TARGET_AREAEFFECT_PARTY_AND_CLASS: case TARGET_AREAEFFECT_PARTY_AND_CLASS:
{ {
Player* targetPlayer = m_targets.getUnitTarget() && m_targets.getUnitTarget()->GetTypeId() == TYPEID_PLAYER Player* targetPlayer = m_targets.getUnitTarget() && m_targets.getUnitTarget()->GetTypeId() == TYPEID_PLAYER
? (Player*)m_targets.getUnitTarget() : nullptr; ? (Player*)m_targets.getUnitTarget() : NULL;
Group* pGroup = targetPlayer ? targetPlayer->GetGroup() : nullptr; Group* pGroup = targetPlayer ? targetPlayer->GetGroup() : NULL;
if (pGroup) if (pGroup)
{ {
for (GroupReference* itr = pGroup->GetFirstMember(); itr != nullptr; itr = itr->next()) for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
{ {
Player* Target = itr->getSource(); Player* Target = itr->getSource();
@ -2717,7 +2717,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
case TARGET_RIGHT_FROM_VICTIM: case TARGET_RIGHT_FROM_VICTIM:
case TARGET_LEFT_FROM_VICTIM: case TARGET_LEFT_FROM_VICTIM:
{ {
Unit* pTarget = nullptr; Unit* pTarget = NULL;
// explicit cast data from client or server-side cast // explicit cast data from client or server-side cast
// some spell at client send caster // some spell at client send caster
@ -3085,7 +3085,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
} }
} }
SpellCastResult Spell::PreCastCheck(Aura* triggeredByAura /*= nullptr*/) SpellCastResult Spell::PreCastCheck(Aura* triggeredByAura /*= NULL*/)
{ {
// Prevent casting at cast another spell (ServerSide check) // Prevent casting at cast another spell (ServerSide check)
if (m_caster->IsNonMeleeSpellCasted(false, true, true) && m_cast_count && !m_spellInfo->HasAttribute(SPELL_ATTR_EX4_CAN_CAST_WHILE_CASTING)) if (m_caster->IsNonMeleeSpellCasted(false, true, true) && m_cast_count && !m_spellInfo->HasAttribute(SPELL_ATTR_EX4_CAN_CAST_WHILE_CASTING))
@ -3716,7 +3716,7 @@ void Spell::_handle_immediate_phase()
if (spellEffect->Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA || if (spellEffect->Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA ||
//summon a gameobject at the spell's destination xyz //summon a gameobject at the spell's destination xyz
(spellEffect->Effect == SPELL_EFFECT_TRANS_DOOR && spellEffect->EffectImplicitTargetA == TARGET_AREAEFFECT_GO_AROUND_DEST)) (spellEffect->Effect == SPELL_EFFECT_TRANS_DOOR && spellEffect->EffectImplicitTargetA == TARGET_AREAEFFECT_GO_AROUND_DEST))
HandleEffects(nullptr, nullptr, nullptr, SpellEffectIndex(j)); HandleEffects(NULL, NULL, NULL, SpellEffectIndex(j));
} }
} }
@ -3853,7 +3853,7 @@ void Spell::update(uint32 difftime)
continue; continue;
Unit* unit = m_caster->GetObjectGuid() == target.targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, target.targetGUID); Unit* unit = m_caster->GetObjectGuid() == target.targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, target.targetGUID);
if (unit == nullptr) if (unit == NULL)
continue; continue;
p->RewardPlayerAndGroupAtCast(unit, m_spellInfo->Id); p->RewardPlayerAndGroupAtCast(unit, m_spellInfo->Id);
@ -6141,7 +6141,7 @@ SpellCastResult Spell::CheckCast(bool strict)
{ {
if (strict) // Summoning Disorientation, trigger pet stun (cast by pet so it doesn't attack player) if (strict) // Summoning Disorientation, trigger pet stun (cast by pet so it doesn't attack player)
if (Pet* pet = ((Player*)m_caster)->GetPet()) if (Pet* pet = ((Player*)m_caster)->GetPet())
pet->CastSpell(pet, 32752, true, nullptr, nullptr, pet->GetObjectGuid()); pet->CastSpell(pet, 32752, true, NULL, NULL, pet->GetObjectGuid());
} }
else else
return SPELL_FAILED_ALREADY_HAVE_SUMMON; return SPELL_FAILED_ALREADY_HAVE_SUMMON;
@ -6507,7 +6507,7 @@ SpellCastResult Spell::CheckPetCast(Unit* target)
Unit* charmer = m_caster->GetCharmerOrOwner(); Unit* charmer = m_caster->GetCharmerOrOwner();
if (charmer) if (charmer)
{ {
Player* pCharmer = charmer->GetTypeId() == TYPEID_PLAYER ? static_cast<Player*>(charmer) : nullptr; Player* pCharmer = charmer->GetTypeId() == TYPEID_PLAYER ? static_cast<Player*>(charmer) : NULL;
if (!charmer->IsAlive() && (!pCharmer || !pCharmer->IsGhouled())) if (!charmer->IsAlive() && (!pCharmer || !pCharmer->IsGhouled()))
return SPELL_FAILED_CASTER_DEAD; return SPELL_FAILED_CASTER_DEAD;
} }

View file

@ -390,7 +390,7 @@ class Spell
Spell(Unit* caster, SpellEntry const* info, bool triggered, ObjectGuid originalCasterGUID = ObjectGuid(), SpellEntry const* triggeredBy = NULL); Spell(Unit* caster, SpellEntry const* info, bool triggered, ObjectGuid originalCasterGUID = ObjectGuid(), SpellEntry const* triggeredBy = NULL);
~Spell(); ~Spell();
void SpellStart(SpellCastTargets const* targets, Aura* triggeredByAura = nullptr); void SpellStart(SpellCastTargets const* targets, Aura* triggeredByAura = NULL);
void cancel(); void cancel();
@ -537,7 +537,7 @@ class Spell
bool IgnoreItemRequirements() const; // some item use spells have unexpected reagent data bool IgnoreItemRequirements() const; // some item use spells have unexpected reagent data
void UpdateOriginalCasterPointer(); void UpdateOriginalCasterPointer();
SpellCastResult PreCastCheck(Aura* triggeredByAura = nullptr); SpellCastResult PreCastCheck(Aura* triggeredByAura = NULL);
void Prepare(); void Prepare();
Unit* m_caster; Unit* m_caster;

View file

@ -818,7 +818,7 @@ void AreaAura::Update(uint32 diff)
holder->SetAuraDuration(GetAuraDuration()); holder->SetAuraDuration(GetAuraDuration());
AreaAura* aur = new AreaAura(actualSpellInfo, m_effIndex, &actualBasePoints, holder, (*tIter), caster, nullptr, GetSpellProto()->Id); AreaAura* aur = new AreaAura(actualSpellInfo, m_effIndex, &actualBasePoints, holder, (*tIter), caster, NULL, GetSpellProto()->Id);
holder->AddAura(aur, m_effIndex); holder->AddAura(aur, m_effIndex);
if (addedToExisting) if (addedToExisting)
@ -863,7 +863,7 @@ void AreaAura::Update(uint32 diff)
{ {
Player* check = caster->GetCharmerOrOwnerPlayerOrPlayerItself(); Player* check = caster->GetCharmerOrOwnerPlayerOrPlayerItself();
Group* pGroup = check ? check->GetGroup() : nullptr; Group* pGroup = check ? check->GetGroup() : NULL;
if (pGroup) if (pGroup)
{ {
Player* checkTarget = target->GetCharmerOrOwnerPlayerOrPlayerItself(); Player* checkTarget = target->GetCharmerOrOwnerPlayerOrPlayerItself();
@ -881,7 +881,7 @@ void AreaAura::Update(uint32 diff)
{ {
Player* check = caster->GetCharmerOrOwnerPlayerOrPlayerItself(); Player* check = caster->GetCharmerOrOwnerPlayerOrPlayerItself();
Group* pGroup = check ? check->GetGroup() : nullptr; Group* pGroup = check ? check->GetGroup() : NULL;
if (pGroup) if (pGroup)
{ {
Player* checkTarget = target->GetCharmerOrOwnerPlayerOrPlayerItself(); Player* checkTarget = target->GetCharmerOrOwnerPlayerOrPlayerItself();
@ -1199,7 +1199,7 @@ void Aura::TriggerSpell()
case 19695: // Inferno case 19695: // Inferno
{ {
int32 damageForTick[8] = { 500, 500, 1000, 1000, 2000, 2000, 3000, 5000 }; int32 damageForTick[8] = { 500, 500, 1000, 1000, 2000, 2000, 3000, 5000 };
triggerTarget->CastCustomSpell(triggerTarget, 19698, &damageForTick[GetAuraTicks() - 1], nullptr, nullptr, true, nullptr); triggerTarget->CastCustomSpell(triggerTarget, 19698, &damageForTick[GetAuraTicks() - 1], NULL, NULL, true, NULL);
return;; return;;
} }
@ -2294,7 +2294,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
case 13139: // net-o-matic case 13139: // net-o-matic
// root to self part of (root_target->charge->root_self sequence // root to self part of (root_target->charge->root_self sequence
if (Unit* caster = GetCaster()) if (Unit* caster = GetCaster())
caster->CastSpell(caster, 13138, true, nullptr, this); caster->CastSpell(caster, 13138, true, NULL, this);
return; return;
case 28832: // Mark of Korth'azz case 28832: // Mark of Korth'azz
case 28833: // Mark of Blaumeux case 28833: // Mark of Blaumeux
@ -2317,7 +2317,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
} }
if (Unit* caster = GetCaster()) if (Unit* caster = GetCaster())
caster->CastCustomSpell(target, 28836, &damage, nullptr, nullptr, true, nullptr, this); caster->CastCustomSpell(target, 28836, &damage, NULL, NULL, true, NULL, this);
return; return;
} }
case 31606: // Stormcrow Amulet case 31606: // Stormcrow Amulet
@ -2347,7 +2347,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
} }
case 36587: // Vision Guide case 36587: // Vision Guide
{ {
target->CastSpell(target, 36573, true, nullptr, this); target->CastSpell(target, 36573, true, NULL, this);
return; return;
} }
// Gender spells // Gender spells
@ -2364,12 +2364,12 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
case 46354: spellId = (gender == GENDER_MALE ? 46355 : 46356); break; case 46354: spellId = (gender == GENDER_MALE ? 46355 : 46356); break;
default: return; default: return;
} }
target->CastSpell(target, spellId, true, nullptr, this); target->CastSpell(target, spellId, true, NULL, this);
return; return;
} }
case 39850: // Rocket Blast case 39850: // Rocket Blast
if (roll_chance_i(20)) // backfire stun if (roll_chance_i(20)) // backfire stun
target->CastSpell(target, 51581, true, nullptr, this); target->CastSpell(target, 51581, true, NULL, this);
return; return;
case 43873: // Headless Horseman Laugh case 43873: // Headless Horseman Laugh
target->PlayDistanceSound(11965); target->PlayDistanceSound(11965);
@ -2383,7 +2383,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return; return;
} }
case 46637: // Break Ice case 46637: // Break Ice
target->CastSpell(target, 46638, true, nullptr, this); target->CastSpell(target, 46638, true, NULL, this);
return; return;
case 46699: // Requires No Ammo case 46699: // Requires No Ammo
if (target->GetTypeId() == TYPEID_PLAYER) if (target->GetTypeId() == TYPEID_PLAYER)
@ -2391,21 +2391,21 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
((Player*)target)->RemoveAmmo(); ((Player*)target)->RemoveAmmo();
return; return;
case 47190: // Toalu'u's Spiritual Incense case 47190: // Toalu'u's Spiritual Incense
target->CastSpell(target, 47189, true, nullptr, this); target->CastSpell(target, 47189, true, NULL, this);
// allow script to process further (text) // allow script to process further (text)
break; break;
case 47563: // Freezing Cloud case 47563: // Freezing Cloud
target->CastSpell(target, 47574, true, nullptr, this); target->CastSpell(target, 47574, true, NULL, this);
return; return;
case 47593: // Freezing Cloud case 47593: // Freezing Cloud
target->CastSpell(target, 47594, true, nullptr, this); target->CastSpell(target, 47594, true, NULL, this);
return; return;
case 48025: // Headless Horseman's Mount case 48025: // Headless Horseman's Mount
Spell::SelectMountByAreaAndSkill(target, GetSpellProto(), 51621, 48024, 51617, 48023, 0); Spell::SelectMountByAreaAndSkill(target, GetSpellProto(), 51621, 48024, 51617, 48023, 0);
return; return;
case 48143: // Forgotten Aura case 48143: // Forgotten Aura
// See Death's Door // See Death's Door
target->CastSpell(target, 48814, true, nullptr, this); target->CastSpell(target, 48814, true, NULL, this);
return; return;
case 51405: // Digging for Treasure case 51405: // Digging for Treasure
target->HandleEmote(EMOTE_STATE_WORK); target->HandleEmote(EMOTE_STATE_WORK);
@ -2426,12 +2426,12 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
case 61187: // Twilight Shift (single target) case 61187: // Twilight Shift (single target)
case 61190: // Twilight Shift (many targets) case 61190: // Twilight Shift (many targets)
target->RemoveAurasDueToSpell(57620); target->RemoveAurasDueToSpell(57620);
target->CastSpell(target, 61885, true, nullptr, this); target->CastSpell(target, 61885, true, NULL, this);
return; return;
case 62061: // Festive Holiday Mount case 62061: // Festive Holiday Mount
if (target->HasAuraType(SPELL_AURA_MOUNTED)) if (target->HasAuraType(SPELL_AURA_MOUNTED))
// Reindeer Transformation // Reindeer Transformation
target->CastSpell(target, 25860, true, nullptr, this); target->CastSpell(target, 25860, true, NULL, this);
return; return;
case 62109: // Tails Up: Aura case 62109: // Tails Up: Aura
target->setFaction(1990); // Ambient (hostile) target->setFaction(1990); // Ambient (hostile)
@ -2452,7 +2452,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return; return;
case 64132: // Constrictor Tentacle case 64132: // Constrictor Tentacle
if (target->GetTypeId() == TYPEID_PLAYER) if (target->GetTypeId() == TYPEID_PLAYER)
target->CastSpell(target, 64133, true, nullptr, this); target->CastSpell(target, 64133, true, NULL, this);
return; return;
case 65684: // Dark Essence case 65684: // Dark Essence
target->RemoveAurasDueToSpell(65686); target->RemoveAurasDueToSpell(65686);
@ -2471,17 +2471,17 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return; return;
case 70623: // Jaina's Call case 70623: // Jaina's Call
if (target->GetTypeId() == TYPEID_PLAYER) if (target->GetTypeId() == TYPEID_PLAYER)
target->CastSpell(target, 70525, true, nullptr, this); target->CastSpell(target, 70525, true, NULL, this);
return; return;
case 70638: // Call of Sylvanas case 70638: // Call of Sylvanas
if (target->GetTypeId() == TYPEID_PLAYER) if (target->GetTypeId() == TYPEID_PLAYER)
target->CastSpell(target, 70639, true, nullptr, this); target->CastSpell(target, 70639, true, NULL, this);
return; return;
case 71342: // Big Love Rocket case 71342: // Big Love Rocket
Spell::SelectMountByAreaAndSkill(target, GetSpellProto(), 71344, 71345, 71346, 71347, 0); Spell::SelectMountByAreaAndSkill(target, GetSpellProto(), 71344, 71345, 71346, 71347, 0);
return; return;
case 71563: // Deadly Precision case 71563: // Deadly Precision
target->CastSpell(target, 71564, true, nullptr, this); target->CastSpell(target, 71564, true, NULL, this);
return; return;
case 72286: // Invincible case 72286: // Invincible
Spell::SelectMountByAreaAndSkill(target, GetSpellProto(), 72281, 72282, 72283, 72284, 0); Spell::SelectMountByAreaAndSkill(target, GetSpellProto(), 72281, 72282, 72283, 72284, 0);
@ -2508,10 +2508,10 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return; return;
// Stance Cooldown // Stance Cooldown
target->CastSpell(target, 41102, true, nullptr, this); target->CastSpell(target, 41102, true, NULL, this);
// Battle Aura // Battle Aura
target->CastSpell(target, 41106, true, nullptr, this); target->CastSpell(target, 41106, true, NULL, this);
// equipment // equipment
((Creature*)target)->SetVirtualItem(VIRTUAL_ITEM_SLOT_0, 32614); ((Creature*)target)->SetVirtualItem(VIRTUAL_ITEM_SLOT_0, 32614);
@ -2525,10 +2525,10 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return; return;
// Stance Cooldown // Stance Cooldown
target->CastSpell(target, 41102, true, nullptr, this); target->CastSpell(target, 41102, true, NULL, this);
// Berserker Aura // Berserker Aura
target->CastSpell(target, 41107, true, nullptr, this); target->CastSpell(target, 41107, true, NULL, this);
// equipment // equipment
((Creature*)target)->SetVirtualItem(VIRTUAL_ITEM_SLOT_0, 32614); ((Creature*)target)->SetVirtualItem(VIRTUAL_ITEM_SLOT_0, 32614);
@ -2542,10 +2542,10 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return; return;
// Stance Cooldown // Stance Cooldown
target->CastSpell(target, 41102, true, nullptr, this); target->CastSpell(target, 41102, true, NULL, this);
// Defensive Aura // Defensive Aura
target->CastSpell(target, 41105, true, nullptr, this); target->CastSpell(target, 41105, true, NULL, this);
// equipment // equipment
((Creature*)target)->SetVirtualItem(VIRTUAL_ITEM_SLOT_0, 32604); ((Creature*)target)->SetVirtualItem(VIRTUAL_ITEM_SLOT_0, 32604);
@ -2559,10 +2559,10 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return; return;
// Stance Cooldown // Stance Cooldown
target->CastSpell(target, 59526, true, nullptr, this); target->CastSpell(target, 59526, true, NULL, this);
// Defensive Aura // Defensive Aura
target->CastSpell(target, 41105, true, nullptr, this); target->CastSpell(target, 41105, true, NULL, this);
// equipment // equipment
((Creature*)target)->SetVirtualItem(VIRTUAL_ITEM_SLOT_0, 43625); ((Creature*)target)->SetVirtualItem(VIRTUAL_ITEM_SLOT_0, 43625);
@ -2576,10 +2576,10 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return; return;
// Stance Cooldown // Stance Cooldown
target->CastSpell(target, 59526, true, nullptr, this); target->CastSpell(target, 59526, true, NULL, this);
// Berserker Aura // Berserker Aura
target->CastSpell(target, 41107, true, nullptr, this); target->CastSpell(target, 41107, true, NULL, this);
// equipment // equipment
((Creature*)target)->SetVirtualItem(VIRTUAL_ITEM_SLOT_0, 43625); ((Creature*)target)->SetVirtualItem(VIRTUAL_ITEM_SLOT_0, 43625);
@ -2593,10 +2593,10 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return; return;
// Stance Cooldown // Stance Cooldown
target->CastSpell(target, 59526, true, nullptr, this); target->CastSpell(target, 59526, true, NULL, this);
// Battle Aura // Battle Aura
target->CastSpell(target, 41106, true, nullptr, this); target->CastSpell(target, 41106, true, NULL, this);
// equipment // equipment
((Creature*)target)->SetVirtualItem(VIRTUAL_ITEM_SLOT_0, 43623); ((Creature*)target)->SetVirtualItem(VIRTUAL_ITEM_SLOT_0, 43623);
@ -2626,10 +2626,10 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
switch ((*itr)->GetSpellProto()->Id) switch ((*itr)->GetSpellProto()->Id)
{ {
case 46859: // Unrelenting Assault, rank 1 case 46859: // Unrelenting Assault, rank 1
target->CastSpell(target, 64849, true, nullptr, (*itr)); target->CastSpell(target, 64849, true, NULL, (*itr));
break; break;
case 46860: // Unrelenting Assault, rank 2 case 46860: // Unrelenting Assault, rank 2
target->CastSpell(target, 64850, true, nullptr, (*itr)); target->CastSpell(target, 64850, true, NULL, (*itr));
break; break;
default: default:
break; break;
@ -2648,7 +2648,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
switch (GetId()) switch (GetId())
{ {
case 34026: // Kill Command case 34026: // Kill Command
target->CastSpell(target, 34027, true, nullptr, this); target->CastSpell(target, 34027, true, NULL, this);
return; return;
} }
break; break;
@ -2658,7 +2658,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
switch (GetId()) switch (GetId())
{ {
case 55198: // Tidal Force case 55198: // Tidal Force
target->CastSpell(target, 55166, true, nullptr, this); target->CastSpell(target, 55166, true, NULL, this);
return; return;
} }
@ -2713,7 +2713,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
} }
if (finalSpellId) if (finalSpellId)
caster->CastSpell(target, finalSpellId, true, nullptr, this); caster->CastSpell(target, finalSpellId, true, NULL, this);
return; return;
} }
@ -2733,7 +2733,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return; return;
} }
case 12479: // Hex of Jammal'an case 12479: // Hex of Jammal'an
target->CastSpell(target, 12480, true, nullptr, this); target->CastSpell(target, 12480, true, NULL, this);
return; return;
case 12774: // (DND) Belnistrasz Idol Shutdown Visual case 12774: // (DND) Belnistrasz Idol Shutdown Visual
{ {
@ -2749,36 +2749,36 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
case 28169: // Mutating Injection case 28169: // Mutating Injection
{ {
// Mutagen Explosion // Mutagen Explosion
target->CastSpell(target, 28206, true, nullptr, this); target->CastSpell(target, 28206, true, NULL, this);
// Poison Cloud // Poison Cloud
target->CastSpell(target, 28240, true, nullptr, this); target->CastSpell(target, 28240, true, NULL, this);
return; return;
} }
case 32045: // Soul Charge case 32045: // Soul Charge
{ {
if (m_removeMode == AURA_REMOVE_BY_EXPIRE) if (m_removeMode == AURA_REMOVE_BY_EXPIRE)
target->CastSpell(target, 32054, true, nullptr, this); target->CastSpell(target, 32054, true, NULL, this);
return; return;
} }
case 32051: // Soul Charge case 32051: // Soul Charge
{ {
if (m_removeMode == AURA_REMOVE_BY_EXPIRE) if (m_removeMode == AURA_REMOVE_BY_EXPIRE)
target->CastSpell(target, 32057, true, nullptr, this); target->CastSpell(target, 32057, true, NULL, this);
return; return;
} }
case 32052: // Soul Charge case 32052: // Soul Charge
{ {
if (m_removeMode == AURA_REMOVE_BY_EXPIRE) if (m_removeMode == AURA_REMOVE_BY_EXPIRE)
target->CastSpell(target, 32053, true, nullptr, this); target->CastSpell(target, 32053, true, NULL, this);
return; return;
} }
case 32286: // Focus Target Visual case 32286: // Focus Target Visual
{ {
if (m_removeMode == AURA_REMOVE_BY_EXPIRE) if (m_removeMode == AURA_REMOVE_BY_EXPIRE)
target->CastSpell(target, 32301, true, nullptr, this); target->CastSpell(target, 32301, true, NULL, this);
return; return;
} }
@ -2791,7 +2791,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
} }
case 36730: // Flame Strike case 36730: // Flame Strike
{ {
target->CastSpell(target, 36731, true, nullptr, this); target->CastSpell(target, 36731, true, NULL, this);
return; return;
} }
case 41099: // Battle Stance case 41099: // Battle Stance
@ -2863,7 +2863,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
{ {
uint32 spellId = target->GetMap()->IsRegularDifficulty() ? 44190 : 46163; uint32 spellId = target->GetMap()->IsRegularDifficulty() ? 44190 : 46163;
target->CastSpell(target, spellId, true, nullptr, this); target->CastSpell(target, spellId, true, NULL, this);
} }
return; return;
} }
@ -2871,7 +2871,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
{ {
// Kill target if dispelled // Kill target if dispelled
if (m_removeMode == AURA_REMOVE_BY_DISPEL) if (m_removeMode == AURA_REMOVE_BY_DISPEL)
target->DealDamage(target, target->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false); target->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
return; return;
} }
case 45963: // Call Alliance Deserter case 45963: // Call Alliance Deserter
@ -2883,12 +2883,12 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
case 46308: // Burning Winds case 46308: // Burning Winds
{ {
// casted only at creatures at spawn // casted only at creatures at spawn
target->CastSpell(target, 47287, true, nullptr, this); target->CastSpell(target, 47287, true, NULL, this);
return; return;
} }
case 46637: // Break Ice case 46637: // Break Ice
{ {
target->CastSpell(target, 47030, true, nullptr, this); target->CastSpell(target, 47030, true, NULL, this);
return; return;
} }
case 48385: // Create Spirit Fount Beam case 48385: // Create Spirit Fount Beam
@ -2900,7 +2900,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
{ {
// Blood Oath // Blood Oath
if (m_removeMode == AURA_REMOVE_BY_EXPIRE) if (m_removeMode == AURA_REMOVE_BY_EXPIRE)
target->CastSpell(target, 50001, true, nullptr, this); target->CastSpell(target, 50001, true, NULL, this);
return; return;
} }
@ -2928,7 +2928,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
if (Unit* pCaster = GetCaster()) if (Unit* pCaster = GetCaster())
{ {
if (m_removeMode == AURA_REMOVE_BY_EXPIRE) if (m_removeMode == AURA_REMOVE_BY_EXPIRE)
pCaster->CastSpell(target, 51872, true, nullptr, this); pCaster->CastSpell(target, 51872, true, NULL, this);
} }
return; return;
@ -2936,7 +2936,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
case 52098: // Charge Up case 52098: // Charge Up
{ {
if (m_removeMode == AURA_REMOVE_BY_EXPIRE) if (m_removeMode == AURA_REMOVE_BY_EXPIRE)
target->CastSpell(target, 52092, true, nullptr, this); target->CastSpell(target, 52092, true, NULL, this);
return; return;
} }
@ -2994,9 +2994,9 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
case 68839: // Corrupt Soul case 68839: // Corrupt Soul
{ {
// Knockdown Stun // Knockdown Stun
target->CastSpell(target, 68848, true, nullptr, this); target->CastSpell(target, 68848, true, NULL, this);
// Draw Corrupted Soul // Draw Corrupted Soul
target->CastSpell(target, 68846, true, nullptr, this); target->CastSpell(target, 68846, true, NULL, this);
return; return;
} }
} }
@ -3005,7 +3005,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
if (classOptions && classOptions->SpellFamilyName == SPELLFAMILY_MAGE && (classOptions->SpellFamilyFlags & UI64LIT(0x2000000000000))) if (classOptions && classOptions->SpellFamilyName == SPELLFAMILY_MAGE && (classOptions->SpellFamilyFlags & UI64LIT(0x2000000000000)))
{ {
if (m_removeMode == AURA_REMOVE_BY_EXPIRE || m_removeMode == AURA_REMOVE_BY_DISPEL) if (m_removeMode == AURA_REMOVE_BY_EXPIRE || m_removeMode == AURA_REMOVE_BY_DISPEL)
target->CastSpell(target, m_modifier.m_amount, true, nullptr, this); target->CastSpell(target, m_modifier.m_amount, true, NULL, this);
return; return;
} }
@ -3044,7 +3044,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
if (!caster) if (!caster)
return; return;
caster->CastSpell(target, 24659, true, nullptr, nullptr, GetCasterGuid()); caster->CastSpell(target, 24659, true, NULL, NULL, GetCasterGuid());
} }
else else
target->RemoveAurasDueToSpell(24659); target->RemoveAurasDueToSpell(24659);
@ -3058,7 +3058,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
if (!caster) if (!caster)
return; return;
caster->CastSpell(target, 24662, true, nullptr, nullptr, GetCasterGuid()); caster->CastSpell(target, 24662, true, NULL, NULL, GetCasterGuid());
} }
else else
target->RemoveAurasDueToSpell(24662); target->RemoveAurasDueToSpell(24662);
@ -3255,7 +3255,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
int32 bp0 = m_modifier.m_amount; int32 bp0 = m_modifier.m_amount;
if (Unit* caster = GetCaster()) if (Unit* caster = GetCaster())
target->CastCustomSpell(caster, 48210, &bp0, nullptr, nullptr, true, nullptr, this); target->CastCustomSpell(caster, 48210, &bp0, NULL, NULL, true, NULL, this);
} }
} }
break; break;
@ -3285,7 +3285,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return; return;
int32 bp0 = int32(target->GetMaxHealth() * m_modifier.m_amount / 100); int32 bp0 = int32(target->GetMaxHealth() * m_modifier.m_amount / 100);
target->CastCustomSpell(target, 50322, &bp0, nullptr, nullptr, true); target->CastCustomSpell(target, 50322, &bp0, NULL, NULL, true);
} }
else else
target->RemoveAurasDueToSpell(50322); target->RemoveAurasDueToSpell(50322);
@ -3318,12 +3318,12 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
if (target->IsInWorld() && GetStackAmount() > 0) if (target->IsInWorld() && GetStackAmount() > 0)
{ {
int32 amount = m_modifier.m_amount; int32 amount = m_modifier.m_amount;
target->CastCustomSpell(target, 33778, &amount, nullptr, nullptr, true, nullptr, this, GetCasterGuid()); target->CastCustomSpell(target, 33778, &amount, NULL, NULL, true, NULL, this, GetCasterGuid());
if (Unit* caster = GetCaster()) if (Unit* caster = GetCaster())
{ {
int32 returnmana = (GetSpellProto()->GetManaCostPercentage() * caster->GetCreateMana() / 100) * GetStackAmount() / 2; int32 returnmana = (GetSpellProto()->GetManaCostPercentage() * caster->GetCreateMana() / 100) * GetStackAmount() / 2;
caster->CastCustomSpell(caster, 64372, &returnmana, nullptr, nullptr, true, nullptr, this, GetCasterGuid()); caster->CastCustomSpell(caster, 64372, &returnmana, NULL, NULL, true, NULL, this, GetCasterGuid());
} }
} }
} }
@ -3407,7 +3407,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
case 25899: // Greater Blessing of Sanctuary case 25899: // Greater Blessing of Sanctuary
{ {
if (apply) if (apply)
target->CastSpell(target, 67480, true, nullptr, this); target->CastSpell(target, 67480, true, NULL, this);
else else
target->RemoveAurasDueToSpell(67480); target->RemoveAurasDueToSpell(67480);
return; return;
@ -3702,14 +3702,14 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
if ((int32)target->GetPower(POWER_ENERGY) > furorChance) if ((int32)target->GetPower(POWER_ENERGY) > furorChance)
{ {
target->SetPower(POWER_ENERGY, 0); target->SetPower(POWER_ENERGY, 0);
target->CastCustomSpell(target, 17099, &furorChance, nullptr, nullptr, true, nullptr, this); target->CastCustomSpell(target, 17099, &furorChance, NULL, NULL, true, NULL, this);
} }
} }
else if (furorChance) // only if talent known else if (furorChance) // only if talent known
{ {
target->SetPower(POWER_RAGE, 0); target->SetPower(POWER_RAGE, 0);
if (irand(1, 100) <= furorChance) if (irand(1, 100) <= furorChance)
target->CastSpell(target, 17057, true, nullptr, this); target->CastSpell(target, 17057, true, NULL, this);
} }
break; break;
} }
@ -3765,12 +3765,12 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
case FORM_BEAR: case FORM_BEAR:
case FORM_CAT: case FORM_CAT:
if (Aura* dummy = target->GetDummyAura(37315)) if (Aura* dummy = target->GetDummyAura(37315))
target->CastSpell(target, 37316, true, nullptr, dummy); target->CastSpell(target, 37316, true, NULL, dummy);
break; break;
// Nordrassil Regalia - bonus // Nordrassil Regalia - bonus
case FORM_MOONKIN: case FORM_MOONKIN:
if (Aura* dummy = target->GetDummyAura(37324)) if (Aura* dummy = target->GetDummyAura(37324))
target->CastSpell(target, 37325, true, nullptr, dummy); target->CastSpell(target, 37325, true, NULL, dummy);
break; break;
default: default:
break; break;
@ -4784,7 +4784,7 @@ void Aura::HandleInvisibility(bool apply, bool Real)
if (Real && target->GetTypeId() == TYPEID_PLAYER) if (Real && target->GetTypeId() == TYPEID_PLAYER)
{ {
if (((Player*)target)->GetMover() == nullptr) // check if the player doesnt have a mover, when player is hidden during MC of creature if (((Player*)target)->GetMover() == NULL) // check if the player doesnt have a mover, when player is hidden during MC of creature
{ {
// apply glow vision // apply glow vision
target->SetByteFlag(PLAYER_FIELD_BYTES2, 1, PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW); target->SetByteFlag(PLAYER_FIELD_BYTES2, 1, PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
@ -7946,7 +7946,7 @@ void Aura::PeriodicDummyTick()
} }
case 7057: // Haunting Spirits case 7057: // Haunting Spirits
if (roll_chance_i(33)) if (roll_chance_i(33))
target->CastSpell(target, m_modifier.m_amount, true, nullptr, this); target->CastSpell(target, m_modifier.m_amount, true, NULL, this);
return; return;
// // Panda // // Panda
// case 19230: break; // case 19230: break;
@ -8090,16 +8090,16 @@ void Aura::PeriodicDummyTick()
// // Darkness // // Darkness
// case 45996: break; // case 45996: break;
case 46041: // Summon Blood Elves Periodic case 46041: // Summon Blood Elves Periodic
target->CastSpell(target, 46037, true, nullptr, this); target->CastSpell(target, 46037, true, NULL, this);
target->CastSpell(target, roll_chance_i(50) ? 46038 : 46039, true, nullptr, this); target->CastSpell(target, roll_chance_i(50) ? 46038 : 46039, true, NULL, this);
target->CastSpell(target, 46040, true, nullptr, this); target->CastSpell(target, 46040, true, NULL, this);
return; return;
// // Transform Visual Missile Periodic // // Transform Visual Missile Periodic
// case 46205: break; // case 46205: break;
// // Find Opening Beam End // // Find Opening Beam End
// case 46333: break; // case 46333: break;
case 46371: // Ice Spear Control Aura case 46371: // Ice Spear Control Aura
target->CastSpell(target, 46372, true, nullptr, this); target->CastSpell(target, 46372, true, NULL, this);
return; return;
// // Hailstone Chill // // Hailstone Chill
// case 46458: break; // case 46458: break;
@ -8126,12 +8126,12 @@ void Aura::PeriodicDummyTick()
{ {
bool chance = roll_chance_i(50); bool chance = roll_chance_i(50);
target->CastSpell(target, chance ? 48631 : 48632, true, nullptr, this); target->CastSpell(target, chance ? 48631 : 48632, true, NULL, this);
if (GetAuraTicks() % 2) // which doctor at odd tick if (GetAuraTicks() % 2) // which doctor at odd tick
target->CastSpell(target, chance ? 48636 : 48635, true, nullptr, this); target->CastSpell(target, chance ? 48636 : 48635, true, NULL, this);
else // or harponeer, at even tick else // or harponeer, at even tick
target->CastSpell(target, chance ? 48634 : 48633, true, nullptr, this); target->CastSpell(target, chance ? 48634 : 48633, true, NULL, this);
return; return;
} }
@ -8160,18 +8160,18 @@ void Aura::PeriodicDummyTick()
// case 50530: break; // case 50530: break;
case 50789: // Summon iron dwarf (left or right) case 50789: // Summon iron dwarf (left or right)
case 59860: case 59860:
target->CastSpell(target, roll_chance_i(50) ? 50790 : 50791, true, nullptr, this); target->CastSpell(target, roll_chance_i(50) ? 50790 : 50791, true, NULL, this);
return; return;
case 50792: // Summon iron trogg (left or right) case 50792: // Summon iron trogg (left or right)
case 59859: case 59859:
target->CastSpell(target, roll_chance_i(50) ? 50793 : 50794, true, nullptr, this); target->CastSpell(target, roll_chance_i(50) ? 50793 : 50794, true, NULL, this);
return; return;
case 50801: // Summon malformed ooze (left or right) case 50801: // Summon malformed ooze (left or right)
case 59858: case 59858:
target->CastSpell(target, roll_chance_i(50) ? 50802 : 50803, true, nullptr, this); target->CastSpell(target, roll_chance_i(50) ? 50802 : 50803, true, NULL, this);
return; return;
case 50824: // Summon earthen dwarf case 50824: // Summon earthen dwarf
target->CastSpell(target, roll_chance_i(50) ? 50825 : 50826, true, nullptr, this); target->CastSpell(target, roll_chance_i(50) ? 50825 : 50826, true, NULL, this);
return; return;
case 52441: // Cool Down case 52441: // Cool Down
target->CastSpell(target, 52443, true); target->CastSpell(target, 52443, true);
@ -8190,17 +8190,17 @@ void Aura::PeriodicDummyTick()
// Cast different spell depending on trigger position // Cast different spell depending on trigger position
// This will summon a different npc entry on each location - each of those has individual movement patern // This will summon a different npc entry on each location - each of those has individual movement patern
if (target->GetPositionZ() < 750.0f) if (target->GetPositionZ() < 750.0f)
target->CastSpell(target, summonSpells[spell->Id - 53035][0], true, nullptr, this); target->CastSpell(target, summonSpells[spell->Id - 53035][0], true, NULL, this);
else if (target->GetPositionX() > 500.0f) else if (target->GetPositionX() > 500.0f)
target->CastSpell(target, summonSpells[spell->Id - 53035][1], true, nullptr, this); target->CastSpell(target, summonSpells[spell->Id - 53035][1], true, NULL, this);
else else
target->CastSpell(target, summonSpells[spell->Id - 53035][2], true, nullptr, this); target->CastSpell(target, summonSpells[spell->Id - 53035][2], true, NULL, this);
return; return;
} }
case 53520: // Carrion Beetles case 53520: // Carrion Beetles
target->CastSpell(target, 53521, true, nullptr, this); target->CastSpell(target, 53521, true, NULL, this);
target->CastSpell(target, 53521, true, nullptr, this); target->CastSpell(target, 53521, true, NULL, this);
return; return;
case 55592: // Clean case 55592: // Clean
switch (urand(0, 2)) switch (urand(0, 2))
@ -8213,18 +8213,18 @@ void Aura::PeriodicDummyTick()
case 61968: // Flash Freeze case 61968: // Flash Freeze
{ {
if (GetAuraTicks() == 1 && !target->HasAura(62464)) if (GetAuraTicks() == 1 && !target->HasAura(62464))
target->CastSpell(target, 61970, true, nullptr, this); target->CastSpell(target, 61970, true, NULL, this);
return; return;
} }
case 62018: // Collapse case 62018: // Collapse
{ {
// lose 1% of health every second // lose 1% of health every second
target->DealDamage(target, target->GetMaxHealth() * .01, nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, nullptr, false); target->DealDamage(target, target->GetMaxHealth() * .01, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
return; return;
} }
case 62019: // Rune of Summoning case 62019: // Rune of Summoning
{ {
target->CastSpell(target, 62020, true, nullptr, this); target->CastSpell(target, 62020, true, NULL, this);
return; return;
} }
case 62038: // Biting Cold case 62038: // Biting Cold
@ -8237,7 +8237,7 @@ void Aura::PeriodicDummyTick()
target->RemoveAuraHolderFromStack(62039); target->RemoveAuraHolderFromStack(62039);
// otherwise add one aura stack each 3 seconds // otherwise add one aura stack each 3 seconds
else if (GetAuraTicks() % 3 && !target->HasAura(62821)) else if (GetAuraTicks() % 3 && !target->HasAura(62821))
target->CastSpell(target, 62039, true, nullptr, this); target->CastSpell(target, 62039, true, NULL, this);
return; return;
} }
case 62039: // Biting Cold case 62039: // Biting Cold
@ -8255,11 +8255,11 @@ void Aura::PeriodicDummyTick()
} }
case 62717: // Slag Pot case 62717: // Slag Pot
{ {
target->CastSpell(target, target->GetMap()->IsRegularDifficulty() ? 65722 : 65723, true, nullptr, this); target->CastSpell(target, target->GetMap()->IsRegularDifficulty() ? 65722 : 65723, true, NULL, this);
// cast Slag Imbued if the target survives up to the last tick // cast Slag Imbued if the target survives up to the last tick
if (GetAuraTicks() == 10) if (GetAuraTicks() == 10)
target->CastSpell(target, 63536, true, nullptr, this); target->CastSpell(target, 63536, true, NULL, this);
return; return;
} }
case 63050: // Sanity case 63050: // Sanity
@ -8289,7 +8289,7 @@ void Aura::PeriodicDummyTick()
if (GetHolder()->GetStackAmount() >= 10) if (GetHolder()->GetStackAmount() >= 10)
{ {
target->CastSpell(target, 64219, true); target->CastSpell(target, 64219, true);
target->DealDamage(target, target->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false); target->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
} }
return; return;
} }
@ -8309,13 +8309,13 @@ void Aura::PeriodicDummyTick()
if (uiAuraId && !target->HasAura(uiAuraId)) if (uiAuraId && !target->HasAura(uiAuraId))
{ {
target->CastSpell(target, uiAuraId, true, nullptr, this); target->CastSpell(target, uiAuraId, true, NULL, this);
// remove original aura if phased // remove original aura if phased
if (uiAuraId == 64417) if (uiAuraId == 64417)
{ {
target->RemoveAurasDueToSpell(64412); target->RemoveAurasDueToSpell(64412);
target->CastSpell(target, 62169, true, nullptr, this); target->CastSpell(target, 62169, true, NULL, this);
} }
} }
} }
@ -8323,7 +8323,7 @@ void Aura::PeriodicDummyTick()
} }
case 65272: // Shatter Chest case 65272: // Shatter Chest
{ {
target->CastSpell(target, 62501, true, nullptr, this); target->CastSpell(target, 62501, true, NULL, this);
return; return;
} }
case 66118: // Leeching Swarm case 66118: // Leeching Swarm
@ -8341,10 +8341,10 @@ void Aura::PeriodicDummyTick()
lifeLeeched = 250; lifeLeeched = 250;
// Leeching swarm damage // Leeching swarm damage
caster->CastCustomSpell(target, 66240, &lifeLeeched, nullptr, nullptr, true, nullptr, this); caster->CastCustomSpell(target, 66240, &lifeLeeched, NULL, NULL, true, NULL, this);
// Leeching swarm heal // Leeching swarm heal
target->CastCustomSpell(caster, 66125, &lifeLeeched, nullptr, nullptr, true, nullptr, this); target->CastCustomSpell(caster, 66125, &lifeLeeched, NULL, NULL, true, NULL, this);
return; return;
} }
@ -8354,7 +8354,7 @@ void Aura::PeriodicDummyTick()
if (!caster) if (!caster)
return; return;
caster->CastSpell(target, 66797, true, nullptr, this); caster->CastSpell(target, 66797, true, NULL, this);
target->RemoveAurasDueToSpell(GetId()); target->RemoveAurasDueToSpell(GetId());
return; return;
} }
@ -8424,7 +8424,7 @@ void Aura::PeriodicDummyTick()
if (GetAuraTicks() != 1) if (GetAuraTicks() != 1)
return; return;
if (Unit* pCaster = GetCaster()) if (Unit* pCaster = GetCaster())
pCaster->CastSpell(pCaster, GetSpellProto()->CalculateSimpleValue(m_effIndex), true, nullptr, this); pCaster->CastSpell(pCaster, GetSpellProto()->CalculateSimpleValue(m_effIndex), true, NULL, this);
return; return;
} }
default: default:
@ -8450,7 +8450,7 @@ void Aura::PeriodicDummyTick()
int32 mod = (rage < 100) ? rage : 100; int32 mod = (rage < 100) ? rage : 100;
int32 points = target->CalculateSpellDamage(target, spell, EFFECT_INDEX_1); int32 points = target->CalculateSpellDamage(target, spell, EFFECT_INDEX_1);
int32 regen = target->GetMaxHealth() * (mod * points / 10) / 1000; int32 regen = target->GetMaxHealth() * (mod * points / 10) / 1000;
target->CastCustomSpell(target, 22845, &regen, nullptr, nullptr, true, nullptr, this); target->CastCustomSpell(target, 22845, &regen, NULL, NULL, true, NULL, this);
target->SetPower(POWER_RAGE, rage - mod); target->SetPower(POWER_RAGE, rage - mod);
return; return;
} }
@ -8517,7 +8517,7 @@ void Aura::PeriodicDummyTick()
{ {
Unit* victim = target->getVictim(); Unit* victim = target->getVictim();
if (victim && victim->GetHealth() * 100 < victim->GetMaxHealth() * 35) if (victim && victim->GetHealth() * 100 < victim->GetMaxHealth() * 35)
target->CastSpell(target, spell->Id == 53511 ? 60096 : 60097, true, nullptr, this); target->CastSpell(target, spell->Id == 53511 ? 60096 : 60097, true, NULL, this);
return; return;
} }
default: default:
@ -8543,7 +8543,7 @@ void Aura::PeriodicDummyTick()
if (classOptions && classOptions->SpellFamilyFlags & UI64LIT(0x0000000000000020)) if (classOptions && classOptions->SpellFamilyFlags & UI64LIT(0x0000000000000020))
{ {
if (Unit* caster = GetCaster()) if (Unit* caster = GetCaster())
caster->CastCustomSpell(target, 52212, &m_modifier.m_amount, nullptr, nullptr, true, nullptr, this); caster->CastCustomSpell(target, 52212, &m_modifier.m_amount, NULL, NULL, true, NULL, this);
return; return;
} }
// Raise Dead // Raise Dead
@ -8576,7 +8576,7 @@ void Aura::PeriodicDummyTick()
// Increases your attack power by $s1 for every $s2 armor value you have. // Increases your attack power by $s1 for every $s2 armor value you have.
// Calculate AP bonus (from 1 effect of this spell) // Calculate AP bonus (from 1 effect of this spell)
int32 apBonus = m_modifier.m_amount * target->GetArmor() / target->CalculateSpellDamage(target, spell, EFFECT_INDEX_1); int32 apBonus = m_modifier.m_amount * target->GetArmor() / target->CalculateSpellDamage(target, spell, EFFECT_INDEX_1);
target->CastCustomSpell(target, 61217, &apBonus, &apBonus, nullptr, true, nullptr, this); target->CastCustomSpell(target, 61217, &apBonus, &apBonus, NULL, true, NULL, this);
return; return;
} }
// Reaping // Reaping
@ -8590,7 +8590,7 @@ void Aura::PeriodicDummyTick()
{ {
// damage not expected to be show in logs, not any damage spell related to damage apply // damage not expected to be show in logs, not any damage spell related to damage apply
uint32 deal = m_modifier.m_amount * target->GetMaxHealth() / 100; uint32 deal = m_modifier.m_amount * target->GetMaxHealth() / 100;
target->DealDamage(target, deal, nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false); target->DealDamage(target, deal, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
return; return;
} }
break; break;
@ -9010,7 +9010,7 @@ void Aura::HandleTriggerLinkedAura(bool apply, bool Real)
if (apply) if (apply)
{ {
// ToDo: handle various cases where base points need to be applied! // ToDo: handle various cases where base points need to be applied!
target->CastSpell(target, spellInfo, true, nullptr, this); target->CastSpell(target, spellInfo, true, NULL, this);
} }
else else
target->RemoveAurasByCasterSpell(linkedSpell, GetCasterGuid()); target->RemoveAurasByCasterSpell(linkedSpell, GetCasterGuid());

View file

@ -558,7 +558,7 @@ class Aura
class AreaAura : public Aura class AreaAura : public Aura
{ {
public: public:
AreaAura(SpellEntry const* spellproto, SpellEffectIndex eff, int32* currentBasePoints, SpellAuraHolder* holder, Unit* target, Unit* caster = nullptr, Item* castItem = nullptr, uint32 originalRankSpellId = 0); AreaAura(SpellEntry const* spellproto, SpellEffectIndex eff, int32* currentBasePoints, SpellAuraHolder* holder, Unit* target, Unit* caster = NULL, Item* castItem = NULL, uint32 originalRankSpellId = 0);
~AreaAura(); ~AreaAura();
protected: protected:
void Update(uint32 diff) override; void Update(uint32 diff) override;
@ -591,5 +591,5 @@ class SingleEnemyTargetAura : public Aura
}; };
Aura* CreateAura(SpellEntry const* spellproto, SpellEffectIndex eff, int32* currentBasePoints, SpellAuraHolder* holder, Unit* target, Unit* caster = NULL, Item* castItem = NULL); Aura* CreateAura(SpellEntry const* spellproto, SpellEffectIndex eff, int32* currentBasePoints, SpellAuraHolder* holder, Unit* target, Unit* caster = NULL, Item* castItem = NULL);
SpellAuraHolder* CreateSpellAuraHolder(SpellEntry const* spellproto, Unit* target, WorldObject* caster, Item* castItem = nullptr, SpellEntry const* triggeredBy = nullptr); SpellAuraHolder* CreateSpellAuraHolder(SpellEntry const* spellproto, Unit* target, WorldObject* caster, Item* castItem = NULL, SpellEntry const* triggeredBy = NULL);
#endif #endif

View file

@ -307,7 +307,7 @@ void Spell::EffectInstaKill(SpellEffectEntry const* /*effect*/)
data << uint32(m_spellInfo->Id); data << uint32(m_spellInfo->Id);
m_caster->SendMessageToSet(&data, true); m_caster->SendMessageToSet(&data, true);
m_caster->DealDamage(unitTarget, unitTarget->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, m_spellInfo, false); m_caster->DealDamage(unitTarget, unitTarget->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, m_spellInfo, false);
} }
void Spell::EffectEnvironmentalDMG(SpellEffectEntry const* effect) void Spell::EffectEnvironmentalDMG(SpellEffectEntry const* effect)
@ -543,7 +543,7 @@ void Spell::EffectSchoolDMG(SpellEffectEntry const* effect)
// Conflagrate - consumes Immolate or Shadowflame // Conflagrate - consumes Immolate or Shadowflame
else if (m_spellInfo->GetTargetAuraState() == AURA_STATE_CONFLAGRATE) else if (m_spellInfo->GetTargetAuraState() == AURA_STATE_CONFLAGRATE)
{ {
Aura const* aura = nullptr; // found req. aura for damage calculation Aura const* aura = NULL; // found req. aura for damage calculation
Unit::AuraList const& mPeriodic = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE); Unit::AuraList const& mPeriodic = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for (Unit::AuraList::const_iterator i = mPeriodic.begin(); i != mPeriodic.end(); ++i) for (Unit::AuraList::const_iterator i = mPeriodic.begin(); i != mPeriodic.end(); ++i)
@ -848,7 +848,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
case 4: spell_id = 8067; break; // Party Time! case 4: spell_id = 8067; break; // Party Time!
case 5: spell_id = 8068; break; // Healthy Spirit case 5: spell_id = 8068; break; // Healthy Spirit
} }
m_caster->CastSpell(m_caster, spell_id, true, nullptr); m_caster->CastSpell(m_caster, spell_id, true, NULL);
return; return;
} }
case 8213: // Savory Deviate Delight case 8213: // Savory Deviate Delight
@ -865,7 +865,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
case 2: spell_id = (m_caster->getGender() == GENDER_MALE ? 8221 : 8222); break; case 2: spell_id = (m_caster->getGender() == GENDER_MALE ? 8221 : 8222); break;
} }
m_caster->CastSpell(m_caster, spell_id, true, nullptr); m_caster->CastSpell(m_caster, spell_id, true, NULL);
return; return;
} }
case 9976: // Polly Eats the E.C.A.C. case 9976: // Polly Eats the E.C.A.C.
@ -905,7 +905,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
else // normal root else // normal root
spell_id = 13099; spell_id = 13099;
m_caster->CastSpell(unitTarget, spell_id, true, nullptr); m_caster->CastSpell(unitTarget, spell_id, true, NULL);
return; return;
} }
case 13489: case 13489:
@ -925,7 +925,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
switch (m_triggeredByAuraSpell->Id) switch (m_triggeredByAuraSpell->Id)
{ {
case 26467: // Persistent Shield case 26467: // Persistent Shield
m_caster->CastCustomSpell(unitTarget, 26470, &damage, nullptr, nullptr, true); m_caster->CastCustomSpell(unitTarget, 26470, &damage, NULL, NULL, true);
break; break;
default: default:
sLog.outError("EffectDummy: Non-handled case for spell 13567 for triggered aura %u", m_triggeredByAuraSpell->Id); sLog.outError("EffectDummy: Non-handled case for spell 13567 for triggered aura %u", m_triggeredByAuraSpell->Id);
@ -989,7 +989,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
default: spell_id = 16591; break; default: spell_id = 16591; break;
} }
m_caster->CastSpell(m_caster, spell_id, true, nullptr); m_caster->CastSpell(m_caster, spell_id, true, NULL);
return; return;
} }
case 17009: // Voodoo case 17009: // Voodoo
@ -1009,7 +1009,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
case 6: spell_id = 16716; break; // Launch case 6: spell_id = 16716; break; // Launch
} }
m_caster->CastSpell(unitTarget, spell_id, true, nullptr, nullptr, m_originalCasterGUID, m_spellInfo); m_caster->CastSpell(unitTarget, spell_id, true, NULL, NULL, m_originalCasterGUID, m_spellInfo);
return; return;
} }
case 17251: // Spirit Healer Res case 17251: // Spirit Healer Res
@ -1036,12 +1036,12 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
? 17269 // Create Resonating Skull ? 17269 // Create Resonating Skull
: 17270; // Create Bone Dust : 17270; // Create Bone Dust
m_caster->CastSpell(m_caster, spell_id, true, nullptr); m_caster->CastSpell(m_caster, spell_id, true, NULL);
return; return;
} }
case 17770: // Wolfshead Helm Energy case 17770: // Wolfshead Helm Energy
{ {
m_caster->CastSpell(m_caster, 29940, true, nullptr); m_caster->CastSpell(m_caster, 29940, true, NULL);
return; return;
} }
case 17950: // Shadow Portal case 17950: // Shadow Portal
@ -1122,7 +1122,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
case 20577: // Cannibalize case 20577: // Cannibalize
{ {
if (unitTarget) if (unitTarget)
m_caster->CastSpell(m_caster, 20578, false, nullptr); m_caster->CastSpell(m_caster, 20578, false, NULL);
return; return;
} }
@ -1332,7 +1332,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
? 29277 // Summon Purified Helboar Meat ? 29277 // Summon Purified Helboar Meat
: 29278; // Summon Toxic Helboar Meat : 29278; // Summon Toxic Helboar Meat
m_caster->CastSpell(m_caster, spell_id, true, nullptr); m_caster->CastSpell(m_caster, spell_id, true, NULL);
return; return;
} }
case 29858: // Soulshatter case 29858: // Soulshatter
@ -1347,7 +1347,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
if (!unitTarget) if (!unitTarget)
return; return;
unitTarget->CastSpell(unitTarget, 29952, true, nullptr, nullptr, m_caster->GetObjectGuid()); unitTarget->CastSpell(unitTarget, 29952, true, NULL, NULL, m_caster->GetObjectGuid());
return; return;
} }
case 29979: // Massive Magnetic Pull case 29979: // Massive Magnetic Pull
@ -1440,7 +1440,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
case 5: spell_id = 33064; break; // Mr. Pinchy's Gift case 5: spell_id = 33064; break; // Mr. Pinchy's Gift
} }
m_caster->CastSpell(m_caster, spell_id, true, nullptr); m_caster->CastSpell(m_caster, spell_id, true, NULL);
return; return;
} }
case 34803: // Summon Reinforcements case 34803: // Summon Reinforcements
@ -1493,7 +1493,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
return; return;
int32 basepoints0 = 100; int32 basepoints0 = 100;
m_caster->CastCustomSpell(unitTarget, 37675, &basepoints0, nullptr, nullptr, true); m_caster->CastCustomSpell(unitTarget, 37675, &basepoints0, NULL, NULL, true);
return; return;
} }
case 39189: // Sha'tari Torch case 39189: // Sha'tari Torch
@ -1516,7 +1516,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
if (!unitTarget) if (!unitTarget)
return; return;
unitTarget->CastSpell(unitTarget, 41466, true, nullptr, nullptr, m_caster->GetObjectGuid()); unitTarget->CastSpell(unitTarget, 41466, true, NULL, NULL, m_caster->GetObjectGuid());
return; return;
} }
case 40802: // Mingo's Fortune Generator (Mingo's Fortune Giblets) case 40802: // Mingo's Fortune Generator (Mingo's Fortune Giblets)
@ -1622,7 +1622,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
unitTarget->CastSpell(m_caster, 42486, true); unitTarget->CastSpell(m_caster, 42486, true);
// There is no known spell to kill the target // There is no known spell to kill the target
m_caster->DealDamage(unitTarget, unitTarget->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false); m_caster->DealDamage(unitTarget, unitTarget->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
return; return;
} }
case 42489: // Cast Ooze Zap When Energized case 42489: // Cast Ooze Zap When Energized
@ -1719,7 +1719,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
if (!unitTarget) if (!unitTarget)
return; return;
unitTarget->CastSpell(unitTarget, 42493, true, nullptr, nullptr, m_caster->GetObjectGuid()); unitTarget->CastSpell(unitTarget, 42493, true, NULL, NULL, m_caster->GetObjectGuid());
return; return;
} }
case 43209: // Place Ram Meat case 43209: // Place Ram Meat
@ -1772,7 +1772,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
if (m_caster->GetTypeId() != TYPEID_PLAYER) if (m_caster->GetTypeId() != TYPEID_PLAYER)
return; return;
((Player*)m_caster)->CastSpell(unitTarget, 43753, true, m_CastItem, nullptr, m_originalCasterGUID, m_spellInfo); ((Player*)m_caster)->CastSpell(unitTarget, 43753, true, m_CastItem, NULL, m_originalCasterGUID, m_spellInfo);
return; return;
} }
case 43882: // Scourging Crystal Controller Dummy case 43882: // Scourging Crystal Controller Dummy
@ -1802,8 +1802,8 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
return; return;
// Cast the spectral realm effect spell, visual spell and spectral blast rift summoning // Cast the spectral realm effect spell, visual spell and spectral blast rift summoning
unitTarget->CastSpell(unitTarget, 44866, true, nullptr, nullptr, m_caster->GetObjectGuid()); unitTarget->CastSpell(unitTarget, 44866, true, NULL, NULL, m_caster->GetObjectGuid());
unitTarget->CastSpell(unitTarget, 46648, true, nullptr, nullptr, m_caster->GetObjectGuid()); unitTarget->CastSpell(unitTarget, 46648, true, NULL, NULL, m_caster->GetObjectGuid());
unitTarget->CastSpell(unitTarget, 44811, true); unitTarget->CastSpell(unitTarget, 44811, true);
return; return;
} }
@ -1817,7 +1817,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
creatureTarget->ForcedDespawn(); creatureTarget->ForcedDespawn();
// cast spell Raptor Capture Credit // cast spell Raptor Capture Credit
m_caster->CastSpell(m_caster, 42337, true, nullptr); m_caster->CastSpell(m_caster, 42337, true, NULL);
return; return;
} }
case 44997: // Converting Sentry case 44997: // Converting Sentry
@ -1866,7 +1866,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
// look for gameobject within max spell range of unitTarget, and respawn if found // look for gameobject within max spell range of unitTarget, and respawn if found
// big fire // big fire
GameObject* pGo = nullptr; GameObject* pGo = NULL;
float fMaxDist = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex)); float fMaxDist = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex));
@ -2015,7 +2015,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
((Player*)m_caster)->KilledMonsterCredit(unitTarget->GetEntry(), unitTarget->GetObjectGuid()); ((Player*)m_caster)->KilledMonsterCredit(unitTarget->GetEntry(), unitTarget->GetObjectGuid());
// look for gameobject within max spell range of unitTarget, and respawn if found // look for gameobject within max spell range of unitTarget, and respawn if found
GameObject* pGo = nullptr; GameObject* pGo = NULL;
float fMaxDist = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex)); float fMaxDist = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex));
@ -2129,7 +2129,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
// The additional castspell arguments are needed here to remove reagents for triggered spells // The additional castspell arguments are needed here to remove reagents for triggered spells
if (spellId) if (spellId)
m_caster->CastSpell(m_caster, spellId, true, m_CastItem, nullptr, m_caster->GetObjectGuid(), m_spellInfo); m_caster->CastSpell(m_caster, spellId, true, m_CastItem, NULL, m_caster->GetObjectGuid(), m_spellInfo);
return; return;
} }
@ -2216,7 +2216,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
// Need internal way to track if credit has been given for this object. // Need internal way to track if credit has been given for this object.
// Iron Dwarf Snapshot Credit // Iron Dwarf Snapshot Credit
m_caster->CastSpell(m_caster, 48047, true, m_CastItem, nullptr, unitTarget->GetObjectGuid()); m_caster->CastSpell(m_caster, 48047, true, m_CastItem, NULL, unitTarget->GetObjectGuid());
return; return;
} }
case 48790: // Neltharion's Flame case 48790: // Neltharion's Flame
@ -2436,7 +2436,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
if (BattleGround* bg = ((Player*)m_caster)->GetBattleGround()) if (BattleGround* bg = ((Player*)m_caster)->GetBattleGround())
bg->EventPlayerDroppedFlag((Player*)m_caster); bg->EventPlayerDroppedFlag((Player*)m_caster);
m_caster->CastSpell(m_caster, 30452, true, nullptr); m_caster->CastSpell(m_caster, 30452, true, NULL);
return; return;
} }
case 51840: // Despawn Fruit Tosser case 51840: // Despawn Fruit Tosser
@ -2481,7 +2481,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
// Expecting pTargetDummy to be summoned by AI at death of target creatures. // Expecting pTargetDummy to be summoned by AI at death of target creatures.
Creature* pTargetDummy = nullptr; Creature* pTargetDummy = NULL;
float fRange = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex)); float fRange = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex));
MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*m_caster, 28523, true, false, fRange * 2); MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*m_caster, 28523, true, false, fRange * 2);
@ -2552,7 +2552,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
uint32 reqAuraID = m_spellInfo->CalculateSimpleValue(EFFECT_INDEX_1); uint32 reqAuraID = m_spellInfo->CalculateSimpleValue(EFFECT_INDEX_1);
if (m_caster->HasAura(reqAuraID, EFFECT_INDEX_0)) if (m_caster->HasAura(reqAuraID, EFFECT_INDEX_0))
m_caster->CastSpell(m_caster, spellID, true, nullptr); m_caster->CastSpell(m_caster, spellID, true, NULL);
return; return;
} }
case EFFECT_INDEX_1: // additional data for dummy[0] case EFFECT_INDEX_1: // additional data for dummy[0]
@ -2596,7 +2596,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
if (!unitTarget) if (!unitTarget)
return; return;
m_caster->CastCustomSpell(unitTarget, 52752, &damage, nullptr, nullptr, true); m_caster->CastCustomSpell(unitTarget, 52752, &damage, NULL, NULL, true);
return; return;
} }
case 52845: // Brewfest Mount Transformation (Faction Swap) case 52845: // Brewfest Mount Transformation (Faction Swap)
@ -2748,8 +2748,8 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
if (!unitTarget) if (!unitTarget)
return; return;
unitTarget->CastSpell(unitTarget, 56431, true, nullptr, nullptr, m_caster->GetObjectGuid()); unitTarget->CastSpell(unitTarget, 56431, true, NULL, NULL, m_caster->GetObjectGuid());
unitTarget->CastSpell(unitTarget, 56432, true, nullptr, nullptr, m_caster->GetObjectGuid()); unitTarget->CastSpell(unitTarget, 56432, true, NULL, NULL, m_caster->GetObjectGuid());
return; return;
} }
case 57578: // Lava Strike case 57578: // Lava Strike
@ -2793,7 +2793,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
case 3: spell_id = 59843; break; case 3: spell_id = 59843; break;
} }
m_caster->CastSpell(m_caster, spell_id, true, nullptr); m_caster->CastSpell(m_caster, spell_id, true, NULL);
return; return;
} }
case 60932: // Disengage (one from creature versions) case 60932: // Disengage (one from creature versions)
@ -2801,7 +2801,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
if (!unitTarget) if (!unitTarget)
return; return;
m_caster->CastSpell(unitTarget, 60934, true, nullptr); m_caster->CastSpell(unitTarget, 60934, true, NULL);
return; return;
} }
case 62105: // To'kini's Blowgun case 62105: // To'kini's Blowgun
@ -2904,7 +2904,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
return; return;
// There is no known spell to kill the target // There is no known spell to kill the target
m_caster->DealDamage(unitTarget, unitTarget->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false); m_caster->DealDamage(unitTarget, unitTarget->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
return; return;
} }
case 64385: // Spinning (from Unusual Compass) case 64385: // Spinning (from Unusual Compass)
@ -3170,7 +3170,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
return; return;
m_caster->CastSpell(unitTarget, 74453, true); m_caster->CastSpell(unitTarget, 74453, true);
m_caster->CastSpell(unitTarget, 74454, true, nullptr, nullptr, m_caster->GetObjectGuid(), m_spellInfo); m_caster->CastSpell(unitTarget, 74454, true, NULL, NULL, m_caster->GetObjectGuid(), m_spellInfo);
return; return;
} }
} }
@ -3262,7 +3262,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
if (warClassOptions && (warClassOptions->SpellFamilyFlags & UI64LIT(0x1)) && m_spellInfo->SpellVisual[0] == 867) if (warClassOptions && (warClassOptions->SpellFamilyFlags & UI64LIT(0x1)) && m_spellInfo->SpellVisual[0] == 867)
{ {
int32 chargeBasePoints0 = damage; int32 chargeBasePoints0 = damage;
m_caster->CastCustomSpell(m_caster, 34846, &chargeBasePoints0, nullptr, nullptr, true); m_caster->CastCustomSpell(m_caster, 34846, &chargeBasePoints0, NULL, NULL, true);
return; return;
} }
// Execute // Execute
@ -3286,7 +3286,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
int32 basePoints0 = damage+int32(rage_modified * effect->EffectDamageMultiplier + int32 basePoints0 = damage+int32(rage_modified * effect->EffectDamageMultiplier +
m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.2f); m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.2f);
m_caster->CastCustomSpell(unitTarget, 20647, &basePoints0, nullptr, nullptr, true, 0); m_caster->CastCustomSpell(unitTarget, 20647, &basePoints0, NULL, NULL, true, 0);
// Sudden Death // Sudden Death
if (m_caster->HasAura(52437)) if (m_caster->HasAura(52437))
@ -3316,7 +3316,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
return; return;
// dummy cast itself ignored by client in logs // dummy cast itself ignored by client in logs
m_caster->CastCustomSpell(unitTarget, 50782, &damage, nullptr, nullptr, true); m_caster->CastCustomSpell(unitTarget, 50782, &damage, NULL, NULL, true);
return; return;
} }
// Concussion Blow // Concussion Blow
@ -3340,13 +3340,13 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
case 12975: case 12975:
{ {
int32 healthModSpellBasePoints0 = int32(m_caster->GetMaxHealth() * 0.3); int32 healthModSpellBasePoints0 = int32(m_caster->GetMaxHealth() * 0.3);
m_caster->CastCustomSpell(m_caster, 12976, &healthModSpellBasePoints0, nullptr, nullptr, true, nullptr); m_caster->CastCustomSpell(m_caster, 12976, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
return; return;
} }
// Bloodthirst // Bloodthirst
case 23881: case 23881:
{ {
m_caster->CastCustomSpell(unitTarget, 23885, &damage, nullptr, nullptr, true, nullptr); m_caster->CastCustomSpell(unitTarget, 23885, &damage, NULL, NULL, true, NULL);
return; return;
} }
case 30012: // Move case 30012: // Move
@ -3401,7 +3401,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
if((*itr)->GetSpellProto()->GetSpellFamilyName()==SPELLFAMILY_WARLOCK && (*itr)->GetSpellProto()->SpellIconID == 208) if((*itr)->GetSpellProto()->GetSpellFamilyName()==SPELLFAMILY_WARLOCK && (*itr)->GetSpellProto()->SpellIconID == 208)
mana = ((*itr)->GetModifier()->m_amount + 100)* mana / 100; mana = ((*itr)->GetModifier()->m_amount + 100)* mana / 100;
m_caster->CastCustomSpell(unitTarget, 31818, &mana, nullptr, nullptr, true); m_caster->CastCustomSpell(unitTarget, 31818, &mana, NULL, NULL, true);
// Mana Feed // Mana Feed
int32 manaFeedVal = 0; int32 manaFeedVal = 0;
@ -3414,7 +3414,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
if (manaFeedVal > 0) if (manaFeedVal > 0)
{ {
manaFeedVal = manaFeedVal * mana / 100; manaFeedVal = manaFeedVal * mana / 100;
m_caster->CastCustomSpell(m_caster, 32553, &manaFeedVal, nullptr, nullptr, true, nullptr); m_caster->CastCustomSpell(m_caster, 32553, &manaFeedVal, NULL, NULL, true, NULL);
} }
} }
else else
@ -3602,7 +3602,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
} }
if (!target || !target->IsAlive()) if (!target || !target->IsAlive())
return; return;
m_caster->CastSpell(target, spellid, true, nullptr); m_caster->CastSpell(target, spellid, true, NULL);
} }
switch (m_spellInfo->Id) switch (m_spellInfo->Id)
@ -3642,7 +3642,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
if (!unitTarget) if (!unitTarget)
return; return;
int32 healthModSpellBasePoints0 = int32(unitTarget->GetMaxHealth() * 0.3); int32 healthModSpellBasePoints0 = int32(unitTarget->GetMaxHealth() * 0.3);
unitTarget->CastCustomSpell(unitTarget, 53479, &healthModSpellBasePoints0, nullptr, nullptr, true, nullptr); unitTarget->CastCustomSpell(unitTarget, 53479, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
return; return;
} }
// Master's Call // Master's Call
@ -3701,7 +3701,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
if (!spell_proto) if (!spell_proto)
return; return;
m_caster->CastSpell(unitTarget, spell_proto, true, nullptr); m_caster->CastSpell(unitTarget, spell_proto, true, NULL);
return; return;
} }
} }
@ -3722,7 +3722,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
{ {
Player* player = friendTarget->GetCharmerOrOwnerPlayerOrPlayerItself(); Player* player = friendTarget->GetCharmerOrOwnerPlayerOrPlayerItself();
if (!player || !player->IsInSameRaidWith((Player*)m_caster)) if (!player || !player->IsInSameRaidWith((Player*)m_caster))
friendTarget = nullptr; friendTarget = NULL;
} }
// non-standard cast requirement check // non-standard cast requirement check
@ -3809,7 +3809,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
if (Aura* dummy = owner->GetDummyAura(55456)) if (Aura* dummy = owner->GetDummyAura(55456))
damage += dummy->GetModifier()->m_amount * damage / 100; damage += dummy->GetModifier()->m_amount * damage / 100;
} }
m_caster->CastCustomSpell(unitTarget, 52042, &damage, nullptr, nullptr, true, 0, 0, m_originalCasterGUID); m_caster->CastCustomSpell(unitTarget, 52042, &damage, NULL, NULL, true, 0, 0, m_originalCasterGUID);
} }
return; return;
} }
@ -3835,7 +3835,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
float weaponSpeed = (1.0f / IN_MILLISECONDS) * m_CastItem->GetProto()->Delay; float weaponSpeed = (1.0f / IN_MILLISECONDS) * m_CastItem->GetProto()->Delay;
int32 totalDamage = int32((damage + 3.85f * spellDamage) * 0.01 * weaponSpeed); int32 totalDamage = int32((damage + 3.85f * spellDamage) * 0.01 * weaponSpeed);
m_caster->CastCustomSpell(unitTarget, 10444, &totalDamage, nullptr, nullptr, true, m_CastItem); m_caster->CastCustomSpell(unitTarget, 10444, &totalDamage, NULL, NULL, true, m_CastItem);
return; return;
} }
if (m_spellInfo->Id == 39610) // Mana Tide Totem effect if (m_spellInfo->Id == 39610) // Mana Tide Totem effect
@ -3849,7 +3849,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
damage += dummy->GetModifier()->m_amount; damage += dummy->GetModifier()->m_amount;
// Regenerate 6% of Total Mana Every 3 secs // Regenerate 6% of Total Mana Every 3 secs
int32 EffectBasePoints0 = unitTarget->GetMaxPower(POWER_MANA) * damage / 100; int32 EffectBasePoints0 = unitTarget->GetMaxPower(POWER_MANA) * damage / 100;
m_caster->CastCustomSpell(unitTarget, 39609, &EffectBasePoints0, nullptr, nullptr, true, nullptr, nullptr, m_originalCasterGUID); m_caster->CastCustomSpell(unitTarget, 39609, &EffectBasePoints0, NULL, NULL, true, NULL, NULL, m_originalCasterGUID);
return; return;
} }
// Lava Lash // Lava Lash
@ -3897,10 +3897,10 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
default: return; default: return;
} }
totem->CastSpell(totem, triggered_spell_id, true, nullptr, nullptr, m_caster->GetObjectGuid()); totem->CastSpell(totem, triggered_spell_id, true, NULL, NULL, m_caster->GetObjectGuid());
// Fire Nova Visual // Fire Nova Visual
totem->CastSpell(totem, 19823, true, nullptr, nullptr, m_caster->GetObjectGuid()); totem->CastSpell(totem, 19823, true, NULL, NULL, m_caster->GetObjectGuid());
return; return;
} }
break; break;
@ -3917,12 +3917,12 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
return; return;
int32 bp = int32(damage * 1.5f); int32 bp = int32(damage * 1.5f);
m_caster->CastCustomSpell(unitTarget, 47633, &bp, nullptr, nullptr, true); m_caster->CastCustomSpell(unitTarget, 47633, &bp, NULL, NULL, true);
} }
else else
{ {
int32 bp = damage; int32 bp = damage;
m_caster->CastCustomSpell(unitTarget, 47632, &bp, nullptr, nullptr, true); m_caster->CastCustomSpell(unitTarget, 47632, &bp, NULL, NULL, true);
} }
return; return;
} }
@ -3964,7 +3964,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
} }
} }
m_caster->CastCustomSpell(m_caster, 45470, &bp, nullptr, nullptr, true); m_caster->CastCustomSpell(m_caster, 45470, &bp, NULL, NULL, true);
return; return;
} }
// Death Grip // Death Grip
@ -3985,7 +3985,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
uint32 spellId = m_spellInfo->CalculateSimpleValue(EFFECT_INDEX_0); uint32 spellId = m_spellInfo->CalculateSimpleValue(EFFECT_INDEX_0);
float dest_x, dest_y; float dest_x, dest_y;
m_caster->GetNearPoint2D(dest_x, dest_y, m_caster->GetObjectBoundingRadius() + unitTarget->GetObjectBoundingRadius(), m_caster->GetOrientation()); m_caster->GetNearPoint2D(dest_x, dest_y, m_caster->GetObjectBoundingRadius() + unitTarget->GetObjectBoundingRadius(), m_caster->GetOrientation());
unitTarget->CastSpell(dest_x, dest_y, m_caster->GetPositionZ() + 0.5f, spellId, true, nullptr, nullptr, m_caster->GetObjectGuid(), m_spellInfo); unitTarget->CastSpell(dest_x, dest_y, m_caster->GetPositionZ() + 0.5f, spellId, true, NULL, NULL, m_caster->GetObjectGuid(), m_spellInfo);
return; return;
} }
// Obliterate // Obliterate
@ -4053,7 +4053,7 @@ void Spell::EffectTriggerSpellWithValue(SpellEffectEntry const* effect)
} }
int32 bp = damage; int32 bp = damage;
m_caster->CastCustomSpell(unitTarget, triggered_spell_id, &bp, &bp, &bp, true, m_CastItem , nullptr, m_originalCasterGUID, m_spellInfo); m_caster->CastCustomSpell(unitTarget, triggered_spell_id, &bp, &bp, &bp, true, m_CastItem , NULL, m_originalCasterGUID, m_spellInfo);
} }
void Spell::EffectTriggerRitualOfSummoning(SpellEffectEntry const* effect) void Spell::EffectTriggerRitualOfSummoning(SpellEffectEntry const* effect)
@ -4132,9 +4132,9 @@ void Spell::EffectForceCast(SpellEffectEntry const* effect)
// spell effect 141 needs to be cast as custom with basePoints // spell effect 141 needs to be cast as custom with basePoints
if (effect->Effect == SPELL_EFFECT_FORCE_CAST_WITH_VALUE) if (effect->Effect == SPELL_EFFECT_FORCE_CAST_WITH_VALUE)
unitTarget->CastCustomSpell(unitTarget, spellInfo, &basePoints, &basePoints, &basePoints, true, nullptr , nullptr, m_originalCasterGUID, m_spellInfo); unitTarget->CastCustomSpell(unitTarget, spellInfo, &basePoints, &basePoints, &basePoints, true, NULL , NULL, m_originalCasterGUID, m_spellInfo);
else else
unitTarget->CastSpell(unitTarget, spellInfo, true, nullptr, nullptr, m_originalCasterGUID, m_spellInfo); unitTarget->CastSpell(unitTarget, spellInfo, true, NULL, NULL, m_originalCasterGUID, m_spellInfo);
} }
void Spell::EffectTriggerSpell(SpellEffectEntry const* effect) void Spell::EffectTriggerSpell(SpellEffectEntry const* effect)
@ -4208,7 +4208,7 @@ void Spell::EffectTriggerSpell(SpellEffectEntry const* effect)
{ {
// Glyph of Mirror Image // Glyph of Mirror Image
if (m_caster->HasAura(63093)) if (m_caster->HasAura(63093))
m_caster->CastSpell(m_caster, 65047, true, m_CastItem, nullptr, m_originalCasterGUID); m_caster->CastSpell(m_caster, 65047, true, m_CastItem, NULL, m_originalCasterGUID);
break; break;
} }
} }
@ -4298,9 +4298,9 @@ void Spell::EffectTriggerMissileSpell(SpellEffectEntry const* effect)
DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "WORLD: cast Item spellId - %i", spellInfo->Id); DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "WORLD: cast Item spellId - %i", spellInfo->Id);
if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION) if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)
m_caster->CastSpell(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, spellInfo, true, m_CastItem, nullptr, m_originalCasterGUID, m_spellInfo); m_caster->CastSpell(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, spellInfo, true, m_CastItem, NULL, m_originalCasterGUID, m_spellInfo);
else if (unitTarget) else if (unitTarget)
m_caster->CastSpell(unitTarget, spellInfo, true, m_CastItem, nullptr, m_originalCasterGUID, m_spellInfo); m_caster->CastSpell(unitTarget, spellInfo, true, m_CastItem, NULL, m_originalCasterGUID, m_spellInfo);
} }
void Spell::EffectJump(SpellEffectEntry const* effect) void Spell::EffectJump(SpellEffectEntry const* effect)
@ -6668,7 +6668,7 @@ void Spell::EffectSummonPet(SpellEffectEntry const* effect)
else else
NewSummon->setPetType(GUARDIAN_PET); NewSummon->setPetType(GUARDIAN_PET);
CreatureInfo const* cInfo = petentry ? ObjectMgr::GetCreatureTemplate(petentry) : nullptr; CreatureInfo const* cInfo = petentry ? ObjectMgr::GetCreatureTemplate(petentry) : NULL;
if (!cInfo) if (!cInfo)
{ {
sLog.outErrorDb("EffectSummonPet: creature entry %u not found for spell %u.", petentry, m_spellInfo->Id); sLog.outErrorDb("EffectSummonPet: creature entry %u not found for spell %u.", petentry, m_spellInfo->Id);
@ -7238,7 +7238,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
default: spell_id = 8855; break; default: spell_id = 8855; break;
} }
m_caster->CastSpell(m_caster, spell_id, true, nullptr); m_caster->CastSpell(m_caster, spell_id, true, NULL);
return; return;
} }
case 17512: // Piccolo of the Flaming Fire case 17512: // Piccolo of the Flaming Fire
@ -7323,7 +7323,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
} }
case 24320: // Poisonous Blood case 24320: // Poisonous Blood
{ {
unitTarget->CastSpell(unitTarget, 24321, true, nullptr, nullptr, m_caster->GetObjectGuid()); unitTarget->CastSpell(unitTarget, 24321, true, NULL, NULL, m_caster->GetObjectGuid());
return; return;
} }
case 24324: // Blood Siphon case 24324: // Blood Siphon
@ -7566,7 +7566,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
int32 damage = unitTarget->GetHealth() - unitTarget->GetMaxHealth() * downToHealthPercent; int32 damage = unitTarget->GetHealth() - unitTarget->GetMaxHealth() * downToHealthPercent;
if (damage > 0) if (damage > 0)
m_caster->CastCustomSpell(unitTarget, 28375, &damage, nullptr, nullptr, true); m_caster->CastCustomSpell(unitTarget, 28375, &damage, NULL, NULL, true);
return; return;
} }
case 28560: // Summon Blizzard case 28560: // Summon Blizzard
@ -7711,7 +7711,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
if (!unitTarget) if (!unitTarget)
return; return;
unitTarget->CastSpell(unitTarget, 30836, true, nullptr, nullptr, m_caster->GetObjectGuid()); unitTarget->CastSpell(unitTarget, 30836, true, NULL, NULL, m_caster->GetObjectGuid());
break; break;
} }
case 30918: // Improved Sprint case 30918: // Improved Sprint
@ -7765,7 +7765,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
if (!unitTarget) if (!unitTarget)
return; return;
unitTarget->CastSpell(unitTarget, unitTarget->GetMap()->IsRegularDifficulty() ? 23971 : 30928, true, nullptr, nullptr, m_caster->GetObjectGuid()); unitTarget->CastSpell(unitTarget, unitTarget->GetMap()->IsRegularDifficulty() ? 23971 : 30928, true, NULL, NULL, m_caster->GetObjectGuid());
return; return;
} }
case 35865: // Summon Nether Vapor case 35865: // Summon Nether Vapor
@ -7810,7 +7810,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
if (!unitTarget) if (!unitTarget)
return; return;
unitTarget->CastSpell(unitTarget, 38353, true, nullptr, nullptr, m_caster->GetObjectGuid()); unitTarget->CastSpell(unitTarget, 38353, true, NULL, NULL, m_caster->GetObjectGuid());
return; return;
} }
case 39338: // Karazhan - Chess, Medivh CHEAT: Hand of Medivh, Target Horde case 39338: // Karazhan - Chess, Medivh CHEAT: Hand of Medivh, Target Horde
@ -7904,7 +7904,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
return; return;
int32 basePoints = effect->CalculateSimpleValue(); int32 basePoints = effect->CalculateSimpleValue();
unitTarget->CastCustomSpell(unitTarget, 42576, &basePoints, nullptr, nullptr, true); unitTarget->CastCustomSpell(unitTarget, 42576, &basePoints, NULL, NULL, true);
return; return;
} }
case 43365: // The Cleansing: Shrine Cast case 43365: // The Cleansing: Shrine Cast
@ -7950,7 +7950,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
// Are there anything special with this, a random chance or condition? // Are there anything special with this, a random chance or condition?
// Feeding Rock Falcon // Feeding Rock Falcon
unitTarget->CastSpell(unitTarget, effect->CalculateSimpleValue(), true, nullptr, nullptr, unitTarget->GetObjectGuid(), m_spellInfo); unitTarget->CastSpell(unitTarget, effect->CalculateSimpleValue(), true, NULL, NULL, unitTarget->GetObjectGuid(), m_spellInfo);
return; return;
} }
case 44455: // Character Script Effect Reverse Cast case 44455: // Character Script Effect Reverse Cast
@ -7997,7 +7997,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
if (m_caster->GetTypeId() != TYPEID_UNIT) if (m_caster->GetTypeId() != TYPEID_UNIT)
return; return;
Creature* pQuestCow = nullptr; Creature* pQuestCow = NULL;
float range = 20.0f; float range = 20.0f;
@ -8057,7 +8057,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
if (!unitTarget) if (!unitTarget)
return; return;
unitTarget->CastSpell(unitTarget, 46394, true, nullptr, nullptr, m_caster->GetObjectGuid()); unitTarget->CastSpell(unitTarget, 46394, true, NULL, NULL, m_caster->GetObjectGuid());
return; return;
} }
case 45151: // Burn case 45151: // Burn
@ -8107,7 +8107,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
if (!unitTarget) if (!unitTarget)
return; return;
unitTarget->CastSpell(unitTarget, 45236, true, nullptr, nullptr, m_caster->GetObjectGuid()); unitTarget->CastSpell(unitTarget, 45236, true, NULL, NULL, m_caster->GetObjectGuid());
return; return;
} }
case 45260: // Karazhan - Chess - Force Player to Kill Bunny case 45260: // Karazhan - Chess - Force Player to Kill Bunny
@ -8188,7 +8188,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
if (m_caster->GetTypeId() != TYPEID_UNIT) if (m_caster->GetTypeId() != TYPEID_UNIT)
return; return;
const CreatureInfo* cTemplate = nullptr; const CreatureInfo* cTemplate = NULL;
switch (m_caster->GetEntry()) switch (m_caster->GetEntry())
{ {
@ -8277,7 +8277,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
// Summon 4 clones of the same player // Summon 4 clones of the same player
for (uint8 i = 0; i < 4; ++i) for (uint8 i = 0; i < 4; ++i)
unitTarget->CastSpell(unitTarget, 45891, true, nullptr, nullptr, m_caster->GetObjectGuid()); unitTarget->CastSpell(unitTarget, 45891, true, NULL, NULL, m_caster->GetObjectGuid());
return; return;
} }
case 45918: // Soul Sever case 45918: // Soul Sever
@ -8531,7 +8531,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
return; return;
// Each target hit buffs the caster // Each target hit buffs the caster
unitTarget->CastSpell(m_caster, m_spellInfo->Id == 49380 ? 49381 : 59805, true, nullptr, nullptr, m_caster->GetObjectGuid()); unitTarget->CastSpell(m_caster, m_spellInfo->Id == 49380 ? 49381 : 59805, true, NULL, NULL, m_caster->GetObjectGuid());
return; return;
} }
case 49405: // Invader Taunt Trigger case 49405: // Invader Taunt Trigger
@ -8607,7 +8607,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
if (!unitTarget) if (!unitTarget)
return; return;
unitTarget->CastSpell(unitTarget, effect->CalculateSimpleValue(), true, nullptr, nullptr, m_originalCasterGUID); unitTarget->CastSpell(unitTarget, effect->CalculateSimpleValue(), true, NULL, NULL, m_originalCasterGUID);
return; return;
} }
case 50439: // Script Cast Summon Image of Drakuru 05 case 50439: // Script Cast Summon Image of Drakuru 05
@ -8651,7 +8651,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
return; return;
unitTarget->RemoveAurasDueToSpell(50812); unitTarget->RemoveAurasDueToSpell(50812);
unitTarget->CastSpell(unitTarget, m_spellInfo->Id == 50810 ? 50811 : 61547 , true, nullptr, nullptr, m_caster->GetObjectGuid()); unitTarget->CastSpell(unitTarget, m_spellInfo->Id == 50810 ? 50811 : 61547 , true, NULL, NULL, m_caster->GetObjectGuid());
return; return;
} }
case 50894: // Zul'Drak Rat case 50894: // Zul'Drak Rat
@ -8744,7 +8744,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
// cast Summon Ghouls On Scarlet Crusade // cast Summon Ghouls On Scarlet Crusade
float x, y, z; float x, y, z;
m_targets.getDestination(x, y, z); m_targets.getDestination(x, y, z);
unitTarget->CastSpell(x, y, z, 54522, true, nullptr, nullptr, m_originalCasterGUID); unitTarget->CastSpell(x, y, z, 54522, true, NULL, NULL, m_originalCasterGUID);
return; return;
} }
case 51910: // Kickin' Nass: Quest Completion case 51910: // Kickin' Nass: Quest Completion
@ -8967,7 +8967,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
case POWER_MANA: case POWER_MANA:
{ {
int32 manapool = unitTarget->GetMaxPower(POWER_MANA) * 0.05; int32 manapool = unitTarget->GetMaxPower(POWER_MANA) * 0.05;
unitTarget->CastCustomSpell(unitTarget, 59813, &manapool, nullptr, nullptr, true); unitTarget->CastCustomSpell(unitTarget, 59813, &manapool, NULL, NULL, true);
break; break;
} }
case POWER_RAGE: case POWER_RAGE:
@ -9614,7 +9614,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
if (missingStacks <= 0) if (missingStacks <= 0)
return; return;
unitTarget->CastCustomSpell(unitTarget, 72371, &missingStacks, &missingStacks, nullptr, true); unitTarget->CastCustomSpell(unitTarget, 72371, &missingStacks, &missingStacks, NULL, true);
return; return;
} }
case 72219: // Gastric Bloat case 72219: // Gastric Bloat
@ -9931,7 +9931,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
{ {
if (roll_chance_i((*i)->GetModifier()->m_amount)) if (roll_chance_i((*i)->GetModifier()->m_amount))
{ {
unitTarget->CastSpell(unitTarget, 53398, true, nullptr, (*i), m_caster->GetObjectGuid()); unitTarget->CastSpell(unitTarget, 53398, true, NULL, (*i), m_caster->GetObjectGuid());
break; break;
} }
} }

View file

@ -312,8 +312,8 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& recvPacket)
if (!his_trade) if (!his_trade)
return; return;
Item* myItems[TRADE_SLOT_TRADED_COUNT] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }; Item* myItems[TRADE_SLOT_TRADED_COUNT] = { NULL, NULL, NULL, NULL, NULL, NULL };
Item* hisItems[TRADE_SLOT_TRADED_COUNT] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }; Item* hisItems[TRADE_SLOT_TRADED_COUNT] = { NULL, NULL, NULL, NULL, NULL, NULL };
// set before checks to properly undo at problems (it already set in to client) // set before checks to properly undo at problems (it already set in to client)
my_trade->SetAccepted(true); my_trade->SetAccepted(true);
@ -367,10 +367,10 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& recvPacket)
{ {
setAcceptTradeMode(my_trade, his_trade, myItems, hisItems); setAcceptTradeMode(my_trade, his_trade, myItems, hisItems);
Spell* my_spell = nullptr; Spell* my_spell = NULL;
SpellCastTargets my_targets; SpellCastTargets my_targets;
Spell* his_spell = nullptr; Spell* his_spell = NULL;
SpellCastTargets his_targets; SpellCastTargets his_targets;
// not accept if spell can't be casted now (cheating) // not accept if spell can't be casted now (cheating)
@ -529,9 +529,9 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& recvPacket)
// cleanup // cleanup
clearAcceptTradeMode(my_trade, his_trade); clearAcceptTradeMode(my_trade, his_trade);
delete _player->m_trade; delete _player->m_trade;
_player->m_trade = nullptr; _player->m_trade = NULL;
delete trader->m_trade; delete trader->m_trade;
trader->m_trade = nullptr; trader->m_trade = NULL;
// desynchronized with the other saves here (SaveInventoryAndGoldToDB() not have own transaction guards) // desynchronized with the other saves here (SaveInventoryAndGoldToDB() not have own transaction guards)
CharacterDatabase.BeginTransaction(); CharacterDatabase.BeginTransaction();

View file

@ -632,7 +632,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
int32 triggerAmount = triggeredByAura->GetModifier()->m_amount; int32 triggerAmount = triggeredByAura->GetModifier()->m_amount;
Item* castItem = triggeredByAura->GetCastItemGuid() && GetTypeId() == TYPEID_PLAYER Item* castItem = triggeredByAura->GetCastItemGuid() && GetTypeId() == TYPEID_PLAYER
? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGuid()) : nullptr; ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGuid()) : NULL;
// some dummy spells have trigger spell in spell data already (from 3.0.3) // some dummy spells have trigger spell in spell data already (from 3.0.3)
uint32 triggered_spell_id = dummySpellEffect->EffectApplyAuraName == SPELL_AURA_DUMMY ? dummySpellEffect->EffectTriggerSpell : 0; uint32 triggered_spell_id = dummySpellEffect->EffectApplyAuraName == SPELL_AURA_DUMMY ? dummySpellEffect->EffectTriggerSpell : 0;
@ -1321,7 +1321,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
RemoveAurasDueToSpell(triggeredByAura->GetId()); RemoveAurasDueToSpell(triggeredByAura->GetId());
// Cast finish spell (triggeredByAura already not exist!) // Cast finish spell (triggeredByAura already not exist!)
CastSpell(this, 27285, true, castItem, nullptr, casterGuid); CastSpell(this, 27285, true, castItem, NULL, casterGuid);
return SPELL_AURA_PROC_OK; // no hidden cooldown return SPELL_AURA_PROC_OK; // no hidden cooldown
} }
@ -1343,7 +1343,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
RemoveAurasDueToSpell(triggeredByAura->GetId()); RemoveAurasDueToSpell(triggeredByAura->GetId());
// Cast finish spell (triggeredByAura already not exist!) // Cast finish spell (triggeredByAura already not exist!)
CastSpell(this, 32865, true, castItem, nullptr, casterGuid); CastSpell(this, 32865, true, castItem, NULL, casterGuid);
return SPELL_AURA_PROC_OK; // no hidden cooldown return SPELL_AURA_PROC_OK; // no hidden cooldown
} }
// Damage counting // Damage counting
@ -1502,7 +1502,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
// Heal amount - Self/Team // Heal amount - Self/Team
int32 team = triggerAmount * damage / 500; int32 team = triggerAmount * damage / 500;
int32 self = triggerAmount * damage / 100 - team; int32 self = triggerAmount * damage / 100 - team;
CastCustomSpell(this, 15290, &team, &self, nullptr, true, castItem, triggeredByAura); CastCustomSpell(this, 15290, &team, &self, NULL, true, castItem, triggeredByAura);
return SPELL_AURA_PROC_OK; // no hidden cooldown return SPELL_AURA_PROC_OK; // no hidden cooldown
} }
// Priest Tier 6 Trinket (Ashtongue Talisman of Acumen) // Priest Tier 6 Trinket (Ashtongue Talisman of Acumen)
@ -1601,7 +1601,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
if (SpellEntry const* manaCastEntry = sSpellStore.LookupEntry(60889)) if (SpellEntry const* manaCastEntry = sSpellStore.LookupEntry(60889))
{ {
int32 mana_percent = manaCastEntry->CalculateSimpleValue(EFFECT_INDEX_0) * heal_percent; int32 mana_percent = manaCastEntry->CalculateSimpleValue(EFFECT_INDEX_0) * heal_percent;
CastCustomSpell(this, manaCastEntry, &mana_percent, nullptr, nullptr, true, castItem, triggeredByAura); CastCustomSpell(this, manaCastEntry, &mana_percent, NULL, NULL, true, castItem, triggeredByAura);
} }
} }
break; break;
@ -1705,7 +1705,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
if (!second) if (!second)
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
pVictim->CastSpell(second, procSpell, true, nullptr, triggeredByAura, GetObjectGuid()); pVictim->CastSpell(second, procSpell, true, NULL, triggeredByAura, GetObjectGuid());
return SPELL_AURA_PROC_OK; return SPELL_AURA_PROC_OK;
} }
// Item - Druid T10 Balance 4P Bonus // Item - Druid T10 Balance 4P Bonus
@ -1908,7 +1908,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
// Glyph of Mend Pet // Glyph of Mend Pet
if (dummySpell->Id == 57870) if (dummySpell->Id == 57870)
{ {
pVictim->CastSpell(pVictim, 57894, true, nullptr, nullptr, GetObjectGuid()); pVictim->CastSpell(pVictim, 57894, true, NULL, NULL, GetObjectGuid());
return SPELL_AURA_PROC_OK; return SPELL_AURA_PROC_OK;
} }
// Misdirection // Misdirection
@ -1957,7 +1957,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
basepoints[0] = int32(pVictim->GetMaxHealth() * triggeredByAura->GetModifier()->m_amount / 100); basepoints[0] = int32(pVictim->GetMaxHealth() * triggeredByAura->GetModifier()->m_amount / 100);
pVictim->CastCustomSpell(pVictim, 20267, &basepoints[0], nullptr, nullptr, true, nullptr, triggeredByAura); pVictim->CastCustomSpell(pVictim, 20267, &basepoints[0], NULL, NULL, true, NULL, triggeredByAura);
return SPELL_AURA_PROC_OK; return SPELL_AURA_PROC_OK;
} }
// Judgement of Wisdom // Judgement of Wisdom
@ -1971,7 +1971,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
{ {
// 2% of maximum base mana // 2% of maximum base mana
basepoints[0] = int32(pVictim->GetCreateMana() * 2 / 100); basepoints[0] = int32(pVictim->GetCreateMana() * 2 / 100);
pVictim->CastCustomSpell(pVictim, 20268, &basepoints[0], nullptr, nullptr, true, nullptr, triggeredByAura); pVictim->CastCustomSpell(pVictim, 20268, &basepoints[0], NULL, NULL, true, NULL, triggeredByAura);
} }
return SPELL_AURA_PROC_OK; return SPELL_AURA_PROC_OK;
} }
@ -2073,7 +2073,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
} }
} }
if (stacks >= 5) if (stacks >= 5)
CastSpell(target, 42463, true, nullptr, triggeredByAura); CastSpell(target, 42463, true, NULL, triggeredByAura);
break; break;
} }
// Judgements of the Wise // Judgements of the Wise
@ -2088,7 +2088,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
triggered_spell_id = 31930; triggered_spell_id = 31930;
// Replenishment // Replenishment
CastSpell(this, 57669, true, nullptr, triggeredByAura); CastSpell(this, 57669, true, NULL, triggeredByAura);
break; break;
// Paladin Tier 6 Trinket (Ashtongue Talisman of Zeal) // Paladin Tier 6 Trinket (Ashtongue Talisman of Zeal)
case 40470: case 40470:
@ -2131,7 +2131,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
// find caster main aura at beacon // find caster main aura at beacon
Aura* dummy = nullptr; Aura* dummy = NULL;
Unit::AuraList const& baa = beacon->GetAurasByType(SPELL_AURA_PERIODIC_TRIGGER_SPELL); Unit::AuraList const& baa = beacon->GetAurasByType(SPELL_AURA_PERIODIC_TRIGGER_SPELL);
for (Unit::AuraList::const_iterator i = baa.begin(); i != baa.end(); ++i) for (Unit::AuraList::const_iterator i = baa.begin(); i != baa.end(); ++i)
{ {
@ -2150,7 +2150,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
basepoints[0] = triggeredByAura->GetModifier()->m_amount * damage / 100; basepoints[0] = triggeredByAura->GetModifier()->m_amount * damage / 100;
// cast with original caster set but beacon to beacon for apply caster mods and avoid LoS check // cast with original caster set but beacon to beacon for apply caster mods and avoid LoS check
beacon->CastCustomSpell(beacon, triggered_spell_id, &basepoints[0], nullptr, nullptr, true, castItem, triggeredByAura, pVictim->GetObjectGuid()); beacon->CastCustomSpell(beacon, triggered_spell_id, &basepoints[0], NULL, NULL, true, castItem, triggeredByAura, pVictim->GetObjectGuid());
return SPELL_AURA_PROC_OK; return SPELL_AURA_PROC_OK;
} }
// Seal of Corruption (damage calc on apply aura) // Seal of Corruption (damage calc on apply aura)
@ -2175,7 +2175,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
} }
} }
if (stacks >= 5) if (stacks >= 5)
CastSpell(target, 53739, true, nullptr, triggeredByAura); CastSpell(target, 53739, true, NULL, triggeredByAura);
break; break;
} }
// Glyph of Holy Light // Glyph of Holy Light
@ -2386,7 +2386,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
// Attack Twice // Attack Twice
for (uint32 i = 0; i < 2; ++i) for (uint32 i = 0; i < 2; ++i)
CastCustomSpell(pVictim, triggered_spell_id, &basepoints[0], nullptr, nullptr, true, castItem, triggeredByAura); CastCustomSpell(pVictim, triggered_spell_id, &basepoints[0], NULL, NULL, true, castItem, triggeredByAura);
return SPELL_AURA_PROC_OK; return SPELL_AURA_PROC_OK;
} }
@ -2886,9 +2886,9 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
if (basepoints[EFFECT_INDEX_0] || basepoints[EFFECT_INDEX_1] || basepoints[EFFECT_INDEX_2]) if (basepoints[EFFECT_INDEX_0] || basepoints[EFFECT_INDEX_1] || basepoints[EFFECT_INDEX_2])
CastCustomSpell(target, triggered_spell_id, CastCustomSpell(target, triggered_spell_id,
basepoints[EFFECT_INDEX_0] ? &basepoints[EFFECT_INDEX_0] : nullptr, basepoints[EFFECT_INDEX_0] ? &basepoints[EFFECT_INDEX_0] : NULL,
basepoints[EFFECT_INDEX_1] ? &basepoints[EFFECT_INDEX_1] : nullptr, basepoints[EFFECT_INDEX_1] ? &basepoints[EFFECT_INDEX_1] : NULL,
basepoints[EFFECT_INDEX_2] ? &basepoints[EFFECT_INDEX_2] : nullptr, basepoints[EFFECT_INDEX_2] ? &basepoints[EFFECT_INDEX_2] : NULL,
true, castItem, triggeredByAura); true, castItem, triggeredByAura);
else else
CastSpell(target, triggered_spell_id, true, castItem, triggeredByAura); CastSpell(target, triggered_spell_id, true, castItem, triggeredByAura);
@ -2912,14 +2912,14 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d
// Set trigger spell id, target, custom basepoints // Set trigger spell id, target, custom basepoints
SpellEffectEntry const* spellEffect = auraSpellInfo->GetSpellEffect(triggeredByAura->GetEffIndex()); SpellEffectEntry const* spellEffect = auraSpellInfo->GetSpellEffect(triggeredByAura->GetEffIndex());
uint32 trigger_spell_id = spellEffect ? spellEffect->EffectTriggerSpell : 0; uint32 trigger_spell_id = spellEffect ? spellEffect->EffectTriggerSpell : 0;
Unit* target = nullptr; Unit* target = NULL;
int32 basepoints[MAX_EFFECT_INDEX] = {0, 0, 0}; int32 basepoints[MAX_EFFECT_INDEX] = {0, 0, 0};
if (triggeredByAura->GetModifier()->m_auraname == SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE) if (triggeredByAura->GetModifier()->m_auraname == SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE)
basepoints[0] = triggerAmount; basepoints[0] = triggerAmount;
Item* castItem = triggeredByAura->GetCastItemGuid() && GetTypeId() == TYPEID_PLAYER Item* castItem = triggeredByAura->GetCastItemGuid() && GetTypeId() == TYPEID_PLAYER
? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGuid()) : nullptr; ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGuid()) : NULL;
// Try handle unknown trigger spells // Try handle unknown trigger spells
// Custom requirements (not listed in procEx) Warning! damage dealing after this // Custom requirements (not listed in procEx) Warning! damage dealing after this
@ -3112,7 +3112,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d
int32 basepoints2 = (int32)(damage * 0.45f); int32 basepoints2 = (int32)(damage * 0.45f);
if (Unit* caster = triggeredByAura->GetCaster()) if (Unit* caster = triggeredByAura->GetCaster())
// Actually this spell should be sent with SMSG_SPELL_START // Actually this spell should be sent with SMSG_SPELL_START
CastCustomSpell(caster, 69034, &basepoints2, nullptr, nullptr, true, nullptr, triggeredByAura, GetObjectGuid()); CastCustomSpell(caster, 69034, &basepoints2, NULL, NULL, true, NULL, triggeredByAura, GetObjectGuid());
return SPELL_AURA_PROC_OK; return SPELL_AURA_PROC_OK;
} }
@ -3213,7 +3213,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d
{ {
// basepoints of trigger spell stored in dummyeffect of spellProto // basepoints of trigger spell stored in dummyeffect of spellProto
int32 basepoints2 = GetMaxPower(POWER_MANA) * (*i)->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_2) / 100; int32 basepoints2 = GetMaxPower(POWER_MANA) * (*i)->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_2) / 100;
CastCustomSpell(this, 18371, &basepoints2, nullptr, nullptr, true, castItem, triggeredByAura); CastCustomSpell(this, 18371, &basepoints2, NULL, NULL, true, castItem, triggeredByAura);
break; break;
} }
} }
@ -3447,7 +3447,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d
if (!pVictim || !pVictim->IsAlive()) if (!pVictim || !pVictim->IsAlive())
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
// stacking // stacking
CastSpell(this, 37658, true, nullptr, triggeredByAura); CastSpell(this, 37658, true, NULL, triggeredByAura);
Aura* dummy = GetDummyAura(37658); Aura* dummy = GetDummyAura(37658);
// release at 3 aura in stack (cont contain in basepoint of trigger aura) // release at 3 aura in stack (cont contain in basepoint of trigger aura)
@ -3471,7 +3471,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d
if (!pVictim || !pVictim->IsAlive()) if (!pVictim || !pVictim->IsAlive())
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
// stacking // stacking
CastSpell(this, 54842, true, nullptr, triggeredByAura); CastSpell(this, 54842, true, NULL, triggeredByAura);
// counting // counting
Aura* dummy = GetDummyAura(54842); Aura* dummy = GetDummyAura(54842);
@ -3492,7 +3492,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d
uint32 castSpell = auraSpellInfo->Id == 67758 ? 67759 : 67713; uint32 castSpell = auraSpellInfo->Id == 67758 ? 67759 : 67713;
// stacking // stacking
CastSpell(this, castSpell, true, nullptr, triggeredByAura); CastSpell(this, castSpell, true, NULL, triggeredByAura);
// counting // counting
Aura* dummy = GetDummyAura(castSpell); Aura* dummy = GetDummyAura(castSpell);
@ -3805,7 +3805,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
// try detect target manually if not set // try detect target manually if not set
if (target == nullptr) if (target == NULL)
target = !(procFlags & PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL) && IsPositiveSpell(trigger_spell_id) ? this : pVictim; target = !(procFlags & PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL) && IsPositiveSpell(trigger_spell_id) ? this : pVictim;
// default case // default case
@ -3814,9 +3814,9 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d
if (basepoints[EFFECT_INDEX_0] || basepoints[EFFECT_INDEX_1] || basepoints[EFFECT_INDEX_2]) if (basepoints[EFFECT_INDEX_0] || basepoints[EFFECT_INDEX_1] || basepoints[EFFECT_INDEX_2])
CastCustomSpell(target, trigger_spell_id, CastCustomSpell(target, trigger_spell_id,
basepoints[EFFECT_INDEX_0] ? &basepoints[EFFECT_INDEX_0] : nullptr, basepoints[EFFECT_INDEX_0] ? &basepoints[EFFECT_INDEX_0] : NULL,
basepoints[EFFECT_INDEX_1] ? &basepoints[EFFECT_INDEX_1] : nullptr, basepoints[EFFECT_INDEX_1] ? &basepoints[EFFECT_INDEX_1] : NULL,
basepoints[EFFECT_INDEX_2] ? &basepoints[EFFECT_INDEX_2] : nullptr, basepoints[EFFECT_INDEX_2] ? &basepoints[EFFECT_INDEX_2] : NULL,
true, castItem, triggeredByAura); true, castItem, triggeredByAura);
else else
CastSpell(target, trigger_spell_id, true, castItem, triggeredByAura); CastSpell(target, trigger_spell_id, true, castItem, triggeredByAura);

View file

@ -121,19 +121,19 @@ class WaypointManager
break; break;
case PATH_FROM_ENTRY: case PATH_FROM_ENTRY:
if (pathId >= 0xFF || pathId < 0) if (pathId >= 0xFF || pathId < 0)
return nullptr; return NULL;
key = (entry << 8) + pathId; key = (entry << 8) + pathId;
wpMap = &m_pathTemplateMap; wpMap = &m_pathTemplateMap;
break; break;
case PATH_FROM_EXTERNAL: case PATH_FROM_EXTERNAL:
if (pathId >= 0xFF || pathId < 0) if (pathId >= 0xFF || pathId < 0)
return nullptr; return NULL;
key = (entry << 8) + pathId; key = (entry << 8) + pathId;
wpMap = &m_externalPathTemplateMap; wpMap = &m_externalPathTemplateMap;
break; break;
case PATH_NO_PATH: case PATH_NO_PATH:
default: default:
return nullptr; return NULL;
} }
WaypointPathMap::iterator find = wpMap->find(key); WaypointPathMap::iterator find = wpMap->find(key);
return find != wpMap->end() ? &find->second : NULL; return find != wpMap->end() ? &find->second : NULL;