* Rename InstanceData to InstanceScript
* Rename *mgr to their new names in scripts project * Mass convert all the scripts (NEEDS THOROUGH TESTING, because it was done automatically) Please, report bugs on issue tracker. --HG-- branch : trunk rename : src/server/game/Instances/InstanceData.cpp => src/server/game/Instances/InstanceScript.cpp rename : src/server/game/Instances/InstanceData.h => src/server/game/Instances/InstanceScript.h
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
#include "GameEventMgr.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "CreatureAIImpl.h"
|
||||
#include "ConditionMgr.h"
|
||||
@@ -708,7 +708,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
||||
break;
|
||||
case ACTION_T_SET_INST_DATA:
|
||||
{
|
||||
InstanceData* pInst = (InstanceData*)me->GetInstanceData();
|
||||
InstanceScript* pInst = (InstanceScript*)me->GetInstanceScript();
|
||||
if (!pInst)
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Event %d attempt to set instance data without instance script. Creature %d", EventId, me->GetEntry());
|
||||
@@ -727,7 +727,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
||||
return;
|
||||
}
|
||||
|
||||
InstanceData* pInst = (InstanceData*)me->GetInstanceData();
|
||||
InstanceScript* pInst = (InstanceScript*)me->GetInstanceScript();
|
||||
if (!pInst)
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Event %d attempt to set instance data64 without instance script. Creature %d", EventId, me->GetEntry());
|
||||
|
||||
@@ -513,7 +513,7 @@ void Scripted_NoMovementAI::AttackStart(Unit* pWho)
|
||||
}
|
||||
|
||||
BossAI::BossAI(Creature *c, uint32 id) : ScriptedAI(c)
|
||||
, bossId(id), summons(me), instance(c->GetInstanceData())
|
||||
, bossId(id), summons(me), instance(c->GetInstanceScript())
|
||||
, boundary(instance ? instance->GetBossBoundary(id) : NULL)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "Creature.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "CreatureAIImpl.h"
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
|
||||
#define SCRIPT_CAST_TYPE dynamic_cast
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#define GET_SPELL(a) (const_cast<SpellEntry*>(GetSpellStore()->LookupEntry(a)))
|
||||
|
||||
class InstanceData;
|
||||
class InstanceScript;
|
||||
|
||||
class SummonList : public std::list<uint64>
|
||||
{
|
||||
@@ -250,7 +250,7 @@ struct BossAI : public ScriptedAI
|
||||
const uint32 bossId;
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
InstanceData * const instance;
|
||||
InstanceScript * const instance;
|
||||
const BossBoundaryMap * const boundary;
|
||||
|
||||
void JustSummoned(Creature *summon);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#ifndef SC_INSTANCE_H
|
||||
#define SC_INSTANCE_H
|
||||
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
|
||||
#define OUT_SAVE_INST_DATA sLog.outDebug("TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d)", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundAB.h"
|
||||
#include "Map.h"
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
|
||||
namespace Trinity
|
||||
{
|
||||
@@ -344,7 +344,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un
|
||||
ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT, criteria_id, map->GetId());
|
||||
return false;
|
||||
}
|
||||
InstanceData* data = ((InstanceMap*)map)->GetInstanceData();
|
||||
InstanceScript* data = ((InstanceMap*)map)->GetInstanceScript();
|
||||
if (!data)
|
||||
{
|
||||
sLog.outErrorDb("Achievement system call ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT (%u) for achievement criteria %u for map %u but map does not have a instance script",
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include "ItemEnchantmentMgr.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "CreatureEventAIMgr.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "DBCEnums.h"
|
||||
@@ -6576,14 +6576,14 @@ bool ChatHandler::HandleInstanceSaveDataCommand(const char * /*args*/)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!((InstanceMap*)map)->GetInstanceData())
|
||||
if (!((InstanceMap*)map)->GetInstanceScript())
|
||||
{
|
||||
PSendSysMessage("Map has no instance data.");
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
((InstanceMap*)map)->GetInstanceData()->SaveToDB();
|
||||
((InstanceMap*)map)->GetInstanceScript()->SaveToDB();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "GameEventMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ProgressBar.h"
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "ConditionMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
|
||||
@@ -119,8 +119,8 @@ bool Condition::Meets(Player * player, Unit* targetOverride)
|
||||
case CONDITION_INSTANCE_DATA:
|
||||
{
|
||||
Map *map = player->GetMap();
|
||||
if (map && map->IsDungeon() && ((InstanceMap*)map)->GetInstanceData())
|
||||
condMeets = ((InstanceMap*)map)->GetInstanceData()->GetData(mConditionValue1) == mConditionValue2;
|
||||
if (map && map->IsDungeon() && ((InstanceMap*)map)->GetInstanceScript())
|
||||
condMeets = ((InstanceMap*)map)->GetInstanceScript()->GetData(mConditionValue1) == mConditionValue2;
|
||||
break;
|
||||
}
|
||||
case CONDITION_SPELL_SCRIPT_TARGET:
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "CreatureAISelector.h"
|
||||
#include "Formulas.h"
|
||||
#include "WaypointMovementGenerator.h"
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Util.h"
|
||||
#include "GridNotifiers.h"
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "CellImpl.h"
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Battleground.h"
|
||||
#include "Util.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
|
||||
@@ -1251,10 +1251,10 @@ void WorldObject::GetZoneAndAreaId(uint32& zoneid, uint32& areaid) const
|
||||
GetBaseMap()->GetZoneAndAreaId(zoneid, areaid, m_positionX, m_positionY, m_positionZ);
|
||||
}
|
||||
|
||||
InstanceData* WorldObject::GetInstanceData()
|
||||
InstanceScript* WorldObject::GetInstanceScript()
|
||||
{
|
||||
Map *map = GetMap();
|
||||
return map->IsDungeon() ? ((InstanceMap*)map)->GetInstanceData() : NULL;
|
||||
return map->IsDungeon() ? ((InstanceMap*)map)->GetInstanceScript() : NULL;
|
||||
}
|
||||
|
||||
float WorldObject::GetDistanceZ(const WorldObject* obj) const
|
||||
@@ -1844,7 +1844,7 @@ void WorldObject::SetZoneScript()
|
||||
if (Map *map = FindMap())
|
||||
{
|
||||
if (map->IsDungeon())
|
||||
m_zoneScript = (ZoneScript*)((InstanceMap*)map)->GetInstanceData();
|
||||
m_zoneScript = (ZoneScript*)((InstanceMap*)map)->GetInstanceScript();
|
||||
else if (!map->IsBattlegroundOrArena())
|
||||
m_zoneScript = sOutdoorPvPMgr.GetZoneScript(GetZoneId());
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ class WorldSession;
|
||||
class Creature;
|
||||
class Player;
|
||||
class UpdateMask;
|
||||
class InstanceData;
|
||||
class InstanceScript;
|
||||
class GameObject;
|
||||
class TempSummon;
|
||||
class Vehicle;
|
||||
@@ -599,7 +599,7 @@ class WorldObject : public Object, public WorldLocation
|
||||
uint32 GetAreaId() const;
|
||||
void GetZoneAndAreaId(uint32& zoneid, uint32& areaid) const;
|
||||
|
||||
InstanceData* GetInstanceData();
|
||||
InstanceScript* GetInstanceScript();
|
||||
|
||||
const char* GetName() const { return m_name.c_str(); }
|
||||
void SetName(const std::string& newname) { m_name=newname; }
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "ObjectMgr.h"
|
||||
#include "World.h"
|
||||
#include "Group.h"
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "ProgressBar.h"
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ void InstanceSave::SaveToDB()
|
||||
if (map)
|
||||
{
|
||||
ASSERT(map->IsDungeon());
|
||||
if (InstanceData *iData = ((InstanceMap*)map)->GetInstanceData())
|
||||
if (InstanceScript *iData = ((InstanceMap*)map)->GetInstanceScript())
|
||||
{
|
||||
data = iData->GetSaveData();
|
||||
if (!data.empty())
|
||||
|
||||
+27
-27
@@ -18,7 +18,7 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Map.h"
|
||||
#include "Player.h"
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "CreatureAI.h"
|
||||
#include "Log.h"
|
||||
|
||||
void InstanceData::SaveToDB()
|
||||
void InstanceScript::SaveToDB()
|
||||
{
|
||||
std::string data = GetSaveData();
|
||||
if (data.empty())
|
||||
@@ -36,17 +36,17 @@ void InstanceData::SaveToDB()
|
||||
CharacterDatabase.PExecute("UPDATE instance SET data = '%s' WHERE id = '%d'", data.c_str(), instance->GetInstanceId());
|
||||
}
|
||||
|
||||
void InstanceData::HandleGameObject(uint64 GUID, bool open, GameObject *go)
|
||||
void InstanceScript::HandleGameObject(uint64 GUID, bool open, GameObject *go)
|
||||
{
|
||||
if (!go)
|
||||
go = instance->GetGameObject(GUID);
|
||||
if (go)
|
||||
go->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY);
|
||||
else
|
||||
sLog.outDebug("TSCR: InstanceData: HandleGameObject failed");
|
||||
sLog.outDebug("TSCR: InstanceScript: HandleGameObject failed");
|
||||
}
|
||||
|
||||
bool InstanceData::IsEncounterInProgress() const
|
||||
bool InstanceScript::IsEncounterInProgress() const
|
||||
{
|
||||
for (std::vector<BossInfo>::const_iterator itr = bosses.begin(); itr != bosses.end(); ++itr)
|
||||
if (itr->state == IN_PROGRESS)
|
||||
@@ -55,7 +55,7 @@ bool InstanceData::IsEncounterInProgress() const
|
||||
return false;
|
||||
}
|
||||
|
||||
void InstanceData::LoadMinionData(const MinionData *data)
|
||||
void InstanceScript::LoadMinionData(const MinionData *data)
|
||||
{
|
||||
while (data->entry)
|
||||
{
|
||||
@@ -64,10 +64,10 @@ void InstanceData::LoadMinionData(const MinionData *data)
|
||||
|
||||
++data;
|
||||
}
|
||||
sLog.outDebug("InstanceData::LoadMinionData: %u minions loaded.", doors.size());
|
||||
sLog.outDebug("InstanceScript::LoadMinionData: %u minions loaded.", doors.size());
|
||||
}
|
||||
|
||||
void InstanceData::LoadDoorData(const DoorData *data)
|
||||
void InstanceScript::LoadDoorData(const DoorData *data)
|
||||
{
|
||||
while (data->entry)
|
||||
{
|
||||
@@ -76,10 +76,10 @@ void InstanceData::LoadDoorData(const DoorData *data)
|
||||
|
||||
++data;
|
||||
}
|
||||
sLog.outDebug("InstanceData::LoadDoorData: %u doors loaded.", doors.size());
|
||||
sLog.outDebug("InstanceScript::LoadDoorData: %u doors loaded.", doors.size());
|
||||
}
|
||||
|
||||
void InstanceData::UpdateMinionState(Creature *minion, EncounterState state)
|
||||
void InstanceScript::UpdateMinionState(Creature *minion, EncounterState state)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
@@ -98,7 +98,7 @@ void InstanceData::UpdateMinionState(Creature *minion, EncounterState state)
|
||||
}
|
||||
}
|
||||
|
||||
void InstanceData::UpdateDoorState(GameObject *door)
|
||||
void InstanceScript::UpdateDoorState(GameObject *door)
|
||||
{
|
||||
DoorInfoMap::iterator lower = doors.lower_bound(door->GetEntry());
|
||||
DoorInfoMap::iterator upper = doors.upper_bound(door->GetEntry());
|
||||
@@ -130,7 +130,7 @@ void InstanceData::UpdateDoorState(GameObject *door)
|
||||
//sLog.outError("Door %u is %s.", door->GetEntry(), open ? "opened" : "closed");
|
||||
}
|
||||
|
||||
void InstanceData::AddDoor(GameObject *door, bool add)
|
||||
void InstanceScript::AddDoor(GameObject *door, bool add)
|
||||
{
|
||||
DoorInfoMap::iterator lower = doors.lower_bound(door->GetEntry());
|
||||
DoorInfoMap::iterator upper = doors.upper_bound(door->GetEntry());
|
||||
@@ -173,7 +173,7 @@ void InstanceData::AddDoor(GameObject *door, bool add)
|
||||
UpdateDoorState(door);
|
||||
}
|
||||
|
||||
void InstanceData::AddMinion(Creature *minion, bool add)
|
||||
void InstanceScript::AddMinion(Creature *minion, bool add)
|
||||
{
|
||||
MinionInfoMap::iterator itr = minions.find(minion->GetEntry());
|
||||
if (itr == minions.end())
|
||||
@@ -185,7 +185,7 @@ void InstanceData::AddMinion(Creature *minion, bool add)
|
||||
itr->second.bossInfo->minion.erase(minion);
|
||||
}
|
||||
|
||||
bool InstanceData::SetBossState(uint32 id, EncounterState state)
|
||||
bool InstanceScript::SetBossState(uint32 id, EncounterState state)
|
||||
{
|
||||
if (id < bosses.size())
|
||||
{
|
||||
@@ -222,7 +222,7 @@ bool InstanceData::SetBossState(uint32 id, EncounterState state)
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string InstanceData::LoadBossState(const char * data)
|
||||
std::string InstanceScript::LoadBossState(const char * data)
|
||||
{
|
||||
if (!data)
|
||||
return NULL;
|
||||
@@ -238,7 +238,7 @@ std::string InstanceData::LoadBossState(const char * data)
|
||||
return loadStream.str();
|
||||
}
|
||||
|
||||
std::string InstanceData::GetBossSaveData()
|
||||
std::string InstanceScript::GetBossSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
for (std::vector<BossInfo>::iterator i = bosses.begin(); i != bosses.end(); ++i)
|
||||
@@ -246,7 +246,7 @@ std::string InstanceData::GetBossSaveData()
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void InstanceData::DoUseDoorOrButton(uint64 uiGuid, uint32 uiWithRestoreTime, bool bUseAlternativeState)
|
||||
void InstanceScript::DoUseDoorOrButton(uint64 uiGuid, uint32 uiWithRestoreTime, bool bUseAlternativeState)
|
||||
{
|
||||
if (!uiGuid)
|
||||
return;
|
||||
@@ -267,7 +267,7 @@ void InstanceData::DoUseDoorOrButton(uint64 uiGuid, uint32 uiWithRestoreTime, bo
|
||||
}
|
||||
}
|
||||
|
||||
void InstanceData::DoRespawnGameObject(uint64 uiGuid, uint32 uiTimeToDespawn)
|
||||
void InstanceScript::DoRespawnGameObject(uint64 uiGuid, uint32 uiTimeToDespawn)
|
||||
{
|
||||
if (GameObject* pGo = instance->GetGameObject(uiGuid))
|
||||
{
|
||||
@@ -283,7 +283,7 @@ void InstanceData::DoRespawnGameObject(uint64 uiGuid, uint32 uiTimeToDespawn)
|
||||
}
|
||||
}
|
||||
|
||||
void InstanceData::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData)
|
||||
void InstanceScript::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData)
|
||||
{
|
||||
Map::PlayerList const& lPlayers = instance->GetPlayers();
|
||||
|
||||
@@ -298,7 +298,7 @@ void InstanceData::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData)
|
||||
}
|
||||
|
||||
// Send Notify to all players in instance
|
||||
void InstanceData::DoSendNotifyToInstance(const char *format, ...)
|
||||
void InstanceScript::DoSendNotifyToInstance(const char *format, ...)
|
||||
{
|
||||
InstanceMap::PlayerList const &PlayerList = instance->GetPlayers();
|
||||
InstanceMap::PlayerList::const_iterator i;
|
||||
@@ -311,7 +311,7 @@ void InstanceData::DoSendNotifyToInstance(const char *format, ...)
|
||||
}
|
||||
|
||||
// Complete Achievement for all players in instance
|
||||
void InstanceData::DoCompleteAchievement(uint32 achievement)
|
||||
void InstanceScript::DoCompleteAchievement(uint32 achievement)
|
||||
{
|
||||
AchievementEntry const* pAE = GetAchievementStore()->LookupEntry(achievement);
|
||||
Map::PlayerList const &PlayerList = instance->GetPlayers();
|
||||
@@ -329,7 +329,7 @@ void InstanceData::DoCompleteAchievement(uint32 achievement)
|
||||
}
|
||||
|
||||
// Update Achievement Criteria for all players in instance
|
||||
void InstanceData::DoUpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1, uint32 miscvalue2, Unit *unit, uint32 time)
|
||||
void InstanceScript::DoUpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1, uint32 miscvalue2, Unit *unit, uint32 time)
|
||||
{
|
||||
Map::PlayerList const &PlayerList = instance->GetPlayers();
|
||||
|
||||
@@ -340,7 +340,7 @@ void InstanceData::DoUpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
}
|
||||
|
||||
// Start timed achievement for all players in instance
|
||||
void InstanceData::DoStartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
|
||||
void InstanceScript::DoStartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
|
||||
{
|
||||
Map::PlayerList const &PlayerList = instance->GetPlayers();
|
||||
|
||||
@@ -351,7 +351,7 @@ void InstanceData::DoStartTimedAchievement(AchievementCriteriaTimedTypes type, u
|
||||
}
|
||||
|
||||
// Stop timed achievement for all players in instance
|
||||
void InstanceData::DoStopTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
|
||||
void InstanceScript::DoStopTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
|
||||
{
|
||||
Map::PlayerList const &PlayerList = instance->GetPlayers();
|
||||
|
||||
@@ -362,7 +362,7 @@ void InstanceData::DoStopTimedAchievement(AchievementCriteriaTimedTypes type, ui
|
||||
}
|
||||
|
||||
// Remove Auras due to Spell on all players in instance
|
||||
void InstanceData::DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
|
||||
void InstanceScript::DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
|
||||
{
|
||||
Map::PlayerList const &PlayerList = instance->GetPlayers();
|
||||
|
||||
@@ -372,9 +372,9 @@ void InstanceData::DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
|
||||
pPlayer->RemoveAurasDueToSpell(spell);
|
||||
}
|
||||
|
||||
bool InstanceData::CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/ /*= NULL*/, uint32 /*miscvalue1*/ /*= 0*/)
|
||||
bool InstanceScript::CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/ /*= NULL*/, uint32 /*miscvalue1*/ /*= 0*/)
|
||||
{
|
||||
sLog.outError("Achievement system call InstanceData::CheckAchievementCriteriaMeet but instance script for map %u not have implementation for achievement criteria %u",
|
||||
sLog.outError("Achievement system call InstanceScript::CheckAchievementCriteriaMeet but instance script for map %u not have implementation for achievement criteria %u",
|
||||
instance->GetId(),criteria_id);
|
||||
return false;
|
||||
}
|
||||
+9
-3
@@ -26,6 +26,12 @@
|
||||
//#include "GameObject.h"
|
||||
//#include "Map.h"
|
||||
|
||||
#define OUT_SAVE_INST_DATA sLog.outDebug("TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d)", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
|
||||
#define OUT_SAVE_INST_DATA_COMPLETE sLog.outDebug("TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d) completed.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
|
||||
#define OUT_LOAD_INST_DATA(a) sLog.outDebug("TSCR: Loading Instance Data for Instance %s (Map %d, Instance Id %d). Input is '%s'", instance->GetMapName(), instance->GetId(), instance->GetInstanceId(), a)
|
||||
#define OUT_LOAD_INST_DATA_COMPLETE sLog.outDebug("TSCR: Instance Data Load for Instance %s (Map %d, Instance Id: %d) is complete.",instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
|
||||
#define OUT_LOAD_INST_DATA_FAIL sLog.outError("TSCR: Unable to load Instance Data for Instance %s (Map %d, Instance Id: %d).",instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
|
||||
|
||||
class Map;
|
||||
class Unit;
|
||||
class Player;
|
||||
@@ -110,12 +116,12 @@ struct MinionInfo
|
||||
typedef std::multimap<uint32 /*entry*/, DoorInfo> DoorInfoMap;
|
||||
typedef std::map<uint32 /*entry*/, MinionInfo> MinionInfoMap;
|
||||
|
||||
class InstanceData : public ZoneScript
|
||||
class InstanceScript : public ZoneScript
|
||||
{
|
||||
public:
|
||||
|
||||
explicit InstanceData(Map *map) : instance(map) {}
|
||||
virtual ~InstanceData() {}
|
||||
explicit InstanceScript(Map *map) : instance(map) {}
|
||||
virtual ~InstanceScript() {}
|
||||
|
||||
Map *instance;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "Log.h"
|
||||
#include "GridStates.h"
|
||||
#include "CellImpl.h"
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Config.h"
|
||||
@@ -2266,7 +2266,7 @@ bool InstanceMap::CanEnter(Player *player)
|
||||
// cannot enter while an encounter is in progress on raids
|
||||
/*Group *pGroup = player->GetGroup();
|
||||
if (!player->isGameMaster() && pGroup && pGroup->InCombatToInstance(GetInstanceId()) && player->GetMapId() != GetId())*/
|
||||
if (IsRaid() && GetInstanceData() && GetInstanceData()->IsEncounterInProgress())
|
||||
if (IsRaid() && GetInstanceScript() && GetInstanceScript()->IsEncounterInProgress())
|
||||
{
|
||||
player->SendTransferAborted(GetId(), TRANSFER_ABORT_ZONE_IN_COMBAT);
|
||||
return false;
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
class Unit;
|
||||
class WorldPacket;
|
||||
class InstanceData;
|
||||
class InstanceScript;
|
||||
class Group;
|
||||
class InstanceSave;
|
||||
class Object;
|
||||
@@ -592,7 +592,7 @@ class InstanceMap : public Map
|
||||
void CreateInstanceData(bool load);
|
||||
bool Reset(uint8 method);
|
||||
uint32 GetScriptId() { return i_script_id; }
|
||||
InstanceData* GetInstanceData() { return i_data; }
|
||||
InstanceScript* GetInstanceScript() { return i_data; }
|
||||
void PermBindAllPlayers(Player *player);
|
||||
void UnloadAll();
|
||||
bool CanEnter(Player* player);
|
||||
@@ -606,7 +606,7 @@ class InstanceMap : public Map
|
||||
private:
|
||||
bool m_resetAfterUnload;
|
||||
bool m_unloadWhenEmpty;
|
||||
InstanceData* i_data;
|
||||
InstanceScript* i_data;
|
||||
uint32 i_script_id;
|
||||
};
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "Transport.h"
|
||||
#include "GridDefines.h"
|
||||
#include "MapInstanced.h"
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "DestinationHolderImp.h"
|
||||
#include "Config.h"
|
||||
#include "World.h"
|
||||
|
||||
@@ -593,12 +593,12 @@ void ScriptMgr::OnMapUpdate(Map* map, uint32 diff)
|
||||
#undef SCR_MAP_BGN
|
||||
#undef SCR_MAP_END
|
||||
|
||||
InstanceData* ScriptMgr::CreateInstanceData(InstanceMap* map)
|
||||
InstanceScript* ScriptMgr::CreateInstanceData(InstanceMap* map)
|
||||
{
|
||||
ASSERT(map);
|
||||
|
||||
GET_SCRIPT_RET(InstanceMapScript, map->GetScriptId(), tmpscript, NULL);
|
||||
return tmpscript->GetInstanceData(map);
|
||||
return tmpscript->GetInstanceScript(map);
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effIndex, Item* target)
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
class Player;
|
||||
class Creature;
|
||||
class CreatureAI;
|
||||
class InstanceData;
|
||||
class InstanceScript;
|
||||
class SpellScript;
|
||||
class Quest;
|
||||
class Item;
|
||||
@@ -421,8 +421,8 @@ class InstanceMapScript : public ScriptObject, public MapScript<InstanceMap>
|
||||
|
||||
bool IsDatabaseBound() const { return true; }
|
||||
|
||||
// Gets an InstanceData object for this instance.
|
||||
virtual InstanceData* GetInstanceData(InstanceMap* map) const { return NULL; }
|
||||
// Gets an InstanceScript object for this instance.
|
||||
virtual InstanceScript* GetInstanceScript(InstanceMap* map) const { return NULL; }
|
||||
};
|
||||
|
||||
class BattlegroundMapScript : public ScriptObject, public MapScript<BattlegroundMap>
|
||||
@@ -852,7 +852,7 @@ class ScriptMgr
|
||||
|
||||
public: /* InstanceMapScript */
|
||||
|
||||
InstanceData* CreateInstanceData(InstanceMap* map);
|
||||
InstanceScript* CreateInstanceData(InstanceMap* map);
|
||||
|
||||
public: /* ItemScript */
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#include "DBCEnums.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "MapManager.h"
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
|
||||
void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
|
||||
@@ -384,7 +384,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!Script->GossipSelect (_player, unit, _player->PlayerTalkClass->GossipOptionSender (option), _player->PlayerTalkClass->GossipOptionAction (option)))
|
||||
if (!Script->OnGossipSelect (_player, unit, _player->PlayerTalkClass->GossipOptionSender (option), _player->PlayerTalkClass->GossipOptionAction (option)))
|
||||
unit->OnGossipSelect (_player, option);
|
||||
}
|
||||
}*/
|
||||
|
||||
@@ -211,11 +211,46 @@ struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI
|
||||
};
|
||||
|
||||
//This is the GetAI method used by all scripts that involve AI
|
||||
//It is called every time a new Creature using this script is created
|
||||
CreatureAI* GetAI_custom_example(Creature* pCreature)
|
||||
//It is called every time a new Creature using this script is created
class custom_example : public CreatureScript
|
||||
{
|
||||
return new custom_exampleAI (pCreature);
|
||||
}
|
||||
public:
|
||||
custom_example() : CreatureScript("custom_example") { }
|
||||
|
||||
bool ReceiveEmote(Player* pPlayer, Creature* pCreature, uint32 emote)
|
||||
{
|
||||
pCreature->HandleEmoteCommand(emote);
|
||||
|
||||
if (emote == TEXTEMOTE_DANCE)
|
||||
((custom_exampleAI*)_Creature->AI())->DoSay(SAY_DANCE,LANG_UNIVERSAL,NULL);
|
||||
|
||||
if (emote == TEXTEMOTE_SALUTE)
|
||||
((custom_exampleAI*)_Creature->AI())->DoSay(SAY_SALUTE,LANG_UNIVERSAL,NULL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
|
||||
{
|
||||
if (uiSender == GOSSIP_SENDER_MAIN)
|
||||
SendDefaultMenu(pPlayer, pCreature, uiAction);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipHello(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
pPlayer->PlayerTalkClass->SendGossipMenu(907, pCreature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature)
|
||||
{
|
||||
return new custom_exampleAI (pCreature);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
//This function is called when the player clicks an option on the gossip menu
|
||||
void SendDefaultMenu_custom_example(Player* pPlayer, Creature* pCreature, uint32 uiAction)
|
||||
@@ -230,36 +265,10 @@ void SendDefaultMenu_custom_example(Player* pPlayer, Creature* pCreature, uint32
|
||||
}
|
||||
|
||||
//This function is called when the player clicks an option on the gossip menu
|
||||
bool GossipSelect_custom_example(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
|
||||
{
|
||||
if (uiSender == GOSSIP_SENDER_MAIN)
|
||||
SendDefaultMenu_custom_example(pPlayer, pCreature, uiAction);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//This function is called when the player opens the gossip menu
|
||||
bool GossipHello_custom_example(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
pPlayer->PlayerTalkClass->SendGossipMenu(907, pCreature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//Our Recive emote function
|
||||
bool ReceiveEmote_custom_example(Player* pPlayer, Creature* pCreature, uint32 emote)
|
||||
{
|
||||
pCreature->HandleEmoteCommand(emote);
|
||||
|
||||
if (emote == TEXTEMOTE_DANCE)
|
||||
((custom_exampleAI*)_Creature->AI())->DoSay(SAY_DANCE,LANG_UNIVERSAL,NULL);
|
||||
|
||||
if (emote == TEXTEMOTE_SALUTE)
|
||||
((custom_exampleAI*)_Creature->AI())->DoSay(SAY_SALUTE,LANG_UNIVERSAL,NULL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//This is the actual function called only once durring InitScripts()
|
||||
//It must define all handled functions that are to be run in this script
|
||||
@@ -267,14 +276,5 @@ bool ReceiveEmote_custom_example(Player* pPlayer, Creature* pCreature, uint32 em
|
||||
//newscript->ReciveEmote = My_Emote_Function;
|
||||
void AddSC_custom_example()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="custom_example";
|
||||
newscript->GetAI = &GetAI_custom_example;
|
||||
newscript->pGossipHello = &GossipHello_custom_example;
|
||||
newscript->pGossipSelect = &GossipSelect_custom_example;
|
||||
newscript->pReceiveEmote = &ReceiveEmote_custom_example;
|
||||
newscript->RegisterSelf();
|
||||
new custom_example();
|
||||
}
|
||||
|
||||
|
||||
@@ -33,59 +33,59 @@ EndScriptData */
|
||||
#define SAY_WRONG "Wrong!"
|
||||
#define SAY_RIGHT "You're right, you are allowed to see my inner secrets."
|
||||
|
||||
//This function is called when the player opens the gossip menubool
|
||||
bool GossipHello_custom_gossip_codebox(Player* pPlayer, Creature* pCreature)
|
||||
//This function is called when the player opens the gossip menubool
class custom_gossip_codebox : public GameObjectScript
|
||||
{
|
||||
pPlayer->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1, "", 0, true);
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
public:
|
||||
custom_gossip_codebox() : GameObjectScript("custom_gossip_codebox") { }
|
||||
|
||||
pPlayer->PlayerTalkClass->SendGossipMenu(907, pCreature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
bool GossipSelectWithCode(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction, const char* sCode)
|
||||
{
|
||||
if (uiSender == GOSSIP_SENDER_MAIN)
|
||||
{
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
if (std::strcmp(sCode, pPlayer->GetName())!=0)
|
||||
{
|
||||
pCreature->Say(SAY_WRONG, LANG_UNIVERSAL, 0);
|
||||
pCreature->CastSpell(pPlayer, 12826, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
pCreature->Say(SAY_RIGHT, LANG_UNIVERSAL, 0);
|
||||
pCreature->CastSpell(pPlayer, 26990, true);
|
||||
}
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GossipSelect(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
|
||||
{
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF+2)
|
||||
{
|
||||
pCreature->Say(SAY_NOT_INTERESTED, LANG_UNIVERSAL, 0);
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipHello(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
pPlayer->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1, "", 0, true);
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
|
||||
pPlayer->PlayerTalkClass->SendGossipMenu(907, pCreature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
//This function is called when the player clicks an option on the gossip menubool
|
||||
bool GossipSelect_custom_gossip_codebox(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
|
||||
{
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF+2)
|
||||
{
|
||||
pCreature->Say(SAY_NOT_INTERESTED, LANG_UNIVERSAL, 0);
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelectWithCode_custom_gossip_codebox(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction, const char* sCode)
|
||||
{
|
||||
if (uiSender == GOSSIP_SENDER_MAIN)
|
||||
{
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
if (std::strcmp(sCode, pPlayer->GetName())!=0)
|
||||
{
|
||||
pCreature->Say(SAY_WRONG, LANG_UNIVERSAL, 0);
|
||||
pCreature->CastSpell(pPlayer, 12826, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
pCreature->Say(SAY_RIGHT, LANG_UNIVERSAL, 0);
|
||||
pCreature->CastSpell(pPlayer, 26990, true);
|
||||
}
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void AddSC_custom_gossip_codebox()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="custom_gossip_codebox";
|
||||
newscript->pGossipHello = &GossipHello_custom_gossip_codebox;
|
||||
newscript->pGossipSelect = &GossipSelect_custom_gossip_codebox;
|
||||
newscript->pGossipSelectWithCode = &GossipSelectWithCode_custom_gossip_codebox;
|
||||
newscript->RegisterSelf();
|
||||
new custom_gossip_codebox();
|
||||
}
|
||||
|
||||
|
||||
@@ -152,69 +152,70 @@ struct TRINITY_DLL_DECL npc_testAI : public npc_escortAI
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_test(Creature* pCreature)
|
||||
class test : public CreatureScript
|
||||
{
|
||||
npc_testAI* testAI = new npc_testAI(pCreature);
|
||||
public:
|
||||
test() : CreatureScript("test") { }
|
||||
|
||||
testAI->AddWaypoint(0, 1231, -4419, 23);
|
||||
testAI->AddWaypoint(1, 1198, -4440, 23, 0);
|
||||
testAI->AddWaypoint(2, 1208, -4392, 23);
|
||||
testAI->AddWaypoint(3, 1231, -4419, 23, 5000);
|
||||
testAI->AddWaypoint(4, 1208, -4392, 23, 5000);
|
||||
|
||||
return (CreatureAI*)testAI;
|
||||
}
|
||||
|
||||
bool GossipHello_npc_test(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID());
|
||||
pCreature->prepareGossipMenu(pPlayer,0);
|
||||
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TEXT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TEXT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TEXT3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
|
||||
|
||||
pCreature->sendPreparedGossip(pPlayer);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect_npc_test(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
|
||||
{
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
|
||||
bool GossipSelect_npc(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
|
||||
{
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
((npc_escortAI*)(pCreature->AI()))->Start(true, true, pPlayer->GetGUID());
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
((npc_escortAI*)(pCreature->AI()))->Start(true, true, pPlayer->GetGUID());
|
||||
|
||||
return true; // prevent Trinity core handling
|
||||
return true; // prevent Trinity core handling
|
||||
}
|
||||
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF+2)
|
||||
{
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
((npc_escortAI*)(pCreature->AI()))->Start(false, false, pPlayer->GetGUID());
|
||||
|
||||
return true; // prevent Trinity core handling
|
||||
}
|
||||
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF+3)
|
||||
{
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
((npc_escortAI*)(pCreature->AI()))->Start(false, false, pPlayer->GetGUID());
|
||||
|
||||
return true; // prevent Trinity core handling
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF+2)
|
||||
bool GossipHello_npc(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
((npc_escortAI*)(pCreature->AI()))->Start(false, false, pPlayer->GetGUID());
|
||||
pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID());
|
||||
pCreature->prepareGossipMenu(pPlayer,0);
|
||||
|
||||
return true; // prevent Trinity core handling
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TEXT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TEXT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TEXT3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
|
||||
|
||||
pCreature->sendPreparedGossip(pPlayer);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF+3)
|
||||
CreatureAI* GetAI(Creature* pCreature)
|
||||
{
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
((npc_escortAI*)(pCreature->AI()))->Start(false, false, pPlayer->GetGUID());
|
||||
npcAI* testAI = new npcAI(pCreature);
|
||||
|
||||
return true; // prevent Trinity core handling
|
||||
testAI->AddWaypoint(0, 1231, -4419, 23);
|
||||
testAI->AddWaypoint(1, 1198, -4440, 23, 0);
|
||||
testAI->AddWaypoint(2, 1208, -4392, 23);
|
||||
testAI->AddWaypoint(3, 1231, -4419, 23, 5000);
|
||||
testAI->AddWaypoint(4, 1208, -4392, 23, 5000);
|
||||
|
||||
return (CreatureAI*)testAI;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
void AddSC_test()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name="test";
|
||||
newscript->GetAI = &GetAI_test;
|
||||
newscript->pGossipHello = &GossipHello_npc_test;
|
||||
newscript->pGossipSelect = &GossipSelect_npc_test;
|
||||
newscript->RegisterSelf();
|
||||
new test();
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -29,65 +29,68 @@ enum Spells
|
||||
{
|
||||
SPELL_FIREBLAST = 15573
|
||||
};
|
||||
|
||||
struct boss_ambassador_flamelashAI : public ScriptedAI
|
||||
class boss_ambassador_flamelash : public CreatureScript
|
||||
{
|
||||
boss_ambassador_flamelashAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_ambassador_flamelash() : CreatureScript("boss_ambassador_flamelash") { }
|
||||
|
||||
uint32 FireBlast_Timer;
|
||||
uint32 Spirit_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
FireBlast_Timer = 2000;
|
||||
Spirit_Timer = 24000;
|
||||
return new boss_ambassador_flamelashAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/) {}
|
||||
|
||||
void SummonSpirits(Unit* victim)
|
||||
struct boss_ambassador_flamelashAI : public ScriptedAI
|
||||
{
|
||||
if (Creature *Spirit = DoSpawnCreature(9178, irand(-9,9), irand(-9,9), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000))
|
||||
Spirit->AI()->AttackStart(victim);
|
||||
}
|
||||
boss_ambassador_flamelashAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 FireBlast_Timer;
|
||||
uint32 Spirit_Timer;
|
||||
|
||||
//FireBlast_Timer
|
||||
if (FireBlast_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FIREBLAST);
|
||||
FireBlast_Timer = 7000;
|
||||
} else FireBlast_Timer -= diff;
|
||||
FireBlast_Timer = 2000;
|
||||
Spirit_Timer = 24000;
|
||||
}
|
||||
|
||||
//Spirit_Timer
|
||||
if (Spirit_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/) {}
|
||||
|
||||
void SummonSpirits(Unit* victim)
|
||||
{
|
||||
SummonSpirits(me->getVictim());
|
||||
SummonSpirits(me->getVictim());
|
||||
SummonSpirits(me->getVictim());
|
||||
SummonSpirits(me->getVictim());
|
||||
if (Creature *Spirit = DoSpawnCreature(9178, irand(-9,9), irand(-9,9), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000))
|
||||
Spirit->AI()->AttackStart(victim);
|
||||
}
|
||||
|
||||
Spirit_Timer = 30000;
|
||||
} else Spirit_Timer -= diff;
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//FireBlast_Timer
|
||||
if (FireBlast_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FIREBLAST);
|
||||
FireBlast_Timer = 7000;
|
||||
} else FireBlast_Timer -= diff;
|
||||
|
||||
//Spirit_Timer
|
||||
if (Spirit_Timer <= diff)
|
||||
{
|
||||
SummonSpirits(me->getVictim());
|
||||
SummonSpirits(me->getVictim());
|
||||
SummonSpirits(me->getVictim());
|
||||
SummonSpirits(me->getVictim());
|
||||
|
||||
Spirit_Timer = 30000;
|
||||
} else Spirit_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_ambassador_flamelash(Creature* pCreature)
|
||||
{
|
||||
return new boss_ambassador_flamelashAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_ambassador_flamelash()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_ambassador_flamelash";
|
||||
newscript->GetAI = &GetAI_boss_ambassador_flamelash;
|
||||
newscript->RegisterSelf();
|
||||
new boss_ambassador_flamelash();
|
||||
}
|
||||
|
||||
@@ -33,86 +33,89 @@ enum Spells
|
||||
SPELL_DEMONARMOR = 11735,
|
||||
SPELL_ENVELOPINGWEB = 15471
|
||||
};
|
||||
|
||||
struct boss_anubshiahAI : public ScriptedAI
|
||||
class boss_anubshiah : public CreatureScript
|
||||
{
|
||||
boss_anubshiahAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_anubshiah() : CreatureScript("boss_anubshiah") { }
|
||||
|
||||
uint32 ShadowBolt_Timer;
|
||||
uint32 CurseOfTongues_Timer;
|
||||
uint32 CurseOfWeakness_Timer;
|
||||
uint32 DemonArmor_Timer;
|
||||
uint32 EnvelopingWeb_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
ShadowBolt_Timer = 7000;
|
||||
CurseOfTongues_Timer = 24000;
|
||||
CurseOfWeakness_Timer = 12000;
|
||||
DemonArmor_Timer = 3000;
|
||||
EnvelopingWeb_Timer = 16000;
|
||||
return new boss_anubshiahAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_anubshiahAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_anubshiahAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 ShadowBolt_Timer;
|
||||
uint32 CurseOfTongues_Timer;
|
||||
uint32 CurseOfWeakness_Timer;
|
||||
uint32 DemonArmor_Timer;
|
||||
uint32 EnvelopingWeb_Timer;
|
||||
|
||||
//ShadowBolt_Timer
|
||||
if (ShadowBolt_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWBOLT);
|
||||
ShadowBolt_Timer = 7000;
|
||||
} else ShadowBolt_Timer -= diff;
|
||||
CurseOfTongues_Timer = 24000;
|
||||
CurseOfWeakness_Timer = 12000;
|
||||
DemonArmor_Timer = 3000;
|
||||
EnvelopingWeb_Timer = 16000;
|
||||
}
|
||||
|
||||
//CurseOfTongues_Timer
|
||||
if (CurseOfTongues_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_CURSEOFTONGUES);
|
||||
CurseOfTongues_Timer = 18000;
|
||||
} else CurseOfTongues_Timer -= diff;
|
||||
}
|
||||
|
||||
//CurseOfWeakness_Timer
|
||||
if (CurseOfWeakness_Timer <= diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CURSEOFWEAKNESS);
|
||||
CurseOfWeakness_Timer = 45000;
|
||||
} else CurseOfWeakness_Timer -= diff;
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//DemonArmor_Timer
|
||||
if (DemonArmor_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_DEMONARMOR);
|
||||
DemonArmor_Timer = 300000;
|
||||
} else DemonArmor_Timer -= diff;
|
||||
//ShadowBolt_Timer
|
||||
if (ShadowBolt_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWBOLT);
|
||||
ShadowBolt_Timer = 7000;
|
||||
} else ShadowBolt_Timer -= diff;
|
||||
|
||||
//EnvelopingWeb_Timer
|
||||
if (EnvelopingWeb_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_ENVELOPINGWEB);
|
||||
EnvelopingWeb_Timer = 12000;
|
||||
} else EnvelopingWeb_Timer -= diff;
|
||||
//CurseOfTongues_Timer
|
||||
if (CurseOfTongues_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_CURSEOFTONGUES);
|
||||
CurseOfTongues_Timer = 18000;
|
||||
} else CurseOfTongues_Timer -= diff;
|
||||
|
||||
//CurseOfWeakness_Timer
|
||||
if (CurseOfWeakness_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CURSEOFWEAKNESS);
|
||||
CurseOfWeakness_Timer = 45000;
|
||||
} else CurseOfWeakness_Timer -= diff;
|
||||
|
||||
//DemonArmor_Timer
|
||||
if (DemonArmor_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_DEMONARMOR);
|
||||
DemonArmor_Timer = 300000;
|
||||
} else DemonArmor_Timer -= diff;
|
||||
|
||||
//EnvelopingWeb_Timer
|
||||
if (EnvelopingWeb_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_ENVELOPINGWEB);
|
||||
EnvelopingWeb_Timer = 12000;
|
||||
} else EnvelopingWeb_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_anubshiah(Creature* pCreature)
|
||||
{
|
||||
return new boss_anubshiahAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_anubshiah()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_anubshiah";
|
||||
newscript->GetAI = &GetAI_boss_anubshiah;
|
||||
newscript->RegisterSelf();
|
||||
new boss_anubshiah();
|
||||
}
|
||||
|
||||
+60
-57
@@ -36,78 +36,81 @@ enum Spells
|
||||
SPELL_HANDOFTHAURISSAN = 17492,
|
||||
SPELL_AVATAROFFLAME = 15636
|
||||
};
|
||||
|
||||
struct boss_draganthaurissanAI : public ScriptedAI
|
||||
class boss_emperor_dagran_thaurissan : public CreatureScript
|
||||
{
|
||||
boss_draganthaurissanAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_emperor_dagran_thaurissan() : CreatureScript("boss_emperor_dagran_thaurissan") { }
|
||||
|
||||
uint32 HandOfThaurissan_Timer;
|
||||
uint32 AvatarOfFlame_Timer;
|
||||
//uint32 Counter;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
HandOfThaurissan_Timer = 4000;
|
||||
AvatarOfFlame_Timer = 25000;
|
||||
//Counter= 0;
|
||||
return new boss_draganthaurissanAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_draganthaurissanAI : public ScriptedAI
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
me->CallForHelp(VISIBLE_RANGE);
|
||||
}
|
||||
boss_draganthaurissanAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
DoScriptText(SAY_SLAY, me);
|
||||
}
|
||||
uint32 HandOfThaurissan_Timer;
|
||||
uint32 AvatarOfFlame_Timer;
|
||||
//uint32 Counter;
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (HandOfThaurissan_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
|
||||
DoCast(pTarget, SPELL_HANDOFTHAURISSAN);
|
||||
HandOfThaurissan_Timer = 4000;
|
||||
AvatarOfFlame_Timer = 25000;
|
||||
//Counter= 0;
|
||||
}
|
||||
|
||||
//3 Hands of Thaurissan will be casted
|
||||
//if (Counter < 3)
|
||||
//{
|
||||
// HandOfThaurissan_Timer = 1000;
|
||||
// ++Counter;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
HandOfThaurissan_Timer = 5000;
|
||||
//Counter = 0;
|
||||
//}
|
||||
} else HandOfThaurissan_Timer -= diff;
|
||||
|
||||
//AvatarOfFlame_Timer
|
||||
if (AvatarOfFlame_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_AVATAROFFLAME);
|
||||
AvatarOfFlame_Timer = 18000;
|
||||
} else AvatarOfFlame_Timer -= diff;
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
me->CallForHelp(VISIBLE_RANGE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
DoScriptText(SAY_SLAY, me);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (HandOfThaurissan_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
|
||||
DoCast(pTarget, SPELL_HANDOFTHAURISSAN);
|
||||
|
||||
//3 Hands of Thaurissan will be casted
|
||||
//if (Counter < 3)
|
||||
//{
|
||||
// HandOfThaurissan_Timer = 1000;
|
||||
// ++Counter;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
HandOfThaurissan_Timer = 5000;
|
||||
//Counter = 0;
|
||||
//}
|
||||
} else HandOfThaurissan_Timer -= diff;
|
||||
|
||||
//AvatarOfFlame_Timer
|
||||
if (AvatarOfFlame_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_AVATAROFFLAME);
|
||||
AvatarOfFlame_Timer = 18000;
|
||||
} else AvatarOfFlame_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_draganthaurissan(Creature* pCreature)
|
||||
{
|
||||
return new boss_draganthaurissanAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_draganthaurissan()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_emperor_dagran_thaurissan";
|
||||
newscript->GetAI = &GetAI_boss_draganthaurissan;
|
||||
newscript->RegisterSelf();
|
||||
new boss_emperor_dagran_thaurissan();
|
||||
}
|
||||
|
||||
@@ -31,104 +31,107 @@ enum Spells
|
||||
SPELL_HAMSTRING = 9080,
|
||||
SPELL_CLEAVE = 20691
|
||||
};
|
||||
|
||||
struct boss_general_angerforgeAI : public ScriptedAI
|
||||
class boss_general_angerforge : public CreatureScript
|
||||
{
|
||||
boss_general_angerforgeAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_general_angerforge() : CreatureScript("boss_general_angerforge") { }
|
||||
|
||||
uint32 MightyBlow_Timer;
|
||||
uint32 HamString_Timer;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 Adds_Timer;
|
||||
bool Medics;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
MightyBlow_Timer = 8000;
|
||||
HamString_Timer = 12000;
|
||||
Cleave_Timer = 16000;
|
||||
Adds_Timer = 0;
|
||||
Medics = false;
|
||||
return new boss_general_angerforgeAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_general_angerforgeAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_general_angerforgeAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void SummonAdds(Unit* victim)
|
||||
{
|
||||
if (Creature *SummonedAdd = DoSpawnCreature(8901, irand(-14,14), irand(-14,14), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000))
|
||||
SummonedAdd->AI()->AttackStart(victim);
|
||||
}
|
||||
uint32 MightyBlow_Timer;
|
||||
uint32 HamString_Timer;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 Adds_Timer;
|
||||
bool Medics;
|
||||
|
||||
void SummonMedics(Unit* victim)
|
||||
{
|
||||
if (Creature *SummonedMedic = DoSpawnCreature(8894, irand(-9,9), irand(-9,9), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000))
|
||||
SummonedMedic->AI()->AttackStart(victim);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//MightyBlow_Timer
|
||||
if (MightyBlow_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_MIGHTYBLOW);
|
||||
MightyBlow_Timer = 18000;
|
||||
} else MightyBlow_Timer -= diff;
|
||||
MightyBlow_Timer = 8000;
|
||||
HamString_Timer = 12000;
|
||||
Cleave_Timer = 16000;
|
||||
Adds_Timer = 0;
|
||||
Medics = false;
|
||||
}
|
||||
|
||||
//HamString_Timer
|
||||
if (HamString_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_HAMSTRING);
|
||||
HamString_Timer = 15000;
|
||||
} else HamString_Timer -= diff;
|
||||
}
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
void SummonAdds(Unit* victim)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 9000;
|
||||
} else Cleave_Timer -= diff;
|
||||
if (Creature *SummonedAdd = DoSpawnCreature(8901, irand(-14,14), irand(-14,14), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000))
|
||||
SummonedAdd->AI()->AttackStart(victim);
|
||||
}
|
||||
|
||||
//Adds_Timer
|
||||
if (me->GetHealth()*100 / me->GetMaxHealth() < 21)
|
||||
void SummonMedics(Unit* victim)
|
||||
{
|
||||
if (Adds_Timer <= diff)
|
||||
if (Creature *SummonedMedic = DoSpawnCreature(8894, irand(-9,9), irand(-9,9), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000))
|
||||
SummonedMedic->AI()->AttackStart(victim);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//MightyBlow_Timer
|
||||
if (MightyBlow_Timer <= diff)
|
||||
{
|
||||
// summon 3 Adds every 25s
|
||||
SummonAdds(me->getVictim());
|
||||
SummonAdds(me->getVictim());
|
||||
SummonAdds(me->getVictim());
|
||||
DoCast(me->getVictim(), SPELL_MIGHTYBLOW);
|
||||
MightyBlow_Timer = 18000;
|
||||
} else MightyBlow_Timer -= diff;
|
||||
|
||||
Adds_Timer = 25000;
|
||||
} else Adds_Timer -= diff;
|
||||
//HamString_Timer
|
||||
if (HamString_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_HAMSTRING);
|
||||
HamString_Timer = 15000;
|
||||
} else HamString_Timer -= diff;
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 9000;
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
//Adds_Timer
|
||||
if (me->GetHealth()*100 / me->GetMaxHealth() < 21)
|
||||
{
|
||||
if (Adds_Timer <= diff)
|
||||
{
|
||||
// summon 3 Adds every 25s
|
||||
SummonAdds(me->getVictim());
|
||||
SummonAdds(me->getVictim());
|
||||
SummonAdds(me->getVictim());
|
||||
|
||||
Adds_Timer = 25000;
|
||||
} else Adds_Timer -= diff;
|
||||
}
|
||||
|
||||
//Summon Medics
|
||||
if (!Medics && me->GetHealth()*100 / me->GetMaxHealth() < 21)
|
||||
{
|
||||
SummonMedics(me->getVictim());
|
||||
SummonMedics(me->getVictim());
|
||||
Medics = true;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
//Summon Medics
|
||||
if (!Medics && me->GetHealth()*100 / me->GetMaxHealth() < 21)
|
||||
{
|
||||
SummonMedics(me->getVictim());
|
||||
SummonMedics(me->getVictim());
|
||||
Medics = true;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_general_angerforge(Creature* pCreature)
|
||||
{
|
||||
return new boss_general_angerforgeAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_general_angerforge()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_general_angerforge";
|
||||
newscript->GetAI = &GetAI_boss_general_angerforge;
|
||||
newscript->RegisterSelf();
|
||||
new boss_general_angerforge();
|
||||
}
|
||||
|
||||
@@ -30,57 +30,60 @@ enum Spells
|
||||
SPELL_WHIRLWIND = 15589,
|
||||
SPELL_MORTALSTRIKE = 24573
|
||||
};
|
||||
|
||||
struct boss_gorosh_the_dervishAI : public ScriptedAI
|
||||
class boss_gorosh_the_dervish : public CreatureScript
|
||||
{
|
||||
boss_gorosh_the_dervishAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_gorosh_the_dervish() : CreatureScript("boss_gorosh_the_dervish") { }
|
||||
|
||||
uint32 WhirlWind_Timer;
|
||||
uint32 MortalStrike_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
WhirlWind_Timer = 12000;
|
||||
MortalStrike_Timer = 22000;
|
||||
return new boss_gorosh_the_dervishAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_gorosh_the_dervishAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_gorosh_the_dervishAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 WhirlWind_Timer;
|
||||
uint32 MortalStrike_Timer;
|
||||
|
||||
//WhirlWind_Timer
|
||||
if (WhirlWind_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me, SPELL_WHIRLWIND);
|
||||
WhirlWind_Timer = 15000;
|
||||
} else WhirlWind_Timer -= diff;
|
||||
WhirlWind_Timer = 12000;
|
||||
MortalStrike_Timer = 22000;
|
||||
}
|
||||
|
||||
//MortalStrike_Timer
|
||||
if (MortalStrike_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_MORTALSTRIKE);
|
||||
MortalStrike_Timer = 15000;
|
||||
} else MortalStrike_Timer -= diff;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//WhirlWind_Timer
|
||||
if (WhirlWind_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_WHIRLWIND);
|
||||
WhirlWind_Timer = 15000;
|
||||
} else WhirlWind_Timer -= diff;
|
||||
|
||||
//MortalStrike_Timer
|
||||
if (MortalStrike_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_MORTALSTRIKE);
|
||||
MortalStrike_Timer = 15000;
|
||||
} else MortalStrike_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_gorosh_the_dervish(Creature* pCreature)
|
||||
{
|
||||
return new boss_gorosh_the_dervishAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_gorosh_the_dervish()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_gorosh_the_dervish";
|
||||
newscript->GetAI = &GetAI_boss_gorosh_the_dervish;
|
||||
newscript->RegisterSelf();
|
||||
new boss_gorosh_the_dervish();
|
||||
}
|
||||
|
||||
@@ -35,62 +35,65 @@ enum Spells
|
||||
SPELL_GROUNDTREMOR = 6524,
|
||||
SPELL_FRENZY = 28371
|
||||
};
|
||||
|
||||
struct boss_grizzleAI : public ScriptedAI
|
||||
class boss_grizzle : public CreatureScript
|
||||
{
|
||||
boss_grizzleAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_grizzle() : CreatureScript("boss_grizzle") { }
|
||||
|
||||
uint32 GroundTremor_Timer;
|
||||
uint32 Frenzy_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
GroundTremor_Timer = 12000;
|
||||
Frenzy_Timer =0;
|
||||
return new boss_grizzleAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_grizzleAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_grizzleAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 GroundTremor_Timer;
|
||||
uint32 Frenzy_Timer;
|
||||
|
||||
//GroundTremor_Timer
|
||||
if (GroundTremor_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_GROUNDTREMOR);
|
||||
GroundTremor_Timer = 8000;
|
||||
} else GroundTremor_Timer -= diff;
|
||||
|
||||
//Frenzy_Timer
|
||||
if (me->GetHealth()*100 / me->GetMaxHealth() < 51)
|
||||
{
|
||||
if (Frenzy_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
DoScriptText(EMOTE_GENERIC_FRENZY_KILL, me);
|
||||
|
||||
Frenzy_Timer = 15000;
|
||||
} else Frenzy_Timer -= diff;
|
||||
GroundTremor_Timer = 12000;
|
||||
Frenzy_Timer =0;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//GroundTremor_Timer
|
||||
if (GroundTremor_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_GROUNDTREMOR);
|
||||
GroundTremor_Timer = 8000;
|
||||
} else GroundTremor_Timer -= diff;
|
||||
|
||||
//Frenzy_Timer
|
||||
if (me->GetHealth()*100 / me->GetMaxHealth() < 51)
|
||||
{
|
||||
if (Frenzy_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
DoScriptText(EMOTE_GENERIC_FRENZY_KILL, me);
|
||||
|
||||
Frenzy_Timer = 15000;
|
||||
} else Frenzy_Timer -= diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
CreatureAI* GetAI_boss_grizzle(Creature* pCreature)
|
||||
{
|
||||
return new boss_grizzleAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_grizzle()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_grizzle";
|
||||
newscript->GetAI = &GetAI_boss_grizzle;
|
||||
newscript->RegisterSelf();
|
||||
new boss_grizzle();
|
||||
}
|
||||
|
||||
+57
-54
@@ -32,77 +32,80 @@ enum Spells
|
||||
SPELL_PSYCHICSCREAM = 8122,
|
||||
SPELL_SHADOWSHIELD = 22417
|
||||
};
|
||||
|
||||
struct boss_high_interrogator_gerstahnAI : public ScriptedAI
|
||||
class boss_high_interrogator_gerstahn : public CreatureScript
|
||||
{
|
||||
boss_high_interrogator_gerstahnAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_high_interrogator_gerstahn() : CreatureScript("boss_high_interrogator_gerstahn") { }
|
||||
|
||||
uint32 ShadowWordPain_Timer;
|
||||
uint32 ManaBurn_Timer;
|
||||
uint32 PsychicScream_Timer;
|
||||
uint32 ShadowShield_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
ShadowWordPain_Timer = 4000;
|
||||
ManaBurn_Timer = 14000;
|
||||
PsychicScream_Timer = 32000;
|
||||
ShadowShield_Timer = 8000;
|
||||
return new boss_high_interrogator_gerstahnAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_high_interrogator_gerstahnAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_high_interrogator_gerstahnAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 ShadowWordPain_Timer;
|
||||
uint32 ManaBurn_Timer;
|
||||
uint32 PsychicScream_Timer;
|
||||
uint32 ShadowShield_Timer;
|
||||
|
||||
//ShadowWordPain_Timer
|
||||
if (ShadowWordPain_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_SHADOWWORDPAIN);
|
||||
ShadowWordPain_Timer = 7000;
|
||||
} else ShadowWordPain_Timer -= diff;
|
||||
ShadowWordPain_Timer = 4000;
|
||||
ManaBurn_Timer = 14000;
|
||||
PsychicScream_Timer = 32000;
|
||||
ShadowShield_Timer = 8000;
|
||||
}
|
||||
|
||||
//ManaBurn_Timer
|
||||
if (ManaBurn_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_MANABURN);
|
||||
ManaBurn_Timer = 10000;
|
||||
} else ManaBurn_Timer -= diff;
|
||||
}
|
||||
|
||||
//PsychicScream_Timer
|
||||
if (PsychicScream_Timer <= diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_PSYCHICSCREAM);
|
||||
PsychicScream_Timer = 30000;
|
||||
} else PsychicScream_Timer -= diff;
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//ShadowShield_Timer
|
||||
if (ShadowShield_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_SHADOWSHIELD);
|
||||
ShadowShield_Timer = 25000;
|
||||
} else ShadowShield_Timer -= diff;
|
||||
//ShadowWordPain_Timer
|
||||
if (ShadowWordPain_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_SHADOWWORDPAIN);
|
||||
ShadowWordPain_Timer = 7000;
|
||||
} else ShadowWordPain_Timer -= diff;
|
||||
|
||||
//ManaBurn_Timer
|
||||
if (ManaBurn_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_MANABURN);
|
||||
ManaBurn_Timer = 10000;
|
||||
} else ManaBurn_Timer -= diff;
|
||||
|
||||
//PsychicScream_Timer
|
||||
if (PsychicScream_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_PSYCHICSCREAM);
|
||||
PsychicScream_Timer = 30000;
|
||||
} else PsychicScream_Timer -= diff;
|
||||
|
||||
//ShadowShield_Timer
|
||||
if (ShadowShield_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_SHADOWSHIELD);
|
||||
ShadowShield_Timer = 25000;
|
||||
} else ShadowShield_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_high_interrogator_gerstahn(Creature* pCreature)
|
||||
{
|
||||
return new boss_high_interrogator_gerstahnAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_high_interrogator_gerstahn()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_high_interrogator_gerstahn";
|
||||
newscript->GetAI = &GetAI_boss_high_interrogator_gerstahn;
|
||||
newscript->RegisterSelf();
|
||||
new boss_high_interrogator_gerstahn();
|
||||
}
|
||||
|
||||
@@ -35,66 +35,69 @@ enum eEnums
|
||||
{
|
||||
DATA_THRONE_DOOR = 24 // not id or guid of doors but number of enum in blackrock_depths.h
|
||||
};
|
||||
|
||||
struct boss_magmusAI : public ScriptedAI
|
||||
class boss_magmus : public CreatureScript
|
||||
{
|
||||
boss_magmusAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_magmus() : CreatureScript("boss_magmus") { }
|
||||
|
||||
uint32 FieryBurst_Timer;
|
||||
uint32 WarStomp_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
FieryBurst_Timer = 5000;
|
||||
WarStomp_Timer =0;
|
||||
return new boss_magmusAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_magmusAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_magmusAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 FieryBurst_Timer;
|
||||
uint32 WarStomp_Timer;
|
||||
|
||||
//FieryBurst_Timer
|
||||
if (FieryBurst_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FIERYBURST);
|
||||
FieryBurst_Timer = 6000;
|
||||
} else FieryBurst_Timer -= diff;
|
||||
|
||||
//WarStomp_Timer
|
||||
if (me->GetHealth()*100 / me->GetMaxHealth() < 51)
|
||||
{
|
||||
if (WarStomp_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WARSTOMP);
|
||||
WarStomp_Timer = 8000;
|
||||
} else WarStomp_Timer -= diff;
|
||||
FieryBurst_Timer = 5000;
|
||||
WarStomp_Timer =0;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
// When he die open door to last chamber
|
||||
void JustDied(Unit *who)
|
||||
{
|
||||
if (ScriptedInstance* pInstance = who->GetInstanceData())
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_THRONE_DOOR), true);
|
||||
}
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//FieryBurst_Timer
|
||||
if (FieryBurst_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FIERYBURST);
|
||||
FieryBurst_Timer = 6000;
|
||||
} else FieryBurst_Timer -= diff;
|
||||
|
||||
//WarStomp_Timer
|
||||
if (me->GetHealth()*100 / me->GetMaxHealth() < 51)
|
||||
{
|
||||
if (WarStomp_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WARSTOMP);
|
||||
WarStomp_Timer = 8000;
|
||||
} else WarStomp_Timer -= diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
// When he die open door to last chamber
|
||||
void JustDied(Unit *who)
|
||||
{
|
||||
if (InstanceScript* pInstance = who->GetInstanceScript())
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_THRONE_DOOR), true);
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
CreatureAI* GetAI_boss_magmus(Creature* pCreature)
|
||||
{
|
||||
return new boss_magmusAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_magmus()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_magmus";
|
||||
newscript->GetAI = &GetAI_boss_magmus;
|
||||
newscript->RegisterSelf();
|
||||
new boss_magmus();
|
||||
}
|
||||
|
||||
@@ -34,67 +34,70 @@ enum Spells
|
||||
SPELL_SHADOWWORDPAIN = 10894,
|
||||
SPELL_SMITE = 10934
|
||||
};
|
||||
|
||||
struct boss_moira_bronzebeardAI : public ScriptedAI
|
||||
class boss_moira_bronzebeard : public CreatureScript
|
||||
{
|
||||
boss_moira_bronzebeardAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_moira_bronzebeard() : CreatureScript("boss_moira_bronzebeard") { }
|
||||
|
||||
uint32 Heal_Timer;
|
||||
uint32 MindBlast_Timer;
|
||||
uint32 ShadowWordPain_Timer;
|
||||
uint32 Smite_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
Heal_Timer = 12000; //These times are probably wrong
|
||||
MindBlast_Timer = 16000;
|
||||
ShadowWordPain_Timer = 2000;
|
||||
Smite_Timer = 8000;
|
||||
return new boss_moira_bronzebeardAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_moira_bronzebeardAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_moira_bronzebeardAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 Heal_Timer;
|
||||
uint32 MindBlast_Timer;
|
||||
uint32 ShadowWordPain_Timer;
|
||||
uint32 Smite_Timer;
|
||||
|
||||
//MindBlast_Timer
|
||||
if (MindBlast_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_MINDBLAST);
|
||||
MindBlast_Timer = 14000;
|
||||
} else MindBlast_Timer -= diff;
|
||||
Heal_Timer = 12000; //These times are probably wrong
|
||||
MindBlast_Timer = 16000;
|
||||
ShadowWordPain_Timer = 2000;
|
||||
Smite_Timer = 8000;
|
||||
}
|
||||
|
||||
//ShadowWordPain_Timer
|
||||
if (ShadowWordPain_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN);
|
||||
ShadowWordPain_Timer = 18000;
|
||||
} else ShadowWordPain_Timer -= diff;
|
||||
}
|
||||
|
||||
//Smite_Timer
|
||||
if (Smite_Timer <= diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SMITE);
|
||||
Smite_Timer = 10000;
|
||||
} else Smite_Timer -= diff;
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//MindBlast_Timer
|
||||
if (MindBlast_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_MINDBLAST);
|
||||
MindBlast_Timer = 14000;
|
||||
} else MindBlast_Timer -= diff;
|
||||
|
||||
//ShadowWordPain_Timer
|
||||
if (ShadowWordPain_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN);
|
||||
ShadowWordPain_Timer = 18000;
|
||||
} else ShadowWordPain_Timer -= diff;
|
||||
|
||||
//Smite_Timer
|
||||
if (Smite_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SMITE);
|
||||
Smite_Timer = 10000;
|
||||
} else Smite_Timer -= diff;
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_moira_bronzebeard(Creature* pCreature)
|
||||
{
|
||||
return new boss_moira_bronzebeardAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_moira_bronzebeard()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_moira_bronzebeard";
|
||||
newscript->GetAI = &GetAI_boss_moira_bronzebeard;
|
||||
newscript->RegisterSelf();
|
||||
new boss_moira_bronzebeard();
|
||||
}
|
||||
|
||||
@@ -46,46 +46,53 @@ enum Misc
|
||||
#define GOSSIP_ITEM_TEACH_2 "Continue..."
|
||||
#define GOSSIP_ITEM_TEACH_3 "[PH] Continue..."
|
||||
#define GOSSIP_ITEM_TRIBUTE "I want to pay tribute"
|
||||
|
||||
bool GossipHello_boss_gloomrel(Player* pPlayer, Creature* pCreature)
|
||||
class boss_gloomrel : public CreatureScript
|
||||
{
|
||||
if (pPlayer->GetQuestRewardStatus(QUEST_SPECTRAL_CHALICE) == 1 && pPlayer->GetSkillValue(SKILL_MINING) >= DATA_SKILLPOINT_MIN && !pPlayer->HasSpell(SPELL_SMELT_DARK_IRON))
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEACH_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
public:
|
||||
boss_gloomrel() : CreatureScript("boss_gloomrel") { }
|
||||
|
||||
if (pPlayer->GetQuestRewardStatus(QUEST_SPECTRAL_CHALICE) == 0 && pPlayer->GetSkillValue(SKILL_MINING) >= DATA_SKILLPOINT_MIN)
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TRIBUTE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
|
||||
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect_boss_gloomrel(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
|
||||
{
|
||||
switch (uiAction)
|
||||
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEACH_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
|
||||
pPlayer->SEND_GOSSIP_MENU(2606, pCreature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+11:
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
pCreature->CastSpell(pPlayer, SPELL_LEARN_SMELT, false);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEACH_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22);
|
||||
pPlayer->SEND_GOSSIP_MENU(2604, pCreature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+22:
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
if (ScriptedInstance* pInstance = pCreature->GetInstanceData())
|
||||
{
|
||||
//are 5 minutes expected? go template may have data to despawn when used at quest
|
||||
pInstance->DoRespawnGameObject(pInstance->GetData64(DATA_GO_CHALICE),MINUTE*5);
|
||||
}
|
||||
break;
|
||||
switch (uiAction)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEACH_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
|
||||
pPlayer->SEND_GOSSIP_MENU(2606, pCreature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+11:
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
pCreature->CastSpell(pPlayer, SPELL_LEARN_SMELT, false);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEACH_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22);
|
||||
pPlayer->SEND_GOSSIP_MENU(2604, pCreature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+22:
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
if (InstanceScript* pInstance = pCreature->GetInstanceScript())
|
||||
{
|
||||
//are 5 minutes expected? go template may have data to despawn when used at quest
|
||||
pInstance->DoRespawnGameObject(pInstance->GetData64(DATA_GO_CHALICE),MINUTE*5);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
if (pPlayer->GetQuestRewardStatus(QUEST_SPECTRAL_CHALICE) == 1 && pPlayer->GetSkillValue(SKILL_MINING) >= DATA_SKILLPOINT_MIN && !pPlayer->HasSpell(SPELL_SMELT_DARK_IRON))
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEACH_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
if (pPlayer->GetQuestRewardStatus(QUEST_SPECTRAL_CHALICE) == 0 && pPlayer->GetSkillValue(SKILL_MINING) >= DATA_SKILLPOINT_MIN)
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TRIBUTE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
|
||||
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
enum DoomrelSpells
|
||||
{
|
||||
@@ -96,161 +103,155 @@ enum DoomrelSpells
|
||||
SPELL_SUMMON_VOIDWALKERS = 15092
|
||||
};
|
||||
|
||||
struct boss_doomrelAI : public ScriptedAI
|
||||
{
|
||||
boss_doomrelAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
uint32 ShadowVolley_Timer;
|
||||
uint32 Immolate_Timer;
|
||||
uint32 CurseOfWeakness_Timer;
|
||||
uint32 DemonArmor_Timer;
|
||||
bool Voidwalkers;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
ShadowVolley_Timer = 10000;
|
||||
Immolate_Timer = 18000;
|
||||
CurseOfWeakness_Timer = 5000;
|
||||
DemonArmor_Timer = 16000;
|
||||
Voidwalkers = false;
|
||||
|
||||
me->setFaction(FACTION_FRIEND);
|
||||
|
||||
// was set before event start, so set again
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
|
||||
if (pInstance)
|
||||
if (pInstance->GetData(DATA_GHOSTKILL) >= 7)
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
else
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
me->RemoveAllAuras();
|
||||
me->DeleteThreatList();
|
||||
me->CombatStop(true);
|
||||
me->LoadCreaturesAddon();
|
||||
if (me->isAlive())
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
me->SetLootRecipient(NULL);
|
||||
if (pInstance)
|
||||
pInstance->SetData64(DATA_EVENSTARTER, 0);
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_GHOSTKILL, 1);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//ShadowVolley_Timer
|
||||
if (ShadowVolley_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWBOLTVOLLEY);
|
||||
ShadowVolley_Timer = 12000;
|
||||
} else ShadowVolley_Timer -= diff;
|
||||
|
||||
//Immolate_Timer
|
||||
if (Immolate_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_IMMOLATE);
|
||||
|
||||
Immolate_Timer = 25000;
|
||||
} else Immolate_Timer -= diff;
|
||||
|
||||
//CurseOfWeakness_Timer
|
||||
if (CurseOfWeakness_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CURSEOFWEAKNESS);
|
||||
CurseOfWeakness_Timer = 45000;
|
||||
} else CurseOfWeakness_Timer -= diff;
|
||||
|
||||
//DemonArmor_Timer
|
||||
if (DemonArmor_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_DEMONARMOR);
|
||||
DemonArmor_Timer = 300000;
|
||||
} else DemonArmor_Timer -= diff;
|
||||
|
||||
//Summon Voidwalkers
|
||||
if (!Voidwalkers && me->GetHealth()*100 / me->GetMaxHealth() < 51)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SUMMON_VOIDWALKERS, true);
|
||||
Voidwalkers = true;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_doomrel(Creature* pCreature)
|
||||
{
|
||||
return new boss_doomrelAI (pCreature);
|
||||
}
|
||||
|
||||
#define GOSSIP_ITEM_CHALLENGE "Your bondage is at an end, Doom'rel. I challenge you!"
|
||||
#define GOSSIP_SELECT_DOOMREL "[PH] Continue..."
|
||||
|
||||
bool GossipHello_boss_doomrel(Player* pPlayer, Creature* pCreature)
|
||||
class boss_doomrel : public CreatureScript
|
||||
{
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_CHALLENGE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
pPlayer->SEND_GOSSIP_MENU(2601, pCreature->GetGUID());
|
||||
public:
|
||||
boss_doomrel() : CreatureScript("boss_doomrel") { }
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect_boss_doomrel(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
|
||||
{
|
||||
switch (uiAction)
|
||||
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_DOOMREL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
pPlayer->SEND_GOSSIP_MENU(2605, pCreature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
//start event here
|
||||
pCreature->setFaction(FACTION_HOSTILE);
|
||||
pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
pCreature->AI()->AttackStart(pPlayer);
|
||||
ScriptedInstance* pInstance = pCreature->GetInstanceData();
|
||||
if (pInstance)
|
||||
pInstance->SetData64(DATA_EVENSTARTER,pPlayer->GetGUID());
|
||||
break;
|
||||
switch (uiAction)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_DOOMREL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
pPlayer->SEND_GOSSIP_MENU(2605, pCreature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
//start event here
|
||||
pCreature->setFaction(FACTION_HOSTILE);
|
||||
pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
pCreature->AI()->AttackStart(pPlayer);
|
||||
InstanceScript* pInstance = pCreature->GetInstanceScript();
|
||||
if (pInstance)
|
||||
pInstance->SetData64(DATA_EVENSTARTER,pPlayer->GetGUID());
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_CHALLENGE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
pPlayer->SEND_GOSSIP_MENU(2601, pCreature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
return new boss_doomrelAI (pCreature);
|
||||
}
|
||||
|
||||
struct boss_doomrelAI : public ScriptedAI
|
||||
{
|
||||
boss_doomrelAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
uint32 ShadowVolley_Timer;
|
||||
uint32 Immolate_Timer;
|
||||
uint32 CurseOfWeakness_Timer;
|
||||
uint32 DemonArmor_Timer;
|
||||
bool Voidwalkers;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
ShadowVolley_Timer = 10000;
|
||||
Immolate_Timer = 18000;
|
||||
CurseOfWeakness_Timer = 5000;
|
||||
DemonArmor_Timer = 16000;
|
||||
Voidwalkers = false;
|
||||
|
||||
me->setFaction(FACTION_FRIEND);
|
||||
|
||||
// was set before event start, so set again
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
|
||||
if (pInstance)
|
||||
if (pInstance->GetData(DATA_GHOSTKILL) >= 7)
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
else
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
me->RemoveAllAuras();
|
||||
me->DeleteThreatList();
|
||||
me->CombatStop(true);
|
||||
me->LoadCreaturesAddon();
|
||||
if (me->isAlive())
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
me->SetLootRecipient(NULL);
|
||||
if (pInstance)
|
||||
pInstance->SetData64(DATA_EVENSTARTER, 0);
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_GHOSTKILL, 1);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//ShadowVolley_Timer
|
||||
if (ShadowVolley_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWBOLTVOLLEY);
|
||||
ShadowVolley_Timer = 12000;
|
||||
} else ShadowVolley_Timer -= diff;
|
||||
|
||||
//Immolate_Timer
|
||||
if (Immolate_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_IMMOLATE);
|
||||
|
||||
Immolate_Timer = 25000;
|
||||
} else Immolate_Timer -= diff;
|
||||
|
||||
//CurseOfWeakness_Timer
|
||||
if (CurseOfWeakness_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CURSEOFWEAKNESS);
|
||||
CurseOfWeakness_Timer = 45000;
|
||||
} else CurseOfWeakness_Timer -= diff;
|
||||
|
||||
//DemonArmor_Timer
|
||||
if (DemonArmor_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_DEMONARMOR);
|
||||
DemonArmor_Timer = 300000;
|
||||
} else DemonArmor_Timer -= diff;
|
||||
|
||||
//Summon Voidwalkers
|
||||
if (!Voidwalkers && me->GetHealth()*100 / me->GetMaxHealth() < 51)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SUMMON_VOIDWALKERS, true);
|
||||
Voidwalkers = true;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_tomb_of_seven()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_gloomrel";
|
||||
newscript->pGossipHello = &GossipHello_boss_gloomrel;
|
||||
newscript->pGossipSelect = &GossipSelect_boss_gloomrel;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_doomrel";
|
||||
newscript->GetAI = &GetAI_boss_doomrel;
|
||||
newscript->pGossipHello = &GossipHello_boss_doomrel;
|
||||
newscript->pGossipSelect = &GossipSelect_boss_doomrel;
|
||||
newscript->RegisterSelf();
|
||||
new boss_gloomrel();
|
||||
new boss_doomrel();
|
||||
}
|
||||
|
||||
+366
-363
@@ -74,389 +74,392 @@ enum eEnums
|
||||
GO_SPECTRAL_CHALICE = 164869,
|
||||
GO_CHEST_SEVEN = 169243
|
||||
};
|
||||
|
||||
struct instance_blackrock_depths : public ScriptedInstance
|
||||
class instance_blackrock_depths : public InstanceMapScript
|
||||
{
|
||||
instance_blackrock_depths(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
|
||||
public:
|
||||
instance_blackrock_depths() : InstanceMapScript("instance_blackrock_depths") { }
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
std::string str_data;
|
||||
|
||||
uint64 EmperorGUID;
|
||||
uint64 PhalanxGUID;
|
||||
uint64 MagmusGUID;
|
||||
|
||||
uint64 GoArena1GUID;
|
||||
uint64 GoArena2GUID;
|
||||
uint64 GoArena3GUID;
|
||||
uint64 GoArena4GUID;
|
||||
uint64 GoShadowLockGUID;
|
||||
uint64 GoShadowMechGUID;
|
||||
uint64 GoShadowGiantGUID;
|
||||
uint64 GoShadowDummyGUID;
|
||||
uint64 GoBarKegGUID;
|
||||
uint64 GoBarKegTrapGUID;
|
||||
uint64 GoBarDoorGUID;
|
||||
uint64 GoTombEnterGUID;
|
||||
uint64 GoTombExitGUID;
|
||||
uint64 GoLyceumGUID;
|
||||
uint64 GoSFSGUID;
|
||||
uint64 GoSFNGUID;
|
||||
uint64 GoGolemNGUID;
|
||||
uint64 GoGolemSGUID;
|
||||
uint64 GoThroneGUID;
|
||||
uint64 GoChestGUID;
|
||||
|
||||
uint32 BarAleCount;
|
||||
uint32 GhostKillCount;
|
||||
uint64 TombBossGUIDs[7];
|
||||
uint64 TombEventStarterGUID;
|
||||
uint32 TombTimer;
|
||||
uint32 TombEventCounter;
|
||||
|
||||
void Initialize()
|
||||
InstanceScript* GetInstanceData_InstanceMapScript(Map* pMap)
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
EmperorGUID = 0;
|
||||
PhalanxGUID = 0;
|
||||
MagmusGUID = 0;
|
||||
|
||||
GoArena1GUID = 0;
|
||||
GoArena2GUID = 0;
|
||||
GoArena3GUID = 0;
|
||||
GoArena4GUID = 0;
|
||||
GoShadowLockGUID = 0;
|
||||
GoShadowMechGUID = 0;
|
||||
GoShadowGiantGUID = 0;
|
||||
GoShadowDummyGUID = 0;
|
||||
GoBarKegGUID = 0;
|
||||
GoBarKegTrapGUID = 0;
|
||||
GoBarDoorGUID = 0;
|
||||
GoTombEnterGUID = 0;
|
||||
GoTombExitGUID = 0;
|
||||
GoLyceumGUID = 0;
|
||||
GoSFSGUID = 0;
|
||||
GoSFNGUID = 0;
|
||||
GoGolemNGUID = 0;
|
||||
GoGolemSGUID = 0;
|
||||
GoThroneGUID = 0;
|
||||
GoChestGUID = 0;
|
||||
|
||||
BarAleCount = 0;
|
||||
GhostKillCount = 0;
|
||||
TombEventStarterGUID = 0;
|
||||
TombTimer = TIMER_TOMBOFTHESEVEN;
|
||||
TombEventCounter = 0;
|
||||
|
||||
for (uint8 i = 0; i < 7; ++i)
|
||||
TombBossGUIDs[i] = 0;
|
||||
return new instance_blackrock_depths_InstanceMapScript(pMap);
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
|
||||
struct instance_blackrock_depths_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
switch(pCreature->GetEntry())
|
||||
instance_blackrock_depths_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();};
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
std::string str_data;
|
||||
|
||||
uint64 EmperorGUID;
|
||||
uint64 PhalanxGUID;
|
||||
uint64 MagmusGUID;
|
||||
|
||||
uint64 GoArena1GUID;
|
||||
uint64 GoArena2GUID;
|
||||
uint64 GoArena3GUID;
|
||||
uint64 GoArena4GUID;
|
||||
uint64 GoShadowLockGUID;
|
||||
uint64 GoShadowMechGUID;
|
||||
uint64 GoShadowGiantGUID;
|
||||
uint64 GoShadowDummyGUID;
|
||||
uint64 GoBarKegGUID;
|
||||
uint64 GoBarKegTrapGUID;
|
||||
uint64 GoBarDoorGUID;
|
||||
uint64 GoTombEnterGUID;
|
||||
uint64 GoTombExitGUID;
|
||||
uint64 GoLyceumGUID;
|
||||
uint64 GoSFSGUID;
|
||||
uint64 GoSFNGUID;
|
||||
uint64 GoGolemNGUID;
|
||||
uint64 GoGolemSGUID;
|
||||
uint64 GoThroneGUID;
|
||||
uint64 GoChestGUID;
|
||||
|
||||
uint32 BarAleCount;
|
||||
uint32 GhostKillCount;
|
||||
uint64 TombBossGUIDs[7];
|
||||
uint64 TombEventStarterGUID;
|
||||
uint32 TombTimer;
|
||||
uint32 TombEventCounter;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
case NPC_EMPEROR: EmperorGUID = pCreature->GetGUID(); break;
|
||||
case NPC_PHALANX: PhalanxGUID = pCreature->GetGUID(); break;
|
||||
case NPC_DOOMREL: TombBossGUIDs[0] = pCreature->GetGUID(); break;
|
||||
case NPC_DOPEREL: TombBossGUIDs[1] = pCreature->GetGUID(); break;
|
||||
case NPC_HATEREL: TombBossGUIDs[2] = pCreature->GetGUID(); break;
|
||||
case NPC_VILEREL: TombBossGUIDs[3] = pCreature->GetGUID(); break;
|
||||
case NPC_SEETHREL: TombBossGUIDs[4] = pCreature->GetGUID(); break;
|
||||
case NPC_GLOOMREL: TombBossGUIDs[5] = pCreature->GetGUID(); break;
|
||||
case NPC_ANGERREL: TombBossGUIDs[6] = pCreature->GetGUID(); break;
|
||||
case NPC_MAGMUS:
|
||||
MagmusGUID = pCreature->GetGUID();
|
||||
if (!pCreature->isAlive())
|
||||
HandleGameObject(GetData64(DATA_THRONE_DOOR), true); // if Magmus is dead open door to last boss
|
||||
break;
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
EmperorGUID = 0;
|
||||
PhalanxGUID = 0;
|
||||
MagmusGUID = 0;
|
||||
|
||||
GoArena1GUID = 0;
|
||||
GoArena2GUID = 0;
|
||||
GoArena3GUID = 0;
|
||||
GoArena4GUID = 0;
|
||||
GoShadowLockGUID = 0;
|
||||
GoShadowMechGUID = 0;
|
||||
GoShadowGiantGUID = 0;
|
||||
GoShadowDummyGUID = 0;
|
||||
GoBarKegGUID = 0;
|
||||
GoBarKegTrapGUID = 0;
|
||||
GoBarDoorGUID = 0;
|
||||
GoTombEnterGUID = 0;
|
||||
GoTombExitGUID = 0;
|
||||
GoLyceumGUID = 0;
|
||||
GoSFSGUID = 0;
|
||||
GoSFNGUID = 0;
|
||||
GoGolemNGUID = 0;
|
||||
GoGolemSGUID = 0;
|
||||
GoThroneGUID = 0;
|
||||
GoChestGUID = 0;
|
||||
|
||||
BarAleCount = 0;
|
||||
GhostKillCount = 0;
|
||||
TombEventStarterGUID = 0;
|
||||
TombTimer = TIMER_TOMBOFTHESEVEN;
|
||||
TombEventCounter = 0;
|
||||
|
||||
for (uint8 i = 0; i < 7; ++i)
|
||||
TombBossGUIDs[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
|
||||
{
|
||||
switch(pGo->GetEntry())
|
||||
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
|
||||
{
|
||||
case GO_ARENA1: GoArena1GUID = pGo->GetGUID(); break;
|
||||
case GO_ARENA2: GoArena2GUID = pGo->GetGUID(); break;
|
||||
case GO_ARENA3: GoArena3GUID = pGo->GetGUID(); break;
|
||||
case GO_ARENA4: GoArena4GUID = pGo->GetGUID(); break;
|
||||
case GO_SHADOW_LOCK: GoShadowLockGUID = pGo->GetGUID(); break;
|
||||
case GO_SHADOW_MECHANISM: GoShadowMechGUID = pGo->GetGUID(); break;
|
||||
case GO_SHADOW_GIANT_DOOR: GoShadowGiantGUID = pGo->GetGUID(); break;
|
||||
case GO_SHADOW_DUMMY: GoShadowDummyGUID = pGo->GetGUID(); break;
|
||||
case GO_BAR_KEG_SHOT: GoBarKegGUID = pGo->GetGUID(); break;
|
||||
case GO_BAR_KEG_TRAP: GoBarKegTrapGUID = pGo->GetGUID(); break;
|
||||
case GO_BAR_DOOR: GoBarDoorGUID = pGo->GetGUID(); break;
|
||||
case GO_TOMB_ENTER: GoTombEnterGUID = pGo->GetGUID(); break;
|
||||
case GO_TOMB_EXIT:
|
||||
GoTombExitGUID = pGo->GetGUID();
|
||||
switch(pCreature->GetEntry())
|
||||
{
|
||||
case NPC_EMPEROR: EmperorGUID = pCreature->GetGUID(); break;
|
||||
case NPC_PHALANX: PhalanxGUID = pCreature->GetGUID(); break;
|
||||
case NPC_DOOMREL: TombBossGUIDs[0] = pCreature->GetGUID(); break;
|
||||
case NPC_DOPEREL: TombBossGUIDs[1] = pCreature->GetGUID(); break;
|
||||
case NPC_HATEREL: TombBossGUIDs[2] = pCreature->GetGUID(); break;
|
||||
case NPC_VILEREL: TombBossGUIDs[3] = pCreature->GetGUID(); break;
|
||||
case NPC_SEETHREL: TombBossGUIDs[4] = pCreature->GetGUID(); break;
|
||||
case NPC_GLOOMREL: TombBossGUIDs[5] = pCreature->GetGUID(); break;
|
||||
case NPC_ANGERREL: TombBossGUIDs[6] = pCreature->GetGUID(); break;
|
||||
case NPC_MAGMUS:
|
||||
MagmusGUID = pCreature->GetGUID();
|
||||
if (!pCreature->isAlive())
|
||||
HandleGameObject(GetData64(DATA_THRONE_DOOR), true); // if Magmus is dead open door to last boss
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
|
||||
{
|
||||
switch(pGo->GetEntry())
|
||||
{
|
||||
case GO_ARENA1: GoArena1GUID = pGo->GetGUID(); break;
|
||||
case GO_ARENA2: GoArena2GUID = pGo->GetGUID(); break;
|
||||
case GO_ARENA3: GoArena3GUID = pGo->GetGUID(); break;
|
||||
case GO_ARENA4: GoArena4GUID = pGo->GetGUID(); break;
|
||||
case GO_SHADOW_LOCK: GoShadowLockGUID = pGo->GetGUID(); break;
|
||||
case GO_SHADOW_MECHANISM: GoShadowMechGUID = pGo->GetGUID(); break;
|
||||
case GO_SHADOW_GIANT_DOOR: GoShadowGiantGUID = pGo->GetGUID(); break;
|
||||
case GO_SHADOW_DUMMY: GoShadowDummyGUID = pGo->GetGUID(); break;
|
||||
case GO_BAR_KEG_SHOT: GoBarKegGUID = pGo->GetGUID(); break;
|
||||
case GO_BAR_KEG_TRAP: GoBarKegTrapGUID = pGo->GetGUID(); break;
|
||||
case GO_BAR_DOOR: GoBarDoorGUID = pGo->GetGUID(); break;
|
||||
case GO_TOMB_ENTER: GoTombEnterGUID = pGo->GetGUID(); break;
|
||||
case GO_TOMB_EXIT:
|
||||
GoTombExitGUID = pGo->GetGUID();
|
||||
if (GhostKillCount >= 7)
|
||||
HandleGameObject(0, true, pGo);
|
||||
else
|
||||
HandleGameObject(0, false, pGo);
|
||||
break;
|
||||
case GO_LYCEUM: GoLyceumGUID = pGo->GetGUID(); break;
|
||||
case GO_SF_S: GoSFSGUID = pGo->GetGUID(); break;
|
||||
case GO_SF_N: GoSFNGUID = pGo->GetGUID(); break;
|
||||
case GO_GOLEM_ROOM_N: GoGolemNGUID = pGo->GetGUID(); break;
|
||||
case GO_GOLEM_ROOM_S: GoGolemSGUID = pGo->GetGUID(); break;
|
||||
case GO_THRONE_ROOM: GoThroneGUID = pGo->GetGUID(); break;
|
||||
case GO_CHEST_SEVEN: GoChestGUID = pGo->GetGUID(); break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData64(uint32 type, uint64 data)
|
||||
{
|
||||
sLog.outDebug("TSCR: Instance Blackrock Depths: SetData64 update (Type: %u Data %u)", type, data);
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case DATA_EVENSTARTER:
|
||||
TombEventStarterGUID = data;
|
||||
if (!TombEventStarterGUID)
|
||||
TombOfSevenReset();//reset
|
||||
else
|
||||
TombOfSevenStart();//start
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
sLog.outDebug("TSCR: Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data);
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case TYPE_RING_OF_LAW:
|
||||
m_auiEncounter[0] = data;
|
||||
break;
|
||||
case TYPE_VAULT:
|
||||
m_auiEncounter[1] = data;
|
||||
break;
|
||||
case TYPE_BAR:
|
||||
if (data == SPECIAL)
|
||||
++BarAleCount;
|
||||
else
|
||||
m_auiEncounter[2] = data;
|
||||
break;
|
||||
case TYPE_TOMB_OF_SEVEN:
|
||||
m_auiEncounter[3] = data;
|
||||
break;
|
||||
case TYPE_LYCEUM:
|
||||
m_auiEncounter[4] = data;
|
||||
break;
|
||||
case TYPE_IRON_HALL:
|
||||
m_auiEncounter[5] = data;
|
||||
break;
|
||||
case DATA_GHOSTKILL:
|
||||
GhostKillCount += data;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE || GhostKillCount >= 7)
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " "
|
||||
<< m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " << GhostKillCount;
|
||||
|
||||
str_data = saveStream.str();
|
||||
|
||||
SaveToDB();
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case TYPE_RING_OF_LAW:
|
||||
return m_auiEncounter[0];
|
||||
case TYPE_VAULT:
|
||||
return m_auiEncounter[1];
|
||||
case TYPE_BAR:
|
||||
if (m_auiEncounter[2] == IN_PROGRESS && BarAleCount == 3)
|
||||
return SPECIAL;
|
||||
else
|
||||
return m_auiEncounter[2];
|
||||
case TYPE_TOMB_OF_SEVEN:
|
||||
return m_auiEncounter[3];
|
||||
case TYPE_LYCEUM:
|
||||
return m_auiEncounter[4];
|
||||
case TYPE_IRON_HALL:
|
||||
return m_auiEncounter[5];
|
||||
case DATA_GHOSTKILL:
|
||||
return GhostKillCount;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 data)
|
||||
{
|
||||
switch(data)
|
||||
{
|
||||
case DATA_EMPEROR:
|
||||
return EmperorGUID;
|
||||
case DATA_PHALANX:
|
||||
return PhalanxGUID;
|
||||
case DATA_ARENA1:
|
||||
return GoArena1GUID;
|
||||
case DATA_ARENA2:
|
||||
return GoArena2GUID;
|
||||
case DATA_ARENA3:
|
||||
return GoArena3GUID;
|
||||
case DATA_ARENA4:
|
||||
return GoArena4GUID;
|
||||
case DATA_GO_BAR_KEG:
|
||||
return GoBarKegGUID;
|
||||
case DATA_GO_BAR_KEG_TRAP:
|
||||
return GoBarKegTrapGUID;
|
||||
case DATA_GO_BAR_DOOR:
|
||||
return GoBarDoorGUID;
|
||||
case DATA_EVENSTARTER:
|
||||
return TombEventStarterGUID;
|
||||
case DATA_SF_BRAZIER_N:
|
||||
return GoSFNGUID;
|
||||
case DATA_SF_BRAZIER_S:
|
||||
return GoSFSGUID;
|
||||
case DATA_THRONE_DOOR:
|
||||
return GoThroneGUID;
|
||||
case DATA_GOLEM_DOOR_N:
|
||||
return GoGolemNGUID;
|
||||
case DATA_GOLEM_DOOR_S:
|
||||
return GoGolemSGUID;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
return str_data;
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(in);
|
||||
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]
|
||||
>> m_auiEncounter[4] >> m_auiEncounter[5] >> GhostKillCount;
|
||||
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
if (GhostKillCount > 0 && GhostKillCount < 7)
|
||||
GhostKillCount = 0;//reset tomb of seven event
|
||||
if (GhostKillCount >= 7)
|
||||
HandleGameObject(0, true, pGo);
|
||||
else
|
||||
HandleGameObject(0, false, pGo);
|
||||
break;
|
||||
case GO_LYCEUM: GoLyceumGUID = pGo->GetGUID(); break;
|
||||
case GO_SF_S: GoSFSGUID = pGo->GetGUID(); break;
|
||||
case GO_SF_N: GoSFNGUID = pGo->GetGUID(); break;
|
||||
case GO_GOLEM_ROOM_N: GoGolemNGUID = pGo->GetGUID(); break;
|
||||
case GO_GOLEM_ROOM_S: GoGolemSGUID = pGo->GetGUID(); break;
|
||||
case GO_THRONE_ROOM: GoThroneGUID = pGo->GetGUID(); break;
|
||||
case GO_CHEST_SEVEN: GoChestGUID = pGo->GetGUID(); break;
|
||||
}
|
||||
}
|
||||
GhostKillCount = 7;
|
||||
|
||||
void SetData64(uint32 type, uint64 data)
|
||||
{
|
||||
sLog.outDebug("TSCR: Instance Blackrock Depths: SetData64 update (Type: %u Data %u)", type, data);
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case DATA_EVENSTARTER:
|
||||
TombEventStarterGUID = data;
|
||||
if (!TombEventStarterGUID)
|
||||
TombOfSevenReset();//reset
|
||||
else
|
||||
TombOfSevenStart();//start
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
sLog.outDebug("TSCR: Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data);
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case TYPE_RING_OF_LAW:
|
||||
m_auiEncounter[0] = data;
|
||||
break;
|
||||
case TYPE_VAULT:
|
||||
m_auiEncounter[1] = data;
|
||||
break;
|
||||
case TYPE_BAR:
|
||||
if (data == SPECIAL)
|
||||
++BarAleCount;
|
||||
else
|
||||
m_auiEncounter[2] = data;
|
||||
break;
|
||||
case TYPE_TOMB_OF_SEVEN:
|
||||
m_auiEncounter[3] = data;
|
||||
break;
|
||||
case TYPE_LYCEUM:
|
||||
m_auiEncounter[4] = data;
|
||||
break;
|
||||
case TYPE_IRON_HALL:
|
||||
m_auiEncounter[5] = data;
|
||||
break;
|
||||
case DATA_GHOSTKILL:
|
||||
GhostKillCount += data;
|
||||
break;
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
if (data == DONE || GhostKillCount >= 7)
|
||||
void TombOfSevenEvent()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " "
|
||||
<< m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " << GhostKillCount;
|
||||
|
||||
str_data = saveStream.str();
|
||||
|
||||
SaveToDB();
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case TYPE_RING_OF_LAW:
|
||||
return m_auiEncounter[0];
|
||||
case TYPE_VAULT:
|
||||
return m_auiEncounter[1];
|
||||
case TYPE_BAR:
|
||||
if (m_auiEncounter[2] == IN_PROGRESS && BarAleCount == 3)
|
||||
return SPECIAL;
|
||||
else
|
||||
return m_auiEncounter[2];
|
||||
case TYPE_TOMB_OF_SEVEN:
|
||||
return m_auiEncounter[3];
|
||||
case TYPE_LYCEUM:
|
||||
return m_auiEncounter[4];
|
||||
case TYPE_IRON_HALL:
|
||||
return m_auiEncounter[5];
|
||||
case DATA_GHOSTKILL:
|
||||
return GhostKillCount;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 data)
|
||||
{
|
||||
switch(data)
|
||||
{
|
||||
case DATA_EMPEROR:
|
||||
return EmperorGUID;
|
||||
case DATA_PHALANX:
|
||||
return PhalanxGUID;
|
||||
case DATA_ARENA1:
|
||||
return GoArena1GUID;
|
||||
case DATA_ARENA2:
|
||||
return GoArena2GUID;
|
||||
case DATA_ARENA3:
|
||||
return GoArena3GUID;
|
||||
case DATA_ARENA4:
|
||||
return GoArena4GUID;
|
||||
case DATA_GO_BAR_KEG:
|
||||
return GoBarKegGUID;
|
||||
case DATA_GO_BAR_KEG_TRAP:
|
||||
return GoBarKegTrapGUID;
|
||||
case DATA_GO_BAR_DOOR:
|
||||
return GoBarDoorGUID;
|
||||
case DATA_EVENSTARTER:
|
||||
return TombEventStarterGUID;
|
||||
case DATA_SF_BRAZIER_N:
|
||||
return GoSFNGUID;
|
||||
case DATA_SF_BRAZIER_S:
|
||||
return GoSFSGUID;
|
||||
case DATA_THRONE_DOOR:
|
||||
return GoThroneGUID;
|
||||
case DATA_GOLEM_DOOR_N:
|
||||
return GoGolemNGUID;
|
||||
case DATA_GOLEM_DOOR_S:
|
||||
return GoGolemSGUID;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
return str_data;
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(in);
|
||||
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]
|
||||
>> m_auiEncounter[4] >> m_auiEncounter[5] >> GhostKillCount;
|
||||
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
if (GhostKillCount > 0 && GhostKillCount < 7)
|
||||
GhostKillCount = 0;//reset tomb of seven event
|
||||
if (GhostKillCount >= 7)
|
||||
GhostKillCount = 7;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
void TombOfSevenEvent()
|
||||
{
|
||||
if (GhostKillCount < 7 && TombBossGUIDs[TombEventCounter])
|
||||
{
|
||||
if (Creature* boss = instance->GetCreature(TombBossGUIDs[TombEventCounter]))
|
||||
if (GhostKillCount < 7 && TombBossGUIDs[TombEventCounter])
|
||||
{
|
||||
boss->setFaction(FACTION_HOSTILE);
|
||||
boss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
if (Unit *pTarget = boss->SelectNearestTarget(500))
|
||||
boss->AI()->AttackStart(pTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TombOfSevenReset()
|
||||
{
|
||||
HandleGameObject(GoTombExitGUID,false);//event reseted, close exit door
|
||||
HandleGameObject(GoTombEnterGUID,true);//event reseted, open entrance door
|
||||
for (uint8 i = 0; i < 7; ++i)
|
||||
{
|
||||
if (Creature* boss = instance->GetCreature(TombBossGUIDs[i]))
|
||||
{
|
||||
if (!boss->isAlive())
|
||||
{//do not call EnterEvadeMode(), it will create infinit loops
|
||||
boss->Respawn();
|
||||
boss->RemoveAllAuras();
|
||||
boss->DeleteThreatList();
|
||||
boss->CombatStop(true);
|
||||
boss->LoadCreaturesAddon();
|
||||
boss->GetMotionMaster()->MoveTargetedHome();
|
||||
boss->SetLootRecipient(NULL);
|
||||
}
|
||||
boss->setFaction(FACTION_FRIEND);
|
||||
}
|
||||
}
|
||||
GhostKillCount = 0;
|
||||
TombEventStarterGUID = 0;
|
||||
TombEventCounter = 0;
|
||||
TombTimer = TIMER_TOMBOFTHESEVEN;
|
||||
SetData(TYPE_TOMB_OF_SEVEN, NOT_STARTED);
|
||||
}
|
||||
|
||||
void TombOfSevenStart()
|
||||
{
|
||||
HandleGameObject(GoTombExitGUID,false);//event started, close exit door
|
||||
HandleGameObject(GoTombEnterGUID,false);//event started, close entrance door
|
||||
SetData(TYPE_TOMB_OF_SEVEN, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void TombOfSevenEnd()
|
||||
{
|
||||
DoRespawnGameObject(GoChestGUID,DAY);
|
||||
HandleGameObject(GoTombExitGUID,true);//event done, open exit door
|
||||
HandleGameObject(GoTombEnterGUID,true);//event done, open entrance door
|
||||
TombEventStarterGUID = 0;
|
||||
SetData(TYPE_TOMB_OF_SEVEN, DONE);
|
||||
}
|
||||
void Update(uint32 diff)
|
||||
{
|
||||
if (TombEventStarterGUID && GhostKillCount < 7)
|
||||
{
|
||||
if (TombTimer <= diff)
|
||||
{
|
||||
TombTimer = TIMER_TOMBOFTHESEVEN;
|
||||
++TombEventCounter;
|
||||
TombOfSevenEvent();
|
||||
// Check Killed bosses
|
||||
for (uint8 i = 0; i < 7; ++i)
|
||||
if (Creature* boss = instance->GetCreature(TombBossGUIDs[TombEventCounter]))
|
||||
{
|
||||
if (Creature* boss = instance->GetCreature(TombBossGUIDs[i]))
|
||||
{
|
||||
if (!boss->isAlive())
|
||||
{
|
||||
GhostKillCount = i+1;
|
||||
}
|
||||
}
|
||||
boss->setFaction(FACTION_HOSTILE);
|
||||
boss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
if (Unit *pTarget = boss->SelectNearestTarget(500))
|
||||
boss->AI()->AttackStart(pTarget);
|
||||
}
|
||||
} else TombTimer -= diff;
|
||||
}
|
||||
}
|
||||
if (GhostKillCount >= 7 && TombEventStarterGUID)
|
||||
TombOfSevenEnd();
|
||||
}
|
||||
|
||||
void TombOfSevenReset()
|
||||
{
|
||||
HandleGameObject(GoTombExitGUID,false);//event reseted, close exit door
|
||||
HandleGameObject(GoTombEnterGUID,true);//event reseted, open entrance door
|
||||
for (uint8 i = 0; i < 7; ++i)
|
||||
{
|
||||
if (Creature* boss = instance->GetCreature(TombBossGUIDs[i]))
|
||||
{
|
||||
if (!boss->isAlive())
|
||||
{//do not call EnterEvadeMode(), it will create infinit loops
|
||||
boss->Respawn();
|
||||
boss->RemoveAllAuras();
|
||||
boss->DeleteThreatList();
|
||||
boss->CombatStop(true);
|
||||
boss->LoadCreaturesAddon();
|
||||
boss->GetMotionMaster()->MoveTargetedHome();
|
||||
boss->SetLootRecipient(NULL);
|
||||
}
|
||||
boss->setFaction(FACTION_FRIEND);
|
||||
}
|
||||
}
|
||||
GhostKillCount = 0;
|
||||
TombEventStarterGUID = 0;
|
||||
TombEventCounter = 0;
|
||||
TombTimer = TIMER_TOMBOFTHESEVEN;
|
||||
SetData(TYPE_TOMB_OF_SEVEN, NOT_STARTED);
|
||||
}
|
||||
|
||||
void TombOfSevenStart()
|
||||
{
|
||||
HandleGameObject(GoTombExitGUID,false);//event started, close exit door
|
||||
HandleGameObject(GoTombEnterGUID,false);//event started, close entrance door
|
||||
SetData(TYPE_TOMB_OF_SEVEN, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void TombOfSevenEnd()
|
||||
{
|
||||
DoRespawnGameObject(GoChestGUID,DAY);
|
||||
HandleGameObject(GoTombExitGUID,true);//event done, open exit door
|
||||
HandleGameObject(GoTombEnterGUID,true);//event done, open entrance door
|
||||
TombEventStarterGUID = 0;
|
||||
SetData(TYPE_TOMB_OF_SEVEN, DONE);
|
||||
}
|
||||
void Update(uint32 diff)
|
||||
{
|
||||
if (TombEventStarterGUID && GhostKillCount < 7)
|
||||
{
|
||||
if (TombTimer <= diff)
|
||||
{
|
||||
TombTimer = TIMER_TOMBOFTHESEVEN;
|
||||
++TombEventCounter;
|
||||
TombOfSevenEvent();
|
||||
// Check Killed bosses
|
||||
for (uint8 i = 0; i < 7; ++i)
|
||||
{
|
||||
if (Creature* boss = instance->GetCreature(TombBossGUIDs[i]))
|
||||
{
|
||||
if (!boss->isAlive())
|
||||
{
|
||||
GhostKillCount = i+1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else TombTimer -= diff;
|
||||
}
|
||||
if (GhostKillCount >= 7 && TombEventStarterGUID)
|
||||
TombOfSevenEnd();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
InstanceData* GetInstanceData_instance_blackrock_depths(Map* pMap)
|
||||
{
|
||||
return new instance_blackrock_depths(pMap);
|
||||
}
|
||||
|
||||
void AddSC_instance_blackrock_depths()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "instance_blackrock_depths";
|
||||
newscript->GetInstanceData = &GetInstanceData_instance_blackrock_depths;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
{
|
||||
new instance_blackrock_depths();
|
||||
}
|
||||
|
||||
@@ -29,76 +29,78 @@ EndScriptData */
|
||||
#define SPELL_CLEAVE 20691
|
||||
#define SPELL_CONFLIGURATION 16805
|
||||
#define SPELL_THUNDERCLAP 15548 //Not sure if right ID. 23931 would be a harder possibility.
|
||||
|
||||
struct boss_drakkisathAI : public ScriptedAI
|
||||
class boss_drakkisath : public CreatureScript
|
||||
{
|
||||
boss_drakkisathAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_drakkisath() : CreatureScript("boss_drakkisath") { }
|
||||
|
||||
uint32 FireNova_Timer;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 Confliguration_Timer;
|
||||
uint32 Thunderclap_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
FireNova_Timer = 6000;
|
||||
Cleave_Timer = 8000;
|
||||
Confliguration_Timer = 15000;
|
||||
Thunderclap_Timer = 17000;
|
||||
return new boss_drakkisathAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_drakkisathAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_drakkisathAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 FireNova_Timer;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 Confliguration_Timer;
|
||||
uint32 Thunderclap_Timer;
|
||||
|
||||
//FireNova_Timer
|
||||
if (FireNova_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FIRENOVA);
|
||||
FireNova_Timer = 10000;
|
||||
} else FireNova_Timer -= diff;
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
FireNova_Timer = 6000;
|
||||
Cleave_Timer = 8000;
|
||||
} else Cleave_Timer -= diff;
|
||||
Confliguration_Timer = 15000;
|
||||
Thunderclap_Timer = 17000;
|
||||
}
|
||||
|
||||
//Confliguration_Timer
|
||||
if (Confliguration_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CONFLIGURATION);
|
||||
Confliguration_Timer = 18000;
|
||||
} else Confliguration_Timer -= diff;
|
||||
}
|
||||
|
||||
//Thunderclap_Timer
|
||||
if (Thunderclap_Timer <= diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_THUNDERCLAP);
|
||||
Thunderclap_Timer = 20000;
|
||||
} else Thunderclap_Timer -= diff;
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//FireNova_Timer
|
||||
if (FireNova_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FIRENOVA);
|
||||
FireNova_Timer = 10000;
|
||||
} else FireNova_Timer -= diff;
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 8000;
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
//Confliguration_Timer
|
||||
if (Confliguration_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CONFLIGURATION);
|
||||
Confliguration_Timer = 18000;
|
||||
} else Confliguration_Timer -= diff;
|
||||
|
||||
//Thunderclap_Timer
|
||||
if (Thunderclap_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_THUNDERCLAP);
|
||||
Thunderclap_Timer = 20000;
|
||||
} else Thunderclap_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_drakkisath(Creature* pCreature)
|
||||
{
|
||||
return new boss_drakkisathAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_drakkisath()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_drakkisath";
|
||||
newscript->GetAI = &GetAI_boss_drakkisath;
|
||||
newscript->RegisterSelf();
|
||||
new boss_drakkisath();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,180 +28,182 @@ EndScriptData */
|
||||
#define SPELL_CORROSIVEACID 20667
|
||||
#define SPELL_FREEZE 18763
|
||||
#define SPELL_FLAMEBREATH 20712
|
||||
|
||||
struct boss_gythAI : public ScriptedAI
|
||||
class boss_gyth : public CreatureScript
|
||||
{
|
||||
boss_gythAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_gyth() : CreatureScript("boss_gyth") { }
|
||||
|
||||
uint32 Aggro_Timer;
|
||||
uint32 Dragons_Timer;
|
||||
uint32 Orc_Timer;
|
||||
uint32 CorrosiveAcid_Timer;
|
||||
uint32 Freeze_Timer;
|
||||
uint32 Flamebreath_Timer;
|
||||
uint32 Line1Count;
|
||||
uint32 Line2Count;
|
||||
|
||||
bool Event;
|
||||
bool SummonedDragons;
|
||||
bool SummonedOrcs;
|
||||
bool SummonedRend;
|
||||
bool bAggro;
|
||||
bool RootSelf;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
Dragons_Timer = 3000;
|
||||
Orc_Timer = 60000;
|
||||
Aggro_Timer = 60000;
|
||||
CorrosiveAcid_Timer = 8000;
|
||||
Freeze_Timer = 11000;
|
||||
Flamebreath_Timer = 4000;
|
||||
Event = false;
|
||||
SummonedDragons = false;
|
||||
SummonedOrcs= false;
|
||||
SummonedRend = false;
|
||||
bAggro = false;
|
||||
RootSelf = false;
|
||||
|
||||
// how many times should the two lines of summoned creatures be spawned
|
||||
// min 2 x 2, max 7 lines of attack in total
|
||||
Line1Count = rand() % 4 + 2;
|
||||
if (Line1Count < 5)
|
||||
Line2Count = rand() % (5 - Line1Count) + 2;
|
||||
else
|
||||
Line2Count = 2;
|
||||
|
||||
//Invisible for event start
|
||||
me->SetDisplayId(11686);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
return new boss_gythAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_gythAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_gythAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void SummonCreatureWithRandomTarget(uint32 creatureId)
|
||||
{
|
||||
Unit* Summoned = me->SummonCreature(creatureId, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 240000);
|
||||
if (Summoned)
|
||||
uint32 Aggro_Timer;
|
||||
uint32 Dragons_Timer;
|
||||
uint32 Orc_Timer;
|
||||
uint32 CorrosiveAcid_Timer;
|
||||
uint32 Freeze_Timer;
|
||||
uint32 Flamebreath_Timer;
|
||||
uint32 Line1Count;
|
||||
uint32 Line2Count;
|
||||
|
||||
bool Event;
|
||||
bool SummonedDragons;
|
||||
bool SummonedOrcs;
|
||||
bool SummonedRend;
|
||||
bool bAggro;
|
||||
bool RootSelf;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
if (pTarget)
|
||||
Summoned->AddThreat(pTarget, 1.0f);
|
||||
}
|
||||
}
|
||||
Dragons_Timer = 3000;
|
||||
Orc_Timer = 60000;
|
||||
Aggro_Timer = 60000;
|
||||
CorrosiveAcid_Timer = 8000;
|
||||
Freeze_Timer = 11000;
|
||||
Flamebreath_Timer = 4000;
|
||||
Event = false;
|
||||
SummonedDragons = false;
|
||||
SummonedOrcs= false;
|
||||
SummonedRend = false;
|
||||
bAggro = false;
|
||||
RootSelf = false;
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//char buf[200];
|
||||
// how many times should the two lines of summoned creatures be spawned
|
||||
// min 2 x 2, max 7 lines of attack in total
|
||||
Line1Count = rand() % 4 + 2;
|
||||
if (Line1Count < 5)
|
||||
Line2Count = rand() % (5 - Line1Count) + 2;
|
||||
else
|
||||
Line2Count = 2;
|
||||
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (!RootSelf)
|
||||
{
|
||||
//me->m_canMove = true;
|
||||
DoCast(me, 33356);
|
||||
RootSelf = true;
|
||||
//Invisible for event start
|
||||
me->SetDisplayId(11686);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
if (!bAggro && Line1Count == 0 && Line2Count == 0)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
if (Aggro_Timer <= diff)
|
||||
{
|
||||
bAggro = true;
|
||||
// Visible now!
|
||||
me->SetDisplayId(9723);
|
||||
me->setFaction(14);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
} else Aggro_Timer -= diff;
|
||||
}
|
||||
|
||||
// Summon Dragon pack. 2 Dragons and 3 Whelps
|
||||
if (!bAggro && !SummonedRend && Line1Count > 0)
|
||||
void SummonCreatureWithRandomTarget(uint32 creatureId)
|
||||
{
|
||||
if (Dragons_Timer <= diff)
|
||||
Unit* Summoned = me->SummonCreature(creatureId, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 240000);
|
||||
if (Summoned)
|
||||
{
|
||||
SummonCreatureWithRandomTarget(10372);
|
||||
SummonCreatureWithRandomTarget(10372);
|
||||
SummonCreatureWithRandomTarget(10442);
|
||||
SummonCreatureWithRandomTarget(10442);
|
||||
SummonCreatureWithRandomTarget(10442);
|
||||
Line1Count = Line1Count - 1;
|
||||
Dragons_Timer = 60000;
|
||||
} else Dragons_Timer -= diff;
|
||||
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
if (pTarget)
|
||||
Summoned->AddThreat(pTarget, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
//Summon Orc pack. 1 Orc Handler 1 Elite Dragonkin and 3 Whelps
|
||||
if (!bAggro && !SummonedRend && Line1Count == 0 && Line2Count > 0)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (Orc_Timer <= diff)
|
||||
{
|
||||
SummonCreatureWithRandomTarget(10447);
|
||||
SummonCreatureWithRandomTarget(10317);
|
||||
SummonCreatureWithRandomTarget(10442);
|
||||
SummonCreatureWithRandomTarget(10442);
|
||||
SummonCreatureWithRandomTarget(10442);
|
||||
Line2Count = Line2Count - 1;
|
||||
Orc_Timer = 60000;
|
||||
} else Orc_Timer -= diff;
|
||||
}
|
||||
//char buf[200];
|
||||
|
||||
// we take part in the fight
|
||||
if (bAggro)
|
||||
{
|
||||
// CorrosiveAcid_Timer
|
||||
if (CorrosiveAcid_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CORROSIVEACID);
|
||||
CorrosiveAcid_Timer = 7000;
|
||||
} else CorrosiveAcid_Timer -= diff;
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
// Freeze_Timer
|
||||
if (Freeze_Timer <= diff)
|
||||
if (!RootSelf)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FREEZE);
|
||||
Freeze_Timer = 16000;
|
||||
} else Freeze_Timer -= diff;
|
||||
|
||||
// Flamebreath_Timer
|
||||
if (Flamebreath_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FLAMEBREATH);
|
||||
Flamebreath_Timer = 10500;
|
||||
} else Flamebreath_Timer -= diff;
|
||||
|
||||
//Summon Rend
|
||||
if (!SummonedRend && me->GetHealth()*100 / me->GetMaxHealth() < 11
|
||||
&& me->GetHealth() > 0)
|
||||
{
|
||||
//summon Rend and Change model to normal Gyth
|
||||
//Interrupt any spell casting
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
//Gyth model
|
||||
me->SetDisplayId(9806);
|
||||
me->SummonCreature(10429, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000);
|
||||
SummonedRend = true;
|
||||
//me->m_canMove = true;
|
||||
DoCast(me, 33356);
|
||||
RootSelf = true;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
} // end if Aggro
|
||||
}
|
||||
if (!bAggro && Line1Count == 0 && Line2Count == 0)
|
||||
{
|
||||
if (Aggro_Timer <= diff)
|
||||
{
|
||||
bAggro = true;
|
||||
// Visible now!
|
||||
me->SetDisplayId(9723);
|
||||
me->setFaction(14);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
} else Aggro_Timer -= diff;
|
||||
}
|
||||
|
||||
// Summon Dragon pack. 2 Dragons and 3 Whelps
|
||||
if (!bAggro && !SummonedRend && Line1Count > 0)
|
||||
{
|
||||
if (Dragons_Timer <= diff)
|
||||
{
|
||||
SummonCreatureWithRandomTarget(10372);
|
||||
SummonCreatureWithRandomTarget(10372);
|
||||
SummonCreatureWithRandomTarget(10442);
|
||||
SummonCreatureWithRandomTarget(10442);
|
||||
SummonCreatureWithRandomTarget(10442);
|
||||
Line1Count = Line1Count - 1;
|
||||
Dragons_Timer = 60000;
|
||||
} else Dragons_Timer -= diff;
|
||||
}
|
||||
|
||||
//Summon Orc pack. 1 Orc Handler 1 Elite Dragonkin and 3 Whelps
|
||||
if (!bAggro && !SummonedRend && Line1Count == 0 && Line2Count > 0)
|
||||
{
|
||||
if (Orc_Timer <= diff)
|
||||
{
|
||||
SummonCreatureWithRandomTarget(10447);
|
||||
SummonCreatureWithRandomTarget(10317);
|
||||
SummonCreatureWithRandomTarget(10442);
|
||||
SummonCreatureWithRandomTarget(10442);
|
||||
SummonCreatureWithRandomTarget(10442);
|
||||
Line2Count = Line2Count - 1;
|
||||
Orc_Timer = 60000;
|
||||
} else Orc_Timer -= diff;
|
||||
}
|
||||
|
||||
// we take part in the fight
|
||||
if (bAggro)
|
||||
{
|
||||
// CorrosiveAcid_Timer
|
||||
if (CorrosiveAcid_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CORROSIVEACID);
|
||||
CorrosiveAcid_Timer = 7000;
|
||||
} else CorrosiveAcid_Timer -= diff;
|
||||
|
||||
// Freeze_Timer
|
||||
if (Freeze_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FREEZE);
|
||||
Freeze_Timer = 16000;
|
||||
} else Freeze_Timer -= diff;
|
||||
|
||||
// Flamebreath_Timer
|
||||
if (Flamebreath_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FLAMEBREATH);
|
||||
Flamebreath_Timer = 10500;
|
||||
} else Flamebreath_Timer -= diff;
|
||||
|
||||
//Summon Rend
|
||||
if (!SummonedRend && me->GetHealth()*100 / me->GetMaxHealth() < 11
|
||||
&& me->GetHealth() > 0)
|
||||
{
|
||||
//summon Rend and Change model to normal Gyth
|
||||
//Interrupt any spell casting
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
//Gyth model
|
||||
me->SetDisplayId(9806);
|
||||
me->SummonCreature(10429, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000);
|
||||
SummonedRend = true;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
} // end if Aggro
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_gyth(Creature* pCreature)
|
||||
{
|
||||
return new boss_gythAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_gyth()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_gyth";
|
||||
newscript->GetAI = &GetAI_boss_gyth;
|
||||
newscript->RegisterSelf();
|
||||
new boss_gyth();
|
||||
}
|
||||
|
||||
|
||||
@@ -32,67 +32,69 @@ EndScriptData */
|
||||
#define ADD_1Y -324.961395
|
||||
#define ADD_1Z 64.401443
|
||||
#define ADD_1O 3.124724
|
||||
|
||||
struct boss_halyconAI : public ScriptedAI
|
||||
class boss_halycon : public CreatureScript
|
||||
{
|
||||
boss_halyconAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_halycon() : CreatureScript("boss_halycon") { }
|
||||
|
||||
uint32 CrowdPummel_Timer;
|
||||
uint32 MightyBlow_Timer;
|
||||
bool Summoned;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
CrowdPummel_Timer = 8000;
|
||||
MightyBlow_Timer = 14000;
|
||||
Summoned = false;
|
||||
return new boss_halyconAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_halyconAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_halyconAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 CrowdPummel_Timer;
|
||||
uint32 MightyBlow_Timer;
|
||||
bool Summoned;
|
||||
|
||||
//CrowdPummel_Timer
|
||||
if (CrowdPummel_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CROWDPUMMEL);
|
||||
CrowdPummel_Timer = 14000;
|
||||
} else CrowdPummel_Timer -= diff;
|
||||
|
||||
//MightyBlow_Timer
|
||||
if (MightyBlow_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_MIGHTYBLOW);
|
||||
MightyBlow_Timer = 10000;
|
||||
} else MightyBlow_Timer -= diff;
|
||||
|
||||
//Summon Gizrul
|
||||
if (!Summoned && me->GetHealth()*100 / me->GetMaxHealth() < 25)
|
||||
{
|
||||
me->SummonCreature(10268,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000);
|
||||
Summoned = true;
|
||||
CrowdPummel_Timer = 8000;
|
||||
MightyBlow_Timer = 14000;
|
||||
Summoned = false;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//CrowdPummel_Timer
|
||||
if (CrowdPummel_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CROWDPUMMEL);
|
||||
CrowdPummel_Timer = 14000;
|
||||
} else CrowdPummel_Timer -= diff;
|
||||
|
||||
//MightyBlow_Timer
|
||||
if (MightyBlow_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_MIGHTYBLOW);
|
||||
MightyBlow_Timer = 10000;
|
||||
} else MightyBlow_Timer -= diff;
|
||||
|
||||
//Summon Gizrul
|
||||
if (!Summoned && me->GetHealth()*100 / me->GetMaxHealth() < 25)
|
||||
{
|
||||
me->SummonCreature(10268,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000);
|
||||
Summoned = true;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
CreatureAI* GetAI_boss_halycon(Creature* pCreature)
|
||||
{
|
||||
return new boss_halyconAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_halycon()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_halycon";
|
||||
newscript->GetAI = &GetAI_boss_halycon;
|
||||
newscript->RegisterSelf();
|
||||
new boss_halycon();
|
||||
}
|
||||
|
||||
|
||||
@@ -32,103 +32,105 @@ EndScriptData */
|
||||
#define SPELL_SUNDERARMOR 24317
|
||||
#define SPELL_KNOCKAWAY 20686
|
||||
#define SPELL_SLOW 22356
|
||||
|
||||
struct boss_highlordomokkAI : public ScriptedAI
|
||||
class boss_highlord_omokk : public CreatureScript
|
||||
{
|
||||
boss_highlordomokkAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_highlord_omokk() : CreatureScript("boss_highlord_omokk") { }
|
||||
|
||||
uint32 WarStomp_Timer;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 Strike_Timer;
|
||||
uint32 Rend_Timer;
|
||||
uint32 SunderArmor_Timer;
|
||||
uint32 KnockAway_Timer;
|
||||
uint32 Slow_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
WarStomp_Timer = 15000;
|
||||
Cleave_Timer = 6000;
|
||||
Strike_Timer = 10000;
|
||||
Rend_Timer = 14000;
|
||||
SunderArmor_Timer = 2000;
|
||||
KnockAway_Timer = 18000;
|
||||
Slow_Timer = 24000;
|
||||
return new boss_highlordomokkAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_highlordomokkAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_highlordomokkAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 WarStomp_Timer;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 Strike_Timer;
|
||||
uint32 Rend_Timer;
|
||||
uint32 SunderArmor_Timer;
|
||||
uint32 KnockAway_Timer;
|
||||
uint32 Slow_Timer;
|
||||
|
||||
//WarStomp_Timer
|
||||
if (WarStomp_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WARSTOMP);
|
||||
WarStomp_Timer = 14000;
|
||||
} else WarStomp_Timer -= diff;
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 8000;
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
//Strike_Timer
|
||||
if (Strike_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_STRIKE);
|
||||
WarStomp_Timer = 15000;
|
||||
Cleave_Timer = 6000;
|
||||
Strike_Timer = 10000;
|
||||
} else Strike_Timer -= diff;
|
||||
Rend_Timer = 14000;
|
||||
SunderArmor_Timer = 2000;
|
||||
KnockAway_Timer = 18000;
|
||||
Slow_Timer = 24000;
|
||||
}
|
||||
|
||||
//Rend_Timer
|
||||
if (Rend_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_REND);
|
||||
Rend_Timer = 18000;
|
||||
} else Rend_Timer -= diff;
|
||||
}
|
||||
|
||||
//SunderArmor_Timer
|
||||
if (SunderArmor_Timer <= diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SUNDERARMOR);
|
||||
SunderArmor_Timer = 25000;
|
||||
} else SunderArmor_Timer -= diff;
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//KnockAway_Timer
|
||||
if (KnockAway_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_KNOCKAWAY);
|
||||
KnockAway_Timer = 12000;
|
||||
} else KnockAway_Timer -= diff;
|
||||
//WarStomp_Timer
|
||||
if (WarStomp_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WARSTOMP);
|
||||
WarStomp_Timer = 14000;
|
||||
} else WarStomp_Timer -= diff;
|
||||
|
||||
//Slow_Timer
|
||||
if (Slow_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SLOW);
|
||||
Slow_Timer = 18000;
|
||||
} else Slow_Timer -= diff;
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 8000;
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
//Strike_Timer
|
||||
if (Strike_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_STRIKE);
|
||||
Strike_Timer = 10000;
|
||||
} else Strike_Timer -= diff;
|
||||
|
||||
//Rend_Timer
|
||||
if (Rend_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_REND);
|
||||
Rend_Timer = 18000;
|
||||
} else Rend_Timer -= diff;
|
||||
|
||||
//SunderArmor_Timer
|
||||
if (SunderArmor_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SUNDERARMOR);
|
||||
SunderArmor_Timer = 25000;
|
||||
} else SunderArmor_Timer -= diff;
|
||||
|
||||
//KnockAway_Timer
|
||||
if (KnockAway_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_KNOCKAWAY);
|
||||
KnockAway_Timer = 12000;
|
||||
} else KnockAway_Timer -= diff;
|
||||
|
||||
//Slow_Timer
|
||||
if (Slow_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SLOW);
|
||||
Slow_Timer = 18000;
|
||||
} else Slow_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_highlordomokk(Creature* pCreature)
|
||||
{
|
||||
return new boss_highlordomokkAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_highlordomokk()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_highlord_omokk";
|
||||
newscript->GetAI = &GetAI_boss_highlordomokk;
|
||||
newscript->RegisterSelf();
|
||||
new boss_highlord_omokk();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,62 +28,64 @@ EndScriptData */
|
||||
#define SPELL_CRYSTALIZE 16104
|
||||
#define SPELL_MOTHERSMILK 16468
|
||||
#define SPELL_SUMMON_SPIRE_SPIDERLING 16103
|
||||
|
||||
struct boss_mothersmolderwebAI : public ScriptedAI
|
||||
class boss_mother_smolderweb : public CreatureScript
|
||||
{
|
||||
boss_mothersmolderwebAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_mother_smolderweb() : CreatureScript("boss_mother_smolderweb") { }
|
||||
|
||||
uint32 Crystalize_Timer;
|
||||
uint32 MothersMilk_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
Crystalize_Timer = 20000;
|
||||
MothersMilk_Timer = 10000;
|
||||
return new boss_mothersmolderwebAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/) {}
|
||||
|
||||
void DamageTaken(Unit * /*done_by*/, uint32 &damage)
|
||||
struct boss_mothersmolderwebAI : public ScriptedAI
|
||||
{
|
||||
if (me->GetHealth() <= damage)
|
||||
DoCast(me, SPELL_SUMMON_SPIRE_SPIDERLING, true);
|
||||
}
|
||||
boss_mothersmolderwebAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 Crystalize_Timer;
|
||||
uint32 MothersMilk_Timer;
|
||||
|
||||
//Crystalize_Timer
|
||||
if (Crystalize_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me, SPELL_CRYSTALIZE);
|
||||
Crystalize_Timer = 15000;
|
||||
} else Crystalize_Timer -= diff;
|
||||
Crystalize_Timer = 20000;
|
||||
MothersMilk_Timer = 10000;
|
||||
}
|
||||
|
||||
//MothersMilk_Timer
|
||||
if (MothersMilk_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/) {}
|
||||
|
||||
void DamageTaken(Unit * /*done_by*/, uint32 &damage)
|
||||
{
|
||||
DoCast(me, SPELL_MOTHERSMILK);
|
||||
MothersMilk_Timer = urand(5000,12500);
|
||||
} else MothersMilk_Timer -= diff;
|
||||
if (me->GetHealth() <= damage)
|
||||
DoCast(me, SPELL_SUMMON_SPIRE_SPIDERLING, true);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Crystalize_Timer
|
||||
if (Crystalize_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_CRYSTALIZE);
|
||||
Crystalize_Timer = 15000;
|
||||
} else Crystalize_Timer -= diff;
|
||||
|
||||
//MothersMilk_Timer
|
||||
if (MothersMilk_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_MOTHERSMILK);
|
||||
MothersMilk_Timer = urand(5000,12500);
|
||||
} else MothersMilk_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_mothersmolderweb(Creature* pCreature)
|
||||
{
|
||||
return new boss_mothersmolderwebAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_mothersmolderweb()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_mother_smolderweb";
|
||||
newscript->GetAI = &GetAI_boss_mothersmolderweb;
|
||||
newscript->RegisterSelf();
|
||||
new boss_mother_smolderweb();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,90 +39,92 @@ EndScriptData */
|
||||
#define ADD_2Y -511.896942
|
||||
#define ADD_2Z 88.195160
|
||||
#define ADD_2O 4.613114
|
||||
|
||||
struct boss_overlordwyrmthalakAI : public ScriptedAI
|
||||
class boss_overlord_wyrmthalak : public CreatureScript
|
||||
{
|
||||
boss_overlordwyrmthalakAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_overlord_wyrmthalak() : CreatureScript("boss_overlord_wyrmthalak") { }
|
||||
|
||||
uint32 BlastWave_Timer;
|
||||
uint32 Shout_Timer;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 Knockaway_Timer;
|
||||
bool Summoned;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
BlastWave_Timer = 20000;
|
||||
Shout_Timer = 2000;
|
||||
Cleave_Timer = 6000;
|
||||
Knockaway_Timer = 12000;
|
||||
Summoned = false;
|
||||
return new boss_overlordwyrmthalakAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_overlordwyrmthalakAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_overlordwyrmthalakAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 BlastWave_Timer;
|
||||
uint32 Shout_Timer;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 Knockaway_Timer;
|
||||
bool Summoned;
|
||||
|
||||
//BlastWave_Timer
|
||||
if (BlastWave_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_BLASTWAVE);
|
||||
BlastWave_Timer = 20000;
|
||||
} else BlastWave_Timer -= diff;
|
||||
|
||||
//Shout_Timer
|
||||
if (Shout_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHOUT);
|
||||
Shout_Timer = 10000;
|
||||
} else Shout_Timer -= diff;
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 7000;
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
//Knockaway_Timer
|
||||
if (Knockaway_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_KNOCKAWAY);
|
||||
Knockaway_Timer = 14000;
|
||||
} else Knockaway_Timer -= diff;
|
||||
|
||||
//Summon two Beserks
|
||||
if (!Summoned && me->GetHealth()*100 / me->GetMaxHealth() < 51)
|
||||
{
|
||||
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0, 100, true);
|
||||
|
||||
if (Creature *SummonedCreature = me->SummonCreature(9216,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000))
|
||||
SummonedCreature->AI()->AttackStart(pTarget);
|
||||
if (Creature *SummonedCreature = me->SummonCreature(9268,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,300000))
|
||||
SummonedCreature->AI()->AttackStart(pTarget);
|
||||
Summoned = true;
|
||||
Shout_Timer = 2000;
|
||||
Cleave_Timer = 6000;
|
||||
Knockaway_Timer = 12000;
|
||||
Summoned = false;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//BlastWave_Timer
|
||||
if (BlastWave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_BLASTWAVE);
|
||||
BlastWave_Timer = 20000;
|
||||
} else BlastWave_Timer -= diff;
|
||||
|
||||
//Shout_Timer
|
||||
if (Shout_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHOUT);
|
||||
Shout_Timer = 10000;
|
||||
} else Shout_Timer -= diff;
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 7000;
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
//Knockaway_Timer
|
||||
if (Knockaway_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_KNOCKAWAY);
|
||||
Knockaway_Timer = 14000;
|
||||
} else Knockaway_Timer -= diff;
|
||||
|
||||
//Summon two Beserks
|
||||
if (!Summoned && me->GetHealth()*100 / me->GetMaxHealth() < 51)
|
||||
{
|
||||
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0, 100, true);
|
||||
|
||||
if (Creature *SummonedCreature = me->SummonCreature(9216,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000))
|
||||
SummonedCreature->AI()->AttackStart(pTarget);
|
||||
if (Creature *SummonedCreature = me->SummonCreature(9268,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,300000))
|
||||
SummonedCreature->AI()->AttackStart(pTarget);
|
||||
Summoned = true;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
CreatureAI* GetAI_boss_overlordwyrmthalak(Creature* pCreature)
|
||||
{
|
||||
return new boss_overlordwyrmthalakAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_overlordwyrmthalak()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_overlord_wyrmthalak";
|
||||
newscript->GetAI = &GetAI_boss_overlordwyrmthalak;
|
||||
newscript->RegisterSelf();
|
||||
new boss_overlord_wyrmthalak();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,68 +28,70 @@ EndScriptData */
|
||||
#define SPELL_FIRENOVA 23462
|
||||
#define SPELL_FLAMEBUFFET 23341
|
||||
#define SPELL_PYROBLAST 17274
|
||||
|
||||
struct boss_pyroguard_emberseerAI : public ScriptedAI
|
||||
class boss_pyroguard_emberseer : public CreatureScript
|
||||
{
|
||||
boss_pyroguard_emberseerAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_pyroguard_emberseer() : CreatureScript("boss_pyroguard_emberseer") { }
|
||||
|
||||
uint32 FireNova_Timer;
|
||||
uint32 FlameBuffet_Timer;
|
||||
uint32 PyroBlast_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
FireNova_Timer = 6000;
|
||||
FlameBuffet_Timer = 3000;
|
||||
PyroBlast_Timer = 14000;
|
||||
return new boss_pyroguard_emberseerAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_pyroguard_emberseerAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_pyroguard_emberseerAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 FireNova_Timer;
|
||||
uint32 FlameBuffet_Timer;
|
||||
uint32 PyroBlast_Timer;
|
||||
|
||||
//FireNova_Timer
|
||||
if (FireNova_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FIRENOVA);
|
||||
FireNova_Timer = 6000;
|
||||
} else FireNova_Timer -= diff;
|
||||
FlameBuffet_Timer = 3000;
|
||||
PyroBlast_Timer = 14000;
|
||||
}
|
||||
|
||||
//FlameBuffet_Timer
|
||||
if (FlameBuffet_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FLAMEBUFFET);
|
||||
FlameBuffet_Timer = 14000;
|
||||
} else FlameBuffet_Timer -= diff;
|
||||
}
|
||||
|
||||
//PyroBlast_Timer
|
||||
if (PyroBlast_Timer <= diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_PYROBLAST);
|
||||
PyroBlast_Timer = 15000;
|
||||
} else PyroBlast_Timer -= diff;
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//FireNova_Timer
|
||||
if (FireNova_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FIRENOVA);
|
||||
FireNova_Timer = 6000;
|
||||
} else FireNova_Timer -= diff;
|
||||
|
||||
//FlameBuffet_Timer
|
||||
if (FlameBuffet_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FLAMEBUFFET);
|
||||
FlameBuffet_Timer = 14000;
|
||||
} else FlameBuffet_Timer -= diff;
|
||||
|
||||
//PyroBlast_Timer
|
||||
if (PyroBlast_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_PYROBLAST);
|
||||
PyroBlast_Timer = 15000;
|
||||
} else PyroBlast_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_pyroguard_emberseer(Creature* pCreature)
|
||||
{
|
||||
return new boss_pyroguard_emberseerAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_pyroguard_emberseer()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_pyroguard_emberseer";
|
||||
newscript->GetAI = &GetAI_boss_pyroguard_emberseer;
|
||||
newscript->RegisterSelf();
|
||||
new boss_pyroguard_emberseer();
|
||||
}
|
||||
|
||||
|
||||
@@ -29,60 +29,62 @@ EndScriptData */
|
||||
#define SPELL_STUNBOMB 16497
|
||||
#define SPELL_HEALING_POTION 15504
|
||||
#define SPELL_HOOKEDNET 15609
|
||||
|
||||
struct boss_quatermasterzigrisAI : public ScriptedAI
|
||||
class quartermaster_zigris : public CreatureScript
|
||||
{
|
||||
boss_quatermasterzigrisAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
quartermaster_zigris() : CreatureScript("quartermaster_zigris") { }
|
||||
|
||||
uint32 Shoot_Timer;
|
||||
uint32 StunBomb_Timer;
|
||||
//uint32 HelingPotion_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
Shoot_Timer = 1000;
|
||||
StunBomb_Timer = 16000;
|
||||
//HelingPotion_Timer = 25000;
|
||||
return new boss_quatermasterzigrisAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_quatermasterzigrisAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_quatermasterzigrisAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 Shoot_Timer;
|
||||
uint32 StunBomb_Timer;
|
||||
//uint32 HelingPotion_Timer;
|
||||
|
||||
//Shoot_Timer
|
||||
if (Shoot_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHOOT);
|
||||
Shoot_Timer = 500;
|
||||
} else Shoot_Timer -= diff;
|
||||
Shoot_Timer = 1000;
|
||||
StunBomb_Timer = 16000;
|
||||
//HelingPotion_Timer = 25000;
|
||||
}
|
||||
|
||||
//StunBomb_Timer
|
||||
if (StunBomb_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_STUNBOMB);
|
||||
StunBomb_Timer = 14000;
|
||||
} else StunBomb_Timer -= diff;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Shoot_Timer
|
||||
if (Shoot_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHOOT);
|
||||
Shoot_Timer = 500;
|
||||
} else Shoot_Timer -= diff;
|
||||
|
||||
//StunBomb_Timer
|
||||
if (StunBomb_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_STUNBOMB);
|
||||
StunBomb_Timer = 14000;
|
||||
} else StunBomb_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_quatermasterzigris(Creature* pCreature)
|
||||
{
|
||||
return new boss_quatermasterzigrisAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_quatermasterzigris()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "quartermaster_zigris";
|
||||
newscript->GetAI = &GetAI_boss_quatermasterzigris;
|
||||
newscript->RegisterSelf();
|
||||
new quartermaster_zigris();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,67 +28,69 @@ EndScriptData */
|
||||
#define SPELL_WHIRLWIND 26038
|
||||
#define SPELL_CLEAVE 20691
|
||||
#define SPELL_THUNDERCLAP 23931 //Not sure if he cast this spell
|
||||
|
||||
struct boss_rend_blackhandAI : public ScriptedAI
|
||||
class boss_rend_blackhand : public CreatureScript
|
||||
{
|
||||
boss_rend_blackhandAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_rend_blackhand() : CreatureScript("boss_rend_blackhand") { }
|
||||
|
||||
uint32 WhirlWind_Timer;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 Thunderclap_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
WhirlWind_Timer = 20000;
|
||||
Cleave_Timer = 5000;
|
||||
Thunderclap_Timer = 9000;
|
||||
return new boss_rend_blackhandAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_rend_blackhandAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_rend_blackhandAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 WhirlWind_Timer;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 Thunderclap_Timer;
|
||||
|
||||
//WhirlWind_Timer
|
||||
if (WhirlWind_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WHIRLWIND);
|
||||
WhirlWind_Timer = 18000;
|
||||
} else WhirlWind_Timer -= diff;
|
||||
WhirlWind_Timer = 20000;
|
||||
Cleave_Timer = 5000;
|
||||
Thunderclap_Timer = 9000;
|
||||
}
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 10000;
|
||||
} else Cleave_Timer -= diff;
|
||||
}
|
||||
|
||||
//Thunderclap_Timer
|
||||
if (Thunderclap_Timer <= diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_THUNDERCLAP);
|
||||
Thunderclap_Timer = 16000;
|
||||
} else Thunderclap_Timer -= diff;
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//WhirlWind_Timer
|
||||
if (WhirlWind_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WHIRLWIND);
|
||||
WhirlWind_Timer = 18000;
|
||||
} else WhirlWind_Timer -= diff;
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 10000;
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
//Thunderclap_Timer
|
||||
if (Thunderclap_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_THUNDERCLAP);
|
||||
Thunderclap_Timer = 16000;
|
||||
} else Thunderclap_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_rend_blackhand(Creature* pCreature)
|
||||
{
|
||||
return new boss_rend_blackhandAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_rend_blackhand()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_rend_blackhand";
|
||||
newscript->GetAI = &GetAI_boss_rend_blackhand;
|
||||
newscript->RegisterSelf();
|
||||
new boss_rend_blackhand();
|
||||
}
|
||||
|
||||
|
||||
+50
-48
@@ -28,68 +28,70 @@ EndScriptData */
|
||||
#define SPELL_CURSEOFBLOOD 24673
|
||||
#define SPELL_HEX 16708
|
||||
#define SPELL_CLEAVE 20691
|
||||
|
||||
struct boss_shadowvoshAI : public ScriptedAI
|
||||
class boss_shadow_hunter_voshgajin : public CreatureScript
|
||||
{
|
||||
boss_shadowvoshAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_shadow_hunter_voshgajin() : CreatureScript("boss_shadow_hunter_voshgajin") { }
|
||||
|
||||
uint32 CurseOfBlood_Timer;
|
||||
uint32 Hex_Timer;
|
||||
uint32 Cleave_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
CurseOfBlood_Timer = 2000;
|
||||
Hex_Timer = 8000;
|
||||
Cleave_Timer = 14000;
|
||||
|
||||
//DoCast(me, SPELL_ICEARMOR, true);
|
||||
return new boss_shadowvoshAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/){}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
struct boss_shadowvoshAI : public ScriptedAI
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
boss_shadowvoshAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
//CurseOfBlood_Timer
|
||||
if (CurseOfBlood_Timer <= diff)
|
||||
uint32 CurseOfBlood_Timer;
|
||||
uint32 Hex_Timer;
|
||||
uint32 Cleave_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CURSEOFBLOOD);
|
||||
CurseOfBlood_Timer = 45000;
|
||||
} else CurseOfBlood_Timer -= diff;
|
||||
CurseOfBlood_Timer = 2000;
|
||||
Hex_Timer = 8000;
|
||||
Cleave_Timer = 14000;
|
||||
|
||||
//Hex_Timer
|
||||
if (Hex_Timer <= diff)
|
||||
//DoCast(me, SPELL_ICEARMOR, true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/){}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_HEX);
|
||||
Hex_Timer = 15000;
|
||||
} else Hex_Timer -= diff;
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 7000;
|
||||
} else Cleave_Timer -= diff;
|
||||
//CurseOfBlood_Timer
|
||||
if (CurseOfBlood_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CURSEOFBLOOD);
|
||||
CurseOfBlood_Timer = 45000;
|
||||
} else CurseOfBlood_Timer -= diff;
|
||||
|
||||
//Hex_Timer
|
||||
if (Hex_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_HEX);
|
||||
Hex_Timer = 15000;
|
||||
} else Hex_Timer -= diff;
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 7000;
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_shadowvosh(Creature* pCreature)
|
||||
{
|
||||
return new boss_shadowvoshAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_shadowvosh()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_shadow_hunter_voshgajin";
|
||||
newscript->GetAI = &GetAI_boss_shadowvosh;
|
||||
newscript->RegisterSelf();
|
||||
new boss_shadow_hunter_voshgajin();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,68 +28,70 @@ EndScriptData */
|
||||
#define SPELL_FLAMEBREAK 16785
|
||||
#define SPELL_IMMOLATE 20294
|
||||
#define SPELL_TERRIFYINGROAR 14100
|
||||
|
||||
struct boss_thebeastAI : public ScriptedAI
|
||||
class boss_the_beast : public CreatureScript
|
||||
{
|
||||
boss_thebeastAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_the_beast() : CreatureScript("boss_the_beast") { }
|
||||
|
||||
uint32 Flamebreak_Timer;
|
||||
uint32 Immolate_Timer;
|
||||
uint32 TerrifyingRoar_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
Flamebreak_Timer = 12000;
|
||||
Immolate_Timer = 3000;
|
||||
TerrifyingRoar_Timer = 23000;
|
||||
return new boss_thebeastAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_thebeastAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_thebeastAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 Flamebreak_Timer;
|
||||
uint32 Immolate_Timer;
|
||||
uint32 TerrifyingRoar_Timer;
|
||||
|
||||
//Flamebreak_Timer
|
||||
if (Flamebreak_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FLAMEBREAK);
|
||||
Flamebreak_Timer = 10000;
|
||||
} else Flamebreak_Timer -= diff;
|
||||
Flamebreak_Timer = 12000;
|
||||
Immolate_Timer = 3000;
|
||||
TerrifyingRoar_Timer = 23000;
|
||||
}
|
||||
|
||||
//Immolate_Timer
|
||||
if (Immolate_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_IMMOLATE);
|
||||
Immolate_Timer = 8000;
|
||||
} else Immolate_Timer -= diff;
|
||||
}
|
||||
|
||||
//TerrifyingRoar_Timer
|
||||
if (TerrifyingRoar_Timer <= diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_TERRIFYINGROAR);
|
||||
TerrifyingRoar_Timer = 20000;
|
||||
} else TerrifyingRoar_Timer -= diff;
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Flamebreak_Timer
|
||||
if (Flamebreak_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FLAMEBREAK);
|
||||
Flamebreak_Timer = 10000;
|
||||
} else Flamebreak_Timer -= diff;
|
||||
|
||||
//Immolate_Timer
|
||||
if (Immolate_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_IMMOLATE);
|
||||
Immolate_Timer = 8000;
|
||||
} else Immolate_Timer -= diff;
|
||||
|
||||
//TerrifyingRoar_Timer
|
||||
if (TerrifyingRoar_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_TERRIFYINGROAR);
|
||||
TerrifyingRoar_Timer = 20000;
|
||||
} else TerrifyingRoar_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_thebeast(Creature* pCreature)
|
||||
{
|
||||
return new boss_thebeastAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_thebeast()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_the_beast";
|
||||
newscript->GetAI = &GetAI_boss_thebeast;
|
||||
newscript->RegisterSelf();
|
||||
new boss_the_beast();
|
||||
}
|
||||
|
||||
|
||||
@@ -31,94 +31,96 @@ EndScriptData */
|
||||
#define SPELL_MORTALSTRIKE 16856
|
||||
#define SPELL_PUMMEL 15615
|
||||
#define SPELL_THROWAXE 16075
|
||||
|
||||
struct boss_warmastervooneAI : public ScriptedAI
|
||||
class boss_warmaster_voone : public CreatureScript
|
||||
{
|
||||
boss_warmastervooneAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_warmaster_voone() : CreatureScript("boss_warmaster_voone") { }
|
||||
|
||||
uint32 Snapkick_Timer;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 Uppercut_Timer;
|
||||
uint32 MortalStrike_Timer;
|
||||
uint32 Pummel_Timer;
|
||||
uint32 ThrowAxe_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
Snapkick_Timer = 8000;
|
||||
Cleave_Timer = 14000;
|
||||
Uppercut_Timer = 20000;
|
||||
MortalStrike_Timer = 12000;
|
||||
Pummel_Timer = 32000;
|
||||
ThrowAxe_Timer = 1000;
|
||||
return new boss_warmastervooneAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_warmastervooneAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_warmastervooneAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 Snapkick_Timer;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 Uppercut_Timer;
|
||||
uint32 MortalStrike_Timer;
|
||||
uint32 Pummel_Timer;
|
||||
uint32 ThrowAxe_Timer;
|
||||
|
||||
//Snapkick_Timer
|
||||
if (Snapkick_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SNAPKICK);
|
||||
Snapkick_Timer = 6000;
|
||||
} else Snapkick_Timer -= diff;
|
||||
Snapkick_Timer = 8000;
|
||||
Cleave_Timer = 14000;
|
||||
Uppercut_Timer = 20000;
|
||||
MortalStrike_Timer = 12000;
|
||||
Pummel_Timer = 32000;
|
||||
ThrowAxe_Timer = 1000;
|
||||
}
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 12000;
|
||||
} else Cleave_Timer -= diff;
|
||||
}
|
||||
|
||||
//Uppercut_Timer
|
||||
if (Uppercut_Timer <= diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_UPPERCUT);
|
||||
Uppercut_Timer = 14000;
|
||||
} else Uppercut_Timer -= diff;
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//MortalStrike_Timer
|
||||
if (MortalStrike_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_MORTALSTRIKE);
|
||||
MortalStrike_Timer = 10000;
|
||||
} else MortalStrike_Timer -= diff;
|
||||
//Snapkick_Timer
|
||||
if (Snapkick_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SNAPKICK);
|
||||
Snapkick_Timer = 6000;
|
||||
} else Snapkick_Timer -= diff;
|
||||
|
||||
//Pummel_Timer
|
||||
if (Pummel_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_PUMMEL);
|
||||
Pummel_Timer = 16000;
|
||||
} else Pummel_Timer -= diff;
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 12000;
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
//ThrowAxe_Timer
|
||||
if (ThrowAxe_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_THROWAXE);
|
||||
ThrowAxe_Timer = 8000;
|
||||
} else ThrowAxe_Timer -= diff;
|
||||
//Uppercut_Timer
|
||||
if (Uppercut_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_UPPERCUT);
|
||||
Uppercut_Timer = 14000;
|
||||
} else Uppercut_Timer -= diff;
|
||||
|
||||
//MortalStrike_Timer
|
||||
if (MortalStrike_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_MORTALSTRIKE);
|
||||
MortalStrike_Timer = 10000;
|
||||
} else MortalStrike_Timer -= diff;
|
||||
|
||||
//Pummel_Timer
|
||||
if (Pummel_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_PUMMEL);
|
||||
Pummel_Timer = 16000;
|
||||
} else Pummel_Timer -= diff;
|
||||
|
||||
//ThrowAxe_Timer
|
||||
if (ThrowAxe_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_THROWAXE);
|
||||
ThrowAxe_Timer = 8000;
|
||||
} else ThrowAxe_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_warmastervoone(Creature* pCreature)
|
||||
{
|
||||
return new boss_warmastervooneAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_warmastervoone()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_warmaster_voone";
|
||||
newscript->GetAI = &GetAI_boss_warmastervoone;
|
||||
newscript->RegisterSelf();
|
||||
new boss_warmaster_voone();
|
||||
}
|
||||
|
||||
|
||||
@@ -32,83 +32,85 @@ EndScriptData */
|
||||
#define SPELL_BLASTWAVE 23331
|
||||
#define SPELL_MORTALSTRIKE 24573
|
||||
#define SPELL_KNOCKBACK 25778
|
||||
|
||||
struct boss_broodlordAI : public ScriptedAI
|
||||
class boss_broodlord : public CreatureScript
|
||||
{
|
||||
boss_broodlordAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_broodlord() : CreatureScript("boss_broodlord") { }
|
||||
|
||||
uint32 Cleave_Timer;
|
||||
uint32 BlastWave_Timer;
|
||||
uint32 MortalStrike_Timer;
|
||||
uint32 KnockBack_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
Cleave_Timer = 8000; //These times are probably wrong
|
||||
BlastWave_Timer = 12000;
|
||||
MortalStrike_Timer = 20000;
|
||||
KnockBack_Timer = 30000;
|
||||
return new boss_broodlordAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_broodlordAI : public ScriptedAI
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
boss_broodlordAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 BlastWave_Timer;
|
||||
uint32 MortalStrike_Timer;
|
||||
uint32 KnockBack_Timer;
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 7000;
|
||||
} else Cleave_Timer -= diff;
|
||||
Cleave_Timer = 8000; //These times are probably wrong
|
||||
BlastWave_Timer = 12000;
|
||||
MortalStrike_Timer = 20000;
|
||||
KnockBack_Timer = 30000;
|
||||
}
|
||||
|
||||
// BlastWave
|
||||
if (BlastWave_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_BLASTWAVE);
|
||||
BlastWave_Timer = urand(8000,16000);
|
||||
} else BlastWave_Timer -= diff;
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
//MortalStrike_Timer
|
||||
if (MortalStrike_Timer <= diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_MORTALSTRIKE);
|
||||
MortalStrike_Timer = urand(25000,35000);
|
||||
} else MortalStrike_Timer -= diff;
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (KnockBack_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_KNOCKBACK);
|
||||
//Drop 50% aggro
|
||||
if (DoGetThreat(me->getVictim()))
|
||||
DoModifyThreatPercent(me->getVictim(),-50);
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 7000;
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
KnockBack_Timer = urand(15000,30000);
|
||||
} else KnockBack_Timer -= diff;
|
||||
// BlastWave
|
||||
if (BlastWave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_BLASTWAVE);
|
||||
BlastWave_Timer = urand(8000,16000);
|
||||
} else BlastWave_Timer -= diff;
|
||||
|
||||
if (EnterEvadeIfOutOfCombatArea(diff))
|
||||
DoScriptText(SAY_LEASH, me);
|
||||
//MortalStrike_Timer
|
||||
if (MortalStrike_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_MORTALSTRIKE);
|
||||
MortalStrike_Timer = urand(25000,35000);
|
||||
} else MortalStrike_Timer -= diff;
|
||||
|
||||
if (KnockBack_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_KNOCKBACK);
|
||||
//Drop 50% aggro
|
||||
if (DoGetThreat(me->getVictim()))
|
||||
DoModifyThreatPercent(me->getVictim(),-50);
|
||||
|
||||
KnockBack_Timer = urand(15000,30000);
|
||||
} else KnockBack_Timer -= diff;
|
||||
|
||||
if (EnterEvadeIfOutOfCombatArea(diff))
|
||||
DoScriptText(SAY_LEASH, me);
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_broodlord(Creature* pCreature)
|
||||
{
|
||||
return new boss_broodlordAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_broodlord()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_broodlord";
|
||||
newscript->GetAI = &GetAI_boss_broodlord;
|
||||
newscript->RegisterSelf();
|
||||
new boss_broodlord();
|
||||
}
|
||||
|
||||
|
||||
@@ -58,246 +58,248 @@ enum Spells
|
||||
SPELL_FRENZY = 28371, //The frenzy spell may be wrong
|
||||
SPELL_ENRAGE = 28747
|
||||
};
|
||||
|
||||
struct boss_chromaggusAI : public ScriptedAI
|
||||
class boss_chromaggus : public CreatureScript
|
||||
{
|
||||
boss_chromaggusAI(Creature *c) : ScriptedAI(c)
|
||||
public:
|
||||
boss_chromaggus() : CreatureScript("boss_chromaggus") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
//Select the 2 breaths that we are going to use until despawned
|
||||
//5 possiblities for the first breath, 4 for the second, 20 total possiblites
|
||||
//This way we don't end up casting 2 of the same breath
|
||||
//TL TL would be stupid
|
||||
switch (urand(0,19))
|
||||
{
|
||||
//B1 - Incin
|
||||
case 0:
|
||||
Breath1_Spell = SPELL_INCINERATE;
|
||||
Breath2_Spell = SPELL_TIMELAPSE;
|
||||
break;
|
||||
case 1:
|
||||
Breath1_Spell = SPELL_INCINERATE;
|
||||
Breath2_Spell = SPELL_CORROSIVEACID;
|
||||
break;
|
||||
case 2:
|
||||
Breath1_Spell = SPELL_INCINERATE;
|
||||
Breath2_Spell = SPELL_IGNITEFLESH;
|
||||
break;
|
||||
case 3:
|
||||
Breath1_Spell = SPELL_INCINERATE;
|
||||
Breath2_Spell = SPELL_FROSTBURN;
|
||||
break;
|
||||
|
||||
//B1 - TL
|
||||
case 4:
|
||||
Breath1_Spell = SPELL_TIMELAPSE;
|
||||
Breath2_Spell = SPELL_INCINERATE;
|
||||
break;
|
||||
case 5:
|
||||
Breath1_Spell = SPELL_TIMELAPSE;
|
||||
Breath2_Spell = SPELL_CORROSIVEACID;
|
||||
break;
|
||||
case 6:
|
||||
Breath1_Spell = SPELL_TIMELAPSE;
|
||||
Breath2_Spell = SPELL_IGNITEFLESH;
|
||||
break;
|
||||
case 7:
|
||||
Breath1_Spell = SPELL_TIMELAPSE;
|
||||
Breath2_Spell = SPELL_FROSTBURN;
|
||||
break;
|
||||
|
||||
//B1 - Acid
|
||||
case 8:
|
||||
Breath1_Spell = SPELL_CORROSIVEACID;
|
||||
Breath2_Spell = SPELL_INCINERATE;
|
||||
break;
|
||||
case 9:
|
||||
Breath1_Spell = SPELL_CORROSIVEACID;
|
||||
Breath2_Spell = SPELL_TIMELAPSE;
|
||||
break;
|
||||
case 10:
|
||||
Breath1_Spell = SPELL_CORROSIVEACID;
|
||||
Breath2_Spell = SPELL_IGNITEFLESH;
|
||||
break;
|
||||
case 11:
|
||||
Breath1_Spell = SPELL_CORROSIVEACID;
|
||||
Breath2_Spell = SPELL_FROSTBURN;
|
||||
break;
|
||||
|
||||
//B1 - Ignite
|
||||
case 12:
|
||||
Breath1_Spell = SPELL_IGNITEFLESH;
|
||||
Breath2_Spell = SPELL_INCINERATE;
|
||||
break;
|
||||
case 13:
|
||||
Breath1_Spell = SPELL_IGNITEFLESH;
|
||||
Breath2_Spell = SPELL_CORROSIVEACID;
|
||||
break;
|
||||
case 14:
|
||||
Breath1_Spell = SPELL_IGNITEFLESH;
|
||||
Breath2_Spell = SPELL_TIMELAPSE;
|
||||
break;
|
||||
case 15:
|
||||
Breath1_Spell = SPELL_IGNITEFLESH;
|
||||
Breath2_Spell = SPELL_FROSTBURN;
|
||||
break;
|
||||
|
||||
//B1 - Frost
|
||||
case 16:
|
||||
Breath1_Spell = SPELL_FROSTBURN;
|
||||
Breath2_Spell = SPELL_INCINERATE;
|
||||
break;
|
||||
case 17:
|
||||
Breath1_Spell = SPELL_FROSTBURN;
|
||||
Breath2_Spell = SPELL_TIMELAPSE;
|
||||
break;
|
||||
case 18:
|
||||
Breath1_Spell = SPELL_FROSTBURN;
|
||||
Breath2_Spell = SPELL_CORROSIVEACID;
|
||||
break;
|
||||
case 19:
|
||||
Breath1_Spell = SPELL_FROSTBURN;
|
||||
Breath2_Spell = SPELL_IGNITEFLESH;
|
||||
break;
|
||||
};
|
||||
|
||||
EnterEvadeMode();
|
||||
return new boss_chromaggusAI (pCreature);
|
||||
}
|
||||
|
||||
uint32 Breath1_Spell;
|
||||
uint32 Breath2_Spell;
|
||||
uint32 CurrentVurln_Spell;
|
||||
|
||||
uint32 Shimmer_Timer;
|
||||
uint32 Breath1_Timer;
|
||||
uint32 Breath2_Timer;
|
||||
uint32 Affliction_Timer;
|
||||
uint32 Frenzy_Timer;
|
||||
bool Enraged;
|
||||
|
||||
void Reset()
|
||||
struct boss_chromaggusAI : public ScriptedAI
|
||||
{
|
||||
CurrentVurln_Spell = 0; //We use this to store our last vulnerabilty spell so we can remove it later
|
||||
|
||||
Shimmer_Timer = 0; //Time till we change vurlnerabilites
|
||||
Breath1_Timer = 30000; //First breath is 30 seconds
|
||||
Breath2_Timer = 60000; //Second is 1 minute so that we can alternate
|
||||
Affliction_Timer = 10000; //This is special - 5 seconds means that we cast this on 1 player every 5 sconds
|
||||
Frenzy_Timer = 15000;
|
||||
|
||||
Enraged = false;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Shimmer_Timer Timer
|
||||
if (Shimmer_Timer <= diff)
|
||||
boss_chromaggusAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
//Remove old vulnerabilty spell
|
||||
if (CurrentVurln_Spell)
|
||||
me->RemoveAurasDueToSpell(CurrentVurln_Spell);
|
||||
|
||||
//Cast new random vulnerabilty on self
|
||||
uint32 spell = RAND(SPELL_FIRE_VULNERABILITY, SPELL_FROST_VULNERABILITY,
|
||||
SPELL_SHADOW_VULNERABILITY, SPELL_NATURE_VULNERABILITY, SPELL_ARCANE_VULNERABILITY);
|
||||
|
||||
DoCast(me, spell);
|
||||
CurrentVurln_Spell = spell;
|
||||
|
||||
DoScriptText(EMOTE_SHIMMER, me);
|
||||
Shimmer_Timer = 45000;
|
||||
} else Shimmer_Timer -= diff;
|
||||
|
||||
//Breath1_Timer
|
||||
if (Breath1_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), Breath1_Spell);
|
||||
Breath1_Timer = 60000;
|
||||
} else Breath1_Timer -= diff;
|
||||
|
||||
//Breath2_Timer
|
||||
if (Breath2_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), Breath2_Spell);
|
||||
Breath2_Timer = 60000;
|
||||
} else Breath2_Timer -= diff;
|
||||
|
||||
//Affliction_Timer
|
||||
if (Affliction_Timer <= diff)
|
||||
{
|
||||
std::list<HostileReference*> threatlist = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
//Select the 2 breaths that we are going to use until despawned
|
||||
//5 possiblities for the first breath, 4 for the second, 20 total possiblites
|
||||
//This way we don't end up casting 2 of the same breath
|
||||
//TL TL would be stupid
|
||||
switch (urand(0,19))
|
||||
{
|
||||
Unit* pUnit;
|
||||
if ((*i) && (*i)->getSource())
|
||||
//B1 - Incin
|
||||
case 0:
|
||||
Breath1_Spell = SPELL_INCINERATE;
|
||||
Breath2_Spell = SPELL_TIMELAPSE;
|
||||
break;
|
||||
case 1:
|
||||
Breath1_Spell = SPELL_INCINERATE;
|
||||
Breath2_Spell = SPELL_CORROSIVEACID;
|
||||
break;
|
||||
case 2:
|
||||
Breath1_Spell = SPELL_INCINERATE;
|
||||
Breath2_Spell = SPELL_IGNITEFLESH;
|
||||
break;
|
||||
case 3:
|
||||
Breath1_Spell = SPELL_INCINERATE;
|
||||
Breath2_Spell = SPELL_FROSTBURN;
|
||||
break;
|
||||
|
||||
//B1 - TL
|
||||
case 4:
|
||||
Breath1_Spell = SPELL_TIMELAPSE;
|
||||
Breath2_Spell = SPELL_INCINERATE;
|
||||
break;
|
||||
case 5:
|
||||
Breath1_Spell = SPELL_TIMELAPSE;
|
||||
Breath2_Spell = SPELL_CORROSIVEACID;
|
||||
break;
|
||||
case 6:
|
||||
Breath1_Spell = SPELL_TIMELAPSE;
|
||||
Breath2_Spell = SPELL_IGNITEFLESH;
|
||||
break;
|
||||
case 7:
|
||||
Breath1_Spell = SPELL_TIMELAPSE;
|
||||
Breath2_Spell = SPELL_FROSTBURN;
|
||||
break;
|
||||
|
||||
//B1 - Acid
|
||||
case 8:
|
||||
Breath1_Spell = SPELL_CORROSIVEACID;
|
||||
Breath2_Spell = SPELL_INCINERATE;
|
||||
break;
|
||||
case 9:
|
||||
Breath1_Spell = SPELL_CORROSIVEACID;
|
||||
Breath2_Spell = SPELL_TIMELAPSE;
|
||||
break;
|
||||
case 10:
|
||||
Breath1_Spell = SPELL_CORROSIVEACID;
|
||||
Breath2_Spell = SPELL_IGNITEFLESH;
|
||||
break;
|
||||
case 11:
|
||||
Breath1_Spell = SPELL_CORROSIVEACID;
|
||||
Breath2_Spell = SPELL_FROSTBURN;
|
||||
break;
|
||||
|
||||
//B1 - Ignite
|
||||
case 12:
|
||||
Breath1_Spell = SPELL_IGNITEFLESH;
|
||||
Breath2_Spell = SPELL_INCINERATE;
|
||||
break;
|
||||
case 13:
|
||||
Breath1_Spell = SPELL_IGNITEFLESH;
|
||||
Breath2_Spell = SPELL_CORROSIVEACID;
|
||||
break;
|
||||
case 14:
|
||||
Breath1_Spell = SPELL_IGNITEFLESH;
|
||||
Breath2_Spell = SPELL_TIMELAPSE;
|
||||
break;
|
||||
case 15:
|
||||
Breath1_Spell = SPELL_IGNITEFLESH;
|
||||
Breath2_Spell = SPELL_FROSTBURN;
|
||||
break;
|
||||
|
||||
//B1 - Frost
|
||||
case 16:
|
||||
Breath1_Spell = SPELL_FROSTBURN;
|
||||
Breath2_Spell = SPELL_INCINERATE;
|
||||
break;
|
||||
case 17:
|
||||
Breath1_Spell = SPELL_FROSTBURN;
|
||||
Breath2_Spell = SPELL_TIMELAPSE;
|
||||
break;
|
||||
case 18:
|
||||
Breath1_Spell = SPELL_FROSTBURN;
|
||||
Breath2_Spell = SPELL_CORROSIVEACID;
|
||||
break;
|
||||
case 19:
|
||||
Breath1_Spell = SPELL_FROSTBURN;
|
||||
Breath2_Spell = SPELL_IGNITEFLESH;
|
||||
break;
|
||||
};
|
||||
|
||||
EnterEvadeMode();
|
||||
}
|
||||
|
||||
uint32 Breath1_Spell;
|
||||
uint32 Breath2_Spell;
|
||||
uint32 CurrentVurln_Spell;
|
||||
|
||||
uint32 Shimmer_Timer;
|
||||
uint32 Breath1_Timer;
|
||||
uint32 Breath2_Timer;
|
||||
uint32 Affliction_Timer;
|
||||
uint32 Frenzy_Timer;
|
||||
bool Enraged;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
CurrentVurln_Spell = 0; //We use this to store our last vulnerabilty spell so we can remove it later
|
||||
|
||||
Shimmer_Timer = 0; //Time till we change vurlnerabilites
|
||||
Breath1_Timer = 30000; //First breath is 30 seconds
|
||||
Breath2_Timer = 60000; //Second is 1 minute so that we can alternate
|
||||
Affliction_Timer = 10000; //This is special - 5 seconds means that we cast this on 1 player every 5 sconds
|
||||
Frenzy_Timer = 15000;
|
||||
|
||||
Enraged = false;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Shimmer_Timer Timer
|
||||
if (Shimmer_Timer <= diff)
|
||||
{
|
||||
//Remove old vulnerabilty spell
|
||||
if (CurrentVurln_Spell)
|
||||
me->RemoveAurasDueToSpell(CurrentVurln_Spell);
|
||||
|
||||
//Cast new random vulnerabilty on self
|
||||
uint32 spell = RAND(SPELL_FIRE_VULNERABILITY, SPELL_FROST_VULNERABILITY,
|
||||
SPELL_SHADOW_VULNERABILITY, SPELL_NATURE_VULNERABILITY, SPELL_ARCANE_VULNERABILITY);
|
||||
|
||||
DoCast(me, spell);
|
||||
CurrentVurln_Spell = spell;
|
||||
|
||||
DoScriptText(EMOTE_SHIMMER, me);
|
||||
Shimmer_Timer = 45000;
|
||||
} else Shimmer_Timer -= diff;
|
||||
|
||||
//Breath1_Timer
|
||||
if (Breath1_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), Breath1_Spell);
|
||||
Breath1_Timer = 60000;
|
||||
} else Breath1_Timer -= diff;
|
||||
|
||||
//Breath2_Timer
|
||||
if (Breath2_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), Breath2_Spell);
|
||||
Breath2_Timer = 60000;
|
||||
} else Breath2_Timer -= diff;
|
||||
|
||||
//Affliction_Timer
|
||||
if (Affliction_Timer <= diff)
|
||||
{
|
||||
std::list<HostileReference*> threatlist = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
{
|
||||
pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
|
||||
if (pUnit)
|
||||
Unit* pUnit;
|
||||
if ((*i) && (*i)->getSource())
|
||||
{
|
||||
//Cast affliction
|
||||
DoCast(pUnit, RAND(SPELL_BROODAF_BLUE, SPELL_BROODAF_BLACK,
|
||||
SPELL_BROODAF_RED, SPELL_BROODAF_BRONZE, SPELL_BROODAF_GREEN), true);
|
||||
|
||||
//Chromatic mutation if target is effected by all afflictions
|
||||
if (pUnit->HasAura(SPELL_BROODAF_BLUE)
|
||||
&& pUnit->HasAura(SPELL_BROODAF_BLACK)
|
||||
&& pUnit->HasAura(SPELL_BROODAF_RED)
|
||||
&& pUnit->HasAura(SPELL_BROODAF_BRONZE)
|
||||
&& pUnit->HasAura(SPELL_BROODAF_GREEN))
|
||||
pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
|
||||
if (pUnit)
|
||||
{
|
||||
//pTarget->RemoveAllAuras();
|
||||
//DoCast(pTarget, SPELL_CHROMATIC_MUT_1);
|
||||
//Cast affliction
|
||||
DoCast(pUnit, RAND(SPELL_BROODAF_BLUE, SPELL_BROODAF_BLACK,
|
||||
SPELL_BROODAF_RED, SPELL_BROODAF_BRONZE, SPELL_BROODAF_GREEN), true);
|
||||
|
||||
//Chromatic mutation is causing issues
|
||||
//Assuming it is caused by a lack of core support for Charm
|
||||
//So instead we instant kill our target
|
||||
//Chromatic mutation if target is effected by all afflictions
|
||||
if (pUnit->HasAura(SPELL_BROODAF_BLUE)
|
||||
&& pUnit->HasAura(SPELL_BROODAF_BLACK)
|
||||
&& pUnit->HasAura(SPELL_BROODAF_RED)
|
||||
&& pUnit->HasAura(SPELL_BROODAF_BRONZE)
|
||||
&& pUnit->HasAura(SPELL_BROODAF_GREEN))
|
||||
{
|
||||
//pTarget->RemoveAllAuras();
|
||||
//DoCast(pTarget, SPELL_CHROMATIC_MUT_1);
|
||||
|
||||
//WORKAROUND
|
||||
if (pUnit->GetTypeId() == TYPEID_PLAYER)
|
||||
pUnit->CastSpell(pUnit, 5, false);
|
||||
//Chromatic mutation is causing issues
|
||||
//Assuming it is caused by a lack of core support for Charm
|
||||
//So instead we instant kill our target
|
||||
|
||||
//WORKAROUND
|
||||
if (pUnit->GetTypeId() == TYPEID_PLAYER)
|
||||
pUnit->CastSpell(pUnit, 5, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Affliction_Timer = 10000;
|
||||
} else Affliction_Timer -= diff;
|
||||
|
||||
//Frenzy_Timer
|
||||
if (Frenzy_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
DoScriptText(EMOTE_FRENZY, me);
|
||||
Frenzy_Timer = urand(10000,15000);
|
||||
} else Frenzy_Timer -= diff;
|
||||
|
||||
//Enrage if not already enraged and below 20%
|
||||
if (!Enraged && (me->GetHealth()*100 / me->GetMaxHealth()) < 20)
|
||||
{
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
Enraged = true;
|
||||
}
|
||||
|
||||
Affliction_Timer = 10000;
|
||||
} else Affliction_Timer -= diff;
|
||||
|
||||
//Frenzy_Timer
|
||||
if (Frenzy_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
DoScriptText(EMOTE_FRENZY, me);
|
||||
Frenzy_Timer = urand(10000,15000);
|
||||
} else Frenzy_Timer -= diff;
|
||||
|
||||
//Enrage if not already enraged and below 20%
|
||||
if (!Enraged && (me->GetHealth()*100 / me->GetMaxHealth()) < 20)
|
||||
{
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
Enraged = true;
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_chromaggus(Creature* pCreature)
|
||||
{
|
||||
return new boss_chromaggusAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_chromaggus()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_chromaggus";
|
||||
newscript->GetAI = &GetAI_boss_chromaggus;
|
||||
newscript->RegisterSelf();
|
||||
new boss_chromaggus();
|
||||
}
|
||||
|
||||
|
||||
@@ -29,78 +29,80 @@ EndScriptData */
|
||||
#define SPELL_WINGBUFFET 18500
|
||||
#define SPELL_SHADOWOFEBONROC 23340
|
||||
#define SPELL_HEAL 41386 //Thea Heal spell of his Shadow
|
||||
|
||||
struct boss_ebonrocAI : public ScriptedAI
|
||||
class boss_ebonroc : public CreatureScript
|
||||
{
|
||||
boss_ebonrocAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_ebonroc() : CreatureScript("boss_ebonroc") { }
|
||||
|
||||
uint32 ShadowFlame_Timer;
|
||||
uint32 WingBuffet_Timer;
|
||||
uint32 ShadowOfEbonroc_Timer;
|
||||
uint32 Heal_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
ShadowFlame_Timer = 15000; //These times are probably wrong
|
||||
WingBuffet_Timer = 30000;
|
||||
ShadowOfEbonroc_Timer = 45000;
|
||||
Heal_Timer = 1000;
|
||||
return new boss_ebonrocAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_ebonrocAI : public ScriptedAI
|
||||
{
|
||||
DoZoneInCombat();
|
||||
}
|
||||
boss_ebonrocAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 ShadowFlame_Timer;
|
||||
uint32 WingBuffet_Timer;
|
||||
uint32 ShadowOfEbonroc_Timer;
|
||||
uint32 Heal_Timer;
|
||||
|
||||
//Shadowflame Timer
|
||||
if (ShadowFlame_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWFLAME);
|
||||
ShadowFlame_Timer = urand(12000,15000);
|
||||
} else ShadowFlame_Timer -= diff;
|
||||
|
||||
//Wing Buffet Timer
|
||||
if (WingBuffet_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WINGBUFFET);
|
||||
WingBuffet_Timer = 25000;
|
||||
} else WingBuffet_Timer -= diff;
|
||||
|
||||
//Shadow of Ebonroc Timer
|
||||
if (ShadowOfEbonroc_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWOFEBONROC);
|
||||
ShadowOfEbonroc_Timer = urand(25000,350000);
|
||||
} else ShadowOfEbonroc_Timer -= diff;
|
||||
|
||||
if (me->getVictim()->HasAura(SPELL_SHADOWOFEBONROC))
|
||||
{
|
||||
if (Heal_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_HEAL);
|
||||
Heal_Timer = urand(1000,3000);
|
||||
} else Heal_Timer -= diff;
|
||||
ShadowFlame_Timer = 15000; //These times are probably wrong
|
||||
WingBuffet_Timer = 30000;
|
||||
ShadowOfEbonroc_Timer = 45000;
|
||||
Heal_Timer = 1000;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Shadowflame Timer
|
||||
if (ShadowFlame_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWFLAME);
|
||||
ShadowFlame_Timer = urand(12000,15000);
|
||||
} else ShadowFlame_Timer -= diff;
|
||||
|
||||
//Wing Buffet Timer
|
||||
if (WingBuffet_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WINGBUFFET);
|
||||
WingBuffet_Timer = 25000;
|
||||
} else WingBuffet_Timer -= diff;
|
||||
|
||||
//Shadow of Ebonroc Timer
|
||||
if (ShadowOfEbonroc_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWOFEBONROC);
|
||||
ShadowOfEbonroc_Timer = urand(25000,350000);
|
||||
} else ShadowOfEbonroc_Timer -= diff;
|
||||
|
||||
if (me->getVictim()->HasAura(SPELL_SHADOWOFEBONROC))
|
||||
{
|
||||
if (Heal_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_HEAL);
|
||||
Heal_Timer = urand(1000,3000);
|
||||
} else Heal_Timer -= diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
CreatureAI* GetAI_boss_ebonroc(Creature* pCreature)
|
||||
{
|
||||
return new boss_ebonrocAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_ebonroc()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_ebonroc";
|
||||
newscript->GetAI = &GetAI_boss_ebonroc;
|
||||
newscript->RegisterSelf();
|
||||
new boss_ebonroc();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,70 +28,72 @@ EndScriptData */
|
||||
#define SPELL_SHADOWFLAME 22539
|
||||
#define SPELL_WINGBUFFET 23339
|
||||
#define SPELL_FLAMEBUFFET 23341
|
||||
|
||||
struct boss_firemawAI : public ScriptedAI
|
||||
class boss_firemaw : public CreatureScript
|
||||
{
|
||||
boss_firemawAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_firemaw() : CreatureScript("boss_firemaw") { }
|
||||
|
||||
uint32 ShadowFlame_Timer;
|
||||
uint32 WingBuffet_Timer;
|
||||
uint32 FlameBuffet_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
ShadowFlame_Timer = 30000; //These times are probably wrong
|
||||
WingBuffet_Timer = 24000;
|
||||
FlameBuffet_Timer = 5000;
|
||||
return new boss_firemawAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_firemawAI : public ScriptedAI
|
||||
{
|
||||
DoZoneInCombat();
|
||||
}
|
||||
boss_firemawAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 ShadowFlame_Timer;
|
||||
uint32 WingBuffet_Timer;
|
||||
uint32 FlameBuffet_Timer;
|
||||
|
||||
//ShadowFlame_Timer
|
||||
if (ShadowFlame_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWFLAME);
|
||||
ShadowFlame_Timer = urand(15000,18000);
|
||||
} else ShadowFlame_Timer -= diff;
|
||||
|
||||
//WingBuffet_Timer
|
||||
if (WingBuffet_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WINGBUFFET);
|
||||
if (DoGetThreat(me->getVictim()))
|
||||
DoModifyThreatPercent(me->getVictim(),-75);
|
||||
|
||||
WingBuffet_Timer = 25000;
|
||||
} else WingBuffet_Timer -= diff;
|
||||
|
||||
//FlameBuffet_Timer
|
||||
if (FlameBuffet_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FLAMEBUFFET);
|
||||
ShadowFlame_Timer = 30000; //These times are probably wrong
|
||||
WingBuffet_Timer = 24000;
|
||||
FlameBuffet_Timer = 5000;
|
||||
} else FlameBuffet_Timer -= diff;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//ShadowFlame_Timer
|
||||
if (ShadowFlame_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWFLAME);
|
||||
ShadowFlame_Timer = urand(15000,18000);
|
||||
} else ShadowFlame_Timer -= diff;
|
||||
|
||||
//WingBuffet_Timer
|
||||
if (WingBuffet_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WINGBUFFET);
|
||||
if (DoGetThreat(me->getVictim()))
|
||||
DoModifyThreatPercent(me->getVictim(),-75);
|
||||
|
||||
WingBuffet_Timer = 25000;
|
||||
} else WingBuffet_Timer -= diff;
|
||||
|
||||
//FlameBuffet_Timer
|
||||
if (FlameBuffet_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FLAMEBUFFET);
|
||||
FlameBuffet_Timer = 5000;
|
||||
} else FlameBuffet_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_firemaw(Creature* pCreature)
|
||||
{
|
||||
return new boss_firemawAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_firemaw()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_firemaw";
|
||||
newscript->GetAI = &GetAI_boss_firemaw;
|
||||
newscript->RegisterSelf();
|
||||
new boss_firemaw();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,71 +30,73 @@ EndScriptData */
|
||||
#define SPELL_SHADOWFLAME 22539
|
||||
#define SPELL_WINGBUFFET 23339
|
||||
#define SPELL_FRENZY 23342 //This spell periodically triggers fire nova
|
||||
|
||||
struct boss_flamegorAI : public ScriptedAI
|
||||
class boss_flamegor : public CreatureScript
|
||||
{
|
||||
boss_flamegorAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_flamegor() : CreatureScript("boss_flamegor") { }
|
||||
|
||||
uint32 ShadowFlame_Timer;
|
||||
uint32 WingBuffet_Timer;
|
||||
uint32 Frenzy_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
ShadowFlame_Timer = 21000; //These times are probably wrong
|
||||
WingBuffet_Timer = 35000;
|
||||
Frenzy_Timer = 10000;
|
||||
return new boss_flamegorAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_flamegorAI : public ScriptedAI
|
||||
{
|
||||
DoZoneInCombat();
|
||||
}
|
||||
boss_flamegorAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 ShadowFlame_Timer;
|
||||
uint32 WingBuffet_Timer;
|
||||
uint32 Frenzy_Timer;
|
||||
|
||||
//ShadowFlame_Timer
|
||||
if (ShadowFlame_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWFLAME);
|
||||
ShadowFlame_Timer = 15000 + rand()%7000;
|
||||
} else ShadowFlame_Timer -= diff;
|
||||
ShadowFlame_Timer = 21000; //These times are probably wrong
|
||||
WingBuffet_Timer = 35000;
|
||||
Frenzy_Timer = 10000;
|
||||
}
|
||||
|
||||
//WingBuffet_Timer
|
||||
if (WingBuffet_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WINGBUFFET);
|
||||
if (DoGetThreat(me->getVictim()))
|
||||
DoModifyThreatPercent(me->getVictim(),-75);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
WingBuffet_Timer = 25000;
|
||||
} else WingBuffet_Timer -= diff;
|
||||
|
||||
//Frenzy_Timer
|
||||
if (Frenzy_Timer <= diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
DoScriptText(EMOTE_FRENZY, me);
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
Frenzy_Timer = urand(8000, 10000);
|
||||
} else Frenzy_Timer -= diff;
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//ShadowFlame_Timer
|
||||
if (ShadowFlame_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWFLAME);
|
||||
ShadowFlame_Timer = 15000 + rand()%7000;
|
||||
} else ShadowFlame_Timer -= diff;
|
||||
|
||||
//WingBuffet_Timer
|
||||
if (WingBuffet_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WINGBUFFET);
|
||||
if (DoGetThreat(me->getVictim()))
|
||||
DoModifyThreatPercent(me->getVictim(),-75);
|
||||
|
||||
WingBuffet_Timer = 25000;
|
||||
} else WingBuffet_Timer -= diff;
|
||||
|
||||
//Frenzy_Timer
|
||||
if (Frenzy_Timer <= diff)
|
||||
{
|
||||
DoScriptText(EMOTE_FRENZY, me);
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
Frenzy_Timer = urand(8000, 10000);
|
||||
} else Frenzy_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_flamegor(Creature* pCreature)
|
||||
{
|
||||
return new boss_flamegorAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_flamegor()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_flamegor";
|
||||
newscript->GetAI = &GetAI_boss_flamegor;
|
||||
newscript->RegisterSelf();
|
||||
new boss_flamegor();
|
||||
}
|
||||
|
||||
|
||||
@@ -59,175 +59,177 @@ EndScriptData */
|
||||
#define SPELL_WARLOCK 23427 //infernals
|
||||
#define SPELL_HUNTER 23436 //bow broke
|
||||
#define SPELL_ROGUE 23414 //Paralise
|
||||
|
||||
struct boss_nefarianAI : public ScriptedAI
|
||||
class boss_nefarian : public CreatureScript
|
||||
{
|
||||
boss_nefarianAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_nefarian() : CreatureScript("boss_nefarian") { }
|
||||
|
||||
uint32 ShadowFlame_Timer;
|
||||
uint32 BellowingRoar_Timer;
|
||||
uint32 VeilOfShadow_Timer;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 TailLash_Timer;
|
||||
uint32 ClassCall_Timer;
|
||||
bool Phase3;
|
||||
|
||||
uint32 DespawnTimer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
ShadowFlame_Timer = 12000; //These times are probably wrong
|
||||
BellowingRoar_Timer = 30000;
|
||||
VeilOfShadow_Timer = 15000;
|
||||
Cleave_Timer = 7000;
|
||||
TailLash_Timer = 10000;
|
||||
ClassCall_Timer = 35000; //35-40 seconds
|
||||
Phase3 = false;
|
||||
|
||||
DespawnTimer = 5000;
|
||||
return new boss_nefarianAI (pCreature);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* Victim)
|
||||
struct boss_nefarianAI : public ScriptedAI
|
||||
{
|
||||
if (rand()%5)
|
||||
return;
|
||||
boss_nefarianAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
DoScriptText(SAY_SLAY, me, Victim);
|
||||
}
|
||||
uint32 ShadowFlame_Timer;
|
||||
uint32 BellowingRoar_Timer;
|
||||
uint32 VeilOfShadow_Timer;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 TailLash_Timer;
|
||||
uint32 ClassCall_Timer;
|
||||
bool Phase3;
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
}
|
||||
uint32 DespawnTimer;
|
||||
|
||||
void EnterCombat(Unit * who)
|
||||
{
|
||||
DoScriptText(RAND(SAY_XHEALTH,SAY_AGGRO,SAY_SHADOWFLAME), me);
|
||||
|
||||
DoCast(who, SPELL_SHADOWFLAME_INITIAL);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (DespawnTimer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
me->ForcedDespawn();
|
||||
DespawnTimer = 5000;
|
||||
} else DespawnTimer -= diff;
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//ShadowFlame_Timer
|
||||
if (ShadowFlame_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWFLAME);
|
||||
ShadowFlame_Timer = 12000;
|
||||
} else ShadowFlame_Timer -= diff;
|
||||
|
||||
//BellowingRoar_Timer
|
||||
if (BellowingRoar_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_BELLOWINGROAR);
|
||||
ShadowFlame_Timer = 12000; //These times are probably wrong
|
||||
BellowingRoar_Timer = 30000;
|
||||
} else BellowingRoar_Timer -= diff;
|
||||
|
||||
//VeilOfShadow_Timer
|
||||
if (VeilOfShadow_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_VEILOFSHADOW);
|
||||
VeilOfShadow_Timer = 15000;
|
||||
} else VeilOfShadow_Timer -= diff;
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 7000;
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
//TailLash_Timer
|
||||
if (TailLash_Timer <= diff)
|
||||
{
|
||||
//Cast NYI since we need a better check for behind target
|
||||
//DoCast(me->getVictim(), SPELL_TAILLASH);
|
||||
|
||||
TailLash_Timer = 10000;
|
||||
} else TailLash_Timer -= diff;
|
||||
ClassCall_Timer = 35000; //35-40 seconds
|
||||
Phase3 = false;
|
||||
|
||||
//ClassCall_Timer
|
||||
if (ClassCall_Timer <= diff)
|
||||
{
|
||||
//Cast a random class call
|
||||
//On official it is based on what classes are currently on the hostil list
|
||||
//but we can't do that yet so just randomly call one
|
||||
|
||||
switch (urand(0,8))
|
||||
{
|
||||
case 0:
|
||||
DoScriptText(SAY_MAGE, me);
|
||||
DoCast(me, SPELL_MAGE);
|
||||
break;
|
||||
case 1:
|
||||
DoScriptText(SAY_WARRIOR, me);
|
||||
DoCast(me, SPELL_WARRIOR);
|
||||
break;
|
||||
case 2:
|
||||
DoScriptText(SAY_DRUID, me);
|
||||
DoCast(me, SPELL_DRUID);
|
||||
break;
|
||||
case 3:
|
||||
DoScriptText(SAY_PRIEST, me);
|
||||
DoCast(me, SPELL_PRIEST);
|
||||
break;
|
||||
case 4:
|
||||
DoScriptText(SAY_PALADIN, me);
|
||||
DoCast(me, SPELL_PALADIN);
|
||||
break;
|
||||
case 5:
|
||||
DoScriptText(SAY_SHAMAN, me);
|
||||
DoCast(me, SPELL_SHAMAN);
|
||||
break;
|
||||
case 6:
|
||||
DoScriptText(SAY_WARLOCK, me);
|
||||
DoCast(me, SPELL_WARLOCK);
|
||||
break;
|
||||
case 7:
|
||||
DoScriptText(SAY_HUNTER, me);
|
||||
DoCast(me, SPELL_HUNTER);
|
||||
break;
|
||||
case 8:
|
||||
DoScriptText(SAY_ROGUE, me);
|
||||
DoCast(me, SPELL_ROGUE);
|
||||
break;
|
||||
}
|
||||
|
||||
ClassCall_Timer = 35000 + (rand() % 5000);
|
||||
} else ClassCall_Timer -= diff;
|
||||
|
||||
//Phase3 begins when we are below X health
|
||||
if (!Phase3 && (me->GetHealth()*100 / me->GetMaxHealth()) < 20)
|
||||
{
|
||||
Phase3 = true;
|
||||
DoScriptText(SAY_RAISE_SKELETONS, me);
|
||||
DespawnTimer = 5000;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void KilledUnit(Unit* Victim)
|
||||
{
|
||||
if (rand()%5)
|
||||
return;
|
||||
|
||||
DoScriptText(SAY_SLAY, me, Victim);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * who)
|
||||
{
|
||||
DoScriptText(RAND(SAY_XHEALTH,SAY_AGGRO,SAY_SHADOWFLAME), me);
|
||||
|
||||
DoCast(who, SPELL_SHADOWFLAME_INITIAL);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (DespawnTimer <= diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
me->ForcedDespawn();
|
||||
DespawnTimer = 5000;
|
||||
} else DespawnTimer -= diff;
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//ShadowFlame_Timer
|
||||
if (ShadowFlame_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWFLAME);
|
||||
ShadowFlame_Timer = 12000;
|
||||
} else ShadowFlame_Timer -= diff;
|
||||
|
||||
//BellowingRoar_Timer
|
||||
if (BellowingRoar_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_BELLOWINGROAR);
|
||||
BellowingRoar_Timer = 30000;
|
||||
} else BellowingRoar_Timer -= diff;
|
||||
|
||||
//VeilOfShadow_Timer
|
||||
if (VeilOfShadow_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_VEILOFSHADOW);
|
||||
VeilOfShadow_Timer = 15000;
|
||||
} else VeilOfShadow_Timer -= diff;
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 7000;
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
//TailLash_Timer
|
||||
if (TailLash_Timer <= diff)
|
||||
{
|
||||
//Cast NYI since we need a better check for behind target
|
||||
//DoCast(me->getVictim(), SPELL_TAILLASH);
|
||||
|
||||
TailLash_Timer = 10000;
|
||||
} else TailLash_Timer -= diff;
|
||||
|
||||
//ClassCall_Timer
|
||||
if (ClassCall_Timer <= diff)
|
||||
{
|
||||
//Cast a random class call
|
||||
//On official it is based on what classes are currently on the hostil list
|
||||
//but we can't do that yet so just randomly call one
|
||||
|
||||
switch (urand(0,8))
|
||||
{
|
||||
case 0:
|
||||
DoScriptText(SAY_MAGE, me);
|
||||
DoCast(me, SPELL_MAGE);
|
||||
break;
|
||||
case 1:
|
||||
DoScriptText(SAY_WARRIOR, me);
|
||||
DoCast(me, SPELL_WARRIOR);
|
||||
break;
|
||||
case 2:
|
||||
DoScriptText(SAY_DRUID, me);
|
||||
DoCast(me, SPELL_DRUID);
|
||||
break;
|
||||
case 3:
|
||||
DoScriptText(SAY_PRIEST, me);
|
||||
DoCast(me, SPELL_PRIEST);
|
||||
break;
|
||||
case 4:
|
||||
DoScriptText(SAY_PALADIN, me);
|
||||
DoCast(me, SPELL_PALADIN);
|
||||
break;
|
||||
case 5:
|
||||
DoScriptText(SAY_SHAMAN, me);
|
||||
DoCast(me, SPELL_SHAMAN);
|
||||
break;
|
||||
case 6:
|
||||
DoScriptText(SAY_WARLOCK, me);
|
||||
DoCast(me, SPELL_WARLOCK);
|
||||
break;
|
||||
case 7:
|
||||
DoScriptText(SAY_HUNTER, me);
|
||||
DoCast(me, SPELL_HUNTER);
|
||||
break;
|
||||
case 8:
|
||||
DoScriptText(SAY_ROGUE, me);
|
||||
DoCast(me, SPELL_ROGUE);
|
||||
break;
|
||||
}
|
||||
|
||||
ClassCall_Timer = 35000 + (rand() % 5000);
|
||||
} else ClassCall_Timer -= diff;
|
||||
|
||||
//Phase3 begins when we are below X health
|
||||
if (!Phase3 && (me->GetHealth()*100 / me->GetMaxHealth()) < 20)
|
||||
{
|
||||
Phase3 = true;
|
||||
DoScriptText(SAY_RAISE_SKELETONS, me);
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
CreatureAI* GetAI_boss_nefarian(Creature* pCreature)
|
||||
{
|
||||
return new boss_nefarianAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_nefarian()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_nefarian";
|
||||
newscript->GetAI = &GetAI_boss_nefarian;
|
||||
newscript->RegisterSelf();
|
||||
new boss_nefarian();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,92 +36,94 @@ EndScriptData */
|
||||
#define SPELL_WARSTOMP 24375
|
||||
#define SPELL_FIREBALLVOLLEY 22425
|
||||
#define SPELL_CONFLAGRATION 23023
|
||||
|
||||
struct boss_razorgoreAI : public ScriptedAI
|
||||
class boss_razorgore : public CreatureScript
|
||||
{
|
||||
boss_razorgoreAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_razorgore() : CreatureScript("boss_razorgore") { }
|
||||
|
||||
uint32 Cleave_Timer;
|
||||
uint32 WarStomp_Timer;
|
||||
uint32 FireballVolley_Timer;
|
||||
uint32 Conflagration_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
Cleave_Timer = 15000; //These times are probably wrong
|
||||
WarStomp_Timer = 35000;
|
||||
FireballVolley_Timer = 7000;
|
||||
Conflagration_Timer = 12000;
|
||||
return new boss_razorgoreAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_razorgoreAI : public ScriptedAI
|
||||
{
|
||||
DoZoneInCombat();
|
||||
}
|
||||
boss_razorgoreAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
}
|
||||
uint32 Cleave_Timer;
|
||||
uint32 WarStomp_Timer;
|
||||
uint32 FireballVolley_Timer;
|
||||
uint32 Conflagration_Timer;
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = urand(7000,10000);
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
//WarStomp_Timer
|
||||
if (WarStomp_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WARSTOMP);
|
||||
WarStomp_Timer = urand(15000,25000);
|
||||
} else WarStomp_Timer -= diff;
|
||||
|
||||
//FireballVolley_Timer
|
||||
if (FireballVolley_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FIREBALLVOLLEY);
|
||||
FireballVolley_Timer = urand(12000,15000);
|
||||
} else FireballVolley_Timer -= diff;
|
||||
|
||||
//Conflagration_Timer
|
||||
if (Conflagration_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CONFLAGRATION);
|
||||
//We will remove this threat reduction and add an aura check.
|
||||
|
||||
//if (DoGetThreat(me->getVictim()))
|
||||
//DoModifyThreatPercent(me->getVictim(),-50);
|
||||
|
||||
Cleave_Timer = 15000; //These times are probably wrong
|
||||
WarStomp_Timer = 35000;
|
||||
FireballVolley_Timer = 7000;
|
||||
Conflagration_Timer = 12000;
|
||||
} else Conflagration_Timer -= diff;
|
||||
}
|
||||
|
||||
// Aura Check. If the gamer is affected by confliguration we attack a random gamer.
|
||||
if (me->getVictim() && me->getVictim()->HasAura(SPELL_CONFLAGRATION))
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
|
||||
me->TauntApply(pTarget);
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = urand(7000,10000);
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
//WarStomp_Timer
|
||||
if (WarStomp_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WARSTOMP);
|
||||
WarStomp_Timer = urand(15000,25000);
|
||||
} else WarStomp_Timer -= diff;
|
||||
|
||||
//FireballVolley_Timer
|
||||
if (FireballVolley_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FIREBALLVOLLEY);
|
||||
FireballVolley_Timer = urand(12000,15000);
|
||||
} else FireballVolley_Timer -= diff;
|
||||
|
||||
//Conflagration_Timer
|
||||
if (Conflagration_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CONFLAGRATION);
|
||||
//We will remove this threat reduction and add an aura check.
|
||||
|
||||
//if (DoGetThreat(me->getVictim()))
|
||||
//DoModifyThreatPercent(me->getVictim(),-50);
|
||||
|
||||
Conflagration_Timer = 12000;
|
||||
} else Conflagration_Timer -= diff;
|
||||
|
||||
// Aura Check. If the gamer is affected by confliguration we attack a random gamer.
|
||||
if (me->getVictim() && me->getVictim()->HasAura(SPELL_CONFLAGRATION))
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
|
||||
me->TauntApply(pTarget);
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_razorgore(Creature* pCreature)
|
||||
{
|
||||
return new boss_razorgoreAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_razorgore()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_razorgore";
|
||||
newscript->GetAI = &GetAI_boss_razorgore;
|
||||
newscript->RegisterSelf();
|
||||
new boss_razorgore();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,226 +39,225 @@ EndScriptData */
|
||||
#define SPELL_TAILSWIPE 15847
|
||||
#define SPELL_BURNINGADRENALINE 23620
|
||||
#define SPELL_CLEAVE 20684 //Chain cleave is most likely named something different and contains a dummy effect
|
||||
|
||||
struct boss_vaelAI : public ScriptedAI
|
||||
class boss_vaelastrasz : public CreatureScript
|
||||
{
|
||||
boss_vaelAI(Creature *c) : ScriptedAI(c)
|
||||
public:
|
||||
boss_vaelastrasz() : CreatureScript("boss_vaelastrasz") { }
|
||||
|
||||
void SendDefaultMenu(Player* pPlayer, Creature* pCreature, uint32 uiAction)
|
||||
{
|
||||
c->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
c->setFaction(35);
|
||||
c->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
uint64 PlayerGUID;
|
||||
uint32 SpeechTimer;
|
||||
uint32 SpeechNum;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 FlameBreath_Timer;
|
||||
uint32 FireNova_Timer;
|
||||
uint32 BurningAdrenalineCaster_Timer;
|
||||
uint32 BurningAdrenalineTank_Timer;
|
||||
uint32 TailSwipe_Timer;
|
||||
bool HasYelled;
|
||||
bool DoingSpeech;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
PlayerGUID = 0;
|
||||
SpeechTimer = 0;
|
||||
SpeechNum = 0;
|
||||
Cleave_Timer = 8000; //These times are probably wrong
|
||||
FlameBreath_Timer = 11000;
|
||||
BurningAdrenalineCaster_Timer = 15000;
|
||||
BurningAdrenalineTank_Timer = 45000;
|
||||
FireNova_Timer = 5000;
|
||||
TailSwipe_Timer = 20000;
|
||||
HasYelled = false;
|
||||
DoingSpeech = false;
|
||||
}
|
||||
|
||||
void BeginSpeech(Unit *pTarget)
|
||||
{
|
||||
//Stand up and begin speach
|
||||
PlayerGUID = pTarget->GetGUID();
|
||||
|
||||
//10 seconds
|
||||
DoScriptText(SAY_LINE1, me);
|
||||
|
||||
SpeechTimer = 10000;
|
||||
SpeechNum = 0;
|
||||
DoingSpeech = true;
|
||||
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * victim)
|
||||
{
|
||||
if (rand()%5)
|
||||
return;
|
||||
|
||||
DoScriptText(SAY_KILLTARGET, me, victim);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me, SPELL_ESSENCEOFTHERED);
|
||||
DoZoneInCombat();
|
||||
me->SetHealth(int(me->GetMaxHealth()*.3));
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Speech
|
||||
if (DoingSpeech)
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
|
||||
{
|
||||
if (SpeechTimer <= diff)
|
||||
{
|
||||
switch (SpeechNum)
|
||||
{
|
||||
case 0:
|
||||
//16 seconds till next line
|
||||
DoScriptText(SAY_LINE2, me);
|
||||
SpeechTimer = 16000;
|
||||
++SpeechNum;
|
||||
break;
|
||||
case 1:
|
||||
//This one is actually 16 seconds but we only go to 10 seconds because he starts attacking after he says "I must fight this!"
|
||||
DoScriptText(SAY_LINE3, me);
|
||||
SpeechTimer = 10000;
|
||||
++SpeechNum;
|
||||
break;
|
||||
case 2:
|
||||
me->setFaction(103);
|
||||
if (PlayerGUID && Unit::GetUnit((*me),PlayerGUID))
|
||||
{
|
||||
AttackStart(Unit::GetUnit((*me),PlayerGUID));
|
||||
DoCast(me, SPELL_ESSENCEOFTHERED);
|
||||
}
|
||||
SpeechTimer = 0;
|
||||
DoingSpeech = false;
|
||||
break;
|
||||
}
|
||||
} else SpeechTimer -= diff;
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
CAST_AI(boss_vaelastrasz::boss_vaelAI, pCreature->AI())->BeginSpeech(pPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
|
||||
{
|
||||
if (uiSender == GOSSIP_SENDER_MAIN)
|
||||
SendDefaultMenu(pPlayer, pCreature, uiAction);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
if (pCreature->isQuestGiver())
|
||||
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
|
||||
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
return new boss_vaelAI (pCreature);
|
||||
}
|
||||
|
||||
struct boss_vaelAI : public ScriptedAI
|
||||
{
|
||||
boss_vaelAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
c->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
c->setFaction(35);
|
||||
c->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint64 PlayerGUID;
|
||||
uint32 SpeechTimer;
|
||||
uint32 SpeechNum;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 FlameBreath_Timer;
|
||||
uint32 FireNova_Timer;
|
||||
uint32 BurningAdrenalineCaster_Timer;
|
||||
uint32 BurningAdrenalineTank_Timer;
|
||||
uint32 TailSwipe_Timer;
|
||||
bool HasYelled;
|
||||
bool DoingSpeech;
|
||||
|
||||
// Yell if hp lower than 15%
|
||||
if (me->GetHealth()*100 / me->GetMaxHealth() < 15 && !HasYelled)
|
||||
void Reset()
|
||||
{
|
||||
DoScriptText(SAY_HALFLIFE, me);
|
||||
HasYelled = true;
|
||||
}
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 15000;
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
//FlameBreath_Timer
|
||||
if (FlameBreath_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FLAMEBREATH);
|
||||
FlameBreath_Timer = urand(4000,8000);
|
||||
} else FlameBreath_Timer -= diff;
|
||||
|
||||
//BurningAdrenalineCaster_Timer
|
||||
if (BurningAdrenalineCaster_Timer <= diff)
|
||||
{
|
||||
Unit *pTarget = NULL;
|
||||
|
||||
uint8 i = 0;
|
||||
while (i < 3) // max 3 tries to get a random target with power_mana
|
||||
{
|
||||
++i;
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); //not aggro leader
|
||||
if (pTarget && pTarget->getPowerType() == POWER_MANA)
|
||||
i = 3;
|
||||
}
|
||||
if (pTarget) // cast on self (see below)
|
||||
pTarget->CastSpell(pTarget,SPELL_BURNINGADRENALINE,1);
|
||||
|
||||
PlayerGUID = 0;
|
||||
SpeechTimer = 0;
|
||||
SpeechNum = 0;
|
||||
Cleave_Timer = 8000; //These times are probably wrong
|
||||
FlameBreath_Timer = 11000;
|
||||
BurningAdrenalineCaster_Timer = 15000;
|
||||
} else BurningAdrenalineCaster_Timer -= diff;
|
||||
|
||||
//BurningAdrenalineTank_Timer
|
||||
if (BurningAdrenalineTank_Timer <= diff)
|
||||
{
|
||||
// have the victim cast the spell on himself otherwise the third effect aura will be applied
|
||||
// to Vael instead of the player
|
||||
me->getVictim()->CastSpell(me->getVictim(),SPELL_BURNINGADRENALINE,1);
|
||||
|
||||
BurningAdrenalineTank_Timer = 45000;
|
||||
} else BurningAdrenalineTank_Timer -= diff;
|
||||
|
||||
//FireNova_Timer
|
||||
if (FireNova_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FIRENOVA);
|
||||
FireNova_Timer = 5000;
|
||||
} else FireNova_Timer -= diff;
|
||||
|
||||
//TailSwipe_Timer
|
||||
if (TailSwipe_Timer <= diff)
|
||||
{
|
||||
//Only cast if we are behind
|
||||
/*if (!me->HasInArc(M_PI, me->getVictim()))
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_TAILSWIPE);
|
||||
}*/
|
||||
|
||||
TailSwipe_Timer = 20000;
|
||||
} else TailSwipe_Timer -= diff;
|
||||
HasYelled = false;
|
||||
DoingSpeech = false;
|
||||
}
|
||||
|
||||
void BeginSpeech(Unit *pTarget)
|
||||
{
|
||||
//Stand up and begin speach
|
||||
PlayerGUID = pTarget->GetGUID();
|
||||
|
||||
//10 seconds
|
||||
DoScriptText(SAY_LINE1, me);
|
||||
|
||||
SpeechTimer = 10000;
|
||||
SpeechNum = 0;
|
||||
DoingSpeech = true;
|
||||
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * victim)
|
||||
{
|
||||
if (rand()%5)
|
||||
return;
|
||||
|
||||
DoScriptText(SAY_KILLTARGET, me, victim);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me, SPELL_ESSENCEOFTHERED);
|
||||
DoZoneInCombat();
|
||||
me->SetHealth(int(me->GetMaxHealth()*.3));
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Speech
|
||||
if (DoingSpeech)
|
||||
{
|
||||
if (SpeechTimer <= diff)
|
||||
{
|
||||
switch (SpeechNum)
|
||||
{
|
||||
case 0:
|
||||
//16 seconds till next line
|
||||
DoScriptText(SAY_LINE2, me);
|
||||
SpeechTimer = 16000;
|
||||
++SpeechNum;
|
||||
break;
|
||||
case 1:
|
||||
//This one is actually 16 seconds but we only go to 10 seconds because he starts attacking after he says "I must fight this!"
|
||||
DoScriptText(SAY_LINE3, me);
|
||||
SpeechTimer = 10000;
|
||||
++SpeechNum;
|
||||
break;
|
||||
case 2:
|
||||
me->setFaction(103);
|
||||
if (PlayerGUID && Unit::GetUnit((*me),PlayerGUID))
|
||||
{
|
||||
AttackStart(Unit::GetUnit((*me),PlayerGUID));
|
||||
DoCast(me, SPELL_ESSENCEOFTHERED);
|
||||
}
|
||||
SpeechTimer = 0;
|
||||
DoingSpeech = false;
|
||||
break;
|
||||
}
|
||||
} else SpeechTimer -= diff;
|
||||
}
|
||||
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
// Yell if hp lower than 15%
|
||||
if (me->GetHealth()*100 / me->GetMaxHealth() < 15 && !HasYelled)
|
||||
{
|
||||
DoScriptText(SAY_HALFLIFE, me);
|
||||
HasYelled = true;
|
||||
}
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 15000;
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
//FlameBreath_Timer
|
||||
if (FlameBreath_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FLAMEBREATH);
|
||||
FlameBreath_Timer = urand(4000,8000);
|
||||
} else FlameBreath_Timer -= diff;
|
||||
|
||||
//BurningAdrenalineCaster_Timer
|
||||
if (BurningAdrenalineCaster_Timer <= diff)
|
||||
{
|
||||
Unit *pTarget = NULL;
|
||||
|
||||
uint8 i = 0;
|
||||
while (i < 3) // max 3 tries to get a random target with power_mana
|
||||
{
|
||||
++i;
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); //not aggro leader
|
||||
if (pTarget && pTarget->getPowerType() == POWER_MANA)
|
||||
i = 3;
|
||||
}
|
||||
if (pTarget) // cast on self (see below)
|
||||
pTarget->CastSpell(pTarget,SPELL_BURNINGADRENALINE,1);
|
||||
|
||||
BurningAdrenalineCaster_Timer = 15000;
|
||||
} else BurningAdrenalineCaster_Timer -= diff;
|
||||
|
||||
//BurningAdrenalineTank_Timer
|
||||
if (BurningAdrenalineTank_Timer <= diff)
|
||||
{
|
||||
// have the victim cast the spell on himself otherwise the third effect aura will be applied
|
||||
// to Vael instead of the player
|
||||
me->getVictim()->CastSpell(me->getVictim(),SPELL_BURNINGADRENALINE,1);
|
||||
|
||||
BurningAdrenalineTank_Timer = 45000;
|
||||
} else BurningAdrenalineTank_Timer -= diff;
|
||||
|
||||
//FireNova_Timer
|
||||
if (FireNova_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FIRENOVA);
|
||||
FireNova_Timer = 5000;
|
||||
} else FireNova_Timer -= diff;
|
||||
|
||||
//TailSwipe_Timer
|
||||
if (TailSwipe_Timer <= diff)
|
||||
{
|
||||
//Only cast if we are behind
|
||||
/*if (!me->HasInArc(M_PI, me->getVictim()))
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_TAILSWIPE);
|
||||
}*/
|
||||
|
||||
TailSwipe_Timer = 20000;
|
||||
} else TailSwipe_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
void SendDefaultMenu_boss_vael(Player* pPlayer, Creature* pCreature, uint32 uiAction)
|
||||
{
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
|
||||
{
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
CAST_AI(boss_vaelAI, pCreature->AI())->BeginSpeech(pPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
bool GossipSelect_boss_vael(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
|
||||
{
|
||||
if (uiSender == GOSSIP_SENDER_MAIN)
|
||||
SendDefaultMenu_boss_vael(pPlayer, pCreature, uiAction);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipHello_boss_vael(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
if (pCreature->isQuestGiver())
|
||||
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
|
||||
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_boss_vael(Creature* pCreature)
|
||||
{
|
||||
return new boss_vaelAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_vael()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_vaelastrasz";
|
||||
newscript->GetAI = &GetAI_boss_vael;
|
||||
newscript->pGossipHello = &GossipHello_boss_vael;
|
||||
newscript->pGossipSelect = &GossipSelect_boss_vael;
|
||||
newscript->RegisterSelf();
|
||||
new boss_vaelastrasz();
|
||||
}
|
||||
|
||||
|
||||
@@ -68,320 +68,321 @@ EndScriptData */
|
||||
//and allow players to start the event over
|
||||
//If nefarian dies then he will kill himself then he will kill himself in his hiding place
|
||||
//To prevent players from doing the event twice
|
||||
|
||||
struct boss_victor_nefariusAI : public ScriptedAI
|
||||
class boss_victor_nefarius : public CreatureScript
|
||||
{
|
||||
boss_victor_nefariusAI(Creature *c) : ScriptedAI(c)
|
||||
public:
|
||||
boss_victor_nefarius() : CreatureScript("boss_victor_nefarius") { }
|
||||
|
||||
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
|
||||
{
|
||||
NefarianGUID = 0;
|
||||
switch (urand(0,19))
|
||||
switch (uiAction)
|
||||
{
|
||||
case 0:
|
||||
DrakType1 = CREATURE_BRONZE_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLUE_DRAKANOID;
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
pPlayer->SEND_GOSSIP_MENU(7198, pCreature->GetGUID());
|
||||
break;
|
||||
case 1:
|
||||
DrakType1 = CREATURE_BRONZE_DRAKANOID;
|
||||
DrakType2 = CREATURE_RED_DRAKANOID;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
|
||||
pPlayer->SEND_GOSSIP_MENU(7199, pCreature->GetGUID());
|
||||
break;
|
||||
case 2:
|
||||
DrakType1 = CREATURE_BRONZE_DRAKANOID;
|
||||
DrakType2 = CREATURE_GREEN_DRAKANOID;
|
||||
break;
|
||||
case 3:
|
||||
DrakType1 = CREATURE_BRONZE_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLACK_DRAKANOID;
|
||||
break;
|
||||
case 4:
|
||||
DrakType1 = CREATURE_BLUE_DRAKANOID;
|
||||
DrakType2 = CREATURE_BRONZE_DRAKANOID;
|
||||
break;
|
||||
case 5:
|
||||
DrakType1 = CREATURE_BLUE_DRAKANOID;
|
||||
DrakType2 = CREATURE_RED_DRAKANOID;
|
||||
break;
|
||||
case 6:
|
||||
DrakType1 = CREATURE_BLUE_DRAKANOID;
|
||||
DrakType2 = CREATURE_GREEN_DRAKANOID;
|
||||
break;
|
||||
case 7:
|
||||
DrakType1 = CREATURE_BLUE_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLACK_DRAKANOID;
|
||||
break;
|
||||
case 8:
|
||||
DrakType1 = CREATURE_RED_DRAKANOID;
|
||||
DrakType2 = CREATURE_BRONZE_DRAKANOID;
|
||||
break;
|
||||
case 9:
|
||||
DrakType1 = CREATURE_RED_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLUE_DRAKANOID;
|
||||
break;
|
||||
case 10:
|
||||
DrakType1 = CREATURE_RED_DRAKANOID;
|
||||
DrakType2 = CREATURE_GREEN_DRAKANOID;
|
||||
break;
|
||||
case 11:
|
||||
DrakType1 = CREATURE_RED_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLACK_DRAKANOID;
|
||||
break;
|
||||
case 12:
|
||||
DrakType1 = CREATURE_GREEN_DRAKANOID;
|
||||
DrakType2 = CREATURE_BRONZE_DRAKANOID;
|
||||
break;
|
||||
case 13:
|
||||
DrakType1 = CREATURE_GREEN_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLUE_DRAKANOID;
|
||||
break;
|
||||
case 14:
|
||||
DrakType1 = CREATURE_GREEN_DRAKANOID;
|
||||
DrakType2 = CREATURE_RED_DRAKANOID;
|
||||
break;
|
||||
case 15:
|
||||
DrakType1 = CREATURE_GREEN_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLACK_DRAKANOID;
|
||||
break;
|
||||
case 16:
|
||||
DrakType1 = CREATURE_BLACK_DRAKANOID;
|
||||
DrakType2 = CREATURE_BRONZE_DRAKANOID;
|
||||
break;
|
||||
case 17:
|
||||
DrakType1 = CREATURE_BLACK_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLUE_DRAKANOID;
|
||||
break;
|
||||
case 18:
|
||||
DrakType1 = CREATURE_BLACK_DRAKANOID;
|
||||
DrakType2 = CREATURE_GREEN_DRAKANOID;
|
||||
break;
|
||||
case 19:
|
||||
DrakType1 = CREATURE_BLACK_DRAKANOID;
|
||||
DrakType2 = CREATURE_RED_DRAKANOID;
|
||||
case GOSSIP_ACTION_INFO_DEF+3:
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
DoScriptText(SAY_GAMESBEGIN_1, pCreature);
|
||||
CAST_AI(boss_victor_nefarius::boss_victor_nefariusAI, pCreature->AI())->BeginEvent(pPlayer);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32 SpawnedAdds;
|
||||
uint32 AddSpawnTimer;
|
||||
uint32 ShadowBoltTimer;
|
||||
uint32 FearTimer;
|
||||
uint32 MindControlTimer;
|
||||
uint32 ResetTimer;
|
||||
uint32 DrakType1;
|
||||
uint32 DrakType2;
|
||||
uint64 NefarianGUID;
|
||||
uint32 NefCheckTime;
|
||||
|
||||
void Reset()
|
||||
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
SpawnedAdds = 0;
|
||||
AddSpawnTimer = 10000;
|
||||
ShadowBoltTimer = 5000;
|
||||
FearTimer = 8000;
|
||||
ResetTimer = 900000; //On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier
|
||||
NefarianGUID = 0;
|
||||
NefCheckTime = 2000;
|
||||
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS,1);
|
||||
me->setFaction(35);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_1 , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
pPlayer->SEND_GOSSIP_MENU(7134, pCreature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
void BeginEvent(Player *pTarget)
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
DoScriptText(SAY_GAMESBEGIN_2, me);
|
||||
return new boss_victor_nefariusAI (pCreature);
|
||||
}
|
||||
|
||||
//Trinity::Singleton<MapManager>::Instance().GetMap(me->GetMapId(), me)->GetPlayers().begin();
|
||||
/*
|
||||
list <Player*>::const_iterator i = sMapMgr.GetMap(me->GetMapId(), me)->GetPlayers().begin();
|
||||
|
||||
for (i = sMapMgr.GetMap(me->GetMapId(), me)->GetPlayers().begin(); i != sMapMgr.GetMap(me->GetMapId(), me)->GetPlayers().end(); ++i)
|
||||
struct boss_victor_nefariusAI : public ScriptedAI
|
||||
{
|
||||
boss_victor_nefariusAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
AttackStart((*i));
|
||||
NefarianGUID = 0;
|
||||
switch (urand(0,19))
|
||||
{
|
||||
case 0:
|
||||
DrakType1 = CREATURE_BRONZE_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLUE_DRAKANOID;
|
||||
break;
|
||||
case 1:
|
||||
DrakType1 = CREATURE_BRONZE_DRAKANOID;
|
||||
DrakType2 = CREATURE_RED_DRAKANOID;
|
||||
break;
|
||||
case 2:
|
||||
DrakType1 = CREATURE_BRONZE_DRAKANOID;
|
||||
DrakType2 = CREATURE_GREEN_DRAKANOID;
|
||||
break;
|
||||
case 3:
|
||||
DrakType1 = CREATURE_BRONZE_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLACK_DRAKANOID;
|
||||
break;
|
||||
case 4:
|
||||
DrakType1 = CREATURE_BLUE_DRAKANOID;
|
||||
DrakType2 = CREATURE_BRONZE_DRAKANOID;
|
||||
break;
|
||||
case 5:
|
||||
DrakType1 = CREATURE_BLUE_DRAKANOID;
|
||||
DrakType2 = CREATURE_RED_DRAKANOID;
|
||||
break;
|
||||
case 6:
|
||||
DrakType1 = CREATURE_BLUE_DRAKANOID;
|
||||
DrakType2 = CREATURE_GREEN_DRAKANOID;
|
||||
break;
|
||||
case 7:
|
||||
DrakType1 = CREATURE_BLUE_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLACK_DRAKANOID;
|
||||
break;
|
||||
case 8:
|
||||
DrakType1 = CREATURE_RED_DRAKANOID;
|
||||
DrakType2 = CREATURE_BRONZE_DRAKANOID;
|
||||
break;
|
||||
case 9:
|
||||
DrakType1 = CREATURE_RED_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLUE_DRAKANOID;
|
||||
break;
|
||||
case 10:
|
||||
DrakType1 = CREATURE_RED_DRAKANOID;
|
||||
DrakType2 = CREATURE_GREEN_DRAKANOID;
|
||||
break;
|
||||
case 11:
|
||||
DrakType1 = CREATURE_RED_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLACK_DRAKANOID;
|
||||
break;
|
||||
case 12:
|
||||
DrakType1 = CREATURE_GREEN_DRAKANOID;
|
||||
DrakType2 = CREATURE_BRONZE_DRAKANOID;
|
||||
break;
|
||||
case 13:
|
||||
DrakType1 = CREATURE_GREEN_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLUE_DRAKANOID;
|
||||
break;
|
||||
case 14:
|
||||
DrakType1 = CREATURE_GREEN_DRAKANOID;
|
||||
DrakType2 = CREATURE_RED_DRAKANOID;
|
||||
break;
|
||||
case 15:
|
||||
DrakType1 = CREATURE_GREEN_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLACK_DRAKANOID;
|
||||
break;
|
||||
case 16:
|
||||
DrakType1 = CREATURE_BLACK_DRAKANOID;
|
||||
DrakType2 = CREATURE_BRONZE_DRAKANOID;
|
||||
break;
|
||||
case 17:
|
||||
DrakType1 = CREATURE_BLACK_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLUE_DRAKANOID;
|
||||
break;
|
||||
case 18:
|
||||
DrakType1 = CREATURE_BLACK_DRAKANOID;
|
||||
DrakType2 = CREATURE_GREEN_DRAKANOID;
|
||||
break;
|
||||
case 19:
|
||||
DrakType1 = CREATURE_BLACK_DRAKANOID;
|
||||
DrakType2 = CREATURE_RED_DRAKANOID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
*/
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS,0);
|
||||
me->setFaction(103);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
AttackStart(pTarget);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
}
|
||||
uint32 SpawnedAdds;
|
||||
uint32 AddSpawnTimer;
|
||||
uint32 ShadowBoltTimer;
|
||||
uint32 FearTimer;
|
||||
uint32 MindControlTimer;
|
||||
uint32 ResetTimer;
|
||||
uint32 DrakType1;
|
||||
uint32 DrakType2;
|
||||
uint64 NefarianGUID;
|
||||
uint32 NefCheckTime;
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
//We simply use this function to find players until we can use pMap->GetPlayers()
|
||||
|
||||
if (who && who->GetTypeId() == TYPEID_PLAYER && me->IsHostileTo(who))
|
||||
void Reset()
|
||||
{
|
||||
//Add them to our threat list
|
||||
me->AddThreat(who, 0.0f);
|
||||
SpawnedAdds = 0;
|
||||
AddSpawnTimer = 10000;
|
||||
ShadowBoltTimer = 5000;
|
||||
FearTimer = 8000;
|
||||
ResetTimer = 900000; //On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier
|
||||
NefarianGUID = 0;
|
||||
NefCheckTime = 2000;
|
||||
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS,1);
|
||||
me->setFaction(35);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Only do this if we haven't spawned nef yet
|
||||
if (SpawnedAdds < 42)
|
||||
void BeginEvent(Player *pTarget)
|
||||
{
|
||||
//ShadowBoltTimer
|
||||
if (ShadowBoltTimer <= diff)
|
||||
DoScriptText(SAY_GAMESBEGIN_2, me);
|
||||
|
||||
//Trinity::Singleton<MapManager>::Instance().GetMap(me->GetMapId(), me)->GetPlayers().begin();
|
||||
/*
|
||||
list <Player*>::const_iterator i = sMapMgr.GetMap(me->GetMapId(), me)->GetPlayers().begin();
|
||||
|
||||
for (i = sMapMgr.GetMap(me->GetMapId(), me)->GetPlayers().begin(); i != sMapMgr.GetMap(me->GetMapId(), me)->GetPlayers().end(); ++i)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_SHADOWBOLT);
|
||||
AttackStart((*i));
|
||||
}
|
||||
*/
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS,0);
|
||||
me->setFaction(103);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
AttackStart(pTarget);
|
||||
}
|
||||
|
||||
ShadowBoltTimer = urand(3000,10000);
|
||||
} else ShadowBoltTimer -= diff;
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
}
|
||||
|
||||
//FearTimer
|
||||
if (FearTimer <= diff)
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
//We simply use this function to find players until we can use pMap->GetPlayers()
|
||||
|
||||
if (who && who->GetTypeId() == TYPEID_PLAYER && me->IsHostileTo(who))
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_FEAR);
|
||||
//Add them to our threat list
|
||||
me->AddThreat(who, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
FearTimer = 10000 + (rand()%10000);
|
||||
} else FearTimer -= diff;
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Add spawning mechanism
|
||||
if (AddSpawnTimer <= diff)
|
||||
//Only do this if we haven't spawned nef yet
|
||||
if (SpawnedAdds < 42)
|
||||
{
|
||||
//Spawn 2 random types of creatures at the 2 locations
|
||||
uint32 CreatureID;
|
||||
Creature* Spawned = NULL;
|
||||
Unit *pTarget = NULL;
|
||||
|
||||
//1 in 3 chance it will be a chromatic
|
||||
if (urand(0,2) == 0)
|
||||
CreatureID = CREATURE_CHROMATIC_DRAKANOID;
|
||||
else
|
||||
CreatureID = DrakType1;
|
||||
|
||||
++SpawnedAdds;
|
||||
|
||||
//Spawn Creature and force it to start attacking a random target
|
||||
Spawned = me->SummonCreature(CreatureID,ADD_X1,ADD_Y1,ADD_Z1,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
if (pTarget && Spawned)
|
||||
//ShadowBoltTimer
|
||||
if (ShadowBoltTimer <= diff)
|
||||
{
|
||||
Spawned->AI()->AttackStart(pTarget);
|
||||
Spawned->setFaction(103);
|
||||
}
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_SHADOWBOLT);
|
||||
|
||||
//1 in 3 chance it will be a chromatic
|
||||
if (urand(0,2) == 0)
|
||||
CreatureID = CREATURE_CHROMATIC_DRAKANOID;
|
||||
else
|
||||
CreatureID = DrakType2;
|
||||
ShadowBoltTimer = urand(3000,10000);
|
||||
} else ShadowBoltTimer -= diff;
|
||||
|
||||
++SpawnedAdds;
|
||||
|
||||
Spawned = me->SummonCreature(CreatureID,ADD_X2,ADD_Y2,ADD_Z2,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
if (pTarget && Spawned)
|
||||
//FearTimer
|
||||
if (FearTimer <= diff)
|
||||
{
|
||||
Spawned->AI()->AttackStart(pTarget);
|
||||
Spawned->setFaction(103);
|
||||
}
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_FEAR);
|
||||
|
||||
//Begin phase 2 by spawning Nefarian and what not
|
||||
if (SpawnedAdds >= 42)
|
||||
FearTimer = 10000 + (rand()%10000);
|
||||
} else FearTimer -= diff;
|
||||
|
||||
//Add spawning mechanism
|
||||
if (AddSpawnTimer <= diff)
|
||||
{
|
||||
//Teleport Victor Nefarius way out of the map
|
||||
//sMapMgr.GetMap(me->GetMapId(), me)->CreatureRelocation(me,0,0,-5000,0);
|
||||
//Spawn 2 random types of creatures at the 2 locations
|
||||
uint32 CreatureID;
|
||||
Creature* Spawned = NULL;
|
||||
Unit *pTarget = NULL;
|
||||
|
||||
//Interrupt any spell casting
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
//1 in 3 chance it will be a chromatic
|
||||
if (urand(0,2) == 0)
|
||||
CreatureID = CREATURE_CHROMATIC_DRAKANOID;
|
||||
else
|
||||
CreatureID = DrakType1;
|
||||
|
||||
//Root self
|
||||
DoCast(me, 33356);
|
||||
++SpawnedAdds;
|
||||
|
||||
//Make super invis
|
||||
DoCast(me, 8149);
|
||||
|
||||
//Teleport self to a hiding spot (this causes errors in the Trinity log but no real issues)
|
||||
DoTeleportTo(HIDE_X,HIDE_Y,HIDE_Z);
|
||||
me->addUnitState(UNIT_STAT_FLEEING);
|
||||
|
||||
//Spawn nef and have him attack a random target
|
||||
Creature* Nefarian = me->SummonCreature(CREATURE_NEFARIAN,NEF_X,NEF_Y,NEF_Z,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000);
|
||||
//Spawn Creature and force it to start attacking a random target
|
||||
Spawned = me->SummonCreature(CreatureID,ADD_X1,ADD_Y1,ADD_Z1,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
if (pTarget && Nefarian)
|
||||
if (pTarget && Spawned)
|
||||
{
|
||||
Nefarian->AI()->AttackStart(pTarget);
|
||||
Nefarian->setFaction(103);
|
||||
NefarianGUID = Nefarian->GetGUID();
|
||||
Spawned->AI()->AttackStart(pTarget);
|
||||
Spawned->setFaction(103);
|
||||
}
|
||||
else sLog.outError("TSCR: Blackwing Lair: Unable to spawn nefarian properly.");
|
||||
}
|
||||
|
||||
AddSpawnTimer = 4000;
|
||||
} else AddSpawnTimer -= diff;
|
||||
}
|
||||
else if (NefarianGUID)
|
||||
{
|
||||
if (NefCheckTime <= diff)
|
||||
//1 in 3 chance it will be a chromatic
|
||||
if (urand(0,2) == 0)
|
||||
CreatureID = CREATURE_CHROMATIC_DRAKANOID;
|
||||
else
|
||||
CreatureID = DrakType2;
|
||||
|
||||
++SpawnedAdds;
|
||||
|
||||
Spawned = me->SummonCreature(CreatureID,ADD_X2,ADD_Y2,ADD_Z2,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
if (pTarget && Spawned)
|
||||
{
|
||||
Spawned->AI()->AttackStart(pTarget);
|
||||
Spawned->setFaction(103);
|
||||
}
|
||||
|
||||
//Begin phase 2 by spawning Nefarian and what not
|
||||
if (SpawnedAdds >= 42)
|
||||
{
|
||||
//Teleport Victor Nefarius way out of the map
|
||||
//sMapMgr.GetMap(me->GetMapId(), me)->CreatureRelocation(me,0,0,-5000,0);
|
||||
|
||||
//Interrupt any spell casting
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
|
||||
//Root self
|
||||
DoCast(me, 33356);
|
||||
|
||||
//Make super invis
|
||||
DoCast(me, 8149);
|
||||
|
||||
//Teleport self to a hiding spot (this causes errors in the Trinity log but no real issues)
|
||||
DoTeleportTo(HIDE_X,HIDE_Y,HIDE_Z);
|
||||
me->addUnitState(UNIT_STAT_FLEEING);
|
||||
|
||||
//Spawn nef and have him attack a random target
|
||||
Creature* Nefarian = me->SummonCreature(CREATURE_NEFARIAN,NEF_X,NEF_Y,NEF_Z,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000);
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
if (pTarget && Nefarian)
|
||||
{
|
||||
Nefarian->AI()->AttackStart(pTarget);
|
||||
Nefarian->setFaction(103);
|
||||
NefarianGUID = Nefarian->GetGUID();
|
||||
}
|
||||
else sLog.outError("TSCR: Blackwing Lair: Unable to spawn nefarian properly.");
|
||||
}
|
||||
|
||||
AddSpawnTimer = 4000;
|
||||
} else AddSpawnTimer -= diff;
|
||||
}
|
||||
else if (NefarianGUID)
|
||||
{
|
||||
Unit* Nefarian = Unit::GetCreature((*me),NefarianGUID);
|
||||
|
||||
//If nef is dead then we die to so the players get out of combat
|
||||
//and cannot repeat the event
|
||||
if (!Nefarian || !Nefarian->isAlive())
|
||||
if (NefCheckTime <= diff)
|
||||
{
|
||||
NefarianGUID = 0;
|
||||
me->ForcedDespawn();
|
||||
}
|
||||
Unit* Nefarian = Unit::GetCreature((*me),NefarianGUID);
|
||||
|
||||
NefCheckTime = 2000;
|
||||
} else NefCheckTime -= diff;
|
||||
//If nef is dead then we die to so the players get out of combat
|
||||
//and cannot repeat the event
|
||||
if (!Nefarian || !Nefarian->isAlive())
|
||||
{
|
||||
NefarianGUID = 0;
|
||||
me->ForcedDespawn();
|
||||
}
|
||||
|
||||
NefCheckTime = 2000;
|
||||
} else NefCheckTime -= diff;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_victor_nefarius(Creature* pCreature)
|
||||
{
|
||||
return new boss_victor_nefariusAI (pCreature);
|
||||
}
|
||||
|
||||
bool GossipHello_boss_victor_nefarius(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_1 , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
pPlayer->SEND_GOSSIP_MENU(7134, pCreature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect_boss_victor_nefarius(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
|
||||
{
|
||||
switch (uiAction)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
pPlayer->SEND_GOSSIP_MENU(7198, pCreature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
|
||||
pPlayer->SEND_GOSSIP_MENU(7199, pCreature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+3:
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
DoScriptText(SAY_GAMESBEGIN_1, pCreature);
|
||||
CAST_AI(boss_victor_nefariusAI, pCreature->AI())->BeginEvent(pPlayer);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void AddSC_boss_victor_nefarius()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_victor_nefarius";
|
||||
newscript->GetAI = &GetAI_boss_victor_nefarius;
|
||||
newscript->pGossipHello = &GossipHello_boss_victor_nefarius;
|
||||
newscript->pGossipSelect = &GossipSelect_boss_victor_nefarius;
|
||||
newscript->RegisterSelf();
|
||||
new boss_victor_nefarius();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,146 +36,149 @@ enum eSpels
|
||||
|
||||
SAY_AGGRO = -1036001
|
||||
};
|
||||
|
||||
struct boss_mr_smiteAI : public ScriptedAI
|
||||
class boss_mr_smite : public CreatureScript
|
||||
{
|
||||
boss_mr_smiteAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
public:
|
||||
boss_mr_smite() : CreatureScript("boss_mr_smite") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
pInstance = pCreature->GetInstanceData();
|
||||
return new boss_mr_smiteAI (pCreature);
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 uiTrashTimer;
|
||||
uint32 uiSlamTimer;
|
||||
uint32 uiNimbleReflexesTimer;
|
||||
|
||||
uint8 uiHealth;
|
||||
|
||||
uint32 uiPhase;
|
||||
uint32 uiTimer;
|
||||
|
||||
void Reset()
|
||||
struct boss_mr_smiteAI : public ScriptedAI
|
||||
{
|
||||
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, me);
|
||||
}
|
||||
|
||||
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)
|
||||
boss_mr_smiteAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
if (bCheckChances())
|
||||
DoCast(me, SPELL_TRASH);
|
||||
uiTrashTimer = urand(6000,15500);
|
||||
} else uiTrashTimer -= uiDiff;
|
||||
|
||||
if (uiSlamTimer <= uiDiff)
|
||||
{
|
||||
if (bCheckChances())
|
||||
DoCast(me->getVictim(), SPELL_SMITE_SLAM);
|
||||
uiSlamTimer = 11000;
|
||||
} else uiSlamTimer -= uiDiff;
|
||||
|
||||
if (uiNimbleReflexesTimer <= uiDiff)
|
||||
{
|
||||
if (bCheckChances())
|
||||
DoCast(me, SPELL_NIMBLE_REFLEXES);
|
||||
uiNimbleReflexesTimer = urand(27300,60100);
|
||||
} else uiNimbleReflexesTimer -= uiDiff;
|
||||
/*END ACID-AI*/
|
||||
|
||||
if (uiHealth == 0 && me->GetHealth()*100 / me->GetMaxHealth() <= 66 || uiHealth == 1 && me->GetHealth()*100 / me->GetMaxHealth() <= 33)
|
||||
{
|
||||
++uiHealth;
|
||||
DoCastAOE(SPELL_SMITE_STOMP,false);
|
||||
SetCombatMovement(false);
|
||||
if (pInstance)
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_SMITE_CHEST)))
|
||||
{
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MovePoint(1,-3.00+pGo->GetPositionX(),pGo->GetPositionY(),pGo->GetPositionZ());
|
||||
}
|
||||
pInstance = pCreature->GetInstanceScript();
|
||||
}
|
||||
|
||||
if (uiPhase)
|
||||
InstanceScript* pInstance;
|
||||
|
||||
uint32 uiTrashTimer;
|
||||
uint32 uiSlamTimer;
|
||||
uint32 uiNimbleReflexesTimer;
|
||||
|
||||
uint8 uiHealth;
|
||||
|
||||
uint32 uiPhase;
|
||||
uint32 uiTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (uiTimer <= uiDiff)
|
||||
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, me);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
switch(uiPhase)
|
||||
{
|
||||
case 1:
|
||||
me->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);
|
||||
me->GetMotionMaster()->MoveChase(me->getVictim(), me->m_CombatDistance);
|
||||
uiPhase = 0;
|
||||
break;
|
||||
if (bCheckChances())
|
||||
DoCast(me, SPELL_TRASH);
|
||||
uiTrashTimer = urand(6000,15500);
|
||||
} else uiTrashTimer -= uiDiff;
|
||||
|
||||
}
|
||||
} else uiTimer -= uiDiff;
|
||||
if (uiSlamTimer <= uiDiff)
|
||||
{
|
||||
if (bCheckChances())
|
||||
DoCast(me->getVictim(), SPELL_SMITE_SLAM);
|
||||
uiSlamTimer = 11000;
|
||||
} else uiSlamTimer -= uiDiff;
|
||||
|
||||
if (uiNimbleReflexesTimer <= uiDiff)
|
||||
{
|
||||
if (bCheckChances())
|
||||
DoCast(me, SPELL_NIMBLE_REFLEXES);
|
||||
uiNimbleReflexesTimer = urand(27300,60100);
|
||||
} else uiNimbleReflexesTimer -= uiDiff;
|
||||
/*END ACID-AI*/
|
||||
|
||||
if (uiHealth == 0 && me->GetHealth()*100 / me->GetMaxHealth() <= 66 || uiHealth == 1 && me->GetHealth()*100 / me->GetMaxHealth() <= 33)
|
||||
{
|
||||
++uiHealth;
|
||||
DoCastAOE(SPELL_SMITE_STOMP,false);
|
||||
SetCombatMovement(false);
|
||||
if (pInstance)
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_SMITE_CHEST)))
|
||||
{
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MovePoint(1,-3.00+pGo->GetPositionX(),pGo->GetPositionY(),pGo->GetPositionZ());
|
||||
}
|
||||
}
|
||||
|
||||
if (uiPhase)
|
||||
{
|
||||
if (uiTimer <= uiDiff)
|
||||
{
|
||||
switch(uiPhase)
|
||||
{
|
||||
case 1:
|
||||
me->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);
|
||||
me->GetMotionMaster()->MoveChase(me->getVictim(), me->m_CombatDistance);
|
||||
uiPhase = 0;
|
||||
break;
|
||||
|
||||
}
|
||||
} else uiTimer -= uiDiff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void MovementInform(uint32 uiType, uint32 /*uiId*/)
|
||||
{
|
||||
if (uiType != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
void MovementInform(uint32 uiType, uint32 /*uiId*/)
|
||||
{
|
||||
if (uiType != POINT_MOTION_TYPE)
|
||||
return;
|
||||
uiTimer = 1500;
|
||||
uiPhase = 1;
|
||||
}
|
||||
|
||||
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();
|
||||
new boss_mr_smite();
|
||||
}
|
||||
|
||||
@@ -30,33 +30,35 @@ EndScriptData */
|
||||
/*#####
|
||||
# item_Defias_Gunpowder
|
||||
#####*/
|
||||
|
||||
bool ItemUse_item_defias_gunpowder(Player* pPlayer, Item* pItem, SpellCastTargets const& targets)
|
||||
class item_defias_gunpowder : public ItemScript
|
||||
{
|
||||
ScriptedInstance *pInstance = pPlayer->GetInstanceData();
|
||||
public:
|
||||
item_defias_gunpowder() : ItemScript("item_defias_gunpowder") { }
|
||||
|
||||
if (!pInstance)
|
||||
bool ItemUse(Player* pPlayer, Item* pItem, SpellCastTargets const& targets)
|
||||
{
|
||||
pPlayer->GetSession()->SendNotification("Instance script not initialized");
|
||||
InstanceScript *pInstance = pPlayer->GetInstanceScript();
|
||||
|
||||
if (!pInstance)
|
||||
{
|
||||
pPlayer->GetSession()->SendNotification("Instance script not initialized");
|
||||
return true;
|
||||
}
|
||||
if (pInstance->GetData(EVENT_STATE)!= CANNON_NOT_USED)
|
||||
return false;
|
||||
if (targets.getGOTarget() && targets.getGOTarget()->GetTypeId() == TYPEID_GAMEOBJECT &&
|
||||
targets.getGOTarget()->GetEntry() == GO_DEFIAS_CANNON)
|
||||
{
|
||||
pInstance->SetData(EVENT_STATE, CANNON_GUNPOWDER_USED);
|
||||
}
|
||||
|
||||
pPlayer->DestroyItemCount(pItem->GetEntry(), 1, true);
|
||||
return true;
|
||||
}
|
||||
if (pInstance->GetData(EVENT_STATE)!= CANNON_NOT_USED)
|
||||
return false;
|
||||
if (targets.getGOTarget() && targets.getGOTarget()->GetTypeId() == TYPEID_GAMEOBJECT &&
|
||||
targets.getGOTarget()->GetEntry() == GO_DEFIAS_CANNON)
|
||||
{
|
||||
pInstance->SetData(EVENT_STATE, CANNON_GUNPOWDER_USED);
|
||||
}
|
||||
|
||||
pPlayer->DestroyItemCount(pItem->GetEntry(), 1, true);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_deadmines()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "item_defias_gunpowder";
|
||||
newscript->pItemUse = &ItemUse_item_defias_gunpowder;
|
||||
newscript->RegisterSelf();
|
||||
new item_defias_gunpowder();
|
||||
}
|
||||
|
||||
@@ -51,9 +51,9 @@ class instance_deadmines : public InstanceMapScript
|
||||
{
|
||||
}
|
||||
|
||||
struct instance_deadmines_InstanceMapScript : public ScriptedInstance
|
||||
struct instance_deadmines_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_deadmines_InstanceMapScript(Map* pMap) : ScriptedInstance(pMap) { Initialize(); };
|
||||
instance_deadmines_InstanceMapScript(Map* pMap) : InstanceScript(pMap) { Initialize(); };
|
||||
|
||||
uint64 FactoryDoorGUID;
|
||||
uint64 IronCladDoorGUID;
|
||||
@@ -251,7 +251,7 @@ class instance_deadmines : public InstanceMapScript
|
||||
}
|
||||
};
|
||||
|
||||
InstanceData* GetInstanceData(InstanceMap* pMap) const
|
||||
InstanceScript* GetInstanceScript(InstanceMap* pMap) const
|
||||
{
|
||||
return new instance_deadmines_InstanceMapScript(pMap);
|
||||
}
|
||||
|
||||
@@ -84,509 +84,514 @@ const Position SpawnPosition[] =
|
||||
{-495.240,-90.808,-149.493,3.238},
|
||||
{-494.195,-89.553,-149.131,3.254}
|
||||
};
|
||||
|
||||
struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
|
||||
class npc_blastmaster_emi_shortfuse : public CreatureScript
|
||||
{
|
||||
npc_blastmaster_emi_shortfuseAI(Creature* pCreature) : npc_escortAI(pCreature)
|
||||
public:
|
||||
npc_blastmaster_emi_shortfuse() : CreatureScript("npc_blastmaster_emi_shortfuse") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
pInstance = pCreature->GetInstanceData();
|
||||
pCreature->RestoreFaction();
|
||||
Reset();
|
||||
return new npc_blastmaster_emi_shortfuseAI(pCreature);
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint8 uiPhase;
|
||||
uint32 uiTimer;
|
||||
|
||||
std::list<uint64> SummonList;
|
||||
std::list<uint64> GoSummonList;
|
||||
|
||||
void Reset()
|
||||
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
|
||||
{
|
||||
if (!HasEscortState(STATE_ESCORT_ESCORTING))
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
uiTimer = 0;
|
||||
uiPhase = 0;
|
||||
if (npc_escortAI* pEscortAI = CAST_AI(npc_blastmaster_emi_shortfuse::npc_blastmaster_emi_shortfuseAI, pCreature->AI()))
|
||||
pEscortAI->Start(true, false,pPlayer->GetGUID());
|
||||
|
||||
RestoreAll();
|
||||
pCreature->setFaction(pPlayer->getFaction());
|
||||
pCreature->AI()->SetData(1,0);
|
||||
|
||||
SummonList.clear();
|
||||
GoSummonList.clear();
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void NextStep(uint32 uiTimerStep,bool bNextStep = true,uint8 uiPhaseStep = 0)
|
||||
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
uiTimer = uiTimerStep;
|
||||
if (bNextStep)
|
||||
++uiPhase;
|
||||
else
|
||||
uiPhase = uiPhaseStep;
|
||||
InstanceScript* pInstance = pCreature->GetInstanceScript();
|
||||
|
||||
if (pInstance && pInstance->GetData(TYPE_EVENT) == NOT_STARTED)
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_START_EVENT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_EMI, pCreature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CaveDestruction(bool bBool)
|
||||
struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
|
||||
{
|
||||
if (GoSummonList.empty())
|
||||
return;
|
||||
|
||||
for (std::list<uint64>::const_iterator itr = GoSummonList.begin(); itr != GoSummonList.end(); ++itr)
|
||||
npc_blastmaster_emi_shortfuseAI(Creature* pCreature) : npc_escortAI(pCreature)
|
||||
{
|
||||
if (GameObject* pGo = GameObject::GetGameObject(*me, *itr))
|
||||
{
|
||||
if (pGo)
|
||||
{
|
||||
if (Creature *trigger = pGo->SummonTrigger(pGo->GetPositionX(), pGo->GetPositionY(),pGo->GetPositionZ(), 0, 1))
|
||||
{
|
||||
//visual effects are not working! ¬¬
|
||||
trigger->CastSpell(trigger,11542,true);
|
||||
trigger->CastSpell(trigger,35470,true);
|
||||
}
|
||||
pGo->RemoveFromWorld();
|
||||
//pGo->CastSpell(me,12158); makes all die?!
|
||||
}
|
||||
}
|
||||
pInstance = pCreature->GetInstanceScript();
|
||||
pCreature->RestoreFaction();
|
||||
Reset();
|
||||
}
|
||||
|
||||
if (bBool)
|
||||
{
|
||||
if (pInstance)
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
|
||||
pInstance->HandleGameObject(NULL,false,pGo);
|
||||
}else
|
||||
if (pInstance)
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
|
||||
pInstance->HandleGameObject(NULL,false,pGo);
|
||||
}
|
||||
InstanceScript* pInstance;
|
||||
|
||||
void SetInFace(bool bBool)
|
||||
{
|
||||
if (!pInstance)
|
||||
return;
|
||||
uint8 uiPhase;
|
||||
uint32 uiTimer;
|
||||
|
||||
if (bBool)
|
||||
std::list<uint64> SummonList;
|
||||
std::list<uint64> GoSummonList;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
|
||||
me->SetFacingToObject(pGo);
|
||||
}else
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
|
||||
me->SetFacingToObject(pGo);
|
||||
}
|
||||
if (!HasEscortState(STATE_ESCORT_ESCORTING))
|
||||
{
|
||||
uiTimer = 0;
|
||||
uiPhase = 0;
|
||||
|
||||
void RestoreAll()
|
||||
{
|
||||
if (!pInstance)
|
||||
return;
|
||||
RestoreAll();
|
||||
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
|
||||
pInstance->HandleGameObject(NULL,false,pGo);
|
||||
SummonList.clear();
|
||||
GoSummonList.clear();
|
||||
}
|
||||
}
|
||||
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
|
||||
pInstance->HandleGameObject(NULL,false,pGo);
|
||||
void NextStep(uint32 uiTimerStep,bool bNextStep = true,uint8 uiPhaseStep = 0)
|
||||
{
|
||||
uiTimer = uiTimerStep;
|
||||
if (bNextStep)
|
||||
++uiPhase;
|
||||
else
|
||||
uiPhase = uiPhaseStep;
|
||||
}
|
||||
|
||||
void CaveDestruction(bool bBool)
|
||||
{
|
||||
if (GoSummonList.empty())
|
||||
return;
|
||||
|
||||
if (!GoSummonList.empty())
|
||||
for (std::list<uint64>::const_iterator itr = GoSummonList.begin(); itr != GoSummonList.end(); ++itr)
|
||||
{
|
||||
if (GameObject* pGo = GameObject::GetGameObject(*me, *itr))
|
||||
pGo->RemoveFromWorld();
|
||||
if (GameObject* pGo = GameObject::GetGameObject(*me, *itr))
|
||||
{
|
||||
if (pGo)
|
||||
{
|
||||
if (Creature *trigger = pGo->SummonTrigger(pGo->GetPositionX(), pGo->GetPositionY(),pGo->GetPositionZ(), 0, 1))
|
||||
{
|
||||
//visual effects are not working! ¬¬
|
||||
trigger->CastSpell(trigger,11542,true);
|
||||
trigger->CastSpell(trigger,35470,true);
|
||||
}
|
||||
pGo->RemoveFromWorld();
|
||||
//pGo->CastSpell(me,12158); makes all die?!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!SummonList.empty())
|
||||
for (std::list<uint64>::const_iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr)
|
||||
{
|
||||
if (Creature* pSummon = Unit::GetCreature(*me, *itr))
|
||||
{
|
||||
if (pSummon->isAlive())
|
||||
pSummon->DisappearAndDie();
|
||||
else
|
||||
pSummon->RemoveCorpse();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (bBool)
|
||||
{
|
||||
if (pInstance)
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
|
||||
pInstance->HandleGameObject(NULL,false,pGo);
|
||||
}else
|
||||
if (pInstance)
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
|
||||
pInstance->HandleGameObject(NULL,false,pGo);
|
||||
}
|
||||
|
||||
void AggroAllPlayers(Creature* pTemp)
|
||||
{
|
||||
Map::PlayerList const &PlList = me->GetMap()->GetPlayers();
|
||||
|
||||
if (PlList.isEmpty())
|
||||
return;
|
||||
|
||||
for (Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
|
||||
void SetInFace(bool bBool)
|
||||
{
|
||||
if (Player* pPlayer = i->getSource())
|
||||
{
|
||||
if (pPlayer->isGameMaster())
|
||||
continue;
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
if (pPlayer->isAlive())
|
||||
if (bBool)
|
||||
{
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
|
||||
me->SetFacingToObject(pGo);
|
||||
}else
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
|
||||
me->SetFacingToObject(pGo);
|
||||
}
|
||||
|
||||
void RestoreAll()
|
||||
{
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
|
||||
pInstance->HandleGameObject(NULL,false,pGo);
|
||||
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
|
||||
pInstance->HandleGameObject(NULL,false,pGo);
|
||||
|
||||
if (!GoSummonList.empty())
|
||||
for (std::list<uint64>::const_iterator itr = GoSummonList.begin(); itr != GoSummonList.end(); ++itr)
|
||||
{
|
||||
pTemp->SetInCombatWith(pPlayer);
|
||||
pPlayer->SetInCombatWith(pTemp);
|
||||
pTemp->AddThreat(pPlayer, 0.0f);
|
||||
if (GameObject* pGo = GameObject::GetGameObject(*me, *itr))
|
||||
pGo->RemoveFromWorld();
|
||||
}
|
||||
|
||||
if (!SummonList.empty())
|
||||
for (std::list<uint64>::const_iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr)
|
||||
{
|
||||
if (Creature* pSummon = Unit::GetCreature(*me, *itr))
|
||||
{
|
||||
if (pSummon->isAlive())
|
||||
pSummon->DisappearAndDie();
|
||||
else
|
||||
pSummon->RemoveCorpse();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AggroAllPlayers(Creature* pTemp)
|
||||
{
|
||||
Map::PlayerList const &PlList = me->GetMap()->GetPlayers();
|
||||
|
||||
if (PlList.isEmpty())
|
||||
return;
|
||||
|
||||
for (Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
|
||||
{
|
||||
if (Player* pPlayer = i->getSource())
|
||||
{
|
||||
if (pPlayer->isGameMaster())
|
||||
continue;
|
||||
|
||||
if (pPlayer->isAlive())
|
||||
{
|
||||
pTemp->SetInCombatWith(pPlayer);
|
||||
pPlayer->SetInCombatWith(pTemp);
|
||||
pTemp->AddThreat(pPlayer, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 uiPoint)
|
||||
{
|
||||
//just in case
|
||||
if (GetPlayerForEscort())
|
||||
if (me->getFaction() != GetPlayerForEscort()->getFaction())
|
||||
me->setFaction(GetPlayerForEscort()->getFaction());
|
||||
|
||||
switch(uiPoint)
|
||||
void WaypointReached(uint32 uiPoint)
|
||||
{
|
||||
case 3:
|
||||
SetEscortPaused(true);
|
||||
NextStep(2000,false,3);
|
||||
break;
|
||||
case 7:
|
||||
SetEscortPaused(true);
|
||||
NextStep(2000,false,4);
|
||||
break;
|
||||
case 9:
|
||||
NextStep(1000,false,8);
|
||||
break;
|
||||
case 10:
|
||||
NextStep(25000,false,10);
|
||||
break;
|
||||
case 11:
|
||||
SetEscortPaused(true);
|
||||
SetInFace(true);
|
||||
NextStep(1000,false,11);
|
||||
break;
|
||||
case 12:
|
||||
NextStep(25000,false,18);
|
||||
break;
|
||||
case 13:
|
||||
Summon(7);
|
||||
NextStep(25000,false,19);
|
||||
break;
|
||||
case 14:
|
||||
SetInFace(false);
|
||||
DoScriptText(SAY_BLASTMASTER_26,me);
|
||||
SetEscortPaused(true);
|
||||
NextStep(5000,false,20);
|
||||
break;
|
||||
}
|
||||
}
|
||||
//just in case
|
||||
if (GetPlayerForEscort())
|
||||
if (me->getFaction() != GetPlayerForEscort()->getFaction())
|
||||
me->setFaction(GetPlayerForEscort()->getFaction());
|
||||
|
||||
void SetData(uint32 uiI,uint32 uiValue)
|
||||
{
|
||||
switch(uiI)
|
||||
{
|
||||
case 1:
|
||||
SetEscortPaused(true);
|
||||
DoScriptText(SAY_BLASTMASTER_0,me);
|
||||
NextStep(1500,true);
|
||||
break;
|
||||
case 2:
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
switch(uiValue)
|
||||
{
|
||||
case 1:
|
||||
pInstance->SetData(TYPE_EVENT, IN_PROGRESS);
|
||||
break;
|
||||
case 2:
|
||||
pInstance->SetData(TYPE_EVENT, DONE);
|
||||
NextStep(5000,false,22);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Summon(uint8 uiCase)
|
||||
{
|
||||
switch(uiCase)
|
||||
{
|
||||
case 1:
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[4], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[5], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[6], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[7], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[8], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[9], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
break;
|
||||
case 2:
|
||||
if (GameObject* pGo = me->SummonGameObject(183410, -533.140,-105.322,-156.016, 0, 0, 0, 0, 0, 1000))
|
||||
{
|
||||
GoSummonList.push_back(pGo->GetGUID());
|
||||
pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1); //We can't use it!
|
||||
}
|
||||
Summon(3);
|
||||
break;
|
||||
case 3:
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
DoScriptText(SAY_BLASTMASTER_19,me);
|
||||
break;
|
||||
case 4:
|
||||
if (GameObject* pGo = me->SummonGameObject(183410, -542.199,-96.854,-155.790, 0, 0, 0, 0, 0, 1000))
|
||||
{
|
||||
GoSummonList.push_back(pGo->GetGUID());
|
||||
pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
DoScriptText(SAY_BLASTMASTER_15,me);
|
||||
break;
|
||||
case 6:
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[10], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[11], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[12], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[13], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[14], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
break;
|
||||
case 7:
|
||||
if (GameObject* pGo = me->SummonGameObject(183410, -507.820,-103.333,-151.353, 0, 0, 0, 0, 0, 1000))
|
||||
{
|
||||
GoSummonList.push_back(pGo->GetGUID());
|
||||
pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1); //We can't use it!
|
||||
Summon(6);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
if (GameObject* pGo = me->SummonGameObject(183410, -511.829,-86.249,-151.431, 0, 0, 0, 0, 0, 1000))
|
||||
{
|
||||
GoSummonList.push_back(pGo->GetGUID());
|
||||
pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1); //We can't use it!
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
if (Creature* pGrubbis = me->SummonCreature(NPC_GRUBBIS, SpawnPosition[15], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000))
|
||||
DoScriptText(SAY_GRUBBIS,pGrubbis);
|
||||
me->SummonCreature(NPC_CHOMPER, SpawnPosition[16], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateEscortAI(const uint32 uiDiff)
|
||||
{
|
||||
if (uiPhase)
|
||||
{
|
||||
if (uiTimer <= uiDiff)
|
||||
switch(uiPoint)
|
||||
{
|
||||
switch(uiPhase)
|
||||
{
|
||||
case 1:
|
||||
DoScriptText(SAY_BLASTMASTER_1,me);
|
||||
NextStep(1500,true);
|
||||
break;
|
||||
case 2:
|
||||
SetEscortPaused(false);
|
||||
NextStep(0,false,0);
|
||||
break;
|
||||
case 3:
|
||||
DoScriptText(SAY_BLASTMASTER_2,me);
|
||||
SetEscortPaused(false);
|
||||
NextStep(0,false,0);
|
||||
break;
|
||||
case 4:
|
||||
DoScriptText(SAY_BLASTMASTER_3,me);
|
||||
NextStep(3000,true);
|
||||
break;
|
||||
case 5:
|
||||
DoScriptText(SAY_BLASTMASTER_4,me);
|
||||
NextStep(3000,true);
|
||||
break;
|
||||
case 6:
|
||||
SetInFace(true);
|
||||
DoScriptText(SAY_BLASTMASTER_5,me);
|
||||
Summon(1);
|
||||
if (pInstance)
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
|
||||
pInstance->HandleGameObject(NULL,true,pGo);
|
||||
NextStep(3000,true);
|
||||
break;
|
||||
case 7:
|
||||
DoScriptText(SAY_BLASTMASTER_6,me);
|
||||
SetEscortPaused(false);
|
||||
NextStep(0,false,0);
|
||||
break;
|
||||
case 8:
|
||||
me->HandleEmoteCommand(EMOTE_STATE_WORK);
|
||||
NextStep(25000,true);
|
||||
break;
|
||||
case 9:
|
||||
Summon(2);
|
||||
NextStep(0,false);
|
||||
break;
|
||||
case 10:
|
||||
Summon(4);
|
||||
NextStep(0,false);
|
||||
break;
|
||||
case 11:
|
||||
DoScriptText(SAY_BLASTMASTER_17,me);
|
||||
NextStep(5000,true);
|
||||
break;
|
||||
case 12:
|
||||
DoScriptText(SAY_BLASTMASTER_18,me);
|
||||
NextStep(5000,true);
|
||||
break;
|
||||
case 13:
|
||||
DoScriptText(SAY_BLASTMASTER_20,me);
|
||||
CaveDestruction(true);
|
||||
NextStep(8000,true);
|
||||
break;
|
||||
case 14:
|
||||
DoScriptText(SAY_BLASTMASTER_21,me);
|
||||
NextStep(8500,true);
|
||||
break;
|
||||
case 15:
|
||||
DoScriptText(SAY_BLASTMASTER_22,me);
|
||||
NextStep(2000,true);
|
||||
break;
|
||||
case 16:
|
||||
DoScriptText(SAY_BLASTMASTER_23,me);
|
||||
SetInFace(false);
|
||||
if (pInstance)
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
|
||||
pInstance->HandleGameObject(NULL,true,pGo);
|
||||
NextStep(2000,true);
|
||||
break;
|
||||
case 17:
|
||||
SetEscortPaused(false);
|
||||
DoScriptText(SAY_BLASTMASTER_24,me);
|
||||
case 3:
|
||||
SetEscortPaused(true);
|
||||
NextStep(2000,false,3);
|
||||
break;
|
||||
case 7:
|
||||
SetEscortPaused(true);
|
||||
NextStep(2000,false,4);
|
||||
break;
|
||||
case 9:
|
||||
NextStep(1000,false,8);
|
||||
break;
|
||||
case 10:
|
||||
NextStep(25000,false,10);
|
||||
break;
|
||||
case 11:
|
||||
SetEscortPaused(true);
|
||||
SetInFace(true);
|
||||
NextStep(1000,false,11);
|
||||
break;
|
||||
case 12:
|
||||
NextStep(25000,false,18);
|
||||
break;
|
||||
case 13:
|
||||
Summon(7);
|
||||
NextStep(25000,false,19);
|
||||
break;
|
||||
case 14:
|
||||
SetInFace(false);
|
||||
DoScriptText(SAY_BLASTMASTER_26,me);
|
||||
SetEscortPaused(true);
|
||||
NextStep(5000,false,20);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 uiI,uint32 uiValue)
|
||||
{
|
||||
switch(uiI)
|
||||
{
|
||||
case 1:
|
||||
SetEscortPaused(true);
|
||||
DoScriptText(SAY_BLASTMASTER_0,me);
|
||||
NextStep(1500,true);
|
||||
break;
|
||||
case 2:
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
switch(uiValue)
|
||||
{
|
||||
case 1:
|
||||
pInstance->SetData(TYPE_EVENT, IN_PROGRESS);
|
||||
break;
|
||||
case 2:
|
||||
pInstance->SetData(TYPE_EVENT, DONE);
|
||||
NextStep(5000,false,22);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Summon(uint8 uiCase)
|
||||
{
|
||||
switch(uiCase)
|
||||
{
|
||||
case 1:
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[4], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[5], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[6], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[7], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[8], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[9], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
break;
|
||||
case 2:
|
||||
if (GameObject* pGo = me->SummonGameObject(183410, -533.140,-105.322,-156.016, 0, 0, 0, 0, 0, 1000))
|
||||
{
|
||||
GoSummonList.push_back(pGo->GetGUID());
|
||||
pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1); //We can't use it!
|
||||
}
|
||||
Summon(3);
|
||||
break;
|
||||
case 3:
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
DoScriptText(SAY_BLASTMASTER_19,me);
|
||||
break;
|
||||
case 4:
|
||||
if (GameObject* pGo = me->SummonGameObject(183410, -542.199,-96.854,-155.790, 0, 0, 0, 0, 0, 1000))
|
||||
{
|
||||
GoSummonList.push_back(pGo->GetGUID());
|
||||
pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
DoScriptText(SAY_BLASTMASTER_15,me);
|
||||
break;
|
||||
case 6:
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[10], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[11], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[12], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[13], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[14], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
break;
|
||||
case 7:
|
||||
if (GameObject* pGo = me->SummonGameObject(183410, -507.820,-103.333,-151.353, 0, 0, 0, 0, 0, 1000))
|
||||
{
|
||||
GoSummonList.push_back(pGo->GetGUID());
|
||||
pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1); //We can't use it!
|
||||
Summon(6);
|
||||
NextStep(0,false);
|
||||
break;
|
||||
case 18:
|
||||
Summon(7);
|
||||
NextStep(0,false);
|
||||
break;
|
||||
case 19:
|
||||
SetInFace(false);
|
||||
Summon(8);
|
||||
DoScriptText(SAY_BLASTMASTER_25,me);
|
||||
NextStep(0,false);
|
||||
break;
|
||||
case 20:
|
||||
DoScriptText(SAY_BLASTMASTER_27,me);
|
||||
NextStep(2000,true);
|
||||
break;
|
||||
case 21:
|
||||
Summon(9);
|
||||
NextStep(0,false);
|
||||
break;
|
||||
case 22:
|
||||
CaveDestruction(false);
|
||||
DoScriptText(SAY_BLASTMASTER_20,me);
|
||||
NextStep(0,false);
|
||||
break;
|
||||
}
|
||||
} else uiTimer -= uiDiff;
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
if (GameObject* pGo = me->SummonGameObject(183410, -511.829,-86.249,-151.431, 0, 0, 0, 0, 0, 1000))
|
||||
{
|
||||
GoSummonList.push_back(pGo->GetGUID());
|
||||
pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1); //We can't use it!
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
if (Creature* pGrubbis = me->SummonCreature(NPC_GRUBBIS, SpawnPosition[15], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000))
|
||||
DoScriptText(SAY_GRUBBIS,pGrubbis);
|
||||
me->SummonCreature(NPC_CHOMPER, SpawnPosition[16], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
void UpdateEscortAI(const uint32 uiDiff)
|
||||
{
|
||||
if (uiPhase)
|
||||
{
|
||||
if (uiTimer <= uiDiff)
|
||||
{
|
||||
switch(uiPhase)
|
||||
{
|
||||
case 1:
|
||||
DoScriptText(SAY_BLASTMASTER_1,me);
|
||||
NextStep(1500,true);
|
||||
break;
|
||||
case 2:
|
||||
SetEscortPaused(false);
|
||||
NextStep(0,false,0);
|
||||
break;
|
||||
case 3:
|
||||
DoScriptText(SAY_BLASTMASTER_2,me);
|
||||
SetEscortPaused(false);
|
||||
NextStep(0,false,0);
|
||||
break;
|
||||
case 4:
|
||||
DoScriptText(SAY_BLASTMASTER_3,me);
|
||||
NextStep(3000,true);
|
||||
break;
|
||||
case 5:
|
||||
DoScriptText(SAY_BLASTMASTER_4,me);
|
||||
NextStep(3000,true);
|
||||
break;
|
||||
case 6:
|
||||
SetInFace(true);
|
||||
DoScriptText(SAY_BLASTMASTER_5,me);
|
||||
Summon(1);
|
||||
if (pInstance)
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
|
||||
pInstance->HandleGameObject(NULL,true,pGo);
|
||||
NextStep(3000,true);
|
||||
break;
|
||||
case 7:
|
||||
DoScriptText(SAY_BLASTMASTER_6,me);
|
||||
SetEscortPaused(false);
|
||||
NextStep(0,false,0);
|
||||
break;
|
||||
case 8:
|
||||
me->HandleEmoteCommand(EMOTE_STATE_WORK);
|
||||
NextStep(25000,true);
|
||||
break;
|
||||
case 9:
|
||||
Summon(2);
|
||||
NextStep(0,false);
|
||||
break;
|
||||
case 10:
|
||||
Summon(4);
|
||||
NextStep(0,false);
|
||||
break;
|
||||
case 11:
|
||||
DoScriptText(SAY_BLASTMASTER_17,me);
|
||||
NextStep(5000,true);
|
||||
break;
|
||||
case 12:
|
||||
DoScriptText(SAY_BLASTMASTER_18,me);
|
||||
NextStep(5000,true);
|
||||
break;
|
||||
case 13:
|
||||
DoScriptText(SAY_BLASTMASTER_20,me);
|
||||
CaveDestruction(true);
|
||||
NextStep(8000,true);
|
||||
break;
|
||||
case 14:
|
||||
DoScriptText(SAY_BLASTMASTER_21,me);
|
||||
NextStep(8500,true);
|
||||
break;
|
||||
case 15:
|
||||
DoScriptText(SAY_BLASTMASTER_22,me);
|
||||
NextStep(2000,true);
|
||||
break;
|
||||
case 16:
|
||||
DoScriptText(SAY_BLASTMASTER_23,me);
|
||||
SetInFace(false);
|
||||
if (pInstance)
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
|
||||
pInstance->HandleGameObject(NULL,true,pGo);
|
||||
NextStep(2000,true);
|
||||
break;
|
||||
case 17:
|
||||
SetEscortPaused(false);
|
||||
DoScriptText(SAY_BLASTMASTER_24,me);
|
||||
Summon(6);
|
||||
NextStep(0,false);
|
||||
break;
|
||||
case 18:
|
||||
Summon(7);
|
||||
NextStep(0,false);
|
||||
break;
|
||||
case 19:
|
||||
SetInFace(false);
|
||||
Summon(8);
|
||||
DoScriptText(SAY_BLASTMASTER_25,me);
|
||||
NextStep(0,false);
|
||||
break;
|
||||
case 20:
|
||||
DoScriptText(SAY_BLASTMASTER_27,me);
|
||||
NextStep(2000,true);
|
||||
break;
|
||||
case 21:
|
||||
Summon(9);
|
||||
NextStep(0,false);
|
||||
break;
|
||||
case 22:
|
||||
CaveDestruction(false);
|
||||
DoScriptText(SAY_BLASTMASTER_20,me);
|
||||
NextStep(0,false);
|
||||
break;
|
||||
}
|
||||
} else uiTimer -= uiDiff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* pSummon)
|
||||
{
|
||||
SummonList.push_back(pSummon->GetGUID());
|
||||
AggroAllPlayers(pSummon);
|
||||
}
|
||||
};
|
||||
|
||||
void JustSummoned(Creature* pSummon)
|
||||
{
|
||||
SummonList.push_back(pSummon->GetGUID());
|
||||
AggroAllPlayers(pSummon);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_npc_blastmaster_emi_shortfuse(Creature* pCreature)
|
||||
|
||||
|
||||
class boss_grubbis : public CreatureScript
|
||||
{
|
||||
return new npc_blastmaster_emi_shortfuseAI(pCreature);
|
||||
}
|
||||
public:
|
||||
boss_grubbis() : CreatureScript("boss_grubbis") { }
|
||||
|
||||
bool GossipHello_npc_blastmaster_emi_shortfuse(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
ScriptedInstance* pInstance = pCreature->GetInstanceData();
|
||||
|
||||
if (pInstance && pInstance->GetData(TYPE_EVENT) == NOT_STARTED)
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_START_EVENT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_EMI, pCreature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect_npc_blastmaster_emi_shortfuse(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
|
||||
{
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
if (npc_escortAI* pEscortAI = CAST_AI(npc_blastmaster_emi_shortfuseAI, pCreature->AI()))
|
||||
pEscortAI->Start(true, false,pPlayer->GetGUID());
|
||||
|
||||
pCreature->setFaction(pPlayer->getFaction());
|
||||
pCreature->AI()->SetData(1,0);
|
||||
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
struct boss_grubbisAI : public ScriptedAI
|
||||
{
|
||||
boss_grubbisAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
SetDataSummoner();
|
||||
return new boss_grubbisAI(pCreature);
|
||||
}
|
||||
|
||||
void SetDataSummoner()
|
||||
struct boss_grubbisAI : public ScriptedAI
|
||||
{
|
||||
if (!me->isSummon())
|
||||
return;
|
||||
boss_grubbisAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
SetDataSummoner();
|
||||
}
|
||||
|
||||
if (Unit* pSummon = CAST_SUM(me)->GetSummoner())
|
||||
CAST_CRE(pSummon)->AI()->SetData(2,1);
|
||||
}
|
||||
void SetDataSummoner()
|
||||
{
|
||||
if (!me->isSummon())
|
||||
return;
|
||||
|
||||
void UpdateAI(const uint32 /*diff*/)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
if (Unit* pSummon = CAST_SUM(me)->GetSummoner())
|
||||
CAST_CRE(pSummon)->AI()->SetData(2,1);
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void UpdateAI(const uint32 /*diff*/)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
void JustDied(Unit* /*pKiller*/)
|
||||
{
|
||||
if (!me->isSummon())
|
||||
return;
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*pKiller*/)
|
||||
{
|
||||
if (!me->isSummon())
|
||||
return;
|
||||
|
||||
if (Unit* pSummon = CAST_SUM(me)->GetSummoner())
|
||||
CAST_CRE(pSummon)->AI()->SetData(2,2);
|
||||
}
|
||||
};
|
||||
|
||||
if (Unit* pSummon = CAST_SUM(me)->GetSummoner())
|
||||
CAST_CRE(pSummon)->AI()->SetData(2,2);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_grubbis(Creature* pCreature)
|
||||
{
|
||||
return new boss_grubbisAI(pCreature);
|
||||
}
|
||||
|
||||
void AddSC_gnomeregan()
|
||||
{
|
||||
Script* newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_blastmaster_emi_shortfuse";
|
||||
newscript->pGossipHello = &GossipHello_npc_blastmaster_emi_shortfuse;
|
||||
newscript->pGossipSelect = &GossipSelect_npc_blastmaster_emi_shortfuse;
|
||||
newscript->GetAI = &GetAI_npc_blastmaster_emi_shortfuse;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_grubbis";
|
||||
newscript->GetAI = &GetAI_boss_grubbis;
|
||||
newscript->RegisterSelf();
|
||||
new npc_blastmaster_emi_shortfuse();
|
||||
new boss_grubbis();
|
||||
}
|
||||
|
||||
@@ -19,122 +19,124 @@
|
||||
#include "gnomeregan.h"
|
||||
|
||||
#define MAX_ENCOUNTER 1
|
||||
|
||||
struct instance_gnomeregan : public ScriptedInstance
|
||||
class instance_gnomeregan : public InstanceMapScript
|
||||
{
|
||||
instance_gnomeregan(Map* pMap) : ScriptedInstance(pMap)
|
||||
public:
|
||||
instance_gnomeregan() : InstanceMapScript("instance_gnomeregan") { }
|
||||
|
||||
InstanceScript* GetInstanceData_InstanceMapScript(Map* pMap)
|
||||
{
|
||||
Initialize();
|
||||
return new instance_gnomeregan_InstanceMapScript(pMap);
|
||||
}
|
||||
|
||||
struct instance_gnomeregan_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_gnomeregan_InstanceMapScript(Map* pMap) : InstanceScript(pMap)
|
||||
{
|
||||
Initialize();
|
||||
};
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
|
||||
uint64 uiCaveInLeftGUID;
|
||||
uint64 uiCaveInRightGUID;
|
||||
|
||||
uint64 uiBastmasterEmiShortfuseGUID;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
uiCaveInLeftGUID = 0;
|
||||
uiCaveInRightGUID = 0;
|
||||
|
||||
uiBastmasterEmiShortfuseGUID = 0;
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(in);
|
||||
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> m_auiEncounter[0];
|
||||
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
{
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* pCreature, bool /*bAdd*/)
|
||||
{
|
||||
switch(pCreature->GetEntry())
|
||||
{
|
||||
case NPC_BLASTMASTER_EMI_SHORTFUSE: uiBastmasterEmiShortfuseGUID = pCreature->GetGUID(); break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* pGo, bool /*bAdd*/)
|
||||
{
|
||||
switch(pGo->GetEntry())
|
||||
{
|
||||
case GO_CAVE_IN_LEFT:
|
||||
uiCaveInLeftGUID = pGo->GetGUID();
|
||||
if (m_auiEncounter[0] == DONE || m_auiEncounter[0] == NOT_STARTED)
|
||||
HandleGameObject(NULL,false,pGo);
|
||||
break;
|
||||
case GO_CAVE_IN_RIGHT:
|
||||
uiCaveInRightGUID = pGo->GetGUID();
|
||||
if (m_auiEncounter[0] == DONE || m_auiEncounter[0] == NOT_STARTED)
|
||||
HandleGameObject(NULL,false,pGo);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 uiType, uint32 uiData)
|
||||
{
|
||||
switch(uiType)
|
||||
{
|
||||
case TYPE_EVENT:
|
||||
m_auiEncounter[0] = uiData;
|
||||
if (uiData == DONE)
|
||||
SaveToDB();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 uiType, uint32 /*uiData*/)
|
||||
{
|
||||
switch(uiType)
|
||||
{
|
||||
case TYPE_EVENT: return m_auiEncounter[0];
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 uiType)
|
||||
{
|
||||
switch(uiType)
|
||||
{
|
||||
case DATA_GO_CAVE_IN_LEFT: return uiCaveInLeftGUID;
|
||||
case DATA_GO_CAVE_IN_RIGHT: return uiCaveInRightGUID;
|
||||
case DATA_NPC_BASTMASTER_EMI_SHORTFUSE: return uiBastmasterEmiShortfuseGUID;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
|
||||
uint64 uiCaveInLeftGUID;
|
||||
uint64 uiCaveInRightGUID;
|
||||
|
||||
uint64 uiBastmasterEmiShortfuseGUID;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
uiCaveInLeftGUID = 0;
|
||||
uiCaveInRightGUID = 0;
|
||||
|
||||
uiBastmasterEmiShortfuseGUID = 0;
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(in);
|
||||
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> m_auiEncounter[0];
|
||||
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
{
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* pCreature, bool /*bAdd*/)
|
||||
{
|
||||
switch(pCreature->GetEntry())
|
||||
{
|
||||
case NPC_BLASTMASTER_EMI_SHORTFUSE: uiBastmasterEmiShortfuseGUID = pCreature->GetGUID(); break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* pGo, bool /*bAdd*/)
|
||||
{
|
||||
switch(pGo->GetEntry())
|
||||
{
|
||||
case GO_CAVE_IN_LEFT:
|
||||
uiCaveInLeftGUID = pGo->GetGUID();
|
||||
if (m_auiEncounter[0] == DONE || m_auiEncounter[0] == NOT_STARTED)
|
||||
HandleGameObject(NULL,false,pGo);
|
||||
break;
|
||||
case GO_CAVE_IN_RIGHT:
|
||||
uiCaveInRightGUID = pGo->GetGUID();
|
||||
if (m_auiEncounter[0] == DONE || m_auiEncounter[0] == NOT_STARTED)
|
||||
HandleGameObject(NULL,false,pGo);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 uiType, uint32 uiData)
|
||||
{
|
||||
switch(uiType)
|
||||
{
|
||||
case TYPE_EVENT:
|
||||
m_auiEncounter[0] = uiData;
|
||||
if (uiData == DONE)
|
||||
SaveToDB();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 uiType, uint32 /*uiData*/)
|
||||
{
|
||||
switch(uiType)
|
||||
{
|
||||
case TYPE_EVENT: return m_auiEncounter[0];
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 uiType)
|
||||
{
|
||||
switch(uiType)
|
||||
{
|
||||
case DATA_GO_CAVE_IN_LEFT: return uiCaveInLeftGUID;
|
||||
case DATA_GO_CAVE_IN_RIGHT: return uiCaveInRightGUID;
|
||||
case DATA_NPC_BASTMASTER_EMI_SHORTFUSE: return uiBastmasterEmiShortfuseGUID;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
InstanceData* GetInstanceData_instance_gnomeregan(Map* pMap)
|
||||
{
|
||||
return new instance_gnomeregan(pMap);
|
||||
}
|
||||
|
||||
void AddSC_instance_gnomeregan()
|
||||
{
|
||||
Script* newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "instance_gnomeregan";
|
||||
newscript->GetInstanceData = &GetInstanceData_instance_gnomeregan;
|
||||
newscript->RegisterSelf();
|
||||
new instance_gnomeregan();
|
||||
}
|
||||
|
||||
@@ -42,157 +42,160 @@ EndScriptData */
|
||||
#define SPELL_EVOCATION 30254
|
||||
#define SPELL_ENRAGE 30403 //Arcane Infusion: Transforms Curator and adds damage.
|
||||
#define SPELL_BERSERK 26662
|
||||
|
||||
struct boss_curatorAI : public ScriptedAI
|
||||
class boss_curator : public CreatureScript
|
||||
{
|
||||
boss_curatorAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_curator() : CreatureScript("boss_curator") { }
|
||||
|
||||
uint32 AddTimer;
|
||||
uint32 HatefulBoltTimer;
|
||||
uint32 BerserkTimer;
|
||||
|
||||
bool Enraged;
|
||||
bool Evocating;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
AddTimer = 10000;
|
||||
HatefulBoltTimer = 15000; //This time may be wrong
|
||||
BerserkTimer = 720000; //12 minutes
|
||||
Enraged = false;
|
||||
Evocating = false;
|
||||
|
||||
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_ARCANE, true);
|
||||
return new boss_curatorAI (pCreature);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * /*victim*/)
|
||||
struct boss_curatorAI : public ScriptedAI
|
||||
{
|
||||
DoScriptText(RAND(SAY_KILL1,SAY_KILL2), me);
|
||||
}
|
||||
boss_curatorAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void JustDied(Unit * /*victim*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
}
|
||||
uint32 AddTimer;
|
||||
uint32 HatefulBoltTimer;
|
||||
uint32 BerserkTimer;
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
}
|
||||
bool Enraged;
|
||||
bool Evocating;
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//always decrease BerserkTimer
|
||||
if (BerserkTimer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
//if evocate, then break evocate
|
||||
AddTimer = 10000;
|
||||
HatefulBoltTimer = 15000; //This time may be wrong
|
||||
BerserkTimer = 720000; //12 minutes
|
||||
Enraged = false;
|
||||
Evocating = false;
|
||||
|
||||
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_ARCANE, true);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * /*victim*/)
|
||||
{
|
||||
DoScriptText(RAND(SAY_KILL1,SAY_KILL2), me);
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*victim*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//always decrease BerserkTimer
|
||||
if (BerserkTimer <= diff)
|
||||
{
|
||||
//if evocate, then break evocate
|
||||
if (Evocating)
|
||||
{
|
||||
if (me->HasAura(SPELL_EVOCATION))
|
||||
me->RemoveAurasDueToSpell(SPELL_EVOCATION);
|
||||
|
||||
Evocating = false;
|
||||
}
|
||||
|
||||
//may not be correct SAY (generic hard enrage)
|
||||
DoScriptText(SAY_ENRAGE, me);
|
||||
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
DoCast(me, SPELL_BERSERK);
|
||||
|
||||
//don't know if he's supposed to do summon/evocate after hard enrage (probably not)
|
||||
Enraged = true;
|
||||
} else BerserkTimer -= diff;
|
||||
|
||||
if (Evocating)
|
||||
{
|
||||
//not supposed to do anything while evocate
|
||||
if (me->HasAura(SPELL_EVOCATION))
|
||||
me->RemoveAurasDueToSpell(SPELL_EVOCATION);
|
||||
|
||||
Evocating = false;
|
||||
return;
|
||||
else
|
||||
Evocating = false;
|
||||
}
|
||||
|
||||
//may not be correct SAY (generic hard enrage)
|
||||
DoScriptText(SAY_ENRAGE, me);
|
||||
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
DoCast(me, SPELL_BERSERK);
|
||||
|
||||
//don't know if he's supposed to do summon/evocate after hard enrage (probably not)
|
||||
Enraged = true;
|
||||
} else BerserkTimer -= diff;
|
||||
|
||||
if (Evocating)
|
||||
{
|
||||
//not supposed to do anything while evocate
|
||||
if (me->HasAura(SPELL_EVOCATION))
|
||||
return;
|
||||
else
|
||||
Evocating = false;
|
||||
}
|
||||
|
||||
if (!Enraged)
|
||||
{
|
||||
if (AddTimer <= diff)
|
||||
if (!Enraged)
|
||||
{
|
||||
//Summon Astral Flare
|
||||
Creature* AstralFlare = DoSpawnCreature(17096, rand()%37, rand()%37, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
Unit *pTarget = NULL;
|
||||
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
|
||||
if (AstralFlare && pTarget)
|
||||
if (AddTimer <= diff)
|
||||
{
|
||||
AstralFlare->CastSpell(AstralFlare, SPELL_ASTRAL_FLARE_PASSIVE, false);
|
||||
AstralFlare->AI()->AttackStart(pTarget);
|
||||
}
|
||||
//Summon Astral Flare
|
||||
Creature* AstralFlare = DoSpawnCreature(17096, rand()%37, rand()%37, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
Unit *pTarget = NULL;
|
||||
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
|
||||
//Reduce Mana by 10% of max health
|
||||
if (int32 mana = me->GetMaxPower(POWER_MANA))
|
||||
{
|
||||
mana /= 10;
|
||||
me->ModifyPower(POWER_MANA, -mana);
|
||||
|
||||
//if this get's us below 10%, then we evocate (the 10th should be summoned now)
|
||||
if (me->GetPower(POWER_MANA)*100 / me->GetMaxPower(POWER_MANA) < 10)
|
||||
if (AstralFlare && pTarget)
|
||||
{
|
||||
DoScriptText(SAY_EVOCATE, me);
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
DoCast(me, SPELL_EVOCATION);
|
||||
Evocating = true;
|
||||
//no AddTimer cooldown, this will make first flare appear instantly after evocate end, like expected
|
||||
return;
|
||||
AstralFlare->CastSpell(AstralFlare, SPELL_ASTRAL_FLARE_PASSIVE, false);
|
||||
AstralFlare->AI()->AttackStart(pTarget);
|
||||
}
|
||||
else
|
||||
|
||||
//Reduce Mana by 10% of max health
|
||||
if (int32 mana = me->GetMaxPower(POWER_MANA))
|
||||
{
|
||||
if (urand(0,1) == 0)
|
||||
mana /= 10;
|
||||
me->ModifyPower(POWER_MANA, -mana);
|
||||
|
||||
//if this get's us below 10%, then we evocate (the 10th should be summoned now)
|
||||
if (me->GetPower(POWER_MANA)*100 / me->GetMaxPower(POWER_MANA) < 10)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), me);
|
||||
DoScriptText(SAY_EVOCATE, me);
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
DoCast(me, SPELL_EVOCATION);
|
||||
Evocating = true;
|
||||
//no AddTimer cooldown, this will make first flare appear instantly after evocate end, like expected
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (urand(0,1) == 0)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), me);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AddTimer = 10000;
|
||||
} else AddTimer -= diff;
|
||||
|
||||
if (me->GetHealth()*100 / me->GetMaxHealth() <= 15)
|
||||
{
|
||||
Enraged = true;
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
DoScriptText(SAY_ENRAGE, me);
|
||||
}
|
||||
|
||||
AddTimer = 10000;
|
||||
} else AddTimer -= diff;
|
||||
|
||||
if (me->GetHealth()*100 / me->GetMaxHealth() <= 15)
|
||||
{
|
||||
Enraged = true;
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
DoScriptText(SAY_ENRAGE, me);
|
||||
}
|
||||
|
||||
if (HatefulBoltTimer <= diff)
|
||||
{
|
||||
if (Enraged)
|
||||
HatefulBoltTimer = 7000;
|
||||
else
|
||||
HatefulBoltTimer = 15000;
|
||||
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 1))
|
||||
DoCast(pTarget, SPELL_HATEFUL_BOLT);
|
||||
|
||||
} else HatefulBoltTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
if (HatefulBoltTimer <= diff)
|
||||
{
|
||||
if (Enraged)
|
||||
HatefulBoltTimer = 7000;
|
||||
else
|
||||
HatefulBoltTimer = 15000;
|
||||
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 1))
|
||||
DoCast(pTarget, SPELL_HATEFUL_BOLT);
|
||||
|
||||
} else HatefulBoltTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_curator(Creature* pCreature)
|
||||
{
|
||||
return new boss_curatorAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_curator()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_curator";
|
||||
newscript->GetAI = &GetAI_boss_curator;
|
||||
newscript->RegisterSelf();
|
||||
new boss_curator();
|
||||
}
|
||||
|
||||
@@ -38,103 +38,105 @@ EndScriptData */
|
||||
#define SPELL_HOLYWRATH 32445
|
||||
#define SPELL_HOLYGROUND 29512
|
||||
#define SPELL_BERSERK 26662
|
||||
|
||||
struct boss_maiden_of_virtueAI : public ScriptedAI
|
||||
class boss_maiden_of_virtue : public CreatureScript
|
||||
{
|
||||
boss_maiden_of_virtueAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_maiden_of_virtue() : CreatureScript("boss_maiden_of_virtue") { }
|
||||
|
||||
uint32 Repentance_Timer;
|
||||
uint32 Holyfire_Timer;
|
||||
uint32 Holywrath_Timer;
|
||||
uint32 Holyground_Timer;
|
||||
uint32 Enrage_Timer;
|
||||
|
||||
bool Enraged;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
Repentance_Timer = 25000+(rand()%15000);
|
||||
Holyfire_Timer = 8000+(rand()%17000);
|
||||
Holywrath_Timer = 15000+(rand()%10000);
|
||||
Holyground_Timer = 3000;
|
||||
Enrage_Timer = 600000;
|
||||
|
||||
Enraged = false;
|
||||
return new boss_maiden_of_virtueAI (pCreature);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*Victim*/)
|
||||
struct boss_maiden_of_virtueAI : public ScriptedAI
|
||||
{
|
||||
if (urand(0,1) == 0)
|
||||
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
|
||||
}
|
||||
boss_maiden_of_virtueAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
}
|
||||
uint32 Repentance_Timer;
|
||||
uint32 Holyfire_Timer;
|
||||
uint32 Holywrath_Timer;
|
||||
uint32 Holyground_Timer;
|
||||
uint32 Enrage_Timer;
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
}
|
||||
bool Enraged;
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (Enrage_Timer < diff && !Enraged)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me, SPELL_BERSERK, true);
|
||||
Enraged = true;
|
||||
} else Enrage_Timer -= diff;
|
||||
Repentance_Timer = 25000+(rand()%15000);
|
||||
Holyfire_Timer = 8000+(rand()%17000);
|
||||
Holywrath_Timer = 15000+(rand()%10000);
|
||||
Holyground_Timer = 3000;
|
||||
Enrage_Timer = 600000;
|
||||
|
||||
if (Holyground_Timer <= diff)
|
||||
Enraged = false;
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*Victim*/)
|
||||
{
|
||||
DoCast(me, SPELL_HOLYGROUND, true); //Triggered so it doesn't interrupt her at all
|
||||
Holyground_Timer = 3000;
|
||||
} else Holyground_Timer -= diff;
|
||||
if (urand(0,1) == 0)
|
||||
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
|
||||
}
|
||||
|
||||
if (Repentance_Timer <= diff)
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_REPENTANCE);
|
||||
DoScriptText(RAND(SAY_REPENTANCE1,SAY_REPENTANCE2), me);
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
}
|
||||
|
||||
Repentance_Timer = urand(25000,35000); //A little randomness on that spell
|
||||
} else Repentance_Timer -= diff;
|
||||
|
||||
if (Holyfire_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_HOLYFIRE);
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
}
|
||||
|
||||
Holyfire_Timer = urand(8000,23000); //Anywhere from 8 to 23 seconds, good luck having several of those in a row!
|
||||
} else Holyfire_Timer -= diff;
|
||||
|
||||
if (Holywrath_Timer <= diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_HOLYWRATH);
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
Holywrath_Timer = urand(20000,25000); //20-30 secs sounds nice
|
||||
} else Holywrath_Timer -= diff;
|
||||
if (Enrage_Timer < diff && !Enraged)
|
||||
{
|
||||
DoCast(me, SPELL_BERSERK, true);
|
||||
Enraged = true;
|
||||
} else Enrage_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
if (Holyground_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_HOLYGROUND, true); //Triggered so it doesn't interrupt her at all
|
||||
Holyground_Timer = 3000;
|
||||
} else Holyground_Timer -= diff;
|
||||
|
||||
if (Repentance_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_REPENTANCE);
|
||||
DoScriptText(RAND(SAY_REPENTANCE1,SAY_REPENTANCE2), me);
|
||||
|
||||
Repentance_Timer = urand(25000,35000); //A little randomness on that spell
|
||||
} else Repentance_Timer -= diff;
|
||||
|
||||
if (Holyfire_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_HOLYFIRE);
|
||||
|
||||
Holyfire_Timer = urand(8000,23000); //Anywhere from 8 to 23 seconds, good luck having several of those in a row!
|
||||
} else Holyfire_Timer -= diff;
|
||||
|
||||
if (Holywrath_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_HOLYWRATH);
|
||||
|
||||
Holywrath_Timer = urand(20000,25000); //20-30 secs sounds nice
|
||||
} else Holywrath_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_maiden_of_virtue(Creature* pCreature)
|
||||
{
|
||||
return new boss_maiden_of_virtueAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_maiden_of_virtue()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_maiden_of_virtue";
|
||||
newscript->GetAI = &GetAI_boss_maiden_of_virtue;
|
||||
newscript->RegisterSelf();
|
||||
new boss_maiden_of_virtue();
|
||||
}
|
||||
|
||||
|
||||
@@ -45,268 +45,271 @@ EndScriptData */
|
||||
|
||||
//Attumen (TODO: Use the summoning spell instead of Creature id. It works , but is not convenient for us)
|
||||
#define SUMMON_ATTUMEN 15550
|
||||
|
||||
struct boss_midnightAI : public ScriptedAI
|
||||
class boss_attumen : public CreatureScript
|
||||
{
|
||||
boss_midnightAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_attumen() : CreatureScript("boss_attumen") { }
|
||||
|
||||
uint64 Attumen;
|
||||
uint8 Phase;
|
||||
uint32 Mount_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
Phase = 1;
|
||||
Attumen = 0;
|
||||
Mount_Timer = 0;
|
||||
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetVisibility(VISIBILITY_ON);
|
||||
return new boss_attumenAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) {}
|
||||
|
||||
void KilledUnit(Unit * /*victim*/)
|
||||
struct boss_attumenAI : public ScriptedAI
|
||||
{
|
||||
if (Phase == 2)
|
||||
boss_attumenAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
if (Unit *pUnit = Unit::GetUnit(*me, Attumen))
|
||||
DoScriptText(SAY_MIDNIGHT_KILL, pUnit);
|
||||
}
|
||||
}
|
||||
Phase = 1;
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (Phase == 1 && (me->GetHealth()*100)/me->GetMaxHealth() < 95)
|
||||
{
|
||||
Phase = 2;
|
||||
if (Creature* pAttumen = me->SummonCreature(SUMMON_ATTUMEN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000))
|
||||
{
|
||||
Attumen = pAttumen->GetGUID();
|
||||
pAttumen->AI()->AttackStart(me->getVictim());
|
||||
SetMidnight(pAttumen, me->GetGUID());
|
||||
DoScriptText(RAND(SAY_APPEAR1,SAY_APPEAR2,SAY_APPEAR3), pAttumen);
|
||||
}
|
||||
}
|
||||
else if (Phase == 2 && (me->GetHealth()*100)/me->GetMaxHealth() < 25)
|
||||
{
|
||||
if (Unit *pAttumen = Unit::GetUnit(*me, Attumen))
|
||||
Mount(pAttumen);
|
||||
}
|
||||
else if (Phase == 3)
|
||||
{
|
||||
if (Mount_Timer)
|
||||
{
|
||||
if (Mount_Timer <= diff)
|
||||
{
|
||||
Mount_Timer = 0;
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
if (Unit *pAttumen = Unit::GetUnit(*me, Attumen))
|
||||
{
|
||||
pAttumen->SetDisplayId(MOUNTED_DISPLAYID);
|
||||
pAttumen->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
if (pAttumen->getVictim())
|
||||
{
|
||||
pAttumen->GetMotionMaster()->MoveChase(pAttumen->getVictim());
|
||||
pAttumen->SetUInt64Value(UNIT_FIELD_TARGET, pAttumen->getVictim()->GetGUID());
|
||||
}
|
||||
pAttumen->SetFloatValue(OBJECT_FIELD_SCALE_X,1);
|
||||
}
|
||||
} else Mount_Timer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
if (Phase != 3)
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void Mount(Unit *pAttumen)
|
||||
{
|
||||
DoScriptText(SAY_MOUNT, pAttumen);
|
||||
Phase = 3;
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
pAttumen->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
float angle = me->GetAngle(pAttumen);
|
||||
float distance = me->GetDistance2d(pAttumen);
|
||||
float newX = me->GetPositionX() + cos(angle)*(distance/2) ;
|
||||
float newY = me->GetPositionY() + sin(angle)*(distance/2) ;
|
||||
float newZ = 50;
|
||||
//me->Relocate(newX,newY,newZ,angle);
|
||||
//me->SendMonsterMove(newX, newY, newZ, 0, true, 1000);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MovePoint(0, newX, newY, newZ);
|
||||
distance += 10;
|
||||
newX = me->GetPositionX() + cos(angle)*(distance/2) ;
|
||||
newY = me->GetPositionY() + sin(angle)*(distance/2) ;
|
||||
pAttumen->GetMotionMaster()->Clear();
|
||||
pAttumen->GetMotionMaster()->MovePoint(0, newX, newY, newZ);
|
||||
//pAttumen->Relocate(newX,newY,newZ,-angle);
|
||||
//pAttumen->SendMonsterMove(newX, newY, newZ, 0, true, 1000);
|
||||
Mount_Timer = 1000;
|
||||
}
|
||||
|
||||
void SetMidnight(Creature *, uint64); //Below ..
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_midnight(Creature* pCreature)
|
||||
{
|
||||
return new boss_midnightAI(pCreature);
|
||||
}
|
||||
|
||||
struct boss_attumenAI : public ScriptedAI
|
||||
{
|
||||
boss_attumenAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
Phase = 1;
|
||||
|
||||
CleaveTimer = urand(10000,15000);
|
||||
CurseTimer = 30000;
|
||||
RandomYellTimer = urand(30000,60000); //Occasionally yell
|
||||
ChargeTimer = 20000;
|
||||
ResetTimer = 0;
|
||||
}
|
||||
|
||||
uint64 Midnight;
|
||||
uint8 Phase;
|
||||
uint32 CleaveTimer;
|
||||
uint32 CurseTimer;
|
||||
uint32 RandomYellTimer;
|
||||
uint32 ChargeTimer; //only when mounted
|
||||
uint32 ResetTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
ResetTimer = 2000;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) {}
|
||||
|
||||
void KilledUnit(Unit * /*victim*/)
|
||||
{
|
||||
DoScriptText(RAND(SAY_KILL1,SAY_KILL2), me);
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*victim*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
if (Unit *pMidnight = Unit::GetUnit(*me, Midnight))
|
||||
pMidnight->Kill(pMidnight);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (ResetTimer)
|
||||
{
|
||||
if (ResetTimer <= diff)
|
||||
{
|
||||
ResetTimer = 0;
|
||||
Unit *pMidnight = Unit::GetUnit(*me, Midnight);
|
||||
if (pMidnight)
|
||||
{
|
||||
pMidnight->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
pMidnight->SetVisibility(VISIBILITY_ON);
|
||||
}
|
||||
Midnight = 0;
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->Kill(me);
|
||||
}
|
||||
} else ResetTimer -= diff;
|
||||
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE))
|
||||
return;
|
||||
|
||||
if (CleaveTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWCLEAVE);
|
||||
CleaveTimer = urand(10000,15000);
|
||||
} else CleaveTimer -= diff;
|
||||
|
||||
if (CurseTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_INTANGIBLE_PRESENCE);
|
||||
CurseTimer = 30000;
|
||||
} else CurseTimer -= diff;
|
||||
|
||||
if (RandomYellTimer <= diff)
|
||||
{
|
||||
DoScriptText(RAND(SAY_RANDOM1,SAY_RANDOM2), me);
|
||||
RandomYellTimer = urand(30000,60000);
|
||||
} else RandomYellTimer -= diff;
|
||||
|
||||
if (me->GetUInt32Value(UNIT_FIELD_DISPLAYID) == MOUNTED_DISPLAYID)
|
||||
{
|
||||
if (ChargeTimer <= diff)
|
||||
{
|
||||
Unit *pTarget = NULL;
|
||||
std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
|
||||
std::vector<Unit *> target_list;
|
||||
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
{
|
||||
pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (pTarget && !pTarget->IsWithinDist(me, ATTACK_DISTANCE, false))
|
||||
target_list.push_back(pTarget);
|
||||
pTarget = NULL;
|
||||
}
|
||||
if (target_list.size())
|
||||
pTarget = *(target_list.begin()+rand()%target_list.size());
|
||||
|
||||
DoCast(pTarget, SPELL_BERSERKER_CHARGE);
|
||||
ChargeTimer = 20000;
|
||||
} else ChargeTimer -= diff;
|
||||
RandomYellTimer = urand(30000,60000); //Occasionally yell
|
||||
ChargeTimer = 20000;
|
||||
ResetTimer = 0;
|
||||
}
|
||||
else
|
||||
|
||||
uint64 Midnight;
|
||||
uint8 Phase;
|
||||
uint32 CleaveTimer;
|
||||
uint32 CurseTimer;
|
||||
uint32 RandomYellTimer;
|
||||
uint32 ChargeTimer; //only when mounted
|
||||
uint32 ResetTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if ((me->GetHealth()*100)/me->GetMaxHealth() < 25)
|
||||
ResetTimer = 2000;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) {}
|
||||
|
||||
void KilledUnit(Unit * /*victim*/)
|
||||
{
|
||||
DoScriptText(RAND(SAY_KILL1,SAY_KILL2), me);
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*victim*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
if (Unit *pMidnight = Unit::GetUnit(*me, Midnight))
|
||||
pMidnight->Kill(pMidnight);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff);
|
||||
|
||||
void SpellHit(Unit * /*source*/, const SpellEntry *spell)
|
||||
{
|
||||
if (spell->Mechanic == MECHANIC_DISARM)
|
||||
DoScriptText(SAY_DISARMED, me);
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
class boss_midnight : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_midnight() : CreatureScript("boss_midnight") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
return new boss_midnightAI(pCreature);
|
||||
}
|
||||
|
||||
struct boss_midnightAI : public ScriptedAI
|
||||
{
|
||||
boss_midnightAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
uint64 Attumen;
|
||||
uint8 Phase;
|
||||
uint32 Mount_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Phase = 1;
|
||||
Attumen = 0;
|
||||
Mount_Timer = 0;
|
||||
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetVisibility(VISIBILITY_ON);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) {}
|
||||
|
||||
void KilledUnit(Unit * /*victim*/)
|
||||
{
|
||||
if (Phase == 2)
|
||||
{
|
||||
Creature *pMidnight = Unit::GetCreature(*me, Midnight);
|
||||
if (pMidnight && pMidnight->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
CAST_AI(boss_midnightAI, (pMidnight->AI()))->Mount(me);
|
||||
me->SetHealth(pMidnight->GetHealth());
|
||||
DoResetThreat();
|
||||
}
|
||||
if (Unit *pUnit = Unit::GetUnit(*me, Attumen))
|
||||
DoScriptText(SAY_MIDNIGHT_KILL, pUnit);
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (Phase == 1 && (me->GetHealth()*100)/me->GetMaxHealth() < 95)
|
||||
{
|
||||
Phase = 2;
|
||||
if (Creature* pAttumen = me->SummonCreature(SUMMON_ATTUMEN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000))
|
||||
{
|
||||
Attumen = pAttumen->GetGUID();
|
||||
pAttumen->AI()->AttackStart(me->getVictim());
|
||||
SetMidnight(pAttumen, me->GetGUID());
|
||||
DoScriptText(RAND(SAY_APPEAR1,SAY_APPEAR2,SAY_APPEAR3), pAttumen);
|
||||
}
|
||||
}
|
||||
else if (Phase == 2 && (me->GetHealth()*100)/me->GetMaxHealth() < 25)
|
||||
{
|
||||
if (Unit *pAttumen = Unit::GetUnit(*me, Attumen))
|
||||
Mount(pAttumen);
|
||||
}
|
||||
else if (Phase == 3)
|
||||
{
|
||||
if (Mount_Timer)
|
||||
{
|
||||
if (Mount_Timer <= diff)
|
||||
{
|
||||
Mount_Timer = 0;
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
if (Unit *pAttumen = Unit::GetUnit(*me, Attumen))
|
||||
{
|
||||
pAttumen->SetDisplayId(MOUNTED_DISPLAYID);
|
||||
pAttumen->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
if (pAttumen->getVictim())
|
||||
{
|
||||
pAttumen->GetMotionMaster()->MoveChase(pAttumen->getVictim());
|
||||
pAttumen->SetUInt64Value(UNIT_FIELD_TARGET, pAttumen->getVictim()->GetGUID());
|
||||
}
|
||||
pAttumen->SetFloatValue(OBJECT_FIELD_SCALE_X,1);
|
||||
}
|
||||
} else Mount_Timer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
if (Phase != 3)
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void Mount(Unit *pAttumen)
|
||||
{
|
||||
DoScriptText(SAY_MOUNT, pAttumen);
|
||||
Phase = 3;
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
pAttumen->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
float angle = me->GetAngle(pAttumen);
|
||||
float distance = me->GetDistance2d(pAttumen);
|
||||
float newX = me->GetPositionX() + cos(angle)*(distance/2) ;
|
||||
float newY = me->GetPositionY() + sin(angle)*(distance/2) ;
|
||||
float newZ = 50;
|
||||
//me->Relocate(newX,newY,newZ,angle);
|
||||
//me->SendMonsterMove(newX, newY, newZ, 0, true, 1000);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MovePoint(0, newX, newY, newZ);
|
||||
distance += 10;
|
||||
newX = me->GetPositionX() + cos(angle)*(distance/2) ;
|
||||
newY = me->GetPositionY() + sin(angle)*(distance/2) ;
|
||||
pAttumen->GetMotionMaster()->Clear();
|
||||
pAttumen->GetMotionMaster()->MovePoint(0, newX, newY, newZ);
|
||||
//pAttumen->Relocate(newX,newY,newZ,-angle);
|
||||
//pAttumen->SendMonsterMove(newX, newY, newZ, 0, true, 1000);
|
||||
Mount_Timer = 1000;
|
||||
}
|
||||
|
||||
void SetMidnight(Creature *pAttumen, uint64 value)
|
||||
{
|
||||
CAST_AI(boss_attumen::boss_attumenAI, pAttumen->AI())->Midnight = value;
|
||||
}
};
|
||||
|
||||
void SpellHit(Unit * /*source*/, const SpellEntry *spell)
|
||||
{
|
||||
if (spell->Mechanic == MECHANIC_DISARM)
|
||||
DoScriptText(SAY_DISARMED, me);
|
||||
}
|
||||
};
|
||||
|
||||
void boss_midnightAI::SetMidnight(Creature *pAttumen, uint64 value)
|
||||
void boss_attumen::boss_attumenAI::UpdateAI(const uint32 diff)
|
||||
{
|
||||
CAST_AI(boss_attumenAI, pAttumen->AI())->Midnight = value;
|
||||
if (ResetTimer)
|
||||
{
|
||||
if (ResetTimer <= diff)
|
||||
{
|
||||
ResetTimer = 0;
|
||||
Unit *pMidnight = Unit::GetUnit(*me, Midnight);
|
||||
if (pMidnight)
|
||||
{
|
||||
pMidnight->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
pMidnight->SetVisibility(VISIBILITY_ON);
|
||||
}
|
||||
Midnight = 0;
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->Kill(me);
|
||||
}
|
||||
} else ResetTimer -= diff;
|
||||
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE))
|
||||
return;
|
||||
|
||||
if (CleaveTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWCLEAVE);
|
||||
CleaveTimer = urand(10000,15000);
|
||||
} else CleaveTimer -= diff;
|
||||
|
||||
if (CurseTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_INTANGIBLE_PRESENCE);
|
||||
CurseTimer = 30000;
|
||||
} else CurseTimer -= diff;
|
||||
|
||||
if (RandomYellTimer <= diff)
|
||||
{
|
||||
DoScriptText(RAND(SAY_RANDOM1,SAY_RANDOM2), me);
|
||||
RandomYellTimer = urand(30000,60000);
|
||||
} else RandomYellTimer -= diff;
|
||||
|
||||
if (me->GetUInt32Value(UNIT_FIELD_DISPLAYID) == MOUNTED_DISPLAYID)
|
||||
{
|
||||
if (ChargeTimer <= diff)
|
||||
{
|
||||
Unit *pTarget = NULL;
|
||||
std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
|
||||
std::vector<Unit *> target_list;
|
||||
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
{
|
||||
pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (pTarget && !pTarget->IsWithinDist(me, ATTACK_DISTANCE, false))
|
||||
target_list.push_back(pTarget);
|
||||
pTarget = NULL;
|
||||
}
|
||||
if (target_list.size())
|
||||
pTarget = *(target_list.begin()+rand()%target_list.size());
|
||||
|
||||
DoCast(pTarget, SPELL_BERSERKER_CHARGE);
|
||||
ChargeTimer = 20000;
|
||||
} else ChargeTimer -= diff;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((me->GetHealth()*100)/me->GetMaxHealth() < 25)
|
||||
{
|
||||
Creature *pMidnight = Unit::GetCreature(*me, Midnight);
|
||||
if (pMidnight && pMidnight->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
CAST_AI(boss_midnight::boss_midnightAI, (pMidnight->AI()))->Mount(me);
|
||||
me->SetHealth(pMidnight->GetHealth());
|
||||
DoResetThreat();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_boss_attumen(Creature* pCreature)
|
||||
{
|
||||
return new boss_attumenAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_attumen()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_attumen";
|
||||
newscript->GetAI = &GetAI_boss_attumen;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_midnight";
|
||||
newscript->GetAI = &GetAI_boss_midnight;
|
||||
newscript->RegisterSelf();
|
||||
new boss_attumen();
|
||||
new boss_midnight();
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -57,283 +57,285 @@ const uint32 PortalBeam[3] = {30465,30464,30463};
|
||||
const uint32 PlayerBuff[3] = {30421,30422,30423};
|
||||
const uint32 NetherBuff[3] = {30466,30467,30468};
|
||||
const uint32 PlayerDebuff[3] = {38637,38638,38639};
|
||||
|
||||
struct boss_netherspiteAI : public ScriptedAI
|
||||
class boss_netherspite : public CreatureScript
|
||||
{
|
||||
boss_netherspiteAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
public:
|
||||
boss_netherspite() : CreatureScript("boss_netherspite") { }
|
||||
|
||||
for (int i=0; i<3; ++i)
|
||||
CreatureAI* GetAI(Creature *pCreature)
|
||||
{
|
||||
return new boss_netherspiteAI(pCreature);
|
||||
}
|
||||
|
||||
struct boss_netherspiteAI : public ScriptedAI
|
||||
{
|
||||
boss_netherspiteAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
PortalGUID[i] = 0;
|
||||
BeamTarget[i] = 0;
|
||||
BeamerGUID[i] = 0;
|
||||
}
|
||||
}
|
||||
pInstance = c->GetInstanceScript();
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
bool PortalPhase;
|
||||
bool Berserk;
|
||||
uint32 PhaseTimer; // timer for phase switching
|
||||
uint32 VoidZoneTimer;
|
||||
uint32 NetherInfusionTimer; // berserking timer
|
||||
uint32 NetherbreathTimer;
|
||||
uint32 EmpowermentTimer;
|
||||
uint32 PortalTimer; // timer for beam checking
|
||||
uint64 PortalGUID[3]; // guid's of portals
|
||||
uint64 BeamerGUID[3]; // guid's of auxiliary beaming portals
|
||||
uint64 BeamTarget[3]; // guid's of portals' current targets
|
||||
|
||||
bool IsBetween(WorldObject* u1, WorldObject *pTarget, WorldObject* u2) // the in-line checker
|
||||
{
|
||||
if (!u1 || !u2 || !pTarget)
|
||||
return false;
|
||||
|
||||
float xn, yn, xp, yp, xh, yh;
|
||||
xn = u1->GetPositionX();
|
||||
yn = u1->GetPositionY();
|
||||
xp = u2->GetPositionX();
|
||||
yp = u2->GetPositionY();
|
||||
xh = pTarget->GetPositionX();
|
||||
yh = pTarget->GetPositionY();
|
||||
|
||||
// check if target is between (not checking distance from the beam yet)
|
||||
if (dist(xn,yn,xh,yh) >= dist(xn,yn,xp,yp) || dist(xp,yp,xh,yh) >= dist(xn,yn,xp,yp))
|
||||
return false;
|
||||
// check distance from the beam
|
||||
return (abs((xn-xp)*yh+(yp-yn)*xh-xn*yp+xp*yn)/dist(xn,yn,xp,yp) < 1.5f);
|
||||
}
|
||||
|
||||
float dist(float xa, float ya, float xb, float yb) // auxiliary method for distance
|
||||
{
|
||||
return sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Berserk = false;
|
||||
NetherInfusionTimer = 540000;
|
||||
VoidZoneTimer = 15000;
|
||||
NetherbreathTimer = 3000;
|
||||
|
||||
HandleDoors(true);
|
||||
DestroyPortals();
|
||||
}
|
||||
|
||||
void SummonPortals()
|
||||
{
|
||||
uint8 r = rand()%4;
|
||||
uint8 pos[3];
|
||||
pos[RED_PORTAL] = (r%2 ? (r>1 ? 2: 1): 0);
|
||||
pos[GREEN_PORTAL] = (r%2 ? 0: (r>1 ? 2: 1));
|
||||
pos[BLUE_PORTAL] = (r>1 ? 1: 2); // Blue Portal not on the left side (0)
|
||||
|
||||
for (int i=0; i<3; ++i)
|
||||
if (Creature *portal = me->SummonCreature(PortalID[i],PortalCoord[pos[i]][0],PortalCoord[pos[i]][1],PortalCoord[pos[i]][2],0,TEMPSUMMON_TIMED_DESPAWN,60000))
|
||||
for (int i=0; i<3; ++i)
|
||||
{
|
||||
PortalGUID[i] = portal->GetGUID();
|
||||
portal->AddAura(PortalVisual[i], portal);
|
||||
PortalGUID[i] = 0;
|
||||
BeamTarget[i] = 0;
|
||||
BeamerGUID[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void DestroyPortals()
|
||||
{
|
||||
for (int i=0; i<3; ++i)
|
||||
{
|
||||
if (Creature *portal = Unit::GetCreature(*me, PortalGUID[i]))
|
||||
portal->DisappearAndDie();
|
||||
if (Creature *portal = Unit::GetCreature(*me, BeamerGUID[i]))
|
||||
portal->DisappearAndDie();
|
||||
PortalGUID[i] = 0;
|
||||
BeamTarget[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdatePortals() // Here we handle the beams' behavior
|
||||
{
|
||||
for (int j=0; j<3; ++j) // j = color
|
||||
if (Creature *portal = Unit::GetCreature(*me, PortalGUID[j]))
|
||||
{
|
||||
// the one who's been casted upon before
|
||||
Unit *current = Unit::GetUnit(*portal, BeamTarget[j]);
|
||||
// temporary store for the best suitable beam reciever
|
||||
Unit *pTarget = me;
|
||||
InstanceScript* pInstance;
|
||||
|
||||
if (Map* map = me->GetMap())
|
||||
{
|
||||
Map::PlayerList const& players = map->GetPlayers();
|
||||
bool PortalPhase;
|
||||
bool Berserk;
|
||||
uint32 PhaseTimer; // timer for phase switching
|
||||
uint32 VoidZoneTimer;
|
||||
uint32 NetherInfusionTimer; // berserking timer
|
||||
uint32 NetherbreathTimer;
|
||||
uint32 EmpowermentTimer;
|
||||
uint32 PortalTimer; // timer for beam checking
|
||||
uint64 PortalGUID[3]; // guid's of portals
|
||||
uint64 BeamerGUID[3]; // guid's of auxiliary beaming portals
|
||||
uint64 BeamTarget[3]; // guid's of portals' current targets
|
||||
|
||||
// get the best suitable target
|
||||
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
|
||||
{
|
||||
Player* p = i->getSource();
|
||||
if (p && p->isAlive() // alive
|
||||
&& (!pTarget || pTarget->GetDistance2d(portal)>p->GetDistance2d(portal)) // closer than current best
|
||||
&& !p->HasAura(PlayerDebuff[j],0) // not exhausted
|
||||
&& !p->HasAura(PlayerBuff[(j+1)%3],0) // not on another beam
|
||||
&& !p->HasAura(PlayerBuff[(j+2)%3],0)
|
||||
&& IsBetween(me, p, portal)) // on the beam
|
||||
pTarget = p;
|
||||
}
|
||||
}
|
||||
// buff the target
|
||||
if (pTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
pTarget->AddAura(PlayerBuff[j], pTarget);
|
||||
else
|
||||
pTarget->AddAura(NetherBuff[j], pTarget);
|
||||
// cast visual beam on the chosen target if switched
|
||||
// simple target switching isn't working -> using BeamerGUID to cast (workaround)
|
||||
if (!current || pTarget != current)
|
||||
{
|
||||
BeamTarget[j] = pTarget->GetGUID();
|
||||
// remove currently beaming portal
|
||||
if (Creature *beamer = Unit::GetCreature(*portal, BeamerGUID[j]))
|
||||
{
|
||||
beamer->CastSpell(pTarget, PortalBeam[j], false);
|
||||
beamer->DisappearAndDie();
|
||||
BeamerGUID[j] = 0;
|
||||
}
|
||||
// create new one and start beaming on the target
|
||||
if (Creature *beamer = portal->SummonCreature(PortalID[j],portal->GetPositionX(),portal->GetPositionY(),portal->GetPositionZ(),portal->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,60000))
|
||||
{
|
||||
beamer->CastSpell(pTarget, PortalBeam[j], false);
|
||||
BeamerGUID[j] = beamer->GetGUID();
|
||||
}
|
||||
}
|
||||
// aggro target if Red Beam
|
||||
if (j == RED_PORTAL && me->getVictim() != pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
me->getThreatManager().addThreat(pTarget, 100000.0f+DoGetThreat(me->getVictim()));
|
||||
}
|
||||
}
|
||||
|
||||
void SwitchToPortalPhase()
|
||||
{
|
||||
me->RemoveAurasDueToSpell(SPELL_BANISH_ROOT);
|
||||
me->RemoveAurasDueToSpell(SPELL_BANISH_VISUAL);
|
||||
SummonPortals();
|
||||
PhaseTimer = 60000;
|
||||
PortalPhase = true;
|
||||
PortalTimer = 10000;
|
||||
EmpowermentTimer = 10000;
|
||||
DoScriptText(EMOTE_PHASE_PORTAL,me);
|
||||
}
|
||||
|
||||
void SwitchToBanishPhase()
|
||||
{
|
||||
me->RemoveAurasDueToSpell(SPELL_EMPOWERMENT);
|
||||
me->RemoveAurasDueToSpell(SPELL_NETHERBURN_AURA);
|
||||
DoCast(me, SPELL_BANISH_VISUAL, true);
|
||||
DoCast(me, SPELL_BANISH_ROOT, true);
|
||||
DestroyPortals();
|
||||
PhaseTimer = 30000;
|
||||
PortalPhase = false;
|
||||
DoScriptText(EMOTE_PHASE_BANISH,me);
|
||||
|
||||
for (int i=0; i<3; ++i)
|
||||
me->RemoveAurasDueToSpell(NetherBuff[i]);
|
||||
}
|
||||
|
||||
void HandleDoors(bool open) // Massive Door switcher
|
||||
{
|
||||
if (GameObject *Door = GameObject::GetGameObject(*me, pInstance ? pInstance->GetData64(DATA_GO_MASSIVE_DOOR) : 0))
|
||||
Door->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
HandleDoors(false);
|
||||
SwitchToPortalPhase();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
HandleDoors(true);
|
||||
DestroyPortals();
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
// Void Zone
|
||||
if (VoidZoneTimer <= diff)
|
||||
bool IsBetween(WorldObject* u1, WorldObject *pTarget, WorldObject* u2) // the in-line checker
|
||||
{
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM,1,45,true),SPELL_VOIDZONE,true);
|
||||
if (!u1 || !u2 || !pTarget)
|
||||
return false;
|
||||
|
||||
float xn, yn, xp, yp, xh, yh;
|
||||
xn = u1->GetPositionX();
|
||||
yn = u1->GetPositionY();
|
||||
xp = u2->GetPositionX();
|
||||
yp = u2->GetPositionY();
|
||||
xh = pTarget->GetPositionX();
|
||||
yh = pTarget->GetPositionY();
|
||||
|
||||
// check if target is between (not checking distance from the beam yet)
|
||||
if (dist(xn,yn,xh,yh) >= dist(xn,yn,xp,yp) || dist(xp,yp,xh,yh) >= dist(xn,yn,xp,yp))
|
||||
return false;
|
||||
// check distance from the beam
|
||||
return (abs((xn-xp)*yh+(yp-yn)*xh-xn*yp+xp*yn)/dist(xn,yn,xp,yp) < 1.5f);
|
||||
}
|
||||
|
||||
float dist(float xa, float ya, float xb, float yb) // auxiliary method for distance
|
||||
{
|
||||
return sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Berserk = false;
|
||||
NetherInfusionTimer = 540000;
|
||||
VoidZoneTimer = 15000;
|
||||
} else VoidZoneTimer -= diff;
|
||||
NetherbreathTimer = 3000;
|
||||
|
||||
// NetherInfusion Berserk
|
||||
if (!Berserk && NetherInfusionTimer <= diff)
|
||||
{
|
||||
me->AddAura(SPELL_NETHER_INFUSION, me);
|
||||
DoCast(me, SPELL_NETHERSPITE_ROAR);
|
||||
Berserk = true;
|
||||
} else NetherInfusionTimer -= diff;
|
||||
|
||||
if (PortalPhase) // PORTAL PHASE
|
||||
{
|
||||
// Distribute beams and buffs
|
||||
if (PortalTimer <= diff)
|
||||
{
|
||||
UpdatePortals();
|
||||
PortalTimer = 1000;
|
||||
} else PortalTimer -= diff;
|
||||
|
||||
// Empowerment & Nether Burn
|
||||
if (EmpowermentTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_EMPOWERMENT);
|
||||
me->AddAura(SPELL_NETHERBURN_AURA, me);
|
||||
EmpowermentTimer = 90000;
|
||||
} else EmpowermentTimer -= diff;
|
||||
|
||||
if (PhaseTimer <= diff)
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
SwitchToBanishPhase();
|
||||
return;
|
||||
}
|
||||
} else PhaseTimer -= diff;
|
||||
}
|
||||
else // BANISH PHASE
|
||||
{
|
||||
// Netherbreath
|
||||
if (NetherbreathTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0,40,true))
|
||||
DoCast(pTarget, SPELL_NETHERBREATH);
|
||||
NetherbreathTimer = urand(5000,7000);
|
||||
} else NetherbreathTimer -= diff;
|
||||
|
||||
if (PhaseTimer <= diff)
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
SwitchToPortalPhase();
|
||||
return;
|
||||
}
|
||||
} else PhaseTimer -= diff;
|
||||
HandleDoors(true);
|
||||
DestroyPortals();
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void SummonPortals()
|
||||
{
|
||||
uint8 r = rand()%4;
|
||||
uint8 pos[3];
|
||||
pos[RED_PORTAL] = (r%2 ? (r>1 ? 2: 1): 0);
|
||||
pos[GREEN_PORTAL] = (r%2 ? 0: (r>1 ? 2: 1));
|
||||
pos[BLUE_PORTAL] = (r>1 ? 1: 2); // Blue Portal not on the left side (0)
|
||||
|
||||
for (int i=0; i<3; ++i)
|
||||
if (Creature *portal = me->SummonCreature(PortalID[i],PortalCoord[pos[i]][0],PortalCoord[pos[i]][1],PortalCoord[pos[i]][2],0,TEMPSUMMON_TIMED_DESPAWN,60000))
|
||||
{
|
||||
PortalGUID[i] = portal->GetGUID();
|
||||
portal->AddAura(PortalVisual[i], portal);
|
||||
}
|
||||
}
|
||||
|
||||
void DestroyPortals()
|
||||
{
|
||||
for (int i=0; i<3; ++i)
|
||||
{
|
||||
if (Creature *portal = Unit::GetCreature(*me, PortalGUID[i]))
|
||||
portal->DisappearAndDie();
|
||||
if (Creature *portal = Unit::GetCreature(*me, BeamerGUID[i]))
|
||||
portal->DisappearAndDie();
|
||||
PortalGUID[i] = 0;
|
||||
BeamTarget[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdatePortals() // Here we handle the beams' behavior
|
||||
{
|
||||
for (int j=0; j<3; ++j) // j = color
|
||||
if (Creature *portal = Unit::GetCreature(*me, PortalGUID[j]))
|
||||
{
|
||||
// the one who's been casted upon before
|
||||
Unit *current = Unit::GetUnit(*portal, BeamTarget[j]);
|
||||
// temporary store for the best suitable beam reciever
|
||||
Unit *pTarget = me;
|
||||
|
||||
if (Map* map = me->GetMap())
|
||||
{
|
||||
Map::PlayerList const& players = map->GetPlayers();
|
||||
|
||||
// get the best suitable target
|
||||
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
|
||||
{
|
||||
Player* p = i->getSource();
|
||||
if (p && p->isAlive() // alive
|
||||
&& (!pTarget || pTarget->GetDistance2d(portal)>p->GetDistance2d(portal)) // closer than current best
|
||||
&& !p->HasAura(PlayerDebuff[j],0) // not exhausted
|
||||
&& !p->HasAura(PlayerBuff[(j+1)%3],0) // not on another beam
|
||||
&& !p->HasAura(PlayerBuff[(j+2)%3],0)
|
||||
&& IsBetween(me, p, portal)) // on the beam
|
||||
pTarget = p;
|
||||
}
|
||||
}
|
||||
// buff the target
|
||||
if (pTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
pTarget->AddAura(PlayerBuff[j], pTarget);
|
||||
else
|
||||
pTarget->AddAura(NetherBuff[j], pTarget);
|
||||
// cast visual beam on the chosen target if switched
|
||||
// simple target switching isn't working -> using BeamerGUID to cast (workaround)
|
||||
if (!current || pTarget != current)
|
||||
{
|
||||
BeamTarget[j] = pTarget->GetGUID();
|
||||
// remove currently beaming portal
|
||||
if (Creature *beamer = Unit::GetCreature(*portal, BeamerGUID[j]))
|
||||
{
|
||||
beamer->CastSpell(pTarget, PortalBeam[j], false);
|
||||
beamer->DisappearAndDie();
|
||||
BeamerGUID[j] = 0;
|
||||
}
|
||||
// create new one and start beaming on the target
|
||||
if (Creature *beamer = portal->SummonCreature(PortalID[j],portal->GetPositionX(),portal->GetPositionY(),portal->GetPositionZ(),portal->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,60000))
|
||||
{
|
||||
beamer->CastSpell(pTarget, PortalBeam[j], false);
|
||||
BeamerGUID[j] = beamer->GetGUID();
|
||||
}
|
||||
}
|
||||
// aggro target if Red Beam
|
||||
if (j == RED_PORTAL && me->getVictim() != pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
me->getThreatManager().addThreat(pTarget, 100000.0f+DoGetThreat(me->getVictim()));
|
||||
}
|
||||
}
|
||||
|
||||
void SwitchToPortalPhase()
|
||||
{
|
||||
me->RemoveAurasDueToSpell(SPELL_BANISH_ROOT);
|
||||
me->RemoveAurasDueToSpell(SPELL_BANISH_VISUAL);
|
||||
SummonPortals();
|
||||
PhaseTimer = 60000;
|
||||
PortalPhase = true;
|
||||
PortalTimer = 10000;
|
||||
EmpowermentTimer = 10000;
|
||||
DoScriptText(EMOTE_PHASE_PORTAL,me);
|
||||
}
|
||||
|
||||
void SwitchToBanishPhase()
|
||||
{
|
||||
me->RemoveAurasDueToSpell(SPELL_EMPOWERMENT);
|
||||
me->RemoveAurasDueToSpell(SPELL_NETHERBURN_AURA);
|
||||
DoCast(me, SPELL_BANISH_VISUAL, true);
|
||||
DoCast(me, SPELL_BANISH_ROOT, true);
|
||||
DestroyPortals();
|
||||
PhaseTimer = 30000;
|
||||
PortalPhase = false;
|
||||
DoScriptText(EMOTE_PHASE_BANISH,me);
|
||||
|
||||
for (int i=0; i<3; ++i)
|
||||
me->RemoveAurasDueToSpell(NetherBuff[i]);
|
||||
}
|
||||
|
||||
void HandleDoors(bool open) // Massive Door switcher
|
||||
{
|
||||
if (GameObject *Door = GameObject::GetGameObject(*me, pInstance ? pInstance->GetData64(DATA_GO_MASSIVE_DOOR) : 0))
|
||||
Door->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
HandleDoors(false);
|
||||
SwitchToPortalPhase();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
HandleDoors(true);
|
||||
DestroyPortals();
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
// Void Zone
|
||||
if (VoidZoneTimer <= diff)
|
||||
{
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM,1,45,true),SPELL_VOIDZONE,true);
|
||||
VoidZoneTimer = 15000;
|
||||
} else VoidZoneTimer -= diff;
|
||||
|
||||
// NetherInfusion Berserk
|
||||
if (!Berserk && NetherInfusionTimer <= diff)
|
||||
{
|
||||
me->AddAura(SPELL_NETHER_INFUSION, me);
|
||||
DoCast(me, SPELL_NETHERSPITE_ROAR);
|
||||
Berserk = true;
|
||||
} else NetherInfusionTimer -= diff;
|
||||
|
||||
if (PortalPhase) // PORTAL PHASE
|
||||
{
|
||||
// Distribute beams and buffs
|
||||
if (PortalTimer <= diff)
|
||||
{
|
||||
UpdatePortals();
|
||||
PortalTimer = 1000;
|
||||
} else PortalTimer -= diff;
|
||||
|
||||
// Empowerment & Nether Burn
|
||||
if (EmpowermentTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_EMPOWERMENT);
|
||||
me->AddAura(SPELL_NETHERBURN_AURA, me);
|
||||
EmpowermentTimer = 90000;
|
||||
} else EmpowermentTimer -= diff;
|
||||
|
||||
if (PhaseTimer <= diff)
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
SwitchToBanishPhase();
|
||||
return;
|
||||
}
|
||||
} else PhaseTimer -= diff;
|
||||
}
|
||||
else // BANISH PHASE
|
||||
{
|
||||
// Netherbreath
|
||||
if (NetherbreathTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0,40,true))
|
||||
DoCast(pTarget, SPELL_NETHERBREATH);
|
||||
NetherbreathTimer = urand(5000,7000);
|
||||
} else NetherbreathTimer -= diff;
|
||||
|
||||
if (PhaseTimer <= diff)
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
SwitchToPortalPhase();
|
||||
return;
|
||||
}
|
||||
} else PhaseTimer -= diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_netherspite(Creature *pCreature)
|
||||
{
|
||||
return new boss_netherspiteAI(pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_netherspite()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_netherspite";
|
||||
newscript->GetAI = GetAI_boss_netherspite;
|
||||
newscript->RegisterSelf();
|
||||
new boss_netherspite();
|
||||
}
|
||||
|
||||
@@ -57,364 +57,366 @@ float IntroWay[8][3] =
|
||||
{-11140 , -1915 ,122},
|
||||
{-11163 , -1903 ,91.473}
|
||||
};
|
||||
|
||||
struct boss_nightbaneAI : public ScriptedAI
|
||||
class boss_nightbane : public CreatureScript
|
||||
{
|
||||
boss_nightbaneAI(Creature* c) : ScriptedAI(c)
|
||||
public:
|
||||
boss_nightbane() : CreatureScript("boss_nightbane") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
Intro = true;
|
||||
return new boss_nightbaneAI (pCreature);
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 Phase;
|
||||
|
||||
bool RainBones;
|
||||
bool Skeletons;
|
||||
|
||||
uint32 BellowingRoarTimer;
|
||||
uint32 CharredEarthTimer;
|
||||
uint32 DistractingAshTimer;
|
||||
uint32 SmolderingBreathTimer;
|
||||
uint32 TailSweepTimer;
|
||||
uint32 RainofBonesTimer;
|
||||
uint32 SmokingBlastTimer;
|
||||
uint32 FireballBarrageTimer;
|
||||
uint32 SearingCindersTimer;
|
||||
|
||||
uint32 FlyCount;
|
||||
uint32 FlyTimer;
|
||||
|
||||
bool Intro;
|
||||
bool Flying;
|
||||
bool Movement;
|
||||
|
||||
uint32 WaitTimer;
|
||||
uint32 MovePhase;
|
||||
|
||||
void Reset()
|
||||
struct boss_nightbaneAI : public ScriptedAI
|
||||
{
|
||||
BellowingRoarTimer = 30000;
|
||||
CharredEarthTimer = 15000;
|
||||
DistractingAshTimer = 20000;
|
||||
SmolderingBreathTimer = 10000;
|
||||
TailSweepTimer = 12000;
|
||||
RainofBonesTimer = 10000;
|
||||
SmokingBlastTimer = 20000;
|
||||
FireballBarrageTimer = 13000;
|
||||
SearingCindersTimer = 14000;
|
||||
WaitTimer = 1000;
|
||||
|
||||
Phase =1;
|
||||
FlyCount = 0;
|
||||
MovePhase = 0;
|
||||
|
||||
me->SetSpeed(MOVE_RUN, 2.0f);
|
||||
me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
|
||||
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
|
||||
me->setActive(true);
|
||||
|
||||
if (pInstance)
|
||||
boss_nightbaneAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
if (pInstance->GetData(TYPE_NIGHTBANE) == DONE || pInstance->GetData(TYPE_NIGHTBANE) == IN_PROGRESS)
|
||||
me->DisappearAndDie();
|
||||
else
|
||||
pInstance->SetData(TYPE_NIGHTBANE, NOT_STARTED);
|
||||
pInstance = c->GetInstanceScript();
|
||||
Intro = true;
|
||||
}
|
||||
|
||||
HandleTerraceDoors(true);
|
||||
InstanceScript* pInstance;
|
||||
|
||||
Flying = false;
|
||||
Movement = false;
|
||||
uint32 Phase;
|
||||
|
||||
if (!Intro)
|
||||
bool RainBones;
|
||||
bool Skeletons;
|
||||
|
||||
uint32 BellowingRoarTimer;
|
||||
uint32 CharredEarthTimer;
|
||||
uint32 DistractingAshTimer;
|
||||
uint32 SmolderingBreathTimer;
|
||||
uint32 TailSweepTimer;
|
||||
uint32 RainofBonesTimer;
|
||||
uint32 SmokingBlastTimer;
|
||||
uint32 FireballBarrageTimer;
|
||||
uint32 SearingCindersTimer;
|
||||
|
||||
uint32 FlyCount;
|
||||
uint32 FlyTimer;
|
||||
|
||||
bool Intro;
|
||||
bool Flying;
|
||||
bool Movement;
|
||||
|
||||
uint32 WaitTimer;
|
||||
uint32 MovePhase;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
me->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0);
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
}
|
||||
}
|
||||
BellowingRoarTimer = 30000;
|
||||
CharredEarthTimer = 15000;
|
||||
DistractingAshTimer = 20000;
|
||||
SmolderingBreathTimer = 10000;
|
||||
TailSweepTimer = 12000;
|
||||
RainofBonesTimer = 10000;
|
||||
SmokingBlastTimer = 20000;
|
||||
FireballBarrageTimer = 13000;
|
||||
SearingCindersTimer = 14000;
|
||||
WaitTimer = 1000;
|
||||
|
||||
void HandleTerraceDoors(bool open)
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_1), open);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_2), open);
|
||||
}
|
||||
}
|
||||
Phase =1;
|
||||
FlyCount = 0;
|
||||
MovePhase = 0;
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_NIGHTBANE, IN_PROGRESS);
|
||||
me->SetSpeed(MOVE_RUN, 2.0f);
|
||||
me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
|
||||
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
|
||||
me->setActive(true);
|
||||
|
||||
HandleTerraceDoors(false);
|
||||
me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (!Intro && !Flying)
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_NIGHTBANE, DONE);
|
||||
|
||||
HandleTerraceDoors(true);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if (!Intro && !Flying)
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (Intro)
|
||||
{
|
||||
if (id >= 8)
|
||||
if (pInstance)
|
||||
{
|
||||
if (pInstance->GetData(TYPE_NIGHTBANE) == DONE || pInstance->GetData(TYPE_NIGHTBANE) == IN_PROGRESS)
|
||||
me->DisappearAndDie();
|
||||
else
|
||||
pInstance->SetData(TYPE_NIGHTBANE, NOT_STARTED);
|
||||
}
|
||||
|
||||
HandleTerraceDoors(true);
|
||||
|
||||
Flying = false;
|
||||
Movement = false;
|
||||
|
||||
if (!Intro)
|
||||
{
|
||||
Intro = false;
|
||||
me->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0);
|
||||
return;
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
}
|
||||
|
||||
WaitTimer = 1;
|
||||
}
|
||||
|
||||
if (Flying)
|
||||
void HandleTerraceDoors(bool open)
|
||||
{
|
||||
if (id == 0)
|
||||
if (pInstance)
|
||||
{
|
||||
me->MonsterTextEmote(EMOTE_BREATH, 0, true);
|
||||
Flying = false;
|
||||
Phase = 2;
|
||||
return;
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_1), open);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_2), open);
|
||||
}
|
||||
|
||||
if (id == 3)
|
||||
{
|
||||
MovePhase = 4;
|
||||
WaitTimer = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (id == 8)
|
||||
{
|
||||
Flying = false;
|
||||
Phase = 1;
|
||||
Movement = true;
|
||||
return;
|
||||
}
|
||||
|
||||
WaitTimer = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature *summoned)
|
||||
{
|
||||
summoned->AI()->AttackStart(me->getVictim());
|
||||
}
|
||||
|
||||
void TakeOff()
|
||||
{
|
||||
me->MonsterYell(YELL_FLY_PHASE, LANG_UNIVERSAL, NULL);
|
||||
|
||||
me->InterruptSpell(CURRENT_GENERIC_SPELL);
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
|
||||
me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
|
||||
(*me).GetMotionMaster()->Clear(false);
|
||||
(*me).GetMotionMaster()->MovePoint(0,IntroWay[2][0],IntroWay[2][1],IntroWay[2][2]);
|
||||
|
||||
Flying = true;
|
||||
|
||||
FlyTimer = urand(45000,60000); //timer wrong between 45 and 60 seconds
|
||||
++FlyCount;
|
||||
|
||||
RainofBonesTimer = 5000; //timer wrong (maybe)
|
||||
RainBones = false;
|
||||
Skeletons = false;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
/* The timer for this was never setup apparently, not sure if the code works properly:
|
||||
if (WaitTimer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_NIGHTBANE, IN_PROGRESS);
|
||||
|
||||
HandleTerraceDoors(false);
|
||||
me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (!Intro && !Flying)
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_NIGHTBANE, DONE);
|
||||
|
||||
HandleTerraceDoors(true);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if (!Intro && !Flying)
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (Intro)
|
||||
{
|
||||
if (MovePhase >= 7)
|
||||
if (id >= 8)
|
||||
{
|
||||
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
|
||||
me->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
me->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]);
|
||||
++MovePhase;
|
||||
Intro = false;
|
||||
me->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0);
|
||||
return;
|
||||
}
|
||||
|
||||
WaitTimer = 1;
|
||||
}
|
||||
|
||||
if (Flying)
|
||||
{
|
||||
if (MovePhase >= 7)
|
||||
if (id == 0)
|
||||
{
|
||||
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
|
||||
me->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]);
|
||||
me->MonsterTextEmote(EMOTE_BREATH, 0, true);
|
||||
Flying = false;
|
||||
Phase = 2;
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
if (id == 3)
|
||||
{
|
||||
me->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]);
|
||||
++MovePhase;
|
||||
MovePhase = 4;
|
||||
WaitTimer = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (id == 8)
|
||||
{
|
||||
Flying = false;
|
||||
Phase = 1;
|
||||
Movement = true;
|
||||
return;
|
||||
}
|
||||
|
||||
WaitTimer = 1;
|
||||
}
|
||||
|
||||
WaitTimer = 0;
|
||||
} else WaitTimer -= diff;
|
||||
*/
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (Flying)
|
||||
return;
|
||||
|
||||
// Phase 1 "GROUND FIGHT"
|
||||
if (Phase == 1)
|
||||
{
|
||||
if (Movement)
|
||||
{
|
||||
DoStartMovement(me->getVictim());
|
||||
Movement = false;
|
||||
}
|
||||
|
||||
if (BellowingRoarTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_BELLOWING_ROAR);
|
||||
BellowingRoarTimer = urand(30000,40000);
|
||||
} else BellowingRoarTimer -= diff;
|
||||
|
||||
if (SmolderingBreathTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SMOLDERING_BREATH);
|
||||
SmolderingBreathTimer = 20000;
|
||||
} else SmolderingBreathTimer -= diff;
|
||||
|
||||
if (CharredEarthTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_CHARRED_EARTH);
|
||||
CharredEarthTimer = 20000;
|
||||
} else CharredEarthTimer -= diff;
|
||||
|
||||
if (TailSweepTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
if (!me->HasInArc(M_PI, pTarget))
|
||||
DoCast(pTarget, SPELL_TAIL_SWEEP);
|
||||
TailSweepTimer = 15000;
|
||||
} else TailSweepTimer -= diff;
|
||||
|
||||
if (SearingCindersTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_SEARING_CINDERS);
|
||||
SearingCindersTimer = 10000;
|
||||
} else SearingCindersTimer -= diff;
|
||||
|
||||
uint32 Prozent;
|
||||
Prozent = (me->GetHealth()*100) / me->GetMaxHealth();
|
||||
|
||||
if (Prozent < 75 && FlyCount == 0) // first take off 75%
|
||||
TakeOff();
|
||||
|
||||
if (Prozent < 50 && FlyCount == 1) // secound take off 50%
|
||||
TakeOff();
|
||||
|
||||
if (Prozent < 25 && FlyCount == 2) // third take off 25%
|
||||
TakeOff();
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
//Phase 2 "FLYING FIGHT"
|
||||
if (Phase == 2)
|
||||
void JustSummoned(Creature *summoned)
|
||||
{
|
||||
if (!RainBones)
|
||||
summoned->AI()->AttackStart(me->getVictim());
|
||||
}
|
||||
|
||||
void TakeOff()
|
||||
{
|
||||
me->MonsterYell(YELL_FLY_PHASE, LANG_UNIVERSAL, NULL);
|
||||
|
||||
me->InterruptSpell(CURRENT_GENERIC_SPELL);
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
|
||||
me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
|
||||
(*me).GetMotionMaster()->Clear(false);
|
||||
(*me).GetMotionMaster()->MovePoint(0,IntroWay[2][0],IntroWay[2][1],IntroWay[2][2]);
|
||||
|
||||
Flying = true;
|
||||
|
||||
FlyTimer = urand(45000,60000); //timer wrong between 45 and 60 seconds
|
||||
++FlyCount;
|
||||
|
||||
RainofBonesTimer = 5000; //timer wrong (maybe)
|
||||
RainBones = false;
|
||||
Skeletons = false;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
/* The timer for this was never setup apparently, not sure if the code works properly:
|
||||
if (WaitTimer <= diff)
|
||||
{
|
||||
if (!Skeletons)
|
||||
if (Intro)
|
||||
{
|
||||
for (uint8 i = 0; i <= 3; ++i)
|
||||
if (MovePhase >= 7)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SUMMON_SKELETON);
|
||||
Skeletons = true;
|
||||
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
|
||||
me->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
me->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]);
|
||||
++MovePhase;
|
||||
}
|
||||
}
|
||||
if (Flying)
|
||||
{
|
||||
if (MovePhase >= 7)
|
||||
{
|
||||
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
|
||||
me->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
me->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]);
|
||||
++MovePhase;
|
||||
}
|
||||
}
|
||||
|
||||
if (RainofBonesTimer < diff && !RainBones) // only once at the beginning of phase 2
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_RAIN_OF_BONES);
|
||||
RainBones = true;
|
||||
SmokingBlastTimer = 20000;
|
||||
} else RainofBonesTimer -= diff;
|
||||
WaitTimer = 0;
|
||||
} else WaitTimer -= diff;
|
||||
*/
|
||||
|
||||
if (DistractingAshTimer <= diff)
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (Flying)
|
||||
return;
|
||||
|
||||
// Phase 1 "GROUND FIGHT"
|
||||
if (Phase == 1)
|
||||
{
|
||||
if (Movement)
|
||||
{
|
||||
DoStartMovement(me->getVictim());
|
||||
Movement = false;
|
||||
}
|
||||
|
||||
if (BellowingRoarTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_BELLOWING_ROAR);
|
||||
BellowingRoarTimer = urand(30000,40000);
|
||||
} else BellowingRoarTimer -= diff;
|
||||
|
||||
if (SmolderingBreathTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SMOLDERING_BREATH);
|
||||
SmolderingBreathTimer = 20000;
|
||||
} else SmolderingBreathTimer -= diff;
|
||||
|
||||
if (CharredEarthTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_DISTRACTING_ASH);
|
||||
DistractingAshTimer = 2000; //timer wrong
|
||||
} else DistractingAshTimer -= diff;
|
||||
DoCast(pTarget, SPELL_CHARRED_EARTH);
|
||||
CharredEarthTimer = 20000;
|
||||
} else CharredEarthTimer -= diff;
|
||||
|
||||
if (TailSweepTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
if (!me->HasInArc(M_PI, pTarget))
|
||||
DoCast(pTarget, SPELL_TAIL_SWEEP);
|
||||
TailSweepTimer = 15000;
|
||||
} else TailSweepTimer -= diff;
|
||||
|
||||
if (SearingCindersTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_SEARING_CINDERS);
|
||||
SearingCindersTimer = 10000;
|
||||
} else SearingCindersTimer -= diff;
|
||||
|
||||
uint32 Prozent;
|
||||
Prozent = (me->GetHealth()*100) / me->GetMaxHealth();
|
||||
|
||||
if (Prozent < 75 && FlyCount == 0) // first take off 75%
|
||||
TakeOff();
|
||||
|
||||
if (Prozent < 50 && FlyCount == 1) // secound take off 50%
|
||||
TakeOff();
|
||||
|
||||
if (Prozent < 25 && FlyCount == 2) // third take off 25%
|
||||
TakeOff();
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
if (RainBones)
|
||||
//Phase 2 "FLYING FIGHT"
|
||||
if (Phase == 2)
|
||||
{
|
||||
if (SmokingBlastTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SMOKING_BLAST);
|
||||
SmokingBlastTimer = 1500; //timer wrong
|
||||
} else SmokingBlastTimer -= diff;
|
||||
if (!RainBones)
|
||||
{
|
||||
if (!Skeletons)
|
||||
{
|
||||
for (uint8 i = 0; i <= 3; ++i)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SUMMON_SKELETON);
|
||||
Skeletons = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (RainofBonesTimer < diff && !RainBones) // only once at the beginning of phase 2
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_RAIN_OF_BONES);
|
||||
RainBones = true;
|
||||
SmokingBlastTimer = 20000;
|
||||
} else RainofBonesTimer -= diff;
|
||||
|
||||
if (DistractingAshTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_DISTRACTING_ASH);
|
||||
DistractingAshTimer = 2000; //timer wrong
|
||||
} else DistractingAshTimer -= diff;
|
||||
}
|
||||
|
||||
if (RainBones)
|
||||
{
|
||||
if (SmokingBlastTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SMOKING_BLAST);
|
||||
SmokingBlastTimer = 1500; //timer wrong
|
||||
} else SmokingBlastTimer -= diff;
|
||||
}
|
||||
|
||||
if (FireballBarrageTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_FARTHEST, 0))
|
||||
DoCast(pTarget, SPELL_FIREBALL_BARRAGE);
|
||||
FireballBarrageTimer = 20000;
|
||||
} else FireballBarrageTimer -= diff;
|
||||
|
||||
if (FlyTimer <= diff) //landing
|
||||
{
|
||||
me->MonsterYell(RAND(*YELL_LAND_PHASE_1,*YELL_LAND_PHASE_2), LANG_UNIVERSAL, NULL);
|
||||
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMotionMaster()->MovePoint(3,IntroWay[3][0],IntroWay[3][1],IntroWay[3][2]);
|
||||
|
||||
Flying = true;
|
||||
} else FlyTimer -= diff;
|
||||
}
|
||||
|
||||
if (FireballBarrageTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_FARTHEST, 0))
|
||||
DoCast(pTarget, SPELL_FIREBALL_BARRAGE);
|
||||
FireballBarrageTimer = 20000;
|
||||
} else FireballBarrageTimer -= diff;
|
||||
|
||||
if (FlyTimer <= diff) //landing
|
||||
{
|
||||
me->MonsterYell(RAND(*YELL_LAND_PHASE_1,*YELL_LAND_PHASE_2), LANG_UNIVERSAL, NULL);
|
||||
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMotionMaster()->MovePoint(3,IntroWay[3][0],IntroWay[3][1],IntroWay[3][2]);
|
||||
|
||||
Flying = true;
|
||||
} else FlyTimer -= diff;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_nightbane(Creature* pCreature)
|
||||
{
|
||||
return new boss_nightbaneAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_nightbane()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_nightbane";
|
||||
newscript->GetAI = &GetAI_boss_nightbane;
|
||||
newscript->RegisterSelf();
|
||||
new boss_nightbane();
|
||||
}
|
||||
|
||||
|
||||
@@ -95,512 +95,513 @@ static InfernalPoint InfernalPoints[] =
|
||||
|
||||
#define EQUIP_ID_AXE 33542 //Axes info
|
||||
|
||||
//---------Infernal code first
|
||||
struct netherspite_infernalAI : public ScriptedAI
|
||||
//---------Infernal code first
class netherspite_infernal : public CreatureScript
|
||||
{
|
||||
netherspite_infernalAI(Creature *c) : ScriptedAI(c) ,
|
||||
malchezaar(0), HellfireTimer(0), CleanupTimer(0), point(NULL) {}
|
||||
public:
|
||||
netherspite_infernal() : CreatureScript("netherspite_infernal") { }
|
||||
|
||||
uint32 HellfireTimer;
|
||||
uint32 CleanupTimer;
|
||||
uint32 malchezaar;
|
||||
InfernalPoint *point;
|
||||
|
||||
void Reset() {}
|
||||
void EnterCombat(Unit * /*who*/) {}
|
||||
void MoveInLineOfSight(Unit * /*who*/) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
if (HellfireTimer)
|
||||
if (HellfireTimer <= diff)
|
||||
return new netherspite_infernalAI (pCreature);
|
||||
}
|
||||
|
||||
struct netherspite_infernalAI : public ScriptedAI
|
||||
{
|
||||
netherspite_infernalAI(Creature *c) : ScriptedAI(c) ,
|
||||
malchezaar(0), HellfireTimer(0), CleanupTimer(0), point(NULL) {}
|
||||
|
||||
uint32 HellfireTimer;
|
||||
uint32 CleanupTimer;
|
||||
uint32 malchezaar;
|
||||
InfernalPoint *point;
|
||||
|
||||
void Reset() {}
|
||||
void EnterCombat(Unit * /*who*/) {}
|
||||
void MoveInLineOfSight(Unit * /*who*/) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
DoCast(me, SPELL_HELLFIRE);
|
||||
HellfireTimer = 0;
|
||||
if (HellfireTimer)
|
||||
if (HellfireTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_HELLFIRE);
|
||||
HellfireTimer = 0;
|
||||
}
|
||||
else HellfireTimer -= diff;
|
||||
|
||||
if (CleanupTimer)
|
||||
if (CleanupTimer <= diff)
|
||||
{
|
||||
Cleanup();
|
||||
CleanupTimer = 0;
|
||||
} else CleanupTimer -= diff;
|
||||
}
|
||||
else HellfireTimer -= diff;
|
||||
|
||||
if (CleanupTimer)
|
||||
if (CleanupTimer <= diff)
|
||||
void KilledUnit(Unit *who)
|
||||
{
|
||||
Cleanup();
|
||||
CleanupTimer = 0;
|
||||
} else CleanupTimer -= diff;
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *who)
|
||||
{
|
||||
Unit *pMalchezaar = Unit::GetUnit(*me, malchezaar);
|
||||
if (pMalchezaar)
|
||||
CAST_CRE(pMalchezaar)->AI()->KilledUnit(who);
|
||||
}
|
||||
|
||||
void SpellHit(Unit * /*who*/, const SpellEntry *spell)
|
||||
{
|
||||
if (spell->Id == SPELL_INFERNAL_RELAY)
|
||||
{
|
||||
me->SetDisplayId(me->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID));
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
HellfireTimer = 4000;
|
||||
CleanupTimer = 170000;
|
||||
Unit *pMalchezaar = Unit::GetUnit(*me, malchezaar);
|
||||
if (pMalchezaar)
|
||||
CAST_CRE(pMalchezaar)->AI()->KilledUnit(who);
|
||||
}
|
||||
}
|
||||
|
||||
void DamageTaken(Unit *done_by, uint32 &damage)
|
||||
{
|
||||
if (done_by->GetGUID() != malchezaar)
|
||||
damage = 0;
|
||||
}
|
||||
void SpellHit(Unit * /*who*/, const SpellEntry *spell)
|
||||
{
|
||||
if (spell->Id == SPELL_INFERNAL_RELAY)
|
||||
{
|
||||
me->SetDisplayId(me->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID));
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
HellfireTimer = 4000;
|
||||
CleanupTimer = 170000;
|
||||
}
|
||||
}
|
||||
|
||||
void DamageTaken(Unit *done_by, uint32 &damage)
|
||||
{
|
||||
if (done_by->GetGUID() != malchezaar)
|
||||
damage = 0;
|
||||
}
|
||||
|
||||
void Cleanup()
|
||||
{
|
||||
Unit *pMalchezaar = Unit::GetUnit(*me, malchezaar);
|
||||
|
||||
if (pMalchezaar && pMalchezaar->isAlive())
|
||||
CAST_AI(boss_malchezaar::boss_malchezaarAI, CAST_CRE(pMalchezaar)->AI())->Cleanup(me, point);
|
||||
}
//below ...
|
||||
};
|
||||
|
||||
void Cleanup(); //below ...
|
||||
};
|
||||
|
||||
struct boss_malchezaarAI : public ScriptedAI
|
||||
class boss_malchezaar : public CreatureScript
|
||||
{
|
||||
boss_malchezaarAI(Creature *c) : ScriptedAI(c)
|
||||
public:
|
||||
boss_malchezaar() : CreatureScript("boss_malchezaar") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
return new boss_malchezaarAI (pCreature);
|
||||
}
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
uint32 EnfeebleTimer;
|
||||
uint32 EnfeebleResetTimer;
|
||||
uint32 ShadowNovaTimer;
|
||||
uint32 SWPainTimer;
|
||||
uint32 SunderArmorTimer;
|
||||
uint32 AmplifyDamageTimer;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 InfernalTimer;
|
||||
uint32 AxesTargetSwitchTimer;
|
||||
uint32 InfernalCleanupTimer;
|
||||
|
||||
std::vector<uint64> infernals;
|
||||
std::vector<InfernalPoint*> positions;
|
||||
|
||||
uint64 axes[2];
|
||||
uint64 enfeeble_targets[5];
|
||||
uint64 enfeeble_health[5];
|
||||
|
||||
uint32 phase;
|
||||
|
||||
void Reset()
|
||||
struct boss_malchezaarAI : public ScriptedAI
|
||||
{
|
||||
AxesCleanup();
|
||||
ClearWeapons();
|
||||
InfernalCleanup();
|
||||
positions.clear();
|
||||
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
enfeeble_targets[i] = 0;
|
||||
|
||||
for (uint8 i = 0; i < TOTAL_INFERNAL_POINTS; ++i)
|
||||
positions.push_back(&InfernalPoints[i]);
|
||||
|
||||
EnfeebleTimer = 30000;
|
||||
EnfeebleResetTimer = 38000;
|
||||
ShadowNovaTimer = 35500;
|
||||
SWPainTimer = 20000;
|
||||
AmplifyDamageTimer = 5000;
|
||||
Cleave_Timer = 8000;
|
||||
InfernalTimer = 45000;
|
||||
InfernalCleanupTimer = 47000;
|
||||
AxesTargetSwitchTimer = urand(7500,20000);
|
||||
SunderArmorTimer = urand(5000,10000);
|
||||
phase = 1;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), true);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * /*victim*/)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*victim*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
AxesCleanup();
|
||||
ClearWeapons();
|
||||
InfernalCleanup();
|
||||
positions.clear();
|
||||
|
||||
for (uint8 i = 0; i < TOTAL_INFERNAL_POINTS; ++i)
|
||||
positions.push_back(&InfernalPoints[i]);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), false); // Open the door leading further in
|
||||
}
|
||||
|
||||
void InfernalCleanup()
|
||||
{
|
||||
//Infernal Cleanup
|
||||
for (std::vector<uint64>::const_iterator itr = infernals.begin(); itr != infernals.end(); ++itr)
|
||||
if (Unit *pInfernal = Unit::GetUnit(*me, *itr))
|
||||
if (pInfernal->isAlive())
|
||||
{
|
||||
pInfernal->SetVisibility(VISIBILITY_OFF);
|
||||
pInfernal->setDeathState(JUST_DIED);
|
||||
}
|
||||
|
||||
infernals.clear();
|
||||
}
|
||||
|
||||
void AxesCleanup()
|
||||
{
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
boss_malchezaarAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
Unit *axe = Unit::GetUnit(*me, axes[i]);
|
||||
if (axe && axe->isAlive())
|
||||
axe->Kill(axe);
|
||||
axes[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void ClearWeapons()
|
||||
{
|
||||
SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
|
||||
|
||||
//damage
|
||||
const CreatureInfo *cinfo = me->GetCreatureInfo();
|
||||
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg);
|
||||
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg);
|
||||
me->UpdateDamagePhysical(BASE_ATTACK);
|
||||
}
|
||||
|
||||
void EnfeebleHealthEffect()
|
||||
{
|
||||
const SpellEntry *info = GetSpellStore()->LookupEntry(SPELL_ENFEEBLE_EFFECT);
|
||||
if (!info)
|
||||
return;
|
||||
|
||||
std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
|
||||
std::vector<Unit *> targets;
|
||||
|
||||
if (!t_list.size())
|
||||
return;
|
||||
|
||||
//begin + 1, so we don't target the one with the highest threat
|
||||
std::list<HostileReference *>::const_iterator itr = t_list.begin();
|
||||
std::advance(itr, 1);
|
||||
for (; itr != t_list.end(); ++itr) //store the threat list in a different container
|
||||
if (Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
|
||||
if (pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
targets.push_back(pTarget);
|
||||
|
||||
//cut down to size if we have more than 5 targets
|
||||
while (targets.size() > 5)
|
||||
targets.erase(targets.begin()+rand()%targets.size());
|
||||
|
||||
uint32 i = 0;
|
||||
for (std::vector<Unit *>::const_iterator iter = targets.begin(); iter != targets.end(); ++iter, ++i)
|
||||
if (Unit *pTarget = *iter)
|
||||
{
|
||||
enfeeble_targets[i] = pTarget->GetGUID();
|
||||
enfeeble_health[i] = pTarget->GetHealth();
|
||||
|
||||
pTarget->CastSpell(pTarget, SPELL_ENFEEBLE, true, 0, 0, me->GetGUID());
|
||||
pTarget->SetHealth(1);
|
||||
}
|
||||
}
|
||||
|
||||
void EnfeebleResetHealth()
|
||||
{
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
{
|
||||
Unit *pTarget = Unit::GetUnit(*me, enfeeble_targets[i]);
|
||||
if (pTarget && pTarget->isAlive())
|
||||
pTarget->SetHealth(enfeeble_health[i]);
|
||||
enfeeble_targets[i] = 0;
|
||||
enfeeble_health[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void SummonInfernal(const uint32 /*diff*/)
|
||||
{
|
||||
InfernalPoint *point = NULL;
|
||||
Position pos;
|
||||
if ((me->GetMapId() != 532) || positions.empty())
|
||||
me->GetRandomNearPosition(pos, 60);
|
||||
else
|
||||
{
|
||||
std::vector<InfernalPoint*>::iterator itr = positions.begin()+rand()%positions.size();
|
||||
point = *itr;
|
||||
positions.erase(itr);
|
||||
pos.Relocate(point->x, point->y, INFERNAL_Z);
|
||||
pInstance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
Creature *Infernal = me->SummonCreature(NETHERSPITE_INFERNAL, pos, TEMPSUMMON_TIMED_DESPAWN, 180000);
|
||||
InstanceScript *pInstance;
|
||||
uint32 EnfeebleTimer;
|
||||
uint32 EnfeebleResetTimer;
|
||||
uint32 ShadowNovaTimer;
|
||||
uint32 SWPainTimer;
|
||||
uint32 SunderArmorTimer;
|
||||
uint32 AmplifyDamageTimer;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 InfernalTimer;
|
||||
uint32 AxesTargetSwitchTimer;
|
||||
uint32 InfernalCleanupTimer;
|
||||
|
||||
if (Infernal)
|
||||
std::vector<uint64> infernals;
|
||||
std::vector<InfernalPoint*> positions;
|
||||
|
||||
uint64 axes[2];
|
||||
uint64 enfeeble_targets[5];
|
||||
uint64 enfeeble_health[5];
|
||||
|
||||
uint32 phase;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Infernal->SetDisplayId(INFERNAL_MODEL_INVISIBLE);
|
||||
Infernal->setFaction(me->getFaction());
|
||||
if (point)
|
||||
CAST_AI(netherspite_infernalAI, Infernal->AI())->point=point;
|
||||
CAST_AI(netherspite_infernalAI, Infernal->AI())->malchezaar=me->GetGUID();
|
||||
AxesCleanup();
|
||||
ClearWeapons();
|
||||
InfernalCleanup();
|
||||
positions.clear();
|
||||
|
||||
infernals.push_back(Infernal->GetGUID());
|
||||
DoCast(Infernal, SPELL_INFERNAL_RELAY);
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
enfeeble_targets[i] = 0;
|
||||
|
||||
for (uint8 i = 0; i < TOTAL_INFERNAL_POINTS; ++i)
|
||||
positions.push_back(&InfernalPoints[i]);
|
||||
|
||||
EnfeebleTimer = 30000;
|
||||
EnfeebleResetTimer = 38000;
|
||||
ShadowNovaTimer = 35500;
|
||||
SWPainTimer = 20000;
|
||||
AmplifyDamageTimer = 5000;
|
||||
Cleave_Timer = 8000;
|
||||
InfernalTimer = 45000;
|
||||
InfernalCleanupTimer = 47000;
|
||||
AxesTargetSwitchTimer = urand(7500,20000);
|
||||
SunderArmorTimer = urand(5000,10000);
|
||||
phase = 1;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), true);
|
||||
}
|
||||
|
||||
DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), me);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (EnfeebleResetTimer && EnfeebleResetTimer <= diff) // Let's not forget to reset that
|
||||
void KilledUnit(Unit * /*victim*/)
|
||||
{
|
||||
EnfeebleResetHealth();
|
||||
EnfeebleResetTimer = 0;
|
||||
} else EnfeebleResetTimer -= diff;
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_STUNNED)) // While shifting to phase 2 malchezaar stuns himself
|
||||
return;
|
||||
|
||||
if (me->GetUInt64Value(UNIT_FIELD_TARGET) != me->getVictim()->GetGUID())
|
||||
me->SetUInt64Value(UNIT_FIELD_TARGET, me->getVictim()->GetGUID());
|
||||
|
||||
if (phase == 1)
|
||||
{
|
||||
if ((me->GetHealth()*100) / me->GetMaxHealth() < 60)
|
||||
{
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
|
||||
phase = 2;
|
||||
|
||||
//animation
|
||||
DoCast(me, SPELL_EQUIP_AXES);
|
||||
|
||||
//text
|
||||
DoScriptText(SAY_AXE_TOSS1, me);
|
||||
|
||||
//passive thrash aura
|
||||
DoCast(me, SPELL_THRASH_AURA, true);
|
||||
|
||||
//models
|
||||
SetEquipmentSlots(false, EQUIP_ID_AXE, EQUIP_ID_AXE, EQUIP_NO_CHANGE);
|
||||
|
||||
//damage
|
||||
const CreatureInfo *cinfo = me->GetCreatureInfo();
|
||||
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 2*cinfo->mindmg);
|
||||
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 2*cinfo->maxdmg);
|
||||
me->UpdateDamagePhysical(BASE_ATTACK);
|
||||
|
||||
me->SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, cinfo->mindmg);
|
||||
me->SetBaseWeaponDamage(OFF_ATTACK, MAXDAMAGE, cinfo->maxdmg);
|
||||
//Sigh, updating only works on main attack, do it manually ....
|
||||
me->SetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE, cinfo->mindmg);
|
||||
me->SetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, cinfo->maxdmg);
|
||||
|
||||
me->SetAttackTime(OFF_ATTACK, (me->GetAttackTime(BASE_ATTACK)*150)/100);
|
||||
}
|
||||
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
|
||||
}
|
||||
else if (phase == 2)
|
||||
|
||||
void JustDied(Unit * /*victim*/)
|
||||
{
|
||||
if ((me->GetHealth()*100) / me->GetMaxHealth() < 30)
|
||||
{
|
||||
InfernalTimer = 15000;
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
phase = 3;
|
||||
AxesCleanup();
|
||||
ClearWeapons();
|
||||
InfernalCleanup();
|
||||
positions.clear();
|
||||
|
||||
ClearWeapons();
|
||||
for (uint8 i = 0; i < TOTAL_INFERNAL_POINTS; ++i)
|
||||
positions.push_back(&InfernalPoints[i]);
|
||||
|
||||
//remove thrash
|
||||
me->RemoveAurasDueToSpell(SPELL_THRASH_AURA);
|
||||
if (pInstance)
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), true);
|
||||
}
|
||||
|
||||
DoScriptText(SAY_AXE_TOSS2, me);
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
{
|
||||
Creature *axe = me->SummonCreature(MALCHEZARS_AXE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
|
||||
if (axe)
|
||||
if (pInstance)
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), false); // Open the door leading further in
|
||||
}
|
||||
|
||||
void InfernalCleanup()
|
||||
{
|
||||
//Infernal Cleanup
|
||||
for (std::vector<uint64>::const_iterator itr = infernals.begin(); itr != infernals.end(); ++itr)
|
||||
if (Unit *pInfernal = Unit::GetUnit(*me, *itr))
|
||||
if (pInfernal->isAlive())
|
||||
{
|
||||
axe->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
axe->setFaction(me->getFaction());
|
||||
axes[i] = axe->GetGUID();
|
||||
if (pTarget)
|
||||
{
|
||||
axe->AI()->AttackStart(pTarget);
|
||||
//axe->getThreatManager().tauntApply(pTarget); //Taunt Apply and fade out does not work properly
|
||||
// So we'll use a hack to add a lot of threat to our target
|
||||
axe->AddThreat(pTarget, 10000000.0f);
|
||||
}
|
||||
pInfernal->SetVisibility(VISIBILITY_OFF);
|
||||
pInfernal->setDeathState(JUST_DIED);
|
||||
}
|
||||
}
|
||||
|
||||
if (ShadowNovaTimer > 35000)
|
||||
ShadowNovaTimer = EnfeebleTimer + 5000;
|
||||
infernals.clear();
|
||||
}
|
||||
|
||||
void AxesCleanup()
|
||||
{
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
{
|
||||
Unit *axe = Unit::GetUnit(*me, axes[i]);
|
||||
if (axe && axe->isAlive())
|
||||
axe->Kill(axe);
|
||||
axes[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void ClearWeapons()
|
||||
{
|
||||
SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
|
||||
|
||||
//damage
|
||||
const CreatureInfo *cinfo = me->GetCreatureInfo();
|
||||
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg);
|
||||
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg);
|
||||
me->UpdateDamagePhysical(BASE_ATTACK);
|
||||
}
|
||||
|
||||
void EnfeebleHealthEffect()
|
||||
{
|
||||
const SpellEntry *info = GetSpellStore()->LookupEntry(SPELL_ENFEEBLE_EFFECT);
|
||||
if (!info)
|
||||
return;
|
||||
|
||||
std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
|
||||
std::vector<Unit *> targets;
|
||||
|
||||
if (!t_list.size())
|
||||
return;
|
||||
|
||||
//begin + 1, so we don't target the one with the highest threat
|
||||
std::list<HostileReference *>::const_iterator itr = t_list.begin();
|
||||
std::advance(itr, 1);
|
||||
for (; itr != t_list.end(); ++itr) //store the threat list in a different container
|
||||
if (Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
|
||||
if (pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
targets.push_back(pTarget);
|
||||
|
||||
//cut down to size if we have more than 5 targets
|
||||
while (targets.size() > 5)
|
||||
targets.erase(targets.begin()+rand()%targets.size());
|
||||
|
||||
uint32 i = 0;
|
||||
for (std::vector<Unit *>::const_iterator iter = targets.begin(); iter != targets.end(); ++iter, ++i)
|
||||
if (Unit *pTarget = *iter)
|
||||
{
|
||||
enfeeble_targets[i] = pTarget->GetGUID();
|
||||
enfeeble_health[i] = pTarget->GetHealth();
|
||||
|
||||
pTarget->CastSpell(pTarget, SPELL_ENFEEBLE, true, 0, 0, me->GetGUID());
|
||||
pTarget->SetHealth(1);
|
||||
}
|
||||
}
|
||||
|
||||
void EnfeebleResetHealth()
|
||||
{
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
{
|
||||
Unit *pTarget = Unit::GetUnit(*me, enfeeble_targets[i]);
|
||||
if (pTarget && pTarget->isAlive())
|
||||
pTarget->SetHealth(enfeeble_health[i]);
|
||||
enfeeble_targets[i] = 0;
|
||||
enfeeble_health[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void SummonInfernal(const uint32 /*diff*/)
|
||||
{
|
||||
InfernalPoint *point = NULL;
|
||||
Position pos;
|
||||
if ((me->GetMapId() != 532) || positions.empty())
|
||||
me->GetRandomNearPosition(pos, 60);
|
||||
else
|
||||
{
|
||||
std::vector<InfernalPoint*>::iterator itr = positions.begin()+rand()%positions.size();
|
||||
point = *itr;
|
||||
positions.erase(itr);
|
||||
pos.Relocate(point->x, point->y, INFERNAL_Z);
|
||||
}
|
||||
|
||||
if (SunderArmorTimer <= diff)
|
||||
Creature *Infernal = me->SummonCreature(NETHERSPITE_INFERNAL, pos, TEMPSUMMON_TIMED_DESPAWN, 180000);
|
||||
|
||||
if (Infernal)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SUNDER_ARMOR);
|
||||
SunderArmorTimer = urand(10000,18000);
|
||||
Infernal->SetDisplayId(INFERNAL_MODEL_INVISIBLE);
|
||||
Infernal->setFaction(me->getFaction());
|
||||
if (point)
|
||||
CAST_AI(netherspite_infernal::netherspite_infernalAI, Infernal->AI())->point=point;
|
||||
CAST_AI(netherspite_infernal::netherspite_infernalAI, Infernal->AI())->malchezaar=me->GetGUID();
|
||||
|
||||
} else SunderArmorTimer -= diff;
|
||||
infernals.push_back(Infernal->GetGUID());
|
||||
DoCast(Infernal, SPELL_INFERNAL_RELAY);
|
||||
}
|
||||
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = urand(6000,12000);
|
||||
|
||||
} else Cleave_Timer -= diff;
|
||||
DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), me);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (AxesTargetSwitchTimer <= diff)
|
||||
{
|
||||
AxesTargetSwitchTimer = urand(7500,20000);
|
||||
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (EnfeebleResetTimer && EnfeebleResetTimer <= diff) // Let's not forget to reset that
|
||||
{
|
||||
EnfeebleResetHealth();
|
||||
EnfeebleResetTimer = 0;
|
||||
} else EnfeebleResetTimer -= diff;
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_STUNNED)) // While shifting to phase 2 malchezaar stuns himself
|
||||
return;
|
||||
|
||||
if (me->GetUInt64Value(UNIT_FIELD_TARGET) != me->getVictim()->GetGUID())
|
||||
me->SetUInt64Value(UNIT_FIELD_TARGET, me->getVictim()->GetGUID());
|
||||
|
||||
if (phase == 1)
|
||||
{
|
||||
if ((me->GetHealth()*100) / me->GetMaxHealth() < 60)
|
||||
{
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
|
||||
phase = 2;
|
||||
|
||||
//animation
|
||||
DoCast(me, SPELL_EQUIP_AXES);
|
||||
|
||||
//text
|
||||
DoScriptText(SAY_AXE_TOSS1, me);
|
||||
|
||||
//passive thrash aura
|
||||
DoCast(me, SPELL_THRASH_AURA, true);
|
||||
|
||||
//models
|
||||
SetEquipmentSlots(false, EQUIP_ID_AXE, EQUIP_ID_AXE, EQUIP_NO_CHANGE);
|
||||
|
||||
//damage
|
||||
const CreatureInfo *cinfo = me->GetCreatureInfo();
|
||||
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 2*cinfo->mindmg);
|
||||
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 2*cinfo->maxdmg);
|
||||
me->UpdateDamagePhysical(BASE_ATTACK);
|
||||
|
||||
me->SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, cinfo->mindmg);
|
||||
me->SetBaseWeaponDamage(OFF_ATTACK, MAXDAMAGE, cinfo->maxdmg);
|
||||
//Sigh, updating only works on main attack, do it manually ....
|
||||
me->SetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE, cinfo->mindmg);
|
||||
me->SetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, cinfo->maxdmg);
|
||||
|
||||
me->SetAttackTime(OFF_ATTACK, (me->GetAttackTime(BASE_ATTACK)*150)/100);
|
||||
}
|
||||
}
|
||||
else if (phase == 2)
|
||||
{
|
||||
if ((me->GetHealth()*100) / me->GetMaxHealth() < 30)
|
||||
{
|
||||
InfernalTimer = 15000;
|
||||
|
||||
phase = 3;
|
||||
|
||||
ClearWeapons();
|
||||
|
||||
//remove thrash
|
||||
me->RemoveAurasDueToSpell(SPELL_THRASH_AURA);
|
||||
|
||||
DoScriptText(SAY_AXE_TOSS2, me);
|
||||
|
||||
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
{
|
||||
if (Unit *axe = Unit::GetUnit(*me, axes[i]))
|
||||
Creature *axe = me->SummonCreature(MALCHEZARS_AXE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
|
||||
if (axe)
|
||||
{
|
||||
if (axe->getVictim())
|
||||
DoModifyThreatPercent(axe->getVictim(), -100);
|
||||
axe->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
axe->setFaction(me->getFaction());
|
||||
axes[i] = axe->GetGUID();
|
||||
if (pTarget)
|
||||
axe->AddThreat(pTarget, 1000000.0f);
|
||||
//axe->getThreatManager().tauntFadeOut(axe->getVictim());
|
||||
//axe->getThreatManager().tauntApply(pTarget);
|
||||
{
|
||||
axe->AI()->AttackStart(pTarget);
|
||||
//axe->getThreatManager().tauntApply(pTarget); //Taunt Apply and fade out does not work properly
|
||||
// So we'll use a hack to add a lot of threat to our target
|
||||
axe->AddThreat(pTarget, 10000000.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ShadowNovaTimer > 35000)
|
||||
ShadowNovaTimer = EnfeebleTimer + 5000;
|
||||
|
||||
return;
|
||||
}
|
||||
} else AxesTargetSwitchTimer -= diff;
|
||||
|
||||
if (AmplifyDamageTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_AMPLIFY_DAMAGE);
|
||||
AmplifyDamageTimer = urand(20000,30000);
|
||||
} else AmplifyDamageTimer -= diff;
|
||||
}
|
||||
if (SunderArmorTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SUNDER_ARMOR);
|
||||
SunderArmorTimer = urand(10000,18000);
|
||||
|
||||
//Time for global and double timers
|
||||
if (InfernalTimer <= diff)
|
||||
{
|
||||
SummonInfernal(diff);
|
||||
InfernalTimer = phase == 3 ? 14500 : 44500; // 15 secs in phase 3, 45 otherwise
|
||||
} else InfernalTimer -= diff;
|
||||
} else SunderArmorTimer -= diff;
|
||||
|
||||
if (ShadowNovaTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWNOVA);
|
||||
ShadowNovaTimer = phase == 3 ? 31000 : uint32(-1);
|
||||
} else ShadowNovaTimer -= diff;
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = urand(6000,12000);
|
||||
|
||||
if (phase != 2)
|
||||
{
|
||||
if (SWPainTimer <= diff)
|
||||
{
|
||||
Unit *pTarget = NULL;
|
||||
if (phase == 1)
|
||||
pTarget = me->getVictim(); // the tank
|
||||
else // anyone but the tank
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
|
||||
|
||||
if (pTarget)
|
||||
DoCast(pTarget, SPELL_SW_PAIN);
|
||||
|
||||
SWPainTimer = 20000;
|
||||
} else SWPainTimer -= diff;
|
||||
}
|
||||
|
||||
if (phase != 3)
|
||||
{
|
||||
if (EnfeebleTimer <= diff)
|
||||
{
|
||||
EnfeebleHealthEffect();
|
||||
EnfeebleTimer = 30000;
|
||||
ShadowNovaTimer = 5000;
|
||||
EnfeebleResetTimer = 9000;
|
||||
} else EnfeebleTimer -= diff;
|
||||
}
|
||||
|
||||
if (phase == 2)
|
||||
DoMeleeAttacksIfReady();
|
||||
else
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void DoMeleeAttacksIfReady()
|
||||
{
|
||||
if (me->IsWithinMeleeRange(me->getVictim()) && !me->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
//Check for base attack
|
||||
if (me->isAttackReady() && me->getVictim())
|
||||
{
|
||||
me->AttackerStateUpdate(me->getVictim());
|
||||
me->resetAttackTimer();
|
||||
} else Cleave_Timer -= diff;
|
||||
}
|
||||
//Check for offhand attack
|
||||
if (me->isAttackReady(OFF_ATTACK) && me->getVictim())
|
||||
else
|
||||
{
|
||||
me->AttackerStateUpdate(me->getVictim(), OFF_ATTACK);
|
||||
me->resetAttackTimer(OFF_ATTACK);
|
||||
if (AxesTargetSwitchTimer <= diff)
|
||||
{
|
||||
AxesTargetSwitchTimer = urand(7500,20000);
|
||||
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
{
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
{
|
||||
if (Unit *axe = Unit::GetUnit(*me, axes[i]))
|
||||
{
|
||||
if (axe->getVictim())
|
||||
DoModifyThreatPercent(axe->getVictim(), -100);
|
||||
if (pTarget)
|
||||
axe->AddThreat(pTarget, 1000000.0f);
|
||||
//axe->getThreatManager().tauntFadeOut(axe->getVictim());
|
||||
//axe->getThreatManager().tauntApply(pTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else AxesTargetSwitchTimer -= diff;
|
||||
|
||||
if (AmplifyDamageTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_AMPLIFY_DAMAGE);
|
||||
AmplifyDamageTimer = urand(20000,30000);
|
||||
} else AmplifyDamageTimer -= diff;
|
||||
}
|
||||
|
||||
//Time for global and double timers
|
||||
if (InfernalTimer <= diff)
|
||||
{
|
||||
SummonInfernal(diff);
|
||||
InfernalTimer = phase == 3 ? 14500 : 44500; // 15 secs in phase 3, 45 otherwise
|
||||
} else InfernalTimer -= diff;
|
||||
|
||||
if (ShadowNovaTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWNOVA);
|
||||
ShadowNovaTimer = phase == 3 ? 31000 : uint32(-1);
|
||||
} else ShadowNovaTimer -= diff;
|
||||
|
||||
if (phase != 2)
|
||||
{
|
||||
if (SWPainTimer <= diff)
|
||||
{
|
||||
Unit *pTarget = NULL;
|
||||
if (phase == 1)
|
||||
pTarget = me->getVictim(); // the tank
|
||||
else // anyone but the tank
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
|
||||
|
||||
if (pTarget)
|
||||
DoCast(pTarget, SPELL_SW_PAIN);
|
||||
|
||||
SWPainTimer = 20000;
|
||||
} else SWPainTimer -= diff;
|
||||
}
|
||||
|
||||
if (phase != 3)
|
||||
{
|
||||
if (EnfeebleTimer <= diff)
|
||||
{
|
||||
EnfeebleHealthEffect();
|
||||
EnfeebleTimer = 30000;
|
||||
ShadowNovaTimer = 5000;
|
||||
EnfeebleResetTimer = 9000;
|
||||
} else EnfeebleTimer -= diff;
|
||||
}
|
||||
|
||||
if (phase == 2)
|
||||
DoMeleeAttacksIfReady();
|
||||
else
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void DoMeleeAttacksIfReady()
|
||||
{
|
||||
if (me->IsWithinMeleeRange(me->getVictim()) && !me->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
//Check for base attack
|
||||
if (me->isAttackReady() && me->getVictim())
|
||||
{
|
||||
me->AttackerStateUpdate(me->getVictim());
|
||||
me->resetAttackTimer();
|
||||
}
|
||||
//Check for offhand attack
|
||||
if (me->isAttackReady(OFF_ATTACK) && me->getVictim())
|
||||
{
|
||||
me->AttackerStateUpdate(me->getVictim(), OFF_ATTACK);
|
||||
me->resetAttackTimer(OFF_ATTACK);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Cleanup(Creature *infernal, InfernalPoint *point)
|
||||
{
|
||||
for (std::vector<uint64>::iterator itr = infernals.begin(); itr!= infernals.end(); ++itr)
|
||||
if (*itr == infernal->GetGUID())
|
||||
void Cleanup(Creature *infernal, InfernalPoint *point)
|
||||
{
|
||||
infernals.erase(itr);
|
||||
break;
|
||||
}
|
||||
for (std::vector<uint64>::iterator itr = infernals.begin(); itr!= infernals.end(); ++itr)
|
||||
if (*itr == infernal->GetGUID())
|
||||
{
|
||||
infernals.erase(itr);
|
||||
break;
|
||||
}
|
||||
|
||||
positions.push_back(point);
|
||||
}
|
||||
};
|
||||
|
||||
positions.push_back(point);
|
||||
}
|
||||
};
|
||||
|
||||
void netherspite_infernalAI::Cleanup()
|
||||
{
|
||||
Unit *pMalchezaar = Unit::GetUnit(*me, malchezaar);
|
||||
|
||||
if (pMalchezaar && pMalchezaar->isAlive())
|
||||
CAST_AI(boss_malchezaarAI, CAST_CRE(pMalchezaar)->AI())->Cleanup(me, point);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_netherspite_infernal(Creature* pCreature)
|
||||
{
|
||||
return new netherspite_infernalAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_boss_malchezaar(Creature* pCreature)
|
||||
{
|
||||
return new boss_malchezaarAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_malchezaar()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_malchezaar";
|
||||
newscript->GetAI = &GetAI_boss_malchezaar;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "netherspite_infernal";
|
||||
newscript->GetAI = &GetAI_netherspite_infernal;
|
||||
newscript->RegisterSelf();
|
||||
new boss_malchezaar();
|
||||
new netherspite_infernal();
|
||||
}
|
||||
|
||||
|
||||
@@ -80,492 +80,497 @@ enum SuperSpell
|
||||
SUPER_BLIZZARD,
|
||||
SUPER_AE,
|
||||
};
|
||||
|
||||
struct boss_aranAI : public ScriptedAI
|
||||
class boss_shade_of_aran : public CreatureScript
|
||||
{
|
||||
boss_aranAI(Creature *c) : ScriptedAI(c)
|
||||
public:
|
||||
boss_shade_of_aran() : CreatureScript("boss_shade_of_aran") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
return new boss_aranAI (pCreature);
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 SecondarySpellTimer;
|
||||
uint32 NormalCastTimer;
|
||||
uint32 SuperCastTimer;
|
||||
uint32 BerserkTimer;
|
||||
uint32 CloseDoorTimer; // Don't close the door right on aggro in case some people are still entering.
|
||||
|
||||
uint8 LastSuperSpell;
|
||||
|
||||
uint32 FlameWreathTimer;
|
||||
uint32 FlameWreathCheckTime;
|
||||
uint64 FlameWreathTarget[3];
|
||||
float FWTargPosX[3];
|
||||
float FWTargPosY[3];
|
||||
|
||||
uint32 CurrentNormalSpell;
|
||||
uint32 ArcaneCooldown;
|
||||
uint32 FireCooldown;
|
||||
uint32 FrostCooldown;
|
||||
|
||||
uint32 DrinkInterruptTimer;
|
||||
|
||||
bool ElementalsSpawned;
|
||||
bool Drinking;
|
||||
bool DrinkInturrupted;
|
||||
|
||||
void Reset()
|
||||
struct boss_aranAI : public ScriptedAI
|
||||
{
|
||||
SecondarySpellTimer = 5000;
|
||||
NormalCastTimer = 0;
|
||||
SuperCastTimer = 35000;
|
||||
BerserkTimer = 720000;
|
||||
CloseDoorTimer = 15000;
|
||||
|
||||
LastSuperSpell = rand()%3;
|
||||
|
||||
FlameWreathTimer = 0;
|
||||
FlameWreathCheckTime = 0;
|
||||
|
||||
CurrentNormalSpell = 0;
|
||||
ArcaneCooldown = 0;
|
||||
FireCooldown = 0;
|
||||
FrostCooldown = 0;
|
||||
|
||||
DrinkInterruptTimer = 10000;
|
||||
|
||||
ElementalsSpawned = false;
|
||||
Drinking = false;
|
||||
DrinkInturrupted = false;
|
||||
|
||||
if (pInstance)
|
||||
boss_aranAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
// Not in progress
|
||||
pInstance->SetData(TYPE_ARAN, NOT_STARTED);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), true);
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * /*victim*/)
|
||||
{
|
||||
DoScriptText(RAND(SAY_KILL1,SAY_KILL2), me);
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*victim*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(TYPE_ARAN, DONE);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), true);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me);
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(TYPE_ARAN, IN_PROGRESS);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), false);
|
||||
}
|
||||
}
|
||||
|
||||
void FlameWreathEffect()
|
||||
{
|
||||
std::vector<Unit*> targets;
|
||||
std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
|
||||
|
||||
if (!t_list.size())
|
||||
return;
|
||||
|
||||
//store the threat list in a different container
|
||||
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
{
|
||||
Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
//only on alive players
|
||||
if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
targets.push_back(pTarget);
|
||||
pInstance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
//cut down to size if we have more than 3 targets
|
||||
while (targets.size() > 3)
|
||||
targets.erase(targets.begin()+rand()%targets.size());
|
||||
InstanceScript* pInstance;
|
||||
|
||||
uint32 i = 0;
|
||||
for (std::vector<Unit*>::const_iterator itr = targets.begin(); itr!= targets.end(); ++itr)
|
||||
uint32 SecondarySpellTimer;
|
||||
uint32 NormalCastTimer;
|
||||
uint32 SuperCastTimer;
|
||||
uint32 BerserkTimer;
|
||||
uint32 CloseDoorTimer; // Don't close the door right on aggro in case some people are still entering.
|
||||
|
||||
uint8 LastSuperSpell;
|
||||
|
||||
uint32 FlameWreathTimer;
|
||||
uint32 FlameWreathCheckTime;
|
||||
uint64 FlameWreathTarget[3];
|
||||
float FWTargPosX[3];
|
||||
float FWTargPosY[3];
|
||||
|
||||
uint32 CurrentNormalSpell;
|
||||
uint32 ArcaneCooldown;
|
||||
uint32 FireCooldown;
|
||||
uint32 FrostCooldown;
|
||||
|
||||
uint32 DrinkInterruptTimer;
|
||||
|
||||
bool ElementalsSpawned;
|
||||
bool Drinking;
|
||||
bool DrinkInturrupted;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (*itr)
|
||||
SecondarySpellTimer = 5000;
|
||||
NormalCastTimer = 0;
|
||||
SuperCastTimer = 35000;
|
||||
BerserkTimer = 720000;
|
||||
CloseDoorTimer = 15000;
|
||||
|
||||
LastSuperSpell = rand()%3;
|
||||
|
||||
FlameWreathTimer = 0;
|
||||
FlameWreathCheckTime = 0;
|
||||
|
||||
CurrentNormalSpell = 0;
|
||||
ArcaneCooldown = 0;
|
||||
FireCooldown = 0;
|
||||
FrostCooldown = 0;
|
||||
|
||||
DrinkInterruptTimer = 10000;
|
||||
|
||||
ElementalsSpawned = false;
|
||||
Drinking = false;
|
||||
DrinkInturrupted = false;
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
FlameWreathTarget[i] = (*itr)->GetGUID();
|
||||
FWTargPosX[i] = (*itr)->GetPositionX();
|
||||
FWTargPosY[i] = (*itr)->GetPositionY();
|
||||
DoCast((*itr), SPELL_FLAME_WREATH, true);
|
||||
++i;
|
||||
// Not in progress
|
||||
pInstance->SetData(TYPE_ARAN, NOT_STARTED);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (CloseDoorTimer)
|
||||
void KilledUnit(Unit * /*victim*/)
|
||||
{
|
||||
if (CloseDoorTimer <= diff)
|
||||
DoScriptText(RAND(SAY_KILL1,SAY_KILL2), me);
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*victim*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_ARAN, DONE);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), true);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me);
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(TYPE_ARAN, IN_PROGRESS);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), false);
|
||||
}
|
||||
}
|
||||
|
||||
void FlameWreathEffect()
|
||||
{
|
||||
std::vector<Unit*> targets;
|
||||
std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
|
||||
|
||||
if (!t_list.size())
|
||||
return;
|
||||
|
||||
//store the threat list in a different container
|
||||
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
{
|
||||
Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
//only on alive players
|
||||
if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
targets.push_back(pTarget);
|
||||
}
|
||||
|
||||
//cut down to size if we have more than 3 targets
|
||||
while (targets.size() > 3)
|
||||
targets.erase(targets.begin()+rand()%targets.size());
|
||||
|
||||
uint32 i = 0;
|
||||
for (std::vector<Unit*>::const_iterator itr = targets.begin(); itr!= targets.end(); ++itr)
|
||||
{
|
||||
if (*itr)
|
||||
{
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), false);
|
||||
CloseDoorTimer = 0;
|
||||
FlameWreathTarget[i] = (*itr)->GetGUID();
|
||||
FWTargPosX[i] = (*itr)->GetPositionX();
|
||||
FWTargPosY[i] = (*itr)->GetPositionY();
|
||||
DoCast((*itr), SPELL_FLAME_WREATH, true);
|
||||
++i;
|
||||
}
|
||||
} else CloseDoorTimer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
//Cooldowns for casts
|
||||
if (ArcaneCooldown)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (ArcaneCooldown >= diff)
|
||||
ArcaneCooldown -= diff;
|
||||
else ArcaneCooldown = 0;
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (CloseDoorTimer)
|
||||
{
|
||||
if (CloseDoorTimer <= diff)
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), false);
|
||||
CloseDoorTimer = 0;
|
||||
}
|
||||
} else CloseDoorTimer -= diff;
|
||||
}
|
||||
|
||||
//Cooldowns for casts
|
||||
if (ArcaneCooldown)
|
||||
{
|
||||
if (ArcaneCooldown >= diff)
|
||||
ArcaneCooldown -= diff;
|
||||
else ArcaneCooldown = 0;
|
||||
}
|
||||
|
||||
if (FireCooldown)
|
||||
{
|
||||
if (FireCooldown >= diff)
|
||||
FireCooldown -= diff;
|
||||
else FireCooldown = 0;
|
||||
}
|
||||
|
||||
if (FrostCooldown)
|
||||
{
|
||||
if (FrostCooldown >= diff)
|
||||
FrostCooldown -= diff;
|
||||
else FrostCooldown = 0;
|
||||
}
|
||||
|
||||
if (!Drinking && me->GetMaxPower(POWER_MANA) && (me->GetPower(POWER_MANA)*100 / me->GetMaxPower(POWER_MANA)) < 20)
|
||||
{
|
||||
Drinking = true;
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
|
||||
DoScriptText(SAY_DRINK, me);
|
||||
|
||||
if (!DrinkInturrupted)
|
||||
{
|
||||
DoCast(me, SPELL_MASS_POLY, true);
|
||||
DoCast(me, SPELL_CONJURE, false);
|
||||
DoCast(me, SPELL_DRINK, false);
|
||||
me->SetStandState(UNIT_STAND_STATE_SIT);
|
||||
DrinkInterruptTimer = 10000;
|
||||
}
|
||||
}
|
||||
|
||||
//Drink Interrupt
|
||||
if (Drinking && DrinkInturrupted)
|
||||
{
|
||||
Drinking = false;
|
||||
me->RemoveAurasDueToSpell(SPELL_DRINK);
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
me->SetPower(POWER_MANA, me->GetMaxPower(POWER_MANA)-32000);
|
||||
DoCast(me, SPELL_POTION, false);
|
||||
}
|
||||
|
||||
//Drink Interrupt Timer
|
||||
if (Drinking && !DrinkInturrupted)
|
||||
if (DrinkInterruptTimer >= diff)
|
||||
DrinkInterruptTimer -= diff;
|
||||
else
|
||||
{
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
DoCast(me, SPELL_POTION, true);
|
||||
DoCast(me, SPELL_AOE_PYROBLAST, false);
|
||||
DrinkInturrupted = true;
|
||||
Drinking = false;
|
||||
}
|
||||
|
||||
//Don't execute any more code if we are drinking
|
||||
if (Drinking)
|
||||
return;
|
||||
|
||||
//Normal casts
|
||||
if (NormalCastTimer <= diff)
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
if (!pTarget)
|
||||
return;
|
||||
|
||||
uint32 Spells[3];
|
||||
uint8 AvailableSpells = 0;
|
||||
|
||||
//Check for what spells are not on cooldown
|
||||
if (!ArcaneCooldown)
|
||||
{
|
||||
Spells[AvailableSpells] = SPELL_ARCMISSLE;
|
||||
++AvailableSpells;
|
||||
}
|
||||
if (!FireCooldown)
|
||||
{
|
||||
Spells[AvailableSpells] = SPELL_FIREBALL;
|
||||
++AvailableSpells;
|
||||
}
|
||||
if (!FrostCooldown)
|
||||
{
|
||||
Spells[AvailableSpells] = SPELL_FROSTBOLT;
|
||||
++AvailableSpells;
|
||||
}
|
||||
|
||||
//If no available spells wait 1 second and try again
|
||||
if (AvailableSpells)
|
||||
{
|
||||
CurrentNormalSpell = Spells[rand() % AvailableSpells];
|
||||
DoCast(pTarget, CurrentNormalSpell);
|
||||
}
|
||||
}
|
||||
NormalCastTimer = 1000;
|
||||
} else NormalCastTimer -= diff;
|
||||
|
||||
if (SecondarySpellTimer <= diff)
|
||||
{
|
||||
switch (urand(0,1))
|
||||
{
|
||||
case 0:
|
||||
DoCast(me, SPELL_AOE_CS);
|
||||
break;
|
||||
case 1:
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_CHAINSOFICE);
|
||||
break;
|
||||
}
|
||||
SecondarySpellTimer = urand(5000,20000);
|
||||
} else SecondarySpellTimer -= diff;
|
||||
|
||||
if (SuperCastTimer <= diff)
|
||||
{
|
||||
uint8 Available[2];
|
||||
|
||||
switch (LastSuperSpell)
|
||||
{
|
||||
case SUPER_AE:
|
||||
Available[0] = SUPER_FLAME;
|
||||
Available[1] = SUPER_BLIZZARD;
|
||||
break;
|
||||
case SUPER_FLAME:
|
||||
Available[0] = SUPER_AE;
|
||||
Available[1] = SUPER_BLIZZARD;
|
||||
break;
|
||||
case SUPER_BLIZZARD:
|
||||
Available[0] = SUPER_FLAME;
|
||||
Available[1] = SUPER_AE;
|
||||
break;
|
||||
}
|
||||
|
||||
LastSuperSpell = Available[urand(0,1)];
|
||||
|
||||
switch (LastSuperSpell)
|
||||
{
|
||||
case SUPER_AE:
|
||||
DoScriptText(RAND(SAY_EXPLOSION1,SAY_EXPLOSION2), me);
|
||||
|
||||
DoCast(me, SPELL_BLINK_CENTER, true);
|
||||
DoCast(me, SPELL_PLAYERPULL, true);
|
||||
DoCast(me, SPELL_MASSSLOW, true);
|
||||
DoCast(me, SPELL_AEXPLOSION, false);
|
||||
break;
|
||||
|
||||
case SUPER_FLAME:
|
||||
DoScriptText(RAND(SAY_FLAMEWREATH1,SAY_FLAMEWREATH2), me);
|
||||
|
||||
FlameWreathTimer = 20000;
|
||||
FlameWreathCheckTime = 500;
|
||||
|
||||
FlameWreathTarget[0] = 0;
|
||||
FlameWreathTarget[1] = 0;
|
||||
FlameWreathTarget[2] = 0;
|
||||
|
||||
FlameWreathEffect();
|
||||
break;
|
||||
|
||||
case SUPER_BLIZZARD:
|
||||
DoScriptText(RAND(SAY_BLIZZARD1,SAY_BLIZZARD2), me);
|
||||
|
||||
if (Creature* pSpawn = me->SummonCreature(CREATURE_ARAN_BLIZZARD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 25000))
|
||||
{
|
||||
pSpawn->setFaction(me->getFaction());
|
||||
pSpawn->CastSpell(pSpawn, SPELL_CIRCULAR_BLIZZARD, false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
SuperCastTimer = urand(35000,40000);
|
||||
} else SuperCastTimer -= diff;
|
||||
|
||||
if (!ElementalsSpawned && me->GetHealth()*100 / me->GetMaxHealth() < 40)
|
||||
{
|
||||
ElementalsSpawned = true;
|
||||
|
||||
for (uint32 i = 0; i < 4; ++i)
|
||||
{
|
||||
if (Creature* pUnit = me->SummonCreature(CREATURE_WATER_ELEMENTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 90000))
|
||||
{
|
||||
pUnit->Attack(me->getVictim(), true);
|
||||
pUnit->setFaction(me->getFaction());
|
||||
}
|
||||
}
|
||||
|
||||
DoScriptText(SAY_ELEMENTALS, me);
|
||||
}
|
||||
|
||||
if (BerserkTimer <= diff)
|
||||
{
|
||||
for (uint32 i = 0; i < 5; ++i)
|
||||
{
|
||||
if (Creature* pUnit = me->SummonCreature(CREATURE_SHADOW_OF_ARAN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000))
|
||||
{
|
||||
pUnit->Attack(me->getVictim(), true);
|
||||
pUnit->setFaction(me->getFaction());
|
||||
}
|
||||
}
|
||||
|
||||
DoScriptText(SAY_TIMEOVER, me);
|
||||
|
||||
BerserkTimer = 60000;
|
||||
} else BerserkTimer -= diff;
|
||||
|
||||
//Flame Wreath check
|
||||
if (FlameWreathTimer)
|
||||
{
|
||||
if (FlameWreathTimer >= diff)
|
||||
FlameWreathTimer -= diff;
|
||||
else FlameWreathTimer = 0;
|
||||
|
||||
if (FlameWreathCheckTime <= diff)
|
||||
{
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
if (!FlameWreathTarget[i])
|
||||
continue;
|
||||
|
||||
Unit* pUnit = Unit::GetUnit(*me, FlameWreathTarget[i]);
|
||||
if (pUnit && !pUnit->IsWithinDist2d(FWTargPosX[i], FWTargPosY[i], 3))
|
||||
{
|
||||
pUnit->CastSpell(pUnit, 20476, true, 0, 0, me->GetGUID());
|
||||
pUnit->CastSpell(pUnit, 11027, true);
|
||||
FlameWreathTarget[i] = 0;
|
||||
}
|
||||
}
|
||||
FlameWreathCheckTime = 500;
|
||||
} else FlameWreathCheckTime -= diff;
|
||||
}
|
||||
|
||||
if (ArcaneCooldown && FireCooldown && FrostCooldown)
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
if (FireCooldown)
|
||||
void DamageTaken(Unit* /*pAttacker*/, uint32 &damage)
|
||||
{
|
||||
if (FireCooldown >= diff)
|
||||
FireCooldown -= diff;
|
||||
else FireCooldown = 0;
|
||||
if (!DrinkInturrupted && Drinking && damage)
|
||||
DrinkInturrupted = true;
|
||||
}
|
||||
|
||||
if (FrostCooldown)
|
||||
void SpellHit(Unit* /*pAttacker*/, const SpellEntry* Spell)
|
||||
{
|
||||
if (FrostCooldown >= diff)
|
||||
FrostCooldown -= diff;
|
||||
else FrostCooldown = 0;
|
||||
}
|
||||
//We only care about interrupt effects and only if they are durring a spell currently being casted
|
||||
if ((Spell->Effect[0] != SPELL_EFFECT_INTERRUPT_CAST &&
|
||||
Spell->Effect[1] != SPELL_EFFECT_INTERRUPT_CAST &&
|
||||
Spell->Effect[2] != SPELL_EFFECT_INTERRUPT_CAST) || !me->IsNonMeleeSpellCasted(false))
|
||||
return;
|
||||
|
||||
if (!Drinking && me->GetMaxPower(POWER_MANA) && (me->GetPower(POWER_MANA)*100 / me->GetMaxPower(POWER_MANA)) < 20)
|
||||
{
|
||||
Drinking = true;
|
||||
//Interrupt effect
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
|
||||
DoScriptText(SAY_DRINK, me);
|
||||
//Normally we would set the cooldown equal to the spell duration
|
||||
//but we do not have access to the DurationStore
|
||||
|
||||
if (!DrinkInturrupted)
|
||||
switch (CurrentNormalSpell)
|
||||
{
|
||||
DoCast(me, SPELL_MASS_POLY, true);
|
||||
DoCast(me, SPELL_CONJURE, false);
|
||||
DoCast(me, SPELL_DRINK, false);
|
||||
me->SetStandState(UNIT_STAND_STATE_SIT);
|
||||
DrinkInterruptTimer = 10000;
|
||||
case SPELL_ARCMISSLE: ArcaneCooldown = 5000; break;
|
||||
case SPELL_FIREBALL: FireCooldown = 5000; break;
|
||||
case SPELL_FROSTBOLT: FrostCooldown = 5000; break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//Drink Interrupt
|
||||
if (Drinking && DrinkInturrupted)
|
||||
{
|
||||
Drinking = false;
|
||||
me->RemoveAurasDueToSpell(SPELL_DRINK);
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
me->SetPower(POWER_MANA, me->GetMaxPower(POWER_MANA)-32000);
|
||||
DoCast(me, SPELL_POTION, false);
|
||||
}
|
||||
};
|
||||
class mob_aran_elemental : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_aran_elemental() : CreatureScript("mob_aran_elemental") { }
|
||||
|
||||
//Drink Interrupt Timer
|
||||
if (Drinking && !DrinkInturrupted)
|
||||
if (DrinkInterruptTimer >= diff)
|
||||
DrinkInterruptTimer -= diff;
|
||||
else
|
||||
{
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
DoCast(me, SPELL_POTION, true);
|
||||
DoCast(me, SPELL_AOE_PYROBLAST, false);
|
||||
DrinkInturrupted = true;
|
||||
Drinking = false;
|
||||
}
|
||||
|
||||
//Don't execute any more code if we are drinking
|
||||
if (Drinking)
|
||||
return;
|
||||
|
||||
//Normal casts
|
||||
if (NormalCastTimer <= diff)
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
if (!pTarget)
|
||||
return;
|
||||
|
||||
uint32 Spells[3];
|
||||
uint8 AvailableSpells = 0;
|
||||
|
||||
//Check for what spells are not on cooldown
|
||||
if (!ArcaneCooldown)
|
||||
{
|
||||
Spells[AvailableSpells] = SPELL_ARCMISSLE;
|
||||
++AvailableSpells;
|
||||
}
|
||||
if (!FireCooldown)
|
||||
{
|
||||
Spells[AvailableSpells] = SPELL_FIREBALL;
|
||||
++AvailableSpells;
|
||||
}
|
||||
if (!FrostCooldown)
|
||||
{
|
||||
Spells[AvailableSpells] = SPELL_FROSTBOLT;
|
||||
++AvailableSpells;
|
||||
}
|
||||
|
||||
//If no available spells wait 1 second and try again
|
||||
if (AvailableSpells)
|
||||
{
|
||||
CurrentNormalSpell = Spells[rand() % AvailableSpells];
|
||||
DoCast(pTarget, CurrentNormalSpell);
|
||||
}
|
||||
}
|
||||
NormalCastTimer = 1000;
|
||||
} else NormalCastTimer -= diff;
|
||||
|
||||
if (SecondarySpellTimer <= diff)
|
||||
{
|
||||
switch (urand(0,1))
|
||||
{
|
||||
case 0:
|
||||
DoCast(me, SPELL_AOE_CS);
|
||||
break;
|
||||
case 1:
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_CHAINSOFICE);
|
||||
break;
|
||||
}
|
||||
SecondarySpellTimer = urand(5000,20000);
|
||||
} else SecondarySpellTimer -= diff;
|
||||
|
||||
if (SuperCastTimer <= diff)
|
||||
{
|
||||
uint8 Available[2];
|
||||
|
||||
switch (LastSuperSpell)
|
||||
{
|
||||
case SUPER_AE:
|
||||
Available[0] = SUPER_FLAME;
|
||||
Available[1] = SUPER_BLIZZARD;
|
||||
break;
|
||||
case SUPER_FLAME:
|
||||
Available[0] = SUPER_AE;
|
||||
Available[1] = SUPER_BLIZZARD;
|
||||
break;
|
||||
case SUPER_BLIZZARD:
|
||||
Available[0] = SUPER_FLAME;
|
||||
Available[1] = SUPER_AE;
|
||||
break;
|
||||
}
|
||||
|
||||
LastSuperSpell = Available[urand(0,1)];
|
||||
|
||||
switch (LastSuperSpell)
|
||||
{
|
||||
case SUPER_AE:
|
||||
DoScriptText(RAND(SAY_EXPLOSION1,SAY_EXPLOSION2), me);
|
||||
|
||||
DoCast(me, SPELL_BLINK_CENTER, true);
|
||||
DoCast(me, SPELL_PLAYERPULL, true);
|
||||
DoCast(me, SPELL_MASSSLOW, true);
|
||||
DoCast(me, SPELL_AEXPLOSION, false);
|
||||
break;
|
||||
|
||||
case SUPER_FLAME:
|
||||
DoScriptText(RAND(SAY_FLAMEWREATH1,SAY_FLAMEWREATH2), me);
|
||||
|
||||
FlameWreathTimer = 20000;
|
||||
FlameWreathCheckTime = 500;
|
||||
|
||||
FlameWreathTarget[0] = 0;
|
||||
FlameWreathTarget[1] = 0;
|
||||
FlameWreathTarget[2] = 0;
|
||||
|
||||
FlameWreathEffect();
|
||||
break;
|
||||
|
||||
case SUPER_BLIZZARD:
|
||||
DoScriptText(RAND(SAY_BLIZZARD1,SAY_BLIZZARD2), me);
|
||||
|
||||
if (Creature* pSpawn = me->SummonCreature(CREATURE_ARAN_BLIZZARD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 25000))
|
||||
{
|
||||
pSpawn->setFaction(me->getFaction());
|
||||
pSpawn->CastSpell(pSpawn, SPELL_CIRCULAR_BLIZZARD, false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
SuperCastTimer = urand(35000,40000);
|
||||
} else SuperCastTimer -= diff;
|
||||
|
||||
if (!ElementalsSpawned && me->GetHealth()*100 / me->GetMaxHealth() < 40)
|
||||
{
|
||||
ElementalsSpawned = true;
|
||||
|
||||
for (uint32 i = 0; i < 4; ++i)
|
||||
{
|
||||
if (Creature* pUnit = me->SummonCreature(CREATURE_WATER_ELEMENTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 90000))
|
||||
{
|
||||
pUnit->Attack(me->getVictim(), true);
|
||||
pUnit->setFaction(me->getFaction());
|
||||
}
|
||||
}
|
||||
|
||||
DoScriptText(SAY_ELEMENTALS, me);
|
||||
}
|
||||
|
||||
if (BerserkTimer <= diff)
|
||||
{
|
||||
for (uint32 i = 0; i < 5; ++i)
|
||||
{
|
||||
if (Creature* pUnit = me->SummonCreature(CREATURE_SHADOW_OF_ARAN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000))
|
||||
{
|
||||
pUnit->Attack(me->getVictim(), true);
|
||||
pUnit->setFaction(me->getFaction());
|
||||
}
|
||||
}
|
||||
|
||||
DoScriptText(SAY_TIMEOVER, me);
|
||||
|
||||
BerserkTimer = 60000;
|
||||
} else BerserkTimer -= diff;
|
||||
|
||||
//Flame Wreath check
|
||||
if (FlameWreathTimer)
|
||||
{
|
||||
if (FlameWreathTimer >= diff)
|
||||
FlameWreathTimer -= diff;
|
||||
else FlameWreathTimer = 0;
|
||||
|
||||
if (FlameWreathCheckTime <= diff)
|
||||
{
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
if (!FlameWreathTarget[i])
|
||||
continue;
|
||||
|
||||
Unit* pUnit = Unit::GetUnit(*me, FlameWreathTarget[i]);
|
||||
if (pUnit && !pUnit->IsWithinDist2d(FWTargPosX[i], FWTargPosY[i], 3))
|
||||
{
|
||||
pUnit->CastSpell(pUnit, 20476, true, 0, 0, me->GetGUID());
|
||||
pUnit->CastSpell(pUnit, 11027, true);
|
||||
FlameWreathTarget[i] = 0;
|
||||
}
|
||||
}
|
||||
FlameWreathCheckTime = 500;
|
||||
} else FlameWreathCheckTime -= diff;
|
||||
}
|
||||
|
||||
if (ArcaneCooldown && FireCooldown && FrostCooldown)
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* /*pAttacker*/, uint32 &damage)
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
if (!DrinkInturrupted && Drinking && damage)
|
||||
DrinkInturrupted = true;
|
||||
return new water_elementalAI (pCreature);
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*pAttacker*/, const SpellEntry* Spell)
|
||||
struct water_elementalAI : public ScriptedAI
|
||||
{
|
||||
//We only care about interrupt effects and only if they are durring a spell currently being casted
|
||||
if ((Spell->Effect[0] != SPELL_EFFECT_INTERRUPT_CAST &&
|
||||
Spell->Effect[1] != SPELL_EFFECT_INTERRUPT_CAST &&
|
||||
Spell->Effect[2] != SPELL_EFFECT_INTERRUPT_CAST) || !me->IsNonMeleeSpellCasted(false))
|
||||
return;
|
||||
water_elementalAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
//Interrupt effect
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
uint32 CastTimer;
|
||||
|
||||
//Normally we would set the cooldown equal to the spell duration
|
||||
//but we do not have access to the DurationStore
|
||||
|
||||
switch (CurrentNormalSpell)
|
||||
void Reset()
|
||||
{
|
||||
case SPELL_ARCMISSLE: ArcaneCooldown = 5000; break;
|
||||
case SPELL_FIREBALL: FireCooldown = 5000; break;
|
||||
case SPELL_FROSTBOLT: FrostCooldown = 5000; break;
|
||||
CastTimer = 2000 + (rand()%3000);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (CastTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WATERBOLT);
|
||||
CastTimer = urand(2000,5000);
|
||||
} else CastTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
struct water_elementalAI : public ScriptedAI
|
||||
// CONVERT TO ACID
class mob_shadow_of_aran : public CreatureScript
|
||||
{
|
||||
water_elementalAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
mob_shadow_of_aran() : CreatureScript("mob_shadow_of_aran") { }
|
||||
|
||||
uint32 CastTimer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
CastTimer = 2000 + (rand()%3000);
|
||||
sLog.outString("TSCR: Convert simpleAI script for Creature Entry %u to ACID", pCreature->GetEntry());
|
||||
SimpleAI* ai = new SimpleAI (pCreature);
|
||||
|
||||
ai->Spell[0].Enabled = true;
|
||||
ai->Spell[0].Spell_Id = SPELL_SHADOW_PYRO;
|
||||
ai->Spell[0].Cooldown = 5000;
|
||||
ai->Spell[0].First_Cast = 1000;
|
||||
ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
|
||||
|
||||
ai->EnterEvadeMode();
|
||||
|
||||
return ai;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (CastTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WATERBOLT);
|
||||
CastTimer = urand(2000,5000);
|
||||
} else CastTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_aran(Creature* pCreature)
|
||||
{
|
||||
return new boss_aranAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_water_elemental(Creature* pCreature)
|
||||
{
|
||||
return new water_elementalAI (pCreature);
|
||||
}
|
||||
|
||||
// CONVERT TO ACID
|
||||
CreatureAI* GetAI_shadow_of_aran(Creature* pCreature)
|
||||
{
|
||||
sLog.outString("TSCR: Convert simpleAI script for Creature Entry %u to ACID", pCreature->GetEntry());
|
||||
SimpleAI* ai = new SimpleAI (pCreature);
|
||||
|
||||
ai->Spell[0].Enabled = true;
|
||||
ai->Spell[0].Spell_Id = SPELL_SHADOW_PYRO;
|
||||
ai->Spell[0].Cooldown = 5000;
|
||||
ai->Spell[0].First_Cast = 1000;
|
||||
ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
|
||||
|
||||
ai->EnterEvadeMode();
|
||||
|
||||
return ai;
|
||||
}
|
||||
|
||||
void AddSC_boss_shade_of_aran()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_shade_of_aran";
|
||||
newscript->GetAI = &GetAI_boss_aran;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_shadow_of_aran";
|
||||
newscript->GetAI = &GetAI_shadow_of_aran;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_aran_elemental";
|
||||
newscript->GetAI = &GetAI_water_elemental;
|
||||
newscript->RegisterSelf();
|
||||
new boss_shade_of_aran();
|
||||
new mob_shadow_of_aran();
|
||||
new mob_aran_elemental();
|
||||
}
|
||||
|
||||
|
||||
@@ -55,365 +55,374 @@ EndScriptData */
|
||||
#define CREATURE_FIENDISHIMP 17267
|
||||
#define CREATURE_PORTAL 17265
|
||||
#define CREATURE_KILREK 17229
|
||||
|
||||
struct mob_kilrekAI : public ScriptedAI
|
||||
class mob_kilrek : public CreatureScript
|
||||
{
|
||||
mob_kilrekAI(Creature *c) : ScriptedAI(c)
|
||||
public:
|
||||
mob_kilrek() : CreatureScript("mob_kilrek") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
return new mob_kilrekAI (pCreature);
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint64 TerestianGUID;
|
||||
|
||||
uint32 AmplifyTimer;
|
||||
|
||||
void Reset()
|
||||
struct mob_kilrekAI : public ScriptedAI
|
||||
{
|
||||
TerestianGUID = 0;
|
||||
AmplifyTimer = 2000;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
if (!pInstance)
|
||||
mob_kilrekAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
ERROR_INST_DATA(me);
|
||||
return;
|
||||
pInstance = c->GetInstanceScript();
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
InstanceScript* pInstance;
|
||||
|
||||
uint64 TerestianGUID;
|
||||
|
||||
uint32 AmplifyTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uint64 TerestianGUID = pInstance->GetData64(DATA_TERESTIAN);
|
||||
if (TerestianGUID)
|
||||
TerestianGUID = 0;
|
||||
AmplifyTimer = 2000;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
if (!pInstance)
|
||||
{
|
||||
Unit* Terestian = Unit::GetUnit((*me), TerestianGUID);
|
||||
if (Terestian && Terestian->isAlive())
|
||||
DoCast(Terestian, SPELL_BROKEN_PACT, true);
|
||||
ERROR_INST_DATA(me);
|
||||
return;
|
||||
}
|
||||
} else ERROR_INST_DATA(me);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (AmplifyTimer <= diff)
|
||||
{
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
DoCast(me->getVictim(), SPELL_AMPLIFY_FLAMES);
|
||||
|
||||
AmplifyTimer = urand(10000,20000);
|
||||
} else AmplifyTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
struct mob_demon_chainAI : public ScriptedAI
|
||||
{
|
||||
mob_demon_chainAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
uint64 SacrificeGUID;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
SacrificeGUID = 0;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) {}
|
||||
void AttackStart(Unit* /*who*/) {}
|
||||
void MoveInLineOfSight(Unit* /*who*/) {}
|
||||
|
||||
void JustDied(Unit * /*killer*/)
|
||||
{
|
||||
if (SacrificeGUID)
|
||||
{
|
||||
Unit* Sacrifice = Unit::GetUnit((*me),SacrificeGUID);
|
||||
if (Sacrifice)
|
||||
Sacrifice->RemoveAurasDueToSpell(SPELL_SACRIFICE);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
struct mob_fiendish_portalAI : public PassiveAI
|
||||
{
|
||||
mob_fiendish_portalAI(Creature *c) : PassiveAI(c),summons(me){}
|
||||
|
||||
SummonList summons;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
summons.DespawnAll();
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
DoZoneInCombat(summon);
|
||||
}
|
||||
|
||||
void DespawnAllImp()
|
||||
{
|
||||
summons.DespawnAll();
|
||||
}
|
||||
};
|
||||
|
||||
struct boss_terestianAI : public ScriptedAI
|
||||
{
|
||||
boss_terestianAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
PortalGUID[i] = 0;
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
uint64 PortalGUID[2];
|
||||
uint8 PortalsCount;
|
||||
|
||||
uint32 SacrificeTimer;
|
||||
uint32 ShadowboltTimer;
|
||||
uint32 SummonTimer;
|
||||
uint32 BerserkTimer;
|
||||
|
||||
bool SummonedPortals;
|
||||
bool Berserk;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
if (PortalGUID[i])
|
||||
if (pInstance)
|
||||
{
|
||||
if (Creature* pPortal = Unit::GetCreature(*me, PortalGUID[i]))
|
||||
uint64 TerestianGUID = pInstance->GetData64(DATA_TERESTIAN);
|
||||
if (TerestianGUID)
|
||||
{
|
||||
CAST_AI(mob_fiendish_portalAI, pPortal->AI())->DespawnAllImp();
|
||||
pPortal->ForcedDespawn();
|
||||
Unit* Terestian = Unit::GetUnit((*me), TerestianGUID);
|
||||
if (Terestian && Terestian->isAlive())
|
||||
DoCast(Terestian, SPELL_BROKEN_PACT, true);
|
||||
}
|
||||
|
||||
PortalGUID[i] = 0;
|
||||
}
|
||||
} else ERROR_INST_DATA(me);
|
||||
}
|
||||
|
||||
PortalsCount = 0;
|
||||
SacrificeTimer = 30000;
|
||||
ShadowboltTimer = 5000;
|
||||
SummonTimer = 10000;
|
||||
BerserkTimer = 600000;
|
||||
|
||||
SummonedPortals = false;
|
||||
Berserk = false;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_TERESTIAN, NOT_STARTED);
|
||||
|
||||
me->RemoveAurasDueToSpell(SPELL_BROKEN_PACT);
|
||||
|
||||
if (Minion* Kilrek = me->GetFirstMinion())
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!Kilrek->isAlive())
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (AmplifyTimer <= diff)
|
||||
{
|
||||
Kilrek->UnSummon();
|
||||
DoCast(me, SPELL_SUMMON_IMP, true);
|
||||
}
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
DoCast(me->getVictim(), SPELL_AMPLIFY_FLAMES);
|
||||
|
||||
AmplifyTimer = urand(10000,20000);
|
||||
} else AmplifyTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
else DoCast(me, SPELL_SUMMON_IMP, true);
|
||||
};
|
||||
|
||||
};
|
||||
class mob_demon_chain : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_demon_chain() : CreatureScript("mob_demon_chain") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
return new mob_demon_chainAI(pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
struct mob_demon_chainAI : public ScriptedAI
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
}
|
||||
mob_demon_chainAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void JustSummoned(Creature* pSummoned)
|
||||
{
|
||||
if (pSummoned->GetEntry() == CREATURE_PORTAL)
|
||||
uint64 SacrificeGUID;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
PortalGUID[PortalsCount] = pSummoned->GetGUID();
|
||||
++PortalsCount;
|
||||
|
||||
if (pSummoned->GetUInt32Value(UNIT_CREATED_BY_SPELL) == SPELL_FIENDISH_PORTAL_1)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), me);
|
||||
SummonedPortals = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * /*victim*/)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*killer*/)
|
||||
{
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
{
|
||||
if (PortalGUID[i])
|
||||
{
|
||||
if (Creature* pPortal = Unit::GetCreature((*me), PortalGUID[i]))
|
||||
pPortal->ForcedDespawn();
|
||||
|
||||
PortalGUID[i] = 0;
|
||||
}
|
||||
SacrificeGUID = 0;
|
||||
}
|
||||
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
void EnterCombat(Unit* /*who*/) {}
|
||||
void AttackStart(Unit* /*who*/) {}
|
||||
void MoveInLineOfSight(Unit* /*who*/) {}
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_TERESTIAN, DONE);
|
||||
void JustDied(Unit * /*killer*/)
|
||||
{
|
||||
if (SacrificeGUID)
|
||||
{
|
||||
Unit* Sacrifice = Unit::GetUnit((*me),SacrificeGUID);
|
||||
if (Sacrifice)
|
||||
Sacrifice->RemoveAurasDueToSpell(SPELL_SACRIFICE);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
class mob_fiendish_portal : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_fiendish_portal() : CreatureScript("mob_fiendish_portal") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
return new mob_fiendish_portalAI (pCreature);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
struct mob_fiendish_portalAI : public PassiveAI
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
mob_fiendish_portalAI(Creature *c) : PassiveAI(c),summons(me){}
|
||||
|
||||
if (SacrificeTimer <= diff)
|
||||
SummonList summons;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
|
||||
if (pTarget && pTarget->isAlive())
|
||||
{
|
||||
DoCast(pTarget, SPELL_SACRIFICE, true);
|
||||
DoCast(pTarget, SPELL_SUMMON_DEMONCHAINS, true);
|
||||
|
||||
if (Creature* Chains = me->FindNearestCreature(CREATURE_DEMONCHAINS, 5000))
|
||||
{
|
||||
CAST_AI(mob_demon_chainAI, Chains->AI())->SacrificeGUID = pTarget->GetGUID();
|
||||
Chains->CastSpell(Chains, SPELL_DEMON_CHAINS, true);
|
||||
DoScriptText(RAND(SAY_SACRIFICE1,SAY_SACRIFICE2), me);
|
||||
SacrificeTimer = 30000;
|
||||
}
|
||||
}
|
||||
} else SacrificeTimer -= diff;
|
||||
|
||||
if (ShadowboltTimer <= diff)
|
||||
{
|
||||
DoCast(SelectUnit(SELECT_TARGET_TOPAGGRO, 0), SPELL_SHADOW_BOLT);
|
||||
ShadowboltTimer = 10000;
|
||||
} else ShadowboltTimer -= diff;
|
||||
|
||||
if (SummonTimer <= diff)
|
||||
{
|
||||
if (!PortalGUID[0])
|
||||
DoCast(me->getVictim(), SPELL_FIENDISH_PORTAL, false);
|
||||
|
||||
if (!PortalGUID[1])
|
||||
DoCast(me->getVictim(), SPELL_FIENDISH_PORTAL_1, false);
|
||||
|
||||
if (PortalGUID[0] && PortalGUID[1])
|
||||
{
|
||||
if (Creature* pPortal = Unit::GetCreature(*me, PortalGUID[urand(0,1)]))
|
||||
pPortal->CastSpell(me->getVictim(), SPELL_SUMMON_FIENDISIMP, false);
|
||||
SummonTimer = 5000;
|
||||
}
|
||||
} else SummonTimer -= diff;
|
||||
|
||||
if (!Berserk)
|
||||
{
|
||||
if (BerserkTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_BERSERK);
|
||||
Berserk = true;
|
||||
} else BerserkTimer -= diff;
|
||||
summons.DespawnAll();
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
DoZoneInCombat(summon);
|
||||
}
|
||||
|
||||
void DespawnAllImp()
|
||||
{
|
||||
summons.DespawnAll();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#define SPELL_FIREBOLT 30050 // Blasts a target for 181-209 Fire damage.
|
||||
|
||||
struct mob_fiendish_impAI : public ScriptedAI
|
||||
class mob_fiendish_imp : public CreatureScript
|
||||
{
|
||||
mob_fiendish_impAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
mob_fiendish_imp() : CreatureScript("mob_fiendish_imp") { }
|
||||
|
||||
uint32 FireboltTimer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
FireboltTimer = 2000;
|
||||
|
||||
me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
|
||||
return new mob_fiendish_impAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
struct mob_fiendish_impAI : public ScriptedAI
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
mob_fiendish_impAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
if (FireboltTimer <= diff)
|
||||
uint32 FireboltTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FIREBOLT);
|
||||
FireboltTimer = 2200;
|
||||
} else FireboltTimer -= diff;
|
||||
FireboltTimer = 2000;
|
||||
|
||||
me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (FireboltTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FIREBOLT);
|
||||
FireboltTimer = 2200;
|
||||
} else FireboltTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_kilrek(Creature* pCreature)
|
||||
class boss_terestian_illhoof : public CreatureScript
|
||||
{
|
||||
return new mob_kilrekAI (pCreature);
|
||||
}
|
||||
public:
|
||||
boss_terestian_illhoof() : CreatureScript("boss_terestian_illhoof") { }
|
||||
|
||||
CreatureAI* GetAI_mob_fiendish_imp(Creature* pCreature)
|
||||
{
|
||||
return new mob_fiendish_impAI (pCreature);
|
||||
}
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
return new boss_terestianAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_mob_fiendish_portal(Creature* pCreature)
|
||||
{
|
||||
return new mob_fiendish_portalAI (pCreature);
|
||||
}
|
||||
struct boss_terestianAI : public ScriptedAI
|
||||
{
|
||||
boss_terestianAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
PortalGUID[i] = 0;
|
||||
pInstance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_boss_terestian_illhoof(Creature* pCreature)
|
||||
{
|
||||
return new boss_terestianAI (pCreature);
|
||||
}
|
||||
InstanceScript *pInstance;
|
||||
|
||||
CreatureAI* GetAI_mob_demon_chain(Creature* pCreature)
|
||||
{
|
||||
return new mob_demon_chainAI(pCreature);
|
||||
}
|
||||
uint64 PortalGUID[2];
|
||||
uint8 PortalsCount;
|
||||
|
||||
uint32 SacrificeTimer;
|
||||
uint32 ShadowboltTimer;
|
||||
uint32 SummonTimer;
|
||||
uint32 BerserkTimer;
|
||||
|
||||
bool SummonedPortals;
|
||||
bool Berserk;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
{
|
||||
if (PortalGUID[i])
|
||||
{
|
||||
if (Creature* pPortal = Unit::GetCreature(*me, PortalGUID[i]))
|
||||
{
|
||||
CAST_AI(mob_fiendish_portal::mob_fiendish_portalAI, pPortal->AI())->DespawnAllImp();
|
||||
pPortal->ForcedDespawn();
|
||||
}
|
||||
|
||||
PortalGUID[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
PortalsCount = 0;
|
||||
SacrificeTimer = 30000;
|
||||
ShadowboltTimer = 5000;
|
||||
SummonTimer = 10000;
|
||||
BerserkTimer = 600000;
|
||||
|
||||
SummonedPortals = false;
|
||||
Berserk = false;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_TERESTIAN, NOT_STARTED);
|
||||
|
||||
me->RemoveAurasDueToSpell(SPELL_BROKEN_PACT);
|
||||
|
||||
if (Minion* Kilrek = me->GetFirstMinion())
|
||||
{
|
||||
if (!Kilrek->isAlive())
|
||||
{
|
||||
Kilrek->UnSummon();
|
||||
DoCast(me, SPELL_SUMMON_IMP, true);
|
||||
}
|
||||
}
|
||||
else DoCast(me, SPELL_SUMMON_IMP, true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* pSummoned)
|
||||
{
|
||||
if (pSummoned->GetEntry() == CREATURE_PORTAL)
|
||||
{
|
||||
PortalGUID[PortalsCount] = pSummoned->GetGUID();
|
||||
++PortalsCount;
|
||||
|
||||
if (pSummoned->GetUInt32Value(UNIT_CREATED_BY_SPELL) == SPELL_FIENDISH_PORTAL_1)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), me);
|
||||
SummonedPortals = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * /*victim*/)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*killer*/)
|
||||
{
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
{
|
||||
if (PortalGUID[i])
|
||||
{
|
||||
if (Creature* pPortal = Unit::GetCreature((*me), PortalGUID[i]))
|
||||
pPortal->ForcedDespawn();
|
||||
|
||||
PortalGUID[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_TERESTIAN, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (SacrificeTimer <= diff)
|
||||
{
|
||||
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
|
||||
if (pTarget && pTarget->isAlive())
|
||||
{
|
||||
DoCast(pTarget, SPELL_SACRIFICE, true);
|
||||
DoCast(pTarget, SPELL_SUMMON_DEMONCHAINS, true);
|
||||
|
||||
if (Creature* Chains = me->FindNearestCreature(CREATURE_DEMONCHAINS, 5000))
|
||||
{
|
||||
CAST_AI(mob_demon_chain::mob_demon_chainAI, Chains->AI())->SacrificeGUID = pTarget->GetGUID();
|
||||
Chains->CastSpell(Chains, SPELL_DEMON_CHAINS, true);
|
||||
DoScriptText(RAND(SAY_SACRIFICE1,SAY_SACRIFICE2), me);
|
||||
SacrificeTimer = 30000;
|
||||
}
|
||||
}
|
||||
} else SacrificeTimer -= diff;
|
||||
|
||||
if (ShadowboltTimer <= diff)
|
||||
{
|
||||
DoCast(SelectUnit(SELECT_TARGET_TOPAGGRO, 0), SPELL_SHADOW_BOLT);
|
||||
ShadowboltTimer = 10000;
|
||||
} else ShadowboltTimer -= diff;
|
||||
|
||||
if (SummonTimer <= diff)
|
||||
{
|
||||
if (!PortalGUID[0])
|
||||
DoCast(me->getVictim(), SPELL_FIENDISH_PORTAL, false);
|
||||
|
||||
if (!PortalGUID[1])
|
||||
DoCast(me->getVictim(), SPELL_FIENDISH_PORTAL_1, false);
|
||||
|
||||
if (PortalGUID[0] && PortalGUID[1])
|
||||
{
|
||||
if (Creature* pPortal = Unit::GetCreature(*me, PortalGUID[urand(0,1)]))
|
||||
pPortal->CastSpell(me->getVictim(), SPELL_SUMMON_FIENDISIMP, false);
|
||||
SummonTimer = 5000;
|
||||
}
|
||||
} else SummonTimer -= diff;
|
||||
|
||||
if (!Berserk)
|
||||
{
|
||||
if (BerserkTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_BERSERK);
|
||||
Berserk = true;
|
||||
} else BerserkTimer -= diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_terestian_illhoof()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_terestian_illhoof";
|
||||
newscript->GetAI = &GetAI_boss_terestian_illhoof;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_fiendish_imp";
|
||||
newscript->GetAI = &GetAI_mob_fiendish_imp;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name= "mob_fiendish_portal";
|
||||
newscript->GetAI = &GetAI_mob_fiendish_portal;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_kilrek";
|
||||
newscript->GetAI = &GetAI_mob_kilrek;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_demon_chain";
|
||||
newscript->GetAI = &GetAI_mob_demon_chain;
|
||||
newscript->RegisterSelf();
|
||||
new boss_terestian_illhoof();
|
||||
new mob_fiendish_imp();
|
||||
new mob_fiendish_portal();
|
||||
new mob_kilrek();
|
||||
new mob_demon_chain();
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -42,269 +42,271 @@ EndScriptData */
|
||||
10 - Prince Malchezzar
|
||||
11 - Nightbane
|
||||
*/
|
||||
|
||||
struct instance_karazhan : public ScriptedInstance
|
||||
class instance_karazhan : public InstanceMapScript
|
||||
{
|
||||
instance_karazhan(Map* pMap) : ScriptedInstance(pMap) {Initialize();}
|
||||
public:
|
||||
instance_karazhan() : InstanceMapScript("instance_karazhan") { }
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
std::string strSaveData;
|
||||
|
||||
uint32 m_uiOperaEvent;
|
||||
uint32 m_uiOzDeathCount;
|
||||
|
||||
uint64 m_uiCurtainGUID;
|
||||
uint64 m_uiStageDoorLeftGUID;
|
||||
uint64 m_uiStageDoorRightGUID;
|
||||
uint64 m_uiKilrekGUID;
|
||||
uint64 m_uiTerestianGUID;
|
||||
uint64 m_uiMoroesGUID;
|
||||
uint64 m_uiLibraryDoor; // Door at Shade of Aran
|
||||
uint64 m_uiMassiveDoor; // Door at Netherspite
|
||||
uint64 m_uiSideEntranceDoor; // Side Entrance
|
||||
uint64 m_uiGamesmansDoor; // Door before Chess
|
||||
uint64 m_uiGamesmansExitDoor; // Door after Chess
|
||||
uint64 m_uiNetherspaceDoor; // Door at Malchezaar
|
||||
uint64 MastersTerraceDoor[2];
|
||||
uint64 ImageGUID;
|
||||
uint64 DustCoveredChest;
|
||||
|
||||
void Initialize()
|
||||
InstanceScript* GetInstanceData_InstanceMapScript(Map* pMap)
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
// 1 - OZ, 2 - HOOD, 3 - RAJ, this never gets altered.
|
||||
m_uiOperaEvent = urand(1,3);
|
||||
m_uiOzDeathCount = 0;
|
||||
|
||||
m_uiCurtainGUID = 0;
|
||||
m_uiStageDoorLeftGUID = 0;
|
||||
m_uiStageDoorRightGUID = 0;
|
||||
|
||||
m_uiKilrekGUID = 0;
|
||||
m_uiTerestianGUID = 0;
|
||||
m_uiMoroesGUID = 0;
|
||||
|
||||
m_uiLibraryDoor = 0;
|
||||
m_uiMassiveDoor = 0;
|
||||
m_uiSideEntranceDoor = 0;
|
||||
m_uiGamesmansDoor = 0;
|
||||
m_uiGamesmansExitDoor = 0;
|
||||
m_uiNetherspaceDoor = 0;
|
||||
MastersTerraceDoor[0]= 0;
|
||||
MastersTerraceDoor[1]= 0;
|
||||
ImageGUID = 0;
|
||||
DustCoveredChest = 0;
|
||||
return new instance_karazhan_InstanceMapScript(pMap);
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
struct instance_karazhan_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
return true;
|
||||
instance_karazhan_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();}
|
||||
|
||||
return false;
|
||||
}
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
std::string strSaveData;
|
||||
|
||||
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
|
||||
{
|
||||
switch (pCreature->GetEntry())
|
||||
uint32 m_uiOperaEvent;
|
||||
uint32 m_uiOzDeathCount;
|
||||
|
||||
uint64 m_uiCurtainGUID;
|
||||
uint64 m_uiStageDoorLeftGUID;
|
||||
uint64 m_uiStageDoorRightGUID;
|
||||
uint64 m_uiKilrekGUID;
|
||||
uint64 m_uiTerestianGUID;
|
||||
uint64 m_uiMoroesGUID;
|
||||
uint64 m_uiLibraryDoor; // Door at Shade of Aran
|
||||
uint64 m_uiMassiveDoor; // Door at Netherspite
|
||||
uint64 m_uiSideEntranceDoor; // Side Entrance
|
||||
uint64 m_uiGamesmansDoor; // Door before Chess
|
||||
uint64 m_uiGamesmansExitDoor; // Door after Chess
|
||||
uint64 m_uiNetherspaceDoor; // Door at Malchezaar
|
||||
uint64 MastersTerraceDoor[2];
|
||||
uint64 ImageGUID;
|
||||
uint64 DustCoveredChest;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
case 17229: m_uiKilrekGUID = pCreature->GetGUID(); break;
|
||||
case 15688: m_uiTerestianGUID = pCreature->GetGUID(); break;
|
||||
case 15687: m_uiMoroesGUID = pCreature->GetGUID(); break;
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
// 1 - OZ, 2 - HOOD, 3 - RAJ, this never gets altered.
|
||||
m_uiOperaEvent = urand(1,3);
|
||||
m_uiOzDeathCount = 0;
|
||||
|
||||
m_uiCurtainGUID = 0;
|
||||
m_uiStageDoorLeftGUID = 0;
|
||||
m_uiStageDoorRightGUID = 0;
|
||||
|
||||
m_uiKilrekGUID = 0;
|
||||
m_uiTerestianGUID = 0;
|
||||
m_uiMoroesGUID = 0;
|
||||
|
||||
m_uiLibraryDoor = 0;
|
||||
m_uiMassiveDoor = 0;
|
||||
m_uiSideEntranceDoor = 0;
|
||||
m_uiGamesmansDoor = 0;
|
||||
m_uiGamesmansExitDoor = 0;
|
||||
m_uiNetherspaceDoor = 0;
|
||||
MastersTerraceDoor[0]= 0;
|
||||
MastersTerraceDoor[1]= 0;
|
||||
ImageGUID = 0;
|
||||
DustCoveredChest = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 uiData)
|
||||
{
|
||||
switch (type)
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
case TYPE_ATTUMEN: m_auiEncounter[0] = uiData; break;
|
||||
case TYPE_MOROES:
|
||||
if (m_auiEncounter[1] == DONE)
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
|
||||
{
|
||||
switch (pCreature->GetEntry())
|
||||
{
|
||||
case 17229: m_uiKilrekGUID = pCreature->GetGUID(); break;
|
||||
case 15688: m_uiTerestianGUID = pCreature->GetGUID(); break;
|
||||
case 15687: m_uiMoroesGUID = pCreature->GetGUID(); break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 uiData)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_ATTUMEN: m_auiEncounter[0] = uiData; break;
|
||||
case TYPE_MOROES:
|
||||
if (m_auiEncounter[1] == DONE)
|
||||
break;
|
||||
m_auiEncounter[1] = uiData;
|
||||
break;
|
||||
m_auiEncounter[1] = uiData;
|
||||
break;
|
||||
case TYPE_MAIDEN: m_auiEncounter[2] = uiData; break;
|
||||
case TYPE_OPTIONAL_BOSS: m_auiEncounter[3] = uiData; break;
|
||||
case TYPE_OPERA: m_auiEncounter[4] = uiData; break;
|
||||
case TYPE_CURATOR: m_auiEncounter[5] = uiData; break;
|
||||
case TYPE_ARAN: m_auiEncounter[6] = uiData; break;
|
||||
case TYPE_TERESTIAN: m_auiEncounter[7] = uiData; break;
|
||||
case TYPE_NETHERSPITE: m_auiEncounter[8] = uiData; break;
|
||||
case TYPE_CHESS:
|
||||
if (uiData == DONE)
|
||||
DoRespawnGameObject(DustCoveredChest,DAY);
|
||||
m_auiEncounter[9] = uiData;
|
||||
break;
|
||||
case TYPE_MALCHEZZAR: m_auiEncounter[10] = uiData; break;
|
||||
case TYPE_NIGHTBANE:
|
||||
if (m_auiEncounter[11] != DONE)
|
||||
m_auiEncounter[11] = uiData;
|
||||
break;
|
||||
case DATA_OPERA_OZ_DEATHCOUNT:
|
||||
if (uiData == SPECIAL)
|
||||
++m_uiOzDeathCount;
|
||||
else if (uiData == IN_PROGRESS)
|
||||
m_uiOzDeathCount = 0;
|
||||
break;
|
||||
case TYPE_MAIDEN: m_auiEncounter[2] = uiData; break;
|
||||
case TYPE_OPTIONAL_BOSS: m_auiEncounter[3] = uiData; break;
|
||||
case TYPE_OPERA: m_auiEncounter[4] = uiData; break;
|
||||
case TYPE_CURATOR: m_auiEncounter[5] = uiData; break;
|
||||
case TYPE_ARAN: m_auiEncounter[6] = uiData; break;
|
||||
case TYPE_TERESTIAN: m_auiEncounter[7] = uiData; break;
|
||||
case TYPE_NETHERSPITE: m_auiEncounter[8] = uiData; break;
|
||||
case TYPE_CHESS:
|
||||
if (uiData == DONE)
|
||||
DoRespawnGameObject(DustCoveredChest,DAY);
|
||||
m_auiEncounter[9] = uiData;
|
||||
break;
|
||||
case TYPE_MALCHEZZAR: m_auiEncounter[10] = uiData; break;
|
||||
case TYPE_NIGHTBANE:
|
||||
if (m_auiEncounter[11] != DONE)
|
||||
m_auiEncounter[11] = uiData;
|
||||
break;
|
||||
case DATA_OPERA_OZ_DEATHCOUNT:
|
||||
if (uiData == SPECIAL)
|
||||
++m_uiOzDeathCount;
|
||||
else if (uiData == IN_PROGRESS)
|
||||
m_uiOzDeathCount = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if (uiData == DONE)
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " "
|
||||
<< m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " << m_auiEncounter[6] << " "
|
||||
<< m_auiEncounter[7] << " " << m_auiEncounter[8] << " " << m_auiEncounter[9] << " " << m_auiEncounter[10] << " " << m_auiEncounter[11];
|
||||
|
||||
strSaveData = saveStream.str();
|
||||
|
||||
SaveToDB();
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
}
|
||||
}
|
||||
|
||||
if (uiData == DONE)
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " "
|
||||
<< m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " << m_auiEncounter[6] << " "
|
||||
<< m_auiEncounter[7] << " " << m_auiEncounter[8] << " " << m_auiEncounter[9] << " " << m_auiEncounter[10] << " " << m_auiEncounter[11];
|
||||
|
||||
strSaveData = saveStream.str();
|
||||
|
||||
SaveToDB();
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData64(uint32 identifier, uint64 data)
|
||||
{
|
||||
switch(identifier)
|
||||
void SetData64(uint32 identifier, uint64 data)
|
||||
{
|
||||
case DATA_IMAGE_OF_MEDIVH: ImageGUID = data;
|
||||
switch(identifier)
|
||||
{
|
||||
case DATA_IMAGE_OF_MEDIVH: ImageGUID = data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
|
||||
{
|
||||
switch(pGo->GetEntry())
|
||||
void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
|
||||
{
|
||||
case 183932: m_uiCurtainGUID = pGo->GetGUID(); break;
|
||||
case 184278:
|
||||
m_uiStageDoorLeftGUID = pGo->GetGUID();
|
||||
if (m_auiEncounter[4] == DONE)
|
||||
pGo->SetGoState(GO_STATE_ACTIVE);
|
||||
break;
|
||||
case 184279:
|
||||
m_uiStageDoorRightGUID = pGo->GetGUID();
|
||||
if (m_auiEncounter[4] == DONE)
|
||||
pGo->SetGoState(GO_STATE_ACTIVE);
|
||||
break;
|
||||
case 184517: m_uiLibraryDoor = pGo->GetGUID(); break;
|
||||
case 185521: m_uiMassiveDoor = pGo->GetGUID(); break;
|
||||
case 184276: m_uiGamesmansDoor = pGo->GetGUID(); break;
|
||||
case 184277: m_uiGamesmansExitDoor = pGo->GetGUID(); break;
|
||||
case 185134: m_uiNetherspaceDoor = pGo->GetGUID(); break;
|
||||
case 184274: MastersTerraceDoor[0] = pGo->GetGUID(); break;
|
||||
case 184280: MastersTerraceDoor[1] = pGo->GetGUID(); break;
|
||||
case 184275:
|
||||
m_uiSideEntranceDoor = pGo->GetGUID();
|
||||
if (m_auiEncounter[4] == DONE)
|
||||
pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
else
|
||||
pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
break;
|
||||
case 185119: DustCoveredChest = pGo->GetGUID(); break;
|
||||
switch(pGo->GetEntry())
|
||||
{
|
||||
case 183932: m_uiCurtainGUID = pGo->GetGUID(); break;
|
||||
case 184278:
|
||||
m_uiStageDoorLeftGUID = pGo->GetGUID();
|
||||
if (m_auiEncounter[4] == DONE)
|
||||
pGo->SetGoState(GO_STATE_ACTIVE);
|
||||
break;
|
||||
case 184279:
|
||||
m_uiStageDoorRightGUID = pGo->GetGUID();
|
||||
if (m_auiEncounter[4] == DONE)
|
||||
pGo->SetGoState(GO_STATE_ACTIVE);
|
||||
break;
|
||||
case 184517: m_uiLibraryDoor = pGo->GetGUID(); break;
|
||||
case 185521: m_uiMassiveDoor = pGo->GetGUID(); break;
|
||||
case 184276: m_uiGamesmansDoor = pGo->GetGUID(); break;
|
||||
case 184277: m_uiGamesmansExitDoor = pGo->GetGUID(); break;
|
||||
case 185134: m_uiNetherspaceDoor = pGo->GetGUID(); break;
|
||||
case 184274: MastersTerraceDoor[0] = pGo->GetGUID(); break;
|
||||
case 184280: MastersTerraceDoor[1] = pGo->GetGUID(); break;
|
||||
case 184275:
|
||||
m_uiSideEntranceDoor = pGo->GetGUID();
|
||||
if (m_auiEncounter[4] == DONE)
|
||||
pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
else
|
||||
pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
break;
|
||||
case 185119: DustCoveredChest = pGo->GetGUID(); break;
|
||||
}
|
||||
|
||||
switch(m_uiOperaEvent)
|
||||
{
|
||||
//TODO: Set Object visibilities for Opera based on performance
|
||||
case EVENT_OZ:
|
||||
break;
|
||||
|
||||
case EVENT_HOOD:
|
||||
break;
|
||||
|
||||
case EVENT_RAJ:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch(m_uiOperaEvent)
|
||||
std::string GetSaveData()
|
||||
{
|
||||
//TODO: Set Object visibilities for Opera based on performance
|
||||
case EVENT_OZ:
|
||||
break;
|
||||
|
||||
case EVENT_HOOD:
|
||||
break;
|
||||
|
||||
case EVENT_RAJ:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
return strSaveData;
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 uiData)
|
||||
{
|
||||
switch (uiData)
|
||||
{
|
||||
case TYPE_ATTUMEN: return m_auiEncounter[0];
|
||||
case TYPE_MOROES: return m_auiEncounter[1];
|
||||
case TYPE_MAIDEN: return m_auiEncounter[2];
|
||||
case TYPE_OPTIONAL_BOSS: return m_auiEncounter[3];
|
||||
case TYPE_OPERA: return m_auiEncounter[4];
|
||||
case TYPE_CURATOR: return m_auiEncounter[5];
|
||||
case TYPE_ARAN: return m_auiEncounter[6];
|
||||
case TYPE_TERESTIAN: return m_auiEncounter[7];
|
||||
case TYPE_NETHERSPITE: return m_auiEncounter[8];
|
||||
case TYPE_CHESS: return m_auiEncounter[9];
|
||||
case TYPE_MALCHEZZAR: return m_auiEncounter[10];
|
||||
case TYPE_NIGHTBANE: return m_auiEncounter[11];
|
||||
case DATA_OPERA_PERFORMANCE: return m_uiOperaEvent;
|
||||
case DATA_OPERA_OZ_DEATHCOUNT: return m_uiOzDeathCount;
|
||||
case DATA_IMAGE_OF_MEDIVH: return ImageGUID;
|
||||
return strSaveData;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 uiData)
|
||||
{
|
||||
switch (uiData)
|
||||
uint32 GetData(uint32 uiData)
|
||||
{
|
||||
case DATA_KILREK: return m_uiKilrekGUID;
|
||||
case DATA_TERESTIAN: return m_uiTerestianGUID;
|
||||
case DATA_MOROES: return m_uiMoroesGUID;
|
||||
case DATA_GO_STAGEDOORLEFT: return m_uiStageDoorLeftGUID;
|
||||
case DATA_GO_STAGEDOORRIGHT: return m_uiStageDoorRightGUID;
|
||||
case DATA_GO_CURTAINS: return m_uiCurtainGUID;
|
||||
case DATA_GO_LIBRARY_DOOR: return m_uiLibraryDoor;
|
||||
case DATA_GO_MASSIVE_DOOR: return m_uiMassiveDoor;
|
||||
case DATA_GO_SIDE_ENTRANCE_DOOR: return m_uiSideEntranceDoor;
|
||||
case DATA_GO_GAME_DOOR: return m_uiGamesmansDoor;
|
||||
case DATA_GO_GAME_EXIT_DOOR: return m_uiGamesmansExitDoor;
|
||||
case DATA_GO_NETHER_DOOR: return m_uiNetherspaceDoor;
|
||||
case DATA_MASTERS_TERRACE_DOOR_1: return MastersTerraceDoor[0];
|
||||
case DATA_MASTERS_TERRACE_DOOR_2: return MastersTerraceDoor[1];
|
||||
switch (uiData)
|
||||
{
|
||||
case TYPE_ATTUMEN: return m_auiEncounter[0];
|
||||
case TYPE_MOROES: return m_auiEncounter[1];
|
||||
case TYPE_MAIDEN: return m_auiEncounter[2];
|
||||
case TYPE_OPTIONAL_BOSS: return m_auiEncounter[3];
|
||||
case TYPE_OPERA: return m_auiEncounter[4];
|
||||
case TYPE_CURATOR: return m_auiEncounter[5];
|
||||
case TYPE_ARAN: return m_auiEncounter[6];
|
||||
case TYPE_TERESTIAN: return m_auiEncounter[7];
|
||||
case TYPE_NETHERSPITE: return m_auiEncounter[8];
|
||||
case TYPE_CHESS: return m_auiEncounter[9];
|
||||
case TYPE_MALCHEZZAR: return m_auiEncounter[10];
|
||||
case TYPE_NIGHTBANE: return m_auiEncounter[11];
|
||||
case DATA_OPERA_PERFORMANCE: return m_uiOperaEvent;
|
||||
case DATA_OPERA_OZ_DEATHCOUNT: return m_uiOzDeathCount;
|
||||
case DATA_IMAGE_OF_MEDIVH: return ImageGUID;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Load(const char* chrIn)
|
||||
{
|
||||
if (!chrIn)
|
||||
uint64 GetData64(uint32 uiData)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
switch (uiData)
|
||||
{
|
||||
case DATA_KILREK: return m_uiKilrekGUID;
|
||||
case DATA_TERESTIAN: return m_uiTerestianGUID;
|
||||
case DATA_MOROES: return m_uiMoroesGUID;
|
||||
case DATA_GO_STAGEDOORLEFT: return m_uiStageDoorLeftGUID;
|
||||
case DATA_GO_STAGEDOORRIGHT: return m_uiStageDoorRightGUID;
|
||||
case DATA_GO_CURTAINS: return m_uiCurtainGUID;
|
||||
case DATA_GO_LIBRARY_DOOR: return m_uiLibraryDoor;
|
||||
case DATA_GO_MASSIVE_DOOR: return m_uiMassiveDoor;
|
||||
case DATA_GO_SIDE_ENTRANCE_DOOR: return m_uiSideEntranceDoor;
|
||||
case DATA_GO_GAME_DOOR: return m_uiGamesmansDoor;
|
||||
case DATA_GO_GAME_EXIT_DOOR: return m_uiGamesmansExitDoor;
|
||||
case DATA_GO_NETHER_DOOR: return m_uiNetherspaceDoor;
|
||||
case DATA_MASTERS_TERRACE_DOOR_1: return MastersTerraceDoor[0];
|
||||
case DATA_MASTERS_TERRACE_DOOR_2: return MastersTerraceDoor[1];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(chrIn);
|
||||
std::istringstream loadStream(chrIn);
|
||||
void Load(const char* chrIn)
|
||||
{
|
||||
if (!chrIn)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(chrIn);
|
||||
std::istringstream loadStream(chrIn);
|
||||
|
||||
loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]
|
||||
>> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6] >> m_auiEncounter[7]
|
||||
>> m_auiEncounter[8] >> m_auiEncounter[9] >> m_auiEncounter[10] >> m_auiEncounter[11];
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead.
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
};
|
||||
|
||||
loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]
|
||||
>> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6] >> m_auiEncounter[7]
|
||||
>> m_auiEncounter[8] >> m_auiEncounter[9] >> m_auiEncounter[10] >> m_auiEncounter[11];
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead.
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
};
|
||||
|
||||
InstanceData* GetInstanceData_instance_karazhan(Map* pMap)
|
||||
{
|
||||
return new instance_karazhan(pMap);
|
||||
}
|
||||
|
||||
void AddSC_instance_karazhan()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "instance_karazhan";
|
||||
newscript->GetInstanceData = &GetInstanceData_instance_karazhan;
|
||||
newscript->RegisterSelf();
|
||||
new instance_karazhan();
|
||||
}
|
||||
|
||||
|
||||
@@ -101,294 +101,302 @@ float Spawns[6][2]=
|
||||
#define SPAWN_Z 90.5
|
||||
#define SPAWN_Y -1758
|
||||
#define SPAWN_O 4.738
|
||||
|
||||
struct npc_barnesAI : public npc_escortAI
|
||||
class npc_barnes : public CreatureScript
|
||||
{
|
||||
npc_barnesAI(Creature* c) : npc_escortAI(c)
|
||||
public:
|
||||
npc_barnes() : CreatureScript("npc_barnes") { }
|
||||
|
||||
struct npc_barnesAI : public npc_escortAI
|
||||
{
|
||||
RaidWiped = false;
|
||||
m_uiEventId = 0;
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint64 m_uiSpotlightGUID;
|
||||
|
||||
uint32 TalkCount;
|
||||
uint32 TalkTimer;
|
||||
uint32 WipeTimer;
|
||||
uint32 m_uiEventId;
|
||||
|
||||
bool PerformanceReady;
|
||||
bool RaidWiped;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_uiSpotlightGUID = 0;
|
||||
|
||||
TalkCount = 0;
|
||||
TalkTimer = 2000;
|
||||
WipeTimer = 5000;
|
||||
|
||||
PerformanceReady = false;
|
||||
|
||||
if (pInstance)
|
||||
m_uiEventId = pInstance->GetData(DATA_OPERA_PERFORMANCE);
|
||||
}
|
||||
|
||||
void StartEvent()
|
||||
{
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
pInstance->SetData(TYPE_OPERA, IN_PROGRESS);
|
||||
|
||||
//resets count for this event, in case earlier failed
|
||||
if (m_uiEventId == EVENT_OZ)
|
||||
pInstance->SetData(DATA_OPERA_OZ_DEATHCOUNT, IN_PROGRESS);
|
||||
|
||||
Start(false, false);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) {}
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
switch(i)
|
||||
npc_barnesAI(Creature* c) : npc_escortAI(c)
|
||||
{
|
||||
case 0:
|
||||
DoCast(me, SPELL_TUXEDO, false);
|
||||
pInstance->DoUseDoorOrButton(pInstance->GetData64(DATA_GO_STAGEDOORLEFT));
|
||||
break;
|
||||
case 4:
|
||||
TalkCount = 0;
|
||||
SetEscortPaused(true);
|
||||
|
||||
if (Creature* pSpotlight = me->SummonCreature(CREATURE_SPOTLIGHT,
|
||||
me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0.0f,
|
||||
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000))
|
||||
{
|
||||
pSpotlight->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
pSpotlight->CastSpell(pSpotlight, SPELL_SPOTLIGHT, false);
|
||||
m_uiSpotlightGUID = pSpotlight->GetGUID();
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
pInstance->DoUseDoorOrButton(pInstance->GetData64(DATA_GO_STAGEDOORLEFT));
|
||||
PerformanceReady = true;
|
||||
break;
|
||||
case 9:
|
||||
PrepareEncounter();
|
||||
pInstance->DoUseDoorOrButton(pInstance->GetData64(DATA_GO_CURTAINS));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Talk(uint32 count)
|
||||
{
|
||||
int32 text = 0;
|
||||
|
||||
switch(m_uiEventId)
|
||||
{
|
||||
case EVENT_OZ:
|
||||
if (OzDialogue[count].textid)
|
||||
text = OzDialogue[count].textid;
|
||||
if (OzDialogue[count].timer)
|
||||
TalkTimer = OzDialogue[count].timer;
|
||||
break;
|
||||
|
||||
case EVENT_HOOD:
|
||||
if (HoodDialogue[count].textid)
|
||||
text = HoodDialogue[count].textid;
|
||||
if (HoodDialogue[count].timer)
|
||||
TalkTimer = HoodDialogue[count].timer;
|
||||
break;
|
||||
|
||||
case EVENT_RAJ:
|
||||
if (RAJDialogue[count].textid)
|
||||
text = RAJDialogue[count].textid;
|
||||
if (RAJDialogue[count].timer)
|
||||
TalkTimer = RAJDialogue[count].timer;
|
||||
break;
|
||||
RaidWiped = false;
|
||||
m_uiEventId = 0;
|
||||
pInstance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
if (text)
|
||||
DoScriptText(text, me);
|
||||
}
|
||||
InstanceScript* pInstance;
|
||||
|
||||
void PrepareEncounter()
|
||||
{
|
||||
sLog.outDebug("TSCR: Barnes Opera Event - Introduction complete - preparing encounter %d", m_uiEventId);
|
||||
uint8 index = 0;
|
||||
uint8 count = 0;
|
||||
uint64 m_uiSpotlightGUID;
|
||||
|
||||
switch(m_uiEventId)
|
||||
uint32 TalkCount;
|
||||
uint32 TalkTimer;
|
||||
uint32 WipeTimer;
|
||||
uint32 m_uiEventId;
|
||||
|
||||
bool PerformanceReady;
|
||||
bool RaidWiped;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
case EVENT_OZ:
|
||||
index = 0;
|
||||
count = 4;
|
||||
break;
|
||||
case EVENT_HOOD:
|
||||
index = 4;
|
||||
count = index+1;
|
||||
break;
|
||||
case EVENT_RAJ:
|
||||
index = 5;
|
||||
count = index+1;
|
||||
break;
|
||||
m_uiSpotlightGUID = 0;
|
||||
|
||||
TalkCount = 0;
|
||||
TalkTimer = 2000;
|
||||
WipeTimer = 5000;
|
||||
|
||||
PerformanceReady = false;
|
||||
|
||||
if (pInstance)
|
||||
m_uiEventId = pInstance->GetData(DATA_OPERA_PERFORMANCE);
|
||||
}
|
||||
|
||||
for (; index < count; ++index)
|
||||
void StartEvent()
|
||||
{
|
||||
uint32 entry = ((uint32)Spawns[index][0]);
|
||||
float PosX = Spawns[index][1];
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
if (Creature* pCreature = me->SummonCreature(entry, PosX, SPAWN_Y, SPAWN_Z, SPAWN_O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS))
|
||||
pInstance->SetData(TYPE_OPERA, IN_PROGRESS);
|
||||
|
||||
//resets count for this event, in case earlier failed
|
||||
if (m_uiEventId == EVENT_OZ)
|
||||
pInstance->SetData(DATA_OPERA_OZ_DEATHCOUNT, IN_PROGRESS);
|
||||
|
||||
Start(false, false);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) {}
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
switch(i)
|
||||
{
|
||||
// In case database has bad flags
|
||||
pCreature->SetUInt32Value(UNIT_FIELD_FLAGS, 0);
|
||||
pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
case 0:
|
||||
DoCast(me, SPELL_TUXEDO, false);
|
||||
pInstance->DoUseDoorOrButton(pInstance->GetData64(DATA_GO_STAGEDOORLEFT));
|
||||
break;
|
||||
case 4:
|
||||
TalkCount = 0;
|
||||
SetEscortPaused(true);
|
||||
|
||||
if (Creature* pSpotlight = me->SummonCreature(CREATURE_SPOTLIGHT,
|
||||
me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0.0f,
|
||||
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000))
|
||||
{
|
||||
pSpotlight->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
pSpotlight->CastSpell(pSpotlight, SPELL_SPOTLIGHT, false);
|
||||
m_uiSpotlightGUID = pSpotlight->GetGUID();
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
pInstance->DoUseDoorOrButton(pInstance->GetData64(DATA_GO_STAGEDOORLEFT));
|
||||
PerformanceReady = true;
|
||||
break;
|
||||
case 9:
|
||||
PrepareEncounter();
|
||||
pInstance->DoUseDoorOrButton(pInstance->GetData64(DATA_GO_CURTAINS));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
RaidWiped = false;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
|
||||
if (HasEscortState(STATE_ESCORT_PAUSED))
|
||||
void Talk(uint32 count)
|
||||
{
|
||||
if (TalkTimer <= diff)
|
||||
int32 text = 0;
|
||||
|
||||
switch(m_uiEventId)
|
||||
{
|
||||
if (TalkCount > 3)
|
||||
{
|
||||
if (Creature* pSpotlight = Unit::GetCreature(*me, m_uiSpotlightGUID))
|
||||
pSpotlight->ForcedDespawn();
|
||||
case EVENT_OZ:
|
||||
if (OzDialogue[count].textid)
|
||||
text = OzDialogue[count].textid;
|
||||
if (OzDialogue[count].timer)
|
||||
TalkTimer = OzDialogue[count].timer;
|
||||
break;
|
||||
|
||||
SetEscortPaused(false);
|
||||
return;
|
||||
}
|
||||
case EVENT_HOOD:
|
||||
if (HoodDialogue[count].textid)
|
||||
text = HoodDialogue[count].textid;
|
||||
if (HoodDialogue[count].timer)
|
||||
TalkTimer = HoodDialogue[count].timer;
|
||||
break;
|
||||
|
||||
Talk(TalkCount);
|
||||
++TalkCount;
|
||||
} else TalkTimer -= diff;
|
||||
case EVENT_RAJ:
|
||||
if (RAJDialogue[count].textid)
|
||||
text = RAJDialogue[count].textid;
|
||||
if (RAJDialogue[count].timer)
|
||||
TalkTimer = RAJDialogue[count].timer;
|
||||
break;
|
||||
}
|
||||
|
||||
if (text)
|
||||
DoScriptText(text, me);
|
||||
}
|
||||
|
||||
if (PerformanceReady)
|
||||
void PrepareEncounter()
|
||||
{
|
||||
if (!RaidWiped)
|
||||
sLog.outDebug("TSCR: Barnes Opera Event - Introduction complete - preparing encounter %d", m_uiEventId);
|
||||
uint8 index = 0;
|
||||
uint8 count = 0;
|
||||
|
||||
switch(m_uiEventId)
|
||||
{
|
||||
if (WipeTimer <= diff)
|
||||
case EVENT_OZ:
|
||||
index = 0;
|
||||
count = 4;
|
||||
break;
|
||||
case EVENT_HOOD:
|
||||
index = 4;
|
||||
count = index+1;
|
||||
break;
|
||||
case EVENT_RAJ:
|
||||
index = 5;
|
||||
count = index+1;
|
||||
break;
|
||||
}
|
||||
|
||||
for (; index < count; ++index)
|
||||
{
|
||||
uint32 entry = ((uint32)Spawns[index][0]);
|
||||
float PosX = Spawns[index][1];
|
||||
|
||||
if (Creature* pCreature = me->SummonCreature(entry, PosX, SPAWN_Y, SPAWN_Z, SPAWN_O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS))
|
||||
{
|
||||
Map* pMap = me->GetMap();
|
||||
if (!pMap->IsDungeon())
|
||||
return;
|
||||
// In case database has bad flags
|
||||
pCreature->SetUInt32Value(UNIT_FIELD_FLAGS, 0);
|
||||
pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
}
|
||||
|
||||
Map::PlayerList const &PlayerList = pMap->GetPlayers();
|
||||
if (PlayerList.isEmpty())
|
||||
return;
|
||||
RaidWiped = false;
|
||||
}
|
||||
|
||||
RaidWiped = true;
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
|
||||
if (HasEscortState(STATE_ESCORT_PAUSED))
|
||||
{
|
||||
if (TalkTimer <= diff)
|
||||
{
|
||||
if (TalkCount > 3)
|
||||
{
|
||||
if (i->getSource()->isAlive() && !i->getSource()->isGameMaster())
|
||||
{
|
||||
RaidWiped = false;
|
||||
break;
|
||||
}
|
||||
if (Creature* pSpotlight = Unit::GetCreature(*me, m_uiSpotlightGUID))
|
||||
pSpotlight->ForcedDespawn();
|
||||
|
||||
SetEscortPaused(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (RaidWiped)
|
||||
Talk(TalkCount);
|
||||
++TalkCount;
|
||||
} else TalkTimer -= diff;
|
||||
}
|
||||
|
||||
if (PerformanceReady)
|
||||
{
|
||||
if (!RaidWiped)
|
||||
{
|
||||
if (WipeTimer <= diff)
|
||||
{
|
||||
Map* pMap = me->GetMap();
|
||||
if (!pMap->IsDungeon())
|
||||
return;
|
||||
|
||||
Map::PlayerList const &PlayerList = pMap->GetPlayers();
|
||||
if (PlayerList.isEmpty())
|
||||
return;
|
||||
|
||||
RaidWiped = true;
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
{
|
||||
if (i->getSource()->isAlive() && !i->getSource()->isGameMaster())
|
||||
{
|
||||
RaidWiped = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (RaidWiped)
|
||||
{
|
||||
RaidWiped = true;
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
|
||||
WipeTimer = 15000;
|
||||
} else WipeTimer -= diff;
|
||||
}
|
||||
|
||||
WipeTimer = 15000;
|
||||
} else WipeTimer -= diff;
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
|
||||
{
|
||||
npc_barnesAI* pBarnesAI = CAST_AI(npc_barnes::npc_barnesAI, pCreature->AI());
|
||||
|
||||
switch(uiAction)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, OZ_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
pPlayer->SEND_GOSSIP_MENU(8971, pCreature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
pBarnesAI->StartEvent();
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+3:
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
pBarnesAI->m_uiEventId = EVENT_OZ;
|
||||
sLog.outString("TSCR: player (GUID %i) manually set Opera event to EVENT_OZ",pPlayer->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+4:
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
pBarnesAI->m_uiEventId = EVENT_HOOD;
|
||||
sLog.outString("TSCR: player (GUID %i) manually set Opera event to EVENT_HOOD",pPlayer->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+5:
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
pBarnesAI->m_uiEventId = EVENT_RAJ;
|
||||
sLog.outString("TSCR: player (GUID %i) manually set Opera event to EVENT_RAJ",pPlayer->GetGUID());
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
if (InstanceScript* pInstance = pCreature->GetInstanceScript())
|
||||
{
|
||||
// Check for death of Moroes and if opera event is not done already
|
||||
if (pInstance->GetData(TYPE_MOROES) == DONE && pInstance->GetData(TYPE_OPERA) != DONE)
|
||||
{
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, OZ_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
if (pPlayer->isGameMaster())
|
||||
{
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, OZ_GM_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, OZ_GM_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, OZ_GM_GOSSIP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
|
||||
}
|
||||
|
||||
if (npc_barnesAI* pBarnesAI = CAST_AI(npc_barnes::npc_barnesAI,pCreature->AI()))
|
||||
{
|
||||
if (!pBarnesAI->RaidWiped)
|
||||
pPlayer->SEND_GOSSIP_MENU(8970, pCreature->GetGUID());
|
||||
else
|
||||
pPlayer->SEND_GOSSIP_MENU(8975, pCreature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pPlayer->SEND_GOSSIP_MENU(8978, pCreature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
return new npc_barnesAI(pCreature);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_npc_barnesAI(Creature* pCreature)
|
||||
{
|
||||
return new npc_barnesAI(pCreature);
|
||||
}
|
||||
|
||||
bool GossipHello_npc_barnes(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
if (ScriptedInstance* pInstance = pCreature->GetInstanceData())
|
||||
{
|
||||
// Check for death of Moroes and if opera event is not done already
|
||||
if (pInstance->GetData(TYPE_MOROES) == DONE && pInstance->GetData(TYPE_OPERA) != DONE)
|
||||
{
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, OZ_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
if (pPlayer->isGameMaster())
|
||||
{
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, OZ_GM_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, OZ_GM_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, OZ_GM_GOSSIP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
|
||||
}
|
||||
|
||||
if (npc_barnesAI* pBarnesAI = CAST_AI(npc_barnesAI,pCreature->AI()))
|
||||
{
|
||||
if (!pBarnesAI->RaidWiped)
|
||||
pPlayer->SEND_GOSSIP_MENU(8970, pCreature->GetGUID());
|
||||
else
|
||||
pPlayer->SEND_GOSSIP_MENU(8975, pCreature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pPlayer->SEND_GOSSIP_MENU(8978, pCreature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect_npc_barnes(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
|
||||
{
|
||||
npc_barnesAI* pBarnesAI = CAST_AI(npc_barnesAI, pCreature->AI());
|
||||
|
||||
switch(uiAction)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, OZ_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
pPlayer->SEND_GOSSIP_MENU(8971, pCreature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
pBarnesAI->StartEvent();
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+3:
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
pBarnesAI->m_uiEventId = EVENT_OZ;
|
||||
sLog.outString("TSCR: player (GUID %i) manually set Opera event to EVENT_OZ",pPlayer->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+4:
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
pBarnesAI->m_uiEventId = EVENT_HOOD;
|
||||
sLog.outString("TSCR: player (GUID %i) manually set Opera event to EVENT_HOOD",pPlayer->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+5:
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
pBarnesAI->m_uiEventId = EVENT_RAJ;
|
||||
sLog.outString("TSCR: player (GUID %i) manually set Opera event to EVENT_RAJ",pPlayer->GetGUID());
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*###
|
||||
# npc_berthold
|
||||
@@ -400,28 +408,35 @@ enum eBerthold
|
||||
};
|
||||
|
||||
#define GOSSIP_ITEM_TELEPORT "Teleport me to the Guardian's Library"
|
||||
|
||||
bool GossipHello_npc_berthold(Player* pPlayer, Creature* pCreature)
|
||||
class npc_berthold : public CreatureScript
|
||||
{
|
||||
if (ScriptedInstance* pInstance = pCreature->GetInstanceData())
|
||||
public:
|
||||
npc_berthold() : CreatureScript("npc_berthold") { }
|
||||
|
||||
bool OnGossipSelect(Player* pPlayer, Creature* /*pCreature*/, uint32 /*uiSender*/, uint32 uiAction)
|
||||
{
|
||||
// Check if Shade of Aran event is done
|
||||
if (pInstance->GetData(TYPE_ARAN) == DONE)
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TELEPORT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
pPlayer->CastSpell(pPlayer, SPELL_TELEPORT, true);
|
||||
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
return true;
|
||||
}
|
||||
|
||||
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
if (InstanceScript* pInstance = pCreature->GetInstanceScript())
|
||||
{
|
||||
// Check if Shade of Aran event is done
|
||||
if (pInstance->GetData(TYPE_ARAN) == DONE)
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TELEPORT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
}
|
||||
|
||||
bool GossipSelect_npc_berthold(Player* pPlayer, Creature* /*pCreature*/, uint32 /*uiSender*/, uint32 uiAction)
|
||||
{
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
pPlayer->CastSpell(pPlayer, SPELL_TELEPORT, true);
|
||||
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
return true;
|
||||
}
|
||||
|
||||
/*###
|
||||
# npc_image_of_medivh
|
||||
@@ -445,204 +460,194 @@ bool GossipSelect_npc_berthold(Player* pPlayer, Creature* /*pCreature*/, uint32
|
||||
|
||||
static float MedivPos[4] = {-11161.49,-1902.24,91.48,1.94};
|
||||
static float ArcanagosPos[4] = {-11169.75,-1881.48,95.39,4.83};
|
||||
|
||||
struct npc_image_of_medivhAI : public ScriptedAI
|
||||
class npc_image_of_medivh : public CreatureScript
|
||||
{
|
||||
npc_image_of_medivhAI(Creature* c) : ScriptedAI(c)
|
||||
public:
|
||||
npc_image_of_medivh() : CreatureScript("npc_image_of_medivh") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
return new npc_image_of_medivhAI(pCreature);
|
||||
}
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
uint64 ArcanagosGUID;
|
||||
|
||||
uint32 YellTimer;
|
||||
uint32 Step;
|
||||
uint32 FireMedivhTimer;
|
||||
uint32 FireArcanagosTimer;
|
||||
|
||||
bool EventStarted;
|
||||
|
||||
void Reset()
|
||||
struct npc_image_of_medivhAI : public ScriptedAI
|
||||
{
|
||||
ArcanagosGUID = 0;
|
||||
|
||||
if (pInstance && pInstance->GetData64(DATA_IMAGE_OF_MEDIVH) == 0)
|
||||
npc_image_of_medivhAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance->SetData64(DATA_IMAGE_OF_MEDIVH, me->GetGUID());
|
||||
(*me).GetMotionMaster()->MovePoint(1,MedivPos[0],MedivPos[1],MedivPos[2]);
|
||||
Step = 0;
|
||||
}else
|
||||
{
|
||||
me->DealDamage(me,me->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
me->RemoveCorpse();
|
||||
pInstance = c->GetInstanceScript();
|
||||
}
|
||||
}
|
||||
void EnterCombat(Unit* /*who*/) {}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
if (id == 1)
|
||||
InstanceScript *pInstance;
|
||||
|
||||
uint64 ArcanagosGUID;
|
||||
|
||||
uint32 YellTimer;
|
||||
uint32 Step;
|
||||
uint32 FireMedivhTimer;
|
||||
uint32 FireArcanagosTimer;
|
||||
|
||||
bool EventStarted;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
StartEvent();
|
||||
me->SetOrientation(MedivPos[3]);
|
||||
me->SetOrientation(MedivPos[3]);
|
||||
}
|
||||
}
|
||||
ArcanagosGUID = 0;
|
||||
|
||||
void StartEvent()
|
||||
{
|
||||
Step = 1;
|
||||
EventStarted = true;
|
||||
Creature* Arcanagos = me->SummonCreature(MOB_ARCANAGOS,ArcanagosPos[0],ArcanagosPos[1],ArcanagosPos[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
|
||||
if (!Arcanagos)
|
||||
return;
|
||||
ArcanagosGUID = Arcanagos->GetGUID();
|
||||
Arcanagos->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
|
||||
(*Arcanagos).GetMotionMaster()->MovePoint(0,ArcanagosPos[0],ArcanagosPos[1],ArcanagosPos[2]);
|
||||
Arcanagos->SetOrientation(ArcanagosPos[3]);
|
||||
me->SetOrientation(MedivPos[3]);
|
||||
YellTimer = 10000;
|
||||
}
|
||||
|
||||
uint32 NextStep(uint32 Step)
|
||||
{
|
||||
Unit* arca = Unit::GetUnit((*me),ArcanagosGUID);
|
||||
Map* pMap = me->GetMap();
|
||||
switch(Step)
|
||||
{
|
||||
case 0: return 9999999;
|
||||
case 1:
|
||||
me->MonsterYell(SAY_DIALOG_MEDIVH_1,LANG_UNIVERSAL,NULL);
|
||||
return 10000;
|
||||
case 2:
|
||||
if (arca)
|
||||
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_2,LANG_UNIVERSAL,NULL);
|
||||
return 20000;
|
||||
case 3:
|
||||
me->MonsterYell(SAY_DIALOG_MEDIVH_3,LANG_UNIVERSAL,NULL);
|
||||
return 10000;
|
||||
case 4:
|
||||
if (arca)
|
||||
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL, NULL);
|
||||
return 20000;
|
||||
case 5:
|
||||
me->MonsterYell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL, NULL);
|
||||
return 20000;
|
||||
case 6:
|
||||
if (arca)
|
||||
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_6, LANG_UNIVERSAL, NULL);
|
||||
return 10000;
|
||||
case 7:
|
||||
FireArcanagosTimer = 500;
|
||||
return 5000;
|
||||
case 8:
|
||||
FireMedivhTimer = 500;
|
||||
DoCast(me, SPELL_MANA_SHIELD);
|
||||
return 10000;
|
||||
case 9:
|
||||
me->MonsterTextEmote(EMOTE_DIALOG_MEDIVH_7, 0, false);
|
||||
return 10000;
|
||||
case 10:
|
||||
if (arca)
|
||||
DoCast(arca, SPELL_CONFLAGRATION_BLAST, false);
|
||||
return 1000;
|
||||
case 11:
|
||||
if (arca)
|
||||
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL, NULL);
|
||||
return 5000;
|
||||
case 12:
|
||||
arca->GetMotionMaster()->MovePoint(0, -11010.82,-1761.18, 156.47);
|
||||
arca->setActive(true);
|
||||
arca->InterruptNonMeleeSpells(true);
|
||||
arca->SetSpeed(MOVE_FLIGHT, 2.0f);
|
||||
return 10000;
|
||||
case 13:
|
||||
me->MonsterYell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, NULL);
|
||||
return 10000;
|
||||
case 14:
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->ClearInCombat();
|
||||
|
||||
if (pMap->IsDungeon())
|
||||
if (pInstance && pInstance->GetData64(DATA_IMAGE_OF_MEDIVH) == 0)
|
||||
{
|
||||
InstanceMap::PlayerList const &PlayerList = pMap->GetPlayers();
|
||||
for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
{
|
||||
if (i->getSource()->isAlive())
|
||||
{
|
||||
if (i->getSource()->GetQuestStatus(9645) == QUEST_STATUS_INCOMPLETE)
|
||||
i->getSource()->CompleteQuest(9645);
|
||||
}
|
||||
}
|
||||
pInstance->SetData64(DATA_IMAGE_OF_MEDIVH, me->GetGUID());
|
||||
(*me).GetMotionMaster()->MovePoint(1,MedivPos[0],MedivPos[1],MedivPos[2]);
|
||||
Step = 0;
|
||||
}else
|
||||
{
|
||||
me->DealDamage(me,me->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
me->RemoveCorpse();
|
||||
}
|
||||
}
|
||||
void EnterCombat(Unit* /*who*/) {}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
if (id == 1)
|
||||
{
|
||||
StartEvent();
|
||||
me->SetOrientation(MedivPos[3]);
|
||||
me->SetOrientation(MedivPos[3]);
|
||||
}
|
||||
return 50000;
|
||||
case 15:
|
||||
arca->DealDamage(arca,arca->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
return 5000;
|
||||
default : return 9999999;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
|
||||
if (YellTimer <= diff)
|
||||
void StartEvent()
|
||||
{
|
||||
if (EventStarted)
|
||||
YellTimer = NextStep(Step++);
|
||||
} else YellTimer -= diff;
|
||||
Step = 1;
|
||||
EventStarted = true;
|
||||
Creature* Arcanagos = me->SummonCreature(MOB_ARCANAGOS,ArcanagosPos[0],ArcanagosPos[1],ArcanagosPos[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
|
||||
if (!Arcanagos)
|
||||
return;
|
||||
ArcanagosGUID = Arcanagos->GetGUID();
|
||||
Arcanagos->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
|
||||
(*Arcanagos).GetMotionMaster()->MovePoint(0,ArcanagosPos[0],ArcanagosPos[1],ArcanagosPos[2]);
|
||||
Arcanagos->SetOrientation(ArcanagosPos[3]);
|
||||
me->SetOrientation(MedivPos[3]);
|
||||
YellTimer = 10000;
|
||||
}
|
||||
|
||||
if (Step >= 7 && Step <= 12)
|
||||
uint32 NextStep(uint32 Step)
|
||||
{
|
||||
Unit* arca = Unit::GetUnit((*me),ArcanagosGUID);
|
||||
|
||||
if (FireArcanagosTimer <= diff)
|
||||
Map* pMap = me->GetMap();
|
||||
switch(Step)
|
||||
{
|
||||
case 0: return 9999999;
|
||||
case 1:
|
||||
me->MonsterYell(SAY_DIALOG_MEDIVH_1,LANG_UNIVERSAL,NULL);
|
||||
return 10000;
|
||||
case 2:
|
||||
if (arca)
|
||||
arca->CastSpell(me, SPELL_FIRE_BALL, false);
|
||||
FireArcanagosTimer = 6000;
|
||||
} else FireArcanagosTimer -= diff;
|
||||
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_2,LANG_UNIVERSAL,NULL);
|
||||
return 20000;
|
||||
case 3:
|
||||
me->MonsterYell(SAY_DIALOG_MEDIVH_3,LANG_UNIVERSAL,NULL);
|
||||
return 10000;
|
||||
case 4:
|
||||
if (arca)
|
||||
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL, NULL);
|
||||
return 20000;
|
||||
case 5:
|
||||
me->MonsterYell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL, NULL);
|
||||
return 20000;
|
||||
case 6:
|
||||
if (arca)
|
||||
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_6, LANG_UNIVERSAL, NULL);
|
||||
return 10000;
|
||||
case 7:
|
||||
FireArcanagosTimer = 500;
|
||||
return 5000;
|
||||
case 8:
|
||||
FireMedivhTimer = 500;
|
||||
DoCast(me, SPELL_MANA_SHIELD);
|
||||
return 10000;
|
||||
case 9:
|
||||
me->MonsterTextEmote(EMOTE_DIALOG_MEDIVH_7, 0, false);
|
||||
return 10000;
|
||||
case 10:
|
||||
if (arca)
|
||||
DoCast(arca, SPELL_CONFLAGRATION_BLAST, false);
|
||||
return 1000;
|
||||
case 11:
|
||||
if (arca)
|
||||
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL, NULL);
|
||||
return 5000;
|
||||
case 12:
|
||||
arca->GetMotionMaster()->MovePoint(0, -11010.82,-1761.18, 156.47);
|
||||
arca->setActive(true);
|
||||
arca->InterruptNonMeleeSpells(true);
|
||||
arca->SetSpeed(MOVE_FLIGHT, 2.0f);
|
||||
return 10000;
|
||||
case 13:
|
||||
me->MonsterYell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, NULL);
|
||||
return 10000;
|
||||
case 14:
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->ClearInCombat();
|
||||
|
||||
if (pMap->IsDungeon())
|
||||
{
|
||||
InstanceMap::PlayerList const &PlayerList = pMap->GetPlayers();
|
||||
for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
{
|
||||
if (i->getSource()->isAlive())
|
||||
{
|
||||
if (i->getSource()->GetQuestStatus(9645) == QUEST_STATUS_INCOMPLETE)
|
||||
i->getSource()->CompleteQuest(9645);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 50000;
|
||||
case 15:
|
||||
arca->DealDamage(arca,arca->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
return 5000;
|
||||
default : return 9999999;
|
||||
}
|
||||
|
||||
if (FireMedivhTimer <= diff)
|
||||
{
|
||||
if (arca)
|
||||
DoCast(arca, SPELL_FIRE_BALL);
|
||||
FireMedivhTimer = 5000;
|
||||
} else FireMedivhTimer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
|
||||
if (YellTimer <= diff)
|
||||
{
|
||||
if (EventStarted)
|
||||
YellTimer = NextStep(Step++);
|
||||
} else YellTimer -= diff;
|
||||
|
||||
if (Step >= 7 && Step <= 12)
|
||||
{
|
||||
Unit* arca = Unit::GetUnit((*me),ArcanagosGUID);
|
||||
|
||||
if (FireArcanagosTimer <= diff)
|
||||
{
|
||||
if (arca)
|
||||
arca->CastSpell(me, SPELL_FIRE_BALL, false);
|
||||
FireArcanagosTimer = 6000;
|
||||
} else FireArcanagosTimer -= diff;
|
||||
|
||||
if (FireMedivhTimer <= diff)
|
||||
{
|
||||
if (arca)
|
||||
DoCast(arca, SPELL_FIRE_BALL);
|
||||
FireMedivhTimer = 5000;
|
||||
} else FireMedivhTimer -= diff;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_npc_image_of_medivh(Creature* pCreature)
|
||||
{
|
||||
return new npc_image_of_medivhAI(pCreature);
|
||||
}
|
||||
|
||||
void AddSC_karazhan()
|
||||
{
|
||||
Script* newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->GetAI = &GetAI_npc_barnesAI;
|
||||
newscript->Name = "npc_barnes";
|
||||
newscript->pGossipHello = &GossipHello_npc_barnes;
|
||||
newscript->pGossipSelect = &GossipSelect_npc_barnes;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_berthold";
|
||||
newscript->pGossipHello = &GossipHello_npc_berthold;
|
||||
newscript->pGossipSelect = &GossipSelect_npc_berthold;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_image_of_medivh";
|
||||
newscript->GetAI = &GetAI_npc_image_of_medivh;
|
||||
newscript->RegisterSelf();
|
||||
new npc_barnes();
|
||||
new npc_berthold();
|
||||
new npc_image_of_medivh();
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -50,319 +50,323 @@ EndScriptData */
|
||||
#define DATA_CRYSTALS 6
|
||||
|
||||
#define CREATURE_FEL_CRYSTAL 24722
|
||||
|
||||
struct boss_selin_fireheartAI : public ScriptedAI
|
||||
class boss_selin_fireheart : public CreatureScript
|
||||
{
|
||||
boss_selin_fireheartAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
public:
|
||||
boss_selin_fireheart() : CreatureScript("boss_selin_fireheart") { }
|
||||
|
||||
Crystals.clear();
|
||||
//GUIDs per instance is static, so we only need to load them once.
|
||||
if (pInstance)
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
return new boss_selin_fireheartAI (pCreature);
|
||||
};
|
||||
|
||||
struct boss_selin_fireheartAI : public ScriptedAI
|
||||
{
|
||||
boss_selin_fireheartAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
uint32 size = pInstance->GetData(DATA_FEL_CRYSTAL_SIZE);
|
||||
for (uint8 i = 0; i < size; ++i)
|
||||
pInstance = c->GetInstanceScript();
|
||||
|
||||
Crystals.clear();
|
||||
//GUIDs per instance is static, so we only need to load them once.
|
||||
if (pInstance)
|
||||
{
|
||||
uint64 guid = pInstance->GetData64(DATA_FEL_CRYSTAL);
|
||||
sLog.outDebug("TSCR: Selin: Adding Fel Crystal %u to list", guid);
|
||||
Crystals.push_back(guid);
|
||||
uint32 size = pInstance->GetData(DATA_FEL_CRYSTAL_SIZE);
|
||||
for (uint8 i = 0; i < size; ++i)
|
||||
{
|
||||
uint64 guid = pInstance->GetData64(DATA_FEL_CRYSTAL);
|
||||
sLog.outDebug("TSCR: Selin: Adding Fel Crystal %u to list", guid);
|
||||
Crystals.push_back(guid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
InstanceScript* pInstance;
|
||||
|
||||
std::list<uint64> Crystals;
|
||||
std::list<uint64> Crystals;
|
||||
|
||||
uint32 DrainLifeTimer;
|
||||
uint32 DrainManaTimer;
|
||||
uint32 FelExplosionTimer;
|
||||
uint32 DrainCrystalTimer;
|
||||
uint32 EmpowerTimer;
|
||||
uint32 DrainLifeTimer;
|
||||
uint32 DrainManaTimer;
|
||||
uint32 FelExplosionTimer;
|
||||
uint32 DrainCrystalTimer;
|
||||
uint32 EmpowerTimer;
|
||||
|
||||
bool IsDraining;
|
||||
bool DrainingCrystal;
|
||||
bool IsDraining;
|
||||
bool DrainingCrystal;
|
||||
|
||||
uint64 CrystalGUID; // This will help us create a pointer to the crystal we are draining. We store GUIDs, never units in case unit is deleted/offline (offline if player of course).
|
||||
uint64 CrystalGUID; // This will help us create a pointer to the crystal we are draining. We store GUIDs, never units in case unit is deleted/offline (offline if player of course).
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (pInstance)
|
||||
void Reset()
|
||||
{
|
||||
//for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
|
||||
if (pInstance)
|
||||
{
|
||||
//for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
|
||||
for (std::list<uint64>::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
|
||||
{
|
||||
//Unit* pUnit = Unit::GetUnit(*me, FelCrystals[i]);
|
||||
Unit* pUnit = Unit::GetUnit(*me, *itr);
|
||||
if (pUnit)
|
||||
{
|
||||
if (!pUnit->isAlive())
|
||||
CAST_CRE(pUnit)->Respawn(); // Let the core handle setting death state, etc.
|
||||
|
||||
// Only need to set unselectable flag. You can't attack unselectable units so non_attackable flag is not necessary here.
|
||||
pUnit->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
}
|
||||
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), true);
|
||||
// Open the big encounter door. Close it in Aggro and open it only in JustDied(and here)
|
||||
// Small door opened after event are expected to be closed by default
|
||||
// Set Inst data for encounter
|
||||
pInstance->SetData(DATA_SELIN_EVENT, NOT_STARTED);
|
||||
} else sLog.outError(ERROR_INST_DATA);
|
||||
|
||||
DrainLifeTimer = 3000 + rand()%4000;
|
||||
DrainManaTimer = DrainLifeTimer + 5000;
|
||||
FelExplosionTimer = 2100;
|
||||
DrainCrystalTimer = 10000 + rand()%5000;
|
||||
DrainCrystalTimer = 20000 + rand()%5000;
|
||||
EmpowerTimer = 10000;
|
||||
|
||||
IsDraining = false;
|
||||
DrainingCrystal = false;
|
||||
CrystalGUID = 0;
|
||||
}
|
||||
|
||||
void SelectNearestCrystal()
|
||||
{
|
||||
if (Crystals.empty())
|
||||
return;
|
||||
|
||||
//float ShortestDistance = 0;
|
||||
CrystalGUID = 0;
|
||||
Unit* pCrystal = NULL;
|
||||
Unit* CrystalChosen = NULL;
|
||||
//for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
|
||||
for (std::list<uint64>::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
|
||||
{
|
||||
//Unit* pUnit = Unit::GetUnit(*me, FelCrystals[i]);
|
||||
Unit* pUnit = Unit::GetUnit(*me, *itr);
|
||||
if (pUnit)
|
||||
pCrystal = NULL;
|
||||
//pCrystal = Unit::GetUnit(*me, FelCrystals[i]);
|
||||
pCrystal = Unit::GetUnit(*me, *itr);
|
||||
if (pCrystal && pCrystal->isAlive())
|
||||
{
|
||||
if (!pUnit->isAlive())
|
||||
CAST_CRE(pUnit)->Respawn(); // Let the core handle setting death state, etc.
|
||||
|
||||
// Only need to set unselectable flag. You can't attack unselectable units so non_attackable flag is not necessary here.
|
||||
pUnit->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
}
|
||||
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), true);
|
||||
// Open the big encounter door. Close it in Aggro and open it only in JustDied(and here)
|
||||
// Small door opened after event are expected to be closed by default
|
||||
// Set Inst data for encounter
|
||||
pInstance->SetData(DATA_SELIN_EVENT, NOT_STARTED);
|
||||
} else sLog.outError(ERROR_INST_DATA);
|
||||
|
||||
DrainLifeTimer = 3000 + rand()%4000;
|
||||
DrainManaTimer = DrainLifeTimer + 5000;
|
||||
FelExplosionTimer = 2100;
|
||||
DrainCrystalTimer = 10000 + rand()%5000;
|
||||
DrainCrystalTimer = 20000 + rand()%5000;
|
||||
EmpowerTimer = 10000;
|
||||
|
||||
IsDraining = false;
|
||||
DrainingCrystal = false;
|
||||
CrystalGUID = 0;
|
||||
}
|
||||
|
||||
void SelectNearestCrystal()
|
||||
{
|
||||
if (Crystals.empty())
|
||||
return;
|
||||
|
||||
//float ShortestDistance = 0;
|
||||
CrystalGUID = 0;
|
||||
Unit* pCrystal = NULL;
|
||||
Unit* CrystalChosen = NULL;
|
||||
//for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
|
||||
for (std::list<uint64>::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
|
||||
{
|
||||
pCrystal = NULL;
|
||||
//pCrystal = Unit::GetUnit(*me, FelCrystals[i]);
|
||||
pCrystal = Unit::GetUnit(*me, *itr);
|
||||
if (pCrystal && pCrystal->isAlive())
|
||||
{
|
||||
// select nearest
|
||||
if (!CrystalChosen || me->GetDistanceOrder(pCrystal, CrystalChosen, false))
|
||||
{
|
||||
CrystalGUID = pCrystal->GetGUID();
|
||||
CrystalChosen = pCrystal; // Store a copy of pCrystal so we don't need to recreate a pointer to closest crystal for the movement and yell.
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CrystalChosen)
|
||||
{
|
||||
DoScriptText(SAY_ENERGY, me);
|
||||
DoScriptText(EMOTE_CRYSTAL, me);
|
||||
|
||||
CrystalChosen->CastSpell(CrystalChosen, SPELL_FEL_CRYSTAL_COSMETIC, true);
|
||||
|
||||
float x, y, z; // coords that we move to, close to the crystal.
|
||||
CrystalChosen->GetClosePoint(x, y, z, me->GetObjectSize(), CONTACT_DISTANCE);
|
||||
|
||||
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
|
||||
me->GetMotionMaster()->MovePoint(1, x, y, z);
|
||||
DrainingCrystal = true;
|
||||
}
|
||||
}
|
||||
|
||||
void ShatterRemainingCrystals()
|
||||
{
|
||||
if (Crystals.empty())
|
||||
return;
|
||||
|
||||
//for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
|
||||
for (std::list<uint64>::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
|
||||
{
|
||||
//Creature* pCrystal = (Unit::GetCreature(*me, FelCrystals[i]));
|
||||
Creature* pCrystal = Unit::GetCreature(*me, *itr);
|
||||
if (pCrystal && pCrystal->isAlive())
|
||||
pCrystal->Kill(pCrystal);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), false);
|
||||
//Close the encounter door, open it in JustDied/Reset
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE && id == 1)
|
||||
{
|
||||
Unit* CrystalChosen = Unit::GetUnit(*me, CrystalGUID);
|
||||
if (CrystalChosen && CrystalChosen->isAlive())
|
||||
{
|
||||
// Make the crystal attackable
|
||||
// We also remove NON_ATTACKABLE in case the database has it set.
|
||||
CrystalChosen->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
|
||||
CrystalChosen->CastSpell(me, SPELL_MANA_RAGE, true);
|
||||
IsDraining = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Make an error message in case something weird happened here
|
||||
sLog.outError("TSCR: Selin Fireheart unable to drain crystal as the crystal is either dead or despawned");
|
||||
DrainingCrystal = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
pInstance->SetData(DATA_SELIN_EVENT, DONE); // Encounter complete!
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), true); // Open the encounter door
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_DOOR), true); // Open the door leading further in
|
||||
ShatterRemainingCrystals();
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (!DrainingCrystal)
|
||||
{
|
||||
uint32 maxPowerMana = me->GetMaxPower(POWER_MANA);
|
||||
if (maxPowerMana && ((me->GetPower(POWER_MANA)*100 / maxPowerMana) < 10))
|
||||
{
|
||||
if (DrainLifeTimer <= diff)
|
||||
{
|
||||
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DRAIN_LIFE);
|
||||
DrainLifeTimer = 10000;
|
||||
} else DrainLifeTimer -= diff;
|
||||
|
||||
// Heroic only
|
||||
if (IsHeroic())
|
||||
{
|
||||
if (DrainManaTimer <= diff)
|
||||
// select nearest
|
||||
if (!CrystalChosen || me->GetDistanceOrder(pCrystal, CrystalChosen, false))
|
||||
{
|
||||
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_DRAIN_MANA);
|
||||
DrainManaTimer = 10000;
|
||||
} else DrainManaTimer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
if (FelExplosionTimer <= diff)
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
DoCast(me, SPELL_FEL_EXPLOSION);
|
||||
FelExplosionTimer = 2000;
|
||||
}
|
||||
} else FelExplosionTimer -= diff;
|
||||
|
||||
// If below 10% mana, start recharging
|
||||
maxPowerMana = me->GetMaxPower(POWER_MANA);
|
||||
if (maxPowerMana && ((me->GetPower(POWER_MANA)*100 / maxPowerMana) < 10))
|
||||
{
|
||||
if (DrainCrystalTimer <= diff)
|
||||
{
|
||||
SelectNearestCrystal();
|
||||
if (IsHeroic())
|
||||
DrainCrystalTimer = 10000 + rand()%5000;
|
||||
else
|
||||
DrainCrystalTimer = 20000 + rand()%5000;
|
||||
} else DrainCrystalTimer -= diff;
|
||||
}
|
||||
|
||||
}else
|
||||
{
|
||||
if (IsDraining)
|
||||
{
|
||||
if (EmpowerTimer <= diff)
|
||||
{
|
||||
IsDraining = false;
|
||||
DrainingCrystal = false;
|
||||
|
||||
DoScriptText(SAY_EMPOWERED, me);
|
||||
|
||||
Unit* CrystalChosen = Unit::GetUnit(*me, CrystalGUID);
|
||||
if (CrystalChosen && CrystalChosen->isAlive())
|
||||
// Use Deal Damage to kill it, not setDeathState.
|
||||
CrystalChosen->Kill(CrystalChosen);
|
||||
|
||||
CrystalGUID = 0;
|
||||
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MoveChase(me->getVictim());
|
||||
} else EmpowerTimer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady(); // No need to check if we are draining crystal here, as the spell has a stun.
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_selin_fireheart(Creature* pCreature)
|
||||
{
|
||||
return new boss_selin_fireheartAI (pCreature);
|
||||
};
|
||||
|
||||
struct mob_fel_crystalAI : public ScriptedAI
|
||||
{
|
||||
mob_fel_crystalAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void Reset() {}
|
||||
void EnterCombat(Unit* /*who*/) {}
|
||||
void AttackStart(Unit* /*who*/) {}
|
||||
void MoveInLineOfSight(Unit* /*who*/) {}
|
||||
void UpdateAI(const uint32 /*diff*/) {}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (ScriptedInstance* pInstance = me->GetInstanceData())
|
||||
{
|
||||
Creature* Selin = (Unit::GetCreature(*me, pInstance->GetData64(DATA_SELIN)));
|
||||
if (Selin && Selin->isAlive())
|
||||
{
|
||||
if (CAST_AI(boss_selin_fireheartAI, Selin->AI())->CrystalGUID == me->GetGUID())
|
||||
{
|
||||
// Set this to false if we are the Creature that Selin is draining so his AI flows properly
|
||||
CAST_AI(boss_selin_fireheartAI, Selin->AI())->DrainingCrystal = false;
|
||||
CAST_AI(boss_selin_fireheartAI, Selin->AI())->IsDraining = false;
|
||||
CAST_AI(boss_selin_fireheartAI, Selin->AI())->EmpowerTimer = 10000;
|
||||
if (Selin->getVictim())
|
||||
{
|
||||
Selin->AI()->AttackStart(Selin->getVictim());
|
||||
Selin->GetMotionMaster()->MoveChase(Selin->getVictim());
|
||||
CrystalGUID = pCrystal->GetGUID();
|
||||
CrystalChosen = pCrystal; // Store a copy of pCrystal so we don't need to recreate a pointer to closest crystal for the movement and yell.
|
||||
}
|
||||
}
|
||||
}
|
||||
} else sLog.outError(ERROR_INST_DATA);
|
||||
}
|
||||
if (CrystalChosen)
|
||||
{
|
||||
DoScriptText(SAY_ENERGY, me);
|
||||
DoScriptText(EMOTE_CRYSTAL, me);
|
||||
|
||||
CrystalChosen->CastSpell(CrystalChosen, SPELL_FEL_CRYSTAL_COSMETIC, true);
|
||||
|
||||
float x, y, z; // coords that we move to, close to the crystal.
|
||||
CrystalChosen->GetClosePoint(x, y, z, me->GetObjectSize(), CONTACT_DISTANCE);
|
||||
|
||||
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
|
||||
me->GetMotionMaster()->MovePoint(1, x, y, z);
|
||||
DrainingCrystal = true;
|
||||
}
|
||||
}
|
||||
|
||||
void ShatterRemainingCrystals()
|
||||
{
|
||||
if (Crystals.empty())
|
||||
return;
|
||||
|
||||
//for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
|
||||
for (std::list<uint64>::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
|
||||
{
|
||||
//Creature* pCrystal = (Unit::GetCreature(*me, FelCrystals[i]));
|
||||
Creature* pCrystal = Unit::GetCreature(*me, *itr);
|
||||
if (pCrystal && pCrystal->isAlive())
|
||||
pCrystal->Kill(pCrystal);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), false);
|
||||
//Close the encounter door, open it in JustDied/Reset
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE && id == 1)
|
||||
{
|
||||
Unit* CrystalChosen = Unit::GetUnit(*me, CrystalGUID);
|
||||
if (CrystalChosen && CrystalChosen->isAlive())
|
||||
{
|
||||
// Make the crystal attackable
|
||||
// We also remove NON_ATTACKABLE in case the database has it set.
|
||||
CrystalChosen->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
|
||||
CrystalChosen->CastSpell(me, SPELL_MANA_RAGE, true);
|
||||
IsDraining = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Make an error message in case something weird happened here
|
||||
sLog.outError("TSCR: Selin Fireheart unable to drain crystal as the crystal is either dead or despawned");
|
||||
DrainingCrystal = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
pInstance->SetData(DATA_SELIN_EVENT, DONE); // Encounter complete!
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), true); // Open the encounter door
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_DOOR), true); // Open the door leading further in
|
||||
ShatterRemainingCrystals();
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (!DrainingCrystal)
|
||||
{
|
||||
uint32 maxPowerMana = me->GetMaxPower(POWER_MANA);
|
||||
if (maxPowerMana && ((me->GetPower(POWER_MANA)*100 / maxPowerMana) < 10))
|
||||
{
|
||||
if (DrainLifeTimer <= diff)
|
||||
{
|
||||
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DRAIN_LIFE);
|
||||
DrainLifeTimer = 10000;
|
||||
} else DrainLifeTimer -= diff;
|
||||
|
||||
// Heroic only
|
||||
if (IsHeroic())
|
||||
{
|
||||
if (DrainManaTimer <= diff)
|
||||
{
|
||||
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_DRAIN_MANA);
|
||||
DrainManaTimer = 10000;
|
||||
} else DrainManaTimer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
if (FelExplosionTimer <= diff)
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
DoCast(me, SPELL_FEL_EXPLOSION);
|
||||
FelExplosionTimer = 2000;
|
||||
}
|
||||
} else FelExplosionTimer -= diff;
|
||||
|
||||
// If below 10% mana, start recharging
|
||||
maxPowerMana = me->GetMaxPower(POWER_MANA);
|
||||
if (maxPowerMana && ((me->GetPower(POWER_MANA)*100 / maxPowerMana) < 10))
|
||||
{
|
||||
if (DrainCrystalTimer <= diff)
|
||||
{
|
||||
SelectNearestCrystal();
|
||||
if (IsHeroic())
|
||||
DrainCrystalTimer = 10000 + rand()%5000;
|
||||
else
|
||||
DrainCrystalTimer = 20000 + rand()%5000;
|
||||
} else DrainCrystalTimer -= diff;
|
||||
}
|
||||
|
||||
}else
|
||||
{
|
||||
if (IsDraining)
|
||||
{
|
||||
if (EmpowerTimer <= diff)
|
||||
{
|
||||
IsDraining = false;
|
||||
DrainingCrystal = false;
|
||||
|
||||
DoScriptText(SAY_EMPOWERED, me);
|
||||
|
||||
Unit* CrystalChosen = Unit::GetUnit(*me, CrystalGUID);
|
||||
if (CrystalChosen && CrystalChosen->isAlive())
|
||||
// Use Deal Damage to kill it, not setDeathState.
|
||||
CrystalChosen->Kill(CrystalChosen);
|
||||
|
||||
CrystalGUID = 0;
|
||||
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MoveChase(me->getVictim());
|
||||
} else EmpowerTimer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady(); // No need to check if we are draining crystal here, as the spell has a stun.
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_fel_crystal(Creature* pCreature)
|
||||
class mob_fel_crystal : public CreatureScript
|
||||
{
|
||||
return new mob_fel_crystalAI (pCreature);
|
||||
public:
|
||||
mob_fel_crystal() : CreatureScript("mob_fel_crystal") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
return new mob_fel_crystalAI (pCreature);
|
||||
};
|
||||
|
||||
struct mob_fel_crystalAI : public ScriptedAI
|
||||
{
|
||||
mob_fel_crystalAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void Reset() {}
|
||||
void EnterCombat(Unit* /*who*/) {}
|
||||
void AttackStart(Unit* /*who*/) {}
|
||||
void MoveInLineOfSight(Unit* /*who*/) {}
|
||||
void UpdateAI(const uint32 /*diff*/) {}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (InstanceScript* pInstance = me->GetInstanceScript())
|
||||
{
|
||||
Creature* Selin = (Unit::GetCreature(*me, pInstance->GetData64(DATA_SELIN)));
|
||||
if (Selin && Selin->isAlive())
|
||||
{
|
||||
if (CAST_AI(boss_selin_fireheart::boss_selin_fireheartAI, Selin->AI())->CrystalGUID == me->GetGUID())
|
||||
{
|
||||
// Set this to false if we are the Creature that Selin is draining so his AI flows properly
|
||||
CAST_AI(boss_selin_fireheart::boss_selin_fireheartAI, Selin->AI())->DrainingCrystal = false;
|
||||
CAST_AI(boss_selin_fireheart::boss_selin_fireheartAI, Selin->AI())->IsDraining = false;
|
||||
CAST_AI(boss_selin_fireheart::boss_selin_fireheartAI, Selin->AI())->EmpowerTimer = 10000;
|
||||
if (Selin->getVictim())
|
||||
{
|
||||
Selin->AI()->AttackStart(Selin->getVictim());
|
||||
Selin->GetMotionMaster()->MoveChase(Selin->getVictim());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else sLog.outError(ERROR_INST_DATA);
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
void AddSC_boss_selin_fireheart()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_selin_fireheart";
|
||||
newscript->GetAI = &GetAI_boss_selin_fireheart;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_fel_crystal";
|
||||
newscript->GetAI = &GetAI_mob_fel_crystal;
|
||||
newscript->RegisterSelf();
|
||||
new boss_selin_fireheart();
|
||||
new mob_fel_crystal();
|
||||
}
|
||||
|
||||
|
||||
@@ -58,171 +58,176 @@ enum eEnums
|
||||
INTERVAL_MODIFIER = 15,
|
||||
INTERVAL_SWITCH = 6
|
||||
};
|
||||
|
||||
struct boss_vexallusAI : public ScriptedAI
|
||||
class boss_vexallus : public CreatureScript
|
||||
{
|
||||
boss_vexallusAI(Creature *c) : ScriptedAI(c)
|
||||
public:
|
||||
boss_vexallus() : CreatureScript("boss_vexallus") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
return new boss_vexallusAI (pCreature);
|
||||
};
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 ChainLightningTimer;
|
||||
uint32 ArcaneShockTimer;
|
||||
uint32 OverloadTimer;
|
||||
uint32 IntervalHealthAmount;
|
||||
bool Enraged;
|
||||
|
||||
void Reset()
|
||||
struct boss_vexallusAI : public ScriptedAI
|
||||
{
|
||||
ChainLightningTimer = 8000;
|
||||
ArcaneShockTimer = 5000;
|
||||
OverloadTimer = 1200;
|
||||
IntervalHealthAmount = 1;
|
||||
Enraged = false;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * /*victim*/)
|
||||
{
|
||||
DoScriptText(SAY_KILL, me);
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*victim*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_VEXALLUS_EVENT, DONE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature *summoned)
|
||||
{
|
||||
if (Unit *temp = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
summoned->GetMotionMaster()->MoveFollow(temp,0,0);
|
||||
|
||||
//spells are SUMMON_TYPE_GUARDIAN, so using setOwner should be ok
|
||||
summoned->CastSpell(summoned,SPELL_ENERGY_BOLT,false,0,0,me->GetGUID());
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (!Enraged)
|
||||
boss_vexallusAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
//used for check, when Vexallus cast adds 85%, 70%, 55%, 40%, 25%
|
||||
if ((me->GetHealth()*100 / me->GetMaxHealth()) <= (100-(INTERVAL_MODIFIER*IntervalHealthAmount)))
|
||||
pInstance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
|
||||
uint32 ChainLightningTimer;
|
||||
uint32 ArcaneShockTimer;
|
||||
uint32 OverloadTimer;
|
||||
uint32 IntervalHealthAmount;
|
||||
bool Enraged;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
ChainLightningTimer = 8000;
|
||||
ArcaneShockTimer = 5000;
|
||||
OverloadTimer = 1200;
|
||||
IntervalHealthAmount = 1;
|
||||
Enraged = false;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * /*victim*/)
|
||||
{
|
||||
DoScriptText(SAY_KILL, me);
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*victim*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_VEXALLUS_EVENT, DONE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature *summoned)
|
||||
{
|
||||
if (Unit *temp = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
summoned->GetMotionMaster()->MoveFollow(temp,0,0);
|
||||
|
||||
//spells are SUMMON_TYPE_GUARDIAN, so using setOwner should be ok
|
||||
summoned->CastSpell(summoned,SPELL_ENERGY_BOLT,false,0,0,me->GetGUID());
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (!Enraged)
|
||||
{
|
||||
//increase amount, unless we're at 10%, then we switch and return
|
||||
if (IntervalHealthAmount == INTERVAL_SWITCH)
|
||||
//used for check, when Vexallus cast adds 85%, 70%, 55%, 40%, 25%
|
||||
if ((me->GetHealth()*100 / me->GetMaxHealth()) <= (100-(INTERVAL_MODIFIER*IntervalHealthAmount)))
|
||||
{
|
||||
Enraged = true;
|
||||
return;
|
||||
}
|
||||
else
|
||||
++IntervalHealthAmount;
|
||||
//increase amount, unless we're at 10%, then we switch and return
|
||||
if (IntervalHealthAmount == INTERVAL_SWITCH)
|
||||
{
|
||||
Enraged = true;
|
||||
return;
|
||||
}
|
||||
else
|
||||
++IntervalHealthAmount;
|
||||
|
||||
DoScriptText(SAY_ENERGY, me);
|
||||
DoScriptText(EMOTE_DISCHARGE_ENERGY, me);
|
||||
DoScriptText(SAY_ENERGY, me);
|
||||
DoScriptText(EMOTE_DISCHARGE_ENERGY, me);
|
||||
|
||||
if (IsHeroic())
|
||||
{
|
||||
DoCast(me, H_SPELL_SUMMON_PURE_ENERGY1, false);
|
||||
DoCast(me, H_SPELL_SUMMON_PURE_ENERGY2, false);
|
||||
}
|
||||
else
|
||||
DoCast(me, SPELL_SUMMON_PURE_ENERGY, false);
|
||||
if (IsHeroic())
|
||||
{
|
||||
DoCast(me, H_SPELL_SUMMON_PURE_ENERGY1, false);
|
||||
DoCast(me, H_SPELL_SUMMON_PURE_ENERGY2, false);
|
||||
}
|
||||
else
|
||||
DoCast(me, SPELL_SUMMON_PURE_ENERGY, false);
|
||||
|
||||
//below are workaround summons, remove when summoning spells w/implicitTarget 73 implemented in the core
|
||||
me->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
|
||||
if (IsHeroic())
|
||||
//below are workaround summons, remove when summoning spells w/implicitTarget 73 implemented in the core
|
||||
me->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
|
||||
if (IsHeroic())
|
||||
me->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
}
|
||||
|
||||
if (ChainLightningTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_CHAIN_LIGHTNING);
|
||||
|
||||
ChainLightningTimer = 8000;
|
||||
} else ChainLightningTimer -= diff;
|
||||
|
||||
if (ArcaneShockTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
if (pTarget)
|
||||
DoCast(pTarget, SPELL_ARCANE_SHOCK);
|
||||
|
||||
ArcaneShockTimer = 8000;
|
||||
} else ArcaneShockTimer -= diff;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (OverloadTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_OVERLOAD);
|
||||
|
||||
OverloadTimer = 2000;
|
||||
} else OverloadTimer -= diff;
|
||||
}
|
||||
|
||||
if (ChainLightningTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_CHAIN_LIGHTNING);
|
||||
|
||||
ChainLightningTimer = 8000;
|
||||
} else ChainLightningTimer -= diff;
|
||||
|
||||
if (ArcaneShockTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
if (pTarget)
|
||||
DoCast(pTarget, SPELL_ARCANE_SHOCK);
|
||||
|
||||
ArcaneShockTimer = 8000;
|
||||
} else ArcaneShockTimer -= diff;
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (OverloadTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_OVERLOAD);
|
||||
};
|
||||
|
||||
OverloadTimer = 2000;
|
||||
} else OverloadTimer -= diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_vexallus(Creature* pCreature)
|
||||
class mob_pure_energy : public CreatureScript
|
||||
{
|
||||
return new boss_vexallusAI (pCreature);
|
||||
};
|
||||
public:
|
||||
mob_pure_energy() : CreatureScript("mob_pure_energy") { }
|
||||
|
||||
struct mob_pure_energyAI : public ScriptedAI
|
||||
{
|
||||
mob_pure_energyAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void Reset() {}
|
||||
|
||||
void JustDied(Unit* slayer)
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
if (Unit *temp = me->GetOwner())
|
||||
return new mob_pure_energyAI (pCreature);
|
||||
};
|
||||
|
||||
struct mob_pure_energyAI : public ScriptedAI
|
||||
{
|
||||
mob_pure_energyAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void Reset() {}
|
||||
|
||||
void JustDied(Unit* slayer)
|
||||
{
|
||||
if (temp && temp->isAlive())
|
||||
slayer->CastSpell(slayer, SPELL_ENERGY_FEEDBACK, true, 0, 0, temp->GetGUID());
|
||||
if (Unit *temp = me->GetOwner())
|
||||
{
|
||||
if (temp && temp->isAlive())
|
||||
slayer->CastSpell(slayer, SPELL_ENERGY_FEEDBACK, true, 0, 0, temp->GetGUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/) {}
|
||||
void MoveInLineOfSight(Unit * /*who*/) {}
|
||||
void AttackStart(Unit * /*who*/) {}
|
||||
void EnterCombat(Unit * /*who*/) {}
|
||||
void MoveInLineOfSight(Unit * /*who*/) {}
|
||||
void AttackStart(Unit * /*who*/) {}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_pure_energy(Creature* pCreature)
|
||||
{
|
||||
return new mob_pure_energyAI (pCreature);
|
||||
};
|
||||
|
||||
void AddSC_boss_vexallus()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_vexallus";
|
||||
newscript->GetAI = &GetAI_boss_vexallus;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_pure_energy";
|
||||
newscript->GetAI = &GetAI_mob_pure_energy;
|
||||
newscript->RegisterSelf();
|
||||
new boss_vexallus();
|
||||
new mob_pure_energy();
|
||||
}
|
||||
|
||||
+147
-146
@@ -34,174 +34,175 @@ EndScriptData */
|
||||
2 - Priestess Delrissa
|
||||
3 - Kael'thas Sunstrider
|
||||
*/
|
||||
|
||||
struct instance_magisters_terrace : public ScriptedInstance
|
||||
class instance_magisters_terrace : public InstanceMapScript
|
||||
{
|
||||
instance_magisters_terrace(Map* pMap) : ScriptedInstance(pMap) {Initialize();}
|
||||
public:
|
||||
instance_magisters_terrace() : InstanceMapScript("instance_magisters_terrace") { }
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
uint32 DelrissaDeathCount;
|
||||
|
||||
std::list<uint64> FelCrystals;
|
||||
std::list<uint64>::const_iterator CrystalItr;
|
||||
|
||||
uint64 SelinGUID;
|
||||
uint64 DelrissaGUID;
|
||||
uint64 VexallusDoorGUID;
|
||||
uint64 SelinDoorGUID;
|
||||
uint64 SelinEncounterDoorGUID;
|
||||
uint64 DelrissaDoorGUID;
|
||||
uint64 KaelDoorGUID;
|
||||
uint64 KaelStatue[2];
|
||||
|
||||
bool InitializedItr;
|
||||
|
||||
void Initialize()
|
||||
InstanceScript* GetInstanceData_InstanceMapScript(Map* pMap)
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
FelCrystals.clear();
|
||||
|
||||
DelrissaDeathCount = 0;
|
||||
|
||||
SelinGUID = 0;
|
||||
DelrissaGUID = 0;
|
||||
VexallusDoorGUID = 0;
|
||||
SelinDoorGUID = 0;
|
||||
SelinEncounterDoorGUID = 0;
|
||||
DelrissaDoorGUID = 0;
|
||||
KaelDoorGUID = 0;
|
||||
KaelStatue[0] = 0;
|
||||
KaelStatue[1] = 0;
|
||||
|
||||
InitializedItr = false;
|
||||
return new instance_magisters_terrace_InstanceMapScript(pMap);
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
struct instance_magisters_terrace_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
instance_magisters_terrace_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();}
|
||||
|
||||
uint32 GetData(uint32 identifier)
|
||||
{
|
||||
switch(identifier)
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
uint32 DelrissaDeathCount;
|
||||
|
||||
std::list<uint64> FelCrystals;
|
||||
std::list<uint64>::const_iterator CrystalItr;
|
||||
|
||||
uint64 SelinGUID;
|
||||
uint64 DelrissaGUID;
|
||||
uint64 VexallusDoorGUID;
|
||||
uint64 SelinDoorGUID;
|
||||
uint64 SelinEncounterDoorGUID;
|
||||
uint64 DelrissaDoorGUID;
|
||||
uint64 KaelDoorGUID;
|
||||
uint64 KaelStatue[2];
|
||||
|
||||
bool InitializedItr;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
case DATA_SELIN_EVENT: return m_auiEncounter[0];
|
||||
case DATA_VEXALLUS_EVENT: return m_auiEncounter[1];
|
||||
case DATA_DELRISSA_EVENT: return m_auiEncounter[2];
|
||||
case DATA_KAELTHAS_EVENT: return m_auiEncounter[3];
|
||||
case DATA_DELRISSA_DEATH_COUNT: return DelrissaDeathCount;
|
||||
case DATA_FEL_CRYSTAL_SIZE: return FelCrystals.size();
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
FelCrystals.clear();
|
||||
|
||||
DelrissaDeathCount = 0;
|
||||
|
||||
SelinGUID = 0;
|
||||
DelrissaGUID = 0;
|
||||
VexallusDoorGUID = 0;
|
||||
SelinDoorGUID = 0;
|
||||
SelinEncounterDoorGUID = 0;
|
||||
DelrissaDoorGUID = 0;
|
||||
KaelDoorGUID = 0;
|
||||
KaelStatue[0] = 0;
|
||||
KaelStatue[1] = 0;
|
||||
|
||||
InitializedItr = false;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 identifier, uint32 data)
|
||||
{
|
||||
switch(identifier)
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
case DATA_SELIN_EVENT: m_auiEncounter[0] = data; break;
|
||||
case DATA_VEXALLUS_EVENT:
|
||||
if (data == DONE)
|
||||
DoUseDoorOrButton(VexallusDoorGUID);
|
||||
m_auiEncounter[1] = data;
|
||||
break;
|
||||
case DATA_DELRISSA_EVENT:
|
||||
if (data == DONE)
|
||||
DoUseDoorOrButton(DelrissaDoorGUID);
|
||||
if (data == IN_PROGRESS)
|
||||
DelrissaDeathCount = 0;
|
||||
m_auiEncounter[2] = data;
|
||||
break;
|
||||
case DATA_KAELTHAS_EVENT: m_auiEncounter[3] = data; break;
|
||||
|
||||
case DATA_DELRISSA_DEATH_COUNT:
|
||||
if (data == SPECIAL)
|
||||
++DelrissaDeathCount;
|
||||
else
|
||||
DelrissaDeathCount = 0;
|
||||
break;
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
|
||||
{
|
||||
switch(pCreature->GetEntry())
|
||||
uint32 GetData(uint32 identifier)
|
||||
{
|
||||
case 24723: SelinGUID = pCreature->GetGUID(); break;
|
||||
case 24560: DelrissaGUID = pCreature->GetGUID(); break;
|
||||
case 24722: FelCrystals.push_back(pCreature->GetGUID()); break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
|
||||
{
|
||||
switch(pGo->GetEntry())
|
||||
{
|
||||
case 187896: VexallusDoorGUID = pGo->GetGUID(); break;
|
||||
//SunwellRaid Gate 02
|
||||
case 187979: SelinDoorGUID = pGo->GetGUID(); break;
|
||||
//Assembly Chamber Door
|
||||
case 188065: SelinEncounterDoorGUID = pGo->GetGUID(); break;
|
||||
case 187770: DelrissaDoorGUID = pGo->GetGUID(); break;
|
||||
case 188064: KaelDoorGUID = pGo->GetGUID(); break;
|
||||
case 188165: KaelStatue[0] = pGo->GetGUID(); break;
|
||||
case 188166: KaelStatue[1] = pGo->GetGUID(); break;
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 identifier)
|
||||
{
|
||||
switch(identifier)
|
||||
{
|
||||
case DATA_SELIN: return SelinGUID;
|
||||
case DATA_DELRISSA: return DelrissaGUID;
|
||||
case DATA_VEXALLUS_DOOR: return VexallusDoorGUID;
|
||||
case DATA_SELIN_DOOR: return SelinDoorGUID;
|
||||
case DATA_SELIN_ENCOUNTER_DOOR: return SelinEncounterDoorGUID;
|
||||
case DATA_DELRISSA_DOOR: return DelrissaDoorGUID;
|
||||
case DATA_KAEL_DOOR: return KaelDoorGUID;
|
||||
case DATA_KAEL_STATUE_LEFT: return KaelStatue[0];
|
||||
case DATA_KAEL_STATUE_RIGHT: return KaelStatue[1];
|
||||
|
||||
case DATA_FEL_CRYSTAL:
|
||||
switch(identifier)
|
||||
{
|
||||
if (FelCrystals.empty())
|
||||
{
|
||||
sLog.outError("TSCR: Magisters Terrace: No Fel Crystals loaded in Inst Data");
|
||||
return 0;
|
||||
}
|
||||
case DATA_SELIN_EVENT: return m_auiEncounter[0];
|
||||
case DATA_VEXALLUS_EVENT: return m_auiEncounter[1];
|
||||
case DATA_DELRISSA_EVENT: return m_auiEncounter[2];
|
||||
case DATA_KAELTHAS_EVENT: return m_auiEncounter[3];
|
||||
case DATA_DELRISSA_DEATH_COUNT: return DelrissaDeathCount;
|
||||
case DATA_FEL_CRYSTAL_SIZE: return FelCrystals.size();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!InitializedItr)
|
||||
{
|
||||
CrystalItr = FelCrystals.begin();
|
||||
InitializedItr = true;
|
||||
}
|
||||
void SetData(uint32 identifier, uint32 data)
|
||||
{
|
||||
switch(identifier)
|
||||
{
|
||||
case DATA_SELIN_EVENT: m_auiEncounter[0] = data; break;
|
||||
case DATA_VEXALLUS_EVENT:
|
||||
if (data == DONE)
|
||||
DoUseDoorOrButton(VexallusDoorGUID);
|
||||
m_auiEncounter[1] = data;
|
||||
break;
|
||||
case DATA_DELRISSA_EVENT:
|
||||
if (data == DONE)
|
||||
DoUseDoorOrButton(DelrissaDoorGUID);
|
||||
if (data == IN_PROGRESS)
|
||||
DelrissaDeathCount = 0;
|
||||
m_auiEncounter[2] = data;
|
||||
break;
|
||||
case DATA_KAELTHAS_EVENT: m_auiEncounter[3] = data; break;
|
||||
|
||||
uint64 guid = *CrystalItr;
|
||||
++CrystalItr;
|
||||
return guid;
|
||||
case DATA_DELRISSA_DEATH_COUNT:
|
||||
if (data == SPECIAL)
|
||||
++DelrissaDeathCount;
|
||||
else
|
||||
DelrissaDeathCount = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
|
||||
{
|
||||
switch(pCreature->GetEntry())
|
||||
{
|
||||
case 24723: SelinGUID = pCreature->GetGUID(); break;
|
||||
case 24560: DelrissaGUID = pCreature->GetGUID(); break;
|
||||
case 24722: FelCrystals.push_back(pCreature->GetGUID()); break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
|
||||
{
|
||||
switch(pGo->GetEntry())
|
||||
{
|
||||
case 187896: VexallusDoorGUID = pGo->GetGUID(); break;
|
||||
//SunwellRaid Gate 02
|
||||
case 187979: SelinDoorGUID = pGo->GetGUID(); break;
|
||||
//Assembly Chamber Door
|
||||
case 188065: SelinEncounterDoorGUID = pGo->GetGUID(); break;
|
||||
case 187770: DelrissaDoorGUID = pGo->GetGUID(); break;
|
||||
case 188064: KaelDoorGUID = pGo->GetGUID(); break;
|
||||
case 188165: KaelStatue[0] = pGo->GetGUID(); break;
|
||||
case 188166: KaelStatue[1] = pGo->GetGUID(); break;
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 identifier)
|
||||
{
|
||||
switch(identifier)
|
||||
{
|
||||
case DATA_SELIN: return SelinGUID;
|
||||
case DATA_DELRISSA: return DelrissaGUID;
|
||||
case DATA_VEXALLUS_DOOR: return VexallusDoorGUID;
|
||||
case DATA_SELIN_DOOR: return SelinDoorGUID;
|
||||
case DATA_SELIN_ENCOUNTER_DOOR: return SelinEncounterDoorGUID;
|
||||
case DATA_DELRISSA_DOOR: return DelrissaDoorGUID;
|
||||
case DATA_KAEL_DOOR: return KaelDoorGUID;
|
||||
case DATA_KAEL_STATUE_LEFT: return KaelStatue[0];
|
||||
case DATA_KAEL_STATUE_RIGHT: return KaelStatue[1];
|
||||
|
||||
case DATA_FEL_CRYSTAL:
|
||||
{
|
||||
if (FelCrystals.empty())
|
||||
{
|
||||
sLog.outError("TSCR: Magisters Terrace: No Fel Crystals loaded in Inst Data");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!InitializedItr)
|
||||
{
|
||||
CrystalItr = FelCrystals.begin();
|
||||
InitializedItr = true;
|
||||
}
|
||||
|
||||
uint64 guid = *CrystalItr;
|
||||
++CrystalItr;
|
||||
return guid;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
InstanceData* GetInstanceData_instance_magisters_terrace(Map* pMap)
|
||||
{
|
||||
return new instance_magisters_terrace(pMap);
|
||||
}
|
||||
|
||||
void AddSC_instance_magisters_terrace()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "instance_magisters_terrace";
|
||||
newscript->GetInstanceData = &GetInstanceData_instance_magisters_terrace;
|
||||
newscript->RegisterSelf();
|
||||
new instance_magisters_terrace();
|
||||
}
|
||||
|
||||
|
||||
@@ -50,127 +50,129 @@ const float afKaelLandPoint[] = {225.045, -276.236, -5.434};
|
||||
#define GOSSIP_ITEM_KAEL_5 "What would Kil'jaeden want with a mortal woman?"
|
||||
|
||||
// This is friendly keal that appear after used Orb.
|
||||
// If we assume DB handle summon, summon appear somewhere outside the platform where Orb is
|
||||
struct npc_kalecgosAI : public ScriptedAI
|
||||
// If we assume DB handle summon, summon appear somewhere outside the platform where Orb is
class npc_kalecgos : public CreatureScript
|
||||
{
|
||||
npc_kalecgosAI(Creature* pCreature) : ScriptedAI(pCreature) {}
|
||||
public:
|
||||
npc_kalecgos() : CreatureScript("npc_kalecgos") { }
|
||||
|
||||
uint32 m_uiTransformTimer;
|
||||
|
||||
void Reset()
|
||||
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
|
||||
{
|
||||
m_uiTransformTimer = 0;
|
||||
|
||||
// we must assume he appear as dragon somewhere outside the platform of orb, and then move directly to here
|
||||
if (me->GetEntry() != NPC_KAEL)
|
||||
me->GetMotionMaster()->MovePoint(POINT_ID_LAND, afKaelLandPoint[0], afKaelLandPoint[1], afKaelLandPoint[2]);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 uiType, uint32 uiPointId)
|
||||
{
|
||||
if (uiType != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (uiPointId == POINT_ID_LAND)
|
||||
m_uiTransformTimer = MINUTE*IN_MILLISECONDS;
|
||||
}
|
||||
|
||||
// some targeting issues with the spell, so use this workaround as temporary solution
|
||||
void DoWorkaroundForQuestCredit()
|
||||
{
|
||||
Map* pMap = me->GetMap();
|
||||
|
||||
if (!pMap || pMap->IsHeroic())
|
||||
return;
|
||||
|
||||
Map::PlayerList const &lList = pMap->GetPlayers();
|
||||
|
||||
if (lList.isEmpty())
|
||||
return;
|
||||
|
||||
SpellEntry const* pSpell = GetSpellStore()->LookupEntry(SPELL_ORB_KILL_CREDIT);
|
||||
|
||||
for (Map::PlayerList::const_iterator i = lList.begin(); i != lList.end(); ++i)
|
||||
switch(uiAction)
|
||||
{
|
||||
if (Player* pPlayer = i->getSource())
|
||||
case GOSSIP_ACTION_INFO_DEF:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
pPlayer->SEND_GOSSIP_MENU(12500, pCreature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
pPlayer->SEND_GOSSIP_MENU(12502, pCreature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
pPlayer->SEND_GOSSIP_MENU(12606, pCreature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+3:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
|
||||
pPlayer->SEND_GOSSIP_MENU(12607, pCreature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+4:
|
||||
pPlayer->SEND_GOSSIP_MENU(12608, pCreature->GetGUID());
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
if (pCreature->isQuestGiver())
|
||||
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
|
||||
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
pPlayer->SEND_GOSSIP_MENU(12498, pCreature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
return new npc_kalecgosAI(pCreature);
|
||||
}
|
||||
|
||||
struct npc_kalecgosAI : public ScriptedAI
|
||||
{
|
||||
npc_kalecgosAI(Creature* pCreature) : ScriptedAI(pCreature) {}
|
||||
|
||||
uint32 m_uiTransformTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_uiTransformTimer = 0;
|
||||
|
||||
// we must assume he appear as dragon somewhere outside the platform of orb, and then move directly to here
|
||||
if (me->GetEntry() != NPC_KAEL)
|
||||
me->GetMotionMaster()->MovePoint(POINT_ID_LAND, afKaelLandPoint[0], afKaelLandPoint[1], afKaelLandPoint[2]);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 uiType, uint32 uiPointId)
|
||||
{
|
||||
if (uiType != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (uiPointId == POINT_ID_LAND)
|
||||
m_uiTransformTimer = MINUTE*IN_MILLISECONDS;
|
||||
}
|
||||
|
||||
// some targeting issues with the spell, so use this workaround as temporary solution
|
||||
void DoWorkaroundForQuestCredit()
|
||||
{
|
||||
Map* pMap = me->GetMap();
|
||||
|
||||
if (!pMap || pMap->IsHeroic())
|
||||
return;
|
||||
|
||||
Map::PlayerList const &lList = pMap->GetPlayers();
|
||||
|
||||
if (lList.isEmpty())
|
||||
return;
|
||||
|
||||
SpellEntry const* pSpell = GetSpellStore()->LookupEntry(SPELL_ORB_KILL_CREDIT);
|
||||
|
||||
for (Map::PlayerList::const_iterator i = lList.begin(); i != lList.end(); ++i)
|
||||
{
|
||||
if (pSpell && pSpell->EffectMiscValue[0])
|
||||
pPlayer->KilledMonsterCredit(pSpell->EffectMiscValue[0], 0);
|
||||
if (Player* pPlayer = i->getSource())
|
||||
{
|
||||
if (pSpell && pSpell->EffectMiscValue[0])
|
||||
pPlayer->KilledMonsterCredit(pSpell->EffectMiscValue[0], 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
if (m_uiTransformTimer)
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
if (m_uiTransformTimer <= uiDiff)
|
||||
if (m_uiTransformTimer)
|
||||
{
|
||||
DoCast(me, SPELL_ORB_KILL_CREDIT, false);
|
||||
DoWorkaroundForQuestCredit();
|
||||
if (m_uiTransformTimer <= uiDiff)
|
||||
{
|
||||
DoCast(me, SPELL_ORB_KILL_CREDIT, false);
|
||||
DoWorkaroundForQuestCredit();
|
||||
|
||||
// Transform and update entry, now ready for quest/read gossip
|
||||
DoCast(me, SPELL_TRANSFORM_TO_KAEL, false);
|
||||
me->UpdateEntry(NPC_KAEL);
|
||||
// Transform and update entry, now ready for quest/read gossip
|
||||
DoCast(me, SPELL_TRANSFORM_TO_KAEL, false);
|
||||
me->UpdateEntry(NPC_KAEL);
|
||||
|
||||
m_uiTransformTimer = 0;
|
||||
} else m_uiTransformTimer -= uiDiff;
|
||||
m_uiTransformTimer = 0;
|
||||
} else m_uiTransformTimer -= uiDiff;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_npc_kalecgos(Creature* pCreature)
|
||||
{
|
||||
return new npc_kalecgosAI(pCreature);
|
||||
}
|
||||
|
||||
bool GossipHello_npc_kalecgos(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
if (pCreature->isQuestGiver())
|
||||
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
|
||||
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
pPlayer->SEND_GOSSIP_MENU(12498, pCreature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect_npc_kalecgos(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
|
||||
{
|
||||
switch(uiAction)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
pPlayer->SEND_GOSSIP_MENU(12500, pCreature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
pPlayer->SEND_GOSSIP_MENU(12502, pCreature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
pPlayer->SEND_GOSSIP_MENU(12606, pCreature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+3:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
|
||||
pPlayer->SEND_GOSSIP_MENU(12607, pCreature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+4:
|
||||
pPlayer->SEND_GOSSIP_MENU(12608, pCreature->GetGUID());
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void AddSC_magisters_terrace()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_kalecgos";
|
||||
newscript->GetAI = &GetAI_npc_kalecgos;
|
||||
newscript->pGossipHello = &GossipHello_npc_kalecgos;
|
||||
newscript->pGossipSelect = &GossipSelect_npc_kalecgos;
|
||||
newscript->RegisterSelf();
|
||||
new npc_kalecgos();
|
||||
}
|
||||
|
||||
@@ -31,79 +31,81 @@ EndScriptData */
|
||||
#define SPELL_IGNITEMANA 19659
|
||||
#define SPELL_LIVINGBOMB 20475
|
||||
#define SPELL_ARMAGEDDOM 20479
|
||||
|
||||
struct boss_baron_geddonAI : public ScriptedAI
|
||||
class boss_baron_geddon : public CreatureScript
|
||||
{
|
||||
boss_baron_geddonAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_baron_geddon() : CreatureScript("boss_baron_geddon") { }
|
||||
|
||||
uint32 Inferno_Timer;
|
||||
uint32 IgniteMana_Timer;
|
||||
uint32 LivingBomb_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
Inferno_Timer = 45000; //These times are probably wrong
|
||||
IgniteMana_Timer = 30000;
|
||||
LivingBomb_Timer = 35000;
|
||||
return new boss_baron_geddonAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_baron_geddonAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_baron_geddonAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 Inferno_Timer;
|
||||
uint32 IgniteMana_Timer;
|
||||
uint32 LivingBomb_Timer;
|
||||
|
||||
//If we are <2% hp cast Armageddom
|
||||
if (me->GetHealth()*100 / me->GetMaxHealth() <= 2)
|
||||
void Reset()
|
||||
{
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
DoCast(me, SPELL_ARMAGEDDOM);
|
||||
DoScriptText(EMOTE_SERVICE, me);
|
||||
return;
|
||||
Inferno_Timer = 45000; //These times are probably wrong
|
||||
IgniteMana_Timer = 30000;
|
||||
LivingBomb_Timer = 35000;
|
||||
}
|
||||
|
||||
//Inferno_Timer
|
||||
if (Inferno_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me, SPELL_INFERNO);
|
||||
Inferno_Timer = 45000;
|
||||
} else Inferno_Timer -= diff;
|
||||
}
|
||||
|
||||
//IgniteMana_Timer
|
||||
if (IgniteMana_Timer <= diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
|
||||
DoCast(pTarget, SPELL_IGNITEMANA);
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
IgniteMana_Timer = 30000;
|
||||
} else IgniteMana_Timer -= diff;
|
||||
//If we are <2% hp cast Armageddom
|
||||
if (me->GetHealth()*100 / me->GetMaxHealth() <= 2)
|
||||
{
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
DoCast(me, SPELL_ARMAGEDDOM);
|
||||
DoScriptText(EMOTE_SERVICE, me);
|
||||
return;
|
||||
}
|
||||
|
||||
//LivingBomb_Timer
|
||||
if (LivingBomb_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
|
||||
DoCast(pTarget, SPELL_LIVINGBOMB);
|
||||
//Inferno_Timer
|
||||
if (Inferno_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_INFERNO);
|
||||
Inferno_Timer = 45000;
|
||||
} else Inferno_Timer -= diff;
|
||||
|
||||
LivingBomb_Timer = 35000;
|
||||
} else LivingBomb_Timer -= diff;
|
||||
//IgniteMana_Timer
|
||||
if (IgniteMana_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
|
||||
DoCast(pTarget, SPELL_IGNITEMANA);
|
||||
|
||||
IgniteMana_Timer = 30000;
|
||||
} else IgniteMana_Timer -= diff;
|
||||
|
||||
//LivingBomb_Timer
|
||||
if (LivingBomb_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
|
||||
DoCast(pTarget, SPELL_LIVINGBOMB);
|
||||
|
||||
LivingBomb_Timer = 35000;
|
||||
} else LivingBomb_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_baron_geddon(Creature* pCreature)
|
||||
{
|
||||
return new boss_baron_geddonAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_baron_geddon()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_baron_geddon";
|
||||
newscript->GetAI = &GetAI_boss_baron_geddon;
|
||||
newscript->RegisterSelf();
|
||||
new boss_baron_geddon();
|
||||
}
|
||||
|
||||
|
||||
@@ -33,113 +33,117 @@ EndScriptData */
|
||||
//Add spells
|
||||
#define SPELL_ERUPTION 19497
|
||||
#define SPELL_IMMOLATE 20294
|
||||
|
||||
struct boss_garrAI : public ScriptedAI
|
||||
class boss_garr : public CreatureScript
|
||||
{
|
||||
boss_garrAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_garr() : CreatureScript("boss_garr") { }
|
||||
|
||||
uint32 AntiMagicPulse_Timer;
|
||||
uint32 MagmaShackles_Timer;
|
||||
uint32 CheckAdds_Timer;
|
||||
uint64 Add[8];
|
||||
bool Enraged[8];
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
AntiMagicPulse_Timer = 25000; //These times are probably wrong
|
||||
MagmaShackles_Timer = 15000;
|
||||
CheckAdds_Timer = 2000;
|
||||
return new boss_garrAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_garrAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_garrAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 AntiMagicPulse_Timer;
|
||||
uint32 MagmaShackles_Timer;
|
||||
uint32 CheckAdds_Timer;
|
||||
uint64 Add[8];
|
||||
bool Enraged[8];
|
||||
|
||||
//AntiMagicPulse_Timer
|
||||
if (AntiMagicPulse_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me, SPELL_ANTIMAGICPULSE);
|
||||
AntiMagicPulse_Timer = 10000 + rand()%5000;
|
||||
} else AntiMagicPulse_Timer -= diff;
|
||||
|
||||
//MagmaShackles_Timer
|
||||
if (MagmaShackles_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_MAGMASHACKLES);
|
||||
MagmaShackles_Timer = 8000 + rand()%4000;
|
||||
} else MagmaShackles_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
struct mob_fireswornAI : public ScriptedAI
|
||||
{
|
||||
mob_fireswornAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
uint32 Immolate_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Immolate_Timer = 4000; //These times are probably wrong
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Immolate_Timer
|
||||
if (Immolate_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
|
||||
DoCast(pTarget, SPELL_IMMOLATE);
|
||||
|
||||
Immolate_Timer = urand(5000,10000);
|
||||
} else Immolate_Timer -= diff;
|
||||
|
||||
//Cast Erruption and let them die
|
||||
if (me->GetHealth() <= me->GetMaxHealth() * 0.10)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_ERUPTION);
|
||||
me->setDeathState(JUST_DIED);
|
||||
me->RemoveCorpse();
|
||||
AntiMagicPulse_Timer = 25000; //These times are probably wrong
|
||||
MagmaShackles_Timer = 15000;
|
||||
CheckAdds_Timer = 2000;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_garr(Creature* pCreature)
|
||||
{
|
||||
return new boss_garrAI (pCreature);
|
||||
}
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_mob_firesworn(Creature* pCreature)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//AntiMagicPulse_Timer
|
||||
if (AntiMagicPulse_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_ANTIMAGICPULSE);
|
||||
AntiMagicPulse_Timer = 10000 + rand()%5000;
|
||||
} else AntiMagicPulse_Timer -= diff;
|
||||
|
||||
//MagmaShackles_Timer
|
||||
if (MagmaShackles_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_MAGMASHACKLES);
|
||||
MagmaShackles_Timer = 8000 + rand()%4000;
|
||||
} else MagmaShackles_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
class mob_firesworn : public CreatureScript
|
||||
{
|
||||
return new mob_fireswornAI (pCreature);
|
||||
}
|
||||
public:
|
||||
mob_firesworn() : CreatureScript("mob_firesworn") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
return new mob_fireswornAI (pCreature);
|
||||
}
|
||||
|
||||
struct mob_fireswornAI : public ScriptedAI
|
||||
{
|
||||
mob_fireswornAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
uint32 Immolate_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Immolate_Timer = 4000; //These times are probably wrong
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Immolate_Timer
|
||||
if (Immolate_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
|
||||
DoCast(pTarget, SPELL_IMMOLATE);
|
||||
|
||||
Immolate_Timer = urand(5000,10000);
|
||||
} else Immolate_Timer -= diff;
|
||||
|
||||
//Cast Erruption and let them die
|
||||
if (me->GetHealth() <= me->GetMaxHealth() * 0.10)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_ERUPTION);
|
||||
me->setDeathState(JUST_DIED);
|
||||
me->RemoveCorpse();
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
void AddSC_boss_garr()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_garr";
|
||||
newscript->GetAI = &GetAI_boss_garr;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_firesworn";
|
||||
newscript->GetAI = &GetAI_mob_firesworn;
|
||||
newscript->RegisterSelf();
|
||||
new boss_garr();
|
||||
new mob_firesworn();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,68 +28,70 @@ EndScriptData */
|
||||
#define SPELL_SHADOWBOLT 19728
|
||||
#define SPELL_RAINOFFIRE 19717
|
||||
#define SPELL_GEHENNASCURSE 19716
|
||||
|
||||
struct boss_gehennasAI : public ScriptedAI
|
||||
class boss_gehennas : public CreatureScript
|
||||
{
|
||||
boss_gehennasAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_gehennas() : CreatureScript("boss_gehennas") { }
|
||||
|
||||
uint32 ShadowBolt_Timer;
|
||||
uint32 RainOfFire_Timer;
|
||||
uint32 GehennasCurse_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
ShadowBolt_Timer = 6000;
|
||||
RainOfFire_Timer = 10000;
|
||||
GehennasCurse_Timer = 12000;
|
||||
return new boss_gehennasAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
struct boss_gehennasAI : public ScriptedAI
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
boss_gehennasAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
//ShadowBolt_Timer
|
||||
if (ShadowBolt_Timer <= diff)
|
||||
uint32 ShadowBolt_Timer;
|
||||
uint32 RainOfFire_Timer;
|
||||
uint32 GehennasCurse_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1))
|
||||
DoCast(pTarget, SPELL_SHADOWBOLT);
|
||||
ShadowBolt_Timer = 6000;
|
||||
RainOfFire_Timer = 10000;
|
||||
GehennasCurse_Timer = 12000;
|
||||
}
|
||||
|
||||
ShadowBolt_Timer = 7000;
|
||||
} else ShadowBolt_Timer -= diff;
|
||||
void EnterCombat(Unit * /*who*/) {}
|
||||
|
||||
//RainOfFire_Timer
|
||||
if (RainOfFire_Timer <= diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_RAINOFFIRE);
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
RainOfFire_Timer = urand(4000,12000);
|
||||
} else RainOfFire_Timer -= diff;
|
||||
//ShadowBolt_Timer
|
||||
if (ShadowBolt_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1))
|
||||
DoCast(pTarget, SPELL_SHADOWBOLT);
|
||||
|
||||
//GehennasCurse_Timer
|
||||
if (GehennasCurse_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_GEHENNASCURSE);
|
||||
GehennasCurse_Timer = urand(22000,30000);
|
||||
} else GehennasCurse_Timer -= diff;
|
||||
ShadowBolt_Timer = 7000;
|
||||
} else ShadowBolt_Timer -= diff;
|
||||
|
||||
//RainOfFire_Timer
|
||||
if (RainOfFire_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_RAINOFFIRE);
|
||||
|
||||
RainOfFire_Timer = urand(4000,12000);
|
||||
} else RainOfFire_Timer -= diff;
|
||||
|
||||
//GehennasCurse_Timer
|
||||
if (GehennasCurse_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_GEHENNASCURSE);
|
||||
GehennasCurse_Timer = urand(22000,30000);
|
||||
} else GehennasCurse_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_gehennas(Creature* pCreature)
|
||||
{
|
||||
return new boss_gehennasAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_gehennas()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_gehennas";
|
||||
newscript->GetAI = &GetAI_boss_gehennas;
|
||||
newscript->RegisterSelf();
|
||||
new boss_gehennas();
|
||||
}
|
||||
|
||||
|
||||
@@ -38,163 +38,167 @@ enum eEnums
|
||||
EMOTE_LOWHP = -1409002,
|
||||
SPELL_MANGLE = 19820
|
||||
};
|
||||
|
||||
struct boss_golemaggAI : public ScriptedAI
|
||||
class boss_golemagg : public CreatureScript
|
||||
{
|
||||
boss_golemaggAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
public:
|
||||
boss_golemagg() : CreatureScript("boss_golemagg") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
m_pInstance = pCreature->GetInstanceData();
|
||||
return new boss_golemaggAI (pCreature);
|
||||
}
|
||||
|
||||
ScriptedInstance* m_pInstance;
|
||||
|
||||
uint32 m_uiPyroblastTimer;
|
||||
uint32 m_uiEarthquakeTimer;
|
||||
uint32 m_uiBuffTimer;
|
||||
bool m_bEnraged;
|
||||
|
||||
void Reset()
|
||||
struct boss_golemaggAI : public ScriptedAI
|
||||
{
|
||||
m_uiPyroblastTimer = 7*IN_MILLISECONDS; // These timers are probably wrong
|
||||
m_uiEarthquakeTimer = 3*IN_MILLISECONDS;
|
||||
m_uiBuffTimer = 2.5*IN_MILLISECONDS;
|
||||
m_bEnraged = false;
|
||||
|
||||
DoCast(me, SPELL_MAGMASPLASH, true);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*pKiller*/)
|
||||
{
|
||||
if (m_pInstance)
|
||||
m_pInstance->SetData(DATA_GOLEMAGG_DEATH, 0);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Pyroblast
|
||||
if (m_uiPyroblastTimer <= uiDiff)
|
||||
boss_golemaggAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_PYROBLAST);
|
||||
|
||||
m_uiPyroblastTimer = 7*IN_MILLISECONDS;
|
||||
}
|
||||
else
|
||||
m_uiPyroblastTimer -= uiDiff;
|
||||
|
||||
// Enrage
|
||||
if (!m_bEnraged && me->GetHealth()*100 < me->GetMaxHealth()*10)
|
||||
{
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
m_bEnraged = true;
|
||||
m_pInstance = pCreature->GetInstanceScript();
|
||||
}
|
||||
|
||||
// Earthquake
|
||||
if (m_bEnraged)
|
||||
{
|
||||
if (m_uiEarthquakeTimer <= uiDiff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_EARTHQUAKE);
|
||||
m_uiEarthquakeTimer = 3*IN_MILLISECONDS;
|
||||
}
|
||||
else
|
||||
m_uiEarthquakeTimer -= uiDiff;
|
||||
}
|
||||
InstanceScript* m_pInstance;
|
||||
|
||||
/*
|
||||
// Golemagg's Trust
|
||||
if (m_uiBuffTimer <= uidiff)
|
||||
uint32 m_uiPyroblastTimer;
|
||||
uint32 m_uiEarthquakeTimer;
|
||||
uint32 m_uiBuffTimer;
|
||||
bool m_bEnraged;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me, SPELL_GOLEMAGG_TRUST);
|
||||
m_uiPyroblastTimer = 7*IN_MILLISECONDS; // These timers are probably wrong
|
||||
m_uiEarthquakeTimer = 3*IN_MILLISECONDS;
|
||||
m_uiBuffTimer = 2.5*IN_MILLISECONDS;
|
||||
m_bEnraged = false;
|
||||
|
||||
DoCast(me, SPELL_MAGMASPLASH, true);
|
||||
}
|
||||
else
|
||||
m_uiBuffTimer -= uiDiff;
|
||||
*/
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
struct mob_core_ragerAI : public ScriptedAI
|
||||
{
|
||||
mob_core_ragerAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
m_pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* m_pInstance;
|
||||
|
||||
uint32 m_uiMangleTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_uiMangleTimer = 7*IN_MILLISECONDS; // These times are probably wrong
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* /*pDoneBy*/, uint32& uiDamage)
|
||||
{
|
||||
if (me->GetHealth()*100 < me->GetMaxHealth()*50)
|
||||
void JustDied(Unit* /*pKiller*/)
|
||||
{
|
||||
if (m_pInstance)
|
||||
m_pInstance->SetData(DATA_GOLEMAGG_DEATH, 0);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Pyroblast
|
||||
if (m_uiPyroblastTimer <= uiDiff)
|
||||
{
|
||||
if (Creature* pGolemagg = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_GOLEMAGG)))
|
||||
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_PYROBLAST);
|
||||
|
||||
m_uiPyroblastTimer = 7*IN_MILLISECONDS;
|
||||
}
|
||||
else
|
||||
m_uiPyroblastTimer -= uiDiff;
|
||||
|
||||
// Enrage
|
||||
if (!m_bEnraged && me->GetHealth()*100 < me->GetMaxHealth()*10)
|
||||
{
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
m_bEnraged = true;
|
||||
}
|
||||
|
||||
// Earthquake
|
||||
if (m_bEnraged)
|
||||
{
|
||||
if (m_uiEarthquakeTimer <= uiDiff)
|
||||
{
|
||||
if (pGolemagg->isAlive())
|
||||
DoCast(me->getVictim(), SPELL_EARTHQUAKE);
|
||||
m_uiEarthquakeTimer = 3*IN_MILLISECONDS;
|
||||
}
|
||||
else
|
||||
m_uiEarthquakeTimer -= uiDiff;
|
||||
}
|
||||
|
||||
/*
|
||||
// Golemagg's Trust
|
||||
if (m_uiBuffTimer <= uidiff)
|
||||
{
|
||||
DoCast(me, SPELL_GOLEMAGG_TRUST);
|
||||
m_uiBuffTimer = 2.5*IN_MILLISECONDS;
|
||||
}
|
||||
else
|
||||
m_uiBuffTimer -= uiDiff;
|
||||
*/
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
class mob_core_rager : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_core_rager() : CreatureScript("mob_core_rager") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
return new mob_core_ragerAI (pCreature);
|
||||
}
|
||||
|
||||
struct mob_core_ragerAI : public ScriptedAI
|
||||
{
|
||||
mob_core_ragerAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
m_pInstance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* m_pInstance;
|
||||
|
||||
uint32 m_uiMangleTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_uiMangleTimer = 7*IN_MILLISECONDS; // These times are probably wrong
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* /*pDoneBy*/, uint32& uiDamage)
|
||||
{
|
||||
if (me->GetHealth()*100 < me->GetMaxHealth()*50)
|
||||
{
|
||||
if (m_pInstance)
|
||||
{
|
||||
if (Creature* pGolemagg = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_GOLEMAGG)))
|
||||
{
|
||||
DoScriptText(EMOTE_LOWHP, me);
|
||||
me->SetHealth(me->GetMaxHealth());
|
||||
if (pGolemagg->isAlive())
|
||||
{
|
||||
DoScriptText(EMOTE_LOWHP, me);
|
||||
me->SetHealth(me->GetMaxHealth());
|
||||
}
|
||||
else
|
||||
uiDamage = me->GetHealth();
|
||||
}
|
||||
else
|
||||
uiDamage = me->GetHealth();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
// Mangle
|
||||
if (m_uiMangleTimer <= uiDiff)
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_MANGLE);
|
||||
m_uiMangleTimer = 10*IN_MILLISECONDS;
|
||||
}
|
||||
else
|
||||
m_uiMangleTimer -= uiDiff;
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
// Mangle
|
||||
if (m_uiMangleTimer <= uiDiff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_MANGLE);
|
||||
m_uiMangleTimer = 10*IN_MILLISECONDS;
|
||||
}
|
||||
else
|
||||
m_uiMangleTimer -= uiDiff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_golemagg(Creature* pCreature)
|
||||
{
|
||||
return new boss_golemaggAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_mob_core_rager(Creature* pCreature)
|
||||
{
|
||||
return new mob_core_ragerAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_golemagg()
|
||||
{
|
||||
Script* newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_golemagg";
|
||||
newscript->GetAI = &GetAI_boss_golemagg;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_core_rager";
|
||||
newscript->GetAI = &GetAI_mob_core_rager;
|
||||
newscript->RegisterSelf();
|
||||
new boss_golemagg();
|
||||
new mob_core_rager();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,66 +28,68 @@ EndScriptData */
|
||||
#define SPELL_IMPENDINGDOOM 19702
|
||||
#define SPELL_LUCIFRONCURSE 19703
|
||||
#define SPELL_SHADOWSHOCK 20603
|
||||
|
||||
struct boss_lucifronAI : public ScriptedAI
|
||||
class boss_lucifron : public CreatureScript
|
||||
{
|
||||
boss_lucifronAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_lucifron() : CreatureScript("boss_lucifron") { }
|
||||
|
||||
uint32 ImpendingDoom_Timer;
|
||||
uint32 LucifronCurse_Timer;
|
||||
uint32 ShadowShock_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
ImpendingDoom_Timer = 10000; //Initial cast after 10 seconds so the debuffs alternate
|
||||
LucifronCurse_Timer = 20000; //Initial cast after 20 seconds
|
||||
ShadowShock_Timer = 6000; //6 seconds
|
||||
return new boss_lucifronAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_lucifronAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_lucifronAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 ImpendingDoom_Timer;
|
||||
uint32 LucifronCurse_Timer;
|
||||
uint32 ShadowShock_Timer;
|
||||
|
||||
//Impending doom timer
|
||||
if (ImpendingDoom_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_IMPENDINGDOOM);
|
||||
ImpendingDoom_Timer = 20000;
|
||||
} else ImpendingDoom_Timer -= diff;
|
||||
ImpendingDoom_Timer = 10000; //Initial cast after 10 seconds so the debuffs alternate
|
||||
LucifronCurse_Timer = 20000; //Initial cast after 20 seconds
|
||||
ShadowShock_Timer = 6000; //6 seconds
|
||||
}
|
||||
|
||||
//Lucifron's curse timer
|
||||
if (LucifronCurse_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_LUCIFRONCURSE);
|
||||
LucifronCurse_Timer = 15000;
|
||||
} else LucifronCurse_Timer -= diff;
|
||||
}
|
||||
|
||||
//Shadowshock
|
||||
if (ShadowShock_Timer <= diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWSHOCK);
|
||||
ShadowShock_Timer = 6000;
|
||||
} else ShadowShock_Timer -= diff;
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Impending doom timer
|
||||
if (ImpendingDoom_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_IMPENDINGDOOM);
|
||||
ImpendingDoom_Timer = 20000;
|
||||
} else ImpendingDoom_Timer -= diff;
|
||||
|
||||
//Lucifron's curse timer
|
||||
if (LucifronCurse_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_LUCIFRONCURSE);
|
||||
LucifronCurse_Timer = 15000;
|
||||
} else LucifronCurse_Timer -= diff;
|
||||
|
||||
//Shadowshock
|
||||
if (ShadowShock_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWSHOCK);
|
||||
ShadowShock_Timer = 6000;
|
||||
} else ShadowShock_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_lucifron(Creature* pCreature)
|
||||
{
|
||||
return new boss_lucifronAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_lucifron()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_lucifron";
|
||||
newscript->GetAI = &GetAI_boss_lucifron;
|
||||
newscript->RegisterSelf();
|
||||
new boss_lucifron();
|
||||
}
|
||||
|
||||
|
||||
@@ -32,71 +32,73 @@ EndScriptData */
|
||||
#define SPELL_PANIC 19408
|
||||
#define SPELL_LAVABOMB 19411 //This calls a dummy server side effect that isn't implemented yet
|
||||
#define SPELL_LAVABOMB_ALT 19428 //This is the spell that the lava bomb casts
|
||||
|
||||
struct boss_magmadarAI : public ScriptedAI
|
||||
class boss_magmadar : public CreatureScript
|
||||
{
|
||||
boss_magmadarAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_magmadar() : CreatureScript("boss_magmadar") { }
|
||||
|
||||
uint32 Frenzy_Timer;
|
||||
uint32 Panic_Timer;
|
||||
uint32 Lavabomb_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
Frenzy_Timer = 30000;
|
||||
Panic_Timer = 20000;
|
||||
Lavabomb_Timer = 12000;
|
||||
|
||||
DoCast(me, SPELL_MAGMASPIT, true);
|
||||
return new boss_magmadarAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_magmadarAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_magmadarAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 Frenzy_Timer;
|
||||
uint32 Panic_Timer;
|
||||
uint32 Lavabomb_Timer;
|
||||
|
||||
//Frenzy_Timer
|
||||
if (Frenzy_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoScriptText(EMOTE_FRENZY, me);
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
Frenzy_Timer = 15000;
|
||||
} else Frenzy_Timer -= diff;
|
||||
|
||||
//Panic_Timer
|
||||
if (Panic_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_PANIC);
|
||||
Panic_Timer = 35000;
|
||||
} else Panic_Timer -= diff;
|
||||
|
||||
//Lavabomb_Timer
|
||||
if (Lavabomb_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
|
||||
DoCast(pTarget, SPELL_LAVABOMB_ALT);
|
||||
|
||||
Frenzy_Timer = 30000;
|
||||
Panic_Timer = 20000;
|
||||
Lavabomb_Timer = 12000;
|
||||
} else Lavabomb_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
DoCast(me, SPELL_MAGMASPIT, true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Frenzy_Timer
|
||||
if (Frenzy_Timer <= diff)
|
||||
{
|
||||
DoScriptText(EMOTE_FRENZY, me);
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
Frenzy_Timer = 15000;
|
||||
} else Frenzy_Timer -= diff;
|
||||
|
||||
//Panic_Timer
|
||||
if (Panic_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_PANIC);
|
||||
Panic_Timer = 35000;
|
||||
} else Panic_Timer -= diff;
|
||||
|
||||
//Lavabomb_Timer
|
||||
if (Lavabomb_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
|
||||
DoCast(pTarget, SPELL_LAVABOMB_ALT);
|
||||
|
||||
Lavabomb_Timer = 12000;
|
||||
} else Lavabomb_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
CreatureAI* GetAI_boss_magmadar(Creature* pCreature)
|
||||
{
|
||||
return new boss_magmadarAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_magmadar()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_magmadar";
|
||||
newscript->GetAI = &GetAI_boss_magmadar;
|
||||
newscript->RegisterSelf();
|
||||
new boss_magmadar();
|
||||
}
|
||||
|
||||
|
||||
@@ -52,85 +52,87 @@ EndScriptData */
|
||||
|
||||
#define ENTRY_FLAMEWALKER_HEALER 11663
|
||||
#define ENTRY_FLAMEWALKER_ELITE 11664
|
||||
|
||||
struct boss_majordomoAI : public ScriptedAI
|
||||
class boss_majordomo : public CreatureScript
|
||||
{
|
||||
boss_majordomoAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_majordomo() : CreatureScript("boss_majordomo") { }
|
||||
|
||||
uint32 MagicReflection_Timer;
|
||||
uint32 DamageReflection_Timer;
|
||||
uint32 Blastwave_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
MagicReflection_Timer = 30000; //Damage reflection first so we alternate
|
||||
DamageReflection_Timer = 15000;
|
||||
Blastwave_Timer = 10000;
|
||||
return new boss_majordomoAI (pCreature);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
struct boss_majordomoAI : public ScriptedAI
|
||||
{
|
||||
if (rand()%5)
|
||||
return;
|
||||
boss_majordomoAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
DoScriptText(SAY_SLAY, me);
|
||||
}
|
||||
uint32 MagicReflection_Timer;
|
||||
uint32 DamageReflection_Timer;
|
||||
uint32 Blastwave_Timer;
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Cast Ageis if less than 50% hp
|
||||
if (me->GetHealth()*100 / me->GetMaxHealth() < 50)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me, SPELL_AEGIS);
|
||||
MagicReflection_Timer = 30000; //Damage reflection first so we alternate
|
||||
DamageReflection_Timer = 15000;
|
||||
Blastwave_Timer = 10000;
|
||||
}
|
||||
|
||||
//MagicReflection_Timer
|
||||
// if (MagicReflection_Timer <= diff)
|
||||
// {
|
||||
// DoCast(me, SPELL_MAGICREFLECTION);
|
||||
|
||||
//60 seconds until we should cast this agian
|
||||
// MagicReflection_Timer = 30000;
|
||||
// } else MagicReflection_Timer -= diff;
|
||||
|
||||
//DamageReflection_Timer
|
||||
// if (DamageReflection_Timer <= diff)
|
||||
// {
|
||||
// DoCast(me, SPELL_DAMAGEREFLECTION);
|
||||
|
||||
//60 seconds until we should cast this agian
|
||||
// DamageReflection_Timer = 30000;
|
||||
// } else DamageReflection_Timer -= diff;
|
||||
|
||||
//Blastwave_Timer
|
||||
if (Blastwave_Timer <= diff)
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_BLASTWAVE);
|
||||
Blastwave_Timer = 10000;
|
||||
} else Blastwave_Timer -= diff;
|
||||
if (rand()%5)
|
||||
return;
|
||||
|
||||
DoScriptText(SAY_SLAY, me);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Cast Ageis if less than 50% hp
|
||||
if (me->GetHealth()*100 / me->GetMaxHealth() < 50)
|
||||
{
|
||||
DoCast(me, SPELL_AEGIS);
|
||||
}
|
||||
|
||||
//MagicReflection_Timer
|
||||
// if (MagicReflection_Timer <= diff)
|
||||
// {
|
||||
// DoCast(me, SPELL_MAGICREFLECTION);
|
||||
|
||||
//60 seconds until we should cast this agian
|
||||
// MagicReflection_Timer = 30000;
|
||||
// } else MagicReflection_Timer -= diff;
|
||||
|
||||
//DamageReflection_Timer
|
||||
// if (DamageReflection_Timer <= diff)
|
||||
// {
|
||||
// DoCast(me, SPELL_DAMAGEREFLECTION);
|
||||
|
||||
//60 seconds until we should cast this agian
|
||||
// DamageReflection_Timer = 30000;
|
||||
// } else DamageReflection_Timer -= diff;
|
||||
|
||||
//Blastwave_Timer
|
||||
if (Blastwave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_BLASTWAVE);
|
||||
Blastwave_Timer = 10000;
|
||||
} else Blastwave_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_majordomo(Creature* pCreature)
|
||||
{
|
||||
return new boss_majordomoAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_majordomo()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_majordomo";
|
||||
newscript->GetAI = &GetAI_boss_majordomo;
|
||||
newscript->RegisterSelf();
|
||||
new boss_majordomo();
|
||||
}
|
||||
|
||||
|
||||
@@ -84,216 +84,218 @@ EndScriptData */
|
||||
#define ADD_8Y -810.869385
|
||||
#define ADD_8Z -229.683182
|
||||
#define ADD_8O 4.693108
|
||||
|
||||
struct boss_ragnarosAI : public ScriptedAI
|
||||
class boss_ragnaros : public CreatureScript
|
||||
{
|
||||
boss_ragnarosAI(Creature *c) : ScriptedAI(c)
|
||||
public:
|
||||
boss_ragnaros() : CreatureScript("boss_ragnaros") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
SetCombatMovement(false);
|
||||
return new boss_ragnarosAI (pCreature);
|
||||
}
|
||||
|
||||
uint32 WrathOfRagnaros_Timer;
|
||||
uint32 HandOfRagnaros_Timer;
|
||||
uint32 LavaBurst_Timer;
|
||||
uint32 MagmaBurst_Timer;
|
||||
uint32 ElementalFire_Timer;
|
||||
uint32 Erruption_Timer;
|
||||
uint32 Submerge_Timer;
|
||||
uint32 Attack_Timer;
|
||||
|
||||
bool HasYelledMagmaBurst;
|
||||
bool HasSubmergedOnce;
|
||||
bool WasBanished;
|
||||
bool HasAura;
|
||||
|
||||
void Reset()
|
||||
struct boss_ragnarosAI : public ScriptedAI
|
||||
{
|
||||
WrathOfRagnaros_Timer = 30000;
|
||||
HandOfRagnaros_Timer = 25000;
|
||||
LavaBurst_Timer = 10000;
|
||||
MagmaBurst_Timer = 2000;
|
||||
Erruption_Timer = 15000;
|
||||
ElementalFire_Timer = 3000;
|
||||
Submerge_Timer = 180000;
|
||||
Attack_Timer = 90000;
|
||||
HasYelledMagmaBurst = false;
|
||||
HasSubmergedOnce = false;
|
||||
WasBanished = false;
|
||||
|
||||
DoCast(me, SPELL_MELTWEAPON, true);
|
||||
HasAura = true;
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (rand()%5)
|
||||
return;
|
||||
|
||||
DoScriptText(SAY_KILL, me);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (WasBanished && Attack_Timer <= diff)
|
||||
boss_ragnarosAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
//Become unbanished again
|
||||
me->setFaction(14);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
DoCast(me, SPELL_RAGEMERGE);
|
||||
WasBanished = false;
|
||||
} else if (WasBanished)
|
||||
{
|
||||
Attack_Timer -= diff;
|
||||
//Do nothing while banished
|
||||
return;
|
||||
SetCombatMovement(false);
|
||||
}
|
||||
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 WrathOfRagnaros_Timer;
|
||||
uint32 HandOfRagnaros_Timer;
|
||||
uint32 LavaBurst_Timer;
|
||||
uint32 MagmaBurst_Timer;
|
||||
uint32 ElementalFire_Timer;
|
||||
uint32 Erruption_Timer;
|
||||
uint32 Submerge_Timer;
|
||||
uint32 Attack_Timer;
|
||||
|
||||
//WrathOfRagnaros_Timer
|
||||
if (WrathOfRagnaros_Timer <= diff)
|
||||
bool HasYelledMagmaBurst;
|
||||
bool HasSubmergedOnce;
|
||||
bool WasBanished;
|
||||
bool HasAura;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WRATHOFRAGNAROS);
|
||||
|
||||
if (urand(0,1))
|
||||
DoScriptText(SAY_WRATH, me);
|
||||
|
||||
WrathOfRagnaros_Timer = 30000;
|
||||
} else WrathOfRagnaros_Timer -= diff;
|
||||
|
||||
//HandOfRagnaros_Timer
|
||||
if (HandOfRagnaros_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_HANDOFRAGNAROS);
|
||||
|
||||
if (urand(0,1))
|
||||
DoScriptText(SAY_HAND, me);
|
||||
|
||||
HandOfRagnaros_Timer = 25000;
|
||||
} else HandOfRagnaros_Timer -= diff;
|
||||
|
||||
//LavaBurst_Timer
|
||||
if (LavaBurst_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_LAVABURST);
|
||||
LavaBurst_Timer = 10000;
|
||||
} else LavaBurst_Timer -= diff;
|
||||
MagmaBurst_Timer = 2000;
|
||||
Erruption_Timer = 15000;
|
||||
ElementalFire_Timer = 3000;
|
||||
Submerge_Timer = 180000;
|
||||
Attack_Timer = 90000;
|
||||
HasYelledMagmaBurst = false;
|
||||
HasSubmergedOnce = false;
|
||||
WasBanished = false;
|
||||
|
||||
//Erruption_Timer
|
||||
if (LavaBurst_Timer <= diff)
|
||||
DoCast(me, SPELL_MELTWEAPON, true);
|
||||
HasAura = true;
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_ERRUPTION);
|
||||
Erruption_Timer = urand(20000,45000);
|
||||
} else Erruption_Timer -= diff;
|
||||
if (rand()%5)
|
||||
return;
|
||||
|
||||
//ElementalFire_Timer
|
||||
if (ElementalFire_Timer <= diff)
|
||||
DoScriptText(SAY_KILL, me);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_ELEMENTALFIRE);
|
||||
ElementalFire_Timer = urand(10000,14000);
|
||||
} else ElementalFire_Timer -= diff;
|
||||
}
|
||||
|
||||
//Submerge_Timer
|
||||
if (!WasBanished && Submerge_Timer <= diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Creature spawning and ragnaros becomming unattackable
|
||||
//is not very well supported in the core
|
||||
//so added normaly spawning and banish workaround and attack again after 90 secs.
|
||||
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
//Root self
|
||||
DoCast(me, 23973);
|
||||
me->setFaction(35);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
|
||||
|
||||
if (!HasSubmergedOnce)
|
||||
if (WasBanished && Attack_Timer <= diff)
|
||||
{
|
||||
DoScriptText(SAY_REINFORCEMENTS1, me);
|
||||
//Become unbanished again
|
||||
me->setFaction(14);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
DoCast(me, SPELL_RAGEMERGE);
|
||||
WasBanished = false;
|
||||
} else if (WasBanished)
|
||||
{
|
||||
Attack_Timer -= diff;
|
||||
//Do nothing while banished
|
||||
return;
|
||||
}
|
||||
|
||||
// summon 10 elementals
|
||||
for (uint8 i = 0; i < 9; ++i)
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//WrathOfRagnaros_Timer
|
||||
if (WrathOfRagnaros_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WRATHOFRAGNAROS);
|
||||
|
||||
if (urand(0,1))
|
||||
DoScriptText(SAY_WRATH, me);
|
||||
|
||||
WrathOfRagnaros_Timer = 30000;
|
||||
} else WrathOfRagnaros_Timer -= diff;
|
||||
|
||||
//HandOfRagnaros_Timer
|
||||
if (HandOfRagnaros_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_HANDOFRAGNAROS);
|
||||
|
||||
if (urand(0,1))
|
||||
DoScriptText(SAY_HAND, me);
|
||||
|
||||
HandOfRagnaros_Timer = 25000;
|
||||
} else HandOfRagnaros_Timer -= diff;
|
||||
|
||||
//LavaBurst_Timer
|
||||
if (LavaBurst_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_LAVABURST);
|
||||
LavaBurst_Timer = 10000;
|
||||
} else LavaBurst_Timer -= diff;
|
||||
|
||||
//Erruption_Timer
|
||||
if (LavaBurst_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_ERRUPTION);
|
||||
Erruption_Timer = urand(20000,45000);
|
||||
} else Erruption_Timer -= diff;
|
||||
|
||||
//ElementalFire_Timer
|
||||
if (ElementalFire_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_ELEMENTALFIRE);
|
||||
ElementalFire_Timer = urand(10000,14000);
|
||||
} else ElementalFire_Timer -= diff;
|
||||
|
||||
//Submerge_Timer
|
||||
if (!WasBanished && Submerge_Timer <= diff)
|
||||
{
|
||||
//Creature spawning and ragnaros becomming unattackable
|
||||
//is not very well supported in the core
|
||||
//so added normaly spawning and banish workaround and attack again after 90 secs.
|
||||
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
//Root self
|
||||
DoCast(me, 23973);
|
||||
me->setFaction(35);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
|
||||
|
||||
if (!HasSubmergedOnce)
|
||||
{
|
||||
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
|
||||
DoScriptText(SAY_REINFORCEMENTS1, me);
|
||||
|
||||
// summon 10 elementals
|
||||
for (uint8 i = 0; i < 9; ++i)
|
||||
{
|
||||
if (Creature* pSummoned = me->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000))
|
||||
pSummoned->AI()->AttackStart(pTarget);
|
||||
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
|
||||
{
|
||||
if (Creature* pSummoned = me->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000))
|
||||
pSummoned->AI()->AttackStart(pTarget);
|
||||
}
|
||||
}
|
||||
|
||||
HasSubmergedOnce = true;
|
||||
WasBanished = true;
|
||||
DoCast(me, SPELL_RAGSUBMERGE);
|
||||
Attack_Timer = 90000;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
DoScriptText(SAY_REINFORCEMENTS2, me);
|
||||
|
||||
for (uint8 i = 0; i < 9; ++i)
|
||||
{
|
||||
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
|
||||
{
|
||||
if (Creature* pSummoned = me->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000))
|
||||
pSummoned->AI()->AttackStart(pTarget);
|
||||
}
|
||||
}
|
||||
|
||||
WasBanished = true;
|
||||
DoCast(me, SPELL_RAGSUBMERGE);
|
||||
Attack_Timer = 90000;
|
||||
}
|
||||
|
||||
HasSubmergedOnce = true;
|
||||
WasBanished = true;
|
||||
DoCast(me, SPELL_RAGSUBMERGE);
|
||||
Attack_Timer = 90000;
|
||||
Submerge_Timer = 180000;
|
||||
} else Submerge_Timer -= diff;
|
||||
|
||||
//If we are within range melee the target
|
||||
if (me->IsWithinMeleeRange(me->getVictim()))
|
||||
{
|
||||
//Make sure our attack is ready and we arn't currently casting
|
||||
if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
me->AttackerStateUpdate(me->getVictim());
|
||||
me->resetAttackTimer();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DoScriptText(SAY_REINFORCEMENTS2, me);
|
||||
|
||||
for (uint8 i = 0; i < 9; ++i)
|
||||
//MagmaBurst_Timer
|
||||
if (MagmaBurst_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
|
||||
DoCast(me->getVictim(), SPELL_MAGMABURST);
|
||||
|
||||
if (!HasYelledMagmaBurst)
|
||||
{
|
||||
if (Creature* pSummoned = me->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000))
|
||||
pSummoned->AI()->AttackStart(pTarget);
|
||||
//Say our dialog
|
||||
DoScriptText(SAY_MAGMABURST, me);
|
||||
HasYelledMagmaBurst = true;
|
||||
}
|
||||
}
|
||||
|
||||
WasBanished = true;
|
||||
DoCast(me, SPELL_RAGSUBMERGE);
|
||||
Attack_Timer = 90000;
|
||||
}
|
||||
|
||||
Submerge_Timer = 180000;
|
||||
} else Submerge_Timer -= diff;
|
||||
|
||||
//If we are within range melee the target
|
||||
if (me->IsWithinMeleeRange(me->getVictim()))
|
||||
{
|
||||
//Make sure our attack is ready and we arn't currently casting
|
||||
if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
me->AttackerStateUpdate(me->getVictim());
|
||||
me->resetAttackTimer();
|
||||
MagmaBurst_Timer = 2500;
|
||||
} else MagmaBurst_Timer -= diff;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//MagmaBurst_Timer
|
||||
if (MagmaBurst_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_MAGMABURST);
|
||||
};
|
||||
|
||||
if (!HasYelledMagmaBurst)
|
||||
{
|
||||
//Say our dialog
|
||||
DoScriptText(SAY_MAGMABURST, me);
|
||||
HasYelledMagmaBurst = true;
|
||||
}
|
||||
|
||||
MagmaBurst_Timer = 2500;
|
||||
} else MagmaBurst_Timer -= diff;
|
||||
}
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_ragnaros(Creature* pCreature)
|
||||
{
|
||||
return new boss_ragnarosAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_ragnaros()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_ragnaros";
|
||||
newscript->GetAI = &GetAI_boss_ragnaros;
|
||||
newscript->RegisterSelf();
|
||||
new boss_ragnaros();
|
||||
}
|
||||
|
||||
|
||||
@@ -29,95 +29,97 @@ EndScriptData */
|
||||
#define SPELL_SHAZZRAHCURSE 19713
|
||||
#define SPELL_DEADENMAGIC 19714
|
||||
#define SPELL_COUNTERSPELL 19715
|
||||
|
||||
struct boss_shazzrahAI : public ScriptedAI
|
||||
class boss_shazzrah : public CreatureScript
|
||||
{
|
||||
boss_shazzrahAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_shazzrah() : CreatureScript("boss_shazzrah") { }
|
||||
|
||||
uint32 ArcaneExplosion_Timer;
|
||||
uint32 ShazzrahCurse_Timer;
|
||||
uint32 DeadenMagic_Timer;
|
||||
uint32 Countspell_Timer;
|
||||
uint32 Blink_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
ArcaneExplosion_Timer = 6000; //These times are probably wrong
|
||||
ShazzrahCurse_Timer = 10000;
|
||||
DeadenMagic_Timer = 24000;
|
||||
Countspell_Timer = 15000;
|
||||
Blink_Timer = 30000;
|
||||
return new boss_shazzrahAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_shazzrahAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_shazzrahAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 ArcaneExplosion_Timer;
|
||||
uint32 ShazzrahCurse_Timer;
|
||||
uint32 DeadenMagic_Timer;
|
||||
uint32 Countspell_Timer;
|
||||
uint32 Blink_Timer;
|
||||
|
||||
//ArcaneExplosion_Timer
|
||||
if (ArcaneExplosion_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_ARCANEEXPLOSION);
|
||||
ArcaneExplosion_Timer = 5000 + rand()%4000;
|
||||
} else ArcaneExplosion_Timer -= diff;
|
||||
ArcaneExplosion_Timer = 6000; //These times are probably wrong
|
||||
ShazzrahCurse_Timer = 10000;
|
||||
DeadenMagic_Timer = 24000;
|
||||
Countspell_Timer = 15000;
|
||||
Blink_Timer = 30000;
|
||||
}
|
||||
|
||||
//ShazzrahCurse_Timer
|
||||
if (ShazzrahCurse_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
Unit *pTarget = NULL;
|
||||
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
if (pTarget) DoCast(pTarget, SPELL_SHAZZRAHCURSE);
|
||||
}
|
||||
|
||||
ShazzrahCurse_Timer = 25000 + rand()%5000;
|
||||
} else ShazzrahCurse_Timer -= diff;
|
||||
|
||||
//DeadenMagic_Timer
|
||||
if (DeadenMagic_Timer <= diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
DoCast(me, SPELL_DEADENMAGIC);
|
||||
DeadenMagic_Timer = 35000;
|
||||
} else DeadenMagic_Timer -= diff;
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Countspell_Timer
|
||||
if (Countspell_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_COUNTERSPELL);
|
||||
Countspell_Timer = 16000 + rand()%4000;
|
||||
} else Countspell_Timer -= diff;
|
||||
|
||||
//Blink_Timer
|
||||
if (Blink_Timer <= diff)
|
||||
{
|
||||
// Teleporting him to a random gamer and casting Arcane Explosion after that.
|
||||
// Blink is not working cause of LoS System we need to do this hardcoded.
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0, 100, true))
|
||||
//ArcaneExplosion_Timer
|
||||
if (ArcaneExplosion_Timer <= diff)
|
||||
{
|
||||
DoTeleportTo(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ());
|
||||
DoCast(pTarget, SPELL_ARCANEEXPLOSION);
|
||||
DoResetThreat();
|
||||
}
|
||||
DoCast(me->getVictim(), SPELL_ARCANEEXPLOSION);
|
||||
ArcaneExplosion_Timer = 5000 + rand()%4000;
|
||||
} else ArcaneExplosion_Timer -= diff;
|
||||
|
||||
Blink_Timer = 45000;
|
||||
} else Blink_Timer -= diff;
|
||||
//ShazzrahCurse_Timer
|
||||
if (ShazzrahCurse_Timer <= diff)
|
||||
{
|
||||
Unit *pTarget = NULL;
|
||||
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
if (pTarget) DoCast(pTarget, SPELL_SHAZZRAHCURSE);
|
||||
|
||||
ShazzrahCurse_Timer = 25000 + rand()%5000;
|
||||
} else ShazzrahCurse_Timer -= diff;
|
||||
|
||||
//DeadenMagic_Timer
|
||||
if (DeadenMagic_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_DEADENMAGIC);
|
||||
DeadenMagic_Timer = 35000;
|
||||
} else DeadenMagic_Timer -= diff;
|
||||
|
||||
//Countspell_Timer
|
||||
if (Countspell_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_COUNTERSPELL);
|
||||
Countspell_Timer = 16000 + rand()%4000;
|
||||
} else Countspell_Timer -= diff;
|
||||
|
||||
//Blink_Timer
|
||||
if (Blink_Timer <= diff)
|
||||
{
|
||||
// Teleporting him to a random gamer and casting Arcane Explosion after that.
|
||||
// Blink is not working cause of LoS System we need to do this hardcoded.
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0, 100, true))
|
||||
{
|
||||
DoTeleportTo(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ());
|
||||
DoCast(pTarget, SPELL_ARCANEEXPLOSION);
|
||||
DoResetThreat();
|
||||
}
|
||||
|
||||
Blink_Timer = 45000;
|
||||
} else Blink_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_shazzrah(Creature* pCreature)
|
||||
{
|
||||
return new boss_shazzrahAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_shazzrah()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_shazzrah";
|
||||
newscript->GetAI = &GetAI_boss_shazzrah;
|
||||
newscript->RegisterSelf();
|
||||
new boss_shazzrah();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,172 +36,176 @@ EndScriptData */
|
||||
#define SPELL_HEAL 19775
|
||||
#define SPELL_SHADOWWORDPAIN 19776
|
||||
#define SPELL_IMMOLATE 20294
|
||||
|
||||
struct boss_sulfuronAI : public ScriptedAI
|
||||
class boss_sulfuron : public CreatureScript
|
||||
{
|
||||
boss_sulfuronAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_sulfuron() : CreatureScript("boss_sulfuron") { }
|
||||
|
||||
uint32 Darkstrike_Timer;
|
||||
uint32 DemoralizingShout_Timer;
|
||||
uint32 Inspire_Timer;
|
||||
uint32 Knockdown_Timer;
|
||||
uint32 Flamespear_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
Darkstrike_Timer=10000; //These times are probably wrong
|
||||
DemoralizingShout_Timer = 15000;
|
||||
Inspire_Timer = 13000;
|
||||
Knockdown_Timer = 6000;
|
||||
Flamespear_Timer = 2000;
|
||||
return new boss_sulfuronAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_sulfuronAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_sulfuronAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 Darkstrike_Timer;
|
||||
uint32 DemoralizingShout_Timer;
|
||||
uint32 Inspire_Timer;
|
||||
uint32 Knockdown_Timer;
|
||||
uint32 Flamespear_Timer;
|
||||
|
||||
//DemoralizingShout_Timer
|
||||
if (DemoralizingShout_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_DEMORALIZINGSHOUT);
|
||||
DemoralizingShout_Timer = 15000 + rand()%5000;
|
||||
} else DemoralizingShout_Timer -= diff;
|
||||
Darkstrike_Timer=10000; //These times are probably wrong
|
||||
DemoralizingShout_Timer = 15000;
|
||||
Inspire_Timer = 13000;
|
||||
Knockdown_Timer = 6000;
|
||||
Flamespear_Timer = 2000;
|
||||
}
|
||||
|
||||
//Inspire_Timer
|
||||
if (Inspire_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
Creature *pTarget = NULL;
|
||||
std::list<Creature*> pList = DoFindFriendlyMissingBuff(45.0f,SPELL_INSPIRE);
|
||||
if (!pList.empty())
|
||||
{
|
||||
std::list<Creature*>::const_iterator i = pList.begin();
|
||||
advance(i, (rand()%pList.size()));
|
||||
pTarget = (*i);
|
||||
}
|
||||
}
|
||||
|
||||
if (pTarget)
|
||||
DoCast(pTarget, SPELL_INSPIRE);
|
||||
|
||||
DoCast(me, SPELL_INSPIRE);
|
||||
|
||||
Inspire_Timer = 20000 + rand()%6000;
|
||||
} else Inspire_Timer -= diff;
|
||||
|
||||
//Knockdown_Timer
|
||||
if (Knockdown_Timer <= diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_KNOCKDOWN);
|
||||
Knockdown_Timer = 12000 + rand()%3000;
|
||||
} else Knockdown_Timer -= diff;
|
||||
|
||||
//Flamespear_Timer
|
||||
if (Flamespear_Timer <= diff)
|
||||
{
|
||||
Unit *pTarget = NULL;
|
||||
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
if (pTarget) DoCast(pTarget, SPELL_FLAMESPEAR);
|
||||
|
||||
Flamespear_Timer = 12000 + rand()%4000;
|
||||
} else Flamespear_Timer -= diff;
|
||||
|
||||
//DarkStrike_Timer
|
||||
if (Darkstrike_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_DARKSTRIKE);
|
||||
Darkstrike_Timer = 15000 + rand()%3000;
|
||||
} else Darkstrike_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
struct mob_flamewaker_priestAI : public ScriptedAI
|
||||
{
|
||||
mob_flamewaker_priestAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
uint32 Heal_Timer;
|
||||
uint32 ShadowWordPain_Timer;
|
||||
uint32 Immolate_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Heal_Timer = 15000+rand()%15000;
|
||||
ShadowWordPain_Timer = 2000;
|
||||
Immolate_Timer = 8000;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Casting Heal to Sulfuron or other Guards.
|
||||
if (Heal_Timer <= diff)
|
||||
{
|
||||
Unit* pUnit = DoSelectLowestHpFriendly(60.0f, 1);
|
||||
if (!pUnit)
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoCast(pUnit, SPELL_HEAL);
|
||||
//DemoralizingShout_Timer
|
||||
if (DemoralizingShout_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_DEMORALIZINGSHOUT);
|
||||
DemoralizingShout_Timer = 15000 + rand()%5000;
|
||||
} else DemoralizingShout_Timer -= diff;
|
||||
|
||||
Heal_Timer = 15000+rand()%5000;
|
||||
} else Heal_Timer -= diff;
|
||||
//Inspire_Timer
|
||||
if (Inspire_Timer <= diff)
|
||||
{
|
||||
Creature *pTarget = NULL;
|
||||
std::list<Creature*> pList = DoFindFriendlyMissingBuff(45.0f,SPELL_INSPIRE);
|
||||
if (!pList.empty())
|
||||
{
|
||||
std::list<Creature*>::const_iterator i = pList.begin();
|
||||
advance(i, (rand()%pList.size()));
|
||||
pTarget = (*i);
|
||||
}
|
||||
|
||||
//ShadowWordPain_Timer
|
||||
if (ShadowWordPain_Timer <= diff)
|
||||
{
|
||||
Unit *pTarget = NULL;
|
||||
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
if (pTarget) DoCast(pTarget, SPELL_SHADOWWORDPAIN);
|
||||
if (pTarget)
|
||||
DoCast(pTarget, SPELL_INSPIRE);
|
||||
|
||||
ShadowWordPain_Timer = 18000+rand()%8000;
|
||||
} else ShadowWordPain_Timer -= diff;
|
||||
DoCast(me, SPELL_INSPIRE);
|
||||
|
||||
//Immolate_Timer
|
||||
if (Immolate_Timer <= diff)
|
||||
{
|
||||
Unit *pTarget = NULL;
|
||||
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
if (pTarget) DoCast(pTarget, SPELL_IMMOLATE);
|
||||
Inspire_Timer = 20000 + rand()%6000;
|
||||
} else Inspire_Timer -= diff;
|
||||
|
||||
Immolate_Timer = 15000+rand()%10000;
|
||||
} else Immolate_Timer -= diff;
|
||||
//Knockdown_Timer
|
||||
if (Knockdown_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_KNOCKDOWN);
|
||||
Knockdown_Timer = 12000 + rand()%3000;
|
||||
} else Knockdown_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
//Flamespear_Timer
|
||||
if (Flamespear_Timer <= diff)
|
||||
{
|
||||
Unit *pTarget = NULL;
|
||||
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
if (pTarget) DoCast(pTarget, SPELL_FLAMESPEAR);
|
||||
|
||||
Flamespear_Timer = 12000 + rand()%4000;
|
||||
} else Flamespear_Timer -= diff;
|
||||
|
||||
//DarkStrike_Timer
|
||||
if (Darkstrike_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_DARKSTRIKE);
|
||||
Darkstrike_Timer = 15000 + rand()%3000;
|
||||
} else Darkstrike_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
class mob_flamewaker_priest : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_flamewaker_priest() : CreatureScript("mob_flamewaker_priest") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
return new mob_flamewaker_priestAI (pCreature);
|
||||
}
|
||||
|
||||
struct mob_flamewaker_priestAI : public ScriptedAI
|
||||
{
|
||||
mob_flamewaker_priestAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
uint32 Heal_Timer;
|
||||
uint32 ShadowWordPain_Timer;
|
||||
uint32 Immolate_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Heal_Timer = 15000+rand()%15000;
|
||||
ShadowWordPain_Timer = 2000;
|
||||
Immolate_Timer = 8000;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Casting Heal to Sulfuron or other Guards.
|
||||
if (Heal_Timer <= diff)
|
||||
{
|
||||
Unit* pUnit = DoSelectLowestHpFriendly(60.0f, 1);
|
||||
if (!pUnit)
|
||||
return;
|
||||
|
||||
DoCast(pUnit, SPELL_HEAL);
|
||||
|
||||
Heal_Timer = 15000+rand()%5000;
|
||||
} else Heal_Timer -= diff;
|
||||
|
||||
//ShadowWordPain_Timer
|
||||
if (ShadowWordPain_Timer <= diff)
|
||||
{
|
||||
Unit *pTarget = NULL;
|
||||
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
if (pTarget) DoCast(pTarget, SPELL_SHADOWWORDPAIN);
|
||||
|
||||
ShadowWordPain_Timer = 18000+rand()%8000;
|
||||
} else ShadowWordPain_Timer -= diff;
|
||||
|
||||
//Immolate_Timer
|
||||
if (Immolate_Timer <= diff)
|
||||
{
|
||||
Unit *pTarget = NULL;
|
||||
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
if (pTarget) DoCast(pTarget, SPELL_IMMOLATE);
|
||||
|
||||
Immolate_Timer = 15000+rand()%10000;
|
||||
} else Immolate_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_sulfuron(Creature* pCreature)
|
||||
{
|
||||
return new boss_sulfuronAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_mob_flamewaker_priest(Creature* pCreature)
|
||||
{
|
||||
return new mob_flamewaker_priestAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_sulfuron()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_sulfuron";
|
||||
newscript->GetAI = &GetAI_boss_sulfuron;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_flamewaker_priest";
|
||||
newscript->GetAI = &GetAI_mob_flamewaker_priest;
|
||||
newscript->RegisterSelf();
|
||||
new boss_sulfuron();
|
||||
new mob_flamewaker_priest();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,230 +39,232 @@ EndScriptData */
|
||||
#define ID_DOMO 12018
|
||||
#define ID_RAGNAROS 11502
|
||||
#define ID_FLAMEWAKERPRIEST 11662
|
||||
|
||||
struct instance_molten_core : public ScriptedInstance
|
||||
class instance_molten_core : public InstanceMapScript
|
||||
{
|
||||
instance_molten_core(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
|
||||
public:
|
||||
instance_molten_core() : InstanceMapScript("instance_molten_core") { }
|
||||
|
||||
uint64 Lucifron, Magmadar, Gehennas, Garr, Geddon, Shazzrah, Sulfuron, Golemagg, Domo, Ragnaros, FlamewakerPriest;
|
||||
uint64 RuneKoro, RuneZeth, RuneMazj, RuneTheri, RuneBlaz, RuneKress, RuneMohn, m_uiFirelordCacheGUID;
|
||||
|
||||
//If all Bosses are dead.
|
||||
bool IsBossDied[9];
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
|
||||
void Initialize()
|
||||
InstanceScript* GetInstance_InstanceMapScript(Map* pMap)
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
Lucifron = 0;
|
||||
Magmadar = 0;
|
||||
Gehennas = 0;
|
||||
Garr = 0;
|
||||
Geddon = 0;
|
||||
Shazzrah = 0;
|
||||
Sulfuron = 0;
|
||||
Golemagg = 0;
|
||||
Domo = 0;
|
||||
Ragnaros = 0;
|
||||
FlamewakerPriest = 0;
|
||||
|
||||
RuneKoro = 0;
|
||||
RuneZeth = 0;
|
||||
RuneMazj = 0;
|
||||
RuneTheri = 0;
|
||||
RuneBlaz = 0;
|
||||
RuneKress = 0;
|
||||
RuneMohn = 0;
|
||||
|
||||
m_uiFirelordCacheGUID = 0;
|
||||
|
||||
IsBossDied[0] = false;
|
||||
IsBossDied[1] = false;
|
||||
IsBossDied[2] = false;
|
||||
IsBossDied[3] = false;
|
||||
IsBossDied[4] = false;
|
||||
IsBossDied[5] = false;
|
||||
IsBossDied[6] = false;
|
||||
|
||||
IsBossDied[7] = false;
|
||||
IsBossDied[8] = false;
|
||||
return new instance_molten_core_InstanceMapScript (pMap);
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
struct instance_molten_core_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
return false;
|
||||
instance_molten_core_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();};
|
||||
|
||||
uint64 Lucifron, Magmadar, Gehennas, Garr, Geddon, Shazzrah, Sulfuron, Golemagg, Domo, Ragnaros, FlamewakerPriest;
|
||||
uint64 RuneKoro, RuneZeth, RuneMazj, RuneTheri, RuneBlaz, RuneKress, RuneMohn, m_uiFirelordCacheGUID;
|
||||
|
||||
//If all Bosses are dead.
|
||||
bool IsBossDied[9];
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
Lucifron = 0;
|
||||
Magmadar = 0;
|
||||
Gehennas = 0;
|
||||
Garr = 0;
|
||||
Geddon = 0;
|
||||
Shazzrah = 0;
|
||||
Sulfuron = 0;
|
||||
Golemagg = 0;
|
||||
Domo = 0;
|
||||
Ragnaros = 0;
|
||||
FlamewakerPriest = 0;
|
||||
|
||||
RuneKoro = 0;
|
||||
RuneZeth = 0;
|
||||
RuneMazj = 0;
|
||||
RuneTheri = 0;
|
||||
RuneBlaz = 0;
|
||||
RuneKress = 0;
|
||||
RuneMohn = 0;
|
||||
|
||||
m_uiFirelordCacheGUID = 0;
|
||||
|
||||
IsBossDied[0] = false;
|
||||
IsBossDied[1] = false;
|
||||
IsBossDied[2] = false;
|
||||
IsBossDied[3] = false;
|
||||
IsBossDied[4] = false;
|
||||
IsBossDied[5] = false;
|
||||
IsBossDied[6] = false;
|
||||
|
||||
IsBossDied[7] = false;
|
||||
IsBossDied[8] = false;
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
return false;
|
||||
};
|
||||
|
||||
void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
|
||||
{
|
||||
switch(pGo->GetEntry())
|
||||
{
|
||||
case 176951: //Sulfuron
|
||||
RuneKoro = pGo->GetGUID();
|
||||
break;
|
||||
case 176952: //Geddon
|
||||
RuneZeth = pGo->GetGUID();
|
||||
break;
|
||||
case 176953: //Shazzrah
|
||||
RuneMazj = pGo->GetGUID();
|
||||
break;
|
||||
case 176954: //Golemagg
|
||||
RuneTheri = pGo->GetGUID();
|
||||
break;
|
||||
case 176955: //Garr
|
||||
RuneBlaz = pGo->GetGUID();
|
||||
break;
|
||||
case 176956: //Magmadar
|
||||
RuneKress = pGo->GetGUID();
|
||||
break;
|
||||
case 176957: //Gehennas
|
||||
RuneMohn = pGo->GetGUID();
|
||||
break;
|
||||
case 179703:
|
||||
m_uiFirelordCacheGUID = pGo->GetGUID(); //when majordomo event == DONE DoRespawnGameObject(m_uiFirelordCacheGUID,);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
|
||||
{
|
||||
switch (pCreature->GetEntry())
|
||||
{
|
||||
case ID_LUCIFRON:
|
||||
Lucifron = pCreature->GetGUID();
|
||||
break;
|
||||
|
||||
case ID_MAGMADAR:
|
||||
Magmadar = pCreature->GetGUID();
|
||||
break;
|
||||
|
||||
case ID_GEHENNAS:
|
||||
Gehennas = pCreature->GetGUID();
|
||||
break;
|
||||
|
||||
case ID_GARR:
|
||||
Garr = pCreature->GetGUID();
|
||||
break;
|
||||
|
||||
case ID_GEDDON:
|
||||
Geddon = pCreature->GetGUID();
|
||||
break;
|
||||
|
||||
case ID_SHAZZRAH:
|
||||
Shazzrah = pCreature->GetGUID();
|
||||
break;
|
||||
|
||||
case ID_SULFURON:
|
||||
Sulfuron = pCreature->GetGUID();
|
||||
break;
|
||||
|
||||
case ID_GOLEMAGG:
|
||||
Golemagg = pCreature->GetGUID();
|
||||
break;
|
||||
|
||||
case ID_DOMO:
|
||||
Domo = pCreature->GetGUID();
|
||||
break;
|
||||
|
||||
case ID_RAGNAROS:
|
||||
Ragnaros = pCreature->GetGUID();
|
||||
break;
|
||||
|
||||
case ID_FLAMEWAKERPRIEST:
|
||||
FlamewakerPriest = pCreature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64 (uint32 identifier)
|
||||
{
|
||||
switch(identifier)
|
||||
{
|
||||
case DATA_SULFURON:
|
||||
return Sulfuron;
|
||||
case DATA_GOLEMAGG:
|
||||
return Golemagg;
|
||||
|
||||
case DATA_FLAMEWAKERPRIEST:
|
||||
return FlamewakerPriest;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case DATA_LUCIFRONISDEAD:
|
||||
if (IsBossDied[0])
|
||||
return 1;
|
||||
break;
|
||||
|
||||
case DATA_MAGMADARISDEAD:
|
||||
if (IsBossDied[1])
|
||||
return 1;
|
||||
break;
|
||||
|
||||
case DATA_GEHENNASISDEAD:
|
||||
if (IsBossDied[2])
|
||||
return 1;
|
||||
break;
|
||||
|
||||
case DATA_GARRISDEAD:
|
||||
if (IsBossDied[3])
|
||||
return 1;
|
||||
break;
|
||||
|
||||
case DATA_GEDDONISDEAD:
|
||||
if (IsBossDied[4])
|
||||
return 1;
|
||||
break;
|
||||
|
||||
case DATA_SHAZZRAHISDEAD:
|
||||
if (IsBossDied[5])
|
||||
return 1;
|
||||
break;
|
||||
|
||||
case DATA_SULFURONISDEAD:
|
||||
if (IsBossDied[6])
|
||||
return 1;
|
||||
break;
|
||||
|
||||
case DATA_GOLEMAGGISDEAD:
|
||||
if (IsBossDied[7])
|
||||
return 1;
|
||||
break;
|
||||
|
||||
case DATA_MAJORDOMOISDEAD:
|
||||
if (IsBossDied[8])
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 /*data*/)
|
||||
{
|
||||
if (type == DATA_GOLEMAGG_DEATH)
|
||||
IsBossDied[7] = true;
|
||||
}
|
||||
};
|
||||
|
||||
void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
|
||||
{
|
||||
switch(pGo->GetEntry())
|
||||
{
|
||||
case 176951: //Sulfuron
|
||||
RuneKoro = pGo->GetGUID();
|
||||
break;
|
||||
case 176952: //Geddon
|
||||
RuneZeth = pGo->GetGUID();
|
||||
break;
|
||||
case 176953: //Shazzrah
|
||||
RuneMazj = pGo->GetGUID();
|
||||
break;
|
||||
case 176954: //Golemagg
|
||||
RuneTheri = pGo->GetGUID();
|
||||
break;
|
||||
case 176955: //Garr
|
||||
RuneBlaz = pGo->GetGUID();
|
||||
break;
|
||||
case 176956: //Magmadar
|
||||
RuneKress = pGo->GetGUID();
|
||||
break;
|
||||
case 176957: //Gehennas
|
||||
RuneMohn = pGo->GetGUID();
|
||||
break;
|
||||
case 179703:
|
||||
m_uiFirelordCacheGUID = pGo->GetGUID(); //when majordomo event == DONE DoRespawnGameObject(m_uiFirelordCacheGUID,);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
|
||||
{
|
||||
switch (pCreature->GetEntry())
|
||||
{
|
||||
case ID_LUCIFRON:
|
||||
Lucifron = pCreature->GetGUID();
|
||||
break;
|
||||
|
||||
case ID_MAGMADAR:
|
||||
Magmadar = pCreature->GetGUID();
|
||||
break;
|
||||
|
||||
case ID_GEHENNAS:
|
||||
Gehennas = pCreature->GetGUID();
|
||||
break;
|
||||
|
||||
case ID_GARR:
|
||||
Garr = pCreature->GetGUID();
|
||||
break;
|
||||
|
||||
case ID_GEDDON:
|
||||
Geddon = pCreature->GetGUID();
|
||||
break;
|
||||
|
||||
case ID_SHAZZRAH:
|
||||
Shazzrah = pCreature->GetGUID();
|
||||
break;
|
||||
|
||||
case ID_SULFURON:
|
||||
Sulfuron = pCreature->GetGUID();
|
||||
break;
|
||||
|
||||
case ID_GOLEMAGG:
|
||||
Golemagg = pCreature->GetGUID();
|
||||
break;
|
||||
|
||||
case ID_DOMO:
|
||||
Domo = pCreature->GetGUID();
|
||||
break;
|
||||
|
||||
case ID_RAGNAROS:
|
||||
Ragnaros = pCreature->GetGUID();
|
||||
break;
|
||||
|
||||
case ID_FLAMEWAKERPRIEST:
|
||||
FlamewakerPriest = pCreature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64 (uint32 identifier)
|
||||
{
|
||||
switch(identifier)
|
||||
{
|
||||
case DATA_SULFURON:
|
||||
return Sulfuron;
|
||||
case DATA_GOLEMAGG:
|
||||
return Golemagg;
|
||||
|
||||
case DATA_FLAMEWAKERPRIEST:
|
||||
return FlamewakerPriest;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case DATA_LUCIFRONISDEAD:
|
||||
if (IsBossDied[0])
|
||||
return 1;
|
||||
break;
|
||||
|
||||
case DATA_MAGMADARISDEAD:
|
||||
if (IsBossDied[1])
|
||||
return 1;
|
||||
break;
|
||||
|
||||
case DATA_GEHENNASISDEAD:
|
||||
if (IsBossDied[2])
|
||||
return 1;
|
||||
break;
|
||||
|
||||
case DATA_GARRISDEAD:
|
||||
if (IsBossDied[3])
|
||||
return 1;
|
||||
break;
|
||||
|
||||
case DATA_GEDDONISDEAD:
|
||||
if (IsBossDied[4])
|
||||
return 1;
|
||||
break;
|
||||
|
||||
case DATA_SHAZZRAHISDEAD:
|
||||
if (IsBossDied[5])
|
||||
return 1;
|
||||
break;
|
||||
|
||||
case DATA_SULFURONISDEAD:
|
||||
if (IsBossDied[6])
|
||||
return 1;
|
||||
break;
|
||||
|
||||
case DATA_GOLEMAGGISDEAD:
|
||||
if (IsBossDied[7])
|
||||
return 1;
|
||||
break;
|
||||
|
||||
case DATA_MAJORDOMOISDEAD:
|
||||
if (IsBossDied[8])
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 /*data*/)
|
||||
{
|
||||
if (type == DATA_GOLEMAGG_DEATH)
|
||||
IsBossDied[7] = true;
|
||||
}
|
||||
};
|
||||
|
||||
InstanceData* GetInstance_instance_molten_core(Map* pMap)
|
||||
{
|
||||
return new instance_molten_core (pMap);
|
||||
}
|
||||
|
||||
void AddSC_instance_molten_core()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "instance_molten_core";
|
||||
newscript->GetInstanceData = &GetInstance_instance_molten_core;
|
||||
newscript->RegisterSelf();
|
||||
new instance_molten_core();
|
||||
}
|
||||
|
||||
|
||||
@@ -40,44 +40,44 @@ EndContentData */
|
||||
#define SPELL_WITHERING_HEAT 19367
|
||||
#define SPELL_ANCIENT_DESPAIR 19369
|
||||
#define SPELL_ANCIENT_HYSTERIA 19372
|
||||
|
||||
CreatureAI* GetAI_mob_ancient_core_hound(Creature* pCreature)
|
||||
class mob_ancient_core_hound : public CreatureScript
|
||||
{
|
||||
SimpleAI *ai = new SimpleAI(pCreature);
|
||||
public:
|
||||
mob_ancient_core_hound() : CreatureScript("mob_ancient_core_hound") { }
|
||||
|
||||
ai->Spell[0].Enabled = true;
|
||||
ai->Spell[0].Spell_Id = SPELL_CONE_OF_FIRE;
|
||||
ai->Spell[0].Cooldown = 7000;
|
||||
ai->Spell[0].First_Cast = 10000;
|
||||
ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
SimpleAI *ai = new SimpleAI(pCreature);
|
||||
|
||||
uint32 RandDebuff = RAND(SPELL_GROUND_STOMP,SPELL_ANCIENT_DREAD,SPELL_CAUTERIZING_FLAMES,
|
||||
SPELL_WITHERING_HEAT,SPELL_ANCIENT_DESPAIR,SPELL_ANCIENT_HYSTERIA);
|
||||
ai->Spell[0].Enabled = true;
|
||||
ai->Spell[0].Spell_Id = SPELL_CONE_OF_FIRE;
|
||||
ai->Spell[0].Cooldown = 7000;
|
||||
ai->Spell[0].First_Cast = 10000;
|
||||
ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
|
||||
|
||||
ai->Spell[1].Enabled = true;
|
||||
ai->Spell[1].Spell_Id = RandDebuff;
|
||||
ai->Spell[1].Cooldown = 24000;
|
||||
ai->Spell[1].First_Cast = 15000;
|
||||
ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET;
|
||||
uint32 RandDebuff = RAND(SPELL_GROUND_STOMP,SPELL_ANCIENT_DREAD,SPELL_CAUTERIZING_FLAMES,
|
||||
SPELL_WITHERING_HEAT,SPELL_ANCIENT_DESPAIR,SPELL_ANCIENT_HYSTERIA);
|
||||
|
||||
ai->Spell[2].Enabled = true;
|
||||
ai->Spell[2].Spell_Id = SPELL_BITE;
|
||||
ai->Spell[2].Cooldown = 6000;
|
||||
ai->Spell[2].First_Cast = 4000;
|
||||
ai->Spell[2].Cast_Target_Type = CAST_HOSTILE_TARGET;
|
||||
ai->Spell[1].Enabled = true;
|
||||
ai->Spell[1].Spell_Id = RandDebuff;
|
||||
ai->Spell[1].Cooldown = 24000;
|
||||
ai->Spell[1].First_Cast = 15000;
|
||||
ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET;
|
||||
|
||||
ai->EnterEvadeMode();
|
||||
ai->Spell[2].Enabled = true;
|
||||
ai->Spell[2].Spell_Id = SPELL_BITE;
|
||||
ai->Spell[2].Cooldown = 6000;
|
||||
ai->Spell[2].First_Cast = 4000;
|
||||
ai->Spell[2].Cast_Target_Type = CAST_HOSTILE_TARGET;
|
||||
|
||||
return ai;
|
||||
}
|
||||
ai->EnterEvadeMode();
|
||||
|
||||
return ai;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
void AddSC_molten_core()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_ancient_core_hound";
|
||||
newscript->GetAI = &GetAI_mob_ancient_core_hound;
|
||||
newscript->RegisterSelf();
|
||||
new mob_ancient_core_hound();
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -22,97 +22,96 @@
|
||||
####*/
|
||||
#define SPELL_REVIVE 51918
|
||||
#define VALK_WHISPER "It is not yet your time, champion. Rise! Rise and fight once more!"
|
||||
|
||||
struct npc_valkyr_battle_maidenAI : public PassiveAI
|
||||
class npc_valkyr_battle_maiden : public CreatureScript
|
||||
{
|
||||
npc_valkyr_battle_maidenAI(Creature *c) : PassiveAI(c) {}
|
||||
public:
|
||||
npc_valkyr_battle_maiden() : CreatureScript("npc_valkyr_battle_maiden") { }
|
||||
|
||||
uint32 FlyBackTimer;
|
||||
float x, y, z;
|
||||
uint32 phase;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
me->setActive(true);
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetFlying(true);
|
||||
FlyBackTimer = 500;
|
||||
phase = 0;
|
||||
|
||||
me->GetPosition(x, y, z);
|
||||
z += 4; x -= 3.5; y -= 5;
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMap()->CreatureRelocation(me, x, y, z, 0.0f);
|
||||
return new npc_valkyr_battle_maidenAI (pCreature);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
struct npc_valkyr_battle_maidenAI : public PassiveAI
|
||||
{
|
||||
if (FlyBackTimer <= diff)
|
||||
npc_valkyr_battle_maidenAI(Creature *c) : PassiveAI(c) {}
|
||||
|
||||
uint32 FlyBackTimer;
|
||||
float x, y, z;
|
||||
uint32 phase;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Player *plr = NULL;
|
||||
if (me->isSummon())
|
||||
if (Unit *summoner = CAST_SUM(me)->GetSummoner())
|
||||
if (summoner->GetTypeId() == TYPEID_PLAYER)
|
||||
plr = CAST_PLR(summoner);
|
||||
me->setActive(true);
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetFlying(true);
|
||||
FlyBackTimer = 500;
|
||||
phase = 0;
|
||||
|
||||
if (!plr)
|
||||
phase = 3;
|
||||
me->GetPosition(x, y, z);
|
||||
z += 4; x -= 3.5; y -= 5;
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMap()->CreatureRelocation(me, x, y, z, 0.0f);
|
||||
}
|
||||
|
||||
switch(phase)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (FlyBackTimer <= diff)
|
||||
{
|
||||
case 0:
|
||||
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
|
||||
me->HandleEmoteCommand(EMOTE_STATE_FLYGRABCLOSED);
|
||||
FlyBackTimer = 500;
|
||||
break;
|
||||
case 1:
|
||||
plr->GetClosePoint(x,y,z, me->GetObjectSize());
|
||||
z += 2.5; x -= 2; y -= 1.5;
|
||||
me->GetMotionMaster()->MovePoint(0, x, y, z);
|
||||
me->SetUInt64Value(UNIT_FIELD_TARGET, plr->GetGUID());
|
||||
me->SetVisibility(VISIBILITY_ON);
|
||||
FlyBackTimer = 4500;
|
||||
break;
|
||||
case 2:
|
||||
if (!plr->isRessurectRequested())
|
||||
{
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOMSPELL01);
|
||||
DoCast(plr, SPELL_REVIVE, true);
|
||||
me->MonsterWhisper(VALK_WHISPER, plr->GetGUID());
|
||||
}
|
||||
FlyBackTimer = 5000;
|
||||
break;
|
||||
case 3:
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
FlyBackTimer = 3000;
|
||||
break;
|
||||
case 4:
|
||||
me->DisappearAndDie();
|
||||
break;
|
||||
default:
|
||||
//Nothing To DO
|
||||
break;
|
||||
}
|
||||
++phase;
|
||||
} else FlyBackTimer-=diff;
|
||||
}
|
||||
Player *plr = NULL;
|
||||
if (me->isSummon())
|
||||
if (Unit *summoner = CAST_SUM(me)->GetSummoner())
|
||||
if (summoner->GetTypeId() == TYPEID_PLAYER)
|
||||
plr = CAST_PLR(summoner);
|
||||
|
||||
if (!plr)
|
||||
phase = 3;
|
||||
|
||||
switch(phase)
|
||||
{
|
||||
case 0:
|
||||
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
|
||||
me->HandleEmoteCommand(EMOTE_STATE_FLYGRABCLOSED);
|
||||
FlyBackTimer = 500;
|
||||
break;
|
||||
case 1:
|
||||
plr->GetClosePoint(x,y,z, me->GetObjectSize());
|
||||
z += 2.5; x -= 2; y -= 1.5;
|
||||
me->GetMotionMaster()->MovePoint(0, x, y, z);
|
||||
me->SetUInt64Value(UNIT_FIELD_TARGET, plr->GetGUID());
|
||||
me->SetVisibility(VISIBILITY_ON);
|
||||
FlyBackTimer = 4500;
|
||||
break;
|
||||
case 2:
|
||||
if (!plr->isRessurectRequested())
|
||||
{
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOMSPELL01);
|
||||
DoCast(plr, SPELL_REVIVE, true);
|
||||
me->MonsterWhisper(VALK_WHISPER, plr->GetGUID());
|
||||
}
|
||||
FlyBackTimer = 5000;
|
||||
break;
|
||||
case 3:
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
FlyBackTimer = 3000;
|
||||
break;
|
||||
case 4:
|
||||
me->DisappearAndDie();
|
||||
break;
|
||||
default:
|
||||
//Nothing To DO
|
||||
break;
|
||||
}
|
||||
++phase;
|
||||
} else FlyBackTimer-=diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_npc_valkyr_battle_maiden(Creature* pCreature)
|
||||
{
|
||||
return new npc_valkyr_battle_maidenAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_the_scarlet_enclave()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_valkyr_battle_maiden";
|
||||
newscript->GetAI = &GetAI_npc_valkyr_battle_maiden;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
// Chapter 3: Scarlet Armies Approach... - An End To All Things...
|
||||
// Chapter 4: An End To All Things... - An End To All Things...
|
||||
new npc_valkyr_battle_maiden();
|
||||
}
|
||||
|
||||
@@ -36,95 +36,97 @@ enum eEnums
|
||||
SPELL_FIREAOE = 9435,
|
||||
SPELL_ARCANEBUBBLE = 9438,
|
||||
};
|
||||
|
||||
struct boss_arcanist_doanAI : public ScriptedAI
|
||||
class boss_arcanist_doan : public CreatureScript
|
||||
{
|
||||
boss_arcanist_doanAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_arcanist_doan() : CreatureScript("boss_arcanist_doan") { }
|
||||
|
||||
uint32 Polymorph_Timer;
|
||||
uint32 AoESilence_Timer;
|
||||
uint32 ArcaneExplosion_Timer;
|
||||
bool bCanDetonate;
|
||||
bool bShielded;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
Polymorph_Timer = 20000;
|
||||
AoESilence_Timer = 15000;
|
||||
ArcaneExplosion_Timer = 3000;
|
||||
bCanDetonate = false;
|
||||
bShielded = false;
|
||||
return new boss_arcanist_doanAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_arcanist_doanAI : public ScriptedAI
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
}
|
||||
boss_arcanist_doanAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 Polymorph_Timer;
|
||||
uint32 AoESilence_Timer;
|
||||
uint32 ArcaneExplosion_Timer;
|
||||
bool bCanDetonate;
|
||||
bool bShielded;
|
||||
|
||||
if (bShielded && bCanDetonate)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me, SPELL_FIREAOE);
|
||||
Polymorph_Timer = 20000;
|
||||
AoESilence_Timer = 15000;
|
||||
ArcaneExplosion_Timer = 3000;
|
||||
bCanDetonate = false;
|
||||
bShielded = false;
|
||||
}
|
||||
|
||||
if (me->HasAura(SPELL_ARCANEBUBBLE))
|
||||
return;
|
||||
|
||||
//If we are <50% hp cast Arcane Bubble
|
||||
if (!bShielded && me->GetHealth()*100 / me->GetMaxHealth() <= 50)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
//wait if we already casting
|
||||
if (me->IsNonMeleeSpellCasted(false))
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoScriptText(SAY_SPECIALAE, me);
|
||||
DoCast(me, SPELL_ARCANEBUBBLE);
|
||||
if (bShielded && bCanDetonate)
|
||||
{
|
||||
DoCast(me, SPELL_FIREAOE);
|
||||
bCanDetonate = false;
|
||||
}
|
||||
|
||||
bCanDetonate = true;
|
||||
bShielded = true;
|
||||
if (me->HasAura(SPELL_ARCANEBUBBLE))
|
||||
return;
|
||||
|
||||
//If we are <50% hp cast Arcane Bubble
|
||||
if (!bShielded && me->GetHealth()*100 / me->GetMaxHealth() <= 50)
|
||||
{
|
||||
//wait if we already casting
|
||||
if (me->IsNonMeleeSpellCasted(false))
|
||||
return;
|
||||
|
||||
DoScriptText(SAY_SPECIALAE, me);
|
||||
DoCast(me, SPELL_ARCANEBUBBLE);
|
||||
|
||||
bCanDetonate = true;
|
||||
bShielded = true;
|
||||
}
|
||||
|
||||
if (Polymorph_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
|
||||
DoCast(pTarget, SPELL_POLYMORPH);
|
||||
|
||||
Polymorph_Timer = 20000;
|
||||
} else Polymorph_Timer -= diff;
|
||||
|
||||
//AoESilence_Timer
|
||||
if (AoESilence_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_AOESILENCE);
|
||||
AoESilence_Timer = 15000 + rand()%5000;
|
||||
} else AoESilence_Timer -= diff;
|
||||
|
||||
//ArcaneExplosion_Timer
|
||||
if (ArcaneExplosion_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_ARCANEEXPLOSION);
|
||||
ArcaneExplosion_Timer = 8000;
|
||||
} else ArcaneExplosion_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
if (Polymorph_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
|
||||
DoCast(pTarget, SPELL_POLYMORPH);
|
||||
|
||||
Polymorph_Timer = 20000;
|
||||
} else Polymorph_Timer -= diff;
|
||||
|
||||
//AoESilence_Timer
|
||||
if (AoESilence_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_AOESILENCE);
|
||||
AoESilence_Timer = 15000 + rand()%5000;
|
||||
} else AoESilence_Timer -= diff;
|
||||
|
||||
//ArcaneExplosion_Timer
|
||||
if (ArcaneExplosion_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_ARCANEEXPLOSION);
|
||||
ArcaneExplosion_Timer = 8000;
|
||||
} else ArcaneExplosion_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_arcanist_doan(Creature* pCreature)
|
||||
{
|
||||
return new boss_arcanist_doanAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_arcanist_doan()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_arcanist_doan";
|
||||
newscript->GetAI = &GetAI_boss_arcanist_doan;
|
||||
newscript->RegisterSelf();
|
||||
new boss_arcanist_doan();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,73 +28,75 @@ EndScriptData */
|
||||
#define SPELL_CALLOFTHEGRAVE 17831
|
||||
#define SPELL_TERRIFY 7399
|
||||
#define SPELL_SOULSIPHON 7290
|
||||
|
||||
struct boss_azshir_the_sleeplessAI : public ScriptedAI
|
||||
class boss_azshir_the_sleepless : public CreatureScript
|
||||
{
|
||||
boss_azshir_the_sleeplessAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_azshir_the_sleepless() : CreatureScript("boss_azshir_the_sleepless") { }
|
||||
|
||||
uint32 SoulSiphon_Timer;
|
||||
uint32 CallOftheGrave_Timer;
|
||||
uint32 Terrify_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
SoulSiphon_Timer = 1;
|
||||
CallOftheGrave_Timer = 30000;
|
||||
Terrify_Timer = 20000;
|
||||
return new boss_azshir_the_sleeplessAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_azshir_the_sleeplessAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
boss_azshir_the_sleeplessAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 SoulSiphon_Timer;
|
||||
uint32 CallOftheGrave_Timer;
|
||||
uint32 Terrify_Timer;
|
||||
|
||||
//If we are <50% hp cast Soul Siphon rank 1
|
||||
if (me->GetHealth()*100 / me->GetMaxHealth() <= 50 && !me->IsNonMeleeSpellCasted(false))
|
||||
void Reset()
|
||||
{
|
||||
//SoulSiphon_Timer
|
||||
if (SoulSiphon_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SOULSIPHON);
|
||||
return;
|
||||
|
||||
//SoulSiphon_Timer = 20000;
|
||||
} else SoulSiphon_Timer -= diff;
|
||||
SoulSiphon_Timer = 1;
|
||||
CallOftheGrave_Timer = 30000;
|
||||
Terrify_Timer = 20000;
|
||||
}
|
||||
|
||||
//CallOfTheGrave_Timer
|
||||
if (CallOftheGrave_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CALLOFTHEGRAVE);
|
||||
CallOftheGrave_Timer = 30000;
|
||||
} else CallOftheGrave_Timer -= diff;
|
||||
}
|
||||
|
||||
//Terrify_Timer
|
||||
if (Terrify_Timer <= diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_TERRIFY);
|
||||
Terrify_Timer = 20000;
|
||||
} else Terrify_Timer -= diff;
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//If we are <50% hp cast Soul Siphon rank 1
|
||||
if (me->GetHealth()*100 / me->GetMaxHealth() <= 50 && !me->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
//SoulSiphon_Timer
|
||||
if (SoulSiphon_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SOULSIPHON);
|
||||
return;
|
||||
|
||||
//SoulSiphon_Timer = 20000;
|
||||
} else SoulSiphon_Timer -= diff;
|
||||
}
|
||||
|
||||
//CallOfTheGrave_Timer
|
||||
if (CallOftheGrave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CALLOFTHEGRAVE);
|
||||
CallOftheGrave_Timer = 30000;
|
||||
} else CallOftheGrave_Timer -= diff;
|
||||
|
||||
//Terrify_Timer
|
||||
if (Terrify_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_TERRIFY);
|
||||
Terrify_Timer = 20000;
|
||||
} else Terrify_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_azshir_the_sleepless(Creature* pCreature)
|
||||
{
|
||||
return new boss_azshir_the_sleeplessAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_azshir_the_sleepless()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_azshir_the_sleepless";
|
||||
newscript->GetAI = &GetAI_boss_azshir_the_sleepless;
|
||||
newscript->RegisterSelf();
|
||||
new boss_azshir_the_sleepless();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,91 +36,93 @@ enum eEnums
|
||||
SPELL_FLAMESPIKE = 8814,
|
||||
SPELL_FIRENOVA = 16079,
|
||||
};
|
||||
|
||||
struct boss_bloodmage_thalnosAI : public ScriptedAI
|
||||
class boss_bloodmage_thalnos : public CreatureScript
|
||||
{
|
||||
boss_bloodmage_thalnosAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_bloodmage_thalnos() : CreatureScript("boss_bloodmage_thalnos") { }
|
||||
|
||||
bool HpYell;
|
||||
uint32 FlameShock_Timer;
|
||||
uint32 ShadowBolt_Timer;
|
||||
uint32 FlameSpike_Timer;
|
||||
uint32 FireNova_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
HpYell = false;
|
||||
FlameShock_Timer = 10000;
|
||||
ShadowBolt_Timer = 2000;
|
||||
FlameSpike_Timer = 8000;
|
||||
FireNova_Timer = 40000;
|
||||
return new boss_bloodmage_thalnosAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_bloodmage_thalnosAI : public ScriptedAI
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
}
|
||||
boss_bloodmage_thalnosAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void KilledUnit(Unit* /*Victim*/)
|
||||
{
|
||||
DoScriptText(SAY_KILL, me);
|
||||
}
|
||||
bool HpYell;
|
||||
uint32 FlameShock_Timer;
|
||||
uint32 ShadowBolt_Timer;
|
||||
uint32 FlameSpike_Timer;
|
||||
uint32 FireNova_Timer;
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//If we are <35% hp
|
||||
if (!HpYell && ((me->GetHealth()*100) / me->GetMaxHealth() <= 35))
|
||||
void Reset()
|
||||
{
|
||||
DoScriptText(SAY_HEALTH, me);
|
||||
HpYell = true;
|
||||
HpYell = false;
|
||||
FlameShock_Timer = 10000;
|
||||
ShadowBolt_Timer = 2000;
|
||||
FlameSpike_Timer = 8000;
|
||||
FireNova_Timer = 40000;
|
||||
}
|
||||
|
||||
//FlameShock_Timer
|
||||
if (FlameShock_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FLAMESHOCK);
|
||||
FlameShock_Timer = 10000 + rand()%5000;
|
||||
} else FlameShock_Timer -= diff;
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
}
|
||||
|
||||
//FlameSpike_Timer
|
||||
if (FlameSpike_Timer <= diff)
|
||||
void KilledUnit(Unit* /*Victim*/)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FLAMESPIKE);
|
||||
FlameSpike_Timer = 30000;
|
||||
} else FlameSpike_Timer -= diff;
|
||||
DoScriptText(SAY_KILL, me);
|
||||
}
|
||||
|
||||
//FireNova_Timer
|
||||
if (FireNova_Timer <= diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FIRENOVA);
|
||||
FireNova_Timer = 40000;
|
||||
} else FireNova_Timer -= diff;
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//ShadowBolt_Timer
|
||||
if (ShadowBolt_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWBOLT);
|
||||
ShadowBolt_Timer = 2000;
|
||||
} else ShadowBolt_Timer -= diff;
|
||||
//If we are <35% hp
|
||||
if (!HpYell && ((me->GetHealth()*100) / me->GetMaxHealth() <= 35))
|
||||
{
|
||||
DoScriptText(SAY_HEALTH, me);
|
||||
HpYell = true;
|
||||
}
|
||||
|
||||
//FlameShock_Timer
|
||||
if (FlameShock_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FLAMESHOCK);
|
||||
FlameShock_Timer = 10000 + rand()%5000;
|
||||
} else FlameShock_Timer -= diff;
|
||||
|
||||
//FlameSpike_Timer
|
||||
if (FlameSpike_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FLAMESPIKE);
|
||||
FlameSpike_Timer = 30000;
|
||||
} else FlameSpike_Timer -= diff;
|
||||
|
||||
//FireNova_Timer
|
||||
if (FireNova_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FIRENOVA);
|
||||
FireNova_Timer = 40000;
|
||||
} else FireNova_Timer -= diff;
|
||||
|
||||
//ShadowBolt_Timer
|
||||
if (ShadowBolt_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWBOLT);
|
||||
ShadowBolt_Timer = 2000;
|
||||
} else ShadowBolt_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_bloodmage_thalnos(Creature* pCreature)
|
||||
{
|
||||
return new boss_bloodmage_thalnosAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_bloodmage_thalnos()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_bloodmage_thalnos";
|
||||
newscript->GetAI = &GetAI_boss_bloodmage_thalnos;
|
||||
newscript->RegisterSelf();
|
||||
new boss_bloodmage_thalnos();
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user