Skip to content

Commit

Permalink
[z0472] Backport: Improve some things in Deadmines. Thanks stfx
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
Salja authored and TheLuda committed Sep 26, 2011
1 parent faddf07 commit 0f4c2aa
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 58 deletions.
11 changes: 2 additions & 9 deletions scripts/eastern_kingdoms/deadmines/deadmines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ struct MANGOS_DLL_DECL boss_mr_smiteAI : public ScriptedAI

m_creature->SetStandState(UNIT_STAND_STATE_STAND);
m_uiPhase = PHASE_EQUIP_END;
m_uiEquipTimer = 5000;
m_uiEquipTimer = 1000;

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

Expand All @@ -157,14 +157,6 @@ struct MANGOS_DLL_DECL boss_mr_smiteAI : public ScriptedAI
EnterEvadeMode();
return;
}

// Takes longer to run further distance. Not accurate, but will probably be sufficient for most cases
if (m_creature->IsWithinDistInMap(pVictim, ATTACK_DISTANCE))
m_uiEquipTimer -= 1000;
else if (m_creature->IsWithinDistInMap(pVictim, 2*ATTACK_DISTANCE))
m_uiEquipTimer -= 2000;
else
m_uiEquipTimer -= 3000;
}

void PhaseEquipEnd()
Expand Down Expand Up @@ -251,6 +243,7 @@ struct MANGOS_DLL_DECL boss_mr_smiteAI : public ScriptedAI
m_uiPhase = PHASE_EQUIP_START;
m_uiEquipTimer = 2500;

// will clear getVictim (m_attacking)
m_creature->AttackStop(true);
m_creature->RemoveAurasDueToSpell(SPELL_THRASH);
}
Expand Down
1 change: 0 additions & 1 deletion scripts/eastern_kingdoms/deadmines/deadmines.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ class MANGOS_DLL_DECL instance_deadmines : public ScriptedInstance
uint32 m_auiEncounter[MAX_ENCOUNTER];

uint32 m_uiIronDoorTimer;
uint32 m_uiDoorStep;
};

#endif
69 changes: 24 additions & 45 deletions scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ EndScriptData */
#include "deadmines.h"

instance_deadmines::instance_deadmines(Map* pMap) : ScriptedInstance(pMap),
m_uiIronDoorTimer(0),
m_uiDoorStep(0)
m_uiIronDoorTimer(0)
{
Initialize();
}
Expand Down Expand Up @@ -124,12 +123,29 @@ void instance_deadmines::SetData(uint32 uiType, uint32 uiData)
{
if (uiData == IN_PROGRESS)
{
if (GameObject* pGo = GetSingleGameObjectFromStorage(GO_IRON_CLAD_DOOR))
DoUseDoorOrButton(GO_IRON_CLAD_DOOR, 0, true);
m_uiIronDoorTimer = 15000;

if (Creature* pMrSmite = GetSingleCreatureFromStorage(NPC_MR_SMITE))
DoScriptText(INST_SAY_ALARM1, pMrSmite);

if (GameObject* pDoor = GetSingleGameObjectFromStorage(GO_IRON_CLAD_DOOR))
{
pGo->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE);
m_uiIronDoorTimer = 3000;
// should be static spawns, fetch the closest ones at the pier
if (Creature* pi1 = GetClosestCreatureWithEntry(pDoor, NPC_PIRATE, 40.0f))
{
pi1->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
pi1->GetMotionMaster()->MovePoint(0, pDoor->GetPositionX(), pDoor->GetPositionY(), pDoor->GetPositionZ());
}

if (Creature* pi2 = GetClosestCreatureWithEntry(pDoor, NPC_SQUALLSHAPER, 40.0f))
{
pi2->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
pi2->GetMotionMaster()->MovePoint(0, pDoor->GetPositionX(), pDoor->GetPositionY(), pDoor->GetPositionZ());
}
}
}

m_auiEncounter[0] = uiData;
break;
}
Expand Down Expand Up @@ -160,46 +176,9 @@ void instance_deadmines::Update(uint32 uiDiff)
if (m_uiIronDoorTimer <= uiDiff)
{
if (Creature* pMrSmite = GetSingleCreatureFromStorage(NPC_MR_SMITE))
{
switch(m_uiDoorStep)
{
case 0:
DoScriptText(INST_SAY_ALARM1,pMrSmite);
m_uiIronDoorTimer = 2000;
++m_uiDoorStep;
break;
case 1:
{
if (GameObject* pDoor = GetSingleGameObjectFromStorage(GO_IRON_CLAD_DOOR))
{
// should be static spawns, fetch the closest ones at the pier
if (Creature* pi1 = GetClosestCreatureWithEntry(pDoor, NPC_PIRATE, 40.0f))
{
pi1->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
pi1->GetMotionMaster()->MovePoint(0, pDoor->GetPositionX(), pDoor->GetPositionY(), pDoor->GetPositionZ());
}

if (Creature* pi2 = GetClosestCreatureWithEntry(pDoor, NPC_SQUALLSHAPER, 40.0f))
{
pi2->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
pi2->GetMotionMaster()->MovePoint(0, pDoor->GetPositionX(), pDoor->GetPositionY(), pDoor->GetPositionZ());
}
}

++m_uiDoorStep;
m_uiIronDoorTimer = 10000;
break;
}
case 2:
DoScriptText(INST_SAY_ALARM2,pMrSmite);
m_uiDoorStep = 0;
m_uiIronDoorTimer = 0;
debug_log("SD2: Instance Deadmines: Iron door event reached end.");
break;
}
}
else
m_uiIronDoorTimer = 0;
DoScriptText(INST_SAY_ALARM2, pMrSmite);

m_uiIronDoorTimer = 0;
}
else
m_uiIronDoorTimer -= uiDiff;
Expand Down
3 changes: 3 additions & 0 deletions sql/Updates/z0472_r2300_scriptdevzero.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DELETE FROM script_texts WHERE entry=-1000716;
INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
(-1000716,'To Nighthaven! Keep your army close, champion. ',0,0,0,0,'remulos SAY_REMULOS_INTRO_2'),
4 changes: 2 additions & 2 deletions sql/scriptdevzero_script_full.sql
Original file line number Diff line number Diff line change
Expand Up @@ -843,8 +843,8 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen

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

Expand Down
2 changes: 1 addition & 1 deletion system/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "0471"
#define REVISION_NR "0472"
#endif // __REVISION_NR_H__

2 comments on commit 0f4c2aa

@DomGries
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Salja: you forgot the sql update file for changed script_texts and please learn backporting with correct author and stuff - actually there is a backport script we use :)

@Salja
Copy link

@Salja Salja commented on 0f4c2aa Oct 3, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wehn you can better you can make =)

Please sign in to comment.