mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 17:27:36 +01:00
Scripts/Botanica: Update scripts (#31121)
* Remove unused data and functions from instance script * Reorder hooks, spells, small changes to improve encounters and codestyle * Move some texts from cast start to cast end
This commit is contained in:
@@ -33,10 +33,11 @@ enum SarannisTexts
|
||||
|
||||
enum SarannisSpells
|
||||
{
|
||||
SPELL_ARCANE_RESONANCE = 34794,
|
||||
SPELL_ARCANE_DEVASTATION = 34799,
|
||||
|
||||
SPELL_SUMMON_REINFORCEMENTS = 34803,
|
||||
|
||||
SPELL_ARCANE_RESONANCE = 34794,
|
||||
|
||||
SPELL_SUMMON_MENDER_1 = 34810,
|
||||
SPELL_SUMMON_RESERVIST_1 = 34817,
|
||||
SPELL_SUMMON_RESERVIST_2 = 34818,
|
||||
@@ -77,17 +78,6 @@ struct boss_commander_sarannis : public BossAI
|
||||
events.ScheduleEvent(EVENT_SUMMON_REINFORCEMENTS, 1min);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* /*killer*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
|
||||
{
|
||||
if (!_summoned && me->HealthBelowPctDamaged(55, damage) && !IsHeroic())
|
||||
@@ -97,8 +87,18 @@ struct boss_commander_sarannis : public BossAI
|
||||
}
|
||||
}
|
||||
|
||||
void OnSpellStart(SpellInfo const* spell) override
|
||||
{
|
||||
if (spell->Id == SPELL_SUMMON_REINFORCEMENTS)
|
||||
Talk(EMOTE_SUMMON);
|
||||
}
|
||||
|
||||
void OnSpellCast(SpellInfo const* spell) override
|
||||
{
|
||||
// Not always?
|
||||
if (spell->Id == SPELL_ARCANE_DEVASTATION)
|
||||
Talk(SAY_ARCANE_DEVASTATION);
|
||||
|
||||
if (spell->Id == SPELL_SUMMON_REINFORCEMENTS)
|
||||
Talk(SAY_SUMMON);
|
||||
}
|
||||
@@ -110,6 +110,17 @@ struct boss_commander_sarannis : public BossAI
|
||||
DoZoneInCombat(summon);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
@@ -125,14 +136,11 @@ struct boss_commander_sarannis : public BossAI
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_ARCANE_DEVASTATION:
|
||||
// Not always?
|
||||
Talk(SAY_ARCANE_DEVASTATION);
|
||||
// She can cast it if victim has only one stack of Arcane Resonance but can she cast it if victim has no stacks?
|
||||
DoCastVictim(SPELL_ARCANE_DEVASTATION);
|
||||
events.Repeat(RAND(10s, 15s, 20s, 25s, 30s, 35s));
|
||||
break;
|
||||
case EVENT_SUMMON_REINFORCEMENTS:
|
||||
Talk(EMOTE_SUMMON);
|
||||
DoCastSelf(SPELL_SUMMON_REINFORCEMENTS);
|
||||
if (IsHeroic())
|
||||
events.Repeat(1min);
|
||||
|
||||
@@ -67,17 +67,6 @@ struct boss_high_botanist_freywinn : public BossAI
|
||||
events.ScheduleEvent(EVENT_TREE_FORM, 30s);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
// Do not despawn them
|
||||
void JustSummoned(Creature* summon) override
|
||||
{
|
||||
@@ -101,6 +90,17 @@ struct boss_high_botanist_freywinn : public BossAI
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "the_botanica.h"
|
||||
|
||||
enum ThorngrinTexts
|
||||
@@ -37,7 +38,6 @@ enum ThorngrinSpells
|
||||
{
|
||||
SPELL_SACRIFICE = 34661,
|
||||
SPELL_HELLFIRE = 34659,
|
||||
SPELL_HELLFIRE_H = 39131,
|
||||
SPELL_ENRAGE = 34670
|
||||
};
|
||||
|
||||
@@ -64,9 +64,9 @@ struct boss_thorngrin_the_tender : public BossAI
|
||||
{
|
||||
_Reset();
|
||||
_phase = PHASE_NONE;
|
||||
_introDone = false;
|
||||
}
|
||||
|
||||
/// @todo: Handle this with GameObject 183772 (Tempest Keep Atrium - Thorngrin Event - Trigger 000)
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
{
|
||||
if (!_introDone && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 75.0f))
|
||||
@@ -95,18 +95,11 @@ struct boss_thorngrin_the_tender : public BossAI
|
||||
|
||||
void OnSpellCast(SpellInfo const* spell) override
|
||||
{
|
||||
switch (spell->Id)
|
||||
{
|
||||
case SPELL_HELLFIRE:
|
||||
case SPELL_HELLFIRE_H:
|
||||
Talk(SAY_CAST_HELLFIRE);
|
||||
break;
|
||||
case SPELL_ENRAGE:
|
||||
Talk(EMOTE_ENRAGE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (spell->Id == sSpellMgr->GetSpellIdForDifficulty(SPELL_HELLFIRE, me))
|
||||
Talk(SAY_CAST_HELLFIRE);
|
||||
|
||||
if (spell->Id == SPELL_ENRAGE)
|
||||
Talk(EMOTE_ENRAGE);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* /*killer*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
|
||||
|
||||
@@ -30,6 +30,7 @@ enum WarpSplinterTexts
|
||||
|
||||
enum WarpSplinterSpells
|
||||
{
|
||||
SPELL_SUMMON_SAPLINGS = 34741,
|
||||
SPELL_STOMP = 34716,
|
||||
SPELL_ARCANE_VOLLEY = 36705,
|
||||
|
||||
@@ -39,7 +40,7 @@ enum WarpSplinterSpells
|
||||
SPELL_SUMMON_SAPLING_4 = 34734,
|
||||
SPELL_SUMMON_SAPLING_5 = 34736,
|
||||
SPELL_SUMMON_SAPLING_6 = 34739,
|
||||
SPELL_SUMMON_SAPLINGS = 34741,
|
||||
|
||||
SPELL_ANCESTRAL_LIFE = 34742,
|
||||
SPELL_MOONFIRE_VISUAL = 36704
|
||||
};
|
||||
@@ -71,17 +72,6 @@ struct boss_warp_splinter : public BossAI
|
||||
events.ScheduleEvent(EVENT_ARCANE_VOLLEY, 15s, 20s);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void OnSpellCast(SpellInfo const* spell) override
|
||||
{
|
||||
if (spell->Id == SPELL_SUMMON_SAPLINGS)
|
||||
@@ -102,6 +92,17 @@ struct boss_warp_splinter : public BossAI
|
||||
summon->AI()->AttackStart(me->GetVictim());
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
|
||||
@@ -32,78 +32,6 @@ class instance_the_botanica : public InstanceMapScript
|
||||
SetHeaders(DataHeader);
|
||||
SetBossNumber(EncounterCount);
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_COMMANDER_SARANNIS:
|
||||
CommanderSarannisGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_HIGH_BOTANIST_FREYWINN:
|
||||
HighBotanistFreywinnGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_THORNGRIN_THE_TENDER:
|
||||
ThorngrinTheTenderGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_LAJ:
|
||||
LajGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_WARP_SPLINTER:
|
||||
WarpSplinterGUID = creature->GetGUID();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ObjectGuid GetGuidData(uint32 type) const override
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_COMMANDER_SARANNIS:
|
||||
return CommanderSarannisGUID;
|
||||
case DATA_HIGH_BOTANIST_FREYWINN:
|
||||
return HighBotanistFreywinnGUID;
|
||||
case DATA_THORNGRIN_THE_TENDER:
|
||||
return ThorngrinTheTenderGUID;
|
||||
case DATA_LAJ:
|
||||
return LajGUID;
|
||||
case DATA_WARP_SPLINTER:
|
||||
return WarpSplinterGUID;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
|
||||
bool SetBossState(uint32 type, EncounterState state) override
|
||||
{
|
||||
if (!InstanceScript::SetBossState(type, state))
|
||||
return false;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case DATA_COMMANDER_SARANNIS:
|
||||
case DATA_HIGH_BOTANIST_FREYWINN:
|
||||
case DATA_THORNGRIN_THE_TENDER:
|
||||
case DATA_LAJ:
|
||||
case DATA_WARP_SPLINTER:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected:
|
||||
ObjectGuid CommanderSarannisGUID;
|
||||
ObjectGuid HighBotanistFreywinnGUID;
|
||||
ObjectGuid ThorngrinTheTenderGUID;
|
||||
ObjectGuid LajGUID;
|
||||
ObjectGuid WarpSplinterGUID;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const override
|
||||
@@ -114,5 +42,5 @@ class instance_the_botanica : public InstanceMapScript
|
||||
|
||||
void AddSC_instance_the_botanica()
|
||||
{
|
||||
new instance_the_botanica;
|
||||
new instance_the_botanica();
|
||||
}
|
||||
|
||||
@@ -34,15 +34,6 @@ enum BCDataTypes
|
||||
DATA_WARP_SPLINTER = 4
|
||||
};
|
||||
|
||||
enum BCCreatureIds
|
||||
{
|
||||
NPC_COMMANDER_SARANNIS = 17976,
|
||||
NPC_HIGH_BOTANIST_FREYWINN = 17975,
|
||||
NPC_THORNGRIN_THE_TENDER = 17978,
|
||||
NPC_LAJ = 17980,
|
||||
NPC_WARP_SPLINTER = 17977
|
||||
};
|
||||
|
||||
template <class AI, class T>
|
||||
inline AI* GetBotanicaAI(T* obj)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user