aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoschiwald <joschiwald.trinity@gmail.com>2014-06-15 17:41:42 +0200
committerjoschiwald <joschiwald.trinity@gmail.com>2014-06-15 17:41:42 +0200
commit7b3141bfde021f09d9d28eda2467262026a30ba1 (patch)
treed8ef6118c3ebb77b99afcdbf296521c9aa0f34d3
parentaca3795fa7be19ffaf25d919c79e4a98bef87148 (diff)
Scripts/Gurtogg:
* fixed bloodboil targeting * fel rage should only hit players Closes #12193
-rw-r--r--sql/updates/world/2014_06_15_00_world_spell_script_names.sql3
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_gurtogg_bloodboil.cpp (renamed from src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp)95
-rw-r--r--src/server/scripts/Outland/CMakeLists.txt2
3 files changed, 44 insertions, 56 deletions
diff --git a/sql/updates/world/2014_06_15_00_world_spell_script_names.sql b/sql/updates/world/2014_06_15_00_world_spell_script_names.sql
new file mode 100644
index 00000000000..84123740083
--- /dev/null
+++ b/sql/updates/world/2014_06_15_00_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `spell_id`=42005;
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(42005, 'spell_gurtogg_bloodboil_bloodboil');
diff --git a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp b/src/server/scripts/Outland/BlackTemple/boss_gurtogg_bloodboil.cpp
index 0004df68016..f03caa37cb2 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_gurtogg_bloodboil.cpp
@@ -17,14 +17,14 @@
*/
/* ScriptData
-SDName: Boss_Bloodboil
-SD%Complete: 80
-SDComment: Bloodboil not working correctly, missing enrage
-SDCategory: Black Temple
+Name: Boss_Bloodboil
+Complete: 80
+Category: Black Temple
EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
+#include "SpellScript.h"
#include "black_temple.h"
enum Bloodboil
@@ -54,9 +54,6 @@ enum Bloodboil
SPELL_BERSERK = 45078
};
-
-//This is used to sort the players by distance in preparation for the Bloodboil cast.
-
class boss_gurtogg_bloodboil : public CreatureScript
{
public:
@@ -137,51 +134,6 @@ public:
Talk(SAY_DEATH);
}
- // Note: This seems like a very complicated fix. The fix needs to be handled by the core, as implementation of limited-target AoE spells are still not limited.
- void CastBloodboil()
- {
- // Get the Threat List
- std::list<HostileReference*> m_threatlist = me->getThreatManager().getThreatList();
-
- if (m_threatlist.empty()) // He doesn't have anyone in his threatlist, useless to continue
- return;
-
- std::list<Unit*> targets;
- std::list<HostileReference*>::const_iterator itr = m_threatlist.begin();
- for (; itr!= m_threatlist.end(); ++itr) //store the threat list in a different container
- {
- Unit* target = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid());
- //only on alive players
- if (target && target->IsAlive() && target->GetTypeId() == TYPEID_PLAYER)
- targets.push_back(target);
- }
-
- //Sort the list of players
- targets.sort(Trinity::ObjectDistanceOrderPred(me, false));
- //Resize so we only get top 5
- targets.resize(5);
-
- //Aura each player in the targets list with Bloodboil. Aura code copied+pasted from Aura command in Level3.cpp
- /*SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_BLOODBOIL);
- if (spellInfo)
- {
- for (std::list<Unit*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
- {
- Unit* target = *itr;
- if (!target) return;
- for (uint32 i = 0; i<3; ++i)
- {
- uint8 eff = spellInfo->Effect[i];
- if (eff >= TOTAL_SPELL_EFFECTS)
- continue;
-
- Aura* Aur = new Aura(spellInfo, i, target, target, target);
- target->AddAura(Aur);
- }
- }
- }*/
- }
-
void RevertThreatOnTarget(uint64 guid)
{
if (Unit* unit = ObjectAccessor::GetUnit(*me, guid))
@@ -247,8 +199,7 @@ public:
{
if (BloodboilCount < 5) // Only cast it five times.
{
- //CastBloodboil(); // Causes issues on windows, so is commented out.
- DoCastVictim(SPELL_BLOODBOIL);
+ DoCastAOE(SPELL_BLOODBOIL);
++BloodboilCount;
BloodboilTimer = 10000*BloodboilCount;
}
@@ -274,7 +225,7 @@ public:
{
if (Phase1)
{
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
{
Phase1 = false;
@@ -327,7 +278,41 @@ public:
};
+// 42005 - Bloodboil
+class spell_gurtogg_bloodboil_bloodboil : public SpellScriptLoader
+{
+ public:
+ spell_gurtogg_bloodboil_bloodboil() : SpellScriptLoader("spell_gurtogg_bloodboil_bloodboil") { }
+
+ class spell_gurtogg_bloodboil_bloodboil_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gurtogg_bloodboil_bloodboil_SpellScript);
+
+ void FilterTargets(std::list<WorldObject*>& targets)
+ {
+ if (targets.size() <= 5)
+ return;
+
+ // Sort the list of players
+ targets.sort(Trinity::ObjectDistanceOrderPred(GetCaster(), false));
+ // Resize so we only get top 5
+ targets.resize(5);
+ }
+
+ void Register() override
+ {
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_gurtogg_bloodboil_bloodboil_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_gurtogg_bloodboil_bloodboil_SpellScript();
+ }
+};
+
void AddSC_boss_gurtogg_bloodboil()
{
new boss_gurtogg_bloodboil();
+ new spell_gurtogg_bloodboil_bloodboil();
}
diff --git a/src/server/scripts/Outland/CMakeLists.txt b/src/server/scripts/Outland/CMakeLists.txt
index 414a3bce14a..0c69a236ef8 100644
--- a/src/server/scripts/Outland/CMakeLists.txt
+++ b/src/server/scripts/Outland/CMakeLists.txt
@@ -112,7 +112,7 @@ set(scripts_STAT_SRCS
Outland/BlackTemple/instance_black_temple.cpp
Outland/BlackTemple/boss_reliquary_of_souls.cpp
Outland/BlackTemple/boss_warlord_najentus.cpp
- Outland/BlackTemple/boss_bloodboil.cpp
+ Outland/BlackTemple/boss_gurtogg_bloodboil.cpp
Outland/BlackTemple/boss_illidan.cpp
Outland/zone_shadowmoon_valley.cpp
Outland/zone_blades_edge_mountains.cpp