Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[2472] Cleanup and improvement for Hydromancer Thespia - The Steamvault

Notes:
The Water Elementals summoning needs further research
The Water Elements script was not cleaned because it will be moved to acid
  • Loading branch information...
commit 9d40a625f7642cb12613f0d6fdccb0fcdc80feb6 1 parent 1ac560e
@xfurry xfurry authored
View
125 scripts/outland/coilfang_reservoir/steam_vault/boss_hydromancer_thespia.cpp
@@ -17,7 +17,7 @@
/* ScriptData
SDName: Boss_Hydromancer_Thespia
SD%Complete: 80
-SDComment: Needs additional adjustments (when instance script is adjusted)
+SDComment: Timers may need small adjustments; Elementals summon needs further research
SDCategory: Coilfang Resevoir, The Steamvault
EndScriptData */
@@ -29,17 +29,26 @@ EndContentData */
#include "precompiled.h"
#include "steam_vault.h"
-#define SAY_SUMMON -1545000
-#define SAY_AGGRO_1 -1545001
-#define SAY_AGGRO_2 -1545002
-#define SAY_AGGRO_3 -1545003
-#define SAY_SLAY_1 -1545004
-#define SAY_SLAY_2 -1545005
-#define SAY_DEAD -1545006
-
-#define SPELL_LIGHTNING_CLOUD 25033
-#define SPELL_LUNG_BURST 31481
-#define SPELL_ENVELOPING_WINDS 31718
+enum
+{
+ SAY_SUMMON = -1545000,
+ SAY_CLOUD = -1545024,
+ SAY_AGGRO_1 = -1545001,
+ SAY_AGGRO_2 = -1545002,
+ SAY_AGGRO_3 = -1545003,
+ SAY_SLAY_1 = -1545004,
+ SAY_SLAY_2 = -1545005,
+ SAY_DEAD = -1545006,
+
+ SPELL_LIGHTNING_CLOUD = 25033,
+ SPELL_LUNG_BURST = 31481,
+ SPELL_ENVELOPING_WINDS = 31718,
+ SPELL_SUMMON_ELEMENTALS = 31476, // not sure where to use this
+
+ // Water elemental spells
+ SPELL_WATER_BOLT_VOLLEY = 34449,
+ SPELL_WATER_BOLT_VOLLEY_H = 37924,
+};
struct MANGOS_DLL_DECL boss_thespiaAI : public ScriptedAI
{
@@ -53,21 +62,24 @@ struct MANGOS_DLL_DECL boss_thespiaAI : public ScriptedAI
ScriptedInstance* m_pInstance;
bool m_bIsRegularMode;
- uint32 LightningCloud_Timer;
- uint32 LungBurst_Timer;
- uint32 EnvelopingWinds_Timer;
+ uint32 m_uiLightningCloudTimer;
+ uint32 m_uiLungBurstTimer;
+ uint32 m_uiEnvelopingWindsTimer;
void Reset()
{
- LightningCloud_Timer = 15000;
- LungBurst_Timer = 7000;
- EnvelopingWinds_Timer = 9000;
+ m_uiLightningCloudTimer = 15000;
+ m_uiLungBurstTimer = urand(15000, 18000);
+ m_uiEnvelopingWindsTimer = urand(20000, 25000);
+ }
- if (m_pInstance && m_creature->isAlive())
- m_pInstance->SetData(TYPE_HYDROMANCER_THESPIA,NOT_STARTED);
+ void JustReachedHome()
+ {
+ if (m_pInstance)
+ m_pInstance->SetData(TYPE_HYDROMANCER_THESPIA, FAIL);
}
- void JustDied(Unit* Killer)
+ void JustDied(Unit* pKiller)
{
DoScriptText(SAY_DEAD, m_creature);
@@ -75,12 +87,12 @@ struct MANGOS_DLL_DECL boss_thespiaAI : public ScriptedAI
m_pInstance->SetData(TYPE_HYDROMANCER_THESPIA, DONE);
}
- void KilledUnit(Unit* victim)
+ void KilledUnit(Unit* pVictim)
@Faq
Faq added a note

why not use void KilledUnit(Unit* /*pVictim*/) ?

if victim not used so it doesnt show warning.

Lot of such places, but if making script cleanup, mby could do this too?

@xfurry Collaborator
xfurry added a note

I agree, but this codestyle change needs to be discussed with Schmoozerd first.
All the Aggro, JustDied and KilledUnit functions have this warning.

@Faq
Faq added a note

that goes for all voids

/*name*/ is most portable way avoid like warning for unused by reason arg.

for write * in comment use: /\* :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
{
DoScriptText(urand(0, 1) ? SAY_SLAY_1 : SAY_SLAY_2, m_creature);
}
- void Aggro(Unit *who)
+ void Aggro(Unit* pWho)
{
switch(urand(0, 2))
{
@@ -93,50 +105,55 @@ struct MANGOS_DLL_DECL boss_thespiaAI : public ScriptedAI
m_pInstance->SetData(TYPE_HYDROMANCER_THESPIA, IN_PROGRESS);
}
- void UpdateAI(const uint32 diff)
+ void UpdateAI(const uint32 uiDiff)
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
- //LightningCloud_Timer
- if (LightningCloud_Timer < diff)
+ // LightningCloud_Timer
+ if (m_uiLightningCloudTimer < uiDiff)
{
- //cast twice in Heroic mode
- if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0))
- DoCastSpellIfCan(target, SPELL_LIGHTNING_CLOUD);
- if (!m_bIsRegularMode)
- if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0))
- DoCastSpellIfCan(target, SPELL_LIGHTNING_CLOUD);
- LightningCloud_Timer = urand(15000, 25000);
- }else LightningCloud_Timer -=diff;
-
- //LungBurst_Timer
- if (LungBurst_Timer < diff)
+ if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
+ {
+ if (DoCastSpellIfCan(pTarget, SPELL_LIGHTNING_CLOUD) == CAST_OK)
+ {
+ if (urand(0, 1))
+ DoScriptText(SAY_CLOUD, m_creature);
+ m_uiLightningCloudTimer = m_bIsRegularMode ? 30000 : 10000;
+ }
+ }
+ }
+ else
+ m_uiLightningCloudTimer -= uiDiff;
+
+ // LungBurst_Timer
+ if (m_uiLungBurstTimer < uiDiff)
{
- if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0))
- DoCastSpellIfCan(target, SPELL_LUNG_BURST);
- LungBurst_Timer = urand(7000, 12000);
- }else LungBurst_Timer -=diff;
+ if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
+ {
+ if (DoCastSpellIfCan(pTarget, SPELL_LUNG_BURST) == CAST_OK)
+ m_uiLungBurstTimer = urand(7000, 12000);
+ }
+ }
+ else
+ m_uiLungBurstTimer -= uiDiff;
- //EnvelopingWinds_Timer
- if (EnvelopingWinds_Timer < diff)
+ // EnvelopingWinds_Timer
+ if (m_uiEnvelopingWindsTimer < uiDiff)
{
- //cast twice in Heroic mode
- if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0))
- DoCastSpellIfCan(target, SPELL_ENVELOPING_WINDS);
- if (!m_bIsRegularMode)
- if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0))
- DoCastSpellIfCan(target, SPELL_ENVELOPING_WINDS);
- EnvelopingWinds_Timer = urand(10000, 15000);
- }else EnvelopingWinds_Timer -=diff;
+ if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
+ {
+ if (DoCastSpellIfCan(pTarget, SPELL_ENVELOPING_WINDS) == CAST_OK)
+ m_uiEnvelopingWindsTimer = m_bIsRegularMode ? 10000 : 15000;
+ }
+ }
+ else
+ m_uiEnvelopingWindsTimer -= uiDiff;
DoMeleeAttackIfReady();
}
};
-#define SPELL_WATER_BOLT_VOLLEY 34449
-#define SPELL_WATER_BOLT_VOLLEY_H 37924
-
struct MANGOS_DLL_DECL mob_coilfang_waterelementalAI : public ScriptedAI
{
mob_coilfang_waterelementalAI(Creature* pCreature) : ScriptedAI(pCreature)
View
2  sd2_revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __SD2_REVISION_NR_H__
#define __SD2_REVISION_NR_H__
- #define SD2_REVISION_NR "2471"
+ #define SD2_REVISION_NR "2472"
#endif // __SD2_REVISION_NR_H__
View
4 sql/scriptdev2_script_full.sql
@@ -1870,7 +1870,9 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen
(-1545020,'Ba\'ahntha sol\'dorei!',10394,1,0,0,'kalithresh SAY_AGGRO3'),
(-1545021,'Scram, surface filth!',10395,1,0,0,'kalithresh SAY_SLAY1'),
(-1545022,'Ah ha ha ha ha ha ha!',10396,1,0,0,'kalithresh SAY_SLAY2'),
-(-1545023,'For her Excellency... for... Vashj!',10397,1,0,0,'kalithresh SAY_DEATH');
+(-1545023,'For her Excellency... for... Vashj!',10397,1,0,0,'kalithresh SAY_DEATH'),
+
+(-1545024,'Enjoy the storm, warm bloods!',0,1,0,0,'thespia SAY_CLOUD');
-- -1 546 000 THE UNDERBOG
View
3  sql/updates/r2472_scriptdev2.sql
@@ -0,0 +1,3 @@
+DELETE FROM script_texts WHERE entry=-1545024;
+INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
+(-1545024,'Enjoy the storm, warm bloods!',0,1,0,0,'thespia SAY_CLOUD');
Please sign in to comment.
Something went wrong with that request. Please try again.