aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2018-01-22 23:55:33 -0300
committerShauren <shauren.trinity@gmail.com>2021-06-16 21:26:57 +0200
commitd0f4310c4417fb5dc8e89061adf4ce113caa4227 (patch)
tree311575f8d3d004140628d0f47f06539538d51112 /src/server/scripts
parentc77925da4a320df5be5eaeb1fc799df50e22c041 (diff)
Core/Entities: don't allow client control if player is still affected by any lose of control state
(cherry picked from commit e315e41d36061fc88dfa09bfa0da1fbc0c00826f)
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Commands/cs_lookup.cpp98
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp23
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