diff options
76 files changed, 574 insertions, 463 deletions
diff --git a/sql/updates/world/2014_01_23_14_world_creature_template.sql b/sql/updates/world/2014_01_23_14_world_creature_template.sql new file mode 100644 index 00000000000..05ce8f568fc --- /dev/null +++ b/sql/updates/world/2014_01_23_14_world_creature_template.sql @@ -0,0 +1,4 @@ +-- +UPDATE `creature_template` SET `faction_A`=64, `faction_H`=64 WHERE `entry` IN (39675, 39368, 39386, 39678, 39396, 39275, 39349); +UPDATE `creature_template` SET `faction_A`=875, `faction_H`=875 WHERE `entry` IN (39717, 39716, 39715); +UPDATE `creature_template` SET `faction_A`=59, `faction_H`=59 WHERE `entry`=1117; diff --git a/sql/updates/world/2014_01_23_15_world_spell_script_names.sql b/sql/updates/world/2014_01_23_15_world_spell_script_names.sql new file mode 100644 index 00000000000..f3812f60e2c --- /dev/null +++ b/sql/updates/world/2014_01_23_15_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=51690; +INSERT INTO `spell_script_names` (`spell_id` ,`ScriptName`) VALUES +(51690, 'spell_rog_killing_spree'); diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 72c8b35091f..e229c782f49 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -849,26 +849,6 @@ namespace Trinity float i_range; }; - class AnyUnfriendlyAttackableVisibleUnitInObjectRangeCheck - { - public: - AnyUnfriendlyAttackableVisibleUnitInObjectRangeCheck(Unit const* funit, float range) - : i_funit(funit), i_range(range) { } - - bool operator()(const Unit* u) - { - return u->IsAlive() - && i_funit->IsWithinDistInMap(u, i_range) - && !i_funit->IsFriendlyTo(u) - && i_funit->IsValidAttackTarget(u) - && u->GetCreatureType() != CREATURE_TYPE_CRITTER - && i_funit->CanSeeOrDetect(u); - } - private: - Unit const* i_funit; - float i_range; - }; - class CreatureWithDbGUIDCheck { public: diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 3250a5f4dbd..7c946542d7c 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -299,6 +299,10 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) case CHAT_MSG_EMOTE: case CHAT_MSG_YELL: { + // Prevent cheating + if (!sender->IsAlive()) + return; + if (sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ)) { SendNotification(GetTrinityString(LANG_SAY_REQ), sWorld->getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ)); @@ -311,7 +315,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) sender->TextEmote(msg); else if (type == CHAT_MSG_YELL) sender->Yell(msg, lang); - } break; + break; + } case CHAT_MSG_WHISPER: { if (!normalizePlayerName(to)) @@ -351,7 +356,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) sender->AddWhisperWhiteList(receiver->GetGUID()); GetPlayer()->Whisper(msg, lang, receiver->GetGUID()); - } break; + break; + } case CHAT_MSG_PARTY: case CHAT_MSG_PARTY_LEADER: { @@ -359,7 +365,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) Group* group = GetPlayer()->GetOriginalGroup(); if (!group) { - group = _player->GetGroup(); + group = sender->GetGroup(); if (!group || group->isBGGroup()) return; } @@ -370,9 +376,10 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group); WorldPacket data; - ChatHandler::BuildChatPacket(data, ChatMsg(type), Language(lang), _player, NULL, msg); + ChatHandler::BuildChatPacket(data, ChatMsg(type), Language(lang), sender, NULL, msg); group->BroadcastPacket(&data, false, group->GetMemberGroup(GetPlayer()->GetGUID())); - } break; + break; + } case CHAT_MSG_GUILD: { if (GetPlayer()->GetGuildId()) @@ -384,7 +391,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) guild->BroadcastToGuild(this, false, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL); } } - } break; + break; + } case CHAT_MSG_OFFICER: { if (GetPlayer()->GetGuildId()) @@ -396,7 +404,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) guild->BroadcastToGuild(this, true, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL); } } - } break; + break; + } case CHAT_MSG_RAID: case CHAT_MSG_RAID_LEADER: { @@ -415,9 +424,10 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group); WorldPacket data; - ChatHandler::BuildChatPacket(data, ChatMsg(type), Language(lang), _player, NULL, msg); + ChatHandler::BuildChatPacket(data, ChatMsg(type), Language(lang), sender, NULL, msg); group->BroadcastPacket(&data, false); - } break; + break; + } case CHAT_MSG_RAID_WARNING: { Group* group = GetPlayer()->GetGroup(); @@ -428,9 +438,10 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) WorldPacket data; //in battleground, raid warning is sent only to players in battleground - code is ok - ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID_WARNING, Language(lang), _player, NULL, msg); + ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID_WARNING, Language(lang), sender, NULL, msg); group->BroadcastPacket(&data, false); - } break; + break; + } case CHAT_MSG_BATTLEGROUND: case CHAT_MSG_BATTLEGROUND_LEADER: { @@ -445,74 +456,76 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group); WorldPacket data; - ChatHandler::BuildChatPacket(data, ChatMsg(type), Language(lang), _player, NULL, msg); + ChatHandler::BuildChatPacket(data, ChatMsg(type), Language(lang), sender, NULL, msg); group->BroadcastPacket(&data, false); - } break; + break; + } case CHAT_MSG_CHANNEL: { if (!HasPermission(rbac::RBAC_PERM_SKIP_CHECK_CHAT_CHANNEL_REQ)) { - if (_player->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ)) + if (sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ)) { SendNotification(GetTrinityString(LANG_CHANNEL_REQ), sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ)); return; } } - if (ChannelMgr* cMgr = ChannelMgr::forTeam(_player->GetTeam())) + if (ChannelMgr* cMgr = ChannelMgr::forTeam(sender->GetTeam())) { - if (Channel* chn = cMgr->GetChannel(channel, _player)) + if (Channel* chn = cMgr->GetChannel(channel, sender)) { - sScriptMgr->OnPlayerChat(_player, type, lang, msg, chn); - chn->Say(_player->GetGUID(), msg.c_str(), lang); + sScriptMgr->OnPlayerChat(sender, type, lang, msg, chn); + chn->Say(sender->GetGUID(), msg.c_str(), lang); } } - } break; + break; + } case CHAT_MSG_AFK: { - if (!_player->IsInCombat()) + if (!sender->IsInCombat()) { - if (_player->isAFK()) // Already AFK + if (sender ->isAFK()) // Already AFK { if (msg.empty()) - _player->ToggleAFK(); // Remove AFK + sender->ToggleAFK(); // Remove AFK else - _player->autoReplyMsg = msg; // Update message + sender->autoReplyMsg = msg; // Update message } else // New AFK mode { - _player->autoReplyMsg = msg.empty() ? GetTrinityString(LANG_PLAYER_AFK_DEFAULT) : msg; + sender->autoReplyMsg = msg.empty() ? GetTrinityString(LANG_PLAYER_AFK_DEFAULT) : msg; - if (_player->isDND()) - _player->ToggleDND(); + if (sender->isDND()) + sender->ToggleDND(); - _player->ToggleAFK(); + sender->ToggleAFK(); } - sScriptMgr->OnPlayerChat(_player, type, lang, msg); + sScriptMgr->OnPlayerChat(sender, type, lang, msg); } break; } case CHAT_MSG_DND: { - if (_player->isDND()) // Already DND + if (sender->isDND()) // Already DND { if (msg.empty()) - _player->ToggleDND(); // Remove DND + sender->ToggleDND(); // Remove DND else - _player->autoReplyMsg = msg; // Update message + sender->autoReplyMsg = msg; // Update message } else // New DND mode { - _player->autoReplyMsg = msg.empty() ? GetTrinityString(LANG_PLAYER_DND_DEFAULT) : msg; + sender->autoReplyMsg = msg.empty() ? GetTrinityString(LANG_PLAYER_DND_DEFAULT) : msg; - if (_player->isAFK()) - _player->ToggleAFK(); + if (sender->isAFK()) + sender->ToggleAFK(); - _player->ToggleDND(); + sender->ToggleDND(); } - sScriptMgr->OnPlayerChat(_player, type, lang, msg); + sScriptMgr->OnPlayerChat(sender, type, lang, msg); break; } default: diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 6e57fe590d9..72d3fd5a746 100644 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -232,7 +232,7 @@ void WorldSession::HandleLootOpcode(WorldPacket& recvData) recvData >> guid; // Check possible cheat - if (!_player->IsAlive()) + if (!GetPlayer()->IsAlive() || !IS_CRE_OR_VEH_GUID(guid)) return; GetPlayer()->SendLoot(guid, LOOT_CORPSE); diff --git a/src/server/game/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp index d9c842d1cb4..aaa9188b6f4 100644 --- a/src/server/game/Handlers/TaxiHandler.cpp +++ b/src/server/game/Handlers/TaxiHandler.cpp @@ -184,6 +184,14 @@ void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket& recvData) { uint32 node; recvData >> node; + + if (!GetPlayer()->m_taxi.IsTaximaskNodeKnown(node) && !GetPlayer()->isTaxiCheater()) + { + SendActivateTaxiReply(ERR_TAXINOTVISITED); + recvData.rfinish(); + return; + } + nodes.push_back(node); } @@ -287,6 +295,15 @@ void WorldSession::HandleActivateTaxiOpcode(WorldPacket& recvData) return; } + if (!GetPlayer()->isTaxiCheater()) + { + if (!GetPlayer()->m_taxi.IsTaximaskNodeKnown(nodes[0]) || !GetPlayer()->m_taxi.IsTaximaskNodeKnown(nodes[1])) + { + SendActivateTaxiReply(ERR_TAXINOTVISITED); + return; + } + } + GetPlayer()->ActivateTaxiPathTo(nodes, npc); } diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index f535a2be05d..41030492a8f 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5324,44 +5324,6 @@ void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const } break; } - case SPELLFAMILY_ROGUE: - { - switch (GetSpellInfo()->Id) - { - // Killing Spree - case 51690: - { - /// @todo this should use effect[1] of 51690 - UnitList targets; - { - // eff_radius == 0 - float radius = GetSpellInfo()->GetMaxRange(false); - - CellCoord p(Trinity::ComputeCellCoord(target->GetPositionX(), target->GetPositionY())); - Cell cell(p); - - Trinity::AnyUnfriendlyAttackableVisibleUnitInObjectRangeCheck u_check(target, radius); - Trinity::UnitListSearcher<Trinity::AnyUnfriendlyAttackableVisibleUnitInObjectRangeCheck> checker(target, targets, u_check); - - TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyUnfriendlyAttackableVisibleUnitInObjectRangeCheck>, GridTypeMapContainer > grid_object_checker(checker); - TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyUnfriendlyAttackableVisibleUnitInObjectRangeCheck>, WorldTypeMapContainer > world_object_checker(checker); - - cell.Visit(p, grid_object_checker, *GetBase()->GetOwner()->GetMap(), *target, radius); - cell.Visit(p, world_object_checker, *GetBase()->GetOwner()->GetMap(), *target, radius); - } - - if (targets.empty()) - return; - - Unit* spellTarget = Trinity::Containers::SelectRandomContainerElement(targets); - - target->CastSpell(spellTarget, 57840, true); - target->CastSpell(spellTarget, 57841, true); - break; - } - } - break; - } case SPELLFAMILY_HUNTER: { // Explosive Shot @@ -5573,6 +5535,21 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster) case 46736: triggerSpellId = 46737; break; + case 65418: //Well Fed - Candied Sweet Potatoes + triggerSpellId = 65410; + break; + case 65419: //Well Fed - Spice Bread Stuffing + triggerSpellId = 65416; + break; + case 65420: //Well Fed - Cranberry Chutney + triggerSpellId = 65412; + break; + case 65421: //Well Fed - Pumpkin Pie + triggerSpellId = 65415; + break; + case 65422: //Well Fed - Slow-Roasted Turkey + triggerSpellId = 65414; + break; } break; } diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp index fe38377341b..8989a8065dc 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp @@ -191,7 +191,7 @@ public: void SetData(uint32 type, uint32 data) OVERRIDE { - if (instance && type == AREATRIGGER && data == AREATRIGGER_BLACKROCK_STADIUM) + if (type == AREATRIGGER && data == AREATRIGGER_BLACKROCK_STADIUM) { if (!gythEvent) { diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp index d292e5f7701..3930656f0e1 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp @@ -183,7 +183,7 @@ public: void EnterCombat(Unit* /*who*/) OVERRIDE { - if (instance && instance->GetBossState(BOSS_FLAMEGOR) != DONE) + if (instance->GetBossState(BOSS_FLAMEGOR) != DONE) { EnterEvadeMode(); return; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp index b8a3c157c52..8d25fe117fe 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp @@ -45,7 +45,7 @@ public: void EnterCombat(Unit* /*who*/) OVERRIDE { - if (instance && instance->GetBossState(BOSS_BROODLORD) != DONE) + if (instance->GetBossState(BOSS_BROODLORD) != DONE) { EnterEvadeMode(); return; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp index 706f376e882..cbd625e852a 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp @@ -45,7 +45,7 @@ public: void EnterCombat(Unit* /*who*/) OVERRIDE { - if (instance && instance->GetBossState(BOSS_BROODLORD) != DONE) + if (instance->GetBossState(BOSS_BROODLORD) != DONE) { EnterEvadeMode(); return; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp index e262cba1978..390bcaa3c9d 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp @@ -50,7 +50,7 @@ public: void EnterCombat(Unit* /*who*/) OVERRIDE { - if (instance && instance->GetBossState(BOSS_BROODLORD) != DONE) + if (instance->GetBossState(BOSS_BROODLORD) != DONE) { EnterEvadeMode(); return; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp index ccaaa1674b3..f3bcbb2526a 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp @@ -223,16 +223,14 @@ public: void SetData(uint32 type, uint32 data) OVERRIDE { - if (instance && type == 1 && data == 1) + if ( type == 1 && data == 1) { me->StopMoving(); events.ScheduleEvent(EVENT_PATH_2, 9000); } - if (instance && type == 1 && data == 2) - { + if (type == 1 && data == 2) events.ScheduleEvent(EVENT_SUCCESS_1, 5000); - } } void UpdateAI(uint32 diff) OVERRIDE diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp index 294b662aea7..d2bd82447dc 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp @@ -96,7 +96,7 @@ class boss_majordomo : public CreatureScript void UpdateAI(uint32 diff) OVERRIDE { - if (instance && instance->GetBossState(BOSS_MAJORDOMO_EXECUTUS) != DONE) + if (instance->GetBossState(BOSS_MAJORDOMO_EXECUTUS) != DONE) { if (!UpdateVictim()) return; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp index 4e135ad513a..4d22ba6abb3 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp @@ -233,7 +233,7 @@ class boss_ragnaros : public CreatureScript break; case EVENT_SUBMERGE: { - if (instance && !_isBanished) + if (!_isBanished) { //Creature spawning and ragnaros becomming unattackable //is not very well supported in the core //no it really isnt diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp index d26458be82e..2b50c525f78 100644 --- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp @@ -193,15 +193,10 @@ public: instance->HandleGameObject(0, false, go); } - void SetInFace(bool bBool) + void SetInFace(bool isRight) { - if (bBool) - { - if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) - me->SetFacingToObject(go); - }else - if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT))) - me->SetFacingToObject(go); + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(isRight ? DATA_GO_CAVE_IN_RIGHT : DATA_GO_CAVE_IN_LEFT))) + me->SetFacingToObject(go); } void RestoreAll() diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp index 36bb2e32cb6..2dff776c35a 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp @@ -252,7 +252,7 @@ public: if (!UpdateVictim()) return; - if (instance && !instance->GetData(TYPE_MOROES)) + if (!instance->GetData(TYPE_MOROES)) { EnterEvadeMode(); return; @@ -371,7 +371,7 @@ struct boss_moroes_guestAI : public ScriptedAI void UpdateAI(uint32 /*diff*/) OVERRIDE { - if (instance && !instance->GetData(TYPE_MOROES)) + if (!instance->GetData(TYPE_MOROES)) EnterEvadeMode(); DoMeleeAttackIfReady(); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index f667394f29c..241ac85faa2 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -496,12 +496,13 @@ public: EventStarted = false; YellTimer = 0; - if (instance && instance->GetData64(DATA_IMAGE_OF_MEDIVH) == 0) + if (instance->GetData64(DATA_IMAGE_OF_MEDIVH) == 0) { instance->SetData64(DATA_IMAGE_OF_MEDIVH, me->GetGUID()); (*me).GetMotionMaster()->MovePoint(1, MedivPos[0], MedivPos[1], MedivPos[2]); Step = 0; - }else + } + else { me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); me->RemoveCorpse(); diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index 6c15fdc77fa..0601c69e96d 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -515,7 +515,7 @@ public: return; } //Don't really die in all phases of Kael'Thas - if (instance && instance->GetData(DATA_KAELTHAS_EVENT) == 0) + if (instance->GetData(DATA_KAELTHAS_EVENT) == 0) { //prevent death damage = 0; diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp index 0d62d47a5d6..a78dce47784 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp @@ -172,7 +172,7 @@ public: if (!UpdateVictim()) return; - if (_bHasDied && !_bHeal && instance && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL) + if (_bHasDied && !_bHeal && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL) { //On ressurection, stop fake death and heal whitemane and resume fight if (Unit* Whitemane = Unit::GetUnit(*me, instance->GetData64(DATA_WHITEMANE))) @@ -259,7 +259,7 @@ public: void AttackStart(Unit* who) OVERRIDE { - if (instance && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == NOT_STARTED) + if (instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == NOT_STARTED) return; ScriptedAI::AttackStart(who); @@ -289,11 +289,11 @@ public: if (_bCanResurrect) { //When casting resuruction make sure to delay so on rez when reinstate battle deepsleep runs out - if (instance && Wait_Timer <= diff) + if (Wait_Timer <= diff) { - if (Unit* Mograine = Unit::GetUnit(*me, instance->GetData64(DATA_MOGRAINE))) + if (Creature* mograine = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_MOGRAINE))) { - DoCast(Mograine, SPELL_SCARLETRESURRECTION); + DoCast(mograine, SPELL_SCARLETRESURRECTION); Talk(SAY_WH_RESSURECT); _bCanResurrect = false; } @@ -325,7 +325,7 @@ public: if (!HealthAbovePct(75)) target = me; - if (Creature* mograine = Unit::GetCreature((*me), instance->GetData64(DATA_MOGRAINE))) + if (Creature* mograine = Unit::GetCreature(*me, instance->GetData64(DATA_MOGRAINE))) { // checking _bCanResurrectCheck prevents her healing Mograine while he is "faking death" if (_bCanResurrectCheck && mograine->IsAlive() && !mograine->HealthAbovePct(75)) diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp index eb7295f72d0..76ae6b06058 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp @@ -93,7 +93,7 @@ public: InstanceScript* instance = creature->GetInstanceScript(); if (instance && instance->GetData(TYPE_FREE_NPC) != DONE && instance->GetData(TYPE_RETHILGORE) == DONE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_DOOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_DOOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp index fe0e3a050c8..f4663c0f8ec 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp @@ -93,7 +93,7 @@ public: MortalStrike_Timer = 12000; // RaiseDead_Timer = 30000; SummonSkeletons_Timer = 34000; - if (instance && instance->GetData(TYPE_RAMSTEIN) == DONE) + if (instance->GetData(TYPE_RAMSTEIN) == DONE) instance->SetData(TYPE_BARON, NOT_STARTED); } diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index 0b2e7766ac6..e8b112aa1cd 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -454,7 +454,7 @@ public: { if (uiRandomSayTimer < diff) { - if (instance && instance->GetBossState(DATA_MURU) != DONE && instance->GetBossState(DATA_KILJAEDEN) == NOT_STARTED) + if (instance->GetBossState(DATA_MURU) != DONE && instance->GetBossState(DATA_KILJAEDEN) == NOT_STARTED) Talk(SAY_KJ_OFFCOMBAT); uiRandomSayTimer = 30000; } else uiRandomSayTimer -= diff; diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp index 2dc17968822..6980dbfb9c2 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp @@ -433,10 +433,11 @@ public: { if (!SummonSentinel) { - if (InAction && instance && instance->GetBossState(DATA_MURU) == NOT_STARTED) + if (InAction && instance->GetBossState(DATA_MURU) == NOT_STARTED) Reset(); return; } + if (SummonTimer <= diff) { DoCastAOE(SPELL_SUMMON_VOID_SENTINEL, false); diff --git a/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp index ffa18eff9e3..f48c3f7556f 100644 --- a/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp +++ b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index 27426e76a81..c7803f23e1b 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -72,14 +72,15 @@ public: AuraTimer = 5000; InfernoTimer = 45000; - if (instance && IsEvent) + if (IsEvent) instance->SetData(DATA_ANETHERONEVENT, NOT_STARTED); } void EnterCombat(Unit* /*who*/) OVERRIDE { - if (instance && IsEvent) + if (IsEvent) instance->SetData(DATA_ANETHERONEVENT, IN_PROGRESS); + Talk(SAY_ONAGGRO); } @@ -91,7 +92,7 @@ public: void WaypointReached(uint32 waypointId) OVERRIDE { - if (waypointId == 7 && instance) + if (waypointId == 7) { Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->IsAlive()) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp index 1024369d4f1..4decce7482f 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp @@ -78,14 +78,15 @@ public: EnrageTimer = 600000; enraged = false; - if (instance && IsEvent) + if (IsEvent) instance->SetData(DATA_AZGALOREVENT, NOT_STARTED); } void EnterCombat(Unit* /*who*/) OVERRIDE { - if (instance && IsEvent) + if (IsEvent) instance->SetData(DATA_AZGALOREVENT, IN_PROGRESS); + Talk(SAY_ONAGGRO); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp index 70de0303f01..6a9f34d4fc2 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp @@ -74,13 +74,13 @@ public: MarkTimer = 45000; MarkTimerBase = 45000; - if (instance && IsEvent) + if (IsEvent) instance->SetData(DATA_KAZROGALEVENT, NOT_STARTED); } void EnterCombat(Unit* /*who*/) OVERRIDE { - if (instance && IsEvent) + if (IsEvent) instance->SetData(DATA_KAZROGALEVENT, IN_PROGRESS); Talk(SAY_ONAGGRO); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp index 740b056ac25..691207a4682 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp @@ -69,13 +69,13 @@ public: NovaTimer = 15000; IceboltTimer = 10000; - if (instance && IsEvent) + if (IsEvent) instance->SetData(DATA_RAGEWINTERCHILLEVENT, NOT_STARTED); } void EnterCombat(Unit* /*who*/) OVERRIDE { - if (instance && IsEvent) + if (IsEvent) instance->SetData(DATA_RAGEWINTERCHILLEVENT, IN_PROGRESS); Talk(SAY_ONAGGRO); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index 3b3cacf7d3f..c8006158ef1 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -705,7 +705,7 @@ void hyjalAI::UpdateAI(uint32 diff) switch (me->GetEntry()) { case JAINA: - if (instance && instance->GetData(DATA_ALLIANCE_RETREAT)) + if (instance->GetData(DATA_ALLIANCE_RETREAT)) { me->SetVisible(false); HideNearPos(me->GetPositionX(), me->GetPositionY()); @@ -717,7 +717,7 @@ void hyjalAI::UpdateAI(uint32 diff) else me->SetVisible(true); break; case THRALL: //thrall - if (instance && instance->GetData(DATA_HORDE_RETREAT)) + if (instance->GetData(DATA_HORDE_RETREAT)) { me->SetVisible(false); HideNearPos(me->GetPositionX(), me->GetPositionY()); @@ -781,7 +781,7 @@ void hyjalAI::UpdateAI(uint32 diff) if (Summon) { - if (instance && EnemyCount) + if (EnemyCount) { EnemyCount = instance->GetData(DATA_TRASH); if (!EnemyCount) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp index 2688fbbdaff..cbace6df028 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -443,7 +443,7 @@ public: void WaypointReached(uint32 waypointId) OVERRIDE { - if (waypointId == 0 && instance && !IsOverrun) + if (waypointId == 0 && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { @@ -559,7 +559,7 @@ public: void WaypointReached(uint32 waypointId) OVERRIDE { - if (waypointId == 7 && instance && !IsOverrun) + if (waypointId == 7 && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { @@ -658,7 +658,7 @@ public: void WaypointReached(uint32 waypointId) OVERRIDE { - if (waypointId == 7 && instance && !IsOverrun) + if (waypointId == 7 && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { @@ -769,7 +769,7 @@ public: void WaypointReached(uint32 waypointId) OVERRIDE { - if (waypointId == 7 && instance && !IsOverrun) + if (waypointId == 7 && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { @@ -882,7 +882,7 @@ public: void WaypointReached(uint32 waypointId) OVERRIDE { - if (waypointId == 7 && instance && !IsOverrun) + if (waypointId == 7 && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { @@ -978,7 +978,7 @@ public: void WaypointReached(uint32 waypointId) OVERRIDE { - if (waypointId == 7 && instance && !IsOverrun) + if (waypointId == 7 && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { @@ -1064,7 +1064,7 @@ public: void WaypointReached(uint32 waypointId) OVERRIDE { - if (waypointId == 7 && instance && !IsOverrun) + if (waypointId == 7 && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { @@ -1153,7 +1153,7 @@ public: void WaypointReached(uint32 waypointId) OVERRIDE { - if (waypointId == 2 && instance && !IsOverrun) + if (waypointId == 2 && !IsOverrun) { Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->IsAlive()) @@ -1166,7 +1166,7 @@ public: void JustDied(Unit* /*killer*/) OVERRIDE { - if (instance && IsEvent) + if (IsEvent) instance->SetData(DATA_TRASH, 0);//signal trash is dead float x, y, z; @@ -1181,11 +1181,13 @@ public: void UpdateAI(uint32 diff) OVERRIDE { hyjal_trashAI::UpdateAI(diff); + if (IsEvent || IsOverrun) { CAST_AI(hyjal_trashAI, me->AI())->SetCanAttack(false); npc_escortAI::UpdateAI(diff); } + if (IsEvent) { if (!go) @@ -1197,7 +1199,9 @@ public: AddWaypoint(i, FrostWyrmWPs[i][0], FrostWyrmWPs[i][1], FrostWyrmWPs[i][2]); Start(false, true); SetDespawnAtEnd(false); - }else{//fly path FlyPathWPs + } + else + {//fly path FlyPathWPs for (uint8 i = 0; i < 3; ++i) AddWaypoint(i, FlyPathWPs[i][0]+irand(-10, 10), FlyPathWPs[i][1]+irand(-10, 10), FlyPathWPs[i][2]); Start(false, true); @@ -1205,9 +1209,12 @@ public: } } } + if (!UpdateVictim()) return; - if (!me->IsWithinDist(me->GetVictim(), 25)){ + + if (!me->IsWithinDist(me->GetVictim(), 25)) + { if (MoveTimer <= diff) { me->GetMotionMaster()->MoveChase(me->GetVictim()); @@ -1227,7 +1234,6 @@ public: } else FrostBreathTimer -= diff; } }; - }; class npc_gargoyle : public CreatureScript @@ -1246,7 +1252,8 @@ public: { instance = creature->GetInstanceScript(); go = false; - DummyTarget[0] = 0;DummyTarget[1] = 0;DummyTarget[2] = 0; + for (uint8 i = 0; i < 3; ++i) + DummyTarget[i] = 0; Reset(); } @@ -1267,7 +1274,7 @@ public: void WaypointReached(uint32 waypointId) OVERRIDE { - if (waypointId == 2 && instance && !IsOverrun) + if (waypointId == 2 && !IsOverrun) { Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->IsAlive()) @@ -1291,11 +1298,13 @@ public: void UpdateAI(uint32 diff) OVERRIDE { hyjal_trashAI::UpdateAI(diff); + if (IsEvent || IsOverrun) { CAST_AI(hyjal_trashAI, me->AI())->SetCanAttack(false); npc_escortAI::UpdateAI(diff); } + if (IsEvent) { if (!go) @@ -1315,6 +1324,7 @@ public: } } } + if (IsOverrun && !UpdateVictim()) { if (faction == 0)//alliance @@ -1326,8 +1336,10 @@ public: } else StrikeTimer -= diff; } } + if (!UpdateVictim()) return; + if (!me->IsWithinDist(me->GetVictim(), 20) || forcemove) { forcemove = false; @@ -1347,6 +1359,7 @@ public: MoveTimer = 2000; } else MoveTimer-=diff; } + if (StrikeTimer <= diff) { if (me->IsWithinDist(me->GetVictim(), 20)) @@ -1359,7 +1372,6 @@ public: } else StrikeTimer -= diff; } }; - }; class alliance_rifleman : public CreatureScript diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp index 061c7fdfc62..5b1db051a56 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp @@ -99,7 +99,7 @@ public: { Talk(SAY_DEATH); - if (instance && instance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS) + if (instance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS) instance->SetData(TYPE_THRALL_PART1, DONE); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp index cb25d96acf3..4d75bc0545c 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp @@ -91,7 +91,7 @@ public: { Talk(SAY_DEATH); - if (instance && instance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS) + if (instance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS) instance->SetData(TYPE_THRALL_PART4, DONE); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp index 6e4ef814dbe..bf902ba403c 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp @@ -82,7 +82,7 @@ public: player->PrepareQuestMenu(creature->GetGUID()); InstanceScript* instance = creature->GetInstanceScript(); - if (instance && instance->GetData(TYPE_BARREL_DIVERSION) != DONE && !player->HasItemCount(ITEM_ENTRY_BOMBS)) + if (instance->GetData(TYPE_BARREL_DIVERSION) != DONE && !player->HasItemCount(ITEM_ENTRY_BOMBS)) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_EROZION1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); if (player->GetQuestStatus(QUEST_ENTRY_RETURN) == QUEST_STATUS_COMPLETE) @@ -92,7 +92,6 @@ public: return true; } - }; /*###### @@ -585,18 +584,14 @@ public: { player->CLOSE_GOSSIP_MENU(); - if (instance && instance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS) + if (instance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS) { instance->SetData(TYPE_THRALL_PART4, IN_PROGRESS); if (instance->GetData64(DATA_EPOCH) == 0) creature->SummonCreature(ENTRY_EPOCH, 2639.13f, 698.55f, 65.43f, 4.59f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); - if (uint64 ThrallGUID = instance->GetData64(DATA_THRALL)) - { - Creature* Thrall = (Unit::GetCreature((*creature), ThrallGUID)); - if (Thrall) - CAST_AI(npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, Thrall->AI())->StartWP(); - } + if (Creature* thrall = (Unit::GetCreature(*creature, instance->GetData64(DATA_THRALL)))) + CAST_AI(npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, thrall->AI())->StartWP(); } } return true; @@ -605,7 +600,7 @@ public: bool OnGossipHello(Player* player, Creature* creature) OVERRIDE { InstanceScript* instance = creature->GetInstanceScript(); - if (instance && instance->GetData(TYPE_THRALL_PART3) == DONE && instance->GetData(TYPE_THRALL_PART4) == NOT_STARTED) + if (instance->GetData(TYPE_THRALL_PART3) == DONE && instance->GetData(TYPE_THRALL_PART4) == NOT_STARTED) { player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->SEND_GOSSIP_MENU(GOSSIP_ID_EPOCH1, creature->GetGUID()); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp index 4fa65c5d42d..58bda23fb36 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp @@ -138,8 +138,8 @@ public: void AttackStart(Unit* /*who*/) OVERRIDE { - //if (instance && instance->GetData(TYPE_MEDIVH) == IN_PROGRESS) - //return; + //if (instance->GetData(TYPE_MEDIVH) == IN_PROGRESS) + // return; //ScriptedAI::AttackStart(who); } @@ -297,7 +297,7 @@ public: if (!creature_entry) return; - if (instance && instance->GetData(TYPE_MEDIVH) != IN_PROGRESS) + if (instance->GetData(TYPE_MEDIVH) != IN_PROGRESS) { me->InterruptNonMeleeSpells(true); me->RemoveAllAuras(); diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp index 7381594a1ce..29e08699a0f 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp @@ -340,7 +340,7 @@ public: Trinity::GameObjectInRangeCheck check(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 15); Trinity::GameObjectLastSearcher<Trinity::GameObjectInRangeCheck> searcher(me, Floor, check); me->VisitNearbyGridObject(30, searcher); - if (instance && Floor) + if (Floor) instance->SetData64(DATA_FLOOR_ERUPTION_GUID, Floor->GetGUID()); events.ScheduleEvent(EVENT_BELLOWING_ROAR, 30000); break; diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h index 4778677e067..a9a5a82f127 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h +++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h @@ -61,13 +61,9 @@ enum GameObjectIds }; template<class AI> -CreatureAI* GetRazorfenDownsAI(Creature* creature) +AI* GetRazorfenDownsAI(Creature* creature) { - if (InstanceMap* instance = creature->GetMap()->ToInstanceMap()) - if (instance->GetInstanceScript()) - if (instance->GetScriptId() == sObjectMgr->GetScriptId(RFDScriptName)) - return new AI(creature); - return NULL; + return GetInstanceAI<AI>(creature, RFDScriptName); } #endif diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp index c1897ff48ad..433193bd703 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp @@ -119,7 +119,7 @@ public: //Checking if Vem is dead. If yes we will enrage. if (Check_Timer <= diff) { - if (instance && instance->GetData(DATA_VEMISDEAD)) + if (instance->GetData(DATA_VEMISDEAD)) { DoCast(me, SPELL_ENRAGE); VemDead = true; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index 81171eef580..d84279f1e8b 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -502,8 +502,6 @@ public: //Added. Can be removed if its included in DB. me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true); - me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 0); - me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 0); } void CastSpellOnBug(Creature* target) diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp index 1890dfb4ff8..f599e6e7c27 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp @@ -394,7 +394,7 @@ public: void AttackStart(Unit* victim) OVERRIDE { - if ((instance && instance->GetBossState(DATA_JEDOGA_SHADOWSEEKER) == IN_PROGRESS) || !victim) + if ((instance->GetBossState(DATA_JEDOGA_SHADOWSEEKER) == IN_PROGRESS) || !victim) return; ScriptedAI::AttackStart(victim); @@ -403,7 +403,7 @@ public: void MoveInLineOfSight(Unit* who) OVERRIDE { - if ((instance && instance->GetBossState(DATA_JEDOGA_SHADOWSEEKER) == IN_PROGRESS) || !who) + if ((instance->GetBossState(DATA_JEDOGA_SHADOWSEEKER) == IN_PROGRESS) || !who) return; ScriptedAI::MoveInLineOfSight(who); @@ -432,7 +432,7 @@ public: void UpdateAI(uint32 diff) OVERRIDE { - if (instance && bCheckTimer <= diff) + if (bCheckTimer <= diff) { if (me->GetGUID() == instance->GetData64(DATA_ADD_JEDOGA_OPFER) && !bWalking) { diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp index 7534e747ee0..a7ad7dbfb4b 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp @@ -84,7 +84,7 @@ public: uiDoorsTimer = urand(20*IN_MILLISECONDS, 30*IN_MILLISECONDS); uiCheckDistanceTimer = 2*IN_MILLISECONDS; - if (instance && (instance->GetBossState(DATA_HADRONOX) != DONE && !bFirstTime)) + if (instance->GetBossState(DATA_HADRONOX) != DONE && !bFirstTime) instance->SetBossState(DATA_HADRONOX, FAIL); bFirstTime = false; diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp index dd699911786..9ae6f811e19 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp @@ -253,7 +253,7 @@ struct dummy_dragonAI : public ScriptedAI { case NPC_TENEBRON: { - if (instance && !instance->GetBossState(DATA_SARTHARION) == IN_PROGRESS) + if (!instance->GetBossState(DATA_SARTHARION) == IN_PROGRESS) { for (uint32 i = 0; i < 6; ++i) me->SummonCreature(NPC_TWILIGHT_EGG, TwilightEggs[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000); @@ -267,7 +267,7 @@ struct dummy_dragonAI : public ScriptedAI } case NPC_SHADRON: { - if (instance && !instance->GetBossState(DATA_SARTHARION) == IN_PROGRESS) + if (!instance->GetBossState(DATA_SARTHARION) == IN_PROGRESS) me->SummonCreature(NPC_ACOLYTE_OF_SHADRON, AcolyteofShadron, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 28000); else me->SummonCreature(NPC_ACOLYTE_OF_SHADRON, AcolyteofShadron2, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 28000); @@ -276,7 +276,7 @@ struct dummy_dragonAI : public ScriptedAI } case NPC_VESPERON: { - if (instance && !instance->GetBossState(DATA_SARTHARION) == IN_PROGRESS) + if (!instance->GetBossState(DATA_SARTHARION) == IN_PROGRESS) { if (Creature* acolyte = me->SummonCreature(NPC_ACOLYTE_OF_VESPERON, AcolyteofVesperon, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000)) { @@ -328,19 +328,19 @@ struct dummy_dragonAI : public ScriptedAI { case NPC_TENEBRON: spellId = SPELL_POWER_OF_TENEBRON; - if (instance && instance->GetBossState(DATA_SARTHARION) != IN_PROGRESS) + if (instance->GetBossState(DATA_SARTHARION) != IN_PROGRESS) instance->SetBossState(DATA_TENEBRON, DONE); break; case NPC_SHADRON: spellId = SPELL_POWER_OF_SHADRON; - if (instance && instance->GetBossState(DATA_SARTHARION) != IN_PROGRESS) + if (instance->GetBossState(DATA_SARTHARION) != IN_PROGRESS) instance->SetBossState(DATA_SHADRON, DONE); if (Creature* acolyte = me->FindNearestCreature(NPC_ACOLYTE_OF_SHADRON, 100.0f)) acolyte->Kill(acolyte); break; case NPC_VESPERON: spellId = SPELL_POWER_OF_VESPERON; - if (instance && instance->GetBossState(DATA_SARTHARION) != IN_PROGRESS) + if (instance->GetBossState(DATA_SARTHARION) != IN_PROGRESS) instance->SetBossState(DATA_VESPERON, DONE); if (Creature* acolyte = me->FindNearestCreature(NPC_ACOLYTE_OF_VESPERON, 100.0f)) acolyte->Kill(acolyte); diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp index 91c1563b494..6c0acc9bba4 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp @@ -252,9 +252,8 @@ class npc_baltharus_the_warborn_clone : public CreatureScript void JustDied(Unit* killer) OVERRIDE { // This is here because DamageTaken wont trigger if the damage is deadly. - if (_instance) - if (Creature* baltharus = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_BALTHARUS_THE_WARBORN))) - killer->Kill(baltharus); + if (Creature* baltharus = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_BALTHARUS_THE_WARBORN))) + killer->Kill(baltharus); } void UpdateAI(uint32 diff) OVERRIDE @@ -262,8 +261,7 @@ class npc_baltharus_the_warborn_clone : public CreatureScript if (!UpdateVictim()) return; - if (_instance) - me->SetHealth(_instance->GetData(DATA_BALTHARUS_SHARED_HEALTH)); + me->SetHealth(_instance->GetData(DATA_BALTHARUS_SHARED_HEALTH)); _events.Update(diff); diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp index ad59c0bed1d..b5bd510addc 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp @@ -1696,6 +1696,7 @@ class spell_halion_twilight_phasing : public SpellScriptLoader } }; +// 74805 - Summon Exit Portals class spell_halion_summon_exit_portals : public SpellScriptLoader { public: @@ -1705,23 +1706,22 @@ class spell_halion_summon_exit_portals : public SpellScriptLoader { PrepareSpellScript(spell_halion_summon_exit_portals_SpellScript); - void OnSummon(SpellEffIndex effIndex) + void SetDest0(SpellDestination& dest) { - WorldLocation summonPos = *GetExplTargetDest(); - Position offset = {0.0f, 20.0f, 0.0f, 0.0f}; - if (effIndex == EFFECT_1) - offset.m_positionY = -20.0f; - - summonPos.RelocateOffset(offset); + Position const offset = { 0.0f, 20.0f, 0.0f, 0.0f }; + dest.RelocateOffset(offset); + } - SetExplTargetDest(summonPos); - GetHitDest()->RelocateOffset(offset); + void SetDest1(SpellDestination& dest) + { + Position const offset = { 0.0f, -20.0f, 0.0f, 0.0f }; + dest.RelocateOffset(offset); } void Register() OVERRIDE { - OnEffectLaunch += SpellEffectFn(spell_halion_summon_exit_portals_SpellScript::OnSummon, EFFECT_0, SPELL_EFFECT_SUMMON_OBJECT_WILD); - OnEffectLaunch += SpellEffectFn(spell_halion_summon_exit_portals_SpellScript::OnSummon, EFFECT_1, SPELL_EFFECT_SUMMON_OBJECT_WILD); + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_halion_summon_exit_portals_SpellScript::SetDest0, EFFECT_0, TARGET_DEST_CASTER); + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_halion_summon_exit_portals_SpellScript::SetDest1, EFFECT_1, TARGET_DEST_CASTER); } }; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp index 37e52900204..92eee0e9151 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp @@ -363,11 +363,11 @@ public: { bDone = true; - if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1)) + if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1)) me->SetHomePosition(739.678f, 662.541f, 412.393f, 4.49f); - else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2)) + else if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2)) me->SetHomePosition(746.71f, 661.02f, 411.69f, 4.6f); - else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3)) + else if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3)) me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f); EnterEvadeMode(); @@ -496,11 +496,11 @@ public: { bDone = true; - if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1)) + if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1)) me->SetHomePosition(739.678f, 662.541f, 412.393f, 4.49f); - else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2)) + else if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2)) me->SetHomePosition(746.71f, 661.02f, 411.69f, 4.6f); - else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3)) + else if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3)) me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f); instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS); @@ -641,9 +641,9 @@ public: if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1)) me->SetHomePosition(739.678f, 662.541f, 412.393f, 4.49f); - else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2)) + else if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2)) me->SetHomePosition(746.71f, 661.02f, 411.69f, 4.6f); - else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3)) + else if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3)) me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f); instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS); @@ -783,11 +783,11 @@ public: { bDone = true; - if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1)) + if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1)) me->SetHomePosition(739.678f, 662.541f, 412.393f, 4.49f); - else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2)) + else if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2)) me->SetHomePosition(746.71f, 661.02f, 411.69f, 4.6f); - else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3)) + else if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3)) me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f); instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS); @@ -929,11 +929,11 @@ public: { bDone = true; - if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1)) + if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1)) me->SetHomePosition(739.678f, 662.541f, 412.393f, 4.49f); - else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2)) + else if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2)) me->SetHomePosition(746.71f, 661.02f, 411.69f, 4.6f); - else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3)) + else if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3)) me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f); instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp index ab21393fce3..a60e69d6479 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp @@ -431,7 +431,7 @@ public: void JustSummoned(Creature* summon) OVERRIDE { - if (instance && instance->GetData(BOSS_GRAND_CHAMPIONS) == NOT_STARTED) + if (instance->GetData(BOSS_GRAND_CHAMPIONS) == NOT_STARTED) { summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); summon->SetReactState(REACT_PASSIVE); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index 0b9b9f2543f..93d5c399725 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -470,7 +470,7 @@ class npc_swarm_scarab : public CreatureScript void UpdateAI(uint32 diff) OVERRIDE { - if (_instance && _instance->GetBossState(BOSS_ANUBARAK) != IN_PROGRESS) + if (_instance->GetBossState(BOSS_ANUBARAK) != IN_PROGRESS) me->DisappearAndDie(); if (!UpdateVictim()) @@ -540,7 +540,7 @@ class npc_nerubian_burrower : public CreatureScript void UpdateAI(uint32 diff) OVERRIDE { - if (_instance && _instance->GetBossState(BOSS_ANUBARAK) != IN_PROGRESS) + if (_instance->GetBossState(BOSS_ANUBARAK) != IN_PROGRESS) me->DisappearAndDie(); if (!UpdateVictim() && !me->HasAura(SPELL_SUBMERGE_EFFECT)) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp index 99423a4b7ae..cb4b3cfcea3 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp @@ -239,7 +239,7 @@ class npc_legion_flame : public CreatureScript void UpdateAI(uint32 /*diff*/) OVERRIDE { UpdateVictim(); - if (_instance && _instance->GetBossState(BOSS_JARAXXUS) != IN_PROGRESS) + if (_instance->GetBossState(BOSS_JARAXXUS) != IN_PROGRESS) me->DespawnOrUnsummon(); } private: @@ -326,7 +326,7 @@ class npc_fel_infernal : public CreatureScript void UpdateAI(uint32 diff) OVERRIDE { - if (_instance && _instance->GetBossState(BOSS_JARAXXUS) != IN_PROGRESS) + if (_instance->GetBossState(BOSS_JARAXXUS) != IN_PROGRESS) { me->DespawnOrUnsummon(); return; @@ -420,8 +420,7 @@ class npc_mistress_of_pain : public CreatureScript npc_mistress_of_painAI(Creature* creature) : ScriptedAI(creature) { _instance = creature->GetInstanceScript(); - if (_instance) - _instance->SetData(DATA_MISTRESS_OF_PAIN_COUNT, INCREASE); + _instance->SetData(DATA_MISTRESS_OF_PAIN_COUNT, INCREASE); } void Reset() OVERRIDE @@ -435,13 +434,12 @@ class npc_mistress_of_pain : public CreatureScript void JustDied(Unit* /*killer*/) OVERRIDE { - if (_instance) - _instance->SetData(DATA_MISTRESS_OF_PAIN_COUNT, DECREASE); + _instance->SetData(DATA_MISTRESS_OF_PAIN_COUNT, DECREASE); } void UpdateAI(uint32 diff) OVERRIDE { - if (_instance && _instance->GetBossState(BOSS_JARAXXUS) != IN_PROGRESS) + if (_instance->GetBossState(BOSS_JARAXXUS) != IN_PROGRESS) { me->DespawnOrUnsummon(); return; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp index a11a74250f5..ea166585bb3 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -295,8 +295,7 @@ class npc_snobold_vassal : public CreatureScript npc_snobold_vassalAI(Creature* creature) : ScriptedAI(creature) { _instance = creature->GetInstanceScript(); - if (_instance) - _instance->SetData(DATA_SNOBOLD_COUNT, INCREASE); + _instance->SetData(DATA_SNOBOLD_COUNT, INCREASE); } void Reset() OVERRIDE @@ -350,8 +349,7 @@ class npc_snobold_vassal : public CreatureScript if (Unit* target = ObjectAccessor::GetPlayer(*me, _targetGUID)) if (target->IsAlive()) target->RemoveAurasDueToSpell(SPELL_SNOBOLLED); - if (_instance) - _instance->SetData(DATA_SNOBOLD_COUNT, DECREASE); + _instance->SetData(DATA_SNOBOLD_COUNT, DECREASE); } void DoAction(int32 action) OVERRIDE @@ -378,30 +376,27 @@ class npc_snobold_vassal : public CreatureScript { if (!target->IsAlive()) { - if (_instance) + Unit* gormok = ObjectAccessor::GetCreature(*me, _instance->GetData64(NPC_GORMOK)); + if (gormok && gormok->IsAlive()) { - Unit* gormok = ObjectAccessor::GetCreature(*me, _instance->GetData64(NPC_GORMOK)); - if (gormok && gormok->IsAlive()) - { - SetCombatMovement(false); - _targetDied = true; + SetCombatMovement(false); + _targetDied = true; - // looping through Gormoks seats - for (uint8 i = 0; i < MAX_SNOBOLDS; i++) + // looping through Gormoks seats + for (uint8 i = 0; i < MAX_SNOBOLDS; i++) + { + if (!gormok->GetVehicleKit()->GetPassenger(i)) { - if (!gormok->GetVehicleKit()->GetPassenger(i)) - { - me->EnterVehicle(gormok, i); - DoAction(ACTION_ENABLE_FIRE_BOMB); - break; - } + me->EnterVehicle(gormok, i); + DoAction(ACTION_ENABLE_FIRE_BOMB); + break; } } - else if (Unit* target2 = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true)) - { - _targetGUID = target2->GetGUID(); - me->GetMotionMaster()->MoveJump(target2->GetPositionX(), target2->GetPositionY(), target2->GetPositionZ(), 15.0f, 15.0f); - } + } + else if (Unit* target2 = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true)) + { + _targetGUID = target2->GetGUID(); + me->GetMotionMaster()->MoveJump(target2->GetPositionX(), target2->GetPositionY(), target2->GetPositionZ(), 15.0f, 15.0f); } } } @@ -528,7 +523,7 @@ struct boss_jormungarAI : public BossAI void JustReachedHome() OVERRIDE { // prevent losing 2 attempts at once on heroics - if (instance && instance->GetData(TYPE_NORTHREND_BEASTS) != FAIL) + if (instance->GetData(TYPE_NORTHREND_BEASTS) != FAIL) instance->SetData(TYPE_NORTHREND_BEASTS, FAIL); me->DespawnOrUnsummon(); @@ -552,7 +547,7 @@ struct boss_jormungarAI : public BossAI if (!UpdateVictim()) return; - if (!Enraged && instance && instance->GetData(TYPE_NORTHREND_BEASTS) == SNAKES_SPECIAL) + if (!Enraged && instance->GetData(TYPE_NORTHREND_BEASTS) == SNAKES_SPECIAL) { me->RemoveAurasDueToSpell(SPELL_SUBMERGE_0); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp index cb0ec2acc38..fdefde10b4f 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp @@ -247,8 +247,8 @@ class boss_lich_king_toc : public CreatureScript summoned->CastSpell(summoned, 51807, false); summoned->SetDisplayId(summoned->GetCreatureTemplate()->Modelid2); } - if (_instance) - _instance->SetBossState(BOSS_LICH_KING, IN_PROGRESS); + + _instance->SetBossState(BOSS_LICH_KING, IN_PROGRESS); me->SetWalk(true); } @@ -401,12 +401,9 @@ class npc_fizzlebang_toc : public CreatureScript { case 1: me->SetWalk(false); - if (_instance) - { - _instance->DoUseDoorOrButton(_instance->GetData64(GO_MAIN_GATE_DOOR)); - _instance->SetData(TYPE_EVENT, 1120); - _instance->SetData(TYPE_EVENT_TIMER, 1*IN_MILLISECONDS); - } + _instance->DoUseDoorOrButton(_instance->GetData64(GO_MAIN_GATE_DOOR)); + _instance->SetData(TYPE_EVENT, 1120); + _instance->SetData(TYPE_EVENT_TIMER, 1*IN_MILLISECONDS); break; default: break; diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index c9247ce17f3..027a6843c87 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -664,8 +664,7 @@ class npc_jaina_or_sylvanas_hor : public CreatureScript _events.ScheduleEvent(EVENT_INTRO_END, 5000); break; case EVENT_INTRO_END: - if (_instance) - _instance->SetData(DATA_INTRO_EVENT, DONE); + _instance->SetData(DATA_INTRO_EVENT, DONE); // Loralen or Koreln disappearAndDie() if (Creature* lichking = ObjectAccessor::GetCreature(*me, _lichkingGUID)) { @@ -1830,7 +1829,7 @@ public: _emergeTimer = 4000; _doEmerge = false; _doJump = false; - if (_instance && _instance->GetData(DATA_ESCAPE_EVENT) == IN_PROGRESS) + if (_instance->GetData(DATA_ESCAPE_EVENT) == IN_PROGRESS) _instance->SetData(DATA_SUMMONS, 1); } @@ -1843,8 +1842,7 @@ public: void JustDied(Unit* /*killer*/) OVERRIDE { - if (_instance) - _instance->SetData(DATA_SUMMONS, 0); + _instance->SetData(DATA_SUMMONS, 0); } void AttackStart(Unit* who) OVERRIDE @@ -1932,9 +1930,8 @@ public: _boltVolleyTimer = 15000; _curseTimer = 7000; _doEmerge = false; - if (_instance) - if (_instance->GetData(DATA_ESCAPE_EVENT) == IN_PROGRESS) - _instance->SetData(DATA_SUMMONS, 1); + if (_instance->GetData(DATA_ESCAPE_EVENT) == IN_PROGRESS) + _instance->SetData(DATA_SUMMONS, 1); } void IsSummonedBy(Unit*) OVERRIDE @@ -1945,9 +1942,7 @@ public: void JustDied(Unit* /*killer*/) OVERRIDE { - if (_instance) - _instance->SetData(DATA_SUMMONS, 0); - + _instance->SetData(DATA_SUMMONS, 0); } void AttackStart(Unit* who) OVERRIDE @@ -2049,9 +2044,8 @@ public: _doWalk = false; _vomitTimer = 15000; _strikeTimer = 6000; - if (_instance) - if (_instance->GetData(DATA_ESCAPE_EVENT) == IN_PROGRESS) - _instance->SetData(DATA_SUMMONS, 1); + if (_instance->GetData(DATA_ESCAPE_EVENT) == IN_PROGRESS) + _instance->SetData(DATA_SUMMONS, 1); } void IsSummonedBy(Unit*) OVERRIDE @@ -2062,9 +2056,6 @@ public: void UpdateAI(uint32 diff) OVERRIDE { - if (!_instance) - return; - if (_instance->GetData(DATA_ESCAPE_EVENT) == IN_PROGRESS) { if (_doWalk != true) @@ -2103,8 +2094,7 @@ public: void JustDied(Unit* /*killer*/) OVERRIDE { - if (_instance) - _instance->SetData(DATA_SUMMONS, 0); + _instance->SetData(DATA_SUMMONS, 0); } }; diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h index ff3192b89d5..c4776c3cfcd 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h @@ -147,9 +147,9 @@ struct boss_horAI : ScriptedAI { events.Reset(); me->SetVisible(false); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); me->SetReactState(REACT_PASSIVE); - if (instance && instance->GetData(DATA_WAVE_COUNT) != NOT_STARTED) + if (instance->GetData(DATA_WAVE_COUNT) != NOT_STARTED) instance->ProcessEvent(0, EVENT_DO_WIPE); } @@ -158,7 +158,7 @@ struct boss_horAI : ScriptedAI switch (actionID) { case ACTION_ENTER_COMBAT: // called by InstanceScript when boss shall enter in combat. - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); me->SetReactState(REACT_AGGRESSIVE); if (Unit* unit = me->SelectNearestTarget()) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp index 30c11ec556d..b053f0a0258 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -1492,6 +1492,7 @@ class spell_taldaram_ball_of_inferno_flame : public SpellScriptLoader } }; +// 72080 - Kinetic Bomb (Valanar) class spell_valanar_kinetic_bomb : public SpellScriptLoader { public: @@ -1501,18 +1502,15 @@ class spell_valanar_kinetic_bomb : public SpellScriptLoader { PrepareSpellScript(spell_valanar_kinetic_bomb_SpellScript); - void ChangeSummonPos(SpellEffIndex /*effIndex*/) + void SetDest(SpellDestination& dest) { - WorldLocation summonPos = *GetExplTargetDest(); - Position offset = {0.0f, 0.0f, 20.0f, 0.0f}; - summonPos.RelocateOffset(offset); - SetExplTargetDest(summonPos); - GetHitDest()->RelocateOffset(offset); + Position const offset = { 0.0f, 0.0f, 20.0f, 0.0f }; + dest.RelocateOffset(offset); } void Register() OVERRIDE { - OnEffectHit += SpellEffectFn(spell_valanar_kinetic_bomb_SpellScript::ChangeSummonPos, EFFECT_0, SPELL_EFFECT_SUMMON); + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_valanar_kinetic_bomb_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER); } }; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index f3b62cd7b24..ca2c75e502c 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -2034,6 +2034,7 @@ class spell_svalna_remove_spear : public SpellScriptLoader } }; +// 72585 - Soul Missile class spell_icc_soul_missile : public SpellScriptLoader { public: @@ -2043,15 +2044,15 @@ class spell_icc_soul_missile : public SpellScriptLoader { PrepareSpellScript(spell_icc_soul_missile_SpellScript); - void RelocateDest() + void RelocateDest(SpellDestination& dest) { - static Position const offset = {0.0f, 0.0f, 200.0f, 0.0f}; - const_cast<WorldLocation*>(GetExplTargetDest())->RelocateOffset(offset); + static Position const offset = { 0.0f, 0.0f, 200.0f, 0.0f }; + dest.RelocateOffset(offset); } void Register() OVERRIDE { - OnCast += SpellCastFn(spell_icc_soul_missile_SpellScript::RelocateDest); + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_icc_soul_missile_SpellScript::RelocateDest, EFFECT_0, TARGET_DEST_CASTER); } }; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp index 07157100ea4..2091b82e20c 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp @@ -757,8 +757,7 @@ class npc_kelthuzad_abomination : public CreatureScript void JustDied(Unit* /*killer*/) OVERRIDE { - if (_instance) - _instance->SetData(DATA_ABOMINATION_KILLED, _instance->GetData(DATA_ABOMINATION_KILLED) + 1); + _instance->SetData(DATA_ABOMINATION_KILLED, _instance->GetData(DATA_ABOMINATION_KILLED) + 1); } private: diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index fd672da7609..58f8943fae6 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -450,7 +450,7 @@ public: { case ACTION_LAND_ENCOUNTER_START: events.CancelEventGroup(1); - if (Creature* alexstraszaBunny = me->GetMap()->GetCreature(instance->GetData64(DATA_ALEXSTRASZA_BUNNY_GUID))) + if (Creature* alexstraszaBunny = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ALEXSTRASZA_BUNNY_GUID))) { Position pos; pos.m_positionZ = alexstraszaBunny->GetPositionZ(); @@ -713,7 +713,8 @@ public: { _firstCyclicMovementStarted = true; me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFacingToObject(me->GetMap()->GetCreature(instance->GetData64(DATA_ALEXSTRASZA_BUNNY_GUID))); + if (Creature* alexstraszaBunny = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ALEXSTRASZA_BUNNY_GUID))) + me->SetFacingToObject(alexstraszaBunny); events.ScheduleEvent(EVENT_SUMMON_ARCANE_BOMB, 1*IN_MILLISECONDS, 0, PHASE_TWO); } _flyingOutOfPlatform = false; @@ -722,7 +723,8 @@ public: break; case POINT_PHASE_ONE_TO_TWO_TRANSITION: me->SetDisableGravity(true); - me->SetFacingToObject(me->GetMap()->GetCreature(instance->GetData64(DATA_ALEXSTRASZA_BUNNY_GUID))); + if (Creature* alexstraszaBunny = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ALEXSTRASZA_BUNNY_GUID))) + me->SetFacingToObject(alexstraszaBunny); SendLightOverride(LIGHT_ARCANE_RUNES, 5*IN_MILLISECONDS); events.ScheduleEvent(EVENT_FLY_OUT_OF_PLATFORM, 18*IN_MILLISECONDS, 0, PHASE_TWO); break; @@ -780,7 +782,7 @@ public: me->CastCustomSpell(SPELL_RANDOM_PORTAL, SPELLVALUE_MAX_TARGETS, 1); break; case EVENT_LAND_START_ENCOUNTER: - if (GameObject* iris = me->GetMap()->GetGameObject(instance->GetData64(DATA_FOCUSING_IRIS_GUID))) + if (GameObject* iris = ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_FOCUSING_IRIS_GUID))) { me->SetFacingToObject(iris); iris->Delete(); // this is not the best way. @@ -837,7 +839,7 @@ public: case EVENT_FLY_OUT_OF_PLATFORM: if (!_performingDestroyPlatform) { - if (Creature* alexstraszaBunny = me->GetMap()->GetCreature(instance->GetData64(DATA_ALEXSTRASZA_BUNNY_GUID))) + if (Creature* alexstraszaBunny = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ALEXSTRASZA_BUNNY_GUID))) { Position randomPosOnRadius; // Hardcodded retail value, reason is Z getters can fail... (TO DO: Change to getter when height calculation works on 100%!) @@ -908,7 +910,7 @@ public: if (!_flyingOutOfPlatform) { DoCast(me, SPELL_SUMMON_ARCANE_BOMB, true); - if (Creature* lastArcaneOverloadBunny = me->GetMap()->GetCreature(_arcaneOverloadGUID)) + if (Creature* lastArcaneOverloadBunny = ObjectAccessor::GetCreature(*me, _arcaneOverloadGUID)) DoCast(lastArcaneOverloadBunny, SPELL_ARCANE_BOMB_TRIGGER, true); } events.ScheduleEvent(EVENT_SUMMON_ARCANE_BOMB, urand(15, 16)*IN_MILLISECONDS, 2, PHASE_TWO); @@ -993,7 +995,7 @@ public: { _JustDied(); Talk(SAY_DEATH); - if (Creature* alexstraszaGiftBoxBunny = me->GetMap()->GetCreature(instance->GetData64(DATA_GIFT_BOX_BUNNY_GUID))) + if (Creature* alexstraszaGiftBoxBunny = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_GIFT_BOX_BUNNY_GUID))) { if (GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) alexstraszaGiftBoxBunny->SummonGameObject(GO_HEART_OF_MAGIC_10, HeartOfMagicSpawnPos.GetPositionX(), HeartOfMagicSpawnPos.GetPositionY(), @@ -1087,7 +1089,7 @@ public: { if (spell->Id == SPELL_PORTAL_OPENED) { - if (Creature* malygos = me->GetMap()->GetCreature(_instance->GetData64(DATA_MALYGOS))) + if (Creature* malygos = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_MALYGOS))) { if (malygos->AI()->GetData(DATA_PHASE) == PHASE_ONE) DoCast(me, SPELL_SUMMON_POWER_PARK, true); @@ -1101,15 +1103,12 @@ public: if (!me->HasAura(SPELL_PORTAL_VISUAL_CLOSED) && !me->HasAura(SPELL_PORTAL_OPENED)) DoCast(me, SPELL_PORTAL_VISUAL_CLOSED, true); - if (_instance) + if (Creature* malygos = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_MALYGOS))) { - if (Creature* malygos = me->GetMap()->GetCreature(_instance->GetData64(DATA_MALYGOS))) + if (malygos->AI()->GetData(DATA_PHASE) != PHASE_ONE && me->HasAura(SPELL_PORTAL_OPENED)) { - if (malygos->AI()->GetData(DATA_PHASE) != PHASE_ONE && me->HasAura(SPELL_PORTAL_OPENED)) - { - me->RemoveAura(SPELL_PORTAL_OPENED); - DoCast(me, SPELL_PORTAL_VISUAL_CLOSED, true); - } + me->RemoveAura(SPELL_PORTAL_OPENED); + DoCast(me, SPELL_PORTAL_VISUAL_CLOSED, true); } } } @@ -1143,9 +1142,8 @@ public: { me->GetMotionMaster()->MoveIdle(); - if (_instance) - if (Creature* malygos = me->GetMap()->GetCreature(_instance->GetData64(DATA_MALYGOS))) - me->GetMotionMaster()->MoveFollow(malygos, 0.0f, 0.0f); + if (Creature* malygos = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_MALYGOS))) + me->GetMotionMaster()->MoveFollow(malygos, 0.0f, 0.0f); } void UpdateAI(uint32 /*diff*/) OVERRIDE @@ -1153,7 +1151,7 @@ public: if (!_instance) return; - if (Creature* malygos = me->GetMap()->GetCreature(_instance->GetData64(DATA_MALYGOS))) + if (Creature* malygos = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_MALYGOS))) { if (malygos->AI()->GetData(DATA_PHASE) != PHASE_ONE || _instance->GetBossState(DATA_MALYGOS_EVENT) == FAIL) { @@ -1432,7 +1430,7 @@ class npc_nexus_lord : public CreatureScript void JustDied(Unit* /*killer*/) OVERRIDE { - if (Creature* malygos = me->GetMap()->GetCreature(_instance->GetData64(DATA_MALYGOS))) + if (Creature* malygos = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_MALYGOS))) malygos->AI()->SetData(DATA_SUMMON_DEATHS, malygos->AI()->GetData(DATA_SUMMON_DEATHS) + 1); } @@ -1499,7 +1497,7 @@ class npc_scion_of_eternity : public CreatureScript void JustDied(Unit* /*killer*/) OVERRIDE { - if (Creature* malygos = me->GetMap()->GetCreature(_instance->GetData64(DATA_MALYGOS))) + if (Creature* malygos = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_MALYGOS))) malygos->AI()->SetData(DATA_SUMMON_DEATHS, malygos->AI()->GetData(DATA_SUMMON_DEATHS) + 1); } @@ -1542,7 +1540,7 @@ public: void DoAction(int32 /*action*/) OVERRIDE { - if (Creature* malygos = me->GetMap()->GetCreature(_instance->GetData64(DATA_MALYGOS))) + if (Creature* malygos = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_MALYGOS))) { if (malygos->AI()->GetData(DATA_PHASE) == PHASE_TWO) me->DespawnOrUnsummon(6*IN_MILLISECONDS); @@ -2047,7 +2045,7 @@ class spell_scion_of_eternity_arcane_barrage : public SpellScriptLoader Creature* caster = GetCaster()->ToCreature(); InstanceScript* instance = caster->GetInstanceScript(); - Creature* malygos = caster->GetMap()->GetCreature(instance->GetData64(DATA_MALYGOS)); + Creature* malygos = ObjectAccessor::GetCreature(*caster, instance->GetData64(DATA_MALYGOS)); // If max possible targets are more than 1 then Scions wouldn't select previosly selected target, // in longer terms this means if spell picks target X then 2nd cast of this spell will pick smth else @@ -2232,6 +2230,7 @@ class spell_alexstrasza_bunny_destroy_platform_event : public SpellScriptLoader } }; +// 56070 - Summon Red Dragon Buddy class spell_wyrmrest_skytalon_summon_red_dragon_buddy : public SpellScriptLoader { public: @@ -2246,19 +2245,16 @@ class spell_wyrmrest_skytalon_summon_red_dragon_buddy : public SpellScriptLoader return GetCaster()->GetTypeId() == TYPEID_PLAYER; } - void ChangeSummonPos(SpellEffIndex /*effIndex*/) + void SetDest(SpellDestination& dest) { // Adjust effect summon position to lower Z - WorldLocation summonPos = *GetExplTargetDest(); - Position offset = { 0.0f, 0.0f, -80.0f, 0.0f }; - summonPos.RelocateOffset(offset); - SetExplTargetDest(summonPos); - GetHitDest()->RelocateOffset(offset); + Position const offset = { 0.0f, 0.0f, -80.0f, 0.0f }; + dest.RelocateOffset(offset); } void Register() OVERRIDE { - OnEffectHit += SpellEffectFn(spell_wyrmrest_skytalon_summon_red_dragon_buddy_SpellScript::ChangeSummonPos, EFFECT_0, SPELL_EFFECT_SUMMON); + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_wyrmrest_skytalon_summon_red_dragon_buddy_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER_RADIUS); } }; diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp index 40e526219fa..506e16741fb 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp @@ -375,27 +375,16 @@ class spell_oculus_call_ruby_emerald_amber_drake : public SpellScriptLoader { PrepareSpellScript(spell_oculus_call_ruby_emerald_amber_drake_SpellScript); - void ChangeSummonPos(SpellEffIndex /*effIndex*/) + void SetDest(SpellDestination& dest) { // Adjust effect summon position - WorldLocation summonPos = *GetExplTargetDest(); - Position offset = { 0.0f, 0.0f, 12.0f, 0.0f }; - summonPos.RelocateOffset(offset); - SetExplTargetDest(summonPos); - GetHitDest()->RelocateOffset(offset); - } - - void ModDestHeight(SpellEffIndex /*effIndex*/) - { - // Used to cast visual effect at proper position - Position offset = { 0.0f, 0.0f, 12.0f, 0.0f }; - const_cast<WorldLocation*>(GetExplTargetDest())->RelocateOffset(offset); + Position const offset = { 0.0f, 0.0f, 12.0f, 0.0f }; + dest.RelocateOffset(offset); } void Register() OVERRIDE { - OnEffectHit += SpellEffectFn(spell_oculus_call_ruby_emerald_amber_drake_SpellScript::ChangeSummonPos, EFFECT_0, SPELL_EFFECT_SUMMON); - OnEffectLaunch += SpellEffectFn(spell_oculus_call_ruby_emerald_amber_drake_SpellScript::ModDestHeight, EFFECT_0, SPELL_EFFECT_SUMMON); + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_oculus_call_ruby_emerald_amber_drake_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER_FRONT); } }; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp index a8f933431c3..9599700eccb 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp @@ -1253,6 +1253,7 @@ class spell_algalon_remove_phase : public SpellScriptLoader } }; +// 62295 - Cosmic Smash class spell_algalon_cosmic_smash : public SpellScriptLoader { public: @@ -1262,16 +1263,15 @@ class spell_algalon_cosmic_smash : public SpellScriptLoader { PrepareSpellScript(spell_algalon_cosmic_smash_SpellScript); - void ModDestHeight(SpellEffIndex /*effIndex*/) + void ModDestHeight(SpellDestination& dest) { - Position offset = {0.0f, 0.0f, 65.0f, 0.0f}; - const_cast<WorldLocation*>(GetExplTargetDest())->RelocateOffset(offset); - GetHitDest()->RelocateOffset(offset); + Position const offset = { 0.0f, 0.0f, 65.0f, 0.0f }; + dest.RelocateOffset(offset); } void Register() OVERRIDE { - OnEffectLaunch += SpellEffectFn(spell_algalon_cosmic_smash_SpellScript::ModDestHeight, EFFECT_0, SPELL_EFFECT_SUMMON); + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_algalon_cosmic_smash_SpellScript::ModDestHeight, EFFECT_0, TARGET_DEST_CASTER_SUMMON); } }; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 1419a804e26..96840842d24 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -1192,7 +1192,7 @@ class npc_lorekeeper : public CreatureScript bool OnGossipHello(Player* player, Creature* creature) OVERRIDE { InstanceScript* instance = creature->GetInstanceScript(); - if (instance && instance->GetData(BOSS_LEVIATHAN) !=DONE && player) + if (instance && instance->GetData(BOSS_LEVIATHAN) != DONE && player) { player->PrepareGossipMenu(creature); @@ -1285,8 +1285,7 @@ class go_ulduar_tower : public GameObjectScript break; } - Creature* trigger = go->FindNearestCreature(NPC_ULDUAR_GAUNTLET_GENERATOR, 15.0f, true); - if (trigger) + if (Creature* trigger = go->FindNearestCreature(NPC_ULDUAR_GAUNTLET_GENERATOR, 15.0f, true)) trigger->DisappearAndDie(); } }; diff --git a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp index ec20489bfc2..e53d046b396 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp @@ -90,7 +90,7 @@ public: void UpdateAI(uint32 diff) OVERRIDE { - if (instance && instance->GetData(DATA_REMOVE_NPC) == 1) + if (instance->GetData(DATA_REMOVE_NPC) == 1) { me->DespawnOrUnsummon(); instance->SetData(DATA_REMOVE_NPC, 0); diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp index 79025bb5c0f..5f79e609e01 100644 --- a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp @@ -446,7 +446,7 @@ public: void Reset() OVERRIDE { - if (instance && !uiBoss) + if (!uiBoss) uiBoss = instance->GetData(DATA_WAVE_COUNT) == 6 ? instance->GetData(DATA_FIRST_BOSS) : instance->GetData(DATA_SECOND_BOSS); me->SetReactState(REACT_PASSIVE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE); @@ -486,7 +486,7 @@ public: void UpdateAI(uint32 diff) OVERRIDE { - if (instance && instance->GetData(DATA_MAIN_EVENT_PHASE) != IN_PROGRESS) + if (instance->GetData(DATA_MAIN_EVENT_PHASE) != IN_PROGRESS) me->CastStop(); npc_escortAI::UpdateAI(diff); @@ -723,7 +723,7 @@ struct violet_hold_trashAI : public npc_escortAI void UpdateAI(uint32) OVERRIDE { - if (instance && instance->GetData(DATA_MAIN_EVENT_PHASE) != IN_PROGRESS) + if (instance->GetData(DATA_MAIN_EVENT_PHASE) != IN_PROGRESS) me->CastStop(); if (!bHasGotMovingPoints) diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index 0173454ef28..f840c0562b3 100644 --- a/src/server/scripts/Northrend/zone_borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -1359,10 +1359,7 @@ public: struct npc_counselor_talbotAI : public ScriptedAI { - npc_counselor_talbotAI(Creature* creature) : ScriptedAI(creature) - { - creature->RestoreFaction(); - } + npc_counselor_talbotAI(Creature* creature) : ScriptedAI(creature) { } uint64 leryssaGUID; uint64 arlosGUID; diff --git a/src/server/scripts/Northrend/zone_grizzly_hills.cpp b/src/server/scripts/Northrend/zone_grizzly_hills.cpp index bacc6de57f0..112d42441b9 100644 --- a/src/server/scripts/Northrend/zone_grizzly_hills.cpp +++ b/src/server/scripts/Northrend/zone_grizzly_hills.cpp @@ -20,8 +20,6 @@ #include "ScriptedCreature.h" #include "ScriptedEscortAI.h" #include "Player.h" -#include "Spell.h" -#include "SpellInfo.h" #include "SpellScript.h" #include "CreatureTextMgr.h" diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 3bbd41afc89..d74aecb9b25 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -1672,7 +1672,7 @@ public: { if (Check_Timer <= diff) { - if (instance && instance->GetBossState(DATA_ILLIDARI_COUNCIL) == DONE) + if (instance->GetBossState(DATA_ILLIDARI_COUNCIL) == DONE) me->SetVisible(true); Check_Timer = 5000; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp index 8583989f059..9055bb1862d 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp @@ -214,7 +214,7 @@ public: void UpdateAI(uint32 diff) OVERRIDE { //Only if not incombat check if the event is started - if (!me->IsInCombat() && instance && instance->GetData(DATA_KARATHRESSEVENT)) + if (!me->IsInCombat() && instance->GetData(DATA_KARATHRESSEVENT)) { if (Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESSEVENT_STARTER))) { @@ -228,7 +228,7 @@ public: return; //someone evaded! - if (instance && !instance->GetData(DATA_KARATHRESSEVENT)) + if (!instance->GetData(DATA_KARATHRESSEVENT)) { EnterEvadeMode(); return; @@ -355,7 +355,7 @@ public: void UpdateAI(uint32 diff) OVERRIDE { //Only if not incombat check if the event is started - if (!me->IsInCombat() && instance && instance->GetData(DATA_KARATHRESSEVENT)) + if (!me->IsInCombat() && instance->GetData(DATA_KARATHRESSEVENT)) { if (Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESSEVENT_STARTER))) AttackStart(target); @@ -366,7 +366,7 @@ public: return; //someone evaded! - if (instance && !instance->GetData(DATA_KARATHRESSEVENT)) + if (!instance->GetData(DATA_KARATHRESSEVENT)) { EnterEvadeMode(); return; @@ -482,7 +482,7 @@ public: void UpdateAI(uint32 diff) OVERRIDE { //Only if not incombat check if the event is started - if (!me->IsInCombat() && instance && instance->GetData(DATA_KARATHRESSEVENT)) + if (!me->IsInCombat() && instance->GetData(DATA_KARATHRESSEVENT)) { if (Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESSEVENT_STARTER))) AttackStart(target); @@ -493,7 +493,7 @@ public: return; //someone evaded! - if (instance && !instance->GetData(DATA_KARATHRESSEVENT)) + if (!instance->GetData(DATA_KARATHRESSEVENT)) { EnterEvadeMode(); return; @@ -597,7 +597,7 @@ public: void UpdateAI(uint32 diff) OVERRIDE { //Only if not incombat check if the event is started - if (!me->IsInCombat() && instance && instance->GetData(DATA_KARATHRESSEVENT)) + if (!me->IsInCombat() && instance->GetData(DATA_KARATHRESSEVENT)) { if (Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESSEVENT_STARTER))) AttackStart(target); diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index b421d9c1153..8d6eb064194 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -519,7 +519,7 @@ public: if (CheckTimer <= diff) { // Start Phase 3 - if (instance && instance->GetData(DATA_CANSTARTPHASE3)) + if (instance->GetData(DATA_CANSTARTPHASE3)) { // set life 50% me->SetHealth(me->CountPctFromMaxHealth(50)); diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp index a45e4ddb0a9..f9370b44c20 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp @@ -317,10 +317,10 @@ public: // and reseting equipment me->LoadEquipment(); - if (instance && instance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) + if (instance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) { Unit* victim = NULL; - victim = Unit::GetUnit(*me, instance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)); + victim = ObjectAccessor::GetUnit(*me, instance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)); if (victim) me->getThreatManager().addThreat(victim, 1); StartEvent(); @@ -750,7 +750,7 @@ public: return; } - if (instance && !instance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) + if (!instance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) { EnterEvadeMode(); return; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp index a6cd426f435..718c32cd8ae 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp @@ -112,10 +112,11 @@ public: bool CheckCanStart()//check if players fished { - if (instance && instance->GetData(DATA_STRANGE_POOL) == NOT_STARTED) + if (instance->GetData(DATA_STRANGE_POOL) == NOT_STARTED) return false; return true; } + void Reset() OVERRIDE { me->SetSwim(true); diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp index 42833fead04..3661ebc8cc3 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp @@ -224,11 +224,11 @@ public: { if (Repair_Timer <= diff) { - if (instance && instance->GetBossState(DATA_MEKGINEER_STEAMRIGGER) == IN_PROGRESS) + if (instance->GetBossState(DATA_MEKGINEER_STEAMRIGGER) == IN_PROGRESS) { - if (Unit* pMekgineer = Unit::GetUnit(*me, instance->GetData64(DATA_MEKGINEER_STEAMRIGGER))) + if (Creature* mekgineer = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_MEKGINEER_STEAMRIGGER))) { - if (me->IsWithinDistInMap(pMekgineer, MAX_REPAIR_RANGE)) + if (me->IsWithinDistInMap(mekgineer, MAX_REPAIR_RANGE)) { //are we already channeling? Doesn't work very well, find better check? if (!me->GetUInt32Value(UNIT_CHANNEL_SPELL)) diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index d802e48f3b0..a961800025d 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -484,7 +484,7 @@ class npc_ember_of_alar : public CreatureScript me->setDeathState(JUST_DIED); } - void DamageTaken(Unit* killer, uint32 &damage) OVERRIDE + void DamageTaken(Unit* killer, uint32& damage) OVERRIDE { if (damage >= me->GetHealth() && killer != me && !toDie) { @@ -492,7 +492,7 @@ class npc_ember_of_alar : public CreatureScript DoCast(me, SPELL_EMBER_BLAST, true); me->SetDisplayId(11686); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - if (instance && instance->GetData(DATA_ALAREVENT) == 2) + if (instance->GetData(DATA_ALAREVENT) == 2) { if (Unit* Alar = Unit::GetUnit(*me, instance->GetData64(DATA_ALAR))) { diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index 75b1bfe8ad1..077539b6b88 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -182,7 +182,7 @@ struct advisorbase_ai : public ScriptedAI me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); //reset encounter - if (instance && (instance->GetData(DATA_KAELTHASEVENT) == 1 || instance->GetData(DATA_KAELTHASEVENT) == 3)) + if (instance->GetData(DATA_KAELTHASEVENT) == 1 || instance->GetData(DATA_KAELTHASEVENT) == 3) if (Creature* Kaelthas = Unit::GetCreature(*me, instance->GetData64(DATA_KAELTHAS))) Kaelthas->AI()->EnterEvadeMode(); } @@ -223,14 +223,14 @@ struct advisorbase_ai : public ScriptedAI return; //Prevent glitch if in fake death - if (FakeDeath && instance && instance->GetData(DATA_KAELTHASEVENT) != 0) + if (FakeDeath && instance->GetData(DATA_KAELTHASEVENT) != 0) { damage = 0; return; } //Don't really die in phase 1 & 3, only die after that - if (instance && instance->GetData(DATA_KAELTHASEVENT) != 0) + if (instance->GetData(DATA_KAELTHASEVENT) != 0) { //prevent death damage = 0; @@ -417,7 +417,7 @@ class boss_kaelthas : public CreatureScript } else if (me->GetMap()->IsDungeon()) { - if (instance && !instance->GetData(DATA_KAELTHASEVENT) && !Phase) + if (!instance->GetData(DATA_KAELTHASEVENT) && !Phase) StartEvent(); who->SetInCombatWith(me); @@ -429,7 +429,7 @@ class boss_kaelthas : public CreatureScript void EnterCombat(Unit* /*who*/) OVERRIDE { - if (instance && !instance->GetData(DATA_KAELTHASEVENT) && !Phase) + if (!instance->GetData(DATA_KAELTHASEVENT) && !Phase) StartEvent(); } @@ -1046,7 +1046,7 @@ class boss_thaladred_the_darkener : public CreatureScript void JustDied(Unit* /*killer*/) OVERRIDE { - if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3) + if (instance->GetData(DATA_KAELTHASEVENT) == 3) Talk(SAY_THALADRED_DEATH); } @@ -1138,7 +1138,7 @@ class boss_lord_sanguinar : public CreatureScript void JustDied(Unit* /*killer*/) OVERRIDE { - if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3) + if (instance->GetData(DATA_KAELTHASEVENT) == 3) Talk(SAY_SANGUINAR_DEATH); } @@ -1203,7 +1203,7 @@ class boss_grand_astromancer_capernian : public CreatureScript void JustDied(Unit* /*killer*/) OVERRIDE { - if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3) + if (instance->GetData(DATA_KAELTHASEVENT) == 3) Talk(SAY_CAPERNIAN_DEATH); } @@ -1342,7 +1342,7 @@ class boss_master_engineer_telonicus : public CreatureScript void JustDied(Unit* /*killer*/) OVERRIDE { - if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3) + if (instance->GetData(DATA_KAELTHASEVENT) == 3) Talk(SAY_TELONICUS_DEATH); } diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp index a1917d6201c..1a972f65360 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp @@ -77,7 +77,7 @@ class boss_void_reaver : public CreatureScript Enraged = false; - if (instance && me->IsAlive()) + if (me->IsAlive()) instance->SetData(DATA_VOIDREAVEREVENT, NOT_STARTED); } diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 4dd06b762a1..cdf32bd94d5 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -1606,6 +1606,7 @@ class spell_q12527_zuldrak_rat : public SpellScriptLoader } }; +// 55368 - Summon Stefan class spell_q12661_q12669_q12676_q12677_q12713_summon_stefan : public SpellScriptLoader { public: @@ -1615,19 +1616,16 @@ class spell_q12661_q12669_q12676_q12677_q12713_summon_stefan : public SpellScrip { PrepareSpellScript(spell_q12661_q12669_q12676_q12677_q12713_summon_stefan_SpellScript); - void ChangeSummonPos(SpellEffIndex /*effIndex*/) + void SetDest(SpellDestination& dest) { // Adjust effect summon position - WorldLocation summonPos = *GetExplTargetDest(); - Position offset = { 0.0f, 0.0f, 20.0f, 0.0f }; - summonPos.RelocateOffset(offset); - SetExplTargetDest(summonPos); - GetHitDest()->RelocateOffset(offset); + Position const offset = { 0.0f, 0.0f, 20.0f, 0.0f }; + dest.RelocateOffset(offset); } void Register() OVERRIDE { - OnEffectHit += SpellEffectFn(spell_q12661_q12669_q12676_q12677_q12713_summon_stefan_SpellScript::ChangeSummonPos, EFFECT_0, SPELL_EFFECT_SUMMON); + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_q12661_q12669_q12676_q12677_q12713_summon_stefan_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER_BACK); } }; @@ -1723,6 +1721,7 @@ class spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy : public } }; +// 59303 - Summon Frost Wyrm class spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon : public SpellScriptLoader { public: @@ -1732,19 +1731,16 @@ class spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon : public S { PrepareSpellScript(spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon_SpellScript); - void ChangeSummonPos(SpellEffIndex /*effIndex*/) + void SetDest(SpellDestination& dest) { // Adjust effect summon position - WorldLocation summonPos = *GetExplTargetDest(); - Position offset = { 0.0f, 0.0f, 20.0f, 0.0f }; - summonPos.RelocateOffset(offset); - SetExplTargetDest(summonPos); - GetHitDest()->RelocateOffset(offset); + Position const offset = { 0.0f, 0.0f, 20.0f, 0.0f }; + dest.RelocateOffset(offset); } void Register() OVERRIDE { - OnEffectHit += SpellEffectFn(spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon_SpellScript::ChangeSummonPos, EFFECT_0, SPELL_EFFECT_SUMMON); + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER_BACK); } }; @@ -1754,6 +1750,7 @@ class spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon : public S } }; +// 12601 - Second Chances: Summon Landgren's Soul Moveto Target Bunny class spell_q12847_summon_soul_moveto_bunny : public SpellScriptLoader { public: @@ -1763,19 +1760,16 @@ class spell_q12847_summon_soul_moveto_bunny : public SpellScriptLoader { PrepareSpellScript(spell_q12847_summon_soul_moveto_bunny_SpellScript); - void ChangeSummonPos(SpellEffIndex /*effIndex*/) + void SetDest(SpellDestination& dest) { // Adjust effect summon position - WorldLocation summonPos = *GetExplTargetDest(); - Position offset = { 0.0f, 0.0f, 2.5f, 0.0f }; - summonPos.RelocateOffset(offset); - SetExplTargetDest(summonPos); - GetHitDest()->RelocateOffset(offset); + Position const offset = { 0.0f, 0.0f, 2.5f, 0.0f }; + dest.RelocateOffset(offset); } void Register() OVERRIDE { - OnEffectHit += SpellEffectFn(spell_q12847_summon_soul_moveto_bunny_SpellScript::ChangeSummonPos, EFFECT_0, SPELL_EFFECT_SUMMON); + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_q12847_summon_soul_moveto_bunny_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER); } }; @@ -2012,19 +2006,19 @@ class spell_q12308_escape_from_silverbrook_summon_worgen : public SpellScriptLoa { PrepareSpellScript(spell_q12308_escape_from_silverbrook_summon_worgen_SpellScript); - void ModDest(SpellEffIndex effIndex) + void ModDest(SpellDestination& dest) { - float dist = GetSpellInfo()->Effects[effIndex].CalcRadius(GetCaster()); - float angle = (urand(0, 1) ? -1 : 1) * (frand(0.75f, 1.0f) * M_PI); + float dist = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster()); + float angle = frand(0.75f, 1.25f) * M_PI; Position pos; GetCaster()->GetNearPosition(pos, dist, angle); - GetHitDest()->Relocate(&pos); + dest.Relocate(pos); } void Register() OVERRIDE { - OnEffectHit += SpellEffectFn(spell_q12308_escape_from_silverbrook_summon_worgen_SpellScript::ModDest, EFFECT_0, SPELL_EFFECT_SUMMON); + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_q12308_escape_from_silverbrook_summon_worgen_SpellScript::ModDest, EFFECT_0, TARGET_DEST_CASTER_SUMMON); } }; diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index f6386616b24..6c870bb55c4 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -25,6 +25,7 @@ #include "ScriptMgr.h" #include "SpellScript.h" #include "SpellAuraEffects.h" +#include "Containers.h" enum RogueSpells { @@ -33,6 +34,10 @@ enum RogueSpells SPELL_ROGUE_CHEAT_DEATH_COOLDOWN = 31231, SPELL_ROGUE_CRIPPLING_POISON = 3409, SPELL_ROGUE_GLYPH_OF_PREPARATION = 56819, + SPELL_ROGUE_KILLING_SPREE = 51690, + SPELL_ROGUE_KILLING_SPREE_TELEPORT = 57840, + SPELL_ROGUE_KILLING_SPREE_WEAPON_DMG = 57841, + SPELL_ROGUE_KILLING_SPREE_DMG_BUFF = 61851, SPELL_ROGUE_MASTER_OF_SUBTLETY_DAMAGE_PERCENT = 31665, SPELL_ROGUE_MASTER_OF_SUBTLETY_PASSIVE = 31223, SPELL_ROGUE_MASTER_OF_SUBTLETY_PERIODIC = 31666, @@ -333,6 +338,105 @@ class spell_rog_deadly_poison : public SpellScriptLoader } }; +// 51690 - Killing Spree +class spell_rog_killing_spree : public SpellScriptLoader +{ + public: + spell_rog_killing_spree() : SpellScriptLoader("spell_rog_killing_spree") { } + + class spell_rog_killing_spree_SpellScript : public SpellScript + { + PrepareSpellScript(spell_rog_killing_spree_SpellScript); + + void FilterTargets(std::list<WorldObject*>& targets) + { + if (targets.empty() || GetCaster()->GetVehicleBase()) + FinishCast(SPELL_FAILED_OUT_OF_RANGE); + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Aura* aura = GetCaster()->GetAura(SPELL_ROGUE_KILLING_SPREE)) + { + if (spell_rog_killing_spree_AuraScript* script = dynamic_cast<spell_rog_killing_spree_AuraScript*>(aura->GetScriptByName("spell_rog_killing_spree"))) + script->AddTarget(GetHitUnit()); + } + } + + void Register() OVERRIDE + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rog_killing_spree_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ENEMY); + OnEffectHitTarget += SpellEffectFn(spell_rog_killing_spree_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_rog_killing_spree_SpellScript(); + } + + class spell_rog_killing_spree_AuraScript : public AuraScript + { + PrepareAuraScript(spell_rog_killing_spree_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_KILLING_SPREE_TELEPORT) + || !sSpellMgr->GetSpellInfo(SPELL_ROGUE_KILLING_SPREE_WEAPON_DMG) + || !sSpellMgr->GetSpellInfo(SPELL_ROGUE_KILLING_SPREE_DMG_BUFF)) + return false; + return true; + } + + void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + GetTarget()->CastSpell(GetTarget(), SPELL_ROGUE_KILLING_SPREE_DMG_BUFF, true); + } + + void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) + { + while (!_targets.empty()) + { + uint64 guid = Trinity::Containers::SelectRandomContainerElement(_targets); + if (Unit* target = ObjectAccessor::GetUnit(*GetTarget(), guid)) + { + GetTarget()->CastSpell(target, SPELL_ROGUE_KILLING_SPREE_TELEPORT, true); + GetTarget()->CastSpell(target, SPELL_ROGUE_KILLING_SPREE_WEAPON_DMG, true); + break; + } + else + _targets.remove(guid); + } + } + + void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + GetTarget()->RemoveAurasDueToSpell(SPELL_ROGUE_KILLING_SPREE_DMG_BUFF); + } + + void Register() OVERRIDE + { + AfterEffectApply += AuraEffectApplyFn(spell_rog_killing_spree_AuraScript::HandleApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_rog_killing_spree_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + AfterEffectRemove += AuraEffectRemoveFn(spell_rog_killing_spree_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + + public: + void AddTarget(Unit* target) + { + _targets.push_back(target->GetGUID()); + } + + private: + std::list<uint64> _targets; + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_rog_killing_spree_AuraScript(); + } +}; + // 31666 - Master of Subtlety class spell_rog_master_of_subtlety : public SpellScriptLoader { @@ -863,6 +967,7 @@ void AddSC_rogue_spell_scripts() new spell_rog_crippling_poison(); new spell_rog_cut_to_the_chase(); new spell_rog_deadly_poison(); + new spell_rog_killing_spree(); new spell_rog_master_of_subtlety(); new spell_rog_nerves_of_steel(); new spell_rog_overkill(); diff --git a/src/server/shared/Debugging/WheatyExceptionReport.cpp b/src/server/shared/Debugging/WheatyExceptionReport.cpp index b4d57f065b0..fcbfa221d6a 100644 --- a/src/server/shared/Debugging/WheatyExceptionReport.cpp +++ b/src/server/shared/Debugging/WheatyExceptionReport.cpp @@ -355,7 +355,7 @@ void WheatyExceptionReport::PrintSystemInfo() } //=========================================================================== -void WheatyExceptionReport::printTracesForAllThreads() +void WheatyExceptionReport::printTracesForAllThreads(bool bWriteVariables) { THREADENTRY32 te32; @@ -391,7 +391,7 @@ void WheatyExceptionReport::printTracesForAllThreads() if (threadHandle) { if (GetThreadContext(threadHandle, &context)) - WriteStackDetails(&context, false, threadHandle); + WriteStackDetails(&context, bWriteVariables, threadHandle); CloseHandle(threadHandle); } } @@ -487,7 +487,7 @@ PEXCEPTION_POINTERS pExceptionInfo) CONTEXT trashableContext = *pCtx; WriteStackDetails(&trashableContext, false, NULL); - printTracesForAllThreads(); + printTracesForAllThreads(false); // #ifdef _M_IX86 // X86 Only! @@ -496,6 +496,7 @@ PEXCEPTION_POINTERS pExceptionInfo) trashableContext = *pCtx; WriteStackDetails(&trashableContext, true, NULL); + printTracesForAllThreads(true); _tprintf(_T("========================\r\n")); _tprintf(_T("Global Variables\r\n")); @@ -756,7 +757,7 @@ ULONG /*SymbolSize*/, PVOID UserContext) { - char szBuffer[4092]; + char szBuffer[8192]; __try { @@ -764,7 +765,7 @@ PVOID UserContext) szBuffer, sizeof(szBuffer))) _tprintf(_T("\t%s\r\n"), szBuffer); } - __except(1) + __except (EXCEPTION_EXECUTE_HANDLER) { _tprintf(_T("punting on symbol %s\r\n"), pSymInfo->Name); } @@ -824,7 +825,7 @@ unsigned /*cbBuffer*/) // will return true. bool bHandled; pszCurrBuffer = DumpTypeIndex(pszCurrBuffer, pSym->ModBase, pSym->TypeIndex, - 0, pVariable, bHandled, pSym->Name); + 0, pVariable, bHandled, pSym->Name, ""); if (!bHandled) { @@ -856,10 +857,15 @@ DWORD dwTypeIndex, unsigned nestingLevel, DWORD_PTR offset, bool & bHandled, -char* /*Name*/) +char* Name, +char* suffix) { bHandled = false; + DWORD typeTag; + if (!SymGetTypeInfo(m_hProcess, modBase, dwTypeIndex, TI_GET_SYMTAG, &typeTag)) + return pszCurrBuffer; + // Get the name of the symbol. This will either be a Type name (if a UDT), // or the structure member name. WCHAR * pwszTypeName; @@ -870,10 +876,58 @@ char* /*Name*/) LocalFree(pwszTypeName); } + if (strlen(suffix) > 0) + pszCurrBuffer += sprintf(pszCurrBuffer, "%s", suffix); + + switch (typeTag) + { + case SymTagPointerType: + DWORD innerTypeID; + if (SymGetTypeInfo(m_hProcess, modBase, dwTypeIndex, TI_GET_TYPEID, &innerTypeID)) + { + pszCurrBuffer += sprintf(pszCurrBuffer, " %s", Name); + BOOL isReference; + SymGetTypeInfo(m_hProcess, modBase, dwTypeIndex, TI_GET_IS_REFERENCE, &isReference); + + char addressStr[40]; + memset(addressStr, 0, sizeof(addressStr)); + + if (isReference) + addressStr[0] = '&'; + else + addressStr[0] = '*'; + + DWORD_PTR address = *(PDWORD_PTR)offset; + if (address == NULL) + { + pwszTypeName; + if (SymGetTypeInfo(m_hProcess, modBase, innerTypeID, TI_GET_SYMNAME, + &pwszTypeName)) + { + pszCurrBuffer += sprintf(pszCurrBuffer, " %ls", pwszTypeName); + LocalFree(pwszTypeName); + } + + pszCurrBuffer += sprintf(pszCurrBuffer, "%s = NULL", addressStr); + + bHandled = true; + return pszCurrBuffer; + } + else + { + FormatOutputValue(&addressStr[1], btVoid, sizeof(PVOID), (PVOID)offset); + pszCurrBuffer = DumpTypeIndex(pszCurrBuffer, modBase, innerTypeID, nestingLevel + 1, + address, bHandled, "", addressStr); + } + } + break; + default: + break; + } + // Determine how many children this type has. DWORD dwChildrenCount = 0; - SymGetTypeInfo(m_hProcess, modBase, dwTypeIndex, TI_GET_CHILDRENCOUNT, - &dwChildrenCount); + SymGetTypeInfo(m_hProcess, modBase, dwTypeIndex, TI_GET_CHILDRENCOUNT, &dwChildrenCount); if (!dwChildrenCount) // If no children, we're done return pszCurrBuffer; @@ -918,18 +972,21 @@ char* /*Name*/) BasicType basicType = GetBasicType(children.ChildId[i], modBase); pszCurrBuffer += sprintf(pszCurrBuffer, rgBaseType[basicType]); + // Get the offset of the child member, relative to its parent + DWORD dwMemberOffset; + SymGetTypeInfo(m_hProcess, modBase, children.ChildId[i], + TI_GET_OFFSET, &dwMemberOffset); + + // Calculate the address of the member + DWORD_PTR dwFinalOffset = offset + dwMemberOffset; + pszCurrBuffer = DumpTypeIndex(pszCurrBuffer, modBase, children.ChildId[i], nestingLevel+1, - offset, bHandled2, ""/*Name */); + dwFinalOffset, bHandled2, ""/*Name */, ""); // If the child wasn't a UDT, format it appropriately if (!bHandled2) { - // Get the offset of the child member, relative to its parent - DWORD dwMemberOffset; - SymGetTypeInfo(m_hProcess, modBase, children.ChildId[i], - TI_GET_OFFSET, &dwMemberOffset); - // Get the real "TypeId" of the child. We need this for the // SymGetTypeInfo(TI_GET_TYPEID) call below. DWORD typeId; @@ -940,9 +997,6 @@ char* /*Name*/) ULONG64 length; SymGetTypeInfo(m_hProcess, modBase, typeId, TI_GET_LENGTH, &length); - // Calculate the address of the member - DWORD_PTR dwFinalOffset = offset + dwMemberOffset; - // BasicType basicType = GetBasicType(children.ChildId[i], modBase); // // pszCurrBuffer += sprintf(pszCurrBuffer, rgBaseType[basicType]); @@ -966,41 +1020,52 @@ BasicType basicType, DWORD64 length, PVOID pAddress) { - // Format appropriately (assuming it's a 1, 2, or 4 bytes (!!!) - if (length == 1) - pszCurrBuffer += sprintf(pszCurrBuffer, " = %X", *(PBYTE)pAddress); - else if (length == 2) - pszCurrBuffer += sprintf(pszCurrBuffer, " = %X", *(PWORD)pAddress); - else if (length == 4) + __try { - if (basicType == btFloat) + // Format appropriately (assuming it's a 1, 2, or 4 bytes (!!!) + if (length == 1) + pszCurrBuffer += sprintf(pszCurrBuffer, " = %X", *(PBYTE)pAddress); + else if (length == 2) + pszCurrBuffer += sprintf(pszCurrBuffer, " = %X", *(PWORD)pAddress); + else if (length == 4) { - pszCurrBuffer += sprintf(pszCurrBuffer, " = %f", *(PFLOAT)pAddress); + if (basicType == btFloat) + { + pszCurrBuffer += sprintf(pszCurrBuffer, " = %f", *(PFLOAT)pAddress); + } + else if (basicType == btChar) + { + if (!IsBadStringPtr(*(PSTR*)pAddress, 32)) + { + pszCurrBuffer += sprintf(pszCurrBuffer, " = \"%.31s\"", + *(PSTR*)pAddress); + } + else + pszCurrBuffer += sprintf(pszCurrBuffer, " = %X", + *(PDWORD)pAddress); + } + else + pszCurrBuffer += sprintf(pszCurrBuffer, " = %X", *(PDWORD)pAddress); } - else if (basicType == btChar) + else if (length == 8) { - if (!IsBadStringPtr(*(PSTR*)pAddress, 32)) + if (basicType == btFloat) { - pszCurrBuffer += sprintf(pszCurrBuffer, " = \"%.31s\"", - *(PSTR*)pAddress); + pszCurrBuffer += sprintf(pszCurrBuffer, " = %lf", + *(double *)pAddress); } else - pszCurrBuffer += sprintf(pszCurrBuffer, " = %X", - *(PDWORD)pAddress); + pszCurrBuffer += sprintf(pszCurrBuffer, " = %I64X", + *(DWORD64*)pAddress); } - else - pszCurrBuffer += sprintf(pszCurrBuffer, " = %X", *(PDWORD)pAddress); } - else if (length == 8) + __except (EXCEPTION_EXECUTE_HANDLER) { - if (basicType == btFloat) - { - pszCurrBuffer += sprintf(pszCurrBuffer, " = %lf", - *(double *)pAddress); - } - else - pszCurrBuffer += sprintf(pszCurrBuffer, " = %I64X", - *(DWORD64*)pAddress); +#if _WIN64 + pszCurrBuffer += sprintf(pszCurrBuffer, " <Unable to read memory> = %I64X", (DWORD64*)pAddress); +#else + pszCurrBuffer += sprintf(pszCurrBuffer, " <Unable to read memory> = %X", (PDWORD)pAddress); +#endif } return pszCurrBuffer; @@ -1037,7 +1102,7 @@ WheatyExceptionReport::GetBasicType(DWORD typeIndex, DWORD64 modBase) //============================================================================ int __cdecl WheatyExceptionReport::_tprintf(const TCHAR * format, ...) { - TCHAR szBuff[4092]; + TCHAR szBuff[8192]; int retValue; DWORD cbWritten; va_list argptr; diff --git a/src/server/shared/Debugging/WheatyExceptionReport.h b/src/server/shared/Debugging/WheatyExceptionReport.h index a4ba69d3ff3..48894a5db91 100644 --- a/src/server/shared/Debugging/WheatyExceptionReport.h +++ b/src/server/shared/Debugging/WheatyExceptionReport.h @@ -81,7 +81,7 @@ class WheatyExceptionReport static LONG WINAPI WheatyUnhandledExceptionFilter( PEXCEPTION_POINTERS pExceptionInfo); - static void printTracesForAllThreads(); + static void printTracesForAllThreads(bool); private: // where report info is extracted and generated static void GenerateExceptionReport(PEXCEPTION_POINTERS pExceptionInfo); @@ -100,7 +100,7 @@ class WheatyExceptionReport static bool FormatSymbolValue(PSYMBOL_INFO, STACKFRAME64 *, char * pszBuffer, unsigned cbBuffer); - static char * DumpTypeIndex(char *, DWORD64, DWORD, unsigned, DWORD_PTR, bool &, char*); + static char * DumpTypeIndex(char *, DWORD64, DWORD, unsigned, DWORD_PTR, bool &, char*, char*); static char * FormatOutputValue(char * pszCurrBuffer, BasicType basicType, DWORD64 length, PVOID pAddress); |