From 846d352eb9cc0109d47bdf25beafd36e571fb28c Mon Sep 17 00:00:00 2001 From: killerwife Date: Sat, 10 Aug 2024 16:42:42 +0200 Subject: [PATCH] GO: Fix aura generator not applying other effects and add condition for cloak dome --- .../ScriptDevAI/scripts/world/go_scripts.cpp | 36 +++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/src/game/AI/ScriptDevAI/scripts/world/go_scripts.cpp b/src/game/AI/ScriptDevAI/scripts/world/go_scripts.cpp index 4b6a885cac7..5c1530bb13a 100644 --- a/src/game/AI/ScriptDevAI/scripts/world/go_scripts.cpp +++ b/src/game/AI/ScriptDevAI/scripts/world/go_scripts.cpp @@ -1133,6 +1133,30 @@ struct go_aura_generator : public GameObjectAI ChangeState(bool(miscValue)); } + bool CustomCondition(Player const* player) + { + switch (m_spellInfo->Id) + { + case 59652: // Cloak Dome (Aura Generator) + case 61342: // Cloak Dome (Aura Generator 2) + { + { + QuestStatus questStatus = player->GetQuestStatus(13379); + if (questStatus == QUEST_STATUS_INCOMPLETE || questStatus == QUEST_STATUS_COMPLETE) + return true; + } + { + QuestStatus questStatus = player->GetQuestStatus(13383); + if (questStatus == QUEST_STATUS_INCOMPLETE || questStatus == QUEST_STATUS_COMPLETE) + return true; + } + return false; + } + } + + return true; + } + void ChangeState(bool apply) { m_started = apply; @@ -1165,6 +1189,8 @@ struct go_aura_generator : public GameObjectAI for (auto& ref : m_go->GetMap()->GetPlayers()) { Player* player = ref.getSource(); + if (!CustomCondition(player)) + continue; float x, y, z; m_go->GetPosition(x, y, z); auto bounds = player->GetSpellAuraHolderBounds(m_spellInfo->Id); @@ -1184,8 +1210,14 @@ struct go_aura_generator : public GameObjectAI if (isCloseEnough) { myHolder = CreateSpellAuraHolder(m_spellInfo, player, m_go); - GameObjectAura* Aur = new GameObjectAura(m_spellInfo, EFFECT_INDEX_0, nullptr, nullptr, myHolder, player, m_go); - myHolder->AddAura(Aur, EFFECT_INDEX_0); + for (uint32 i = 0; i < MAX_EFFECT_INDEX; ++i) + { + if (m_spellInfo->EffectApplyAuraName[i] > 0) + { + GameObjectAura* Aur = new GameObjectAura(m_spellInfo, SpellEffectIndex(i), nullptr, nullptr, myHolder, player, m_go); + myHolder->AddAura(Aur, SpellEffectIndex(i)); + } + } if (!player->AddSpellAuraHolder(myHolder)) delete myHolder; }