mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
Scripts/GB: implement General Umbriss encounter
*todo: loot
This commit is contained in:
74
sql/updates/world/4.3.4/custom_2018_01_18_00_world.sql
Normal file
74
sql/updates/world/4.3.4/custom_2018_01_18_00_world.sql
Normal file
@@ -0,0 +1,74 @@
|
||||
-- Assign scriptname to instance
|
||||
UPDATE `instance_template` SET `script`= 'instance_grim_batol' WHERE `map`= 670;
|
||||
|
||||
-- Template Updates
|
||||
UPDATE `creature_template` SET `scriptname`= 'boss_general_umbriss', `flags_extra`= `flags_extra`| 0x40000000 WHERE `entry`= 39625;
|
||||
UPDATE `creature_template` SET `minlevel`= 87, `maxlevel`= 87, `BaseAttackTime`= 1500, `unit_flags`= 67141696, `lootid`= 48337, `mechanic_immune_mask`= 617299839, `flags_extra`= `flags_extra`| 0x40000000 WHERE `entry`= 48337;
|
||||
-- Blitz / Ground Siege
|
||||
UPDATE `creature_template` SET `faction`= 35, `unit_flags`= 33554688, `flags_extra`= 131 WHERE `entry` IN (40040, 40030);
|
||||
|
||||
-- Remove db side spawned Malignant Trogg
|
||||
DELETE FROM `creature` WHERE `guid`= 340015;
|
||||
DELETE FROM `creature_addon` WHERE `guid`= 340015;
|
||||
|
||||
-- Texts
|
||||
DELETE FROM `creature_text` WHERE `CreatureID`= 39625;
|
||||
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `Comment`) VALUES
|
||||
(39625, 0, 0, 'Cover the rear! Alexstrasza''s brood decimate our ranks!', 14, 0, 100, 0, 0, 18537, 40642, 'General Umbriss'),
|
||||
(39625, 0, 1, 'Reinforce the front! We are being invaded!', 14, 0, 100, 0, 0, 18536, 40640, 'General Umbriss'),
|
||||
(39625, 1, 0, 'A million more await my orders. What chance do you have?', 14, 0, 100, 0, 0, 18530, 47784, 'General Umbriss to Player'),
|
||||
(39625, 2, 0, 'Attack you cowardly vermin!', 14, 0, 100, 0, 0, 18535, 47799, 'General Umbriss'),
|
||||
(39625, 2, 1, 'Vermin, your dinner awaits!', 14, 0, 100, 0, 0, 18531, 47785, 'General Umbriss'),
|
||||
|
||||
(39625, 3, 0, 'Messy...', 14, 0, 100, 0, 0, 18532, 47786, 'General Umbriss'),
|
||||
(39625, 4, 0, '|TInterface\\Icons\\ability_warrior_charge.blp:20|tGeneral Umbriss sets his eyes on |cFFFF0000$n|r and begins to cast |cFFFF0000|Hspell:74670|h[Blitz]|h|r!', 41, 0, 100, 0, 0, 0, 39994, 'General Umbriss to Player'),
|
||||
(39625, 5, 0, '|TInterface\\Icons\\spell_nature_earthquake.blp:20|tGeneral Umbriss begins to cast |cFFFF0000|Hspell:74634|h[Ground Siege]|h|r!', 41, 0, 100, 0, 0, 0, 50666, 'General Umbriss to Ground Siege'),
|
||||
(39625, 6, 0, '%s goes into a frenzy!', 41, 0, 100, 0, 0, 0, 10645, 'General Umbriss');
|
||||
|
||||
-- Spell scriptnames
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName` IN
|
||||
('spell_umbriss_summon_blitz_trigger',
|
||||
'spell_umbriss_summon_ground_siege_trigger',
|
||||
'spell_umbriss_bleeding_wound',
|
||||
'spell_umbriss_modguds_malice');
|
||||
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(74668, 'spell_umbriss_summon_blitz_trigger'),
|
||||
(74640, 'spell_umbriss_summon_ground_siege_trigger'),
|
||||
(74846, 'spell_umbriss_bleeding_wound'),
|
||||
(91937, 'spell_umbriss_bleeding_wound'),
|
||||
(74699, 'spell_umbriss_modguds_malice'),
|
||||
(90169, 'spell_umbriss_modguds_malice');
|
||||
|
||||
DELETE FROM `conditions` WHERE `SourceEntry` IN (74670, 90250, 74634, 90249, 90170) AND `SourceTypeOrReferenceId`= 13;
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ScriptName`, `Comment`) VALUES
|
||||
(13, 1, 74670, 0, 0, 31, 0, 3, 40040, 0, 0, 0, '', 'Blitz - Target Blitz Stalker'),
|
||||
(13, 1, 90250, 0, 0, 31, 0, 3, 40040, 0, 0, 0, '', 'Blitz - Target Blitz Stalker'),
|
||||
(13, 1, 74634, 0, 0, 31, 0, 3, 40030, 0, 0, 0, '', 'Ground Siege - Target Ground Siege Stalker'),
|
||||
(13, 1, 90249, 0, 0, 31, 0, 3, 40030, 0, 0, 0, '', 'Ground Siege - Target Ground Siege Stalker'),
|
||||
(13, 1, 90170, 0, 0, 31, 0, 3, 39625, 0, 0, 0, '', 'Modgud''s Malice - Target General Umbriss'),
|
||||
(13, 2, 90170, 0, 0, 31, 0, 3, 39625, 0, 0, 0, '', 'Modgud''s Malice - Target General Umbriss'),
|
||||
(13, 4, 90170, 0, 0, 31, 0, 3, 45467, 0, 0, 0, '', 'Modgud''s Malice - Target Trogg Dweller');
|
||||
|
||||
-- Creature Malignant Trogg 39984 SAI
|
||||
SET @ENTRY := 39984;
|
||||
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
|
||||
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||
(@ENTRY, 0, 0, 0, 1, 0, 100, 1, 3000, 3000, 0, 0, 49, 0, 0, 0, 0, 0, 0, 18, 100, 0, 0, 0, 0, 0, 0, "When out of combat and timer at the begining between 3000 and 3000 ms (and later repeats every 0 and 0 ms) - Self: Attack Players in 100 yards // "),
|
||||
(@ENTRY, 0, 1, 0, 0, 0, 100, 0, 6000, 7000, 6000, 7000, 11, 76507, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, "When in combat and timer at the begining between 6000 and 7000 ms (and later repeats every 6000 and 7000 ms) - Self: Cast spell 76507 on Victim // ");
|
||||
|
||||
DELETE FROM `creature_template_addon` WHERE `entry`= 48350;
|
||||
INSERT INTO `creature_template_addon` (`entry`, `bytes2`, `auras`) VALUES
|
||||
(48350, 1, 74699);
|
||||
|
||||
-- Creature Trogg Dweller 45467 SAI
|
||||
SET @ENTRY := 45467;
|
||||
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
|
||||
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||
(@ENTRY, 0, 0, 0, 1, 0, 100, 1, 3000, 3000, 0, 0, 49, 0, 0, 0, 0, 0, 0, 18, 100, 0, 0, 0, 0, 0, 0, "When out of combat and timer at the begining between 3000 and 3000 ms (and later repeats every 0 and 0 ms) - Self: Attack Players in 100 yards // "),
|
||||
(@ENTRY, 0, 1, 0, 0, 0, 100, 0, 6000, 7000, 6000, 7000, 11, 76507, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, "When in combat and timer at the begining between 6000 and 7000 ms (and later repeats every 6000 and 7000 ms) - Self: Cast spell 76507 on Victim // ");
|
||||
|
||||
-- Remove pathfinding from troggs since they have to pass ugly terrain
|
||||
UPDATE `creature_template` SET `flags_extra`= `flags_extra` | 0x20000000 WHERE `entry` IN (45467, 39984, 48350, 48348);
|
||||
@@ -4112,6 +4112,19 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
});
|
||||
// ENDOF THE VORTEX PINNACLE SPELLS
|
||||
|
||||
//
|
||||
// GRIM BATOL SPELLS
|
||||
//
|
||||
// General Umbriss
|
||||
// Ground Siege
|
||||
ApplySpellFix({ 74634, 90249 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
// SPELL_ATTR3_ONLY_TARGET_PLAYERS is the only attribute here so we can nullify it
|
||||
spellInfo->AttributesEx3 = 0;
|
||||
});
|
||||
|
||||
// ENDOF GRIM_BATOL SPELLS
|
||||
|
||||
//
|
||||
// THE LOST CITY OF THE TOL'VIR SPELLS
|
||||
//
|
||||
|
||||
@@ -0,0 +1,381 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2018 TrinityCore <https://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 "grim_batol.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
// General Umbriss
|
||||
SPELL_BLEEDING_WOUND = 74846,
|
||||
SPELL_BLITZ_SUMMON_TRIGGER = 74668,
|
||||
SPELL_BLITZ = 74670,
|
||||
SPELL_GROUND_SIEGE_SUMMON_TRIGGER = 74640,
|
||||
SPELL_GROUND_SIEGE = 74634,
|
||||
SPELL_SUMMON_SKARDYN = 74859,
|
||||
SPELL_FRENZY = 74853,
|
||||
|
||||
// Troggs
|
||||
SPELL_MODGUDS_MALADY = 74837,
|
||||
SPELL_MODGUDS_MALICE_SPREAD = 90170,
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
// General Husam
|
||||
EVENT_BLEEDING_WOUND = 1,
|
||||
EVENT_BLITZ,
|
||||
EVENT_GROUND_SIEGE,
|
||||
EVENT_SUMMON_SKARDYN
|
||||
};
|
||||
|
||||
enum Texts
|
||||
{
|
||||
SAY_BOMBARDMENT = 0,
|
||||
SAY_AGGRO = 1,
|
||||
SAY_SUMMON_SKARDYN = 2,
|
||||
SAY_SLAY = 3,
|
||||
SAY_ANNOUNCE_BLITZ = 4,
|
||||
SAY_ANNOUNCE_GROUND_SIEGE = 5,
|
||||
SAY_ANNOUNCE_FRENZY = 6,
|
||||
};
|
||||
|
||||
enum MovementPoints
|
||||
{
|
||||
POINT_SKARDYN_SUMMON = 1
|
||||
};
|
||||
|
||||
Position const MalignantTroggSummonPosition = { -705.4689f, -485.3758f, 281.0951f, 1.265874f };
|
||||
Position const MalignantTroggMovePosition = { -691.993f, -456.1111f, 268.7674f };
|
||||
|
||||
Position const TroggDwellerSummonPositions[3] =
|
||||
{
|
||||
{ -723.0738f, -488.2023f, 292.2519f, 1.432476f },
|
||||
{ -749.5168f, -469.0633f, 309.0818f, 0.5629198f },
|
||||
{ -697.3342f, -486.9066f, 281.0173f, 1.33856f }
|
||||
};
|
||||
|
||||
Position const TroggDwellerMovePositions[3] =
|
||||
{
|
||||
{ -718.5313f, -443.1129f, 268.7674f },
|
||||
{ -729.0295f, -443.5573f, 268.7674f },
|
||||
{ -693.0521f, -458.2517f, 268.7674f }
|
||||
};
|
||||
|
||||
class boss_general_umbriss : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_general_umbriss() : CreatureScript("boss_general_umbriss") { }
|
||||
|
||||
struct boss_general_umbrissAI : public BossAI
|
||||
{
|
||||
boss_general_umbrissAI(Creature* creature) : BossAI(creature, DATA_GENERAL_UMBRISS)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_frenzyCasted = false;
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
_JustEngagedWith();
|
||||
Talk(SAY_AGGRO);
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me);
|
||||
events.ScheduleEvent(EVENT_SUMMON_SKARDYN, Seconds(6));
|
||||
events.ScheduleEvent(EVENT_BLEEDING_WOUND, Seconds(11));
|
||||
events.ScheduleEvent(EVENT_GROUND_SIEGE, Seconds(25) + Milliseconds(500));
|
||||
events.ScheduleEvent(EVENT_BLITZ, Seconds(16));
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
summons.DespawnAll();
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
_EnterEvadeMode();
|
||||
summons.DespawnAll();
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
_DespawnAtEvade();
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon) override
|
||||
{
|
||||
summons.Summon(summon);
|
||||
|
||||
switch (summon->GetEntry())
|
||||
{
|
||||
case NPC_BLITZ_STALKER:
|
||||
me->StopMoving();
|
||||
me->SetFacingToObject(summon);
|
||||
DoCast(summon, SPELL_BLITZ);
|
||||
break;
|
||||
case NPC_GROUND_SIEGE_STALKER:
|
||||
me->StopMoving();
|
||||
me->SetFacingToObject(summon);
|
||||
DoCast(summon, SPELL_GROUND_SIEGE);
|
||||
Talk(SAY_ANNOUNCE_GROUND_SIEGE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/) override
|
||||
{
|
||||
if (me->HealthBelowPct(30) && !_frenzyCasted && !me->HasAura(SPELL_FRENZY))
|
||||
{
|
||||
_frenzyCasted = true;
|
||||
DoCastSelf(SPELL_FRENZY, true);
|
||||
}
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
|
||||
{
|
||||
if (spell->Id == SPELL_FRENZY)
|
||||
Talk(SAY_ANNOUNCE_FRENZY);
|
||||
}
|
||||
|
||||
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_BLEEDING_WOUND:
|
||||
DoCastVictim(SPELL_BLEEDING_WOUND);
|
||||
events.Repeat(Seconds(10) + Milliseconds(500));
|
||||
break;
|
||||
case EVENT_BLITZ:
|
||||
DoCastAOE(SPELL_BLITZ_SUMMON_TRIGGER, true);
|
||||
events.Repeat(Seconds(23));
|
||||
break;
|
||||
case EVENT_GROUND_SIEGE:
|
||||
DoCastAOE(SPELL_GROUND_SIEGE_SUMMON_TRIGGER, true);
|
||||
break;
|
||||
case EVENT_SUMMON_SKARDYN:
|
||||
Talk(SAY_SUMMON_SKARDYN);
|
||||
DoCastAOE(SPELL_SUMMON_SKARDYN); // sends a event but since event_scripts does not support multiple spawns...
|
||||
if (Creature* malignantTrogg = DoSummon(NPC_MALIGNANT_TROGG, MalignantTroggSummonPosition, 5000))
|
||||
malignantTrogg->GetMotionMaster()->MovePoint(POINT_SKARDYN_SUMMON, MalignantTroggMovePosition, false);
|
||||
for (uint8 i = 0; i < 3; i++)
|
||||
if (Creature* troggDweller = DoSummon(NPC_TROGG_DWELLER, TroggDwellerSummonPositions[i], 5000))
|
||||
troggDweller->GetMotionMaster()->MovePoint(POINT_SKARDYN_SUMMON, TroggDwellerMovePositions[i], false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
private:
|
||||
bool _frenzyCasted;
|
||||
};
|
||||
|
||||
|
||||
CreatureAI* GetAI(Creature *creature) const override
|
||||
{
|
||||
return GetGrimBatolAI<boss_general_umbrissAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_umbriss_summon_blitz_trigger : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_umbriss_summon_blitz_trigger() : SpellScriptLoader("spell_umbriss_summon_blitz_trigger") { }
|
||||
|
||||
class spell_umbriss_summon_blitz_trigger_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_umbriss_summon_blitz_trigger_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
Trinity::Containers::RandomResize(targets, 1);
|
||||
}
|
||||
|
||||
void HandleSummon(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
|
||||
GetHitUnit()->CastSpell(GetHitUnit(), GetSpellInfo()->Effects[effIndex].TriggerSpell, true);
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Creature* umbriss = GetCaster()->ToCreature())
|
||||
umbriss->AI()->Talk(SAY_ANNOUNCE_BLITZ, GetHitUnit());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_umbriss_summon_blitz_trigger_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_umbriss_summon_blitz_trigger_SpellScript::HandleSummon, EFFECT_0, SPELL_EFFECT_FORCE_CAST);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_umbriss_summon_blitz_trigger_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_umbriss_summon_blitz_trigger_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_umbriss_summon_ground_siege_trigger : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_umbriss_summon_ground_siege_trigger() : SpellScriptLoader("spell_umbriss_summon_ground_siege_trigger") { }
|
||||
|
||||
class spell_umbriss_summon_ground_siege_trigger_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_umbriss_summon_ground_siege_trigger_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
Trinity::Containers::RandomResize(targets, 1);
|
||||
}
|
||||
|
||||
void HandleSummon(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
GetHitUnit()->CastSpell(GetHitUnit(), GetSpellInfo()->Effects[effIndex].TriggerSpell, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_umbriss_summon_ground_siege_trigger_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_umbriss_summon_ground_siege_trigger_SpellScript::HandleSummon, EFFECT_0, SPELL_EFFECT_FORCE_CAST);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_umbriss_summon_ground_siege_trigger_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_umbriss_bleeding_wound : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_umbriss_bleeding_wound() : SpellScriptLoader("spell_umbriss_bleeding_wound") { }
|
||||
|
||||
class spell_umbriss_bleeding_wound_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_umbriss_bleeding_wound_AuraScript);
|
||||
|
||||
void HandleRemoval(AuraEffect const* aurEff)
|
||||
{
|
||||
if (Unit* owner = GetOwner()->ToUnit())
|
||||
if (owner->GetHealthPct() >= 90.0f)
|
||||
aurEff->GetBase()->Remove();
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_umbriss_bleeding_wound_AuraScript::HandleRemoval, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_umbriss_bleeding_wound_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_umbriss_modguds_malice : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_umbriss_modguds_malice() : SpellScriptLoader("spell_umbriss_modguds_malice") { }
|
||||
|
||||
class spell_umbriss_modguds_malice_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_umbriss_modguds_malice_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_MODGUDS_MALADY,
|
||||
SPELL_MODGUDS_MALICE_SPREAD
|
||||
});
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* owner = GetOwner()->ToUnit())
|
||||
{
|
||||
owner->CastSpell(owner, SPELL_MODGUDS_MALADY, true);
|
||||
owner->CastSpell(owner, SPELL_MODGUDS_MALICE_SPREAD, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectApplyFn(spell_umbriss_modguds_malice_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_MOD_SCALE, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_umbriss_modguds_malice_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_general_umbriss()
|
||||
{
|
||||
new boss_general_umbriss();
|
||||
new spell_umbriss_summon_blitz_trigger();
|
||||
new spell_umbriss_summon_ground_siege_trigger();
|
||||
new spell_umbriss_bleeding_wound();
|
||||
new spell_umbriss_modguds_malice();
|
||||
}
|
||||
56
src/server/scripts/EasternKingdoms/GrimBatol/grim_batol.h
Normal file
56
src/server/scripts/EasternKingdoms/GrimBatol/grim_batol.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2018 TrinityCore <https://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/>.
|
||||
*/
|
||||
|
||||
#ifndef GRIM_BATOL_H_
|
||||
#define GRIM_BATOL_H_
|
||||
|
||||
#define GBScriptName "instance_grim_batol"
|
||||
#define DataHeader "GB"
|
||||
|
||||
uint32 const EncounterCount = 5;
|
||||
|
||||
enum GBDataTypes
|
||||
{
|
||||
// Encounter States
|
||||
DATA_GENERAL_UMBRISS = 0,
|
||||
DATA_FORGEMASTER_THRONGUS = 1,
|
||||
DATA_DRAHGA_SHADOWBURNER = 2,
|
||||
DATA_ERUDAX = 3
|
||||
};
|
||||
|
||||
enum GBCreatureIds
|
||||
{
|
||||
// Bosses
|
||||
BOSS_GENERAL_UMBRISS = 39625,
|
||||
BOSS_FORGEMASTER_THRONGUS = 40177,
|
||||
BOSS_DRAHGA_SHADOWBURNER = 40319,
|
||||
BOSS_ERUDAX = 40484,
|
||||
|
||||
// General Umbriss encounter
|
||||
NPC_BLITZ_STALKER = 40040,
|
||||
NPC_GROUND_SIEGE_STALKER = 40030,
|
||||
NPC_MALIGNANT_TROGG = 39984,
|
||||
NPC_TROGG_DWELLER = 45467
|
||||
};
|
||||
|
||||
template<class AI>
|
||||
AI* GetGrimBatolAI(Creature* creature)
|
||||
{
|
||||
return GetInstanceAI<AI>(creature, GBScriptName);
|
||||
}
|
||||
|
||||
#endif // GRIM_BATOL_H_
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2018 TrinityCore <https://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 "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "grim_batol.h"
|
||||
|
||||
ObjectData const creatureData[] =
|
||||
{
|
||||
{ BOSS_GENERAL_UMBRISS, DATA_GENERAL_UMBRISS },
|
||||
{ BOSS_FORGEMASTER_THRONGUS, DATA_FORGEMASTER_THRONGUS },
|
||||
{ BOSS_DRAHGA_SHADOWBURNER, DATA_DRAHGA_SHADOWBURNER },
|
||||
{ BOSS_ERUDAX, DATA_ERUDAX },
|
||||
{ 0, 0 } // End
|
||||
};
|
||||
|
||||
class instance_grim_batol : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_grim_batol() : InstanceMapScript(GBScriptName, 670) { }
|
||||
|
||||
struct instance_grim_batol_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_grim_batol_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
SetHeaders(DataHeader);
|
||||
SetBossNumber(EncounterCount);
|
||||
LoadObjectData(creatureData, nullptr);
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
{
|
||||
InstanceScript::OnCreatureCreate(creature);
|
||||
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_BLITZ_STALKER:
|
||||
case NPC_GROUND_SIEGE_STALKER:
|
||||
if (Creature* umbriss = GetCreature(DATA_GENERAL_UMBRISS))
|
||||
umbriss->AI()->JustSummoned(creature);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool SetBossState(uint32 type, EncounterState state) override
|
||||
{
|
||||
if (!InstanceScript::SetBossState(type, state))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void SetData(uint32 data, uint32 value) override
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const override
|
||||
{
|
||||
return new instance_grim_batol_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_grim_batol()
|
||||
{
|
||||
new instance_grim_batol();
|
||||
}
|
||||
@@ -73,6 +73,8 @@ void AddSC_boss_mr_smite();
|
||||
void AddSC_gilneas_c1(); //Gilneas
|
||||
void AddSC_gnomeregan(); //Gnomeregan
|
||||
void AddSC_instance_gnomeregan();
|
||||
void AddSC_instance_grim_batol(); //Grim Batol
|
||||
void AddSC_boss_general_umbriss();
|
||||
void AddSC_boss_attumen(); //Karazhan
|
||||
void AddSC_boss_curator();
|
||||
void AddSC_boss_maiden_of_virtue();
|
||||
@@ -270,6 +272,8 @@ void AddEasternKingdomsScripts()
|
||||
AddSC_gilneas_c1(); //Gilneas
|
||||
AddSC_gnomeregan(); //Gnomeregan
|
||||
AddSC_instance_gnomeregan();
|
||||
AddSC_instance_grim_batol(); //Grim Batol
|
||||
AddSC_boss_general_umbriss();
|
||||
AddSC_boss_attumen(); //Karazhan
|
||||
AddSC_boss_curator();
|
||||
AddSC_boss_maiden_of_virtue();
|
||||
|
||||
Reference in New Issue
Block a user