Skip to content

Commit 0d19616

Browse files
authored
Scripts/Botanica: Update scripts (TrinityCore#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
1 parent 5715b96 commit 0d19616

File tree

6 files changed

+56
-135
lines changed

6 files changed

+56
-135
lines changed

src/server/scripts/Outland/TempestKeep/botanica/boss_commander_sarannis.cpp

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ enum SarannisTexts
3333

3434
enum SarannisSpells
3535
{
36-
SPELL_ARCANE_RESONANCE = 34794,
3736
SPELL_ARCANE_DEVASTATION = 34799,
38-
3937
SPELL_SUMMON_REINFORCEMENTS = 34803,
38+
39+
SPELL_ARCANE_RESONANCE = 34794,
40+
4041
SPELL_SUMMON_MENDER_1 = 34810,
4142
SPELL_SUMMON_RESERVIST_1 = 34817,
4243
SPELL_SUMMON_RESERVIST_2 = 34818,
@@ -77,17 +78,6 @@ struct boss_commander_sarannis : public BossAI
7778
events.ScheduleEvent(EVENT_SUMMON_REINFORCEMENTS, 1min);
7879
}
7980

80-
void KilledUnit(Unit* /*victim*/) override
81-
{
82-
Talk(SAY_SLAY);
83-
}
84-
85-
void JustDied(Unit* /*killer*/) override
86-
{
87-
_JustDied();
88-
Talk(SAY_DEATH);
89-
}
90-
9181
void DamageTaken(Unit* /*killer*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
9282
{
9383
if (!_summoned && me->HealthBelowPctDamaged(55, damage) && !IsHeroic())
@@ -97,8 +87,18 @@ struct boss_commander_sarannis : public BossAI
9787
}
9888
}
9989

90+
void OnSpellStart(SpellInfo const* spell) override
91+
{
92+
if (spell->Id == SPELL_SUMMON_REINFORCEMENTS)
93+
Talk(EMOTE_SUMMON);
94+
}
95+
10096
void OnSpellCast(SpellInfo const* spell) override
10197
{
98+
// Not always?
99+
if (spell->Id == SPELL_ARCANE_DEVASTATION)
100+
Talk(SAY_ARCANE_DEVASTATION);
101+
102102
if (spell->Id == SPELL_SUMMON_REINFORCEMENTS)
103103
Talk(SAY_SUMMON);
104104
}
@@ -110,6 +110,17 @@ struct boss_commander_sarannis : public BossAI
110110
DoZoneInCombat(summon);
111111
}
112112

113+
void KilledUnit(Unit* /*victim*/) override
114+
{
115+
Talk(SAY_SLAY);
116+
}
117+
118+
void JustDied(Unit* /*killer*/) override
119+
{
120+
_JustDied();
121+
Talk(SAY_DEATH);
122+
}
123+
113124
void UpdateAI(uint32 diff) override
114125
{
115126
if (!UpdateVictim())
@@ -125,14 +136,11 @@ struct boss_commander_sarannis : public BossAI
125136
switch (eventId)
126137
{
127138
case EVENT_ARCANE_DEVASTATION:
128-
// Not always?
129-
Talk(SAY_ARCANE_DEVASTATION);
130139
// She can cast it if victim has only one stack of Arcane Resonance but can she cast it if victim has no stacks?
131140
DoCastVictim(SPELL_ARCANE_DEVASTATION);
132141
events.Repeat(RAND(10s, 15s, 20s, 25s, 30s, 35s));
133142
break;
134143
case EVENT_SUMMON_REINFORCEMENTS:
135-
Talk(EMOTE_SUMMON);
136144
DoCastSelf(SPELL_SUMMON_REINFORCEMENTS);
137145
if (IsHeroic())
138146
events.Repeat(1min);

src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,6 @@ struct boss_high_botanist_freywinn : public BossAI
6767
events.ScheduleEvent(EVENT_TREE_FORM, 30s);
6868
}
6969

70-
void KilledUnit(Unit* /*victim*/) override
71-
{
72-
Talk(SAY_SLAY);
73-
}
74-
75-
void JustDied(Unit* /*killer*/) override
76-
{
77-
_JustDied();
78-
Talk(SAY_DEATH);
79-
}
80-
8170
// Do not despawn them
8271
void JustSummoned(Creature* summon) override
8372
{
@@ -101,6 +90,17 @@ struct boss_high_botanist_freywinn : public BossAI
10190
}
10291
}
10392

93+
void KilledUnit(Unit* /*victim*/) override
94+
{
95+
Talk(SAY_SLAY);
96+
}
97+
98+
void JustDied(Unit* /*killer*/) override
99+
{
100+
_JustDied();
101+
Talk(SAY_DEATH);
102+
}
103+
104104
void UpdateAI(uint32 diff) override
105105
{
106106
if (!UpdateVictim())

src/server/scripts/Outland/TempestKeep/botanica/boss_thorngrin_the_tender.cpp

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "ScriptMgr.h"
1919
#include "ScriptedCreature.h"
2020
#include "SpellInfo.h"
21+
#include "SpellMgr.h"
2122
#include "the_botanica.h"
2223

2324
enum ThorngrinTexts
@@ -37,7 +38,6 @@ enum ThorngrinSpells
3738
{
3839
SPELL_SACRIFICE = 34661,
3940
SPELL_HELLFIRE = 34659,
40-
SPELL_HELLFIRE_H = 39131,
4141
SPELL_ENRAGE = 34670
4242
};
4343

@@ -64,9 +64,9 @@ struct boss_thorngrin_the_tender : public BossAI
6464
{
6565
_Reset();
6666
_phase = PHASE_NONE;
67-
_introDone = false;
6867
}
6968

69+
/// @todo: Handle this with GameObject 183772 (Tempest Keep Atrium - Thorngrin Event - Trigger 000)
7070
void MoveInLineOfSight(Unit* who) override
7171
{
7272
if (!_introDone && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 75.0f))
@@ -95,18 +95,11 @@ struct boss_thorngrin_the_tender : public BossAI
9595

9696
void OnSpellCast(SpellInfo const* spell) override
9797
{
98-
switch (spell->Id)
99-
{
100-
case SPELL_HELLFIRE:
101-
case SPELL_HELLFIRE_H:
102-
Talk(SAY_CAST_HELLFIRE);
103-
break;
104-
case SPELL_ENRAGE:
105-
Talk(EMOTE_ENRAGE);
106-
break;
107-
default:
108-
break;
109-
}
98+
if (spell->Id == sSpellMgr->GetSpellIdForDifficulty(SPELL_HELLFIRE, me))
99+
Talk(SAY_CAST_HELLFIRE);
100+
101+
if (spell->Id == SPELL_ENRAGE)
102+
Talk(EMOTE_ENRAGE);
110103
}
111104

112105
void DamageTaken(Unit* /*killer*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override

src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ enum WarpSplinterTexts
3030

3131
enum WarpSplinterSpells
3232
{
33+
SPELL_SUMMON_SAPLINGS = 34741,
3334
SPELL_STOMP = 34716,
3435
SPELL_ARCANE_VOLLEY = 36705,
3536

@@ -39,7 +40,7 @@ enum WarpSplinterSpells
3940
SPELL_SUMMON_SAPLING_4 = 34734,
4041
SPELL_SUMMON_SAPLING_5 = 34736,
4142
SPELL_SUMMON_SAPLING_6 = 34739,
42-
SPELL_SUMMON_SAPLINGS = 34741,
43+
4344
SPELL_ANCESTRAL_LIFE = 34742,
4445
SPELL_MOONFIRE_VISUAL = 36704
4546
};
@@ -71,17 +72,6 @@ struct boss_warp_splinter : public BossAI
7172
events.ScheduleEvent(EVENT_ARCANE_VOLLEY, 15s, 20s);
7273
}
7374

74-
void KilledUnit(Unit* /*victim*/) override
75-
{
76-
Talk(SAY_SLAY);
77-
}
78-
79-
void JustDied(Unit* /*killer*/) override
80-
{
81-
_JustDied();
82-
Talk(SAY_DEATH);
83-
}
84-
8575
void OnSpellCast(SpellInfo const* spell) override
8676
{
8777
if (spell->Id == SPELL_SUMMON_SAPLINGS)
@@ -102,6 +92,17 @@ struct boss_warp_splinter : public BossAI
10292
summon->AI()->AttackStart(me->GetVictim());
10393
}
10494

95+
void KilledUnit(Unit* /*victim*/) override
96+
{
97+
Talk(SAY_SLAY);
98+
}
99+
100+
void JustDied(Unit* /*killer*/) override
101+
{
102+
_JustDied();
103+
Talk(SAY_DEATH);
104+
}
105+
105106
void UpdateAI(uint32 diff) override
106107
{
107108
if (!UpdateVictim())

src/server/scripts/Outland/TempestKeep/botanica/instance_the_botanica.cpp

Lines changed: 1 addition & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -32,78 +32,6 @@ class instance_the_botanica : public InstanceMapScript
3232
SetHeaders(DataHeader);
3333
SetBossNumber(EncounterCount);
3434
}
35-
36-
void OnCreatureCreate(Creature* creature) override
37-
{
38-
switch (creature->GetEntry())
39-
{
40-
case NPC_COMMANDER_SARANNIS:
41-
CommanderSarannisGUID = creature->GetGUID();
42-
break;
43-
case NPC_HIGH_BOTANIST_FREYWINN:
44-
HighBotanistFreywinnGUID = creature->GetGUID();
45-
break;
46-
case NPC_THORNGRIN_THE_TENDER:
47-
ThorngrinTheTenderGUID = creature->GetGUID();
48-
break;
49-
case NPC_LAJ:
50-
LajGUID = creature->GetGUID();
51-
break;
52-
case NPC_WARP_SPLINTER:
53-
WarpSplinterGUID = creature->GetGUID();
54-
break;
55-
default:
56-
break;
57-
}
58-
}
59-
60-
ObjectGuid GetGuidData(uint32 type) const override
61-
{
62-
switch (type)
63-
{
64-
case DATA_COMMANDER_SARANNIS:
65-
return CommanderSarannisGUID;
66-
case DATA_HIGH_BOTANIST_FREYWINN:
67-
return HighBotanistFreywinnGUID;
68-
case DATA_THORNGRIN_THE_TENDER:
69-
return ThorngrinTheTenderGUID;
70-
case DATA_LAJ:
71-
return LajGUID;
72-
case DATA_WARP_SPLINTER:
73-
return WarpSplinterGUID;
74-
default:
75-
break;
76-
}
77-
78-
return ObjectGuid::Empty;
79-
}
80-
81-
bool SetBossState(uint32 type, EncounterState state) override
82-
{
83-
if (!InstanceScript::SetBossState(type, state))
84-
return false;
85-
86-
switch (type)
87-
{
88-
case DATA_COMMANDER_SARANNIS:
89-
case DATA_HIGH_BOTANIST_FREYWINN:
90-
case DATA_THORNGRIN_THE_TENDER:
91-
case DATA_LAJ:
92-
case DATA_WARP_SPLINTER:
93-
break;
94-
default:
95-
break;
96-
}
97-
98-
return true;
99-
}
100-
101-
protected:
102-
ObjectGuid CommanderSarannisGUID;
103-
ObjectGuid HighBotanistFreywinnGUID;
104-
ObjectGuid ThorngrinTheTenderGUID;
105-
ObjectGuid LajGUID;
106-
ObjectGuid WarpSplinterGUID;
10735
};
10836

10937
InstanceScript* GetInstanceScript(InstanceMap* map) const override
@@ -114,5 +42,5 @@ class instance_the_botanica : public InstanceMapScript
11442

11543
void AddSC_instance_the_botanica()
11644
{
117-
new instance_the_botanica;
45+
new instance_the_botanica();
11846
}

src/server/scripts/Outland/TempestKeep/botanica/the_botanica.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,6 @@ enum BCDataTypes
3434
DATA_WARP_SPLINTER = 4
3535
};
3636

37-
enum BCCreatureIds
38-
{
39-
NPC_COMMANDER_SARANNIS = 17976,
40-
NPC_HIGH_BOTANIST_FREYWINN = 17975,
41-
NPC_THORNGRIN_THE_TENDER = 17978,
42-
NPC_LAJ = 17980,
43-
NPC_WARP_SPLINTER = 17977
44-
};
45-
4637
template <class AI, class T>
4738
inline AI* GetBotanicaAI(T* obj)
4839
{

0 commit comments

Comments
 (0)