chore(Core/Misc): Some cleanup (#19970)

* remove weird blanks

* update if

* ) ) to ))

* missed some ) )

* now switch

* .
This commit is contained in:
Kitzunu 2024-09-21 19:34:31 +02:00 committed by GitHub
parent 0ba59c0053
commit 386aea03ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
157 changed files with 1606 additions and 1616 deletions

View file

@ -279,7 +279,7 @@ bool DynamicMapTree::isInLineOfSight(float x1, float y1, float z1, float x2, flo
float maxDist = (v2 - v1).magnitude();
if (!G3D::fuzzyGt(maxDist, 0) )
if (!G3D::fuzzyGt(maxDist, 0))
{
return true;
}

View file

@ -418,7 +418,7 @@ namespace VMAP
std::string model_name(buff, name_length);
WorldModel_Raw raw_model;
if ( !raw_model.Read((iSrcDir + "/" + model_name).c_str()) )
if (!raw_model.Read((iSrcDir + "/" + model_name).c_str()))
{
continue;
}
@ -527,7 +527,7 @@ namespace VMAP
READ_OR_RETURN_WITH_DELETE(vectorarray, nvectors * sizeof(float) * 3);
for (uint32 i = 0; i < nvectors; ++i)
{
vertexArray.push_back( Vector3(vectorarray + 3 * i) );
vertexArray.push_back( Vector3(vectorarray + 3 * i));
}
delete[] vectorarray;

View file

@ -227,5 +227,4 @@ namespace VMAP
if (check != nameLen) { return false; }
return true;
}
}

View file

@ -237,7 +237,7 @@ namespace Acore
//{
// // The head element is bad
// SPECIFIC_TYPE* t = Remove(elements._elements, obj);
// return ( t != nullptr ? t : Remove(elements._TailElements, obj) );
// return ( t != nullptr ? t : Remove(elements._TailElements, obj));
//}
}
#endif

View file

@ -137,7 +137,7 @@ namespace Acore
template<class SPECIFIC_TYPE> bool Remove(ContainerMapList<SPECIFIC_TYPE>& elements, CountedPtr<SPECIFIC_TYPE>& obj, OBJECT_HANDLE hdl)
{
typename std::map<OBJECT_HANDLE, CountedPtr<SPECIFIC_TYPE>>::iterator iter = elements._element.find(hdl);
if ( iter != elements._element.end() )
if (iter != elements._element.end())
{
elements._element.erase(iter);
return true;
@ -163,6 +163,5 @@ namespace Acore
bool t = Remove(elements._elements, obj, hdl);
return ( !t ? Remove(elements._TailElements, obj, hdl) : t );
}
}
#endif

View file

@ -52,7 +52,7 @@ bool WinServiceInstall()
if (serviceControlMgr)
{
char path[_MAX_PATH + 10];
if (GetModuleFileName( 0, path, sizeof(path) / sizeof(path[0]) ) > 0)
if (GetModuleFileName( 0, path, sizeof(path) / sizeof(path[0])) > 0)
{
SC_HANDLE service;
std::strcat(path, " --service");
@ -170,7 +170,7 @@ void WINAPI ServiceControlHandler(DWORD controlCode)
break;
default:
if ( controlCode >= 128 && controlCode <= 255 )
if (controlCode >= 128 && controlCode <= 255)
// user defined control code
{
break;
@ -198,7 +198,7 @@ void WINAPI ServiceMain(DWORD argc, char* argv[])
serviceStatusHandle = RegisterServiceCtrlHandler(serviceName, ServiceControlHandler);
if ( serviceStatusHandle )
if (serviceStatusHandle)
{
char path[_MAX_PATH + 1];
unsigned int i, last_slash = 0;

View file

@ -90,7 +90,7 @@ std::string secsToTimeString(uint64 timeInSecs, bool shortText)
{
ss << minutes << (shortText ? "m" : " minute(s) ");
}
if (secs || (!days && !hours && !minutes) )
if (secs || (!days && !hours && !minutes))
{
ss << secs << (shortText ? "s" : " second(s) ");
}

View file

@ -256,7 +256,7 @@ void TurretAI::UpdateAI(uint32 /*diff*/)
if (!UpdateVictim())
return;
if( me->m_spells[0] )
if (me->m_spells[0])
DoSpellAttackIfReady(me->m_spells[0]);
}

View file

@ -1562,7 +1562,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
for (WorldObject* target : targets)
{
// xinef: allow gameobjects to summon gameobjects!
//if(!IsUnit((*itr)))
//if (!IsUnit((*itr)))
// continue;
target->GetPosition(x, y, z, o);

View file

@ -2352,7 +2352,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
LocaleConstant localeConstant = GetPlayer()->GetSession()->GetSessionDbLocaleIndex();
if (localeConstant != LOCALE_enUS)
{
if(AchievementRewardLocale const* loc = sAchievementMgr->GetAchievementRewardLocale(achievement))
if (AchievementRewardLocale const* loc = sAchievementMgr->GetAchievementRewardLocale(achievement))
{
ObjectMgr::GetLocaleString(loc->Subject, localeConstant, subject);
ObjectMgr::GetLocaleString(loc->Text, localeConstant, text);
@ -2539,7 +2539,7 @@ bool AchievementGlobalMgr::IsStatisticAchievement(AchievementEntry const* achiev
AchievementCategoryEntry const* cat = sAchievementCategoryStore.LookupEntry(achievement->categoryId);
do
{
switch(cat->ID)
switch (cat->ID)
{
case ACHIEVEMENT_CATEGORY_STATISTICS:
return true;

View file

@ -250,7 +250,7 @@ AuctionHouseObject* AuctionHouseMgr::GetAuctionsMapByHouseId(uint8 auctionHouseI
if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION))
return &_neutralAuctions;
switch(auctionHouseId)
switch (auctionHouseId)
{
case AUCTIONHOUSE_ALLIANCE:
return &_allianceAuctions;
@ -260,7 +260,6 @@ AuctionHouseObject* AuctionHouseMgr::GetAuctionsMapByHouseId(uint8 auctionHouseI
}
return &_neutralAuctions;
}
uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item* pItem, uint32 count)

View file

@ -64,7 +64,7 @@ void BattlefieldMgr::InitBattlefield()
/* For Cataclysm: Tol Barad
pBf = new BattlefieldTB;
// respawn, init variables
if(!pBf->SetupBattlefield())
if (!pBf->SetupBattlefield())
{
LOG_DEBUG("bg.battlefield", "Battlefield : Tol Barad init failed.");
delete pBf;

View file

@ -73,7 +73,7 @@ void BattlegroundNA::FillInitialWorldStates(WorldPacket& data)
bool BattlegroundNA::SetupBattleground()
{
// gates
if ( !AddObject(BG_NA_OBJECT_DOOR_1, BG_NA_OBJECT_TYPE_DOOR_1, 4031.854f, 2966.833f, 12.0462f, -2.648788f, 0, 0, 0.9697962f, -0.2439165f, RESPAWN_IMMEDIATELY)
if (!AddObject(BG_NA_OBJECT_DOOR_1, BG_NA_OBJECT_TYPE_DOOR_1, 4031.854f, 2966.833f, 12.0462f, -2.648788f, 0, 0, 0.9697962f, -0.2439165f, RESPAWN_IMMEDIATELY)
|| !AddObject(BG_NA_OBJECT_DOOR_2, BG_NA_OBJECT_TYPE_DOOR_2, 4081.179f, 2874.97f, 12.00171f, 0.4928045f, 0, 0, 0.2439165f, 0.9697962f, RESPAWN_IMMEDIATELY)
|| !AddObject(BG_NA_OBJECT_DOOR_3, BG_NA_OBJECT_TYPE_DOOR_3, 4023.709f, 2981.777f, 10.70117f, -2.648788f, 0, 0, 0.9697962f, -0.2439165f, RESPAWN_IMMEDIATELY)
|| !AddObject(BG_NA_OBJECT_DOOR_4, BG_NA_OBJECT_TYPE_DOOR_4, 4090.064f, 2858.438f, 10.23631f, 0.4928045f, 0, 0, 0.2439165f, 0.9697962f, RESPAWN_IMMEDIATELY)

View file

@ -589,7 +589,7 @@ void BattlegroundSA::DefendersPortalTeleport(GameObject* portal, Player* plr)
uint32 portal_num = 0;
//get it via X
switch( (uint32)portal->GetPositionX() )
switch ((uint32)portal->GetPositionX())
{
case 1394:
portal_num = 0;
@ -947,7 +947,7 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
uint32 npc = 0;
uint32 flag = 0;
switch(i)
switch (i)
{
case BG_SA_LEFT_CAPTURABLE_GY:
flag = BG_SA_LEFT_FLAG;

View file

@ -536,7 +536,7 @@ private:
uint32 GetGateIDFromEntry(uint32 id)
{
uint32 i = 0;
switch(id)
switch (id)
{
case 190722:
i = BG_SA_GREEN_GATE;

View file

@ -28,7 +28,7 @@ enum CalendarMailAnswers
{
// else
CALENDAR_EVENT_REMOVED_MAIL_SUBJECT = 0,
// if ( *(_DWORD *)(a1 + 8292) & 0x100 )
// if (*(_DWORD *)(a1 + 8292) & 0x100 )
CALENDAR_INVITE_REMOVED_MAIL_SUBJECT = 0x100
};

View file

@ -304,7 +304,7 @@ namespace lfg
//UpdateBestCompatibleInQueue(itQueue, strGuids);
AddToCompatibles(strGuids);
if (roleCheckResult && roleCheckResult <= 15)
foundMask |= ( (((uint64)1) << (roleCheckResult - 1)) | (((uint64)1) << (16 + roleCheckResult - 1)) | (((uint64)1) << (32 + roleCheckResult - 1)) | (((uint64)1) << (48 + roleCheckResult - 1)) );
foundMask |= ( (((uint64)1) << (roleCheckResult - 1)) | (((uint64)1) << (16 + roleCheckResult - 1)) | (((uint64)1) << (32 + roleCheckResult - 1)) | (((uint64)1) << (48 + roleCheckResult - 1)));
return LFG_COMPATIBLES_WITH_LESS_PLAYERS;
}

View file

@ -3609,10 +3609,10 @@ float Creature::GetAttackDistance(Unit const* player) const
if (creatureLevel + 5 <= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
{
// detect range auras
retDistance += static_cast<float>( GetTotalAuraModifier(SPELL_AURA_MOD_DETECT_RANGE) );
retDistance += static_cast<float>( GetTotalAuraModifier(SPELL_AURA_MOD_DETECT_RANGE));
// detected range auras
retDistance += static_cast<float>( player->GetTotalAuraModifier(SPELL_AURA_MOD_DETECTED_RANGE) );
retDistance += static_cast<float>( player->GetTotalAuraModifier(SPELL_AURA_MOD_DETECTED_RANGE));
}
// "Minimum Aggro Radius for a mob seems to be combat range (5 yards)"

View file

@ -1175,7 +1175,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4)));
}
switch(GetEntry())
switch (GetEntry())
{
case NPC_FELGUARD:
{

View file

@ -4684,7 +4684,7 @@ void Player::DurabilityLossAll(double percent, bool inventory)
void Player::DurabilityLoss(Item* item, double percent)
{
if(!item || percent == 0.0)
if (!item || percent == 0.0)
return;
uint32 pMaxDurability = item ->GetUInt32Value(ITEM_FIELD_MAXDURABILITY);
@ -10001,13 +10001,13 @@ void Player::RemoveSpellMods(Spell* spell)
spell->m_appliedMods.erase(iterMod);
// MAGE T8P4 BONUS
if( spellInfo->SpellFamilyName == SPELLFAMILY_MAGE )
if (spellInfo->SpellFamilyName == SPELLFAMILY_MAGE)
{
SpellInfo const* sp = mod->ownerAura->GetSpellInfo();
// Missile Barrage, Hot Streak, Brain Freeze (trigger spell - Fireball!)
if( sp->SpellIconID == 3261 || sp->SpellIconID == 2999 || sp->SpellIconID == 2938 )
if( AuraEffect* aurEff = GetAuraEffectDummy(64869) )
if( roll_chance_i(aurEff->GetAmount()) )
if (sp->SpellIconID == 3261 || sp->SpellIconID == 2999 || sp->SpellIconID == 2938)
if (AuraEffect* aurEff = GetAuraEffectDummy(64869))
if (roll_chance_i(aurEff->GetAmount()))
{
mod->charges = 1;
continue;
@ -15443,7 +15443,7 @@ void Player::PrepareCharmAISpells()
}
else if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE)
{
if( (int32)periodic_damage < CalculateSpellDamage(this, spellInfo, i) )
if ((int32)periodic_damage < CalculateSpellDamage(this, spellInfo, i))
{
m_charmAISpells[SPELL_DOT_DAMAGE] = spellInfo->Id;
break;

View file

@ -294,7 +294,7 @@ bool Player::CanCompleteQuest(uint32 quest_id, const QuestStatusData* q_savedSta
return false;
// Xinef: take seasonals into account
if(!qInfo->IsRepeatable() && !qInfo->IsSeasonal() && IsQuestRewarded(quest_id))
if (!qInfo->IsRepeatable() && !qInfo->IsSeasonal() && IsQuestRewarded(quest_id))
return false; // not allow re-complete quest
// auto complete quest

View file

@ -991,7 +991,7 @@ InventoryResult Player::CanStoreItem_InBag(uint8 bag, ItemPosCountVec& dest, Ite
// skip not existed bag or self targeted bag
Bag* pBag = GetBagByPos(bag);
if (!pBag || pBag == pSrcItem || (pSrcItem && (pSrcItem->GetGUID() == pBag->GetGUID())) )
if (!pBag || pBag == pSrcItem || (pSrcItem && (pSrcItem->GetGUID() == pBag->GetGUID())))
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
if (pSrcItem && pSrcItem->IsNotEmptyBag())
@ -1119,8 +1119,8 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& des
if (pItem)
{
// you bad chet0rz, wpe pro
if( bag == NULL_BAG && slot == NULL_SLOT )
if( pItem->IsBag() && pItem->IsNotEmptyBag() )
if (bag == NULL_BAG && slot == NULL_SLOT)
if (pItem->IsBag() && pItem->IsNotEmptyBag())
return EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS;
// Xinef: Removed next loot generated check
@ -7197,7 +7197,7 @@ void Player::_SaveAuras(CharacterDatabaseTransaction trans, bool logout)
continue;
Aura* aura = itr->second;
if( !logout && aura->GetDuration() < 60 * IN_MILLISECONDS )
if (!logout && aura->GetDuration() < 60 * IN_MILLISECONDS )
continue;
int32 damage[MAX_SPELL_EFFECTS];

View file

@ -237,7 +237,7 @@ void Player::UpdateResistances(uint32 school)
AuraEffectList const& mResbyIntellect = GetAuraEffectsByType(SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT);
for(AuraEffectList::const_iterator i = mResbyIntellect.begin(); i != mResbyIntellect.end(); ++i)
{
if((*i)->GetMiscValue() & (1 << (school - 1)) )
if ((*i)->GetMiscValue() & (1 << (school - 1)))
value += int32(GetStat(Stats((*i)->GetMiscValueB())) * (*i)->GetAmount() / 100.0f);
}
@ -923,7 +923,7 @@ void Player::ApplyHealthRegenBonus(int32 amount, bool apply)
void Player::UpdateManaRegen()
{
if( HasAuraTypeWithMiscvalue(SPELL_AURA_PREVENT_REGENERATE_POWER, POWER_MANA + 1) )
if (HasAuraTypeWithMiscvalue(SPELL_AURA_PREVENT_REGENERATE_POWER, POWER_MANA + 1))
{
SetStatFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER, 0);
SetStatFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER, 0);

View file

@ -2772,7 +2772,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(Unit const* victim, WeaponAttackTy
// Critical hit chance
float crit_chance = GetUnitCriticalChance(attType, victim);
if( crit_chance < 0 )
if (crit_chance < 0)
crit_chance = 0;
float dodge_chance = victim->GetUnitDodgeChance();
@ -4956,7 +4956,7 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId
if (Aura* noxious = Aura::TryCreate(aura->GetSpellInfo(), aura->GetEffectMask(), dispeller, caster))
{
noxious->SetDuration(aura->GetDuration() * aureff->GetAmount() / 100);
if (aura->GetUnitOwner() )
if (aura->GetUnitOwner())
if (const std::vector<int32>* spell_triggered = sSpellMgr->GetSpellLinked(-int32(aura->GetId())))
for (std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
aura->GetUnitOwner()->RemoveAurasDueToSpell(*itr);
@ -5691,7 +5691,7 @@ bool Unit::HasVisibleAuraType(AuraType auraType) const
{
AuraEffectList const& mAuraList = GetAuraEffectsByType(auraType);
for (AuraEffectList::const_iterator i = mAuraList.begin(); i != mAuraList.end(); ++i)
if( (*i)->GetBase()->CanBeSentToClient() )
if ((*i)->GetBase()->CanBeSentToClient())
return true;
return false;
@ -6221,7 +6221,7 @@ void Unit::RemoveGameObject(uint32 spellid, bool del)
}
go->SetOwnerGUID(ObjectGuid::Empty);
if(del)
if (del)
{
go->SetRespawnTime(0);
go->Delete();
@ -6236,7 +6236,7 @@ void Unit::RemoveAllGameObjects()
while(!m_gameObj.empty())
{
GameObject* go = ObjectAccessor::GetGameObject(*this, *m_gameObj.begin());
if(go)
if (go)
{
go->SetOwnerGUID(ObjectGuid::Empty);
go->SetRespawnTime(0);
@ -7537,7 +7537,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
}
case SPELLFAMILY_ROGUE:
{
switch(dummySpell->Id)
switch (dummySpell->Id)
{
// Glyph of Backstab
case 56800:
@ -7546,7 +7546,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
if (AuraEffect* aurEff = victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x100000, 0, 0, GetGUID()))
if (Aura* aur = aurEff->GetBase())
if (!aur->IsRemoved() && aur->GetDuration() > 0)
if ((aur->GetApplyTime() + aur->GetMaxDuration() / 1000 + 5) > (GameTime::GetGameTime().count() + aur->GetDuration() / 1000) )
if ((aur->GetApplyTime() + aur->GetMaxDuration() / 1000 + 5) > (GameTime::GetGameTime().count() + aur->GetDuration() / 1000))
{
aur->SetDuration(aur->GetDuration() + 2000);
return true;
@ -7565,7 +7565,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
}
}
// Master of subtlety
if( dummySpell->SpellIconID == 2114 )
if (dummySpell->SpellIconID == 2114)
{
triggered_spell_id = 31665;
basepoints0 = triggerAmount;
@ -8317,7 +8317,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
// Lightning Overload
if (dummySpell->SpellIconID == 2018) // only this spell have SpellFamily Shaman SpellIconID == 2018 and dummy aura
{
if(!procSpell || !IsPlayer() || !victim)
if (!procSpell || !IsPlayer() || !victim)
return false;
if (procEx & PROC_EX_CRITICAL_HIT)
@ -8548,7 +8548,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
basepoints0 = triggerEntry->Effects[EFFECT_0].BasePoints * 2;
SetCantProc(true);
if(basepoints0)
if (basepoints0)
CastCustomSpell(target, triggered_spell_id, &basepoints0, nullptr, nullptr, true, castItem, triggeredByAura, originalCaster);
else
CastSpell(target, triggered_spell_id, true, castItem, triggeredByAura, originalCaster);
@ -8688,7 +8688,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
AddSpellCooldown(cooldown_spell_id, 0, cooldown);
}
if(basepoints0)
if (basepoints0)
CastCustomSpell(target, triggered_spell_id, &basepoints0, nullptr, nullptr, true, castItem, triggeredByAura, originalCaster);
else
CastSpell(target, triggered_spell_id, true, castItem, triggeredByAura, originalCaster);
@ -9586,7 +9586,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
{
if (cooldown)
{
if (pTarget->HasSpellCooldown(trigger_spell_id) )
if (pTarget->HasSpellCooldown(trigger_spell_id))
return false;
pTarget->AddSpellCooldown(trigger_spell_id, 0, cooldown);
}
@ -9622,7 +9622,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
// Ruby Drake, Evasive Aura
case 50241:
{
if( GetAura(50240) )
if (GetAura(50240))
return false;
break;
@ -9812,7 +9812,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
AddSpellCooldown(triggerEntry->Id, 0, cooldown);
}
if(basepoints0)
if (basepoints0)
CastCustomSpell(target, triggerEntry->Id, &basepoints0, nullptr, nullptr, true, castItem, triggeredByAura);
else
CastSpell(target, triggerEntry->Id, true, castItem, triggeredByAura);
@ -10466,11 +10466,11 @@ void Unit::ModifyAuraState(AuraStateType flag, bool apply)
Unit::AuraMap& tAuras = GetOwnedAuras();
for (Unit::AuraMap::iterator itr = tAuras.begin(); itr != tAuras.end(); ++itr)
{
if( (*itr).second->IsRemoved() )
if ((*itr).second->IsRemoved())
continue;
if( (*itr).second->GetSpellInfo()->CasterAuraState == flag )
if( AuraApplication* aurApp = (*itr).second->GetApplicationOfTarget(GetGUID()) )
if ((*itr).second->GetSpellInfo()->CasterAuraState == flag )
if (AuraApplication* aurApp = (*itr).second->GetApplicationOfTarget(GetGUID()))
(*itr).second->HandleAllEffects(aurApp, AURA_EFFECT_HANDLE_REAL, true);
}
}
@ -10486,8 +10486,8 @@ void Unit::ModifyAuraState(AuraStateType flag, bool apply)
Unit::AuraMap& tAuras = GetOwnedAuras();
for (Unit::AuraMap::iterator itr = tAuras.begin(); itr != tAuras.end(); ++itr)
{
if( (*itr).second->GetSpellInfo()->CasterAuraState == flag )
if( AuraApplication* aurApp = (*itr).second->GetApplicationOfTarget(GetGUID()) )
if ((*itr).second->GetSpellInfo()->CasterAuraState == flag )
if (AuraApplication* aurApp = (*itr).second->GetApplicationOfTarget(GetGUID()))
(*itr).second->HandleAllEffects(aurApp, AURA_EFFECT_HANDLE_REAL, false);
}
}
@ -11383,7 +11383,7 @@ float Unit::SpellPctDamageModsDone(Unit* victim, SpellInfo const* spellProto, Da
// Merciless Combat
if ((*i)->GetSpellInfo()->SpellIconID == 2656)
{
if( (spellProto && spellProto->SpellFamilyFlags[0] & 0x2) || spellProto->SpellFamilyFlags[1] & 0x2 )
if ((spellProto && spellProto->SpellFamilyFlags[0] & 0x2) || spellProto->SpellFamilyFlags[1] & 0x2 )
if (!victim->HealthAbovePct(35))
AddPct(DoneTotalMod, (*i)->GetAmount());
}
@ -12463,7 +12463,7 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
// Check for table values
SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id);
if(bonus)
if (bonus)
{
if (damagetype == DOT)
{
@ -12711,7 +12711,7 @@ bool Unit::IsImmunedToDamage(SpellSchoolMask meleeSchoolMask) const
// If m_immuneToDamage type contain magic, IMMUNE damage.
SpellImmuneList const& damageList = m_spellImmune[IMMUNITY_DAMAGE];
for (SpellImmuneList::const_iterator itr = damageList.begin(); itr != damageList.end(); ++itr)
if((itr->type & meleeSchoolMask) == meleeSchoolMask)
if ((itr->type & meleeSchoolMask) == meleeSchoolMask)
return true;
return false;
@ -12743,7 +12743,7 @@ bool Unit::IsImmunedToDamage(SpellInfo const* spellInfo) const
// If m_immuneToDamage type contain magic, IMMUNE damage.
SpellImmuneList const& damageList = m_spellImmune[IMMUNITY_DAMAGE];
for (SpellImmuneList::const_iterator itr = damageList.begin(); itr != damageList.end(); ++itr)
if((itr->type & schoolMask) == schoolMask)
if ((itr->type & schoolMask) == schoolMask)
return true;
return false;
@ -12796,7 +12796,7 @@ bool Unit::IsImmunedToSchool(SpellSchoolMask meleeSchoolMask) const
// If m_immuneToSchool type contain this school type, IMMUNE damage.
SpellImmuneList const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
for (SpellImmuneList::const_iterator itr = schoolList.begin(); itr != schoolList.end(); ++itr)
if((itr->type & meleeSchoolMask) == meleeSchoolMask)
if ((itr->type & meleeSchoolMask) == meleeSchoolMask)
return true;
return false;
@ -12818,7 +12818,7 @@ bool Unit::IsImmunedToSchool(SpellInfo const* spellInfo) const
// If m_immuneToSchool type contain this school type, IMMUNE damage.
SpellImmuneList const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
for (SpellImmuneList::const_iterator itr = schoolList.begin(); itr != schoolList.end(); ++itr)
if((itr->type & schoolMask) == schoolMask && !spellInfo->CanPierceImmuneAura(sSpellMgr->GetSpellInfo(itr->spellId)))
if ((itr->type & schoolMask) == schoolMask && !spellInfo->CanPierceImmuneAura(sSpellMgr->GetSpellInfo(itr->spellId)))
return true;
}
@ -13897,7 +13897,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo
{
Player* owner = GetAffectingPlayer();
Unit const* const thisUnit = owner ? owner : this;
if (!(target->IsPlayer() && thisUnit->IsPlayer()) &&
if (!(target->IsPlayer() && thisUnit->IsPlayer()) &&
!(target->IsCreature() && thisUnit->IsCreature()))
{
Player const* player = target->IsPlayer() ? target->ToPlayer() : thisUnit->ToPlayer();
@ -15385,7 +15385,7 @@ float Unit::GetTotalAttackPowerValue(WeaponAttackType attType, Unit* victim) con
if (attType == RANGED_ATTACK)
{
int32 ap = GetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER) + GetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER_MODS);
if( victim )
if (victim)
ap += victim->GetTotalAuraModifier(SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS);
if (ap < 0)
@ -15395,7 +15395,7 @@ float Unit::GetTotalAttackPowerValue(WeaponAttackType attType, Unit* victim) con
else
{
int32 ap = GetInt32Value(UNIT_FIELD_ATTACK_POWER) + GetInt32Value(UNIT_FIELD_ATTACK_POWER_MODS);
if( victim )
if (victim)
ap += victim->GetTotalAuraModifier(SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS);
if (ap < 0)

View file

@ -702,7 +702,6 @@ void ObjectMgr::LoadCreatureTemplate(Field* fields, bool triggerHook)
{
sScriptMgr->OnAfterDatabaseLoadCreatureTemplates(_creatureTemplateStoreFast);
}
}
void ObjectMgr::LoadCreatureTemplateModels()

View file

@ -838,8 +838,8 @@ namespace Acore
FriendlyMissingBuffInRange(Unit const* obj, float range, uint32 spellid) : i_obj(obj), i_range(range)
{
i_spell = spellid;
if( SpellInfo const* spell = sSpellMgr->GetSpellInfo(spellid) )
if( SpellInfo const* newSpell = sSpellMgr->GetSpellForDifficultyFromSpell(spell, const_cast<Unit*>(obj)) )
if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(spellid))
if (SpellInfo const* newSpell = sSpellMgr->GetSpellForDifficultyFromSpell(spell, const_cast<Unit*>(obj)))
i_spell = newSpell->Id;
}
bool operator()(Unit* u)

View file

@ -1573,7 +1573,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
ItemPosCountVec dest;
InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, roll->itemid, item->count);
if(msg == EQUIP_ERR_OK)
if (msg == EQUIP_ERR_OK)
{
player->AutoStoreLoot(pProto->DisenchantID, LootTemplates_Disenchant, true);
}

View file

@ -241,7 +241,7 @@ void Guild::BankEventLogEntry::WritePacket(WorldPackets::Guild::GuildBankLogQuer
bankLogEntry.TimeOffset = int32(GameTime::GetGameTime().count() - m_timestamp);
bankLogEntry.EntryType = int8(m_eventType);
switch(m_eventType)
switch (m_eventType)
{
case GUILD_BANK_LOG_DEPOSIT_ITEM:
case GUILD_BANK_LOG_WITHDRAW_ITEM:

View file

@ -1160,7 +1160,7 @@ void WorldSession::HandleGroupSwapSubGroupOpcode(WorldPacket& recv_data)
ObjectGuid guid1 = getGuid(playerName1);
ObjectGuid guid2 = getGuid(playerName2);
if(!guid1 || !guid2)
if (!guid1 || !guid2)
{
SendPartyResult(PARTY_OP_SWAP, playerName1, ERR_GROUP_SWAP_FAILED);
return;

View file

@ -319,7 +319,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData)
needItemDelay = GetAccountId() != rc_account;
}
if( money >= 10 * GOLD )
if (money >= 10 * GOLD)
{
CleanStringForMysqlQuery(subject);
CharacterDatabase.Execute("INSERT INTO log_money VALUES({}, {}, \"{}\", \"{}\", {}, \"{}\", {}, \"{}\", NOW(), {})",
@ -551,7 +551,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket& recvData)
.AddMoney(m->COD)
.SendMailTo(trans, MailReceiver(sender, m->sender), MailSender(MAIL_NORMAL, m->receiver), MAIL_CHECK_MASK_COD_PAYMENT);
if( m->COD >= 10 * GOLD )
if (m->COD >= 10 * GOLD)
{
std::string senderName;
if (!sCharacterCache->GetCharacterNameByGuid(ObjectGuid(HighGuid::Player, m->sender), senderName))

View file

@ -1707,7 +1707,7 @@ void WorldSession::HandleHearthAndResurrect(WorldPacket& /*recv_data*/)
if (_player->IsInFlight())
return;
if(Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId()))
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId()))
{
bf->PlayerAskToLeave(_player);
return;

View file

@ -462,7 +462,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe
spell->SendPetCastResult(SPELL_FAILED_DONT_REPORT);
if (!pet->HasSpellCooldown(spellId))
if(pet->ToPet())
if (pet->ToPet())
pet->ToPet()->RemoveSpellCooldown(spellId, true);
spell->finish(false);

View file

@ -375,7 +375,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
if (mover->IsPlayer())
{
// not have spell in spellbook or spell passive and not casted by client
if( !(spellInfo->Targets & TARGET_FLAG_GAMEOBJECT_ITEM) && (!mover->ToPlayer()->HasActiveSpell(spellId) || spellInfo->IsPassive()) )
if (!(spellInfo->Targets & TARGET_FLAG_GAMEOBJECT_ITEM) && (!mover->ToPlayer()->HasActiveSpell(spellId) || spellInfo->IsPassive()))
{
bool allow = false;
@ -411,7 +411,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
if (seat->m_flags & VEHICLE_SEAT_FLAG_CAN_ATTACK || spellInfo->Effects[EFFECT_0].Effect == SPELL_EFFECT_OPEN_LOCK /*allow looting from vehicle, but only if player has required spell (all necessary opening spells are in playercreateinfo_spell)*/)
if ((mover->IsCreature() && !mover->ToCreature()->HasSpell(spellId)) || spellInfo->IsPassive()) // the creature can't cast that spell, check player instead
{
if( !(spellInfo->Targets & TARGET_FLAG_GAMEOBJECT_ITEM) && (!_player->HasActiveSpell (spellId) || spellInfo->IsPassive()) )
if (!(spellInfo->Targets & TARGET_FLAG_GAMEOBJECT_ITEM) && (!_player->HasActiveSpell (spellId) || spellInfo->IsPassive()))
{
//cheater? kick? ban?
recvPacket.rfinish(); // prevent spam at ignore packet

View file

@ -462,12 +462,12 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/)
// execute trade: 2. store
moveItems(myItems, hisItems);
if( my_trade->GetMoney() >= 10 * GOLD )
if (my_trade->GetMoney() >= 10 * GOLD )
{
CharacterDatabase.Execute("INSERT INTO log_money VALUES({}, {}, \"{}\", \"{}\", {}, \"{}\", {}, \"goods\", NOW(), {})",
GetAccountId(), _player->GetGUID().GetCounter(), _player->GetName(), GetRemoteAddress(), trader->GetSession()->GetAccountId(), trader->GetName(), my_trade->GetMoney(), 6);
}
if( his_trade->GetMoney() >= 10 * GOLD )
if (his_trade->GetMoney() >= 10 * GOLD )
{
CharacterDatabase.Execute("INSERT INTO log_money VALUES({}, {}, \"{}\", \"{}\", {}, \"{}\", {}, \"goods\", NOW(), {})",
trader->GetSession()->GetAccountId(), trader->GetGUID().GetCounter(), trader->GetName(), trader->GetSession()->GetRemoteAddress(), GetAccountId(), _player->GetName(), his_trade->GetMoney(), 6);

View file

@ -301,5 +301,4 @@ namespace Movement
return str.str();
}
}

View file

@ -205,7 +205,6 @@ namespace Movement
void set_length(index_type i, length_type length) { lengths[i] = length;}
void clear();
};
}
#include "SplineImpl.h"

View file

@ -92,5 +92,4 @@ namespace Movement
SplineBase::clear();
lengths.clear();
}
}

View file

@ -299,7 +299,6 @@ void OutdoorPvP::HandlePlayerLeaveZone(Player* player, uint32 /*zone*/)
void OutdoorPvP::HandlePlayerResurrects(Player* /*player*/, uint32 /*zone*/)
{
}
bool OutdoorPvP::Update(uint32 diff)

View file

@ -55,7 +55,6 @@ void ScriptMgr::OnBeforeCreatureSelectLevel(const CreatureTemplate* cinfo, Creat
{
script->OnBeforeCreatureSelectLevel(cinfo, creature, level);
});
}
void ScriptMgr::Creature_SelectLevel(const CreatureTemplate* cinfo, Creature* creature)

View file

@ -988,7 +988,7 @@ void WorldSession::ReadMovementInfo(WorldPacket& data, MovementInfo* mi)
if (mi->HasMovementFlag(MOVEMENTFLAG_SPLINE_ELEVATION))
data >> mi->splineElevation;
//! Anti-cheat checks. Please keep them in seperate if() blocks to maintain a clear overview.
//! Anti-cheat checks. Please keep them in seperate if () blocks to maintain a clear overview.
//! Might be subject to latency, so just remove improper flags.
#ifdef ACORE_DEBUG
#define REMOVE_VIOLATING_FLAGS(check, maskToRemove) \

View file

@ -1058,7 +1058,7 @@ float AuraEffect::CalcPeriodicCritChance(Unit const* caster, Unit const* target)
}
}
switch(GetSpellInfo()->SpellFamilyName)
switch (GetSpellInfo()->SpellFamilyName)
{
// Rupture - since 3.3.3 can crit
case SPELLFAMILY_ROGUE:
@ -5603,7 +5603,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
{
if (Battleground* bg = target->ToPlayer()->GetBattleground())
bg->RemovePlayerFromResurrectQueue(target->ToPlayer());
if(Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetZoneId()))
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetZoneId()))
bf->RemovePlayerFromResurrectQueue(target->GetGUID());
}
break;
@ -5623,7 +5623,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
// Halls of Lightning, Arc Lightning
case 52921:
{
if( aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE )
if (aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE )
return;
Player* player = nullptr;
@ -5631,7 +5631,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
Acore::PlayerSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(target, player, checker);
Cell::VisitWorldObjects(target, searcher, 10.0f);
if( player && player->GetGUID() != target->GetGUID() )
if (player && player->GetGUID() != target->GetGUID())
target->CastSpell(player, 52921, true);
return;
@ -6488,7 +6488,7 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster)
{
if (caster)
if (Unit* victim = caster->GetVictim())
if(victim->GetDistance(caster) < 45.0f)
if (victim->GetDistance(caster) < 45.0f)
{
target = victim;
break;

View file

@ -1613,7 +1613,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
case SPELLFAMILY_GENERIC:
if (!caster)
break;
switch(GetId())
switch (GetId())
{
case 61987: // Avenging Wrath
// Remove the immunity shield marker on Avenging Wrath removal if Forbearance is not present
@ -2010,7 +2010,7 @@ bool Aura::IsAuraStronger(Aura const* newAura) const
return true;
if (curValue == std::abs(newEffect->GetAmount()))
if(!IsPassive() && !IsPermanent() && GetDuration() < newAura->GetDuration())
if (!IsPassive() && !IsPermanent() && GetDuration() < newAura->GetDuration())
return true;
}
}

View file

@ -3069,7 +3069,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
{
// for delayed spells ignore negative spells (after duel end) for friendly targets
/// @todo: this cause soul transfer bugged
if(!IsTriggered() && m_spellInfo->Speed > 0.0f && unit->IsPlayer() && !m_spellInfo->IsPositive())
if (!IsTriggered() && m_spellInfo->Speed > 0.0f && unit->IsPlayer() && !m_spellInfo->IsPositive())
return SPELL_MISS_EVADE;
// assisting case, healing and resurrection
@ -3248,7 +3248,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
HandleEffects(unit, nullptr, nullptr, effectNumber, SPELL_EFFECT_HANDLE_HIT_TARGET);
}
if( sanct_effect >= 0 && (effectMask & (1 << sanct_effect)) )
if (sanct_effect >= 0 && (effectMask & (1 << sanct_effect)))
HandleEffects(unit, nullptr, nullptr, sanct_effect, SPELL_EFFECT_HANDLE_HIT_TARGET);
return SPELL_MISS_NONE;
@ -3275,7 +3275,7 @@ void Spell::DoTriggersOnSpellHit(Unit* unit, uint8 effMask)
m_caster->CastSpell(unit, 61988, true);
// Fearie Fire (Feral) - damage
if( m_preCastSpell == 60089 )
if (m_preCastSpell == 60089)
m_caster->CastSpell(unit, m_preCastSpell, true);
else if (sSpellMgr->GetSpellInfo(m_preCastSpell))
// Blizz seems to just apply aura without bothering to cast
@ -6540,24 +6540,24 @@ SpellCastResult Spell::CheckCast(bool strict)
}
case SPELL_EFFECT_STEAL_BENEFICIAL_BUFF:
{
if( !m_targets.GetUnitTarget() || m_targets.GetUnitTarget() == m_caster)
if (!m_targets.GetUnitTarget() || m_targets.GetUnitTarget() == m_caster)
return SPELL_FAILED_BAD_TARGETS;
bool found = false;
Unit::VisibleAuraMap const* visibleAuras = m_targets.GetUnitTarget()->GetVisibleAuras();
for(Unit::VisibleAuraMap::const_iterator itr = visibleAuras->begin(); itr != visibleAuras->end(); ++itr)
{
if( itr->second->GetBase()->IsPassive() )
if (itr->second->GetBase()->IsPassive())
continue;
if( !itr->second->IsPositive() )
if (!itr->second->IsPositive())
continue;
found = true;
break;
}
if( !found )
if (!found)
return SPELL_FAILED_NOTHING_TO_STEAL;
break;
@ -8757,17 +8757,17 @@ void Spell::PrepareTriggersExecutedOnHit()
{
case SPELLFAMILY_PALADIN:
{
if( m_spellInfo->SpellFamilyFlags[1] & 0x40000000 )
if (m_spellInfo->SpellFamilyFlags[1] & 0x40000000)
{
Unit::AuraEffectList const& mVindication = m_caster->GetAuraEffectsByType(SPELL_AURA_PROC_TRIGGER_SPELL);
for(Unit::AuraEffectList::const_iterator itr = mVindication.begin(); itr != mVindication.end(); ++itr)
{
if( (*itr)->GetSpellInfo()->Effects[EFFECT_0].TriggerSpell == 26017 )
if ((*itr)->GetSpellInfo()->Effects[EFFECT_0].TriggerSpell == 26017 )
{
m_preCastSpell = 26017;
break;
}
else if( (*itr)->GetSpellInfo()->Effects[EFFECT_0].TriggerSpell == 67 )
else if ((*itr)->GetSpellInfo()->Effects[EFFECT_0].TriggerSpell == 67 )
m_preCastSpell = 67;
}
}
@ -8776,7 +8776,7 @@ void Spell::PrepareTriggersExecutedOnHit()
case SPELLFAMILY_DRUID:
{
// Faerie Fire (Feral)
if( m_spellInfo->Id == 16857 && (m_caster->GetShapeshiftForm() == FORM_BEAR || m_caster->GetShapeshiftForm() == FORM_DIREBEAR) )
if (m_spellInfo->Id == 16857 && (m_caster->GetShapeshiftForm() == FORM_BEAR || m_caster->GetShapeshiftForm() == FORM_DIREBEAR))
m_preCastSpell = 60089;
break;

View file

@ -681,16 +681,16 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
// Trial of the Champion, Trample
case 67866:
{
if( unitTarget && !unitTarget->IsVehicle() && !unitTarget->GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID) )
if (unitTarget && !unitTarget->IsVehicle() && !unitTarget->GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID))
unitTarget->CastSpell(unitTarget, 67867, false);
return;
}
// Trial of the Champion, Hammer of the Righteous
case 66867:
{
if( !unitTarget )
if (!unitTarget)
return;
if( unitTarget->HasAura(66940) )
if (unitTarget->HasAura(66940))
m_caster->CastSpell(unitTarget, 66903, true);
else
m_caster->CastSpell(unitTarget, 66904, true);
@ -699,12 +699,12 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
case 17731:
case 69294:
{
if( !gameObjTarget || gameObjTarget->GetRespawnTime() > GameTime::GetGameTime().count() )
if (!gameObjTarget || gameObjTarget->GetRespawnTime() > GameTime::GetGameTime().count())
return;
gameObjTarget->SetRespawnTime(10);
gameObjTarget->SendCustomAnim(gameObjTarget->GetGoAnimProgress());
if( Creature* trigger = gameObjTarget->SummonCreature(12758, *gameObjTarget, TEMPSUMMON_TIMED_DESPAWN, 1000) )
if (Creature* trigger = gameObjTarget->SummonCreature(12758, *gameObjTarget, TEMPSUMMON_TIMED_DESPAWN, 1000))
trigger->CastSpell(trigger, 17731, false);
return;
@ -712,7 +712,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
// HoL, Arc Weld
case 59086:
{
if( m_caster && m_caster->IsPlayer() && m_caster->ToPlayer()->isMoving() )
if (m_caster && m_caster->IsPlayer() && m_caster->ToPlayer()->isMoving())
m_caster->CastSpell(m_caster, 59097, true);
return;
@ -753,7 +753,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
break;
case SPELLFAMILY_ROGUE:
// Hunger for Blood
if( m_spellInfo->Id == 51662 )
if (m_spellInfo->Id == 51662)
{
m_caster->CastSpell(m_caster, 63848, true);
return;
@ -3126,7 +3126,7 @@ void Spell::EffectSummonPet(SpellEffIndex effIndex)
uint32 petentry = m_spellInfo->Effects[effIndex].MiscValue;
int32 duration = m_spellInfo->GetDuration();
if(Player* modOwner = m_originalCaster->GetSpellModOwner())
if (Player* modOwner = m_originalCaster->GetSpellModOwner())
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration);
Player* owner = m_originalCaster->ToPlayer();
@ -3448,7 +3448,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
case SPELLFAMILY_HUNTER:
{
// Kill Shot
if( m_spellInfo->SpellFamilyFlags[1] & 0x800000 )
if (m_spellInfo->SpellFamilyFlags[1] & 0x800000)
{
spell_bonus += int32(m_caster->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.4f);
}
@ -3469,7 +3469,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
{
float disease_amt = m_spellInfo->Effects[EFFECT_2].CalcValue();
//Death Knight T8 Melee 4P Bonus
if (AuraEffect* aurEff = m_caster->GetAuraEffectDummy(64736) )
if (AuraEffect* aurEff = m_caster->GetAuraEffectDummy(64736))
AddPct(disease_amt, aurEff->GetAmount());
AddPct(totalDamagePercentMod, disease_amt * unitTarget->GetDiseasesByCaster(m_caster->GetGUID()) / 2.0f);
@ -3501,7 +3501,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
float disease_amt = m_spellInfo->Effects[EFFECT_2].CalcValue();
//Death Knight T8 Melee 4P Bonus
if (AuraEffect* aurEff = m_caster->GetAuraEffectDummy(64736) )
if (AuraEffect* aurEff = m_caster->GetAuraEffectDummy(64736))
AddPct(disease_amt, aurEff->GetAmount());
AddPct(totalDamagePercentMod, disease_amt * unitTarget->GetDiseasesByCaster(m_caster->GetGUID(), consumeDiseases) / 2.0f);
@ -3520,7 +3520,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
{
float disease_amt = m_spellInfo->Effects[EFFECT_2].CalcValue();
//Death Knight T8 Melee 4P Bonus
if (AuraEffect* aurEff = m_caster->GetAuraEffectDummy(64736) )
if (AuraEffect* aurEff = m_caster->GetAuraEffectDummy(64736))
AddPct(disease_amt, aurEff->GetAmount());
AddPct(totalDamagePercentMod, disease_amt * unitTarget->GetDiseasesByCaster(m_caster->GetGUID()));
@ -3945,7 +3945,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
}
case 61263: // for item Intravenous Healing Potion (44698)
{
if( !m_caster || !unitTarget )
if (!m_caster || !unitTarget)
return;
m_caster->CastSpell(m_caster, 61267, true);
@ -3957,16 +3957,16 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
}
case SPELLFAMILY_ROGUE:
{
switch( m_spellInfo->Id )
switch (m_spellInfo->Id)
{
// Master of Subtlety
case 31666:
{
if( !unitTarget )
if (!unitTarget)
return;
Aura* mos = unitTarget->GetAura(31665);
if( mos )
if (mos)
{
mos->SetMaxDuration(6000);
mos->SetDuration(6000, true);
@ -3977,11 +3977,11 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
// Overkill
case 58428:
{
if( !unitTarget )
if (!unitTarget)
return;
Aura* overkill = unitTarget->GetAura(58427);
if( overkill )
if (overkill)
{
overkill->SetMaxDuration(20000);
overkill->SetDuration(20000, true);

View file

@ -3038,7 +3038,7 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
{
if (spellInfo->Effects[j].Effect)
{
switch(spellInfo->Effects[j].Effect)
switch (spellInfo->Effects[j].Effect)
{
case SPELL_EFFECT_SCHOOL_DAMAGE:
case SPELL_EFFECT_WEAPON_DAMAGE:
@ -3503,7 +3503,7 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
{
if (spellInfo->Effects[j].ApplyAuraName && spellInfo->Effects[j].TriggerSpell)
{
switch(spellInfo->Effects[j].ApplyAuraName)
switch (spellInfo->Effects[j].ApplyAuraName)
{
case SPELL_AURA_PERIODIC_TRIGGER_SPELL:
case SPELL_AURA_PERIODIC_TRIGGER_SPELL_FROM_CLIENT:

View file

@ -194,7 +194,7 @@ public:
_events.Update(diff);
switch(_events.ExecuteEvent())
switch (_events.ExecuteEvent())
{
case EVENT_SPELL_FIREBLAST:
DoCastVictim(SPELL_FIREBLAST);

View file

@ -218,7 +218,7 @@ public:
_events.Update(diff);
switch(_events.ExecuteEvent())
switch (_events.ExecuteEvent())
{
case EVENT_SPELL_SHADOWBOLTVOLLEY:
DoCastVictim(SPELL_SHADOWBOLTVOLLEY);

View file

@ -456,7 +456,7 @@ public:
{
case TYPE_RING_OF_LAW:
encounter[0] = data;
switch(data)
switch (data)
{
case IN_PROGRESS:
TempSummonGrimstone = instance->SummonCreature(NPC_GRIMSTONE, GrimstonePositon);

View file

@ -358,7 +358,7 @@ public:
}
break;
case DATA_SOLAKAR_FLAMEWREATH:
switch(data)
switch (data)
{
case IN_PROGRESS:
if (SolakarState == NOT_STARTED)

View file

@ -242,7 +242,7 @@ struct boss_nightbane : public BossAI
_skeletonscheduler.Schedule(50ms, [this](TaskContext context)
{
//spawns skeletons every 2 seconds until skeletonCount is reached
if(_skeletonSpawnCounter < _skeletonCount)
if (_skeletonSpawnCounter < _skeletonCount)
{
me->CastSpell(_skeletonSpawnPos.GetPositionX(), _skeletonSpawnPos.GetPositionY(), _skeletonSpawnPos.GetPositionZ(), SPELL_SUMMON_SKELETON, true);
_skeletonSpawnCounter++;

View file

@ -941,7 +941,7 @@ struct boss_julianne : public ScriptedAI
void DoAction(int32 action) override
{
switch(action)
switch (action)
{
case ACTION_FAKING_DEATH:
isFakingDeath = false;
@ -1138,7 +1138,7 @@ struct boss_romulo : public ScriptedAI
void DoAction(int32 action) override
{
switch(action)
switch (action)
{
case ACTION_FAKING_DEATH:
isFakingDeath = false;

View file

@ -456,7 +456,7 @@ public:
uint32 NextStep(uint32 nextStep)
{
switch(nextStep)
switch (nextStep)
{
case 1:
Talk(SAY_DIALOG_MEDIVH_1);

View file

@ -140,7 +140,7 @@ public:
void SetData(uint32 type, uint32 data) override
{
switch(type)
switch (type)
{
case TYPE_MOGRAINE_AND_WHITE_EVENT:
if (data == IN_PROGRESS)
@ -317,7 +317,7 @@ public:
mograine->Kill(me, me, true);
return 0;
default:
if(mograine)
if (mograine)
mograine->DespawnOrUnsummon(0);
return 0;
}
@ -468,7 +468,7 @@ public:
while (uint32 eventId = events.ExecuteEvent())
{
switch(eventId)
switch (eventId)
{
case EVENT_SPELL_CRUSADER_STRIKE:
me->CastSpell(me->GetVictim(), SPELL_CRUSADER_STRIKE, true);

View file

@ -417,7 +417,7 @@ public:
return;
}
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 1:
me->CastSpell(me, BONE_ARMOR_SPELL, false);

View file

@ -281,7 +281,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case EVENT_RESTORE_COMBAT:
me->SetReactState(REACT_AGGRESSIVE);

View file

@ -193,7 +193,7 @@ public:
{
me->RemoveAurasDueToSpell(67541);
me->GetMotionMaster()->MoveCharge(11779.30f, -7065.43f, 24.92f, me->GetSpeed(MOVE_RUN), EVENT_CHARGE);
switch(summon->GetEntry())
switch (summon->GetEntry())
{
case NPC_SCOURGE_ZOMBIE:
events.ScheduleEvent(EVENT_SPAWN_WAVE_2, 3000);

View file

@ -517,7 +517,7 @@ public:
void WaypointReached(uint32 uiPointId) override
{
switch(uiPointId)
switch (uiPointId)
{
// Starting waypoint, After reaching uther and jaina
case 0:

View file

@ -97,7 +97,7 @@ public:
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/) override
{
switch(criteria_id)
switch (criteria_id)
{
case ACHIEV_CRITERIA_MANY_WHELPS_10_PLAYER:
case ACHIEV_CRITERIA_MANY_WHELPS_25_PLAYER:

View file

@ -330,12 +330,12 @@ public:
instance->SetData(DATA_PYRAMID, PYRAMID_CAGES_OPEN);
//setting gossip option as soon as the cages open
if(Creature* bly = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_BLY)))
if (Creature* bly = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_BLY)))
{
bly->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
}
if(Creature* weegli = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_WEEGLI)))
if (Creature* weegli = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_WEEGLI)))
{
weegli->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
}

View file

@ -256,7 +256,7 @@ public:
void JustSummoned(Creature* summon) override
{
if(summon->GetEntry() != me->GetEntry())
if (summon->GetEntry() != me->GetEntry())
{
summon->GetMotionMaster()->MovePoint(0, *me, false);
summon->GetMotionMaster()->MoveFollow(me, 0.1f, 0.0f + M_PI * 0.3f * summons.size());

View file

@ -48,7 +48,7 @@ public:
void OnCreatureCreate(Creature* pCreature) override
{
switch(pCreature->GetEntry())
switch (pCreature->GetEntry())
{
case NPC_SARTHARION:
m_uiSartharionGUID = pCreature->GetGUID();
@ -67,7 +67,7 @@ public:
ObjectGuid GetGuidData(uint32 uiData) const override
{
switch(uiData)
switch (uiData)
{
case DATA_SARTHARION:
return m_uiSartharionGUID;
@ -84,7 +84,7 @@ public:
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* source, Unit const* /*target*/, uint32 /*miscvalue1*/) override
{
switch(criteria_id)
switch (criteria_id)
{
// Gonna Go When the Volcano Blows (10 player) (2047)
case 7326:

View file

@ -104,19 +104,19 @@ public:
{
events.Reset();
me->SetReactState(REACT_PASSIVE);
if( pInstance )
if (pInstance)
pInstance->SetData(BOSS_ARGENT_CHALLENGE, NOT_STARTED);
}
void MovementInform(uint32 type, uint32 id) override
{
if( type == POINT_MOTION_TYPE && id == 1 )
if (type == POINT_MOTION_TYPE && id == 1)
me->SetFacingTo(3 * M_PI / 2);
}
void KilledUnit(Unit* who) override
{
if( who->IsPlayer() )
if (who->IsPlayer())
{
Talk(SAY_EADRIC_KILL_PLAYER);
}
@ -129,7 +129,7 @@ public:
events.ScheduleEvent(EVENT_SPELL_HAMMER_RIGHTEOUS, 25000);
Talk(SAY_EADRIC_AGGRO);
me->CastSpell(me, SPELL_VENGEANCE, false);
if( pInstance )
if (pInstance)
pInstance->SetData(BOSS_ARGENT_CHALLENGE, IN_PROGRESS);
}
@ -141,7 +141,7 @@ public:
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
if( damage >= me->GetHealth() )
if (damage >= me->GetHealth())
{
damage = me->GetHealth() - 1;
if (me->GetFaction() != FACTION_FRIENDLY)
@ -156,7 +156,7 @@ public:
_EnterEvadeMode();
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToAll(true);
if( pInstance )
if (pInstance)
pInstance->SetData(BOSS_ARGENT_CHALLENGE, DONE);
}
}
@ -164,15 +164,15 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
@ -182,7 +182,7 @@ public:
events.Repeat(16s);
break;
case EVENT_SPELL_HAMMER_RIGHTEOUS:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 55.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 55.0f, true))
{
Talk(SAY_EADRIC_EMOTE_HAMMER_RIGHTEOUS, target);
Talk(SAY_EADRIC_HAMMER_RIGHTEOUS);
@ -224,26 +224,26 @@ public:
{
events.Reset();
summoned = false;
if( MemoryGUID )
if (MemoryGUID)
{
if( Creature* memory = ObjectAccessor::GetCreature(*me, MemoryGUID) )
if (Creature* memory = ObjectAccessor::GetCreature(*me, MemoryGUID))
memory->DespawnOrUnsummon();
MemoryGUID.Clear();
}
me->SetReactState(REACT_PASSIVE);
if( pInstance )
if (pInstance)
pInstance->SetData(BOSS_ARGENT_CHALLENGE, NOT_STARTED);
}
void MovementInform(uint32 type, uint32 id) override
{
if( type == POINT_MOTION_TYPE && id == 1 )
if (type == POINT_MOTION_TYPE && id == 1)
me->SetFacingTo(3 * M_PI / 2);
}
void KilledUnit(Unit* who) override
{
if( who->IsPlayer() )
if (who->IsPlayer())
{
Talk(SAY_PALETRESS_KILL_PLAYER);
}
@ -256,22 +256,22 @@ public:
events.ScheduleEvent(EVENT_SPELL_SMITE, 2s, 3s);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
Talk(SAY_PALETRESS_AGGRO);
if( pInstance )
if (pInstance)
pInstance->SetData(BOSS_ARGENT_CHALLENGE, IN_PROGRESS);
}
void DoAction(int32 param) override
{
if( param == 1 )
if (param == 1)
{
MemoryGUID.Clear();
me->RemoveAura(SPELL_SHIELD);
Talk(SAY_PALETRESS_MEMORY_DEATH);
}
else if( param == (-1) )
else if (param == (-1))
{
if( MemoryGUID )
if( Creature* memory = ObjectAccessor::GetCreature(*me, MemoryGUID) )
if (MemoryGUID)
if (Creature* memory = ObjectAccessor::GetCreature(*me, MemoryGUID))
{
memory->DespawnOrUnsummon();
MemoryGUID.Clear();
@ -281,10 +281,10 @@ public:
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
//if( me->HasAura(SPELL_SHIELD) )
//if (me->HasAura(SPELL_SHIELD))
// return;
if( damage >= me->GetHealth() )
if (damage >= me->GetHealth())
{
damage = me->GetHealth() - 1;
@ -299,7 +299,7 @@ public:
_EnterEvadeMode();
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToAll(true);
if( pInstance )
if (pInstance)
{
pInstance->SetData(BOSS_ARGENT_CHALLENGE, DONE);
pInstance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 68206);
@ -310,7 +310,7 @@ public:
void JustSummoned(Creature* summon) override
{
if( pInstance )
if (pInstance)
pInstance->SetData(DATA_MEMORY_ENTRY, summon->GetEntry());
MemoryGUID = summon->GetGUID();
}
@ -324,12 +324,12 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( !summoned && HealthBelowPct(25) )
if (!summoned && HealthBelowPct(25))
{
me->InterruptNonMeleeSpells(true);
Talk(SAY_PALETRESS_MEMORY_SUMMON);
@ -343,32 +343,32 @@ public:
return;
}
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_SPELL_SMITE:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
me->CastSpell(target, SPELL_SMITE, false);
events.Repeat(3s, 4s);
break;
case EVENT_SPELL_HOLY_FIRE:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
me->CastSpell(target, SPELL_HOLY_FIRE, false);
events.Repeat(9s, 12s);
break;
case EVENT_SPELL_RENEW:
if( !MemoryGUID )
if (!MemoryGUID)
{
break;
}
if( urand(0, 1) )
if (urand(0, 1))
me->CastSpell(me, SPELL_RENEW, false);
else if( Creature* memory = ObjectAccessor::GetCreature(*me, MemoryGUID) )
if( memory->IsAlive() )
else if (Creature* memory = ObjectAccessor::GetCreature(*me, MemoryGUID))
if (memory->IsAlive())
me->CastSpell(memory, SPELL_RENEW, false);
events.Repeat(15s, 17s);
break;
@ -410,8 +410,8 @@ public:
void JustDied(Unit* /*killer*/) override
{
me->DespawnOrUnsummon(20000);
if( pInstance )
if( Creature* paletress = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(DATA_PALETRESS)) )
if (pInstance)
if (Creature* paletress = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(DATA_PALETRESS)))
paletress->AI()->DoAction(1);
}
@ -421,10 +421,10 @@ public:
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
@ -436,7 +436,7 @@ public:
case EVENT_MEMORY_START_ATTACK:
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToAll(false);
if( Unit* target = me->SelectNearestTarget(200.0f) )
if (Unit* target = me->SelectNearestTarget(200.0f))
{
AttackStart(target);
DoZoneInCombat();
@ -447,12 +447,12 @@ public:
events.ScheduleEvent(EVENT_SPELL_WAKING_NIGHTMARE, 20s, 30s);
break;
case EVENT_SPELL_OLD_WOUNDS:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 10.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 10.0f, true))
me->CastSpell(target, SPELL_OLD_WOUNDS, true);
events.Repeat(12s);
break;
case EVENT_SPELL_SHADOWS_PAST:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true))
me->CastSpell(target, SPELL_SHADOWS_PAST, false);
events.Repeat(15s, 20s);
break;
@ -541,9 +541,9 @@ public:
void WaypointReached(uint32 uiPoint) override
{
if( uiPoint == 1 )
if (uiPoint == 1)
{
switch( uiWaypoint )
switch (uiWaypoint)
{
case 0:
me->SetFacingTo(5.4f);
@ -561,10 +561,10 @@ public:
void SetData(uint32 uiType, uint32 /*uiData*/) override
{
AddWaypoint(0, me->GetPositionX(), 660.0f, 411.80f);
switch( me->GetEntry() )
switch (me->GetEntry())
{
case NPC_ARGENT_LIGHTWIELDER:
switch( uiType )
switch (uiType)
{
case 0:
AddWaypoint(1, 716.321f, 647.047f, 411.93f);
@ -578,7 +578,7 @@ public:
}
break;
case NPC_ARGENT_MONK:
switch( uiType )
switch (uiType)
{
case 0:
AddWaypoint(1, 717.86f, 649.0f, 411.923f);
@ -592,7 +592,7 @@ public:
}
break;
case NPC_PRIESTESS:
switch( uiType )
switch (uiType)
{
case 0:
AddWaypoint(1, 719.872f, 650.94f, 411.93f);
@ -613,7 +613,7 @@ public:
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
if( bCheck && damage >= me->GetHealth() )
if (bCheck && damage >= me->GetHealth())
{
bCheck = false;
damage = me->GetHealth() - 1;
@ -625,25 +625,25 @@ public:
void JustEngagedWith(Unit* /*who*/) override
{
switch( me->GetEntry() )
switch (me->GetEntry())
{
case NPC_ARGENT_MONK:
events.RescheduleEvent(EVENT_MONK_SPELL_FLURRY_OF_BLOWS, 5s);
events.RescheduleEvent(EVENT_MONK_SPELL_PUMMEL, 7s);
if( IsHeroic() )
if (IsHeroic())
bCheck = true;
break;
case NPC_PRIESTESS:
events.RescheduleEvent(EVENT_PRIESTESS_SPELL_HOLY_SMITE, 5s, 8s);
events.RescheduleEvent(EVENT_PRIESTESS_SPELL_SHADOW_WORD_PAIN, 3s, 6s);
events.RescheduleEvent(EVENT_PRIESTESS_SPELL_FOUNTAIN_OF_LIGHT, 8s, 15s);
if( IsHeroic() )
if (IsHeroic())
events.RescheduleEvent(EVENT_PRIESTESS_SPELL_MIND_CONTROL_H, 12s);
break;
case NPC_ARGENT_LIGHTWIELDER:
events.RescheduleEvent(EVENT_LIGHTWIELDER_SPELL_BLAZING_LIGHT, 12s, 15s);
events.RescheduleEvent(EVENT_LIGHTWIELDER_SPELL_CLEAVE, 3s, 5s);
if( IsHeroic() )
if (IsHeroic())
events.RescheduleEvent(EVENT_LIGHTWIELDER_SPELL_UNBALANCING_STRIKE_H, 8s, 12s);
break;
}
@ -653,15 +653,15 @@ public:
{
npc_escortAI::UpdateAI(diff);
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
@ -671,18 +671,18 @@ public:
events.Repeat(12s, 18s);
break;
case EVENT_MONK_SPELL_PUMMEL:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_PUMMEL, false);
events.Repeat(8s, 11s);
break;
case EVENT_PRIESTESS_SPELL_HOLY_SMITE:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_HOLY_SMITE, false);
events.Repeat(6s, 8s);
break;
case EVENT_PRIESTESS_SPELL_SHADOW_WORD_PAIN:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_SHADOW_WORD_PAIN, false);
events.Repeat(12s, 15s);
break;
@ -691,7 +691,7 @@ public:
events.Repeat(35s, 45s);
break;
case EVENT_PRIESTESS_SPELL_MIND_CONTROL_H:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
me->CastSpell(target, SPELL_MIND_CONTROL_H, false);
events.Repeat(22s, 30s);
break;
@ -699,19 +699,19 @@ public:
case EVENT_LIGHTWIELDER_SPELL_BLAZING_LIGHT:
{
Unit* target = DoSelectLowestHpFriendly(40.0f);
if( !target )
if (!target)
target = me;
me->CastSpell(target, SPELL_BLAZING_LIGHT, false);
events.Repeat(8s, 12s);
}
break;
case EVENT_LIGHTWIELDER_SPELL_CLEAVE:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_CLEAVE, false);
events.Repeat(6s, 8s);
break;
case EVENT_LIGHTWIELDER_SPELL_UNBALANCING_STRIKE_H:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_UNBALANCING_STRIKE_H, false);
events.Repeat(12s, 15s);
break;
@ -723,7 +723,7 @@ public:
void JustDied(Unit* /*pKiller*/) override
{
me->DespawnOrUnsummon(10000);
if( pInstance )
if (pInstance)
pInstance->SetData(DATA_ARGENT_SOLDIER_DEFEATED, 0);
}
};
@ -742,7 +742,7 @@ class spell_eadric_radiance : public SpellScript
{
std::list<WorldObject*> tmplist;
for( std::list<WorldObject*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
if( (*itr)->ToUnit()->HasInArc(M_PI, GetCaster()) )
if ((*itr)->ToUnit()->HasInArc(M_PI, GetCaster()))
tmplist.push_back(*itr);
targets.clear();
@ -798,8 +798,8 @@ class spell_reflective_shield_aura : public AuraScript
void HandleAfterEffectAbsorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
{
if( Unit* attacker = dmgInfo.GetAttacker() )
if( GetOwner() && attacker->GetGUID() != GetOwner()->GetGUID() )
if (Unit* attacker = dmgInfo.GetAttacker())
if (GetOwner() && attacker->GetGUID() != GetOwner()->GetGUID())
{
int32 damage = (int32)(absorbAmount * 0.25f);
GetOwner()->ToUnit()->CastCustomSpell(attacker, SPELL_REFLECTIVE_SHIELD_DAMAGE, &damage, nullptr, nullptr, true);

View file

@ -123,7 +123,7 @@ public:
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToAll(true);
me->SetReactState(REACT_PASSIVE);
if( pInstance )
if (pInstance)
pInstance->SetData(BOSS_BLACK_KNIGHT, NOT_STARTED);
//me->SetLootMode(0); // [LOOT]
@ -143,7 +143,7 @@ public:
return;
}
if( Phase < 3 && damage >= me->GetHealth() )
if (Phase < 3 && damage >= me->GetHealth())
{
damage = 0;
me->SetHealth(me->GetMaxHealth());
@ -164,19 +164,19 @@ public:
void DoAction(int32 param) override
{
if( param == -1 )
if (param == -1)
{
summons.DespawnAll();
}
else if( param == 1 )
else if (param == 1)
{
if( !pInstance )
if (!pInstance)
return;
pInstance->SetData(BOSS_BLACK_KNIGHT, IN_PROGRESS);
Talk(SAY_BK_AGGRO);
me->CastSpell((Unit*)nullptr, (pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? SPELL_RAISE_DEAD_JAEREN : SPELL_RAISE_DEAD_ARELAS), false);
if( Creature* announcer = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_ANNOUNCER)) )
if (Creature* announcer = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_ANNOUNCER)))
announcer->DespawnOrUnsummon();
events.Reset();
@ -190,7 +190,7 @@ public:
void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) override
{
switch( spell->Id )
switch (spell->Id)
{
case SPELL_BLACK_KNIGHT_RES:
me->SetHealth(me->GetMaxHealth());
@ -205,7 +205,7 @@ public:
++Phase;
switch( Phase )
switch (Phase)
{
case 2:
me->SetDisplayId(MODEL_SKELETON);
@ -236,46 +236,46 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_ANNOUNCER_SAY_ZOMBIE:
if( pInstance && !summons.empty() )
if( Creature* ghoul = pInstance->instance->GetCreature(*summons.begin()) )
if (pInstance && !summons.empty())
if (Creature* ghoul = pInstance->instance->GetCreature(*summons.begin()))
if (urand(0, 1))
ghoul->Yell("[Zombie] .... . Brains ....", LANG_UNIVERSAL); /// @todo: Multiple variations + not always happening, from video sources, needs sniff to transition from DB.
break;
case EVENT_SPELL_PLAGUE_STRIKE:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_PLAGUE_STRIKE, false);
events.Repeat(10s, 12s);
break;
case EVENT_SPELL_ICY_TOUCH:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_ICY_TOUCH, false);
events.Repeat(5s, 6s);
break;
case EVENT_SPELL_DEATH_RESPITE:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
me->CastSpell(target, SPELL_DEATH_RESPITE, false);
events.Repeat(13s, 15s);
break;
case EVENT_SPELL_OBLITERATE:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_OBLITERATE, false);
events.Repeat(15s, 17s);
break;
case EVENT_SPELL_DESECRATION:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
me->CastSpell(target, SPELL_DESECRATION, false);
events.Repeat(14s, 17s);
break;
@ -284,7 +284,7 @@ public:
events.Repeat(2s, 4s);
break;
case EVENT_SPELL_MARKED_DEATH:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.000000f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.000000f, true))
me->CastSpell(target, SPELL_MARKED_DEATH, false);
events.Repeat(9s);
break;
@ -296,7 +296,7 @@ public:
void JustSummoned(Creature* summon) override
{
summons.Summon(summon);
if( Unit* target = summon->SelectNearestTarget(200.0f) )
if (Unit* target = summon->SelectNearestTarget(200.0f))
{
summon->AI()->AttackStart(target);
DoZoneInCombat(summon);
@ -305,7 +305,7 @@ public:
void KilledUnit(Unit* victim) override
{
if( victim->IsPlayer() )
if (victim->IsPlayer())
{
Talk(SAY_BK_KILL_PLAYER);
}
@ -315,9 +315,9 @@ public:
{
me->CastSpell((Unit*)nullptr, SPELL_BK_KILL_CREDIT, true);
Talk(SAY_BK_DEATH);
if( pInstance )
if (pInstance)
pInstance->SetData(BOSS_BLACK_KNIGHT, DONE);
if( me->ToTempSummon() )
if (me->ToTempSummon())
me->ToTempSummon()->SetTempSummonType(TEMPSUMMON_MANUAL_DESPAWN);
}
};
@ -347,7 +347,7 @@ public:
void DoAction(int32 param) override
{
if( param == 1 )
if (param == 1)
{
me->SetControlled(false, UNIT_STATE_ROOT);
me->DisableRotate(false);
@ -358,7 +358,7 @@ public:
void WaypointReached(uint32 i) override
{
if( i == 12 )
if (i == 12)
{
SetEscortPaused(true);
me->SetOrientation(3.62f);
@ -366,7 +366,7 @@ public:
me->DisableRotate(true);
me->SetFacingTo(3.62f);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_MOUNT_SPECIAL);
if( InstanceScript* pInstance = me->GetInstanceScript() )
if (InstanceScript* pInstance = me->GetInstanceScript())
pInstance->SetData(DATA_SKELETAL_GRYPHON_LANDED, 0);
}
}
@ -422,7 +422,7 @@ public:
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
switch(spell->Id)
switch (spell->Id)
{
case SPELL_CLAW_N:
case SPELL_CLAW_H:
@ -443,15 +443,15 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;

View file

@ -173,7 +173,7 @@ public:
if (me->IsDuringRemoveFromWorld())
return;
if( apply )
if (apply)
{
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetSpeed(MOVE_RUN, 2.0f, false);
@ -193,7 +193,7 @@ public:
if (me->IsDuringRemoveFromWorld())
return;
if( !apply )
if (!apply)
{
me->RemoveAura(SPELL_PLAYER_VEHICLE_DEFEND);
who->RemoveAura(SPELL_PLAYER_VEHICLE_DEFEND);
@ -260,7 +260,7 @@ public:
void UpdateAI(uint32 diff) override
{
if( ShieldTimer <= (int32)diff )
if (ShieldTimer <= (int32)diff )
{
me->CastSpell(me, SPELL_MINIONS_DEFEND, true);
ShieldTimer = 5000;
@ -268,15 +268,15 @@ public:
else
ShieldTimer -= diff;
if ( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
@ -285,22 +285,22 @@ public:
GuidVector LIST;
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
if( Player* plr = itr->GetSource() )
if (Player* plr = itr->GetSource())
{
if( me->GetExactDist(plr) < 8.0f || me->GetExactDist(plr) > 25.0f || plr->isDead() )
if (me->GetExactDist(plr) < 8.0f || me->GetExactDist(plr) > 25.0f || plr->isDead())
continue;
if( !plr->GetVehicle() )
if (!plr->GetVehicle())
LIST.push_back(plr->GetGUID());
else if( Vehicle* v = plr->GetVehicle() )
else if (Vehicle* v = plr->GetVehicle())
{
if( Unit* mount = v->GetBase() )
if (Unit* mount = v->GetBase())
LIST.push_back(mount->GetGUID());
}
}
if( !LIST.empty() )
if (!LIST.empty())
{
uint8 rnd = LIST.size() > 1 ? urand(0, LIST.size() - 1) : 0;
if( Unit* target = ObjectAccessor::GetUnit(*me, LIST.at(rnd)) )
if (Unit* target = ObjectAccessor::GetUnit(*me, LIST.at(rnd)))
{
me->GetThreatMgr().ResetAllThreat();
me->AddThreat(target, 10000.0f);
@ -316,25 +316,25 @@ public:
GuidVector LIST;
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
if( Player* plr = itr->GetSource() )
if (Player* plr = itr->GetSource())
{
if( me->GetExactDist(plr) < 10.0f || me->GetExactDist(plr) > 30.0f )
if (me->GetExactDist(plr) < 10.0f || me->GetExactDist(plr) > 30.0f )
continue;
if( Vehicle* v = plr->GetVehicle() )
if( Unit* mount = v->GetBase() )
if (Vehicle* v = plr->GetVehicle())
if (Unit* mount = v->GetBase())
LIST.push_back(mount->GetGUID());
}
if( !LIST.empty() )
if (!LIST.empty())
{
uint8 rnd = LIST.size() > 1 ? urand(0, LIST.size() - 1) : 0;
if( Unit* target = ObjectAccessor::GetCreature(*me, LIST.at(rnd)) )
if (Unit* target = ObjectAccessor::GetCreature(*me, LIST.at(rnd)))
me->CastSpell(target, SPELL_NPC_SHIELD_BREAKER, false);
}
events.Repeat(6s, 8s);
}
break;
case EVENT_THRUST:
if( me->GetVictim() && me->GetExactDist(me->GetVictim()) <= 5.5f )
if (me->GetVictim() && me->GetExactDist(me->GetVictim()) <= 5.5f )
me->CastSpell(me->GetVictim(), SPELL_PLAYER_VEHICLE_THRUST, false);
events.Repeat(3s, 5s);
break;
@ -345,7 +345,7 @@ public:
{
me->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 0);
me->DespawnOrUnsummon(10000);
if( pInstance )
if (pInstance)
pInstance->SetData(DATA_MOUNT_DIED, 0);
}
};
@ -402,7 +402,7 @@ public:
void Reset() override
{
if( pInstance && pInstance->GetData(DATA_INSTANCE_PROGRESS) == INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED )
if (pInstance && pInstance->GetData(DATA_INSTANCE_PROGRESS) == INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED )
{
DoAction(1);
DoAction(2);
@ -415,7 +415,7 @@ public:
void JustEngagedWith(Unit* /*who*/) override
{
if( pInstance && pInstance->GetData(DATA_INSTANCE_PROGRESS) == INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED )
if (pInstance && pInstance->GetData(DATA_INSTANCE_PROGRESS) == INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED )
me->CallForHelp(100.0f);
}
@ -423,7 +423,7 @@ public:
{
me->m_spellImmune[IMMUNITY_MECHANIC].clear();
events.Reset();
switch( me->GetEntry() )
switch (me->GetEntry())
{
case NPC_AMBROSE: // Ambrose Boltspark
case NPC_ERESSEA: // Eressea Dawnsinger
@ -485,7 +485,7 @@ public:
void DoAction(int32 param) override
{
if( param == 1 )
if (param == 1)
{
MountPhase = false;
NewMountGUID.Clear();
@ -500,16 +500,16 @@ public:
AddCreatureAddonAuras();
events.Reset();
}
else if( param == 2 )
else if (param == 2)
ScheduleAbilitiesEvents();
}
void SetData(uint32 uiType, uint32 uiData) override
{
BossOrder = uiType;
if( uiData > 1 )
if (uiData > 1)
return;
switch( BossOrder )
switch (BossOrder)
{
case 0:
if (uiData == 0) // 1 == short version
@ -545,11 +545,11 @@ public:
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
if( MountPhase )
if (MountPhase)
{
if( me->GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID) == 0 )
if (me->GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID) == 0 )
damage = 0;
else if( damage >= me->GetHealth() )
else if (damage >= me->GetHealth())
{
events.Reset();
damage = me->GetHealth() - 1;
@ -565,10 +565,10 @@ public:
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToAll(true);
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
if( pInstance )
if (pInstance)
{
pInstance->SetData(DATA_MOUNT_DIED, BossOrder);
if( Creature* mount = me->FindNearestCreature( pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? VEHICLE_ARGENT_WARHORSE : VEHICLE_ARGENT_BATTLEWORG, 100.0f, true ) )
if (Creature* mount = me->FindNearestCreature( pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? VEHICLE_ARGENT_WARHORSE : VEHICLE_ARGENT_BATTLEWORG, 100.0f, true ))
{
NewMountGUID = mount->GetGUID();
me->GetMotionMaster()->MovePoint(7, *mount);
@ -579,7 +579,7 @@ public:
}
else
{
if( damage >= me->GetHealth() )
if (damage >= me->GetHealth())
{
MountPhase = true;
events.Reset();
@ -593,7 +593,7 @@ public:
me->SetRegeneratingHealth(false);
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToAll(true);
if( pInstance )
if (pInstance)
pInstance->SetData(DATA_GRAND_CHAMPION_DIED, BossOrder);
}
}
@ -603,26 +603,26 @@ public:
void WaypointReached(uint32 i) override
{
if( !pInstance )
if (!pInstance)
return;
if( (i == 2 && (BossOrder == 1 || BossOrder == 2)) || (i == 3 && BossOrder == 0) )
if ((i == 2 && (BossOrder == 1 || BossOrder == 2)) || (i == 3 && BossOrder == 0))
pInstance->SetData(DATA_GRAND_CHAMPION_REACHED_DEST, BossOrder);
}
void MovementInform(uint32 type, uint32 id) override
{
if( id < 4 )
if (id < 4)
npc_escortAI::MovementInform(type, id);
if( type == POINT_MOTION_TYPE )
if (type == POINT_MOTION_TYPE)
{
if( id == 5 )
if (id == 5)
me->SetFacingTo(3 * M_PI / 2);
else if( id == 7 ) // reached new mount!
else if (id == 7) // reached new mount!
{
if( NewMountGUID )
if( Creature* mount = ObjectAccessor::GetCreature(*me, NewMountGUID) )
if (NewMountGUID)
if (Creature* mount = ObjectAccessor::GetCreature(*me, NewMountGUID))
{
mount->DespawnOrUnsummon();
me->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, mount->GetDisplayId());
@ -637,16 +637,16 @@ public:
me->SetReactState(REACT_AGGRESSIVE);
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToAll(false);
if( Unit* target = me->SelectNearestTarget(200.0f) )
if (Unit* target = me->SelectNearestTarget(200.0f))
AttackStart(target);
DoZoneInCombat();
me->CastSpell(me, SPELL_TRAMPLE_AURA, true);
if( pInstance )
if (pInstance)
pInstance->SetData(DATA_REACHED_NEW_MOUNT, 0);
NewMountGUID.Clear();
}
}
else if( id == 9 )
else if (id == 9)
me->DespawnOrUnsummon();
}
}
@ -661,37 +661,37 @@ public:
{
npc_escortAI::UpdateAI(diff);
if ( !UpdateVictim() && !NewMountGUID )
if (!UpdateVictim() && !NewMountGUID )
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) || ((me->GetEntry() == NPC_JACOB || me->GetEntry() == NPC_MOKRA) && me->HasAura(SPELL_BLADESTORM)) )
if (me->HasUnitState(UNIT_STATE_CASTING) || ((me->GetEntry() == NPC_JACOB || me->GetEntry() == NPC_MOKRA) && me->HasAura(SPELL_BLADESTORM)))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_FIND_NEW_MOUNT:
{
if( me->HasAura(SPELL_TRAMPLE_STUN) )
if (me->HasAura(SPELL_TRAMPLE_STUN))
{
events.Repeat(200ms);
break;
}
// hackfix, trample won't hit grand champions because of UNIT_FLAG_NON_ATTACKABLE
if( pInstance )
if (pInstance)
{
bool trample = false;
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
if( Player* plr = itr->GetSource() )
if( me->GetExactDist(plr) <= 5.0f )
if( Vehicle* v = plr->GetVehicle() )
if( Unit* c = v->GetBase() )
if( c->IsCreature() && c->ToCreature()->GetEntry() == (pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? VEHICLE_ARGENT_BATTLEWORG : VEHICLE_ARGENT_WARHORSE) )
if (Player* plr = itr->GetSource())
if (me->GetExactDist(plr) <= 5.0f )
if (Vehicle* v = plr->GetVehicle())
if (Unit* c = v->GetBase())
if (c->IsCreature() && c->ToCreature()->GetEntry() == (pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? VEHICLE_ARGENT_BATTLEWORG : VEHICLE_ARGENT_WARHORSE))
{
me->GetMotionMaster()->MovementExpired();
me->GetMotionMaster()->MoveIdle();
@ -701,23 +701,23 @@ public:
break;
}
if( trample )
if (trample)
{
events.Repeat(15s);
break;
}
}
if( Creature* mount = ObjectAccessor::GetCreature(*me, NewMountGUID) )
if( mount->IsAlive() )
if (Creature* mount = ObjectAccessor::GetCreature(*me, NewMountGUID))
if (mount->IsAlive())
{
if( me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE )
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE )
me->GetMotionMaster()->MovePoint(7, *mount);
events.Repeat(200ms);
break;
}
if( Creature* mount = me->FindNearestCreature( pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? VEHICLE_ARGENT_WARHORSE : VEHICLE_ARGENT_BATTLEWORG, 100.0f, true ) )
if (Creature* mount = me->FindNearestCreature( pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? VEHICLE_ARGENT_WARHORSE : VEHICLE_ARGENT_BATTLEWORG, 100.0f, true ))
{
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
NewMountGUID = mount->GetGUID();
@ -734,22 +734,22 @@ public:
GuidVector LIST;
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
if( Player* plr = itr->GetSource() )
if (Player* plr = itr->GetSource())
{
if( me->GetExactDist(plr) < 8.0f || me->GetExactDist(plr) > 25.0f || plr->isDead() )
if (me->GetExactDist(plr) < 8.0f || me->GetExactDist(plr) > 25.0f || plr->isDead())
continue;
if( !plr->GetVehicle() )
if (!plr->GetVehicle())
LIST.push_back(plr->GetGUID());
else if( Vehicle* v = plr->GetVehicle() )
else if (Vehicle* v = plr->GetVehicle())
{
if( Unit* mount = v->GetBase() )
if (Unit* mount = v->GetBase())
LIST.push_back(mount->GetGUID());
}
}
if( !LIST.empty() )
if (!LIST.empty())
{
uint8 rnd = LIST.size() > 1 ? urand(0, LIST.size() - 1) : 0;
if( Unit* target = ObjectAccessor::GetUnit(*me, LIST.at(rnd)) )
if (Unit* target = ObjectAccessor::GetUnit(*me, LIST.at(rnd)))
{
me->GetThreatMgr().ResetAllThreat();
me->AddThreat(target, 10000.0f);
@ -765,33 +765,33 @@ public:
GuidVector LIST;
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
if( Player* plr = itr->GetSource() )
if (Player* plr = itr->GetSource())
{
if( me->GetExactDist(plr) < 10.0f || me->GetExactDist(plr) > 30.0f )
if (me->GetExactDist(plr) < 10.0f || me->GetExactDist(plr) > 30.0f )
continue;
if( Vehicle* v = plr->GetVehicle() )
if( Unit* mount = v->GetBase() )
if (Vehicle* v = plr->GetVehicle())
if (Unit* mount = v->GetBase())
LIST.push_back(mount->GetGUID());
}
if( !LIST.empty() )
if (!LIST.empty())
{
uint8 rnd = LIST.size() > 1 ? urand(0, LIST.size() - 1) : 0;
if( Unit* target = ObjectAccessor::GetCreature(*me, LIST.at(rnd)) )
if (Unit* target = ObjectAccessor::GetCreature(*me, LIST.at(rnd)))
me->CastSpell(target, SPELL_NPC_SHIELD_BREAKER, false);
}
events.Repeat(6s, 8s);
}
break;
case EVENT_THRUST:
if( Unit* victim = me->GetVictim() )
if( me->GetExactDist(victim) <= 6.0f )
if (Unit* victim = me->GetVictim())
if (me->GetExactDist(victim) <= 6.0f )
me->CastSpell(victim, SPELL_PLAYER_VEHICLE_THRUST, false);
events.Repeat(3s, 5s);
break;
/******************* MAGE *******************/
case EVEMT_MAGE_SPELL_FIREBALL:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_FIREBALL, false);
events.Repeat(5s);
break;
@ -804,7 +804,7 @@ public:
events.Repeat(22s);
break;
case EVEMT_MAGE_SPELL_POLYMORPH:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
me->CastSpell(target, SPELL_POLYMORPH, false);
events.Repeat(8s);
break;
@ -812,7 +812,7 @@ public:
/****************** SHAMAN ******************/
case EVENT_SHAMAN_SPELL_CHAIN_LIGHTNING:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
me->CastSpell(target, SPELL_CHAIN_LIGHTNING, false);
events.Repeat(16s);
break;
@ -823,10 +823,10 @@ public:
case EVENT_SHAMAN_SPELL_HEALING_WAVE:
{
Unit* target = nullptr;
if( urand(0, 1) )
if (urand(0, 1))
{
target = DoSelectLowestHpFriendly(40.0f);
if( !target )
if (!target)
target = me;
}
else
@ -836,7 +836,7 @@ public:
}
break;
case EVENT_SHAMAN_SPELL_HEX_OF_MENDING:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_HEX_OF_MENDING, false);
events.Repeat(20s, 25s);
break;
@ -852,9 +852,9 @@ public:
break;
case EVENT_HUNTER_SPELL_MULTI_SHOT:
{
if( !UnitTargetGUID )
if (!UnitTargetGUID)
{
if( Unit* target = SelectTarget(SelectTargetMethod::MinDistance, 0, 30.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::MinDistance, 0, 30.0f, true))
{
me->CastSpell(target, SPELL_SHOOT, false);
UnitTargetGUID = target->GetGUID();
@ -865,7 +865,7 @@ public:
else
{
Unit* target = ObjectAccessor::GetUnit(*me, UnitTargetGUID);
if( target && me->IsInRange(target, 5.0f, 30.0f, false) )
if (target && me->IsInRange(target, 5.0f, 30.0f, false))
me->CastSpell(target, SPELL_MULTI_SHOT, false);
else
{
@ -873,7 +873,7 @@ public:
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
{
Player* player = itr->GetSource();
if( player && me->IsInRange(player, 5.0f, 30.0f, false) )
if (player && me->IsInRange(player, 5.0f, 30.0f, false))
{
me->CastSpell(player, SPELL_MULTI_SHOT, false);
break;
@ -889,7 +889,7 @@ public:
/****************** ROGUE *******************/
case EVENT_ROGUE_SPELL_EVISCERATE:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_EVISCERATE, false);
events.Repeat(8s);
break;
@ -898,7 +898,7 @@ public:
events.Repeat(14s);
break;
case EVENT_ROGUE_SPELL_POISON_BOTTLE:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
me->CastSpell(target, SPELL_POISON_BOTTLE, false);
events.Repeat(19s);
break;
@ -906,12 +906,12 @@ public:
/***************** WARRIOR ******************/
case EVENT_WARRIOR_SPELL_MORTAL_STRIKE:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_MORTAL_STRIKE, false);
events.Repeat(8s, 12s);
break;
case EVENT_WARRIOR_SPELL_BLADESTORM:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_BLADESTORM, false);
events.Repeat(15s, 20s);
break;
@ -921,7 +921,7 @@ public:
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
{
Player* player = itr->GetSource();
if( player && me->IsInRange(player, 8.0f, 25.0f, false) )
if (player && me->IsInRange(player, 8.0f, 25.0f, false))
{
DoResetThreatList();
me->AddThreat(player, 5.0f);

View file

@ -101,7 +101,7 @@ public:
bool IsEncounterInProgress() const override
{
for( uint8 i = 0; i < MAX_ENCOUNTER; ++i )
if( m_auiEncounter[i] == IN_PROGRESS )
if (m_auiEncounter[i] == IN_PROGRESS)
return true;
return false;
@ -112,54 +112,54 @@ public:
if (TeamIdInInstance == TEAM_NEUTRAL)
{
Map::PlayerList const& players = instance->GetPlayers();
if( !players.IsEmpty() )
if( Player* pPlayer = players.begin()->GetSource() )
if (!players.IsEmpty())
if (Player* pPlayer = players.begin()->GetSource())
TeamIdInInstance = pPlayer->GetTeamId();
}
switch( creature->GetEntry() )
switch (creature->GetEntry())
{
// Grand Champions:
case NPC_MOKRA:
if( TeamIdInInstance == TEAM_HORDE )
if (TeamIdInInstance == TEAM_HORDE)
creature->UpdateEntry(NPC_JACOB);
break;
case NPC_ERESSEA:
if( TeamIdInInstance == TEAM_HORDE )
if (TeamIdInInstance == TEAM_HORDE)
creature->UpdateEntry(NPC_AMBROSE);
break;
case NPC_RUNOK:
if( TeamIdInInstance == TEAM_HORDE )
if (TeamIdInInstance == TEAM_HORDE)
creature->UpdateEntry(NPC_COLOSOS);
break;
case NPC_ZULTORE:
if( TeamIdInInstance == TEAM_HORDE )
if (TeamIdInInstance == TEAM_HORDE)
creature->UpdateEntry(NPC_JAELYNE);
break;
case NPC_VISCERI:
if( TeamIdInInstance == TEAM_HORDE )
if (TeamIdInInstance == TEAM_HORDE)
creature->UpdateEntry(NPC_LANA);
break;
// Grand Champion Minions:
case NPC_ORGRIMMAR_MINION:
if( TeamIdInInstance == TEAM_HORDE )
if (TeamIdInInstance == TEAM_HORDE)
creature->UpdateEntry(NPC_STORMWIND_MINION);
break;
case NPC_SILVERMOON_MINION:
if( TeamIdInInstance == TEAM_HORDE )
if (TeamIdInInstance == TEAM_HORDE)
creature->UpdateEntry(NPC_GNOMEREGAN_MINION);
break;
case NPC_THUNDER_BLUFF_MINION:
if( TeamIdInInstance == TEAM_HORDE )
if (TeamIdInInstance == TEAM_HORDE)
creature->UpdateEntry(NPC_EXODAR_MINION);
break;
case NPC_SENJIN_MINION:
if( TeamIdInInstance == TEAM_HORDE )
if (TeamIdInInstance == TEAM_HORDE)
creature->UpdateEntry(NPC_DARNASSUS_MINION);
break;
case NPC_UNDERCITY_MINION:
if( TeamIdInInstance == TEAM_HORDE )
if (TeamIdInInstance == TEAM_HORDE)
creature->UpdateEntry(NPC_IRONFORGE_MINION);
break;
@ -173,7 +173,7 @@ public:
case NPC_JAEREN:
case NPC_ARELAS:
NPC_AnnouncerGUID = creature->GetGUID();
//if( TeamIdInInstance == TEAM_ALLIANCE )
//if (TeamIdInInstance == TEAM_ALLIANCE)
// creature->UpdateEntry(NPC_ARELAS);
creature->SetReactState(REACT_PASSIVE);
break;
@ -186,7 +186,7 @@ public:
// Beginning vehicles:
case VEHICLE_ARGENT_WARHORSE:
case VEHICLE_ARGENT_BATTLEWORG:
if( InstanceProgress < INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED && m_auiEncounter[0] == NOT_STARTED )
if (InstanceProgress < INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED && m_auiEncounter[0] == NOT_STARTED)
{
creature->DespawnOrUnsummon();
creature->SetRespawnTime(3);
@ -204,7 +204,7 @@ public:
void OnGameObjectCreate(GameObject* go) override
{
switch( go->GetEntry() )
switch (go->GetEntry())
{
case GO_MAIN_GATE:
GO_MainGateGUID = go->GetGUID();
@ -237,7 +237,7 @@ public:
events.Reset();
events.RescheduleEvent(EVENT_CHECK_PLAYERS, 0ms);
if( !in )
if (!in)
{
OUT_LOAD_INST_DATA_FAIL;
return;
@ -250,17 +250,17 @@ public:
std::istringstream loadStream(in);
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3;
if( dataHead1 == 'T' && dataHead2 == 'C' )
if (dataHead1 == 'T' && dataHead2 == 'C')
{
m_auiEncounter[0] = data0;
m_auiEncounter[1] = data1;
m_auiEncounter[2] = data2;
InstanceProgress = data3;
if( InstanceProgress == INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED )
if (InstanceProgress == INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED)
InstanceProgress = INSTANCE_PROGRESS_INITIAL;
for( uint8 i = 0; i < MAX_ENCOUNTER; ++i )
if( m_auiEncounter[i] == IN_PROGRESS )
if (m_auiEncounter[i] == IN_PROGRESS)
m_auiEncounter[i] = NOT_STARTED;
}
else
@ -306,10 +306,10 @@ public:
void InstanceCleanup()
{
if( CLEANED )
if (CLEANED)
return;
switch( InstanceProgress )
switch (InstanceProgress)
{
case INSTANCE_PROGRESS_INITIAL:
case INSTANCE_PROGRESS_GRAND_CHAMPIONS_REACHED_DEST:
@ -328,15 +328,15 @@ public:
{
for( uint8 j = 0; j < 3; ++j )
{
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[i][j]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[i][j]))
c->DespawnOrUnsummon();
NPC_GrandChampionMinionsGUID[i][j].Clear();
}
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]))
c->DespawnOrUnsummon();
NPC_GrandChampionGUID[i].Clear();
}
if( Creature* c = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* c = instance->GetCreature(NPC_AnnouncerGUID))
{
c->DespawnOrUnsummon();
c->SetHomePosition(748.309f, 619.488f, 411.172f, 4.71239f);
@ -349,7 +349,7 @@ public:
break;
case INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED:
{
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
{
announcer->DespawnOrUnsummon();
announcer->SetHomePosition(735.81f, 661.92f, 412.39f, 4.714f);
@ -358,28 +358,28 @@ public:
announcer->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]))
{
uint32 entry = c->GetEntry();
c->DespawnOrUnsummon();
switch( i )
switch (i)
{
case 0:
if( Creature* pBoss = announcer->SummonCreature(entry, 736.695f, 650.02f, 412.4f, 3 * M_PI / 2) )
if (Creature* pBoss = announcer->SummonCreature(entry, 736.695f, 650.02f, 412.4f, 3 * M_PI / 2))
{
NPC_GrandChampionGUID[0] = pBoss->GetGUID();
pBoss->AI()->SetData(0, 2);
}
break;
case 1:
if( Creature* pBoss = announcer->SummonCreature(entry, 756.32f, 650.05f, 412.4f, 3 * M_PI / 2) )
if (Creature* pBoss = announcer->SummonCreature(entry, 756.32f, 650.05f, 412.4f, 3 * M_PI / 2))
{
NPC_GrandChampionGUID[1] = pBoss->GetGUID();
pBoss->AI()->SetData(1, 2);
}
break;
case 2:
if( Creature* pBoss = announcer->SummonCreature(entry, 746.5f, 650.65f, 411.7f, 3 * M_PI / 2) )
if (Creature* pBoss = announcer->SummonCreature(entry, 746.5f, 650.65f, 411.7f, 3 * M_PI / 2))
{
NPC_GrandChampionGUID[2] = pBoss->GetGUID();
pBoss->AI()->SetData(2, 2);
@ -397,17 +397,17 @@ public:
for( uint8 i = 0; i < 3; ++i )
for( uint8 j = 0; j < 3; ++j )
{
if( Creature* c = instance->GetCreature(NPC_ArgentSoldierGUID[i][j]) )
if (Creature* c = instance->GetCreature(NPC_ArgentSoldierGUID[i][j]))
c->DespawnOrUnsummon();
NPC_ArgentSoldierGUID[i][j].Clear();
}
if( Creature* c = instance->GetCreature(NPC_ArgentChampionGUID) )
if (Creature* c = instance->GetCreature(NPC_ArgentChampionGUID))
{
c->AI()->DoAction(-1); // paletress despawn memory
c->DespawnOrUnsummon();
}
NPC_ArgentChampionGUID.Clear();
if( Creature* c = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* c = instance->GetCreature(NPC_AnnouncerGUID))
{
c->DespawnOrUnsummon();
c->SetHomePosition(743.14f, 628.77f, 411.2f, 4.71239f);
@ -422,16 +422,16 @@ public:
case INSTANCE_PROGRESS_ARGENT_CHALLENGE_DIED:
// revert to INSTANCE_PROGRESS_ARGENT_CHALLENGE_DIED
{
if( Creature* c = instance->GetCreature(NPC_BlackKnightVehicleGUID) )
if (Creature* c = instance->GetCreature(NPC_BlackKnightVehicleGUID))
c->DespawnOrUnsummon();
NPC_BlackKnightVehicleGUID.Clear();
if( Creature* c = instance->GetCreature(NPC_BlackKnightGUID) )
if (Creature* c = instance->GetCreature(NPC_BlackKnightGUID))
{
c->AI()->DoAction(-1);
c->DespawnOrUnsummon();
}
NPC_BlackKnightGUID.Clear();
if( Creature* c = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* c = instance->GetCreature(NPC_AnnouncerGUID))
{
c->DespawnOrUnsummon();
c->SetHomePosition(743.14f, 628.77f, 411.2f, 4.71239f);
@ -443,7 +443,7 @@ public:
}
break;
case INSTANCE_PROGRESS_FINISHED:
if( Creature* c = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* c = instance->GetCreature(NPC_AnnouncerGUID))
c->DespawnOrUnsummon();
break;
}
@ -460,7 +460,7 @@ public:
uint32 GetData(uint32 uiData) const override
{
switch( uiData )
switch (uiData)
{
case DATA_INSTANCE_PROGRESS:
return InstanceProgress;
@ -473,7 +473,7 @@ public:
ObjectGuid GetGuidData(uint32 uiData) const override
{
switch( uiData )
switch (uiData)
{
case DATA_ANNOUNCER:
return NPC_AnnouncerGUID;
@ -486,21 +486,21 @@ public:
void SetData(uint32 uiType, uint32 uiData) override
{
switch( uiType )
switch (uiType)
{
case DATA_ANNOUNCER_GOSSIP_SELECT:
switch( InstanceProgress )
switch (InstanceProgress)
{
case INSTANCE_PROGRESS_INITIAL:
if (uiData == 0) // normal intro
{
shortver = false;
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
{
if( GameObject* gate = instance->GetGameObject(GO_MainGateGUID) )
if (GameObject* gate = instance->GetGameObject(GO_MainGateGUID))
announcer->SetFacingToObject(gate);
if( Creature* tirion = instance->GetCreature(NPC_TirionGUID) )
if (Creature* tirion = instance->GetCreature(NPC_TirionGUID))
tirion->AI()->Talk(TEXT_WELCOME);
}
events.RescheduleEvent(EVENT_YELL_WELCOME_2, 8s);
@ -521,7 +521,7 @@ public:
InstanceProgress = INSTANCE_PROGRESS_GRAND_CHAMPIONS_REACHED_DEST;
uiData = DONE; // save to db
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
{
announcer->SetUnitMovementFlags(MOVEMENTFLAG_WALKING);
announcer->GetMotionMaster()->MovePoint(1, 735.81f, 661.92f, 412.39f);
@ -530,10 +530,10 @@ public:
}
break;
case INSTANCE_PROGRESS_CHAMPIONS_DEAD:
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
{
Counter = urand(0, 1);
if( Counter )
if (Counter)
announcer->AI()->Talk(SAY_EADRIC_INTRO_ANNOUNCER);
else
announcer->AI()->Talk(SAY_JAEREN_PALETRESS_INTRO);
@ -542,7 +542,7 @@ public:
events.RescheduleEvent(EVENT_START_ARGENT_CHALLENGE_INTRO, 0ms);
break;
case INSTANCE_PROGRESS_ARGENT_CHALLENGE_DIED:
if( Creature* tirion = instance->GetCreature(NPC_TirionGUID) )
if (Creature* tirion = instance->GetCreature(NPC_TirionGUID))
tirion->AI()->Talk(TEXT_BK_INTRO);
events.RescheduleEvent(EVENT_SUMMON_BLACK_KNIGHT, 3s);
break;
@ -551,7 +551,7 @@ public:
case DATA_GRAND_CHAMPION_REACHED_DEST:
if (shortver)
break;
switch( uiData )
switch (uiData)
{
case 0:
events.ScheduleEvent(EVENT_SUMMON_GRAND_CHAMPION_2, 0ms);
@ -560,7 +560,7 @@ public:
events.ScheduleEvent(EVENT_SUMMON_GRAND_CHAMPION_3, 0ms);
break;
case 2:
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
{
InstanceProgress = INSTANCE_PROGRESS_GRAND_CHAMPIONS_REACHED_DEST;
uiData = DONE; // save to db
@ -572,10 +572,10 @@ public:
}
break;
case DATA_MOUNT_DIED:
switch( InstanceProgress )
switch (InstanceProgress)
{
case INSTANCE_PROGRESS_GRAND_CHAMPIONS_REACHED_DEST: // fighting group 1/3
if( ++Counter >= 3 )
if (++Counter >= 3)
{
Counter = 0;
InstanceProgress = INSTANCE_PROGRESS_CHAMPION_GROUP_DIED_1;
@ -584,7 +584,7 @@ public:
}
break;
case INSTANCE_PROGRESS_CHAMPION_GROUP_DIED_1: // fighting group 2/3
if( ++Counter >= 3 )
if (++Counter >= 3)
{
Counter = 0;
InstanceProgress = INSTANCE_PROGRESS_CHAMPION_GROUP_DIED_2;
@ -593,7 +593,7 @@ public:
}
break;
case INSTANCE_PROGRESS_CHAMPION_GROUP_DIED_2: // fighting group 3/3
if( ++Counter >= 3 )
if (++Counter >= 3)
{
Counter = 0;
InstanceProgress = INSTANCE_PROGRESS_CHAMPION_GROUP_DIED_3;
@ -602,7 +602,7 @@ public:
}
break;
case INSTANCE_PROGRESS_CHAMPION_GROUP_DIED_3: // fighting grand champions (on vehicles)
if( ++Counter >= 3 )
if (++Counter >= 3)
{
Counter = 0;
InstanceProgress = INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED;
@ -618,7 +618,7 @@ public:
--Counter;
break;
case DATA_GRAND_CHAMPION_DIED:
if( ++Counter >= 3 )
if (++Counter >= 3)
{
Counter = 0;
VehicleList.clear();
@ -627,7 +627,7 @@ public:
m_auiEncounter[0] = DONE;
bool creditCasted = false;
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]))
{
c->GetMotionMaster()->MovePoint(9, 747.36f, 670.07f, 411.9f);
if (!creditCasted)
@ -636,7 +636,7 @@ public:
creditCasted = true;
}
}
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
{
announcer->GetMotionMaster()->MovePoint(0, 743.14f, 628.77f, 411.2f);
announcer->SummonGameObject(instance->IsHeroic() ? GO_CHAMPIONS_LOOT_H : GO_CHAMPIONS_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, 0, 0, 0, 0, 90000000); // [LOOT]
@ -645,12 +645,12 @@ public:
}
// bind players to instance
if( instance->IsHeroic() )
if (instance->IsHeroic())
instance->ToInstanceMap()->PermBindAllPlayers();
}
break;
case DATA_ARGENT_SOLDIER_DEFEATED:
if( ++Counter >= 9 )
if (++Counter >= 9)
{
Counter = 0;
InstanceProgress = INSTANCE_PROGRESS_ARGENT_SOLDIERS_DIED;
@ -661,7 +661,7 @@ public:
case BOSS_ARGENT_CHALLENGE:
{
m_auiEncounter[1] = uiData;
if( uiData == DONE )
if (uiData == DONE)
{
HandleGameObject(GO_EnterGateGUID, true);
InstanceProgress = INSTANCE_PROGRESS_ARGENT_CHALLENGE_DIED;
@ -685,7 +685,7 @@ public:
HandleGameObject(GO_EnterGateGUID, false);
bAchievIveHadWorse = true;
}
else if( uiData == DONE )
else if (uiData == DONE)
{
HandleGameObject(GO_EnterGateGUID, true);
InstanceProgress = INSTANCE_PROGRESS_FINISHED;
@ -698,7 +698,7 @@ public:
break;
}
if( uiData == DONE )
if (uiData == DONE)
SaveToDB();
}
@ -708,7 +708,7 @@ public:
uint32 MINION_TO_SUMMON = 0;
int32 TEXT_ID = 0;
switch( BossNumber )
switch (BossNumber)
{
case 0:
CHAMPION_TO_SUMMON = NPC_MOKRA;
@ -754,7 +754,7 @@ public:
break;
}
if( Creature* pBoss = instance->SummonCreature(CHAMPION_TO_SUMMON, SpawnPos) )
if (Creature* pBoss = instance->SummonCreature(CHAMPION_TO_SUMMON, SpawnPos))
{
NPC_GrandChampionGUID[BossOrder] = pBoss->GetGUID();
pBoss->ToCreature()->SetReactState(REACT_PASSIVE);
@ -764,7 +764,7 @@ public:
pBoss->AI()->SetData(BossOrder, (shortver ? 1 : 0));
for( uint8 i = 0; i < 3; ++i )
if( Creature* pAdd = instance->SummonCreature(MINION_TO_SUMMON, SpawnPos) )
if (Creature* pAdd = instance->SummonCreature(MINION_TO_SUMMON, SpawnPos))
{
NPC_GrandChampionMinionsGUID[BossOrder][i] = pAdd->GetGUID();
pAdd->SetReactState(REACT_PASSIVE);
@ -776,7 +776,7 @@ public:
}
if (!shortver)
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
{
announcer->AI()->Talk(TEXT_ID); /// @todo: Missing Argent Raid Spectator cheers.
}
@ -785,7 +785,7 @@ public:
void Update(uint32 diff) override
{
events.Update(diff);
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case EVENT_NULL:
break;
@ -842,15 +842,15 @@ public:
}
case EVENT_GRAND_GROUP_1_MOVE_MIDDLE:
{
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
{
announcer->SetFacingTo(4.714f);
if( Creature* tirion = instance->GetCreature(NPC_TirionGUID) )
if (Creature* tirion = instance->GetCreature(NPC_TirionGUID))
tirion->AI()->Talk(TEXT_BEGIN);
HandleGameObject(GO_EnterGateGUID, false);
}
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[1][i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[1][i]))
{
float angle = rand_norm() * 2 * M_PI;
c->GetMotionMaster()->MovePoint(0, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * std::sin(angle), 411.3f);
@ -862,12 +862,12 @@ public:
case EVENT_GRAND_GROUP_1_ATTACK:
{
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[1][i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[1][i]))
{
c->SetReactState(REACT_AGGRESSIVE);
c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
c->SetImmuneToAll(false);
if( Unit* target = c->SelectNearestTarget(200.0f) )
if (Unit* target = c->SelectNearestTarget(200.0f))
c->AI()->AttackStart(target);
c->AI()->DoZoneInCombat();
}
@ -877,7 +877,7 @@ public:
case EVENT_GRAND_GROUP_2_MOVE_MIDDLE:
{
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[0][i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[0][i]))
{
float angle = rand_norm() * 2 * M_PI;
c->GetMotionMaster()->MovePoint(0, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * std::sin(angle), 411.3f);
@ -889,12 +889,12 @@ public:
case EVENT_GRAND_GROUP_2_ATTACK:
{
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[0][i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[0][i]))
{
c->SetReactState(REACT_AGGRESSIVE);
c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
c->SetImmuneToAll(false);
if( Unit* target = c->SelectNearestTarget(200.0f) )
if (Unit* target = c->SelectNearestTarget(200.0f))
c->AI()->AttackStart(target);
c->AI()->DoZoneInCombat();
}
@ -903,7 +903,7 @@ public:
case EVENT_GRAND_GROUP_3_MOVE_MIDDLE:
{
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[2][i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[2][i]))
{
float angle = rand_norm() * 2 * M_PI;
c->GetMotionMaster()->MovePoint(0, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * std::sin(angle), 411.3f);
@ -915,12 +915,12 @@ public:
case EVENT_GRAND_GROUP_3_ATTACK:
{
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[2][i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[2][i]))
{
c->SetReactState(REACT_AGGRESSIVE);
c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
c->SetImmuneToAll(false);
if( Unit* target = c->SelectNearestTarget(200.0f) )
if (Unit* target = c->SelectNearestTarget(200.0f))
c->AI()->AttackStart(target);
c->AI()->DoZoneInCombat();
}
@ -929,7 +929,7 @@ public:
case EVENT_GRAND_CHAMPIONS_MOVE_MIDDLE:
{
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]))
{
float angle = rand_norm() * 2 * M_PI;
c->GetMotionMaster()->MovePoint(4, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * std::sin(angle), 411.3f);
@ -941,12 +941,12 @@ public:
case EVENT_GRAND_CHAMPIONS_MOUNTS_ATTACK:
{
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]))
{
c->SetReactState(REACT_AGGRESSIVE);
c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
c->SetImmuneToAll(false);
if( Unit* target = c->SelectNearestTarget(200.0f) )
if (Unit* target = c->SelectNearestTarget(200.0f))
c->AI()->AttackStart(target);
c->AI()->DoZoneInCombat();
c->CastSpell(c, 67865, true); // SPELL_TRAMPLE_AURA
@ -956,10 +956,10 @@ public:
case EVENT_GRAND_CHAMPIONS_MOVE_SIDE:
{
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]))
{
c->AI()->DoAction(1);
switch( i )
switch (i)
{
case 0:
c->GetMotionMaster()->MovePoint(5, 736.695f, 650.02f, 412.4f);
@ -979,12 +979,12 @@ public:
case EVENT_GRAND_CHAMPIONS_ATTACK:
{
for( uint8 i = 0; i < 3; ++i )
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
if (Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]))
{
c->SetReactState(REACT_AGGRESSIVE);
c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
c->SetImmuneToAll(false);
if( Unit* target = c->SelectNearestTarget(200.0f) )
if (Unit* target = c->SelectNearestTarget(200.0f))
c->AI()->AttackStart(target);
c->AI()->DoZoneInCombat();
c->AI()->DoAction(2);
@ -993,7 +993,7 @@ public:
break;
case EVENT_GRATZ_SLAIN_CHAMPIONS:
{
if( Creature* tirion = instance->GetCreature(NPC_TirionGUID) )
if (Creature* tirion = instance->GetCreature(NPC_TirionGUID))
tirion->AI()->Talk(TEXT_GRATZ_SLAIN_CHAMPIONS);
HandleGameObject(GO_EnterGateGUID, true);
@ -1001,15 +1001,15 @@ public:
break;
case EVENT_RESTORE_ANNOUNCER_GOSSIP:
{
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
announcer->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
}
break;
case EVENT_START_ARGENT_CHALLENGE_INTRO:
{
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
{
if( GameObject* gate = instance->GetGameObject(GO_MainGateGUID) )
if (GameObject* gate = instance->GetGameObject(GO_MainGateGUID))
{
announcer->SetFacingToObject(gate);
HandleGameObject(GO_MainGateGUID, true, gate);
@ -1023,19 +1023,19 @@ public:
float x = pos.GetPositionX();
pos.m_positionX = x - 2.0f + (i - 1) * 10.0f;
if( Creature* pTrash = instance->SummonCreature(NPC_ARGENT_LIGHTWIELDER, pos) )
if (Creature* pTrash = instance->SummonCreature(NPC_ARGENT_LIGHTWIELDER, pos))
{
pTrash->AI()->SetData(i, 0);
NPC_ArgentSoldierGUID[i][0] = pTrash->GetGUID();
}
pos.m_positionX = x + (i - 1) * 10.0f;
if( Creature* pTrash = instance->SummonCreature(NPC_ARGENT_MONK, pos) )
if (Creature* pTrash = instance->SummonCreature(NPC_ARGENT_MONK, pos))
{
pTrash->AI()->SetData(i, 0);
NPC_ArgentSoldierGUID[i][1] = pTrash->GetGUID();
}
pos.m_positionX = x + 2.0f + (i - 1) * 10.0f;
if( Creature* pTrash = instance->SummonCreature(NPC_PRIESTESS, pos) )
if (Creature* pTrash = instance->SummonCreature(NPC_PRIESTESS, pos))
{
pTrash->AI()->SetData(i, 0);
NPC_ArgentSoldierGUID[i][2] = pTrash->GetGUID();
@ -1046,7 +1046,7 @@ public:
break;
case EVENT_SUMMON_ARGENT_CHALLENGE:
{
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
announcer->GetMotionMaster()->MovePoint(0, 735.81f, 661.92f, 412.39f);
if (Creature* boss = instance->SummonCreature(Counter ? NPC_EADRIC : NPC_PALETRESS, SpawnPosition))
boss->GetMotionMaster()->MovePoint(0, 746.881f, 660.263f, 411.7f);
@ -1057,15 +1057,15 @@ public:
break;
case EVENT_ARGENT_CHALLENGE_SAY_1:
{
if( Creature* ac = instance->GetCreature(NPC_ArgentChampionGUID) )
if (Creature* ac = instance->GetCreature(NPC_ArgentChampionGUID))
ac->AI()->Talk(Counter ? SAY_EADRIC_INTRO : SAY_PALETRESS_INTRO_1);
if( !Counter )
if (!Counter)
events.ScheduleEvent(EVENT_ARGENT_CHALLENGE_SAY_2, 6s);
}
break;
case EVENT_ARGENT_CHALLENGE_SAY_2:
{
if( Creature* ac = instance->GetCreature(NPC_ArgentChampionGUID) )
if (Creature* ac = instance->GetCreature(NPC_ArgentChampionGUID))
ac->AI()->Talk(SAY_PALETRESS_INTRO_2);
}
break;
@ -1074,14 +1074,14 @@ public:
Counter = 0;
for( uint8 i = 0; i < 3; ++i )
for( uint8 j = 0; j < 3; ++j )
if( Creature* c = instance->GetCreature(NPC_ArgentSoldierGUID[i][j]) )
if (Creature* c = instance->GetCreature(NPC_ArgentSoldierGUID[i][j]))
{
c->SetReactState(REACT_AGGRESSIVE);
c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
c->SetImmuneToAll(false);
//c->AI()->DoZoneInCombat();
}
if( Creature* tirion = instance->GetCreature(NPC_TirionGUID) )
if (Creature* tirion = instance->GetCreature(NPC_TirionGUID))
tirion->AI()->Talk(TEXT_YOU_MAY_BEGIN);
}
break;
@ -1096,12 +1096,12 @@ public:
break;
case EVENT_ARGENT_CHALLENGE_ATTACK:
{
if( Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID) )
if (Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID))
{
boss->SetReactState(REACT_AGGRESSIVE);
boss->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
boss->SetImmuneToAll(false);
if( Unit* target = boss->SelectNearestTarget(200.0f) )
if (Unit* target = boss->SelectNearestTarget(200.0f))
boss->AI()->AttackStart(target);
boss->AI()->DoZoneInCombat();
}
@ -1109,7 +1109,7 @@ public:
break;
case EVENT_ARGENT_CHALLENGE_RUN_MIDDLE:
{
if( Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID) )
if (Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID))
{
boss->GetMotionMaster()->MovePoint(1, 747.13f, 628.037f, 411.2f);
events.ScheduleEvent(EVENT_ARGENT_CHALLENGE_LEAVE_CHEST, 6s);
@ -1118,12 +1118,12 @@ public:
break;
case EVENT_ARGENT_CHALLENGE_LEAVE_CHEST:
{
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if( Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
if (Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID))
{
announcer->GetMotionMaster()->MovePoint(0, 743.14f, 628.77f, 411.2f);
uint32 chest = 0;
if( instance->IsHeroic() )
if (instance->IsHeroic())
chest = (boss->GetEntry() == NPC_EADRIC || boss->GetEntry() == NPC_EADRIC_H) ? GO_EADRIC_LOOT_H : GO_PALETRESS_LOOT_H;
else
chest = (boss->GetEntry() == NPC_EADRIC || boss->GetEntry() == NPC_EADRIC_H) ? GO_EADRIC_LOOT : GO_PALETRESS_LOOT;
@ -1136,7 +1136,7 @@ public:
break;
case EVENT_ARGENT_CHALLENGE_DISAPPEAR:
{
if( Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID) )
if (Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID))
{
boss->GetMotionMaster()->MovePoint(0, SpawnPosition);
boss->DespawnOrUnsummon(3000);
@ -1145,18 +1145,18 @@ public:
break;
case EVENT_SUMMON_BLACK_KNIGHT:
{
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if( Creature* bk_vehicle = announcer->SummonCreature(VEHICLE_BLACK_KNIGHT, 769.834f, 651.915f, 447.035f, 0.0f) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
if (Creature* bk_vehicle = announcer->SummonCreature(VEHICLE_BLACK_KNIGHT, 769.834f, 651.915f, 447.035f, 0.0f))
{
NPC_BlackKnightVehicleGUID = bk_vehicle->GetGUID();
bk_vehicle->SetReactState(REACT_PASSIVE);
bk_vehicle->SetFacingTo(M_PI);
if( Vehicle* v = bk_vehicle->GetVehicleKit() )
if( Unit* bk = v->GetPassenger(0) )
if (Vehicle* v = bk_vehicle->GetVehicleKit())
if (Unit* bk = v->GetPassenger(0))
{
NPC_BlackKnightGUID = bk->GetGUID();
bk->SendMovementFlagUpdate(); // put him on vehicle visually
if( bk->IsCreature() )
if (bk->IsCreature())
bk->ToCreature()->SetReactState(REACT_PASSIVE);
}
@ -1167,7 +1167,7 @@ public:
break;
case EVENT_START_BLACK_KNIGHT_SCENE:
{
if( Creature* bk = instance->GetCreature(NPC_BlackKnightGUID) )
if (Creature* bk = instance->GetCreature(NPC_BlackKnightGUID))
{
Position exitPos = { 751.003357f, 638.145508f, 411.570129f, M_PI };
bk->ExitVehicle(/*&exitPos*/);
@ -1179,9 +1179,9 @@ public:
break;
case EVENT_BLACK_KNIGHT_CAST_ANNOUNCER:
{
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
{
if( Creature* bk = instance->GetCreature(NPC_BlackKnightGUID) )
if (Creature* bk = instance->GetCreature(NPC_BlackKnightGUID))
{
bk->SetPosition(745.016f, 631.506f, 411.575f, bk->GetAngle(announcer));
bk->SetHomePosition(*bk);
@ -1189,7 +1189,7 @@ public:
announcer->SetFacingToObject(bk);
announcer->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
bk->AddAura(68306, announcer); // spell has attribute player only
if( Creature* tirion = instance->GetCreature(NPC_TirionGUID) )
if (Creature* tirion = instance->GetCreature(NPC_TirionGUID))
tirion->AI()->Talk(TEXT_BK_MEANING);
}
}
@ -1198,7 +1198,7 @@ public:
break;
case EVENT_BLACK_KNIGHT_KILL_ANNOUNCER:
{
if( Creature* bk_vehicle = instance->GetCreature(NPC_BlackKnightVehicleGUID) )
if (Creature* bk_vehicle = instance->GetCreature(NPC_BlackKnightVehicleGUID))
bk_vehicle->AI()->DoAction(1);
events.ScheduleEvent(EVENT_BLACK_KNIGHT_MOVE_FORWARD, 4s);
@ -1206,13 +1206,13 @@ public:
break;
case EVENT_BLACK_KNIGHT_MOVE_FORWARD:
{
if( Creature* bk = instance->GetCreature(NPC_BlackKnightGUID) )
if (Creature* bk = instance->GetCreature(NPC_BlackKnightGUID))
{
bk->SetUnitMovementFlags(MOVEMENTFLAG_WALKING);
bk->GetMotionMaster()->MovePoint(0, 746.81f, 623.15f, 411.42f);
bk->AI()->Talk(SAY_BK_INTRO_2);
}
if( Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID) )
if (Creature* announcer = instance->GetCreature(NPC_AnnouncerGUID))
if (announcer->IsAlive())
Unit::Kill(announcer, announcer);
events.ScheduleEvent(EVENT_BLACK_KNIGHT_SAY_TASK, 14s);
@ -1220,7 +1220,7 @@ public:
break;
case EVENT_BLACK_KNIGHT_SAY_TASK:
{
if( Creature* bk = instance->GetCreature(NPC_BlackKnightGUID) )
if (Creature* bk = instance->GetCreature(NPC_BlackKnightGUID))
{
bk->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
bk->AI()->Talk(SAY_BK_INTRO_3);
@ -1230,11 +1230,11 @@ public:
break;
case EVENT_BLACK_KNIGHT_ATTACK:
{
if( Creature* bk = instance->GetCreature(NPC_BlackKnightGUID) )
if (Creature* bk = instance->GetCreature(NPC_BlackKnightGUID))
{
bk->SetReactState(REACT_AGGRESSIVE);
bk->ReplaceAllUnitFlags(UNIT_FLAG_NONE);
if( Unit* target = bk->SelectNearestTarget(200.0f) )
if (Unit* target = bk->SelectNearestTarget(200.0f))
bk->AI()->AttackStart(target);
bk->AI()->DoZoneInCombat();
bk->AI()->DoAction(1);
@ -1246,7 +1246,7 @@ public:
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/) override
{
switch(criteria_id)
switch (criteria_id)
{
case 11789: // I've Had Worse criteria id
return bAchievIveHadWorse;

View file

@ -88,14 +88,14 @@ public:
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) override
{
if(!creature->HasNpcFlag(UNIT_NPC_FLAG_GOSSIP))
if (!creature->HasNpcFlag(UNIT_NPC_FLAG_GOSSIP))
return true;
InstanceScript* pInstance = creature->GetInstanceScript();
if(!pInstance)
if (!pInstance)
return true;
if(uiAction == GOSSIP_ACTION_INFO_DEF + 1 || uiAction == GOSSIP_ACTION_INFO_DEF + 2 || uiAction == GOSSIP_ACTION_INFO_DEF + 3 || uiAction == GOSSIP_ACTION_INFO_DEF + 4)
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1 || uiAction == GOSSIP_ACTION_INFO_DEF + 2 || uiAction == GOSSIP_ACTION_INFO_DEF + 3 || uiAction == GOSSIP_ACTION_INFO_DEF + 4)
{
pInstance->SetData(DATA_ANNOUNCER_GOSSIP_SELECT, (uiAction == GOSSIP_ACTION_INFO_DEF + 2 ? 1 : 0));
creature->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
@ -117,9 +117,9 @@ public:
void Reset() override
{
InstanceScript* pInstance = me->GetInstanceScript();
if( !pInstance )
if (!pInstance)
return;
if( pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_ALLIANCE )
if (pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_ALLIANCE )
me->UpdateEntry(NPC_ARELAS);
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); // removed during black knight scene
}
@ -135,7 +135,7 @@ public:
if (type != EFFECT_MOTION_TYPE)
return;
InstanceScript* pInstance = me->GetInstanceScript();
if( !pInstance )
if (!pInstance)
return;
if (pInstance->GetData(DATA_INSTANCE_PROGRESS) < INSTANCE_PROGRESS_ARGENT_CHALLENGE_DIED)
return;

View file

@ -182,7 +182,7 @@ public:
{
float angle = rand_norm() * 2 * M_PI;
float dist = rand_norm() * 40.0f;
if( Creature* c = me->SummonCreature(NPC_SCARAB, AnubLocs[0].GetPositionX() + cos(angle) * dist, AnubLocs[0].GetPositionY() + std::sin(angle) * dist, AnubLocs[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000) )
if (Creature* c = me->SummonCreature(NPC_SCARAB, AnubLocs[0].GetPositionX() + cos(angle) * dist, AnubLocs[0].GetPositionY() + std::sin(angle) * dist, AnubLocs[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000))
{
c->SetFaction(FACTION_PREY);
c->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
@ -193,7 +193,7 @@ public:
void DoAction(int32 param) override
{
switch( param )
switch (param)
{
case -1:
summons.DespawnAll();
@ -210,7 +210,7 @@ public:
events.RescheduleEvent(EVENT_SPELL_PENETRATING_COLD, 15s, 20s);
events.RescheduleEvent(EVENT_SUMMON_NERUBIAN, 5s, 8s);
events.RescheduleEvent(EVENT_SUBMERGE, 80s);
if( !IsHeroic() )
if (!IsHeroic())
events.RescheduleEvent(EVENT_RESPAWN_SPHERE, 4s);
for (ObjectGuid const& guid : summons)
@ -224,15 +224,15 @@ public:
}
summons.clear();
for( uint8 i = 0; i < 4; ++i )
if( Creature* c = me->SummonCreature(NPC_BURROW, AnubLocs[i + 1]) )
if (Creature* c = me->SummonCreature(NPC_BURROW, AnubLocs[i + 1]))
BurrowGUID[i] = c->GetGUID();
for( uint8 i = 0; i < 6; ++i )
if( Creature* c = me->SummonCreature(NPC_FROST_SPHERE, AnubLocs[i + 5]) )
if (Creature* c = me->SummonCreature(NPC_FROST_SPHERE, AnubLocs[i + 5]))
SphereGUID[i] = c->GetGUID();
Talk(SAY_AGGRO);
DoZoneInCombat();
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_ANUBARAK, IN_PROGRESS);
}
@ -243,21 +243,21 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
if( !bPhase3 && HealthBelowPct(30) && !me->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE) && !me->HasAura(SPELL_SUBMERGE) && !me->HasAura(SPELL_EMERGE) )
if (!bPhase3 && HealthBelowPct(30) && !me->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE) && !me->HasAura(SPELL_SUBMERGE) && !me->HasAura(SPELL_EMERGE))
{
bPhase3 = true;
events.CancelEvent(EVENT_SUBMERGE);
events.CancelEvent(EVENT_EMERGE);
events.CancelEvent(EVENT_EMERGE_2);
if( !IsHeroic() )
if (!IsHeroic())
events.CancelEvent(EVENT_SUMMON_NERUBIAN);
me->CastSpell((Unit*)nullptr, SPELL_LEECHING_SWARM, false);
Talk(EMOTE_LEECHING_SWARM);
@ -265,7 +265,7 @@ public:
return;
}
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
@ -280,10 +280,10 @@ public:
uint8 i = StartAt;
do
{
if( Creature* c = ObjectAccessor::GetCreature(*me, SphereGUID[i]) )
if( !c->HasAura(SPELL_FROST_SPHERE) )
if (Creature* c = ObjectAccessor::GetCreature(*me, SphereGUID[i]))
if (!c->HasAura(SPELL_FROST_SPHERE))
{
if( Creature* c = me->SummonCreature(NPC_FROST_SPHERE, AnubLocs[i + 5]) )
if (Creature* c = me->SummonCreature(NPC_FROST_SPHERE, AnubLocs[i + 5]))
SphereGUID[i] = c->GetGUID();
break;
}
@ -294,7 +294,7 @@ public:
break;
case EVENT_SPELL_FREEZING_SLASH:
{
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_FREEZING_SLASH, false);
events.Repeat(15s, 20s);
}
@ -332,7 +332,7 @@ public:
case EVENT_SUMMON_SCARAB:
{
uint8 i = urand(0, 3);
if( Creature* c = ObjectAccessor::GetCreature(*me, BurrowGUID[i]) )
if (Creature* c = ObjectAccessor::GetCreature(*me, BurrowGUID[i]))
me->CastSpell(c, SPELL_SUMMON_SCARAB, true);
events.Repeat(4s);
}
@ -368,7 +368,7 @@ public:
void JustSummoned(Creature* summon) override
{
if( !summon )
if (!summon)
return;
summons.Summon(summon);
@ -379,13 +379,13 @@ public:
events.Reset();
summons.DespawnAll();
Talk(SAY_DEATH);
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_ANUBARAK, DONE);
}
void KilledUnit(Unit* who) override
{
if( who->IsPlayer() )
if (who->IsPlayer())
Talk(SAY_KILL_PLAYER);
}
@ -394,7 +394,7 @@ public:
events.Reset();
summons.DespawnAll();
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_FAILED, 1);
}
@ -409,7 +409,7 @@ public:
if (!bIntro)
{
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
if( !me->IsInCombat() )
if (!me->IsInCombat())
Talk(SAY_INTRO);
bIntro = true;
}
@ -442,7 +442,7 @@ public:
void DoAction(int32 param) override
{
if( param == 1 )
if (param == 1)
despawnTimer = 2000;
}
@ -453,11 +453,11 @@ public:
determinationTimer = urand(10000, 50000);
despawnTimer = 0;
if (me->GetFaction() == FACTION_MONSTER_2) // hostile - it's phase 2
if( Unit* target = me->SelectNearestTarget(250.0f) )
if (Unit* target = me->SelectNearestTarget(250.0f))
{
AttackStart(target);
DoZoneInCombat();
if( Unit* t = SelectTarget(SelectTargetMethod::Random, 0, 250.0f, true) )
if (Unit* t = SelectTarget(SelectTargetMethod::Random, 0, 250.0f, true))
{
me->AddThreat(t, 20000.0f);
AttackStart(t);
@ -472,9 +472,9 @@ public:
void UpdateAI(uint32 diff) override
{
if( despawnTimer )
if (despawnTimer)
{
if( despawnTimer <= (int32)diff )
if (despawnTimer <= (int32)diff )
{
despawnTimer = 0;
me->DisappearAndDie();
@ -485,10 +485,10 @@ public:
return;
}
if( !UpdateVictim() )
if (!UpdateVictim())
return;
if( determinationTimer <= (int32)diff )
if (determinationTimer <= (int32)diff )
{
me->CastSpell(me, SPELL_DETERMINATION, false);
determinationTimer = urand(20000, 60000);
@ -556,10 +556,10 @@ public:
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
if( me->GetHealth() <= damage )
if (me->GetHealth() <= damage )
{
damage = 0;
if( !me->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE) )
if (!me->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE))
{
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->GetMotionMaster()->MoveIdle();
@ -571,7 +571,7 @@ public:
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if( spell->Id == SPELL_SPIKE_FAIL )
if (spell->Id == SPELL_SPIKE_FAIL)
{
me->RemoveAllAuras();
me->DespawnOrUnsummon(1500);
@ -580,9 +580,9 @@ public:
void UpdateAI(uint32 diff) override
{
if( permafrostTimer )
if (permafrostTimer)
{
if( permafrostTimer <= diff )
if (permafrostTimer <= diff)
{
permafrostTimer = 0;
me->RemoveAurasDueToSpell(SPELL_FROST_SPHERE);
@ -631,9 +631,9 @@ public:
me->CastSpell(me, SPELL_SPIDER_FRENZY, true);
events.Reset();
events.RescheduleEvent(EVENT_SUBMERGE, 30s);
if( IsHeroic() )
if (IsHeroic())
events.RescheduleEvent(EVENT_SPELL_SHADOW_STRIKE, 30s, 45s);
if( Unit* target = me->SelectNearestTarget(250.0f) )
if (Unit* target = me->SelectNearestTarget(250.0f))
{
AttackStart(target);
DoZoneInCombat();
@ -642,13 +642,13 @@ public:
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
if( !target || !spell )
if (!target || !spell)
return;
if( spell->Id == SPELL_SHADOW_STRIKE )
if (spell->Id == SPELL_SHADOW_STRIKE)
{
float o = target->GetOrientation();
if( o >= M_PI )
if (o >= M_PI)
o -= M_PI;
else
o += M_PI;
@ -661,25 +661,25 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_SPELL_SHADOW_STRIKE:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 250.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 250.0f, true))
me->CastSpell(target, SPELL_SHADOW_STRIKE, false);
events.Repeat(30s, 45s);
break;
case EVENT_SUBMERGE:
if( HealthBelowPct(80) && !me->HasAura(RAID_MODE(66193, 67855, 67856, 67857)) ) // not having permafrost - allow submerge
if (HealthBelowPct(80) && !me->HasAura(RAID_MODE(66193, 67855, 67856, 67857))) // not having permafrost - allow submerge
{
me->GetMotionMaster()->MoveIdle();
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
@ -743,9 +743,9 @@ public:
void DoAction(int32 param) override
{
if( param == -1 )
if (param == -1)
{
if( Unit* target = ObjectAccessor::GetPlayer(*me, TargetGUID) )
if (Unit* target = ObjectAccessor::GetPlayer(*me, TargetGUID))
target->RemoveAura(SPELL_MARK);
TargetGUID.Clear();
me->RemoveAllAuras();
@ -758,7 +758,7 @@ public:
void SelectNewTarget(bool next)
{
if (TargetGUID)
if( Unit* target = ObjectAccessor::GetPlayer(*me, TargetGUID) )
if (Unit* target = ObjectAccessor::GetPlayer(*me, TargetGUID))
target->RemoveAura(SPELL_MARK);
TargetGUID.Clear();
if (!next)
@ -768,7 +768,7 @@ public:
}
DoZoneInCombat();
DoResetThreatList();
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 250.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 250.0f, true))
{
if (!next)
{
@ -791,10 +791,10 @@ public:
void UpdateAI(uint32 diff) override
{
if( TargetGUID )
if (TargetGUID)
{
Unit* target = ObjectAccessor::GetPlayer(*me, TargetGUID);
if( !target || !target->HasAura(SPELL_MARK) || !me->IsValidAttackTarget(target) || me->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE || !me->HasUnitState(UNIT_STATE_CHASE_MOVE) )
if (!target || !target->HasAura(SPELL_MARK) || !me->IsValidAttackTarget(target) || me->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE || !me->HasUnitState(UNIT_STATE_CHASE_MOVE))
{
SelectNewTarget(true);
return;
@ -803,7 +803,7 @@ public:
events.Update(diff);
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
@ -840,13 +840,13 @@ public:
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
{
if( Unit* target = GetTarget() )
if (Unit* target = GetTarget())
{
if( Creature* c = target->FindNearestCreature(NPC_FROST_SPHERE, 8.0f, true) )
if (Creature* c = target->FindNearestCreature(NPC_FROST_SPHERE, 8.0f, true))
{
target->UpdatePosition(*c, false);
target->CastCustomSpell(SPELL_SPIKE_FAIL, SPELLVALUE_MAX_TARGETS, 1);
if( target->IsCreature() )
if (target->IsCreature())
target->ToCreature()->AI()->DoAction(-1);
Remove();
return;

View file

@ -116,7 +116,7 @@ public:
void Reset() override
{
events.Reset();
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_JARAXXUS, NOT_STARTED);
std::list<Creature*> creatures;
@ -135,34 +135,34 @@ public:
events.RescheduleEvent(EVENT_SPELL_INCINERATE_FLESH, 24s, 26s);
events.RescheduleEvent(EVENT_SPELL_NETHER_POWER, 25s, 45s);
events.RescheduleEvent(EVENT_SPELL_LEGION_FLAME, 30s);
//if( GetDifficulty() == RAID_DIFFICULTY_25MAN_HEROIC )
//if (GetDifficulty() == RAID_DIFFICULTY_25MAN_HEROIC )
// events.RescheduleEvent(EVENT_SPELL_TOUCH_OF_JARAXXUS, 10s, 15s);
events.RescheduleEvent(EVENT_SUMMON_NETHER_PORTAL, 20s); // it schedules EVENT_SUMMON_VOLCANO
me->RemoveAura(SPELL_CHAINS);
Talk(SAY_AGGRO);
DoZoneInCombat();
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_JARAXXUS, IN_PROGRESS);
}
void SpellHit(Unit* caster, SpellInfo const* spell) override
{
switch( spell->Id )
switch (spell->Id)
{
case 66228:
case 67106:
case 67107:
case 67108:
if( Aura* a = me->GetAura(spell->Id) )
if (Aura* a = me->GetAura(spell->Id))
a->SetStackAmount(spell->StackAmount);
break;
case 30449:
{
if( !caster )
if (!caster)
return;
uint32 id = 0;
switch( me->GetMap()->GetDifficulty() )
switch (me->GetMap()->GetDifficulty())
{
case 0:
id = 66228;
@ -177,9 +177,9 @@ public:
id = 67108;
break;
}
if( Aura* a = me->GetAura(id) )
if (Aura* a = me->GetAura(id))
{
if( a->GetStackAmount() > 1 )
if (a->GetStackAmount() > 1 )
a->ModStackAmount(-1);
else
a->Remove();
@ -194,30 +194,30 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_SPELL_FEL_FIREBALL:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_FEL_FIREBALL, false);
events.Repeat(10s, 15s);
break;
case EVENT_SPELL_FEL_LIGHTNING:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, true))
me->CastSpell(target, SPELL_FEL_LIGHTNING, false);
events.Repeat(10s, 15s);
break;
case EVENT_SPELL_INCINERATE_FLESH:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, true))
{
Talk(EMOTE_INCINERATE, target);
Talk(SAY_INCINERATE);
@ -231,7 +231,7 @@ public:
events.Repeat(25s, 45s);
break;
case EVENT_SPELL_LEGION_FLAME:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, true))
{
Talk(EMOTE_LEGION_FLAME, target);
me->CastSpell(target, SPELL_LEGION_FLAME, false);
@ -239,7 +239,7 @@ public:
events.Repeat(30s);
break;
case EVENT_SPELL_TOUCH_OF_JARAXXUS:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
me->CastSpell(target, SPELL_TOUCH_OF_JARAXXUS, false);
events.Repeat(10s, 15s);
break;
@ -266,7 +266,7 @@ public:
{
summons.DespawnAll();
Talk(SAY_DEATH);
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_JARAXXUS, DONE);
}
@ -285,7 +285,7 @@ public:
events.Reset();
summons.DespawnAll();
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_FAILED, 1);
}
@ -311,7 +311,7 @@ public:
void Reset() override
{
if( Unit* target = me->SelectNearestTarget(200.0f) )
if (Unit* target = me->SelectNearestTarget(200.0f))
{
AttackStart(target);
DoZoneInCombat();
@ -322,20 +322,20 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_SPELL_FEL_STEAK:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 44.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 44.0f, true))
{
DoResetThreatList();
me->AddThreat(target, 50000.0f);
@ -381,7 +381,7 @@ public:
void Reset() override
{
if( Unit* target = me->SelectNearestTarget(200.0f) )
if (Unit* target = me->SelectNearestTarget(200.0f))
{
AttackStart(target);
DoZoneInCombat();
@ -389,7 +389,7 @@ public:
events.Reset();
events.RescheduleEvent(EVENT_SPELL_SHIVAN_SLASH, 10s, 20s);
events.RescheduleEvent(EVENT_SPELL_SPINNING_PAIN_SPIKE, 22s, 30s);
if( IsHeroic() )
if (IsHeroic())
events.RescheduleEvent(EVENT_SPELL_MISTRESS_KISS, 10s, 15s);
}
@ -401,25 +401,25 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_SPELL_SHIVAN_SLASH:
if( me->GetVictim() )
if (me->GetVictim())
me->CastSpell(me->GetVictim(), SPELL_SHIVAN_SLASH, false);
events.Repeat(15s, 25s);
break;
case EVENT_SPELL_SPINNING_PAIN_SPIKE:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 140.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 140.0f, true))
me->CastSpell(target, SPELL_SPINNING_PAIN_SPIKE, false);
events.Repeat(25s, 30s);
break;
@ -457,7 +457,7 @@ public:
{
if (Unit* caster = GetCaster())
if (Unit* target = GetTarget())
if( target->HasUnitState(UNIT_STATE_CASTING) )
if (target->HasUnitState(UNIT_STATE_CASTING))
{
caster->CastSpell(target, 66359, true);
SetDuration(0);

View file

@ -113,7 +113,7 @@ public:
void AttackStart(Unit* who) override
{
if( who->GetGUID() != TargetGUID )
if (who->GetGUID() != TargetGUID )
return;
ScriptedAI::AttackStart(who);
}
@ -122,26 +122,26 @@ public:
void UpdateAI(uint32 diff) override
{
if( !TargetGUID && !me->GetVehicle() )
if (!TargetGUID && !me->GetVehicle())
return;
Unit* t = ObjectAccessor::GetUnit(*me, TargetGUID);
if( !t && !(t = me->GetVehicleBase()) )
if (!t && !(t = me->GetVehicleBase()))
return;
if( t->isDead() )
if (t->isDead())
{
t->RemoveAura(SPELL_CHANGE_VEHICLE);
me->RemoveAllAuras();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
me->SetHealth(me->GetMaxHealth());
if( pInstance )
if( Creature* gormok = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(TYPE_GORMOK)) )
if( gormok->IsAlive() )
if( Vehicle* vk = gormok->GetVehicleKit() )
if (pInstance)
if (Creature* gormok = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(TYPE_GORMOK)))
if (gormok->IsAlive())
if (Vehicle* vk = gormok->GetVehicleKit())
for( uint8 i = 0; i < 4; ++i )
if( !vk->GetPassenger(i) )
if (!vk->GetPassenger(i))
{
me->EnterVehicleUnattackable(gormok, i);
Reset();
@ -153,26 +153,26 @@ public:
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_SPELL_SNOBOLLED:
if( t->IsPlayer() )
if (t->IsPlayer())
me->CastSpell((Unit*)nullptr, SPELL_SNOBOLLED, true);
break;
case EVENT_SPELL_BATTER:
if( t->IsPlayer() )
if (t->IsPlayer())
me->CastSpell(t, SPELL_BATTER);
events.Repeat(6s, 8s);
break;
case EVENT_SPELL_FIRE_BOMB:
{
if( !t->IsPlayer() && pInstance )
if (!t->IsPlayer() && pInstance )
{
GuidVector validPlayers;
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
@ -180,14 +180,14 @@ public:
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
{
if( Player* p = itr->GetSource() )
if( p->IsAlive() && p->GetGUID() != TargetGUID && (!gormok || !p->IsWithinMeleeRange(gormok)) )
if (Player* p = itr->GetSource())
if (p->IsAlive() && p->GetGUID() != TargetGUID && (!gormok || !p->IsWithinMeleeRange(gormok)))
validPlayers.push_back(p->GetGUID());
}
if( !validPlayers.empty() )
if( Player* p = ObjectAccessor::GetPlayer(*me, validPlayers.at(urand(0, validPlayers.size() - 1))) )
if( Creature* trigger = me->SummonCreature(NPC_FIRE_BOMB, *p, TEMPSUMMON_TIMED_DESPAWN, 60000) )
if (!validPlayers.empty())
if (Player* p = ObjectAccessor::GetPlayer(*me, validPlayers.at(urand(0, validPlayers.size() - 1))))
if (Creature* trigger = me->SummonCreature(NPC_FIRE_BOMB, *p, TEMPSUMMON_TIMED_DESPAWN, 60000))
{
me->CastSpell(trigger, SPELL_FIRE_BOMB_AURA, true); // periodic damage aura, speed 14.0f
me->CastSpell(trigger, SPELL_FIRE_BOMB); // visual + initial damage 4k
@ -198,7 +198,7 @@ public:
}
break;
case EVENT_SPELL_HEAD_CRACK:
if( t->IsPlayer() )
if (t->IsPlayer())
me->CastSpell(t, SPELL_HEAD_CRACK);
events.Repeat(30s, 35s);
break;
@ -209,17 +209,17 @@ public:
void JustDied(Unit* /*pKiller*/) override
{
if( Unit* t = ObjectAccessor::GetUnit(*me, TargetGUID))
if (Unit* t = ObjectAccessor::GetUnit(*me, TargetGUID))
{
t->RemoveAura(SPELL_CHANGE_VEHICLE);
if( t->IsAlive() )
if (t->IsAlive())
t->RemoveAurasDueToSpell(SPELL_SNOBOLLED);
}
}
void DoAction(int32 param) override
{
if( param == 1 && !TargetGUID )
if (param == 1 && !TargetGUID)
me->DespawnOrUnsummon();
}
};
@ -265,9 +265,9 @@ public:
events.RescheduleEvent(EVENT_PICK_SNOBOLD_TARGET, 16s, 24s);
// refresh snobold position
if( Vehicle* vk = me->GetVehicleKit() )
if (Vehicle* vk = me->GetVehicleKit())
for( uint8 i = 0; i < 4; ++i )
if( Unit* snobold = vk->GetPassenger(i) )
if (Unit* snobold = vk->GetPassenger(i))
snobold->SendMovementFlagUpdate();
}
@ -280,22 +280,22 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_SPELL_IMPALE:
if( !me->HasUnitFlag(UNIT_FLAG_DISARMED) )
if (!me->HasUnitFlag(UNIT_FLAG_DISARMED))
{
if( Unit* victim = me->GetVictim() )
if (Unit* victim = me->GetVictim())
me->CastSpell(victim, SPELL_IMPALE, false);
events.Repeat(9s, 10s);
}
@ -307,21 +307,21 @@ public:
events.Repeat(20s, 25s);
break;
case EVENT_PICK_SNOBOLD_TARGET:
if( Vehicle* vk = me->GetVehicleKit() )
if (Vehicle* vk = me->GetVehicleKit())
for( uint8 i = 0; i < 4; ++i )
if( Unit* snobold = vk->GetPassenger(i) )
if (Unit* snobold = vk->GetPassenger(i))
{
GuidVector validPlayers;
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
{
if( Player* p = itr->GetSource() )
if( p->IsAlive() && !p->GetVehicleKit() && !p->IsMounted() && !p->GetVehicle() && !p->IsGameMaster() )
if (Player* p = itr->GetSource())
if (p->IsAlive() && !p->GetVehicleKit() && !p->IsMounted() && !p->GetVehicle() && !p->IsGameMaster())
validPlayers.push_back(p->GetGUID());
}
if( !validPlayers.empty() )
if( Player* p = ObjectAccessor::GetPlayer(*me, validPlayers.at(urand(0, validPlayers.size() - 1))) )
if (!validPlayers.empty())
if (Player* p = ObjectAccessor::GetPlayer(*me, validPlayers.at(urand(0, validPlayers.size() - 1))))
{
snobold->ChangeSeat(4); // switch to hand
me->setAttackTimer(BASE_ATTACK, 3000);
@ -337,12 +337,12 @@ public:
{
me->CastSpell(me, SPELL_RISING_ANGER, true);
Player* p = ObjectAccessor::GetPlayer(*me, PlayerGUID);
if( p && p->IsAlive() && !p->GetVehicleKit() && !p->IsMounted() && !p->GetVehicle() )
if (p && p->IsAlive() && !p->GetVehicleKit() && !p->IsMounted() && !p->GetVehicle())
{
if( Vehicle* vk = me->GetVehicleKit() )
if( Unit* snobold = vk->GetPassenger(4) )
if (Vehicle* vk = me->GetVehicleKit())
if (Unit* snobold = vk->GetPassenger(4))
{
if( snobold->IsCreature() )
if (snobold->IsCreature())
{
CAST_AI(npc_snobold_vassal::npc_snobold_vassalAI, snobold->ToCreature()->AI())->TargetGUID = PlayerGUID;
snobold->ToCreature()->AI()->AttackStart(p);
@ -353,21 +353,21 @@ public:
//snobold->ClearUnitState(UNIT_STATE_ONVEHICLE);
}
}
else if( Vehicle* vk = me->GetVehicleKit() )
else if (Vehicle* vk = me->GetVehicleKit())
{
events.RescheduleEvent(EVENT_PICK_SNOBOLD_TARGET, 5s);
if( Unit* snobold = vk->GetPassenger(4) )
if( snobold->IsCreature() )
if (Unit* snobold = vk->GetPassenger(4))
if (snobold->IsCreature())
{
bool needDespawn = true;
for( uint8 i = 0; i < 4; ++i )
if( !vk->GetPassenger(i) )
if (!vk->GetPassenger(i))
{
snobold->ChangeSeat(i);
needDespawn = false;
break;
}
if( needDespawn )
if (needDespawn)
snobold->ToCreature()->DespawnOrUnsummon();
}
}
@ -383,7 +383,7 @@ public:
{
summons.DoAction(1);
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_GORMOK, DONE);
}
@ -394,7 +394,7 @@ public:
void DoAction(int32 param) override
{
switch( param )
switch (param)
{
case -1:
summons.DespawnAll();
@ -407,7 +407,7 @@ public:
events.Reset();
summons.DespawnAll();
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_FAILED, 1);
}
};
@ -488,16 +488,16 @@ struct boss_jormungarAI : public ScriptedAI
void DoAction(int32 param) override
{
switch( param )
switch (param)
{
case -1:
if( !me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE) )
if (!me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE))
events.RescheduleEvent(EVENT_SUBMERGE, 1500ms);
break;
case -2:
if( me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE) )
if (me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE))
bIsStationary = true; // it will come out mobile soon
else if( me->GetDisplayId() == _MODEL_STATIONARY )
else if (me->GetDisplayId() == _MODEL_STATIONARY )
events.RescheduleEvent(EVENT_SUBMERGE, 1s);
else
events.CancelEvent(EVENT_SUBMERGE);
@ -510,7 +510,7 @@ struct boss_jormungarAI : public ScriptedAI
void ScheduleEvents()
{
events.Reset();
if( me->GetDisplayId() == _MODEL_STATIONARY )
if (me->GetDisplayId() == _MODEL_STATIONARY )
{
me->SetAttackTime(BASE_ATTACK, 1500);
events.RescheduleEvent(EVENT_SPELL_SPRAY, (me->GetEntry() == NPC_ACIDMAW ? 20s : 15s));
@ -523,7 +523,7 @@ struct boss_jormungarAI : public ScriptedAI
events.RescheduleEvent(EVENT_SPELL_SPEW, 15s, 30s);
events.RescheduleEvent(EVENT_SPELL_SLIME_POOL, 15s);
}
if( !me->HasAura(SPELL_ENRAGE) )
if (!me->HasAura(SPELL_ENRAGE))
events.RescheduleEvent(EVENT_SUBMERGE, 45s, 50s);
}
@ -540,11 +540,11 @@ struct boss_jormungarAI : public ScriptedAI
void AttackStart(Unit* who) override
{
if( me->GetDisplayId() == _MODEL_STATIONARY )
if (me->GetDisplayId() == _MODEL_STATIONARY )
{
if( !who )
if (!who)
return;
if( me->Attack(who, true) )
if (me->Attack(who, true))
DoStartNoMovement(who);
}
else
@ -553,15 +553,15 @@ struct boss_jormungarAI : public ScriptedAI
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
@ -573,8 +573,8 @@ struct boss_jormungarAI : public ScriptedAI
Talk(EMOTE_SUBMERGE);
// second one submerge 1.5sec after the first one, used also for synchronizing
if( pInstance )
if( Creature* c = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(_TYPE_OTHER)) )
if (pInstance)
if (Creature* c = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(_TYPE_OTHER)))
c->AI()->DoAction(-1);
events.Reset();
@ -584,7 +584,7 @@ struct boss_jormungarAI : public ScriptedAI
case EVENT_MOVE_UNDERGROUND:
{
float angle = me->GetAngle(Locs[LOC_CENTER].GetPositionX() + urand(0, 20) - 10.0f, Locs[LOC_CENTER].GetPositionY() + urand(0, 20) - 10.0f), dist = urand(10, 35);
if( Creature* c = me->SummonCreature(NPC_WORLD_TRIGGER, *me, TEMPSUMMON_TIMED_DESPAWN, 6000) )
if (Creature* c = me->SummonCreature(NPC_WORLD_TRIGGER, *me, TEMPSUMMON_TIMED_DESPAWN, 6000))
{
c->SetSpeed(MOVE_RUN, 2.5f);
c->CastSpell(c, SPELL_CHURNING_GROUND, true);
@ -603,11 +603,11 @@ struct boss_jormungarAI : public ScriptedAI
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
me->StopMoving();
if( bIsStationary )
if (bIsStationary)
{
me->SetNativeDisplayId(_MODEL_MOBILE);
me->SetCombatMovement(true);
if( Unit* victim = me->GetVictim() )
if (Unit* victim = me->GetVictim())
me->GetMotionMaster()->MoveChase(victim);
}
else
@ -623,7 +623,7 @@ struct boss_jormungarAI : public ScriptedAI
}
break;
case EVENT_SPELL_SPRAY:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
me->CastSpell(target, _SPELL_SPRAY, false);
events.Repeat(20s);
break;
@ -632,7 +632,7 @@ struct boss_jormungarAI : public ScriptedAI
events.Repeat(15s, 30s);
break;
case EVENT_SPELL_BITE:
if( Unit* victim = me->GetVictim() )
if (Unit* victim = me->GetVictim())
me->CastSpell(victim, _SPELL_BITE, false);
events.Repeat(20s);
break;
@ -641,15 +641,15 @@ struct boss_jormungarAI : public ScriptedAI
events.Repeat(15s, 30s);
break;
case EVENT_SPELL_SLIME_POOL:
if( Creature* c = me->SummonCreature(NPC_SLIME_POOL, *me, TEMPSUMMON_TIMED_DESPAWN, 30000) )
if (Creature* c = me->SummonCreature(NPC_SLIME_POOL, *me, TEMPSUMMON_TIMED_DESPAWN, 30000))
c->CastSpell(c, SPELL_SLIME_POOL_EFFECT, true);
events.Repeat(30s);
break;
}
if( !me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE) )
if (!me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE))
{
if( me->GetDisplayId() == _MODEL_STATIONARY )
if (me->GetDisplayId() == _MODEL_STATIONARY )
DoSpellAttackIfReady(_SPELL_SPIT);
else
DoMeleeAttackIfReady();
@ -658,10 +658,10 @@ struct boss_jormungarAI : public ScriptedAI
void JustDied(Unit* /*pKiller*/) override
{
if( pInstance )
if (pInstance)
{
if( Creature* c = pInstance->instance->GetCreature(pInstance->GetGuidData(_TYPE_OTHER)) )
if( c->IsAlive() )
if (Creature* c = pInstance->instance->GetCreature(pInstance->GetGuidData(_TYPE_OTHER)))
if (c->IsAlive())
c->AI()->DoAction(-2);
pInstance->SetData(TYPE_JORMUNGAR, DONE);
}
@ -671,7 +671,7 @@ struct boss_jormungarAI : public ScriptedAI
{
events.Reset();
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_FAILED, 1);
}
};
@ -817,8 +817,8 @@ public:
{
Map::PlayerList const& lPlayers = me->GetMap()->GetPlayers();
for( Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr )
if( Unit* p = itr->GetSource() )
if( p->IsAlive() && p->GetExactDist(me) <= 12.0f )
if (Unit* p = itr->GetSource())
if (p->IsAlive() && p->GetExactDist(me) <= 12.0f )
{
DoCastAOE(SPELL_TRAMPLE);
return true;
@ -829,7 +829,7 @@ public:
void MovementInform(uint32 /*type*/, uint32 id) override
{
if( id == EVENT_CHARGE )
if (id == EVENT_CHARGE)
{
events.Reset();
events.RescheduleEvent(EVENT_SPELL_FEROCIOUS_BUTT, 5s, 15s);
@ -843,7 +843,7 @@ public:
me->UpdatePosition(destX, destY, destZ, angle, true);
me->StopMovingOnCurrentPos();
if( !DoTrampleIfValid() )
if (!DoTrampleIfValid())
{
me->CastSpell(me, SPELL_STAGGERED_DAZE, true);
me->CastSpell((Unit*)nullptr, SPELL_TRAMPLE, true);
@ -862,20 +862,20 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_SPELL_FEROCIOUS_BUTT:
if( Unit* victim = me->GetVictim() )
if (Unit* victim = me->GetVictim())
me->CastSpell(victim, SPELL_FEROCIOUS_BUTT, false);
events.Repeat(15s, 30s);
break;
@ -884,7 +884,7 @@ public:
events.Repeat(15s, 20s);
break;
case EVENT_SPELL_ARCTIC_BREATH:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 90.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 90.0f, true))
me->CastSpell(target, SPELL_ARCTIC_BREATH, false);
events.Repeat(20s, 30s);
break;
@ -906,7 +906,7 @@ public:
events.RescheduleEvent(EVENT_GAZE, 2s);
break;
case EVENT_GAZE:
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 500.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 500.0f, true))
{
TargetGUID = target->GetGUID();
me->SetGuidValue(UNIT_FIELD_TARGET, TargetGUID);
@ -929,14 +929,14 @@ public:
case EVENT_JUMP_BACK:
{
float angle;
if( Unit* target = ObjectAccessor::GetPlayer(*me, TargetGUID) )
if (Unit* target = ObjectAccessor::GetPlayer(*me, TargetGUID))
angle = me->GetAngle(target);
else // in case something went wrong
angle = rand_norm() * 2 * M_PI;
float jumpangle = angle >= M_PI ? angle - M_PI : angle + M_PI;
float dist = 50.0f;
if( angle > 1.0f && angle < 2.0f ) // near main gate
if (angle > 1.0f && angle < 2.0f) // near main gate
dist = 46.0f;
destX = Locs[LOC_CENTER].GetPositionX() + cos(angle) * dist;
destY = Locs[LOC_CENTER].GetPositionY() + std::sin(angle) * dist;
@ -946,8 +946,8 @@ public:
events.RescheduleEvent(EVENT_TRAMPLE, 1500ms);
if( pInstance )
switch( GetDifficulty() )
if (pInstance)
switch (GetDifficulty())
{
case RAID_DIFFICULTY_10MAN_NORMAL:
pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_MASSIVE_CRASH);
@ -976,7 +976,7 @@ public:
break;
case EVENT_CHECK_TRAMPLE_PLAYERS:
if( DoTrampleIfValid() )
if (DoTrampleIfValid())
{
events.Reset();
events.RescheduleEvent(EVENT_SPELL_FEROCIOUS_BUTT, 5s, 15s);
@ -996,7 +996,7 @@ public:
break;
}
if( me->GetReactState() != REACT_PASSIVE )
if (me->GetReactState() != REACT_PASSIVE )
DoMeleeAttackIfReady();
}
@ -1004,13 +1004,13 @@ public:
{
events.Reset();
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_FAILED, 1);
}
void JustDied(Unit* /*killer*/) override
{
if( !pInstance )
if (!pInstance)
return;
pInstance->SetData(TYPE_ICEHOWL, DONE);

View file

@ -116,9 +116,9 @@ struct boss_twin_valkyrAI : public ScriptedAI
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_HASTE_SPELLS, true);
events.Reset();
if( me->GetEntry() == NPC_LIGHTBANE )
if (me->GetEntry() == NPC_LIGHTBANE )
{
if( pInstance )
if (pInstance)
pInstance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, 21853);
// special events here
@ -127,7 +127,7 @@ struct boss_twin_valkyrAI : public ScriptedAI
events.RescheduleEvent(EVENT_SPECIAL, 45s);
}
events.RescheduleEvent(EVENT_SPELL_SPIKE, 5s, 8s);
if( IsHeroic() )
if (IsHeroic())
events.RescheduleEvent(EVENT_SPELL_TOUCH, 10s, 25s, 1);
me->SetCanFly(true);
@ -142,14 +142,14 @@ struct boss_twin_valkyrAI : public ScriptedAI
void DoAction(int32 a) override
{
switch( a )
switch (a)
{
case -1:
summons.DespawnAll();
if( pInstance && me->GetEntry() == NPC_LIGHTBANE )
if (pInstance && me->GetEntry() == NPC_LIGHTBANE )
{
uint32 essenceId1 = 0, empoweredId1 = 0, touchId1 = 0, essenceId2 = 0, empoweredId2 = 0, touchId2 = 0;
switch( me->GetMap()->GetDifficulty() )
switch (me->GetMap()->GetDifficulty())
{
case 0:
essenceId1 = 65684;
@ -207,7 +207,7 @@ struct boss_twin_valkyrAI : public ScriptedAI
/*void AttackStart(Unit* victim)
{
if( victim && me->Attack(victim, true) )
if (victim && me->Attack(victim, true))
me->GetMotionMaster()->MoveChase(victim, 0.0f, 0.0f, 6.0f);
}*/
@ -216,15 +216,15 @@ struct boss_twin_valkyrAI : public ScriptedAI
me->setActive(true);
me->LowerPlayerDamageReq(me->GetMaxHealth());
DoZoneInCombat();
if( Creature* twin = GetSister() )
if( !twin->IsInCombat() )
if( Unit* target = twin->SelectNearestTarget(200.0f) )
if (Creature* twin = GetSister())
if (!twin->IsInCombat())
if (Unit* target = twin->SelectNearestTarget(200.0f))
twin->AI()->AttackStart(target);
Talk(SAY_AGGRO);
me->CastSpell(me, me->GetEntry() == NPC_LIGHTBANE ? SPELL_LIGHT_SURGE : SPELL_DARK_SURGE, true);
if( pInstance && me->GetEntry() == NPC_LIGHTBANE )
if (pInstance && me->GetEntry() == NPC_LIGHTBANE )
pInstance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, 21853);
}
@ -265,13 +265,13 @@ struct boss_twin_valkyrAI : public ScriptedAI
void UpdateSharedHealth()
{
// lightbane synchronizes
if( me->GetEntry() == NPC_LIGHTBANE )
if( Creature* twin = GetSister() )
if( twin->IsAlive() && me->IsAlive() )
if (me->GetEntry() == NPC_LIGHTBANE )
if (Creature* twin = GetSister())
if (twin->IsAlive() && me->IsAlive())
{
int32 d = CAST_AI(boss_twin_valkyrAI, twin->AI())->LastSynchroHP - (int32)twin->GetHealth();
int32 newhealth = (int32)me->GetHealth() - d;
if( newhealth <= 0 )
if (newhealth <= 0)
newhealth = 1;
me->SetHealth( (uint32)newhealth );
twin->SetHealth(me->GetHealth());
@ -281,25 +281,25 @@ struct boss_twin_valkyrAI : public ScriptedAI
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
UpdateSharedHealth();
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
uint8 eventId = events.ExecuteEvent();
switch(eventId)
switch (eventId)
{
case 0:
break;
case EVENT_BERSERK:
me->CastSpell(me, SPELL_BERSERK, true);
Talk(SAY_BERSERK);
if( Creature* twin = GetSister() )
if (Creature* twin = GetSister())
{
twin->CastSpell(twin, SPELL_BERSERK, true);
twin->AI()->Talk(SAY_BERSERK);
@ -311,18 +311,18 @@ struct boss_twin_valkyrAI : public ScriptedAI
case EVENT_SUMMON_BALLS_3:
{
uint8 count = 0;
if( IsHeroic() )
if (IsHeroic())
count = eventId == EVENT_SUMMON_BALLS_3 ? 36 : 6;
else
count = eventId == EVENT_SUMMON_BALLS_3 ? 24 : 4;
for( uint8 i = 0; i < count; ++i )
{
float angle = rand_norm() * 2 * M_PI;
if( Creature* ball = me->SummonCreature((i % 2) ? NPC_CONCENTRATED_DARK : NPC_CONCENTRATED_LIGHT, Locs[LOC_CENTER].GetPositionX() + cos(angle) * 47.0f, Locs[LOC_CENTER].GetPositionY() + std::sin(angle) * 47.0f, Locs[LOC_CENTER].GetPositionZ() + 1.5f, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1500) )
if (Creature* ball = me->SummonCreature((i % 2) ? NPC_CONCENTRATED_DARK : NPC_CONCENTRATED_LIGHT, Locs[LOC_CENTER].GetPositionX() + cos(angle) * 47.0f, Locs[LOC_CENTER].GetPositionY() + std::sin(angle) * 47.0f, Locs[LOC_CENTER].GetPositionZ() + 1.5f, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1500))
boss_twin_valkyrAI::JustSummoned(ball);
}
switch( eventId )
switch (eventId)
{
case EVENT_SUMMON_BALLS_1:
events.RescheduleEvent(EVENT_SUMMON_BALLS_2, 8s);
@ -343,10 +343,10 @@ struct boss_twin_valkyrAI : public ScriptedAI
case EVENT_SPELL_TOUCH:
{
uint32 essenceId = 0;
switch( me->GetEntry() )
switch (me->GetEntry())
{
case NPC_LIGHTBANE:
switch( GetDifficulty() )
switch (GetDifficulty())
{
case 0:
essenceId = 65684;
@ -363,7 +363,7 @@ struct boss_twin_valkyrAI : public ScriptedAI
}
break;
case NPC_DARKBANE:
switch( GetDifficulty() )
switch (GetDifficulty())
{
case 0:
essenceId = 65686;
@ -382,7 +382,7 @@ struct boss_twin_valkyrAI : public ScriptedAI
}
/*
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, essenceId) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, essenceId))
me->CastSpell(target, me->GetEntry()==NPC_LIGHTBANE ? SPELL_LIGHT_TOUCH : SPELL_DARK_TOUCH, false);
events.RepeatEvent(urand(45000,50000));
*/
@ -414,17 +414,17 @@ struct boss_twin_valkyrAI : public ScriptedAI
do s = urand(0, 3);
while( SpecialMask & (1 << s) && (SpecialMask & 0xF) != 0xF );
SpecialMask |= (1 << s);
switch( s )
switch (s)
{
case 0: // light vortex
me->CastSpell((Unit*)nullptr, SPELL_LIGHT_VORTEX, false);
Talk(EMOTE_VORTEX);
Talk(SAY_LIGHT);
if( Creature* twin = GetSister() )
if (Creature* twin = GetSister())
twin->AI()->Talk(SAY_LIGHT);
break;
case 1: // dark vortex
if( Creature* twin = GetSister() )
if (Creature* twin = GetSister())
{
twin->CastSpell((Unit*)nullptr, SPELL_DARK_VORTEX, false);
twin->AI()->Talk(EMOTE_VORTEX);
@ -435,7 +435,7 @@ struct boss_twin_valkyrAI : public ScriptedAI
case 2: // light pact
Talk(EMOTE_TWINK_PACT);
Talk(SAY_TWINK_PACT);
if( Creature* twin = GetSister() )
if (Creature* twin = GetSister())
{
twin->AI()->Talk(SAY_TWINK_PACT);
twin->AI()->DoAction(-3);
@ -444,7 +444,7 @@ struct boss_twin_valkyrAI : public ScriptedAI
me->CastSpell(me, SPELL_LIGHT_TWIN_PACT, false);
break;
case 3: // dark pact
if( Creature* twin = GetSister() )
if (Creature* twin = GetSister())
{
twin->AI()->Talk(EMOTE_TWINK_PACT);
twin->AI()->Talk(SAY_TWINK_PACT);
@ -455,7 +455,7 @@ struct boss_twin_valkyrAI : public ScriptedAI
}
break;
}
if( (SpecialMask & 0xF) == 0xF )
if ((SpecialMask & 0xF) == 0xF )
SpecialMask = 0;
events.Repeat(45s);
events.DelayEventsToMax(15000, 1); // no touch of light/darkness during special abilities!
@ -474,13 +474,13 @@ struct boss_twin_valkyrAI : public ScriptedAI
{
DoAction(-1);
Talk(SAY_DEATH);
if( pInstance )
if (pInstance)
{
pInstance->SetData(TYPE_VALKYR, DONE);
pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_POWERING_UP);
}
if( Creature* twin = GetSister() )
if( twin->IsAlive() )
if (Creature* twin = GetSister())
if (twin->IsAlive())
{
twin->SetHealth(1);
Unit::Kill(twin, twin);
@ -499,17 +499,17 @@ struct boss_twin_valkyrAI : public ScriptedAI
void KilledUnit(Unit* who) override
{
if( who->IsPlayer() )
if (who->IsPlayer())
{
Talk(SAY_KILL_PLAYER);
if( Creature* twin = GetSister() )
if (Creature* twin = GetSister())
twin->AI()->Talk(SAY_KILL_PLAYER);
}
}
void EnterEvadeMode(EvadeReason /* why */) override
{
if( pInstance )
if (pInstance)
pInstance->SetData(TYPE_FAILED, 0);
}
};
@ -530,9 +530,9 @@ public:
{
me->SetFlag(UNIT_FIELD_AURASTATE, 1 << (19 - 1));
SetEquipmentSlots(false, EQUIP_MAIN_2, EQUIP_OFFHAND_2, EQUIP_RANGED_2);
if( Creature* c = me->SummonCreature(NPC_DARK_ESSENCE, Locs[LOC_DARKESS_1]) )
if (Creature* c = me->SummonCreature(NPC_DARK_ESSENCE, Locs[LOC_DARKESS_1]))
boss_twin_valkyrAI::JustSummoned(c);
if( Creature* c = me->SummonCreature(NPC_DARK_ESSENCE, Locs[LOC_DARKESS_2]) )
if (Creature* c = me->SummonCreature(NPC_DARK_ESSENCE, Locs[LOC_DARKESS_2]))
boss_twin_valkyrAI::JustSummoned(c);
}
@ -556,9 +556,9 @@ public:
{
me->SetFlag(UNIT_FIELD_AURASTATE, 1 << (22 - 1));
SetEquipmentSlots(false, EQUIP_MAIN_1, EQUIP_OFFHAND_1, EQUIP_RANGED_1);
if( Creature* c = me->SummonCreature(NPC_LIGHT_ESSENCE, Locs[LOC_LIGHTESS_1]) )
if (Creature* c = me->SummonCreature(NPC_LIGHT_ESSENCE, Locs[LOC_LIGHTESS_1]))
boss_twin_valkyrAI::JustSummoned(c);
if( Creature* c = me->SummonCreature(NPC_LIGHT_ESSENCE, Locs[LOC_LIGHTESS_2]) )
if (Creature* c = me->SummonCreature(NPC_LIGHT_ESSENCE, Locs[LOC_LIGHTESS_2]))
boss_twin_valkyrAI::JustSummoned(c);
}
@ -573,7 +573,7 @@ public:
bool OnGossipHello(Player* player, Creature* creature) override
{
switch( creature->GetEntry() )
switch (creature->GetEntry())
{
case NPC_LIGHT_ESSENCE:
{
@ -582,7 +582,7 @@ public:
//uint32 empoweredId = 0;
uint32 touchId1 = 0;
//uint32 touchId2 = 0;
switch( creature->GetMap()->GetDifficulty() )
switch (creature->GetMap()->GetDifficulty())
{
case 0:
essenceId = 65684;
@ -628,7 +628,7 @@ public:
//uint32 empoweredId = 0;
//uint32 touchId1 = 0;
uint32 touchId2 = 0;
switch( creature->GetMap()->GetDifficulty() )
switch (creature->GetMap()->GetDifficulty())
{
case 0:
essenceId = 65686;
@ -706,10 +706,10 @@ public:
void MovementInform(uint32 type, uint32 id) override
{
if( type != POINT_MOTION_TYPE || id != 0 )
if (type != POINT_MOTION_TYPE || id != 0)
return;
if( urand(0, 2) )
if (urand(0, 2))
me->DespawnOrUnsummon(0);
}
@ -721,10 +721,10 @@ public:
void UpdateAI(uint32 /*diff*/) override
{
if( despawning )
if (despawning)
return;
if( me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE )
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE )
MoveToNextPoint();
}
};
@ -742,15 +742,15 @@ public:
void HandleAfterEffectAbsorb(AuraEffect* /*aurEff*/, DamageInfo& /*dmgInfo*/, uint32& absorbAmount)
{
uint16 count = absorbAmount / 1000;
if( !count || !GetOwner() )
if (!count || !GetOwner())
return;
if( SpellInfo const* se = GetAura()->GetSpellInfo() )
if( Unit* owner = GetOwner()->ToUnit() )
if (SpellInfo const* se = GetAura()->GetSpellInfo())
if (Unit* owner = GetOwner()->ToUnit())
{
uint32 auraId = 0;
uint32 empoweredId = 0;
switch( se->Id )
switch (se->Id)
{
case 65686:
auraId = 67590;
@ -785,15 +785,15 @@ public:
empoweredId = 65724;
break;
}
if( !owner->HasAura(auraId) )
if (!owner->HasAura(auraId))
{
owner->CastSpell(owner, SPELL_POWERING_UP, true);
if( --count == 0 )
if (--count == 0)
return;
}
if( Aura* aur = owner->GetAura(auraId) )
if (Aura* aur = owner->GetAura(auraId))
{
if( aur->GetStackAmount() + count < 100 )
if (aur->GetStackAmount() + count < 100 )
{
aur->ModStackAmount(count);
@ -834,15 +834,15 @@ public:
{
PreventDefaultAction();
Unit* caster = GetCaster();
if( !caster )
if (!caster)
return;
if( caster->GetMap()->GetId() == 649 )
if (caster->GetMap()->GetId() == 649 )
{
uint32 excludedID = GetSpellInfo()->ExcludeTargetAuraSpell;
Map::PlayerList const& pl = caster->GetMap()->GetPlayers();
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
if( Player* plr = itr->GetSource() )
if( plr->IsAlive() && !plr->HasAura(excludedID) && !plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION) )
if (Player* plr = itr->GetSource())
if (plr->IsAlive() && !plr->HasAura(excludedID) && !plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
{
uint32 absorb = 0;
uint32 resist = 0;

View file

@ -36,15 +36,15 @@ public:
bool OnGossipHello(Player* player, Creature* creature) override
{
if(!creature->HasNpcFlag(UNIT_NPC_FLAG_GOSSIP))
if (!creature->HasNpcFlag(UNIT_NPC_FLAG_GOSSIP))
return true;
InstanceScript* pInstance = creature->GetInstanceScript();
if(!pInstance)
if (!pInstance)
return true;
uint32 gossipTextId = 0;
switch(pInstance->GetData(TYPE_INSTANCE_PROGRESS))
switch (pInstance->GetData(TYPE_INSTANCE_PROGRESS))
{
case INSTANCE_PROGRESS_INITIAL:
gossipTextId = MSG_TESTED;
@ -72,14 +72,14 @@ public:
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 uiAction) override
{
if( !creature->HasNpcFlag(UNIT_NPC_FLAG_GOSSIP) )
if (!creature->HasNpcFlag(UNIT_NPC_FLAG_GOSSIP))
return true;
InstanceScript* pInstance = creature->GetInstanceScript();
if( !pInstance )
if (!pInstance)
return true;
if( uiAction == GOSSIP_ACTION_INFO_DEF + 1337 )
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1337)
{
pInstance->SetData(TYPE_ANNOUNCER_GOSSIP_SELECT, 0);
creature->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);

View file

@ -133,7 +133,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case EVENT_SPELL_INFECTED_WOUND:
me->CastSpell(me->GetVictim(), SPELL_INFECTED_WOUND, false);

View file

@ -143,7 +143,7 @@ public:
if (me->isAttackReady())
me->SetFacingToObject(me->GetVictim());
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;

View file

@ -204,7 +204,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;

View file

@ -81,7 +81,7 @@ public:
void UpdateAI(uint32 diff) override
{
events.Update(diff);
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;
@ -206,7 +206,7 @@ public:
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) override
{
ClearGossipMenuFor(player);
switch(uiAction)
switch (uiAction)
{
case GOSSIP_ACTION_INFO_DEF+1:
CloseGossipMenuFor(player);

View file

@ -151,7 +151,7 @@ public:
void SetData(uint32 type, uint32 data) override
{
switch(type)
switch (type)
{
case DATA_BRONJAHM:
m_auiEncounter[type] = data;
@ -180,22 +180,22 @@ public:
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/) override
{
switch(criteria_id)
switch (criteria_id)
{
case 12752: // Soul Power
if( Creature* c = instance->GetCreature(NPC_BronjahmGUID) )
if (Creature* c = instance->GetCreature(NPC_BronjahmGUID))
{
std::list<Creature*> L;
uint8 count = 0;
c->GetCreaturesWithEntryInRange(L, 200.0f, 36535); // find all Corrupted Soul Fragment (36535)
for( std::list<Creature*>::const_iterator itr = L.begin(); itr != L.end(); ++itr )
if( (*itr)->IsAlive() )
if ((*itr)->IsAlive())
++count;
return (count >= 4);
}
break;
case 12976:
if( Creature* c = instance->GetCreature(NPC_DevourerGUID) )
if (Creature* c = instance->GetCreature(NPC_DevourerGUID))
return (bool)c->AI()->GetData(1);
break;
}

View file

@ -245,7 +245,7 @@ public:
void DoAction(int32 actionId) override
{
switch(actionId)
switch (actionId)
{
case ACTION_START_INTRO:
events.ScheduleEvent(EVENT_START_INTRO, 0ms);
@ -1767,7 +1767,7 @@ public:
if (me->IsNonMeleeSpellCast(false, true, true))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case EVENT_LK_CHECK_COMBAT:
if (me->isActiveObject()) // during fight
@ -1953,7 +1953,7 @@ public:
void DoAction(int32 actionId) override
{
switch(actionId)
switch (actionId)
{
case ACTION_START_INTRO:
events.ScheduleEvent(EVENT_LK_SAY_AGGRO, 0ms);
@ -2001,7 +2001,7 @@ public:
void UpdateAI(uint32 diff) override
{
events.Update(diff);
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case EVENT_LK_SAY_AGGRO:
if (Creature* lkboss = pInstance->instance->GetCreature(pInstance->GetGuidData(NPC_LICH_KING_BOSS)))

View file

@ -228,7 +228,7 @@ public:
}
}
switch(creature->GetEntry())
switch (creature->GetEntry())
{
case NPC_SYLVANAS_PART1:
creature->SetVisible(false);
@ -372,7 +372,7 @@ public:
void OnGameObjectCreate(GameObject* go) override
{
switch(go->GetEntry())
switch (go->GetEntry())
{
case GO_FROSTMOURNE:
GO_FrostmourneGUID = go->GetGUID();
@ -408,7 +408,7 @@ public:
void SetData(uint32 type, uint32 data) override
{
switch(type)
switch (type)
{
case DATA_INTRO:
EncounterMask |= (1 << DATA_INTRO);
@ -597,7 +597,7 @@ public:
if (EncounterMask & (1 << DATA_BATTERED_HILT))
return;
switch(data)
switch (data)
{
case 1: // talked to leader
EncounterMask |= (1 << DATA_BATTERED_HILT);
@ -667,7 +667,7 @@ public:
uint32 GetData(uint32 type) const override
{
switch(type)
switch (type)
{
case DATA_INTRO:
case DATA_FALRIC:
@ -687,7 +687,7 @@ public:
ObjectGuid GetGuidData(uint32 type) const override
{
switch(type)
switch (type)
{
case NPC_DARK_RANGER_LORALEN:
return NPC_GuardGUID;

View file

@ -233,7 +233,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;

View file

@ -175,7 +175,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING | UNIT_STATE_STUNNED))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;
@ -212,7 +212,7 @@ public:
break;
case EVENT_SPECIAL:
switch(urand(0, 2))
switch (urand(0, 2))
{
case 0: // Pursuit
if (Creature* k = GetKrick())
@ -305,7 +305,7 @@ public:
void UpdateAI(uint32 diff) override
{
events.Update(diff);
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;

View file

@ -150,7 +150,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;

View file

@ -261,7 +261,7 @@ public:
void SetData(uint32 type, uint32 data) override
{
switch(type)
switch (type)
{
case DATA_INSTANCE_PROGRESS:
if (InstanceProgress < data)
@ -306,7 +306,7 @@ public:
void SetGuidData(uint32 type, ObjectGuid data) override
{
switch(type)
switch (type)
{
case DATA_NECROLYTE_1_GUID:
NPC_Necrolyte1GUID = data;
@ -374,7 +374,7 @@ public:
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/) override
{
switch(criteria_id)
switch (criteria_id)
{
case 12993: // Doesn't Go to Eleven (4524)
return bAchievEleven;

View file

@ -73,7 +73,7 @@ public:
void UpdateAI(uint32 diff) override
{
events.Update(diff);
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;
@ -469,7 +469,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;
@ -521,7 +521,7 @@ public:
{
if (type != POINT_MOTION_TYPE)
return;
switch(id)
switch (id)
{
case 1:
events.RescheduleEvent(id, 0ms);
@ -532,7 +532,7 @@ public:
void UpdateAI(uint32 diff) override
{
events.Update(diff);
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;
@ -1013,7 +1013,7 @@ public:
{
events.Update(diff);
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;
@ -1198,7 +1198,7 @@ public:
if (type != WAYPOINT_MOTION_TYPE)
return;
switch(id)
switch (id)
{
case 0:
Talk(me->GetEntry() == NPC_JAINA_PART2 ? SAY_JAINA_OUTRO_2 : SAY_SYLVANAS_OUTRO_2);
@ -1221,7 +1221,7 @@ public:
{
events.Update(diff);
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;

View file

@ -813,7 +813,7 @@ class spell_sindragosa_s_fury : public SpellScript
if (ResistFactor > 0.9f)
ResistFactor = 0.9f;
uint32 damage = uint32( (GetEffectValue() / _targetCount) * (1.0f - ResistFactor) );
uint32 damage = uint32( (GetEffectValue() / _targetCount) * (1.0f - ResistFactor));
SpellNonMeleeDamage damageInfo(GetCaster(), GetHitUnit(), GetSpellInfo(), GetSpellInfo()->SchoolMask);
damageInfo.damage = damage;

View file

@ -157,7 +157,7 @@ public:
void MoveToCorner()
{
switch(me->GetEntry())
switch (me->GetEntry())
{
case NPC_THANE_KORTHAZZ:
currentWaypoint = 0;

View file

@ -357,7 +357,7 @@ public:
void SummonHelpers(uint32 entry)
{
switch(entry)
switch (entry)
{
case NPC_LIVING_TRAINEE:
me->SummonCreature(NPC_LIVING_TRAINEE, PosSummonLiving[0].GetPositionX(), PosSummonLiving[0].GetPositionY(), PosSummonLiving[0].GetPositionZ(), PosSummonLiving[0].GetOrientation());

View file

@ -231,7 +231,7 @@ public:
}
if (GameObject* go = me->GetMap()->GetGameObject(pInstance->GetGuidData(DATA_KELTHUZAD_GATE)))
{
if(!_justSpawned) // Don't open the door if we just spawned and are still doing the conversation
if (!_justSpawned) // Don't open the door if we just spawned and are still doing the conversation
{
go->SetGoState(GO_STATE_ACTIVE);
}

View file

@ -222,7 +222,7 @@ public:
void DamageTaken(Unit* who, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
// Damage done by the controlled Death Knight understudies should also count toward damage done by players
if(who && who->IsCreature() && who->GetEntry() == NPC_DEATH_KNIGHT_UNDERSTUDY)
if (who && who->IsCreature() && who->GetEntry() == NPC_DEATH_KNIGHT_UNDERSTUDY)
{
me->LowerPlayerDamageReq(damage);
}

View file

@ -206,7 +206,7 @@ public:
void OnCreatureCreate(Creature* creature) override
{
switch(creature->GetEntry())
switch (creature->GetEntry())
{
case NPC_PATCHWERK:
_patchwerkGUID = creature->GetGUID();
@ -277,7 +277,7 @@ public:
return;
}
switch(pGo->GetEntry())
switch (pGo->GetEntry())
{
case GO_PATCHWERK_GATE:
_patchwerkGateGUID = pGo->GetGUID();
@ -621,7 +621,7 @@ public:
void SetData(uint32 id, uint32 data) override
{
switch(id)
switch (id)
{
case DATA_ABOMINATION_KILLED:
abominationsKilled++;
@ -768,7 +768,7 @@ public:
return false;
// Bosses data
switch(bossId)
switch (bossId)
{
case BOSS_KELTHUZAD:
if (state == NOT_STARTED)

View file

@ -382,7 +382,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;
@ -799,7 +799,7 @@ public:
if (!summon)
return;
summons.Summon(summon);
switch(summon->GetEntry())
switch (summon->GetEntry())
{
case NPC_ARCANE_OVERLOAD:
summon->CastSpell(summon, SPELL_ARCANE_OVERLOAD_DMG, true);
@ -989,7 +989,7 @@ public:
void DoAction(int32 param) override
{
switch(param)
switch (param)
{
case 1:
MoveTimer = 1;
@ -1123,7 +1123,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;
@ -1183,7 +1183,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;
@ -1321,12 +1321,12 @@ public:
void DoAction(int32 param) override
{
switch(param)
switch (param)
{
case 1: // move to next point
if (Vehicle* v = me->GetVehicleKit())
if (Unit* pass = v->GetPassenger(0))
switch(pass->GetEntry())
switch (pass->GetEntry())
{
case NPC_NEXUS_LORD:
{
@ -1357,7 +1357,7 @@ public:
{
events.Update(diff);
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;
@ -1397,7 +1397,7 @@ public:
void UpdateAI(uint32 diff) override
{
events.Update(diff);
switch(events.ExecuteEvent())
switch (events.ExecuteEvent())
{
case 0:
break;

View file

@ -97,7 +97,7 @@ public:
void OnCreatureCreate(Creature* creature) override
{
switch(creature->GetEntry())
switch (creature->GetEntry())
{
case NPC_MALYGOS:
NPC_MalygosGUID = creature->GetGUID();
@ -107,7 +107,7 @@ public:
void OnGameObjectCreate(GameObject* go) override
{
switch(go->GetEntry())
switch (go->GetEntry())
{
case GO_IRIS_N:
case GO_IRIS_H:
@ -124,7 +124,7 @@ public:
void SetData(uint32 type, uint32 data) override
{
switch(type)
switch (type)
{
case DATA_IRIS_ACTIVATED:
if (EncounterStatus == NOT_STARTED)
@ -134,7 +134,7 @@ public:
break;
case DATA_ENCOUNTER_STATUS:
EncounterStatus = data;
switch(data)
switch (data)
{
case NOT_STARTED:
bPokeAchiev = false;
@ -184,7 +184,7 @@ public:
ObjectGuid GetGuidData(uint32 type) const override
{
switch(type)
switch (type)
{
case DATA_MALYGOS_GUID:
return NPC_MalygosGUID;
@ -195,7 +195,7 @@ public:
void ProcessEvent(WorldObject* /*unit*/, uint32 eventId) override
{
switch(eventId)
switch (eventId)
{
case 20158:
if (GameObject* go = instance->GetGameObject(GO_PlatformGUID))
@ -233,7 +233,7 @@ public:
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* source, Unit const* /*target*/, uint32 /*miscvalue1*/) override
{
switch(criteria_id)
switch (criteria_id)
{
case ACHIEV_CRITERIA_A_POKE_IN_THE_EYE_10:
case ACHIEV_CRITERIA_A_POKE_IN_THE_EYE_25:

View file

@ -105,9 +105,9 @@ public:
{
pInstance->SetData(DATA_DRAKOS, DONE);
for( uint8 i = 0; i < 3; ++i )
if( ObjectGuid guid = pInstance->GetGuidData(DATA_DCD_1 + i) )
if( GameObject* pGo = ObjectAccessor::GetGameObject(*me, guid) )
if( pGo->GetGoState() != GO_STATE_ACTIVE )
if (ObjectGuid guid = pInstance->GetGuidData(DATA_DCD_1 + i))
if (GameObject* pGo = ObjectAccessor::GetGameObject(*me, guid))
if (pGo->GetGoState() != GO_STATE_ACTIVE )
{
pGo->SetLootState(GO_READY);
pGo->UseDoorOrButton(0, false);
@ -125,17 +125,17 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
DoMeleeAttackIfReady();
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
@ -206,10 +206,10 @@ public:
void MovementInform(uint32 type, uint32 id) override
{
if( type != POINT_MOTION_TYPE || id != 1 )
if (type != POINT_MOTION_TYPE || id != 1)
return;
if( !located )
if (!located)
gonext = true;
}
@ -231,21 +231,21 @@ public:
void UpdateAI(uint32 diff) override
{
if( timer == 0 )
if (timer == 0)
me->CastSpell(me, SPELL_TELEPORT_VISUAL, true);
timer += diff;
if( timer > 10000 )
if (timer > 10000)
{
if( !located )
if (!located)
me->GetMotionMaster()->MoveIdle();
located = true;
me->CastSpell(me, SPELL_UNSTABLE_SPHERE_PULSE, true);
timer -= 2000;
}
if( !located && gonext )
if (!located && gonext)
{
PickNewLocation();
gonext = false;

View file

@ -93,7 +93,7 @@ public:
if (pInstance)
{
pInstance->SetData(DATA_EREGOS, NOT_STARTED);
if( pInstance->GetData(DATA_UROM) != DONE )
if (pInstance->GetData(DATA_UROM) != DONE )
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
else
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
@ -110,17 +110,17 @@ public:
{
pInstance->SetData(DATA_EREGOS, IN_PROGRESS);
if( me->FindNearestCreature(NPC_AMBER_DRAKE, 750.0f, true) )
if (me->FindNearestCreature(NPC_AMBER_DRAKE, 750.0f, true))
pInstance->SetData(DATA_AMBER_VOID, 0);
else
pInstance->SetData(DATA_AMBER_VOID, 1);
if( me->FindNearestCreature(NPC_EMERALD_DRAKE, 750.0f, true) )
if (me->FindNearestCreature(NPC_EMERALD_DRAKE, 750.0f, true))
pInstance->SetData(DATA_EMERALD_VOID, 0);
else
pInstance->SetData(DATA_EMERALD_VOID, 1);
if( me->FindNearestCreature(NPC_RUBY_DRAKE, 750.0f, true) )
if (me->FindNearestCreature(NPC_RUBY_DRAKE, 750.0f, true))
pInstance->SetData(DATA_RUBY_VOID, 0);
else
pInstance->SetData(DATA_RUBY_VOID, 1);
@ -148,10 +148,10 @@ public:
void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask) override
{
if( !me->GetMap()->IsHeroic() )
if (!me->GetMap()->IsHeroic())
return;
if( shiftNumber <= uint32(1) && uint32(me->GetHealth() * 100 / me->GetMaxHealth()) <= uint32(60 - shiftNumber * 40) )
if (shiftNumber <= uint32(1) && uint32(me->GetHealth() * 100 / me->GetMaxHealth()) <= uint32(60 - shiftNumber * 40))
{
++shiftNumber;
events.RescheduleEvent(EVENT_SPELL_PLANAR_SHIFT, 0ms);
@ -167,7 +167,7 @@ public:
void JustSummoned(Creature* pSummon) override
{
if( pSummon->GetEntry() != NPC_LEY_GUARDIAN_WHELP )
if (pSummon->GetEntry() != NPC_LEY_GUARDIAN_WHELP )
return;
DoZoneInCombat(pSummon, 300.0f);
@ -175,25 +175,25 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
if( me->HasAura(SPELL_PLANAR_SHIFT) || me->HasAura(SPELL_DRAKE_STOP_TIME) )
if (me->HasAura(SPELL_PLANAR_SHIFT) || me->HasAura(SPELL_DRAKE_STOP_TIME))
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
DoMeleeAttackIfReady();
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_SPELL_ARCANE_BARRAGE:
if( Unit* v = me->GetVictim() )
if (Unit* v = me->GetVictim())
me->CastSpell(v, SPELL_ARCANE_BARRAGE, false);
events.Repeat(2500ms);
break;
@ -224,8 +224,8 @@ public:
Talk(SAY_SHIELD);
me->CastSpell(me, SPELL_PLANAR_SHIFT, false);
for( uint8 i = 0; i < 3; ++i )
if( Unit* t = SelectTarget(SelectTargetMethod::Random, 0, 300.0f, false) )
if( Creature* pa = me->SummonCreature(NPC_PLANAR_ANOMALY, *me, TEMPSUMMON_TIMED_DESPAWN, 17000) )
if (Unit* t = SelectTarget(SelectTargetMethod::Random, 0, 300.0f, false))
if (Creature* pa = me->SummonCreature(NPC_PLANAR_ANOMALY, *me, TEMPSUMMON_TIMED_DESPAWN, 17000))
{
pa->SetCanFly(true);
pa->SetDisableGravity(true);
@ -234,7 +234,7 @@ public:
pa->CastSpell(pa, SPELL_PLANAR_AURA_DAMAGE, true);
if (Aura* a = pa->GetAura(SPELL_PLANAR_AURA_DAMAGE))
a->SetDuration(15000);
if( pa->AI() )
if (pa->AI())
{
pa->AI()->AttackStart(t);
pa->GetMotionMaster()->MoveChase(t, 0.01f);

View file

@ -125,7 +125,7 @@ public:
if (pInstance)
{
pInstance->SetData(DATA_UROM, NOT_STARTED);
if( pInstance->GetData(DATA_VAROS) != DONE )
if (pInstance->GetData(DATA_VAROS) != DONE )
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
else
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
@ -143,20 +143,20 @@ public:
void JustEngagedWith(Unit* /*who*/) override
{
if( lock )
if (lock)
return;
uint8 phase = GetPhaseByCurrentPosition();
if( phase == 3 )
if (phase == 3)
{
Talk(SAY_AGGRO);
if( pInstance )
if (pInstance)
pInstance->SetData(DATA_UROM, IN_PROGRESS);
me->SetInCombatWithZone();
me->SetHomePosition(cords[0][0], cords[0][1], cords[0][2], cords[0][3]);
if( me->FindCurrentSpellBySpellId(SPELL_EVOCATION) )
if (me->FindCurrentSpellBySpellId(SPELL_EVOCATION))
me->InterruptNonMeleeSpells(false);
events.RescheduleEvent(EVENT_FROSTBOMB, 7s, 11s);
@ -167,7 +167,7 @@ public:
{
lock = true;
switch( phase )
switch (phase)
{
case 0:
Talk(SAY_SUMMON_1);
@ -190,7 +190,7 @@ public:
void AttackStart(Unit* who) override
{
if( lock )
if (lock)
return;
if (me->GetDistance(1103.0f, 1049.0f, 510.0f) < 55.0f)
@ -200,8 +200,8 @@ public:
void JustSummoned(Creature* pSummon) override
{
pSummon->SetInCombatWithZone();
if( Unit* v = pSummon->SelectVictim() )
if( pSummon->AI() )
if (Unit* v = pSummon->SelectVictim())
if (pSummon->AI())
pSummon->AI()->AttackStart(v);
}
@ -234,7 +234,7 @@ public:
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
switch( spell->Id )
switch (spell->Id)
{
case SPELL_SUMMON_MENAGERIE_1:
{
@ -299,9 +299,9 @@ public:
void UpdateAI(uint32 diff) override
{
if( releaseLockTimer )
if (releaseLockTimer)
{
if( releaseLockTimer >= 5000 )
if (releaseLockTimer >= 5000)
{
lock = false;
if (me->IsInCombat())
@ -315,27 +315,27 @@ public:
releaseLockTimer += diff;
}
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
DoMeleeAttackIfReady();
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_FROSTBOMB:
if( Unit* v = me->GetVictim() )
if (Unit* v = me->GetVictim())
me->CastSpell(v, SPELL_FROSTBOMB, false);
events.Repeat(7s, 11s);
break;
case EVENT_TIME_BOMB:
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
DoCast(target, DUNGEON_MODE(SPELL_TIME_BOMB_N, SPELL_TIME_BOMB_H));
events.Repeat(20s, 25s);
break;

View file

@ -100,7 +100,7 @@ public:
if (pInstance)
{
pInstance->SetData(DATA_VAROS, NOT_STARTED);
if( pInstance->GetData(DATA_CC_COUNT) < 10 )
if (pInstance->GetData(DATA_CC_COUNT) < 10 )
{
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->CastSpell(me, 50053, true);
@ -157,23 +157,23 @@ public:
void UpdateAI(uint32 diff) override
{
if( !UpdateVictim() )
if (!UpdateVictim())
return;
events.Update(diff);
if( me->HasUnitState(UNIT_STATE_CASTING) )
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
DoMeleeAttackIfReady();
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case 0:
break;
case EVENT_AMPLIFY_MAGIC:
{
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
me->CastSpell(target, SPELL_AMPLIFY_MAGIC, false);
events.Repeat(17s + 500ms, 22s + 500ms);
}
@ -185,7 +185,7 @@ public:
{
Talk(SAY_AZURE);
Talk(SAY_AZURE_EMOTE);
switch( events.ExecuteEvent() )
switch (events.ExecuteEvent())
{
case EVENT_CALL_AZURE_RING_CAPTAIN_1:
me->CastSpell(me, SPELL_CALL_AZURE_RING_CAPTAIN_1, true);
@ -204,11 +204,11 @@ public:
events.ScheduleEvent(EVENT_CALL_AZURE_RING_CAPTAIN_1, 16s);
break;
}
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
{
if( Creature* trigger = me->SummonCreature(NPC_ARCANE_BEAM, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 13000) )
if (Creature* trigger = me->SummonCreature(NPC_ARCANE_BEAM, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 13000))
{
if( Creature* c = me->FindNearestCreature(NPC_AZURE_RING_CAPTAIN, 500.0f, true) )
if (Creature* c = me->FindNearestCreature(NPC_AZURE_RING_CAPTAIN, 500.0f, true))
c->CastSpell(trigger, SPELL_ARCANE_BEAM_VISUAL, true);
trigger->GetMotionMaster()->MoveChase(target, 0.1f);
trigger->CastSpell(me, SPELL_ARCANE_BEAM_PERIODIC_DAMAGE, true);
@ -234,7 +234,7 @@ public:
me->SetControlled(true, UNIT_STATE_ROOT);
me->CastSpell((Unit*)nullptr, SPELL_ENERGIZE_CORES, false);
ZapAngle += M_PI / 2;
if( ZapAngle >= 2 * M_PI )
if (ZapAngle >= 2 * M_PI)
ZapAngle -= 2 * M_PI;
events.ScheduleEvent(EVENT_ENERGIZE_CORES_THIN, 2s);
}

View file

@ -63,7 +63,7 @@ public:
void OnCreatureCreate(Creature* pCreature) override
{
switch( pCreature->GetEntry() )
switch (pCreature->GetEntry())
{
case NPC_DRAKOS:
uiDrakosGUID = pCreature->GetGUID();
@ -82,19 +82,19 @@ public:
void OnGameObjectCreate(GameObject* pGo) override
{
switch( pGo->GetEntry() )
switch (pGo->GetEntry())
{
case GO_DRAGON_CAGE_DOOR:
for( uint8 i = 0; i < 3; ++i )
{
if( DragonCageDoorGUID[i] )
if (DragonCageDoorGUID[i])
continue;
DragonCageDoorGUID[i] = pGo->GetGUID();
break;
}
if( m_auiEncounter[DATA_DRAKOS] == DONE )
if( pGo->GetGoState() != GO_STATE_ACTIVE )
if (m_auiEncounter[DATA_DRAKOS] == DONE)
if (pGo->GetGoState() != GO_STATE_ACTIVE )
{
pGo->SetLootState(GO_READY);
pGo->UseDoorOrButton(0, false);
@ -129,11 +129,11 @@ public:
void SetData(uint32 type, uint32 data) override
{
switch( type )
switch (type)
{
case DATA_DRAKOS:
m_auiEncounter[DATA_DRAKOS] = data;
if( data == DONE )
if (data == DONE)
{
DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW, 1);
DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_AMOUNT, 10 - CentrifugeCount);
@ -144,18 +144,18 @@ public:
break;
case DATA_VAROS:
m_auiEncounter[DATA_VAROS] = data;
if( data == DONE )
if (data == DONE)
{
DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW, 0);
if( Creature* urom = instance->GetCreature(uiUromGUID) )
if (Creature* urom = instance->GetCreature(uiUromGUID))
urom->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
}
break;
case DATA_UROM:
m_auiEncounter[DATA_UROM] = data;
if( data == DONE )
if( Creature* eregos = instance->GetCreature(uiEregosGUID) )
if (data == DONE)
if (Creature* eregos = instance->GetCreature(uiEregosGUID))
eregos->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
break;
case DATA_EREGOS:
@ -174,13 +174,13 @@ public:
}
break;
case DATA_CC_COUNT:
if( CentrifugeCount < 10 )
if (CentrifugeCount < 10)
{
++CentrifugeCount;
DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_AMOUNT, 10 - CentrifugeCount);
}
if( CentrifugeCount >= 10 )
if( Creature* varos = instance->GetCreature(uiVarosGUID) )
if (CentrifugeCount >= 10)
if (Creature* varos = instance->GetCreature(uiVarosGUID))
{
varos->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
varos->InterruptNonMeleeSpells(false);
@ -198,13 +198,13 @@ public:
break;
}
if( data == DONE )
if (data == DONE)
SaveToDB();
}
uint32 GetData(uint32 type) const override
{
switch( type )
switch (type)
{
case DATA_DRAKOS:
case DATA_VAROS:
@ -220,7 +220,7 @@ public:
ObjectGuid GetGuidData(uint32 identifier) const override
{
switch( identifier )
switch (identifier)
{
case DATA_DRAKOS:
return uiDrakosGUID;
@ -259,24 +259,24 @@ public:
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* source, Unit const* /*target*/, uint32 /*miscvalue1*/) override
{
switch(criteria_id)
switch (criteria_id)
{
case CRITERIA_EXPERIENCED_AMBER:
if( source )
if( Unit* drake = source->GetVehicleBase() )
if( drake->GetEntry() == NPC_AMBER_DRAKE )
if (source)
if (Unit* drake = source->GetVehicleBase())
if (drake->GetEntry() == NPC_AMBER_DRAKE )
return true;
break;
case CRITERIA_EXPERIENCED_EMERALD:
if( source )
if( Unit* drake = source->GetVehicleBase() )
if( drake->GetEntry() == NPC_EMERALD_DRAKE )
if (source)
if (Unit* drake = source->GetVehicleBase())
if (drake->GetEntry() == NPC_EMERALD_DRAKE )
return true;
break;
case CRITERIA_EXPERIENCED_RUBY:
if( source )
if( Unit* drake = source->GetVehicleBase() )
if( drake->GetEntry() == NPC_RUBY_DRAKE )
if (source)
if (Unit* drake = source->GetVehicleBase())
if (drake->GetEntry() == NPC_RUBY_DRAKE )
return true;
break;
case CRITERIA_AMBER_VOID:

View file

@ -157,7 +157,7 @@ public:
return;
}
if(me->GetEntry() == NPC_BELGARISTRASZ)
if (me->GetEntry() == NPC_BELGARISTRASZ)
{
Talk(SAY_BELGARISTRASZ);
}
@ -167,10 +167,10 @@ public:
bool OnGossipHello(Player* player, Creature* creature) override
{
if(creature->IsQuestGiver())
if (creature->IsQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
if(creature->GetInstanceScript()->GetData(DATA_DRAKOS) == DONE)
if (creature->GetInstanceScript()->GetData(DATA_DRAKOS) == DONE)
{
switch (creature->GetEntry())
{
@ -251,10 +251,10 @@ public:
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) override
{
ClearGossipMenuFor(player);
switch(creature->GetEntry())
switch (creature->GetEntry())
{
case NPC_VERDISA:
switch(uiAction)
switch (uiAction)
{
case GOSSIP_ACTION_INFO_DEF:
SendGossipMenuFor(player, GOSSIP_TEXTID_VERDISA2, creature->GetGUID());
@ -273,7 +273,7 @@ public:
CloseGossipMenuFor(player);
break;
case NPC_BELGARISTRASZ:
switch(uiAction)
switch (uiAction)
{
case GOSSIP_ACTION_INFO_DEF:
openedMenu[player->GetGUID()] = true;
@ -415,11 +415,11 @@ public:
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
for( uint8 i = 0; i < 8; ++i )
if( me->m_spells[i] == spell->Id )
if (me->m_spells[i] == spell->Id)
{
if( target && target->IsAlive() && !target->CanFly() && target->IsHostileTo(me) && !spell->IsTargetingArea())
if (target && target->IsAlive() && !target->CanFly() && target->IsHostileTo(me) && !spell->IsTargetingArea())
{
if( Unit* charmer = me->GetCharmer() )
if (Unit* charmer = me->GetCharmer())
Unit::Kill(charmer, charmer, false);
}
break;

View file

@ -143,7 +143,7 @@ public:
{
if (hp)
{
switch(HealthCheck)
switch (HealthCheck)
{
case 75:
Talk(SAY_75HEALTH);

Some files were not shown because too many files have changed in this diff Show more