Skip to content

Commit 0f4c2aa

Browse files
SaljaTheLuda
Salja
authored and
TheLuda
committed
[z0472] Backport: Improve some things in Deadmines. Thanks stfx
* Mr. Smite: Fix delay handling after he "used" his chest * Cannon event: Improve timed handling, make code more default, fix say types Signed-off-by: Salja <[email protected]>
1 parent faddf07 commit 0f4c2aa

File tree

6 files changed

+32
-58
lines changed

6 files changed

+32
-58
lines changed

scripts/eastern_kingdoms/deadmines/deadmines.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ struct MANGOS_DLL_DECL boss_mr_smiteAI : public ScriptedAI
148148

149149
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
150150
m_uiPhase = PHASE_EQUIP_END;
151-
m_uiEquipTimer = 5000;
151+
m_uiEquipTimer = 1000;
152152

153153
Unit* pVictim = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 0);
154154

@@ -157,14 +157,6 @@ struct MANGOS_DLL_DECL boss_mr_smiteAI : public ScriptedAI
157157
EnterEvadeMode();
158158
return;
159159
}
160-
161-
// Takes longer to run further distance. Not accurate, but will probably be sufficient for most cases
162-
if (m_creature->IsWithinDistInMap(pVictim, ATTACK_DISTANCE))
163-
m_uiEquipTimer -= 1000;
164-
else if (m_creature->IsWithinDistInMap(pVictim, 2*ATTACK_DISTANCE))
165-
m_uiEquipTimer -= 2000;
166-
else
167-
m_uiEquipTimer -= 3000;
168160
}
169161

170162
void PhaseEquipEnd()
@@ -251,6 +243,7 @@ struct MANGOS_DLL_DECL boss_mr_smiteAI : public ScriptedAI
251243
m_uiPhase = PHASE_EQUIP_START;
252244
m_uiEquipTimer = 2500;
253245

246+
// will clear getVictim (m_attacking)
254247
m_creature->AttackStop(true);
255248
m_creature->RemoveAurasDueToSpell(SPELL_THRASH);
256249
}

scripts/eastern_kingdoms/deadmines/deadmines.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ class MANGOS_DLL_DECL instance_deadmines : public ScriptedInstance
7171
uint32 m_auiEncounter[MAX_ENCOUNTER];
7272

7373
uint32 m_uiIronDoorTimer;
74-
uint32 m_uiDoorStep;
7574
};
7675

7776
#endif

scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp

Lines changed: 24 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ EndScriptData */
2828
#include "deadmines.h"
2929

3030
instance_deadmines::instance_deadmines(Map* pMap) : ScriptedInstance(pMap),
31-
m_uiIronDoorTimer(0),
32-
m_uiDoorStep(0)
31+
m_uiIronDoorTimer(0)
3332
{
3433
Initialize();
3534
}
@@ -124,12 +123,29 @@ void instance_deadmines::SetData(uint32 uiType, uint32 uiData)
124123
{
125124
if (uiData == IN_PROGRESS)
126125
{
127-
if (GameObject* pGo = GetSingleGameObjectFromStorage(GO_IRON_CLAD_DOOR))
126+
DoUseDoorOrButton(GO_IRON_CLAD_DOOR, 0, true);
127+
m_uiIronDoorTimer = 15000;
128+
129+
if (Creature* pMrSmite = GetSingleCreatureFromStorage(NPC_MR_SMITE))
130+
DoScriptText(INST_SAY_ALARM1, pMrSmite);
131+
132+
if (GameObject* pDoor = GetSingleGameObjectFromStorage(GO_IRON_CLAD_DOOR))
128133
{
129-
pGo->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE);
130-
m_uiIronDoorTimer = 3000;
134+
// should be static spawns, fetch the closest ones at the pier
135+
if (Creature* pi1 = GetClosestCreatureWithEntry(pDoor, NPC_PIRATE, 40.0f))
136+
{
137+
pi1->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
138+
pi1->GetMotionMaster()->MovePoint(0, pDoor->GetPositionX(), pDoor->GetPositionY(), pDoor->GetPositionZ());
139+
}
140+
141+
if (Creature* pi2 = GetClosestCreatureWithEntry(pDoor, NPC_SQUALLSHAPER, 40.0f))
142+
{
143+
pi2->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
144+
pi2->GetMotionMaster()->MovePoint(0, pDoor->GetPositionX(), pDoor->GetPositionY(), pDoor->GetPositionZ());
145+
}
131146
}
132147
}
148+
133149
m_auiEncounter[0] = uiData;
134150
break;
135151
}
@@ -160,46 +176,9 @@ void instance_deadmines::Update(uint32 uiDiff)
160176
if (m_uiIronDoorTimer <= uiDiff)
161177
{
162178
if (Creature* pMrSmite = GetSingleCreatureFromStorage(NPC_MR_SMITE))
163-
{
164-
switch(m_uiDoorStep)
165-
{
166-
case 0:
167-
DoScriptText(INST_SAY_ALARM1,pMrSmite);
168-
m_uiIronDoorTimer = 2000;
169-
++m_uiDoorStep;
170-
break;
171-
case 1:
172-
{
173-
if (GameObject* pDoor = GetSingleGameObjectFromStorage(GO_IRON_CLAD_DOOR))
174-
{
175-
// should be static spawns, fetch the closest ones at the pier
176-
if (Creature* pi1 = GetClosestCreatureWithEntry(pDoor, NPC_PIRATE, 40.0f))
177-
{
178-
pi1->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
179-
pi1->GetMotionMaster()->MovePoint(0, pDoor->GetPositionX(), pDoor->GetPositionY(), pDoor->GetPositionZ());
180-
}
181-
182-
if (Creature* pi2 = GetClosestCreatureWithEntry(pDoor, NPC_SQUALLSHAPER, 40.0f))
183-
{
184-
pi2->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
185-
pi2->GetMotionMaster()->MovePoint(0, pDoor->GetPositionX(), pDoor->GetPositionY(), pDoor->GetPositionZ());
186-
}
187-
}
188-
189-
++m_uiDoorStep;
190-
m_uiIronDoorTimer = 10000;
191-
break;
192-
}
193-
case 2:
194-
DoScriptText(INST_SAY_ALARM2,pMrSmite);
195-
m_uiDoorStep = 0;
196-
m_uiIronDoorTimer = 0;
197-
debug_log("SD2: Instance Deadmines: Iron door event reached end.");
198-
break;
199-
}
200-
}
201-
else
202-
m_uiIronDoorTimer = 0;
179+
DoScriptText(INST_SAY_ALARM2, pMrSmite);
180+
181+
m_uiIronDoorTimer = 0;
203182
}
204183
else
205184
m_uiIronDoorTimer -= uiDiff;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DELETE FROM script_texts WHERE entry=-1000716;
2+
INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
3+
(-1000716,'To Nighthaven! Keep your army close, champion. ',0,0,0,0,'remulos SAY_REMULOS_INTRO_2'),

sql/scriptdevzero_script_full.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,8 +843,8 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen
843843

844844
-- -1 036 000 DEADMINES
845845
INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
846-
(-1036000,'You there, check out that noise.',5775,1,7,0,'smite INST_SAY_ALARM1'),
847-
(-1036001,'We\'re under attack! A vast, ye swabs! Repel the invaders!',5777,1,7,0,'smite INST_SAY_ALARM2'),
846+
(-1036000,'You there, check out that noise.',5775,6,7,0,'smite INST_SAY_ALARM1'),
847+
(-1036001,'We\'re under attack! A vast, ye swabs! Repel the invaders!',5777,6,7,0,'smite INST_SAY_ALARM2'),
848848
(-1036002,'You land lubbers are tougher than I thought! I\'ll have to improvise!',5778,0,0,21,'smite SAY_PHASE_2'),
849849
(-1036003,'D\'ah! Now you\'re making me angry!',5779,0,0,15,'smite SAY_PHASE_3');
850850

system/revision_nr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#ifndef __REVISION_NR_H__
22
#define __REVISION_NR_H__
3-
#define REVISION_NR "0471"
3+
#define REVISION_NR "0472"
44
#endif // __REVISION_NR_H__

0 commit comments

Comments
 (0)