diff options
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/Commands/cs_lookup.cpp | 98 | ||||
| -rw-r--r-- | src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp | 23 |
2 files changed, 58 insertions, 63 deletions
diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 6391adf7438..8ea4aa3dc27 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -615,68 +615,64 @@ public: for (auto const& questTemplatePair : questTemplates) { uint8 localeIndex = handler->GetSessionDbLocaleIndex(); - if (localeIndex >= 0) + if (QuestTemplateLocale const* questLocale = sObjectMgr->GetQuestLocale(questTemplatePair.first)) { - uint8 ulocaleIndex = uint8(localeIndex); - if (QuestTemplateLocale const* questLocale = sObjectMgr->GetQuestLocale(questTemplatePair.first)) + if (questLocale->LogTitle.size() > localeIndex && !questLocale->LogTitle[localeIndex].empty()) { - if (questLocale->LogTitle.size() > ulocaleIndex && !questLocale->LogTitle[ulocaleIndex].empty()) - { - std::string title = questLocale->LogTitle[ulocaleIndex]; + std::string title = questLocale->LogTitle[localeIndex]; - if (Utf8FitTo(title, wNamePart)) + if (Utf8FitTo(title, wNamePart)) + { + if (maxResults && count++ == maxResults) { - if (maxResults && count++ == maxResults) - { - handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); - return true; - } + handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); + return true; + } - char const* statusStr = ""; + char const* statusStr = ""; - if (target) + if (target) + { + switch (target->GetQuestStatus(questTemplatePair.first)) { - switch (target->GetQuestStatus(questTemplatePair.first)) - { - case QUEST_STATUS_COMPLETE: - statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_COMPLETE); - break; - case QUEST_STATUS_INCOMPLETE: - statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_ACTIVE); - break; - case QUEST_STATUS_REWARDED: - statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_REWARDED); - break; - default: - break; - } + case QUEST_STATUS_COMPLETE: + statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_COMPLETE); + break; + case QUEST_STATUS_INCOMPLETE: + statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_ACTIVE); + break; + case QUEST_STATUS_REWARDED: + statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_REWARDED); + break; + default: + break; } + } - if (handler->GetSession()) - { - int32 maxLevel = 0; - if (Optional<ContentTuningLevels> questLevels = sDB2Manager.GetContentTuningData(questTemplatePair.second.GetContentTuningId(), - handler->GetSession()->GetPlayer()->m_playerData->CtrOptions->ContentTuningConditionMask)) - maxLevel = questLevels->MaxLevel; - - int32 scalingFactionGroup = 0; - if (ContentTuningEntry const* contentTuning = sContentTuningStore.LookupEntry(questTemplatePair.second.GetContentTuningId())) - scalingFactionGroup = contentTuning->GetScalingFactionGroup(); - - handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, questTemplatePair.first, questTemplatePair.first, - handler->GetSession()->GetPlayer()->GetQuestLevel(&questTemplatePair.second), - handler->GetSession()->GetPlayer()->GetQuestMinLevel(&questTemplatePair.second), - maxLevel, scalingFactionGroup, - title.c_str(), statusStr); - } - else - handler->PSendSysMessage(LANG_QUEST_LIST_CONSOLE, questTemplatePair.first, title.c_str(), statusStr); + if (handler->GetSession()) + { + int32 maxLevel = 0; + if (Optional<ContentTuningLevels> questLevels = sDB2Manager.GetContentTuningData(questTemplatePair.second.GetContentTuningId(), + handler->GetSession()->GetPlayer()->m_playerData->CtrOptions->ContentTuningConditionMask)) + maxLevel = questLevels->MaxLevel; + + int32 scalingFactionGroup = 0; + if (ContentTuningEntry const* contentTuning = sContentTuningStore.LookupEntry(questTemplatePair.second.GetContentTuningId())) + scalingFactionGroup = contentTuning->GetScalingFactionGroup(); + + handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, questTemplatePair.first, questTemplatePair.first, + handler->GetSession()->GetPlayer()->GetQuestLevel(&questTemplatePair.second), + handler->GetSession()->GetPlayer()->GetQuestMinLevel(&questTemplatePair.second), + maxLevel, scalingFactionGroup, + title.c_str(), statusStr); + } + else + handler->PSendSysMessage(LANG_QUEST_LIST_CONSOLE, questTemplatePair.first, title.c_str(), statusStr); - if (!found) - found = true; + if (!found) + found = true; - continue; - } + continue; } } } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp index b0469a7689d..f0adef90f4b 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp @@ -570,7 +570,7 @@ class spell_auriaya_agro_creator : public SpellScript } }; -// 61906 - Random Aggro Periodic (5 sec) +// 61906 - Random Aggro Periodic (5 sec) class spell_auriaya_random_agro_periodic : public AuraScript { PrepareAuraScript(spell_auriaya_random_agro_periodic); @@ -586,17 +586,16 @@ class spell_auriaya_random_agro_periodic : public AuraScript if (!owner || !owner->IsAIEnabled || owner->HasReactState(REACT_PASSIVE)) return; - if (Unit* target = owner->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0, CatsTargetSelector(owner, 15.0f, 25.0f))) - { - owner->GetThreatManager().AddThreat(target, 3000000.0f, nullptr, true); - owner->CastSpell(target, SPELL_FERAL_POUNCE, true); - owner->AI()->AttackStart(target); - } - else if (Unit* target = owner->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0)) - { - owner->GetThreatManager().AddThreat(target, 3000000.0f); - owner->AI()->AttackStart(target); - } + Unit* target = owner->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0, CatsTargetSelector(owner, 15.0f, 25.0f)); + if (!target) + target = owner->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0); + + if (!target) + return; + + owner->GetThreatManager().AddThreat(target, 3000000.0f, nullptr, true); + owner->CastSpell(target, SPELL_FERAL_POUNCE, true); + owner->AI()->AttackStart(target); } void Register() override |
