Merge branch 'master' into 4.3.4
Conflicts: src/server/game/Entities/Creature/Creature.cpp src/server/game/Entities/Creature/Creature.h src/server/game/Entities/Creature/GossipDef.cpp src/server/game/Entities/Player/Player.cpp src/server/game/Entities/Transport/Transport.cpp src/server/game/Entities/Unit/Unit.cpp src/server/game/Globals/ObjectMgr.cpp src/server/game/Globals/ObjectMgr.h src/server/game/Handlers/QuestHandler.cpp src/server/game/Handlers/SpellHandler.cpp src/server/game/Handlers/TradeHandler.cpp src/server/game/Quests/QuestDef.h src/server/game/Spells/Auras/SpellAuraEffects.cpp src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp src/server/scripts/EasternKingdoms/zone_ghostlands.cpp src/server/scripts/EasternKingdoms/zone_hinterlands.cpp src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp src/server/scripts/EasternKingdoms/zone_swamp_of_sorrows.cpp src/server/scripts/Kalimdor/zone_azshara.cpp src/server/scripts/Kalimdor/zone_darkshore.cpp src/server/scripts/Kalimdor/zone_desolace.cpp src/server/scripts/Northrend/zone_dalaran.cpp src/tools/CMakeLists.txt
This commit is contained in:
@@ -1376,7 +1376,10 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
Position pos;
|
||||
transport->GetPosition(&pos);
|
||||
handler->PSendSysMessage("Transport %s is %s", transport->GetName().c_str(), transport->GetGoState() == GO_STATE_READY ? "stopped" : "moving");
|
||||
handler->PSendSysMessage("Transport position: %s", pos.ToString().c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
{
|
||||
std::string name = param1;
|
||||
WorldDatabase.EscapeString(name);
|
||||
whereClause << ", creature_template WHERE creature.id = creature_template.entry AND creature_template.name "_LIKE_" '" << name << '\'';
|
||||
whereClause << ", creature_template WHERE creature.id = creature_template.entry AND creature_template.name " _LIKE_" '" << name << '\'';
|
||||
}
|
||||
else
|
||||
whereClause << "WHERE guid = '" << guid << '\'';
|
||||
|
||||
@@ -238,7 +238,7 @@ public:
|
||||
WorldDatabase.EscapeString(name);
|
||||
result = WorldDatabase.PQuery(
|
||||
"SELECT guid, id, position_x, position_y, position_z, orientation, map, phaseMask, (POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ "
|
||||
"FROM gameobject, gameobject_template WHERE gameobject_template.entry = gameobject.id AND map = %i AND name "_LIKE_" "_CONCAT3_("'%%'", "'%s'", "'%%'")" ORDER BY order_ ASC LIMIT 1",
|
||||
"FROM gameobject, gameobject_template WHERE gameobject_template.entry = gameobject.id AND map = %i AND name " _LIKE_" " _CONCAT3_("'%%'", "'%s'", "'%%'")" ORDER BY order_ ASC LIMIT 1",
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), name.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ public:
|
||||
|
||||
uint32 haveMap = Map::ExistMap(mapId, gridX, gridY) ? 1 : 0;
|
||||
uint32 haveVMap = Map::ExistVMap(mapId, gridX, gridY) ? 1 : 0;
|
||||
uint32 haveMMap = (MMAP::MMapFactory::IsPathfindingEnabled(mapId) && MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId())) ? 1 : 0;
|
||||
uint32 haveMMap = (MMAP::MMapFactory::IsPathfindingEnabled(mapId) && MMAP::MMapFactory::CreateOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId())) ? 1 : 0;
|
||||
|
||||
if (haveVMap)
|
||||
{
|
||||
@@ -2273,7 +2273,7 @@ public:
|
||||
// stop combat + make player unattackable + duel stop + stop some spells
|
||||
player->setFaction(35);
|
||||
player->CombatStop();
|
||||
if (player->IsNonMeleeSpellCasted(true))
|
||||
if (player->IsNonMeleeSpellCast(true))
|
||||
player->InterruptNonMeleeSpells(true);
|
||||
player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
|
||||
|
||||
@@ -30,11 +30,13 @@
|
||||
#include "PointMovementGenerator.h"
|
||||
#include "PathGenerator.h"
|
||||
#include "MMapFactory.h"
|
||||
#include "DetourCommon.h"
|
||||
#include "Map.h"
|
||||
#include "TargetedMovementGenerator.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "CellImpl.h"
|
||||
#include "MMapManager.h"
|
||||
|
||||
class mmaps_commandscript : public CommandScript
|
||||
{
|
||||
@@ -61,9 +63,137 @@ public:
|
||||
return commandTable;
|
||||
}
|
||||
|
||||
static float Fix_GetXZArea(float* verts, int nv)
|
||||
{
|
||||
float area = 0;
|
||||
for(int i=0; i<nv-1; i++)
|
||||
area+=(verts[i*3]*verts[i*3+5]-verts[i*3+3]*verts[i*3+2]);
|
||||
area += (verts[(nv-1)*3]*verts[2] - verts[0]*verts[(nv-1)*3+2]);
|
||||
return area*0.5f;
|
||||
}
|
||||
|
||||
|
||||
//dtPointInPolygon will return false when the point is too close to the edge,so we rewite the test function.
|
||||
static bool Fix_PointIsInPoly(float* pos,float* verts,int nv,float err)
|
||||
{
|
||||
//poly area
|
||||
float area = abs(Fix_GetXZArea(verts,nv));
|
||||
|
||||
//calculate each area of triangles
|
||||
float TestTri[9];
|
||||
memcpy(TestTri,pos,sizeof(float)*3);
|
||||
float area1 = 0;
|
||||
for(int i=0;i<nv-1;++i)
|
||||
{
|
||||
memcpy(&TestTri[3],&verts[i*3],sizeof(float)*3);
|
||||
memcpy(&TestTri[6],&verts[i*3+3],sizeof(float)*3);
|
||||
area1+= abs(Fix_GetXZArea(TestTri,3));
|
||||
if(area1-err>area)
|
||||
return false;
|
||||
}
|
||||
|
||||
//last one
|
||||
memcpy(&TestTri[3],verts,sizeof(float)*3);
|
||||
memcpy(&TestTri[6],&verts[nv*3-3],sizeof(float)*3);
|
||||
area1+= abs(Fix_GetXZArea(TestTri,3));
|
||||
|
||||
return abs(area1-area)<err;
|
||||
}
|
||||
|
||||
|
||||
static float DistanceToWall(dtNavMeshQuery* navQuery, dtNavMesh* navMesh, float* polyPickExt, dtQueryFilter& filter, float* pos,float* hitPos,float* hitNormal)
|
||||
{
|
||||
float distanceToWall=0;
|
||||
dtPolyRef ref;
|
||||
if(dtStatusSucceed(navQuery->findNearestPoly(pos, polyPickExt, &filter, &ref, 0))==false || ref ==0)
|
||||
return -1;
|
||||
|
||||
const dtMeshTile* tile = 0;
|
||||
const dtPoly* poly = 0;
|
||||
if (dtStatusFailed(navMesh->getTileAndPolyByRef(ref, &tile, &poly)))
|
||||
return -1;
|
||||
|
||||
// Collect vertices.
|
||||
float verts[DT_VERTS_PER_POLYGON*3];
|
||||
int nv = 0;
|
||||
for (int i = 0; i < (int)poly->vertCount; ++i)
|
||||
{
|
||||
dtVcopy(&verts[nv*3], &tile->verts[poly->verts[i]*3]);
|
||||
nv++;
|
||||
}
|
||||
|
||||
bool inside = Fix_PointIsInPoly(pos, verts, nv,0.05f);
|
||||
if(inside == false)
|
||||
return -1;
|
||||
|
||||
if(dtStatusSucceed(navQuery->findDistanceToWall(ref, pos, 100.0f, &filter, &distanceToWall, hitPos, hitNormal))==false)
|
||||
return -1;
|
||||
|
||||
return distanceToWall;
|
||||
}
|
||||
|
||||
#define MIN_WALL_DISTANCE 1.5f //set this value bigger to make the path point far way from wall
|
||||
|
||||
//Try to fix the path,
|
||||
static void FixPath(dtNavMesh* navMesh, dtNavMeshQuery* navQuery, float* polyPickExt, dtQueryFilter& filter, int pathLength, float*& straightPath)
|
||||
{
|
||||
float hitPos[3];
|
||||
float hitNormal[3];
|
||||
float TestPos[3];
|
||||
float distanceToWall=0;
|
||||
float up[3]={0,1,0};
|
||||
float origDis = 0;
|
||||
|
||||
for(int i=1;i<pathLength-1;++i)
|
||||
{
|
||||
dtPolyRef pt;
|
||||
float* pCurPoi=&straightPath[i*3];
|
||||
distanceToWall = DistanceToWall(navQuery, navMesh, polyPickExt, filter, pCurPoi,hitPos,hitNormal);
|
||||
|
||||
if(distanceToWall<MIN_WALL_DISTANCE && distanceToWall>=0)
|
||||
{
|
||||
float vec[3];
|
||||
dtVsub(vec,&straightPath[i*3-3],&straightPath[i*3]);
|
||||
//distanceToWall is 0 means the point is in the edge.so we can't get the hitpos.
|
||||
if(distanceToWall == 0)
|
||||
{
|
||||
//test left side
|
||||
dtVcross(TestPos,vec,up);
|
||||
dtVadd(TestPos,TestPos,pCurPoi);
|
||||
float ft = MIN_WALL_DISTANCE/dtVdist(TestPos,pCurPoi);
|
||||
dtVlerp(TestPos,pCurPoi,TestPos,ft);
|
||||
distanceToWall = DistanceToWall(navQuery, navMesh, polyPickExt, filter,TestPos,hitPos,hitNormal);
|
||||
if(abs(MIN_WALL_DISTANCE - distanceToWall)>0.1f)
|
||||
{
|
||||
//test right side
|
||||
dtVcross(TestPos,up,vec);
|
||||
dtVadd(TestPos,TestPos,pCurPoi);
|
||||
ft = MIN_WALL_DISTANCE/dtVdist(TestPos,pCurPoi);
|
||||
dtVlerp(TestPos,pCurPoi,TestPos,ft);
|
||||
distanceToWall = DistanceToWall(navQuery, navMesh, polyPickExt, filter,TestPos,hitPos,hitNormal);
|
||||
}
|
||||
|
||||
//if test point is better than the orig point,replace it.
|
||||
if(abs(distanceToWall-MIN_WALL_DISTANCE)<0.1f)
|
||||
dtVcopy(pCurPoi,TestPos);
|
||||
}
|
||||
else
|
||||
{
|
||||
//ok,we get the hitpos,just make a ray
|
||||
float ft = MIN_WALL_DISTANCE/distanceToWall;
|
||||
dtVlerp(TestPos,hitPos,pCurPoi,ft);
|
||||
distanceToWall = DistanceToWall(navQuery, navMesh, polyPickExt, filter, TestPos,hitPos,hitNormal);
|
||||
|
||||
if(abs(distanceToWall-MIN_WALL_DISTANCE)<0.1f)
|
||||
dtVcopy(pCurPoi,TestPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static bool HandleMmapPathCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId()))
|
||||
if (!MMAP::MMapFactory::CreateOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId()))
|
||||
{
|
||||
handler->PSendSysMessage("NavMesh not loaded for current map.");
|
||||
return true;
|
||||
@@ -91,10 +221,10 @@ public:
|
||||
player->GetPosition(x, y, z);
|
||||
|
||||
// path
|
||||
PathGenerator path(target);
|
||||
/*PathGenerator path(target);
|
||||
path.SetUseStraightPath(useStraightPath);
|
||||
bool result = path.CalculatePath(x, y, z);
|
||||
|
||||
|
||||
Movement::PointsArray const& pointPath = path.GetPath();
|
||||
handler->PSendSysMessage("%s's path to %s:", target->GetName().c_str(), player->GetName().c_str());
|
||||
handler->PSendSysMessage("Building: %s", useStraightPath ? "StraightPath" : "SmoothPath");
|
||||
@@ -107,13 +237,64 @@ public:
|
||||
handler->PSendSysMessage("StartPosition (%.3f, %.3f, %.3f)", start.x, start.y, start.z);
|
||||
handler->PSendSysMessage("EndPosition (%.3f, %.3f, %.3f)", end.x, end.y, end.z);
|
||||
handler->PSendSysMessage("ActualEndPosition (%.3f, %.3f, %.3f)", actualEnd.x, actualEnd.y, actualEnd.z);
|
||||
*/
|
||||
float m_spos[3];
|
||||
m_spos[0] = -y;
|
||||
m_spos[1] = z;
|
||||
m_spos[2] = -x;
|
||||
|
||||
//
|
||||
float m_epos[3];
|
||||
m_epos[0] = -target->GetPositionY();
|
||||
m_epos[1] = target->GetPositionZ();
|
||||
m_epos[2] = -target->GetPositionX();
|
||||
|
||||
//
|
||||
dtQueryFilter m_filter;
|
||||
m_filter.setIncludeFlags(3);
|
||||
m_filter.setExcludeFlags(2);
|
||||
|
||||
//
|
||||
float m_polyPickExt[3];
|
||||
m_polyPickExt[0] = 2.5f;
|
||||
m_polyPickExt[1] = 2.5f;
|
||||
m_polyPickExt[2] = 2.5f;
|
||||
|
||||
//
|
||||
dtPolyRef m_startRef;
|
||||
dtPolyRef m_endRef;
|
||||
|
||||
const dtNavMesh* navMesh = MMAP::MMapFactory::CreateOrGetMMapManager()->GetNavMesh(player->GetMapId());
|
||||
const dtNavMeshQuery* navMeshQuery = MMAP::MMapFactory::CreateOrGetMMapManager()->GetNavMeshQuery(player->GetMapId(), handler->GetSession()->GetPlayer()->GetInstanceId());
|
||||
|
||||
float nearestPt[3];
|
||||
|
||||
navMeshQuery->findNearestPoly(m_spos, m_polyPickExt, &m_filter, &m_startRef, nearestPt);
|
||||
navMeshQuery->findNearestPoly(m_epos, m_polyPickExt, &m_filter, &m_endRef, nearestPt);
|
||||
|
||||
if ( !m_startRef || !m_endRef )
|
||||
{
|
||||
std::cerr << "Could not find any nearby poly's (" << m_startRef << "," << m_endRef << ")" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int hops;
|
||||
dtPolyRef* hopBuffer = new dtPolyRef[8192];
|
||||
dtStatus status = navMeshQuery->findPath(m_startRef, m_endRef, m_spos, m_epos, &m_filter, hopBuffer, &hops, 8192);
|
||||
|
||||
int resultHopCount;
|
||||
float* straightPath = new float[2048*3];
|
||||
unsigned char* pathFlags = new unsigned char[2048];
|
||||
dtPolyRef* pathRefs = new dtPolyRef[2048];
|
||||
|
||||
status = navMeshQuery->findStraightPath(m_spos, m_epos, hopBuffer, hops, straightPath, pathFlags, pathRefs, &resultHopCount, 2048);
|
||||
FixPath(const_cast<dtNavMesh*>(navMesh), const_cast<dtNavMeshQuery*>(navMeshQuery), m_polyPickExt, m_filter, resultHopCount, straightPath);
|
||||
for (uint32 i = 0; i < resultHopCount; ++i)
|
||||
player->SummonCreature(VISUAL_WAYPOINT, -straightPath[i * 3 + 2], -straightPath[i * 3 + 0], straightPath[i * 3 + 1], 0, TEMPSUMMON_TIMED_DESPAWN, 9000);
|
||||
|
||||
if (!player->IsGameMaster())
|
||||
handler->PSendSysMessage("Enable GM mode to see the path points.");
|
||||
|
||||
for (uint32 i = 0; i < pointPath.size(); ++i)
|
||||
player->SummonCreature(VISUAL_WAYPOINT, pointPath[i].x, pointPath[i].y, pointPath[i].z, 0, TEMPSUMMON_TIMED_DESPAWN, 9000);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -131,8 +312,8 @@ public:
|
||||
handler->PSendSysMessage("gridloc [%i, %i]", gx, gy);
|
||||
|
||||
// calculate navmesh tile location
|
||||
dtNavMesh const* navmesh = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId());
|
||||
dtNavMeshQuery const* navmeshquery = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMeshQuery(handler->GetSession()->GetPlayer()->GetMapId(), player->GetInstanceId());
|
||||
dtNavMesh const* navmesh = MMAP::MMapFactory::CreateOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId());
|
||||
dtNavMeshQuery const* navmeshquery = MMAP::MMapFactory::CreateOrGetMMapManager()->GetNavMeshQuery(handler->GetSession()->GetPlayer()->GetMapId(), player->GetInstanceId());
|
||||
if (!navmesh || !navmeshquery)
|
||||
{
|
||||
handler->PSendSysMessage("NavMesh not loaded for current map.");
|
||||
@@ -142,8 +323,8 @@ public:
|
||||
float const* min = navmesh->getParams()->orig;
|
||||
float x, y, z;
|
||||
player->GetPosition(x, y, z);
|
||||
float location[VERTEX_SIZE] = {y, z, x};
|
||||
float extents[VERTEX_SIZE] = {3.0f, 5.0f, 3.0f};
|
||||
float location[] = {y, z, x};
|
||||
float extents[] = {3.0f, 5.0f, 3.0f};
|
||||
|
||||
int32 tilex = int32((y - min[0]) / SIZE_OF_GRIDS);
|
||||
int32 tiley = int32((x - min[2]) / SIZE_OF_GRIDS);
|
||||
@@ -152,14 +333,14 @@ public:
|
||||
|
||||
// navmesh poly -> navmesh tile location
|
||||
dtQueryFilter filter = dtQueryFilter();
|
||||
dtPolyRef polyRef = INVALID_POLYREF;
|
||||
dtPolyRef polyRef = 0;
|
||||
if (dtStatusFailed(navmeshquery->findNearestPoly(location, extents, &filter, &polyRef, NULL)))
|
||||
{
|
||||
handler->PSendSysMessage("Dt [??,??] (invalid poly, probably no tile loaded)");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (polyRef == INVALID_POLYREF)
|
||||
if (polyRef == 0)
|
||||
handler->PSendSysMessage("Dt [??, ??] (invalid poly, probably no tile loaded)");
|
||||
else
|
||||
{
|
||||
@@ -183,8 +364,8 @@ public:
|
||||
static bool HandleMmapLoadedTilesCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
uint32 mapid = handler->GetSession()->GetPlayer()->GetMapId();
|
||||
dtNavMesh const* navmesh = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(mapid);
|
||||
dtNavMeshQuery const* navmeshquery = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMeshQuery(mapid, handler->GetSession()->GetPlayer()->GetInstanceId());
|
||||
dtNavMesh const* navmesh = MMAP::MMapFactory::CreateOrGetMMapManager()->GetNavMesh(mapid);
|
||||
dtNavMeshQuery const* navmeshquery = MMAP::MMapFactory::CreateOrGetMMapManager()->GetNavMeshQuery(mapid, handler->GetSession()->GetPlayer()->GetInstanceId());
|
||||
if (!navmesh || !navmeshquery)
|
||||
{
|
||||
handler->PSendSysMessage("NavMesh not loaded for current map.");
|
||||
@@ -211,8 +392,8 @@ public:
|
||||
handler->PSendSysMessage("mmap stats:");
|
||||
handler->PSendSysMessage(" global mmap pathfinding is %sabled", MMAP::MMapFactory::IsPathfindingEnabled(mapId) ? "en" : "dis");
|
||||
|
||||
MMAP::MMapManager* manager = MMAP::MMapFactory::createOrGetMMapManager();
|
||||
handler->PSendSysMessage(" %u maps loaded with %u tiles overall", manager->getLoadedMapsCount(), manager->getLoadedTilesCount());
|
||||
MMAP::MMapManager* manager = MMAP::MMapFactory::CreateOrGetMMapManager();
|
||||
handler->PSendSysMessage(" %u maps loaded with %u tiles overall", manager->GetLoadedMapsCount(), manager->GetLoadedTilesCount());
|
||||
|
||||
dtNavMesh const* navmesh = manager->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId());
|
||||
if (!navmesh)
|
||||
|
||||
@@ -276,7 +276,11 @@ public:
|
||||
|
||||
uint32 db_guid = creature->GetDBTableGUIDLow();
|
||||
|
||||
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
|
||||
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells()
|
||||
// current "creature" variable is deleted and created fresh new, otherwise old values might trigger asserts or cause undefined behavior
|
||||
creature->CleanupsBeforeDelete();
|
||||
delete creature;
|
||||
creature = new Creature();
|
||||
if (!creature->LoadCreatureFromDB(db_guid, map))
|
||||
{
|
||||
delete creature;
|
||||
|
||||
@@ -201,7 +201,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// All creature/GO slain/casted (not required, but otherwise it will display "Creature slain 0/10")
|
||||
// All creature/GO slain/cast (not required, but otherwise it will display "Creature slain 0/10")
|
||||
for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
{
|
||||
int32 creature = quest->RequiredNpcOrGo[i];
|
||||
|
||||
@@ -208,7 +208,7 @@ class boss_alizabal : public CreatureScript
|
||||
{
|
||||
DoCast(target, SPELL_SKEWER, true);
|
||||
Talk(SAY_SKEWER);
|
||||
Talk(SAY_SKEWER_ANNOUNCE, target->GetGUID());
|
||||
Talk(SAY_SKEWER_ANNOUNCE, target);
|
||||
}
|
||||
_skewer = true;
|
||||
events.ScheduleEvent(EVENT_RANDOM_CAST, urand(7000, 10000));
|
||||
|
||||
+5
-17
@@ -117,7 +117,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_grimstoneAI(creature);
|
||||
return GetInstanceAI<npc_grimstoneAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_grimstoneAI : public npc_escortAI
|
||||
@@ -207,12 +207,9 @@ public:
|
||||
Event_Timer = 5000;
|
||||
break;
|
||||
case 5:
|
||||
if (instance)
|
||||
{
|
||||
instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, NPC_GRIMSTONE, me);
|
||||
instance->SetData(TYPE_RING_OF_LAW, DONE);
|
||||
TC_LOG_DEBUG("scripts", "npc_grimstone: event reached end and set complete.");
|
||||
}
|
||||
instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, NPC_GRIMSTONE, me);
|
||||
instance->SetData(TYPE_RING_OF_LAW, DONE);
|
||||
TC_LOG_DEBUG("scripts", "npc_grimstone: event reached end and set complete.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -224,9 +221,6 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (MobDeath_Timer)
|
||||
{
|
||||
if (MobDeath_Timer <= diff)
|
||||
@@ -1237,7 +1231,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_rocknotAI(creature);
|
||||
return GetInstanceAI<npc_rocknotAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_rocknotAI : public npc_escortAI
|
||||
@@ -1269,9 +1263,6 @@ public:
|
||||
|
||||
void WaypointReached(uint32 waypointId) OVERRIDE
|
||||
{
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
switch (waypointId)
|
||||
{
|
||||
case 1:
|
||||
@@ -1295,9 +1286,6 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (BreakKeg_Timer)
|
||||
{
|
||||
if (BreakKeg_Timer <= diff)
|
||||
|
||||
+2
-2
@@ -39,7 +39,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_draganthaurissanAI(creature);
|
||||
return GetInstanceAI<boss_draganthaurissanAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_draganthaurissanAI : public ScriptedAI
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_HANDOFTHAURISSAN);
|
||||
|
||||
//3 Hands of Thaurissan will be casted
|
||||
//3 Hands of Thaurissan will be cast
|
||||
//if (Counter < 3)
|
||||
//{
|
||||
// HandOfThaurissan_Timer = 1000;
|
||||
|
||||
+7
-12
@@ -140,7 +140,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_doomrelAI(creature);
|
||||
return GetInstanceAI<boss_doomrelAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_doomrelAI : public ScriptedAI
|
||||
@@ -170,13 +170,10 @@ public:
|
||||
// was set before event start, so set again
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
|
||||
|
||||
if (instance)
|
||||
{
|
||||
if (instance->GetData(DATA_GHOSTKILL) >= 7)
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
else
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
}
|
||||
if (instance->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*/) OVERRIDE
|
||||
@@ -192,14 +189,12 @@ public:
|
||||
if (me->IsAlive())
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
me->SetLootRecipient(NULL);
|
||||
if (instance)
|
||||
instance->SetData64(DATA_EVENSTARTER, 0);
|
||||
instance->SetData64(DATA_EVENSTARTER, 0);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_GHOSTKILL, 1);
|
||||
instance->SetData(DATA_GHOSTKILL, 1);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_gythAI(creature);
|
||||
return GetInstanceAI<boss_gythAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+2
-3
@@ -64,8 +64,7 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_LORD_VALTHALAK, DONE);
|
||||
instance->SetData(DATA_LORD_VALTHALAK, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
@@ -128,7 +127,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_lord_valthalakAI(creature);
|
||||
return GetInstanceAI<boss_lord_valthalakAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+35
-44
@@ -79,23 +79,20 @@ public:
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
{
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
|
||||
events.Reset();
|
||||
// Apply auras on spawn and reset
|
||||
// DoCast(me, SPELL_FIRE_SHIELD_TRIGGER); // Need to find this in old DBC if possible
|
||||
me->RemoveAura(SPELL_EMBERSEER_FULL_STRENGTH);
|
||||
me->RemoveAura(SPELL_EMBERSEER_GROWING);
|
||||
me->RemoveAura(SPELL_EMBERSEER_GROWING_TRIGGER);
|
||||
events.ScheduleEvent(EVENT_RESPAWN, 5000);
|
||||
// Hack for missing trigger spell
|
||||
events.ScheduleEvent(EVENT_FIRE_SHIELD, 3000);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
|
||||
events.Reset();
|
||||
// Apply auras on spawn and reset
|
||||
// DoCast(me, SPELL_FIRE_SHIELD_TRIGGER); // Need to find this in old DBC if possible
|
||||
me->RemoveAura(SPELL_EMBERSEER_FULL_STRENGTH);
|
||||
me->RemoveAura(SPELL_EMBERSEER_GROWING);
|
||||
me->RemoveAura(SPELL_EMBERSEER_GROWING_TRIGGER);
|
||||
events.ScheduleEvent(EVENT_RESPAWN, 5000);
|
||||
// Hack for missing trigger spell
|
||||
events.ScheduleEvent(EVENT_FIRE_SHIELD, 3000);
|
||||
|
||||
// Open doors on reset
|
||||
if (instance->GetBossState(DATA_PYROGAURD_EMBERSEER) == IN_PROGRESS)
|
||||
OpenDoors(false); // Opens 2 entrance doors
|
||||
}
|
||||
// Open doors on reset
|
||||
if (instance->GetBossState(DATA_PYROGAURD_EMBERSEER) == IN_PROGRESS)
|
||||
OpenDoors(false); // Opens 2 entrance doors
|
||||
}
|
||||
|
||||
void SetData(uint32 /*type*/, uint32 data) OVERRIDE
|
||||
@@ -132,15 +129,12 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
{
|
||||
// Activate all the runes
|
||||
UpdateRunes(GO_STATE_READY);
|
||||
// Opens all 3 doors
|
||||
OpenDoors(true);
|
||||
// Complete encounter
|
||||
instance->SetBossState(DATA_PYROGAURD_EMBERSEER, DONE);
|
||||
}
|
||||
// Activate all the runes
|
||||
UpdateRunes(GO_STATE_READY);
|
||||
// Opens all 3 doors
|
||||
OpenDoors(true);
|
||||
// Complete encounter
|
||||
instance->SetBossState(DATA_PYROGAURD_EMBERSEER, DONE);
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) OVERRIDE
|
||||
@@ -185,24 +179,21 @@ public:
|
||||
|
||||
void UpdateRunes(GOState state)
|
||||
{
|
||||
if (instance)
|
||||
{
|
||||
// update all runes
|
||||
if (GameObject* rune1 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_1)))
|
||||
rune1->SetGoState(state);
|
||||
if (GameObject* rune2 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_2)))
|
||||
rune2->SetGoState(state);
|
||||
if (GameObject* rune3 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_3)))
|
||||
rune3->SetGoState(state);
|
||||
if (GameObject* rune4 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_4)))
|
||||
rune4->SetGoState(state);
|
||||
if (GameObject* rune5 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_5)))
|
||||
rune5->SetGoState(state);
|
||||
if (GameObject* rune6 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_6)))
|
||||
rune6->SetGoState(state);
|
||||
if (GameObject* rune7 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_7)))
|
||||
rune7->SetGoState(state);
|
||||
}
|
||||
// update all runes
|
||||
if (GameObject* rune1 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_1)))
|
||||
rune1->SetGoState(state);
|
||||
if (GameObject* rune2 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_2)))
|
||||
rune2->SetGoState(state);
|
||||
if (GameObject* rune3 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_3)))
|
||||
rune3->SetGoState(state);
|
||||
if (GameObject* rune4 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_4)))
|
||||
rune4->SetGoState(state);
|
||||
if (GameObject* rune5 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_5)))
|
||||
rune5->SetGoState(state);
|
||||
if (GameObject* rune6 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_6)))
|
||||
rune6->SetGoState(state);
|
||||
if (GameObject* rune7 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_7)))
|
||||
rune7->SetGoState(state);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
@@ -316,7 +307,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_pyroguard_emberseerAI(creature);
|
||||
return GetInstanceAI<boss_pyroguard_emberseerAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -438,7 +438,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_rend_blackhandAI(creature);
|
||||
return GetInstanceAI<boss_rend_blackhandAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+7
-8
@@ -23,11 +23,11 @@
|
||||
enum Spells
|
||||
{
|
||||
SPELL_SNAPKICK = 15618,
|
||||
SPELL_CLEAVE = 15579,
|
||||
SPELL_CLEAVE = 15284,
|
||||
SPELL_UPPERCUT = 10966,
|
||||
SPELL_MORTALSTRIKE = 16856,
|
||||
SPELL_PUMMEL = 15615,
|
||||
SPELL_THROWAXE = 16075,
|
||||
SPELL_THROWAXE = 16075
|
||||
};
|
||||
|
||||
enum Events
|
||||
@@ -37,7 +37,7 @@ enum Events
|
||||
EVENT_UPPERCUT = 3,
|
||||
EVENT_MORTAL_STRIKE = 4,
|
||||
EVENT_PUMMEL = 5,
|
||||
EVENT_THROW_AXE = 6,
|
||||
EVENT_THROW_AXE = 6
|
||||
};
|
||||
|
||||
class boss_warmaster_voone : public CreatureScript
|
||||
@@ -45,11 +45,6 @@ class boss_warmaster_voone : public CreatureScript
|
||||
public:
|
||||
boss_warmaster_voone() : CreatureScript("boss_warmaster_voone") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_warmastervooneAI(creature);
|
||||
}
|
||||
|
||||
struct boss_warmastervooneAI : public BossAI
|
||||
{
|
||||
boss_warmastervooneAI(Creature* creature) : BossAI(creature, DATA_WARMASTER_VOONE) { }
|
||||
@@ -119,6 +114,10 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_warmastervooneAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_warmastervoone()
|
||||
|
||||
+1
-1
@@ -116,7 +116,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_broodlordAI(creature);
|
||||
return GetInstanceAI<boss_broodlordAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -282,7 +282,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_chromaggusAI(creature);
|
||||
return GetInstanceAI<boss_chromaggusAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_ebonrocAI(creature);
|
||||
return GetInstanceAI<boss_ebonrocAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_firemawAI(creature);
|
||||
return GetInstanceAI<boss_firemawAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_flamegorAI(creature);
|
||||
return GetInstanceAI<boss_flamegorAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+5
-5
@@ -170,11 +170,12 @@ public:
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
SpawnedAdds = 0;
|
||||
|
||||
if (me->GetMapId() == 469)
|
||||
{
|
||||
if (!me->FindNearestCreature(NPC_NEFARIAN, 1000.0f, true))
|
||||
_Reset();
|
||||
SpawnedAdds = 0;
|
||||
|
||||
me->SetVisible(true);
|
||||
me->SetPhaseMask(1, true);
|
||||
@@ -376,7 +377,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_victor_nefariusAI(creature);
|
||||
return GetInstanceAI<boss_victor_nefariusAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -443,8 +444,7 @@ public:
|
||||
{
|
||||
if (canDespawn && DespawnTimer <= diff)
|
||||
{
|
||||
if (instance)
|
||||
instance->SetBossState(BOSS_NEFARIAN, FAIL);
|
||||
instance->SetBossState(BOSS_NEFARIAN, FAIL);
|
||||
|
||||
std::list<Creature*> constructList;
|
||||
me->GetCreatureListWithEntryInGrid(constructList, NPC_BONE_CONSTRUCT, 500.0f);
|
||||
@@ -572,7 +572,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_nefarianAI(creature);
|
||||
return GetInstanceAI<boss_nefarianAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+3
-5
@@ -75,8 +75,7 @@ public:
|
||||
_Reset();
|
||||
|
||||
secondPhase = false;
|
||||
if (instance)
|
||||
instance->SetData(DATA_EGG_EVENT, NOT_STARTED);
|
||||
instance->SetData(DATA_EGG_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
@@ -84,8 +83,7 @@ public:
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_EGG_EVENT, NOT_STARTED);
|
||||
instance->SetData(DATA_EGG_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void DoChangePhase()
|
||||
@@ -156,7 +154,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_razorgoreAI(creature);
|
||||
return GetInstanceAI<boss_razorgoreAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ class npc_core_rager : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_core_ragerAI(creature);
|
||||
return GetInstanceAI<npc_core_ragerAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+2
-3
@@ -161,8 +161,7 @@ class boss_majordomo : public CreatureScript
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
break;
|
||||
case EVENT_OUTRO_2:
|
||||
if (instance)
|
||||
instance->instance->SummonCreature(NPC_RAGNAROS, RagnarosSummonPos);
|
||||
instance->instance->SummonCreature(NPC_RAGNAROS, RagnarosSummonPos);
|
||||
break;
|
||||
case EVENT_OUTRO_3:
|
||||
Talk(SAY_ARRIVAL2_MAJ);
|
||||
@@ -207,7 +206,7 @@ class boss_majordomo : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_majordomoAI(creature);
|
||||
return GetInstanceAI<boss_majordomoAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -147,9 +147,8 @@ class boss_ragnaros : public CreatureScript
|
||||
break;
|
||||
case EVENT_INTRO_4:
|
||||
Talk(SAY_ARRIVAL5_RAG);
|
||||
if (instance)
|
||||
if (Creature* executus = Unit::GetCreature(*me, instance->GetData64(BOSS_MAJORDOMO_EXECUTUS)))
|
||||
me->Kill(executus);
|
||||
if (Creature* executus = Unit::GetCreature(*me, instance->GetData64(BOSS_MAJORDOMO_EXECUTUS)))
|
||||
me->Kill(executus);
|
||||
break;
|
||||
case EVENT_INTRO_5:
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
@@ -163,29 +162,26 @@ class boss_ragnaros : public CreatureScript
|
||||
}
|
||||
else
|
||||
{
|
||||
if (instance)
|
||||
if (_isBanished && ((_emergeTimer <= diff) || (instance->GetData(DATA_RAGNAROS_ADDS)) > 8))
|
||||
{
|
||||
if (_isBanished && ((_emergeTimer <= diff) || (instance->GetData(DATA_RAGNAROS_ADDS)) > 8))
|
||||
{
|
||||
//Become unbanished again
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->setFaction(14);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
AttackStart(target);
|
||||
instance->SetData(DATA_RAGNAROS_ADDS, 0);
|
||||
//Become unbanished again
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->setFaction(14);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
AttackStart(target);
|
||||
instance->SetData(DATA_RAGNAROS_ADDS, 0);
|
||||
|
||||
//DoCast(me, SPELL_RAGEMERGE); //"phase spells" didnt worked correctly so Ive commented them and wrote solution witch doesnt need core support
|
||||
_isBanished = false;
|
||||
}
|
||||
else if (_isBanished)
|
||||
{
|
||||
_emergeTimer -= diff;
|
||||
//Do nothing while banished
|
||||
return;
|
||||
}
|
||||
//DoCast(me, SPELL_RAGEMERGE); //"phase spells" didnt worked correctly so Ive commented them and wrote solution witch doesnt need core support
|
||||
_isBanished = false;
|
||||
}
|
||||
else if (_isBanished)
|
||||
{
|
||||
_emergeTimer -= diff;
|
||||
//Do nothing while banished
|
||||
return;
|
||||
}
|
||||
|
||||
//Return since we have no target
|
||||
@@ -306,7 +302,7 @@ class boss_ragnaros : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_ragnarosAI(creature);
|
||||
return GetInstanceAI<boss_ragnarosAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -324,8 +320,7 @@ class npc_son_of_flame : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_RAGNAROS_ADDS, 1);
|
||||
instance->SetData(DATA_RAGNAROS_ADDS, 1);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 /*diff*/) OVERRIDE
|
||||
@@ -342,7 +337,7 @@ class npc_son_of_flame : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_son_of_flameAI(creature);
|
||||
return GetInstanceAI<npc_son_of_flameAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_mr_smiteAI(creature);
|
||||
return GetInstanceAI<boss_mr_smiteAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_mr_smiteAI : public ScriptedAI
|
||||
@@ -127,12 +127,11 @@ public:
|
||||
++uiHealth;
|
||||
DoCastAOE(SPELL_SMITE_STOMP, false);
|
||||
SetCombatMovement(false);
|
||||
if (instance)
|
||||
if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_SMITE_CHEST)))
|
||||
{
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MovePoint(1, go->GetPositionX() - 3.0f, go->GetPositionY(), go->GetPositionZ());
|
||||
}
|
||||
if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_SMITE_CHEST)))
|
||||
{
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MovePoint(1, go->GetPositionX() - 3.0f, go->GetPositionY(), go->GetPositionZ());
|
||||
}
|
||||
}
|
||||
|
||||
if (uiPhase)
|
||||
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_blastmaster_emi_shortfuseAI(creature);
|
||||
return GetInstanceAI<npc_blastmaster_emi_shortfuseAI>(creature);
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
|
||||
@@ -186,20 +186,15 @@ public:
|
||||
|
||||
if (bBool)
|
||||
{
|
||||
if (instance)
|
||||
if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
|
||||
instance->HandleGameObject(0, false, go);
|
||||
if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
|
||||
instance->HandleGameObject(0, false, go);
|
||||
}else
|
||||
if (instance)
|
||||
if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT)))
|
||||
instance->HandleGameObject(0, false, go);
|
||||
if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT)))
|
||||
instance->HandleGameObject(0, false, go);
|
||||
}
|
||||
|
||||
void SetInFace(bool bBool)
|
||||
{
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (bBool)
|
||||
{
|
||||
if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
|
||||
@@ -211,9 +206,6 @@ public:
|
||||
|
||||
void RestoreAll()
|
||||
{
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
|
||||
instance->HandleGameObject(0, false, go);
|
||||
|
||||
@@ -318,9 +310,6 @@ public:
|
||||
NextStep(2000, true);
|
||||
break;
|
||||
case 2:
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
switch (uiValue)
|
||||
{
|
||||
case 1:
|
||||
@@ -441,9 +430,8 @@ public:
|
||||
SetInFace(true);
|
||||
Talk(SAY_BLASTMASTER_5);
|
||||
Summon(1);
|
||||
if (instance)
|
||||
if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
|
||||
instance->HandleGameObject(0, true, go);
|
||||
if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
|
||||
instance->HandleGameObject(0, true, go);
|
||||
NextStep(3000, true);
|
||||
break;
|
||||
case 7:
|
||||
@@ -488,9 +476,8 @@ public:
|
||||
case 16:
|
||||
Talk(SAY_BLASTMASTER_14);
|
||||
SetInFace(false);
|
||||
if (instance)
|
||||
if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT)))
|
||||
instance->HandleGameObject(0, true, go);
|
||||
if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT)))
|
||||
instance->HandleGameObject(0, true, go);
|
||||
NextStep(2000, true);
|
||||
break;
|
||||
case 17:
|
||||
|
||||
@@ -82,6 +82,7 @@ public:
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
ResetTimer = 0;
|
||||
Midnight = 0;
|
||||
}
|
||||
|
||||
void EnterEvadeMode() OVERRIDE
|
||||
|
||||
@@ -98,7 +98,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_moroesAI(creature);
|
||||
return GetInstanceAI<boss_moroesAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_moroesAI : public ScriptedAI
|
||||
@@ -138,14 +138,12 @@ public:
|
||||
if (me->IsAlive())
|
||||
SpawnAdds();
|
||||
|
||||
if (instance)
|
||||
instance->SetData(TYPE_MOROES, NOT_STARTED);
|
||||
instance->SetData(TYPE_MOROES, NOT_STARTED);
|
||||
}
|
||||
|
||||
void StartEvent()
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(TYPE_MOROES, IN_PROGRESS);
|
||||
instance->SetData(TYPE_MOROES, IN_PROGRESS);
|
||||
|
||||
DoZoneInCombat();
|
||||
}
|
||||
@@ -168,14 +166,12 @@ public:
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
if (instance)
|
||||
instance->SetData(TYPE_MOROES, DONE);
|
||||
instance->SetData(TYPE_MOROES, DONE);
|
||||
|
||||
DeSpawnAdds();
|
||||
|
||||
//remove aura from spell Garrote when Moroes dies
|
||||
if (instance)
|
||||
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_GARROTE);
|
||||
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_GARROTE);
|
||||
}
|
||||
|
||||
void SpawnAdds()
|
||||
@@ -349,15 +345,11 @@ struct boss_moroes_guestAI : public ScriptedAI
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(TYPE_MOROES, NOT_STARTED);
|
||||
instance->SetData(TYPE_MOROES, NOT_STARTED);
|
||||
}
|
||||
|
||||
void AcquireGUID()
|
||||
{
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (Creature* Moroes = Unit::GetCreature(*me, instance->GetData64(DATA_MOROES)))
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
if (uint64 GUID = CAST_AI(boss_moroes::boss_moroesAI, Moroes->AI())->AddGUID[i])
|
||||
@@ -393,7 +385,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_baroness_dorothea_millstipeAI(creature);
|
||||
return GetInstanceAI<boss_baroness_dorothea_millstipeAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_baroness_dorothea_millstipeAI : public boss_moroes_guestAI
|
||||
@@ -456,7 +448,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_baron_rafe_dreugerAI(creature);
|
||||
return GetInstanceAI<boss_baron_rafe_dreugerAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_baron_rafe_dreugerAI : public boss_moroes_guestAI
|
||||
@@ -513,7 +505,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_lady_catriona_von_indiAI(creature);
|
||||
return GetInstanceAI<boss_lady_catriona_von_indiAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_lady_catriona_von_indiAI : public boss_moroes_guestAI
|
||||
@@ -583,7 +575,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_lady_keira_berrybuckAI(creature);
|
||||
return GetInstanceAI<boss_lady_keira_berrybuckAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_lady_keira_berrybuckAI : public boss_moroes_guestAI
|
||||
@@ -657,7 +649,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_lord_robin_darisAI(creature);
|
||||
return GetInstanceAI<boss_lord_robin_darisAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_lord_robin_darisAI : public boss_moroes_guestAI
|
||||
@@ -713,7 +705,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_lord_crispin_ferenceAI(creature);
|
||||
return GetInstanceAI<boss_lord_crispin_ferenceAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_lord_crispin_ferenceAI : public boss_moroes_guestAI
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_netherspiteAI(creature);
|
||||
return GetInstanceAI<boss_netherspiteAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_netherspiteAI : public ScriptedAI
|
||||
@@ -172,7 +172,7 @@ public:
|
||||
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
|
||||
// the one who's been cast upon before
|
||||
Unit* current = Unit::GetUnit(*portal, BeamTarget[j]);
|
||||
// temporary store for the best suitable beam reciever
|
||||
Unit* target = me;
|
||||
@@ -308,7 +308,7 @@ public:
|
||||
|
||||
if (PhaseTimer <= diff)
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
if (!me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
SwitchToBanishPhase();
|
||||
return;
|
||||
@@ -327,7 +327,7 @@ public:
|
||||
|
||||
if (PhaseTimer <= diff)
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
if (!me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
SwitchToPortalPhase();
|
||||
return;
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_nightbaneAI(creature);
|
||||
return GetInstanceAI<boss_nightbaneAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_nightbaneAI : public ScriptedAI
|
||||
@@ -131,13 +131,10 @@ public:
|
||||
me->SetWalk(false);
|
||||
me->setActive(true);
|
||||
|
||||
if (instance)
|
||||
{
|
||||
if (instance->GetData(TYPE_NIGHTBANE) == DONE || instance->GetData(TYPE_NIGHTBANE) == IN_PROGRESS)
|
||||
me->DisappearAndDie();
|
||||
else
|
||||
instance->SetData(TYPE_NIGHTBANE, NOT_STARTED);
|
||||
}
|
||||
if (instance->GetData(TYPE_NIGHTBANE) == DONE || instance->GetData(TYPE_NIGHTBANE) == IN_PROGRESS)
|
||||
me->DisappearAndDie();
|
||||
else
|
||||
instance->SetData(TYPE_NIGHTBANE, NOT_STARTED);
|
||||
|
||||
HandleTerraceDoors(true);
|
||||
|
||||
@@ -153,17 +150,13 @@ public:
|
||||
|
||||
void HandleTerraceDoors(bool open)
|
||||
{
|
||||
if (instance)
|
||||
{
|
||||
instance->HandleGameObject(instance->GetData64(DATA_MASTERS_TERRACE_DOOR_1), open);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_MASTERS_TERRACE_DOOR_2), open);
|
||||
}
|
||||
instance->HandleGameObject(instance->GetData64(DATA_MASTERS_TERRACE_DOOR_1), open);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_MASTERS_TERRACE_DOOR_2), open);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(TYPE_NIGHTBANE, IN_PROGRESS);
|
||||
instance->SetData(TYPE_NIGHTBANE, IN_PROGRESS);
|
||||
|
||||
HandleTerraceDoors(false);
|
||||
Talk(YELL_AGGRO);
|
||||
@@ -177,8 +170,7 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(TYPE_NIGHTBANE, DONE);
|
||||
instance->SetData(TYPE_NIGHTBANE, DONE);
|
||||
|
||||
HandleTerraceDoors(true);
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_malchezaarAI(creature);
|
||||
return GetInstanceAI<boss_malchezaarAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_malchezaarAI : public ScriptedAI
|
||||
@@ -239,8 +239,7 @@ public:
|
||||
SunderArmorTimer = urand(5000, 10000);
|
||||
phase = 1;
|
||||
|
||||
if (instance)
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_NETHER_DOOR), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_NETHER_DOOR), true);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) OVERRIDE
|
||||
@@ -260,16 +259,14 @@ public:
|
||||
for (uint8 i = 0; i < TOTAL_INFERNAL_POINTS; ++i)
|
||||
positions.push_back(&InfernalPoints[i]);
|
||||
|
||||
if (instance)
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_NETHER_DOOR), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_NETHER_DOOR), true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
if (instance)
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_NETHER_DOOR), false); // Open the door leading further in
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_NETHER_DOOR), false); // Open the door leading further in
|
||||
}
|
||||
|
||||
void InfernalCleanup()
|
||||
@@ -569,7 +566,7 @@ public:
|
||||
|
||||
void DoMeleeAttacksIfReady()
|
||||
{
|
||||
if (me->IsWithinMeleeRange(me->GetVictim()) && !me->IsNonMeleeSpellCasted(false))
|
||||
if (me->IsWithinMeleeRange(me->GetVictim()) && !me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
//Check for base attack
|
||||
if (me->isAttackReady() && me->GetVictim())
|
||||
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_aranAI(creature);
|
||||
return GetInstanceAI<boss_aranAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_aranAI : public ScriptedAI
|
||||
@@ -147,12 +147,9 @@ public:
|
||||
Drinking = false;
|
||||
DrinkInturrupted = false;
|
||||
|
||||
if (instance)
|
||||
{
|
||||
// Not in progress
|
||||
instance->SetData(TYPE_ARAN, NOT_STARTED);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_LIBRARY_DOOR), true);
|
||||
}
|
||||
// Not in progress
|
||||
instance->SetData(TYPE_ARAN, NOT_STARTED);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_LIBRARY_DOOR), true);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) OVERRIDE
|
||||
@@ -164,22 +161,16 @@ public:
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
if (instance)
|
||||
{
|
||||
instance->SetData(TYPE_ARAN, DONE);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_LIBRARY_DOOR), true);
|
||||
}
|
||||
instance->SetData(TYPE_ARAN, DONE);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_LIBRARY_DOOR), true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
if (instance)
|
||||
{
|
||||
instance->SetData(TYPE_ARAN, IN_PROGRESS);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_LIBRARY_DOOR), false);
|
||||
}
|
||||
instance->SetData(TYPE_ARAN, IN_PROGRESS);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_LIBRARY_DOOR), false);
|
||||
}
|
||||
|
||||
void FlameWreathEffect()
|
||||
@@ -226,11 +217,8 @@ public:
|
||||
{
|
||||
if (CloseDoorTimer <= diff)
|
||||
{
|
||||
if (instance)
|
||||
{
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_LIBRARY_DOOR), false);
|
||||
CloseDoorTimer = 0;
|
||||
}
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_LIBRARY_DOOR), false);
|
||||
CloseDoorTimer = 0;
|
||||
} else CloseDoorTimer -= diff;
|
||||
}
|
||||
|
||||
@@ -305,7 +293,7 @@ public:
|
||||
//Normal casts
|
||||
if (NormalCastTimer <= diff)
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
if (!me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
if (!target)
|
||||
@@ -486,10 +474,10 @@ public:
|
||||
|
||||
void SpellHit(Unit* /*pAttacker*/, const SpellInfo* Spell) OVERRIDE
|
||||
{
|
||||
//We only care about interrupt effects and only if they are durring a spell currently being casted
|
||||
//We only care about interrupt effects and only if they are durring a spell currently being cast
|
||||
if ((Spell->Effects[0].Effect != SPELL_EFFECT_INTERRUPT_CAST &&
|
||||
Spell->Effects[1].Effect != SPELL_EFFECT_INTERRUPT_CAST &&
|
||||
Spell->Effects[2].Effect != SPELL_EFFECT_INTERRUPT_CAST) || !me->IsNonMeleeSpellCasted(false))
|
||||
Spell->Effects[2].Effect != SPELL_EFFECT_INTERRUPT_CAST) || !me->IsNonMeleeSpellCast(false))
|
||||
return;
|
||||
|
||||
//Interrupt effect
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_kilrekAI(creature);
|
||||
return GetInstanceAI<npc_kilrekAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_kilrekAI : public ScriptedAI
|
||||
@@ -95,25 +95,17 @@ public:
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
if (!instance)
|
||||
{
|
||||
ERROR_INST_DATA(me);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
uint64 TerestianGUID = instance->GetData64(DATA_TERESTIAN);
|
||||
if (TerestianGUID)
|
||||
{
|
||||
uint64 TerestianGUID = instance->GetData64(DATA_TERESTIAN);
|
||||
if (TerestianGUID)
|
||||
{
|
||||
Unit* Terestian = Unit::GetUnit(*me, TerestianGUID);
|
||||
if (Terestian && Terestian->IsAlive())
|
||||
DoCast(Terestian, SPELL_BROKEN_PACT, true);
|
||||
}
|
||||
} else ERROR_INST_DATA(me);
|
||||
Unit* Terestian = Unit::GetUnit(*me, TerestianGUID);
|
||||
if (Terestian && Terestian->IsAlive())
|
||||
DoCast(Terestian, SPELL_BROKEN_PACT, true);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
@@ -256,7 +248,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_terestianAI(creature);
|
||||
return GetInstanceAI<boss_terestianAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_terestianAI : public ScriptedAI
|
||||
@@ -306,8 +298,7 @@ public:
|
||||
SummonedPortals = false;
|
||||
Berserk = false;
|
||||
|
||||
if (instance)
|
||||
instance->SetData(TYPE_TERESTIAN, NOT_STARTED);
|
||||
instance->SetData(TYPE_TERESTIAN, NOT_STARTED);
|
||||
|
||||
me->RemoveAurasDueToSpell(SPELL_BROKEN_PACT);
|
||||
|
||||
@@ -362,8 +353,7 @@ public:
|
||||
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
if (instance)
|
||||
instance->SetData(TYPE_TERESTIAN, DONE);
|
||||
instance->SetData(TYPE_TERESTIAN, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
|
||||
@@ -118,7 +118,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_dorotheeAI(creature);
|
||||
return GetInstanceAI<boss_dorotheeAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_dorotheeAI : public ScriptedAI
|
||||
@@ -167,8 +167,7 @@ public:
|
||||
{
|
||||
Talk(SAY_DOROTHEE_DEATH);
|
||||
|
||||
if (instance)
|
||||
SummonCroneIfReady(instance, me);
|
||||
SummonCroneIfReady(instance, me);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who) OVERRIDE
|
||||
@@ -299,7 +298,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_strawmanAI(creature);
|
||||
return GetInstanceAI<boss_strawmanAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_strawmanAI : public ScriptedAI
|
||||
@@ -366,8 +365,7 @@ public:
|
||||
{
|
||||
Talk(SAY_STRAWMAN_DEATH);
|
||||
|
||||
if (instance)
|
||||
SummonCroneIfReady(instance, me);
|
||||
SummonCroneIfReady(instance, me);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) OVERRIDE
|
||||
@@ -414,7 +412,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_tinheadAI(creature);
|
||||
return GetInstanceAI<boss_tinheadAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_tinheadAI : public ScriptedAI
|
||||
@@ -472,8 +470,7 @@ public:
|
||||
{
|
||||
Talk(SAY_TINHEAD_DEATH);
|
||||
|
||||
if (instance)
|
||||
SummonCroneIfReady(instance, me);
|
||||
SummonCroneIfReady(instance, me);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) OVERRIDE
|
||||
@@ -524,7 +521,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_roarAI(creature);
|
||||
return GetInstanceAI<boss_roarAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_roarAI : public ScriptedAI
|
||||
@@ -580,8 +577,7 @@ public:
|
||||
{
|
||||
Talk(SAY_ROAR_DEATH);
|
||||
|
||||
if (instance)
|
||||
SummonCroneIfReady(instance, me);
|
||||
SummonCroneIfReady(instance, me);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) OVERRIDE
|
||||
@@ -633,7 +629,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_croneAI(creature);
|
||||
return GetInstanceAI<boss_croneAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_croneAI : public ScriptedAI
|
||||
@@ -675,15 +671,12 @@ public:
|
||||
{
|
||||
Talk(SAY_CRONE_DEATH);
|
||||
|
||||
if (instance)
|
||||
{
|
||||
instance->SetData(TYPE_OPERA, DONE);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORLEFT), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
|
||||
instance->SetData(TYPE_OPERA, DONE);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORLEFT), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
|
||||
|
||||
if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
|
||||
pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
}
|
||||
if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
|
||||
pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
@@ -813,7 +806,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_bigbadwolfAI(creature);
|
||||
return GetInstanceAI<boss_bigbadwolfAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_bigbadwolfAI : public ScriptedAI
|
||||
@@ -865,15 +858,12 @@ public:
|
||||
{
|
||||
DoPlaySoundToSet(me, SOUND_WOLF_DEATH);
|
||||
|
||||
if (instance)
|
||||
{
|
||||
instance->SetData(TYPE_OPERA, DONE);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORLEFT), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
|
||||
instance->SetData(TYPE_OPERA, DONE);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORLEFT), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
|
||||
|
||||
if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
|
||||
pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
}
|
||||
if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
|
||||
pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
@@ -1015,7 +1005,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_julianneAI(creature);
|
||||
return GetInstanceAI<boss_julianneAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_julianneAI : public ScriptedAI
|
||||
@@ -1112,14 +1102,11 @@ public:
|
||||
{
|
||||
Talk(SAY_JULIANNE_DEATH02);
|
||||
|
||||
if (instance)
|
||||
{
|
||||
instance->SetData(TYPE_OPERA, DONE);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORLEFT), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
|
||||
if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
|
||||
pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
}
|
||||
instance->SetData(TYPE_OPERA, DONE);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORLEFT), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
|
||||
if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
|
||||
pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) OVERRIDE
|
||||
@@ -1138,7 +1125,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_romuloAI(creature);
|
||||
return GetInstanceAI<boss_romuloAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_romuloAI : public ScriptedAI
|
||||
@@ -1267,15 +1254,12 @@ public:
|
||||
{
|
||||
Talk(SAY_ROMULO_DEATH);
|
||||
|
||||
if (instance)
|
||||
{
|
||||
instance->SetData(TYPE_OPERA, DONE);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORLEFT), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
|
||||
instance->SetData(TYPE_OPERA, DONE);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORLEFT), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
|
||||
|
||||
if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
|
||||
pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
}
|
||||
if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
|
||||
pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) OVERRIDE
|
||||
|
||||
@@ -158,15 +158,11 @@ public:
|
||||
|
||||
PerformanceReady = false;
|
||||
|
||||
if (instance)
|
||||
m_uiEventId = instance->GetData(DATA_OPERA_PERFORMANCE);
|
||||
m_uiEventId = instance->GetData(DATA_OPERA_PERFORMANCE);
|
||||
}
|
||||
|
||||
void StartEvent()
|
||||
{
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
instance->SetData(TYPE_OPERA, IN_PROGRESS);
|
||||
|
||||
//resets count for this event, in case earlier failed
|
||||
@@ -180,9 +176,6 @@ public:
|
||||
|
||||
void WaypointReached(uint32 waypointId) OVERRIDE
|
||||
{
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
switch (waypointId)
|
||||
{
|
||||
case 0:
|
||||
@@ -412,7 +405,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_barnesAI(creature);
|
||||
return GetInstanceAI<npc_barnesAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -476,7 +469,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_image_of_medivhAI(creature);
|
||||
return GetInstanceAI<npc_image_of_medivhAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_image_of_medivhAI : public ScriptedAI
|
||||
@@ -500,6 +493,8 @@ public:
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
ArcanagosGUID = 0;
|
||||
EventStarted = false;
|
||||
YellTimer = 0;
|
||||
|
||||
if (instance && instance->GetData64(DATA_IMAGE_OF_MEDIVH) == 0)
|
||||
{
|
||||
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* c) const OVERRIDE
|
||||
{
|
||||
return new boss_felblood_kaelthasAI(c);
|
||||
return GetInstanceAI<boss_felblood_kaelthasAI>(c);
|
||||
}
|
||||
|
||||
struct boss_felblood_kaelthasAI : public ScriptedAI
|
||||
@@ -150,17 +150,13 @@ public:
|
||||
|
||||
Phase = 0;
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_KAELTHAS_EVENT, NOT_STARTED);
|
||||
instance->SetData(DATA_KAELTHAS_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
instance->SetData(DATA_KAELTHAS_EVENT, DONE);
|
||||
|
||||
// Enable the Translocation Orb Exit
|
||||
@@ -176,9 +172,6 @@ public:
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
instance->SetData(DATA_KAELTHAS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
@@ -371,8 +364,7 @@ public:
|
||||
Talk(SAY_GRAVITY_LAPSE);
|
||||
FirstGravityLapse = false;
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_KAELTHAS_STATUES, 1);
|
||||
instance->SetData(DATA_KAELTHAS_STATUES, 1);
|
||||
}
|
||||
else
|
||||
Talk(SAY_RECAST_GRAVITY);
|
||||
@@ -482,7 +474,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* c) const OVERRIDE
|
||||
{
|
||||
return new npc_felkael_phoenixAI(c);
|
||||
return GetInstanceAI<npc_felkael_phoenixAI>(c);
|
||||
}
|
||||
|
||||
struct npc_felkael_phoenixAI : public ScriptedAI
|
||||
|
||||
@@ -110,7 +110,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_priestess_delrissaAI(creature);
|
||||
return GetInstanceAI<boss_priestess_delrissaAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_priestess_delrissaAI : public ScriptedAI
|
||||
@@ -153,8 +153,7 @@ public:
|
||||
//this mean she at some point evaded
|
||||
void JustReachedHome() OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_DELRISSA_EVENT, FAIL);
|
||||
instance->SetData(DATA_DELRISSA_EVENT, FAIL);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who) OVERRIDE
|
||||
@@ -173,8 +172,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_DELRISSA_EVENT, IN_PROGRESS);
|
||||
instance->SetData(DATA_DELRISSA_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void InitializeLackeys()
|
||||
@@ -241,9 +239,6 @@ public:
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (instance->GetData(DATA_DELRISSA_DEATH_COUNT) == MAX_ACTIVE_LACKEY)
|
||||
instance->SetData(DATA_DELRISSA_EVENT, DONE);
|
||||
else
|
||||
@@ -393,36 +388,30 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
||||
if (!who)
|
||||
return;
|
||||
|
||||
if (instance)
|
||||
for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
|
||||
if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUIDs[i]))
|
||||
{
|
||||
if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUIDs[i]))
|
||||
if (!pAdd->GetVictim() && pAdd != me)
|
||||
{
|
||||
if (!pAdd->GetVictim() && pAdd != me)
|
||||
{
|
||||
who->SetInCombatWith(pAdd);
|
||||
pAdd->AddThreat(who, 0.0f);
|
||||
}
|
||||
who->SetInCombatWith(pAdd);
|
||||
pAdd->AddThreat(who, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Creature* pDelrissa = Unit::GetCreature(*me, instance->GetData64(DATA_DELRISSA)))
|
||||
if (Creature* pDelrissa = Unit::GetCreature(*me, instance->GetData64(DATA_DELRISSA)))
|
||||
{
|
||||
if (pDelrissa->IsAlive() && !pDelrissa->GetVictim())
|
||||
{
|
||||
if (pDelrissa->IsAlive() && !pDelrissa->GetVictim())
|
||||
{
|
||||
who->SetInCombatWith(pDelrissa);
|
||||
pDelrissa->AddThreat(who, 0.0f);
|
||||
}
|
||||
who->SetInCombatWith(pDelrissa);
|
||||
pDelrissa->AddThreat(who, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
Creature* pDelrissa = Unit::GetCreature(*me, instance->GetData64(DATA_DELRISSA));
|
||||
uint32 uiLackeyDeathCount = instance->GetData(DATA_DELRISSA_DEATH_COUNT);
|
||||
|
||||
@@ -452,18 +441,12 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
||||
|
||||
void KilledUnit(Unit* victim) OVERRIDE
|
||||
{
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (Creature* Delrissa = Unit::GetCreature(*me, instance->GetData64(DATA_DELRISSA)))
|
||||
Delrissa->AI()->KilledUnit(victim);
|
||||
}
|
||||
|
||||
void AcquireGUIDs()
|
||||
{
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (Creature* Delrissa = (Unit::GetCreature(*me, instance->GetData64(DATA_DELRISSA))))
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
|
||||
@@ -504,7 +487,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_kagani_nightstrikeAI(creature);
|
||||
return GetInstanceAI<boss_kagani_nightstrikeAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_kagani_nightstrikeAI : public boss_priestess_lackey_commonAI
|
||||
@@ -608,7 +591,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_ellris_duskhallowAI(creature);
|
||||
return GetInstanceAI<boss_ellris_duskhallowAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_ellris_duskhallowAI : public boss_priestess_lackey_commonAI
|
||||
@@ -699,7 +682,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_eramas_brightblazeAI(creature);
|
||||
return GetInstanceAI<boss_eramas_brightblazeAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_eramas_brightblazeAI : public boss_priestess_lackey_commonAI
|
||||
@@ -760,7 +743,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_yazzaiAI(creature);
|
||||
return GetInstanceAI<boss_yazzaiAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_yazzaiAI : public boss_priestess_lackey_commonAI
|
||||
@@ -890,7 +873,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_warlord_salarisAI(creature);
|
||||
return GetInstanceAI<boss_warlord_salarisAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_warlord_salarisAI : public boss_priestess_lackey_commonAI
|
||||
@@ -1010,7 +993,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_garaxxasAI(creature);
|
||||
return GetInstanceAI<boss_garaxxasAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_garaxxasAI : public boss_priestess_lackey_commonAI
|
||||
@@ -1068,7 +1051,7 @@ public:
|
||||
|
||||
if (Freezing_Trap_Timer <= diff)
|
||||
{
|
||||
//attempt find go summoned from spell (casted by me)
|
||||
//attempt find go summoned from spell (cast by me)
|
||||
GameObject* go = me->GetGameObject(SPELL_FREEZING_TRAP);
|
||||
|
||||
//if we have a go, we need to wait (only one trap at a time)
|
||||
@@ -1121,7 +1104,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_apokoAI(creature);
|
||||
return GetInstanceAI<boss_apokoAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_apokoAI : public boss_priestess_lackey_commonAI
|
||||
@@ -1219,7 +1202,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_zelfanAI(creature);
|
||||
return GetInstanceAI<boss_zelfanAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_zelfanAI : public boss_priestess_lackey_commonAI
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_selin_fireheartAI(creature);
|
||||
return GetInstanceAI<boss_selin_fireheartAI>(creature);
|
||||
};
|
||||
|
||||
struct boss_selin_fireheartAI : public ScriptedAI
|
||||
@@ -77,16 +77,13 @@ public:
|
||||
|
||||
Crystals.clear();
|
||||
//GUIDs per instance is static, so we only need to load them once.
|
||||
if (instance)
|
||||
uint32 size = instance->GetData(DATA_FEL_CRYSTAL_SIZE);
|
||||
for (uint8 i = 0; i < size; ++i)
|
||||
{
|
||||
uint32 size = instance->GetData(DATA_FEL_CRYSTAL_SIZE);
|
||||
for (uint8 i = 0; i < size; ++i)
|
||||
{
|
||||
instance->SetData64(DATA_FEL_CRYSTAL, i);
|
||||
uint64 guid = instance->GetData64(DATA_FEL_CRYSTAL);
|
||||
TC_LOG_DEBUG("scripts", "Selin: Adding Fel Crystal " UI64FMTD " to list", guid);
|
||||
Crystals.push_back(guid);
|
||||
}
|
||||
instance->SetData64(DATA_FEL_CRYSTAL, i);
|
||||
uint64 guid = instance->GetData64(DATA_FEL_CRYSTAL);
|
||||
TC_LOG_DEBUG("scripts", "Selin: Adding Fel Crystal " UI64FMTD " to list", guid);
|
||||
Crystals.push_back(guid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,25 +104,22 @@ public:
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
//for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
|
||||
for (std::list<uint64>::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
|
||||
{
|
||||
//for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
|
||||
for (std::list<uint64>::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
|
||||
//Unit* unit = Unit::GetUnit(*me, FelCrystals[i]);
|
||||
if (Creature* creature = Unit::GetCreature(*me, *itr))
|
||||
{
|
||||
//Unit* unit = Unit::GetUnit(*me, FelCrystals[i]);
|
||||
if (Creature* creature = Unit::GetCreature(*me, *itr))
|
||||
{
|
||||
if (!creature->IsAlive())
|
||||
creature->Respawn(); // Let the core handle setting death state, etc.
|
||||
if (!creature->IsAlive())
|
||||
creature->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.
|
||||
creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
// Only need to set unselectable flag. You can't attack unselectable units so non_attackable flag is not necessary here.
|
||||
creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
}
|
||||
|
||||
// Set Inst data for encounter
|
||||
instance->SetData(DATA_SELIN_EVENT, NOT_STARTED);
|
||||
} else TC_LOG_ERROR("scripts", ERROR_INST_DATA);
|
||||
// Set Inst data for encounter
|
||||
instance->SetData(DATA_SELIN_EVENT, NOT_STARTED);
|
||||
|
||||
DrainLifeTimer = urand(3000, 7000);
|
||||
DrainManaTimer = DrainLifeTimer + 5000;
|
||||
@@ -200,8 +194,7 @@ public:
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
if (instance)
|
||||
instance->SetData(DATA_SELIN_EVENT, IN_PROGRESS);
|
||||
instance->SetData(DATA_SELIN_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) OVERRIDE
|
||||
@@ -235,9 +228,6 @@ public:
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
instance->SetData(DATA_SELIN_EVENT, DONE); // Encounter complete!
|
||||
ShatterRemainingCrystals();
|
||||
}
|
||||
@@ -271,7 +261,7 @@ public:
|
||||
|
||||
if (FelExplosionTimer <= diff)
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
if (!me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
DoCast(me, SPELL_FEL_EXPLOSION);
|
||||
FelExplosionTimer = 2000;
|
||||
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_vexallusAI(creature);
|
||||
return GetInstanceAI<boss_vexallusAI>(creature);
|
||||
};
|
||||
|
||||
struct boss_vexallusAI : public BossAI
|
||||
@@ -103,8 +103,7 @@ public:
|
||||
IntervalHealthAmount = 1;
|
||||
Enraged = false;
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED);
|
||||
instance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) OVERRIDE
|
||||
@@ -115,16 +114,14 @@ public:
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
summons.DespawnAll();
|
||||
if (instance)
|
||||
instance->SetData(DATA_VEXALLUS_EVENT, DONE);
|
||||
instance->SetData(DATA_VEXALLUS_EVENT, DONE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS);
|
||||
instance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned) OVERRIDE
|
||||
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
if (!bShielded && !HealthAbovePct(50))
|
||||
{
|
||||
//wait if we already casting
|
||||
if (me->IsNonMeleeSpellCasted(false))
|
||||
if (me->IsNonMeleeSpellCast(false))
|
||||
return;
|
||||
|
||||
Talk(SAY_SPECIALAE);
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
return;
|
||||
|
||||
//If we are <50% hp cast Soul Siphon rank 1
|
||||
if (!HealthAbovePct(50) && !me->IsNonMeleeSpellCasted(false))
|
||||
if (!HealthAbovePct(50) && !me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
//SoulSiphon_Timer
|
||||
if (SoulSiphon_Timer <= diff)
|
||||
|
||||
@@ -374,7 +374,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_headless_horsemanAI(creature);
|
||||
return GetInstanceAI<boss_headless_horsemanAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_headless_horsemanAI : public ScriptedAI
|
||||
@@ -382,6 +382,7 @@ public:
|
||||
boss_headless_horsemanAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
headGUID = 0;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
@@ -434,8 +435,7 @@ public:
|
||||
}
|
||||
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
|
||||
//if (instance)
|
||||
// instance->SetData(DATA_HORSEMAN_EVENT, NOT_STARTED);
|
||||
//instance->SetData(DATA_HORSEMAN_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void FlyMode()
|
||||
@@ -471,8 +471,7 @@ public:
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
if (instance)
|
||||
instance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject
|
||||
instance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject
|
||||
break;
|
||||
case 19:
|
||||
me->SetDisableGravity(false);
|
||||
@@ -494,8 +493,7 @@ public:
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_HORSEMAN_EVENT, IN_PROGRESS);
|
||||
instance->SetData(DATA_HORSEMAN_EVENT, IN_PROGRESS);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
@@ -569,8 +567,7 @@ public:
|
||||
flame->CastSpell(flame, SPELL_BODY_FLAME, false);
|
||||
if (Creature* wisp = DoSpawnCreature(WISP_INVIS, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 60000))
|
||||
CAST_AI(npc_wisp_invis::npc_wisp_invisAI, wisp->AI())->SetType(4);
|
||||
if (instance)
|
||||
instance->SetData(DATA_HORSEMAN_EVENT, DONE);
|
||||
instance->SetData(DATA_HORSEMAN_EVENT, DONE);
|
||||
|
||||
Map::PlayerList const& players = me->GetMap()->GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
@@ -800,8 +797,8 @@ public:
|
||||
float x, y, z;
|
||||
me->GetPosition(x, y, z); //this visual aura some under ground
|
||||
me->SetPosition(x, y, z + 0.35f, 0.0f);
|
||||
Despawn();
|
||||
debuffGUID = 0;
|
||||
Despawn();
|
||||
Creature* debuff = DoSpawnCreature(HELPER, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 14500);
|
||||
if (debuff)
|
||||
{
|
||||
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
return;
|
||||
|
||||
//If we are <30% hp goes Enraged
|
||||
if (!Enrage && !HealthAbovePct(30) && !me->IsNonMeleeSpellCasted(false))
|
||||
if (!Enrage && !HealthAbovePct(30) && !me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
Talk(EMOTE_ENRAGE);
|
||||
Talk(SAY_ENRAGE);
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ public:
|
||||
return;
|
||||
|
||||
//If we are <25% hp cast Heal
|
||||
if (!HealthAbovePct(25) && !me->IsNonMeleeSpellCasted(false) && Heal_Timer <= diff)
|
||||
if (!HealthAbovePct(25) && !me->IsNonMeleeSpellCast(false) && Heal_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_HEAL);
|
||||
Heal_Timer = 30000;
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_interrogator_vishasAI(creature);
|
||||
return GetInstanceAI<boss_interrogator_vishasAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_interrogator_vishasAI : public ScriptedAI
|
||||
@@ -67,6 +67,8 @@ public:
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
ShadowWordPain_Timer = 5000;
|
||||
Yell60 = false;
|
||||
Yell30 = false;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
@@ -81,9 +83,6 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
//Any other Actions to do with vorrel? setStandState?
|
||||
if (Creature* vorrel = Creature::GetCreature(*me, instance->GetData64(DATA_VORREL)))
|
||||
vorrel->AI()->Talk(SAY_TRIGGER_VORREL);
|
||||
|
||||
+15
-27
@@ -65,7 +65,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_scarlet_commander_mograineAI(creature);
|
||||
return GetInstanceAI<boss_scarlet_commander_mograineAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_scarlet_commander_mograineAI : public ScriptedAI
|
||||
@@ -94,9 +94,8 @@ public:
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
|
||||
if (instance)
|
||||
if (me->IsAlive())
|
||||
instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
|
||||
if (me->IsAlive())
|
||||
instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
|
||||
|
||||
_bHasDied = false;
|
||||
_bHeal = false;
|
||||
@@ -105,11 +104,8 @@ public:
|
||||
|
||||
void JustReachedHome() OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
{
|
||||
if (instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) != NOT_STARTED)
|
||||
instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL);
|
||||
}
|
||||
if (instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) != NOT_STARTED)
|
||||
instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
@@ -130,9 +126,6 @@ public:
|
||||
if (damage < me->GetHealth() || _bHasDied || _bFakeDeath)
|
||||
return;
|
||||
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
//On first death, fake death and open door, as well as initiate whitemane if exist
|
||||
if (Unit* Whitemane = Unit::GetUnit(*me, instance->GetData64(DATA_WHITEMANE)))
|
||||
{
|
||||
@@ -145,7 +138,7 @@ public:
|
||||
|
||||
me->SetHealth(0);
|
||||
|
||||
if (me->IsNonMeleeSpellCasted(false))
|
||||
if (me->IsNonMeleeSpellCast(false))
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
|
||||
me->ClearComboPointHolders();
|
||||
@@ -170,8 +163,7 @@ public:
|
||||
Talk(SAY_MO_RESSURECTED);
|
||||
_bFakeDeath = false;
|
||||
|
||||
if (instance)
|
||||
instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL);
|
||||
instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,7 +223,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_high_inquisitor_whitemaneAI(creature);
|
||||
return GetInstanceAI<boss_high_inquisitor_whitemaneAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_high_inquisitor_whitemaneAI : public ScriptedAI
|
||||
@@ -261,9 +253,8 @@ public:
|
||||
_bCanResurrectCheck = false;
|
||||
_bCanResurrect = false;
|
||||
|
||||
if (instance)
|
||||
if (me->IsAlive())
|
||||
instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
|
||||
if (me->IsAlive())
|
||||
instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who) OVERRIDE
|
||||
@@ -313,7 +304,7 @@ public:
|
||||
//Cast Deep sleep when health is less than 50%
|
||||
if (!_bCanResurrectCheck && !HealthAbovePct(50))
|
||||
{
|
||||
if (me->IsNonMeleeSpellCasted(false))
|
||||
if (me->IsNonMeleeSpellCast(false))
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
|
||||
DoCastVictim(SPELL_DEEPSLEEP);
|
||||
@@ -334,14 +325,11 @@ public:
|
||||
if (!HealthAbovePct(75))
|
||||
target = me;
|
||||
|
||||
if (instance)
|
||||
if (Creature* mograine = Unit::GetCreature((*me), instance->GetData64(DATA_MOGRAINE)))
|
||||
{
|
||||
if (Creature* mograine = Unit::GetCreature((*me), instance->GetData64(DATA_MOGRAINE)))
|
||||
{
|
||||
// checking _bCanResurrectCheck prevents her healing Mograine while he is "faking death"
|
||||
if (_bCanResurrectCheck && mograine->IsAlive() && !mograine->HealthAbovePct(75))
|
||||
target = mograine;
|
||||
}
|
||||
// checking _bCanResurrectCheck prevents her healing Mograine while he is "faking death"
|
||||
if (_bCanResurrectCheck && mograine->IsAlive() && !mograine->HealthAbovePct(75))
|
||||
target = mograine;
|
||||
}
|
||||
|
||||
if (target)
|
||||
|
||||
@@ -128,7 +128,7 @@ class boss_darkmaster_gandling : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_darkmaster_gandlingAI(creature);
|
||||
return GetInstanceAI<boss_darkmaster_gandlingAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ class boss_instructor_malicia : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_RENEW, 10000);
|
||||
break;
|
||||
case EVENT_FLASHHEAL:
|
||||
//5 Flashheals will be casted
|
||||
//5 Flashheals will be cast
|
||||
DoCast(me, SPELL_FLASHHEAL);
|
||||
if (FlashCounter < 2)
|
||||
{
|
||||
@@ -113,7 +113,7 @@ class boss_instructor_malicia : public CreatureScript
|
||||
}
|
||||
break;
|
||||
case EVENT_HEALINGTOUCH:
|
||||
//3 Healing Touch will be casted
|
||||
//3 Healing Touch will be cast
|
||||
DoCast(me, SPELL_HEALINGTOUCH);
|
||||
if (TouchCounter < 2)
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ enum Spells
|
||||
//SPELL_ILLUSION = 17773,
|
||||
|
||||
// Spells of Illusion of Jandice Barov
|
||||
SPELL_CLEAVE = 15584
|
||||
SPELL_CLEAVE = 15284
|
||||
};
|
||||
|
||||
class boss_jandice_barov : public CreatureScript
|
||||
|
||||
@@ -253,7 +253,7 @@ class boss_kirtonos_the_herald : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_kirtonos_the_heraldAI(creature);
|
||||
return GetInstanceAI<boss_kirtonos_the_heraldAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -28,8 +28,9 @@ EndScriptData */
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_IMMOLATE = 20294, // Old ID was 15570
|
||||
SPELL_VEILOFSHADOW = 17820
|
||||
SPELL_IMMOLATE = 20294,
|
||||
SPELL_VEILOFSHADOW = 17820,
|
||||
SPELL_UNHOLY_AURA = 17467
|
||||
};
|
||||
|
||||
enum Events
|
||||
@@ -49,7 +50,9 @@ class boss_lord_alexei_barov : public CreatureScript
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
_Reset();
|
||||
me->LoadCreaturesAddon();
|
||||
|
||||
if (!me->HasAura(SPELL_UNHOLY_AURA))
|
||||
DoCast(me, SPELL_UNHOLY_AURA);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_shadowfang_prisonerAI(creature);
|
||||
return GetInstanceAI<npc_shadowfang_prisonerAI>(creature);
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
|
||||
@@ -135,8 +135,7 @@ public:
|
||||
else
|
||||
Talk(SAY_POST1_DOOR_AD);
|
||||
|
||||
if (instance)
|
||||
instance->SetData(TYPE_FREE_NPC, DONE);
|
||||
instance->SetData(TYPE_FREE_NPC, DONE);
|
||||
break;
|
||||
case 13:
|
||||
if (me->GetEntry() != NPC_ASH)
|
||||
@@ -158,7 +157,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_arugal_voidwalkerAI(creature);
|
||||
return GetInstanceAI<npc_arugal_voidwalkerAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_arugal_voidwalkerAI : public ScriptedAI
|
||||
@@ -196,8 +195,7 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(TYPE_FENRUS, instance->GetData(TYPE_FENRUS) + 1);
|
||||
instance->SetData(TYPE_FENRUS, instance->GetData(TYPE_FENRUS) + 1);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_baron_rivendareAI(creature);
|
||||
return GetInstanceAI<boss_baron_rivendareAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_baron_rivendareAI : public ScriptedAI
|
||||
@@ -99,8 +99,8 @@ public:
|
||||
|
||||
void AttackStart(Unit* who) OVERRIDE
|
||||
{
|
||||
if (instance)//can't use entercombat(), boss' dmg aura sets near players in combat, before entering the room's door
|
||||
instance->SetData(TYPE_BARON, IN_PROGRESS);
|
||||
//can't use entercombat(), boss' dmg aura sets near players in combat, before entering the room's door
|
||||
instance->SetData(TYPE_BARON, IN_PROGRESS);
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
|
||||
@@ -110,11 +110,10 @@ public:
|
||||
summoned->AI()->AttackStart(target);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(TYPE_BARON, DONE);
|
||||
}
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
instance->SetData(TYPE_BARON, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_baroness_anastariAI(creature);
|
||||
return GetInstanceAI<boss_baroness_anastariAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_baroness_anastariAI : public ScriptedAI
|
||||
@@ -71,11 +71,10 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(TYPE_BARONESS, IN_PROGRESS);
|
||||
}
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
instance->SetData(TYPE_BARONESS, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
//BalnazzarTransform
|
||||
if (HealthBelowPct(40))
|
||||
{
|
||||
if (me->IsNonMeleeSpellCasted(false))
|
||||
if (me->IsNonMeleeSpellCast(false))
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
|
||||
//restore hp, mana and stun
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_maleki_the_pallidAI(creature);
|
||||
return GetInstanceAI<boss_maleki_the_pallidAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_maleki_the_pallidAI : public ScriptedAI
|
||||
@@ -72,8 +72,7 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(TYPE_PALLID, IN_PROGRESS);
|
||||
instance->SetData(TYPE_PALLID, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_nerubenkanAI(creature);
|
||||
return GetInstanceAI<boss_nerubenkanAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_nerubenkanAI : public ScriptedAI
|
||||
@@ -73,8 +73,7 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(TYPE_NERUB, IN_PROGRESS);
|
||||
instance->SetData(TYPE_NERUB, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void RaiseUndeadScarab(Unit* victim)
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_silver_hand_bossesAI(creature);
|
||||
return GetInstanceAI<boss_silver_hand_bossesAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_silver_hand_bossesAI : public ScriptedAI
|
||||
@@ -78,26 +78,23 @@ public:
|
||||
HolyLight_Timer = 20000;
|
||||
DivineShield_Timer = 20000;
|
||||
|
||||
if (instance)
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case SH_AELMAR:
|
||||
instance->SetData(TYPE_SH_AELMAR, 0);
|
||||
break;
|
||||
case SH_CATHELA:
|
||||
instance->SetData(TYPE_SH_CATHELA, 0);
|
||||
break;
|
||||
case SH_GREGOR:
|
||||
instance->SetData(TYPE_SH_GREGOR, 0);
|
||||
break;
|
||||
case SH_NEMAS:
|
||||
instance->SetData(TYPE_SH_NEMAS, 0);
|
||||
break;
|
||||
case SH_VICAR:
|
||||
instance->SetData(TYPE_SH_VICAR, 0);
|
||||
break;
|
||||
}
|
||||
case SH_AELMAR:
|
||||
instance->SetData(TYPE_SH_AELMAR, 0);
|
||||
break;
|
||||
case SH_CATHELA:
|
||||
instance->SetData(TYPE_SH_CATHELA, 0);
|
||||
break;
|
||||
case SH_GREGOR:
|
||||
instance->SetData(TYPE_SH_GREGOR, 0);
|
||||
break;
|
||||
case SH_NEMAS:
|
||||
instance->SetData(TYPE_SH_NEMAS, 0);
|
||||
break;
|
||||
case SH_VICAR:
|
||||
instance->SetData(TYPE_SH_VICAR, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,9 +104,6 @@ public:
|
||||
|
||||
void JustDied(Unit* killer) OVERRIDE
|
||||
{
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case SH_AELMAR:
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_ramstein_the_gorgerAI(creature);
|
||||
return GetInstanceAI<boss_ramstein_the_gorgerAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_ramstein_the_gorgerAI : public ScriptedAI
|
||||
@@ -78,8 +78,7 @@ public:
|
||||
mob->AI()->AttackStart(me->SelectNearestTarget(100.0f));
|
||||
}
|
||||
|
||||
if (instance)
|
||||
instance->SetData(TYPE_RAMSTEIN, DONE);
|
||||
instance->SetData(TYPE_RAMSTEIN, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
|
||||
@@ -217,7 +217,7 @@ public:
|
||||
{
|
||||
if (ConflagrationTimer <= diff)
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
if (!me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
me->InterruptSpell(CURRENT_GENERIC_SPELL);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
@@ -230,7 +230,7 @@ public:
|
||||
{
|
||||
if (ShadownovaTimer <= diff)
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
if (!me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (target)
|
||||
@@ -249,7 +249,7 @@ public:
|
||||
|
||||
if (ConfoundingblowTimer <= diff)
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
if (!me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_CONFOUNDING_BLOW);
|
||||
@@ -276,7 +276,7 @@ public:
|
||||
|
||||
if (ShadowbladesTimer <= diff)
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
if (!me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
DoCast(me, SPELL_SHADOW_BLADES);
|
||||
ShadowbladesTimer = 10000;
|
||||
@@ -291,7 +291,7 @@ public:
|
||||
Enraged = true;
|
||||
} else EnrageTimer -= diff;
|
||||
|
||||
if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false))
|
||||
if (me->isAttackReady() && !me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
//If we are within range melee the target
|
||||
if (me->IsWithinMeleeRange(me->GetVictim()))
|
||||
@@ -548,7 +548,7 @@ public:
|
||||
{
|
||||
if (ShadownovaTimer <= diff)
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
if (!me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_SHADOW_NOVA);
|
||||
@@ -560,7 +560,7 @@ public:
|
||||
{
|
||||
if (ConflagrationTimer <= diff)
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
if (!me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
me->InterruptSpell(CURRENT_GENERIC_SPELL);
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
@@ -582,7 +582,7 @@ public:
|
||||
|
||||
if (FlamesearTimer <= diff)
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
if (!me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
DoCast(me, SPELL_FLAME_SEAR);
|
||||
FlamesearTimer = 15000;
|
||||
@@ -591,7 +591,7 @@ public:
|
||||
|
||||
if (PyrogenicsTimer <= diff)
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
if (!me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
DoCast(me, SPELL_PYROGENICS, true);
|
||||
PyrogenicsTimer = 15000;
|
||||
@@ -600,7 +600,7 @@ public:
|
||||
|
||||
if (BlazeTimer <= diff)
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
if (!me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
DoCastVictim(SPELL_BLAZE);
|
||||
BlazeTimer = 3800;
|
||||
@@ -691,7 +691,7 @@ public:
|
||||
|
||||
if (DarkstrikeTimer <= diff)
|
||||
{
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
if (!me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
//If we are within range melee the target
|
||||
if (me->IsWithinMeleeRange(me->GetVictim()))
|
||||
|
||||
@@ -404,7 +404,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->IsNonMeleeSpellCasted(false))
|
||||
if (me->IsNonMeleeSpellCast(false))
|
||||
return;
|
||||
|
||||
if (phase == PHASE_GROUND)
|
||||
|
||||
@@ -441,7 +441,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_kalecAI(creature);
|
||||
return GetInstanceAI<boss_kalecAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_kalecAI : public ScriptedAI
|
||||
@@ -464,8 +464,7 @@ public:
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
SathGUID = instance->GetData64(DATA_SATHROVARR);
|
||||
SathGUID = instance->GetData64(DATA_SATHROVARR);
|
||||
|
||||
RevitalizeTimer = 5000;
|
||||
HeroicStrikeTimer = 3000;
|
||||
@@ -575,7 +574,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_sathrovarrAI(creature);
|
||||
return GetInstanceAI<boss_sathrovarrAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_sathrovarrAI : public ScriptedAI
|
||||
@@ -605,11 +604,8 @@ public:
|
||||
{
|
||||
me->SetFullHealth();//dunno why it does not resets health at evade..
|
||||
me->setActive(true);
|
||||
if (instance)
|
||||
{
|
||||
KalecgosGUID = instance->GetData64(DATA_KALECGOS_DRAGON);
|
||||
instance->SetBossState(DATA_KALECGOS, NOT_STARTED);
|
||||
}
|
||||
KalecgosGUID = instance->GetData64(DATA_KALECGOS_DRAGON);
|
||||
instance->SetBossState(DATA_KALECGOS, NOT_STARTED);
|
||||
if (KalecGUID)
|
||||
{
|
||||
if (Creature* Kalec = ObjectAccessor::GetCreature(*me, KalecGUID))
|
||||
@@ -674,8 +670,7 @@ public:
|
||||
CAST_AI(boss_kalecgos::boss_kalecgosAI, Kalecgos->AI())->isFriendly = true;
|
||||
}
|
||||
|
||||
if (instance)
|
||||
instance->SetBossState(DATA_KALECGOS, DONE);
|
||||
instance->SetBossState(DATA_KALECGOS, DONE);
|
||||
}
|
||||
|
||||
void TeleportAllPlayersBack()
|
||||
|
||||
@@ -236,7 +236,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_kalecgos_kjAI(creature);
|
||||
return GetInstanceAI<boss_kalecgos_kjAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_kalecgos_kjAI : public ScriptedAI
|
||||
@@ -265,9 +265,6 @@ public:
|
||||
|
||||
GameObject* GetOrb(int32 index)
|
||||
{
|
||||
if (!instance)
|
||||
return NULL;
|
||||
|
||||
switch (index)
|
||||
{
|
||||
case 0:
|
||||
@@ -389,7 +386,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_kiljaeden_controllerAI(creature);
|
||||
return GetInstanceAI<npc_kiljaeden_controllerAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_kiljaeden_controllerAI : public ScriptedAI
|
||||
@@ -424,9 +421,8 @@ public:
|
||||
{
|
||||
phase = PHASE_DECEIVERS;
|
||||
|
||||
if (instance)
|
||||
if (Creature* pKalecKJ = ObjectAccessor::GetCreature((*me), instance->GetData64(DATA_KALECGOS_KJ)))
|
||||
CAST_AI(boss_kalecgos_kj::boss_kalecgos_kjAI, pKalecKJ->AI())->ResetOrbs();
|
||||
if (Creature* pKalecKJ = ObjectAccessor::GetCreature((*me), instance->GetData64(DATA_KALECGOS_KJ)))
|
||||
CAST_AI(boss_kalecgos_kj::boss_kalecgos_kjAI, pKalecKJ->AI())->ResetOrbs();
|
||||
deceiverDeathCount = 0;
|
||||
bSummonedDeceivers = false;
|
||||
bKiljaedenDeath = false;
|
||||
@@ -710,7 +706,7 @@ public:
|
||||
SpeechTimer += diff;
|
||||
break;
|
||||
case TIMER_SOUL_FLAY:
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
if (!me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
DoCastVictim(SPELL_SOUL_FLAY_SLOW, false);
|
||||
DoCastVictim(SPELL_SOUL_FLAY, false);
|
||||
@@ -718,7 +714,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case TIMER_LEGION_LIGHTNING:
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
if (!me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
Unit* pRandomPlayer = NULL;
|
||||
|
||||
@@ -740,7 +736,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case TIMER_FIRE_BLOOM:
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
if (!me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
me->RemoveAurasDueToSpell(SPELL_SOUL_FLAY);
|
||||
DoCastAOE(SPELL_FIRE_BLOOM, false);
|
||||
@@ -760,7 +756,7 @@ public:
|
||||
Timer[TIMER_SOUL_FLAY] = 2000;
|
||||
break;
|
||||
case TIMER_SHADOW_SPIKE: //Phase 3
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
if (!me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
CastSinisterReflection();
|
||||
DoCastAOE(SPELL_SHADOW_SPIKE, false);
|
||||
@@ -774,7 +770,7 @@ public:
|
||||
Timer[TIMER_FLAME_DART] = 3000; /// @todo Timer
|
||||
break;
|
||||
case TIMER_DARKNESS: //Phase 3
|
||||
if (!me->IsNonMeleeSpellCasted(false))
|
||||
if (!me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
// Begins to channel for 8 seconds, then deals 50'000 damage to all raid members.
|
||||
if (!IsInDarkness)
|
||||
@@ -927,9 +923,6 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (Creature* pControl = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_KILJAEDEN_CONTROLLER)))
|
||||
++(CAST_AI(npc_kiljaeden_controller::npc_kiljaeden_controllerAI, pControl->AI())->deceiverDeathCount);
|
||||
}
|
||||
@@ -1150,7 +1143,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_shield_orbAI(creature);
|
||||
return GetInstanceAI<npc_shield_orbAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_shield_orbAI : public ScriptedAI
|
||||
|
||||
@@ -371,7 +371,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_muru_portalAI(creature);
|
||||
return GetInstanceAI<npc_muru_portalAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_muru_portalAI : public ScriptedAI
|
||||
@@ -405,9 +405,8 @@ public:
|
||||
|
||||
void JustSummoned(Creature* summoned) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
if (Player* Target = ObjectAccessor::GetPlayer(*me, instance->GetData64(DATA_PLAYER_GUID)))
|
||||
summoned->AI()->AttackStart(Target);
|
||||
if (Player* Target = ObjectAccessor::GetPlayer(*me, instance->GetData64(DATA_PLAYER_GUID)))
|
||||
summoned->AI()->AttackStart(Target);
|
||||
|
||||
Summons.Summon(summoned);
|
||||
}
|
||||
@@ -571,7 +570,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_blackholeAI(creature);
|
||||
return GetInstanceAI<npc_blackholeAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_blackholeAI : public ScriptedAI
|
||||
@@ -593,6 +592,7 @@ public:
|
||||
DespawnTimer = 15000;
|
||||
SpellTimer = 5000;
|
||||
Phase = 0;
|
||||
NeedForAHack = 0;
|
||||
|
||||
me->AddUnitState(UNIT_STATE_STUNNED);
|
||||
DoCastAOE(SPELL_BLACKHOLE_SPAWN, true);
|
||||
|
||||
@@ -86,8 +86,7 @@ class boss_archaedas : public CreatureScript
|
||||
bGuardiansAwake = false;
|
||||
bVaultWalkersAwake = false;
|
||||
|
||||
if (instance)
|
||||
instance->SetData(0, 5); // respawn any dead minions
|
||||
instance->SetData(0, 5); // respawn any dead minions
|
||||
me->setFaction(35);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
@@ -132,8 +131,6 @@ class boss_archaedas : public CreatureScript
|
||||
|
||||
void UpdateAI(uint32 uiDiff) OVERRIDE
|
||||
{
|
||||
if (!instance)
|
||||
return;
|
||||
// we're still doing awaken animation
|
||||
if (bWakingUp && iAwakenTimer >= 0)
|
||||
{
|
||||
@@ -196,17 +193,14 @@ class boss_archaedas : public CreatureScript
|
||||
|
||||
void JustDied (Unit* /*killer*/)
|
||||
{
|
||||
if (instance)
|
||||
{
|
||||
instance->SetData(DATA_ANCIENT_DOOR, DONE); // open the vault door
|
||||
instance->SetData(DATA_MINIONS, SPECIAL); // deactivate his minions
|
||||
}
|
||||
instance->SetData(DATA_ANCIENT_DOOR, DONE); // open the vault door
|
||||
instance->SetData(DATA_MINIONS, SPECIAL); // deactivate his minions
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_archaedasAI(creature);
|
||||
return GetInstanceAI<boss_archaedasAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -305,7 +299,7 @@ class npc_archaedas_minions : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_archaedas_minionsAI(creature);
|
||||
return GetInstanceAI<npc_archaedas_minionsAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -361,14 +355,13 @@ class npc_stonekeepers : public CreatureScript
|
||||
void JustDied(Unit* /*attacker*/) OVERRIDE
|
||||
{
|
||||
DoCast (me, SPELL_SELF_DESTRUCT, true);
|
||||
if (instance)
|
||||
instance->SetData(DATA_STONE_KEEPERS, IN_PROGRESS); // activate next stonekeeper
|
||||
instance->SetData(DATA_STONE_KEEPERS, IN_PROGRESS); // activate next stonekeeper
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_stonekeepersAI(creature);
|
||||
return GetInstanceAI<npc_stonekeepersAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -48,14 +48,14 @@ class boss_ironaya : public CreatureScript
|
||||
boss_ironayaAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
uint32 uiArcingTimer;
|
||||
bool bHasCastedWstomp;
|
||||
bool bHasCastedKnockaway;
|
||||
bool bHasCastWstomp;
|
||||
bool bHasCastKnockaway;
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
uiArcingTimer = 3000;
|
||||
bHasCastedKnockaway = false;
|
||||
bHasCastedWstomp = false;
|
||||
bHasCastKnockaway = false;
|
||||
bHasCastWstomp = false;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
@@ -70,7 +70,7 @@ class boss_ironaya : public CreatureScript
|
||||
return;
|
||||
|
||||
//If we are <50% hp do knockaway ONCE
|
||||
if (!bHasCastedKnockaway && HealthBelowPct(50))
|
||||
if (!bHasCastKnockaway && HealthBelowPct(50))
|
||||
{
|
||||
DoCastVictim(SPELL_KNOCKAWAY, true);
|
||||
|
||||
@@ -84,7 +84,7 @@ class boss_ironaya : public CreatureScript
|
||||
me->TauntApply(target);
|
||||
|
||||
//Shouldn't cast this agian
|
||||
bHasCastedKnockaway = true;
|
||||
bHasCastKnockaway = true;
|
||||
}
|
||||
|
||||
//uiArcingTimer
|
||||
@@ -94,10 +94,10 @@ class boss_ironaya : public CreatureScript
|
||||
uiArcingTimer = 13000;
|
||||
} else uiArcingTimer -= uiDiff;
|
||||
|
||||
if (!bHasCastedWstomp && HealthBelowPct(25))
|
||||
if (!bHasCastWstomp && HealthBelowPct(25))
|
||||
{
|
||||
DoCast(me, SPELL_WSTOMP);
|
||||
bHasCastedWstomp = true;
|
||||
bHasCastWstomp = true;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
@@ -56,10 +56,10 @@ class boss_akilzon : public CreatureScript
|
||||
_JustDied();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim) OVERRIDE
|
||||
void KilledUnit(Unit* who) OVERRIDE
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_PLAYER_KILL);
|
||||
if (who->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
@@ -88,7 +88,7 @@ class boss_akilzon : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return GetZulAmanAI<boss_akilzonAI>(creature);
|
||||
return GetInstanceAI<boss_akilzonAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ class boss_hexlord_malacrass : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return GetZulAmanAI<boss_hex_lord_malacrassAI>(creature);
|
||||
return GetInstanceAI<boss_hex_lord_malacrassAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ class boss_janalai : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return GetZulAmanAI<boss_janalaiAI>(creature);
|
||||
return GetInstanceAI<boss_janalaiAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ class boss_nalorakk : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_nalorakkAI(creature);
|
||||
return GetInstanceAI<boss_nalorakkAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -126,7 +126,6 @@ class npc_voljin_zulaman : public CreatureScript
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
_events.Update(diff);
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
@@ -214,7 +213,7 @@ class npc_voljin_zulaman : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return GetZulAmanAI<npc_voljin_zulamanAI>(creature);
|
||||
return GetInstanceAI<npc_voljin_zulamanAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -39,17 +39,16 @@ EndContentData */
|
||||
enum ProfessorPhizzlethorpe
|
||||
{
|
||||
// Yells
|
||||
SAY_PROGRESS_1 = 0,
|
||||
SAY_PROGRESS_2 = 1,
|
||||
SAY_PROGRESS_3 = 2,
|
||||
EMOTE_PROGRESS_4 = 3,
|
||||
SAY_AGGRO = 4,
|
||||
SAY_PROGRESS_5 = 5,
|
||||
SAY_PROGRESS_6 = 6,
|
||||
SAY_PROGRESS_7 = 7,
|
||||
EMOTE_PROGRESS_8 = 8,
|
||||
SAY_PROGRESS_9 = 9,
|
||||
|
||||
SAY_PROGRESS_1 = 0,
|
||||
SAY_PROGRESS_2 = 1,
|
||||
SAY_PROGRESS_3 = 2,
|
||||
EMOTE_PROGRESS_4 = 3,
|
||||
SAY_AGGRO = 4,
|
||||
SAY_PROGRESS_5 = 5,
|
||||
SAY_PROGRESS_6 = 6,
|
||||
SAY_PROGRESS_7 = 7,
|
||||
EMOTE_PROGRESS_8 = 8,
|
||||
SAY_PROGRESS_9 = 9,
|
||||
EVENT_SAY_3 = 1,
|
||||
EVENT_SAY_6 = 2,
|
||||
EVENT_SAY_8 = 3,
|
||||
@@ -57,19 +56,15 @@ enum ProfessorPhizzlethorpe
|
||||
// Quests
|
||||
QUEST_SUNKEN_TREASURE = 665,
|
||||
QUEST_GOGGLE_BOGGLE = 26050,
|
||||
|
||||
// Creatures
|
||||
NPC_VENGEFUL_SURGE = 2776
|
||||
NPC_VENGEFUL_SURGE = 2776,
|
||||
FACTION_SUNKEN_TREASURE = 113
|
||||
};
|
||||
|
||||
class npc_professor_phizzlethorpe : public CreatureScript
|
||||
{
|
||||
public:
|
||||
|
||||
npc_professor_phizzlethorpe()
|
||||
: CreatureScript("npc_professor_phizzlethorpe")
|
||||
{
|
||||
}
|
||||
npc_professor_phizzlethorpe() : CreatureScript("npc_professor_phizzlethorpe") { }
|
||||
|
||||
struct npc_professor_phizzlethorpeAI : public npc_escortAI
|
||||
{
|
||||
@@ -113,6 +108,16 @@ class npc_professor_phizzlethorpe : public CreatureScript
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void sQuestAccept(Player* player, Quest const* quest)
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE)
|
||||
{
|
||||
Talk(SAY_PROGRESS_1, player);
|
||||
npc_escortAI::Start(false, false, player->GetGUID(), quest);
|
||||
me->setFaction(FACTION_SUNKEN_TREASURE);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
Player* player = GetPlayerForEscort();
|
||||
@@ -145,23 +150,10 @@ class npc_professor_phizzlethorpe : public CreatureScript
|
||||
EventMap events;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_professor_phizzlethorpeAI(creature);
|
||||
}
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_GOGGLE_BOGGLE)
|
||||
{
|
||||
creature->AI()->Talk(SAY_PROGRESS_1, player);
|
||||
if (npc_escortAI* pEscortAI = CAST_AI(npc_professor_phizzlethorpeAI, (creature->AI())))
|
||||
pEscortAI->Start(false, false, player->GetGUID(), quest);
|
||||
|
||||
creature->setFaction(42);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_professor_phizzlethorpeAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_arathi_highlands()
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
@@ -16,28 +15,26 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Blasted_Lands
|
||||
SD%Complete: 90
|
||||
SDComment: Quest support: 3628. Teleporter to Rise of the Defiler missing group support.
|
||||
SDCategory: Blasted Lands
|
||||
EndScriptData */
|
||||
/*
|
||||
Blasted_Lands
|
||||
Quest support: 3628. Teleporter to Rise of the Defiler.
|
||||
*/
|
||||
|
||||
/* ContentData
|
||||
/*
|
||||
npc_deathly_usher
|
||||
EndContentData */
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "SpellScript.h"
|
||||
#include "Player.h"
|
||||
#include "Group.h"
|
||||
|
||||
/*######
|
||||
## npc_deathly_usher
|
||||
######*/
|
||||
|
||||
#define GOSSIP_ITEM_USHER "I wish to to visit the Rise of the Defiler."
|
||||
|
||||
enum DeathlyUsher
|
||||
{
|
||||
SPELL_TELEPORT_SINGLE = 12885,
|
||||
@@ -50,30 +47,72 @@ class npc_deathly_usher : public CreatureScript
|
||||
public:
|
||||
npc_deathly_usher() : CreatureScript("npc_deathly_usher") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
|
||||
struct npc_deathly_usherAI : public ScriptedAI
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
if (action == GOSSIP_ACTION_INFO_DEF)
|
||||
npc_deathly_usherAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void sGossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) OVERRIDE
|
||||
{
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
creature->CastSpell(player, SPELL_TELEPORT_SINGLE, true);
|
||||
me->CastSpell(player, SPELL_TELEPORT_GROUP, true);
|
||||
}
|
||||
};
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
if (player->GetQuestStatus(3628) == QUEST_STATUS_INCOMPLETE && player->HasItemCount(10757))
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_USHER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
|
||||
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
|
||||
|
||||
return true;
|
||||
return new npc_deathly_usherAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/*#####
|
||||
# spell_razelikh_teleport_group
|
||||
#####*/
|
||||
|
||||
class spell_razelikh_teleport_group : public SpellScriptLoader
|
||||
{
|
||||
public: spell_razelikh_teleport_group() : SpellScriptLoader("spell_razelikh_teleport_group") { }
|
||||
|
||||
class spell_razelikh_teleport_group_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_razelikh_teleport_group_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) OVERRIDE
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_TELEPORT_SINGLE) && !sSpellMgr->GetSpellInfo(SPELL_TELEPORT_SINGLE_IN_GROUP))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
if (Player* player = GetHitPlayer())
|
||||
{
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
if (Player* member = itr->GetSource())
|
||||
if (member->IsWithinDistInMap(player, 20.0f) && !member->isDead())
|
||||
member->CastSpell(member, SPELL_TELEPORT_SINGLE_IN_GROUP, true);
|
||||
}
|
||||
else
|
||||
player->CastSpell(player, SPELL_TELEPORT_SINGLE, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() OVERRIDE
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_razelikh_teleport_group_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const OVERRIDE
|
||||
{
|
||||
return new spell_razelikh_teleport_group_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_blasted_lands()
|
||||
{
|
||||
new npc_deathly_usher();
|
||||
new spell_razelikh_teleport_group();
|
||||
}
|
||||
|
||||
@@ -23,6 +23,38 @@ SDComment:
|
||||
SDCategory: Burning Steppes
|
||||
EndScriptData */
|
||||
|
||||
enum RaggedJohn
|
||||
{
|
||||
QUEST_THE_TRUE_MASTERS = 4224,
|
||||
QUEST_MOTHERS_MILK = 4866,
|
||||
SPELL_MOTHERS_MILK = 16468,
|
||||
SPELL_WICKED_MILKING = 16472
|
||||
};
|
||||
|
||||
struct npc_ragged_johnAI : public ScriptedAI
|
||||
{
|
||||
npc_ragged_johnAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void Reset() OVERRIDE { }
|
||||
|
||||
void MoveInLineOfSight(Unit* who) OVERRIDE
|
||||
{
|
||||
if (who->HasAura(SPELL_MOTHERS_MILK))
|
||||
{
|
||||
if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 15) && who->isInAccessiblePlaceFor(me))
|
||||
{
|
||||
DoCast(who, SPELL_WICKED_MILKING);
|
||||
if (Player* player = who->ToPlayer())
|
||||
player->AreaExploredOrEventHappens(QUEST_MOTHERS_MILK);
|
||||
}
|
||||
}
|
||||
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE { }
|
||||
};
|
||||
|
||||
void AddSC_burning_steppes()
|
||||
{
|
||||
|
||||
|
||||
@@ -27,81 +27,45 @@ EndScriptData */
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Player.h"
|
||||
|
||||
enum Yells
|
||||
enum TwilightCorrupter
|
||||
{
|
||||
YELL_TWILIGHTCORRUPTOR_RESPAWN = 0,
|
||||
YELL_TWILIGHTCORRUPTOR_AGGRO = 1,
|
||||
YELL_TWILIGHTCORRUPTOR_KILL = 2,
|
||||
};
|
||||
ITEM_FRAGMENT = 21149,
|
||||
NPC_TWILIGHT_CORRUPTER = 15625,
|
||||
YELL_TWILIGHTCORRUPTOR_RESPAWN = 0,
|
||||
YELL_TWILIGHTCORRUPTOR_AGGRO = 1,
|
||||
YELL_TWILIGHTCORRUPTOR_KILL = 2,
|
||||
SPELL_SOUL_CORRUPTION = 25805,
|
||||
SPELL_CREATURE_OF_NIGHTMARE = 25806,
|
||||
SPELL_LEVEL_UP = 24312,
|
||||
|
||||
|
||||
/*######
|
||||
# at_twilight_grove
|
||||
######*/
|
||||
|
||||
class at_twilight_grove : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
at_twilight_grove() : AreaTriggerScript("at_twilight_grove") { }
|
||||
|
||||
bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/) OVERRIDE
|
||||
{
|
||||
if (player->HasQuestForItem(21149))
|
||||
{
|
||||
if (Unit* TCorrupter = player->SummonCreature(15625, -10328.16f, -489.57f, 49.95f, 0, TEMPSUMMON_MANUAL_DESPAWN, 60000))
|
||||
{
|
||||
TCorrupter->setFaction(14);
|
||||
TCorrupter->SetMaxHealth(832750);
|
||||
}
|
||||
if (Creature* CorrupterSpeaker = player->SummonCreature(1, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()-1, 0, TEMPSUMMON_TIMED_DESPAWN, 15000))
|
||||
{
|
||||
CorrupterSpeaker->SetName("Twilight Corrupter");
|
||||
CorrupterSpeaker->SetVisible(true);
|
||||
CorrupterSpeaker->AI()->Talk(YELL_TWILIGHTCORRUPTOR_RESPAWN, player);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
EVENT_SOUL_CORRUPTION = 1,
|
||||
EVENT_CREATURE_OF_NIGHTMARE = 2,
|
||||
FACTION_HOSTILE = 14
|
||||
};
|
||||
|
||||
/*######
|
||||
# boss_twilight_corrupter
|
||||
######*/
|
||||
|
||||
enum TwilightCorrupter
|
||||
{
|
||||
SPELL_SOUL_CORRUPTION = 25805,
|
||||
SPELL_CREATURE_OF_NIGHTMARE = 25806,
|
||||
SPELL_LEVEL_UP = 24312
|
||||
};
|
||||
|
||||
class boss_twilight_corrupter : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_twilight_corrupter() : CreatureScript("boss_twilight_corrupter") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_twilight_corrupterAI(creature);
|
||||
}
|
||||
|
||||
struct boss_twilight_corrupterAI : public ScriptedAI
|
||||
{
|
||||
boss_twilight_corrupterAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
uint32 SoulCorruption_Timer;
|
||||
uint32 CreatureOfNightmare_Timer;
|
||||
uint8 KillCount;
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
SoulCorruption_Timer = 15000;
|
||||
CreatureOfNightmare_Timer = 30000;
|
||||
KillCount = 0;
|
||||
KillCount = 0;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
Talk(YELL_TWILIGHTCORRUPTOR_AGGRO);
|
||||
_events.ScheduleEvent(EVENT_SOUL_CORRUPTION, 15000);
|
||||
_events.ScheduleEvent(EVENT_CREATURE_OF_NIGHTMARE, 30000);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim) OVERRIDE
|
||||
@@ -123,19 +87,63 @@ public:
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
if (SoulCorruption_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SOUL_CORRUPTION);
|
||||
SoulCorruption_Timer = rand()%4000+15000; //gotta confirm Timers
|
||||
} else SoulCorruption_Timer-=diff;
|
||||
|
||||
if (CreatureOfNightmare_Timer <= diff)
|
||||
_events.Update(diff);
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
DoCastVictim(SPELL_CREATURE_OF_NIGHTMARE);
|
||||
CreatureOfNightmare_Timer = 45000; //gotta confirm Timers
|
||||
} else CreatureOfNightmare_Timer-=diff;
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SOUL_CORRUPTION:
|
||||
DoCastVictim(SPELL_SOUL_CORRUPTION);
|
||||
_events.ScheduleEvent(EVENT_SOUL_CORRUPTION, rand()%4000+15000);
|
||||
break;
|
||||
case EVENT_CREATURE_OF_NIGHTMARE:
|
||||
DoCastVictim(SPELL_CREATURE_OF_NIGHTMARE);
|
||||
_events.ScheduleEvent(EVENT_CREATURE_OF_NIGHTMARE, 45000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
};
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events;
|
||||
uint8 KillCount;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_twilight_corrupterAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
# at_twilight_grove
|
||||
######*/
|
||||
|
||||
class at_twilight_grove : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
at_twilight_grove() : AreaTriggerScript("at_twilight_grove") { }
|
||||
|
||||
bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/) OVERRIDE
|
||||
{
|
||||
if (player->HasQuestForItem(ITEM_FRAGMENT))
|
||||
{
|
||||
if (Unit* corrupter = player->SummonCreature(NPC_TWILIGHT_CORRUPTER, -10328.16f, -489.57f, 49.95f, 0, TEMPSUMMON_MANUAL_DESPAWN, 60000))
|
||||
corrupter->setFaction(FACTION_HOSTILE);
|
||||
|
||||
if (Creature* CorrupterSpeaker = player->SummonCreature(1, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()-1, 0, TEMPSUMMON_TIMED_DESPAWN, 15000))
|
||||
{
|
||||
CorrupterSpeaker->SetName("Twilight Corrupter");
|
||||
CorrupterSpeaker->SetVisible(true);
|
||||
CorrupterSpeaker->AI()->Talk(YELL_TWILIGHTCORRUPTOR_RESPAWN, player);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ SDCategory: Ghostlands
|
||||
EndScriptData */
|
||||
|
||||
/* ContentData
|
||||
npc_rathis_tomber
|
||||
npc_ranger_lilatha
|
||||
EndContentData */
|
||||
|
||||
@@ -36,46 +35,12 @@ EndContentData */
|
||||
#include "WorldSession.h"
|
||||
|
||||
/*######
|
||||
## npc_rathis_tomber
|
||||
######*/
|
||||
|
||||
class npc_rathis_tomber : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_rathis_tomber() : CreatureScript("npc_rathis_tomber") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
if (action == GOSSIP_ACTION_TRADE)
|
||||
player->GetSession()->SendListInventory(creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
|
||||
{
|
||||
if (creature->IsQuestGiver())
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
|
||||
if (creature->IsVendor() && player->GetQuestRewardStatus(9152))
|
||||
{
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
|
||||
player->SEND_GOSSIP_MENU(8432, creature->GetGUID());
|
||||
}
|
||||
else
|
||||
player->SEND_GOSSIP_MENU(8431, creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_ranger_lilatha
|
||||
######*/
|
||||
|
||||
enum RangerLilatha
|
||||
{
|
||||
// Yells
|
||||
SAY_START = 0,
|
||||
SAY_PROGRESS1 = 1,
|
||||
SAY_PROGRESS2 = 2,
|
||||
@@ -83,18 +48,12 @@ enum RangerLilatha
|
||||
SAY_END1 = 4,
|
||||
SAY_END2 = 5,
|
||||
SAY_CAPTAIN_ANSWER = 0,
|
||||
|
||||
// Quests
|
||||
QUEST_ESCAPE_FROM_THE_CATACOMBS = 9212,
|
||||
|
||||
// Gameobjects
|
||||
GO_CAGE = 181152,
|
||||
|
||||
// Creature
|
||||
NPC_CAPTAIN_HELIOS = 16220,
|
||||
|
||||
// Factions
|
||||
FACTION_SMOON_E = 1603
|
||||
NPC_MUMMIFIED_HEADHUNTER = 16342,
|
||||
NPC_SHADOWPINE_ORACLE = 16343,
|
||||
FACTION_QUEST_ESCAPE = 113
|
||||
};
|
||||
|
||||
class npc_ranger_lilatha : public CreatureScript
|
||||
@@ -130,8 +89,8 @@ public:
|
||||
case 18:
|
||||
{
|
||||
Talk(SAY_PROGRESS3, player);
|
||||
Creature* Summ1 = me->SummonCreature(16342, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
Creature* Summ2 = me->SummonCreature(16343, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
Creature* Summ1 = me->SummonCreature(NPC_MUMMIFIED_HEADHUNTER, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
Creature* Summ2 = me->SummonCreature(NPC_SHADOWPINE_ORACLE, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
if (Summ1 && Summ2)
|
||||
{
|
||||
Summ1->Attack(me, true);
|
||||
@@ -174,7 +133,7 @@ public:
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS)
|
||||
{
|
||||
creature->setFaction(113);
|
||||
creature->setFaction(FACTION_QUEST_ESCAPE);
|
||||
|
||||
if (npc_escortAI* pEscortAI = CAST_AI(npc_ranger_lilatha::npc_ranger_lilathaAI, creature->AI()))
|
||||
pEscortAI->Start(true, false, player->GetGUID());
|
||||
@@ -191,6 +150,5 @@ public:
|
||||
|
||||
void AddSC_ghostlands()
|
||||
{
|
||||
new npc_rathis_tomber();
|
||||
new npc_ranger_lilatha();
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ SDCategory: The Hinterlands
|
||||
EndScriptData */
|
||||
|
||||
/* ContentData
|
||||
npc_00x09hl
|
||||
npc_oox09hl
|
||||
EndContentData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
@@ -33,7 +33,7 @@ EndContentData */
|
||||
#include "Player.h"
|
||||
|
||||
/*######
|
||||
## npc_00x09hl
|
||||
## npc_oox09hl
|
||||
######*/
|
||||
|
||||
enum eOOX
|
||||
@@ -43,51 +43,48 @@ enum eOOX
|
||||
SAY_OOX_AMBUSH = 2,
|
||||
SAY_OOX_AMBUSH_REPLY = 3,
|
||||
SAY_OOX_END = 4,
|
||||
|
||||
QUEST_RESQUE_OOX_09 = 836,
|
||||
|
||||
NPC_MARAUDING_OWL = 7808,
|
||||
NPC_VILE_AMBUSHER = 7809,
|
||||
|
||||
FACTION_ESCORTEE_A = 774,
|
||||
FACTION_ESCORTEE_H = 775
|
||||
};
|
||||
|
||||
class npc_00x09hl : public CreatureScript
|
||||
class npc_oox09hl : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_00x09hl() : CreatureScript("npc_00x09hl") { }
|
||||
npc_oox09hl() : CreatureScript("npc_oox09hl") { }
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest)
|
||||
struct npc_oox09hlAI : public npc_escortAI
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_RESQUE_OOX_09)
|
||||
{
|
||||
creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
|
||||
if (player->GetTeam() == ALLIANCE)
|
||||
creature->setFaction(FACTION_ESCORTEE_A);
|
||||
else if (player->GetTeam() == HORDE)
|
||||
creature->setFaction(FACTION_ESCORTEE_H);
|
||||
|
||||
creature->AI()->Talk(SAY_OOX_START, player);
|
||||
|
||||
if (npc_00x09hlAI* pEscortAI = CAST_AI(npc_00x09hl::npc_00x09hlAI, creature->AI()))
|
||||
pEscortAI->Start(false, false, player->GetGUID(), quest);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_00x09hlAI(creature);
|
||||
}
|
||||
|
||||
struct npc_00x09hlAI : public npc_escortAI
|
||||
{
|
||||
npc_00x09hlAI(Creature* creature) : npc_escortAI(creature) { }
|
||||
npc_oox09hlAI(Creature* creature) : npc_escortAI(creature) { }
|
||||
|
||||
void Reset() OVERRIDE { }
|
||||
|
||||
void EnterCombat(Unit* who) OVERRIDE
|
||||
{
|
||||
if (who->GetEntry() == NPC_MARAUDING_OWL || who->GetEntry() == NPC_VILE_AMBUSHER)
|
||||
return;
|
||||
|
||||
Talk(SAY_OOX_AGGRO);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned) OVERRIDE
|
||||
{
|
||||
summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
|
||||
}
|
||||
|
||||
void sQuestAccept(Player* player, Quest const* quest)
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_RESQUE_OOX_09)
|
||||
{
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
me->setFaction(player->GetTeam() == ALLIANCE ? FACTION_ESCORTEE_A : FACTION_ESCORTEE_H);
|
||||
Talk(SAY_OOX_START, player);
|
||||
npc_escortAI::Start(false, false, player->GetGUID(), quest);
|
||||
}
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId)
|
||||
{
|
||||
switch (waypointId)
|
||||
@@ -106,9 +103,9 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void WaypointStart(uint32 uiPointId)
|
||||
void WaypointStart(uint32 pointId) OVERRIDE
|
||||
{
|
||||
switch (uiPointId)
|
||||
switch (pointId)
|
||||
{
|
||||
case 27:
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
@@ -130,23 +127,15 @@ public:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
if (who->GetEntry() == NPC_MARAUDING_OWL || who->GetEntry() == NPC_VILE_AMBUSHER)
|
||||
return;
|
||||
|
||||
Talk(SAY_OOX_AGGRO);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned) OVERRIDE
|
||||
{
|
||||
summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_oox09hlAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_hinterlands()
|
||||
{
|
||||
new npc_00x09hl();
|
||||
new npc_oox09hl();
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ class spell_ex_66244 : public SpellScriptLoader
|
||||
// we initialize local variables if needed
|
||||
bool Load() OVERRIDE
|
||||
{
|
||||
// do not load script if aura is casted by player or caster not avalible
|
||||
// do not load script if aura is cast by player or caster not avalible
|
||||
if (Unit* caster = GetCaster())
|
||||
if (caster->GetTypeId() == TYPEID_PLAYER)
|
||||
return true;
|
||||
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_blackfathom_deeps_eventAI(creature);
|
||||
return GetInstanceAI<npc_blackfathom_deeps_eventAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_blackfathom_deeps_eventAI : public ScriptedAI
|
||||
@@ -182,8 +182,7 @@ public:
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (me->IsSummon()) //we are not a normal spawn.
|
||||
if (instance)
|
||||
instance->SetData(DATA_EVENT, instance->GetData(DATA_EVENT) + 1);
|
||||
instance->SetData(DATA_EVENT, instance->GetData(DATA_EVENT) + 1);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -31,7 +31,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_gelihastAI(creature);
|
||||
return GetInstanceAI<boss_gelihastAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_gelihastAI : public ScriptedAI
|
||||
@@ -48,20 +48,17 @@ public:
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
netTimer = urand(2000, 4000);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_GELIHAST, NOT_STARTED);
|
||||
instance->SetData(TYPE_GELIHAST, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(TYPE_GELIHAST, IN_PROGRESS);
|
||||
instance->SetData(TYPE_GELIHAST, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(TYPE_GELIHAST, DONE);
|
||||
instance->SetData(TYPE_GELIHAST, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_kelrisAI(creature);
|
||||
return GetInstanceAI<boss_kelrisAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_kelrisAI : public ScriptedAI
|
||||
@@ -55,22 +55,19 @@ public:
|
||||
{
|
||||
mindBlastTimer = urand(2000, 5000);
|
||||
sleepTimer = urand(9000, 12000);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_KELRIS, NOT_STARTED);
|
||||
instance->SetData(TYPE_KELRIS, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_KELRIS, IN_PROGRESS);
|
||||
instance->SetData(TYPE_KELRIS, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_KELRIS, DONE);
|
||||
instance->SetData(TYPE_KELRIS, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_anetheronAI(creature);
|
||||
return GetInstanceAI<boss_anetheronAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_anetheronAI : public hyjal_trashAI
|
||||
@@ -83,9 +83,10 @@ public:
|
||||
Talk(SAY_ONAGGRO);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) OVERRIDE
|
||||
void KilledUnit(Unit* who) OVERRIDE
|
||||
{
|
||||
Talk(SAY_ONSLAY);
|
||||
if (who->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_ONSLAY);
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId) OVERRIDE
|
||||
@@ -115,19 +116,16 @@ public:
|
||||
if (!go)
|
||||
{
|
||||
go = true;
|
||||
if (instance)
|
||||
{
|
||||
AddWaypoint(0, 4896.08f, -1576.35f, 1333.65f);
|
||||
AddWaypoint(1, 4898.68f, -1615.02f, 1329.48f);
|
||||
AddWaypoint(2, 4907.12f, -1667.08f, 1321.00f);
|
||||
AddWaypoint(3, 4963.18f, -1699.35f, 1340.51f);
|
||||
AddWaypoint(4, 4989.16f, -1716.67f, 1335.74f);
|
||||
AddWaypoint(5, 5026.27f, -1736.89f, 1323.02f);
|
||||
AddWaypoint(6, 5037.77f, -1770.56f, 1324.36f);
|
||||
AddWaypoint(7, 5067.23f, -1789.95f, 1321.17f);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
AddWaypoint(0, 4896.08f, -1576.35f, 1333.65f);
|
||||
AddWaypoint(1, 4898.68f, -1615.02f, 1329.48f);
|
||||
AddWaypoint(2, 4907.12f, -1667.08f, 1321.00f);
|
||||
AddWaypoint(3, 4963.18f, -1699.35f, 1340.51f);
|
||||
AddWaypoint(4, 4989.16f, -1716.67f, 1335.74f);
|
||||
AddWaypoint(5, 5026.27f, -1736.89f, 1323.02f);
|
||||
AddWaypoint(6, 5037.77f, -1770.56f, 1324.36f);
|
||||
AddWaypoint(7, 5067.23f, -1789.95f, 1321.17f);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,17 +177,15 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_towering_infernalAI(creature);
|
||||
return GetInstanceAI<npc_towering_infernalAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_towering_infernalAI : public ScriptedAI
|
||||
{
|
||||
npc_towering_infernalAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
AnetheronGUID = 0;
|
||||
instance = creature->GetInstanceScript();
|
||||
if (instance)
|
||||
AnetheronGUID = instance->GetData64(DATA_ANETHERON);
|
||||
AnetheronGUID = instance->GetData64(DATA_ANETHERON);
|
||||
}
|
||||
|
||||
uint32 ImmolationTimer;
|
||||
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_ancient_wispAI(creature);
|
||||
return GetInstanceAI<npc_ancient_wispAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_ancient_wispAI : public ScriptedAI
|
||||
@@ -102,8 +102,7 @@ public:
|
||||
{
|
||||
CheckTimer = 1000;
|
||||
|
||||
if (instance)
|
||||
ArchimondeGUID = instance->GetData64(DATA_ARCHIMONDE);
|
||||
ArchimondeGUID = instance->GetData64(DATA_ARCHIMONDE);
|
||||
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
@@ -239,7 +238,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_archimondeAI(creature);
|
||||
return GetInstanceAI<boss_archimondeAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_archimondeAI : public hyjal_trashAI
|
||||
@@ -275,8 +274,7 @@ public:
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_ARCHIMONDEEVENT, NOT_STARTED);
|
||||
instance->SetData(DATA_ARCHIMONDEEVENT, NOT_STARTED);
|
||||
|
||||
DoomfireSpiritGUID = 0;
|
||||
damageTaken = 0;
|
||||
@@ -308,8 +306,7 @@ public:
|
||||
Talk(SAY_AGGRO);
|
||||
DoZoneInCombat();
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_ARCHIMONDEEVENT, IN_PROGRESS);
|
||||
instance->SetData(DATA_ARCHIMONDEEVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim) OVERRIDE
|
||||
@@ -350,8 +347,7 @@ public:
|
||||
hyjal_trashAI::JustDied(killer);
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_ARCHIMONDEEVENT, DONE);
|
||||
instance->SetData(DATA_ARCHIMONDEEVENT, DONE);
|
||||
}
|
||||
|
||||
bool CanUseFingerOfDeath()
|
||||
@@ -471,19 +467,16 @@ public:
|
||||
{
|
||||
if (!me->IsInCombat())
|
||||
{
|
||||
if (instance)
|
||||
// Do not let the raid skip straight to Archimonde. Visible and hostile ONLY if Azagalor is finished.
|
||||
if ((instance->GetData(DATA_AZGALOREVENT) < DONE) && (me->IsVisible() || (me->getFaction() != 35)))
|
||||
{
|
||||
// Do not let the raid skip straight to Archimonde. Visible and hostile ONLY if Azagalor is finished.
|
||||
if ((instance->GetData(DATA_AZGALOREVENT) < DONE) && (me->IsVisible() || (me->getFaction() != 35)))
|
||||
{
|
||||
me->SetVisible(false);
|
||||
me->setFaction(35);
|
||||
}
|
||||
else if ((instance->GetData(DATA_AZGALOREVENT) >= DONE) && (!me->IsVisible() || (me->getFaction() == 35)))
|
||||
{
|
||||
me->setFaction(1720);
|
||||
me->SetVisible(true);
|
||||
}
|
||||
me->SetVisible(false);
|
||||
me->setFaction(35);
|
||||
}
|
||||
else if ((instance->GetData(DATA_AZGALOREVENT) >= DONE) && (!me->IsVisible() || (me->getFaction() == 35)))
|
||||
{
|
||||
me->setFaction(1720);
|
||||
me->SetVisible(true);
|
||||
}
|
||||
|
||||
if (DrainNordrassilTimer <= diff)
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_azgalorAI(creature);
|
||||
return GetInstanceAI<boss_azgalorAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_azgalorAI : public hyjal_trashAI
|
||||
@@ -121,19 +121,16 @@ public:
|
||||
if (!go)
|
||||
{
|
||||
go = true;
|
||||
if (instance)
|
||||
{
|
||||
AddWaypoint(0, 5492.91f, -2404.61f, 1462.63f);
|
||||
AddWaypoint(1, 5531.76f, -2460.87f, 1469.55f);
|
||||
AddWaypoint(2, 5554.58f, -2514.66f, 1476.12f);
|
||||
AddWaypoint(3, 5554.16f, -2567.23f, 1479.90f);
|
||||
AddWaypoint(4, 5540.67f, -2625.99f, 1480.89f);
|
||||
AddWaypoint(5, 5508.16f, -2659.2f, 1480.15f);
|
||||
AddWaypoint(6, 5489.62f, -2704.05f, 1482.18f);
|
||||
AddWaypoint(7, 5457.04f, -2726.26f, 1485.10f);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
AddWaypoint(0, 5492.91f, -2404.61f, 1462.63f);
|
||||
AddWaypoint(1, 5531.76f, -2460.87f, 1469.55f);
|
||||
AddWaypoint(2, 5554.58f, -2514.66f, 1476.12f);
|
||||
AddWaypoint(3, 5554.16f, -2567.23f, 1479.90f);
|
||||
AddWaypoint(4, 5540.67f, -2625.99f, 1480.89f);
|
||||
AddWaypoint(5, 5508.16f, -2659.2f, 1480.15f);
|
||||
AddWaypoint(6, 5489.62f, -2704.05f, 1482.18f);
|
||||
AddWaypoint(7, 5457.04f, -2726.26f, 1485.10f);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,17 +183,15 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_lesser_doomguardAI(creature);
|
||||
return GetInstanceAI<npc_lesser_doomguardAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_lesser_doomguardAI : public hyjal_trashAI
|
||||
{
|
||||
npc_lesser_doomguardAI(Creature* creature) : hyjal_trashAI(creature)
|
||||
{
|
||||
AzgalorGUID = 0;
|
||||
instance = creature->GetInstanceScript();
|
||||
if (instance)
|
||||
AzgalorGUID = instance->GetData64(DATA_AZGALOR);
|
||||
AzgalorGUID = instance->GetData64(DATA_AZGALOR);
|
||||
}
|
||||
|
||||
uint32 CrippleTimer;
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_kazrogalAI(creature);
|
||||
return GetInstanceAI<boss_kazrogalAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_kazrogalAI : public hyjal_trashAI
|
||||
@@ -117,19 +117,16 @@ public:
|
||||
if (!go)
|
||||
{
|
||||
go = true;
|
||||
if (instance)
|
||||
{
|
||||
AddWaypoint(0, 5492.91f, -2404.61f, 1462.63f);
|
||||
AddWaypoint(1, 5531.76f, -2460.87f, 1469.55f);
|
||||
AddWaypoint(2, 5554.58f, -2514.66f, 1476.12f);
|
||||
AddWaypoint(3, 5554.16f, -2567.23f, 1479.90f);
|
||||
AddWaypoint(4, 5540.67f, -2625.99f, 1480.89f);
|
||||
AddWaypoint(5, 5508.16f, -2659.2f, 1480.15f);
|
||||
AddWaypoint(6, 5489.62f, -2704.05f, 1482.18f);
|
||||
AddWaypoint(7, 5457.04f, -2726.26f, 1485.10f);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
AddWaypoint(0, 5492.91f, -2404.61f, 1462.63f);
|
||||
AddWaypoint(1, 5531.76f, -2460.87f, 1469.55f);
|
||||
AddWaypoint(2, 5554.58f, -2514.66f, 1476.12f);
|
||||
AddWaypoint(3, 5554.16f, -2567.23f, 1479.90f);
|
||||
AddWaypoint(4, 5540.67f, -2625.99f, 1480.89f);
|
||||
AddWaypoint(5, 5508.16f, -2659.2f, 1480.15f);
|
||||
AddWaypoint(6, 5489.62f, -2704.05f, 1482.18f);
|
||||
AddWaypoint(7, 5457.04f, -2726.26f, 1485.10f);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-14
@@ -44,7 +44,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_rage_winterchillAI(creature);
|
||||
return GetInstanceAI<boss_rage_winterchillAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_rage_winterchillAI : public hyjal_trashAI
|
||||
@@ -112,19 +112,16 @@ public:
|
||||
if (!go)
|
||||
{
|
||||
go = true;
|
||||
if (instance)
|
||||
{
|
||||
AddWaypoint(0, 4896.08f, -1576.35f, 1333.65f);
|
||||
AddWaypoint(1, 4898.68f, -1615.02f, 1329.48f);
|
||||
AddWaypoint(2, 4907.12f, -1667.08f, 1321.00f);
|
||||
AddWaypoint(3, 4963.18f, -1699.35f, 1340.51f);
|
||||
AddWaypoint(4, 4989.16f, -1716.67f, 1335.74f);
|
||||
AddWaypoint(5, 5026.27f, -1736.89f, 1323.02f);
|
||||
AddWaypoint(6, 5037.77f, -1770.56f, 1324.36f);
|
||||
AddWaypoint(7, 5067.23f, -1789.95f, 1321.17f);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
AddWaypoint(0, 4896.08f, -1576.35f, 1333.65f);
|
||||
AddWaypoint(1, 4898.68f, -1615.02f, 1329.48f);
|
||||
AddWaypoint(2, 4907.12f, -1667.08f, 1321.00f);
|
||||
AddWaypoint(3, 4963.18f, -1699.35f, 1340.51f);
|
||||
AddWaypoint(4, 4989.16f, -1716.67f, 1335.74f);
|
||||
AddWaypoint(5, 5026.27f, -1736.89f, 1323.02f);
|
||||
AddWaypoint(6, 5037.77f, -1770.56f, 1324.36f);
|
||||
AddWaypoint(7, 5067.23f, -1789.95f, 1321.17f);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -102,6 +102,9 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
if (!creature->GetInstanceScript())
|
||||
return NULL;
|
||||
|
||||
hyjalAI* ai = new hyjalAI(creature);
|
||||
|
||||
ai->Reset();
|
||||
@@ -184,6 +187,9 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
if (!creature->GetInstanceScript())
|
||||
return NULL;
|
||||
|
||||
hyjalAI* ai = new hyjalAI(creature);
|
||||
|
||||
ai->Reset();
|
||||
@@ -209,6 +215,9 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
if (!creature->GetInstanceScript())
|
||||
return NULL;
|
||||
|
||||
hyjalAI* ai = new hyjalAI(creature);
|
||||
ai->Reset();
|
||||
ai->EnterEvadeMode();
|
||||
|
||||
@@ -397,17 +397,14 @@ void hyjalAI::Reset()
|
||||
memset(Spells, 0, sizeof(Spell) * HYJAL_AI_MAX_SPELLS);
|
||||
|
||||
//Reset Instance Data for trash count
|
||||
if (instance)
|
||||
if ((!instance->GetData(DATA_ALLIANCE_RETREAT) && me->GetEntry() == JAINA) || (instance->GetData(DATA_ALLIANCE_RETREAT) && me->GetEntry() == THRALL))
|
||||
{
|
||||
if ((!instance->GetData(DATA_ALLIANCE_RETREAT) && me->GetEntry() == JAINA) || (instance->GetData(DATA_ALLIANCE_RETREAT) && me->GetEntry() == THRALL))
|
||||
{
|
||||
//Reset World States
|
||||
instance->DoUpdateWorldState(WORLD_STATE_WAVES, 0);
|
||||
instance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0);
|
||||
instance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 0);
|
||||
instance->SetData(DATA_RESET_TRASH_COUNT, 0);
|
||||
}
|
||||
} else TC_LOG_ERROR("scripts", ERROR_INST_DATA);
|
||||
//Reset World States
|
||||
instance->DoUpdateWorldState(WORLD_STATE_WAVES, 0);
|
||||
instance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0);
|
||||
instance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 0);
|
||||
instance->SetData(DATA_RESET_TRASH_COUNT, 0);
|
||||
}
|
||||
|
||||
//Visibility
|
||||
DoHide = true;
|
||||
@@ -517,11 +514,8 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3])
|
||||
CAST_AI(hyjal_trashAI, creature->AI())->IsEvent = true;
|
||||
break;
|
||||
}
|
||||
if (instance)
|
||||
{
|
||||
if (instance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE)
|
||||
creature->SetDisableReputationGain(true);//no repu for solo farming
|
||||
}
|
||||
if (instance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE)
|
||||
creature->SetDisableReputationGain(true);//no repu for solo farming
|
||||
// Check if Creature is a boss.
|
||||
if (creature->isWorldBoss())
|
||||
{
|
||||
@@ -538,11 +532,6 @@ void hyjalAI::SummonNextWave(const Wave wave[18], uint32 Count, float Base[4][3]
|
||||
if (rand()%4 == 0)
|
||||
Talk(RALLY);
|
||||
|
||||
if (!instance)
|
||||
{
|
||||
TC_LOG_ERROR("scripts", ERROR_INST_DATA);
|
||||
return;
|
||||
}
|
||||
InfernalCount = 0;//reset infernal count every new wave
|
||||
|
||||
EnemyCount = instance->GetData(DATA_TRASH);
|
||||
@@ -612,41 +601,34 @@ void hyjalAI::StartEvent(Player* player)
|
||||
|
||||
uint32 hyjalAI::GetInstanceData(uint32 Event)
|
||||
{
|
||||
if (instance)
|
||||
return instance->GetData(Event);
|
||||
else TC_LOG_ERROR("scripts", ERROR_INST_DATA);
|
||||
|
||||
return 0;
|
||||
return instance->GetData(Event);
|
||||
}
|
||||
|
||||
void hyjalAI::Retreat()
|
||||
{
|
||||
if (instance)
|
||||
{
|
||||
instance->SetData(TYPE_RETREAT, SPECIAL);
|
||||
instance->SetData(TYPE_RETREAT, SPECIAL);
|
||||
|
||||
if (Faction == 0)
|
||||
if (Faction == 0)
|
||||
{
|
||||
instance->SetData(DATA_ALLIANCE_RETREAT, 1);
|
||||
AddWaypoint(0, JainaWPs[0][0], JainaWPs[0][1], JainaWPs[0][2]);
|
||||
AddWaypoint(1, JainaWPs[1][0], JainaWPs[1][1], JainaWPs[1][2]);
|
||||
Start(false, false);
|
||||
SetDespawnAtEnd(false);//move to center of alliance base
|
||||
}
|
||||
if (Faction == 1)
|
||||
{
|
||||
instance->SetData(DATA_HORDE_RETREAT, 1);
|
||||
Creature* JainaDummy = me->SummonCreature(JAINA, JainaDummySpawn[0][0], JainaDummySpawn[0][1], JainaDummySpawn[0][2], JainaDummySpawn[0][3], TEMPSUMMON_TIMED_DESPAWN, 60000);
|
||||
if (JainaDummy)
|
||||
{
|
||||
instance->SetData(DATA_ALLIANCE_RETREAT, 1);
|
||||
AddWaypoint(0, JainaWPs[0][0], JainaWPs[0][1], JainaWPs[0][2]);
|
||||
AddWaypoint(1, JainaWPs[1][0], JainaWPs[1][1], JainaWPs[1][2]);
|
||||
Start(false, false);
|
||||
SetDespawnAtEnd(false);//move to center of alliance base
|
||||
}
|
||||
if (Faction == 1)
|
||||
{
|
||||
instance->SetData(DATA_HORDE_RETREAT, 1);
|
||||
Creature* JainaDummy = me->SummonCreature(JAINA, JainaDummySpawn[0][0], JainaDummySpawn[0][1], JainaDummySpawn[0][2], JainaDummySpawn[0][3], TEMPSUMMON_TIMED_DESPAWN, 60000);
|
||||
if (JainaDummy)
|
||||
{
|
||||
JainaDummy->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
CAST_AI(hyjalAI, JainaDummy->AI())->IsDummy = true;
|
||||
DummyGuid = JainaDummy->GetGUID();
|
||||
}
|
||||
AddWaypoint(0, JainaDummySpawn[1][0], JainaDummySpawn[1][1], JainaDummySpawn[1][2]);
|
||||
Start(false, false);
|
||||
SetDespawnAtEnd(false);//move to center of alliance base
|
||||
JainaDummy->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
CAST_AI(hyjalAI, JainaDummy->AI())->IsDummy = true;
|
||||
DummyGuid = JainaDummy->GetGUID();
|
||||
}
|
||||
AddWaypoint(0, JainaDummySpawn[1][0], JainaDummySpawn[1][1], JainaDummySpawn[1][2]);
|
||||
Start(false, false);
|
||||
SetDespawnAtEnd(false);//move to center of alliance base
|
||||
}
|
||||
SpawnVeins();
|
||||
Overrun = true;
|
||||
@@ -681,8 +663,6 @@ void hyjalAI::SpawnVeins()
|
||||
|
||||
void hyjalAI::DeSpawnVeins()
|
||||
{
|
||||
if (!instance)
|
||||
return;
|
||||
if (Faction == 1)
|
||||
{
|
||||
Creature* unit=Unit::GetCreature((*me), instance->GetData64(DATA_JAINAPROUDMOORE));
|
||||
@@ -841,8 +821,7 @@ void hyjalAI::UpdateAI(uint32 diff)
|
||||
CheckTimer = 0;
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
BossGUID[i] = 0;
|
||||
if (instance)
|
||||
instance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); // Reset world state for enemies to disable it
|
||||
instance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); // Reset world state for enemies to disable it
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -858,7 +837,7 @@ void hyjalAI::UpdateAI(uint32 diff)
|
||||
{
|
||||
if (SpellTimer[i] <= diff)
|
||||
{
|
||||
if (me->IsNonMeleeSpellCasted(false))
|
||||
if (me->IsNonMeleeSpellCast(false))
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
|
||||
Unit* target = NULL;
|
||||
@@ -899,18 +878,16 @@ void hyjalAI::JustDied(Unit* /*killer*/)
|
||||
RespawnTimer = 120000;
|
||||
Talk(DEATH);
|
||||
Summons.DespawnAll();//despawn all wave's summons
|
||||
if (instance)
|
||||
{//reset encounter if boss is despawned (ex: thrall is killed, boss despawns, event stucks at inprogress)
|
||||
if (instance->GetData(DATA_RAGEWINTERCHILLEVENT) == IN_PROGRESS)
|
||||
instance->SetData(DATA_RAGEWINTERCHILLEVENT, NOT_STARTED);
|
||||
if (instance->GetData(DATA_ANETHERONEVENT) == IN_PROGRESS)
|
||||
instance->SetData(DATA_ANETHERONEVENT, NOT_STARTED);
|
||||
if (instance->GetData(DATA_KAZROGALEVENT) == IN_PROGRESS)
|
||||
instance->SetData(DATA_KAZROGALEVENT, NOT_STARTED);
|
||||
if (instance->GetData(DATA_AZGALOREVENT) == IN_PROGRESS)
|
||||
instance->SetData(DATA_AZGALOREVENT, NOT_STARTED);
|
||||
instance->SetData(DATA_RESET_RAIDDAMAGE, 0);//reset damage on die
|
||||
}
|
||||
//reset encounter if boss is despawned (ex: thrall is killed, boss despawns, event stucks at inprogress)
|
||||
if (instance->GetData(DATA_RAGEWINTERCHILLEVENT) == IN_PROGRESS)
|
||||
instance->SetData(DATA_RAGEWINTERCHILLEVENT, NOT_STARTED);
|
||||
if (instance->GetData(DATA_ANETHERONEVENT) == IN_PROGRESS)
|
||||
instance->SetData(DATA_ANETHERONEVENT, NOT_STARTED);
|
||||
if (instance->GetData(DATA_KAZROGALEVENT) == IN_PROGRESS)
|
||||
instance->SetData(DATA_KAZROGALEVENT, NOT_STARTED);
|
||||
if (instance->GetData(DATA_AZGALOREVENT) == IN_PROGRESS)
|
||||
instance->SetData(DATA_AZGALOREVENT, NOT_STARTED);
|
||||
instance->SetData(DATA_RESET_RAIDDAMAGE, 0);//reset damage on die
|
||||
}
|
||||
|
||||
void hyjalAI::HideNearPos(float x, float y)
|
||||
|
||||
@@ -195,8 +195,7 @@ void hyjal_trashAI::DamageTaken(Unit* done_by, uint32 &damage)
|
||||
if (done_by->GetTypeId() == TYPEID_PLAYER || done_by->IsPet())
|
||||
{
|
||||
damageTaken += damage;
|
||||
if (instance)
|
||||
instance->SetData(DATA_RAIDDAMAGE, damage);//store raid's damage
|
||||
instance->SetData(DATA_RAIDDAMAGE, damage);//store raid's damage
|
||||
}
|
||||
}
|
||||
|
||||
@@ -399,9 +398,6 @@ void hyjal_trashAI::UpdateAI(uint32 /*diff*/)
|
||||
|
||||
void hyjal_trashAI::JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (IsEvent && !me->isWorldBoss())
|
||||
instance->SetData(DATA_TRASH, 0);//signal trash is dead
|
||||
|
||||
@@ -488,16 +484,13 @@ public:
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetDisplayId(me->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID));
|
||||
CanMove = true;
|
||||
if (instance)
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT) && !instance->GetData(DATA_HORDE_RETREAT))
|
||||
{
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT) && !instance->GetData(DATA_HORDE_RETREAT))
|
||||
{
|
||||
Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
} else if (instance->GetData(DATA_ALLIANCE_RETREAT) && instance->GetData(DATA_HORDE_RETREAT)){
|
||||
//do overrun
|
||||
}
|
||||
Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
} else if (instance->GetData(DATA_ALLIANCE_RETREAT) && instance->GetData(DATA_HORDE_RETREAT)){
|
||||
//do overrun
|
||||
}
|
||||
} else spawnTimer -= diff;
|
||||
}
|
||||
@@ -510,12 +503,9 @@ public:
|
||||
if (!go)
|
||||
{
|
||||
go = true;
|
||||
if (instance)
|
||||
{
|
||||
AddWaypoint(0, HordeWPs[7][0]+irand(-3, 3), HordeWPs[7][1]+irand(-3, 3), HordeWPs[7][2]);//HordeWPs[7] infront of thrall
|
||||
Start(true, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
AddWaypoint(0, HordeWPs[7][0]+irand(-3, 3), HordeWPs[7][1]+irand(-3, 3), HordeWPs[7][2]);//HordeWPs[7] infront of thrall
|
||||
Start(true, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -537,7 +527,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_giant_infernalAI(creature);
|
||||
return GetInstanceAI<npc_giant_infernalAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -548,7 +538,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_abominationAI(creature);
|
||||
return GetInstanceAI<npc_abominationAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_abominationAI : public hyjal_trashAI
|
||||
@@ -606,21 +596,18 @@ public:
|
||||
if (!go)
|
||||
{
|
||||
go = true;
|
||||
if (instance)
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
|
||||
{
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else//use alliance WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else//use alliance WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -646,7 +633,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_ghoulAI(creature);
|
||||
return GetInstanceAI<npc_ghoulAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_ghoulAI : public hyjal_trashAI
|
||||
@@ -709,21 +696,18 @@ public:
|
||||
if (!go)
|
||||
{
|
||||
go = true;
|
||||
if (instance)
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
|
||||
{
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else//use alliance WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else//use alliance WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -748,7 +732,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_necromancerAI(creature);
|
||||
return GetInstanceAI<npc_necromancerAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_necromancerAI : public hyjal_trashAI
|
||||
@@ -834,21 +818,18 @@ public:
|
||||
if (!go)
|
||||
{
|
||||
go = true;
|
||||
if (instance)
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
|
||||
{
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
|
||||
Start(true, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else//use alliance WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
|
||||
Start(true, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
|
||||
Start(true, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else//use alliance WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
|
||||
Start(true, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -875,7 +856,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_bansheeAI(creature);
|
||||
return GetInstanceAI<npc_bansheeAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_bansheeAI : public hyjal_trashAI
|
||||
@@ -930,21 +911,18 @@ public:
|
||||
if (!go)
|
||||
{
|
||||
go = true;
|
||||
if (instance)
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
|
||||
{
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else//use alliance WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else//use alliance WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -978,7 +956,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_crypt_fiendAI(creature);
|
||||
return GetInstanceAI<npc_crypt_fiendAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_crypt_fiendAI : public hyjal_trashAI
|
||||
@@ -1029,22 +1007,18 @@ public:
|
||||
if (!go)
|
||||
{
|
||||
go = true;
|
||||
if (instance)
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
|
||||
{
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else//use alliance WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else//use alliance WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1068,7 +1042,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_fel_stalkerAI(creature);
|
||||
return GetInstanceAI<npc_fel_stalkerAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_fel_stalkerAI : public hyjal_trashAI
|
||||
@@ -1119,22 +1093,18 @@ public:
|
||||
if (!go)
|
||||
{
|
||||
go = true;
|
||||
if (instance)
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
|
||||
{
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else//use alliance WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else//use alliance WPs
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1158,7 +1128,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_frost_wyrmAI(creature);
|
||||
return GetInstanceAI<npc_frost_wyrmAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_frost_wyrmAI : public hyjal_trashAI
|
||||
@@ -1221,20 +1191,17 @@ public:
|
||||
if (!go)
|
||||
{
|
||||
go = true;
|
||||
if (instance)
|
||||
if (!useFlyPath)
|
||||
{
|
||||
if (!useFlyPath)
|
||||
{
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
AddWaypoint(i, FrostWyrmWPs[i][0], FrostWyrmWPs[i][1], FrostWyrmWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else{//fly path FlyPathWPs
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
AddWaypoint(i, FlyPathWPs[i][0]+irand(-10, 10), FlyPathWPs[i][1]+irand(-10, 10), FlyPathWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
AddWaypoint(i, FrostWyrmWPs[i][0], FrostWyrmWPs[i][1], FrostWyrmWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else{//fly path FlyPathWPs
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
AddWaypoint(i, FlyPathWPs[i][0]+irand(-10, 10), FlyPathWPs[i][1]+irand(-10, 10), FlyPathWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1270,7 +1237,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_gargoyleAI(creature);
|
||||
return GetInstanceAI<npc_gargoyleAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_gargoyleAI : public hyjal_trashAI
|
||||
@@ -1334,20 +1301,17 @@ public:
|
||||
if (!go)
|
||||
{
|
||||
go = true;
|
||||
if (instance)
|
||||
if (!useFlyPath)
|
||||
{
|
||||
if (!useFlyPath)
|
||||
{
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
AddWaypoint(i, GargoyleWPs[i][0]+irand(-10, 10), GargoyleWPs[i][1]+irand(-10, 10), GargoyleWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else{//fly path FlyPathWPs
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
AddWaypoint(i, FlyPathWPs[i][0]+irand(-10, 10), FlyPathWPs[i][1]+irand(-10, 10), FlyPathWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
AddWaypoint(i, GargoyleWPs[i][0]+irand(-10, 10), GargoyleWPs[i][1]+irand(-10, 10), GargoyleWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else{//fly path FlyPathWPs
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
AddWaypoint(i, FlyPathWPs[i][0]+irand(-10, 10), FlyPathWPs[i][1]+irand(-10, 10), FlyPathWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-7
@@ -52,7 +52,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_epochAI(creature);
|
||||
return GetInstanceAI<boss_epochAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_epochAI : public ScriptedAI
|
||||
@@ -81,16 +81,14 @@ public:
|
||||
uiTimeStopTimer = 21300;
|
||||
uiWoundingStrikeTimer = 5300;
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_EPOCH_EVENT, NOT_STARTED);
|
||||
instance->SetData(DATA_EPOCH_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_EPOCH_EVENT, IN_PROGRESS);
|
||||
instance->SetData(DATA_EPOCH_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
@@ -132,8 +130,7 @@ public:
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_EPOCH_EVENT, DONE);
|
||||
instance->SetData(DATA_EPOCH_EVENT, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim) OVERRIDE
|
||||
|
||||
+4
-7
@@ -39,7 +39,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_infinite_corruptorAI(creature);
|
||||
return GetInstanceAI<boss_infinite_corruptorAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_infinite_corruptorAI : public ScriptedAI
|
||||
@@ -53,15 +53,13 @@ public:
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_INFINITE_EVENT, NOT_STARTED);
|
||||
instance->SetData(DATA_INFINITE_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
if (instance)
|
||||
instance->SetData(DATA_INFINITE_EVENT, IN_PROGRESS);
|
||||
instance->SetData(DATA_INFINITE_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 /*diff*/) OVERRIDE
|
||||
@@ -76,8 +74,7 @@ public:
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
if (instance)
|
||||
instance->SetData(DATA_INFINITE_EVENT, DONE);
|
||||
instance->SetData(DATA_INFINITE_EVENT, DONE);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_mal_ganisAI(creature);
|
||||
return GetInstanceAI<boss_mal_ganisAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_mal_ganisAI : public ScriptedAI
|
||||
@@ -102,15 +102,13 @@ public:
|
||||
uiSleepTimer = urand(15000, 20000);
|
||||
uiOutroTimer = 1000;
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_MAL_GANIS_EVENT, NOT_STARTED);
|
||||
instance->SetData(DATA_MAL_GANIS_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
if (instance)
|
||||
instance->SetData(DATA_MAL_GANIS_EVENT, IN_PROGRESS);
|
||||
instance->SetData(DATA_MAL_GANIS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* done_by, uint32 &damage) OVERRIDE
|
||||
@@ -154,8 +152,7 @@ public:
|
||||
{
|
||||
EnterEvadeMode();
|
||||
me->DisappearAndDie();
|
||||
if (instance)
|
||||
instance->SetData(DATA_MAL_GANIS_EVENT, FAIL);
|
||||
instance->SetData(DATA_MAL_GANIS_EVENT, FAIL);
|
||||
}
|
||||
|
||||
if (uiCarrionSwarmTimer < diff)
|
||||
@@ -228,13 +225,10 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
{
|
||||
instance->SetData(DATA_MAL_GANIS_EVENT, DONE);
|
||||
DoCastAOE(SPELL_MAL_GANIS_KILL_CREDIT);
|
||||
// give achievement credit and LFG rewards to players. criteria use spell 58630 which doesn't exist, but it was created in spell_dbc
|
||||
DoCastAOE(SPELL_KILL_CREDIT);
|
||||
}
|
||||
instance->SetData(DATA_MAL_GANIS_EVENT, DONE);
|
||||
DoCastAOE(SPELL_MAL_GANIS_KILL_CREDIT);
|
||||
// give achievement credit and LFG rewards to players. criteria use spell 58630 which doesn't exist, but it was created in spell_dbc
|
||||
DoCastAOE(SPELL_KILL_CREDIT);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim) OVERRIDE
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_meathookAI(creature);
|
||||
return GetInstanceAI<boss_meathookAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_meathookAI : public ScriptedAI
|
||||
@@ -59,8 +59,7 @@ public:
|
||||
boss_meathookAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
if (instance)
|
||||
Talk(SAY_SPAWN);
|
||||
Talk(SAY_SPAWN);
|
||||
}
|
||||
|
||||
uint32 uiChainTimer;
|
||||
@@ -75,16 +74,14 @@ public:
|
||||
uiDiseaseTimer = urand(2000, 4000); //approx 3s
|
||||
uiFrenzyTimer = urand(21000, 26000); //made it up
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_MEATHOOK_EVENT, NOT_STARTED);
|
||||
instance->SetData(DATA_MEATHOOK_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_MEATHOOK_EVENT, IN_PROGRESS);
|
||||
instance->SetData(DATA_MEATHOOK_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
@@ -119,8 +116,7 @@ public:
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_MEATHOOK_EVENT, DONE);
|
||||
instance->SetData(DATA_MEATHOOK_EVENT, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim) OVERRIDE
|
||||
|
||||
+5
-9
@@ -56,7 +56,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_salrammAI(creature);
|
||||
return GetInstanceAI<boss_salrammAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_salrammAI : public ScriptedAI
|
||||
@@ -64,8 +64,7 @@ public:
|
||||
boss_salrammAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
if (instance)
|
||||
Talk(SAY_SPAWN);
|
||||
Talk(SAY_SPAWN);
|
||||
}
|
||||
|
||||
uint32 uiCurseFleshTimer;
|
||||
@@ -84,16 +83,14 @@ public:
|
||||
uiStealFleshTimer = 12345;
|
||||
uiSummonGhoulsTimer = urand(19000, 24000); //on a video approx 24s after aggro
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_SALRAMM_EVENT, NOT_STARTED);
|
||||
instance->SetData(DATA_SALRAMM_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_SALRAMM_EVENT, IN_PROGRESS);
|
||||
instance->SetData(DATA_SALRAMM_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
@@ -142,8 +139,7 @@ public:
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_SALRAMM_EVENT, DONE);
|
||||
instance->SetData(DATA_SALRAMM_EVENT, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim) OVERRIDE
|
||||
|
||||
+69
-90
@@ -344,7 +344,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_arthasAI(creature);
|
||||
return GetInstanceAI<npc_arthasAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_arthasAI : public npc_escortAI
|
||||
@@ -399,22 +399,20 @@ public:
|
||||
malganisGUID = 0;
|
||||
infiniteGUID = 0;
|
||||
|
||||
if (instance) {
|
||||
instance->SetData(DATA_ARTHAS_EVENT, NOT_STARTED);
|
||||
switch (instance->GetData(DATA_ARTHAS_EVENT))
|
||||
{
|
||||
case NOT_STARTED:
|
||||
bStepping = true;
|
||||
step = 0;
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
bossEvent = DATA_MEATHOOK_EVENT;
|
||||
gossipStep = 0;
|
||||
break;
|
||||
}
|
||||
phaseTimer = 1000;
|
||||
exorcismTimer = 7300;
|
||||
wave = 0;
|
||||
instance->SetData(DATA_ARTHAS_EVENT, NOT_STARTED);
|
||||
switch (instance->GetData(DATA_ARTHAS_EVENT))
|
||||
{
|
||||
case NOT_STARTED:
|
||||
bStepping = true;
|
||||
step = 0;
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
bossEvent = DATA_MEATHOOK_EVENT;
|
||||
gossipStep = 0;
|
||||
break;
|
||||
}
|
||||
phaseTimer = 1000;
|
||||
exorcismTimer = 7300;
|
||||
wave = 0;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
@@ -424,8 +422,7 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_ARTHAS_EVENT, FAIL);
|
||||
instance->SetData(DATA_ARTHAS_EVENT, FAIL);
|
||||
}
|
||||
|
||||
void SpawnTimeRift(uint32 timeRiftID, uint64* guidVector)
|
||||
@@ -559,9 +556,8 @@ public:
|
||||
Talk(SAY_PHASE403);
|
||||
break;
|
||||
case 36:
|
||||
if (instance)
|
||||
if (GameObject* pGate = instance->instance->GetGameObject(instance->GetData64(DATA_SHKAF_GATE)))
|
||||
pGate->SetGoState(GO_STATE_ACTIVE);
|
||||
if (GameObject* pGate = instance->instance->GetGameObject(instance->GetData64(DATA_SHKAF_GATE)))
|
||||
pGate->SetGoState(GO_STATE_ACTIVE);
|
||||
break;
|
||||
case 45:
|
||||
SetRun(true);
|
||||
@@ -888,8 +884,7 @@ public:
|
||||
Talk(SAY_PHASE209);
|
||||
|
||||
bossEvent = DATA_MEATHOOK_EVENT;
|
||||
if (instance)
|
||||
instance->SetData(DATA_ARTHAS_EVENT, IN_PROGRESS);
|
||||
instance->SetData(DATA_ARTHAS_EVENT, IN_PROGRESS);
|
||||
|
||||
me->SetReactState(REACT_DEFENSIVE);
|
||||
SetDespawnAtFar(false);
|
||||
@@ -961,25 +956,22 @@ public:
|
||||
break;
|
||||
case 50: //Wait Boss death
|
||||
case 60:
|
||||
if (instance)
|
||||
if (instance->GetData(bossEvent) == DONE)
|
||||
{
|
||||
if (instance->GetData(bossEvent) == DONE)
|
||||
JumpToNextStep(1000);
|
||||
if (bossEvent == DATA_MEATHOOK_EVENT)
|
||||
bossEvent = DATA_SALRAMM_EVENT;
|
||||
else if (bossEvent == DATA_SALRAMM_EVENT)
|
||||
{
|
||||
JumpToNextStep(1000);
|
||||
if (bossEvent == DATA_MEATHOOK_EVENT)
|
||||
bossEvent = DATA_SALRAMM_EVENT;
|
||||
else if (bossEvent == DATA_SALRAMM_EVENT)
|
||||
{
|
||||
SetHoldState(false);
|
||||
bStepping = false;
|
||||
bossEvent = DATA_EPOCH_EVENT;
|
||||
}
|
||||
SetHoldState(false);
|
||||
bStepping = false;
|
||||
bossEvent = DATA_EPOCH_EVENT;
|
||||
}
|
||||
else if (instance->GetData(bossEvent) == FAIL)
|
||||
npc_escortAI::EnterEvadeMode();
|
||||
else
|
||||
phaseTimer = 10000;
|
||||
}
|
||||
else if (instance->GetData(bossEvent) == FAIL)
|
||||
npc_escortAI::EnterEvadeMode();
|
||||
else
|
||||
phaseTimer = 10000;
|
||||
break;
|
||||
//After Gossip 2 (waypoint 22)
|
||||
case 61:
|
||||
@@ -1096,53 +1088,47 @@ public:
|
||||
JumpToNextStep(1000);
|
||||
break;
|
||||
case 80:
|
||||
if (instance)
|
||||
if (instance->GetData(DATA_EPOCH_EVENT) != DONE)
|
||||
{
|
||||
SpawnTimeRift(17, &epochGUID);
|
||||
if (Creature* epoch = Unit::GetCreature(*me, epochGUID))
|
||||
epoch->AI()->Talk(SAY_PHASE314);
|
||||
me->SetTarget(epochGUID);
|
||||
}
|
||||
if (instance->GetData(DATA_EPOCH_EVENT) != DONE)
|
||||
{
|
||||
SpawnTimeRift(17, &epochGUID);
|
||||
if (Creature* epoch = Unit::GetCreature(*me, epochGUID))
|
||||
epoch->AI()->Talk(SAY_PHASE314);
|
||||
me->SetTarget(epochGUID);
|
||||
}
|
||||
JumpToNextStep(18000);
|
||||
break;
|
||||
case 81:
|
||||
if (instance)
|
||||
if (instance->GetData(DATA_EPOCH_EVENT) != DONE)
|
||||
Talk(SAY_PHASE315);
|
||||
if (instance->GetData(DATA_EPOCH_EVENT) != DONE)
|
||||
Talk(SAY_PHASE315);
|
||||
JumpToNextStep(6000);
|
||||
break;
|
||||
case 82:
|
||||
if (instance)
|
||||
if (instance->GetData(DATA_EPOCH_EVENT) != DONE)
|
||||
if (instance->GetData(DATA_EPOCH_EVENT) != DONE)
|
||||
{
|
||||
if (Creature* epoch = Unit::GetCreature(*me, epochGUID))
|
||||
{
|
||||
if (Creature* epoch = Unit::GetCreature(*me, epochGUID))
|
||||
{
|
||||
//Make Epoch attackable
|
||||
epoch->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
epoch->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
epoch->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
|
||||
//Make Epoch attackable
|
||||
epoch->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
epoch->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
epoch->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
|
||||
}
|
||||
JumpToNextStep(1000);
|
||||
break;
|
||||
case 83:
|
||||
if (instance)
|
||||
if (instance->GetData(DATA_EPOCH_EVENT) == DONE)
|
||||
{
|
||||
if (instance->GetData(DATA_EPOCH_EVENT) == DONE)
|
||||
{
|
||||
gossipStep = 3;
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
bStepping = false;
|
||||
bossEvent = DATA_MAL_GANIS_EVENT;
|
||||
JumpToNextStep(15000);
|
||||
}
|
||||
else if (instance->GetData(DATA_EPOCH_EVENT) == FAIL)
|
||||
npc_escortAI::EnterEvadeMode();
|
||||
else
|
||||
phaseTimer = 10000;
|
||||
gossipStep = 3;
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
bStepping = false;
|
||||
bossEvent = DATA_MAL_GANIS_EVENT;
|
||||
JumpToNextStep(15000);
|
||||
}
|
||||
else if (instance->GetData(DATA_EPOCH_EVENT) == FAIL)
|
||||
npc_escortAI::EnterEvadeMode();
|
||||
else
|
||||
phaseTimer = 10000;
|
||||
break;
|
||||
//After Gossip 4
|
||||
case 84:
|
||||
@@ -1158,9 +1144,8 @@ public:
|
||||
malganisGUID = malganis->GetGUID();
|
||||
malganis->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
if (instance)
|
||||
if (GameObject* pGate = instance->instance->GetGameObject(instance->GetData64(DATA_MAL_GANIS_GATE_1)))
|
||||
pGate->SetGoState(GO_STATE_ACTIVE);
|
||||
if (GameObject* pGate = instance->instance->GetGameObject(instance->GetData64(DATA_MAL_GANIS_GATE_1)))
|
||||
pGate->SetGoState(GO_STATE_ACTIVE);
|
||||
SetHoldState(false);
|
||||
bStepping = false;
|
||||
JumpToNextStep(0);
|
||||
@@ -1180,18 +1165,15 @@ public:
|
||||
JumpToNextStep(1000);
|
||||
break;
|
||||
case 88:
|
||||
if (instance)
|
||||
if (instance->GetData(DATA_MAL_GANIS_EVENT) == DONE)
|
||||
{
|
||||
if (instance->GetData(DATA_MAL_GANIS_EVENT) == DONE)
|
||||
{
|
||||
SetHoldState(false);
|
||||
JumpToNextStep(1000);
|
||||
}
|
||||
else if (instance->GetData(DATA_MAL_GANIS_EVENT) == FAIL)
|
||||
npc_escortAI::EnterEvadeMode();
|
||||
else
|
||||
phaseTimer = 10000;
|
||||
SetHoldState(false);
|
||||
JumpToNextStep(1000);
|
||||
}
|
||||
else if (instance->GetData(DATA_MAL_GANIS_EVENT) == FAIL)
|
||||
npc_escortAI::EnterEvadeMode();
|
||||
else
|
||||
phaseTimer = 10000;
|
||||
break;
|
||||
//After waypoint 56
|
||||
case 89:
|
||||
@@ -1201,11 +1183,8 @@ public:
|
||||
JumpToNextStep(7000);
|
||||
break;
|
||||
case 90:
|
||||
if (instance)
|
||||
{
|
||||
instance->SetData(DATA_ARTHAS_EVENT, DONE); //Rewards: Achiev & Chest ;D
|
||||
me->SetTarget(instance->GetData64(DATA_MAL_GANIS_GATE_2)); //Look behind
|
||||
}
|
||||
instance->SetData(DATA_ARTHAS_EVENT, DONE); //Rewards: Achiev & Chest ;D
|
||||
me->SetTarget(instance->GetData64(DATA_MAL_GANIS_GATE_2)); //Look behind
|
||||
Talk(SAY_PHASE504);
|
||||
bStepping = false;
|
||||
break;
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_captain_skarlocAI(creature);
|
||||
return GetInstanceAI<boss_captain_skarlocAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_captain_skarlocAI : public ScriptedAI
|
||||
|
||||
+2
-2
@@ -52,7 +52,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_epoch_hunterAI(creature);
|
||||
return GetInstanceAI<boss_epoch_hunterAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_epoch_hunterAI : public ScriptedAI
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
//Sand Breath
|
||||
if (SandBreath_Timer <= diff)
|
||||
{
|
||||
if (me->IsNonMeleeSpellCasted(false))
|
||||
if (me->IsNonMeleeSpellCast(false))
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
|
||||
DoCastVictim(SPELL_SAND_BREATH);
|
||||
|
||||
@@ -188,7 +188,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_thrall_old_hillsbradAI(creature);
|
||||
return GetInstanceAI<npc_thrall_old_hillsbradAI>(creature);
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
|
||||
@@ -291,9 +291,6 @@ public:
|
||||
|
||||
void WaypointReached(uint32 waypointId) OVERRIDE
|
||||
{
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
switch (waypointId)
|
||||
{
|
||||
case 8:
|
||||
@@ -526,8 +523,7 @@ public:
|
||||
}
|
||||
void JustDied(Unit* slayer) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(TYPE_THRALL_EVENT, FAIL);
|
||||
instance->SetData(TYPE_THRALL_EVENT, FAIL);
|
||||
|
||||
// Don't do a yell if he kills self (if player goes too far or at the end).
|
||||
if (slayer == me)
|
||||
@@ -573,7 +569,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_tarethaAI(creature);
|
||||
return GetInstanceAI<npc_tarethaAI>(creature);
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user