From d74dcabd859ec70ae6a466e1e5e0e9d15d14591b Mon Sep 17 00:00:00 2001 From: Sebastian Valle Date: Thu, 3 Oct 2013 17:47:38 -0500 Subject: Core/MMaps: Started this new branch as my playground for mmaps. Made some refactoring Free memory taken by mmaps when a map is destroyed. --- src/server/game/Maps/Map.cpp | 16 +++++++++------- src/server/game/Maps/MapInstanced.cpp | 2 +- src/server/game/Movement/PathGenerator.cpp | 3 ++- src/server/game/World/World.cpp | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 4660489004d..3156a071854 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -66,7 +66,9 @@ Map::~Map() if (!m_scriptSchedule.empty()) sScriptMgr->DecreaseScheduledScriptCount(m_scriptSchedule.size()); - MMAP::MMapFactory::createOrGetMMapManager()->unloadMapInstance(GetId(), i_InstanceId); + MMAP::MMapManager* manager = MMAP::MMapFactory::CreateOrGetMMapManager(); + manager->UnloadMapInstance(GetId(), i_InstanceId); // Delete the dtNavMeshQuery + manager->UnloadMap(GetId()); // Unload the loaded tiles and delete the dtNavMesh } bool Map::ExistMap(uint32 mapid, int gx, int gy) @@ -119,12 +121,12 @@ bool Map::ExistVMap(uint32 mapid, int gx, int gy) void Map::LoadMMap(int gx, int gy) { - bool mmapLoadResult = MMAP::MMapFactory::createOrGetMMapManager()->loadMap((sWorld->GetDataPath() + "mmaps").c_str(), GetId(), gx, gy); + bool mmapLoadResult = MMAP::MMapFactory::CreateOrGetMMapManager()->LoadMapTile(GetId(), gx, gy); if (mmapLoadResult) - TC_LOG_INFO(LOG_FILTER_MAPS, "MMAP loaded name:%s, id:%d, x:%d, y:%d (mmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); + TC_LOG_INFO(LOG_FILTER_MAPS, "MMAP loaded name: %s, id: %d, x: %d, y: %d", GetMapName(), GetId(), gx, gy); else - TC_LOG_INFO(LOG_FILTER_MAPS, "Could not load MMAP name:%s, id:%d, x:%d, y:%d (mmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); + TC_LOG_INFO(LOG_FILTER_MAPS, "Could not load MMAP name: %s, id: %d, x: %d, y: %d", GetMapName(), GetId(), gx, gy); } void Map::LoadVMap(int gx, int gy) @@ -224,9 +226,9 @@ m_activeNonPlayersIter(m_activeNonPlayers.end()), i_gridExpiry(expiry), i_scriptLock(false) { m_parentMap = (_parent ? _parent : this); - for (unsigned int idx=0; idx < MAX_NUMBER_OF_GRIDS; ++idx) + for (unsigned int idx = 0; idx < MAX_NUMBER_OF_GRIDS; ++idx) { - for (unsigned int j=0; j < MAX_NUMBER_OF_GRIDS; ++j) + for (unsigned int j = 0; j < MAX_NUMBER_OF_GRIDS; ++j) { //z code GridMaps[idx][j] =NULL; @@ -1009,7 +1011,7 @@ bool Map::UnloadGrid(NGridType& ngrid, bool unloadAll) delete GridMaps[gx][gy]; } VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(GetId(), gx, gy); - MMAP::MMapFactory::createOrGetMMapManager()->unloadMap(GetId(), gx, gy); + MMAP::MMapFactory::CreateOrGetMMapManager()->UnloadMapTile(GetId(), gx, gy); } else ((MapInstanced*)m_parentMap)->RemoveGridMapReference(GridCoord(gx, gy)); diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index 385683d66af..05c430c4d00 100644 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -260,7 +260,7 @@ bool MapInstanced::DestroyInstance(InstancedMaps::iterator &itr) if (m_InstancedMaps.size() <= 1 && sWorld->getBoolConfig(CONFIG_GRID_UNLOAD)) { VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(itr->second->GetId()); - MMAP::MMapFactory::createOrGetMMapManager()->unloadMap(itr->second->GetId()); + MMAP::MMapFactory::CreateOrGetMMapManager()->UnloadMap(itr->second->GetId()); // in that case, unload grids of the base map, too // so in the next map creation, (EnsureGridCreated actually) VMaps will be reloaded Map::UnloadAll(); diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index c902eb850f6..3216cb8103e 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -1,4 +1,5 @@ /* + * Copyright (C) 2008-2013 TrinityCore * Copyright (C) 2005-2011 MaNGOS * * This program is free software; you can redistribute it and/or modify @@ -38,7 +39,7 @@ PathGenerator::PathGenerator(const Unit* owner) : uint32 mapId = _sourceUnit->GetMapId(); if (MMAP::MMapFactory::IsPathfindingEnabled(mapId)) { - MMAP::MMapManager* mmap = MMAP::MMapFactory::createOrGetMMapManager(); + MMAP::MMapManager* mmap = MMAP::MMapFactory::CreateOrGetMMapManager(); _navMesh = mmap->GetNavMesh(mapId); _navMeshQuery = mmap->GetNavMeshQuery(mapId, _sourceUnit->GetInstanceId()); } diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 8ca2e1db56e..d3258aa3401 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -137,7 +137,7 @@ World::~World() delete command; VMAP::VMapFactory::clear(); - MMAP::MMapFactory::clear(); + MMAP::MMapFactory::Clear(); /// @todo free addSessQueue } -- cgit v1.2.3 From a27237dedd1b770ab4e66570e7a236a44d2c9e00 Mon Sep 17 00:00:00 2001 From: Sebastian Valle Date: Fri, 4 Oct 2013 22:23:17 -0500 Subject: Core/MMaps: MMaps are now correctly loaded into TC P.S: They do behave better in some places, but are still a bit weird in some others, will have to look into that. P.P.S: I'll have to re-implement all the previous PathGenerator code --- src/server/game/Maps/Map.cpp | 6 +- src/server/game/Miscellaneous/SharedDefines.h | 2 +- .../ConfusedMovementGenerator.cpp | 1 - .../FleeingMovementGenerator.cpp | 1 - src/server/game/Movement/PathGenerator.cpp | 755 ++------------------- src/server/game/Movement/PathGenerator.h | 52 -- src/server/game/Spells/Spell.cpp | 1 - src/server/scripts/Commands/cs_mmaps.cpp | 68 +- src/tools/mesh_extractor/MeshExtractor.cpp | 8 +- src/tools/mesh_extractor/TileBuilder.cpp | 4 +- 10 files changed, 125 insertions(+), 773 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 3156a071854..aaeb06462ef 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -121,7 +121,11 @@ bool Map::ExistVMap(uint32 mapid, int gx, int gy) void Map::LoadMMap(int gx, int gy) { - bool mmapLoadResult = MMAP::MMapFactory::CreateOrGetMMapManager()->LoadMapTile(GetId(), gx, gy); + bool mmapLoadResult = false; + if (GetEntry()->Instanceable()) + mmapLoadResult = MMAP::MMapFactory::CreateOrGetMMapManager()->LoadMapTile(GetId(), 0, 0); // Ignore the tile entry for instances, as they only have 1 tile. + else + mmapLoadResult = MMAP::MMapFactory::CreateOrGetMMapManager()->LoadMapTile(GetId(), gx, gy); if (mmapLoadResult) TC_LOG_INFO(LOG_FILTER_MAPS, "MMAP loaded name: %s, id: %d, x: %d, y: %d", GetMapName(), GetId(), gx, gy); diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index e561d37ed36..6ed0982e631 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -3541,7 +3541,7 @@ enum PartyResult }; const uint32 MMAP_MAGIC = 0x4d4d4150; // 'MMAP' -#define MMAP_VERSION 4 +#define MMAP_VERSION 3 struct MmapTileHeader { diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp index ef24b112253..63b1cf283a4 100755 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp @@ -86,7 +86,6 @@ bool ConfusedMovementGenerator::DoUpdate(T* unit, uint32 diff) unit->MovePositionToFirstCollision(pos, dest, 0.0f); PathGenerator path(unit); - path.SetPathLengthLimit(30.0f); bool result = path.CalculatePath(pos.m_positionX, pos.m_positionY, pos.m_positionZ); if (!result || (path.GetPathType() & PATHFIND_NOPATH)) { diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp index f78411fc547..1c65499fe50 100644 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp @@ -44,7 +44,6 @@ void FleeingMovementGenerator::_setTargetLocation(T* owner) _getPoint(owner, x, y, z); PathGenerator path(owner); - path.SetPathLengthLimit(30.0f); bool result = path.CalculatePath(x, y, z); if (!result || (path.GetPathType() & PATHFIND_NOPATH)) { diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index 3216cb8103e..c5922156939 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -29,12 +29,10 @@ ////////////////// PathGenerator ////////////////// PathGenerator::PathGenerator(const Unit* owner) : - _polyLength(0), _type(PATHFIND_BLANK), _useStraightPath(false), - _forceDestination(false), _pointPathLimit(MAX_POINT_PATH_LENGTH), - _endPosition(G3D::Vector3::zero()), _sourceUnit(owner), _navMesh(NULL), - _navMeshQuery(NULL) + _type(PATHFIND_BLANK), _endPosition(G3D::Vector3::zero()), + _sourceUnit(owner), _navMesh(NULL), _navMeshQuery(NULL) { - TC_LOG_DEBUG(LOG_FILTER_MAPS, "++ PathGenerator::PathGenerator for %u \n", _sourceUnit->GetGUIDLow()); + TC_LOG_DEBUG(LOG_FILTER_MAPS, "PathGenerator::PathGenerator for %u \n", _sourceUnit->GetGUIDLow()); uint32 mapId = _sourceUnit->GetMapId(); if (MMAP::MMapFactory::IsPathfindingEnabled(mapId)) @@ -49,7 +47,7 @@ PathGenerator::PathGenerator(const Unit* owner) : PathGenerator::~PathGenerator() { - TC_LOG_DEBUG(LOG_FILTER_MAPS, "++ PathGenerator::~PathGenerator() for %u \n", _sourceUnit->GetGUIDLow()); + TC_LOG_DEBUG(LOG_FILTER_MAPS, "PathGenerator::~PathGenerator() for %u \n", _sourceUnit->GetGUIDLow()); } bool PathGenerator::CalculatePath(float destX, float destY, float destZ, bool forceDest) @@ -66,463 +64,88 @@ bool PathGenerator::CalculatePath(float destX, float destY, float destZ, bool fo G3D::Vector3 start(x, y, z); SetStartPosition(start); - _forceDestination = forceDest; - - TC_LOG_DEBUG(LOG_FILTER_MAPS, "++ PathGenerator::CalculatePath() for %u \n", _sourceUnit->GetGUIDLow()); + TC_LOG_DEBUG(LOG_FILTER_MAPS, "PathGenerator::CalculatePath() for %u \n", _sourceUnit->GetGUIDLow()); // make sure navMesh works - we can run on map w/o mmap // check if the start and end point have a .mmtile loaded (can we pass via not loaded tile on the way?) - if (!_navMesh || !_navMeshQuery || _sourceUnit->HasUnitState(UNIT_STATE_IGNORE_PATHFINDING) || - !HaveTile(start) || !HaveTile(dest)) + if (!_navMesh || !_navMeshQuery || _sourceUnit->HasUnitState(UNIT_STATE_IGNORE_PATHFINDING)) { - BuildShortcut(); _type = PathType(PATHFIND_NORMAL | PATHFIND_NOT_USING_PATH); return true; } UpdateFilter(); - BuildPolyPath(start, dest); - return true; -} - -dtPolyRef PathGenerator::GetPathPolyByPosition(dtPolyRef const* polyPath, uint32 polyPathSize, float const* point, float* distance) const -{ - if (!polyPath || !polyPathSize) - return INVALID_POLYREF; - - dtPolyRef nearestPoly = INVALID_POLYREF; - float minDist2d = FLT_MAX; - float minDist3d = 0.0f; + float startPos[3]; + startPos[0] = -y; + startPos[1] = z; + startPos[2] = -x; - for (uint32 i = 0; i < polyPathSize; ++i) - { - float closestPoint[VERTEX_SIZE]; - if (dtStatusFailed(_navMeshQuery->closestPointOnPoly(polyPath[i], point, closestPoint))) - continue; - - float d = dtVdist2DSqr(point, closestPoint); - if (d < minDist2d) - { - minDist2d = d; - nearestPoly = polyPath[i]; - minDist3d = dtVdistSqr(point, closestPoint); - } + float endPos[3]; + endPos[0] = -destY; + endPos[1] = destZ; + endPos[2] = -destX; - if (minDist2d < 1.0f) // shortcut out - close enough for us - break; - } + float polyPickExt[3]; + polyPickExt[0] = 2.5f; + polyPickExt[1] = 2.5f; + polyPickExt[2] = 2.5f; - if (distance) - *distance = dtSqrt(minDist3d); + // + dtPolyRef startRef; + dtPolyRef endRef; - return (minDist2d < 3.0f) ? nearestPoly : INVALID_POLYREF; -} + float nearestPt[3]; -dtPolyRef PathGenerator::GetPolyByLocation(float const* point, float* distance) const -{ - // first we check the current path - // if the current path doesn't contain the current poly, - // we need to use the expensive navMesh.findNearestPoly - dtPolyRef polyRef = GetPathPolyByPosition(_pathPolyRefs, _polyLength, point, distance); - if (polyRef != INVALID_POLYREF) - return polyRef; + _navMeshQuery->findNearestPoly(startPos, polyPickExt, &_filter, &startRef, nearestPt); + _navMeshQuery->findNearestPoly(endPos, polyPickExt, &_filter, &endRef, nearestPt); - // we don't have it in our old path - // try to get it by findNearestPoly() - // first try with low search box - float extents[VERTEX_SIZE] = {3.0f, 5.0f, 3.0f}; // bounds of poly search area - float closestPoint[VERTEX_SIZE] = {0.0f, 0.0f, 0.0f}; - if (dtStatusSucceed(_navMeshQuery->findNearestPoly(point, extents, &_filter, &polyRef, closestPoint)) && polyRef != INVALID_POLYREF) + if (!startRef || !endRef) { - *distance = dtVdist(closestPoint, point); - return polyRef; - } - - // still nothing .. - // try with bigger search box - // Note that the extent should not overlap more than 128 polygons in the navmesh (see dtNavMeshQuery::findNearestPoly) - extents[1] = 50.0f; - - if (dtStatusSucceed(_navMeshQuery->findNearestPoly(point, extents, &_filter, &polyRef, closestPoint)) && polyRef != INVALID_POLYREF) - { - *distance = dtVdist(closestPoint, point); - return polyRef; - } - - return INVALID_POLYREF; -} - -void PathGenerator::BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 const& endPos) -{ - // *** getting start/end poly logic *** - - float distToStartPoly, distToEndPoly; - float startPoint[VERTEX_SIZE] = {startPos.y, startPos.z, startPos.x}; - float endPoint[VERTEX_SIZE] = {endPos.y, endPos.z, endPos.x}; - - dtPolyRef startPoly = GetPolyByLocation(startPoint, &distToStartPoly); - dtPolyRef endPoly = GetPolyByLocation(endPoint, &distToEndPoly); - - // we have a hole in our mesh - // make shortcut path and mark it as NOPATH ( with flying and swimming exception ) - // its up to caller how he will use this info - if (startPoly == INVALID_POLYREF || endPoly == INVALID_POLYREF) - { - TC_LOG_DEBUG(LOG_FILTER_MAPS, "++ BuildPolyPath :: (startPoly == 0 || endPoly == 0)\n"); - BuildShortcut(); - bool path = _sourceUnit->GetTypeId() == TYPEID_UNIT && _sourceUnit->ToCreature()->CanFly(); - - bool waterPath = _sourceUnit->GetTypeId() == TYPEID_UNIT && _sourceUnit->ToCreature()->CanSwim(); - if (waterPath) - { - // Check both start and end points, if they're both in water, then we can *safely* let the creature move - for (uint32 i = 0; i < _pathPoints.size(); ++i) - { - ZLiquidStatus status = _sourceUnit->GetBaseMap()->getLiquidStatus(_pathPoints[i].x, _pathPoints[i].y, _pathPoints[i].z, MAP_ALL_LIQUIDS, NULL); - // One of the points is not in the water, cancel movement. - if (status == LIQUID_MAP_NO_WATER) - { - waterPath = false; - break; - } - } - } - - _type = (path || waterPath) ? PathType(PATHFIND_NORMAL | PATHFIND_NOT_USING_PATH) : PATHFIND_NOPATH; - return; - } - - // we may need a better number here - bool farFromPoly = (distToStartPoly > 7.0f || distToEndPoly > 7.0f); - if (farFromPoly) - { - TC_LOG_DEBUG(LOG_FILTER_MAPS, "++ BuildPolyPath :: farFromPoly distToStartPoly=%.3f distToEndPoly=%.3f\n", distToStartPoly, distToEndPoly); - - bool buildShotrcut = false; - if (_sourceUnit->GetTypeId() == TYPEID_UNIT) - { - Creature* owner = (Creature*)_sourceUnit; - - G3D::Vector3 const& p = (distToStartPoly > 7.0f) ? startPos : endPos; - if (_sourceUnit->GetBaseMap()->IsUnderWater(p.x, p.y, p.z)) - { - TC_LOG_DEBUG(LOG_FILTER_MAPS, "++ BuildPolyPath :: underWater case\n"); - if (owner->CanSwim()) - buildShotrcut = true; - } - else - { - TC_LOG_DEBUG(LOG_FILTER_MAPS, "++ BuildPolyPath :: flying case\n"); - if (owner->CanFly()) - buildShotrcut = true; - } - } - - if (buildShotrcut) - { - BuildShortcut(); - _type = PathType(PATHFIND_NORMAL | PATHFIND_NOT_USING_PATH); - return; - } - else - { - float closestPoint[VERTEX_SIZE]; - // we may want to use closestPointOnPolyBoundary instead - if (dtStatusSucceed(_navMeshQuery->closestPointOnPoly(endPoly, endPoint, closestPoint))) - { - dtVcopy(endPoint, closestPoint); - SetActualEndPosition(G3D::Vector3(endPoint[2], endPoint[0], endPoint[1])); - } - - _type = PATHFIND_INCOMPLETE; - } - } - - // *** poly path generating logic *** - - // start and end are on same polygon - // just need to move in straight line - if (startPoly == endPoly) - { - TC_LOG_DEBUG(LOG_FILTER_MAPS, "++ BuildPolyPath :: (startPoly == endPoly)\n"); - - BuildShortcut(); - - _pathPolyRefs[0] = startPoly; - _polyLength = 1; - - _type = farFromPoly ? PATHFIND_INCOMPLETE : PATHFIND_NORMAL; - TC_LOG_DEBUG(LOG_FILTER_MAPS, "++ BuildPolyPath :: path type %d\n", _type); - return; - } - - // look for startPoly/endPoly in current path - /// @todo we can merge it with getPathPolyByPosition() loop - bool startPolyFound = false; - bool endPolyFound = false; - uint32 pathStartIndex = 0; - uint32 pathEndIndex = 0; - - if (_polyLength) - { - for (; pathStartIndex < _polyLength; ++pathStartIndex) - { - // here to carch few bugs - ASSERT(_pathPolyRefs[pathStartIndex] != INVALID_POLYREF); - - if (_pathPolyRefs[pathStartIndex] == startPoly) - { - startPolyFound = true; - break; - } - } - - for (pathEndIndex = _polyLength-1; pathEndIndex > pathStartIndex; --pathEndIndex) - if (_pathPolyRefs[pathEndIndex] == endPoly) - { - endPolyFound = true; - break; - } - } - - if (startPolyFound && endPolyFound) - { - TC_LOG_DEBUG(LOG_FILTER_MAPS, "++ BuildPolyPath :: (startPolyFound && endPolyFound)\n"); - - // we moved along the path and the target did not move out of our old poly-path - // our path is a simple subpath case, we have all the data we need - // just "cut" it out - - _polyLength = pathEndIndex - pathStartIndex + 1; - memmove(_pathPolyRefs, _pathPolyRefs + pathStartIndex, _polyLength * sizeof(dtPolyRef)); + TC_LOG_DEBUG(LOG_FILTER_MAPS, "PathGenerator::CalculatePath() for %u no polygons found for start and end locations\n", _sourceUnit->GetGUIDLow()); + _type = PATHFIND_NOPATH; + return false; } - else if (startPolyFound && !endPolyFound) - { - TC_LOG_DEBUG(LOG_FILTER_MAPS, "++ BuildPolyPath :: (startPolyFound && !endPolyFound)\n"); - - // we are moving on the old path but target moved out - // so we have atleast part of poly-path ready - - _polyLength -= pathStartIndex; - // try to adjust the suffix of the path instead of recalculating entire length - // at given interval the target cannot get too far from its last location - // thus we have less poly to cover - // sub-path of optimal path is optimal - - // take ~80% of the original length - /// @todo play with the values here - uint32 prefixPolyLength = uint32(_polyLength * 0.8f + 0.5f); - memmove(_pathPolyRefs, _pathPolyRefs+pathStartIndex, prefixPolyLength * sizeof(dtPolyRef)); - - dtPolyRef suffixStartPoly = _pathPolyRefs[prefixPolyLength-1]; - - // we need any point on our suffix start poly to generate poly-path, so we need last poly in prefix data - float suffixEndPoint[VERTEX_SIZE]; - if (dtStatusFailed(_navMeshQuery->closestPointOnPoly(suffixStartPoly, endPoint, suffixEndPoint))) - { - // we can hit offmesh connection as last poly - closestPointOnPoly() don't like that - // try to recover by using prev polyref - --prefixPolyLength; - suffixStartPoly = _pathPolyRefs[prefixPolyLength-1]; - if (dtStatusFailed(_navMeshQuery->closestPointOnPoly(suffixStartPoly, endPoint, suffixEndPoint))) - { - // suffixStartPoly is still invalid, error state - BuildShortcut(); - _type = PATHFIND_NOPATH; - return; - } - } - - // generate suffix - uint32 suffixPolyLength = 0; - dtStatus dtResult = _navMeshQuery->findPath( - suffixStartPoly, // start polygon - endPoly, // end polygon - suffixEndPoint, // start position - endPoint, // end position - &_filter, // polygon search filter - _pathPolyRefs + prefixPolyLength - 1, // [out] path - (int*)&suffixPolyLength, - MAX_PATH_LENGTH-prefixPolyLength); // max number of polygons in output path - - if (!suffixPolyLength || dtStatusFailed(dtResult)) - { - // this is probably an error state, but we'll leave it - // and hopefully recover on the next Update - // we still need to copy our preffix - TC_LOG_ERROR(LOG_FILTER_MAPS, "%u's Path Build failed: 0 length path", _sourceUnit->GetGUIDLow()); - } - - TC_LOG_DEBUG(LOG_FILTER_MAPS, "++ m_polyLength=%u prefixPolyLength=%u suffixPolyLength=%u \n", _polyLength, prefixPolyLength, suffixPolyLength); - - // new path = prefix + suffix - overlap - _polyLength = prefixPolyLength + suffixPolyLength - 1; - } - else + int hops; + dtPolyRef* hopBuffer = new dtPolyRef[8192]; + dtStatus status = _navMeshQuery->findPath(startRef, endRef, startPos, endPos, &_filter, hopBuffer, &hops, 8192); + + if (!dtStatusSucceed(status)) { - TC_LOG_DEBUG(LOG_FILTER_MAPS, "++ BuildPolyPath :: (!startPolyFound && !endPolyFound)\n"); - - // either we have no path at all -> first run - // or something went really wrong -> we aren't moving along the path to the target - // just generate new path - - // free and invalidate old path data - Clear(); - - dtStatus dtResult = _navMeshQuery->findPath( - startPoly, // start polygon - endPoly, // end polygon - startPoint, // start position - endPoint, // end position - &_filter, // polygon search filter - _pathPolyRefs, // [out] path - (int*)&_polyLength, - MAX_PATH_LENGTH); // max number of polygons in output path - - if (!_polyLength || dtStatusFailed(dtResult)) - { - // only happens if we passed bad data to findPath(), or navmesh is messed up - TC_LOG_ERROR(LOG_FILTER_MAPS, "%u's Path Build failed: 0 length path", _sourceUnit->GetGUIDLow()); - BuildShortcut(); - _type = PATHFIND_NOPATH; - return; - } + TC_LOG_DEBUG(LOG_FILTER_MAPS, "PathGenerator::CalculatePath() for %u no path found for start and end locations\n", _sourceUnit->GetGUIDLow()); + _type = PATHFIND_NOPATH; + return false; } - // by now we know what type of path we can get - if (_pathPolyRefs[_polyLength - 1] == endPoly && !(_type & PATHFIND_INCOMPLETE)) - _type = PATHFIND_NORMAL; - else - _type = PATHFIND_INCOMPLETE; - - // generate the point-path out of our up-to-date poly-path - BuildPointPath(startPoint, endPoint); -} - -void PathGenerator::BuildPointPath(const float *startPoint, const float *endPoint) -{ - float pathPoints[MAX_POINT_PATH_LENGTH*VERTEX_SIZE]; - uint32 pointCount = 0; - dtStatus dtResult = DT_FAILURE; - if (_useStraightPath) - { - dtResult = _navMeshQuery->findStraightPath( - startPoint, // start position - endPoint, // end position - _pathPolyRefs, // current path - _polyLength, // lenth of current path - pathPoints, // [out] path corner points - NULL, // [out] flags - NULL, // [out] shortened path - (int*)&pointCount, - _pointPathLimit); // maximum number of points/polygons to use - } - else - { - dtResult = FindSmoothPath( - startPoint, // start position - endPoint, // end position - _pathPolyRefs, // current path - _polyLength, // length of current path - pathPoints, // [out] path corner points - (int*)&pointCount, - _pointPathLimit); // maximum number of points - } + int resultHopCount; + float* straightPath = new float[2048 * 3]; + unsigned char* pathFlags = new unsigned char[2048]; + dtPolyRef* pathRefs = new dtPolyRef[2048]; - if (pointCount < 2 || dtStatusFailed(dtResult)) + status = _navMeshQuery->findStraightPath(startPos, endPos, hopBuffer, hops, straightPath, pathFlags, pathRefs, &resultHopCount, 2048); + if (!dtStatusSucceed(status)) { - // only happens if pass bad data to findStraightPath or navmesh is broken - // single point paths can be generated here - /// @todo check the exact cases - TC_LOG_DEBUG(LOG_FILTER_MAPS, "++ PathGenerator::BuildPointPath FAILED! path sized %d returned\n", pointCount); - BuildShortcut(); + TC_LOG_DEBUG(LOG_FILTER_MAPS, "PathGenerator::CalculatePath() for %u no straight path found for start and end locations\n", _sourceUnit->GetGUIDLow()); _type = PATHFIND_NOPATH; - return; - } - else if (pointCount == _pointPathLimit) - { - TC_LOG_DEBUG(LOG_FILTER_MAPS, "++ PathGenerator::BuildPointPath FAILED! path sized %d returned, lower than limit set to %d\n", pointCount, _pointPathLimit); - BuildShortcut(); - _type = PATHFIND_SHORT; - return; + return false; } - _pathPoints.resize(pointCount); - for (uint32 i = 0; i < pointCount; ++i) - _pathPoints[i] = G3D::Vector3(pathPoints[i*VERTEX_SIZE+2], pathPoints[i*VERTEX_SIZE], pathPoints[i*VERTEX_SIZE+1]); + for (uint32 i = 0; i < resultHopCount; ++i) + _pathPoints.push_back(G3D::Vector3(-straightPath[i * 3 + 2], -straightPath[i * 3 + 0], straightPath[i * 3 + 1])); - NormalizePath(); - - // first point is always our current location - we need the next one - SetActualEndPosition(_pathPoints[pointCount-1]); - - // force the given destination, if needed - if (_forceDestination && - (!(_type & PATHFIND_NORMAL) || !InRange(GetEndPosition(), GetActualEndPosition(), 1.0f, 1.0f))) - { - // we may want to keep partial subpath - if (Dist3DSqr(GetActualEndPosition(), GetEndPosition()) < 0.3f * Dist3DSqr(GetStartPosition(), GetEndPosition())) - { - SetActualEndPosition(GetEndPosition()); - _pathPoints[_pathPoints.size()-1] = GetEndPosition(); - } - else - { - SetActualEndPosition(GetEndPosition()); - BuildShortcut(); - } - - _type = PathType(PATHFIND_NORMAL | PATHFIND_NOT_USING_PATH); - } - - TC_LOG_DEBUG(LOG_FILTER_MAPS, "++ PathGenerator::BuildPointPath path type %d size %d poly-size %d\n", _type, pointCount, _polyLength); -} - -void PathGenerator::NormalizePath() -{ - for (uint32 i = 0; i < _pathPoints.size(); ++i) - _sourceUnit->UpdateAllowedPositionZ(_pathPoints[i].x, _pathPoints[i].y, _pathPoints[i].z); -} - -void PathGenerator::BuildShortcut() -{ - TC_LOG_DEBUG(LOG_FILTER_MAPS, "++ BuildShortcut :: making shortcut\n"); - - Clear(); - - // make two point path, our curr pos is the start, and dest is the end - _pathPoints.resize(2); - - // set start and a default next position - _pathPoints[0] = GetStartPosition(); - _pathPoints[1] = GetActualEndPosition(); - - NormalizePath(); - - _type = PATHFIND_SHORTCUT; + return true; } void PathGenerator::CreateFilter() { - uint16 includeFlags = 0; + uint16 includeFlags = 1 | 2; uint16 excludeFlags = 0; - - if (_sourceUnit->GetTypeId() == TYPEID_UNIT) - { - Creature* creature = (Creature*)_sourceUnit; - if (creature->CanWalk()) - includeFlags |= NAV_GROUND; // walk - - // creatures don't take environmental damage - if (creature->CanSwim()) - includeFlags |= (NAV_WATER | NAV_MAGMA | NAV_SLIME); // swim - } - else // assume Player + + if (_sourceUnit->GetTypeId() == TYPEID_UNIT && !_sourceUnit->ToCreature()->CanSwim()) { - // perfect support not possible, just stay 'safe' - includeFlags |= (NAV_GROUND | NAV_WATER | NAV_MAGMA | NAV_SLIME); + includeFlags = 1; + excludeFlags = 2; } _filter.setIncludeFlags(includeFlags); @@ -533,275 +156,5 @@ void PathGenerator::CreateFilter() void PathGenerator::UpdateFilter() { - // allow creatures to cheat and use different movement types if they are moved - // forcefully into terrain they can't normally move in - if (_sourceUnit->IsInWater() || _sourceUnit->IsUnderWater()) - { - uint16 includedFlags = _filter.getIncludeFlags(); - includedFlags |= GetNavTerrain(_sourceUnit->GetPositionX(), - _sourceUnit->GetPositionY(), - _sourceUnit->GetPositionZ()); - - _filter.setIncludeFlags(includedFlags); - } -} - -NavTerrain PathGenerator::GetNavTerrain(float x, float y, float z) -{ - LiquidData data; - ZLiquidStatus liquidStatus = _sourceUnit->GetBaseMap()->getLiquidStatus(x, y, z, MAP_ALL_LIQUIDS, &data); - if (liquidStatus == LIQUID_MAP_NO_WATER) - return NAV_GROUND; - - switch (data.type_flags) - { - case MAP_LIQUID_TYPE_WATER: - case MAP_LIQUID_TYPE_OCEAN: - return NAV_WATER; - case MAP_LIQUID_TYPE_MAGMA: - return NAV_MAGMA; - case MAP_LIQUID_TYPE_SLIME: - return NAV_SLIME; - default: - return NAV_GROUND; - } -} - -bool PathGenerator::HaveTile(const G3D::Vector3& p) const -{ - int tx = -1, ty = -1; - float point[VERTEX_SIZE] = {p.y, p.z, p.x}; - - _navMesh->calcTileLoc(point, &tx, &ty); - - /// Workaround - /// For some reason, often the tx and ty variables wont get a valid value - /// Use this check to prevent getting negative tile coords and crashing on getTileAt - if (tx < 0 || ty < 0) - return false; - - return (_navMesh->getTileAt(tx, ty, 0) != NULL); -} - -uint32 PathGenerator::FixupCorridor(dtPolyRef* path, uint32 npath, uint32 maxPath, dtPolyRef const* visited, uint32 nvisited) -{ - int32 furthestPath = -1; - int32 furthestVisited = -1; - - // Find furthest common polygon. - for (int32 i = npath-1; i >= 0; --i) - { - bool found = false; - for (int32 j = nvisited-1; j >= 0; --j) - { - if (path[i] == visited[j]) - { - furthestPath = i; - furthestVisited = j; - found = true; - } - } - if (found) - break; - } - - // If no intersection found just return current path. - if (furthestPath == -1 || furthestVisited == -1) - return npath; - - // Concatenate paths. - - // Adjust beginning of the buffer to include the visited. - uint32 req = nvisited - furthestVisited; - uint32 orig = uint32(furthestPath + 1) < npath ? furthestPath + 1 : npath; - uint32 size = npath > orig ? npath - orig : 0; - if (req + size > maxPath) - size = maxPath-req; - - if (size) - memmove(path + req, path + orig, size * sizeof(dtPolyRef)); - - // Store visited - for (uint32 i = 0; i < req; ++i) - path[i] = visited[(nvisited - 1) - i]; - - return req+size; -} - -bool PathGenerator::GetSteerTarget(float const* startPos, float const* endPos, - float minTargetDist, dtPolyRef const* path, uint32 pathSize, - float* steerPos, unsigned char& steerPosFlag, dtPolyRef& steerPosRef) -{ - // Find steer target. - static const uint32 MAX_STEER_POINTS = 3; - float steerPath[MAX_STEER_POINTS*VERTEX_SIZE]; - unsigned char steerPathFlags[MAX_STEER_POINTS]; - dtPolyRef steerPathPolys[MAX_STEER_POINTS]; - uint32 nsteerPath = 0; - dtStatus dtResult = _navMeshQuery->findStraightPath(startPos, endPos, path, pathSize, - steerPath, steerPathFlags, steerPathPolys, (int*)&nsteerPath, MAX_STEER_POINTS); - if (!nsteerPath || dtStatusFailed(dtResult)) - return false; - - // Find vertex far enough to steer to. - uint32 ns = 0; - while (ns < nsteerPath) - { - // Stop at Off-Mesh link or when point is further than slop away. - if ((steerPathFlags[ns] & DT_STRAIGHTPATH_OFFMESH_CONNECTION) || - !InRangeYZX(&steerPath[ns*VERTEX_SIZE], startPos, minTargetDist, 1000.0f)) - break; - ns++; - } - // Failed to find good point to steer to. - if (ns >= nsteerPath) - return false; - - dtVcopy(steerPos, &steerPath[ns*VERTEX_SIZE]); - steerPos[1] = startPos[1]; // keep Z value - steerPosFlag = steerPathFlags[ns]; - steerPosRef = steerPathPolys[ns]; - - return true; -} - -dtStatus PathGenerator::FindSmoothPath(float const* startPos, float const* endPos, - dtPolyRef const* polyPath, uint32 polyPathSize, - float* smoothPath, int* smoothPathSize, uint32 maxSmoothPathSize) -{ - *smoothPathSize = 0; - uint32 nsmoothPath = 0; - - dtPolyRef polys[MAX_PATH_LENGTH]; - memcpy(polys, polyPath, sizeof(dtPolyRef)*polyPathSize); - uint32 npolys = polyPathSize; - - float iterPos[VERTEX_SIZE], targetPos[VERTEX_SIZE]; - if (dtStatusFailed(_navMeshQuery->closestPointOnPolyBoundary(polys[0], startPos, iterPos))) - return DT_FAILURE; - - if (dtStatusFailed(_navMeshQuery->closestPointOnPolyBoundary(polys[npolys-1], endPos, targetPos))) - return DT_FAILURE; - - dtVcopy(&smoothPath[nsmoothPath*VERTEX_SIZE], iterPos); - nsmoothPath++; - - // Move towards target a small advancement at a time until target reached or - // when ran out of memory to store the path. - while (npolys && nsmoothPath < maxSmoothPathSize) - { - // Find location to steer towards. - float steerPos[VERTEX_SIZE]; - unsigned char steerPosFlag; - dtPolyRef steerPosRef = INVALID_POLYREF; - - if (!GetSteerTarget(iterPos, targetPos, SMOOTH_PATH_SLOP, polys, npolys, steerPos, steerPosFlag, steerPosRef)) - break; - - bool endOfPath = (steerPosFlag & DT_STRAIGHTPATH_END); - bool offMeshConnection = (steerPosFlag & DT_STRAIGHTPATH_OFFMESH_CONNECTION); - - // Find movement delta. - float delta[VERTEX_SIZE]; - dtVsub(delta, steerPos, iterPos); - float len = dtSqrt(dtVdot(delta, delta)); - // If the steer target is end of path or off-mesh link, do not move past the location. - if ((endOfPath || offMeshConnection) && len < SMOOTH_PATH_STEP_SIZE) - len = 1.0f; - else - len = SMOOTH_PATH_STEP_SIZE / len; - - float moveTgt[VERTEX_SIZE]; - dtVmad(moveTgt, iterPos, delta, len); - - // Move - float result[VERTEX_SIZE]; - const static uint32 MAX_VISIT_POLY = 16; - dtPolyRef visited[MAX_VISIT_POLY]; - - uint32 nvisited = 0; - _navMeshQuery->moveAlongSurface(polys[0], iterPos, moveTgt, &_filter, result, visited, (int*)&nvisited, MAX_VISIT_POLY); - npolys = FixupCorridor(polys, npolys, MAX_PATH_LENGTH, visited, nvisited); - - _navMeshQuery->getPolyHeight(polys[0], result, &result[1]); - result[1] += 0.5f; - dtVcopy(iterPos, result); - - // Handle end of path and off-mesh links when close enough. - if (endOfPath && InRangeYZX(iterPos, steerPos, SMOOTH_PATH_SLOP, 1.0f)) - { - // Reached end of path. - dtVcopy(iterPos, targetPos); - if (nsmoothPath < maxSmoothPathSize) - { - dtVcopy(&smoothPath[nsmoothPath*VERTEX_SIZE], iterPos); - nsmoothPath++; - } - break; - } - else if (offMeshConnection && InRangeYZX(iterPos, steerPos, SMOOTH_PATH_SLOP, 1.0f)) - { - // Advance the path up to and over the off-mesh connection. - dtPolyRef prevRef = INVALID_POLYREF; - dtPolyRef polyRef = polys[0]; - uint32 npos = 0; - while (npos < npolys && polyRef != steerPosRef) - { - prevRef = polyRef; - polyRef = polys[npos]; - npos++; - } - - for (uint32 i = npos; i < npolys; ++i) - polys[i-npos] = polys[i]; - - npolys -= npos; - - // Handle the connection. - float startPos[VERTEX_SIZE], endPos[VERTEX_SIZE]; - if (dtStatusSucceed(_navMesh->getOffMeshConnectionPolyEndPoints(prevRef, polyRef, startPos, endPos))) - { - if (nsmoothPath < maxSmoothPathSize) - { - dtVcopy(&smoothPath[nsmoothPath*VERTEX_SIZE], startPos); - nsmoothPath++; - } - // Move position at the other side of the off-mesh link. - dtVcopy(iterPos, endPos); - _navMeshQuery->getPolyHeight(polys[0], iterPos, &iterPos[1]); - iterPos[1] += 0.5f; - } - } - - // Store results. - if (nsmoothPath < maxSmoothPathSize) - { - dtVcopy(&smoothPath[nsmoothPath*VERTEX_SIZE], iterPos); - nsmoothPath++; - } - } - - *smoothPathSize = nsmoothPath; - - // this is most likely a loop - return nsmoothPath < MAX_POINT_PATH_LENGTH ? DT_SUCCESS : DT_FAILURE; -} - -bool PathGenerator::InRangeYZX(const float* v1, const float* v2, float r, float h) const -{ - const float dx = v2[0] - v1[0]; - const float dy = v2[1] - v1[1]; // elevation - const float dz = v2[2] - v1[2]; - return (dx * dx + dz * dz) < r * r && fabsf(dy) < h; -} - -bool PathGenerator::InRange(G3D::Vector3 const& p1, G3D::Vector3 const& p2, float r, float h) const -{ - G3D::Vector3 d = p1 - p2; - return (d.x * d.x + d.y * d.y) < r * r && fabsf(d.z) < h; -} - -float PathGenerator::Dist3DSqr(G3D::Vector3 const& p1, G3D::Vector3 const& p2) const -{ - return (p1 - p2).squaredLength(); -} + +} \ No newline at end of file diff --git a/src/server/game/Movement/PathGenerator.h b/src/server/game/Movement/PathGenerator.h index ac66b7cec57..507f8e8defb 100644 --- a/src/server/game/Movement/PathGenerator.h +++ b/src/server/game/Movement/PathGenerator.h @@ -26,18 +26,6 @@ class Unit; -// 74*4.0f=296y number_of_points*interval = max_path_len -// this is way more than actual evade range -// I think we can safely cut those down even more -#define MAX_PATH_LENGTH 74 -#define MAX_POINT_PATH_LENGTH 74 - -#define SMOOTH_PATH_STEP_SIZE 4.0f -#define SMOOTH_PATH_SLOP 0.3f - -#define VERTEX_SIZE 3 -#define INVALID_POLYREF 0 - enum PathType { PATHFIND_BLANK = 0x00, // path not built yet @@ -59,10 +47,6 @@ class PathGenerator // return: true if new path was calculated, false otherwise (no change needed) bool CalculatePath(float destX, float destY, float destZ, bool forceDest = false); - // option setters - use optional - void SetUseStraightPath(bool useStraightPath) { _useStraightPath = useStraightPath; } - void SetPathLengthLimit(float distance) { _pointPathLimit = std::min(uint32(distance/SMOOTH_PATH_STEP_SIZE), MAX_POINT_PATH_LENGTH); } - // result getters G3D::Vector3 const& GetStartPosition() const { return _startPosition; } G3D::Vector3 const& GetEndPosition() const { return _endPosition; } @@ -73,17 +57,9 @@ class PathGenerator PathType GetPathType() const { return _type; } private: - - dtPolyRef _pathPolyRefs[MAX_PATH_LENGTH]; // array of detour polygon references - uint32 _polyLength; // number of polygons in the path - Movement::PointsArray _pathPoints; // our actual (x,y,z) path to the target PathType _type; // tells what kind of path this is - bool _useStraightPath; // type of path will be generated - bool _forceDestination; // when set, we will always arrive at given point - uint32 _pointPathLimit; // limit point path size; min(this, MAX_POINT_PATH_LENGTH) - G3D::Vector3 _startPosition; // {x, y, z} of current location G3D::Vector3 _endPosition; // {x, y, z} of the destination G3D::Vector3 _actualEndPosition; // {x, y, z} of the closest possible point to given destination @@ -97,37 +73,9 @@ class PathGenerator void SetStartPosition(G3D::Vector3 const& point) { _startPosition = point; } void SetEndPosition(G3D::Vector3 const& point) { _actualEndPosition = point; _endPosition = point; } void SetActualEndPosition(G3D::Vector3 const& point) { _actualEndPosition = point; } - void NormalizePath(); - - void Clear() - { - _polyLength = 0; - _pathPoints.clear(); - } - - bool InRange(G3D::Vector3 const& p1, G3D::Vector3 const& p2, float r, float h) const; - float Dist3DSqr(G3D::Vector3 const& p1, G3D::Vector3 const& p2) const; - bool InRangeYZX(float const* v1, float const* v2, float r, float h) const; - dtPolyRef GetPathPolyByPosition(dtPolyRef const* polyPath, uint32 polyPathSize, float const* Point, float* Distance = NULL) const; - dtPolyRef GetPolyByLocation(float const* Point, float* Distance) const; - bool HaveTile(G3D::Vector3 const& p) const; - - void BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 const& endPos); - void BuildPointPath(float const* startPoint, float const* endPoint); - void BuildShortcut(); - - NavTerrain GetNavTerrain(float x, float y, float z); void CreateFilter(); void UpdateFilter(); - - // smooth path aux functions - uint32 FixupCorridor(dtPolyRef* path, uint32 npath, uint32 maxPath, dtPolyRef const* visited, uint32 nvisited); - bool GetSteerTarget(float const* startPos, float const* endPos, float minTargetDist, dtPolyRef const* path, uint32 pathSize, float* steerPos, - unsigned char& steerPosFlag, dtPolyRef& steerPosRef); - dtStatus FindSmoothPath(float const* startPos, float const* endPos, - dtPolyRef const* polyPath, uint32 polyPathSize, - float* smoothPath, int* smoothPathSize, uint32 smoothPathMaxSize); }; #endif diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index b2e8a89c86d..804a7f25a12 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5162,7 +5162,6 @@ SpellCastResult Spell::CheckCast(bool strict) target->GetContactPoint(m_caster, pos.m_positionX, pos.m_positionY, pos.m_positionZ); target->GetFirstCollisionPosition(pos, CONTACT_DISTANCE, target->GetRelativeAngle(m_caster)); - m_preGeneratedPath.SetPathLengthLimit(m_spellInfo->GetMaxRange(true) * 1.5f); bool result = m_preGeneratedPath.CalculatePath(pos.m_positionX, pos.m_positionY, pos.m_positionZ + target->GetObjectSize()); if (m_preGeneratedPath.GetPathType() & PATHFIND_SHORT) return SPELL_FAILED_OUT_OF_RANGE; diff --git a/src/server/scripts/Commands/cs_mmaps.cpp b/src/server/scripts/Commands/cs_mmaps.cpp index d0b1fdc2abd..0beb10af4fc 100644 --- a/src/server/scripts/Commands/cs_mmaps.cpp +++ b/src/server/scripts/Commands/cs_mmaps.cpp @@ -92,10 +92,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"); @@ -108,13 +108,63 @@ 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); + 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; } @@ -143,8 +193,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); @@ -153,14 +203,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 { diff --git a/src/tools/mesh_extractor/MeshExtractor.cpp b/src/tools/mesh_extractor/MeshExtractor.cpp index 9cc7eea5509..51b13ce6fd0 100644 --- a/src/tools/mesh_extractor/MeshExtractor.cpp +++ b/src/tools/mesh_extractor/MeshExtractor.cpp @@ -381,8 +381,8 @@ int main(int argc, char* argv[]) if (extractFlags & Constants::EXTRACT_FLAG_TEST) { - float start[] = { 16226.200195f, 16257.000000f, 13.202200f }; - float end[] = { 16245.725586f, 16382.465820f, 47.384956f }; + float start[] = { -1.37402868f, -21.7641087f, -20.1751060f }; + float end[] = { -22.756405f, -62.745014f, -21.371508f }; // float m_spos[3]; @@ -411,7 +411,7 @@ int main(int argc, char* argv[]) dtPolyRef m_startRef; dtPolyRef m_endRef; - FILE* mmap = fopen("mmaps/001.mmap", "rb"); + FILE* mmap = fopen("mmaps/389.mmap", "rb"); dtNavMeshParams params; int count = fread(¶ms, sizeof(dtNavMeshParams), 1, mmap); fclose(mmap); @@ -430,7 +430,7 @@ int main(int argc, char* argv[]) for (int j = 0; j <= 32; ++j) { char buff[100]; - sprintf(buff, "mmaps/001%02i%02i.mmtile", i, j); + sprintf(buff, "mmaps/389%02i%02i.mmtile", i, j); LoadTile(navMesh, buff); } } diff --git a/src/tools/mesh_extractor/TileBuilder.cpp b/src/tools/mesh_extractor/TileBuilder.cpp index 51df91d2652..cdc3131b3db 100644 --- a/src/tools/mesh_extractor/TileBuilder.cpp +++ b/src/tools/mesh_extractor/TileBuilder.cpp @@ -42,13 +42,13 @@ TileBuilder::TileBuilder(ContinentBuilder* _cBuilder, std::string world, int x, InstanceConfig.mergeRegionArea = 100; InstanceConfig.walkableSlopeAngle = 50.0f; InstanceConfig.detailSampleDist = 3.0f; - InstanceConfig.detailSampleMaxError = 1.5f; + InstanceConfig.detailSampleMaxError = 1.25f; InstanceConfig.walkableClimb = 1.0f / InstanceConfig.ch; InstanceConfig.walkableHeight = 2.1f / InstanceConfig.ch; InstanceConfig.walkableRadius = 0.6f / InstanceConfig.cs; InstanceConfig.maxEdgeLen = 8 * InstanceConfig.walkableRadius; InstanceConfig.maxVertsPerPoly = 6; - InstanceConfig.maxSimplificationError = 1.25f; + InstanceConfig.maxSimplificationError = 1.3f; InstanceConfig.borderSize = 0; Context = new rcContext; -- cgit v1.2.3 From 6b149d18cd1fc537ed33b314ded0c4d13714ec00 Mon Sep 17 00:00:00 2001 From: Sebastian Valle Date: Sat, 5 Oct 2013 14:28:53 -0500 Subject: Core/MMaps: Use an enum for the poly flags --- src/server/game/Movement/PathGenerator.cpp | 6 +++--- src/server/game/Movement/PathGenerator.h | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index c5922156939..b5735e74d99 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -139,13 +139,13 @@ bool PathGenerator::CalculatePath(float destX, float destY, float destZ, bool fo void PathGenerator::CreateFilter() { - uint16 includeFlags = 1 | 2; + uint16 includeFlags = POLY_FLAG_WALK | POLY_FLAG_SWIM; uint16 excludeFlags = 0; if (_sourceUnit->GetTypeId() == TYPEID_UNIT && !_sourceUnit->ToCreature()->CanSwim()) { - includeFlags = 1; - excludeFlags = 2; + includeFlags = POLY_FLAG_WALK; + excludeFlags = POLY_FLAG_SWIM; } _filter.setIncludeFlags(includeFlags); diff --git a/src/server/game/Movement/PathGenerator.h b/src/server/game/Movement/PathGenerator.h index 507f8e8defb..90e0f3b8f75 100644 --- a/src/server/game/Movement/PathGenerator.h +++ b/src/server/game/Movement/PathGenerator.h @@ -37,6 +37,12 @@ enum PathType PATHFIND_SHORT = 0x20, // path is longer or equal to its limited path length }; +enum PolyFlag +{ + POLY_FLAG_WALK = 1, + POLY_FLAG_SWIM = 2 +}; + class PathGenerator { public: -- cgit v1.2.3 From e07d76836d3e2d9ee67f63489b5ced155c821c4a Mon Sep 17 00:00:00 2001 From: Sebastian Valle Date: Sat, 5 Oct 2013 18:11:39 -0500 Subject: Core/MMaps: Separate the path from the walls to prevent falling off the edges client-side and improve the behavior. Thanks to Game2Mesh user in ownedcore. --- src/server/game/Movement/PathGenerator.cpp | 129 ++++++++++++++++++++++++++++ src/server/game/Movement/PathGenerator.h | 9 ++ src/server/scripts/Commands/cs_mmaps.cpp | 130 +++++++++++++++++++++++++++++ 3 files changed, 268 insertions(+) (limited to 'src/server/game') diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index b5735e74d99..9704bd1feb2 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -27,6 +27,8 @@ #include "DetourCommon.h" #include "DetourNavMeshQuery.h" +float PathGenerator::MinWallDistance = 2.5f; + ////////////////// PathGenerator ////////////////// PathGenerator::PathGenerator(const Unit* owner) : _type(PATHFIND_BLANK), _endPosition(G3D::Vector3::zero()), @@ -131,6 +133,8 @@ bool PathGenerator::CalculatePath(float destX, float destY, float destZ, bool fo return false; } + SmoothPath(polyPickExt, resultHopCount, straightPath); // Separate the path from the walls + for (uint32 i = 0; i < resultHopCount; ++i) _pathPoints.push_back(G3D::Vector3(-straightPath[i * 3 + 2], -straightPath[i * 3 + 0], straightPath[i * 3 + 1])); @@ -157,4 +161,129 @@ void PathGenerator::CreateFilter() void PathGenerator::UpdateFilter() { +} + +float PathGenerator::GetTriangleArea(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; +} + +bool PathGenerator::PointInPoly(float* pos, float* verts, int nv, float err) +{ + // Poly area + float area = abs(PathGenerator::GetTriangleArea(verts, nv)); + + // Calculate each area of the 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(PathGenerator::GetTriangleArea(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(PathGenerator::GetTriangleArea(testTri, 3)); + + return abs(area1 - area) < err; +} + +float PathGenerator::DistanceToWall(float* polyPickExt, float* pos, float* hitPos, float* hitNormal) +{ + float distanceToWall = 0; + dtPolyRef ref; + + dtStatus status = _navMeshQuery->findNearestPoly(pos, polyPickExt, &_filter, &ref, 0); + + if (!dtStatusSucceed(status) || 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 (unsigned char i = 0; i < poly->vertCount; ++i) + { + dtVcopy(&verts[nv * 3], &tile->verts[poly->verts[i] * 3]); + nv++; + } + + bool inside = PathGenerator::PointInPoly(pos, verts, nv, 0.05f); + if (!inside) + return -1; + + if (!dtStatusSucceed(_navMeshQuery->findDistanceToWall(ref, pos, 100.0f, &_filter, &distanceToWall, hitPos, hitNormal))) + return -1; + + return distanceToWall; +} + +void PathGenerator::SmoothPath(float* polyPickExt, int pathLength, float*& straightPath) +{ + float hitPos[3]; + float hitNormal[3]; + float testPos[3]; + float distanceToWall = 0; + float up[]= { 0, 1, 0 }; + float origDis = 0; + + for (int i = 1; i < pathLength - 1; ++i) + { + dtPolyRef pt; + float* curPoi = &straightPath[i * 3]; + distanceToWall = DistanceToWall(polyPickExt, curPoi, hitPos, hitNormal); + + if (distanceToWall < PathGenerator::MinWallDistance && distanceToWall >= 0) + { + float vec[3]; + dtVsub(vec, &straightPath[i * 3 - 3], &straightPath[i * 3]); + // If distanceToWall is 0 means the point is in the edge, so we can't get the hitpos. + if (distanceToWall == 0) + { + // Test the left side + dtVcross(testPos, vec, up); + dtVadd(testPos, testPos, curPoi); + float ft = PathGenerator::MinWallDistance / dtVdist(testPos, curPoi); + dtVlerp(testPos, curPoi, testPos, ft); + distanceToWall = DistanceToWall(polyPickExt, testPos, hitPos, hitNormal); + if (abs(PathGenerator::MinWallDistance - distanceToWall) > 0.1f) + { + // Test the right side + dtVcross(testPos, up, vec); + dtVadd(testPos, testPos, curPoi); + ft = PathGenerator::MinWallDistance / dtVdist(testPos, curPoi); + dtVlerp(testPos, curPoi, testPos, ft); + distanceToWall = DistanceToWall(polyPickExt, testPos, hitPos, hitNormal); + } + + // If the test point is better than the orig point, replace it. + if (abs(distanceToWall - PathGenerator::MinWallDistance) < 0.1f) + dtVcopy(curPoi, testPos); + } + else + { + // We get the hitpos with a ray + float ft = PathGenerator::MinWallDistance / distanceToWall; + dtVlerp(testPos, hitPos, curPoi, ft); + distanceToWall = DistanceToWall(polyPickExt, testPos, hitPos, hitNormal); + + if (abs(distanceToWall - PathGenerator::MinWallDistance) < 0.1f) + dtVcopy(curPoi, testPos); + } + } + } } \ No newline at end of file diff --git a/src/server/game/Movement/PathGenerator.h b/src/server/game/Movement/PathGenerator.h index 90e0f3b8f75..075d6dabc9f 100644 --- a/src/server/game/Movement/PathGenerator.h +++ b/src/server/game/Movement/PathGenerator.h @@ -61,6 +61,8 @@ class PathGenerator Movement::PointsArray const& GetPath() const { return _pathPoints; } PathType GetPathType() const { return _type; } + + static float MinWallDistance; private: Movement::PointsArray _pathPoints; // our actual (x,y,z) path to the target @@ -80,6 +82,13 @@ class PathGenerator void SetEndPosition(G3D::Vector3 const& point) { _actualEndPosition = point; _endPosition = point; } void SetActualEndPosition(G3D::Vector3 const& point) { _actualEndPosition = point; } + // Path smoothing + void SmoothPath(float* polyPickExt, int pathLength, float*& straightPath); + float DistanceToWall(float* polyPickExt, float* pos, float* hitPos, float* hitNormal); + // dtPointInPolygon will return false when the point is too close to the edge, so we rewrite the test function. + static bool PointInPoly(float* pos, float* verts, int nv, float err); + static float GetTriangleArea(float* verts, int nv); + void CreateFilter(); void UpdateFilter(); }; diff --git a/src/server/scripts/Commands/cs_mmaps.cpp b/src/server/scripts/Commands/cs_mmaps.cpp index 0beb10af4fc..88e364878cc 100644 --- a/src/server/scripts/Commands/cs_mmaps.cpp +++ b/src/server/scripts/Commands/cs_mmaps.cpp @@ -30,6 +30,7 @@ #include "PointMovementGenerator.h" #include "PathGenerator.h" #include "MMapFactory.h" +#include "DetourCommon.h" #include "Map.h" #include "TargetedMovementGenerator.h" #include "GridNotifiers.h" @@ -62,6 +63,134 @@ public: return commandTable; } + static float Fix_GetXZArea(float* verts, int nv) + { + float area = 0; + for(int i=0; iarea) + 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)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=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())) @@ -159,6 +288,7 @@ public: dtPolyRef* pathRefs = new dtPolyRef[2048]; status = navMeshQuery->findStraightPath(m_spos, m_epos, hopBuffer, hops, straightPath, pathFlags, pathRefs, &resultHopCount, 2048); + FixPath(const_cast(navMesh), const_cast(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); -- cgit v1.2.3 From 6e994f11894d639f8566a14a60026df7749f79e3 Mon Sep 17 00:00:00 2001 From: Sebastian Valle Date: Sat, 5 Oct 2013 18:52:46 -0500 Subject: Core/MMaps: Bump mmaps version to 5 --- src/server/game/Miscellaneous/SharedDefines.h | 2 +- src/tools/mesh_extractor/Utils.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 6ed0982e631..c2daca325e4 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -3541,7 +3541,7 @@ enum PartyResult }; const uint32 MMAP_MAGIC = 0x4d4d4150; // 'MMAP' -#define MMAP_VERSION 3 +#define MMAP_VERSION 5 struct MmapTileHeader { diff --git a/src/tools/mesh_extractor/Utils.h b/src/tools/mesh_extractor/Utils.h index d6bb421a633..472cf6dbd1b 100644 --- a/src/tools/mesh_extractor/Utils.h +++ b/src/tools/mesh_extractor/Utils.h @@ -334,7 +334,7 @@ public: }; #define MMAP_MAGIC 0x4d4d4150 // 'MMAP' -#define MMAP_VERSION 3 +#define MMAP_VERSION 5 struct MmapTileHeader { -- cgit v1.2.3 From a316b86a7969fdfbe6e0430455c25f246a113f0c Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 23 Dec 2013 14:25:34 +0100 Subject: Core/Spells: Prevent adding sockets to items that have 3 sockets in item_template or already had a socket added to them --- src/server/game/Spells/Spell.cpp | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index a88ee634be8..9eff094114f 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -6123,19 +6123,39 @@ SpellCastResult Spell::CheckItems() } } - SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(m_spellInfo->Effects[i].MiscValue); + SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(m_spellInfo->Effects[i].MiscValue); // do not allow adding usable enchantments to items that have use effect already - if (pEnchant && isItemUsable) + if (enchantEntry) + { for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s) - if (pEnchant->type[s] == ITEM_ENCHANTMENT_TYPE_USE_SPELL) - return SPELL_FAILED_ON_USE_ENCHANT; + { + switch (enchantEntry->type[s]) + { + case ITEM_ENCHANTMENT_TYPE_USE_SPELL: + if (isItemUsable) + return SPELL_FAILED_ON_USE_ENCHANT; + break; + case ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET: + { + uint32 numSockets = 0; + for (uint32 socket = 0; socket < MAX_ITEM_PROTO_SOCKETS; ++socket) + if (targetItem->GetTemplate()->Socket[socket].Color) + ++numSockets; + + if (numSockets == MAX_ITEM_PROTO_SOCKETS || targetItem->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT)) + return SPELL_FAILED_MAX_SOCKETS; + break; + } + } + } + } // Not allow enchant in trade slot for some enchant type if (targetItem->GetOwner() != m_caster) { - if (!pEnchant) + if (!enchantEntry) return SPELL_FAILED_ERROR; - if (pEnchant->slot & ENCHANTMENT_CAN_SOULBOUND) + if (enchantEntry->slot & ENCHANTMENT_CAN_SOULBOUND) return SPELL_FAILED_NOT_TRADEABLE; } break; -- cgit v1.2.3 From 5e8f8291819430f40559e6c5cba5ad9e53b3da56 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 24 Dec 2013 11:26:07 +0100 Subject: Core/SAI: Fixed a crash in call for help/flee for assist actions when they had an emote attached --- src/server/game/AI/SmartScripts/SmartScript.cpp | 32 ++++++------------------- 1 file changed, 7 insertions(+), 25 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index e39d66054e8..60a4db511f4 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -17,6 +17,7 @@ #include "Cell.h" #include "CellImpl.h" +#include "Chat.h" #include "CreatureTextMgr.h" #include "DatabaseEnv.h" #include "GossipDef.h" @@ -40,41 +41,22 @@ class TrinityStringTextBuilder { public: - TrinityStringTextBuilder(WorldObject* obj, ChatMsg msgtype, int32 id, uint32 language, uint64 targetGUID) - : _source(obj), _msgType(msgtype), _textId(id), _language(language), _targetGUID(targetGUID) + TrinityStringTextBuilder(WorldObject* obj, ChatMsg msgtype, int32 id, uint32 language, WorldObject* target) + : _source(obj), _msgType(msgtype), _textId(id), _language(language), _target(target) { } size_t operator()(WorldPacket* data, LocaleConstant locale) const { std::string text = sObjectMgr->GetTrinityString(_textId, locale); - std::string localizedName = _source->GetNameForLocaleIdx(locale); - - *data << uint8(_msgType); - *data << uint32(_language); - *data << uint64(_source->GetGUID()); - *data << uint32(1); // 2.1.0 - *data << uint32(localizedName.size() + 1); - *data << localizedName; - size_t whisperGUIDpos = data->wpos(); - *data << uint64(_targetGUID); // Unit Target - if (_targetGUID && !IS_PLAYER_GUID(_targetGUID)) - { - *data << uint32(1); // target name length - *data << uint8(0); // target name - } - *data << uint32(text.length() + 1); - *data << text; - *data << uint8(0); // ChatTag - - return whisperGUIDpos; + return ChatHandler::BuildChatPacket(*data, _msgType, Language(_language), _source, _target, text, 0, "", locale); } WorldObject* _source; ChatMsg _msgType; int32 _textId; uint32 _language; - uint64 _targetGUID; + WorldObject* _target; }; SmartScript::SmartScript() @@ -777,7 +759,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u me->DoFleeToGetAssistance(); if (e.action.flee.withEmote) { - TrinityStringTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, LANG_FLEE, LANG_UNIVERSAL, 0); + TrinityStringTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, LANG_FLEE, LANG_UNIVERSAL, NULL); sCreatureTextMgr->SendChatPacket(me, builder, CHAT_MSG_MONSTER_EMOTE); } TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_FLEE_FOR_ASSIST: Creature %u DoFleeToGetAssistance", me->GetGUIDLow()); @@ -1020,7 +1002,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u me->CallForHelp((float)e.action.callHelp.range); if (e.action.callHelp.withEmote) { - TrinityStringTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, LANG_CALL_FOR_HELP, LANG_UNIVERSAL, 0); + TrinityStringTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, LANG_CALL_FOR_HELP, LANG_UNIVERSAL, NULL); sCreatureTextMgr->SendChatPacket(me, builder, CHAT_MSG_MONSTER_EMOTE); } TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction: SMART_ACTION_CALL_FOR_HELP: Creature %u", me->GetGUIDLow()); -- cgit v1.2.3 From 20a2b691785b66a8a265f691c5ffd8affd6298f0 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 24 Dec 2013 20:21:13 +0100 Subject: Core/Chat: Fixed GM messages in chat channels after refactoring --- src/server/game/Chat/Channels/Channel.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index c65d76cecd0..1faa168b3a8 100644 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -600,14 +600,6 @@ void Channel::Say(uint64 guid, std::string const& what, uint32 lang) if (what.empty()) return; - uint8 chatTag = 0; - bool isGM = false; - if (Player* player = ObjectAccessor::FindPlayer(guid)) - { - chatTag = player->GetChatTag(); - isGM = player->GetSession()->HasPermission(rbac::RBAC_PERM_COMMAND_GM_CHAT); - } - // TODO: Add proper RBAC check if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL)) lang = LANG_UNIVERSAL; @@ -629,7 +621,11 @@ void Channel::Say(uint64 guid, std::string const& what, uint32 lang) } WorldPacket data; - ChatHandler::BuildChatPacket(data, CHAT_MSG_CHANNEL, Language(lang), guid, guid, what, chatTag, "", "", 0, isGM, _name); + if (Player* player = ObjectAccessor::FindPlayer(guid)) + ChatHandler::BuildChatPacket(data, CHAT_MSG_CHANNEL, Language(lang), player, player, what, 0, _name); + else + ChatHandler::BuildChatPacket(data, CHAT_MSG_CHANNEL, Language(lang), guid, guid, what, 0, "", "", 0, false, _name); + SendToAll(&data, !playersStore[guid].IsModerator() ? guid : false); } -- cgit v1.2.3 From 293915db392b193580d1b2d3f61eca310a822ed8 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 25 Dec 2013 02:08:05 +0100 Subject: Core/Quests: Fixed icon shown above questgivers with daily quests that have already been completed once by a character Closes #11331 --- src/server/game/Entities/Creature/GossipDef.cpp | 2 +- src/server/game/Entities/Creature/GossipDef.h | 2 +- src/server/game/Handlers/QuestHandler.cpp | 48 ++++++++++++------------- src/server/game/Quests/QuestDef.h | 5 ++- src/server/game/Scripting/ScriptMgr.cpp | 6 ++-- src/server/game/Server/WorldSession.h | 2 +- 6 files changed, 32 insertions(+), 33 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index d04fde46713..9a6dce7d9f0 100644 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -297,7 +297,7 @@ void QuestMenu::ClearMenu() _questMenuItems.clear(); } -void PlayerMenu::SendQuestGiverQuestList(QEmote eEmote, const std::string& Title, uint64 npcGUID) +void PlayerMenu::SendQuestGiverQuestList(QEmote const& eEmote, const std::string& Title, uint64 npcGUID) { WorldPacket data(SMSG_QUESTGIVER_QUEST_LIST, 100); // guess size data << uint64(npcGUID); diff --git a/src/server/game/Entities/Creature/GossipDef.h b/src/server/game/Entities/Creature/GossipDef.h index b43ab8ec332..0c5b7e8c9eb 100644 --- a/src/server/game/Entities/Creature/GossipDef.h +++ b/src/server/game/Entities/Creature/GossipDef.h @@ -273,7 +273,7 @@ class PlayerMenu /*********************************************************/ void SendQuestGiverStatus(uint8 questStatus, uint64 npcGUID) const; - void SendQuestGiverQuestList(QEmote eEmote, const std::string& Title, uint64 npcGUID); + void SendQuestGiverQuestList(QEmote const& eEmote, const std::string& Title, uint64 npcGUID); void SendQuestQueryResponse(Quest const* quest) const; void SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, bool activateAccept) const; diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index a84d8e33812..c73a4c845bb 100644 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -36,8 +36,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket& recvData) { uint64 guid; recvData >> guid; - uint8 questStatus = DIALOG_STATUS_NONE; - uint8 defstatus = DIALOG_STATUS_NONE; + uint32 questStatus = DIALOG_STATUS_NONE; Object* questgiver = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); if (!questgiver) @@ -50,23 +49,23 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket& recvData) { case TYPEID_UNIT: { - TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for npc, guid = %u", uint32(GUID_LOPART(guid))); - Creature* cr_questgiver=questgiver->ToCreature(); + TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for npc, guid = %u", questgiver->GetGUIDLow()); + Creature* cr_questgiver = questgiver->ToCreature(); if (!cr_questgiver->IsHostileTo(_player)) // do not show quest status to enemies { questStatus = sScriptMgr->GetDialogStatus(_player, cr_questgiver); - if (questStatus > 6) - questStatus = getDialogStatus(_player, cr_questgiver, defstatus); + if (questStatus == DIALOG_STATUS_SCRIPTED_NO_STATUS) + questStatus = getDialogStatus(_player, cr_questgiver); } break; } case TYPEID_GAMEOBJECT: { - TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for GameObject guid = %u", uint32(GUID_LOPART(guid))); - GameObject* go_questgiver=(GameObject*)questgiver; + TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for GameObject guid = %u", questgiver->GetGUIDLow()); + GameObject* go_questgiver = questgiver->ToGameObject(); questStatus = sScriptMgr->GetDialogStatus(_player, go_questgiver); - if (questStatus > 6) - questStatus = getDialogStatus(_player, go_questgiver, defstatus); + if (questStatus == DIALOG_STATUS_SCRIPTED_NO_STATUS) + questStatus = getDialogStatus(_player, go_questgiver); break; } default: @@ -75,7 +74,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket& recvData) } //inform client about status of quest - _player->PlayerTalkClass->SendQuestGiverStatus(questStatus, guid); + _player->PlayerTalkClass->SendQuestGiverStatus(uint8(questStatus), guid); } void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket& recvData) @@ -639,9 +638,9 @@ void WorldSession::HandleQuestPushResult(WorldPacket& recvPacket) } } -uint32 WorldSession::getDialogStatus(Player* player, Object* questgiver, uint32 defstatus) +uint32 WorldSession::getDialogStatus(Player* player, Object* questgiver) { - uint32 result = defstatus; + uint32 result = DIALOG_STATUS_NONE; QuestRelationBounds qr; QuestRelationBounds qir; @@ -682,7 +681,7 @@ uint32 WorldSession::getDialogStatus(Player* player, Object* questgiver, uint32 if ((status == QUEST_STATUS_COMPLETE && !player->GetQuestRewardStatus(quest_id)) || (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))) { - if (quest->IsAutoComplete() && quest->IsRepeatable()) + if (quest->IsAutoComplete() && quest->IsRepeatable() && !quest->IsDailyOrWeekly()) result2 = DIALOG_STATUS_REWARD_REP; else result2 = DIALOG_STATUS_REWARD; @@ -713,11 +712,11 @@ uint32 WorldSession::getDialogStatus(Player* player, Object* questgiver, uint32 { if (player->SatisfyQuestLevel(quest, false)) { - if (quest->IsAutoComplete() || (quest->IsRepeatable() && player->IsQuestRewarded(quest_id))) + if (quest->IsAutoComplete()) result2 = DIALOG_STATUS_REWARD_REP; else if (player->getLevel() <= ((player->GetQuestLevel(quest) == -1) ? player->getLevel() : player->GetQuestLevel(quest) + sWorld->getIntConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF))) { - if (quest->HasFlag(QUEST_FLAGS_DAILY) || quest->HasFlag(QUEST_FLAGS_WEEKLY)) + if (quest->IsDaily()) result2 = DIALOG_STATUS_AVAILABLE_REP; else result2 = DIALOG_STATUS_AVAILABLE; @@ -748,8 +747,7 @@ void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket for (Player::ClientGUIDs::const_iterator itr = _player->m_clientGUIDs.begin(); itr != _player->m_clientGUIDs.end(); ++itr) { - uint8 questStatus = DIALOG_STATUS_NONE; - uint8 defstatus = DIALOG_STATUS_NONE; + uint32 questStatus = DIALOG_STATUS_NONE; if (IS_CRE_OR_VEH_OR_PET_GUID(*itr)) { @@ -759,9 +757,10 @@ void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket continue; if (!questgiver->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER)) continue; + questStatus = sScriptMgr->GetDialogStatus(_player, questgiver); - if (questStatus > 6) - questStatus = getDialogStatus(_player, questgiver, defstatus); + if (questStatus == DIALOG_STATUS_SCRIPTED_NO_STATUS) + questStatus = getDialogStatus(_player, questgiver); data << uint64(questgiver->GetGUID()); data << uint8(questStatus); @@ -770,13 +769,12 @@ void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket else if (IS_GAMEOBJECT_GUID(*itr)) { GameObject* questgiver = GetPlayer()->GetMap()->GetGameObject(*itr); - if (!questgiver) - continue; - if (questgiver->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER) + if (!questgiver || questgiver->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER) continue; + questStatus = sScriptMgr->GetDialogStatus(_player, questgiver); - if (questStatus > 6) - questStatus = getDialogStatus(_player, questgiver, defstatus); + if (questStatus == DIALOG_STATUS_SCRIPTED_NO_STATUS) + questStatus = getDialogStatus(_player, questgiver); data << uint64(questgiver->GetGUID()); data << uint8(questStatus); diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index 88a4ddfcad9..f763777fe15 100644 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -118,7 +118,10 @@ enum QuestGiverStatus DIALOG_STATUS_AVAILABLE_REP = 7, DIALOG_STATUS_AVAILABLE = 8, DIALOG_STATUS_REWARD2 = 9, // no yellow dot on minimap - DIALOG_STATUS_REWARD = 10 // yellow dot on minimap + DIALOG_STATUS_REWARD = 10, // yellow dot on minimap + + // Custom value meaning that script call did not return any valid quest status + DIALOG_STATUS_SCRIPTED_NO_STATUS = 0x1000, }; enum QuestFlags diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 3674f8fe15e..6a1ab28efed 100644 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -778,8 +778,7 @@ uint32 ScriptMgr::GetDialogStatus(Player* player, Creature* creature) ASSERT(player); ASSERT(creature); - /// @todo 100 is a funny magic number to have hanging around here... - GET_SCRIPT_RET(CreatureScript, creature->GetScriptId(), tmpscript, 100); + GET_SCRIPT_RET(CreatureScript, creature->GetScriptId(), tmpscript, DIALOG_STATUS_SCRIPTED_NO_STATUS); player->PlayerTalkClass->ClearMenus(); return tmpscript->GetDialogStatus(player, creature); } @@ -864,8 +863,7 @@ uint32 ScriptMgr::GetDialogStatus(Player* player, GameObject* go) ASSERT(player); ASSERT(go); - /// @todo 100 is a funny magic number to have hanging around here... - GET_SCRIPT_RET(GameObjectScript, go->GetScriptId(), tmpscript, 100); + GET_SCRIPT_RET(GameObjectScript, go->GetScriptId(), tmpscript, DIALOG_STATUS_SCRIPTED_NO_STATUS); player->PlayerTalkClass->ClearMenus(); return tmpscript->GetDialogStatus(player, go); } diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 2d7ec9c68c6..4aef02206c4 100644 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -357,7 +357,7 @@ class WorldSession uint32 GetLatency() const { return m_latency; } void SetLatency(uint32 latency) { m_latency = latency; } void ResetClientTimeDelay() { m_clientTimeDelay = 0; } - uint32 getDialogStatus(Player* player, Object* questgiver, uint32 defstatus); + uint32 getDialogStatus(Player* player, Object* questgiver); ACE_Atomic_Op m_timeOutTime; void UpdateTimeOutTime(uint32 diff) -- cgit v1.2.3 From 8bcde415383a539afeefe02caddb94c541bd100d Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 25 Dec 2013 12:17:23 +0100 Subject: Core/Quests: Added stuff missing in previous commit --- src/server/game/AI/CoreAI/GameObjectAI.h | 2 +- src/server/game/AI/SmartScripts/SmartAI.cpp | 5 ++++- src/server/game/Scripting/ScriptMgr.h | 5 +++-- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/AI/CoreAI/GameObjectAI.h b/src/server/game/AI/CoreAI/GameObjectAI.h index 0d5af4f8802..41443294100 100644 --- a/src/server/game/AI/CoreAI/GameObjectAI.h +++ b/src/server/game/AI/CoreAI/GameObjectAI.h @@ -51,7 +51,7 @@ class GameObjectAI virtual bool GossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, char const* /*code*/) { return false; } virtual bool QuestAccept(Player* /*player*/, Quest const* /*quest*/) { return false; } virtual bool QuestReward(Player* /*player*/, Quest const* /*quest*/, uint32 /*opt*/) { return false; } - virtual uint32 GetDialogStatus(Player* /*player*/) { return 100; } + virtual uint32 GetDialogStatus(Player* /*player*/) { return DIALOG_STATUS_SCRIPTED_NO_STATUS; } virtual void Destroyed(Player* /*player*/, uint32 /*eventId*/) { } virtual uint32 GetData(uint32 /*id*/) const { return 0; } virtual void SetData64(uint32 /*id*/, uint64 /*value*/) { } diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 1ced9e79672..8b914d7ca20 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -905,7 +905,10 @@ bool SmartGameObjectAI::QuestReward(Player* player, Quest const* quest, uint32 o } // Called when the dialog status between a player and the gameobject is requested. -uint32 SmartGameObjectAI::GetDialogStatus(Player* /*player*/) { return 100; } +uint32 SmartGameObjectAI::GetDialogStatus(Player* /*player*/) +{ + return DIALOG_STATUS_SCRIPTED_NO_STATUS; +} // Called when the gameobject is destroyed (destructible buildings only). void SmartGameObjectAI::Destroyed(Player* player, uint32 eventId) diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 401be45a4e1..18ed549029d 100644 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -24,6 +24,7 @@ #include #include "DBCStores.h" +#include "QuestDef.h" #include "SharedDefines.h" #include "World.h" #include "Weather.h" @@ -447,7 +448,7 @@ class CreatureScript : public UnitScript, public UpdatableScript virtual bool OnQuestReward(Player* /*player*/, Creature* /*creature*/, Quest const* /*quest*/, uint32 /*opt*/) { return false; } // Called when the dialog status between a player and the creature is requested. - virtual uint32 GetDialogStatus(Player* /*player*/, Creature* /*creature*/) { return 100; } + virtual uint32 GetDialogStatus(Player* /*player*/, Creature* /*creature*/) { return DIALOG_STATUS_SCRIPTED_NO_STATUS; } // Called when a CreatureAI object is needed for the creature. virtual CreatureAI* GetAI(Creature* /*creature*/) const { return NULL; } @@ -482,7 +483,7 @@ class GameObjectScript : public ScriptObject, public UpdatableScript virtual bool OnQuestReward(Player* /*player*/, GameObject* /*go*/, Quest const* /*quest*/, uint32 /*opt*/) { return false; } // Called when the dialog status between a player and the gameobject is requested. - virtual uint32 GetDialogStatus(Player* /*player*/, GameObject* /*go*/) { return 100; } + virtual uint32 GetDialogStatus(Player* /*player*/, GameObject* /*go*/) { return DIALOG_STATUS_SCRIPTED_NO_STATUS; } // Called when the game object is destroyed (destructible buildings only). virtual void OnDestroyed(GameObject* /*go*/, Player* /*player*/) { } -- cgit v1.2.3 From 890b47c8617ab21bdb2c737e90f38238d6cc6b78 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 25 Dec 2013 12:37:00 +0100 Subject: Build fix --- src/server/game/AI/CoreAI/GameObjectAI.h | 1 + src/server/scripts/Kalimdor/zone_azshara.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/server/game') diff --git a/src/server/game/AI/CoreAI/GameObjectAI.h b/src/server/game/AI/CoreAI/GameObjectAI.h index 41443294100..7c0e04aa957 100644 --- a/src/server/game/AI/CoreAI/GameObjectAI.h +++ b/src/server/game/AI/CoreAI/GameObjectAI.h @@ -22,6 +22,7 @@ #include "Define.h" #include #include "Object.h" +#include "QuestDef.h" #include "GameObject.h" #include "CreatureAI.h" diff --git a/src/server/scripts/Kalimdor/zone_azshara.cpp b/src/server/scripts/Kalimdor/zone_azshara.cpp index bde7074923b..5d28c7f018e 100644 --- a/src/server/scripts/Kalimdor/zone_azshara.cpp +++ b/src/server/scripts/Kalimdor/zone_azshara.cpp @@ -329,7 +329,7 @@ public: } } - void sGossipSelect(Player* player, uint32 sender, uint32 action) OVERRIDE + void sGossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) OVERRIDE { player->CLOSE_GOSSIP_MENU(); me->CastSpell(player, SPELL_GIVE_SOUTHFURY_MOONSTONE, true); -- cgit v1.2.3 From fe95371d9a8b485d3028a8d0bf1481e2cae20c1c Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 25 Dec 2013 14:16:55 -0330 Subject: Core/Scripting: Replace casted with cast as casted is not a word. --- dep/mysqllite/libmysql/libmysql.c | 2 +- src/server/game/AI/CoreAI/PetAI.cpp | 2 +- src/server/game/AI/CoreAI/TotemAI.cpp | 2 +- src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 2 +- src/server/game/AI/SmartScripts/SmartScript.cpp | 12 +++--- src/server/game/Achievements/AchievementMgr.cpp | 2 +- .../game/Battlefield/Zones/BattlefieldWG.cpp | 2 +- .../game/Battlegrounds/Zones/BattlegroundDS.h | 2 +- src/server/game/DataStores/DBCEnums.h | 2 +- src/server/game/Entities/Creature/GossipDef.cpp | 12 +++--- src/server/game/Entities/GameObject/GameObject.cpp | 4 +- src/server/game/Entities/Item/Item.cpp | 2 +- src/server/game/Entities/Player/Player.cpp | 20 +++++----- src/server/game/Entities/Player/Player.h | 2 +- src/server/game/Entities/Unit/Unit.cpp | 46 +++++++++++----------- src/server/game/Entities/Unit/Unit.h | 12 +++--- src/server/game/Globals/ObjectMgr.cpp | 6 +-- src/server/game/Handlers/LootHandler.cpp | 2 +- src/server/game/Handlers/SpellHandler.cpp | 12 +++--- src/server/game/Handlers/TradeHandler.cpp | 6 +-- src/server/game/Miscellaneous/SharedDefines.h | 2 +- src/server/game/Quests/QuestDef.h | 18 ++++----- src/server/game/Scripting/MapScripts.cpp | 4 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 6 +-- src/server/game/Spells/Auras/SpellAuras.cpp | 14 +++---- src/server/game/Spells/Auras/SpellAuras.h | 2 +- src/server/game/Spells/Spell.cpp | 40 +++++++++---------- src/server/game/Spells/Spell.h | 2 +- src/server/game/Spells/SpellEffects.cpp | 4 +- src/server/game/Spells/SpellInfo.cpp | 8 ++-- src/server/game/Spells/SpellMgr.cpp | 6 +-- src/server/game/Spells/SpellScript.h | 6 +-- src/server/scripts/Commands/cs_misc.cpp | 2 +- src/server/scripts/Commands/cs_quest.cpp | 2 +- .../boss_emperor_dagran_thaurissan.cpp | 2 +- .../EasternKingdoms/Karazhan/boss_netherspite.cpp | 6 +-- .../Karazhan/boss_prince_malchezaar.cpp | 2 +- .../Karazhan/boss_shade_of_aran.cpp | 6 +-- .../MagistersTerrace/boss_priestess_delrissa.cpp | 2 +- .../MagistersTerrace/boss_selin_fireheart.cpp | 2 +- .../ScarletMonastery/boss_arcanist_doan.cpp | 2 +- .../ScarletMonastery/boss_azshir_the_sleepless.cpp | 2 +- .../ScarletMonastery/boss_herod.cpp | 2 +- .../boss_high_inquisitor_fairbanks.cpp | 2 +- .../boss_mograine_and_whitemane.cpp | 4 +- .../Scholomance/boss_instructor_malicia.cpp | 4 +- .../Stratholme/boss_dathrohan_balnazzar.cpp | 2 +- .../SunwellPlateau/boss_eredar_twins.cpp | 22 +++++------ .../SunwellPlateau/boss_felmyst.cpp | 2 +- .../SunwellPlateau/boss_kiljaeden.cpp | 10 ++--- .../EasternKingdoms/Uldaman/boss_ironaya.cpp | 16 ++++---- .../EasternKingdoms/ZulAman/boss_halazzi.cpp | 2 +- .../EasternKingdoms/ZulAman/boss_janalai.cpp | 2 +- .../EasternKingdoms/ZulAman/boss_zuljin.cpp | 2 +- src/server/scripts/Examples/example_spell.cpp | 2 +- .../CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp | 2 +- .../EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp | 2 +- .../TheBlackMorass/the_black_morass.cpp | 2 +- .../scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp | 2 +- .../Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp | 2 +- .../Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp | 2 +- .../TempleOfAhnQiraj/boss_twinemperors.cpp | 12 +++--- .../AzjolNerub/Ahnkahet/boss_herald_volazj.cpp | 2 +- .../Ahnkahet/boss_jedoga_shadowseeker.cpp | 20 +++++----- .../ObsidianSanctum/boss_sartharion.cpp | 2 +- .../TrialOfTheCrusader/boss_northrend_beasts.cpp | 14 +++---- .../Northrend/DraktharonKeep/boss_king_dred.cpp | 2 +- .../Northrend/DraktharonKeep/boss_tharon_ja.cpp | 2 +- .../IcecrownCitadel/boss_professor_putricide.cpp | 2 +- .../Northrend/Nexus/EyeOfEternity/boss_malygos.cpp | 8 ++-- .../scripts/Northrend/Nexus/Oculus/boss_eregos.cpp | 2 +- .../scripts/Northrend/Nexus/Oculus/boss_urom.cpp | 2 +- .../Ulduar/HallsOfLightning/boss_bjarngrim.cpp | 2 +- .../Ulduar/HallsOfLightning/boss_ionar.cpp | 2 +- .../Ulduar/HallsOfLightning/boss_volkhan.cpp | 4 +- .../scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp | 2 +- .../scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp | 2 +- .../Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp | 4 +- .../UtgardeKeep/UtgardeKeep/boss_keleseth.cpp | 2 +- .../UtgardeKeep/boss_skarvald_dalronn.cpp | 6 +-- .../UtgardeKeep/UtgardePinnacle/boss_skadi.cpp | 2 +- .../Northrend/VioletHold/instance_violet_hold.cpp | 4 +- .../scripts/Northrend/VioletHold/violet_hold.cpp | 2 +- .../scripts/Northrend/zone_crystalsong_forest.cpp | 2 +- src/server/scripts/Northrend/zone_dragonblight.cpp | 2 +- .../AuchenaiCrypts/boss_exarch_maladaar.cpp | 4 +- .../ManaTombs/boss_nexusprince_shaffar.cpp | 8 ++-- .../Auchindoun/ManaTombs/boss_pandemonius.cpp | 2 +- .../SethekkHalls/boss_darkweaver_syth.cpp | 2 +- .../SethekkHalls/boss_tailonking_ikiss.cpp | 2 +- .../scripts/Outland/BlackTemple/boss_illidan.cpp | 2 +- .../SerpentShrine/boss_lady_vashj.cpp | 8 ++-- .../BloodFurnace/boss_kelidan_the_breaker.cpp | 12 +++--- .../MagtheridonsLair/boss_magtheridon.cpp | 6 +-- .../scripts/Outland/TempestKeep/Eye/boss_alar.cpp | 2 +- .../Outland/TempestKeep/Eye/boss_kaelthas.cpp | 14 +++---- .../Outland/TempestKeep/arcatraz/arcatraz.cpp | 2 +- .../arcatraz/boss_harbinger_skyriss.cpp | 8 ++-- .../botanica/boss_high_botanist_freywinn.cpp | 2 +- .../scripts/Outland/zone_blades_edge_mountains.cpp | 2 +- src/server/scripts/Pet/pet_mage.cpp | 2 +- src/server/scripts/Spells/spell_generic.cpp | 28 ++++++------- src/server/scripts/Spells/spell_quest.cpp | 2 +- src/server/scripts/World/guards.cpp | 4 +- src/server/scripts/World/mob_generic_creature.cpp | 4 +- src/server/shared/Database/Field.cpp | 2 +- 106 files changed, 299 insertions(+), 299 deletions(-) (limited to 'src/server/game') diff --git a/dep/mysqllite/libmysql/libmysql.c b/dep/mysqllite/libmysql/libmysql.c index f802387cf9a..3af9165de8c 100644 --- a/dep/mysqllite/libmysql/libmysql.c +++ b/dep/mysqllite/libmysql/libmysql.c @@ -2303,7 +2303,7 @@ stmt_read_row_no_result_set(MYSQL_STMT *stmt __attribute__((unused)), mysql_stmt_attr_set() attr_type statement attribute - value casted to const void * pointer to value. + value cast to const void * pointer to value. RETURN VALUE 0 success diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index 18daf1ef8de..bc131724484 100644 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -131,7 +131,7 @@ void PetAI::UpdateAI(uint32 diff) HandleReturnMovement(); } - // Autocast (casted only in combat or persistent spells in any state) + // Autocast (cast only in combat or persistent spells in any state) if (!me->HasUnitState(UNIT_STATE_CASTING)) { typedef std::vector > TargetSpellList; diff --git a/src/server/game/AI/CoreAI/TotemAI.cpp b/src/server/game/AI/CoreAI/TotemAI.cpp index 6f8452176e5..508554a7a32 100644 --- a/src/server/game/AI/CoreAI/TotemAI.cpp +++ b/src/server/game/AI/CoreAI/TotemAI.cpp @@ -52,7 +52,7 @@ void TotemAI::UpdateAI(uint32 /*diff*/) if (me->ToTotem()->GetTotemType() != TOTEM_ACTIVE) return; - if (!me->IsAlive() || me->IsNonMeleeSpellCasted(false)) + if (!me->IsAlive() || me->IsNonMeleeSpellCast(false)) return; // Search spell diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 68c7869f8b7..d00f686a98a 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -156,7 +156,7 @@ void ScriptedAI::DoStopAttack() void ScriptedAI::DoCastSpell(Unit* target, SpellInfo const* spellInfo, bool triggered) { - if (!target || me->IsNonMeleeSpellCasted(false)) + if (!target || me->IsNonMeleeSpellCast(false)) return; me->StopMoving(); diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 60a4db511f4..0069cd3dd45 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -529,7 +529,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u me->GetGUIDLow(), e.action.cast.spell, (*itr)->GetGUIDLow(), e.action.cast.flags); } else - TC_LOG_DEBUG("scripts.ai", "Spell %u not casted because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*itr)->GetGUID(), (*itr)->GetEntry(), uint32((*itr)->GetTypeId())); + TC_LOG_DEBUG("scripts.ai", "Spell %u not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*itr)->GetGUID(), (*itr)->GetEntry(), uint32((*itr)->GetTypeId())); } delete targets; @@ -560,7 +560,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u tempLastInvoker->GetGUIDLow(), e.action.cast.spell, (*itr)->GetGUIDLow(), e.action.cast.flags); } else - TC_LOG_DEBUG("scripts.ai", "Spell %u not casted because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*itr)->GetGUID(), (*itr)->GetEntry(), uint32((*itr)->GetTypeId())); + TC_LOG_DEBUG("scripts.ai", "Spell %u not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*itr)->GetGUID(), (*itr)->GetEntry(), uint32((*itr)->GetTypeId())); } delete targets; @@ -1730,7 +1730,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u unit->CastSpell((*it)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED)); } else - TC_LOG_DEBUG("scripts.ai", "Spell %u not casted because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*it)->GetGUID(), (*it)->GetEntry(), uint32((*it)->GetTypeId())); + TC_LOG_DEBUG("scripts.ai", "Spell %u not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*it)->GetGUID(), (*it)->GetEntry(), uint32((*it)->GetTypeId())); } } @@ -2731,7 +2731,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui Unit* victim = me->GetVictim(); - if (!victim || !victim->IsNonMeleeSpellCasted(false, false, true)) + if (!victim || !victim->IsNonMeleeSpellCast(false, false, true)) return; if (e.event.targetCasting.spellId > 0) @@ -3157,12 +3157,12 @@ void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff) if (e.GetEventType() == SMART_EVENT_UPDATE_IC && (!me || !me->IsInCombat())) return; - if (e.GetEventType() == SMART_EVENT_UPDATE_OOC && (me && me->IsInCombat()))//can be used with me=NULL (go script) + if (e.GetEventType() == SMART_EVENT_UPDATE_OOC && (me && me->IsInCombat())) //can be used with me=NULL (go script) return; if (e.timer < diff) { - // delay spell cast event if another spell is being casted + // delay spell cast event if another spell is being cast if (e.GetActionType() == SMART_ACTION_CAST) { if (!(e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS)) diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 60056fe324d..191acdefcac 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -771,7 +771,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_SOLD: /* FIXME: for online player only currently */ case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_DEALT: case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_RECEIVED: - case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CAST: case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED: // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case if (!miscValue1) diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index a5602a1b415..67288e0fadb 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -804,7 +804,7 @@ uint32 BattlefieldWG::GetData(uint32 data) const { switch (data) { - // Used to determine when the phasing spells must be casted + // Used to determine when the phasing spells must be cast // See: SpellArea::IsFitToRequirements case AREA_THE_SUNKEN_RING: case AREA_THE_BROKEN_TEMPLATE: diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h index cdfbbc480bb..74c5e70a633 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h @@ -58,7 +58,7 @@ enum BattlegroundDSCreatures enum BattlegroundDSSpells { BG_DS_SPELL_FLUSH = 57405, // Visual and target selector for the starting knockback from the pipe - BG_DS_SPELL_FLUSH_KNOCKBACK = 61698, // Knockback effect for previous spell (triggered, not need to be casted) + BG_DS_SPELL_FLUSH_KNOCKBACK = 61698, // Knockback effect for previous spell (triggered, not needed to be cast) BG_DS_SPELL_WATER_SPOUT = 58873 // Knockback effect of the central waterfall }; diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index e976704c215..ec2ab308cd7 100644 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -201,7 +201,7 @@ enum AchievementCriteriaTypes ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_DEALT = 101, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_RECEIVED = 102, ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED = 103, - ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED = 104, + ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CAST = 104, ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED = 105, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED = 106, ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED = 107, diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index 9a6dce7d9f0..6c13b921d3e 100644 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -436,8 +436,8 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, // rewarded honor points. Multiply with 10 to satisfy client data << uint32(10 * quest->CalculateHonorGain(_session->GetPlayer()->GetQuestLevel(quest))); data << float(0.0f); // unk, honor multiplier? - data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0) - data << int32(quest->GetRewSpellCast()); // casted spell + data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (cast if RewSpellCast == 0) + data << int32(quest->GetRewSpellCast()); // cast spell data << uint32(quest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles) data << uint32(quest->GetBonusTalents()); // bonus talents data << uint32(quest->GetRewArenaPoints()); // reward arena points @@ -517,8 +517,8 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const data << uint32(quest->GetRewOrReqMoney()); // reward money (below max lvl) data << uint32(quest->GetRewMoneyMaxLevel()); // used in XP calculation at client - data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0) - data << int32(quest->GetRewSpellCast()); // casted spell + data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (cast if RewSpellCast == 0) + data << int32(quest->GetRewSpellCast()); // cast spell // rewarded honor points data << uint32(quest->GetRewHonorAddition()); @@ -674,8 +674,8 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, b data << uint32(10 * quest->CalculateHonorGain(_session->GetPlayer()->GetQuestLevel(quest))); data << float(0.0f); // unk, honor multiplier? data << uint32(0x08); // unused by client? - data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0) - data << int32(quest->GetRewSpellCast()); // casted spell + data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (cast if RewSpellCast == 0) + data << int32(quest->GetRewSpellCast()); // cast spell data << uint32(0); // unknown data << uint32(quest->GetBonusTalents()); // bonus talents data << uint32(quest->GetRewArenaPoints()); // arena points diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 3c44c8e6035..e4d69a1f690 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -651,7 +651,7 @@ void GameObject::Update(uint32 diff) void GameObject::Refresh() { - // not refresh despawned not casted GO (despawned casted GO destroyed in all cases anyway) + // Do not refresh despawned GO from spellcast (GO's from spellcast are destroyed after despawn) if (m_respawnTime > 0 && m_spawnedByDefault) return; @@ -1485,7 +1485,7 @@ void GameObject::Use(Unit* user) if (spellId == 62330) // GO store nonexistent spell, replace by expected { // spell have reagent and mana cost but it not expected use its - // it triggered spell in fact casted at currently channeled GO + // it triggered spell in fact cast at currently channeled GO spellId = 61993; triggered = true; } diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 747884e197c..b69c5f05714 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -102,7 +102,7 @@ void AddItemsSetItem(Player* player, Item* item) break; } - // spell casted only if fit form requirement, in other case will casted at form change + // spell cast only if fit form requirement, in other case will cast at form change player->ApplyEquipSpell(spellInfo, NULL, true); eff->spells[y] = spellInfo; break; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index a8b92a70ae1..934acc223b0 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2180,7 +2180,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati SetSemaphoreTeleportFar(false); //setup delayed teleport flag SetDelayedTeleportFlag(IsCanDelayTeleport()); - //if teleport spell is casted in Unit::Update() func + //if teleport spell is cast in Unit::Update() func //then we need to delay it until update process will be finished if (IsHasDelayedTeleport()) { @@ -2244,7 +2244,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati SetSemaphoreTeleportNear(false); //setup delayed teleport flag SetDelayedTeleportFlag(IsCanDelayTeleport()); - //if teleport spell is casted in Unit::Update() func + //if teleport spell is cast in Unit::Update() func //then we need to delay it until update process will be finished if (IsHasDelayedTeleport()) { @@ -2290,7 +2290,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati // stop spellcasting // not attempt interrupt teleportation spell at caster teleport if (!(options & TELE_TO_SPELL)) - if (IsNonMeleeSpellCasted(true)) + if (IsNonMeleeSpellCast(true)) InterruptNonMeleeSpells(true); //remove auras before removing from map... @@ -8422,7 +8422,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->spellid[s]); if (!spellInfo) { - TC_LOG_ERROR("entities.player.items", "Player::CastItemCombatSpell(GUID: %u, name: %s, enchant: %i): unknown spell %i is casted, ignoring...", + TC_LOG_ERROR("entities.player.items", "Player::CastItemCombatSpell(GUID: %u, name: %s, enchant: %i): unknown spell %i is cast, ignoring...", GetGUIDLow(), GetName().c_str(), pEnchant->ID, pEnchant->spellid[s]); continue; } @@ -8483,7 +8483,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8 // use triggered flag only for items with many spell casts and for not first cast uint8 count = 0; - // item spells casted at use + // item spells cast at use for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) { _Spell const& spellData = proto->Spells[i]; @@ -8512,7 +8512,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8 ++count; } - // Item enchantments spells casted at use + // Item enchantments spells cast at use for (uint8 e_slot = 0; e_slot < MAX_ENCHANTMENT_SLOT; ++e_slot) { uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(e_slot)); @@ -11554,7 +11554,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool if (IsInCombat()&& (pProto->Class == ITEM_CLASS_WEAPON || pProto->InventoryType == INVTYPE_RELIC) && m_weaponChangeTimer != 0) return EQUIP_ERR_CANT_DO_RIGHT_NOW; // maybe exist better err - if (IsNonMeleeSpellCasted(false)) + if (IsNonMeleeSpellCast(false)) return EQUIP_ERR_CANT_DO_RIGHT_NOW; } @@ -21052,7 +21052,7 @@ bool Player::ActivateTaxiPathTo(std::vector const& nodes, Creature* npc } // not let cheating with start flight in time of logout process || if casting not finished || while in combat || if not use Spell's with EffectSendTaxi - if (IsNonMeleeSpellCasted(false)) + if (IsNonMeleeSpellCast(false)) { GetSession()->SendActivateTaxiReply(ERR_TAXIPLAYERBUSY); return false; @@ -23544,7 +23544,7 @@ void Player::RemoveItemDependentAurasAndCasts(Item* pItem) RemoveOwnedAura(itr); } - // currently casted spells can be dependent from item + // currently cast spells can be dependent from item for (uint32 i = 0; i < CURRENT_MAX_SPELL; ++i) if (Spell* spell = GetCurrentSpell(CurrentSpellTypes(i))) if (spell->getState() != SPELL_STATE_DELAYED && !HasItemFitToSpellRequirements(spell->m_spellInfo, pItem)) @@ -25805,7 +25805,7 @@ void Player::ActivateSpec(uint8 spec) if (spec > GetSpecsCount()) return; - if (IsNonMeleeSpellCasted(false)) + if (IsNonMeleeSpellCast(false)) InterruptNonMeleeSpells(false); SQLTransaction trans = CharacterDatabase.BeginTransaction(); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index da25e04bc2f..44b35c9482f 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1021,7 +1021,7 @@ class TradeData uint32 m_money; // m_player place money to trade uint32 m_spell; // m_player apply spell to non-traded slot item - uint64 m_spellCastItem; // applied spell casted by item use + uint64 m_spellCastItem; // applied spell cast by item use uint64 m_items[TRADE_SLOT_COUNT]; // traded items from m_player side including non-traded slot }; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 32dfee3409b..ea6eb49e99a 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1936,7 +1936,7 @@ void Unit::AttackerStateUpdate (Unit* victim, WeaponAttackType attType, bool ext if (attType != BASE_ATTACK && attType != OFF_ATTACK) return; // ignore ranged case - // melee attack spell casted at main hand attack only - no normal melee dmg dealt + // melee attack spell cast at main hand attack only - no normal melee dmg dealt if (attType == BASE_ATTACK && m_currentSpells[CURRENT_MELEE_SPELL] && !extra) m_currentSpells[CURRENT_MELEE_SPELL]->cast(); else @@ -2673,7 +2673,7 @@ uint32 Unit::GetDefenseSkillValue(Unit const* target) const float Unit::GetUnitDodgeChance() const { - if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STATE_CONTROLLED)) + if (IsNonMeleeSpellCast(false) || HasUnitState(UNIT_STATE_CONTROLLED)) return 0.0f; if (GetTypeId() == TYPEID_PLAYER) @@ -2693,7 +2693,7 @@ float Unit::GetUnitDodgeChance() const float Unit::GetUnitParryChance() const { - if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STATE_CONTROLLED)) + if (IsNonMeleeSpellCast(false) || HasUnitState(UNIT_STATE_CONTROLLED)) return 0.0f; float chance = 0.0f; @@ -2739,7 +2739,7 @@ float Unit::GetUnitMissChance(WeaponAttackType attType) const float Unit::GetUnitBlockChance() const { - if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STATE_CONTROLLED)) + if (IsNonMeleeSpellCast(false) || HasUnitState(UNIT_STATE_CONTROLLED)) return 0.0f; if (Player const* player = ToPlayer()) @@ -2931,7 +2931,7 @@ void Unit::_UpdateSpells(uint32 time) void Unit::_UpdateAutoRepeatSpell() { // check "realtime" interrupts - if ((GetTypeId() == TYPEID_PLAYER && ToPlayer()->isMoving()) || IsNonMeleeSpellCasted(false, false, true, m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id == 75)) + if ((GetTypeId() == TYPEID_PLAYER && ToPlayer()->isMoving()) || IsNonMeleeSpellCast(false, false, true, m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id == 75)) { // cancel wand shoot if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id != 75) @@ -2964,7 +2964,7 @@ void Unit::_UpdateAutoRepeatSpell() } } -void Unit::SetCurrentCastedSpell(Spell* pSpell) +void Unit::SetCurrentCastSpell(Spell* pSpell) { ASSERT(pSpell); // NULL may be never passed here, use InterruptSpell or InterruptNonMeleeSpells @@ -3077,16 +3077,16 @@ void Unit::FinishSpell(CurrentSpellTypes spellType, bool ok /*= true*/) spell->finish(ok); } -bool Unit::IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled, bool skipAutorepeat, bool isAutoshoot, bool skipInstant) const +bool Unit::IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled, bool skipAutorepeat, bool isAutoshoot, bool skipInstant) const { // We don't do loop here to explicitly show that melee spell is excluded. // Maybe later some special spells will be excluded too. - // if skipInstant then instant spells shouldn't count as being casted + // if skipInstant then instant spells shouldn't count as being cast if (skipInstant && m_currentSpells[CURRENT_GENERIC_SPELL] && !m_currentSpells[CURRENT_GENERIC_SPELL]->GetCastTime()) return false; - // generic spells are casted when they are not finished and not delayed + // generic spells are cast when they are not finished and not delayed if (m_currentSpells[CURRENT_GENERIC_SPELL] && (m_currentSpells[CURRENT_GENERIC_SPELL]->getState() != SPELL_STATE_FINISHED) && (withDelayed || m_currentSpells[CURRENT_GENERIC_SPELL]->getState() != SPELL_STATE_DELAYED)) @@ -3094,14 +3094,14 @@ bool Unit::IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled, bool skip if (!isAutoshoot || !(m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->AttributesEx2 & SPELL_ATTR2_NOT_RESET_AUTO_ACTIONS)) return true; } - // channeled spells may be delayed, but they are still considered casted + // channeled spells may be delayed, but they are still considered cast else if (!skipChanneled && m_currentSpells[CURRENT_CHANNELED_SPELL] && (m_currentSpells[CURRENT_CHANNELED_SPELL]->getState() != SPELL_STATE_FINISHED)) { if (!isAutoshoot || !(m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->AttributesEx2 & SPELL_ATTR2_NOT_RESET_AUTO_ACTIONS)) return true; } - // autorepeat spells may be finished or delayed, but they are still considered casted + // autorepeat spells may be finished or delayed, but they are still considered cast else if (!skipAutorepeat && m_currentSpells[CURRENT_AUTOREPEAT_SPELL]) return true; @@ -5682,7 +5682,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Second Wind if (dummySpell->SpellIconID == 1697) { - // only for spells and hit/crit (trigger start always) and not start from self casted spells (5530 Mace Stun Effect for example) + // only for spells and hit/crit (trigger start always) and not start from self cast spells (5530 Mace Stun Effect for example) if (procSpell == 0 || !(procEx & (PROC_EX_NORMAL_HIT|PROC_EX_CRITICAL_HIT)) || this == victim) return false; // Need stun or root mechanic @@ -6352,7 +6352,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere { if (Player* member = itr->GetSource()) { - // check if it was heal by paladin which casted this beacon of light + // check if it was heal by paladin which cast this beacon of light if (member->GetAura(53563, victim->GetGUID())) { // do not proc when target of beacon of light is healed @@ -7304,7 +7304,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Runic Power Back on Snare/Root if (dummySpell->Id == 61257) { - // only for spells and hit/crit (trigger start always) and not start from self casted spells + // only for spells and hit/crit (trigger start always) and not start from self cast spells if (procSpell == 0 || !(procEx & (PROC_EX_NORMAL_HIT|PROC_EX_CRITICAL_HIT)) || this == victim) return false; // Need snare or root mechanic @@ -8026,7 +8026,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg { if (!procSpell) return false; - // procspell is triggered spell but we need mana cost of original casted spell + // procspell is triggered spell but we need mana cost of original cast spell uint32 originalSpellId = procSpell->Id; // Holy Shock heal if (procSpell->SpellFamilyFlags[1] & 0x00010000) @@ -9050,7 +9050,7 @@ bool Unit::AttackStop() void Unit::CombatStop(bool includingCast) { - if (includingCast && IsNonMeleeSpellCasted(false)) + if (includingCast && IsNonMeleeSpellCast(false)) InterruptNonMeleeSpells(false); AttackStop(); @@ -9605,7 +9605,7 @@ int32 Unit::DealHeal(Unit* victim, uint32 addhealth) if (gain) player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE, gain, 0, victim); - player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED, addhealth); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CAST, addhealth); } if (Player* player = victim->ToPlayer()) @@ -12404,7 +12404,7 @@ void Unit::setDeathState(DeathState s) getHostileRefManager().deleteReferences(); ClearComboPointHolders(); // any combo points pointed to unit lost at it death - if (IsNonMeleeSpellCasted(false)) + if (IsNonMeleeSpellCast(false)) InterruptNonMeleeSpells(false); ExitVehicle(); // Exit vehicle before calling RemoveAllControlled @@ -12823,7 +12823,7 @@ int32 Unit::ModSpellDuration(SpellInfo const* spellProto, Unit const* target, in } } - // Glyphs which increase duration of selfcasted buffs + // Glyphs which increase duration of selfcast buffs if (target == this) { switch (spellProto->SpellFamilyName) @@ -12884,7 +12884,7 @@ DiminishingLevels Unit::GetDiminishing(DiminishingGroup group) if (!i->hitTime) return DIMINISHING_LEVEL_1; - // If last spell was casted more than 15 seconds ago - reset the count. + // If last spell was cast more than 15 seconds ago - reset the count. if (i->stack == 0 && getMSTimeDiff(i->hitTime, getMSTime()) > 15000) { i->hitCount = DIMINISHING_LEVEL_1; @@ -13495,7 +13495,7 @@ void Unit::CleanupBeforeRemoveFromMap(bool finalCleanup) if (finalCleanup) m_cleanupDone = true; - m_Events.KillAllEvents(false); // non-delatable (currently casted spells) will not deleted now but it will deleted at call in Map::RemoveAllObjectsInRemoveList + m_Events.KillAllEvents(false); // non-delatable (currently cast spells) will not deleted now but it will deleted at call in Map::RemoveAllObjectsInRemoveList CombatStop(); ClearComboPointHolders(); DeleteThreatList(); @@ -14652,7 +14652,7 @@ void Unit::ApplyCastTimePercentMod(float val, bool apply) uint32 Unit::GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime) const { - // Not apply this to creature casted spells with casttime == 0 + // Not apply this to creature cast spells with casttime == 0 if (CastingTime == 0 && GetTypeId() == TYPEID_UNIT && !ToCreature()->IsPet()) return 3500; @@ -17174,7 +17174,7 @@ void Unit::StopAttackFaction(uint32 faction_id) if (victim->GetFactionTemplateEntry()->faction == faction_id) { AttackStop(); - if (IsNonMeleeSpellCasted(false)) + if (IsNonMeleeSpellCast(false)) InterruptNonMeleeSpells(false); // melee and ranged forced attack cancel diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index d9e49ab6a4d..4508b1f0090 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1816,15 +1816,15 @@ class Unit : public WorldObject float GetNegStat(Stats stat) const { return GetFloatValue(UNIT_FIELD_NEGSTAT0+stat); } float GetCreateStat(Stats stat) const { return m_createStats[stat]; } - void SetCurrentCastedSpell(Spell* pSpell); + void SetCurrentCastSpell(Spell* pSpell); virtual void ProhibitSpellSchool(SpellSchoolMask /*idSchoolMask*/, uint32 /*unTimeMs*/) { } void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed = true, bool withInstant = true); void FinishSpell(CurrentSpellTypes spellType, bool ok = true); - // set withDelayed to true to account delayed spells as casted - // delayed+channeled spells are always accounted as casted + // set withDelayed to true to account delayed spells as cast + // delayed+channeled spells are always accounted as cast // we can skip channeled or delayed checks using flags - bool IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled = false, bool skipAutorepeat = false, bool isAutoshoot = false, bool skipInstant = true) const; + bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled = false, bool skipAutorepeat = false, bool isAutoshoot = false, bool skipInstant = true) const; // set withDelayed to true to interrupt delayed spells too // delayed+channeled spells are always interrupted @@ -2170,8 +2170,8 @@ class Unit : public WorldObject uint32 m_removedAurasCount; AuraEffectList m_modAuras[TOTAL_AURAS]; - AuraList m_scAuras; // casted singlecast auras - AuraApplicationList m_interruptableAuras; // auras which have interrupt mask applied on unit + AuraList m_scAuras; // cast singlecast auras + AuraApplicationList m_interruptableAuras; // auras which have interrupt mask applied on unit AuraStateAurasMap m_auraStateAuras; // Used for improve performance of aura state checks on aura apply/remove uint32 m_interruptMask; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 3d56225bc00..e4d20cbc391 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -4234,21 +4234,21 @@ void ObjectMgr::LoadQuests() { TC_LOG_ERROR("sql.sql", "Quest %u has `RewardSpellCast` = %u but spell %u does not exist, quest will not have a spell reward.", qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast); - qinfo->RewardSpellCast = 0; // no spell will be casted on player + qinfo->RewardSpellCast = 0; // no spell will be cast on player } else if (!SpellMgr::IsSpellValid(spellInfo)) { TC_LOG_ERROR("sql.sql", "Quest %u has `RewardSpellCast` = %u but spell %u is broken, quest will not have a spell reward.", qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast); - qinfo->RewardSpellCast = 0; // no spell will be casted on player + qinfo->RewardSpellCast = 0; // no spell will be cast on player } else if (GetTalentSpellCost(qinfo->RewardSpellCast)) { TC_LOG_ERROR("sql.sql", "Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.", qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast); - qinfo->RewardSpellCast = 0; // no spell will be casted on player + qinfo->RewardSpellCast = 0; // no spell will be cast on player } } diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 9a371178044..94578b83c20 100644 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -229,7 +229,7 @@ void WorldSession::HandleLootOpcode(WorldPacket& recvData) GetPlayer()->SendLoot(guid, LOOT_CORPSE); // interrupt cast - if (GetPlayer()->IsNonMeleeSpellCasted(false)) + if (GetPlayer()->IsNonMeleeSpellCast(false)) GetPlayer()->InterruptNonMeleeSpells(false); } diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index b264b0d2fff..62c4dfe5497 100644 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -67,10 +67,10 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) return; uint8 bagIndex, slot, castFlags; - uint8 castCount; // next cast if exists (single or not) + uint8 castCount; // next cast if exists (single or not) uint64 itemGUID; uint32 glyphIndex; // something to do with glyphs? - uint32 spellId; // casted spell id + uint32 spellId; // cast spell id recvPacket >> bagIndex >> slot >> castCount >> spellId >> itemGUID >> glyphIndex >> castFlags; @@ -357,7 +357,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) return; } - // Client is resending autoshot cast opcode when other spell is casted during shoot rotation + // Client is resending autoshot cast opcode when other spell is cast during shoot rotation // Skip it to prevent "interrupt" message if (spellInfo->IsAutoRepeatRangedSpell() && caster->GetCurrentSpell(CURRENT_AUTOREPEAT_SPELL) && caster->GetCurrentSpell(CURRENT_AUTOREPEAT_SPELL)->m_spellInfo == spellInfo) @@ -383,7 +383,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) { SpellInfo const* actualSpellInfo = spellInfo->GetAuraRankForLevel(targets.GetUnitTarget()->getLevel()); - // if rank not found then function return NULL but in explicit cast case original spell can be casted and later failed with appropriate error message + // if rank not found then function return NULL but in explicit cast case original spell can be cast and later failed with appropriate error message if (actualSpellInfo) spellInfo = actualSpellInfo; } @@ -400,7 +400,7 @@ void WorldSession::HandleCancelCastOpcode(WorldPacket& recvPacket) recvPacket.read_skip(); // counter, increments with every CANCEL packet, don't use for now recvPacket >> spellId; - if (_player->IsNonMeleeSpellCasted(false)) + if (_player->IsNonMeleeSpellCast(false)) _player->InterruptNonMeleeSpells(false, spellId, false); } @@ -417,7 +417,7 @@ void WorldSession::HandleCancelAuraOpcode(WorldPacket& recvPacket) if (spellInfo->Attributes & SPELL_ATTR0_CANT_CANCEL) return; - // channeled spell case (it currently casted then) + // channeled spell case (it currently cast then) if (spellInfo->IsChanneled()) { if (Spell* curSpell = _player->GetCurrentSpell(CURRENT_CHANNELED_SPELL)) diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index 8befde46550..7acd599eda3 100644 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -90,7 +90,7 @@ void WorldSession::SendUpdateTrade(bool trader_data /*= true*/) data << uint32(TRADE_SLOT_COUNT); // trade slots count/number?, = next field in most cases data << uint32(TRADE_SLOT_COUNT); // trade slots count/number?, = prev field in most cases data << uint32(view_trade->GetMoney()); // trader gold - data << uint32(view_trade->GetSpell()); // spell casted on lowest slot item + data << uint32(view_trade->GetSpell()); // spell cast on lowest slot item for (uint8 i = 0; i < TRADE_SLOT_COUNT; ++i) { @@ -351,7 +351,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) Spell* his_spell = NULL; SpellCastTargets his_targets; - // not accept if spell can't be casted now (cheating) + // not accept if spell can't be cast now (cheating) if (uint32 my_spell_id = my_trade->GetSpell()) { SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(my_spell_id); @@ -386,7 +386,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) } } - // not accept if spell can't be casted now (cheating) + // not accept if spell can't be cast now (cheating) if (uint32 his_spell_id = his_trade->GetSpell()) { SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(his_spell_id); diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index a3be268110c..cb5156b2b64 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -386,7 +386,7 @@ enum SpellAttr3 SPELL_ATTR3_ONLY_TARGET_PLAYERS = 0x00000100, // 8 can only target players SPELL_ATTR3_TRIGGERED_CAN_TRIGGER_PROC_2 = 0x00000200, // 9 triggered from effect? SPELL_ATTR3_MAIN_HAND = 0x00000400, // 10 Main hand weapon required - SPELL_ATTR3_BATTLEGROUND = 0x00000800, // 11 Can casted only on battleground + SPELL_ATTR3_BATTLEGROUND = 0x00000800, // 11 Can only be cast in battleground SPELL_ATTR3_ONLY_TARGET_GHOSTS = 0x00001000, // 12 SPELL_ATTR3_UNK13 = 0x00002000, // 13 SPELL_ATTR3_IS_HONORLESS_TARGET = 0x00004000, // 14 "Honorless Target" only this spells have this flag diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index f763777fe15..7c0db146a4a 100644 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -109,15 +109,15 @@ enum QuestStatus enum QuestGiverStatus { DIALOG_STATUS_NONE = 0, - DIALOG_STATUS_UNAVAILABLE = 1, - DIALOG_STATUS_LOW_LEVEL_AVAILABLE = 2, - DIALOG_STATUS_LOW_LEVEL_REWARD_REP = 3, - DIALOG_STATUS_LOW_LEVEL_AVAILABLE_REP = 4, - DIALOG_STATUS_INCOMPLETE = 5, - DIALOG_STATUS_REWARD_REP = 6, - DIALOG_STATUS_AVAILABLE_REP = 7, - DIALOG_STATUS_AVAILABLE = 8, - DIALOG_STATUS_REWARD2 = 9, // no yellow dot on minimap + DIALOG_STATUS_UNAVAILABLE = 2, + DIALOG_STATUS_LOW_LEVEL_AVAILABLE = 3, + DIALOG_STATUS_LOW_LEVEL_REWARD_REP = 4, + DIALOG_STATUS_LOW_LEVEL_AVAILABLE_REP = 5, + DIALOG_STATUS_INCOMPLETE = 6, + DIALOG_STATUS_REWARD_REP = 7, + DIALOG_STATUS_AVAILABLE_REP = 8, + DIALOG_STATUS_AVAILABLE = 9, + DIALOG_STATUS_REWARD2 = 10, // no yellow dot on minimap DIALOG_STATUS_REWARD = 10, // yellow dot on minimap // Custom value meaning that script call did not return any valid quest status diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp index 7f2e1f095e4..b9765bbbdc2 100644 --- a/src/server/game/Scripting/MapScripts.cpp +++ b/src/server/game/Scripting/MapScripts.cpp @@ -166,7 +166,7 @@ inline Unit* Map::_GetScriptUnit(Object* obj, bool isSource, const ScriptInfo* s { unit = obj->ToUnit(); if (!unit) - TC_LOG_ERROR("scripts", "%s %s object could not be casted to unit.", + TC_LOG_ERROR("scripts", "%s %s object could not be cast to unit.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target"); } return unit; @@ -242,7 +242,7 @@ inline void Map::_ScriptProcessDoor(Object* source, Object* target, const Script { WorldObject* wSource = dynamic_cast (source); if (!wSource) - TC_LOG_ERROR("scripts", "%s source object could not be casted to world object (TypeId: %u, Entry: %u, GUID: %u), skipping.", + TC_LOG_ERROR("scripts", "%s source object could not be cast to world object (TypeId: %u, Entry: %u, GUID: %u), skipping.", scriptInfo->GetDebugInfo().c_str(), source->GetTypeId(), source->GetEntry(), source->GetGUIDLow()); else { diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 2a6d53089b9..9ac1862c016 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -709,7 +709,7 @@ void AuraEffect::ApplySpellMod(Unit* target, bool apply) { Aura* aura = iter->second->GetBase(); // only passive and permament auras-active auras should have amount set on spellcast and not be affected - // if aura is casted by others, it will not be affected + // if aura is cast by others, it will not be affected if ((aura->IsPassive() || aura->IsPermanent()) && aura->GetCasterGUID() == guid && aura->GetSpellInfo()->IsAffectedBySpellMod(m_spellmod)) { if (GetMiscValue() == SPELLMOD_ALL_EFFECTS) @@ -4531,7 +4531,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool if (target->GetTypeId() != TYPEID_PLAYER) return; // ..while they are casting - if (target->IsNonMeleeSpellCasted(false, false, true, false, true)) + if (target->IsNonMeleeSpellCast(false, false, true, false, true)) if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARRIOR, 2775, 0)) switch (aurEff->GetId()) { @@ -4727,7 +4727,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool case 42783: // Wrath of the Astromancer target->CastSpell(target, GetAmount(), true, NULL, this); break; - case 46308: // Burning Winds casted only at creatures at spawn + case 46308: // Burning Winds cast only at creatures at spawn target->CastSpell(target, 47287, true, NULL, this); break; case 52172: // Coyote Spirit Despawn Aura diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 70769b50b29..90679ad17b6 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -114,12 +114,12 @@ void AuraApplication::_Remove() void AuraApplication::_InitFlags(Unit* caster, uint8 effMask) { - // mark as selfcasted if needed + // mark as selfcast if needed _flags |= (GetBase()->GetCasterGUID() == GetTarget()->GetGUID()) ? AFLAG_CASTER : AFLAG_NONE; - // aura is casted by self or an enemy + // aura is cast by self or an enemy // one negative effect and we know aura is negative - if (IsSelfcasted() || !caster || !caster->IsFriendlyTo(GetTarget())) + if (IsSelfcast() || !caster || !caster->IsFriendlyTo(GetTarget())) { bool negativeFound = false; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) @@ -132,7 +132,7 @@ void AuraApplication::_InitFlags(Unit* caster, uint8 effMask) } _flags |= negativeFound ? AFLAG_NEGATIVE : AFLAG_POSITIVE; } - // aura is casted by friend + // aura is cast by friend // one positive effect and we know aura is positive else { @@ -306,7 +306,7 @@ Aura* Aura::Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owne // check if aura can be owned by owner if (owner->isType(TYPEMASK_UNIT)) if (!owner->IsInWorld() || ((Unit*)owner)->IsDuringRemoveFromWorld()) - // owner not in world so don't allow to own not self casted single target auras + // owner not in world so don't allow to own not self cast single target auras if (casterGUID != owner->GetGUID() && spellproto->IsSingleTarget()) return NULL; @@ -1279,7 +1279,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b } break; case SPELLFAMILY_ROGUE: - // Sprint (skip non player casted spells by category) + // Sprint (skip non player cast spells by category) if (GetSpellInfo()->SpellFamilyFlags[0] & 0x40 && GetSpellInfo()->GetCategory() == 44) // in official maybe there is only one icon? if (target->HasAura(58039)) // Glyph of Blurred Speed @@ -1675,7 +1675,7 @@ bool Aura::CanBeAppliedOn(Unit* target) // area auras mustn't be applied if (GetOwner() != target) return false; - // not selfcasted single target auras mustn't be applied + // do not apply non-selfcast single target auras if (GetCasterGUID() != GetOwner()->GetGUID() && GetSpellInfo()->IsSingleTarget()) return false; return true; diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index 9e7d0cce82c..123ad9d5a8a 100644 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -69,7 +69,7 @@ class AuraApplication uint8 GetEffectMask() const { return _flags & (AFLAG_EFF_INDEX_0 | AFLAG_EFF_INDEX_1 | AFLAG_EFF_INDEX_2); } bool HasEffect(uint8 effect) const { ASSERT(effect < MAX_SPELL_EFFECTS); return _flags & (1<AttributesEx3 & SPELL_ATTR3_CANT_TRIGGER_PROC) && unitTarget->CanProc() && CanExecuteTriggersOnHit(mask); Unit* spellHitTarget = NULL; @@ -3007,7 +3007,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered m_caster->m_Events.AddEvent(Event, m_caster->m_Events.CalculateTime(1)); //Prevent casting at cast another spell (ServerSide check) - if (!(_triggeredCastFlags & TRIGGERED_IGNORE_CAST_IN_PROGRESS) && m_caster->IsNonMeleeSpellCasted(false, true, true) && m_cast_count) + if (!(_triggeredCastFlags & TRIGGERED_IGNORE_CAST_IN_PROGRESS) && m_caster->IsNonMeleeSpellCast(false, true, true) && m_cast_count) { SendCastResult(SPELL_FAILED_SPELL_IN_PROGRESS); finish(false); @@ -3070,7 +3070,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered else m_casttime = m_spellInfo->CalcCastTime(this); - // don't allow channeled spells / spells with cast time to be casted while moving + // don't allow channeled spells / spells with cast time to be cast while moving // (even if they are interrupted on moving, spells with almost immediate effect get to have their effect processed before movement interrupter kicks in) if ((m_spellInfo->IsChanneled() || m_casttime) && m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->isMoving() && m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT) { @@ -3085,7 +3085,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered TC_LOG_DEBUG("spells", "Spell::prepare: spell id %u source %u caster %d customCastFlags %u mask %u", m_spellInfo->Id, m_caster->GetEntry(), m_originalCaster ? m_originalCaster->GetEntry() : -1, _triggeredCastFlags, m_targets.GetTargetMask()); //Containers for channeled spells have to be set - /// @todoApply this to all casted spells if needed + /// @todoApply this to all cast spells if needed // Why check duration? 29350: channelled triggers channelled if ((_triggeredCastFlags & TRIGGERED_CAST_DIRECTLY) && (!m_spellInfo->IsChanneled() || !m_spellInfo->GetMaxDuration())) cast(true); @@ -3104,7 +3104,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered } } - m_caster->SetCurrentCastedSpell(this); + m_caster->SetCurrentCastSpell(this); SendSpellStart(); // set target for proper facing @@ -3214,7 +3214,7 @@ void Spell::cast(bool skipCheck) if (m_caster->GetTypeId() == TYPEID_PLAYER) { // Set spell which will drop charges for triggered cast spells - // if not successfully casted, will be remove in finish(false) + // if not successfully cast, will be remove in finish(false) m_caster->ToPlayer()->SetSpellModTakingSpell(this, true); } @@ -3251,7 +3251,7 @@ void Spell::cast(bool skipCheck) { if (!my_trade->IsInAcceptProcess()) { - // Spell will be casted at completing the trade. Silently ignore at this place + // Spell will be cast after completing the trade. Silently ignore at this place my_trade->SetSpell(m_spellInfo->Id, m_CastItem); SendCastResult(SPELL_FAILED_DONT_REPORT); SendInterrupted(0); @@ -3341,7 +3341,7 @@ void Spell::cast(bool skipCheck) m_spellState = SPELL_STATE_DELAYED; SetDelayStart(0); - if (m_caster->HasUnitState(UNIT_STATE_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true)) + if (m_caster->HasUnitState(UNIT_STATE_CASTING) && !m_caster->IsNonMeleeSpellCast(false, false, true)) m_caster->ClearUnitState(UNIT_STATE_CASTING); } else @@ -3663,7 +3663,7 @@ void Spell::finish(bool ok) if (m_spellInfo->IsChanneled()) m_caster->UpdateInterruptMask(); - if (m_caster->HasUnitState(UNIT_STATE_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true)) + if (m_caster->HasUnitState(UNIT_STATE_CASTING) && !m_caster->IsNonMeleeSpellCast(false, false, true)) m_caster->ClearUnitState(UNIT_STATE_CASTING); // Unsummon summon as possessed creatures on spell cancel @@ -3999,7 +3999,7 @@ void Spell::SendSpellGo() if (castFlags & CAST_FLAG_RUNE_LIST) // rune cooldowns list { - /// @todo There is a crash caused by a spell with CAST_FLAG_RUNE_LIST casted by a creature + /// @todo There is a crash caused by a spell with CAST_FLAG_RUNE_LIST cast by a creature //The creature is the mover of a player, so HandleCastSpellOpcode uses it as the caster if (Player* player = m_caster->ToPlayer()) { @@ -4920,7 +4920,7 @@ SpellCastResult Spell::CheckCast(bool strict) if ((m_spellInfo->AttributesCu & SPELL_ATTR0_CU_REQ_TARGET_FACING_CASTER) && !target->HasInArc(static_cast(M_PI), m_caster)) return SPELL_FAILED_NOT_INFRONT; - if (m_caster->GetEntry() != WORLD_TRIGGER) // Ignore LOS for gameobjects casts (wrongly casted by a trigger) + if (m_caster->GetEntry() != WORLD_TRIGGER) // Ignore LOS for gameobjects casts (wrongly cast by a trigger) if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS) && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, m_spellInfo->Id, NULL, SPELL_DISABLE_LOS) && !m_caster->IsWithinLOSInMap(target)) return SPELL_FAILED_LINE_OF_SIGHT; } @@ -4952,7 +4952,7 @@ SpellCastResult Spell::CheckCast(bool strict) } } - // Spell casted only on battleground + // Spell cast only in battleground if ((m_spellInfo->AttributesEx3 & SPELL_ATTR3_BATTLEGROUND) && m_caster->GetTypeId() == TYPEID_PLAYER) if (!m_caster->ToPlayer()->InBattleground()) return SPELL_FAILED_ONLY_BATTLEGROUNDS; @@ -5501,7 +5501,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (!m_targets.GetUnitTarget()) return SPELL_FAILED_BAD_IMPLICIT_TARGETS; - // can be casted at non-friendly unit or own pet/charm + // can be cast at non-friendly unit or own pet/charm if (m_caster->IsFriendlyTo(m_targets.GetUnitTarget())) return SPELL_FAILED_TARGET_FRIENDLY; @@ -5729,7 +5729,7 @@ SpellCastResult Spell::CheckCasterAuras() const } } } - // You are prevented from casting and the spell casted does not grant immunity. Return a failed error. + // You are prevented from casting and the spell cast does not grant immunity. Return a failed error. else return prevented_reason; } @@ -6665,11 +6665,11 @@ bool SpellEvent::Execute(uint64 e_time, uint32 p_time) /* if (m_Spell->m_spellInfo->IsChanneled()) { - // evented channeled spell is processed separately, casted once after delay, and not destroyed till finish + // evented channeled spell is processed separately, cast once after delay, and not destroyed till finish // check, if we have casting anything else except this channeled spell and autorepeat - if (m_Spell->GetCaster()->IsNonMeleeSpellCasted(false, true, true)) + if (m_Spell->GetCaster()->IsNonMeleeSpellCast(false, true, true)) { - // another non-melee non-delayed spell is casted now, abort + // another non-melee non-delayed spell is cast now, abort m_Spell->cancel(); } else @@ -6898,7 +6898,7 @@ SpellCastResult Spell::CanOpenLock(uint32 effIndex, uint32 lockId, SkillType& sk 0 : m_caster->ToPlayer()->GetSkillValue(skillId); // skill bonus provided by casting spell (mostly item spells) - // add the effect base points modifier from the spell casted (cheat lock / skeleton key etc.) + // add the effect base points modifier from the spell cast (cheat lock / skeleton key etc.) if (m_spellInfo->Effects[effIndex].TargetA.GetTarget() == TARGET_GAMEOBJECT_ITEM_TARGET || m_spellInfo->Effects[effIndex].TargetB.GetTarget() == TARGET_GAMEOBJECT_ITEM_TARGET) skillValue += m_spellInfo->Effects[effIndex].CalcValue(); @@ -7199,7 +7199,7 @@ bool Spell::CheckScriptEffectImplicitTargets(uint32 effIndex, uint32 effIndexToC bool Spell::CanExecuteTriggersOnHit(uint8 effMask, SpellInfo const* triggeredByAura) const { bool only_on_caster = (triggeredByAura && (triggeredByAura->AttributesEx4 & SPELL_ATTR4_PROC_ONLY_ON_CASTER)); - // If triggeredByAura has SPELL_ATTR4_PROC_ONLY_ON_CASTER then it can only proc on a casted spell with TARGET_UNIT_CASTER + // If triggeredByAura has SPELL_ATTR4_PROC_ONLY_ON_CASTER then it can only proc on a cast spell with TARGET_UNIT_CASTER for (uint8 i = 0;i < MAX_SPELL_EFFECTS; ++i) { if ((effMask & (1 << i)) && (!only_on_caster || (m_spellInfo->Effects[i].TargetA.GetTarget() == TARGET_UNIT_CASTER))) @@ -7289,7 +7289,7 @@ void Spell::TriggerGlobalCooldown() return; // Global cooldown can't leave range 1..1.5 secs - // There are some spells (mostly not casted directly by player) that have < 1 sec and > 1.5 sec global cooldowns + // There are some spells (mostly not cast directly by player) that have < 1 sec and > 1.5 sec global cooldowns // but as tests show are not affected by any spell mods. if (m_spellInfo->StartRecoveryTime >= MIN_GCD && m_spellInfo->StartRecoveryTime <= MAX_GCD) { diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 927ecd32f29..6fc0c9b749d 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -209,7 +209,7 @@ enum SpellEffectHandleMode class Spell { - friend void Unit::SetCurrentCastedSpell(Spell* pSpell); + friend void Unit::SetCurrentCastSpell(Spell* pSpell); friend class SpellScript; public: diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index d6a43e89494..90334281a8a 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -4901,8 +4901,8 @@ void Spell::EffectKnockBack(SpellEffIndex effIndex) if (unitTarget->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED)) return; - // Instantly interrupt non melee spells being casted - if (unitTarget->IsNonMeleeSpellCasted(true)) + // Instantly interrupt non melee spells being cast + if (unitTarget->IsNonMeleeSpellCast(true)) unitTarget->InterruptNonMeleeSpells(true); float ratio = 0.1f; diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 6b54df27596..bd10f484f64 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1311,10 +1311,10 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const uint32 stanceMask = (form ? 1 << (form - 1) : 0); - if (stanceMask & StancesNot) // can explicitly not be casted in this stance + if (stanceMask & StancesNot) // can explicitly not be cast in this stance return SPELL_FAILED_NOT_SHAPESHIFT; - if (stanceMask & Stances) // can explicitly be casted in this stance + if (stanceMask & Stances) // can explicitly be cast in this stance return SPELL_CAST_OK; bool actAsShifted = false; @@ -2518,12 +2518,12 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const case SPELL_AURA_PREVENT_RESURRECTION: return false; case SPELL_AURA_PERIODIC_DAMAGE: // used in positive spells also. - // part of negative spell if casted at self (prevent cancel) + // part of negative spell if cast at self (prevent cancel) if (Effects[effIndex].TargetA.GetTarget() == TARGET_UNIT_CASTER) return false; break; case SPELL_AURA_MOD_DECREASE_SPEED: // used in positive spells also - // part of positive spell if casted at self + // part of positive spell if cast at self if (Effects[effIndex].TargetA.GetTarget() != TARGET_UNIT_CASTER) return false; // but not this if this first effect (didn't find better check) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 730f89a7b6b..ff9c57d8521 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1534,8 +1534,8 @@ void SpellMgr::LoadSpellLearnSpells() if (!GetSpellInfo(dbc_node.spell)) continue; - // talent or passive spells or skill-step spells auto-casted and not need dependent learning, - // pet teaching spells must not be dependent learning (casted) + // talent or passive spells or skill-step spells auto-cast and not need dependent learning, + // pet teaching spells must not be dependent learning (cast) // other required explicit dependent learning dbc_node.autoLearned = entry->Effects[i].TargetA.GetTarget() == TARGET_UNIT_PET || GetTalentSpellCost(spell) > 0 || entry->IsPassive() || entry->HasEffect(SPELL_EFFECT_SKILL_STEP); @@ -3719,7 +3719,7 @@ void SpellMgr::LoadSpellInfoCorrections() break; // This would never crit on retail and it has attribute for SPELL_ATTR3_NO_DONE_BONUS because is handled from player, // until someone figures how to make scions not critting without hack and without making them main casters this should stay here. - case 63934: // Arcane Barrage (casted by players and NONMELEEDAMAGELOG with caster Scion of Eternity (original caster)). + case 63934: // Arcane Barrage (cast by players and NONMELEEDAMAGELOG with caster Scion of Eternity (original caster)). spellInfo->AttributesEx2 |= SPELL_ATTR2_CANT_CRIT; break; // ENDOF EYE OF ETERNITY SPELLS diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index 0d5643bc50c..4c25adb0476 100644 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -775,11 +775,11 @@ class AuraScript : public _SpellScript // returns spellid of the spell uint32 GetId() const; - // returns guid of object which casted the aura (m_originalCaster of the Spell class) + // returns guid of object which cast the aura (m_originalCaster of the Spell class) uint64 GetCasterGUID() const; - // returns unit which casted the aura or NULL if not avalible (caster logged out for example) + // returns unit which cast the aura or NULL if not avalible (caster logged out for example) Unit* GetCaster() const; - // returns object on which aura was casted, target for non-area auras, area aura source for area auras + // returns object on which aura was cast, target for non-area auras, area aura source for area auras WorldObject* GetOwner() const; // returns owner if it's unit or unit derived object, NULL otherwise (only for persistent area auras NULL is returned) Unit* GetUnitOwner() const; diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 019a962c4b1..3eba91cdab5 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -2280,7 +2280,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); diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp index 83e65d2f01f..cdae7a88387 100644 --- a/src/server/scripts/Commands/cs_quest.cpp +++ b/src/server/scripts/Commands/cs_quest.cpp @@ -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]; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp index 25f93a2b6b7..dcf5ef56848 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp @@ -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; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp index f80ff5b6028..7111056cc69 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp @@ -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; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index 7c6cdd4cb3e..9f7db5813d4 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -569,7 +569,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()) diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp index 2d3fabb810b..2036d083f6b 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp @@ -305,7 +305,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 +486,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 diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp index c8ab4a147ff..af78b250ae1 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp @@ -1068,7 +1068,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) diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp index 849713d72bf..d2dbc85f52a 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp @@ -271,7 +271,7 @@ public: if (FelExplosionTimer <= diff) { - if (!me->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCast(false)) { DoCast(me, SPELL_FEL_EXPLOSION); FelExplosionTimer = 2000; diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp index 694fdf9d84e..7389d9afbff 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp @@ -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); diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp index 6f028e33726..274be80b7b0 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp @@ -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) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp index 40fe93155a5..e4974ef7eb0 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp @@ -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); diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp index 46680730f7e..ea624576dbc 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp @@ -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; diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp index 403416bb202..6e71729ab50 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp @@ -145,7 +145,7 @@ public: me->SetHealth(0); - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(false); me->ClearComboPointHolders(); @@ -313,7 +313,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); diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp index 88f95df69c4..0f3929bda36 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp @@ -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) { diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp index 5847f7b132b..951cb8e2659 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp @@ -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 diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp index 37dda5a969a..d80196f79ee 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp @@ -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())) diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp index 80b4b98b0a4..a52c008a16c 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp @@ -404,7 +404,7 @@ public: events.Update(diff); - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) return; if (phase == PHASE_GROUND) diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index b3982200a10..5db7e182ea1 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -710,7 +710,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 +718,7 @@ public: } break; case TIMER_LEGION_LIGHTNING: - if (!me->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCast(false)) { Unit* pRandomPlayer = NULL; @@ -740,7 +740,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 +760,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 +774,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) diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp index 830942ae2c3..8ab31cc08fa 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp @@ -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(); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp index 39ee2d6923a..594cc3d2918 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp @@ -266,7 +266,7 @@ class boss_halazzi : public CreatureScript { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) { - if (target->IsNonMeleeSpellCasted(false)) + if (target->IsNonMeleeSpellCast(false)) DoCast(target, SPELL_EARTHSHOCK); else DoCast(target, SPELL_FLAMESHOCK); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index e429f27aa48..cc5acbf8ab3 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -324,7 +324,7 @@ class boss_janalai : public CreatureScript { if (isFlameBreathing) { - if (!me->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCast(false)) isFlameBreathing = false; else return; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp index 6281bcef5df..ef47fa8877a 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp @@ -246,7 +246,7 @@ class boss_zuljin : public CreatureScript void DoMeleeAttackIfReady() { - if (!me->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCast(false)) { if (me->isAttackReady() && me->IsWithinMeleeRange(me->GetVictim())) { diff --git a/src/server/scripts/Examples/example_spell.cpp b/src/server/scripts/Examples/example_spell.cpp index 2c76d9a40b0..af028d539f0 100644 --- a/src/server/scripts/Examples/example_spell.cpp +++ b/src/server/scripts/Examples/example_spell.cpp @@ -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; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index 6d73485d98b..0b84911bb96 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -858,7 +858,7 @@ void hyjalAI::UpdateAI(uint32 diff) { if (SpellTimer[i] <= diff) { - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(false); Unit* target = NULL; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp index 3e650bf4fe9..5cbe76671a4 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp @@ -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); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp index cc3cf8192dc..4fa7e007a7c 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp @@ -358,7 +358,7 @@ public: TimeRiftWave_Timer = 15000; } else TimeRiftWave_Timer -= diff; - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) return; TC_LOG_DEBUG("scripts", "npc_time_rift: not casting anylonger, i need to die."); diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp index 79421ffe37e..f16441ba72b 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp @@ -404,7 +404,7 @@ public: case EVENT_DEEP_BREATH: // Phase PHASE_BREATH if (!IsMoving) { - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(false); Talk(EMOTE_BREATH); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp index 8dd009cdb32..63d43dcfb4b 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp @@ -32,7 +32,7 @@ enum Spells SPELL_CLEAVE = 26350, SPELL_TOXIC_VOLLEY = 25812, SPELL_POISON_CLOUD = 38718, //Only Spell with right dmg. - SPELL_ENRAGE = 34624, //Changed cause 25790 is casted on gamers too. Same prob with old explosion of twin emperors. + SPELL_ENRAGE = 34624, //Changed cause 25790 is cast on gamers too. Same prob with old explosion of twin emperors. SPELL_CHARGE = 26561, SPELL_KNOCKBACK = 26027, diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp index a3edd9ad83d..f640173efb2 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp @@ -160,7 +160,7 @@ public: //If she is 20% enrage if (!Enraged) { - if (!HealthAbovePct(20) && !me->IsNonMeleeSpellCasted(false)) + if (!HealthAbovePct(20) && !me->IsNonMeleeSpellCast(false)) { DoCast(me, SPELL_ENRAGE); Enraged = true; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index 1d888f3ce8b..76665f649b3 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -80,7 +80,7 @@ struct boss_twinemperorsAI : public ScriptedAI uint32 AfterTeleportTimer; bool DontYellWhenDead; uint32 Abuse_Bug_Timer, BugsTimer; - bool tspellcasted; + bool tspellcast; uint32 EnrageTimer; virtual bool IAmVeklor() = 0; @@ -92,7 +92,7 @@ struct boss_twinemperorsAI : public ScriptedAI Heal_Timer = 0; // first heal immediately when they get close together Teleport_Timer = TELEPORTTIME; AfterTeleport = false; - tspellcasted = false; + tspellcast = false; AfterTeleportTimer = 0; Abuse_Bug_Timer = urand(10000, 17000); BugsTimer = 2000; @@ -243,21 +243,21 @@ struct boss_twinemperorsAI : public ScriptedAI me->AddUnitState(UNIT_STATE_STUNNED); AfterTeleport = true; AfterTeleportTimer = 2000; - tspellcasted = false; + tspellcast = false; } bool TryActivateAfterTTelep(uint32 diff) { if (AfterTeleport) { - if (!tspellcasted) + if (!tspellcast) { me->ClearUnitState(UNIT_STATE_STUNNED); DoCast(me, SPELL_TWIN_TELEPORT); me->AddUnitState(UNIT_STATE_STUNNED); } - tspellcasted = true; + tspellcast = true; if (AfterTeleportTimer <= diff) { @@ -378,7 +378,7 @@ struct boss_twinemperorsAI : public ScriptedAI { if (EnrageTimer <= diff) { - if (!me->IsNonMeleeSpellCasted(true)) + if (!me->IsNonMeleeSpellCast(true)) { DoCast(me, SPELL_BERSERK); EnrageTimer = 60*60000; diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp index e8e815db5d4..a5997dc4cf8 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp @@ -33,7 +33,7 @@ enum Spells SPELL_MIND_FLAY = 57941, SPELL_SHADOW_BOLT_VOLLEY = 57942, SPELL_SHIVER = 57949, - SPELL_CLONE_PLAYER = 57507, //casted on player during insanity + SPELL_CLONE_PLAYER = 57507, //cast on player during insanity SPELL_INSANITY_PHASING_1 = 57508, SPELL_INSANITY_PHASING_2 = 57509, SPELL_INSANITY_PHASING_3 = 57510, diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp index a68a122bc31..fcd4d4d73b3 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp @@ -528,8 +528,8 @@ public: instance = creature->GetInstanceScript(); bRemoved = false; bRemoved2 = false; - bCasted = false; - bCasted2 = false; + bCast = false; + bCast2 = false; SetCombatMovement(false); } @@ -538,8 +538,8 @@ public: bool bRemoved; bool bRemoved2; - bool bCasted; - bool bCasted2; + bool bCast; + bool bCast2; void Reset() OVERRIDE { } void EnterCombat(Unit* /*who*/) OVERRIDE { } @@ -560,23 +560,23 @@ public: bRemoved = true; return; } - if (!bCasted) + if (!bCast) { DoCast(me, SPELL_BEAM_VISUAL_JEDOGAS_AUFSEHER_1, false); - bCasted = true; + bCast = true; } } if (!bRemoved2 && me->GetPositionX() < 440.0f) { - if (!bCasted2 && instance->GetData(DATA_JEDOGA_TRIGGER_SWITCH)) + if (!bCast2 && instance->GetData(DATA_JEDOGA_TRIGGER_SWITCH)) { DoCast(me, SPELL_BEAM_VISUAL_JEDOGAS_AUFSEHER_2, false); - bCasted2 = true; + bCast2 = true; } - if (bCasted2 && !instance->GetData(DATA_JEDOGA_TRIGGER_SWITCH)) + if (bCast2 && !instance->GetData(DATA_JEDOGA_TRIGGER_SWITCH)) { me->InterruptNonMeleeSpells(true); - bCasted2 = false; + bCast2 = false; } if (!bRemoved2 && instance->GetBossState(DATA_JEDOGA_SHADOWSEEKER) == DONE) { diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp index 8375fb7f0a8..9c5415375b7 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp @@ -45,7 +45,7 @@ enum Enums SPELL_TAIL_LASH = 56910, // A sweeping tail strike hits all enemies behind the caster, inflicting 3063 to 3937 damage and stunning them for 2 sec. SPELL_TAIL_LASH_H = 58957, // A sweeping tail strike hits all enemies behind the caster, inflicting 4375 to 5625 damage and stunning them for 2 sec. SPELL_WILL_OF_SARTHARION = 61254, // Sartharion's presence bolsters the resolve of the Twilight Drakes, increasing their total health by 25%. This effect also increases Sartharion's health by 25%. - SPELL_LAVA_STRIKE = 57571, // (Real spell casted should be 57578) 57571 then trigger visual missile, then summon Lava Blaze on impact(spell 57572) + SPELL_LAVA_STRIKE = 57571, // (Real spell cast should be 57578) 57571 then trigger visual missile, then summon Lava Blaze on impact(spell 57572) SPELL_TWILIGHT_REVENGE = 60639, NPC_FIRE_CYCLONE = 30648, diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp index 7843808a6a3..5b90676fffc 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -873,7 +873,7 @@ class boss_icehowl : public CreatureScript events.ScheduleEvent(EVENT_MASSIVE_CRASH, 30*IN_MILLISECONDS); _movementStarted = false; _movementFinish = false; - _trampleCasted = false; + _trampleCast = false; _trampleTargetGUID = 0; _trampleTargetX = 0; _trampleTargetY = 0; @@ -961,10 +961,10 @@ class boss_icehowl : public CreatureScript { if (spell->Id == SPELL_TRAMPLE && target->GetTypeId() == TYPEID_PLAYER) { - if (!_trampleCasted) + if (!_trampleCast) { DoCast(me, SPELL_FROTHING_RAGE, true); - _trampleCasted = true; + _trampleCast = true; } } } @@ -1025,7 +1025,7 @@ class boss_icehowl : public CreatureScript me->AttackStop(); _trampleTargetGUID = target->GetGUID(); me->SetTarget(_trampleTargetGUID); - _trampleCasted = false; + _trampleCast = false; SetCombatMovement(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE); me->GetMotionMaster()->Clear(); @@ -1047,7 +1047,7 @@ class boss_icehowl : public CreatureScript { me->StopMoving(); me->AttackStop(); - _trampleCasted = false; + _trampleCast = false; _movementStarted = true; _trampleTargetX = target->GetPositionX(); _trampleTargetY = target->GetPositionY(); @@ -1100,7 +1100,7 @@ class boss_icehowl : public CreatureScript } break; case 6: - if (!_trampleCasted) + if (!_trampleCast) { DoCast(me, SPELL_STAGGERED_DAZE); Talk(EMOTE_TRAMPLE_CRASH); @@ -1131,7 +1131,7 @@ class boss_icehowl : public CreatureScript uint64 _trampleTargetGUID; bool _movementStarted; bool _movementFinish; - bool _trampleCasted; + bool _trampleCast; uint8 _stage; }; diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_king_dred.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_king_dred.cpp index f8f0752184e..42f408861e1 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_king_dred.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_king_dred.cpp @@ -27,7 +27,7 @@ enum Spells { SPELL_BELLOWING_ROAR = 22686, // fears the group, can be resisted/dispelled SPELL_GRIEVOUS_BITE = 48920, - SPELL_MANGLING_SLASH = 48873, // casted on the current tank, adds debuf + SPELL_MANGLING_SLASH = 48873, // cast on the current tank, adds debuf SPELL_FEARSOME_ROAR = 48849, SPELL_PIERCING_SLASH = 48878, // debuff --> Armor reduced by 75% SPELL_RAPTOR_CALL = 59416, // dummy diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp index efca060b67c..78399749fe6 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp @@ -32,7 +32,7 @@ enum Spells SPELL_CURSE_OF_LIFE = 49527, SPELL_RAIN_OF_FIRE = 49518, SPELL_SHADOW_VOLLEY = 49528, - SPELL_DECAY_FLESH = 49356, // casted at end of phase 1, starts phase 2 + SPELL_DECAY_FLESH = 49356, // cast at end of phase 1, starts phase 2 // Flesh Spells (phase 2) SPELL_GIFT_OF_THARON_JA = 52509, SPELL_CLEAR_GIFT_OF_THARON_JA = 53242, diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index cdcd8ed796a..92c97ce6abf 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -739,7 +739,7 @@ class npc_putricide_oozeAI : public ScriptedAI if (!UpdateVictim() && !_newTargetSelectTimer) return; - if (!_newTargetSelectTimer && !me->IsNonMeleeSpellCasted(false, false, true, false, true)) + if (!_newTargetSelectTimer && !me->IsNonMeleeSpellCast(false, false, true, false, true)) _newTargetSelectTimer = 1000; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 2f2aa3b0b5c..d113daa4954 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -106,8 +106,8 @@ enum Spells SPELL_ARCANE_STORM_P_I = 61693, SPELL_VORTEX_1 = 56237, // seems that frezze object animation SPELL_VORTEX_2 = 55873, // visual effect - SPELL_VORTEX_3 = 56105, // this spell must handle all the script - casted by the boss and to himself - SPELL_VORTEX_6 = 73040, // teleport - (casted to all raid), caster vortex bunnies, targets players. + SPELL_VORTEX_3 = 56105, // this spell must handle all the script - cast by the boss and to himself + SPELL_VORTEX_6 = 73040, // teleport - (cast to all raid), caster vortex bunnies, targets players. // Phase II SPELL_TELEPORT_VISUAL_ONLY = 41232, // Light blue animation cast by arcane NPCs when spawned on Hover Disks @@ -117,7 +117,7 @@ enum Spells SPELL_SUMMON_ARCANE_BOMB = 56429, SPELL_ARCANE_BOMB_TRIGGER = 56430, SPELL_ARCANE_BOMB_KNOCKBACK_DAMAGE = 56431, - SPELL_ARCANE_OVERLOAD_1 = 56432, // casted by npc Arcane Overload ID: 30282 + SPELL_ARCANE_OVERLOAD_1 = 56432, // cast by npc Arcane Overload ID: 30282 // SPELL_ARCANE_OVERLOAD_2 = 56435, // Triggered by 56432 - resizing target // SPELL_ARCANE_OVERLOAD_3 = 56438, // Triggered by 56432 - damage reduction SPELL_SURGE_OF_POWER_P_II = 56505, @@ -1907,7 +1907,7 @@ class spell_malygos_vortex_visual : public SpellScriptLoader if (InstanceScript* instance = caster->GetInstanceScript()) { - // Teleport spell - I'm not sure but might be it must be casted by each vehicle when it's passenger leaves it. + // Teleport spell - I'm not sure but might be it must be cast by each vehicle when it's passenger leaves it. if (Creature* trigger = caster->GetMap()->GetCreature(instance->GetData64(DATA_TRIGGER))) trigger->CastSpell(targetPlayer, SPELL_VORTEX_6, true); } diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp index 875ddf8c9da..1f7d47ccc31 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp @@ -166,7 +166,7 @@ class boss_eregos : public CreatureScript if (summon->GetEntry() != NPC_PLANAR_ANOMALY) return; - /// @todo: See why the spell is not casted + /// @todo: See why the spell is not cast summon->CastSpell(summon, SPELL_PLANAR_BLAST, true); } diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp index f7c558879d1..db1bb342286 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp @@ -248,7 +248,7 @@ class boss_urom : public CreatureScript arcaneExplosionTimer -= diff; } - if (!me->IsNonMeleeSpellCasted(false, true, true)) + if (!me->IsNonMeleeSpellCast(false, true, true)) { if (frostBombTimer <= diff) { diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp index 944eacda34e..7d1f2d86b18 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp @@ -245,7 +245,7 @@ public: if (m_uiChangeStance_Timer <= uiDiff) { //wait for current spell to finish before change stance - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) return; DoRemoveStanceAura(m_uiStance); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp index af89c7815ba..68116452082 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp @@ -279,7 +279,7 @@ public: Talk(SAY_SPLIT); - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(false); DoCast(me, SPELL_DISPERSE, false); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp index 5cd17a2c8d2..8f231457619 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp @@ -287,7 +287,7 @@ public: { ++m_uiHealthAmountModifier; - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(false); Talk(SAY_FORGE); @@ -412,7 +412,7 @@ public: me->AttackStop(); // me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); //Set in DB // me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //Set in DB - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(false); if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) me->GetMotionMaster()->MovementExpired(); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index 549d496f19d..e8f8e7684c2 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -433,7 +433,7 @@ class boss_freya : public CreatureScript case EVENT_STRENGTHENED_IRON_ROOTS: Talk(EMOTE_IRON_ROOTS); if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, -SPELL_ROOTS_FREYA)) - target->CastSpell(target, SPELL_ROOTS_FREYA, true); // This must be casted by Target self + target->CastSpell(target, SPELL_ROOTS_FREYA, true); // This must be cast by Target self events.ScheduleEvent(EVENT_STRENGTHENED_IRON_ROOTS, urand(12000, 20000)); break; case EVENT_GROUND_TREMOR: diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp index 12925f1c6e1..3997a484323 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp @@ -232,7 +232,7 @@ class boss_xt002 : public CreatureScript events.ScheduleEvent(EVENT_ENRAGE, TIMER_ENRAGE); events.ScheduleEvent(EVENT_GRAVITY_BOMB, TIMER_GRAVITY_BOMB); events.ScheduleEvent(EVENT_SEARING_LIGHT, TIMER_SEARING_LIGHT); - //Tantrum is casted a bit slower the first time. + //Tantrum is cast a bit slower the first time. events.ScheduleEvent(EVENT_TYMPANIC_TANTRUM, urand(TIMER_TYMPANIC_TANTRUM_MIN, TIMER_TYMPANIC_TANTRUM_MAX) * 2); if (!instance) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp index 575ab574140..96a2a52714a 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp @@ -108,7 +108,7 @@ enum Spells SPELL_SANITY = 63050, SPELL_INSANE_PERIODIC = 64554, SPELL_INSANE = 63120, - //SPELL_CLEAR_INSANE = 63122, // when it should be casted? + //SPELL_CLEAR_INSANE = 63122, // when should it be cast? SPELL_CONSTRICTOR_TENTACLE = 64132, SPELL_CRUSHER_TENTACLE_SUMMON = 64139, SPELL_CORRUPTOR_TENTACLE_SUMMON = 64143, @@ -799,7 +799,7 @@ class boss_sara : public CreatureScript DoCast(yogg, SPELL_RIDE_YOGG_SARON_VEHICLE); DoCast(me, SPELL_SHADOWY_BARRIER_SARA); _events.SetPhase(PHASE_TWO); - _events.ScheduleEvent(EVENT_DEATH_RAY, 20000, 0, PHASE_TWO); // almost never casted at scheduled time, why? + _events.ScheduleEvent(EVENT_DEATH_RAY, 20000, 0, PHASE_TWO); // almost never cast at scheduled time, why? _events.ScheduleEvent(EVENT_MALADY_OF_THE_MIND, 18000, 0, PHASE_TWO); _events.ScheduleEvent(EVENT_PSYCHOSIS, 1, 0, PHASE_TWO); _events.ScheduleEvent(EVENT_BRAIN_LINK, 23000, 0, PHASE_TWO); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp index 6465864f94c..68f59419998 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp @@ -212,7 +212,7 @@ class boss_keleseth : public CreatureScript void SummonSkeletons() { - // I could not found any spell casted for this + // I could not found any spell cast for this for (uint8 i = 0; i < 4; ++i) me->SummonCreature(NPC_SKELETON, SkeletonSpawnPoint[0][0], SkeletonSpawnPoint[0][1], SKELETONSPAWN_Z, 0); } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp index 5247f9019da..42fa0242df2 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp @@ -358,7 +358,7 @@ class boss_dalronn_the_controller : public CreatureScript if (ShadowBolt_Timer <= diff) { - if (!me->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCast(false)) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true)) DoCast(target, SPELL_SHADOW_BOLT); @@ -370,7 +370,7 @@ class boss_dalronn_the_controller : public CreatureScript if (Debilitate_Timer <= diff) { - if (!me->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCast(false)) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true)) DoCast(target, SPELL_DEBILITATE); @@ -384,7 +384,7 @@ class boss_dalronn_the_controller : public CreatureScript { if (Summon_Timer <= diff) { - if (!me->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCast(false)) { DoCast(me, H_SPELL_SUMMON_SKELETONS); Summon_Timer = (rand()%10000) + 20000; diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index 12d25045a92..6fdbea2086d 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -133,7 +133,7 @@ enum Spells { // Skadi Spells SPELL_CRUSH = 50234, - SPELL_POISONED_SPEAR = 50225, //isn't being casted =/ + SPELL_POISONED_SPEAR = 50225, //isn't being cast SPELL_WHIRLWIND = 50228, //random target, but not the tank approx. every 20s SPELL_RAPID_FIRE = 56570, SPELL_HARPOON_DAMAGE = 56578, diff --git a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp index 4ff0f2d36e9..3e16f38001b 100644 --- a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp @@ -160,7 +160,7 @@ public: bool bActive; bool bWiped; - bool bIsDoorSpellCasted; + bool bIsDoorSpellCast; bool bCrystalActivated; bool defenseless; @@ -210,7 +210,7 @@ public: uiCyanigosaEventTimer = 3*IN_MILLISECONDS; bActive = false; - bIsDoorSpellCasted = false; + bIsDoorSpellCast = false; bCrystalActivated = false; defenseless = true; uiMainEventPhase = NOT_STARTED; diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp index c78a1ee1740..6897153c44d 100644 --- a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp @@ -649,7 +649,7 @@ public: uiSpawnTimer = SPAWN_TIME; } else uiSpawnTimer -= diff; - if (bPortalGuardianOrKeeperOrEliteSpawn && !me->IsNonMeleeSpellCasted(false)) + if (bPortalGuardianOrKeeperOrEliteSpawn && !me->IsNonMeleeSpellCast(false)) { me->Kill(me, false); me->RemoveCorpse(); diff --git a/src/server/scripts/Northrend/zone_crystalsong_forest.cpp b/src/server/scripts/Northrend/zone_crystalsong_forest.cpp index 5c4efcc2430..4c45bed1af8 100644 --- a/src/server/scripts/Northrend/zone_crystalsong_forest.cpp +++ b/src/server/scripts/Northrend/zone_crystalsong_forest.cpp @@ -65,7 +65,7 @@ public: void UpdateAI(uint32 /*diff*/) OVERRIDE { - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) return; if (me->GetEntry() == NPC_WARMAGE_SARINA) diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp index 5f3442c1ba9..9673fef0a1e 100644 --- a/src/server/scripts/Northrend/zone_dragonblight.cpp +++ b/src/server/scripts/Northrend/zone_dragonblight.cpp @@ -517,7 +517,7 @@ enum WyrmDefenderEnum // Spells data SPELL_CHARACTER_SCRIPT = 49213, SPELL_DEFENDER_ON_LOW_HEALTH_EMOTE = 52421, // ID - 52421 Wyrmrest Defender: On Low Health Boss Emote to Controller - Random /self/ - SPELL_RENEW = 49263, // casted to heal drakes + SPELL_RENEW = 49263, // cast to heal drakes SPELL_WYRMREST_DEFENDER_MOUNT = 49256, // Texts data diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp index 783e7b9f09b..9b96255fde0 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp @@ -250,7 +250,7 @@ public: if (!Avatar_summoned && HealthBelowPct(25)) { - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(true); Talk(SAY_SUMMON); @@ -266,7 +266,7 @@ public: { if (target->GetTypeId() == TYPEID_PLAYER) { - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(true); Talk(SAY_ROAR); diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp index 862fe76decd..db69ca6c892 100644 --- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp +++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp @@ -170,7 +170,7 @@ public: if (FrostNova_Timer <= diff) { - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(true); DoCast(me, SPELL_FROSTNOVA); @@ -194,7 +194,7 @@ public: { if (Blink_Timer <= diff) { - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(true); //expire movement, will prevent from running right back to victim after cast @@ -210,7 +210,7 @@ public: if (Beacon_Timer <= diff) { - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(true); if (!urand(0, 3)) @@ -301,7 +301,7 @@ public: if (Apprentice_Timer <= diff) { - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(true); DoCast(me, SPELL_ETHEREAL_APPRENTICE, true); diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp index 3a845842934..6f2b05a73c0 100644 --- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp +++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp @@ -107,7 +107,7 @@ public: { if (DarkShell_Timer <= diff) { - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(true); Talk(EMOTE_DARK_SHELL); diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp index c077cec3c04..6adfdf7c885 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp @@ -115,7 +115,7 @@ public: { Talk(SAY_SUMMON); - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(false); DoCast(me, SPELL_SUMMON_SYTH_ARCANE, true); //front diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp index 022ac3e9e4d..217eb2ea004 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp @@ -167,7 +167,7 @@ public: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) { - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(false); //Spell doesn't work, but we use for visual effect at least diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index c9ccbb79ad0..46e5c5783e6 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -974,7 +974,7 @@ public: break; } - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) return; if (Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || (Phase == PHASE_NORMAL_MAIEV && !me->HasAura(SPELL_CAGED))) diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index 1d233aa6da4..e1d6955cd7d 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -831,12 +831,12 @@ public: InstanceScript* instance; uint32 CheckTimer; - bool Casted; + bool Cast; void Reset() OVERRIDE { CheckTimer = 0; - Casted = false; + Cast = false; me->SetDisplayId(11686); // invisible me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -857,10 +857,10 @@ public: if (vashj && vashj->IsAlive()) { // start visual channel - if (!Casted || !vashj->HasAura(SPELL_MAGIC_BARRIER)) + if (!Cast || !vashj->HasAura(SPELL_MAGIC_BARRIER)) { DoCast(vashj, SPELL_MAGIC_BARRIER, true); - Casted = true; + Cast = true; } } CheckTimer = 1000; diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp index f6bceb78a14..75ccc962996 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp @@ -115,7 +115,7 @@ class boss_kelidan_the_breaker : public CreatureScript void EnterCombat(Unit* who) OVERRIDE { Talk(SAY_WAKE); - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(true); DoStartMovement(who); if (instance) @@ -207,7 +207,7 @@ class boss_kelidan_the_breaker : public CreatureScript { if (check_Timer <= diff) { - if (!me->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCast(false)) DoCast(me, SPELL_EVOCATION); check_Timer = 5000; } @@ -248,7 +248,7 @@ class boss_kelidan_the_breaker : public CreatureScript if (BurningNova_Timer <= diff) { - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(true); Talk(SAY_NOVA); @@ -311,7 +311,7 @@ class npc_shadowmoon_channeler : public CreatureScript ShadowBolt_Timer = 1000+rand()%1000; MarkOfShadow_Timer = 5000+rand()%2000; check_Timer = 0; - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(true); } @@ -319,7 +319,7 @@ class npc_shadowmoon_channeler : public CreatureScript { if (Creature* Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) CAST_AI(boss_kelidan_the_breaker::boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerEngaged(who); - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(true); DoStartMovement(who); } @@ -336,7 +336,7 @@ class npc_shadowmoon_channeler : public CreatureScript { if (check_Timer <= diff) { - if (!me->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCast(false)) if (Creature* Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) { uint64 channeler = CAST_AI(boss_kelidan_the_breaker::boss_kelidan_the_breakerAI, Kelidan->AI())->GetChanneled(me); diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp index f4ee716dc67..44fcc7b8fe1 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp @@ -71,7 +71,7 @@ enum Spells SPELL_SHADOW_CAGE = 30168, SPELL_SHADOW_GRASP = 30410, SPELL_SHADOW_GRASP_VISUAL = 30166, - SPELL_MIND_EXHAUSTION = 44032, //Casted by the cubes when channeling ends + SPELL_MIND_EXHAUSTION = 44032, //Cast by the cubes when channeling ends SPELL_SHADOW_CAGE_C = 30205, SPELL_SHADOW_GRASP_C = 30207, SPELL_SHADOW_BOLT_VOLLEY = 30510, @@ -392,7 +392,7 @@ class boss_magtheridon : public CreatureScript if (Quake_Timer <= diff) { // to avoid blastnova interruption - if (!me->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCast(false)) { DoCast(me, SPELL_QUAKE_TRIGGER, true); Quake_Timer = 50000; @@ -421,7 +421,7 @@ class boss_magtheridon : public CreatureScript Blaze_Timer -= diff; if (!Phase3 && HealthBelowPct(30) - && !me->IsNonMeleeSpellCasted(false) // blast nova + && !me->IsNonMeleeSpellCast(false) // blast nova && !me->HasUnitState(UNIT_STATE_STUNNED)) // shadow cage and earthquake { Phase3 = true; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index 5d789359864..07401e1efbb 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -426,7 +426,7 @@ class boss_alar : public CreatureScript void DoMeleeAttackIfReady() { - if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false)) + if (me->isAttackReady() && !me->IsNonMeleeSpellCast(false)) { if (me->IsWithinMeleeRange(me->GetVictim())) { diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index e85c8781dd9..a6ff49d1e48 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -308,7 +308,7 @@ class boss_kaelthas : public CreatureScript uint32 Phase; uint32 PhaseSubphase; //generic uint32 Phase_Timer; //generic timer - uint32 PyrosCasted; + uint32 PyrosCast; bool InGravityLapse; bool IsCastingFireball; @@ -330,7 +330,7 @@ class boss_kaelthas : public CreatureScript GravityLapse_Phase = 0; NetherBeam_Timer = 8000; NetherVapor_Timer = 10000; - PyrosCasted = 0; + PyrosCast = 0; Phase = 0; InGravityLapse = false; IsCastingFireball = false; @@ -750,7 +750,7 @@ class boss_kaelthas : public CreatureScript { if (!IsCastingFireball) { - if (!me->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCast(false)) { //interruptable me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false); @@ -844,19 +844,19 @@ class boss_kaelthas : public CreatureScript { DoCast(me, SPELL_SHOCK_BARRIER); ChainPyros = true; - PyrosCasted = 0; + PyrosCast = 0; ShockBarrier_Timer = 60000; } else ShockBarrier_Timer -= diff; //Chain Pyros (3 of them max) - if (ChainPyros && !me->IsNonMeleeSpellCasted(false)) + if (ChainPyros && !me->IsNonMeleeSpellCast(false)) { - if (PyrosCasted < 3) + if (PyrosCast < 3) { DoCastVictim(SPELL_PYROBLAST); - ++PyrosCasted; + ++PyrosCast; } else { diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp index 0e3018d3f98..741b1378e4a 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp @@ -190,7 +190,7 @@ class npc_millhouse_manastorm : public CreatureScript if (Pyroblast_Timer <= diff) { - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) return; Talk(SAY_PYRO); diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp index 48d955acbc3..d590093de56 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp @@ -137,7 +137,7 @@ class boss_harbinger_skyriss : public CreatureScript void DoSplit(uint32 val) { - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(false); Talk(SAY_IMAGE); @@ -211,7 +211,7 @@ class boss_harbinger_skyriss : public CreatureScript if (Fear_Timer <= diff) { - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) return; Talk(SAY_FEAR); @@ -228,7 +228,7 @@ class boss_harbinger_skyriss : public CreatureScript if (Domination_Timer <= diff) { - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) return; Talk(SAY_MIND); @@ -247,7 +247,7 @@ class boss_harbinger_skyriss : public CreatureScript { if (ManaBurn_Timer <= diff) { - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) return; if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1)) diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp index 1b362fe8a5a..fe072b437eb 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp @@ -126,7 +126,7 @@ class boss_high_botanist_freywinn : public CreatureScript { Talk(SAY_TREE); - if (me->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(true); me->RemoveAllAuras(); diff --git a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp index a6daf3b420d..bb8bbe9215e 100644 --- a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp @@ -881,7 +881,7 @@ class npc_simon_bunny : public CreatureScript /* Called when AI is playing the sequence for player. We cast the visual spell and then remove the - casted color from the casting sequence. + cast color from the casting sequence. */ void PlayNextColor() { diff --git a/src/server/scripts/Pet/pet_mage.cpp b/src/server/scripts/Pet/pet_mage.cpp index 85247b29f84..7ac50f4313c 100644 --- a/src/server/scripts/Pet/pet_mage.cpp +++ b/src/server/scripts/Pet/pet_mage.cpp @@ -49,7 +49,7 @@ class npc_pet_mage_mirror_image : public CreatureScript // Inherit Master's Threat List (not yet implemented) owner->CastSpell((Unit*)NULL, SPELL_MAGE_MASTERS_THREAT_LIST, true); // here mirror image casts on summoner spell (not present in client dbc) 49866 - // here should be auras (not present in client dbc): 35657, 35658, 35659, 35660 selfcasted by mirror images (stats related?) + // here should be auras (not present in client dbc): 35657, 35658, 35659, 35660 selfcast by mirror images (stats related?) // Clone Me! owner->CastSpell(me, SPELL_MAGE_CLONE_ME, false); } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 98ed2c8b331..f2c3473d8c6 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -475,20 +475,20 @@ class spell_gen_bonked : public SpellScriptLoader + EFFECT_0: SCRIPT_EFFECT + EFFECT_1: NONE + EFFECT_2: NONE - - Spells casted by players triggered by script: + - Spells cast by players triggered by script: + EFFECT_0: SCHOOL_DAMAGE + EFFECT_1: SCRIPT_EFFECT + EFFECT_2: FORCE_CAST - - Spells casted by NPCs on players: + - Spells cast by NPCs on players: + EFFECT_0: SCHOOL_DAMAGE + EFFECT_1: SCRIPT_EFFECT + EFFECT_2: NONE In the following script we handle the SCRIPT_EFFECT for effIndex EFFECT_0 and EFFECT_1. - When handling EFFECT_0 we're in the "Spells on vehicle bar used by players" case - and we'll trigger "Spells casted by players triggered by script" - - When handling EFFECT_1 we're in the "Spells casted by players triggered by script" - or "Spells casted by NPCs on players" so we'll search for the first defend layer and drop it. + and we'll trigger "Spells cast by players triggered by script" + - When handling EFFECT_1 we're in the "Spells cast by players triggered by script" + or "Spells cast by NPCs on players" so we'll search for the first defend layer and drop it. */ enum BreakShieldSpells @@ -1193,7 +1193,7 @@ class spell_gen_defend : public SpellScriptLoader { SpellInfo const* spell = sSpellMgr->GetSpellInfo(m_scriptSpellId); - // Defend spells casted by NPCs (add visuals) + // Defend spells cast by NPCs (add visuals) if (spell->Effects[EFFECT_0].ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN) { AfterEffectApply += AuraEffectApplyFn(spell_gen_defend_AuraScript::RefreshVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); @@ -1204,7 +1204,7 @@ class spell_gen_defend : public SpellScriptLoader if (spell->Effects[EFFECT_2].ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN) OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend_AuraScript::RemoveDummyFromDriver, EFFECT_2, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL); - // Defend spells casted by players (add/remove visuals) + // Defend spells cast by players (add/remove visuals) if (spell->Effects[EFFECT_1].ApplyAuraName == SPELL_AURA_DUMMY) { AfterEffectApply += AuraEffectApplyFn(spell_gen_defend_AuraScript::RefreshVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); @@ -2039,15 +2039,15 @@ class spell_gen_mount : public SpellScriptLoader + EFFECT_0: SCRIPT_EFFECT + EFFECT_1: TRIGGER_SPELL + EFFECT_2: NONE - - Spells casted by player's mounts triggered by script: + - Spells cast by player's mounts triggered by script: + EFFECT_0: CHARGE + EFFECT_1: TRIGGER_SPELL + EFFECT_2: APPLY_AURA - - Spells casted by players on the target triggered by script: + - Spells cast by players on the target triggered by script: + EFFECT_0: SCHOOL_DAMAGE + EFFECT_1: SCRIPT_EFFECT + EFFECT_2: NONE - - Spells casted by NPCs on players: + - Spells cast by NPCs on players: + EFFECT_0: SCHOOL_DAMAGE + EFFECT_1: CHARGE + EFFECT_2: SCRIPT_EFFECT @@ -2055,12 +2055,12 @@ class spell_gen_mount : public SpellScriptLoader In the following script we handle the SCRIPT_EFFECT and CHARGE - When handling SCRIPT_EFFECT: + EFFECT_0: Corresponds to "Spells on vehicle bar used by players" and we make player's mount cast - the charge effect on the current target ("Spells casted by player's mounts triggered by script"). - + EFFECT_1 and EFFECT_2: Triggered when "Spells casted by player's mounts triggered by script" hits target, - corresponding to "Spells casted by players on the target triggered by script" and "Spells casted by + the charge effect on the current target ("Spells cast by player's mounts triggered by script"). + + EFFECT_1 and EFFECT_2: Triggered when "Spells cast by player's mounts triggered by script" hits target, + corresponding to "Spells cast by players on the target triggered by script" and "Spells cast by NPCs on players" and we check Defend layers and drop a charge of the first found. - When handling CHARGE: - + Only launched for "Spells casted by player's mounts triggered by script", makes the player cast the + + Only launched for "Spells cast by player's mounts triggered by script", makes the player cast the damaging spell on target with a small chance of failing it. */ diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 92a18a654d5..cfb43e8a3f8 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -1367,7 +1367,7 @@ class spell_q12372_destabilize_azure_dragonshrine_dummy : public SpellScriptLoad } }; -// ID - 50287 Azure Dragon: On Death Force Cast Wyrmrest Defender to Whisper to Controller - Random (casted from Azure Dragons and Azure Drakes on death) +// ID - 50287 Azure Dragon: On Death Force Cast Wyrmrest Defender to Whisper to Controller - Random (cast from Azure Dragons and Azure Drakes on death) class spell_q12372_azure_on_death_force_whisper : public SpellScriptLoader { public: diff --git a/src/server/scripts/World/guards.cpp b/src/server/scripts/World/guards.cpp index 5ba95dca199..b629fd06b32 100644 --- a/src/server/scripts/World/guards.cpp +++ b/src/server/scripts/World/guards.cpp @@ -106,7 +106,7 @@ public: return; // Make sure our attack is ready and we arn't currently casting - 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())) @@ -145,7 +145,7 @@ public: else { //Only run this code if we arn't already casting - if (!me->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCast(false)) { bool healing = false; SpellInfo const* info = NULL; diff --git a/src/server/scripts/World/mob_generic_creature.cpp b/src/server/scripts/World/mob_generic_creature.cpp index ed086712ca2..5cc9e68eb9b 100644 --- a/src/server/scripts/World/mob_generic_creature.cpp +++ b/src/server/scripts/World/mob_generic_creature.cpp @@ -93,7 +93,7 @@ public: if (me->IsWithinMeleeRange(me->GetVictim())) { //Make sure our attack is ready and we arn't currently casting - if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false)) + if (me->isAttackReady() && !me->IsNonMeleeSpellCast(false)) { bool Healing = false; SpellInfo const* info = NULL; @@ -124,7 +124,7 @@ public: else { //Only run this code if we arn't already casting - if (!me->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCast(false)) { bool Healing = false; SpellInfo const* info = NULL; diff --git a/src/server/shared/Database/Field.cpp b/src/server/shared/Database/Field.cpp index 51d918e716e..87151f7a9be 100644 --- a/src/server/shared/Database/Field.cpp +++ b/src/server/shared/Database/Field.cpp @@ -35,7 +35,7 @@ void Field::SetByteValue(const void* newValue, const size_t newSize, enum_field_ if (data.value) CleanUp(); - // This value stores raw bytes that have to be explicitly casted later + // This value stores raw bytes that have to be explicitly cast later if (newValue) { data.value = new char[newSize]; -- cgit v1.2.3 From 01a43e6a300a0321bf11082f2eecfb0e8ecc2e1b Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 25 Dec 2013 14:31:28 -0330 Subject: Core/QuestDef: Well I clicked revert but Git didn't play along. --- src/server/game/Quests/QuestDef.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index 7c0db146a4a..f763777fe15 100644 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -109,15 +109,15 @@ enum QuestStatus enum QuestGiverStatus { DIALOG_STATUS_NONE = 0, - DIALOG_STATUS_UNAVAILABLE = 2, - DIALOG_STATUS_LOW_LEVEL_AVAILABLE = 3, - DIALOG_STATUS_LOW_LEVEL_REWARD_REP = 4, - DIALOG_STATUS_LOW_LEVEL_AVAILABLE_REP = 5, - DIALOG_STATUS_INCOMPLETE = 6, - DIALOG_STATUS_REWARD_REP = 7, - DIALOG_STATUS_AVAILABLE_REP = 8, - DIALOG_STATUS_AVAILABLE = 9, - DIALOG_STATUS_REWARD2 = 10, // no yellow dot on minimap + DIALOG_STATUS_UNAVAILABLE = 1, + DIALOG_STATUS_LOW_LEVEL_AVAILABLE = 2, + DIALOG_STATUS_LOW_LEVEL_REWARD_REP = 3, + DIALOG_STATUS_LOW_LEVEL_AVAILABLE_REP = 4, + DIALOG_STATUS_INCOMPLETE = 5, + DIALOG_STATUS_REWARD_REP = 6, + DIALOG_STATUS_AVAILABLE_REP = 7, + DIALOG_STATUS_AVAILABLE = 8, + DIALOG_STATUS_REWARD2 = 9, // no yellow dot on minimap DIALOG_STATUS_REWARD = 10, // yellow dot on minimap // Custom value meaning that script call did not return any valid quest status -- cgit v1.2.3 From e255d1d37667f21612f9fcf0c14a23b2bb2f0e9b Mon Sep 17 00:00:00 2001 From: jackpoz Date: Wed, 25 Dec 2013 22:52:35 +0100 Subject: Core/Transports: Fix possible crash Fix a crash happening when deleting an instance with transports. This case doesn't appear in current sources but could have happened in ICC and HoR. --- src/server/game/Maps/Map.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index b57b50dd422..5b22940670f 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -63,15 +63,6 @@ Map::~Map() obj->ResetMap(); } - for (TransportsContainer::iterator itr = _transports.begin(); itr != _transports.end();) - { - Transport* transport = *itr; - ++itr; - - transport->RemoveFromWorld(); - delete transport; - } - if (!m_scriptSchedule.empty()) sScriptMgr->DecreaseScheduledScriptCount(m_scriptSchedule.size()); @@ -1357,6 +1348,17 @@ void Map::UnloadAll() ++i; UnloadGrid(grid, true); // deletes the grid and removes it from the GridRefManager } + + for (TransportsContainer::iterator itr = _transports.begin(); itr != _transports.end();) + { + Transport* transport = *itr; + ++itr; + + transport->RemoveFromWorld(); + delete transport; + } + + _transports.clear(); } // ***************************** -- cgit v1.2.3 From 29acf99ea626cf71c06fa8fd0481d7f70d33890e Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 28 Dec 2013 12:44:22 +0100 Subject: Core/Transports: Fixed new spawned transports not being visible for players already present on map --- src/server/game/Entities/Transport/Transport.cpp | 28 ------------------------ src/server/game/Maps/Map.cpp | 28 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 28 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 386a36ae1f0..860a84d5e83 100644 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -411,38 +411,10 @@ bool Transport::TeleportTransport(uint32 newMapid, float x, float y, float z) if (oldMap->GetId() != newMapid) { Map* newMap = sMapMgr->CreateBaseMap(newMapid); - Map::PlayerList const& oldPlayers = GetMap()->GetPlayers(); - if (!oldPlayers.isEmpty()) - { - UpdateData data; - BuildOutOfRangeUpdateBlock(&data); - WorldPacket packet; - data.BuildPacket(&packet); - for (Map::PlayerList::const_iterator itr = oldPlayers.begin(); itr != oldPlayers.end(); ++itr) - if (itr->GetSource()->GetTransport() != this) - itr->GetSource()->SendDirectMessage(&packet); - } - UnloadStaticPassengers(); GetMap()->RemoveFromMap(this, false); SetMap(newMap); - Map::PlayerList const& newPlayers = GetMap()->GetPlayers(); - if (!newPlayers.isEmpty()) - { - for (Map::PlayerList::const_iterator itr = newPlayers.begin(); itr != newPlayers.end(); ++itr) - { - if (itr->GetSource()->GetTransport() != this) - { - UpdateData data; - BuildCreateUpdateBlockForPlayer(&data, itr->GetSource()); - WorldPacket packet; - data.BuildPacket(&packet); - itr->GetSource()->SendDirectMessage(&packet); - } - } - } - for (std::set::iterator itr = _passengers.begin(); itr != _passengers.end();) { WorldObject* obj = (*itr++); diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 5b22940670f..3723fc4ab45 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -553,6 +553,22 @@ bool Map::AddToMap(Transport* obj) obj->AddToWorld(); _transports.insert(obj); + // Broadcast creation to players + if (!GetPlayers().isEmpty()) + { + for (Map::PlayerList::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) + { + if (itr->GetSource()->GetTransport() != obj) + { + UpdateData data; + obj->BuildCreateUpdateBlockForPlayer(&data, itr->GetSource()); + WorldPacket packet; + data.BuildPacket(&packet); + itr->GetSource()->SendDirectMessage(&packet); + } + } + } + return true; } @@ -801,6 +817,18 @@ void Map::RemoveFromMap(Transport* obj, bool remove) { obj->RemoveFromWorld(); + Map::PlayerList const& players = GetPlayers(); + if (!players.isEmpty()) + { + UpdateData data; + obj->BuildOutOfRangeUpdateBlock(&data); + WorldPacket packet; + data.BuildPacket(&packet); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + if (itr->GetSource()->GetTransport() != obj) + itr->GetSource()->SendDirectMessage(&packet); + } + if (_transportsUpdateIter != _transports.end()) { TransportsContainer::iterator itr = _transports.find(obj); -- cgit v1.2.3 From 533180f2a16abb4016a0fcc5f55272b841648778 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 28 Dec 2013 13:02:05 +0100 Subject: Core/Battlegrounds: Removed unneeded code --- src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp index aa3568a62d5..0b04d81bd5b 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp @@ -397,11 +397,6 @@ bool BattlegroundIC::SetupBattleground() return false; } - //Send transport init packet to all player in map - for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) - if (Player* player = ObjectAccessor::FindPlayer(itr->first)) - GetBgMap()->SendInitTransports(player); - // setting correct factions for Keep Cannons for (uint8 i = BG_IC_NPC_KEEP_CANNON_1; i < BG_IC_NPC_KEEP_CANNON_12; ++i) GetBGCreature(i)->setFaction(BG_IC_Factions[0]); -- cgit v1.2.3 From 3744c141841917075c295c3c38643e3d156eb9d4 Mon Sep 17 00:00:00 2001 From: jackpoz Date: Sun, 29 Dec 2013 01:19:52 +0100 Subject: Scripts/Misc: Ensure Creatures are in instances when required Create ScriptedAIs that require a InstanceScript reference only if the InstanceScript exists, so if these Creatures are in an instance. ScriptedAIs that don't require a InstanceScript reference have not been modified. This fixes many possible NULL dereference crashes happening when spawning a scripted Creature outside of an instance. Fixed a GetOwner() and a ToPlayer() NULL dereference crashes too. --- src/server/game/Instances/InstanceScript.h | 12 +++++++- .../BlackrockDepths/blackrock_depths.cpp | 4 +-- .../boss_emperor_dagran_thaurissan.cpp | 2 +- .../BlackrockDepths/boss_tomb_of_seven.cpp | 2 +- .../BlackrockMountain/BlackrockSpire/boss_gyth.cpp | 2 +- .../BlackrockSpire/boss_lord_valthalak.cpp | 2 +- .../BlackrockSpire/boss_pyroguard_emberseer.cpp | 2 +- .../BlackrockSpire/boss_rend_blackhand.cpp | 2 +- .../BlackwingLair/boss_broodlord_lashlayer.cpp | 2 +- .../BlackwingLair/boss_chromaggus.cpp | 2 +- .../BlackwingLair/boss_ebonroc.cpp | 2 +- .../BlackwingLair/boss_firemaw.cpp | 2 +- .../BlackwingLair/boss_flamegor.cpp | 2 +- .../BlackwingLair/boss_nefarian.cpp | 4 +-- .../BlackwingLair/boss_razorgore.cpp | 2 +- .../BlackrockMountain/MoltenCore/boss_golemagg.cpp | 2 +- .../MoltenCore/boss_majordomo_executus.cpp | 2 +- .../BlackrockMountain/MoltenCore/boss_ragnaros.cpp | 4 +-- .../EasternKingdoms/Deadmines/boss_mr_smite.cpp | 2 +- .../EasternKingdoms/Gnomeregan/gnomeregan.cpp | 2 +- .../EasternKingdoms/Karazhan/boss_moroes.cpp | 14 ++++----- .../EasternKingdoms/Karazhan/boss_netherspite.cpp | 2 +- .../EasternKingdoms/Karazhan/boss_nightbane.cpp | 2 +- .../Karazhan/boss_prince_malchezaar.cpp | 2 +- .../Karazhan/boss_shade_of_aran.cpp | 2 +- .../Karazhan/boss_terestian_illhoof.cpp | 4 +-- .../EasternKingdoms/Karazhan/bosses_opera.cpp | 16 +++++----- .../scripts/EasternKingdoms/Karazhan/karazhan.cpp | 4 +-- .../MagistersTerrace/boss_felblood_kaelthas.cpp | 4 +-- .../MagistersTerrace/boss_priestess_delrissa.cpp | 18 ++++++------ .../MagistersTerrace/boss_selin_fireheart.cpp | 2 +- .../MagistersTerrace/boss_vexallus.cpp | 2 +- .../ScarletMonastery/boss_headless_horseman.cpp | 2 +- .../ScarletMonastery/boss_interrogator_vishas.cpp | 2 +- .../boss_mograine_and_whitemane.cpp | 4 +-- .../Scholomance/boss_darkmaster_gandling.cpp | 2 +- .../Scholomance/boss_kirtonos_the_herald.cpp | 2 +- .../ShadowfangKeep/shadowfang_keep.cpp | 4 +-- .../Stratholme/boss_baron_rivendare.cpp | 2 +- .../Stratholme/boss_baroness_anastari.cpp | 2 +- .../Stratholme/boss_maleki_the_pallid.cpp | 2 +- .../EasternKingdoms/Stratholme/boss_nerubenkan.cpp | 2 +- .../Stratholme/boss_order_of_silver_hand.cpp | 2 +- .../Stratholme/boss_ramstein_the_gorger.cpp | 2 +- .../SunwellPlateau/boss_kalecgos.cpp | 4 +-- .../SunwellPlateau/boss_kiljaeden.cpp | 6 ++-- .../EasternKingdoms/SunwellPlateau/boss_muru.cpp | 4 +-- .../EasternKingdoms/Uldaman/boss_archaedas.cpp | 6 ++-- .../EasternKingdoms/ZulAman/boss_akilzon.cpp | 2 +- .../EasternKingdoms/ZulAman/boss_halazzi.cpp | 2 +- .../EasternKingdoms/ZulAman/boss_hexlord.cpp | 16 +++++----- .../EasternKingdoms/ZulAman/boss_janalai.cpp | 6 ++-- .../EasternKingdoms/ZulAman/boss_nalorakk.cpp | 2 +- .../EasternKingdoms/ZulAman/boss_zuljin.cpp | 2 +- .../scripts/EasternKingdoms/ZulAman/zulaman.cpp | 4 +-- .../EasternKingdoms/ZulGurub/boss_hakkar.cpp | 2 +- .../EasternKingdoms/ZulGurub/boss_jeklik.cpp | 2 +- .../EasternKingdoms/ZulGurub/boss_jindo.cpp | 2 +- .../EasternKingdoms/ZulGurub/boss_mandokir.cpp | 2 +- .../EasternKingdoms/ZulGurub/boss_thekal.cpp | 6 ++-- .../BlackfathomDeeps/blackfathom_deeps.cpp | 2 +- .../Kalimdor/BlackfathomDeeps/boss_gelihast.cpp | 2 +- .../Kalimdor/BlackfathomDeeps/boss_kelris.cpp | 2 +- .../BattleForMountHyjal/boss_anetheron.cpp | 4 +-- .../BattleForMountHyjal/boss_archimonde.cpp | 4 +-- .../BattleForMountHyjal/boss_azgalor.cpp | 4 +-- .../BattleForMountHyjal/boss_kazrogal.cpp | 2 +- .../BattleForMountHyjal/boss_rage_winterchill.cpp | 2 +- .../CavernsOfTime/BattleForMountHyjal/hyjal.cpp | 9 ++++++ .../BattleForMountHyjal/hyjal_trash.cpp | 18 ++++++------ .../CullingOfStratholme/boss_chrono_lord_epoch.cpp | 2 +- .../boss_infinite_corruptor.cpp | 2 +- .../CullingOfStratholme/boss_mal_ganis.cpp | 2 +- .../CullingOfStratholme/boss_meathook.cpp | 2 +- .../boss_salramm_the_fleshcrafter.cpp | 2 +- .../CullingOfStratholme/culling_of_stratholme.cpp | 2 +- .../boss_captain_skarloc.cpp | 2 +- .../EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp | 2 +- .../EscapeFromDurnholdeKeep/old_hillsbrad.cpp | 4 +-- .../CavernsOfTime/TheBlackMorass/boss_aeonus.cpp | 2 +- .../TheBlackMorass/boss_chrono_lord_deja.cpp | 2 +- .../CavernsOfTime/TheBlackMorass/boss_temporus.cpp | 2 +- .../TheBlackMorass/the_black_morass.cpp | 4 +-- .../scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp | 2 +- .../Kalimdor/RazorfenDowns/razorfen_downs.cpp | 6 ++-- .../Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp | 4 +-- .../scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp | 2 +- .../Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp | 2 +- .../Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp | 2 +- .../Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp | 6 ++-- .../Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp | 4 +-- .../TempleOfAhnQiraj/boss_twinemperors.cpp | 4 +-- .../Kalimdor/WailingCaverns/wailing_caverns.cpp | 2 +- .../scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp | 2 +- .../scripts/Kalimdor/ZulFarrak/zulfarrak.cpp | 4 +-- .../AzjolNerub/Ahnkahet/boss_herald_volazj.cpp | 2 +- .../Ahnkahet/boss_jedoga_shadowseeker.cpp | 6 ++-- .../AzjolNerub/AzjolNerub/boss_anubarak.cpp | 2 +- .../AzjolNerub/AzjolNerub/boss_hadronox.cpp | 2 +- .../AzjolNerub/boss_krikthir_the_gatewatcher.cpp | 2 +- .../TrialOfTheChampion/boss_argent_challenge.cpp | 6 ++-- .../TrialOfTheChampion/boss_black_knight.cpp | 2 +- .../TrialOfTheChampion/boss_grand_champions.cpp | 12 ++++---- .../TrialOfTheChampion/trial_of_the_champion.cpp | 2 +- .../TrialOfTheCrusader/boss_anubarak_trial.cpp | 6 ++-- .../TrialOfTheCrusader/boss_faction_champions.cpp | 34 +++++++++++----------- .../TrialOfTheCrusader/boss_lord_jaraxxus.cpp | 8 ++--- .../TrialOfTheCrusader/boss_northrend_beasts.cpp | 14 ++++----- .../TrialOfTheCrusader/boss_twin_valkyr.cpp | 4 +-- .../TrialOfTheCrusader/trial_of_the_crusader.cpp | 10 +++---- .../FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp | 4 +-- .../ForgeOfSouls/boss_devourer_of_souls.cpp | 2 +- .../FrozenHalls/ForgeOfSouls/forge_of_souls.cpp | 4 +-- .../FrozenHalls/HallsOfReflection/boss_falric.cpp | 2 +- .../FrozenHalls/HallsOfReflection/boss_marwyn.cpp | 2 +- .../HallsOfReflection/halls_of_reflection.cpp | 18 ++++++------ .../Northrend/Gundrak/boss_drakkari_colossus.cpp | 6 ++-- src/server/scripts/Northrend/Gundrak/boss_eck.cpp | 4 +-- .../scripts/Northrend/Gundrak/boss_gal_darah.cpp | 2 +- .../scripts/Northrend/Gundrak/boss_moorabi.cpp | 2 +- .../scripts/Northrend/Gundrak/boss_slad_ran.cpp | 2 +- .../IcecrownCitadel/boss_valithria_dreamwalker.cpp | 2 +- .../Northrend/Naxxramas/boss_anubrekhan.cpp | 2 +- .../scripts/Northrend/Naxxramas/boss_faerlina.cpp | 2 +- .../Northrend/Naxxramas/boss_four_horsemen.cpp | 2 +- .../scripts/Northrend/Naxxramas/boss_gothik.cpp | 2 +- .../scripts/Northrend/Naxxramas/boss_heigan.cpp | 2 +- .../scripts/Northrend/Naxxramas/boss_kelthuzad.cpp | 4 +-- .../scripts/Northrend/Naxxramas/boss_noth.cpp | 2 +- .../scripts/Northrend/Naxxramas/boss_patchwerk.cpp | 2 +- .../scripts/Northrend/Naxxramas/boss_thaddius.cpp | 6 ++-- .../Northrend/Nexus/EyeOfEternity/boss_malygos.cpp | 16 +++++----- .../Northrend/Nexus/Nexus/boss_anomalus.cpp | 4 +-- .../Northrend/Nexus/Nexus/boss_keristrasza.cpp | 2 +- .../Northrend/Nexus/Nexus/boss_magus_telestra.cpp | 2 +- .../scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp | 2 +- .../scripts/Northrend/Nexus/Oculus/boss_varos.cpp | 2 +- .../Ulduar/HallsOfLightning/boss_bjarngrim.cpp | 4 +-- .../Ulduar/HallsOfLightning/boss_ionar.cpp | 4 +-- .../Ulduar/HallsOfLightning/boss_loken.cpp | 2 +- .../Ulduar/HallsOfLightning/boss_volkhan.cpp | 2 +- .../Northrend/Ulduar/Ulduar/boss_auriaya.cpp | 6 ++-- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 4 +-- .../scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp | 8 ++--- .../Northrend/Ulduar/Ulduar/boss_general_vezax.cpp | 4 +-- .../scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp | 4 +-- .../Northrend/Ulduar/Ulduar/boss_razorscale.cpp | 4 +-- .../scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp | 8 ++--- .../UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp | 10 +++---- .../UtgardeKeep/UtgardePinnacle/boss_skadi.cpp | 2 +- .../Northrend/VaultOfArchavon/boss_emalon.cpp | 2 +- .../Northrend/VaultOfArchavon/boss_toravon.cpp | 2 +- .../Northrend/VioletHold/boss_cyanigosa.cpp | 2 +- .../scripts/Northrend/VioletHold/boss_erekem.cpp | 4 +-- .../scripts/Northrend/VioletHold/boss_ichoron.cpp | 4 +-- .../Northrend/VioletHold/boss_lavanthor.cpp | 2 +- .../scripts/Northrend/VioletHold/boss_moragg.cpp | 2 +- .../scripts/Northrend/VioletHold/boss_xevozz.cpp | 4 +-- .../scripts/Northrend/VioletHold/boss_zuramat.cpp | 2 +- .../scripts/Northrend/VioletHold/violet_hold.cpp | 22 +++++++------- .../scripts/Northrend/zone_borean_tundra.cpp | 3 ++ .../scripts/Outland/BlackTemple/black_temple.cpp | 2 +- .../scripts/Outland/BlackTemple/boss_bloodboil.cpp | 2 +- .../scripts/Outland/BlackTemple/boss_illidan.cpp | 6 ++-- .../Outland/BlackTemple/boss_mother_shahraz.cpp | 2 +- .../BlackTemple/boss_reliquary_of_souls.cpp | 2 +- .../Outland/BlackTemple/boss_shade_of_akama.cpp | 18 ++++++------ .../scripts/Outland/BlackTemple/boss_supremus.cpp | 2 +- .../Outland/BlackTemple/boss_teron_gorefiend.cpp | 2 +- .../Outland/BlackTemple/boss_warlord_najentus.cpp | 2 +- .../Outland/BlackTemple/illidari_council.cpp | 10 +++---- .../SerpentShrine/boss_fathomlord_karathress.cpp | 8 ++--- .../SerpentShrine/boss_hydross_the_unstable.cpp | 2 +- .../SerpentShrine/boss_lady_vashj.cpp | 10 +++---- .../SerpentShrine/boss_leotheras_the_blind.cpp | 4 +-- .../SerpentShrine/boss_lurker_below.cpp | 2 +- .../SerpentShrine/boss_morogrim_tidewalker.cpp | 2 +- .../SteamVault/boss_hydromancer_thespia.cpp | 2 +- .../SteamVault/boss_mekgineer_steamrigger.cpp | 4 +-- .../SteamVault/boss_warlord_kalithresh.cpp | 4 +-- .../HellfireCitadel/BloodFurnace/boss_broggok.cpp | 2 +- .../BloodFurnace/boss_kelidan_the_breaker.cpp | 4 +-- .../BloodFurnace/boss_the_maker.cpp | 2 +- .../HellfireRamparts/boss_omor_the_unscarred.cpp | 2 +- .../MagtheridonsLair/boss_magtheridon.cpp | 4 +-- .../ShatteredHalls/boss_nethekurse.cpp | 4 +-- .../ShatteredHalls/boss_warbringer_omrogg.cpp | 4 +-- .../boss_warchief_kargath_bladefist.cpp | 2 +- .../scripts/Outland/TempestKeep/Eye/boss_alar.cpp | 4 +-- .../Outland/TempestKeep/Eye/boss_astromancer.cpp | 4 +-- .../Outland/TempestKeep/Eye/boss_kaelthas.cpp | 10 +++---- .../Outland/TempestKeep/Eye/boss_void_reaver.cpp | 2 +- .../Mechanar/boss_nethermancer_sepethrea.cpp | 2 +- .../scripts/Outland/zone_blades_edge_mountains.cpp | 5 ++-- 194 files changed, 414 insertions(+), 391 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Instances/InstanceScript.h b/src/server/game/Instances/InstanceScript.h index acc8012bbbc..ade08b3a35d 100644 --- a/src/server/game/Instances/InstanceScript.h +++ b/src/server/game/Instances/InstanceScript.h @@ -243,6 +243,16 @@ AI* GetInstanceAI(T* obj, char const* scriptName) return new AI(obj); return NULL; -} +}; + +template +AI* GetInstanceAI(T* obj) +{ + if (InstanceMap* instance = obj->GetMap()->ToInstanceMap()) + if (instance->GetInstanceScript()) + return new AI(obj); + + return NULL; +}; #endif // TRINITY_INSTANCE_DATA_H diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp index ee8f22ca66c..6949c73a1f3 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp @@ -117,7 +117,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_grimstoneAI(creature); + return GetInstanceAI(creature); } struct npc_grimstoneAI : public npc_escortAI @@ -1237,7 +1237,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_rocknotAI(creature); + return GetInstanceAI(creature); } struct npc_rocknotAI : public npc_escortAI diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp index dcf5ef56848..ecdfafea641 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp @@ -39,7 +39,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_draganthaurissanAI(creature); + return GetInstanceAI(creature); } struct boss_draganthaurissanAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp index 55e6862bda7..aa0d0810a08 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp @@ -140,7 +140,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_doomrelAI(creature); + return GetInstanceAI(creature); } struct boss_doomrelAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gyth.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gyth.cpp index dbc3056b1ff..b2d496501ff 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gyth.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gyth.cpp @@ -162,7 +162,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_gythAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_lord_valthalak.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_lord_valthalak.cpp index 26540eb38a6..5a34bffca6f 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_lord_valthalak.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_lord_valthalak.cpp @@ -128,7 +128,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_lord_valthalakAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp index 1c40385c0fd..0e14eedc813 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp @@ -316,7 +316,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_pyroguard_emberseerAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp index ff839e3cacb..efe53d0825a 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp @@ -438,7 +438,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_rend_blackhandAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_broodlord_lashlayer.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_broodlord_lashlayer.cpp index c9dc3d8f134..77afea4b656 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_broodlord_lashlayer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_broodlord_lashlayer.cpp @@ -116,7 +116,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_broodlordAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp index 05effabe557..9878720b1dd 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp @@ -282,7 +282,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_chromaggusAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp index 0d79f3faeee..222bd6f80ea 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp @@ -92,7 +92,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_ebonrocAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp index 369e4e02f5a..983fe60a2d0 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp @@ -94,7 +94,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_firemawAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp index 060bfeb60b3..63b43d81ae4 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp @@ -100,7 +100,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_flamegorAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp index 0d3774e1b58..5e0f17b2330 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp @@ -376,7 +376,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_victor_nefariusAI(creature); + return GetInstanceAI(creature); } }; @@ -572,7 +572,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_nefarianAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp index caf2719eff9..c2e7b7a091c 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp @@ -156,7 +156,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_razorgoreAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_golemagg.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_golemagg.cpp index 0fdb88923b3..bc94f1b0267 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_golemagg.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_golemagg.cpp @@ -179,7 +179,7 @@ class npc_core_rager : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_core_ragerAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp index 1001516d42e..4c1ae6b302f 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp @@ -207,7 +207,7 @@ class boss_majordomo : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_majordomoAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp index d03f756f366..165c33573bd 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp @@ -306,7 +306,7 @@ class boss_ragnaros : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_ragnarosAI(creature); + return GetInstanceAI(creature); } }; @@ -342,7 +342,7 @@ class npc_son_of_flame : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_son_of_flameAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp index 8a7836b310e..16142215e9f 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp @@ -45,7 +45,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_mr_smiteAI(creature); + return GetInstanceAI(creature); } struct boss_mr_smiteAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp index 46683442a60..3fe806e09a8 100644 --- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp @@ -90,7 +90,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_blastmaster_emi_shortfuseAI(creature); + return GetInstanceAI(creature); } bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp index fc37c42be85..006f619d3ab 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp @@ -98,7 +98,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_moroesAI(creature); + return GetInstanceAI(creature); } struct boss_moroesAI : public ScriptedAI @@ -393,7 +393,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_baroness_dorothea_millstipeAI(creature); + return GetInstanceAI(creature); } struct boss_baroness_dorothea_millstipeAI : public boss_moroes_guestAI @@ -456,7 +456,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_baron_rafe_dreugerAI(creature); + return GetInstanceAI(creature); } struct boss_baron_rafe_dreugerAI : public boss_moroes_guestAI @@ -513,7 +513,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_lady_catriona_von_indiAI(creature); + return GetInstanceAI(creature); } struct boss_lady_catriona_von_indiAI : public boss_moroes_guestAI @@ -583,7 +583,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_lady_keira_berrybuckAI(creature); + return GetInstanceAI(creature); } struct boss_lady_keira_berrybuckAI : public boss_moroes_guestAI @@ -657,7 +657,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_lord_robin_darisAI(creature); + return GetInstanceAI(creature); } struct boss_lord_robin_darisAI : public boss_moroes_guestAI @@ -713,7 +713,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_lord_crispin_ferenceAI(creature); + return GetInstanceAI(creature); } struct boss_lord_crispin_ferenceAI : public boss_moroes_guestAI diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp index 7111056cc69..52bec6dbf27 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp @@ -71,7 +71,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_netherspiteAI(creature); + return GetInstanceAI(creature); } struct boss_netherspiteAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp index 984ef902f05..5f3156ccc5a 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp @@ -71,7 +71,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_nightbaneAI(creature); + return GetInstanceAI(creature); } struct boss_nightbaneAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index 9f7db5813d4..d8901174d62 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -179,7 +179,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_malchezaarAI(creature); + return GetInstanceAI(creature); } struct boss_malchezaarAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp index 2036d083f6b..b2c74fc45f8 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp @@ -86,7 +86,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_aranAI(creature); + return GetInstanceAI(creature); } struct boss_aranAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp index 9e7897cd56a..68ba0a3fd01 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp @@ -72,7 +72,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_kilrekAI(creature); + return GetInstanceAI(creature); } struct npc_kilrekAI : public ScriptedAI @@ -257,7 +257,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_terestianAI(creature); + return GetInstanceAI(creature); } struct boss_terestianAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp index da14ab8646e..c6f37b15a54 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp @@ -118,7 +118,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_dorotheeAI(creature); + return GetInstanceAI(creature); } struct boss_dorotheeAI : public ScriptedAI @@ -299,7 +299,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_strawmanAI(creature); + return GetInstanceAI(creature); } struct boss_strawmanAI : public ScriptedAI @@ -414,7 +414,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_tinheadAI(creature); + return GetInstanceAI(creature); } struct boss_tinheadAI : public ScriptedAI @@ -524,7 +524,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_roarAI(creature); + return GetInstanceAI(creature); } struct boss_roarAI : public ScriptedAI @@ -633,7 +633,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_croneAI(creature); + return GetInstanceAI(creature); } struct boss_croneAI : public ScriptedAI @@ -813,7 +813,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_bigbadwolfAI(creature); + return GetInstanceAI(creature); } struct boss_bigbadwolfAI : public ScriptedAI @@ -1015,7 +1015,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_julianneAI(creature); + return GetInstanceAI(creature); } struct boss_julianneAI : public ScriptedAI @@ -1138,7 +1138,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_romuloAI(creature); + return GetInstanceAI(creature); } struct boss_romuloAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index e59889d24aa..ed010124d6f 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -412,7 +412,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_barnesAI(creature); + return GetInstanceAI(creature); } }; @@ -476,7 +476,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_image_of_medivhAI(creature); + return GetInstanceAI(creature); } struct npc_image_of_medivhAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index 074ad3f1b96..15b3e6833c6 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -96,7 +96,7 @@ public: CreatureAI* GetAI(Creature* c) const OVERRIDE { - return new boss_felblood_kaelthasAI(c); + return GetInstanceAI(c); } struct boss_felblood_kaelthasAI : public ScriptedAI @@ -482,7 +482,7 @@ public: CreatureAI* GetAI(Creature* c) const OVERRIDE { - return new npc_felkael_phoenixAI(c); + return GetInstanceAI(c); } struct npc_felkael_phoenixAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp index af78b250ae1..b5110c3c3c7 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp @@ -110,7 +110,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_priestess_delrissaAI(creature); + return GetInstanceAI(creature); } struct boss_priestess_delrissaAI : public ScriptedAI @@ -504,7 +504,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_kagani_nightstrikeAI(creature); + return GetInstanceAI(creature); } struct boss_kagani_nightstrikeAI : public boss_priestess_lackey_commonAI @@ -608,7 +608,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_ellris_duskhallowAI(creature); + return GetInstanceAI(creature); } struct boss_ellris_duskhallowAI : public boss_priestess_lackey_commonAI @@ -699,7 +699,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_eramas_brightblazeAI(creature); + return GetInstanceAI(creature); } struct boss_eramas_brightblazeAI : public boss_priestess_lackey_commonAI @@ -760,7 +760,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_yazzaiAI(creature); + return GetInstanceAI(creature); } struct boss_yazzaiAI : public boss_priestess_lackey_commonAI @@ -890,7 +890,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_warlord_salarisAI(creature); + return GetInstanceAI(creature); } struct boss_warlord_salarisAI : public boss_priestess_lackey_commonAI @@ -1010,7 +1010,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_garaxxasAI(creature); + return GetInstanceAI(creature); } struct boss_garaxxasAI : public boss_priestess_lackey_commonAI @@ -1121,7 +1121,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_apokoAI(creature); + return GetInstanceAI(creature); } struct boss_apokoAI : public boss_priestess_lackey_commonAI @@ -1219,7 +1219,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_zelfanAI(creature); + return GetInstanceAI(creature); } struct boss_zelfanAI : public boss_priestess_lackey_commonAI diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp index d2dbc85f52a..bcb321cab2e 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp @@ -66,7 +66,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_selin_fireheartAI(creature); + return GetInstanceAI(creature); }; struct boss_selin_fireheartAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp index 24b48112bb6..553107b2e82 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp @@ -76,7 +76,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_vexallusAI(creature); + return GetInstanceAI(creature); }; struct boss_vexallusAI : public BossAI diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index 442dcf91f32..7c561f8b920 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -374,7 +374,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_headless_horsemanAI(creature); + return GetInstanceAI(creature); } struct boss_headless_horsemanAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp index a57c237c21a..48b133081bd 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp @@ -48,7 +48,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_interrogator_vishasAI(creature); + return GetInstanceAI(creature); } struct boss_interrogator_vishasAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp index 6e71729ab50..41e961360b5 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp @@ -65,7 +65,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_scarlet_commander_mograineAI(creature); + return GetInstanceAI(creature); } struct boss_scarlet_commander_mograineAI : public ScriptedAI @@ -231,7 +231,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_high_inquisitor_whitemaneAI(creature); + return GetInstanceAI(creature); } struct boss_high_inquisitor_whitemaneAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp index 2277c53ae6b..558dc030eaf 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp @@ -128,7 +128,7 @@ class boss_darkmaster_gandling : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_darkmaster_gandlingAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp index 2433390f8f5..e485db94e42 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp @@ -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(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp index 8d89592090e..b8f3df2da60 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp @@ -72,7 +72,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_shadowfang_prisonerAI(creature); + return GetInstanceAI(creature); } bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE @@ -158,7 +158,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_arugal_voidwalkerAI(creature); + return GetInstanceAI(creature); } struct npc_arugal_voidwalkerAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp index 16ec442d963..04edf4e3f43 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp @@ -68,7 +68,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_baron_rivendareAI(creature); + return GetInstanceAI(creature); } struct boss_baron_rivendareAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp index 1812e2efd8d..2f5750b6141 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp @@ -42,7 +42,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_baroness_anastariAI(creature); + return GetInstanceAI(creature); } struct boss_baroness_anastariAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp index 0f8340891a8..57bd138e7e1 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp @@ -43,7 +43,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_maleki_the_pallidAI(creature); + return GetInstanceAI(creature); } struct boss_maleki_the_pallidAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp index 2cacf80e27c..2eb5d6024d4 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp @@ -42,7 +42,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_nerubenkanAI(creature); + return GetInstanceAI(creature); } struct boss_nerubenkanAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp index 706c2e7b6fb..b5d03ae9261 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp @@ -58,7 +58,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_silver_hand_bossesAI(creature); + return GetInstanceAI(creature); } struct boss_silver_hand_bossesAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp index 79b8dd7dfe2..17eebf227e8 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp @@ -45,7 +45,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_ramstein_the_gorgerAI(creature); + return GetInstanceAI(creature); } struct boss_ramstein_the_gorgerAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index 28f4bae9f0f..92d5c3121ed 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -441,7 +441,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_kalecAI(creature); + return GetInstanceAI(creature); } struct boss_kalecAI : public ScriptedAI @@ -575,7 +575,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_sathrovarrAI(creature); + return GetInstanceAI(creature); } struct boss_sathrovarrAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index 5db7e182ea1..d3e1661aca9 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -236,7 +236,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_kalecgos_kjAI(creature); + return GetInstanceAI(creature); } struct boss_kalecgos_kjAI : public ScriptedAI @@ -389,7 +389,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_kiljaeden_controllerAI(creature); + return GetInstanceAI(creature); } struct npc_kiljaeden_controllerAI : public ScriptedAI @@ -1150,7 +1150,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_shield_orbAI(creature); + return GetInstanceAI(creature); } struct npc_shield_orbAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp index 8da162bae14..add0885a8a2 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp @@ -371,7 +371,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_muru_portalAI(creature); + return GetInstanceAI(creature); } struct npc_muru_portalAI : public ScriptedAI @@ -571,7 +571,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_blackholeAI(creature); + return GetInstanceAI(creature); } struct npc_blackholeAI : public ScriptedAI diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp index 69ee53f0762..bae21721634 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp @@ -206,7 +206,7 @@ class boss_archaedas : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_archaedasAI(creature); + return GetInstanceAI(creature); } }; @@ -305,7 +305,7 @@ class npc_archaedas_minions : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_archaedas_minionsAI(creature); + return GetInstanceAI(creature); } }; @@ -368,7 +368,7 @@ class npc_stonekeepers : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_stonekeepersAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index f436b3c89ab..f9470f89209 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -363,7 +363,7 @@ class boss_akilzon : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_akilzonAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp index 594cc3d2918..116c450ddab 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp @@ -343,7 +343,7 @@ class boss_halazzi : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_halazziAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp index 78c1395d82d..42f8837ac81 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp @@ -510,7 +510,7 @@ class boss_hexlord_malacrass : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_hex_lord_malacrassAI(creature); + return GetInstanceAI(creature); } }; @@ -567,7 +567,7 @@ class boss_thurg : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_thurgAI(creature); + return GetInstanceAI(creature); } }; @@ -664,7 +664,7 @@ class boss_alyson_antille : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_alyson_antilleAI(creature); + return GetInstanceAI(creature); } }; @@ -757,7 +757,7 @@ class boss_lord_raadan : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_lord_raadanAI(creature); + return GetInstanceAI(creature); } }; @@ -798,7 +798,7 @@ class boss_darkheart : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_darkheartAI(creature); + return GetInstanceAI(creature); } }; @@ -857,7 +857,7 @@ class boss_slither : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_slitherAI(creature); + return GetInstanceAI(creature); } }; @@ -900,7 +900,7 @@ class boss_fenstalker : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_fenstalkerAI(creature); + return GetInstanceAI(creature); } }; @@ -950,7 +950,7 @@ class boss_koragg : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_koraggAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index cc5acbf8ab3..5d119b1d86a 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -442,7 +442,7 @@ class boss_janalai : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_janalaiAI(creature); + return GetInstanceAI(creature); } }; @@ -612,7 +612,7 @@ class npc_janalai_hatcher : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_janalai_hatcherAI(creature); + return GetInstanceAI(creature); } }; @@ -671,7 +671,7 @@ class npc_janalai_hatchling : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_janalai_hatchlingAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp index 25fa16b974c..e97456b3e7d 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp @@ -453,7 +453,7 @@ class boss_nalorakk : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_nalorakkAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp index ef47fa8877a..ce1c434bb96 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp @@ -555,7 +555,7 @@ class boss_zuljin : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_zuljinAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index a4176322288..6e375114fc6 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -116,7 +116,7 @@ class npc_forest_frog : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_forest_frogAI(creature); + return GetInstanceAI(creature); } }; @@ -460,7 +460,7 @@ class npc_harrison_jones : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_harrison_jonesAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp index b25daf85a7c..d35e9bd31f6 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp @@ -169,7 +169,7 @@ class boss_hakkar : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_hakkarAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp index 50b7d277a70..16cdfc6c10a 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp @@ -286,7 +286,7 @@ class npc_batrider : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_batriderAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp index 4a37f3cf597..0bd97ec3bf4 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp @@ -232,7 +232,7 @@ class npc_healing_ward : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_healing_wardAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index 121de7d9cf5..392b405b0a8 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -393,7 +393,7 @@ class npc_vilebranch_speaker : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_vilebranch_speakerAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp index d20414705cf..c784b2c65ad 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp @@ -251,7 +251,7 @@ class boss_thekal : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_thekalAI(creature); + return GetInstanceAI(creature); } }; @@ -406,7 +406,7 @@ class npc_zealot_lorkhan : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_zealot_lorkhanAI(creature); + return GetInstanceAI(creature); } }; @@ -559,7 +559,7 @@ class npc_zealot_zath : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_zealot_zathAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp index e74ed93bc66..f76bf2925ee 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp @@ -73,7 +73,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_blackfathom_deeps_eventAI(creature); + return GetInstanceAI(creature); } struct npc_blackfathom_deeps_eventAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp index 139eed963c1..092156b632a 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp @@ -31,7 +31,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_gelihastAI(creature); + return GetInstanceAI(creature); } struct boss_gelihastAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp index 8eeedb6e15f..d224fa2f06c 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp @@ -36,7 +36,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_kelrisAI(creature); + return GetInstanceAI(creature); } struct boss_kelrisAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index d61fbc153e9..fc3252484db 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -47,7 +47,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_anetheronAI(creature); + return GetInstanceAI(creature); } struct boss_anetheronAI : public hyjal_trashAI @@ -180,7 +180,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_towering_infernalAI(creature); + return GetInstanceAI(creature); } struct npc_towering_infernalAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp index 41cc1d0241d..cd434f4aefd 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp @@ -83,7 +83,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ancient_wispAI(creature); + return GetInstanceAI(creature); } struct npc_ancient_wispAI : public ScriptedAI @@ -239,7 +239,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_archimondeAI(creature); + return GetInstanceAI(creature); } struct boss_archimondeAI : public hyjal_trashAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp index dd486df16ed..91581ac7e92 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp @@ -48,7 +48,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_azgalorAI(creature); + return GetInstanceAI(creature); } struct boss_azgalorAI : public hyjal_trashAI @@ -186,7 +186,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_lesser_doomguardAI(creature); + return GetInstanceAI(creature); } struct npc_lesser_doomguardAI : public hyjal_trashAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp index 66e276d25b6..ea5e641347c 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp @@ -49,7 +49,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_kazrogalAI(creature); + return GetInstanceAI(creature); } struct boss_kazrogalAI : public hyjal_trashAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp index c163e7c0f1f..6b413ec847b 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp @@ -44,7 +44,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_rage_winterchillAI(creature); + return GetInstanceAI(creature); } struct boss_rage_winterchillAI : public hyjal_trashAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp index f4d3f559585..a352c3493ee 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp @@ -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(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp index 9245a0c648f..6ca5bfd10d5 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -537,7 +537,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_giant_infernalAI(creature); + return GetInstanceAI(creature); } }; @@ -548,7 +548,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_abominationAI(creature); + return GetInstanceAI(creature); } struct npc_abominationAI : public hyjal_trashAI @@ -646,7 +646,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ghoulAI(creature); + return GetInstanceAI(creature); } struct npc_ghoulAI : public hyjal_trashAI @@ -748,7 +748,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_necromancerAI(creature); + return GetInstanceAI(creature); } struct npc_necromancerAI : public hyjal_trashAI @@ -875,7 +875,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_bansheeAI(creature); + return GetInstanceAI(creature); } struct npc_bansheeAI : public hyjal_trashAI @@ -978,7 +978,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_crypt_fiendAI(creature); + return GetInstanceAI(creature); } struct npc_crypt_fiendAI : public hyjal_trashAI @@ -1068,7 +1068,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_fel_stalkerAI(creature); + return GetInstanceAI(creature); } struct npc_fel_stalkerAI : public hyjal_trashAI @@ -1158,7 +1158,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_frost_wyrmAI(creature); + return GetInstanceAI(creature); } struct npc_frost_wyrmAI : public hyjal_trashAI @@ -1270,7 +1270,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_gargoyleAI(creature); + return GetInstanceAI(creature); } struct npc_gargoyleAI : public hyjal_trashAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_chrono_lord_epoch.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_chrono_lord_epoch.cpp index c049be0309b..15f0df5fae6 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_chrono_lord_epoch.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_chrono_lord_epoch.cpp @@ -52,7 +52,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_epochAI(creature); + return GetInstanceAI(creature); } struct boss_epochAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite_corruptor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite_corruptor.cpp index 54438e3b8a9..b12986c72ff 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite_corruptor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite_corruptor.cpp @@ -39,7 +39,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_infinite_corruptorAI(creature); + return GetInstanceAI(creature); } struct boss_infinite_corruptorAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp index e16ed882171..0ab5f49fb34 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp @@ -66,7 +66,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_mal_ganisAI(creature); + return GetInstanceAI(creature); } struct boss_mal_ganisAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp index aff076f4763..490e93ec090 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp @@ -51,7 +51,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_meathookAI(creature); + return GetInstanceAI(creature); } struct boss_meathookAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp index fc5b3c4a8b0..ffc0c73ecfa 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp @@ -56,7 +56,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_salrammAI(creature); + return GetInstanceAI(creature); } struct boss_salrammAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp index dbead663cff..91a7ca9ab0d 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp @@ -344,7 +344,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_arthasAI(creature); + return GetInstanceAI(creature); } struct npc_arthasAI : public npc_escortAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp index 3b51f6d0f8f..d69137060e0 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp @@ -54,7 +54,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_captain_skarlocAI(creature); + return GetInstanceAI(creature); } struct boss_captain_skarlocAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp index 5cbe76671a4..0c20669775c 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp @@ -52,7 +52,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_epoch_hunterAI(creature); + return GetInstanceAI(creature); } struct boss_epoch_hunterAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp index bdf7d71a497..031a0f2792e 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp @@ -188,7 +188,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_thrall_old_hillsbradAI(creature); + return GetInstanceAI(creature); } bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE @@ -573,7 +573,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_tarethaAI(creature); + return GetInstanceAI(creature); } bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_aeonus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_aeonus.cpp index 3817c2628e3..a26b8f5556b 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_aeonus.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_aeonus.cpp @@ -141,7 +141,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_aeonusAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_chrono_lord_deja.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_chrono_lord_deja.cpp index fe91f3ab712..aa5fb22a24a 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_chrono_lord_deja.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_chrono_lord_deja.cpp @@ -145,7 +145,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_chrono_lord_dejaAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp index 4d94edf7339..d496a9a79ab 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp @@ -143,7 +143,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_temporusAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp index 4fa7e007a7c..10cd2068f72 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp @@ -70,7 +70,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_medivh_bmAI(creature); + return GetInstanceAI(creature); } struct npc_medivh_bmAI : public ScriptedAI @@ -268,7 +268,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_time_riftAI(creature); + return GetInstanceAI(creature); } struct npc_time_riftAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp index f16441ba72b..c610760a289 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp @@ -469,7 +469,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_onyxiaAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp index abd76ebe508..28e7759a16f 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp @@ -321,7 +321,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_belnistraszAI(creature); + return GetInstanceAI(creature); } }; @@ -362,7 +362,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_idol_room_spawnerAI(creature); + return GetInstanceAI(creature); } }; @@ -433,7 +433,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_tomb_creatureAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp index 327fe0d1358..1cdcfae1139 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp @@ -232,7 +232,7 @@ class boss_ayamiss : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_ayamissAI(creature); + return GetInstanceAI(creature); } }; @@ -286,7 +286,7 @@ class npc_hive_zara_larva : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_hive_zara_larvaAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp index 0890a9804f9..ae4b42a4221 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp @@ -236,7 +236,7 @@ class npc_buru_egg : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_buru_eggAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp index 0b58ded0b1c..09c4734dc49 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp @@ -127,7 +127,7 @@ class boss_kurinnaxx : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_kurinnaxxAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp index 366f74f469e..6db8b3dde85 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp @@ -273,7 +273,7 @@ class boss_ossirian : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_ossirianAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp index 63d43dcfb4b..e00b46d3ed1 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp @@ -48,7 +48,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_kriAI(creature); + return GetInstanceAI(creature); } struct boss_kriAI : public ScriptedAI @@ -145,7 +145,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_vemAI(creature); + return GetInstanceAI(creature); } struct boss_vemAI : public ScriptedAI @@ -238,7 +238,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_yaujAI(creature); + return GetInstanceAI(creature); } struct boss_yaujAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index d2b5b5eaf8c..73eb9a8163b 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -153,7 +153,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new eye_of_cthunAI(creature); + return GetInstanceAI(creature); } struct eye_of_cthunAI : public ScriptedAI @@ -459,7 +459,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new cthunAI(creature); + return GetInstanceAI(creature); } struct cthunAI : public ScriptedAI diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index 76665f649b3..e63c2b8545b 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -394,7 +394,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_veknilashAI(creature); + return GetInstanceAI(creature); } struct boss_veknilashAI : public boss_twinemperorsAI @@ -480,7 +480,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_veklorAI(creature); + return GetInstanceAI(creature); } struct boss_veklorAI : public boss_twinemperorsAI diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp index a985f353976..fa1b780b258 100644 --- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp +++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp @@ -81,7 +81,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_disciple_of_naralexAI(creature); + return GetInstanceAI(creature); } bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE diff --git a/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp b/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp index bc31fd118be..95e2c298af7 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp @@ -150,7 +150,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_zum_rahAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp index a2f98b21589..72715c49b8f 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp @@ -97,7 +97,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_sergeant_blyAI(creature); + return GetInstanceAI(creature); } struct npc_sergeant_blyAI : public ScriptedAI @@ -296,7 +296,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_weegli_blastfuseAI(creature); + return GetInstanceAI(creature); } struct npc_weegli_blastfuseAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp index a5997dc4cf8..e43d0846b75 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp @@ -311,7 +311,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_volazjAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp index fcd4d4d73b3..a80b6fda636 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp @@ -337,7 +337,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_jedoga_shadowseekerAI(creature); + return GetInstanceAI(creature); } }; @@ -503,7 +503,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_jedoga_initiandAI(creature); + return GetInstanceAI(creature); } }; @@ -589,7 +589,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_jedogas_aufseher_triggerAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp index 81530265617..155b8aa20b5 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp @@ -355,7 +355,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_anub_arakAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp index 1664a1375ae..39aaae06ff5 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp @@ -192,7 +192,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_hadronoxAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp index 143ccc29e0d..86fb0260cc5 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp @@ -195,7 +195,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_krik_thirAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp index f6fd1c14a9b..39be0eebf60 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp @@ -248,7 +248,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_eadricAI(creature); + return GetInstanceAI(creature); } }; @@ -406,7 +406,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_paletressAI(creature); + return GetInstanceAI(creature); } }; @@ -589,7 +589,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_argent_soldierAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp index 1922ad26060..468ab681389 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp @@ -300,7 +300,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_black_knightAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp index 8bff123af75..3f86e75a410 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp @@ -300,7 +300,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new generic_vehicleAI_toc5AI(creature); + return GetInstanceAI(creature); } }; @@ -433,7 +433,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_warrior_toc5AI(creature); + return GetInstanceAI(creature); } }; @@ -572,7 +572,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_mage_toc5AI(creature); + return GetInstanceAI(creature); } }; @@ -719,7 +719,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_shaman_toc5AI(creature); + return GetInstanceAI(creature); } }; @@ -875,7 +875,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_hunter_toc5AI(creature); + return GetInstanceAI(creature); } }; @@ -996,7 +996,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_rouge_toc5AI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp index 00b312aa407..2add4e9a1dd 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp @@ -472,7 +472,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_announcer_toc5AI(creature); + return GetInstanceAI(creature); } bool OnGossipHello(Player* player, Creature* creature) OVERRIDE diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index 32a8a2fe379..ddd906c790c 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -423,7 +423,7 @@ class boss_anubarak_trial : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_anubarak_trialAI(creature); + return GetInstanceAI(creature); }; }; @@ -495,7 +495,7 @@ class npc_swarm_scarab : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_swarm_scarabAI(creature); + return GetInstanceAI(creature); }; }; @@ -583,7 +583,7 @@ class npc_nerubian_burrower : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_nerubian_burrowerAI(creature); + return GetInstanceAI(creature); }; }; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp index 4c73d1a5f55..db926c32f96 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp @@ -539,7 +539,7 @@ class boss_toc_champion_controller : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_toc_champion_controllerAI(creature); + return GetInstanceAI(creature); } }; @@ -839,7 +839,7 @@ class npc_toc_druid : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_druidAI(creature); + return GetInstanceAI(creature); } }; @@ -932,7 +932,7 @@ class npc_toc_shaman : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_shamanAI(creature); + return GetInstanceAI(creature); } }; @@ -1036,7 +1036,7 @@ class npc_toc_paladin : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_paladinAI(creature); + return GetInstanceAI(creature); } }; @@ -1121,7 +1121,7 @@ class npc_toc_priest : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_priestAI(creature); + return GetInstanceAI(creature); } }; @@ -1219,7 +1219,7 @@ class npc_toc_shadow_priest : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_shadow_priestAI(creature); + return GetInstanceAI(creature); } }; @@ -1310,7 +1310,7 @@ class npc_toc_warlock : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_warlockAI(creature); + return GetInstanceAI(creature); } }; @@ -1404,7 +1404,7 @@ class npc_toc_mage : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_mageAI(creature); + return GetInstanceAI(creature); } }; @@ -1506,7 +1506,7 @@ class npc_toc_hunter : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_hunterAI(creature); + return GetInstanceAI(creature); } }; @@ -1598,7 +1598,7 @@ class npc_toc_boomkin : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_boomkinAI(creature); + return GetInstanceAI(creature); } }; @@ -1702,7 +1702,7 @@ class npc_toc_warrior : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_warriorAI(creature); + return GetInstanceAI(creature); } }; @@ -1798,7 +1798,7 @@ class npc_toc_dk : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_dkAI(creature); + return GetInstanceAI(creature); } }; @@ -1903,7 +1903,7 @@ class npc_toc_rogue : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_rogueAI(creature); + return GetInstanceAI(creature); } }; @@ -2029,7 +2029,7 @@ class npc_toc_enh_shaman : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_enh_shamanAI(creature); + return GetInstanceAI(creature); } }; @@ -2135,7 +2135,7 @@ class npc_toc_retro_paladin : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_retro_paladinAI(creature); + return GetInstanceAI(creature); } }; @@ -2187,7 +2187,7 @@ class npc_toc_pet_warlock : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_pet_warlockAI(creature); + return GetInstanceAI(creature); } }; @@ -2227,7 +2227,7 @@ class npc_toc_pet_hunter : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toc_pet_hunterAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp index 3fa9ac7387f..55372e73721 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp @@ -214,7 +214,7 @@ class boss_jaraxxus : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_jaraxxusAI(creature); + return GetInstanceAI(creature); } }; @@ -250,7 +250,7 @@ class npc_legion_flame : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_legion_flameAI(creature); + return GetInstanceAI(creature); } }; @@ -355,7 +355,7 @@ class npc_fel_infernal : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_fel_infernalAI(creature); + return GetInstanceAI(creature); } }; @@ -488,7 +488,7 @@ class npc_mistress_of_pain : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_mistress_of_painAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp index 5b90676fffc..3784c69225f 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -284,7 +284,7 @@ class boss_gormok : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_gormokAI(creature); + return GetInstanceAI(creature); } }; @@ -454,7 +454,7 @@ class npc_snobold_vassal : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_snobold_vassalAI(creature); + return GetInstanceAI(creature); } }; @@ -490,7 +490,7 @@ class npc_firebomb : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_firebombAI(creature); + return GetInstanceAI(creature); } }; @@ -712,7 +712,7 @@ class boss_acidmaw : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_acidmawAI(creature); + return GetInstanceAI(creature); } }; @@ -779,7 +779,7 @@ class boss_dreadscale : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_dreadscaleAI(creature); + return GetInstanceAI(creature); } }; @@ -820,7 +820,7 @@ class npc_slime_pool : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_slime_poolAI(creature); + return GetInstanceAI(creature); } }; @@ -1137,7 +1137,7 @@ class boss_icehowl : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_icehowlAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp index 0674696a033..88a404e8dfd 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -451,7 +451,7 @@ class boss_fjola : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_fjolaAI(creature); + return GetInstanceAI(creature); } }; @@ -486,7 +486,7 @@ class boss_eydis : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_eydisAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp index 36cf9432d96..cd3a4e26924 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp @@ -357,7 +357,7 @@ class boss_lich_king_toc : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_lich_king_tocAI(creature); + return GetInstanceAI(creature); } }; @@ -531,7 +531,7 @@ class npc_fizzlebang_toc : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_fizzlebang_tocAI(creature); + return GetInstanceAI(creature); } }; @@ -819,7 +819,7 @@ class npc_tirion_toc : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_tirion_tocAI(creature); + return GetInstanceAI(creature); } }; @@ -903,7 +903,7 @@ class npc_garrosh_toc : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_garrosh_tocAI(creature); + return GetInstanceAI(creature); } }; @@ -987,7 +987,7 @@ class npc_varian_toc : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_varian_tocAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp index 2dedc986b0c..7d1fbc752be 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp @@ -188,7 +188,7 @@ class boss_bronjahm : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_bronjahmAI(creature); + return GetInstanceAI(creature); } }; @@ -231,7 +231,7 @@ class npc_corrupted_soul_fragment : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_corrupted_soul_fragmentAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp index f3ed568fe23..52ab910fb9e 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp @@ -345,7 +345,7 @@ class boss_devourer_of_souls : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_devourer_of_soulsAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp index cfa149c134f..0fc5ee29ca0 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp @@ -193,7 +193,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_sylvanas_fosAI(creature); + return GetInstanceAI(creature); } }; @@ -330,7 +330,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_jaina_fosAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp index e2d285f7306..fbdd7f96fbe 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp @@ -52,7 +52,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_falricAI(creature); + return GetInstanceAI(creature); } struct boss_falricAI : public boss_horAI diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp index a87b7b6d93d..b13cae79434 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp @@ -51,7 +51,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_marwynAI(creature); + return GetInstanceAI(creature); } struct boss_marwynAI : public boss_horAI diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index 96b772df5a9..2561dca0a4a 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -1283,7 +1283,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ghostly_priestAI(creature); + return GetInstanceAI(creature); } }; @@ -1355,7 +1355,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_phantom_mageAI(creature); + return GetInstanceAI(creature); } }; @@ -1447,7 +1447,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_shadowy_mercenaryAI(creature); + return GetInstanceAI(creature); } }; @@ -1499,7 +1499,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_spectral_footmanAI(creature); + return GetInstanceAI(creature); } }; @@ -1558,7 +1558,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_tortured_riflemanAI(creature); + return GetInstanceAI(creature); } }; @@ -1674,7 +1674,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_frostworn_generalAI(creature); + return GetInstanceAI(creature); } }; @@ -1901,7 +1901,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_raging_ghoulAI(creature); + return GetInstanceAI(creature); } }; @@ -2021,7 +2021,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_risen_witch_doctorAI(creature); + return GetInstanceAI(creature); } }; @@ -2111,7 +2111,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_lumbering_abominationAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp index 93030492caf..f6973581a59 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp @@ -248,7 +248,7 @@ class boss_drakkari_colossus : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_drakkari_colossusAI(creature); + return GetInstanceAI(creature); } }; @@ -381,7 +381,7 @@ class boss_drakkari_elemental : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_drakkari_elementalAI(creature); + return GetInstanceAI(creature); } }; @@ -392,7 +392,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_living_mojoAI(creature); + return GetInstanceAI(creature); } struct npc_living_mojoAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp index c11db7146d1..e597c4c9e96 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp @@ -37,7 +37,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_eckAI(creature); + return GetInstanceAI(creature); } struct boss_eckAI : public ScriptedAI @@ -141,7 +141,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ruins_dwellerAI(creature); + return GetInstanceAI(creature); } struct npc_ruins_dwellerAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp index 7a5520ab145..0337dc07d8a 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp @@ -70,7 +70,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_gal_darahAI(creature); + return GetInstanceAI(creature); } struct boss_gal_darahAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp b/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp index 0ccaea316ef..2b621a70a68 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp @@ -54,7 +54,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_moorabiAI(creature); + return GetInstanceAI(creature); } struct boss_moorabiAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp index 4c25bead1b4..0dcc2ca9c6e 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp @@ -76,7 +76,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_slad_ranAI(creature); + return GetInstanceAI(creature); } struct boss_slad_ranAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp index bbd700b7edd..9684c7d9cdf 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp @@ -666,7 +666,7 @@ class npc_the_lich_king_controller : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_the_lich_king_controllerAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp index b873b3ee15c..f6d4b5f786e 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp @@ -59,7 +59,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_anubrekhanAI(creature); + return GetInstanceAI(creature); } struct boss_anubrekhanAI : public BossAI diff --git a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp index b723c2f4139..2d216c78ea8 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp @@ -216,7 +216,7 @@ class npc_faerlina_add : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_faerlina_addAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp index 9b336a77e26..04dba1d9fab 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp @@ -89,7 +89,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_four_horsemenAI(creature); + return GetInstanceAI(creature); } struct boss_four_horsemenAI : public BossAI diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp index f76c46d96ff..46c16320547 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp @@ -500,7 +500,7 @@ class boss_gothik : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_gothikAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp index a8e2783602f..3dad2798d2f 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp @@ -61,7 +61,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_heiganAI(creature); + return GetInstanceAI(creature); } struct boss_heiganAI : public BossAI diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp index f9efdfce28b..e112be27b21 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp @@ -649,7 +649,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_kelthuzadAI(creature); + return GetInstanceAI(creature); } }; @@ -769,7 +769,7 @@ class npc_kelthuzad_abomination : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_kelthuzad_abominationAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp index b56ecdd8b53..d653be216dc 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp @@ -217,7 +217,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_nothAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp index 96f2d743cac..f6e91d51af1 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp @@ -57,7 +57,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_patchwerkAI(creature); + return GetInstanceAI(creature); } struct boss_patchwerkAI : public BossAI diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp index 3d121887471..5548e5b7ad4 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp @@ -110,7 +110,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_thaddiusAI(creature); + return GetInstanceAI(creature); } struct boss_thaddiusAI : public BossAI @@ -285,7 +285,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_stalaggAI(creature); + return GetInstanceAI(creature); } struct npc_stalaggAI : public ScriptedAI @@ -379,7 +379,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_feugenAI(creature); + return GetInstanceAI(creature); } struct npc_feugenAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index d113daa4954..81f14206d65 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -1074,7 +1074,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_malygosAI(creature); + return GetInstanceAI(creature); } }; @@ -1127,7 +1127,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_portal_eoeAI(creature); + return GetInstanceAI(creature); } }; @@ -1190,7 +1190,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_power_sparkAI(creature); + return GetInstanceAI(creature); } }; @@ -1292,7 +1292,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_melee_hover_diskAI(creature); + return GetInstanceAI(creature); } }; @@ -1374,7 +1374,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_caster_hover_diskAI(creature); + return GetInstanceAI(creature); } }; @@ -1450,7 +1450,7 @@ class npc_nexus_lord : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_nexus_lordAI(creature); + return GetInstanceAI(creature); } }; @@ -1517,7 +1517,7 @@ class npc_scion_of_eternity : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_scion_of_eternityAI(creature); + return GetInstanceAI(creature); } }; @@ -1575,7 +1575,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_arcane_overloadAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp index f05d065ab34..5d4167cc053 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp @@ -187,7 +187,7 @@ class boss_anomalus : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_anomalusAI(creature); + return GetInstanceAI(creature); } }; @@ -255,7 +255,7 @@ class npc_chaotic_rift : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_chaotic_riftAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp index f598de52e49..4d58a3449b9 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp @@ -61,7 +61,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_keristraszaAI(creature); + return GetInstanceAI(creature); } struct boss_keristraszaAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp index 1656d4c5a72..96c8f8c0ec5 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp @@ -65,7 +65,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_magus_telestraAI(creature); + return GetInstanceAI(creature); } struct boss_magus_telestraAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp index d911aa8ed1a..2c7b16d1160 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp @@ -160,7 +160,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_ormorokAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp index 385f80ae37d..3d1872e3f80 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp @@ -241,7 +241,7 @@ class npc_azure_ring_captain : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_azure_ring_captainAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp index 7d1f2d86b18..b2cdfe0c854 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp @@ -99,7 +99,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_bjarngrimAI(creature); + return GetInstanceAI(creature); } struct boss_bjarngrimAI : public ScriptedAI @@ -391,7 +391,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_stormforged_lieutenantAI(creature); + return GetInstanceAI(creature); } struct npc_stormforged_lieutenantAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp index 68116452082..350a036e861 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp @@ -72,7 +72,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_ionarAI(creature); + return GetInstanceAI(creature); } struct boss_ionarAI : public ScriptedAI @@ -302,7 +302,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_spark_of_ionarAI(creature); + return GetInstanceAI(creature); } struct npc_spark_of_ionarAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp index af6cc7350c3..a2aceb92832 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp @@ -69,7 +69,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_lokenAI(creature); + return GetInstanceAI(creature); } struct boss_lokenAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp index 8f231457619..c916bd06d1f 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp @@ -75,7 +75,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_volkhanAI(creature); + return GetInstanceAI(creature); } struct boss_volkhanAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp index e2a8ab25cac..d7fccf22d72 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp @@ -315,7 +315,7 @@ class npc_auriaya_seeping_trigger : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_auriaya_seeping_triggerAI(creature); + return GetInstanceAI(creature); } }; @@ -390,7 +390,7 @@ class npc_sanctum_sentry : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_sanctum_sentryAI(creature); + return GetInstanceAI(creature); } }; @@ -466,7 +466,7 @@ class npc_feral_defender : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_feral_defenderAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 44c380465a4..14588087e83 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -619,7 +619,7 @@ class boss_flame_leviathan_seat : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_flame_leviathan_seatAI(creature); + return GetInstanceAI(creature); } }; @@ -898,7 +898,7 @@ class npc_colossus : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_colossusAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index e8f8e7684c2..19f22947b7c 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -1146,7 +1146,7 @@ class npc_ancient_water_spirit : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ancient_water_spiritAI(creature); + return GetInstanceAI(creature); } }; @@ -1213,7 +1213,7 @@ class npc_storm_lasher : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_storm_lasherAI(creature); + return GetInstanceAI(creature); } }; @@ -1258,7 +1258,7 @@ class npc_snaplasher : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_snaplasherAI(creature); + return GetInstanceAI(creature); } }; @@ -1522,7 +1522,7 @@ class npc_unstable_sun_beam : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_unstable_sun_beamAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp index 46776ae9b96..d4ef496dba0 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp @@ -369,7 +369,7 @@ class boss_saronite_animus : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_saronite_animusAI(creature); + return GetInstanceAI(creature); } }; @@ -439,7 +439,7 @@ class npc_saronite_vapors : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_saronite_vaporsAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp index 2fb165b935e..344fd7d3e85 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp @@ -235,7 +235,7 @@ class npc_flash_freeze : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_flash_freezeAI(creature); + return GetInstanceAI(creature); } }; @@ -296,7 +296,7 @@ class npc_ice_block : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ice_blockAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp index 31c635c7de5..30b0e41f52a 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp @@ -300,7 +300,7 @@ class boss_razorscale_controller : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_razorscale_controllerAI(creature); + return GetInstanceAI(creature); } }; @@ -735,7 +735,7 @@ class npc_expedition_commander : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_expedition_commanderAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp index 3997a484323..f8a78975117 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp @@ -477,7 +477,7 @@ class npc_xt002_heart : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_xt002_heartAI(creature); + return GetInstanceAI(creature); } }; @@ -493,7 +493,7 @@ class npc_scrapbot : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_scrapbotAI(creature); + return GetInstanceAI(creature); } struct npc_scrapbotAI : public ScriptedAI @@ -550,7 +550,7 @@ class npc_pummeller : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_pummellerAI(creature); + return GetInstanceAI(creature); } struct npc_pummellerAI : public ScriptedAI @@ -652,7 +652,7 @@ class npc_boombot : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_boombotAI(creature); + return GetInstanceAI(creature); } struct npc_boombotAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp index 7a25077cadd..5666c701807 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp @@ -256,7 +256,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ravenous_furbolgAI(creature); + return GetInstanceAI(creature); } struct npc_ravenous_furbolgAI : public ScriptedAI @@ -364,7 +364,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_frenzied_worgenAI(creature); + return GetInstanceAI(creature); } struct npc_frenzied_worgenAI : public ScriptedAI @@ -475,7 +475,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ferocious_rhinoAI(creature); + return GetInstanceAI(creature); } struct npc_ferocious_rhinoAI : public ScriptedAI @@ -590,7 +590,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_massive_jormungarAI(creature); + return GetInstanceAI(creature); } struct npc_massive_jormungarAI : public ScriptedAI @@ -691,7 +691,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_palehoof_orbAI(creature); + return GetInstanceAI(creature); } struct npc_palehoof_orbAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index 6fdbea2086d..6bbecb35cfb 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -162,7 +162,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_skadiAI(creature); + return GetInstanceAI(creature); } struct boss_skadiAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp index 1ceddd4bd66..6fc0ffa2d45 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp @@ -268,7 +268,7 @@ class npc_tempest_minion : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_tempest_minionAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp index e8e54184cb3..7a42983d4e8 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp @@ -277,7 +277,7 @@ class npc_frozen_orb_stalker : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_frozen_orb_stalkerAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp index 80ebc01debc..5a2bdaad803 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp @@ -50,7 +50,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_cyanigosaAI(creature); + return GetInstanceAI(creature); } struct boss_cyanigosaAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp index 883ea8fa0c0..eb129bcc774 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp @@ -49,7 +49,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_erekemAI(creature); + return GetInstanceAI(creature); } struct boss_erekemAI : public ScriptedAI @@ -266,7 +266,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_erekem_guardAI(creature); + return GetInstanceAI(creature); } struct npc_erekem_guardAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp index 4852b6cea07..d190c8ae90d 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp @@ -78,7 +78,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_ichoronAI(creature); + return GetInstanceAI(creature); } struct boss_ichoronAI : public ScriptedAI @@ -342,7 +342,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ichor_globuleAI(creature); + return GetInstanceAI(creature); } struct npc_ichor_globuleAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp b/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp index 964f6b75e72..f8b21707a7a 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp @@ -37,7 +37,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_lavanthorAI(creature); + return GetInstanceAI(creature); } struct boss_lavanthorAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp b/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp index d5dd41e7a90..7da9f75ffe6 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp @@ -33,7 +33,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_moraggAI(creature); + return GetInstanceAI(creature); } struct boss_moraggAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp b/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp index 8b39c48fb92..a3e4bfe43f6 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp @@ -63,7 +63,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_xevozzAI(creature); + return GetInstanceAI(creature); } struct boss_xevozzAI : public ScriptedAI @@ -231,7 +231,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ethereal_sphereAI(creature); + return GetInstanceAI(creature); } struct npc_ethereal_sphereAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp index 3db389ac703..bcb1a60c744 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp @@ -58,7 +58,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_zuramatAI(creature); + return GetInstanceAI(creature); } struct boss_zuramatAI : public ScriptedAI diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp index 6897153c44d..491d3bd38ac 100644 --- a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp @@ -307,7 +307,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_sinclariAI(creature); + return GetInstanceAI(creature); } struct npc_sinclariAI : public ScriptedAI @@ -428,7 +428,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_azure_saboteurAI(creature); + return GetInstanceAI(creature); } struct npc_azure_saboteurAI : public npc_escortAI @@ -552,7 +552,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_teleportation_portalAI(creature); + return GetInstanceAI(creature); } struct npc_teleportation_portalAI : public ScriptedAI @@ -809,7 +809,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_azure_invaderAI(creature); + return GetInstanceAI(creature); } struct npc_azure_invaderAI : public violet_hold_trashAI @@ -887,7 +887,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_azure_binderAI(creature); + return GetInstanceAI(creature); } struct npc_azure_binderAI : public violet_hold_trashAI @@ -965,7 +965,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_azure_mage_slayerAI(creature); + return GetInstanceAI(creature); } struct npc_azure_mage_slayerAI : public violet_hold_trashAI @@ -1025,7 +1025,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_azure_raiderAI(creature); + return GetInstanceAI(creature); } struct npc_azure_raiderAI : public violet_hold_trashAI @@ -1131,7 +1131,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_azure_stalkerAI(creature); + return GetInstanceAI(creature); } }; @@ -1210,7 +1210,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_azure_spellbreakerAI(creature); + return GetInstanceAI(creature); } }; @@ -1221,7 +1221,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_azure_captainAI(creature); + return GetInstanceAI(creature); } struct npc_azure_captainAI : public violet_hold_trashAI @@ -1273,7 +1273,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_azure_sorcerorAI(creature); + return GetInstanceAI(creature); } struct npc_azure_sorcerorAI : public violet_hold_trashAI diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index cef6c3388de..98a7f456d76 100644 --- a/src/server/scripts/Northrend/zone_borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -439,6 +439,9 @@ public: me->SetReactState(REACT_PASSIVE); + if (!me->GetOwner()) + return; + switch (me->GetOwner()->ToPlayer()->GetTeamId()) { case TEAM_ALLIANCE: diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.cpp b/src/server/scripts/Outland/BlackTemple/black_temple.cpp index 57c494756e5..0f13a03f568 100644 --- a/src/server/scripts/Outland/BlackTemple/black_temple.cpp +++ b/src/server/scripts/Outland/BlackTemple/black_temple.cpp @@ -207,7 +207,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_wrathbone_flayerAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp index 3a33885144d..9029a8bd2cd 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp @@ -64,7 +64,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_gurtogg_bloodboilAI(creature); + return GetInstanceAI(creature); } struct boss_gurtogg_bloodboilAI : public ScriptedAI diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 46e5c5783e6..2b312aeacde 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -1126,7 +1126,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_illidan_stormrageAI(creature); + return GetInstanceAI(creature); } }; @@ -1794,7 +1794,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_akama_illidanAI(creature); + return GetInstanceAI(creature); } }; @@ -2228,7 +2228,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_parasitic_shadowfiendAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp index aafe5f365b2..6691d04441b 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp @@ -84,7 +84,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_shahrazAI(creature); + return GetInstanceAI(creature); } struct boss_shahrazAI : public ScriptedAI diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp index ad913a45071..0c8d7a7206c 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp @@ -134,7 +134,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_reliquary_of_soulsAI(creature); + return GetInstanceAI(creature); } struct boss_reliquary_of_soulsAI : public ScriptedAI diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp index 1a2a55e6d00..0f67ba822a1 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -405,7 +405,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_shade_of_akamaAI(creature); + return GetInstanceAI(creature); } }; @@ -550,7 +550,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_akamaAI(creature); + return GetInstanceAI(creature); } }; @@ -622,7 +622,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ashtongue_channelerAI(creature); + return GetInstanceAI(creature); } }; @@ -730,7 +730,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_creature_generator_akamaAI(creature); + return GetInstanceAI(creature); } }; @@ -851,7 +851,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ashtongue_sorcererAI(creature); + return GetInstanceAI(creature); } }; @@ -941,7 +941,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ashtongue_defenderAI(creature); + return GetInstanceAI(creature); } }; @@ -1021,7 +1021,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ashtongue_rogueAI(creature); + return GetInstanceAI(creature); } }; @@ -1101,7 +1101,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ashtongue_elementalistAI(creature); + return GetInstanceAI(creature); } }; @@ -1198,7 +1198,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ashtongue_spiritbinderAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp index b62e7b35a3c..0ba2a16e9df 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp @@ -90,7 +90,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_supremusAI(creature); + return GetInstanceAI(creature); } struct boss_supremusAI : public ScriptedAI diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp index 7d445e23053..e8f2f75abc1 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp @@ -217,7 +217,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_teron_gorefiendAI(creature); + return GetInstanceAI(creature); } struct boss_teron_gorefiendAI : public ScriptedAI diff --git a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp index 1f4a36afad6..c3dceaffd91 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp @@ -78,7 +78,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_najentusAI(creature); + return GetInstanceAI(creature); } struct boss_najentusAI : public ScriptedAI diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp index 057bb725c32..1ac413f237d 100644 --- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -218,7 +218,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_illidari_councilAI(creature); + return GetInstanceAI(creature); } struct npc_illidari_councilAI : public ScriptedAI @@ -476,7 +476,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_gathios_the_shattererAI(creature); + return GetInstanceAI(creature); } struct boss_gathios_the_shattererAI : public boss_illidari_councilAI @@ -608,7 +608,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_high_nethermancer_zerevorAI(creature); + return GetInstanceAI(creature); } struct boss_high_nethermancer_zerevorAI : public boss_illidari_councilAI @@ -712,7 +712,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_lady_malandeAI(creature); + return GetInstanceAI(creature); } struct boss_lady_malandeAI : public boss_illidari_councilAI @@ -790,7 +790,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_veras_darkshadowAI(creature); + return GetInstanceAI(creature); } struct boss_veras_darkshadowAI : public boss_illidari_councilAI diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp index 6ccf69ae39b..b31afd1cdc9 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp @@ -104,7 +104,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_fathomlord_karathressAI(creature); + return GetInstanceAI(creature); } struct boss_fathomlord_karathressAI : public ScriptedAI @@ -312,7 +312,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_fathomguard_sharkkisAI(creature); + return GetInstanceAI(creature); } struct boss_fathomguard_sharkkisAI : public ScriptedAI @@ -459,7 +459,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_fathomguard_tidalvessAI(creature); + return GetInstanceAI(creature); } struct boss_fathomguard_tidalvessAI : public ScriptedAI @@ -582,7 +582,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_fathomguard_caribdisAI(creature); + return GetInstanceAI(creature); } struct boss_fathomguard_caribdisAI : public ScriptedAI diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp index d6205cb3ec7..26119e0eb31 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp @@ -86,7 +86,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_hydross_the_unstableAI(creature); + return GetInstanceAI(creature); } struct boss_hydross_the_unstableAI : public ScriptedAI diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index e1d6955cd7d..53ed13e8515 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -140,7 +140,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_lady_vashjAI(creature); + return GetInstanceAI(creature); } struct boss_lady_vashjAI : public ScriptedAI @@ -556,7 +556,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_enchanted_elementalAI(creature); + return GetInstanceAI(creature); } struct npc_enchanted_elementalAI : public ScriptedAI @@ -651,7 +651,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_tainted_elementalAI(creature); + return GetInstanceAI(creature); } struct npc_tainted_elementalAI : public ScriptedAI @@ -720,7 +720,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_toxic_sporebatAI(creature); + return GetInstanceAI(creature); } struct npc_toxic_sporebatAI : public ScriptedAI @@ -819,7 +819,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_shield_generator_channelAI(creature); + return GetInstanceAI(creature); } struct npc_shield_generator_channelAI : public ScriptedAI diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp index 83ec5e053c0..bfe63b80e48 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp @@ -181,7 +181,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_leotheras_the_blindAI(creature); + return GetInstanceAI(creature); } struct boss_leotheras_the_blindAI : public ScriptedAI @@ -677,7 +677,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_greyheart_spellbinderAI(creature); + return GetInstanceAI(creature); } struct npc_greyheart_spellbinderAI : public ScriptedAI diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp index c4a55065f27..392ad2fe2b4 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp @@ -81,7 +81,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_the_lurker_belowAI(creature); + return GetInstanceAI(creature); } struct boss_the_lurker_belowAI : public ScriptedAI diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp index 48a4a1e5ecd..6f507a3c50f 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp @@ -91,7 +91,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_morogrim_tidewalkerAI(creature); + return GetInstanceAI(creature); } struct boss_morogrim_tidewalkerAI : public ScriptedAI diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp index d6162fd1ea4..c7d99b8da85 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp @@ -41,7 +41,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_thespiaAI(creature); + return GetInstanceAI(creature); } struct boss_thespiaAI : public ScriptedAI diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp index 241d0f8fec2..6a94fc7ff00 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp @@ -57,7 +57,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_mekgineer_steamriggerAI(creature); + return GetInstanceAI(creature); } struct boss_mekgineer_steamriggerAI : public ScriptedAI @@ -197,7 +197,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_steamrigger_mechanicAI(creature); + return GetInstanceAI(creature); } struct npc_steamrigger_mechanicAI : public ScriptedAI diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp index 887d51a43bf..7deed59f8c4 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp @@ -50,7 +50,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_naga_distillerAI(creature); + return GetInstanceAI(creature); } struct npc_naga_distillerAI : public ScriptedAI @@ -108,7 +108,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_warlord_kalithreshAI(creature); + return GetInstanceAI(creature); } struct boss_warlord_kalithreshAI : public ScriptedAI diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp index 307a329fd95..d238bf98041 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp @@ -155,7 +155,7 @@ class boss_broggok : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_broggokAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp index 75ccc962996..0aec396afdd 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp @@ -275,7 +275,7 @@ class boss_kelidan_the_breaker : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_kelidan_the_breakerAI(creature); + return GetInstanceAI(creature); } }; @@ -373,7 +373,7 @@ class npc_shadowmoon_channeler : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_shadowmoon_channelerAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp index 33e23c12d14..b41b21c5d17 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp @@ -156,7 +156,7 @@ class boss_the_maker : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_the_makerAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp index 7e80182f1e8..6f8eac88c66 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp @@ -224,7 +224,7 @@ class boss_omor_the_unscarred : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_omor_the_unscarredAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp index 44fcc7b8fe1..5657880cbb6 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp @@ -457,7 +457,7 @@ class boss_magtheridon : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_magtheridonAI(creature); + return GetInstanceAI(creature); } }; @@ -576,7 +576,7 @@ class npc_hellfire_channeler : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_hellfire_channelerAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp index 981774a677b..93f8b4f5030 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp @@ -297,7 +297,7 @@ class boss_grand_warlock_nethekurse : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_grand_warlock_nethekurseAI(creature); + return GetInstanceAI(creature); } }; @@ -369,7 +369,7 @@ class npc_fel_orc_convert : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_fel_orc_convertAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp index 9c4be7c0b1b..d5e56e13f24 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp @@ -388,7 +388,7 @@ class boss_warbringer_omrogg : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_warbringer_omroggAI(creature); + return GetInstanceAI(creature); } }; @@ -438,7 +438,7 @@ class npc_omrogg_heads : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_omrogg_headsAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp index f9ec3edb362..4aab27024c1 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp @@ -311,7 +311,7 @@ class boss_warchief_kargath_bladefist : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_warchief_kargath_bladefistAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index 07401e1efbb..4659c7bc627 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -451,7 +451,7 @@ class boss_alar : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_alarAI(creature); + return GetInstanceAI(creature); } }; @@ -528,7 +528,7 @@ class npc_ember_of_alar : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ember_of_alarAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp index c5c3f6deb12..aede4a6cefc 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp @@ -419,7 +419,7 @@ class boss_high_astromancer_solarian : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_high_astromancer_solarianAI(creature); + return GetInstanceAI(creature); } }; @@ -506,7 +506,7 @@ class npc_solarium_priest : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_solarium_priestAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index a6ff49d1e48..5651707985c 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -1011,7 +1011,7 @@ class boss_kaelthas : public CreatureScript }; CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_kaelthasAI(creature); + return GetInstanceAI(creature); } }; @@ -1109,7 +1109,7 @@ class boss_thaladred_the_darkener : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_thaladred_the_darkenerAI(creature); + return GetInstanceAI(creature); } }; @@ -1177,7 +1177,7 @@ class boss_lord_sanguinar : public CreatureScript }; CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_lord_sanguinarAI(creature); + return GetInstanceAI(creature); } }; //Grand Astromancer Capernian AI @@ -1321,7 +1321,7 @@ class boss_grand_astromancer_capernian : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_grand_astromancer_capernianAI(creature); + return GetInstanceAI(creature); } }; @@ -1404,7 +1404,7 @@ class boss_master_engineer_telonicus : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_master_engineer_telonicusAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp index f842ed19f3c..ef53d8fed92 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp @@ -172,7 +172,7 @@ class boss_void_reaver : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_void_reaverAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp index b5172245b49..7e4fc5c9bb5 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp @@ -223,7 +223,7 @@ class npc_ragin_flames : public CreatureScript }; CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_ragin_flamesAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp index bb8bbe9215e..2df2d272c3e 100644 --- a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp @@ -132,8 +132,9 @@ public: void JustDied(Unit* killer) OVERRIDE { - if (killer->ToPlayer()->GetQuestRewardStatus(QUEST_INTO_THE_SOULGRINDER)) - Talk(SAY_DEATH); + if (killer->GetTypeId() == TYPEID_PLAYER) + if (killer->ToPlayer()->GetQuestRewardStatus(QUEST_INTO_THE_SOULGRINDER)) + Talk(SAY_DEATH); } void MoveInLineOfSight(Unit* who) OVERRIDE -- cgit v1.2.3 From 079905e29aa9158d0e33c0c27536e514bc662e36 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 29 Dec 2013 14:59:06 +0100 Subject: Core/Transports * Fixed transport orientation * Fixed transport position desynchronization for stoppable transports * Ignore spawnMask errors for objects spawned on transports --- .../game/Battlegrounds/Zones/BattlegroundIC.cpp | 3 + src/server/game/Entities/Transport/Transport.cpp | 58 +++++---- src/server/game/Entities/Transport/Transport.h | 2 +- src/server/game/Globals/ObjectMgr.cpp | 7 +- src/server/game/Globals/ObjectMgr.h | 2 + src/server/game/Maps/TransportMgr.cpp | 139 +++++++++++---------- src/server/game/Maps/TransportMgr.h | 3 +- src/server/game/Movement/Spline/Spline.cpp | 2 +- src/server/game/Movement/Spline/Spline.h | 2 +- src/server/scripts/Commands/cs_debug.cpp | 3 + 10 files changed, 123 insertions(+), 98 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp index 0b04d81bd5b..5ebef030518 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp @@ -397,6 +397,9 @@ bool BattlegroundIC::SetupBattleground() return false; } + gunshipHorde->EnableMovement(false); + gunshipAlliance->EnableMovement(false); + // setting correct factions for Keep Cannons for (uint8 i = BG_IC_NPC_KEEP_CANNON_1; i < BG_IC_NPC_KEEP_CANNON_12; ++i) GetBGCreature(i)->setFaction(BG_IC_Factions[0]); diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 860a84d5e83..04e388cc3ac 100644 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -90,8 +90,7 @@ bool Transport::Create(uint32 guidlow, uint32 entry, uint32 mapid, float x, floa SetPeriod(tInfo->pathTime); SetEntry(goinfo->entry); SetDisplayId(goinfo->displayId); - SetGoState(GO_STATE_READY); - _pendingStop = goinfo->moTransport.canBeStopped != 0; + SetGoState(!goinfo->moTransport.canBeStopped ? GO_STATE_READY : GO_STATE_ACTIVE); SetGoType(GAMEOBJECT_TYPE_MO_TRANSPORT); SetGoAnimProgress(animprogress); SetName(goinfo->name); @@ -111,7 +110,8 @@ void Transport::Update(uint32 diff) if (GetKeyFrames().size() <= 1) return; - m_goValue.Transport.PathProgress += diff; + if (IsMoving() || !_pendingStop) + m_goValue.Transport.PathProgress += diff; uint32 timer = m_goValue.Transport.PathProgress % GetPeriod(); @@ -132,31 +132,23 @@ void Transport::Update(uint32 diff) if (timer < _currentFrame->DepartureTime) { SetMoving(false); - if (_pendingStop) + if (_pendingStop && GetGoState() != GO_STATE_READY) + { SetGoState(GO_STATE_READY); + m_goValue.Transport.PathProgress = (m_goValue.Transport.PathProgress / GetPeriod()); + m_goValue.Transport.PathProgress *= GetPeriod(); + m_goValue.Transport.PathProgress += _currentFrame->ArriveTime; + } break; // its a stop frame and we are waiting } } - if (_pendingStop && timer >= _currentFrame->DepartureTime && GetGoState() == GO_STATE_READY) - { - m_goValue.Transport.PathProgress = (m_goValue.Transport.PathProgress / GetPeriod()); - m_goValue.Transport.PathProgress *= GetPeriod(); - m_goValue.Transport.PathProgress += _currentFrame->ArriveTime; - break; - } - if (timer >= _currentFrame->DepartureTime && !_triggeredDepartureEvent) { DoEventIfAny(*_currentFrame, true); // departure event _triggeredDepartureEvent = true; } - if (timer >= _currentFrame->DepartureTime && timer < _currentFrame->NextArriveTime) - break; // found current waypoint - - MoveToNextWaypoint(); - // not waiting anymore SetMoving(true); @@ -164,13 +156,18 @@ void Transport::Update(uint32 diff) if (GetGOInfo()->moTransport.canBeStopped) SetGoState(GO_STATE_ACTIVE); + if (timer >= _currentFrame->DepartureTime && timer < _currentFrame->NextArriveTime) + break; // found current waypoint + + MoveToNextWaypoint(); + sScriptMgr->OnRelocate(this, _currentFrame->Node->index, _currentFrame->Node->mapid, _currentFrame->Node->x, _currentFrame->Node->y, _currentFrame->Node->z); TC_LOG_DEBUG("entities.transport", "Transport %u (%s) moved to node %u %u %f %f %f", GetEntry(), GetName().c_str(), _currentFrame->Node->index, _currentFrame->Node->mapid, _currentFrame->Node->x, _currentFrame->Node->y, _currentFrame->Node->z); // Departure event if (_currentFrame->IsTeleportFrame()) - if (TeleportTransport(_nextFrame->Node->mapid, _nextFrame->Node->x, _nextFrame->Node->y, _nextFrame->Node->z)) + if (TeleportTransport(_nextFrame->Node->mapid, _nextFrame->Node->x, _nextFrame->Node->y, _nextFrame->Node->z, _nextFrame->InitialOrientation)) return; // Update more in new map thread } @@ -185,7 +182,18 @@ void Transport::Update(uint32 diff) G3D::Vector3 pos, dir; _currentFrame->Spline->evaluate_percent(_currentFrame->Index, t, pos); _currentFrame->Spline->evaluate_derivative(_currentFrame->Index, t, dir); - UpdatePosition(pos.x, pos.y, pos.z, atan2(dir.x, dir.y)); + UpdatePosition(pos.x, pos.y, pos.z, atan2(dir.y, dir.x) + M_PI); + } + else + { + /* There are four possible scenarios that trigger loading/unloading passengers: + 1. transport moves from inactive to active grid + 2. the grid that transport is currently in becomes active + 3. transport moves from active to inactive grid + 4. the grid that transport is currently in unloads + */ + if (_staticPassengers.empty() && GetMap()->IsGridLoaded(GetPositionX(), GetPositionY())) // 2. + LoadStaticPassengers(); } } @@ -314,7 +322,7 @@ void Transport::UpdatePosition(float x, float y, float z, float o) 3. transport moves from active to inactive grid 4. the grid that transport is currently in unloads */ - if (_staticPassengers.empty() && newActive) // 1. and 2. + if (_staticPassengers.empty() && newActive) // 1. LoadStaticPassengers(); else if (!_staticPassengers.empty() && !newActive && Cell(x, y).DiffGrid(Cell(GetPositionX(), GetPositionY()))) // 3. UnloadStaticPassengers(); @@ -404,7 +412,7 @@ float Transport::CalculateSegmentPos(float now) return segmentPos / frame.NextDistFromPrev; } -bool Transport::TeleportTransport(uint32 newMapid, float x, float y, float z) +bool Transport::TeleportTransport(uint32 newMapid, float x, float y, float z, float o) { Map const* oldMap = GetMap(); @@ -421,7 +429,7 @@ bool Transport::TeleportTransport(uint32 newMapid, float x, float y, float z) float destX, destY, destZ, destO; obj->m_movementInfo.transport.pos.GetPosition(destX, destY, destZ, destO); - TransportBase::CalculatePassengerPosition(destX, destY, destZ, &destO, x, y, z, GetOrientation()); + TransportBase::CalculatePassengerPosition(destX, destY, destZ, &destO, x, y, z, o); switch (obj->GetTypeId()) { @@ -447,7 +455,7 @@ bool Transport::TeleportTransport(uint32 newMapid, float x, float y, float z) } } - Relocate(x, y, z, GetOrientation()); + Relocate(x, y, z, o); GetMap()->AddToMap(this); return true; } @@ -460,13 +468,13 @@ bool Transport::TeleportTransport(uint32 newMapid, float x, float y, float z) { float destX, destY, destZ, destO; (*itr)->m_movementInfo.transport.pos.GetPosition(destX, destY, destZ, destO); - TransportBase::CalculatePassengerPosition(destX, destY, destZ, &destO, x, y, z, GetOrientation()); + TransportBase::CalculatePassengerPosition(destX, destY, destZ, &destO, x, y, z, o); (*itr)->ToUnit()->NearTeleportTo(destX, destY, destZ, destO); } } - UpdatePosition(x, y, z, GetOrientation()); + UpdatePosition(x, y, z, o); return false; } } diff --git a/src/server/game/Entities/Transport/Transport.h b/src/server/game/Entities/Transport/Transport.h index e290a5d5e00..b0e80ea27b3 100644 --- a/src/server/game/Entities/Transport/Transport.h +++ b/src/server/game/Entities/Transport/Transport.h @@ -78,7 +78,7 @@ class Transport : public GameObject, public TransportBase private: void MoveToNextWaypoint(); float CalculateSegmentPos(float perc); - bool TeleportTransport(uint32 newMapid, float x, float y, float z); + bool TeleportTransport(uint32 newMapid, float x, float y, float z, float o); void UpdatePassengerPositions(std::set& passengers); void DoEventIfAny(KeyFrame const& node, bool departure); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index e4d20cbc391..38549a358a0 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1601,7 +1601,8 @@ void ObjectMgr::LoadCreatures() continue; } - if (data.spawnMask & ~spawnMasks[data.mapid]) + // Skip spawnMask check for transport maps + if (!_transportMaps.count(data.mapid) && data.spawnMask & ~spawnMasks[data.mapid]) TC_LOG_ERROR("sql.sql", "Table `creature` have creature (GUID: %u) that have wrong spawn mask %u including not supported difficulty modes for map (Id: %u).", guid, data.spawnMask, data.mapid); bool ok = true; @@ -1936,7 +1937,7 @@ void ObjectMgr::LoadGameobjects() data.spawnMask = fields[14].GetUInt8(); - if (data.spawnMask & ~spawnMasks[data.mapid]) + if (!_transportMaps.count(data.mapid) && data.spawnMask & ~spawnMasks[data.mapid]) TC_LOG_ERROR("sql.sql", "Table `gameobject` has gameobject (GUID: %u Entry: %u) that has wrong spawn mask %u including not supported difficulty modes for map (Id: %u), skip", guid, data.id, data.spawnMask, data.mapid); data.phaseMask = fields[15].GetUInt32(); @@ -6480,6 +6481,8 @@ void ObjectMgr::LoadGameObjectTemplate() TC_LOG_ERROR("sql.sql", "GameObject (Entry: %u GoType: %u) have data0=%u but TaxiPath (Id: %u) not exist.", entry, got.type, got.moTransport.taxiPathId, got.moTransport.taxiPathId); } + if (uint32 transportMap = got.moTransport.mapID) + _transportMaps.insert(transportMap); break; } case GAMEOBJECT_TYPE_SUMMONING_RITUAL: //18 diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index bf835ed6c4e..a99140d4572 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -1384,6 +1384,8 @@ class ObjectMgr GO_TO_GO, GO_TO_CREATURE // GO is dependant on creature }; + + std::set _transportMaps; // Helper container storing map ids that are for transports only, loaded from gameobject_template }; #define sObjectMgr ACE_Singleton::instance() diff --git a/src/server/game/Maps/TransportMgr.cpp b/src/server/game/Maps/TransportMgr.cpp index 11798201397..8e768924eb8 100644 --- a/src/server/game/Maps/TransportMgr.cpp +++ b/src/server/game/Maps/TransportMgr.cpp @@ -87,28 +87,60 @@ void TransportMgr::LoadTransportTemplates() TC_LOG_INFO("server.loading", ">> Loaded %u transport templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } +class SplineRawInitializer +{ +public: + SplineRawInitializer(Movement::PointsArray& points) : _points(points) { } + + void operator()(uint8& mode, bool& cyclic, Movement::PointsArray& points, int& lo, int& hi) const + { + mode = Movement::SplineBase::ModeCatmullrom; + cyclic = false; + points.assign(_points.begin(), _points.end()); + lo = 1; + hi = points.size(); + } + + Movement::PointsArray& _points; +}; + void TransportMgr::GeneratePath(GameObjectTemplate const* goInfo, TransportTemplate* transport) { uint32 pathId = goInfo->moTransport.taxiPathId; TaxiPathNodeList const& path = sTaxiPathNodesByPath[pathId]; std::vector& keyFrames = transport->keyFrames; - Movement::PointsArray splinePath; + Movement::PointsArray splinePath, allPoints; bool mapChange = false; - bool cyclic = true; + for (size_t i = 0; i < path.size(); ++i) + allPoints.push_back(G3D::Vector3(path[i].x, path[i].y, path[i].z)); + + // Add extra points to allow derivative calculations for all path nodes + allPoints.insert(allPoints.begin(), allPoints.front().lerp(allPoints[1], -0.2f)); + allPoints.push_back(allPoints.back().lerp(allPoints[allPoints.size() - 2], -0.2f)); + allPoints.push_back(allPoints.back().lerp(allPoints[allPoints.size() - 2], -1.0f)); + + SplineRawInitializer initer(allPoints); + TransportSpline orientationSpline; + orientationSpline.init_spline_custom(initer); + orientationSpline.initLengths(); + for (size_t i = 0; i < path.size(); ++i) { if (!mapChange) { TaxiPathNodeEntry const& node_i = path[i]; - if (i != path.size() - 1 && (node_i.actionFlag == 1 || node_i.mapid != path[i + 1].mapid)) + if (i != path.size() - 1 && (node_i.actionFlag & 1 || node_i.mapid != path[i + 1].mapid)) { - cyclic = false; keyFrames.back().Teleport = true; mapChange = true; } else { KeyFrame k(node_i); + G3D::Vector3 h; + orientationSpline.evaluate_derivative(i + 1, 0.0f, h); + k.InitialOrientation = Position::NormalizeOrientation(atan2(h.y, h.x) + M_PI); + keyFrames.push_back(k); splinePath.push_back(G3D::Vector3(node_i.x, node_i.y, node_i.z)); transport->mapsUsed.insert(k.Node->mapid); @@ -118,16 +150,15 @@ void TransportMgr::GeneratePath(GameObjectTemplate const* goInfo, TransportTempl mapChange = false; } - // Not sure if data8 means the transport can be stopped or that its path in dbc does not contain extra spline points - if (!goInfo->moTransport.canBeStopped && splinePath.size() >= 2) + if (splinePath.size() >= 2) { // Remove special catmull-rom spline points - splinePath.erase(splinePath.begin()); - keyFrames.erase(keyFrames.begin()); - splinePath.pop_back(); - keyFrames.pop_back(); - // Cyclic spline has one more extra point - if (cyclic && !splinePath.empty()) + if (!keyFrames.front().IsStopFrame() && !keyFrames.front().Node->arrivalEventID && !keyFrames.front().Node->departureEventID) + { + splinePath.erase(splinePath.begin()); + keyFrames.erase(keyFrames.begin()); + } + if (!keyFrames.back().IsStopFrame() && !keyFrames.back().Node->arrivalEventID && !keyFrames.back().Node->departureEventID) { splinePath.pop_back(); keyFrames.pop_back(); @@ -170,67 +201,41 @@ void TransportMgr::GeneratePath(GameObjectTemplate const* goInfo, TransportTempl // find the rest of the distances between key points // Every path segment has its own spline - if (cyclic) - { - TransportSpline* spline = new TransportSpline(); - spline->init_cyclic_spline(&splinePath[0], splinePath.size(), Movement::SplineBase::ModeCatmullrom, 0); - spline->initLengths(); - keyFrames[0].DistFromPrev = spline->length(spline->last() - 2, spline->last() - 1); - keyFrames[0].Spline = spline; - for (size_t i = 0; i < keyFrames.size(); ++i) - { - keyFrames[i].Index = i + 1; - keyFrames[i].DistFromPrev = spline->length(i, i + 1); - if (i > 0) - keyFrames[i - 1].NextDistFromPrev = keyFrames[i].DistFromPrev; - keyFrames[i].Spline = spline; - if (keyFrames[i].IsStopFrame()) - { - // remember first stop frame - if (firstStop == -1) - firstStop = i; - lastStop = i; - } - } - } - else + size_t start = 0; + for (size_t i = 1; i < keyFrames.size(); ++i) { - size_t start = 0; - for (size_t i = 1; i < keyFrames.size(); ++i) + if (keyFrames[i - 1].Teleport || i + 1 == keyFrames.size()) { - if (keyFrames[i - 1].Teleport || i + 1 == keyFrames.size()) + size_t extra = !keyFrames[i - 1].Teleport ? 1 : 0; + TransportSpline* spline = new TransportSpline(); + spline->init_spline(&splinePath[start], i - start + extra, Movement::SplineBase::ModeCatmullrom); + spline->initLengths(); + for (size_t j = start; j < i + extra; ++j) { - size_t extra = !keyFrames[i - 1].Teleport ? 1 : 0; - TransportSpline* spline = new TransportSpline(); - spline->init_spline(&splinePath[start], i - start + extra, Movement::SplineBase::ModeCatmullrom); - spline->initLengths(); - for (size_t j = start; j < i + extra; ++j) - { - keyFrames[j].Index = j - start + 1; - keyFrames[j].DistFromPrev = spline->length(j - start, j + 1 - start); - if (j > 0) - keyFrames[j - 1].NextDistFromPrev = keyFrames[j].DistFromPrev; - keyFrames[j].Spline = spline; - } - - if (keyFrames[i - 1].Teleport) - { - keyFrames[i].Index = i - start + 1; - keyFrames[i].DistFromPrev = 0.0f; - keyFrames[i - 1].NextDistFromPrev = 0.0f; - keyFrames[i].Spline = spline; - } - - start = i; + keyFrames[j].Index = j - start + 1; + keyFrames[j].DistFromPrev = spline->length(j - start, j + 1 - start); + if (j > 0) + keyFrames[j - 1].NextDistFromPrev = keyFrames[j].DistFromPrev; + keyFrames[j].Spline = spline; } - if (keyFrames[i].IsStopFrame()) + if (keyFrames[i - 1].Teleport) { - // remember first stop frame - if (firstStop == -1) - firstStop = i; - lastStop = i; + keyFrames[i].Index = i - start + 1; + keyFrames[i].DistFromPrev = 0.0f; + keyFrames[i - 1].NextDistFromPrev = 0.0f; + keyFrames[i].Spline = spline; } + + start = i; + } + + if (keyFrames[i].IsStopFrame()) + { + // remember first stop frame + if (firstStop == -1) + firstStop = i; + lastStop = i; } } @@ -373,7 +378,7 @@ Transport* TransportMgr::CreateTransport(uint32 entry, uint32 guid /*= 0*/, Map* float x = startNode->x; float y = startNode->y; float z = startNode->z; - float o = 0.0f; + float o = tInfo->keyFrames.begin()->InitialOrientation; // initialize the gameobject base uint32 guidLow = guid ? guid : sObjectMgr->GenerateLowGuid(HIGHGUID_MO_TRANSPORT); diff --git a/src/server/game/Maps/TransportMgr.h b/src/server/game/Maps/TransportMgr.h index 205a614eabb..c2f82069b30 100644 --- a/src/server/game/Maps/TransportMgr.h +++ b/src/server/game/Maps/TransportMgr.h @@ -38,7 +38,7 @@ typedef UNORDERED_MAP > TransportInstanceMap; struct KeyFrame { - explicit KeyFrame(TaxiPathNodeEntry const& _node) : Index(0), Node(&_node), + explicit KeyFrame(TaxiPathNodeEntry const& _node) : Index(0), Node(&_node), InitialOrientation(0.0f), DistSinceStop(-1.0f), DistUntilStop(-1.0f), DistFromPrev(-1.0f), TimeFrom(0.0f), TimeTo(0.0f), Teleport(false), ArriveTime(0), DepartureTime(0), Spline(NULL), NextDistFromPrev(0.0f), NextArriveTime(0) { @@ -46,6 +46,7 @@ struct KeyFrame uint32 Index; TaxiPathNodeEntry const* Node; + float InitialOrientation; float DistSinceStop; float DistUntilStop; float DistFromPrev; diff --git a/src/server/game/Movement/Spline/Spline.cpp b/src/server/game/Movement/Spline/Spline.cpp index 887541e2289..6424afc5d6e 100644 --- a/src/server/game/Movement/Spline/Spline.cpp +++ b/src/server/game/Movement/Spline/Spline.cpp @@ -156,7 +156,7 @@ float SplineBase::SegLengthLinear(index_type index) const return (points[index] - points[index+1]).length(); } -float SplineBase::SegLengthCatmullRom( index_type index ) const +float SplineBase::SegLengthCatmullRom(index_type index) const { ASSERT(index >= index_lo && index < index_hi); diff --git a/src/server/game/Movement/Spline/Spline.h b/src/server/game/Movement/Spline/Spline.h index dab31e957f1..1444b2872d1 100644 --- a/src/server/game/Movement/Spline/Spline.h +++ b/src/server/game/Movement/Spline/Spline.h @@ -118,7 +118,7 @@ public: /** As i can see there are a lot of ways how spline can be initialized would be no harm to have some custom initializers. */ - template inline void init_spline(Init& initializer) + template inline void init_spline_custom(Init& initializer) { initializer(m_mode, cyclic, points, index_lo, index_hi); } diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index d3e6f3e8430..433e8e5a66b 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -1382,7 +1382,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; } -- cgit v1.2.3 From 799daaae551556fce9a261c1280dd54cfd45aedd Mon Sep 17 00:00:00 2001 From: jackpoz Date: Mon, 30 Dec 2013 16:15:37 +0100 Subject: Core/Transports: Fix array overflow Fix an array overflow in TransportMgr::GeneratePath() spline code. Valgrind log: Invalid read of size 4 at : G3D::Vector3::operator*(float) const (Vector3.h:650) by : Movement::C_Evaluate(G3D::Vector3 const*, float, G3D::Matrix4 const&, G3D::Vector3&) (Spline.cpp:103) by : Movement::SplineBase::SegLengthCatmullRom(int) const (Spline.cpp:171) by : Movement::SplineBase::SegLength(int) const (in /home/jackpoz/trinity/bin/worldserver) by : Movement::Spline::initLengths() (SplineImpl.h:86) by : TransportMgr::GeneratePath(GameObjectTemplate const*, TransportTemplate*) (TransportMgr.cpp:125) by : TransportMgr::LoadTransportTemplates() (TransportMgr.cpp:78) Address 0x1d07d154 is 8 bytes after a block of size 300 alloc'd --- src/server/game/Maps/TransportMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server/game') diff --git a/src/server/game/Maps/TransportMgr.cpp b/src/server/game/Maps/TransportMgr.cpp index 8e768924eb8..328342ab303 100644 --- a/src/server/game/Maps/TransportMgr.cpp +++ b/src/server/game/Maps/TransportMgr.cpp @@ -98,7 +98,7 @@ public: cyclic = false; points.assign(_points.begin(), _points.end()); lo = 1; - hi = points.size(); + hi = points.size() - 2; } Movement::PointsArray& _points; -- cgit v1.2.3 From 6d21d33aac5c26e8541e29aeefffb1e5c4e4a596 Mon Sep 17 00:00:00 2001 From: Nawuko Date: Mon, 30 Dec 2013 20:35:37 +0100 Subject: Core: user defined literals need a space in front --- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/scripts/Commands/cs_go.cpp | 2 +- src/server/scripts/Commands/cs_gobject.cpp | 2 +- .../scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index ea6eb49e99a..acbff8fae62 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17205,7 +17205,7 @@ void Unit::OutDebugInfo() const { TC_LOG_ERROR("entities.unit", "Unit::OutDebugInfo"); TC_LOG_INFO("entities.unit", "GUID " UI64FMTD ", entry %u, type %u, name %s", GetGUID(), GetEntry(), (uint32)GetTypeId(), GetName().c_str()); - TC_LOG_INFO("entities.unit", "OwnerGUID " UI64FMTD ", MinionGUID " UI64FMTD ", CharmerGUID " UI64FMTD ", CharmedGUID "UI64FMTD, GetOwnerGUID(), GetMinionGUID(), GetCharmerGUID(), GetCharmGUID()); + TC_LOG_INFO("entities.unit", "OwnerGUID " UI64FMTD ", MinionGUID " UI64FMTD ", CharmerGUID " UI64FMTD ", CharmedGUID " UI64FMTD, GetOwnerGUID(), GetMinionGUID(), GetCharmerGUID(), GetCharmGUID()); TC_LOG_INFO("entities.unit", "In world %u, unit type mask %u", (uint32)(IsInWorld() ? 1 : 0), m_unitTypeMask); if (IsInWorld()) TC_LOG_INFO("entities.unit", "Mapid %u", GetMapId()); diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp index 5bc59bb74d3..bf41670fd58 100644 --- a/src/server/scripts/Commands/cs_go.cpp +++ b/src/server/scripts/Commands/cs_go.cpp @@ -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 << '\''; diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index 6bb927fec5e..0c59cd5a3d4 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -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()); } } diff --git a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp index d9e34ee2af3..445e3fa5f68 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp @@ -170,7 +170,7 @@ class instance_drak_tharon_keep : public InstanceMapScript return saveStream.str(); } - void Load(char const* str) OVERRIDE OVERRIDE + void Load(char const* str) OVERRIDE { if (!str) { -- cgit v1.2.3 From b2728cf1a03a2d687094b20bcd6b7181abd5aae0 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 30 Dec 2013 15:19:50 -0500 Subject: Tools/MeshExtractor: Added some debug messages --- src/server/game/Movement/PathGenerator.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/server/game') diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index 3e32be56fb0..d434c5268a9 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -58,7 +58,10 @@ bool PathGenerator::CalculatePath(float destX, float destY, float destZ, bool fo _sourceUnit->GetPosition(x, y, z); if (!Trinity::IsValidMapCoord(destX, destY, destZ) || !Trinity::IsValidMapCoord(x, y, z)) + { + TC_LOG_DEBUG("maps", "PathGenerator::CalculatePath() called with invalid map coords, destX: %f destY: %f destZ: %f x: %f y: %f z: %f for creature %u", destX, destY, destZ, x, y, z, _sourceUnit->GetGUIDLow()); return false; + } G3D::Vector3 dest(destX, destY, destZ); SetEndPosition(dest); @@ -72,6 +75,7 @@ bool PathGenerator::CalculatePath(float destX, float destY, float destZ, bool fo // check if the start and end point have a .mmtile loaded (can we pass via not loaded tile on the way?) if (!_navMesh || !_navMeshQuery || _sourceUnit->HasUnitState(UNIT_STATE_IGNORE_PATHFINDING)) { + TC_LOG_DEBUG("maps", "PathGenerator::CalculatePath() navmesh is not initialized for %u \n", _sourceUnit->GetGUIDLow()); _type = PathType(PATHFIND_NORMAL | PATHFIND_NOT_USING_PATH); return true; } @@ -136,7 +140,10 @@ bool PathGenerator::CalculatePath(float destX, float destY, float destZ, bool fo SmoothPath(polyPickExt, resultHopCount, straightPath); // Separate the path from the walls for (uint32 i = 0; i < resultHopCount; ++i) + { + TC_LOG_DEBUG("maps", "PathGenerator::CalculatePath() for %u path point %u: (%f, %f, %f)", _sourceUnit->GetGUIDLow(), i, _pathPoints[i].x, _pathPoints[i].y, _pathPoints[i].z); _pathPoints.push_back(G3D::Vector3(-straightPath[i * 3 + 2], -straightPath[i * 3 + 0], straightPath[i * 3 + 1])); + } return true; } -- cgit v1.2.3 From 64ab81059504903c411944e9242e42d1f0864551 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 30 Dec 2013 15:31:12 -0500 Subject: Tools/MeshExtractor: Corrected a mistake. --- src/server/game/Movement/PathGenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server/game') diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index d434c5268a9..365699e3854 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -141,8 +141,8 @@ bool PathGenerator::CalculatePath(float destX, float destY, float destZ, bool fo for (uint32 i = 0; i < resultHopCount; ++i) { - TC_LOG_DEBUG("maps", "PathGenerator::CalculatePath() for %u path point %u: (%f, %f, %f)", _sourceUnit->GetGUIDLow(), i, _pathPoints[i].x, _pathPoints[i].y, _pathPoints[i].z); _pathPoints.push_back(G3D::Vector3(-straightPath[i * 3 + 2], -straightPath[i * 3 + 0], straightPath[i * 3 + 1])); + TC_LOG_DEBUG("maps", "PathGenerator::CalculatePath() for %u path point %u: (%f, %f, %f)", _sourceUnit->GetGUIDLow(), i, _pathPoints[i].x, _pathPoints[i].y, _pathPoints[i].z); } return true; -- cgit v1.2.3 From 84b20f07e83c2812602babdaf04f2a48ce3ed4e3 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 30 Dec 2013 18:47:34 -0500 Subject: Core/MMaps: Clear the points on each CalculatePath call and allow for shortcut paths in case no path is available. --- src/server/game/Movement/PathGenerator.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index 365699e3854..19295f63712 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -54,12 +54,16 @@ PathGenerator::~PathGenerator() bool PathGenerator::CalculatePath(float destX, float destY, float destZ, bool forceDest) { + // Clear the previous path, just in case that the same PathGenerator instance is being used + _pathPoints.clear(); + float x, y, z; _sourceUnit->GetPosition(x, y, z); if (!Trinity::IsValidMapCoord(destX, destY, destZ) || !Trinity::IsValidMapCoord(x, y, z)) { TC_LOG_DEBUG("maps", "PathGenerator::CalculatePath() called with invalid map coords, destX: %f destY: %f destZ: %f x: %f y: %f z: %f for creature %u", destX, destY, destZ, x, y, z, _sourceUnit->GetGUIDLow()); + _type = PATHFIND_NOPATH; return false; } @@ -77,6 +81,8 @@ bool PathGenerator::CalculatePath(float destX, float destY, float destZ, bool fo { TC_LOG_DEBUG("maps", "PathGenerator::CalculatePath() navmesh is not initialized for %u \n", _sourceUnit->GetGUIDLow()); _type = PathType(PATHFIND_NORMAL | PATHFIND_NOT_USING_PATH); + _pathPoints.push_back(start); + _pathPoints.push_back(dest); return true; } @@ -109,7 +115,9 @@ bool PathGenerator::CalculatePath(float destX, float destY, float destZ, bool fo if (!startRef || !endRef) { TC_LOG_DEBUG("maps", "PathGenerator::CalculatePath() for %u no polygons found for start and end locations\n", _sourceUnit->GetGUIDLow()); - _type = PATHFIND_NOPATH; + _type = PathType(PATHFIND_NORMAL | PATHFIND_NOT_USING_PATH); + _pathPoints.push_back(start); + _pathPoints.push_back(dest); return false; } @@ -120,7 +128,9 @@ bool PathGenerator::CalculatePath(float destX, float destY, float destZ, bool fo if (!dtStatusSucceed(status)) { TC_LOG_DEBUG("maps", "PathGenerator::CalculatePath() for %u no path found for start and end locations\n", _sourceUnit->GetGUIDLow()); - _type = PATHFIND_NOPATH; + _type = PathType(PATHFIND_NORMAL | PATHFIND_NOT_USING_PATH); + _pathPoints.push_back(start); + _pathPoints.push_back(dest); return false; } @@ -133,7 +143,9 @@ bool PathGenerator::CalculatePath(float destX, float destY, float destZ, bool fo if (!dtStatusSucceed(status)) { TC_LOG_DEBUG("maps", "PathGenerator::CalculatePath() for %u no straight path found for start and end locations\n", _sourceUnit->GetGUIDLow()); - _type = PATHFIND_NOPATH; + _type = PathType(PATHFIND_NORMAL | PATHFIND_NOT_USING_PATH); + _pathPoints.push_back(start); + _pathPoints.push_back(dest); return false; } @@ -145,6 +157,7 @@ bool PathGenerator::CalculatePath(float destX, float destY, float destZ, bool fo TC_LOG_DEBUG("maps", "PathGenerator::CalculatePath() for %u path point %u: (%f, %f, %f)", _sourceUnit->GetGUIDLow(), i, _pathPoints[i].x, _pathPoints[i].y, _pathPoints[i].z); } + _type = PATHFIND_NORMAL; return true; } -- cgit v1.2.3 From 9a1282aac6befe6b3e26deb39d066fdc04452f4a Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 31 Dec 2013 13:08:45 +0100 Subject: Core/Spells: Fixed movement from SPELL_EFFECT_PULL_TOWARDS_DEST --- src/server/game/Spells/SpellEffects.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 90334281a8a..3bb74bad9d7 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -5003,8 +5003,6 @@ void Spell::EffectPullTowards(SpellEffIndex effIndex) if (!unitTarget) return; - float speedZ = (float)(m_spellInfo->Effects[effIndex].CalcValue() / 10); - float speedXY = (float)(m_spellInfo->Effects[effIndex].MiscValue/10); Position pos; if (m_spellInfo->Effects[effIndex].Effect == SPELL_EFFECT_PULL_TOWARDS_DEST) { @@ -5018,6 +5016,9 @@ void Spell::EffectPullTowards(SpellEffIndex effIndex) pos.Relocate(m_caster); } + float speedXY = float(m_spellInfo->Effects[effIndex].MiscValue) * 0.1f; + float speedZ = unitTarget->GetDistance(pos) / speedXY * 0.5f * Movement::gravity; + unitTarget->GetMotionMaster()->MoveJump(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), speedXY, speedZ); } -- cgit v1.2.3 From 1cdc2e8c2a362afc1a2ab4aa5cb3a3cb7544ea33 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 31 Dec 2013 14:12:02 +0100 Subject: Core/Movement: Fixed creature movement on transports --- src/server/game/Entities/Creature/Creature.cpp | 2 +- src/server/game/Entities/Object/Object.cpp | 4 ++++ src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index d039ee385ec..dfc283b7df1 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1477,7 +1477,7 @@ void Creature::setDeathState(DeathState s) CreatureTemplate const* cinfo = GetCreatureTemplate(); SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag); - ClearUnitState(uint32(UNIT_STATE_ALL_STATE)); + ClearUnitState(uint32(UNIT_STATE_ALL_STATE & ~UNIT_STATE_IGNORE_PATHFINDING)); SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool)); LoadCreaturesAddon(true); Motion_Initialize(); diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index e88d84d4a18..07386720c76 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1556,6 +1556,10 @@ void WorldObject::UpdateGroundPositionZ(float x, float y, float &z) const void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const { + // TODO: Allow transports to be part of dynamic vmap tree + if (GetTransport()) + return; + switch (GetTypeId()) { case TYPEID_UNIT: diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp index 2d9fe4dd27f..ecf9e0c9ede 100644 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp @@ -60,7 +60,7 @@ void HomeMovementGenerator::_setTargetLocation(Creature* owner) arrived = false; - owner->ClearUnitState(uint32(UNIT_STATE_ALL_STATE & ~UNIT_STATE_EVADE)); + owner->ClearUnitState(uint32(UNIT_STATE_ALL_STATE & ~(UNIT_STATE_EVADE | UNIT_STATE_IGNORE_PATHFINDING))); } bool HomeMovementGenerator::DoUpdate(Creature* owner, const uint32 /*time_diff*/) -- cgit v1.2.3 From 3018ff4e6cbed7e3270df7727d1a04e28a901954 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Tue, 31 Dec 2013 12:45:56 -0330 Subject: Core/Creature: Obtain Attack power and base damage from creature_classlevelstats table. --- src/server/game/Entities/Creature/Creature.cpp | 14 ++++++++------ src/server/game/Entities/Creature/Creature.h | 11 ++++++++++- src/server/game/Globals/ObjectMgr.cpp | 8 +++++++- 3 files changed, 25 insertions(+), 8 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index dfc283b7df1..5d3f717d845 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1074,15 +1074,17 @@ void Creature::SelectLevel(const CreatureTemplate* cinfo) SetModifierValue(UNIT_MOD_MANA, BASE_VALUE, (float)mana); //damage - float damagemod = 1.0f;//_GetDamageMod(rank); - SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg * damagemod); - SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg * damagemod); + float basedamage = stats->GenerateBaseDamage(cinfo); + + SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, ((basedamage + (stats->AttackPower / 14)) * cinfo->dmg_multiplier) * (cinfo->baseattacktime / 1000)); + SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (((basedamage * 1.5) + (stats->AttackPower / 14)) * cinfo->dmg_multiplier) * (cinfo->baseattacktime / 1000)); + SetBaseWeaponDamage(RANGED_ATTACK, MINDAMAGE, (basedamage + (stats->RangedAttackPower / 14)) * (cinfo->rangeattacktime / 1000)); + SetBaseWeaponDamage(RANGED_ATTACK, MAXDAMAGE, ((basedamage * 1.5) + (stats->RangedAttackPower / 14)) * (cinfo->rangeattacktime / 1000)); - SetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE, cinfo->minrangedmg * damagemod); - SetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE, cinfo->maxrangedmg * damagemod); + float damagemod = 1.0f;//_GetDamageMod(rank); - SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, cinfo->attackpower * damagemod); + SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, stats->AttackPower * damagemod); } diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 90e8bd7edb1..692ae941d9e 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -176,6 +176,7 @@ typedef UNORDERED_MAP CreatureTemplateContainer; // Represents max amount of expansions. /// @todo: Add MAX_EXPANSION constant. #define MAX_CREATURE_BASE_HP 3 +#define MAX_CREATURE_BASE_DAMAGE 3 // GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform #if defined(__GNUC__) @@ -184,12 +185,15 @@ typedef UNORDERED_MAP CreatureTemplateContainer; #pragma pack(push, 1) #endif -// Defines base stats for creatures (used to calculate HP/mana/armor). +// Defines base stats for creatures (used to calculate HP/mana/armor/attackpower/rangedattackpower/all damage). struct CreatureBaseStats { uint32 BaseHealth[MAX_CREATURE_BASE_HP]; uint32 BaseMana; uint32 BaseArmor; + uint32 AttackPower; + uint32 RangedAttackPower; + float BaseDamage[MAX_CREATURE_BASE_DAMAGE]; // Helpers @@ -212,6 +216,11 @@ struct CreatureBaseStats return uint32(ceil(BaseArmor * info->ModArmor)); } + float GenerateBaseDamage(CreatureTemplate const* info) const + { + return BaseDamage[info->expansion]; + } + static CreatureBaseStats const* GetBaseStats(uint8 level, uint8 unitClass); }; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 38549a358a0..9b0c14ac826 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -8528,7 +8528,7 @@ void ObjectMgr::LoadCreatureClassLevelStats() { uint32 oldMSTime = getMSTime(); - QueryResult result = WorldDatabase.Query("SELECT level, class, basehp0, basehp1, basehp2, basemana, basearmor FROM creature_classlevelstats"); + QueryResult result = WorldDatabase.Query("SELECT level, class, basehp0, basehp1, basehp2, basemana, basearmor, attackpower, rangedattackpower, damage_base, damage_exp1, damage_exp2 FROM creature_classlevelstats"); if (!result) { @@ -8552,6 +8552,12 @@ void ObjectMgr::LoadCreatureClassLevelStats() stats.BaseMana = fields[5].GetInt16(); stats.BaseArmor = fields[6].GetInt16(); + stats.AttackPower = fields[7].GetInt16(); + stats.RangedAttackPower = fields[8].GetInt16(); + + for (uint8 i = 0; i < MAX_CREATURE_BASE_DAMAGE; ++i) + stats.BaseDamage[i] = fields[i + 9].GetFloat(); + if (!Class || ((1 << (Class - 1)) & CLASSMASK_ALL_CREATURES) == 0) TC_LOG_ERROR("sql.sql", "Creature base stats for level %u has invalid class %u", Level, Class); -- cgit v1.2.3