Deadmines: Implemented Mr.Smite chest event.
--HG-- branch : trunk
This commit is contained in:
@@ -54,6 +54,7 @@ SET(trinityscript_LIB_SRCS
|
||||
scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp
|
||||
scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp
|
||||
scripts/eastern_kingdoms/blackwing_lair/instance_blackwing_lair.cpp
|
||||
scripts/eastern_kingdoms/deadmines/boss_mr_smite.cpp
|
||||
scripts/eastern_kingdoms/deadmines/deadmines.h
|
||||
scripts/eastern_kingdoms/deadmines/deadmines.cpp
|
||||
scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp
|
||||
|
||||
@@ -658,6 +658,10 @@
|
||||
<Filter
|
||||
Name="Deadmines"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\scripts\eastern_kingdoms\deadmines\boss_mr_smite.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\eastern_kingdoms\deadmines\deadmines.cpp"
|
||||
>
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2010 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss Mr.Smite
|
||||
SD%Complete:
|
||||
SDComment: Timers and say taken from acid script
|
||||
EndScriptData */
|
||||
|
||||
#include "precompiled.h"
|
||||
#include "deadmines.h"
|
||||
|
||||
enum eSpels
|
||||
{
|
||||
SPELL_TRASH = 3391,
|
||||
SPELL_SMITE_STOMP = 6432,
|
||||
SPELL_SMITE_SLAM = 6435,
|
||||
SPELL_NIMBLE_REFLEXES = 6264,
|
||||
|
||||
EQUIP_SWORD = 5191,
|
||||
EQUIP_MACE = 7230,
|
||||
|
||||
SAY_AGGRO = -1036001
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_mr_smiteAI : public ScriptedAI
|
||||
{
|
||||
boss_mr_smiteAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
pInstance = pCreature->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 uiTrashTimer;
|
||||
uint32 uiSlamTimer;
|
||||
uint32 uiNimbleReflexesTimer;
|
||||
|
||||
uint8 uiHealth;
|
||||
|
||||
uint32 uiPhase;
|
||||
uint32 uiTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiTrashTimer = urand(5000,9000);
|
||||
uiSlamTimer = 9000;
|
||||
uiNimbleReflexesTimer = urand(15500,31600);
|
||||
|
||||
uiHealth = 0;
|
||||
|
||||
uiPhase = 0;
|
||||
uiTimer = 0;
|
||||
|
||||
SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* pWho)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
}
|
||||
|
||||
bool bCheckChances()
|
||||
{
|
||||
uint32 uiChances = urand(0,99);
|
||||
if (uiChances <= 15)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
/*START ACID-AI*/
|
||||
if (uiTrashTimer <= uiDiff)
|
||||
{
|
||||
if (bCheckChances())
|
||||
DoCast(m_creature, SPELL_TRASH);
|
||||
uiTrashTimer = urand(6000,15500);
|
||||
} else uiTrashTimer -= uiDiff;
|
||||
|
||||
if (uiSlamTimer <= uiDiff)
|
||||
{
|
||||
if (bCheckChances())
|
||||
DoCast(m_creature->getVictim(), SPELL_SMITE_SLAM);
|
||||
uiSlamTimer = 11000;
|
||||
} else uiSlamTimer -= uiDiff;
|
||||
|
||||
if (uiNimbleReflexesTimer <= uiDiff)
|
||||
{
|
||||
if (bCheckChances())
|
||||
DoCast(m_creature, SPELL_NIMBLE_REFLEXES);
|
||||
uiNimbleReflexesTimer = urand(27300,60100);
|
||||
} else uiNimbleReflexesTimer -= uiDiff;
|
||||
/*END ACID-AI*/
|
||||
|
||||
if (uiHealth == 0 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 66 || uiHealth == 1 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 33)
|
||||
{
|
||||
++uiHealth;
|
||||
DoCastAOE(SPELL_SMITE_STOMP,false);
|
||||
SetCombatMovement(false);
|
||||
if (pInstance)
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_SMITE_CHEST)))
|
||||
{
|
||||
m_creature->GetMotionMaster()->Clear();
|
||||
m_creature->GetMotionMaster()->MovePoint(1,-3.00+pGo->GetPositionX(),pGo->GetPositionY(),pGo->GetPositionZ());
|
||||
}
|
||||
}
|
||||
|
||||
if (uiPhase)
|
||||
{
|
||||
if (uiTimer <= uiDiff)
|
||||
{
|
||||
switch(uiPhase)
|
||||
{
|
||||
case 1:
|
||||
m_creature->HandleEmoteCommand(EMOTE_STATE_KNEEL); //dosen't work?
|
||||
uiTimer = 1000;
|
||||
uiPhase = 2;
|
||||
break;
|
||||
case 2:
|
||||
if (uiHealth == 1)
|
||||
SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SWORD, EQUIP_NO_CHANGE);
|
||||
else
|
||||
SetEquipmentSlots(false, EQUIP_MACE, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
|
||||
uiTimer = 500;
|
||||
uiPhase = 3;
|
||||
break;
|
||||
case 3:
|
||||
SetCombatMovement(true);
|
||||
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), me->m_CombatDistance);
|
||||
uiPhase = 0;
|
||||
break;
|
||||
|
||||
}
|
||||
} else uiTimer -= uiDiff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void MovementInform(uint32 uiType, uint32 uiId)
|
||||
{
|
||||
if (uiType != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
uiTimer = 1500;
|
||||
uiPhase = 1;
|
||||
}
|
||||
|
||||
};
|
||||
CreatureAI* GetAI_boss_mr_smite(Creature* pCreature)
|
||||
{
|
||||
return new boss_mr_smiteAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_mr_smite()
|
||||
{
|
||||
Script* newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_mr_smite";
|
||||
newscript->GetAI = &GetAI_boss_mr_smite;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -17,11 +17,17 @@ enum Data
|
||||
EVENT_STATE
|
||||
};
|
||||
|
||||
enum Data64
|
||||
{
|
||||
DATA_SMITE_CHEST
|
||||
};
|
||||
|
||||
enum GameObjects
|
||||
{
|
||||
GO_IRONCLAD_DOOR = 16397,
|
||||
GO_DEFIAS_CANNON = 16398,
|
||||
GO_DOOR_LEVER = 101833
|
||||
GO_DOOR_LEVER = 101833,
|
||||
GO_MR_SMITE_CHEST = 144111
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ enum Misc
|
||||
struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance
|
||||
{
|
||||
instance_deadmines(Map* pMap) : ScriptedInstance(pMap) { Initialize(); };
|
||||
|
||||
|
||||
GameObject* IronCladDoor;
|
||||
GameObject* DefiasCannon;
|
||||
GameObject* DoorLever;
|
||||
@@ -54,20 +54,22 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance
|
||||
uint32 State;
|
||||
uint32 CannonBlast_Timer;
|
||||
uint32 PiratesDelay_Timer;
|
||||
|
||||
uint64 uiSmiteChestGUID;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
IronCladDoor = NULL;
|
||||
DefiasCannon = NULL;
|
||||
DoorLever = NULL;
|
||||
State = CANNON_NOT_USED;
|
||||
uiSmiteChestGUID = 0;
|
||||
}
|
||||
|
||||
|
||||
virtual void Update(uint32 diff)
|
||||
{
|
||||
if (!IronCladDoor || !DefiasCannon || !DoorLever)
|
||||
return;
|
||||
|
||||
|
||||
switch (State)
|
||||
{
|
||||
case CANNON_GUNPOWDER_USED:
|
||||
@@ -100,47 +102,47 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SummonCreatures()
|
||||
{
|
||||
DefiasPirate1 = IronCladDoor->SummonCreature(657,IronCladDoor->GetPositionX() - 2,IronCladDoor->GetPositionY()-7,IronCladDoor->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
|
||||
DefiasPirate2 = IronCladDoor->SummonCreature(657,IronCladDoor->GetPositionX() + 3,IronCladDoor->GetPositionY()-6,IronCladDoor->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
|
||||
DefiasCompanion = IronCladDoor->SummonCreature(3450,IronCladDoor->GetPositionX() + 2,IronCladDoor->GetPositionY()-6,IronCladDoor->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
|
||||
}
|
||||
|
||||
|
||||
void MoveCreaturesInside()
|
||||
{
|
||||
if (!DefiasPirate1 || !DefiasPirate2 || !DefiasCompanion)
|
||||
return;
|
||||
|
||||
|
||||
MoveCreatureInside(DefiasPirate1);
|
||||
MoveCreatureInside(DefiasPirate2);
|
||||
MoveCreatureInside(DefiasCompanion);
|
||||
}
|
||||
|
||||
|
||||
void MoveCreatureInside(Creature* pCreature)
|
||||
{
|
||||
pCreature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
||||
pCreature->GetMotionMaster()->MovePoint(0, -102.7,-655.9, pCreature->GetPositionZ());
|
||||
}
|
||||
|
||||
|
||||
void ShootCannon()
|
||||
{
|
||||
DefiasCannon->SetGoState(GO_STATE_ACTIVE);
|
||||
DoPlaySound(DefiasCannon, SOUND_CANNONFIRE);
|
||||
}
|
||||
|
||||
|
||||
void BlastOutDoor()
|
||||
{
|
||||
IronCladDoor->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE);
|
||||
DoPlaySound(IronCladDoor, SOUND_DESTROYDOOR);
|
||||
}
|
||||
|
||||
|
||||
void LeverStucked()
|
||||
{
|
||||
DoorLever->SetUInt32Value(GAMEOBJECT_FLAGS, 4);
|
||||
}
|
||||
|
||||
|
||||
void OnGameObjectCreate(GameObject* pGo, bool add)
|
||||
{
|
||||
switch(pGo->GetEntry())
|
||||
@@ -154,9 +156,12 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance
|
||||
case GO_DOOR_LEVER:
|
||||
DoorLever = pGo;
|
||||
break;
|
||||
case GO_MR_SMITE_CHEST:
|
||||
uiSmiteChestGUID = pGo->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
if (type == EVENT_STATE)
|
||||
@@ -165,14 +170,29 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance
|
||||
State=data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
uint32 GetData(uint32 type)
|
||||
{
|
||||
if (type == EVENT_STATE)
|
||||
return State;
|
||||
switch (type)
|
||||
{
|
||||
case EVENT_STATE:
|
||||
return State;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
uint64 GetData64(uint32 data)
|
||||
{
|
||||
switch (data)
|
||||
{
|
||||
case DATA_SMITE_CHEST:
|
||||
return uiSmiteChestGUID;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void DoPlaySound(GameObject* unit, uint32 sound)
|
||||
{
|
||||
WorldPacket data(4);
|
||||
@@ -180,7 +200,7 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance
|
||||
data << uint32(sound);
|
||||
unit->SendMessageToSet(&data,false);
|
||||
}
|
||||
|
||||
|
||||
void DoPlaySoundCreature(Unit* unit, uint32 sound)
|
||||
{
|
||||
WorldPacket data(4);
|
||||
|
||||
@@ -60,6 +60,7 @@ extern void AddSC_boss_flamegor();
|
||||
extern void AddSC_boss_chromaggus();
|
||||
extern void AddSC_boss_nefarian();
|
||||
extern void AddSC_boss_victor_nefarius();
|
||||
extern void AddSC_boss_mr_smite();
|
||||
extern void AddSC_deadmines(); //Deadmines
|
||||
extern void AddSC_instance_deadmines();
|
||||
extern void AddSC_boss_attumen(); //Karazhan
|
||||
@@ -518,6 +519,7 @@ void AddScripts()
|
||||
AddSC_boss_chromaggus();
|
||||
AddSC_boss_nefarian();
|
||||
AddSC_boss_victor_nefarius();
|
||||
AddSC_boss_mr_smite();
|
||||
AddSC_deadmines(); //Deadmines
|
||||
AddSC_instance_deadmines();
|
||||
AddSC_boss_attumen(); //Karazhan
|
||||
|
||||
Reference in New Issue
Block a user