mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 19:06:49 +01:00
Scripts/Deadmines: implement Admiral Ripsnarl encounter
This commit is contained in:
48
sql/updates/world/4.3.4/custom_2018_02_19_00_world.sql
Normal file
48
sql/updates/world/4.3.4/custom_2018_02_19_00_world.sql
Normal file
@@ -0,0 +1,48 @@
|
||||
-- Template Updates
|
||||
-- Admiral Ripsnarl
|
||||
UPDATE `creature_template` SET `ScriptName`= 'boss_admiral_ripsnarl' WHERE `entry`= 47626;
|
||||
UPDATE `creature_template` SET `minlevel`= 87, `maxlevel`= 87, `DamageModifier`= 30, `flags_extra`= 1 WHERE `entry`= 48943;
|
||||
-- Vapor
|
||||
UPDATE `creature_template` SET `minlevel`= 15, `maxlevel`= 15, `difficulty_entry_1`= 49241, `ScriptName`= 'npc_ripsnarl_vapor' WHERE `entry`= 47714;
|
||||
UPDATE `creature_template` SET `minlevel`= 87, `maxlevel`= 87, `exp`= 3, `faction`= 14, `DamageModifier`= 10 WHERE `entry`= 49241;
|
||||
|
||||
|
||||
-- Texts
|
||||
DELETE FROM `creature_text` WHERE `CreatureID`= 47626;
|
||||
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `Comment`) VALUES
|
||||
(47626, 0, 0, 'Ah, fresh meat!', 14, 0, 100, 0, 0, 19882, 48179, 'Admiral Ripsnarl - Aggro'),
|
||||
(47626, 1, 0, 'Do you feel that chill running up your spine?', 14, 0, 100, 0, 0, 19877, 47914, 'Admiral Ripsnarl - Fog 1'),
|
||||
(47626, 2, 0, 'The fog is rolling in...', 14, 0, 100, 0, 0, 0, 47915, 'Admiral Ripsnarl - Fog 2'),
|
||||
(47626, 3, 0, 'Your blood only increases my hunger!', 14, 0, 100, 0, 0, 19876, 48009, 'Admiral Ripsnarl - Slay'),
|
||||
(47626, 4, 0, 'I can smell your fear...', 14, 0, 100, 0, 0, 19879, 48006, 'Admiral Ripsnarl - Go for the Throat 1'),
|
||||
(47626, 4, 1, 'I will rip your heart from your chest!', 14, 0, 100, 0, 0, 19880, 48007, 'Admiral Ripsnarl - Go for the Throat 2'),
|
||||
(47626, 5, 0, 'Multiple vapors appear from the fog! Kill Admiral Ripsnarl before you are overwhelmed!', 41, 0, 100, 0, 0, 19878, 50851, 'Admiral Ripsnarl - Announce Vapor'),
|
||||
(47626, 6, 0, 'You will...NOT find her...until it is too late...', 14, 0, 100, 0, 0, 19875, 48010, 'Admiral Ripsnarl - Death');
|
||||
|
||||
-- Conditions
|
||||
DELETE FROM `conditions` WHERE `SourceEntry` IN (95408) AND `SourceTypeOrReferenceId`= 13;
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ScriptName`, `Comment`) VALUES
|
||||
(13, 1, 95408, 0, 0, 31, 0, 3, 48266, 0, 0, 0, '', 'Ripnsarl Cannon Kill - Target Defias Cannon');
|
||||
|
||||
-- Spells
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName` IN
|
||||
('spell_ripsnarl_go_for_the_throat_targeting',
|
||||
'spell_ripsnarl_summon_vapor_targeting');
|
||||
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(88838, 'spell_ripsnarl_go_for_the_throat_targeting'),
|
||||
(88833, 'spell_ripsnarl_summon_vapor_targeting');
|
||||
|
||||
-- Loot
|
||||
UPDATE `creature_template` SET `lootid`= 47626 WHERE `entry` = 47626;
|
||||
DELETE FROM creature_loot_template WHERE `Entry` IN (47626, 48943);
|
||||
INSERT INTO `creature_loot_template` (`Entry`, `Item`, `Chance`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`) VALUES
|
||||
(47626, 1156, 0, 1, 1, 1, 1),
|
||||
(47626, 5196, 0, 1, 1, 1, 1),
|
||||
(47626, 872, 0, 1, 1, 1, 1);
|
||||
|
||||
UPDATE `creature_template` SET `lootid`= 48943 WHERE `entry` = 48943;
|
||||
INSERT INTO `creature_loot_template` (`Entry`, `Item`, `Chance`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`) VALUES
|
||||
(48943, 65166, 0, 1, 1, 1, 1),
|
||||
(48943, 65165, 0, 1, 1, 1, 1),
|
||||
(48943, 65167, 0, 1, 1, 1, 1);
|
||||
@@ -0,0 +1,462 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2017 TrinityCore <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ObjectMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "Player.h"
|
||||
#include "deadmines.h"
|
||||
|
||||
enum Texts
|
||||
{
|
||||
// Admiral Ripsnarl
|
||||
SAY_AGGRO = 0,
|
||||
SAY_FOG_1 = 1,
|
||||
SAY_FOG_2 = 2,
|
||||
SAY_SLAY = 3,
|
||||
SAY_GO_FOR_THE_THROAT = 4,
|
||||
SAY_ANNOUNCE_VAPORS = 5,
|
||||
SAY_DEATH = 6
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
// Admiral Ripsnarl
|
||||
SPELL_RIPSNARL_CANNON_KILL = 95408,
|
||||
SPELL_THIRST_FOR_BLOOD = 88736,
|
||||
SPELL_SWIPE = 88839,
|
||||
SPELL_EMOTE_TALK = 79506,
|
||||
SPELL_VANISH = 88840,
|
||||
SPELL_GO_FOR_THE_THROAT_TARGETING = 88838,
|
||||
SPELL_SUMMON_VAPOR_TARGETING = 88833,
|
||||
|
||||
// Vapor
|
||||
SPELL_STEAM_AURA = 95503,
|
||||
SPELL_CONDENSATION = 92013,
|
||||
|
||||
SPELL_SWIRLING_VAPOR = 92007,
|
||||
SPELL_CONDENSING_VAPOR = 92008,
|
||||
SPELL_FREEZING_VAPOR = 92011,
|
||||
SPELL_COALESCE = 92042,
|
||||
SPELL_CONDENSE_TRANSFORM_1 = 92016,
|
||||
SPELL_CONDENSE_TRANSFORM_2 = 92020,
|
||||
SPELL_VAPOR_ANIMUS = 92038,
|
||||
|
||||
// General Purpose Bunny JMF
|
||||
SPELL_RIPSNARLS_FOG_AURA = 89247
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
// Admiral Ripsnarl
|
||||
EVENT_SWIPE = 1,
|
||||
EVENT_SAY_VANISH_INTRO,
|
||||
EVENT_VANISH,
|
||||
EVENT_CAST_VANISH,
|
||||
EVENT_CAST_RIPSNARLS_FOG_AURA,
|
||||
EVENT_GO_FOR_THE_THROAT,
|
||||
EVENT_SUMMON_VAPOR,
|
||||
|
||||
// Vapor
|
||||
EVENT_VAPOR,
|
||||
};
|
||||
|
||||
enum Sounds
|
||||
{
|
||||
SOUND_HOWL = 19881
|
||||
};
|
||||
|
||||
class boss_admiral_ripsnarl: public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_admiral_ripsnarl() : CreatureScript("boss_admiral_ripsnarl") { }
|
||||
|
||||
struct boss_admiral_ripsnarlAI : public BossAI
|
||||
{
|
||||
boss_admiral_ripsnarlAI(Creature* creature) : BossAI(creature, DATA_ADMIRAL_RIPSNARL)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_vanishCounter = 0;
|
||||
_firstVaporGuid.Clear();
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
Initialize();
|
||||
DoCastSelf(SPELL_THIRST_FOR_BLOOD, true);
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
_JustEngagedWith();
|
||||
Talk(SAY_AGGRO);
|
||||
DoCastAOE(SPELL_RIPSNARL_CANNON_KILL, true);
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me);
|
||||
events.ScheduleEvent(EVENT_SWIPE, Seconds(3) + Milliseconds(500));
|
||||
if (IsHeroic())
|
||||
events.ScheduleEvent(EVENT_GO_FOR_THE_THROAT, Seconds(11));
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
instance->SetData(DATA_RIPSNARL_FOG, NOT_STARTED);
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
_EnterEvadeMode();
|
||||
summons.DespawnAll();
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
instance->SetData(DATA_RIPSNARL_FOG, NOT_STARTED);
|
||||
summons.DespawnAll();
|
||||
_DespawnAtEvade();
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon) override
|
||||
{
|
||||
summons.Summon(summon);
|
||||
if (_firstVaporGuid.IsEmpty())
|
||||
_firstVaporGuid = summon->GetGUID();
|
||||
}
|
||||
|
||||
void SummonedCreatureDies(Creature* summon, Unit* /*killer*/) override
|
||||
{
|
||||
switch (summon->GetEntry())
|
||||
{
|
||||
case NPC_VAPOR:
|
||||
if (summon->GetGUID() == _firstVaporGuid)
|
||||
Talk(SAY_GO_FOR_THE_THROAT);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/) override
|
||||
{
|
||||
if (HealthBelowPct(75) && _vanishCounter == 0)
|
||||
{
|
||||
Talk(SAY_FOG_1);
|
||||
DoCastSelf(SPELL_EMOTE_TALK, true);
|
||||
me->AttackStop();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
events.CancelEvent(EVENT_GO_FOR_THE_THROAT);
|
||||
events.CancelEvent(EVENT_SWIPE);
|
||||
events.CancelEvent(EVENT_SUMMON_VAPOR);
|
||||
events.ScheduleEvent(EVENT_VANISH, Seconds(3) + Milliseconds(600));
|
||||
events.ScheduleEvent(EVENT_SAY_VANISH_INTRO, Seconds(3) + Milliseconds(600));
|
||||
events.ScheduleEvent(EVENT_CAST_RIPSNARLS_FOG_AURA, Seconds(3) + Milliseconds(600));
|
||||
_vanishCounter++;
|
||||
}
|
||||
else if (HealthBelowPct(50) && _vanishCounter == 1)
|
||||
{
|
||||
me->AttackStop();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
events.CancelEvent(EVENT_GO_FOR_THE_THROAT);
|
||||
events.CancelEvent(EVENT_SWIPE);
|
||||
events.CancelEvent(EVENT_SUMMON_VAPOR);
|
||||
events.ScheduleEvent(EVENT_VANISH, Milliseconds(1));
|
||||
_vanishCounter++;
|
||||
}
|
||||
else if (HealthBelowPct(25) && _vanishCounter == 2)
|
||||
{
|
||||
me->AttackStop();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
events.CancelEvent(EVENT_GO_FOR_THE_THROAT);
|
||||
events.CancelEvent(EVENT_SWIPE);
|
||||
events.CancelEvent(EVENT_SUMMON_VAPOR);
|
||||
events.ScheduleEvent(EVENT_VANISH, Milliseconds(1));
|
||||
_vanishCounter++;
|
||||
}
|
||||
else if (IsHeroic() && HealthBelowPct(10) && _vanishCounter == 3)
|
||||
{
|
||||
for (uint8 i = 0; i < 3; i++)
|
||||
DoCastAOE(SPELL_SUMMON_VAPOR_TARGETING, true);
|
||||
|
||||
_vanishCounter++;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SWIPE:
|
||||
DoCastVictim(SPELL_SWIPE);
|
||||
events.Repeat(Seconds(3) + Milliseconds(500));
|
||||
break;
|
||||
case EVENT_SAY_VANISH_INTRO:
|
||||
Talk(SAY_FOG_2);
|
||||
instance->SetData(DATA_RIPSNARL_FOG, IN_PROGRESS);
|
||||
break;
|
||||
case EVENT_VANISH:
|
||||
{
|
||||
float angle = me->GetOrientation() + float(M_PI);
|
||||
float x = me->GetPositionX() + cos(angle) * 5;
|
||||
float y = me->GetPositionY() + sin(angle) * 5;
|
||||
float z = me->GetPositionZ();
|
||||
me->GetMotionMaster()->MovePoint(0, x, y, z, false);
|
||||
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
_firstVaporGuid.Clear();
|
||||
events.ScheduleEvent(EVENT_CAST_VANISH, Milliseconds(1));
|
||||
events.ScheduleEvent(EVENT_GO_FOR_THE_THROAT, Seconds(22) + Milliseconds(500));
|
||||
events.ScheduleEvent(EVENT_SUMMON_VAPOR, Seconds(3));
|
||||
break;
|
||||
}
|
||||
case EVENT_CAST_VANISH:
|
||||
DoCastSelf(SPELL_VANISH);
|
||||
break;
|
||||
case EVENT_CAST_RIPSNARLS_FOG_AURA:
|
||||
if (Creature* bunny = me->FindNearestCreature(NPC_GENERAL_PURPOSE_DUMMY_JMF, 100.0f, true))
|
||||
bunny->CastSpell(bunny, SPELL_RIPSNARLS_FOG_AURA);
|
||||
events.Repeat(Seconds(2));
|
||||
break;
|
||||
case EVENT_GO_FOR_THE_THROAT:
|
||||
if (me->HasAura(SPELL_VANISH))
|
||||
{
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me);
|
||||
me->RemoveAurasDueToSpell(SPELL_VANISH);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->PlayDirectSound(SOUND_HOWL);
|
||||
events.ScheduleEvent(EVENT_SWIPE, Seconds(3) + Milliseconds(500));
|
||||
events.RescheduleEvent(EVENT_SUMMON_VAPOR, Seconds(10));
|
||||
}
|
||||
DoCastAOE(SPELL_GO_FOR_THE_THROAT_TARGETING, true);
|
||||
if (IsHeroic())
|
||||
events.Repeat(_vanishCounter > 0 ? Seconds(9) + Milliseconds(500) : Seconds(10), _vanishCounter > 0 ? Seconds(10) : Seconds(12));
|
||||
break;
|
||||
case EVENT_SUMMON_VAPOR:
|
||||
DoCastAOE(SPELL_SUMMON_VAPOR_TARGETING, true);
|
||||
events.Repeat(me->HasAura(SPELL_VANISH) ? Seconds(4) : Seconds(12), me->HasAura(SPELL_VANISH) ? Seconds(5) : Seconds(16));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
private:
|
||||
uint8 _vanishCounter;
|
||||
ObjectGuid _firstVaporGuid;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature *creature) const override
|
||||
{
|
||||
return GetDeadminesAI<boss_admiral_ripsnarlAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_ripsnarl_vapor : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_ripsnarl_vapor() : CreatureScript("npc_ripsnarl_vapor") { }
|
||||
|
||||
struct npc_ripsnarl_vaporAI : public ScriptedAI
|
||||
{
|
||||
npc_ripsnarl_vaporAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void IsSummonedBy(Unit* /*summoner*/) override
|
||||
{
|
||||
DoCastSelf(SPELL_STEAM_AURA, true);
|
||||
if (Player* player = me->SelectNearestPlayer(50.0f))
|
||||
me->AI()->AttackStart(player);
|
||||
|
||||
if (IsHeroic())
|
||||
{
|
||||
DoCastSelf(SPELL_CONDENSATION, true);
|
||||
_events.ScheduleEvent(EVENT_VAPOR, Seconds(3), Seconds(4));
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
me->DespawnOrUnsummon(Seconds(5));
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
|
||||
{
|
||||
if (spell->Id == SPELL_VAPOR_ANIMUS)
|
||||
DoCastAOE(SPELL_COALESCE, true);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
_events.Update(diff);
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_VAPOR:
|
||||
{
|
||||
uint32 spellId = SPELL_SWIRLING_VAPOR;
|
||||
if (me->HasAura(SPELL_CONDENSE_TRANSFORM_1))
|
||||
spellId = SPELL_CONDENSING_VAPOR;
|
||||
else if (me->HasAura(SPELL_CONDENSE_TRANSFORM_2))
|
||||
spellId = SPELL_FREEZING_VAPOR;
|
||||
|
||||
DoCastSelf(spellId);
|
||||
_events.Repeat(Seconds(9), Seconds(10));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
private:
|
||||
EventMap _events;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetDeadminesAI<npc_ripsnarl_vaporAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class TargetingCheck
|
||||
{
|
||||
public:
|
||||
TargetingCheck() { }
|
||||
|
||||
bool operator()(WorldObject* object)
|
||||
{
|
||||
if (Unit* unit = object->ToUnit())
|
||||
if ((unit->IsCharmedOwnedByPlayerOrPlayer()) || unit->GetTypeId() == TYPEID_PLAYER)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class spell_ripsnarl_go_for_the_throat_targeting : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_ripsnarl_go_for_the_throat_targeting() : SpellScriptLoader("spell_ripsnarl_go_for_the_throat_targeting") { }
|
||||
|
||||
class spell_ripsnarl_go_for_the_throat_targeting_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_ripsnarl_go_for_the_throat_targeting_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
targets.remove_if(TargetingCheck());
|
||||
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
Trinity::Containers::RandomResize(targets, 1);
|
||||
}
|
||||
|
||||
void HandleHit(SpellEffIndex effIndex)
|
||||
{
|
||||
GetCaster()->CastSpell(GetHitUnit(), GetSpellInfo()->Effects[effIndex].BasePoints, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ripsnarl_go_for_the_throat_targeting_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_ripsnarl_go_for_the_throat_targeting_SpellScript::HandleHit, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_ripsnarl_go_for_the_throat_targeting_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_ripsnarl_summon_vapor_targeting : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_ripsnarl_summon_vapor_targeting() : SpellScriptLoader("spell_ripsnarl_summon_vapor_targeting") { }
|
||||
|
||||
class spell_ripsnarl_summon_vapor_targeting_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_ripsnarl_summon_vapor_targeting_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (targets.empty())
|
||||
{
|
||||
if (Creature* caster = GetCaster()->ToCreature())
|
||||
caster->AI()->EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
|
||||
targets.remove_if(TargetingCheck());
|
||||
|
||||
if (targets.empty())
|
||||
{
|
||||
if (Creature* caster = GetCaster()->ToCreature())
|
||||
caster->AI()->EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
|
||||
Trinity::Containers::RandomResize(targets, 1);
|
||||
}
|
||||
|
||||
void HandleHit(SpellEffIndex effIndex)
|
||||
{
|
||||
GetCaster()->CastSpell(GetHitUnit(), GetSpellInfo()->Effects[effIndex].BasePoints, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ripsnarl_summon_vapor_targeting_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_ripsnarl_summon_vapor_targeting_SpellScript::HandleHit, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_ripsnarl_summon_vapor_targeting_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_admiral_ripsnarl()
|
||||
{
|
||||
new boss_admiral_ripsnarl();
|
||||
new npc_ripsnarl_vapor();
|
||||
new spell_ripsnarl_go_for_the_throat_targeting();
|
||||
new spell_ripsnarl_summon_vapor_targeting();
|
||||
}
|
||||
@@ -40,7 +40,8 @@ enum DMDataTypes
|
||||
DATA_FOE_REAPER_BUNNY = 10,
|
||||
DATA_PROTOTYPE_REAPER = 11,
|
||||
DATA_BROKEN_DOOR = 13,
|
||||
DATA_IRON_CLAD_DOOR = 14
|
||||
DATA_IRON_CLAD_DOOR = 14,
|
||||
DATA_RIPSNARL_FOG = 15
|
||||
};
|
||||
|
||||
enum DMCreatures
|
||||
@@ -49,6 +50,7 @@ enum DMCreatures
|
||||
BOSS_GLUBTOK = 47162,
|
||||
BOSS_HELIX_GEARBREAKER = 47296,
|
||||
BOSS_FOE_REAPER_5000 = 43778,
|
||||
BOSS_ADMIRAL_RIPSNARL = 47626,
|
||||
|
||||
// Horde Creatures
|
||||
NPC_SLINKY_SHARPSHIV = 46906,
|
||||
@@ -84,6 +86,7 @@ enum DMCreatures
|
||||
NPC_FOE_REAPER_TARGETING_BUNNY = 47468,
|
||||
NPC_PROTOTYPE_REAPER = 49208,
|
||||
NPC_MOLTEN_SLAG = 49229,
|
||||
NPC_VAPOR = 47714
|
||||
};
|
||||
|
||||
enum DMGameObjects
|
||||
@@ -97,6 +100,10 @@ enum DMGameObjects
|
||||
GO_FOUNDRY_DOOR = 16399
|
||||
};
|
||||
|
||||
enum DMSpells
|
||||
{
|
||||
SPELL_FOG = 88768
|
||||
};
|
||||
|
||||
template<class AI>
|
||||
AI* GetDeadminesAI(Creature* creature)
|
||||
|
||||
@@ -27,6 +27,7 @@ ObjectData const creatureData[] =
|
||||
{ BOSS_GLUBTOK, DATA_GLUBTOK },
|
||||
{ BOSS_HELIX_GEARBREAKER, DATA_HELIX_GEARBREAKER },
|
||||
{ BOSS_FOE_REAPER_5000, DATA_FOE_REAPER_5000 },
|
||||
{ BOSS_ADMIRAL_RIPSNARL, DATA_ADMIRAL_RIPSNARL },
|
||||
{ NPC_LUMBERING_OAF, DATA_LUMBERING_OAF },
|
||||
{ NPC_FOE_REAPER_TARGETING_BUNNY, DATA_FOE_REAPER_BUNNY },
|
||||
{ NPC_PROTOTYPE_REAPER, DATA_PROTOTYPE_REAPER },
|
||||
@@ -126,6 +127,13 @@ class instance_deadmines : public InstanceMapScript
|
||||
if (Creature* reaper = GetCreature(DATA_FOE_REAPER_5000))
|
||||
reaper->AI()->JustSummoned(creature);
|
||||
break;
|
||||
case NPC_GENERAL_PURPOSE_BUNNY_L2:
|
||||
_generalPurposeBunnyJMF2GuidSet.insert(creature->GetGUID());
|
||||
break;
|
||||
case NPC_VAPOR:
|
||||
if (Creature* ripsnarl = GetCreature(DATA_ADMIRAL_RIPSNARL))
|
||||
ripsnarl->AI()->JustSummoned(creature);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -162,6 +170,22 @@ class instance_deadmines : public InstanceMapScript
|
||||
_IronCladDoorState = data;
|
||||
SaveToDB();
|
||||
break;
|
||||
case DATA_RIPSNARL_FOG:
|
||||
if (data == IN_PROGRESS)
|
||||
{
|
||||
if (Creature* ripsnarl = GetCreature(DATA_ADMIRAL_RIPSNARL))
|
||||
for (auto itr = _generalPurposeBunnyJMF2GuidSet.begin(); itr != _generalPurposeBunnyJMF2GuidSet.end(); itr++)
|
||||
if (Creature* bunny = instance->GetCreature(*itr))
|
||||
if (bunny->GetDistance2d(ripsnarl->GetHomePosition().GetPositionX(), ripsnarl->GetHomePosition().GetPositionY()) <= 100.0f)
|
||||
bunny->CastSpell(bunny, SPELL_FOG, true);
|
||||
}
|
||||
else if (data == NOT_STARTED)
|
||||
{
|
||||
for (auto itr = _generalPurposeBunnyJMF2GuidSet.begin(); itr != _generalPurposeBunnyJMF2GuidSet.end(); itr++)
|
||||
if (Creature* bunny = instance->GetCreature(*itr))
|
||||
bunny->RemoveAllAuras();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -201,6 +225,7 @@ class instance_deadmines : public InstanceMapScript
|
||||
uint32 _teamInInstance;
|
||||
uint32 _foeReaper5000Intro;
|
||||
uint32 _IronCladDoorState;
|
||||
GuidSet _generalPurposeBunnyJMF2GuidSet;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@ void AddSC_instance_deadmines();
|
||||
void AddSC_boss_glubtok();
|
||||
void AddSC_boss_helix_gearbreaker();
|
||||
void AddSC_boss_foe_reaper_5000();
|
||||
void AddSC_boss_admiral_ripsnarl();
|
||||
void AddSC_gilneas_c1(); //Gilneas
|
||||
void AddSC_gnomeregan(); //Gnomeregan
|
||||
void AddSC_instance_gnomeregan();
|
||||
@@ -276,6 +277,7 @@ void AddEasternKingdomsScripts()
|
||||
AddSC_boss_glubtok();
|
||||
AddSC_boss_helix_gearbreaker();
|
||||
AddSC_boss_foe_reaper_5000();
|
||||
AddSC_boss_admiral_ripsnarl();
|
||||
AddSC_gilneas_c1(); //Gilneas
|
||||
AddSC_gnomeregan(); //Gnomeregan
|
||||
AddSC_instance_gnomeregan();
|
||||
|
||||
Reference in New Issue
Block a user