Merge pull request #5933 from GyxTom/master

Core/Misc: Code style and remove unused define
This commit is contained in:
Shocker
2012-03-30 14:49:44 -07:00
88 changed files with 938 additions and 855 deletions
@@ -795,7 +795,7 @@ void AuctionHouseMgr::DeleteExpiredAuctionsAtStartup()
AuctionEntry* auction = new AuctionEntry(); AuctionEntry* auction = new AuctionEntry();
// Can't use LoadFromDB() because it assumes the auction map is loaded // Can't use LoadFromDB() because it assumes the auction map is loaded
if (!auction->LoadFromFieldList(fields)) if (!auction->LoadFromFieldList(fields))
{ {
// For some reason the record in the DB is broken (possibly corrupt // For some reason the record in the DB is broken (possibly corrupt
@@ -306,11 +306,13 @@ void ArenaTeam::DelMember(uint64 guid, bool cleanDb)
{ {
// Remove member from team // Remove member from team
for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr) for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr)
{
if (itr->Guid == guid) if (itr->Guid == guid)
{ {
Members.erase(itr); Members.erase(itr);
break; break;
} }
}
// Inform player and remove arena team info from player data // Inform player and remove arena team info from player data
if (Player* player = ObjectAccessor::FindPlayer(guid)) if (Player* player = ObjectAccessor::FindPlayer(guid))
@@ -75,9 +75,9 @@ void ObjectPosSelector::InitializeAngle()
bool ObjectPosSelector::FirstAngle(float& angle) bool ObjectPosSelector::FirstAngle(float& angle)
{ {
if (m_UsedPosLists[USED_POS_PLUS].empty() && !m_UsedPosLists[USED_POS_MINUS].empty() ) if (m_UsedPosLists[USED_POS_PLUS].empty() && !m_UsedPosLists[USED_POS_MINUS].empty())
return NextAngleFor(*m_UsedPosLists[USED_POS_MINUS].begin(), 1.0f, USED_POS_PLUS, angle); return NextAngleFor(*m_UsedPosLists[USED_POS_MINUS].begin(), 1.0f, USED_POS_PLUS, angle);
else if (m_UsedPosLists[USED_POS_MINUS].empty() && !m_UsedPosLists[USED_POS_PLUS].empty() ) else if (m_UsedPosLists[USED_POS_MINUS].empty() && !m_UsedPosLists[USED_POS_PLUS].empty())
return NextAngleFor(*m_UsedPosLists[USED_POS_PLUS].begin(), -1.0f, USED_POS_MINUS, angle); return NextAngleFor(*m_UsedPosLists[USED_POS_PLUS].begin(), -1.0f, USED_POS_MINUS, angle);
return false; return false;
@@ -100,7 +100,7 @@ bool ObjectPosSelector::NextAngle(float& angle)
bool ObjectPosSelector::NextUsedAngle(float& angle) bool ObjectPosSelector::NextUsedAngle(float& angle)
{ {
while (m_nextUsedPos[USED_POS_PLUS]!=m_UsedPosLists[USED_POS_PLUS].end() || while (m_nextUsedPos[USED_POS_PLUS]!=m_UsedPosLists[USED_POS_PLUS].end() ||
m_nextUsedPos[USED_POS_MINUS]!=m_UsedPosLists[USED_POS_MINUS].end() ) m_nextUsedPos[USED_POS_MINUS]!=m_UsedPosLists[USED_POS_MINUS].end())
{ {
// calculate next possible angle // calculate next possible angle
if (!NextPosibleAngle(angle)) if (!NextPosibleAngle(angle))
@@ -114,7 +114,7 @@ bool ObjectPosSelector::NextPosibleAngle(float& angle)
{ {
// ++ direction less updated // ++ direction less updated
if (m_nextUsedPos[USED_POS_PLUS]!=m_UsedPosLists[USED_POS_PLUS].end() && if (m_nextUsedPos[USED_POS_PLUS]!=m_UsedPosLists[USED_POS_PLUS].end() &&
(m_nextUsedPos[USED_POS_MINUS]==m_UsedPosLists[USED_POS_MINUS].end() || m_nextUsedPos[USED_POS_PLUS]->first <= m_nextUsedPos[USED_POS_MINUS]->first) ) (m_nextUsedPos[USED_POS_MINUS]==m_UsedPosLists[USED_POS_MINUS].end() || m_nextUsedPos[USED_POS_PLUS]->first <= m_nextUsedPos[USED_POS_MINUS]->first))
{ {
bool ok; bool ok;
if (m_smallStepOk[USED_POS_PLUS]) if (m_smallStepOk[USED_POS_PLUS])
+1 -1
View File
@@ -20475,7 +20475,7 @@ void Player::SendProficiency(ItemClass itemClass, uint32 itemSubclassMask)
{ {
WorldPacket data(SMSG_SET_PROFICIENCY, 1 + 4); WorldPacket data(SMSG_SET_PROFICIENCY, 1 + 4);
data << uint8(itemClass) << uint32(itemSubclassMask); data << uint8(itemClass) << uint32(itemSubclassMask);
GetSession()->SendPacket (&data); GetSession()->SendPacket(&data);
} }
void Player::RemovePetitionsAndSigns(uint64 guid, uint32 type) void Player::RemovePetitionsAndSigns(uint64 guid, uint32 type)
+2 -2
View File
@@ -9020,10 +9020,10 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
case 70893: case 70893:
{ {
// check if we're doing a critical hit // check if we're doing a critical hit
if (!(procSpell->SpellFamilyFlags[1] & 0x10000000) && (procEx != PROC_EX_CRITICAL_HIT) ) if (!(procSpell->SpellFamilyFlags[1] & 0x10000000) && (procEx != PROC_EX_CRITICAL_HIT))
return false; return false;
// check if we're procced by Claw, Bite or Smack (need to use the spell icon ID to detect it) // check if we're procced by Claw, Bite or Smack (need to use the spell icon ID to detect it)
if (!(procSpell->SpellIconID == 262 || procSpell->SpellIconID == 1680 || procSpell->SpellIconID == 473 )) if (!(procSpell->SpellIconID == 262 || procSpell->SpellIconID == 1680 || procSpell->SpellIconID == 473))
return false; return false;
break; break;
} }
+1 -1
View File
@@ -756,7 +756,7 @@ void Group::SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p,
if (!p || !p->GetSession()) if (!p || !p->GetSession())
return; return;
WorldPacket data(SMSG_LOOT_START_ROLL, (8 + 4 + 4 + 4 + 4 + 4 + 4 + 1 )); WorldPacket data(SMSG_LOOT_START_ROLL, (8 + 4 + 4 + 4 + 4 + 4 + 4 + 1));
data << uint64(r.itemGUID); // guid of rolled item data << uint64(r.itemGUID); // guid of rolled item
data << uint32(mapId); // 3.3.3 mapid data << uint32(mapId); // 3.3.3 mapid
data << uint32(r.totalPlayersRolling); // maybe the number of players rolling for it??? data << uint32(r.totalPlayersRolling); // maybe the number of players rolling for it???
@@ -1673,7 +1673,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data)
{ {
WorldPacket data(SMSG_CHAR_FACTION_CHANGE, 1); WorldPacket data(SMSG_CHAR_FACTION_CHANGE, 1);
data << uint8(CHAR_NAME_RESERVED); data << uint8(CHAR_NAME_RESERVED);
SendPacket (&data); SendPacket(&data);
return; return;
} }
@@ -173,12 +173,6 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket)
} }
} }
#define OPEN_CHEST 11437
#define OPEN_SAFE 11535
#define OPEN_CAGE 11792
#define OPEN_BOOTY_CHEST 5107
#define OPEN_STRONGBOX 8517
void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
{ {
sLog->outDetail("WORLD: CMSG_OPEN_ITEM packet, data length = %i", (uint32)recvPacket.size()); sLog->outDetail("WORLD: CMSG_OPEN_ITEM packet, data length = %i", (uint32)recvPacket.size());
+1 -1
View File
@@ -2355,7 +2355,7 @@ bool InstanceMap::CanEnter(Player* player)
return false; return false;
} }
// player inside instance has no group or his groups is different to entering player's one, deny entry // player inside instance has no group or his groups is different to entering player's one, deny entry
if (!iPlayer->GetGroup() || iPlayer->GetGroup() != player->GetGroup() ) if (!iPlayer->GetGroup() || iPlayer->GetGroup() != player->GetGroup())
{ {
player->SendTransferAborted(GetId(), TRANSFER_ABORT_MAX_PLAYERS); player->SendTransferAborted(GetId(), TRANSFER_ABORT_MAX_PLAYERS);
return false; return false;
+2 -2
View File
@@ -202,11 +202,11 @@ void MotionMaster::MoveTargetedHome()
} }
else if (_owner->GetTypeId()==TYPEID_UNIT && ((Creature*)_owner)->GetCharmerOrOwnerGUID()) else if (_owner->GetTypeId()==TYPEID_UNIT && ((Creature*)_owner)->GetCharmerOrOwnerGUID())
{ {
sLog->outStaticDebug("Pet or controlled creature (Entry: %u GUID: %u) targeting home", _owner->GetEntry(), _owner->GetGUIDLow() ); sLog->outStaticDebug("Pet or controlled creature (Entry: %u GUID: %u) targeting home", _owner->GetEntry(), _owner->GetGUIDLow());
Unit *target = ((Creature*)_owner)->GetCharmerOrOwner(); Unit *target = ((Creature*)_owner)->GetCharmerOrOwner();
if (target) if (target)
{ {
sLog->outStaticDebug("Following %s (GUID: %u)", target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : ((Creature*)target)->GetDBTableGUIDLow() ); sLog->outStaticDebug("Following %s (GUID: %u)", target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : ((Creature*)target)->GetDBTableGUIDLow());
Mutate(new FollowMovementGenerator<Creature>(*target,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE), MOTION_SLOT_ACTIVE); Mutate(new FollowMovementGenerator<Creature>(*target,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE), MOTION_SLOT_ACTIVE);
} }
} }
@@ -118,7 +118,7 @@ bool ConfusedMovementGenerator<T>::Update(T &unit, const uint32 &diff)
{ {
// waiting for next move // waiting for next move
i_nextMoveTime.Update(diff); i_nextMoveTime.Update(diff);
if(i_nextMoveTime.Passed() ) if (i_nextMoveTime.Passed())
{ {
// start moving // start moving
unit.AddUnitState(UNIT_STATE_CONFUSED_MOVE); unit.AddUnitState(UNIT_STATE_CONFUSED_MOVE);
@@ -182,7 +182,7 @@ FleeingMovementGenerator<T>::_getPoint(T &owner, float &x, float &y, float &z)
} }
} }
i_to_distance_from_caster = 0.0f; i_to_distance_from_caster = 0.0f;
i_nextCheckTime.Reset( urand(500,1000) ); i_nextCheckTime.Reset(urand(500,1000));
return false; return false;
} }
@@ -201,12 +201,12 @@ FleeingMovementGenerator<T>::_setMoveData(T &owner)
(i_last_distance_from_caster < i_to_distance_from_caster && cur_dist_xyz > i_to_distance_from_caster) || (i_last_distance_from_caster < i_to_distance_from_caster && cur_dist_xyz > i_to_distance_from_caster) ||
// if we reach bigger distance // if we reach bigger distance
(cur_dist_xyz > MAX_QUIET_DISTANCE) || // if we are too far (cur_dist_xyz > MAX_QUIET_DISTANCE) || // if we are too far
(i_last_distance_from_caster > MIN_QUIET_DISTANCE && cur_dist_xyz < MIN_QUIET_DISTANCE) ) (i_last_distance_from_caster > MIN_QUIET_DISTANCE && cur_dist_xyz < MIN_QUIET_DISTANCE))
// if we leave 'quiet zone' // if we leave 'quiet zone'
{ {
// we are very far or too close, stopping // we are very far or too close, stopping
i_to_distance_from_caster = 0.0f; i_to_distance_from_caster = 0.0f;
i_nextCheckTime.Reset( urand(500,1000) ); i_nextCheckTime.Reset(urand(500,1000));
return false; return false;
} }
else else
@@ -231,7 +231,7 @@ void FlightPathMovementGenerator::Reset(Player & player)
uint32 end = GetPathAtMapEnd(); uint32 end = GetPathAtMapEnd();
for (uint32 i = GetCurrentNode(); i != end; ++i) for (uint32 i = GetCurrentNode(); i != end; ++i)
{ {
G3D::Vector3 vertice((*i_path)[i].x,(*i_path)[i].y,(*i_path)[i].z); G3D::Vector3 vertice((*i_path)[i].x, (*i_path)[i].y, (*i_path)[i].z);
init.Path().push_back(vertice); init.Path().push_back(vertice);
} }
init.SetFirstPointId(GetCurrentNode()); init.SetFirstPointId(GetCurrentNode());
@@ -34,6 +34,7 @@ WorldLog::~WorldLog()
{ {
if (i_file != NULL) if (i_file != NULL)
fclose(i_file); fclose(i_file);
i_file = NULL; i_file = NULL;
} }
+2 -1
View File
@@ -195,7 +195,7 @@ void WorldSession::SendPacket(WorldPacket const* packet)
} }
#endif // !TRINITY_DEBUG #endif // !TRINITY_DEBUG
if (m_Socket->SendPacket (*packet) == -1) if (m_Socket->SendPacket(*packet) == -1)
m_Socket->CloseSocket(); m_Socket->CloseSocket();
} }
@@ -922,6 +922,7 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data)
{ {
if (data.rpos() + 4 > data.size()) if (data.rpos() + 4 > data.size())
return; return;
uint32 size; uint32 size;
data >> size; data >> size;
+22 -22
View File
@@ -152,7 +152,7 @@ const std::string& WorldSocket::GetRemoteAddress (void) const
return m_Address; return m_Address;
} }
int WorldSocket::SendPacket (const WorldPacket& pct) int WorldSocket::SendPacket(const WorldPacket& pct)
{ {
ACE_GUARD_RETURN (LockType, Guard, m_OutBufferLock, -1); ACE_GUARD_RETURN (LockType, Guard, m_OutBufferLock, -1);
@@ -252,7 +252,7 @@ int WorldSocket::open (void *a)
if (peer().get_remote_addr(remote_addr) == -1) if (peer().get_remote_addr(remote_addr) == -1)
{ {
sLog->outError ("WorldSocket::open: peer().get_remote_addr errno = %s", ACE_OS::strerror (errno)); sLog->outError("WorldSocket::open: peer().get_remote_addr errno = %s", ACE_OS::strerror (errno));
return -1; return -1;
} }
@@ -277,7 +277,7 @@ int WorldSocket::open (void *a)
// Register with ACE Reactor // Register with ACE Reactor
if (reactor()->register_handler(this, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::WRITE_MASK) == -1) if (reactor()->register_handler(this, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::WRITE_MASK) == -1)
{ {
sLog->outError ("WorldSocket::open: unable to register client handler errno = %s", ACE_OS::strerror (errno)); sLog->outError("WorldSocket::open: unable to register client handler errno = %s", ACE_OS::strerror (errno));
return -1; return -1;
} }
@@ -496,7 +496,7 @@ int WorldSocket::handle_input_header (void)
if ((header.size < 4) || (header.size > 10240) || (header.cmd > 10240)) if ((header.size < 4) || (header.size > 10240) || (header.cmd > 10240))
{ {
Player* _player = m_Session ? m_Session->GetPlayer() : NULL; Player* _player = m_Session ? m_Session->GetPlayer() : NULL;
sLog->outError ("WorldSocket::handle_input_header(): client (account: %u, char [GUID: %u, name: %s]) sent malformed packet (size: %d, cmd: %d)", sLog->outError("WorldSocket::handle_input_header(): client (account: %u, char [GUID: %u, name: %s]) sent malformed packet (size: %d, cmd: %d)",
m_Session ? m_Session->GetAccountId() : 0, m_Session ? m_Session->GetAccountId() : 0,
_player ? _player->GetGUIDLow() : 0, _player ? _player->GetGUIDLow() : 0,
_player ? _player->GetName() : "<none>", _player ? _player->GetName() : "<none>",
@@ -602,7 +602,7 @@ int WorldSocket::handle_input_missing_data (void)
// hope this is not hack, as proper m_RecvWPct is asserted around // hope this is not hack, as proper m_RecvWPct is asserted around
if (!m_RecvWPct) if (!m_RecvWPct)
{ {
sLog->outError ("Forcing close on input m_RecvWPct = NULL"); sLog->outError("Forcing close on input m_RecvWPct = NULL");
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
@@ -648,7 +648,7 @@ int WorldSocket::cancel_wakeup_output (GuardType& g)
(this, ACE_Event_Handler::WRITE_MASK) == -1) (this, ACE_Event_Handler::WRITE_MASK) == -1)
{ {
// would be good to store errno from reactor with errno guard // would be good to store errno from reactor with errno guard
sLog->outError ("WorldSocket::cancel_wakeup_output"); sLog->outError("WorldSocket::cancel_wakeup_output");
return -1; return -1;
} }
@@ -667,7 +667,7 @@ int WorldSocket::schedule_wakeup_output (GuardType& g)
if (reactor()->schedule_wakeup if (reactor()->schedule_wakeup
(this, ACE_Event_Handler::WRITE_MASK) == -1) (this, ACE_Event_Handler::WRITE_MASK) == -1)
{ {
sLog->outError ("WorldSocket::schedule_wakeup_output"); sLog->outError("WorldSocket::schedule_wakeup_output");
return -1; return -1;
} }
@@ -715,7 +715,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct)
case CMSG_AUTH_SESSION: case CMSG_AUTH_SESSION:
if (m_Session) if (m_Session)
{ {
sLog->outError ("WorldSocket::ProcessIncoming: Player send CMSG_AUTH_SESSION again"); sLog->outError("WorldSocket::ProcessIncoming: Player send CMSG_AUTH_SESSION again");
return -1; return -1;
} }
@@ -744,7 +744,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct)
} }
else else
{ {
sLog->outError ("WorldSocket::ProcessIncoming: Client not authed opcode = %u", uint32(opcode)); sLog->outError("WorldSocket::ProcessIncoming: Client not authed opcode = %u", uint32(opcode));
return -1; return -1;
} }
} }
@@ -788,9 +788,9 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
{ {
packet.Initialize(SMSG_AUTH_RESPONSE, 1); packet.Initialize(SMSG_AUTH_RESPONSE, 1);
packet << uint8(AUTH_REJECT); packet << uint8(AUTH_REJECT);
SendPacket (packet); SendPacket(packet);
sLog->outError ("WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteAddress().c_str()); sLog->outError("WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteAddress().c_str());
return -1; return -1;
} }
@@ -824,9 +824,9 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
packet.Initialize (SMSG_AUTH_RESPONSE, 1); packet.Initialize (SMSG_AUTH_RESPONSE, 1);
packet << uint8 (AUTH_UNKNOWN_ACCOUNT); packet << uint8 (AUTH_UNKNOWN_ACCOUNT);
SendPacket (packet); SendPacket(packet);
sLog->outError ("WorldSocket::HandleAuthSession: Sent Auth Response (unknown account)."); sLog->outError("WorldSocket::HandleAuthSession: Sent Auth Response (unknown account).");
return -1; return -1;
} }
@@ -860,7 +860,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
{ {
packet.Initialize (SMSG_AUTH_RESPONSE, 1); packet.Initialize (SMSG_AUTH_RESPONSE, 1);
packet << uint8 (AUTH_FAILED); packet << uint8 (AUTH_FAILED);
SendPacket (packet); SendPacket(packet);
sLog->outBasic ("WorldSocket::HandleAuthSession: Sent Auth Response (Account IP differs)."); sLog->outBasic ("WorldSocket::HandleAuthSession: Sent Auth Response (Account IP differs).");
return -1; return -1;
@@ -924,9 +924,9 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
{ {
packet.Initialize (SMSG_AUTH_RESPONSE, 1); packet.Initialize (SMSG_AUTH_RESPONSE, 1);
packet << uint8 (AUTH_BANNED); packet << uint8 (AUTH_BANNED);
SendPacket (packet); SendPacket(packet);
sLog->outError ("WorldSocket::HandleAuthSession: Sent Auth Response (Account banned)."); sLog->outError("WorldSocket::HandleAuthSession: Sent Auth Response (Account banned).");
return -1; return -1;
} }
@@ -938,9 +938,9 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
WorldPacket Packet (SMSG_AUTH_RESPONSE, 1); WorldPacket Packet (SMSG_AUTH_RESPONSE, 1);
Packet << uint8 (AUTH_UNAVAILABLE); Packet << uint8 (AUTH_UNAVAILABLE);
SendPacket (packet); SendPacket(packet);
sLog->outDetail ("WorldSocket::HandleAuthSession: User tries to login but his security level is not enough"); sLog->outDetail("WorldSocket::HandleAuthSession: User tries to login but his security level is not enough");
return -1; return -1;
} }
@@ -960,9 +960,9 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
packet.Initialize (SMSG_AUTH_RESPONSE, 1); packet.Initialize (SMSG_AUTH_RESPONSE, 1);
packet << uint8 (AUTH_FAILED); packet << uint8 (AUTH_FAILED);
SendPacket (packet); SendPacket(packet);
sLog->outError ("WorldSocket::HandleAuthSession: Sent Auth Response (authentification failed)."); sLog->outError("WorldSocket::HandleAuthSession: Sent Auth Response (authentification failed).");
return -1; return -1;
} }
@@ -1067,7 +1067,7 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket)
m_Session->SetLatency (latency); m_Session->SetLatency (latency);
else else
{ {
sLog->outError ("WorldSocket::HandlePing: peer sent CMSG_PING, " sLog->outError("WorldSocket::HandlePing: peer sent CMSG_PING, "
"but is not authenticated or got recently kicked, " "but is not authenticated or got recently kicked, "
" address = %s", " address = %s",
GetRemoteAddress().c_str()); GetRemoteAddress().c_str());
@@ -1077,5 +1077,5 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket)
WorldPacket packet (SMSG_PONG, 4); WorldPacket packet (SMSG_PONG, 4);
packet << ping; packet << ping;
return SendPacket (packet); return SendPacket(packet);
} }
+1 -1
View File
@@ -108,7 +108,7 @@ class WorldSocket : public WorldHandler
/// Send A packet on the socket, this function is reentrant. /// Send A packet on the socket, this function is reentrant.
/// @param pct packet to send /// @param pct packet to send
/// @return -1 of failure /// @return -1 of failure
int SendPacket (const WorldPacket& pct); int SendPacket(const WorldPacket& pct);
/// Add reference to this object. /// Add reference to this object.
long AddReference (void); long AddReference (void);
+5 -5
View File
@@ -236,7 +236,7 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address)
if (num_threads <= 0) if (num_threads <= 0)
{ {
sLog->outError ("Network.Threads is wrong in your config file"); sLog->outError("Network.Threads is wrong in your config file");
return -1; return -1;
} }
@@ -253,7 +253,7 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address)
if (m_SockOutUBuff <= 0) if (m_SockOutUBuff <= 0)
{ {
sLog->outError ("Network.OutUBuff is wrong in your config file"); sLog->outError("Network.OutUBuff is wrong in your config file");
return -1; return -1;
} }
@@ -263,7 +263,7 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address)
if (m_Acceptor->open(listen_addr, m_NetThreads[0].GetReactor(), ACE_NONBLOCK) == -1) if (m_Acceptor->open(listen_addr, m_NetThreads[0].GetReactor(), ACE_NONBLOCK) == -1)
{ {
sLog->outError ("Failed to open acceptor, check if the port is free"); sLog->outError("Failed to open acceptor, check if the port is free");
return -1; return -1;
} }
@@ -327,7 +327,7 @@ WorldSocketMgr::OnSocketOpen (WorldSocket* sock)
(void*) & m_SockOutKBuff, (void*) & m_SockOutKBuff,
sizeof (int)) == -1 && errno != ENOTSUP) sizeof (int)) == -1 && errno != ENOTSUP)
{ {
sLog->outError ("WorldSocketMgr::OnSocketOpen set_option SO_SNDBUF"); sLog->outError("WorldSocketMgr::OnSocketOpen set_option SO_SNDBUF");
return -1; return -1;
} }
} }
@@ -342,7 +342,7 @@ WorldSocketMgr::OnSocketOpen (WorldSocket* sock)
(void*)&ndoption, (void*)&ndoption,
sizeof (int)) == -1) sizeof (int)) == -1)
{ {
sLog->outError ("WorldSocketMgr::OnSocketOpen: peer().set_option TCP_NODELAY errno = %s", ACE_OS::strerror (errno)); sLog->outError("WorldSocketMgr::OnSocketOpen: peer().set_option TCP_NODELAY errno = %s", ACE_OS::strerror (errno));
return -1; return -1;
} }
} }
+3 -3
View File
@@ -267,7 +267,7 @@ void World::AddSession_(WorldSession* s)
{ {
AddQueuedPlayer (s); AddQueuedPlayer (s);
UpdateMaxSessionCounters(); UpdateMaxSessionCounters();
sLog->outDetail ("PlayerQueue: Account id %u is in Queue Position (%u).", s->GetAccountId(), ++QueueSize); sLog->outDetail("PlayerQueue: Account id %u is in Queue Position (%u).", s->GetAccountId(), ++QueueSize);
return; return;
} }
@@ -284,7 +284,7 @@ void World::AddSession_(WorldSession* s)
float popu = (float)GetActiveSessionCount(); // updated number of users on the server float popu = (float)GetActiveSessionCount(); // updated number of users on the server
popu /= pLimit; popu /= pLimit;
popu *= 2; popu *= 2;
sLog->outDetail ("Server Population (%f).", popu); sLog->outDetail("Server Population (%f).", popu);
} }
} }
@@ -1764,7 +1764,7 @@ void World::SetInitialWorldSettings()
uint32 startupDuration = GetMSTimeDiffToNow(startupBegin); uint32 startupDuration = GetMSTimeDiffToNow(startupBegin);
sLog->outString(); sLog->outString();
sLog->outString("WORLD: World initialized in %u minutes %u seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000) ); sLog->outString("WORLD: World initialized in %u minutes %u seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000));
sLog->outString(); sLog->outString();
} }
@@ -177,39 +177,39 @@ public:
MobDeath_Timer = 2500; MobDeath_Timer = 2500;
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
switch (i) switch (waypointId)
{ {
case 0: case 0:
DoScriptText(SCRIPT_TEXT1, me);//2 DoScriptText(SCRIPT_TEXT1, me);//2
CanWalk = false; CanWalk = false;
Event_Timer = 5000; Event_Timer = 5000;
break; break;
case 1: case 1:
DoScriptText(SCRIPT_TEXT2, me);//4 DoScriptText(SCRIPT_TEXT2, me);//4
CanWalk = false; CanWalk = false;
Event_Timer = 5000; Event_Timer = 5000;
break; break;
case 2: case 2:
CanWalk = false; CanWalk = false;
break; break;
case 3: case 3:
DoScriptText(SCRIPT_TEXT3, me);//5 DoScriptText(SCRIPT_TEXT3, me);//5
break; break;
case 4: case 4:
DoScriptText(SCRIPT_TEXT4, me);//6 DoScriptText(SCRIPT_TEXT4, me);//6
CanWalk = false; CanWalk = false;
Event_Timer = 5000; Event_Timer = 5000;
break; break;
case 5: case 5:
if (instance) if (instance)
{ {
instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, NPC_GRIMSTONE, me); instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, NPC_GRIMSTONE, me);
instance->SetData(TYPE_RING_OF_LAW, DONE); instance->SetData(TYPE_RING_OF_LAW, DONE);
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_grimstone: event reached end and set complete."); sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_grimstone: event reached end and set complete.");
} }
break; break;
} }
} }
@@ -611,18 +611,22 @@ public:
{ {
npc_dughal_stormwingAI(Creature* creature) : npc_escortAI(creature) {} npc_dughal_stormwingAI(Creature* creature) : npc_escortAI(creature) {}
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
switch (i) switch (waypointId)
{ {
case 0:me->Say(SAY_DUGHAL_FREE, LANG_UNIVERSAL, PlayerGUID); break; case 0:
case 1:instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break; me->Say(SAY_DUGHAL_FREE, LANG_UNIVERSAL, PlayerGUID);
case 2: break;
me->SetVisible(false); case 1:
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_OBJECTIVE_COMPLETED);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); break;
instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED); case 2:
break; me->SetVisible(false);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED);
break;
} }
} }
@@ -712,14 +716,15 @@ public:
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
{ {
if (quest->GetQuestId() == 4322) if (quest->GetQuestId() == 4322)
{PlayerStart = player; {
PlayerStart = player;
if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED)
{ {
CAST_AI(npc_escort::npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); CAST_AI(npc_escort::npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID());
instance->SetData(DATA_QUEST_JAIL_BREAK, ENCOUNTER_STATE_IN_PROGRESS); instance->SetData(DATA_QUEST_JAIL_BREAK, ENCOUNTER_STATE_IN_PROGRESS);
creature->setFaction(11); creature->setFaction(11);
}
} }
}
return false; return false;
} }
@@ -730,60 +735,66 @@ public:
instance = creature->GetInstanceScript(); instance = creature->GetInstanceScript();
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
switch (i) switch (waypointId)
{ {
case 1: case 1:
me->Say(SAY_WINDSOR_1, LANG_UNIVERSAL, PlayerGUID); me->Say(SAY_WINDSOR_1, LANG_UNIVERSAL, PlayerGUID);
break; break;
case 7: case 7:
me->HandleEmoteCommand(EMOTE_STATE_POINT); me->HandleEmoteCommand(EMOTE_STATE_POINT);
me->Say(SAY_WINDSOR_4_1, LANG_UNIVERSAL, PlayerGUID); me->Say(SAY_WINDSOR_4_1, LANG_UNIVERSAL, PlayerGUID);
IsOnHold=true; IsOnHold = true;
break; break;
case 10: case 10:
me->setFaction(534); me->setFaction(534);
break; break;
case 12: case 12:
me->Say(SAY_WINDSOR_6, LANG_UNIVERSAL, PlayerGUID); me->Say(SAY_WINDSOR_6, LANG_UNIVERSAL, PlayerGUID);
instance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_IN_PROGRESS); instance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_IN_PROGRESS);
break; break;
case 13: case 13:
me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK
break; break;
case 14: case 14:
instance->SetData(DATA_GATE_SR, 0); instance->SetData(DATA_GATE_SR, 0);
me->setFaction(11); me->setFaction(11);
break; break;
case 16: case 16:
me->Say(SAY_WINDSOR_9, LANG_UNIVERSAL, PlayerGUID); me->Say(SAY_WINDSOR_9, LANG_UNIVERSAL, PlayerGUID);
break; break;
case 17: case 17:
me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK
break; break;
case 18: case 18:
instance->SetData(DATA_GATE_SC, 0); instance->SetData(DATA_GATE_SC, 0);
break; break;
case 19: case 19:
me->SetVisible(false); me->SetVisible(false);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SummonCreature(MOB_ENTRY_REGINALD_WINDSOR, 403.61f, -51.71f, -63.92f, 3.600434f, TEMPSUMMON_DEAD_DESPAWN, 0); me->SummonCreature(MOB_ENTRY_REGINALD_WINDSOR, 403.61f, -51.71f, -63.92f, 3.600434f, TEMPSUMMON_DEAD_DESPAWN, 0);
instance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_ENDED); instance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_ENDED);
break; break;
} }
} }
void EnterCombat(Unit* who) void EnterCombat(Unit* who)
{ {
switch (urand(0, 2)) switch (urand(0, 2))
{ {
case 0: me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break; case 0:
case 1: me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break; me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID);
case 2: me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); break; break;
} case 1:
me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID);
break;
case 2:
me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID);
break;
} }
}
void Reset() {} void Reset() {}
@@ -794,19 +805,22 @@ public:
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
{ {
if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED)
return;
if (instance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) if (instance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED)
SetEscortPaused(false); SetEscortPaused(false);
if (!instance->GetData(DATA_GATE_D) && instance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_NOT_STARTED) if (!instance->GetData(DATA_GATE_D) && instance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_NOT_STARTED)
{ {
me->Say(SAY_WINDSOR_4_2, LANG_UNIVERSAL, PlayerGUID); me->Say(SAY_WINDSOR_4_2, LANG_UNIVERSAL, PlayerGUID);
instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_BEFORE_START); instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_BEFORE_START);
} }
if (instance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) if (instance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED)
{ {
me->Say(SAY_WINDSOR_4_3, LANG_UNIVERSAL, PlayerGUID); me->Say(SAY_WINDSOR_4_3, LANG_UNIVERSAL, PlayerGUID);
instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED); instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED);
} }
if ((instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& instance->GetData(DATA_SUPPLY_ROOM) == ENCOUNTER_STATE_ENDED) if ((instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& instance->GetData(DATA_SUPPLY_ROOM) == ENCOUNTER_STATE_ENDED)
{ {
me->SetVisible(false); me->SetVisible(false);
@@ -900,61 +914,61 @@ public:
{ {
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
wp=i; wp = waypointId;
switch (i) switch (waypointId)
{ {
case 0: case 0:
me->setFaction(11); me->setFaction(11);
me->Say(SAY_REGINALD_WINDSOR_0_1, LANG_UNIVERSAL, PlayerGUID); me->Say(SAY_REGINALD_WINDSOR_0_1, LANG_UNIVERSAL, PlayerGUID);
break; break;
case 1: case 1:
me->Say(SAY_REGINALD_WINDSOR_0_2, LANG_UNIVERSAL, PlayerGUID); me->Say(SAY_REGINALD_WINDSOR_0_2, LANG_UNIVERSAL, PlayerGUID);
break; break;
case 7: case 7:
me->HandleEmoteCommand(EMOTE_STATE_POINT); me->HandleEmoteCommand(EMOTE_STATE_POINT);
me->Say(SAY_REGINALD_WINDSOR_5_1, LANG_UNIVERSAL, PlayerGUID); me->Say(SAY_REGINALD_WINDSOR_5_1, LANG_UNIVERSAL, PlayerGUID);
IsOnHold=true; IsOnHold=true;
break; break;
case 8: case 8:
me->Say(SAY_REGINALD_WINDSOR_5_2, LANG_UNIVERSAL, PlayerGUID); me->Say(SAY_REGINALD_WINDSOR_5_2, LANG_UNIVERSAL, PlayerGUID);
break; break;
case 11: case 11:
me->HandleEmoteCommand(EMOTE_STATE_POINT); me->HandleEmoteCommand(EMOTE_STATE_POINT);
me->Say(SAY_REGINALD_WINDSOR_7_1, LANG_UNIVERSAL, PlayerGUID); me->Say(SAY_REGINALD_WINDSOR_7_1, LANG_UNIVERSAL, PlayerGUID);
IsOnHold=true; IsOnHold=true;
break; break;
case 12: case 12:
me->Say(SAY_REGINALD_WINDSOR_7_2, LANG_UNIVERSAL, PlayerGUID); me->Say(SAY_REGINALD_WINDSOR_7_2, LANG_UNIVERSAL, PlayerGUID);
break; break;
case 13: case 13:
me->Say(SAY_REGINALD_WINDSOR_7_3, LANG_UNIVERSAL, PlayerGUID); me->Say(SAY_REGINALD_WINDSOR_7_3, LANG_UNIVERSAL, PlayerGUID);
break; break;
case 20: case 20:
me->HandleEmoteCommand(EMOTE_STATE_POINT); me->HandleEmoteCommand(EMOTE_STATE_POINT);
me->Say(SAY_REGINALD_WINDSOR_13_1, LANG_UNIVERSAL, PlayerGUID); me->Say(SAY_REGINALD_WINDSOR_13_1, LANG_UNIVERSAL, PlayerGUID);
IsOnHold=true; IsOnHold=true;
break; break;
case 21: case 21:
me->Say(SAY_REGINALD_WINDSOR_13_3, LANG_UNIVERSAL, PlayerGUID); me->Say(SAY_REGINALD_WINDSOR_13_3, LANG_UNIVERSAL, PlayerGUID);
break; break;
case 23: case 23:
me->HandleEmoteCommand(EMOTE_STATE_POINT); me->HandleEmoteCommand(EMOTE_STATE_POINT);
me->Say(SAY_REGINALD_WINDSOR_14_1, LANG_UNIVERSAL, PlayerGUID); me->Say(SAY_REGINALD_WINDSOR_14_1, LANG_UNIVERSAL, PlayerGUID);
IsOnHold=true; IsOnHold=true;
break; break;
case 24: case 24:
me->Say(SAY_REGINALD_WINDSOR_14_2, LANG_UNIVERSAL, PlayerGUID); me->Say(SAY_REGINALD_WINDSOR_14_2, LANG_UNIVERSAL, PlayerGUID);
break; break;
case 31: case 31:
me->Say(SAY_REGINALD_WINDSOR_20_1, LANG_UNIVERSAL, PlayerGUID); me->Say(SAY_REGINALD_WINDSOR_20_1, LANG_UNIVERSAL, PlayerGUID);
break; break;
case 32: case 32:
me->Say(SAY_REGINALD_WINDSOR_20_2, LANG_UNIVERSAL, PlayerGUID); me->Say(SAY_REGINALD_WINDSOR_20_2, LANG_UNIVERSAL, PlayerGUID);
PlayerStart->GroupEventHappens(QUEST_JAIL_BREAK, me); PlayerStart->GroupEventHappens(QUEST_JAIL_BREAK, me);
instance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED); instance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED);
break; break;
} }
} }
@@ -978,14 +992,20 @@ public:
} }
void EnterCombat(Unit* who) void EnterCombat(Unit* who)
{ {
switch (urand(0, 2)) switch (urand(0, 2))
{ {
case 0: me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break; case 0:
case 1: me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break; me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID);
case 2: me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); break; break;
} case 1:
me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID);
break;
case 2:
me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID);
break;
} }
}
void Reset() {} void Reset() {}
void JustDied(Unit* slayer) void JustDied(Unit* slayer)
@@ -995,47 +1015,49 @@ public:
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
{ {
if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED)
return;
if (wp == 7) if (wp == 7)
{ {
if (!instance->GetData(DATA_GATE_J) && instance->GetData(DATA_JAZ) == ENCOUNTER_STATE_NOT_STARTED) if (!instance->GetData(DATA_GATE_J) && instance->GetData(DATA_JAZ) == ENCOUNTER_STATE_NOT_STARTED)
{ {
instance->SetData(DATA_CREATURE_JAZ, 1); instance->SetData(DATA_CREATURE_JAZ, 1);
instance->SetData(DATA_JAZ, ENCOUNTER_STATE_IN_PROGRESS); instance->SetData(DATA_JAZ, ENCOUNTER_STATE_IN_PROGRESS);
} }
if (instance->GetData(DATA_CREATURE_JAZ) && instance->GetData(DATA_CREATURE_OGRABISI) && instance->GetData(DATA_JAZ) == ENCOUNTER_STATE_IN_PROGRESS) if (instance->GetData(DATA_CREATURE_JAZ) && instance->GetData(DATA_CREATURE_OGRABISI) && instance->GetData(DATA_JAZ) == ENCOUNTER_STATE_IN_PROGRESS)
{ {
SetEscortPaused(false); SetEscortPaused(false);
instance->SetData(DATA_JAZ, ENCOUNTER_STATE_ENDED); instance->SetData(DATA_JAZ, ENCOUNTER_STATE_ENDED);
}
} }
}
else if (wp == 11) else if (wp == 11)
{ {
if (!instance->GetData(DATA_GATE_S) && instance->GetData(DATA_SHILL) == ENCOUNTER_STATE_NOT_STARTED) if (!instance->GetData(DATA_GATE_S) && instance->GetData(DATA_SHILL) == ENCOUNTER_STATE_NOT_STARTED)
{
instance->SetData(DATA_CREATURE_SHILL, 1);
instance->SetData(DATA_SHILL, ENCOUNTER_STATE_IN_PROGRESS);
}
if (instance->GetData(DATA_CREATURE_SHILL) && instance->GetData(DATA_SHILL) == ENCOUNTER_STATE_IN_PROGRESS)
{
instance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED);
SetEscortPaused(false);
}
}
else if (wp == 20)
{ {
if (!instance->GetData(DATA_GATE_C) && instance->GetData(DATA_CREST) == ENCOUNTER_STATE_NOT_STARTED) instance->SetData(DATA_CREATURE_SHILL, 1);
{ instance->SetData(DATA_SHILL, ENCOUNTER_STATE_IN_PROGRESS);
instance->SetData(DATA_CREATURE_CREST, 1);
me->Say(SAY_REGINALD_WINDSOR_13_2, LANG_UNIVERSAL, PlayerGUID);
instance->SetData(DATA_CREST, ENCOUNTER_STATE_IN_PROGRESS);
}
if (instance->GetData(DATA_CREATURE_CREST) && instance->GetData(DATA_CREST) == ENCOUNTER_STATE_IN_PROGRESS)
{
SetEscortPaused(false);
instance->SetData(DATA_CREST, ENCOUNTER_STATE_ENDED);
}
} }
if (instance->GetData(DATA_CREATURE_SHILL) && instance->GetData(DATA_SHILL) == ENCOUNTER_STATE_IN_PROGRESS)
{
instance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED);
SetEscortPaused(false);
}
}
else if (wp == 20)
{
if (!instance->GetData(DATA_GATE_C) && instance->GetData(DATA_CREST) == ENCOUNTER_STATE_NOT_STARTED)
{
instance->SetData(DATA_CREATURE_CREST, 1);
me->Say(SAY_REGINALD_WINDSOR_13_2, LANG_UNIVERSAL, PlayerGUID);
instance->SetData(DATA_CREST, ENCOUNTER_STATE_IN_PROGRESS);
}
if (instance->GetData(DATA_CREATURE_CREST) && instance->GetData(DATA_CREST) == ENCOUNTER_STATE_IN_PROGRESS)
{
SetEscortPaused(false);
instance->SetData(DATA_CREST, ENCOUNTER_STATE_ENDED);
}
}
if (instance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) SetEscortPaused(false); if (instance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) SetEscortPaused(false);
npc_escortAI::UpdateAI(diff); npc_escortAI::UpdateAI(diff);
} }
@@ -1045,6 +1067,7 @@ public:
// npc_tobias_seecher // npc_tobias_seecher
#define SAY_TOBIAS_FREE "Thank you! I will run for safety immediately!" #define SAY_TOBIAS_FREE "Thank you! I will run for safety immediately!"
/* /*
class npc_tobias_seecher : public CreatureScript class npc_tobias_seecher : public CreatureScript
{ {
@@ -1105,25 +1128,30 @@ public:
} }
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
switch (i) switch (waypointId)
{ {
case 0:me->Say(SAY_TOBIAS_FREE, LANG_UNIVERSAL, PlayerGUID); break; case 0:
case 2: me->Say(SAY_TOBIAS_FREE, LANG_UNIVERSAL, PlayerGUID);
instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break; break;
case 4: case 2:
me->SetVisible(false); instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_OBJECTIVE_COMPLETED);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); break;
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); case 4:
instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_ENDED); me->SetVisible(false);
break; me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_ENDED);
break;
} }
} }
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
{ {
if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED)
return;
if ((instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& instance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_ENDED) if ((instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& instance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_ENDED)
{ {
me->SetVisible(false); me->SetVisible(false);
@@ -1226,29 +1254,29 @@ public:
go->SetGoState((GOState)state); go->SetGoState((GOState)state);
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
if (!instance) if (!instance)
return; return;
switch (i) switch (waypointId)
{ {
case 1: case 1:
me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); me->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
break; break;
case 2: case 2:
me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED); me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED);
break; break;
case 3: case 3:
me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED); me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED);
break; break;
case 4: case 4:
me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); me->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
break; break;
case 5: case 5:
me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); me->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
BreakKeg_Timer = 2000; BreakKeg_Timer = 2000;
break; break;
} }
} }
@@ -266,14 +266,14 @@ public:
} }
} }
void WaypointReached(uint32 uiPoint) void WaypointReached(uint32 waypointId)
{ {
//just in case //just in case
if (GetPlayerForEscort()) if (GetPlayerForEscort())
if (me->getFaction() != GetPlayerForEscort()->getFaction()) if (me->getFaction() != GetPlayerForEscort()->getFaction())
me->setFaction(GetPlayerForEscort()->getFaction()); me->setFaction(GetPlayerForEscort()->getFaction());
switch (uiPoint) switch (waypointId)
{ {
case 3: case 3:
SetEscortPaused(true); SetEscortPaused(true);
@@ -158,12 +158,12 @@ public:
void EnterCombat(Unit* /*who*/) {} void EnterCombat(Unit* /*who*/) {}
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
if (!instance) if (!instance)
return; return;
switch (i) switch (waypointId)
{ {
case 0: case 0:
DoCast(me, SPELL_TUXEDO, false); DoCast(me, SPELL_TUXEDO, false);
@@ -994,9 +994,9 @@ public:
SetDespawnAtFar(false); SetDespawnAtFar(false);
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
switch (i) switch (waypointId)
{ {
case 1: case 1:
if (Unit* car = Unit::GetCreature(*me, carGUID)) if (Unit* car = Unit::GetCreature(*me, carGUID))
@@ -239,9 +239,9 @@ public:
} }
} }
void WaypointReached(uint32 uiPointId) void WaypointReached(uint32 waypointId)
{ {
switch (uiPointId) switch (waypointId)
{ {
case 0: case 0:
DoScriptText(SAY_BREAKOUT1, me); DoScriptText(SAY_BREAKOUT1, me);
@@ -497,9 +497,9 @@ public:
SetEscortPaused(bOnHold); SetEscortPaused(bOnHold);
} }
void WaypointReached(uint32 wpId) void WaypointReached(uint32 waypointId)
{ {
switch (wpId) switch (waypointId)
{ {
case 0: case 0:
me->SetWalk(false); me->SetWalk(false);
@@ -507,7 +507,6 @@ public:
break; break;
case 1: case 1:
SetHoldState(true); SetHoldState(true);
SpawnNPC(); SpawnNPC();
if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID)) if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID))
DoScriptText(SAY_LIGHT_OF_DAWN07, temp); DoScriptText(SAY_LIGHT_OF_DAWN07, temp);
@@ -152,7 +152,12 @@ public:
uint32 Start_Timer; uint32 Start_Timer;
void Reset() {} void Reset() {}
void WaypointReached(uint32 /*point*/) {}
void WaypointReached(uint32 /*waypointId*/)
{
}
void EnterCombat(Unit* /*who*/) {} void EnterCombat(Unit* /*who*/) {}
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
@@ -99,9 +99,9 @@ public:
InstanceScript* instance; InstanceScript* instance;
uint32 uiNpcEntry; uint32 uiNpcEntry;
void WaypointReached(uint32 uiPoint) void WaypointReached(uint32 waypointId)
{ {
switch (uiPoint) switch (waypointId)
{ {
case 0: case 0:
if (uiNpcEntry == NPC_ASH) if (uiNpcEntry == NPC_ASH)
@@ -64,43 +64,42 @@ class npc_professor_phizzlethorpe : public CreatureScript
{ {
npc_professor_phizzlethorpeAI(Creature* creature) : npc_escortAI(creature) {} npc_professor_phizzlethorpeAI(Creature* creature) : npc_escortAI(creature) {}
void WaypointReached(uint32 uiPointId) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (uiPointId) switch (waypointId)
{ {
case 4: case 4:
Talk(SAY_PROGRESS_2, player->GetGUID()); Talk(SAY_PROGRESS_2, player->GetGUID());
break; break;
case 5: case 5:
Talk(SAY_PROGRESS_3, player->GetGUID()); Talk(SAY_PROGRESS_3, player->GetGUID());
break; break;
case 8: case 8:
Talk(EMOTE_PROGRESS_4); Talk(EMOTE_PROGRESS_4);
break; break;
case 9: case 9:
me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
break; break;
case 10: case 10:
Talk(SAY_PROGRESS_5, player->GetGUID()); Talk(SAY_PROGRESS_5, player->GetGUID());
break; break;
case 11: case 11:
Talk(SAY_PROGRESS_6, player->GetGUID()); Talk(SAY_PROGRESS_6, player->GetGUID());
SetRun(); SetRun();
break; break;
case 19: case 19:
Talk(SAY_PROGRESS_7, player->GetGUID()); Talk(SAY_PROGRESS_7, player->GetGUID());
break; break;
case 20: case 20:
Talk(EMOTE_PROGRESS_8); Talk(EMOTE_PROGRESS_8);
Talk(SAY_PROGRESS_9, player->GetGUID()); Talk(SAY_PROGRESS_9, player->GetGUID());
CAST_PLR(player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me); CAST_PLR(player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me);
break; break;
} }
} }
@@ -130,14 +130,13 @@ public:
{ {
npc_ranger_lilathaAI(Creature* creature) : npc_escortAI(creature) {} npc_ranger_lilathaAI(Creature* creature) : npc_escortAI(creature) {}
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 0: case 0:
me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
@@ -145,16 +144,13 @@ public:
Cage->SetGoState(GO_STATE_ACTIVE); Cage->SetGoState(GO_STATE_ACTIVE);
DoScriptText(SAY_START, me, player); DoScriptText(SAY_START, me, player);
break; break;
case 5: case 5:
DoScriptText(SAY_PROGRESS1, me, player); DoScriptText(SAY_PROGRESS1, me, player);
break; break;
case 11: case 11:
DoScriptText(SAY_PROGRESS2, me, player); DoScriptText(SAY_PROGRESS2, me, player);
me->SetOrientation(4.762841f); me->SetOrientation(4.762841f);
break; break;
case 18: case 18:
{ {
DoScriptText(SAY_PROGRESS3, me, player); DoScriptText(SAY_PROGRESS3, me, player);
@@ -168,25 +164,20 @@ public:
me->AI()->AttackStart(Summ1); me->AI()->AttackStart(Summ1);
} }
break; break;
case 19: case 19:
me->SetWalk(false); me->SetWalk(false);
break; break;
case 25: case 25:
me->SetWalk(true); me->SetWalk(true);
break; break;
case 30: case 30:
if (player->GetTypeId() == TYPEID_PLAYER) if (player->GetTypeId() == TYPEID_PLAYER)
CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me); CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me);
break; break;
case 32: case 32:
me->SetOrientation(2.978281f); me->SetOrientation(2.978281f);
DoScriptText(SAY_END1, me, player); DoScriptText(SAY_END1, me, player);
break; break;
case 33: case 33:
me->SetOrientation(5.858011f); me->SetOrientation(5.858011f);
DoScriptText(SAY_END2, me, player); DoScriptText(SAY_END2, me, player);
@@ -87,9 +87,9 @@ public:
void Reset() { } void Reset() { }
void WaypointReached(uint32 uiPointId) void WaypointReached(uint32 waypointId)
{ {
switch (uiPointId) switch (waypointId)
{ {
case 26: case 26:
DoScriptText(SAY_OOX_AMBUSH, me); DoScriptText(SAY_OOX_AMBUSH, me);
@@ -276,14 +276,13 @@ public:
summoned->GetMotionMaster()->MovePoint(0, m_afAmbushMoveTo[m_iSpawnId].m_fX, m_afAmbushMoveTo[m_iSpawnId].m_fY, m_afAmbushMoveTo[m_iSpawnId].m_fZ); summoned->GetMotionMaster()->MovePoint(0, m_afAmbushMoveTo[m_iSpawnId].m_fX, m_afAmbushMoveTo[m_iSpawnId].m_fY, m_afAmbushMoveTo[m_iSpawnId].m_fZ);
} }
void WaypointReached(uint32 uiPointId) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (uiPointId) switch (waypointId)
{ {
case 1: case 1:
DoScriptText(SAY_RIN_FREE, me, player); DoScriptText(SAY_RIN_FREE, me, player);
@@ -76,17 +76,16 @@ public:
uiShieldBashTimer = 8000; uiShieldBashTimer = 8000;
} }
void WaypointReached(uint32 uiI) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
if (uiI >= 65 && me->GetUnitMovementFlags() == MOVEMENTFLAG_WALKING) if (waypointId >= 65 && me->GetUnitMovementFlags() == MOVEMENTFLAG_WALKING)
me->SetWalk(false); me->SetWalk(false);
switch (uiI) switch (waypointId)
{ {
case 39: case 39:
SetEscortPaused(true); SetEscortPaused(true);
@@ -66,50 +66,41 @@ public:
{ {
npc_deathstalker_erlandAI(Creature* creature) : npc_escortAI(creature) {} npc_deathstalker_erlandAI(Creature* creature) : npc_escortAI(creature) {}
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 1: case 1:
DoScriptText(SAY_START, me, player); DoScriptText(SAY_START, me, player);
break; break;
case 13: case 13:
DoScriptText(SAY_LAST, me, player); DoScriptText(SAY_LAST, me, player);
player->GroupEventHappens(QUEST_ESCORTING, me); player->GroupEventHappens(QUEST_ESCORTING, me);
break; break;
case 14: case 14:
DoScriptText(SAY_THANKS, me, player); DoScriptText(SAY_THANKS, me, player);
break; break;
case 15: case 15:
if (Unit* Rane = me->FindNearestCreature(NPC_RANE, 20)) if (Unit* Rane = me->FindNearestCreature(NPC_RANE, 20))
DoScriptText(SAY_RANE, Rane); DoScriptText(SAY_RANE, Rane);
break; break;
case 16: case 16:
DoScriptText(SAY_ANSWER, me); DoScriptText(SAY_ANSWER, me);
break; break;
case 17: case 17:
DoScriptText(SAY_MOVE_QUINN, me); DoScriptText(SAY_MOVE_QUINN, me);
break; break;
case 24: case 24:
DoScriptText(SAY_GREETINGS, me); DoScriptText(SAY_GREETINGS, me);
break; break;
case 25: case 25:
if (Unit* Quinn = me->FindNearestCreature(NPC_QUINN, 20)) if (Unit* Quinn = me->FindNearestCreature(NPC_QUINN, 20))
DoScriptText(SAY_QUINN, Quinn); DoScriptText(SAY_QUINN, Quinn);
break; break;
case 26: case 26:
DoScriptText(SAY_ON_BYE, me, NULL); DoScriptText(SAY_ON_BYE, me, NULL);
break; break;
@@ -268,9 +268,9 @@ public:
} }
} }
void WaypointReached(uint32 uiPointId) void WaypointReached(uint32 waypointId)
{ {
switch (uiPointId) switch (waypointId)
{ {
case 14: case 14:
SetEscortPaused(true); SetEscortPaused(true);
@@ -497,9 +497,9 @@ public:
uiPhase = 0; uiPhase = 0;
} }
void WaypointReached(uint32 uiPointId) void WaypointReached(uint32 waypointId)
{ {
switch (uiPointId) switch (waypointId)
{ {
case 1: case 1:
SetEscortPaused(true); SetEscortPaused(true);
@@ -106,24 +106,24 @@ public:
} }
} }
void WaypointReached(uint32 uiPointId) void WaypointReached(uint32 waypointId)
{ {
switch (uiPointId) switch (waypointId)
{ {
case 0: case 0:
if (GameObject* pCage = me->GetMap()->GetGameObject(m_uiGalensCageGUID)) if (GameObject* pCage = me->GetMap()->GetGameObject(m_uiGalensCageGUID))
pCage->ResetDoorOrButton(); pCage->ResetDoorOrButton();
break; break;
case 20: case 20:
if (Player* player = GetPlayerForEscort()) if (Player* player = GetPlayerForEscort())
{ {
me->SetFacingToObject(player); me->SetFacingToObject(player);
DoScriptText(SAY_QUEST_COMPLETE, me, player); DoScriptText(SAY_QUEST_COMPLETE, me, player);
DoScriptText(EMOTE_WHISPER, me, player); DoScriptText(EMOTE_WHISPER, me, player);
player->GroupEventHappens(QUEST_GALENS_ESCAPE, me); player->GroupEventHappens(QUEST_GALENS_ESCAPE, me);
} }
SetRun(true); SetRun(true);
break; break;
} }
} }
@@ -328,10 +328,11 @@ public:
summoned->AI()->AttackStart(me); summoned->AI()->AttackStart(me);
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
switch (i)
switch (waypointId)
{ {
case 8: case 8:
DoScriptText(SAY_WP_0, me); DoScriptText(SAY_WP_0, me);
+14 -10
View File
@@ -85,9 +85,15 @@ public:
{ {
switch (uiWPHolder) switch (uiWPHolder)
{ {
case 7: DoScriptText(SAY_DS_DOWN_1, me); break; case 7:
case 8: DoScriptText(SAY_DS_DOWN_2, me); break; DoScriptText(SAY_DS_DOWN_1, me);
case 9: DoScriptText(SAY_DS_DOWN_3, me); break; break;
case 8:
DoScriptText(SAY_DS_DOWN_2, me);
break;
case 9:
DoScriptText(SAY_DS_DOWN_3, me);
break;
} }
} }
else else
@@ -96,16 +102,15 @@ public:
uiShootTimer = 0; uiShootTimer = 0;
} }
void WaypointReached(uint32 uiPoint) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
uiWPHolder = uiPoint; uiWPHolder = waypointId;
switch (uiPoint) switch (waypointId)
{ {
case 4: case 4:
SetEquipmentSlots(false, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE, EQUIP_ID_RIFLE); SetEquipmentSlots(false, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE, EQUIP_ID_RIFLE);
@@ -226,14 +231,13 @@ public:
{ {
npc_defias_traitorAI(Creature* creature) : npc_escortAI(creature) { Reset(); } npc_defias_traitorAI(Creature* creature) : npc_escortAI(creature) { Reset(); }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 35: case 35:
SetRun(false); SetRun(false);
@@ -67,14 +67,13 @@ public:
m_bFriendSummoned = false; m_bFriendSummoned = false;
} }
void WaypointReached(uint32 uiPointId) void WaypointReached(uint32 waypointId)
{ {
switch (uiPointId) switch (waypointId)
{ {
case 2: case 2:
if (me->HasStealthAura()) if (me->HasStealthAura())
me->RemoveAurasByType(SPELL_AURA_MOD_STEALTH); me->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
SetRun(); SetRun();
me->setFaction(FACTION_ENEMY); me->setFaction(FACTION_ENEMY);
break; break;
@@ -75,9 +75,9 @@ class example_escort : public CreatureScript
} }
// Pure Virtual Functions (Have to be implemented) // Pure Virtual Functions (Have to be implemented)
void WaypointReached(uint32 uiWP) void WaypointReached(uint32 waypointId)
{ {
switch (uiWP) switch (waypointId)
{ {
case 1: case 1:
DoScriptText(SAY_WP_1, me); DoScriptText(SAY_WP_1, me);
@@ -236,9 +236,9 @@ public:
Start(false, false, 0); Start(false, false, 0);
} }
void WaypointReached(uint32 uiPoint) void WaypointReached(uint32 waypointId)
{ {
switch (uiPoint) switch (waypointId)
{ {
case 4: case 4:
SetEscortPaused(true); SetEscortPaused(true);
@@ -115,9 +115,9 @@ public:
} }
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
if (i == 7 && instance) if (waypointId == 7 && instance)
{ {
Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE));
if (target && target->isAlive()) if (target && target->isAlive())
@@ -644,7 +644,11 @@ public:
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
void WaypointReached(uint32 /*i*/){}
void WaypointReached(uint32 /*waypointId*/)
{
}
}; };
}; };
@@ -111,9 +111,9 @@ public:
} }
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
if (i == 7 && instance) if (waypointId == 7 && instance)
{ {
Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL));
if (target && target->isAlive()) if (target && target->isAlive())
@@ -241,7 +241,7 @@ public:
{ {
} }
void WaypointReached(uint32 /*i*/) void WaypointReached(uint32 /*waypointId*/)
{ {
} }
@@ -103,9 +103,9 @@ public:
} }
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
if (i == 7 && instance) if (waypointId == 7 && instance)
{ {
Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL));
if (target && target->isAlive()) if (target && target->isAlive())
@@ -105,9 +105,9 @@ public:
} }
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
if (i == 7 && instance) if (waypointId == 7 && instance)
{ {
Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE));
if (target && target->isAlive()) if (target && target->isAlive())
@@ -980,9 +980,9 @@ void hyjalAI::RespawnNearPos(float x, float y)
cell.Visit(p, obj_worker, *me->GetMap(), *me, me->GetGridActivationRange()); cell.Visit(p, obj_worker, *me->GetMap(), *me, me->GetGridActivationRange());
} }
void hyjalAI::WaypointReached(uint32 i) void hyjalAI::WaypointReached(uint32 waypointId)
{ {
if (i == 1 || (i == 0 && me->GetEntry() == THRALL)) if (waypointId == 1 || (waypointId == 0 && me->GetEntry() == THRALL))
{ {
me->MonsterYell(YELL_HURRY, 0, 0); me->MonsterYell(YELL_HURRY, 0, 0);
WaitForTeleport = true; WaitForTeleport = true;
@@ -196,7 +196,7 @@ struct hyjalAI : public npc_escortAI
void SummonedCreatureDespawn(Creature* summoned); void SummonedCreatureDespawn(Creature* summoned);
void HideNearPos(float x, float y); void HideNearPos(float x, float y);
void RespawnNearPos(float x, float y); void RespawnNearPos(float x, float y);
void WaypointReached(uint32 i); void WaypointReached(uint32 waypointId);
void DoOverrun(uint32 faction, const uint32 diff); void DoOverrun(uint32 faction, const uint32 diff);
void MoveInLineOfSight(Unit* who); void MoveInLineOfSight(Unit* who);
@@ -425,9 +425,9 @@ public:
void EnterCombat(Unit* /*who*/) {} void EnterCombat(Unit* /*who*/) {}
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
if (i == 0 && instance && !IsOverrun) if (waypointId == 0 && instance && !IsOverrun)
{ {
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{ {
@@ -550,22 +550,24 @@ public:
KnockDownTimer = 10000; KnockDownTimer = 10000;
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
if (i == 7 && instance && !IsOverrun) if (waypointId == 7 && instance && !IsOverrun)
{ {
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{ {
Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL));
if (target && target->isAlive()) if (target && target->isAlive())
me->AddThreat(target, 0.0f); me->AddThreat(target, 0.0f);
}else{ }
else
{
Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE));
if (target && target->isAlive()) if (target && target->isAlive())
me->AddThreat(target, 0.0f); me->AddThreat(target, 0.0f);
} }
} }
if (i == LastOverronPos && IsOverrun) if (waypointId == LastOverronPos && IsOverrun)
{ {
if ((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21)) if ((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21))
{ {
@@ -652,22 +654,24 @@ public:
RandomMove = false; RandomMove = false;
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
if (i == 7 && instance && !IsOverrun) if (waypointId == 7 && instance && !IsOverrun)
{ {
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{ {
Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL));
if (target && target->isAlive()) if (target && target->isAlive())
me->AddThreat(target, 0.0f); me->AddThreat(target, 0.0f);
}else{ }
else
{
Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE));
if (target && target->isAlive()) if (target && target->isAlive())
me->AddThreat(target, 0.0f); me->AddThreat(target, 0.0f);
} }
} }
if (i == LastOverronPos && IsOverrun) if (waypointId == LastOverronPos && IsOverrun)
{ {
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACK_UNARMED); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACK_UNARMED);
if ((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21)) if ((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21))
@@ -675,7 +679,6 @@ public:
me->setDeathState(DEAD); me->setDeathState(DEAD);
me->RemoveCorpse(); me->RemoveCorpse();
} }
} }
} }
@@ -770,16 +773,18 @@ public:
summons.Despawn(summon); summons.Despawn(summon);
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
if (i == 7 && instance && !IsOverrun) if (waypointId == 7 && instance && !IsOverrun)
{ {
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{ {
Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL));
if (target && target->isAlive()) if (target && target->isAlive())
me->AddThreat(target, 0.0f); me->AddThreat(target, 0.0f);
}else{ }
else
{
Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE));
if (target && target->isAlive()) if (target && target->isAlive())
me->AddThreat(target, 0.0f); me->AddThreat(target, 0.0f);
@@ -888,16 +893,18 @@ public:
ShellTimer = 50000+rand()%10000; ShellTimer = 50000+rand()%10000;
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
if (i == 7 && instance && !IsOverrun) if (waypointId == 7 && instance && !IsOverrun)
{ {
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{ {
Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL));
if (target && target->isAlive()) if (target && target->isAlive())
me->AddThreat(target, 0.0f); me->AddThreat(target, 0.0f);
}else{ }
else
{
Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE));
if (target && target->isAlive()) if (target && target->isAlive())
me->AddThreat(target, 0.0f); me->AddThreat(target, 0.0f);
@@ -987,16 +994,18 @@ public:
WebTimer = 20000+rand()%5000; WebTimer = 20000+rand()%5000;
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
if (i == 7 && instance && !IsOverrun) if (waypointId == 7 && instance && !IsOverrun)
{ {
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{ {
Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL));
if (target && target->isAlive()) if (target && target->isAlive())
me->AddThreat(target, 0.0f); me->AddThreat(target, 0.0f);
}else{ }
else
{
Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE));
if (target && target->isAlive()) if (target && target->isAlive())
me->AddThreat(target, 0.0f); me->AddThreat(target, 0.0f);
@@ -1077,16 +1086,18 @@ public:
ManaBurnTimer = 9000+rand()%5000; ManaBurnTimer = 9000+rand()%5000;
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
if (i == 7 && instance && !IsOverrun) if (waypointId == 7 && instance && !IsOverrun)
{ {
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{ {
Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL));
if (target && target->isAlive()) if (target && target->isAlive())
me->AddThreat(target, 0.0f); me->AddThreat(target, 0.0f);
}else{ }
else
{
Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE));
if (target && target->isAlive()) if (target && target->isAlive())
me->AddThreat(target, 0.0f); me->AddThreat(target, 0.0f);
@@ -1170,9 +1181,9 @@ public:
me->SetDisableGravity(true); me->SetDisableGravity(true);
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
if (i == 2 && instance && !IsOverrun) if (waypointId == 2 && instance && !IsOverrun)
{ {
Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL));
if (target && target->isAlive()) if (target && target->isAlive())
@@ -1289,9 +1300,9 @@ public:
me->SetDisableGravity(true); me->SetDisableGravity(true);
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
if (i == 2 && instance && !IsOverrun) if (waypointId == 2 && instance && !IsOverrun)
{ {
Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL));
if (target && target->isAlive()) if (target && target->isAlive())
@@ -446,9 +446,9 @@ public:
++uiStep; ++uiStep;
} }
void WaypointReached(uint32 uiPointId) void WaypointReached(uint32 waypointId)
{ {
switch (uiPointId) switch (waypointId)
{ {
case 0: case 0:
case 1: case 1:
@@ -296,12 +296,12 @@ public:
bool LowHp; bool LowHp;
bool HadMount; bool HadMount;
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
if (!instance) if (!instance)
return; return;
switch (i) switch (waypointId)
{ {
case 8: case 8:
SetRun(false); SetRun(false);
@@ -433,7 +433,6 @@ public:
//trigger epoch Yell("Thrall! Come outside and face your fate! ....") //trigger epoch Yell("Thrall! Come outside and face your fate! ....")
//from here, thrall should not never be allowed to move to point 106 which he currently does. //from here, thrall should not never be allowed to move to point 106 which he currently does.
break; break;
case 106: case 106:
{ {
//trigger taretha to run down outside //trigger taretha to run down outside
@@ -631,9 +630,9 @@ public:
InstanceScript* instance; InstanceScript* instance;
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
switch (i) switch (waypointId)
{ {
case 6: case 6:
DoScriptText(SAY_TA_FREE, me); DoScriptText(SAY_TA_FREE, me);
@@ -643,6 +642,7 @@ public:
break; break;
} }
} }
void Reset() {} void Reset() {}
void EnterCombat(Unit* /*who*/) {} void EnterCombat(Unit* /*who*/) {}
@@ -72,55 +72,54 @@ public:
{ {
npc_willixAI(Creature* creature) : npc_escortAI(creature) {} npc_willixAI(Creature* creature) : npc_escortAI(creature) {}
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 3: case 3:
me->HandleEmoteCommand(EMOTE_STATE_POINT); me->HandleEmoteCommand(EMOTE_STATE_POINT);
DoScriptText(SAY_POINT, me, player); DoScriptText(SAY_POINT, me, player);
break; break;
case 4: case 4:
me->SummonCreature(ENTRY_BOAR, 2137.66f, 1843.98f, 48.08f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(ENTRY_BOAR, 2137.66f, 1843.98f, 48.08f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break; break;
case 8: case 8:
DoScriptText(SAY_BLUELEAF, me, player); DoScriptText(SAY_BLUELEAF, me, player);
break; break;
case 9: case 9:
DoScriptText(SAY_DANGER, me, player); DoScriptText(SAY_DANGER, me, player);
break; break;
case 13: case 13:
DoScriptText(SAY_BAD, me, player); DoScriptText(SAY_BAD, me, player);
break; break;
case 14: case 14:
me->SummonCreature(ENTRY_BOAR, 2078.91f, 1704.54f, 56.77f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(ENTRY_BOAR, 2078.91f, 1704.54f, 56.77f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break; break;
case 25: case 25:
DoScriptText(SAY_THINK, me, player); DoScriptText(SAY_THINK, me, player);
break; break;
case 31: case 31:
DoScriptText(SAY_SOON, me, player); DoScriptText(SAY_SOON, me, player);
break; break;
case 42: case 42:
DoScriptText(SAY_FINALY, me, player); DoScriptText(SAY_FINALY, me, player);
break; break;
case 43: case 43:
me->SummonCreature(ENTRY_BOAR, 1956.43f, 1596.97f, 81.75f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(ENTRY_BOAR, 1956.43f, 1596.97f, 81.75f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break; break;
case 45: case 45:
DoScriptText(SAY_WIN, me, player); DoScriptText(SAY_WIN, me, player);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
if (player->GetTypeId() == TYPEID_PLAYER) if (player->GetTypeId() == TYPEID_PLAYER)
CAST_PLR(player)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER, me); CAST_PLR(player)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER, me);
break; break;
case 46: case 46:
DoScriptText(SAY_END, me, player); DoScriptText(SAY_END, me, player);
break; break;
} }
} }
@@ -151,35 +151,35 @@ public:
uint32 eventProgress; uint32 eventProgress;
InstanceScript* instance; InstanceScript* instance;
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
if (!instance) if (!instance)
return; return;
switch (i) switch (waypointId)
{ {
case 4: case 4:
eventProgress = 1; eventProgress = 1;
currentEvent = TYPE_NARALEX_PART1; currentEvent = TYPE_NARALEX_PART1;
instance->SetData(TYPE_NARALEX_PART1, IN_PROGRESS); instance->SetData(TYPE_NARALEX_PART1, IN_PROGRESS);
break; break;
case 5: case 5:
DoScriptText(SAY_MUST_CONTINUE, me); DoScriptText(SAY_MUST_CONTINUE, me);
instance->SetData(TYPE_NARALEX_PART1, DONE); instance->SetData(TYPE_NARALEX_PART1, DONE);
break; break;
case 11: case 11:
eventProgress = 1; eventProgress = 1;
currentEvent = TYPE_NARALEX_PART2; currentEvent = TYPE_NARALEX_PART2;
instance->SetData(TYPE_NARALEX_PART2, IN_PROGRESS); instance->SetData(TYPE_NARALEX_PART2, IN_PROGRESS);
break; break;
case 19: case 19:
DoScriptText(SAY_BEYOND_THIS_CORRIDOR, me); DoScriptText(SAY_BEYOND_THIS_CORRIDOR, me);
break; break;
case 24: case 24:
eventProgress = 1; eventProgress = 1;
currentEvent = TYPE_NARALEX_PART3; currentEvent = TYPE_NARALEX_PART3;
instance->SetData(TYPE_NARALEX_PART3, IN_PROGRESS); instance->SetData(TYPE_NARALEX_PART3, IN_PROGRESS);
break; break;
} }
} }
+30 -32
View File
@@ -76,35 +76,34 @@ class npc_torek : public CreatureScript
uint32 Thunderclap_Timer; uint32 Thunderclap_Timer;
bool Completed; bool Completed;
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 1: case 1:
Talk(SAY_MOVE, player->GetGUID()); Talk(SAY_MOVE, player->GetGUID());
break; break;
case 8: case 8:
Talk(SAY_PREPARE, player->GetGUID()); Talk(SAY_PREPARE, player->GetGUID());
break; break;
case 19: case 19:
//TODO: verify location and creatures amount. //TODO: verify location and creatures amount.
me->SummonCreature(ENTRY_DURIEL, 1776.73f, -2049.06f, 109.83f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(ENTRY_DURIEL, 1776.73f, -2049.06f, 109.83f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(ENTRY_SILVERWING_SENTINEL, 1774.64f, -2049.41f, 109.83f, 1.40f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(ENTRY_SILVERWING_SENTINEL, 1774.64f, -2049.41f, 109.83f, 1.40f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(ENTRY_SILVERWING_WARRIOR, 1778.73f, -2049.50f, 109.83f, 1.67f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(ENTRY_SILVERWING_WARRIOR, 1778.73f, -2049.50f, 109.83f, 1.67f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break; break;
case 20: case 20:
DoScriptText(SAY_WIN, me, player); DoScriptText(SAY_WIN, me, player);
Completed = true; Completed = true;
player->GroupEventHappens(QUEST_TOREK_ASSULT, me); player->GroupEventHappens(QUEST_TOREK_ASSULT, me);
break; break;
case 21: case 21:
Talk(SAY_END, player->GetGUID()); Talk(SAY_END, player->GetGUID());
break; break;
} }
} }
@@ -182,32 +181,29 @@ class npc_ruul_snowhoof : public CreatureScript
{ {
npc_ruul_snowhoofAI(Creature* creature) : npc_escortAI(creature) { } npc_ruul_snowhoofAI(Creature* creature) : npc_escortAI(creature) { }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 0: case 0:
me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20)) if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
Cage->SetGoState(GO_STATE_ACTIVE); Cage->SetGoState(GO_STATE_ACTIVE);
break; break;
case 13: case 13:
me->SummonCreature(3922, 3449.218018f, -587.825073f, 174.978867f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000); me->SummonCreature(3922, 3449.218018f, -587.825073f, 174.978867f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000);
me->SummonCreature(3921, 3446.384521f, -587.830872f, 175.186279f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000); me->SummonCreature(3921, 3446.384521f, -587.830872f, 175.186279f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000);
me->SummonCreature(3926, 3444.218994f, -587.835327f, 175.380600f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000); me->SummonCreature(3926, 3444.218994f, -587.835327f, 175.380600f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000);
break; break;
case 19: case 19:
me->SummonCreature(3922, 3508.344482f, -492.024261f, 186.929031f, 4.145029f, TEMPSUMMON_DEAD_DESPAWN, 60000); me->SummonCreature(3922, 3508.344482f, -492.024261f, 186.929031f, 4.145029f, TEMPSUMMON_DEAD_DESPAWN, 60000);
me->SummonCreature(3921, 3506.265625f, -490.531006f, 186.740128f, 4.239277f, TEMPSUMMON_DEAD_DESPAWN, 60000); me->SummonCreature(3921, 3506.265625f, -490.531006f, 186.740128f, 4.239277f, TEMPSUMMON_DEAD_DESPAWN, 60000);
me->SummonCreature(3926, 3503.682373f, -489.393799f, 186.629684f, 4.349232f, TEMPSUMMON_DEAD_DESPAWN, 60000); me->SummonCreature(3926, 3503.682373f, -489.393799f, 186.629684f, 4.349232f, TEMPSUMMON_DEAD_DESPAWN, 60000);
break; break;
case 21: case 21:
player->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, me); player->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, me);
break; break;
@@ -316,17 +312,19 @@ class npc_muglash : public CreatureScript
summoned->AI()->AttackStart(me); summoned->AI()->AttackStart(me);
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
switch (i) switch (waypointId)
{ {
case 0: case 0:
DoScriptText(SAY_MUG_START2, me, player); if (player)
DoScriptText(SAY_MUG_START2, me, player);
break; break;
case 24: case 24:
DoScriptText(SAY_MUG_BRAZIER, me, player); if (player)
DoScriptText(SAY_MUG_BRAZIER, me, player);
if (GameObject* go = GetClosestGameObjectWithEntry(me, GO_NAGA_BRAZIER, INTERACTION_DISTANCE*2)) if (GameObject* go = GetClosestGameObjectWithEntry(me, GO_NAGA_BRAZIER, INTERACTION_DISTANCE*2))
{ {
+16 -17
View File
@@ -374,29 +374,28 @@ public:
{ {
npc_magwinAI(Creature* creature) : npc_escortAI(creature) {} npc_magwinAI(Creature* creature) : npc_escortAI(creature) {}
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 0: case 0:
DoScriptText(SAY_START, me, player); DoScriptText(SAY_START, me, player);
break; break;
case 17: case 17:
DoScriptText(SAY_PROGRESS, me, player); DoScriptText(SAY_PROGRESS, me, player);
break; break;
case 28: case 28:
DoScriptText(SAY_END1, me, player); DoScriptText(SAY_END1, me, player);
break; break;
case 29: case 29:
DoScriptText(EMOTE_HUG, me, player); DoScriptText(EMOTE_HUG, me, player);
DoScriptText(SAY_END2, me, player); DoScriptText(SAY_END2, me, player);
player->GroupEventHappens(QUEST_A_CRY_FOR_SAY_HELP, me); player->GroupEventHappens(QUEST_A_CRY_FOR_SAY_HELP, me);
break; break;
} }
} }
+2 -2
View File
@@ -231,13 +231,13 @@ public:
{ {
npc_prospector_remtravelAI(Creature* creature) : npc_escortAI(creature) {} npc_prospector_remtravelAI(Creature* creature) : npc_escortAI(creature) {}
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 0: case 0:
DoScriptText(SAY_REM_START, me, player); DoScriptText(SAY_REM_START, me, player);
+3 -2
View File
@@ -228,10 +228,11 @@ public:
{ {
npc_dalindaAI(Creature* creature) : npc_escortAI(creature) { } npc_dalindaAI(Creature* creature) : npc_escortAI(creature) { }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
switch (i)
switch (waypointId)
{ {
case 1: case 1:
me->IsStandState(); me->IsStandState();
@@ -607,49 +607,48 @@ public:
{ {
npc_stinkyAI(Creature* creature) : npc_escortAI(creature) { } npc_stinkyAI(Creature* creature) : npc_escortAI(creature) { }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 7: case 7:
DoScriptText(SAY_STAY_1, me, player); DoScriptText(SAY_STAY_1, me, player);
break; break;
case 11: case 11:
DoScriptText(SAY_STAY_2, me, player); DoScriptText(SAY_STAY_2, me, player);
break; break;
case 25: case 25:
DoScriptText(SAY_STAY_3, me, player); DoScriptText(SAY_STAY_3, me, player);
break; break;
case 26: case 26:
DoScriptText(SAY_STAY_4, me, player); DoScriptText(SAY_STAY_4, me, player);
break; break;
case 27: case 27:
DoScriptText(SAY_STAY_5, me, player); DoScriptText(SAY_STAY_5, me, player);
break; break;
case 28: case 28:
DoScriptText(SAY_STAY_6, me, player); DoScriptText(SAY_STAY_6, me, player);
me->SetStandState(UNIT_STAND_STATE_KNEEL); me->SetStandState(UNIT_STAND_STATE_KNEEL);
break; break;
case 29: case 29:
me->SetStandState(UNIT_STAND_STATE_STAND); me->SetStandState(UNIT_STAND_STATE_STAND);
break; break;
case 37: case 37:
DoScriptText(SAY_QUEST_COMPLETE, me, player); DoScriptText(SAY_QUEST_COMPLETE, me, player);
me->SetSpeed(MOVE_RUN, 1.2f, true); me->SetSpeed(MOVE_RUN, 1.2f, true);
me->SetWalk(false); me->SetWalk(false);
if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H)) if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H))
player->GroupEventHappens(QUEST_STINKYS_ESCAPE_H, me); player->GroupEventHappens(QUEST_STINKYS_ESCAPE_H, me);
if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_A)) if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_A))
player->GroupEventHappens(QUEST_STINKYS_ESCAPE_A, me); player->GroupEventHappens(QUEST_STINKYS_ESCAPE_A, me);
break; break;
case 39: case 39:
DoScriptText(EMOTE_DISAPPEAR, me); DoScriptText(EMOTE_DISAPPEAR, me);
break; break;
} }
} }
+2 -2
View File
@@ -124,9 +124,9 @@ public:
{ {
npc_oox22feAI(Creature* creature) : npc_escortAI(creature) { } npc_oox22feAI(Creature* creature) : npc_escortAI(creature) { }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
switch (i) switch (waypointId)
{ {
// First Ambush(3 Yetis) // First Ambush(3 Yetis)
case 11: case 11:
+2 -2
View File
@@ -537,9 +537,9 @@ public:
} else if (Event_onWait) Event_Timer -= diff; } else if (Event_onWait) Event_Timer -= diff;
} }
void WaypointReached(uint32 id) void WaypointReached(uint32 waypointId)
{ {
CurrWP = id; CurrWP = waypointId;
Event_Timer = 0; Event_Timer = 0;
Step = 0; Step = 0;
Event_onWait = true; Event_onWait = true;
@@ -114,14 +114,13 @@ public:
{ {
npc_kaya_flathoofAI(Creature* creature) : npc_escortAI(creature) {} npc_kaya_flathoofAI(Creature* creature) : npc_escortAI(creature) {}
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 16: case 16:
DoScriptText(SAY_AMBUSH, me); DoScriptText(SAY_AMBUSH, me);
@@ -129,7 +128,6 @@ public:
me->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85f, -503.77f, -45.90f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); me->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85f, -503.77f, -45.90f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
me->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37f, -496.23f, -45.71f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); me->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37f, -496.23f, -45.71f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
break; break;
case 18: case 18:
me->SetInFront(player); me->SetInFront(player);
DoScriptText(SAY_END, me, player); DoScriptText(SAY_END, me, player);
+55 -24
View File
@@ -172,31 +172,65 @@ public:
{ {
npc_custodian_of_timeAI(Creature* creature) : npc_escortAI(creature) {} npc_custodian_of_timeAI(Creature* creature) : npc_escortAI(creature) {}
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 0: DoScriptText(WHISPER_CUSTODIAN_1, me, player); break; case 0:
case 1: DoScriptText(WHISPER_CUSTODIAN_2, me, player); break; DoScriptText(WHISPER_CUSTODIAN_1, me, player);
case 2: DoScriptText(WHISPER_CUSTODIAN_3, me, player); break; break;
case 3: DoScriptText(WHISPER_CUSTODIAN_4, me, player); break; case 1:
case 5: DoScriptText(WHISPER_CUSTODIAN_5, me, player); break; DoScriptText(WHISPER_CUSTODIAN_2, me, player);
case 6: DoScriptText(WHISPER_CUSTODIAN_6, me, player); break; break;
case 7: DoScriptText(WHISPER_CUSTODIAN_7, me, player); break; case 2:
case 8: DoScriptText(WHISPER_CUSTODIAN_8, me, player); break; DoScriptText(WHISPER_CUSTODIAN_3, me, player);
case 9: DoScriptText(WHISPER_CUSTODIAN_9, me, player); break; break;
case 10: DoScriptText(WHISPER_CUSTODIAN_4, me, player); break; case 3:
case 13: DoScriptText(WHISPER_CUSTODIAN_10, me, player); break; DoScriptText(WHISPER_CUSTODIAN_4, me, player);
case 14: DoScriptText(WHISPER_CUSTODIAN_4, me, player); break; break;
case 16: DoScriptText(WHISPER_CUSTODIAN_11, me, player); break; case 5:
case 17: DoScriptText(WHISPER_CUSTODIAN_12, me, player); break; DoScriptText(WHISPER_CUSTODIAN_5, me, player);
case 18: DoScriptText(WHISPER_CUSTODIAN_4, me, player); break; break;
case 22: DoScriptText(WHISPER_CUSTODIAN_13, me, player); break; case 6:
case 23: DoScriptText(WHISPER_CUSTODIAN_4, me, player); break; DoScriptText(WHISPER_CUSTODIAN_6, me, player);
break;
case 7:
DoScriptText(WHISPER_CUSTODIAN_7, me, player);
break;
case 8:
DoScriptText(WHISPER_CUSTODIAN_8, me, player);
break;
case 9:
DoScriptText(WHISPER_CUSTODIAN_9, me, player);
break;
case 10:
DoScriptText(WHISPER_CUSTODIAN_4, me, player);
break;
case 13:
DoScriptText(WHISPER_CUSTODIAN_10, me, player);
break;
case 14:
DoScriptText(WHISPER_CUSTODIAN_4, me, player);
break;
case 16:
DoScriptText(WHISPER_CUSTODIAN_11, me, player);
break;
case 17:
DoScriptText(WHISPER_CUSTODIAN_12, me, player);
break;
case 18:
DoScriptText(WHISPER_CUSTODIAN_4, me, player);
break;
case 22:
DoScriptText(WHISPER_CUSTODIAN_13, me, player);
break;
case 23:
DoScriptText(WHISPER_CUSTODIAN_4, me, player);
break;
case 24: case 24:
DoScriptText(WHISPER_CUSTODIAN_14, me, player); DoScriptText(WHISPER_CUSTODIAN_14, me, player);
DoCast(player, 34883); DoCast(player, 34883);
@@ -428,14 +462,13 @@ public:
{ {
npc_OOX17AI(Creature* creature) : npc_escortAI(creature) {} npc_OOX17AI(Creature* creature) : npc_escortAI(creature) {}
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 23: case 23:
me->SummonCreature(SPAWN_FIRST, -8350.96f, -4445.79f, 10.10f, 6.20f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(SPAWN_FIRST, -8350.96f, -4445.79f, 10.10f, 6.20f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
@@ -443,7 +476,6 @@ public:
me->SummonCreature(SPAWN_FIRST, -8353.96f, -4442.79f, 10.10f, 6.08f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(SPAWN_FIRST, -8353.96f, -4442.79f, 10.10f, 6.08f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
DoScriptText(SAY_OOX_AMBUSH, me); DoScriptText(SAY_OOX_AMBUSH, me);
break; break;
case 56: case 56:
me->SummonCreature(SPAWN_SECOND_1, -7510.07f, -4795.50f, 9.35f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(SPAWN_SECOND_1, -7510.07f, -4795.50f, 9.35f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(SPAWN_SECOND_2, -7515.07f, -4797.50f, 9.35f, 6.22f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(SPAWN_SECOND_2, -7515.07f, -4797.50f, 9.35f, 6.22f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
@@ -452,7 +484,6 @@ public:
if (Unit* scoff = me->FindNearestCreature(SPAWN_SECOND_2, 30)) if (Unit* scoff = me->FindNearestCreature(SPAWN_SECOND_2, 30))
DoScriptText(SAY_OOX17_AMBUSH_REPLY, scoff); DoScriptText(SAY_OOX17_AMBUSH_REPLY, scoff);
break; break;
case 86: case 86:
DoScriptText(SAY_OOX_END, me); DoScriptText(SAY_OOX_END, me);
player->GroupEventHappens(Q_OOX17, me); player->GroupEventHappens(Q_OOX17, me);
+20 -21
View File
@@ -127,14 +127,13 @@ public:
void Reset() { } void Reset() { }
void WaypointReached(uint32 uiPointId) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (uiPointId) switch (waypointId)
{ {
case 16: case 16:
DoScriptText(SAY_GIL_AT_LAST, me, player); DoScriptText(SAY_GIL_AT_LAST, me, player);
@@ -593,26 +592,26 @@ public:
} }
} }
void WaypointReached(uint32 uiPointId) void WaypointReached(uint32 waypointId)
{ {
switch (uiPointId) switch (waypointId)
{ {
case 0: case 0:
DoScriptText(SAY_STARTUP1, me); DoScriptText(SAY_STARTUP1, me);
break; break;
case 9: case 9:
SetRun(false); SetRun(false);
break; break;
case 17: case 17:
if (Creature* temp = me->SummonCreature(NPC_MERCENARY, 1128.489f, -3037.611f, 92.701f, 1.472f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) if (Creature* temp = me->SummonCreature(NPC_MERCENARY, 1128.489f, -3037.611f, 92.701f, 1.472f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000))
{ {
DoScriptText(SAY_MERCENARY, temp); DoScriptText(SAY_MERCENARY, temp);
me->SummonCreature(NPC_MERCENARY, 1160.172f, -2980.168f, 97.313f, 3.690f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); me->SummonCreature(NPC_MERCENARY, 1160.172f, -2980.168f, 97.313f, 3.690f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
} }
break; break;
case 24: case 24:
m_bIsPostEvent = true; m_bIsPostEvent = true;
break; break;
} }
} }
@@ -75,9 +75,9 @@ public:
void Reset() { } void Reset() { }
void WaypointReached(uint32 uiPointId) void WaypointReached(uint32 waypointId)
{ {
switch (uiPointId) switch (waypointId)
{ {
case 0: case 0:
DoScriptText(SAY_KAN_START, me); DoScriptText(SAY_KAN_START, me);
@@ -166,9 +166,9 @@ public:
void Reset() { } void Reset() { }
void WaypointReached(uint32 uiPointId) void WaypointReached(uint32 waypointId)
{ {
switch (uiPointId) switch (waypointId)
{ {
case 8: case 8:
DoScriptText(SAY_LAKO_LOOK_OUT, me); DoScriptText(SAY_LAKO_LOOK_OUT, me);
@@ -251,9 +251,9 @@ public:
void Reset() { } void Reset() { }
void WaypointReached(uint32 uiPointId) void WaypointReached(uint32 waypointId)
{ {
switch (uiPointId) switch (waypointId)
{ {
case 15: case 15:
DoScriptText(SAY_WYVERN, me); DoScriptText(SAY_WYVERN, me);
@@ -78,14 +78,13 @@ public:
uint32 DEMORALIZINGSHOUT_Timer; uint32 DEMORALIZINGSHOUT_Timer;
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 19: case 19:
me->SummonCreature(ENTRY_STOMPER, -6391.69f, -1730.49f, -272.83f, 4.96f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(ENTRY_STOMPER, -6391.69f, -1730.49f, -272.83f, 4.96f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
@@ -227,9 +227,9 @@ class npc_onyx_flamecaller : public CreatureScript
zarithrian->AI()->JustSummoned(me); zarithrian->AI()->JustSummoned(me);
} }
void WaypointReached(uint32 pointId) void WaypointReached(uint32 waypointId)
{ {
if (pointId == MAX_PATH_FLAMECALLER_WAYPOINTS || pointId == MAX_PATH_FLAMECALLER_WAYPOINTS*2) if (waypointId == MAX_PATH_FLAMECALLER_WAYPOINTS || waypointId == MAX_PATH_FLAMECALLER_WAYPOINTS*2)
{ {
DoZoneInCombat(); DoZoneInCombat();
SetEscortPaused(true); SetEscortPaused(true);
@@ -447,9 +447,9 @@ public:
uint8 uiWaypoint; uint8 uiWaypoint;
void WaypointReached(uint32 uiPoint) void WaypointReached(uint32 waypointId)
{ {
if (uiPoint == 0) if (waypointId == 0)
{ {
switch (uiWaypoint) switch (uiWaypoint)
{ {
@@ -356,7 +356,7 @@ public:
Start(false, true, 0, NULL); Start(false, true, 0, NULL);
} }
void WaypointReached(uint32 /*i*/) void WaypointReached(uint32 /*waypointId*/)
{ {
} }
@@ -203,17 +203,19 @@ public:
Start(false, true, 0, NULL); Start(false, true, 0, NULL);
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
switch (i) if (!instance)
return;
switch (waypointId)
{ {
case 2: case 2:
if (instance && (uiWaypointPath == 3 || uiWaypointPath == 2)) if (uiWaypointPath == 3 || uiWaypointPath == 2)
instance->SetData(DATA_MOVEMENT_DONE, instance->GetData(DATA_MOVEMENT_DONE)+1); instance->SetData(DATA_MOVEMENT_DONE, instance->GetData(DATA_MOVEMENT_DONE)+1);
break; break;
case 3: case 3:
if (instance) instance->SetData(DATA_MOVEMENT_DONE, instance->GetData(DATA_MOVEMENT_DONE)+1);
instance->SetData(DATA_MOVEMENT_DONE, instance->GetData(DATA_MOVEMENT_DONE)+1);
break; break;
} }
} }
@@ -963,8 +963,9 @@ public:
// we dont do melee damage! // we dont do melee damage!
} }
void WaypointReached(uint32 /*i*/) void WaypointReached(uint32 /*waypointId*/)
{ {
} }
private: private:
@@ -346,9 +346,9 @@ public:
lDwarfGUIDList.clear(); lDwarfGUIDList.clear();
} }
void WaypointReached(uint32 uiPointId) void WaypointReached(uint32 waypointId)
{ {
switch (uiPointId) switch (waypointId)
{ {
case 7: case 7:
if (Creature* creature = GetClosestCreatureWithEntry(me, CREATURE_TRIBUNAL_OF_THE_AGES, 100.0f)) if (Creature* creature = GetClosestCreatureWithEntry(me, CREATURE_TRIBUNAL_OF_THE_AGES, 100.0f))
@@ -964,8 +964,9 @@ public:
me->SetReactState(REACT_PASSIVE); me->SetReactState(REACT_PASSIVE);
} }
void WaypointReached(uint32 /*i*/) void WaypointReached(uint32 /*waypointId*/)
{ {
} }
void Reset() void Reset()
@@ -447,32 +447,32 @@ public:
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
} }
void WaypointReached(uint32 uiWPointId) void WaypointReached(uint32 waypointId)
{ {
switch (uiBoss) switch (uiBoss)
{ {
case 1: case 1:
if (uiWPointId == 2) if (waypointId == 2)
FinishPointReached(); FinishPointReached();
break; break;
case 2: case 2:
if (uiWPointId == 2) if (waypointId == 2)
FinishPointReached(); FinishPointReached();
break; break;
case 3: case 3:
if (uiWPointId == 1) if (waypointId == 1)
FinishPointReached(); FinishPointReached();
break; break;
case 4: case 4:
if (uiWPointId == 0) if (waypointId == 0)
FinishPointReached(); FinishPointReached();
break; break;
case 5: case 5:
if (uiWPointId == 0) if (waypointId == 0)
FinishPointReached(); FinishPointReached();
break; break;
case 6: case 6:
if (uiWPointId == 4) if (waypointId == 4)
FinishPointReached(); FinishPointReached();
break; break;
} }
@@ -690,32 +690,32 @@ struct violet_hold_trashAI : public npc_escortAI
uint32 portalLocationID; uint32 portalLocationID;
uint32 secondPortalRouteID; uint32 secondPortalRouteID;
void WaypointReached(uint32 uiPointId) void WaypointReached(uint32 waypointId)
{ {
switch (portalLocationID) switch (portalLocationID)
{ {
case 0: case 0:
if (uiPointId == 5) if (waypointId == 5)
CreatureStartAttackDoor(); CreatureStartAttackDoor();
break; break;
case 1: case 1:
if ((uiPointId == 8 && secondPortalRouteID == 0) || (uiPointId == 7 && secondPortalRouteID == 1)) if ((waypointId == 8 && secondPortalRouteID == 0) || (waypointId == 7 && secondPortalRouteID == 1))
CreatureStartAttackDoor(); CreatureStartAttackDoor();
break; break;
case 2: case 2:
if (uiPointId == 7) if (waypointId == 7)
CreatureStartAttackDoor(); CreatureStartAttackDoor();
break; break;
case 3: case 3:
if (uiPointId == 8) if (waypointId == 8)
CreatureStartAttackDoor(); CreatureStartAttackDoor();
break; break;
case 4: case 4:
if (uiPointId == 5) if (waypointId == 5)
CreatureStartAttackDoor(); CreatureStartAttackDoor();
break; break;
case 5: case 5:
if (uiPointId == 3) if (waypointId == 3)
CreatureStartAttackDoor(); CreatureStartAttackDoor();
break; break;
} }
+27 -30
View File
@@ -716,9 +716,9 @@ public:
} }
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
switch (i) switch (waypointId)
{ {
case 0: case 0:
IntroPhase = 1; IntroPhase = 1;
@@ -1012,13 +1012,13 @@ public:
uiPhaseTimer = 0; uiPhaseTimer = 0;
} }
void WaypointReached(uint32 uiPointId) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (uiPointId) switch (waypointId)
{ {
case 3: case 3:
SetEscortPaused(true); SetEscortPaused(true);
@@ -1038,7 +1038,6 @@ public:
} }
me->SetWalk(false); me->SetWalk(false);
break; break;
case 4: case 4:
SetEscortPaused(true); SetEscortPaused(true);
uiPhase = 7; uiPhase = 7;
@@ -1851,34 +1850,33 @@ public:
player->FailQuest(QUEST_ESCAPING_THE_MIST); player->FailQuest(QUEST_ESCAPING_THE_MIST);
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 10: case 10:
me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
DoScriptText(SAY_2, me); DoScriptText(SAY_2, me);
break; break;
case 12: case 12:
DoScriptText(SAY_3, me); DoScriptText(SAY_3, me);
me->HandleEmoteCommand(EMOTE_ONESHOT_LOOT); me->HandleEmoteCommand(EMOTE_ONESHOT_LOOT);
break; break;
case 16: case 16:
DoScriptText(SAY_4, me); DoScriptText(SAY_4, me);
me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
break; break;
case 20: case 20:
me->SetPhaseMask(1, true); me->SetPhaseMask(1, true);
DoScriptText(SAY_5, me); DoScriptText(SAY_5, me);
me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
player->GroupEventHappens(QUEST_ESCAPING_THE_MIST, me); player->GroupEventHappens(QUEST_ESCAPING_THE_MIST, me);
SetRun(true); SetRun(true);
break; break;
} }
} }
}; };
@@ -1951,14 +1949,13 @@ public:
else Bonker_agro=0; else Bonker_agro=0;
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 29: case 29:
player->GroupEventHappens(QUEST_GET_ME_OUTA_HERE, me); player->GroupEventHappens(QUEST_GET_ME_OUTA_HERE, me);
@@ -74,13 +74,13 @@ public:
summoned->AI()->AttackStart(me->getVictim()); summoned->AI()->AttackStart(me->getVictim());
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 9: case 9:
if (Creature* Mrfloppy = GetClosestCreatureWithEntry(me, NPC_MRFLOPPY, 100.0f)) if (Creature* Mrfloppy = GetClosestCreatureWithEntry(me, NPC_MRFLOPPY, 100.0f))
@@ -97,13 +97,13 @@ public:
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 1: case 1:
me->SetReactState(REACT_AGGRESSIVE); me->SetReactState(REACT_AGGRESSIVE);
+31 -29
View File
@@ -70,39 +70,40 @@ public:
} }
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 1: SetRun(); break; case 1:
case 10: SetRun();
case 11: break;
case 12: case 10:
case 13: case 11:
case 14: case 12:
case 15: case 13:
case 16: case 14:
case 17: case 15:
case 18: case 16:
me->RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING); case 17:
me->RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING); case 18:
me->SetSpeed(MOVE_SWIM, 0.85f, true); me->RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING);
me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_DISABLE_GRAVITY); me->RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING);
break; me->SetSpeed(MOVE_SWIM, 0.85f, true);
case 19: me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_DISABLE_GRAVITY);
me->SetUnitMovementFlags(MOVEMENTFLAG_FALLING); break;
break; case 19:
case 28: me->SetUnitMovementFlags(MOVEMENTFLAG_FALLING);
player->GroupEventHappens(QUEST_FORTUNATE_MISUNDERSTANDINGS, me); break;
// me->RestoreFaction(); case 28:
DoScriptText(SAY_END_IRO, me); player->GroupEventHappens(QUEST_FORTUNATE_MISUNDERSTANDINGS, me);
SetRun(false); // me->RestoreFaction();
break; DoScriptText(SAY_END_IRO, me);
SetRun(false);
break;
} }
} }
@@ -359,10 +360,11 @@ public:
uint32 m_uiChatTimer; uint32 m_uiChatTimer;
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
switch (i)
switch (waypointId)
{ {
case 0: case 0:
DoScriptText(SAY_WP_2, me); DoScriptText(SAY_WP_2, me);
+3 -4
View File
@@ -374,18 +374,17 @@ public:
{ {
npc_injured_goblinAI(Creature* creature) : npc_escortAI(creature) { } npc_injured_goblinAI(Creature* creature) : npc_escortAI(creature) { }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 26: case 26:
DoScriptText(SAY_END_WP_REACHED, me, player); DoScriptText(SAY_END_WP_REACHED, me, player);
break; break;
case 27: case 27:
player->GroupEventHappens(QUEST_BITTER_DEPARTURE, me); player->GroupEventHappens(QUEST_BITTER_DEPARTURE, me);
break; break;
@@ -672,7 +671,7 @@ public:
} }
} }
void WaypointReached(uint32 /*wp*/) void WaypointReached(uint32 /*waypointId*/)
{ {
} }
+4 -4
View File
@@ -740,9 +740,9 @@ public:
bEnrage = false; bEnrage = false;
} }
void WaypointReached(uint32 uiI) void WaypointReached(uint32 waypointId)
{ {
switch (uiI) switch (waypointId)
{ {
case 6: case 6:
me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0); me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0);
@@ -934,9 +934,9 @@ public:
bThunderClap = false; bThunderClap = false;
} }
void WaypointReached(uint32 uiI) void WaypointReached(uint32 waypointId)
{ {
switch (uiI) switch (waypointId)
{ {
case 7: case 7:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
@@ -102,7 +102,7 @@ public:
npc_escortAI::MoveInLineOfSight(who); npc_escortAI::MoveInLineOfSight(who);
} }
void WaypointReached(uint32 /*i*/) void WaypointReached(uint32 /*waypointId*/)
{ {
} }
@@ -180,9 +180,9 @@ public:
npc_escortAI::MoveInLineOfSight(who); npc_escortAI::MoveInLineOfSight(who);
} }
void WaypointReached(uint32 uiPointId) void WaypointReached(uint32 waypointId)
{ {
switch (uiPointId) switch (waypointId)
{ {
case 0: case 0:
DoScriptText(EMOTE_WOLF_LIFT_HEAD, me); DoScriptText(EMOTE_WOLF_LIFT_HEAD, me);
@@ -402,38 +402,37 @@ public:
{ {
npc_wounded_blood_elfAI(Creature* creature) : npc_escortAI(creature) {} npc_wounded_blood_elfAI(Creature* creature) : npc_escortAI(creature) {}
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 0: case 0:
DoScriptText(SAY_ELF_START, me, player); DoScriptText(SAY_ELF_START, me, player);
break; break;
case 9: case 9:
DoScriptText(SAY_ELF_SUMMON1, me, player); DoScriptText(SAY_ELF_SUMMON1, me, player);
// Spawn two Haal'eshi Talonguard // Spawn two Haal'eshi Talonguard
DoSpawnCreature(16967, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); DoSpawnCreature(16967, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
DoSpawnCreature(16967, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); DoSpawnCreature(16967, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
break; break;
case 13: case 13:
DoScriptText(SAY_ELF_RESTING, me, player); DoScriptText(SAY_ELF_RESTING, me, player);
break; break;
case 14: case 14:
DoScriptText(SAY_ELF_SUMMON2, me, player); DoScriptText(SAY_ELF_SUMMON2, me, player);
// Spawn two Haal'eshi Windwalker // Spawn two Haal'eshi Windwalker
DoSpawnCreature(16966, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); DoSpawnCreature(16966, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
DoSpawnCreature(16966, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); DoSpawnCreature(16966, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
break; break;
case 27: case 27:
DoScriptText(SAY_ELF_COMPLETE, me, player); DoScriptText(SAY_ELF_COMPLETE, me, player);
// Award quest credit // Award quest credit
player->GroupEventHappens(QUEST_ROAD_TO_FALCON_WATCH, me); player->GroupEventHappens(QUEST_ROAD_TO_FALCON_WATCH, me);
break; break;
} }
} }
+4 -4
View File
@@ -221,9 +221,9 @@ public:
DoCast(me, SPELL_EARTHBIND_TOTEM, false); DoCast(me, SPELL_EARTHBIND_TOTEM, false);
} }
void WaypointReached(uint32 uiPointId) void WaypointReached(uint32 waypointId)
{ {
switch (uiPointId) switch (waypointId)
{ {
case 7: case 7:
DoScriptText(SAY_MAG_MORE, me); DoScriptText(SAY_MAG_MORE, me);
@@ -565,9 +565,9 @@ public:
} }
} }
void WaypointReached(uint32 PointId) void WaypointReached(uint32 waypointId)
{ {
switch(PointId) switch (waypointId)
{ {
case 3: case 3:
{ {
+8 -9
View File
@@ -889,33 +889,32 @@ public:
player->FailQuest(Q_ALMABTRIEB); player->FailQuest(Q_ALMABTRIEB);
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 3: //first spawn case 3: //first spawn
me->SummonCreature(SPAWN_FIRST, 2449.67f, 2183.11f, 96.85f, 6.20f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(SPAWN_FIRST, 2449.67f, 2183.11f, 96.85f, 6.20f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(SPAWN_FIRST, 2449.53f, 2184.43f, 96.36f, 6.27f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(SPAWN_FIRST, 2449.53f, 2184.43f, 96.36f, 6.27f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(SPAWN_FIRST, 2449.85f, 2186.34f, 97.57f, 6.08f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(SPAWN_FIRST, 2449.85f, 2186.34f, 97.57f, 6.08f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break; break;
case 7: case 7:
me->SummonCreature(SPAWN_SECOND, 2309.64f, 2186.24f, 92.25f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(SPAWN_SECOND, 2309.64f, 2186.24f, 92.25f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(SPAWN_SECOND, 2309.25f, 2183.46f, 91.75f, 6.22f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(SPAWN_SECOND, 2309.25f, 2183.46f, 91.75f, 6.22f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break; break;
case 12: case 12:
player->GroupEventHappens(Q_ALMABTRIEB, me); player->GroupEventHappens(Q_ALMABTRIEB, me);
if (me->FindNearestCreature(N_THADELL, 30)) if (me->FindNearestCreature(N_THADELL, 30))
DoScriptText(SAY_THADELL_1, me); break; DoScriptText(SAY_THADELL_1, me);
break;
case 13: case 13:
if (me->FindNearestCreature(N_THADELL, 30)) if (me->FindNearestCreature(N_THADELL, 30))
DoScriptText(SAY_THADELL_2, me, player); break; DoScriptText(SAY_THADELL_2, me, player);
break;
} }
} }
@@ -964,13 +963,13 @@ public:
uiTakeTimer=3000; uiTakeTimer=3000;
} }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 7: case 7:
case 17: case 17:
@@ -1054,14 +1054,13 @@ public:
m_uiHealingTimer = 0; m_uiHealingTimer = 0;
} }
void WaypointReached(uint32 uiPointId) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (uiPointId) switch (waypointId)
{ {
case 13: case 13:
DoScriptText(SAY_WIL_PROGRESS1, me, player); DoScriptText(SAY_WIL_PROGRESS1, me, player);
+65 -24
View File
@@ -319,36 +319,77 @@ public:
public: public:
npc_kservantAI(Creature* creature) : npc_escortAI(creature) {} npc_kservantAI(Creature* creature) : npc_escortAI(creature) {}
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 0: DoScriptText(SAY1, me, player); break; case 0:
case 4: DoScriptText(WHISP1, me, player); break; DoScriptText(SAY1, me, player);
case 6: DoScriptText(WHISP2, me, player); break; break;
case 7: DoScriptText(WHISP3, me, player); break; case 4:
case 8: DoScriptText(WHISP4, me, player); break; DoScriptText(WHISP1, me, player);
case 17: DoScriptText(WHISP5, me, player); break; break;
case 18: DoScriptText(WHISP6, me, player); break; case 6:
case 19: DoScriptText(WHISP7, me, player); break; DoScriptText(WHISP2, me, player);
case 33: DoScriptText(WHISP8, me, player); break; break;
case 34: DoScriptText(WHISP9, me, player); break; case 7:
case 35: DoScriptText(WHISP10, me, player); break; DoScriptText(WHISP3, me, player);
case 36: DoScriptText(WHISP11, me, player); break; break;
case 43: DoScriptText(WHISP12, me, player); break; case 8:
case 44: DoScriptText(WHISP13, me, player); break; DoScriptText(WHISP4, me, player);
case 49: DoScriptText(WHISP14, me, player); break; break;
case 50: DoScriptText(WHISP15, me, player); break; case 17:
case 51: DoScriptText(WHISP16, me, player); break; DoScriptText(WHISP5, me, player);
case 52: DoScriptText(WHISP17, me, player); break; break;
case 53: DoScriptText(WHISP18, me, player); break; case 18:
case 54: DoScriptText(WHISP19, me, player); break; DoScriptText(WHISP6, me, player);
case 55: DoScriptText(WHISP20, me, player); break; break;
case 19:
DoScriptText(WHISP7, me, player);
break;
case 33:
DoScriptText(WHISP8, me, player);
break;
case 34:
DoScriptText(WHISP9, me, player);
break;
case 35:
DoScriptText(WHISP10, me, player);
break;
case 36:
DoScriptText(WHISP11, me, player);
break;
case 43:
DoScriptText(WHISP12, me, player);
break;
case 44:
DoScriptText(WHISP13, me, player);
break;
case 49:
DoScriptText(WHISP14, me, player);
break;
case 50:
DoScriptText(WHISP15, me, player);
break;
case 51:
DoScriptText(WHISP16, me, player);
break;
case 52:
DoScriptText(WHISP17, me, player);
break;
case 53:
DoScriptText(WHISP18, me, player);
break;
case 54:
DoScriptText(WHISP19, me, player);
break;
case 55:
DoScriptText(WHISP20, me, player);
break;
case 56: case 56:
DoScriptText(WHISP21, me, player); DoScriptText(WHISP21, me, player);
player->GroupEventHappens(10211, me); player->GroupEventHappens(10211, me);
+6 -14
View File
@@ -202,13 +202,13 @@ public:
public: public:
npc_skywingAI(Creature* creature) : npc_escortAI(creature) {} npc_skywingAI(Creature* creature) : npc_escortAI(creature) {}
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 8: case 8:
player->AreaExploredOrEventHappens(10898); player->AreaExploredOrEventHappens(10898);
@@ -461,32 +461,27 @@ public:
{ {
npc_isla_starmaneAI(Creature* creature) : npc_escortAI(creature) {} npc_isla_starmaneAI(Creature* creature) : npc_escortAI(creature) {}
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 0: case 0:
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10)) if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10))
Cage->SetGoState(GO_STATE_ACTIVE); Cage->SetGoState(GO_STATE_ACTIVE);
break; break;
case 2: case 2:
DoScriptText(SAY_PROGRESS_1, me, player); DoScriptText(SAY_PROGRESS_1, me, player);
break; break;
case 5: case 5:
DoScriptText(SAY_PROGRESS_2, me, player); DoScriptText(SAY_PROGRESS_2, me, player);
break; break;
case 6: case 6:
DoScriptText(SAY_PROGRESS_3, me, player); DoScriptText(SAY_PROGRESS_3, me, player);
break; break;
case 29: case 29:
DoScriptText(SAY_PROGRESS_4, me, player); DoScriptText(SAY_PROGRESS_4, me, player);
if (player->GetTeam() == ALLIANCE) if (player->GetTeam() == ALLIANCE)
@@ -495,11 +490,9 @@ public:
player->GroupEventHappens(QUEST_EFTW_H, me); player->GroupEventHappens(QUEST_EFTW_H, me);
me->SetInFront(player); me->SetInFront(player);
break; break;
case 30: case 30:
me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
break; break;
case 31: case 31:
DoCast(me, SPELL_CAT); DoCast(me, SPELL_CAT);
me->SetWalk(false); me->SetWalk(false);
@@ -673,14 +666,13 @@ public:
{ {
npc_akunoAI(Creature* creature) : npc_escortAI(creature) {} npc_akunoAI(Creature* creature) : npc_escortAI(creature) {}
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 3: case 3:
me->SummonCreature(NPC_CABAL_SKRIMISHER, -2795.99f, 5420.33f, -34.53f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(NPC_CABAL_SKRIMISHER, -2795.99f, 5420.33f, -34.53f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+2 -3
View File
@@ -322,14 +322,13 @@ public:
void Reset() { } void Reset() { }
void WaypointReached(uint32 i) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (i) switch (waypointId)
{ {
case 4: case 4:
DoScriptText(SAY_AMBUSH1, me, player); DoScriptText(SAY_AMBUSH1, me, player);
+2 -1
View File
@@ -1040,8 +1040,9 @@ public:
} }
} }
void WaypointReached(uint32 /*point*/) void WaypointReached(uint32 /*waypointId*/)
{ {
} }
void UpdateAI(uint32 const diff) void UpdateAI(uint32 const diff)
+11 -11
View File
@@ -38,11 +38,11 @@ Log::Log() :
Log::~Log() Log::~Log()
{ {
if ( logfile != NULL ) if (logfile != NULL)
fclose(logfile); fclose(logfile);
logfile = NULL; logfile = NULL;
if ( gmLogfile != NULL ) if (gmLogfile != NULL)
fclose(gmLogfile); fclose(gmLogfile);
gmLogfile = NULL; gmLogfile = NULL;
@@ -50,7 +50,7 @@ Log::~Log()
fclose(charLogfile); fclose(charLogfile);
charLogfile = NULL; charLogfile = NULL;
if ( dberLogfile != NULL ) if (dberLogfile != NULL)
fclose(dberLogfile); fclose(dberLogfile);
dberLogfile = NULL; dberLogfile = NULL;
@@ -81,32 +81,32 @@ Log::~Log()
void Log::SetLogLevel(char *Level) void Log::SetLogLevel(char *Level)
{ {
int32 NewLevel =atoi((char*)Level); int32 NewLevel = atoi((char*)Level);
if ( NewLevel <0 ) if (NewLevel < 0)
NewLevel = 0; NewLevel = 0;
m_logLevel = NewLevel; m_logLevel = NewLevel;
outString( "LogLevel is %u", m_logLevel ); outString("LogLevel is %u", m_logLevel);
} }
void Log::SetLogFileLevel(char *Level) void Log::SetLogFileLevel(char *Level)
{ {
int32 NewLevel =atoi((char*)Level); int32 NewLevel = atoi((char*)Level);
if ( NewLevel <0 ) if (NewLevel < 0)
NewLevel = 0; NewLevel = 0;
m_logFileLevel = NewLevel; m_logFileLevel = NewLevel;
outString( "LogFileLevel is %u", m_logFileLevel ); outString("LogFileLevel is %u", m_logFileLevel);
} }
void Log::SetDBLogLevel(char *Level) void Log::SetDBLogLevel(char *Level)
{ {
int32 NewLevel = atoi((char*)Level); int32 NewLevel = atoi((char*)Level);
if ( NewLevel < 0 ) if (NewLevel < 0)
NewLevel = 0; NewLevel = 0;
m_dbLogLevel = NewLevel; m_dbLogLevel = NewLevel;
outString( "DBLogLevel is %u", m_dbLogLevel ); outString("DBLogLevel is %u", m_dbLogLevel);
} }
void Log::Initialize() void Log::Initialize()
+21 -21
View File
@@ -117,28 +117,28 @@ class Log
void SetColor(bool stdout_stream, ColorTypes color); void SetColor(bool stdout_stream, ColorTypes color);
void ResetColor(bool stdout_stream); void ResetColor(bool stdout_stream);
void outErrorST( const char * err, ... ) ATTR_PRINTF(2, 3); void outErrorST(const char * err, ...) ATTR_PRINTF(2, 3);
void outDB( LogTypes type, const char * str ); void outDB(LogTypes type, const char * str);
void outString( const char * str, ... ) ATTR_PRINTF(2, 3); void outString(const char * str, ...) ATTR_PRINTF(2, 3);
void outString( ); void outString();
void outStringInLine( const char * str, ... ) ATTR_PRINTF(2, 3); void outStringInLine(const char * str, ...) ATTR_PRINTF(2, 3);
void outError( const char * err, ... ) ATTR_PRINTF(2, 3); void outError(const char * err, ...) ATTR_PRINTF(2, 3);
void outCrash( const char * err, ... ) ATTR_PRINTF(2, 3); void outCrash(const char * err, ...) ATTR_PRINTF(2, 3);
void outBasic( const char * str, ... ) ATTR_PRINTF(2, 3); void outBasic(const char * str, ...) ATTR_PRINTF(2, 3);
void outDetail( const char * str, ... ) ATTR_PRINTF(2, 3); void outDetail(const char * str, ...) ATTR_PRINTF(2, 3);
void outSQLDev( const char * str, ... ) ATTR_PRINTF(2, 3); void outSQLDev(const char * str, ...) ATTR_PRINTF(2, 3);
void outDebug(DebugLogFilters f, const char* str, ...) ATTR_PRINTF(3, 4); void outDebug(DebugLogFilters f, const char* str, ...) ATTR_PRINTF(3, 4);
void outStaticDebug( const char * str, ... ) ATTR_PRINTF(2, 3); void outStaticDebug(const char * str, ...) ATTR_PRINTF(2, 3);
void outDebugInLine( const char * str, ... ) ATTR_PRINTF(2, 3); void outDebugInLine(const char * str, ...) ATTR_PRINTF(2, 3);
void outErrorDb( const char * str, ... ) ATTR_PRINTF(2, 3); void outErrorDb(const char * str, ...) ATTR_PRINTF(2, 3);
void outChar( const char * str, ... ) ATTR_PRINTF(2, 3); void outChar(const char * str, ...) ATTR_PRINTF(2, 3);
void outCommand( uint32 account, const char * str, ...) ATTR_PRINTF(3, 4); void outCommand(uint32 account, const char * str, ...) ATTR_PRINTF(3, 4);
void outRemote( const char * str, ... ) ATTR_PRINTF(2, 3); void outRemote(const char * str, ...) ATTR_PRINTF(2, 3);
void outChat( const char * str, ... ) ATTR_PRINTF(2, 3); void outChat(const char * str, ...) ATTR_PRINTF(2, 3);
void outArena( const char * str, ... ) ATTR_PRINTF(2, 3); void outArena(const char * str, ...) ATTR_PRINTF(2, 3);
void outSQLDriver( const char* str, ... ) ATTR_PRINTF(2, 3); void outSQLDriver(const char* str, ...) ATTR_PRINTF(2, 3);
void outWarden( const char * str, ... ) ATTR_PRINTF(2, 3); void outWarden(const char * str, ...) ATTR_PRINTF(2, 3);
void outCharDump( const char * str, uint32 account_id, uint32 guid, const char * name ); void outCharDump(const char * str, uint32 account_id, uint32 guid, const char * name);
static void outTimestamp(FILE* file); static void outTimestamp(FILE* file);
static std::string GetTimestampStr(); static std::string GetTimestampStr();