[svn] *** Source: MaNGOS ***
* Fixed build extractor at Windows Vista. Author: Vladimir * Fixed comment text and code indentifiers spelling. Author: Vladimir & Paradox. * Access cached member lists in guild handlers instead of querying the DB. Author: Hunuza * Small fixes in send/received packet and simple code cleanup also. Author: Vladimir * Not output error at loading empty character_ticket table. Author: Vladimir * Not reset display model at shapeshift aura remove if it not set at apply. Author: Arthorius * Applied props to few files. --HG-- branch : trunk
This commit is contained in:
@@ -51,7 +51,7 @@ AggressorAI::MoveInLineOfSight(Unit *u)
|
||||
|
||||
if( !i_creature.getVictim() && !i_creature.hasUnitState(UNIT_STAT_STUNNED) && i_creature.canAttack(u) &&
|
||||
( i_creature.IsHostileTo( u ) /*|| u->getVictim() && i_creature.IsFriendlyTo( u->getVictim() )*/ ) &&
|
||||
u->isInAccessablePlaceFor(&i_creature) )
|
||||
u->isInAccessiblePlaceFor(&i_creature) )
|
||||
{
|
||||
float attackRadius = i_creature.GetAttackDistance(u);
|
||||
if(i_creature.IsWithinDistInMap(u, attackRadius) && i_creature.IsWithinLOSInMap(u) )
|
||||
|
||||
@@ -178,7 +178,7 @@ void WorldSession::SendAuctionOutbiddedMail(AuctionEntry *auction, uint32 newPri
|
||||
}
|
||||
}
|
||||
|
||||
//this function sends mail, when auction is cancelled to old bidder
|
||||
//this function sends mail, when auction is canceled to old bidder
|
||||
void WorldSession::SendAuctionCancelledToBidderMail( AuctionEntry* auction )
|
||||
{
|
||||
uint64 bidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER);
|
||||
@@ -245,7 +245,7 @@ void WorldSession::HandleAuctionSellItem( WorldPacket & recv_data )
|
||||
SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_INTERNAL_ERROR);
|
||||
return;
|
||||
}
|
||||
// prevent sending bag with items (cheat: can be placed in bag after adding equiped empty bag to auction)
|
||||
// prevent sending bag with items (cheat: can be placed in bag after adding equipped empty bag to auction)
|
||||
if(!it)
|
||||
{
|
||||
SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_ITEM_NOT_FOUND);
|
||||
|
||||
@@ -627,12 +627,12 @@ void BattleGroundQueue::Update(uint32 bgTypeId, uint32 queue_id, uint8 arenatype
|
||||
// try to build the selection pools
|
||||
bool bAllyOK = BuildSelectionPool(bgTypeId, queue_id, MinPlayersPerTeam, MaxPlayersPerTeam, NORMAL_ALLIANCE, arenatype, isRated, arenaMinRating, arenaMaxRating, discardTime);
|
||||
if(bAllyOK)
|
||||
sLog.outDebug("Battleground: ally pool succesfully build");
|
||||
sLog.outDebug("Battleground: ally pool successfully build");
|
||||
else
|
||||
sLog.outDebug("Battleground: ally pool wasn't created");
|
||||
bool bHordeOK = BuildSelectionPool(bgTypeId, queue_id, MinPlayersPerTeam, MaxPlayersPerTeam, NORMAL_HORDE, arenatype, isRated, arenaMinRating, arenaMaxRating, discardTime);
|
||||
if(bHordeOK)
|
||||
sLog.outDebug("Battleground: horde pool succesfully built");
|
||||
sLog.outDebug("Battleground: horde pool successfully built");
|
||||
else
|
||||
sLog.outDebug("Battleground: horde pool wasn't created");
|
||||
|
||||
|
||||
+2
-2
@@ -1024,7 +1024,7 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* linkType, char** s
|
||||
if(!text)
|
||||
return NULL;
|
||||
|
||||
// skip speces
|
||||
// skip spaces
|
||||
while(*text==' '||*text=='\t'||*text=='\b')
|
||||
++text;
|
||||
|
||||
@@ -1072,7 +1072,7 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* const* linkTypes,
|
||||
if(!text)
|
||||
return NULL;
|
||||
|
||||
// skip speces
|
||||
// skip spaces
|
||||
while(*text==' '||*text=='\t'||*text=='\b')
|
||||
++text;
|
||||
|
||||
|
||||
+10
-10
@@ -336,11 +336,11 @@ void Creature::Update(uint32 diff)
|
||||
switch( m_deathState )
|
||||
{
|
||||
case JUST_ALIVED:
|
||||
// Dont must be called, see Creature::setDeathState JUST_ALIVED -> ALIVE promoting.
|
||||
// Don't must be called, see Creature::setDeathState JUST_ALIVED -> ALIVE promoting.
|
||||
sLog.outError("Creature (GUIDLow: %u Entry: %u ) in wrong state: JUST_ALIVED (4)",GetGUIDLow(),GetEntry());
|
||||
break;
|
||||
case JUST_DIED:
|
||||
// Dont must be called, see Creature::setDeathState JUST_DIED -> CORPSE promoting.
|
||||
// Don't must be called, see Creature::setDeathState JUST_DIED -> CORPSE promoting.
|
||||
sLog.outError("Creature (GUIDLow: %u Entry: %u ) in wrong state: JUST_DEAD (1)",GetGUIDLow(),GetEntry());
|
||||
break;
|
||||
case DEAD:
|
||||
@@ -506,7 +506,7 @@ void Creature::RegenerateHealth()
|
||||
|
||||
uint32 addvalue = 0;
|
||||
|
||||
// Not only pet, but any controelled creature
|
||||
// Not only pet, but any controlled creature
|
||||
if(GetCharmerOrOwnerGUID())
|
||||
{
|
||||
float HealthIncreaseRate = sWorld.getRate(RATE_HEALTH);
|
||||
@@ -863,7 +863,7 @@ void Creature::sendPreparedGossip(Player* player)
|
||||
}
|
||||
|
||||
// in case non empty gossip menu (that not included quests list size) show it
|
||||
// (quest entries from quest menu wiill be included in list)
|
||||
// (quest entries from quest menu will be included in list)
|
||||
player->PlayerTalkClass->SendGossipMenu(GetNpcTextId(), GetGUID());
|
||||
}
|
||||
|
||||
@@ -1147,7 +1147,7 @@ void Creature::SetLootRecipient(Unit *unit)
|
||||
void Creature::SaveToDB()
|
||||
{
|
||||
// this should only be used when the creature has already been loaded
|
||||
// perferably after adding to map, because mapid may not be valid otherwise
|
||||
// preferably after adding to map, because mapid may not be valid otherwise
|
||||
CreatureData const *data = objmgr.GetCreatureData(m_DBTableGuid);
|
||||
if(!data)
|
||||
{
|
||||
@@ -1556,7 +1556,7 @@ float Creature::GetAttackDistance(Unit const* pl) const
|
||||
// "The aggro radius of a mob having the same level as the player is roughly 20 yards"
|
||||
float RetDistance = 20;
|
||||
|
||||
// "Aggro Radius varries with level difference at a rate of roughly 1 yard/level"
|
||||
// "Aggro Radius varies with level difference at a rate of roughly 1 yard/level"
|
||||
// radius grow if playlevel < creaturelevel
|
||||
RetDistance -= (float)leveldif;
|
||||
|
||||
@@ -1583,7 +1583,7 @@ void Creature::setDeathState(DeathState s)
|
||||
m_deathTimer = m_corpseDelay*1000;
|
||||
|
||||
// always save boss respawn time at death to prevent crash cheating
|
||||
if(sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATLY) || isWorldBoss())
|
||||
if(sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY) || isWorldBoss())
|
||||
SaveRespawnTime();
|
||||
|
||||
if(!IsStopped())
|
||||
@@ -1875,7 +1875,7 @@ bool Creature::IsOutOfThreatArea(Unit* pVictim) const
|
||||
if(!canAttack(pVictim))
|
||||
return true;
|
||||
|
||||
if(!pVictim->isInAccessablePlaceFor(this))
|
||||
if(!pVictim->isInAccessiblePlaceFor(this))
|
||||
return true;
|
||||
|
||||
if(sMapStore.LookupEntry(GetMapId())->Instanceable())
|
||||
@@ -1885,7 +1885,7 @@ bool Creature::IsOutOfThreatArea(Unit* pVictim) const
|
||||
float AttackDist = GetAttackDistance(pVictim);
|
||||
uint32 ThreatRadius = sWorld.getConfig(CONFIG_THREAT_RADIUS);
|
||||
|
||||
//Use AttackDistance in distance check if threat radius is lower. This prevents creature bounce in and ouf of combat every update tick.
|
||||
//Use AttackDistance in distance check if threat radius is lower. This prevents creature bounce in and out of combat every update tick.
|
||||
return ( length > (ThreatRadius > AttackDist ? ThreatRadius : AttackDist));
|
||||
}
|
||||
|
||||
@@ -1954,7 +1954,7 @@ bool Creature::LoadCreaturesAddon(bool reload)
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Send a message to LocalDefense channel for players oposition team in the zone
|
||||
/// Send a message to LocalDefense channel for players opposition team in the zone
|
||||
void Creature::SendZoneUnderAttackMessage(Player* attacker)
|
||||
{
|
||||
uint32 enemy_team = attacker->GetTeam();
|
||||
|
||||
+181
-181
@@ -1,181 +1,181 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2008 MaNGOS
|
||||
*
|
||||
* Copyright (C) 2008 Trinity
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "Language.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "Log.h"
|
||||
#include "GMTicketMgr.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
#include "Chat.h"
|
||||
|
||||
void WorldSession::SendGMTicketGetTicket(uint32 status, char const* text)
|
||||
{
|
||||
int len = text ? strlen(text) : 0;
|
||||
WorldPacket data( SMSG_GMTICKET_GETTICKET, (4+len+1+4+2+4+4) );
|
||||
data << uint32(status); // standard 0x0A, 0x06 if text present
|
||||
if(status == 6)
|
||||
{
|
||||
data << text; // ticket text
|
||||
data << uint8(0x7); // ticket category
|
||||
data << float(0); // time from ticket creation?
|
||||
data << float(0); // const
|
||||
data << float(0); // const
|
||||
data << uint8(0); // const
|
||||
data << uint8(0); // const
|
||||
}
|
||||
SendPacket( &data );
|
||||
}
|
||||
|
||||
void WorldSession::HandleGMTicketGetTicketOpcode( WorldPacket & /*recv_data*/ )
|
||||
{
|
||||
WorldPacket data( SMSG_QUERY_TIME_RESPONSE, 4+4 );
|
||||
data << (uint32)time(NULL);
|
||||
data << (uint32)0;
|
||||
SendPacket( &data );
|
||||
|
||||
GMTicket* ticket = ticketmgr.GetGMTicket(GetPlayer()->GetGUIDLow());
|
||||
if(ticket)
|
||||
SendGMTicketGetTicket(0x06,ticket->GetText());
|
||||
else
|
||||
SendGMTicketGetTicket(0x0A,0);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGMTicketUpdateTextOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,1);
|
||||
|
||||
std::string ticketText;
|
||||
recv_data >> ticketText;
|
||||
|
||||
CharacterDatabase.escape_string(ticketText);
|
||||
|
||||
if(GMTicket* ticket = ticketmgr.GetGMTicket(GetPlayer()->GetGUIDLow()))
|
||||
ticket->SetText(ticketText.c_str());
|
||||
else
|
||||
sLog.outError("Ticket update: Player %s (GUID: %u) doesn't have active ticket", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow());
|
||||
}
|
||||
|
||||
void WorldSession::HandleGMTicketDeleteOpcode( WorldPacket & /*recv_data*/ )
|
||||
{
|
||||
ticketmgr.Delete(GetPlayer()->GetGUIDLow());
|
||||
|
||||
WorldPacket data( SMSG_GMTICKET_DELETETICKET, 4 );
|
||||
data << uint32(9);
|
||||
SendPacket( &data );
|
||||
|
||||
SendGMTicketGetTicket(0x0A, 0);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 4*4+1+2*4);
|
||||
|
||||
uint32 map;
|
||||
float x, y, z;
|
||||
std::string ticketText = "";
|
||||
uint32 unk1, unk2;
|
||||
|
||||
recv_data >> map >> x >> y >> z; // last check 2.4.3
|
||||
recv_data >> ticketText;
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data,4*4+(ticketText.size()+1)+2*4);
|
||||
|
||||
recv_data >> unk1 >> unk2;
|
||||
// note: the packet might contain more data, but the exact structure of that is unknown
|
||||
|
||||
sLog.outDebug("TicketCreate: map %u, x %f, y %f, z %f, text %s, unk1 %u, unk2 %u", map, x, y, z, ticketText.c_str(), unk1, unk2);
|
||||
|
||||
CharacterDatabase.escape_string(ticketText);
|
||||
|
||||
if(GMTicket* ticket = ticketmgr.GetGMTicket(GetPlayer()->GetGUIDLow()))
|
||||
{
|
||||
WorldPacket data( SMSG_GMTICKET_CREATE, 4 );
|
||||
data << uint32(1);
|
||||
SendPacket( &data );
|
||||
return;
|
||||
}
|
||||
|
||||
ticketmgr.Create(_player->GetGUIDLow(), ticketText.c_str());
|
||||
|
||||
WorldPacket data( SMSG_QUERY_TIME_RESPONSE, 4+4 );
|
||||
data << (uint32)time(NULL);
|
||||
data << (uint32)0;
|
||||
SendPacket( &data );
|
||||
|
||||
data.Initialize( SMSG_GMTICKET_CREATE, 4 );
|
||||
data << uint32(2);
|
||||
SendPacket( &data );
|
||||
DEBUG_LOG("update the ticket\n");
|
||||
|
||||
//TODO: Guard player map
|
||||
HashMapHolder<Player>::MapType &m = ObjectAccessor::Instance().GetPlayers();
|
||||
for(HashMapHolder<Player>::MapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(itr->second->GetSession()->GetSecurity() >= SEC_GAMEMASTER && itr->second->isAcceptTickets())
|
||||
ChatHandler(itr->second).PSendSysMessage(LANG_COMMAND_TICKETNEW,GetPlayer()->GetName());
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::HandleGMTicketSystemStatusOpcode( WorldPacket & /*recv_data*/ )
|
||||
{
|
||||
WorldPacket data( SMSG_GMTICKET_SYSTEMSTATUS,4 );
|
||||
data << uint32(1); // we can also disable ticket system by sending 0 value
|
||||
|
||||
SendPacket( &data );
|
||||
}
|
||||
|
||||
void WorldSession::HandleGMSurveySubmit( WorldPacket & recv_data)
|
||||
{
|
||||
// GM survey is shown after SMSG_GM_TICKET_STATUS_UPDATE with status = 3
|
||||
CHECK_PACKET_SIZE(recv_data,4+4);
|
||||
uint32 x;
|
||||
recv_data >> x; // answer range? (6 = 0-5?)
|
||||
sLog.outDebug("SURVEY: X = %u", x);
|
||||
|
||||
uint8 result[10];
|
||||
memset(result, 0, sizeof(result));
|
||||
for( int i = 0; i < 10; ++i)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,recv_data.rpos()+4);
|
||||
uint32 questionID;
|
||||
recv_data >> questionID; // GMSurveyQuestions.dbc
|
||||
if (!questionID)
|
||||
break;
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data,recv_data.rpos()+1+1);
|
||||
uint8 value;
|
||||
std::string unk_text;
|
||||
recv_data >> value; // answer
|
||||
recv_data >> unk_text; // always empty?
|
||||
|
||||
result[i] = value;
|
||||
sLog.outDebug("SURVEY: ID %u, value %u, text %s", questionID, value, unk_text.c_str());
|
||||
}
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data,recv_data.rpos()+1);
|
||||
std::string comment;
|
||||
recv_data >> comment; // addional comment
|
||||
sLog.outDebug("SURVEY: comment %s", comment.c_str());
|
||||
|
||||
// TODO: chart this data in some way
|
||||
}
|
||||
/*
|
||||
* Copyright (C) 2005-2008 MaNGOS
|
||||
*
|
||||
* Copyright (C) 2008 Trinity
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "Language.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "Log.h"
|
||||
#include "GMTicketMgr.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
#include "Chat.h"
|
||||
|
||||
void WorldSession::SendGMTicketGetTicket(uint32 status, char const* text)
|
||||
{
|
||||
int len = text ? strlen(text) : 0;
|
||||
WorldPacket data( SMSG_GMTICKET_GETTICKET, (4+len+1+4+2+4+4) );
|
||||
data << uint32(status); // standard 0x0A, 0x06 if text present
|
||||
if(status == 6)
|
||||
{
|
||||
data << text; // ticket text
|
||||
data << uint8(0x7); // ticket category
|
||||
data << float(0); // time from ticket creation?
|
||||
data << float(0); // const
|
||||
data << float(0); // const
|
||||
data << uint8(0); // const
|
||||
data << uint8(0); // const
|
||||
}
|
||||
SendPacket( &data );
|
||||
}
|
||||
|
||||
void WorldSession::HandleGMTicketGetTicketOpcode( WorldPacket & /*recv_data*/ )
|
||||
{
|
||||
WorldPacket data( SMSG_QUERY_TIME_RESPONSE, 4+4 );
|
||||
data << (uint32)time(NULL);
|
||||
data << (uint32)0;
|
||||
SendPacket( &data );
|
||||
|
||||
GMTicket* ticket = ticketmgr.GetGMTicket(GetPlayer()->GetGUIDLow());
|
||||
if(ticket)
|
||||
SendGMTicketGetTicket(0x06,ticket->GetText());
|
||||
else
|
||||
SendGMTicketGetTicket(0x0A,0);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGMTicketUpdateTextOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,1);
|
||||
|
||||
std::string ticketText;
|
||||
recv_data >> ticketText;
|
||||
|
||||
CharacterDatabase.escape_string(ticketText);
|
||||
|
||||
if(GMTicket* ticket = ticketmgr.GetGMTicket(GetPlayer()->GetGUIDLow()))
|
||||
ticket->SetText(ticketText.c_str());
|
||||
else
|
||||
sLog.outError("Ticket update: Player %s (GUID: %u) doesn't have active ticket", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow());
|
||||
}
|
||||
|
||||
void WorldSession::HandleGMTicketDeleteOpcode( WorldPacket & /*recv_data*/ )
|
||||
{
|
||||
ticketmgr.Delete(GetPlayer()->GetGUIDLow());
|
||||
|
||||
WorldPacket data( SMSG_GMTICKET_DELETETICKET, 4 );
|
||||
data << uint32(9);
|
||||
SendPacket( &data );
|
||||
|
||||
SendGMTicketGetTicket(0x0A, 0);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data, 4*4+1+2*4);
|
||||
|
||||
uint32 map;
|
||||
float x, y, z;
|
||||
std::string ticketText = "";
|
||||
uint32 unk1, unk2;
|
||||
|
||||
recv_data >> map >> x >> y >> z; // last check 2.4.3
|
||||
recv_data >> ticketText;
|
||||
|
||||
// recheck
|
||||
CHECK_PACKET_SIZE(recv_data,4*4+(ticketText.size()+1)+2*4);
|
||||
|
||||
recv_data >> unk1 >> unk2;
|
||||
// note: the packet might contain more data, but the exact structure of that is unknown
|
||||
|
||||
sLog.outDebug("TicketCreate: map %u, x %f, y %f, z %f, text %s, unk1 %u, unk2 %u", map, x, y, z, ticketText.c_str(), unk1, unk2);
|
||||
|
||||
CharacterDatabase.escape_string(ticketText);
|
||||
|
||||
if(GMTicket* ticket = ticketmgr.GetGMTicket(GetPlayer()->GetGUIDLow()))
|
||||
{
|
||||
WorldPacket data( SMSG_GMTICKET_CREATE, 4 );
|
||||
data << uint32(1);
|
||||
SendPacket( &data );
|
||||
return;
|
||||
}
|
||||
|
||||
ticketmgr.Create(_player->GetGUIDLow(), ticketText.c_str());
|
||||
|
||||
WorldPacket data( SMSG_QUERY_TIME_RESPONSE, 4+4 );
|
||||
data << (uint32)time(NULL);
|
||||
data << (uint32)0;
|
||||
SendPacket( &data );
|
||||
|
||||
data.Initialize( SMSG_GMTICKET_CREATE, 4 );
|
||||
data << uint32(2);
|
||||
SendPacket( &data );
|
||||
DEBUG_LOG("update the ticket\n");
|
||||
|
||||
//TODO: Guard player map
|
||||
HashMapHolder<Player>::MapType &m = ObjectAccessor::Instance().GetPlayers();
|
||||
for(HashMapHolder<Player>::MapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(itr->second->GetSession()->GetSecurity() >= SEC_GAMEMASTER && itr->second->isAcceptTickets())
|
||||
ChatHandler(itr->second).PSendSysMessage(LANG_COMMAND_TICKETNEW,GetPlayer()->GetName());
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::HandleGMTicketSystemStatusOpcode( WorldPacket & /*recv_data*/ )
|
||||
{
|
||||
WorldPacket data( SMSG_GMTICKET_SYSTEMSTATUS,4 );
|
||||
data << uint32(1); // we can also disable ticket system by sending 0 value
|
||||
|
||||
SendPacket( &data );
|
||||
}
|
||||
|
||||
void WorldSession::HandleGMSurveySubmit( WorldPacket & recv_data)
|
||||
{
|
||||
// GM survey is shown after SMSG_GM_TICKET_STATUS_UPDATE with status = 3
|
||||
CHECK_PACKET_SIZE(recv_data,4+4);
|
||||
uint32 x;
|
||||
recv_data >> x; // answer range? (6 = 0-5?)
|
||||
sLog.outDebug("SURVEY: X = %u", x);
|
||||
|
||||
uint8 result[10];
|
||||
memset(result, 0, sizeof(result));
|
||||
for( int i = 0; i < 10; ++i)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recv_data,recv_data.rpos()+4);
|
||||
uint32 questionID;
|
||||
recv_data >> questionID; // GMSurveyQuestions.dbc
|
||||
if (!questionID)
|
||||
break;
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data,recv_data.rpos()+1+1);
|
||||
uint8 value;
|
||||
std::string unk_text;
|
||||
recv_data >> value; // answer
|
||||
recv_data >> unk_text; // always empty?
|
||||
|
||||
result[i] = value;
|
||||
sLog.outDebug("SURVEY: ID %u, value %u, text %s", questionID, value, unk_text.c_str());
|
||||
}
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data,recv_data.rpos()+1);
|
||||
std::string comment;
|
||||
recv_data >> comment; // addional comment
|
||||
sLog.outDebug("SURVEY: comment %s", comment.c_str());
|
||||
|
||||
// TODO: chart this data in some way
|
||||
}
|
||||
|
||||
+82
-82
@@ -1,82 +1,82 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2008 MaNGOS
|
||||
*
|
||||
* Copyright (C) 2008 Trinity
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "Database/DatabaseEnv.h"
|
||||
#include "Database/SQLStorage.h"
|
||||
#include "GMTicketMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ProgressBar.h"
|
||||
#include "Policies/SingletonImp.h"
|
||||
#include "Player.h"
|
||||
#include "ObjectDefines.h"
|
||||
|
||||
INSTANTIATE_SINGLETON_1(GMTicketMgr);
|
||||
|
||||
void GMTicketMgr::LoadGMTickets()
|
||||
{
|
||||
m_GMTicketMap.clear(); // For reload case
|
||||
|
||||
QueryResult *result = CharacterDatabase.Query(
|
||||
// 0 1 2
|
||||
"SELECT guid, ticket_text,UNIX_TIMESTAMP(ticket_lastchange) FROM character_ticket");
|
||||
|
||||
if( !result )
|
||||
{
|
||||
barGoLink bar( 1 );
|
||||
|
||||
bar.step();
|
||||
|
||||
sLog.outString();
|
||||
sLog.outErrorDb(">> Loaded `character_ticket`, table is empty!");
|
||||
return;
|
||||
}
|
||||
|
||||
barGoLink bar( result->GetRowCount() );
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
do
|
||||
{
|
||||
bar.step();
|
||||
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 guid = fields[0].GetUInt32();
|
||||
m_GMTicketMap[guid] = GMTicket(guid, fields[1].GetCppString(), time_t(fields[2].GetUInt64()));
|
||||
++count;
|
||||
|
||||
} while (result->NextRow());
|
||||
delete result;
|
||||
|
||||
sLog.outString();
|
||||
sLog.outString( ">> Loaded %d GM tickets", count );
|
||||
}
|
||||
|
||||
void GMTicketMgr::DeleteAll()
|
||||
{
|
||||
for(GMTicketMap::iterator itr = m_GMTicketMap.begin(); itr != m_GMTicketMap.end(); ++itr)
|
||||
{
|
||||
if(Player* owner = objmgr.GetPlayer(MAKE_NEW_GUID(itr->first,0,HIGHGUID_PLAYER)))
|
||||
owner->GetSession()->SendGMTicketGetTicket(0x0A,0);
|
||||
}
|
||||
CharacterDatabase.PExecute("DELETE FROM character_ticket");
|
||||
m_GMTicketMap.clear();
|
||||
}
|
||||
/*
|
||||
* Copyright (C) 2005-2008 MaNGOS
|
||||
*
|
||||
* Copyright (C) 2008 Trinity
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "Database/DatabaseEnv.h"
|
||||
#include "Database/SQLStorage.h"
|
||||
#include "GMTicketMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ProgressBar.h"
|
||||
#include "Policies/SingletonImp.h"
|
||||
#include "Player.h"
|
||||
#include "ObjectDefines.h"
|
||||
|
||||
INSTANTIATE_SINGLETON_1(GMTicketMgr);
|
||||
|
||||
void GMTicketMgr::LoadGMTickets()
|
||||
{
|
||||
m_GMTicketMap.clear(); // For reload case
|
||||
|
||||
QueryResult *result = CharacterDatabase.Query(
|
||||
// 0 1 2
|
||||
"SELECT guid, ticket_text,UNIX_TIMESTAMP(ticket_lastchange) FROM character_ticket");
|
||||
|
||||
if( !result )
|
||||
{
|
||||
barGoLink bar( 1 );
|
||||
|
||||
bar.step();
|
||||
|
||||
sLog.outString();
|
||||
sLog.outString(">> Loaded `character_ticket`, table is empty.");
|
||||
return;
|
||||
}
|
||||
|
||||
barGoLink bar( result->GetRowCount() );
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
do
|
||||
{
|
||||
bar.step();
|
||||
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 guid = fields[0].GetUInt32();
|
||||
m_GMTicketMap[guid] = GMTicket(guid, fields[1].GetCppString(), time_t(fields[2].GetUInt64()));
|
||||
++count;
|
||||
|
||||
} while (result->NextRow());
|
||||
delete result;
|
||||
|
||||
sLog.outString();
|
||||
sLog.outString( ">> Loaded %d GM tickets", count );
|
||||
}
|
||||
|
||||
void GMTicketMgr::DeleteAll()
|
||||
{
|
||||
for(GMTicketMap::iterator itr = m_GMTicketMap.begin(); itr != m_GMTicketMap.end(); ++itr)
|
||||
{
|
||||
if(Player* owner = objmgr.GetPlayer(MAKE_NEW_GUID(itr->first,0,HIGHGUID_PLAYER)))
|
||||
owner->GetSession()->SendGMTicketGetTicket(0x0A,0);
|
||||
}
|
||||
CharacterDatabase.PExecute("DELETE FROM character_ticket");
|
||||
m_GMTicketMap.clear();
|
||||
}
|
||||
|
||||
+117
-117
@@ -1,118 +1,118 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _GMTICKETMGR_H
|
||||
#define _GMTICKETMGR_H
|
||||
|
||||
#include "Policies/Singleton.h"
|
||||
#include "Database/DatabaseEnv.h"
|
||||
#include "Util.h"
|
||||
#include <map>
|
||||
|
||||
class GMTicket
|
||||
{
|
||||
public:
|
||||
explicit GMTicket()
|
||||
{
|
||||
}
|
||||
|
||||
GMTicket(uint32 guid, std::string text, time_t update) : m_guid(guid), m_text(text), m_lastUpdate(update)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
const char* GetText() const
|
||||
{
|
||||
return m_text.c_str();
|
||||
}
|
||||
|
||||
uint64 GetLastUpdate() const
|
||||
{
|
||||
return m_lastUpdate;
|
||||
}
|
||||
|
||||
void SetText(const char* text)
|
||||
{
|
||||
m_text = text ? text : "";
|
||||
m_lastUpdate = time(NULL);
|
||||
CharacterDatabase.PExecute("UPDATE character_ticket SET ticket_text = '%s' WHERE guid = '%u'", m_text.c_str(), m_guid);
|
||||
}
|
||||
|
||||
void DeleteFromDB() const
|
||||
{
|
||||
CharacterDatabase.PExecute("DELETE FROM character_ticket WHERE guid = '%u' LIMIT 1", m_guid);
|
||||
}
|
||||
|
||||
void SaveToDB() const
|
||||
{
|
||||
CharacterDatabase.BeginTransaction();
|
||||
DeleteFromDB();
|
||||
CharacterDatabase.PExecute("INSERT INTO character_ticket (guid, ticket_text) VALUES ('%u', '%s')", m_guid, GetText());
|
||||
CharacterDatabase.CommitTransaction();
|
||||
}
|
||||
private:
|
||||
uint32 m_guid;
|
||||
std::string m_text;
|
||||
time_t m_lastUpdate;
|
||||
};
|
||||
typedef std::map<uint32, GMTicket> GMTicketMap;
|
||||
|
||||
class GMTicketMgr
|
||||
{
|
||||
public:
|
||||
GMTicketMgr() { }
|
||||
~GMTicketMgr() { }
|
||||
|
||||
void LoadGMTickets();
|
||||
|
||||
GMTicket* GetGMTicket(uint32 guid)
|
||||
{
|
||||
GMTicketMap::iterator itr = m_GMTicketMap.find(guid);
|
||||
if(itr == m_GMTicketMap.end())
|
||||
return NULL;
|
||||
return &(itr->second);
|
||||
}
|
||||
|
||||
size_t GetTicketCount() const
|
||||
{
|
||||
return m_GMTicketMap.size();
|
||||
}
|
||||
|
||||
void Delete(uint32 guid)
|
||||
{
|
||||
GMTicketMap::iterator itr = m_GMTicketMap.find(guid);
|
||||
if(itr == m_GMTicketMap.end())
|
||||
return;
|
||||
itr->second.DeleteFromDB();
|
||||
m_GMTicketMap.erase(itr);
|
||||
}
|
||||
|
||||
void DeleteAll();
|
||||
|
||||
void Create(uint32 guid, const char* text)
|
||||
{
|
||||
GMTicket t = GMTicket(guid, text, time(NULL));
|
||||
t.SaveToDB();
|
||||
m_GMTicketMap[guid] = t;
|
||||
}
|
||||
private:
|
||||
GMTicketMap m_GMTicketMap;
|
||||
};
|
||||
|
||||
#define ticketmgr Trinity::Singleton<GMTicketMgr>::Instance()
|
||||
/*
|
||||
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _GMTICKETMGR_H
|
||||
#define _GMTICKETMGR_H
|
||||
|
||||
#include "Policies/Singleton.h"
|
||||
#include "Database/DatabaseEnv.h"
|
||||
#include "Util.h"
|
||||
#include <map>
|
||||
|
||||
class GMTicket
|
||||
{
|
||||
public:
|
||||
explicit GMTicket()
|
||||
{
|
||||
}
|
||||
|
||||
GMTicket(uint32 guid, std::string text, time_t update) : m_guid(guid), m_text(text), m_lastUpdate(update)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
const char* GetText() const
|
||||
{
|
||||
return m_text.c_str();
|
||||
}
|
||||
|
||||
uint64 GetLastUpdate() const
|
||||
{
|
||||
return m_lastUpdate;
|
||||
}
|
||||
|
||||
void SetText(const char* text)
|
||||
{
|
||||
m_text = text ? text : "";
|
||||
m_lastUpdate = time(NULL);
|
||||
CharacterDatabase.PExecute("UPDATE character_ticket SET ticket_text = '%s' WHERE guid = '%u'", m_text.c_str(), m_guid);
|
||||
}
|
||||
|
||||
void DeleteFromDB() const
|
||||
{
|
||||
CharacterDatabase.PExecute("DELETE FROM character_ticket WHERE guid = '%u' LIMIT 1", m_guid);
|
||||
}
|
||||
|
||||
void SaveToDB() const
|
||||
{
|
||||
CharacterDatabase.BeginTransaction();
|
||||
DeleteFromDB();
|
||||
CharacterDatabase.PExecute("INSERT INTO character_ticket (guid, ticket_text) VALUES ('%u', '%s')", m_guid, GetText());
|
||||
CharacterDatabase.CommitTransaction();
|
||||
}
|
||||
private:
|
||||
uint32 m_guid;
|
||||
std::string m_text;
|
||||
time_t m_lastUpdate;
|
||||
};
|
||||
typedef std::map<uint32, GMTicket> GMTicketMap;
|
||||
|
||||
class GMTicketMgr
|
||||
{
|
||||
public:
|
||||
GMTicketMgr() { }
|
||||
~GMTicketMgr() { }
|
||||
|
||||
void LoadGMTickets();
|
||||
|
||||
GMTicket* GetGMTicket(uint32 guid)
|
||||
{
|
||||
GMTicketMap::iterator itr = m_GMTicketMap.find(guid);
|
||||
if(itr == m_GMTicketMap.end())
|
||||
return NULL;
|
||||
return &(itr->second);
|
||||
}
|
||||
|
||||
size_t GetTicketCount() const
|
||||
{
|
||||
return m_GMTicketMap.size();
|
||||
}
|
||||
|
||||
void Delete(uint32 guid)
|
||||
{
|
||||
GMTicketMap::iterator itr = m_GMTicketMap.find(guid);
|
||||
if(itr == m_GMTicketMap.end())
|
||||
return;
|
||||
itr->second.DeleteFromDB();
|
||||
m_GMTicketMap.erase(itr);
|
||||
}
|
||||
|
||||
void DeleteAll();
|
||||
|
||||
void Create(uint32 guid, const char* text)
|
||||
{
|
||||
GMTicket t = GMTicket(guid, text, time(NULL));
|
||||
t.SaveToDB();
|
||||
m_GMTicketMap[guid] = t;
|
||||
}
|
||||
private:
|
||||
GMTicketMap m_GMTicketMap;
|
||||
};
|
||||
|
||||
#define ticketmgr Trinity::Singleton<GMTicketMgr>::Instance()
|
||||
#endif
|
||||
@@ -65,7 +65,7 @@ GameObject::~GameObject()
|
||||
{
|
||||
if(m_uint32Values) // field array can be not exist if GameOBject not loaded
|
||||
{
|
||||
// crash possable at access to deleted GO in Unit::m_gameobj
|
||||
// crash possible at access to deleted GO in Unit::m_gameobj
|
||||
uint64 owner_guid = GetOwnerGUID();
|
||||
if(owner_guid)
|
||||
{
|
||||
@@ -73,7 +73,7 @@ GameObject::~GameObject()
|
||||
if(owner)
|
||||
owner->RemoveGameObject(this,false);
|
||||
else if(!IS_PLAYER_GUID(owner_guid))
|
||||
sLog.outError("Delete GameObject (GUID: %u Entry: %u ) that have references in not found creature %u GO list. Crash possable later.",GetGUIDLow(),GetGOInfo()->id,GUID_LOPART(owner_guid));
|
||||
sLog.outError("Delete GameObject (GUID: %u Entry: %u ) that have references in not found creature %u GO list. Crash possible later.",GetGUIDLow(),GetGOInfo()->id,GUID_LOPART(owner_guid));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -209,7 +209,7 @@ void GameObject::Update(uint32 /*p_time*/)
|
||||
((Player*)caster)->SendMessageToSet(&data,true);
|
||||
}
|
||||
|
||||
m_lootState = GO_READY; // can be succesfully open with some chance
|
||||
m_lootState = GO_READY; // can be successfully open with some chance
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -286,7 +286,7 @@ void GameObject::Update(uint32 /*p_time*/)
|
||||
float radius = goInfo->trap.radius;
|
||||
if(!radius)
|
||||
{
|
||||
if(goInfo->trap.cooldown != 3) // cast in other case (at some triggring/linked go/etc explicit call)
|
||||
if(goInfo->trap.cooldown != 3) // cast in other case (at some triggering/linked go/etc explicit call)
|
||||
return;
|
||||
else
|
||||
{
|
||||
@@ -433,7 +433,7 @@ void GameObject::Update(uint32 /*p_time*/)
|
||||
m_respawnTime = time(NULL) + m_respawnDelayTime;
|
||||
|
||||
// if option not set then object will be saved at grid unload
|
||||
if(sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATLY))
|
||||
if(sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY))
|
||||
SaveRespawnTime();
|
||||
|
||||
ObjectAccessor::UpdateObjectVisibility(this);
|
||||
@@ -486,7 +486,7 @@ void GameObject::getFishLoot(Loot *fishloot)
|
||||
void GameObject::SaveToDB()
|
||||
{
|
||||
// this should only be used when the gameobject has already been loaded
|
||||
// perferably after adding to map, because mapid may not be valid otherwise
|
||||
// preferably after adding to map, because mapid may not be valid otherwise
|
||||
GameObjectData const *data = objmgr.GetGOData(m_DBTableGuid);
|
||||
if(!data)
|
||||
{
|
||||
@@ -1284,4 +1284,4 @@ void GameObject::CastSpell(Unit* target, uint32 spell)
|
||||
}
|
||||
//trigger->setDeathState(JUST_DIED);
|
||||
//trigger->RemoveCorpse();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1462,7 +1462,7 @@ InstanceGroupBind* Group::BindToInstance(InstanceSave *save, bool permanent, boo
|
||||
InstanceGroupBind& bind = m_boundInstances[save->GetDifficulty()][save->GetMapId()];
|
||||
if(bind.save)
|
||||
{
|
||||
// when a boss is killed or when copying the players's binds to the group
|
||||
// when a boss is killed or when copying the player's binds to the group
|
||||
if(permanent != bind.perm || save != bind.save)
|
||||
if(!load) CharacterDatabase.PExecute("UPDATE group_instance SET instance = '%u', permanent = '%u' WHERE leaderGuid = '%u' AND instance = '%u'", save->GetInstanceId(), permanent, GUID_LOPART(GetLeaderGUID()), bind.save->GetInstanceId());
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ void GuardAI::MoveInLineOfSight(Unit *u)
|
||||
|
||||
if( !i_creature.getVictim() && i_creature.canAttack(u) &&
|
||||
( u->IsHostileToPlayers() || i_creature.IsHostileTo(u) /*|| u->getVictim() && i_creature.IsFriendlyTo(u->getVictim())*/ ) &&
|
||||
u->isInAccessablePlaceFor(&i_creature))
|
||||
u->isInAccessiblePlaceFor(&i_creature))
|
||||
{
|
||||
float attackRadius = i_creature.GetAttackDistance(u);
|
||||
if(i_creature.IsWithinDistInMap(u,attackRadius))
|
||||
|
||||
+1
-1
@@ -1928,7 +1928,7 @@ uint8 Guild::CanStoreItem( uint8 tab, uint8 slot, GuildItemPosCountVec &dest, ui
|
||||
return EQUIP_ERR_OK;
|
||||
}
|
||||
|
||||
// not specific slot or have spece for partly store only in specific slot
|
||||
// not specific slot or have space for partly store only in specific slot
|
||||
|
||||
// search stack in tab for merge to
|
||||
if( pItem->GetMaxStackCount() > 1 )
|
||||
|
||||
@@ -331,6 +331,18 @@ class Guild
|
||||
{
|
||||
return (members.find(LowGuid) != members.end());
|
||||
}
|
||||
MemberSlot* GetMemberSlot(std::string const& name, uint64& guid)
|
||||
{
|
||||
for(MemberList::iterator itr = members.begin(); itr != members.end(); ++itr)
|
||||
{
|
||||
if(itr->second.name == name)
|
||||
{
|
||||
guid = itr->first;
|
||||
return &itr->second;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Roster(WorldSession *session);
|
||||
void Query(WorldSession *session);
|
||||
|
||||
+36
-65
@@ -173,26 +173,20 @@ void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
uint64 plGuid = objmgr.GetPlayerGUIDByName(plName);
|
||||
|
||||
if(!plGuid)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_FOUND);
|
||||
return;
|
||||
}
|
||||
|
||||
if(plGuid == guild->GetLeader())
|
||||
{
|
||||
SendGuildCommandResult(GUILD_QUIT_S, "", GUILD_LEADER_LEAVE);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!guild->IsMember(GUID_LOPART(plGuid)))
|
||||
uint64 plGuid;
|
||||
MemberSlot* slot = guild->GetMemberSlot(plName, plGuid);
|
||||
if(!slot)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_IN_GUILD_S);
|
||||
return;
|
||||
}
|
||||
|
||||
if(slot->RankId == GR_GUILDMASTER)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_QUIT_S, "", GUILD_LEADER_LEAVE);
|
||||
return;
|
||||
}
|
||||
|
||||
guild->DelMember(plGuid);
|
||||
// Put record into guildlog
|
||||
guild->LogGuildEvent(GUILD_EVENT_LOG_UNINVITE_PLAYER, GetPlayer()->GetGUIDLow(), GUID_LOPART(plGuid), 0);
|
||||
@@ -301,29 +295,25 @@ void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
uint64 plGuid = objmgr.GetPlayerGUIDByName(plName);
|
||||
|
||||
if(!plGuid)
|
||||
uint64 plGuid;
|
||||
MemberSlot* slot = guild->GetMemberSlot(plName, plGuid);
|
||||
|
||||
if(!slot)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_FOUND);
|
||||
SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_IN_GUILD_S);
|
||||
return;
|
||||
}
|
||||
else if(plGuid == GetPlayer()->GetGUID())
|
||||
|
||||
if(plGuid == GetPlayer()->GetGUID())
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, "", GUILD_NAME_INVALID);
|
||||
return;
|
||||
}
|
||||
|
||||
int32 plRankId = guild->GetRank(GUID_LOPART(plGuid));
|
||||
if(plRankId == -1)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_IN_GUILD_S);
|
||||
return;
|
||||
}
|
||||
if(plRankId < 2 || (plRankId-1) < GetPlayer()->GetRank())
|
||||
if(slot->RankId < 2 || (slot->RankId-1) < GetPlayer()->GetRank())
|
||||
return;
|
||||
|
||||
uint32 newRankId = plRankId < guild->GetNrRanks() ? plRankId-1 : guild->GetNrRanks()-1;
|
||||
uint32 newRankId = slot->RankId < guild->GetNrRanks() ? slot->RankId-1 : guild->GetNrRanks()-1;
|
||||
|
||||
guild->ChangeRank(plGuid, newRankId);
|
||||
// Put record into guildlog
|
||||
@@ -365,11 +355,12 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
uint64 plGuid = objmgr.GetPlayerGUIDByName(plName);
|
||||
uint64 plGuid;
|
||||
MemberSlot* slot = guild->GetMemberSlot(plName, plGuid);
|
||||
|
||||
if( !plGuid )
|
||||
if (!slot)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_FOUND);
|
||||
SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_IN_GUILD_S);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -379,26 +370,19 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
int32 plRankId = guild->GetRank(GUID_LOPART(plGuid));
|
||||
if(plRankId == -1)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_IN_GUILD_S);
|
||||
return;
|
||||
}
|
||||
|
||||
if((plRankId+1) >= guild->GetNrRanks() || plRankId <= this->GetPlayer()->GetRank())
|
||||
if((slot->RankId+1) >= guild->GetNrRanks() || slot->RankId <= GetPlayer()->GetRank())
|
||||
return;
|
||||
|
||||
guild->ChangeRank(plGuid, (plRankId+1));
|
||||
guild->ChangeRank(plGuid, (slot->RankId+1));
|
||||
// Put record into guildlog
|
||||
guild->LogGuildEvent(GUILD_EVENT_LOG_DEMOTE_PLAYER, GetPlayer()->GetGUIDLow(), GUID_LOPART(plGuid), (plRankId+1));
|
||||
guild->LogGuildEvent(GUILD_EVENT_LOG_DEMOTE_PLAYER, GetPlayer()->GetGUIDLow(), GUID_LOPART(plGuid), (slot->RankId+1));
|
||||
|
||||
WorldPacket data(SMSG_GUILD_EVENT, (2+30)); // guess size
|
||||
data << (uint8)GE_DEMOTION;
|
||||
data << (uint8)3;
|
||||
data << GetPlayer()->GetName();
|
||||
data << plName;
|
||||
data << guild->GetRankName(plRankId+1);
|
||||
data << guild->GetRankName(slot->RankId+1);
|
||||
guild->BroadcastPacket(&data);
|
||||
}
|
||||
|
||||
@@ -497,13 +481,10 @@ void WorldSession::HandleGuildLeaderOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
uint64 newLeaderGUID = objmgr.GetPlayerGUIDByName(name);
|
||||
if (!newLeaderGUID)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, name, GUILD_PLAYER_NOT_FOUND);
|
||||
return;
|
||||
}
|
||||
if(!guild->IsMember(GUID_LOPART(newLeaderGUID)))
|
||||
uint64 newLeaderGUID;
|
||||
MemberSlot* slot = guild->GetMemberSlot(name, newLeaderGUID);
|
||||
|
||||
if (!slot)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, name, GUILD_PLAYER_NOT_IN_GUILD_S);
|
||||
return;
|
||||
@@ -583,15 +564,10 @@ void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
uint64 plGuid = objmgr.GetPlayerGUIDByName(name);
|
||||
uint64 plGuid;
|
||||
MemberSlot* slot = guild->GetMemberSlot(name, plGuid);
|
||||
|
||||
if (!plGuid)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, name, GUILD_PLAYER_NOT_FOUND);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!guild->IsMember(GUID_LOPART(plGuid)))
|
||||
if (!slot)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, name, GUILD_PLAYER_NOT_IN_GUILD_S);
|
||||
return;
|
||||
@@ -628,15 +604,10 @@ void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
uint64 plGuid = objmgr.GetPlayerGUIDByName(plName);
|
||||
|
||||
if (!plGuid)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_FOUND);
|
||||
return;
|
||||
}
|
||||
uint64 plGuid;
|
||||
MemberSlot* slot = guild->GetMemberSlot(plName, plGuid);
|
||||
|
||||
if (!guild->IsMember(GUID_LOPART(plGuid)))
|
||||
if (!slot)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_IN_GUILD_S);
|
||||
return;
|
||||
|
||||
@@ -555,7 +555,7 @@ void WorldSession::HandleSellItemOpcode( WorldPacket & recv_data )
|
||||
}
|
||||
else
|
||||
{
|
||||
// prevent sell more items that exist in stack (possable only not from client)
|
||||
// prevent sell more items that exist in stack (possible only not from client)
|
||||
if(count > pItem->GetCount())
|
||||
{
|
||||
_player->SendSellError( SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0);
|
||||
@@ -1027,7 +1027,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
if(item==gift) // not possable with pacjket from real client
|
||||
if(item==gift) // not possible with pacjket from real client
|
||||
{
|
||||
_player->SendEquipError( EQUIP_ERR_WRAPPED_CANT_BE_WRAPPED, item, NULL );
|
||||
return;
|
||||
|
||||
@@ -78,7 +78,7 @@ enum ItemBondingType
|
||||
{
|
||||
NO_BIND = 0,
|
||||
BIND_WHEN_PICKED_UP = 1,
|
||||
BIND_WHEN_EQUIPED = 2,
|
||||
BIND_WHEN_EQUIPPED = 2,
|
||||
BIND_WHEN_USE = 3,
|
||||
BIND_QUEST_ITEM = 4,
|
||||
BIND_QUEST_ITEM1 = 5 // not used in game
|
||||
|
||||
@@ -112,7 +112,7 @@ static void AttemptAddMore(Player* _player)
|
||||
if(!group->Create(_player->GetGUID(), _player->GetName()))
|
||||
{
|
||||
delete group;
|
||||
return; // cann't create group (??)
|
||||
return; // can't create group (??)
|
||||
}
|
||||
|
||||
objmgr.AddGroup(group);
|
||||
@@ -254,7 +254,7 @@ void WorldSession::SendLfgResult(uint32 type, uint32 entry, uint8 lfg_type)
|
||||
{
|
||||
uint32 number = 0;
|
||||
|
||||
// start preper packet;
|
||||
// start prepare packet;
|
||||
WorldPacket data(MSG_LOOKING_FOR_GROUP);
|
||||
data << uint32(type); // type
|
||||
data << uint32(entry); // entry from LFGDungeons.dbc
|
||||
|
||||
@@ -52,7 +52,6 @@
|
||||
#include "BattleGroundMgr.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "InstanceData.h"
|
||||
#include "AccountMgr.h"
|
||||
|
||||
//reload commands
|
||||
bool ChatHandler::HandleReloadCommand(const char* arg)
|
||||
|
||||
@@ -534,7 +534,7 @@ void Loot::NotifyQuestItemRemoved(uint8 questIndex)
|
||||
// when a free for all questitem is looted
|
||||
// all players will get notified of it being removed
|
||||
// (other questitems can be looted by each group member)
|
||||
// bit inefficient but isnt called often
|
||||
// bit inefficient but isn't called often
|
||||
|
||||
std::set<uint64>::iterator i_next;
|
||||
for(std::set<uint64>::iterator i = PlayersLooting.begin(); i != PlayersLooting.end(); i = i_next)
|
||||
|
||||
+2
-2
@@ -375,7 +375,7 @@ void WorldSession::SendReturnToSender(uint8 messageType, uint32 sender_acc, uint
|
||||
return;
|
||||
}
|
||||
|
||||
// preper mail and send in other case
|
||||
// prepare mail and send in other case
|
||||
bool needItemDelay = false;
|
||||
|
||||
if(mi && !mi->empty())
|
||||
@@ -467,7 +467,7 @@ void WorldSession::HandleTakeItem(WorldPacket & recv_data )
|
||||
else if(!receive)
|
||||
sender_accId = objmgr.GetPlayerAccountIdByGUID(sender_guid);
|
||||
|
||||
// check player existanse
|
||||
// check player existence
|
||||
if(receive || sender_accId)
|
||||
{
|
||||
WorldSession::SendMailTo(receive, MAIL_NORMAL, MAIL_STATIONERY_NORMAL, m->receiver, m->sender, m->subject, 0, NULL, m->COD, 0, MAIL_CHECK_MASK_COD_PAYMENT);
|
||||
|
||||
+1
-1
@@ -677,7 +677,7 @@ Map::Remove(T *obj, bool remove)
|
||||
if( remove )
|
||||
{
|
||||
// if option set then object already saved at this moment
|
||||
if(!sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATLY))
|
||||
if(!sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY))
|
||||
obj->SaveRespawnTime();
|
||||
DeleteFromWorld(obj);
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
|
||||
data << uint8(0); // new 2.4.0
|
||||
data << uint32( pzoneid ); // player zone id
|
||||
|
||||
// 49 is maximum player count sent to client - can be overriden
|
||||
// 49 is maximum player count sent to client - can be overridden
|
||||
// through config, but is unstable
|
||||
if ((++clientcount) == sWorld.getConfig(CONFIG_MAX_WHO))
|
||||
break;
|
||||
@@ -1280,6 +1280,8 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
normalizePlayerName (charname);
|
||||
|
||||
Player *plr = objmgr.GetPlayer(charname.c_str());
|
||||
|
||||
if(!plr)
|
||||
|
||||
@@ -140,7 +140,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
|
||||
if(!mEntry->IsMountAllowed())
|
||||
_player->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
|
||||
|
||||
// battleground state preper
|
||||
// battleground state prepare
|
||||
// only add to bg group and object, if the player was invited (else he entered through command)
|
||||
if(_player->InBattleGround() && _player->IsInvitedForBattleGroundInstance(_player->GetBattleGroundId()))
|
||||
{
|
||||
|
||||
@@ -255,7 +255,7 @@ ObjectGridUnloader::Visit(GridRefManager<T> &m)
|
||||
{
|
||||
T *obj = m.getFirst()->getSource();
|
||||
// if option set then object already saved at this moment
|
||||
if(!sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATLY))
|
||||
if(!sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY))
|
||||
obj->SaveRespawnTime();
|
||||
///- object must be out of world before delete
|
||||
obj->RemoveFromWorld();
|
||||
@@ -276,7 +276,7 @@ ObjectGridUnloader::Visit(CreatureMapType &m)
|
||||
{
|
||||
Creature *obj = m.getFirst()->getSource();
|
||||
// if option set then object already saved at this moment
|
||||
if(!sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATLY))
|
||||
if(!sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY))
|
||||
obj->SaveRespawnTime();
|
||||
///- object will get delinked from the manager when deleted
|
||||
delete obj;
|
||||
|
||||
+21
-21
@@ -892,7 +892,7 @@ void ObjectMgr::ConvertCreatureAddonAuras(CreatureDataAddon* addon, char const*
|
||||
return;
|
||||
}
|
||||
|
||||
// replace by new strucutres array
|
||||
// replace by new structures array
|
||||
const_cast<CreatureDataAddonAura*&>(addon->auras) = new CreatureDataAddonAura[val.size()/2+1];
|
||||
|
||||
int i=0;
|
||||
@@ -3132,7 +3132,7 @@ void ObjectMgr::LoadQuests()
|
||||
{
|
||||
sLog.outErrorDb("Quest %u has `SrcItemId` = %u but `SrcItemCount` = 0, set to 1 but need fix in DB.",
|
||||
qinfo->GetQuestId(),qinfo->SrcItemId);
|
||||
qinfo->SrcItemCount = 1; // update to 1 for allow quest work for backward comptibility with DB
|
||||
qinfo->SrcItemCount = 1; // update to 1 for allow quest work for backward compatibility with DB
|
||||
}
|
||||
}
|
||||
else if(qinfo->SrcItemCount>0)
|
||||
@@ -3535,7 +3535,7 @@ void ObjectMgr::LoadQuests()
|
||||
|
||||
Quest const* quest = GetQuestTemplate(quest_id);
|
||||
|
||||
// some quest referenced in spells not exist (outdataed spells)
|
||||
// some quest referenced in spells not exist (outdated spells)
|
||||
if(!quest)
|
||||
continue;
|
||||
|
||||
@@ -3895,7 +3895,7 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename)
|
||||
// this will prevent quest completing without objective
|
||||
const_cast<Quest*>(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT);
|
||||
|
||||
// continue; - quest objective requiremet set and command can be allowed
|
||||
// continue; - quest objective requirement set and command can be allowed
|
||||
}
|
||||
|
||||
if(float(tmp.datalong2) > DEFAULT_VISIBILITY_DISTANCE)
|
||||
@@ -4069,7 +4069,7 @@ void ObjectMgr::LoadEventScripts()
|
||||
{
|
||||
std::set<uint32>::const_iterator itr2 = evt_scripts.find(itr->first);
|
||||
if (itr2 == evt_scripts.end())
|
||||
sLog.outErrorDb("Table `event_scripts` has script (Id: %u) not refering to any gameobject_template type 10 data2 field or type 3 data6 field or any spell effect %u", itr->first, SPELL_EFFECT_SEND_EVENT);
|
||||
sLog.outErrorDb("Table `event_scripts` has script (Id: %u) not referring to any gameobject_template type 10 data2 field or type 3 data6 field or any spell effect %u", itr->first, SPELL_EFFECT_SEND_EVENT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4236,7 +4236,7 @@ void ObjectMgr::LoadInstanceTemplate()
|
||||
}
|
||||
}
|
||||
|
||||
// the reset_delay must be atleast one day
|
||||
// the reset_delay must be at least one day
|
||||
temp->reset_delay = std::max((uint32)1, (uint32)(temp->reset_delay * sWorld.getRate(RATE_INSTANCE_RESET_TIME)));
|
||||
}
|
||||
|
||||
@@ -4537,7 +4537,7 @@ void ObjectMgr::LoadQuestAreaTriggers()
|
||||
// this will prevent quest completing without objective
|
||||
const_cast<Quest*>(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT);
|
||||
|
||||
// continue; - quest modified to required obkective and trigger can be allowed.
|
||||
// continue; - quest modified to required objective and trigger can be allowed.
|
||||
}
|
||||
|
||||
mQuestAreaTriggerMap[trigger_ID] = quest_ID;
|
||||
@@ -4834,7 +4834,7 @@ void ObjectMgr::LoadGraveyardZones()
|
||||
}
|
||||
|
||||
if(!AddGraveYardLink(safeLocId,zoneId,team,false))
|
||||
sLog.outErrorDb("Table `game_graveyard_zone` has a duplicate record for Garveyard (ID: %u) and Zone (ID: %u), skipped.",safeLocId,zoneId);
|
||||
sLog.outErrorDb("Table `game_graveyard_zone` has a duplicate record for Graveyard (ID: %u) and Zone (ID: %u), skipped.",safeLocId,zoneId);
|
||||
} while( result->NextRow() );
|
||||
|
||||
delete result;
|
||||
@@ -5235,7 +5235,7 @@ uint32 ObjectMgr::GenerateAuctionID()
|
||||
++m_auctionid;
|
||||
if(m_auctionid>=0xFFFFFFFF)
|
||||
{
|
||||
sLog.outError("Auctions ids overflow!! Can't continue, shuting down server. ");
|
||||
sLog.outError("Auctions ids overflow!! Can't continue, shutting down server. ");
|
||||
sWorld.m_stopEvent = true;
|
||||
}
|
||||
return m_auctionid;
|
||||
@@ -5246,7 +5246,7 @@ uint32 ObjectMgr::GenerateMailID()
|
||||
++m_mailid;
|
||||
if(m_mailid>=0xFFFFFFFF)
|
||||
{
|
||||
sLog.outError("Mail ids overflow!! Can't continue, shuting down server. ");
|
||||
sLog.outError("Mail ids overflow!! Can't continue, shutting down server. ");
|
||||
sWorld.m_stopEvent = true;
|
||||
}
|
||||
return m_mailid;
|
||||
@@ -5257,7 +5257,7 @@ uint32 ObjectMgr::GenerateItemTextID()
|
||||
++m_ItemTextId;
|
||||
if(m_ItemTextId>=0xFFFFFFFF)
|
||||
{
|
||||
sLog.outError("Item text ids overflow!! Can't continue, shuting down server. ");
|
||||
sLog.outError("Item text ids overflow!! Can't continue, shutting down server. ");
|
||||
sWorld.m_stopEvent = true;
|
||||
}
|
||||
return m_ItemTextId;
|
||||
@@ -5285,7 +5285,7 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh)
|
||||
++m_hiItemGuid;
|
||||
if(m_hiItemGuid>=0xFFFFFFFF)
|
||||
{
|
||||
sLog.outError("Item guid overflow!! Can't continue, shuting down server. ");
|
||||
sLog.outError("Item guid overflow!! Can't continue, shutting down server. ");
|
||||
sWorld.m_stopEvent = true;
|
||||
}
|
||||
return m_hiItemGuid;
|
||||
@@ -5293,7 +5293,7 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh)
|
||||
++m_hiCreatureGuid;
|
||||
if(m_hiCreatureGuid>=0x00FFFFFF)
|
||||
{
|
||||
sLog.outError("Creature guid overflow!! Can't continue, shuting down server. ");
|
||||
sLog.outError("Creature guid overflow!! Can't continue, shutting down server. ");
|
||||
sWorld.m_stopEvent = true;
|
||||
}
|
||||
return m_hiCreatureGuid;
|
||||
@@ -5301,7 +5301,7 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh)
|
||||
++m_hiPetGuid;
|
||||
if(m_hiPetGuid>=0x00FFFFFF)
|
||||
{
|
||||
sLog.outError("Pet guid overflow!! Can't continue, shuting down server. ");
|
||||
sLog.outError("Pet guid overflow!! Can't continue, shutting down server. ");
|
||||
sWorld.m_stopEvent = true;
|
||||
}
|
||||
return m_hiPetGuid;
|
||||
@@ -5309,7 +5309,7 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh)
|
||||
++m_hiCharGuid;
|
||||
if(m_hiCharGuid>=0xFFFFFFFF)
|
||||
{
|
||||
sLog.outError("Players guid overflow!! Can't continue, shuting down server. ");
|
||||
sLog.outError("Players guid overflow!! Can't continue, shutting down server. ");
|
||||
sWorld.m_stopEvent = true;
|
||||
}
|
||||
return m_hiCharGuid;
|
||||
@@ -5317,7 +5317,7 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh)
|
||||
++m_hiGoGuid;
|
||||
if(m_hiGoGuid>=0x00FFFFFF)
|
||||
{
|
||||
sLog.outError("Gameobject guid overflow!! Can't continue, shuting down server. ");
|
||||
sLog.outError("Gameobject guid overflow!! Can't continue, shutting down server. ");
|
||||
sWorld.m_stopEvent = true;
|
||||
}
|
||||
return m_hiGoGuid;
|
||||
@@ -5325,7 +5325,7 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh)
|
||||
++m_hiCorpseGuid;
|
||||
if(m_hiCorpseGuid>=0xFFFFFFFF)
|
||||
{
|
||||
sLog.outError("Corpse guid overflow!! Can't continue, shuting down server. ");
|
||||
sLog.outError("Corpse guid overflow!! Can't continue, shutting down server. ");
|
||||
sWorld.m_stopEvent = true;
|
||||
}
|
||||
return m_hiCorpseGuid;
|
||||
@@ -5333,7 +5333,7 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh)
|
||||
++m_hiDoGuid;
|
||||
if(m_hiDoGuid>=0xFFFFFFFF)
|
||||
{
|
||||
sLog.outError("DynamicObject guid overflow!! Can't continue, shuting down server. ");
|
||||
sLog.outError("DynamicObject guid overflow!! Can't continue, shutting down server. ");
|
||||
sWorld.m_stopEvent = true;
|
||||
}
|
||||
return m_hiDoGuid;
|
||||
@@ -6177,7 +6177,7 @@ bool isValidString(std::wstring wstr, uint32 strictMask, bool numericOrSpace, bo
|
||||
return true;
|
||||
}
|
||||
|
||||
if(strictMask & 0x1) // basic latin
|
||||
if(strictMask & 0x1) // basic Latin
|
||||
{
|
||||
if(isBasicLatinString(wstr,numericOrSpace))
|
||||
return true;
|
||||
@@ -6511,7 +6511,7 @@ void ObjectMgr::LoadSpellDisabledEntrys()
|
||||
|
||||
void ObjectMgr::LoadFishingBaseSkillLevel()
|
||||
{
|
||||
mFishingBaseForArea.clear(); // for relaod case
|
||||
mFishingBaseForArea.clear(); // for reload case
|
||||
|
||||
uint32 count = 0;
|
||||
QueryResult *result = WorldDatabase.Query("SELECT entry,skill FROM skill_fishing_base_level");
|
||||
@@ -6827,7 +6827,7 @@ SkillRangeType GetSkillRangeType(SkillLineEntry const *pSkill, bool racial)
|
||||
|
||||
void ObjectMgr::LoadGameTele()
|
||||
{
|
||||
m_GameTeleMap.clear(); // for relaod case
|
||||
m_GameTeleMap.clear(); // for reload case
|
||||
|
||||
uint32 count = 0;
|
||||
QueryResult *result = WorldDatabase.Query("SELECT id, position_x, position_y, position_z, orientation, map, name FROM game_tele");
|
||||
|
||||
@@ -321,7 +321,7 @@ bool OutdoorPvPObjective::DelCreature(uint32 type)
|
||||
}
|
||||
sLog.outDebug("deleting opvp creature type %u",type);
|
||||
uint32 guid = cr->GetDBTableGUIDLow();
|
||||
// dont save respawn time
|
||||
// Don't save respawn time
|
||||
cr->SetRespawnTime(0);
|
||||
cr->RemoveCorpse();
|
||||
cr->CleanupsBeforeDelete();
|
||||
@@ -379,7 +379,7 @@ bool OutdoorPvPObjective::DelCapturePoint()
|
||||
if(cr)
|
||||
{
|
||||
uint32 guid = cr->GetDBTableGUIDLow();
|
||||
// dont save respawn time
|
||||
// Don't save respawn time
|
||||
cr->SetRespawnTime(0);
|
||||
cr->RemoveCorpse();
|
||||
cr->CleanupsBeforeDelete();
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ void PetAI::MoveInLineOfSight(Unit *u)
|
||||
if( !i_pet.getVictim() && i_pet.GetCharmInfo() &&
|
||||
i_pet.GetCharmInfo()->HasReactState(REACT_AGGRESSIVE) &&
|
||||
i_pet.IsHostileTo( u ) && i_pet.canAttack(u) &&
|
||||
u->isInAccessablePlaceFor(&i_pet))
|
||||
u->isInAccessiblePlaceFor(&i_pet))
|
||||
{
|
||||
float attackRadius = i_pet.GetAttackDistance(u);
|
||||
if(i_pet.IsWithinDistInMap(u, attackRadius) && i_pet.GetDistanceZ(u) <= CREATURE_Z_ATTACK_RANGE)
|
||||
|
||||
+8
-8
@@ -797,7 +797,7 @@ void Player::StopMirrorTimer(MirrorTimerType Type)
|
||||
GetSession()->SendPacket( &data );
|
||||
}
|
||||
|
||||
void Player::EnvironmentalDamage(uint64 guid, EnviromentalDamage type, uint32 damage)
|
||||
void Player::EnvironmentalDamage(uint64 guid, EnvironmentalDamageType type, uint32 damage)
|
||||
{
|
||||
WorldPacket data(SMSG_ENVIRONMENTALDAMAGELOG, (21));
|
||||
data << (uint64)guid;
|
||||
@@ -1544,7 +1544,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
|
||||
if (isPossessedByPlayer())
|
||||
((Player*)GetCharmer())->RemovePossess();
|
||||
|
||||
// The player was ported to another map and looses the duel immediatly.
|
||||
// The player was ported to another map and looses the duel immediately.
|
||||
// We have to perform this check before the teleport, otherwise the
|
||||
// ObjectAccessor won't find the flag.
|
||||
if (duel && GetMapId()!=mapid)
|
||||
@@ -6690,7 +6690,7 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto,uint8 slot,bool apply)
|
||||
SetBaseWeaponDamage(attType, MAXDAMAGE, damage);
|
||||
}
|
||||
|
||||
if(!IsUseEquipedWeapon(slot==EQUIPMENT_SLOT_MAINHAND))
|
||||
if(!IsUseEquippedWeapon(slot==EQUIPMENT_SLOT_MAINHAND))
|
||||
return;
|
||||
|
||||
if (proto->Delay)
|
||||
@@ -8468,7 +8468,7 @@ Item* Player::GetWeaponForAttack(WeaponAttackType attackType, bool useable) cons
|
||||
if(!useable)
|
||||
return item;
|
||||
|
||||
if( item->IsBroken() || !IsUseEquipedWeapon(attackType==BASE_ATTACK) )
|
||||
if( item->IsBroken() || !IsUseEquippedWeapon(attackType==BASE_ATTACK) )
|
||||
return NULL;
|
||||
|
||||
return item;
|
||||
@@ -10138,7 +10138,7 @@ Item* Player::_StoreItem( uint16 pos, Item *pItem, uint32 count, bool clone, boo
|
||||
|
||||
if( pItem->GetProto()->Bonding == BIND_WHEN_PICKED_UP ||
|
||||
pItem->GetProto()->Bonding == BIND_QUEST_ITEM ||
|
||||
pItem->GetProto()->Bonding == BIND_WHEN_EQUIPED && IsBagPos(pos) )
|
||||
pItem->GetProto()->Bonding == BIND_WHEN_EQUIPPED && IsBagPos(pos) )
|
||||
pItem->SetBinding( true );
|
||||
|
||||
if( bag == INVENTORY_SLOT_BAG_0 )
|
||||
@@ -10184,7 +10184,7 @@ Item* Player::_StoreItem( uint16 pos, Item *pItem, uint32 count, bool clone, boo
|
||||
{
|
||||
if( pItem2->GetProto()->Bonding == BIND_WHEN_PICKED_UP ||
|
||||
pItem2->GetProto()->Bonding == BIND_QUEST_ITEM ||
|
||||
pItem2->GetProto()->Bonding == BIND_WHEN_EQUIPED && IsBagPos(pos) )
|
||||
pItem2->GetProto()->Bonding == BIND_WHEN_EQUIPPED && IsBagPos(pos) )
|
||||
pItem2->SetBinding( true );
|
||||
|
||||
pItem2->SetCount( pItem2->GetCount() + count );
|
||||
@@ -10369,7 +10369,7 @@ void Player::VisualizeItem( uint8 slot, Item *pItem)
|
||||
return;
|
||||
|
||||
// check also BIND_WHEN_PICKED_UP and BIND_QUEST_ITEM for .additem or .additemset case by GM (not binded at adding to inventory)
|
||||
if( pItem->GetProto()->Bonding == BIND_WHEN_EQUIPED || pItem->GetProto()->Bonding == BIND_WHEN_PICKED_UP || pItem->GetProto()->Bonding == BIND_QUEST_ITEM )
|
||||
if( pItem->GetProto()->Bonding == BIND_WHEN_EQUIPPED || pItem->GetProto()->Bonding == BIND_WHEN_PICKED_UP || pItem->GetProto()->Bonding == BIND_QUEST_ITEM )
|
||||
pItem->SetBinding( true );
|
||||
|
||||
sLog.outDebug( "STORAGE: EquipItem slot = %u, item = %u", slot, pItem->GetEntry());
|
||||
@@ -17331,7 +17331,7 @@ bool Player::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList) cons
|
||||
// GM invisibility checks early, invisibility if any detectable, so if not stealth then visible
|
||||
if(u->GetVisibility() == VISIBILITY_GROUP_STEALTH)
|
||||
{
|
||||
// if player is dead then he can't detect anyone in anycases
|
||||
// if player is dead then he can't detect anyone in any cases
|
||||
//do not know what is the use of this detect
|
||||
// stealth and detected and visible for some seconds
|
||||
if(!isAlive())
|
||||
|
||||
+4
-4
@@ -785,7 +785,7 @@ enum TeleportToOptions
|
||||
};
|
||||
|
||||
/// Type of environmental damages
|
||||
enum EnviromentalDamage
|
||||
enum EnvironmentalDamageType
|
||||
{
|
||||
DAMAGE_EXHAUSTED = 0,
|
||||
DAMAGE_DROWNING = 1,
|
||||
@@ -1123,7 +1123,7 @@ class TRINITY_DLL_SPEC Player : public Unit
|
||||
uint32 GetWeaponProficiency() const { return m_WeaponProficiency; }
|
||||
uint32 GetArmorProficiency() const { return m_ArmorProficiency; }
|
||||
bool IsInFeralForm() const { return m_form == FORM_CAT || m_form == FORM_BEAR || m_form == FORM_DIREBEAR; }
|
||||
bool IsUseEquipedWeapon( bool mainhand ) const
|
||||
bool IsUseEquippedWeapon( bool mainhand ) const
|
||||
{
|
||||
// disarm applied only to mainhand weapon
|
||||
return !IsInFeralForm() && (!mainhand || !HasFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISARMED) );
|
||||
@@ -1933,10 +1933,10 @@ class TRINITY_DLL_SPEC Player : public Unit
|
||||
void SetRestTime(uint32 v) { m_restTime = v;};
|
||||
|
||||
/*********************************************************/
|
||||
/*** ENVIROMENTAL SYSTEM ***/
|
||||
/*** ENVIRONMENTAL SYSTEM ***/
|
||||
/*********************************************************/
|
||||
|
||||
void EnvironmentalDamage(uint64 guid, EnviromentalDamage type, uint32 damage);
|
||||
void EnvironmentalDamage(uint64 guid, EnvironmentalDamageType type, uint32 damage);
|
||||
|
||||
/*********************************************************/
|
||||
/*** FLOOD FILTER SYSTEM ***/
|
||||
|
||||
@@ -199,7 +199,7 @@ enum ItemQualities
|
||||
// ***********************************
|
||||
|
||||
#define SPELL_ATTR_UNK0 0x00000001 // 0
|
||||
#define SPELL_ATTR_RANGED 0x00000002 // 1 All ranged abilites have this flag
|
||||
#define SPELL_ATTR_RANGED 0x00000002 // 1 All ranged abilities have this flag
|
||||
#define SPELL_ATTR_ON_NEXT_SWING_1 0x00000004 // 2 on next swing
|
||||
#define SPELL_ATTR_UNK3 0x00000008 // 3 not set in 2.4.2
|
||||
#define SPELL_ATTR_UNK4 0x00000010 // 4
|
||||
@@ -736,7 +736,7 @@ enum Mechanics
|
||||
(1<<MECHANIC_SHACKLE )|(1<<MECHANIC_TURN )|(1<<MECHANIC_HORROR)| \
|
||||
(1<<MECHANIC_DAZE )|(1<<MECHANIC_SAPPED ) )
|
||||
|
||||
// Spell dispell type
|
||||
// Spell dispel type
|
||||
enum DispelType
|
||||
{
|
||||
DISPEL_NONE = 0,
|
||||
|
||||
+2
-2
@@ -365,7 +365,7 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 origi
|
||||
|
||||
m_powerCost = 0; // setup to correct value in Spell::prepare, don't must be used before.
|
||||
m_casttime = 0; // setup to correct value in Spell::prepare, don't must be used before.
|
||||
m_timer = 0; // will set to castime in preper
|
||||
m_timer = 0; // will set to castime in prepare
|
||||
|
||||
m_needAliveTargetMask = 0;
|
||||
|
||||
@@ -1679,7 +1679,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
|
||||
if(Player* target = ((Player*)m_caster)->GetNextRandomRaidMember(radius))
|
||||
TagUnitMap.push_back(target);
|
||||
}break;
|
||||
// TARGET_SINGLE_PARTY means that the spells can only be casted on a party member and not on the caster (some sceals, fire shield from imp, etc..)
|
||||
// TARGET_SINGLE_PARTY means that the spells can only be casted on a party member and not on the caster (some seals, fire shield from imp, etc..)
|
||||
case TARGET_SINGLE_PARTY:
|
||||
{
|
||||
Unit *target = m_targets.getUnitTarget();
|
||||
|
||||
@@ -213,7 +213,7 @@ enum AuraType
|
||||
SPELL_AURA_MOD_SPEED_NOT_STACK = 171,
|
||||
SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK = 172,
|
||||
SPELL_AURA_ALLOW_CHAMPION_SPELLS = 173,
|
||||
SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT = 174, // by defeult intelect, dependent from SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT
|
||||
SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT = 174, // by default intellect, dependent from SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT
|
||||
SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT = 175,
|
||||
SPELL_AURA_SPIRIT_OF_REDEMPTION = 176,
|
||||
SPELL_AURA_AOE_CHARM = 177,
|
||||
|
||||
+29
-28
@@ -215,7 +215,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
|
||||
&Aura::HandleNULL, //157 SPELL_AURA_PET_DAMAGE_MULTI
|
||||
&Aura::HandleShieldBlockValue, //158 SPELL_AURA_MOD_SHIELD_BLOCKVALUE
|
||||
&Aura::HandleNoImmediateEffect, //159 SPELL_AURA_NO_PVP_CREDIT only for Honorless Target spell
|
||||
&Aura::HandleNoImmediateEffect, //160 SPELL_AURA_MOD_AOE_AVOIDANCE implemended in Unit::MagicSpellHitResult
|
||||
&Aura::HandleNoImmediateEffect, //160 SPELL_AURA_MOD_AOE_AVOIDANCE implemented in Unit::MagicSpellHitResult
|
||||
&Aura::HandleNoImmediateEffect, //161 SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT
|
||||
&Aura::HandleAuraPowerBurn, //162 SPELL_AURA_POWER_BURN_MANA
|
||||
&Aura::HandleNoImmediateEffect, //163 SPELL_AURA_MOD_CRIT_DAMAGE_BONUS_MELEE
|
||||
@@ -229,7 +229,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
|
||||
&Aura::HandleAuraModIncreaseSpeed, //171 SPELL_AURA_MOD_SPEED_NOT_STACK
|
||||
&Aura::HandleAuraModIncreaseMountedSpeed, //172 SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK
|
||||
&Aura::HandleUnused, //173 SPELL_AURA_ALLOW_CHAMPION_SPELLS only for Proclaim Champion spell
|
||||
&Aura::HandleModSpellDamagePercentFromStat, //174 SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT implemented in Unit::SpellBaseDamageBonus (by defeult intelect, dependent from SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT)
|
||||
&Aura::HandleModSpellDamagePercentFromStat, //174 SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT implemented in Unit::SpellBaseDamageBonus (by default intellect, dependent from SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT)
|
||||
&Aura::HandleModSpellHealingPercentFromStat, //175 SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT implemented in Unit::SpellBaseHealingBonus
|
||||
&Aura::HandleSpiritOfRedemption, //176 SPELL_AURA_SPIRIT_OF_REDEMPTION only for Spirit of Redemption spell, die at aura end
|
||||
&Aura::HandleNULL, //177 SPELL_AURA_AOE_CHARM
|
||||
@@ -242,7 +242,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
|
||||
&Aura::HandleNoImmediateEffect, //184 SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst
|
||||
&Aura::HandleNoImmediateEffect, //185 SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst
|
||||
&Aura::HandleNoImmediateEffect, //186 SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE implemented in Unit::MagicSpellHitResult
|
||||
&Aura::HandleNoImmediateEffect, //187 SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE implemended in Unit::GetUnitCriticalChance
|
||||
&Aura::HandleNoImmediateEffect, //187 SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE implemented in Unit::GetUnitCriticalChance
|
||||
&Aura::HandleNoImmediateEffect, //188 SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_CHANCE implemented in Unit::GetUnitCriticalChance
|
||||
&Aura::HandleModRating, //189 SPELL_AURA_MOD_RATING
|
||||
&Aura::HandleNULL, //190 SPELL_AURA_MOD_FACTION_REPUTATION_GAIN
|
||||
@@ -1054,7 +1054,7 @@ void Aura::_RemoveAura()
|
||||
((Player*)caster)->SendCooldownEvent(GetSpellProto());
|
||||
}
|
||||
}
|
||||
else if(sameaura) // decrease count for spell, only for same aura effect, or this spell auras in remove proccess.
|
||||
else if(sameaura) // decrease count for spell, only for same aura effect, or this spell auras in remove process.
|
||||
UpdateSlotCounterAndDuration(false);
|
||||
}
|
||||
|
||||
@@ -1204,12 +1204,12 @@ void Aura::TriggerSpell()
|
||||
|
||||
uint64 originalCasterGUID = GetCasterGUID();
|
||||
|
||||
SpellEntry const *triggredSpellInfo = sSpellStore.LookupEntry(trigger_spell_id);
|
||||
SpellEntry const *triggeredSpellInfo = sSpellStore.LookupEntry(trigger_spell_id);
|
||||
SpellEntry const *auraSpellInfo = GetSpellProto();
|
||||
uint32 auraId = auraSpellInfo->Id;
|
||||
|
||||
// specific code for cases with no trigger spell provided in field
|
||||
if (triggredSpellInfo == NULL)
|
||||
if (triggeredSpellInfo == NULL)
|
||||
{
|
||||
switch(auraSpellInfo->SpellFamilyName)
|
||||
{
|
||||
@@ -1217,7 +1217,7 @@ void Aura::TriggerSpell()
|
||||
{
|
||||
switch(auraId)
|
||||
{
|
||||
// Firestone Passive (1-5 rangs)
|
||||
// Firestone Passive (1-5 ranks)
|
||||
case 758:
|
||||
case 17945:
|
||||
case 17947:
|
||||
@@ -1251,7 +1251,7 @@ void Aura::TriggerSpell()
|
||||
// case 812: break;
|
||||
// // Polymorphic Ray
|
||||
// case 6965: break;
|
||||
// // Fire Nova (1-7 Rangs)
|
||||
// // Fire Nova (1-7 ranks)
|
||||
// case 8350:
|
||||
// case 8508:
|
||||
// case 8509:
|
||||
@@ -1823,8 +1823,8 @@ void Aura::TriggerSpell()
|
||||
break;
|
||||
}
|
||||
// Reget trigger spell proto
|
||||
triggredSpellInfo = sSpellStore.LookupEntry(trigger_spell_id);
|
||||
if(triggredSpellInfo == NULL)
|
||||
triggeredSpellInfo = sSpellStore.LookupEntry(trigger_spell_id);
|
||||
if(triggeredSpellInfo == NULL)
|
||||
{
|
||||
sLog.outError("Aura::TriggerSpell: Spell %u have 0 in EffectTriggered[%d], not handled custom case?",GetId(),GetEffIndex());
|
||||
return;
|
||||
@@ -1832,7 +1832,7 @@ void Aura::TriggerSpell()
|
||||
}
|
||||
else
|
||||
{
|
||||
// Spell exist but require costum code
|
||||
// Spell exist but require custom code
|
||||
switch(auraId)
|
||||
{
|
||||
// Curse of Idiocy
|
||||
@@ -1842,14 +1842,14 @@ void Aura::TriggerSpell()
|
||||
// BUT:
|
||||
// 1) target show casting at each triggered cast: target don't must show casting animation for any triggered spell
|
||||
// but must show affect apply like item casting
|
||||
// 2) maybe aura must be replace by new with accumulative stat mods insteed stacking
|
||||
// 2) maybe aura must be replace by new with accumulative stat mods instead stacking
|
||||
|
||||
// prevent cast by triggered auras
|
||||
if(m_caster_guid == m_target->GetGUID())
|
||||
return;
|
||||
|
||||
// stop triggering after each affected stats lost > 90
|
||||
int32 intelectLoss = 0;
|
||||
int32 intellectLoss = 0;
|
||||
int32 spiritLoss = 0;
|
||||
|
||||
Unit::AuraList const& mModStat = m_target->GetAurasByType(SPELL_AURA_MOD_STAT);
|
||||
@@ -1859,14 +1859,14 @@ void Aura::TriggerSpell()
|
||||
{
|
||||
switch((*i)->GetModifier()->m_miscvalue)
|
||||
{
|
||||
case STAT_INTELLECT: intelectLoss += (*i)->GetModifier()->m_amount; break;
|
||||
case STAT_INTELLECT: intellectLoss += (*i)->GetModifier()->m_amount; break;
|
||||
case STAT_SPIRIT: spiritLoss += (*i)->GetModifier()->m_amount; break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(intelectLoss <= -90 && spiritLoss <= -90)
|
||||
if(intellectLoss <= -90 && spiritLoss <= -90)
|
||||
return;
|
||||
|
||||
caster = target;
|
||||
@@ -1881,9 +1881,9 @@ void Aura::TriggerSpell()
|
||||
}
|
||||
}
|
||||
}
|
||||
m_target->CastSpell(target, triggredSpellInfo, true, 0, this, originalCasterGUID);
|
||||
m_target->CastSpell(target, triggeredSpellInfo, true, 0, this, originalCasterGUID);
|
||||
/*// All ok cast by default case
|
||||
Spell *spell = new Spell(m_target, triggredSpellInfo, true, originalCasterGUID );
|
||||
Spell *spell = new Spell(m_target, triggeredSpellInfo, true, originalCasterGUID );
|
||||
|
||||
SpellCastTargets targets;
|
||||
targets.setUnitTarget( target );
|
||||
@@ -2008,7 +2008,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
|
||||
// Dark Fiend
|
||||
if(GetId()==45934)
|
||||
{
|
||||
// Kill target if dispeled
|
||||
// Kill target if dispelled
|
||||
if (m_removeMode==AURA_REMOVE_BY_DISPEL)
|
||||
m_target->DealDamage(m_target, m_target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
return;
|
||||
@@ -2565,7 +2565,8 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
|
||||
}
|
||||
else
|
||||
{
|
||||
m_target->SetDisplayId(m_target->GetNativeDisplayId());
|
||||
if(modelid > 0)
|
||||
m_target->SetDisplayId(m_target->GetNativeDisplayId());
|
||||
m_target->SetByteValue(UNIT_FIELD_BYTES_2, 3, FORM_NONE);
|
||||
if(m_target->getClass() == CLASS_DRUID)
|
||||
m_target->setPowerType(POWER_MANA);
|
||||
@@ -2716,7 +2717,7 @@ void Aura::HandleAuraTransform(bool apply, bool Real)
|
||||
Aura* handledAura = *otherTransforms.begin();
|
||||
for(Unit::AuraList::const_iterator i = otherTransforms.begin();i != otherTransforms.end(); ++i)
|
||||
{
|
||||
// negative auras are prefered
|
||||
// negative auras are preferred
|
||||
if(!IsPositiveSpell((*i)->GetSpellProto()->Id))
|
||||
{
|
||||
handledAura = *i;
|
||||
@@ -3116,7 +3117,7 @@ void Aura::HandleAuraModDisarm(bool apply, bool Real)
|
||||
if (m_target->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
// main-hand attack speed already set to special value for feral form already and don't must chnage and reset at remove.
|
||||
// main-hand attack speed already set to special value for feral form already and don't must change and reset at remove.
|
||||
if (((Player *)m_target)->IsInFeralForm())
|
||||
return;
|
||||
|
||||
@@ -3438,7 +3439,7 @@ void Aura::HandleAuraModSilence(bool apply, bool Real)
|
||||
if (currentSpell && currentSpell->m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE)
|
||||
{
|
||||
uint32 state = currentSpell->getState();
|
||||
// Stop spells on prepere or casting state
|
||||
// Stop spells on prepare or casting state
|
||||
if ( state == SPELL_STATE_PREPARING || state == SPELL_STATE_CASTING )
|
||||
{
|
||||
currentSpell->cancel();
|
||||
@@ -4011,7 +4012,7 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real)
|
||||
int32 mws = caster->GetAttackTime(BASE_ATTACK);
|
||||
float mwb_min = caster->GetWeaponDamageRange(BASE_ATTACK,MINDAMAGE);
|
||||
float mwb_max = caster->GetWeaponDamageRange(BASE_ATTACK,MAXDAMAGE);
|
||||
// WARNING! in 3.0 multipler 0.00743f change to 0.6
|
||||
// WARNING! in 3.0 multiplier 0.00743f change to 0.6
|
||||
m_modifier.m_amount+=int32(((mwb_min+mwb_max)/2+ap*mws/14000)*0.00743f);
|
||||
}
|
||||
return;
|
||||
@@ -4039,7 +4040,7 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real)
|
||||
// Rip
|
||||
if (m_spellProto->SpellFamilyFlags & 0x000000000000800000LL)
|
||||
{
|
||||
// $AP * min(0.06*$cp, 0.24)/6 [Yes, there is no difference, wheather 4 or 5 CPs are being used]
|
||||
// $AP * min(0.06*$cp, 0.24)/6 [Yes, there is no difference, whether 4 or 5 CPs are being used]
|
||||
if (apply && !loading && caster && caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
uint8 cp = ((Player*)caster)->GetComboPoints();
|
||||
@@ -4092,7 +4093,7 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real)
|
||||
// Rupture
|
||||
if (m_spellProto->SpellFamilyFlags & 0x000000000000100000LL)
|
||||
{
|
||||
// Dmg/tick = $AP*min(0.01*$cp, 0.03) [Like Rip: only the first three CP inrease the contribution from AP]
|
||||
// Dmg/tick = $AP*min(0.01*$cp, 0.03) [Like Rip: only the first three CP increase the contribution from AP]
|
||||
if (apply && !loading && caster && caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
uint8 cp = ((Player*)caster)->GetComboPoints();
|
||||
@@ -4422,9 +4423,9 @@ void Aura::HandleAuraModResistenceOfStatPercent(bool apply, bool Real)
|
||||
|
||||
if(m_modifier.m_miscvalue != SPELL_SCHOOL_MASK_NORMAL)
|
||||
{
|
||||
// support required adding replace UpdateArmor by loop by UpdateResistence at intelect update
|
||||
// support required adding replace UpdateArmor by loop by UpdateResistence at intellect update
|
||||
// and include in UpdateResistence same code as in UpdateArmor for aura mod apply.
|
||||
sLog.outError("Aura SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT(182) need adding support for non-armor resistences!");
|
||||
sLog.outError("Aura SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT(182) need adding support for non-armor resistances!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4887,7 +4888,7 @@ void Aura::HandleAuraModRangedAttackPowerOfStatPercent(bool apply, bool Real)
|
||||
if(m_modifier.m_miscvalue != STAT_INTELLECT)
|
||||
{
|
||||
// support required adding UpdateAttackPowerAndDamage calls at stat update
|
||||
sLog.outError("Aura SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT (212) need support non-intelect stats!");
|
||||
sLog.outError("Aura SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT (212) need support non-intellect stats!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+16
-16
@@ -809,7 +809,7 @@ void Spell::EffectDummy(uint32 i)
|
||||
}
|
||||
case 13567: // Dummy Trigger
|
||||
{
|
||||
// can be used for different aura triggreing, so select by aura
|
||||
// can be used for different aura triggering, so select by aura
|
||||
if(!m_triggeredByAuraSpell || !unitTarget)
|
||||
return;
|
||||
|
||||
@@ -1352,7 +1352,7 @@ void Spell::EffectDummy(uint32 i)
|
||||
case 19266: spellid = 19254; break; // Rank 6
|
||||
case 25461: spellid = 25460; break; // Rank 7
|
||||
default:
|
||||
sLog.outError("Spell::EffectDummy: Spell 28598 triggered by unhandeled spell %u",m_triggeredByAuraSpell->Id);
|
||||
sLog.outError("Spell::EffectDummy: Spell 28598 triggered by unhandled spell %u",m_triggeredByAuraSpell->Id);
|
||||
return;
|
||||
}
|
||||
m_caster->CastSpell(unitTarget, spellid, true, NULL);
|
||||
@@ -2665,31 +2665,31 @@ void Spell::EffectEnergize(uint32 i)
|
||||
return;
|
||||
|
||||
// Some level depends spells
|
||||
int multipler = 0;
|
||||
int multiplier = 0;
|
||||
int level_diff = 0;
|
||||
switch (m_spellInfo->Id)
|
||||
{
|
||||
// Restore Energy
|
||||
case 9512:
|
||||
level_diff = m_caster->getLevel() - 40;
|
||||
multipler = 2;
|
||||
multiplier = 2;
|
||||
break;
|
||||
// Blood Fury
|
||||
case 24571:
|
||||
level_diff = m_caster->getLevel() - 60;
|
||||
multipler = 10;
|
||||
multiplier = 10;
|
||||
break;
|
||||
// Burst of Energy
|
||||
case 24532:
|
||||
level_diff = m_caster->getLevel() - 60;
|
||||
multipler = 4;
|
||||
multiplier = 4;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (level_diff > 0)
|
||||
damage -= multipler * level_diff;
|
||||
damage -= multiplier * level_diff;
|
||||
|
||||
if(damage < 0)
|
||||
return;
|
||||
@@ -3292,7 +3292,7 @@ void Spell::EffectDispel(uint32 i)
|
||||
if(!unitTarget)
|
||||
return;
|
||||
|
||||
// Fill possible dispell list
|
||||
// Fill possible dispel list
|
||||
std::vector <Aura *> dispel_list;
|
||||
|
||||
// Create dispel mask by dispel type
|
||||
@@ -3327,7 +3327,7 @@ void Spell::EffectDispel(uint32 i)
|
||||
std::list < std::pair<uint32,uint64> > success_list;// (spell_id,casterGuid)
|
||||
std::list < uint32 > fail_list; // spell_id
|
||||
int32 list_size = dispel_list.size();
|
||||
// Dispell N = damage buffs (or while exist buffs for dispel)
|
||||
// dispel N = damage buffs (or while exist buffs for dispel)
|
||||
for (int32 count=0; count < damage && list_size > 0; ++count)
|
||||
{
|
||||
// Random select buff for dispel
|
||||
@@ -3351,8 +3351,8 @@ void Spell::EffectDispel(uint32 i)
|
||||
// Remove buff from list for prevent doubles
|
||||
for (std::vector<Aura *>::iterator j = dispel_list.begin(); j != dispel_list.end(); )
|
||||
{
|
||||
Aura *dispeled = *j;
|
||||
if (dispeled->GetId() == aur->GetId() && dispeled->GetCasterGUID() == aur->GetCasterGUID())
|
||||
Aura *dispelled = *j;
|
||||
if (dispelled->GetId() == aur->GetId() && dispelled->GetCasterGUID() == aur->GetCasterGUID())
|
||||
{
|
||||
j = dispel_list.erase(j);
|
||||
--list_size;
|
||||
@@ -3368,14 +3368,14 @@ void Spell::EffectDispel(uint32 i)
|
||||
WorldPacket data(SMSG_SPELLDISPELLOG, 8+8+4+1+4+count*5);
|
||||
data.append(unitTarget->GetPackGUID()); // Victim GUID
|
||||
data.append(m_caster->GetPackGUID()); // Caster GUID
|
||||
data << uint32(m_spellInfo->Id); // Dispell spell id
|
||||
data << uint32(m_spellInfo->Id); // dispel spell id
|
||||
data << uint8(0); // not used
|
||||
data << uint32(count); // count
|
||||
for (std::list<std::pair<uint32,uint64> >::iterator j = success_list.begin(); j != success_list.end(); ++j)
|
||||
{
|
||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(j->first);
|
||||
data << uint32(spellInfo->Id); // Spell Id
|
||||
data << uint8(0); // 0 - dispeled !=0 cleansed
|
||||
data << uint8(0); // 0 - dispelled !=0 cleansed
|
||||
unitTarget->RemoveAurasDueToSpellByDispel(spellInfo->Id, j->second, m_caster);
|
||||
}
|
||||
m_caster->SendMessageToSet(&data, true);
|
||||
@@ -3408,7 +3408,7 @@ void Spell::EffectDispel(uint32 i)
|
||||
WorldPacket data(SMSG_DISPEL_FAILED, 8+8+4+4*fail_list.size());
|
||||
data << uint64(m_caster->GetGUID()); // Caster GUID
|
||||
data << uint64(unitTarget->GetGUID()); // Victim GUID
|
||||
data << uint32(m_spellInfo->Id); // Dispell spell id
|
||||
data << uint32(m_spellInfo->Id); // dispel spell id
|
||||
for (std::list< uint32 >::iterator j = fail_list.begin(); j != fail_list.end(); ++j)
|
||||
data << uint32(*j); // Spell Id
|
||||
m_caster->SendMessageToSet(&data, true);
|
||||
@@ -6224,7 +6224,7 @@ void Spell::EffectStealBeneficialBuff(uint32 i)
|
||||
{
|
||||
std::list < std::pair<uint32,uint64> > success_list;
|
||||
int32 list_size = steal_list.size();
|
||||
// Dispell N = damage buffs (or while exist buffs for dispel)
|
||||
// dispel N = damage buffs (or while exist buffs for dispel)
|
||||
for (int32 count=0; count < damage && list_size > 0; ++count)
|
||||
{
|
||||
// Random select buff for dispel
|
||||
@@ -6253,7 +6253,7 @@ void Spell::EffectStealBeneficialBuff(uint32 i)
|
||||
WorldPacket data(SMSG_SPELLSTEALLOG, 8+8+4+1+4+count*5);
|
||||
data.append(unitTarget->GetPackGUID()); // Victim GUID
|
||||
data.append(m_caster->GetPackGUID()); // Caster GUID
|
||||
data << uint32(m_spellInfo->Id); // Dispell spell id
|
||||
data << uint32(m_spellInfo->Id); // dispel spell id
|
||||
data << uint8(0); // not used
|
||||
data << uint32(count); // count
|
||||
for (std::list<std::pair<uint32,uint64> >::iterator j = success_list.begin(); j != success_list.end(); ++j)
|
||||
|
||||
@@ -485,7 +485,7 @@ bool IsPositiveSpell(uint32 spellId)
|
||||
SpellEntry const *spellproto = sSpellStore.LookupEntry(spellId);
|
||||
if (!spellproto) return false;
|
||||
|
||||
// spells with atleast one negative effect are considered negative
|
||||
// spells with at least one negative effect are considered negative
|
||||
// some self-applied spells have negative effects but in self casting case negative check ignored.
|
||||
for (int i = 0; i < 3; i++)
|
||||
if (!IsPositiveEffect(spellId, i))
|
||||
|
||||
+1
-1
@@ -428,7 +428,7 @@ inline Mechanics GetEffectMechanic(SpellEntry const* spellInfo, int32 effect)
|
||||
|
||||
inline uint32 GetDispellMask(DispelType dispel)
|
||||
{
|
||||
// If dispell all
|
||||
// If dispel all
|
||||
if (dispel == DISPEL_ALL)
|
||||
return DISPEL_ALL_MASK;
|
||||
else
|
||||
|
||||
@@ -68,7 +68,7 @@ bool Player::UpdateStats(Stats stat)
|
||||
case STAT_INTELLECT:
|
||||
UpdateMaxPower(POWER_MANA);
|
||||
UpdateAllSpellCritChances();
|
||||
UpdateAttackPowerAndDamage(true); //SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT, only intelect currently
|
||||
UpdateAttackPowerAndDamage(true); //SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT, only intellect currently
|
||||
UpdateArmor(); //SPELL_AURA_MOD_RESISTANCE_OF_INTELLECT_PERCENT, only armor currently
|
||||
break;
|
||||
|
||||
@@ -384,7 +384,7 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, fl
|
||||
weapon_mindamage = lvl*0.85*att_speed;
|
||||
weapon_maxdamage = lvl*1.25*att_speed;
|
||||
}
|
||||
else if(!IsUseEquipedWeapon(attType==BASE_ATTACK)) //check if player not in form but still can't use weapon (broken/etc)
|
||||
else if(!IsUseEquippedWeapon(attType==BASE_ATTACK)) //check if player not in form but still can't use weapon (broken/etc)
|
||||
{
|
||||
weapon_mindamage = BASE_MINDAMAGE;
|
||||
weapon_maxdamage = BASE_MAXDAMAGE;
|
||||
|
||||
@@ -201,7 +201,7 @@ void WorldSession::HandleTaxiNextDestinationOpcode(WorldPacket& /*recv_data*/)
|
||||
// in taxi flight packet received in 2 case:
|
||||
// 1) end taxi path in far (multi-node) flight
|
||||
// 2) switch from one map to other in case multim-map taxi path
|
||||
// we need proccess only (1)
|
||||
// we need process only (1)
|
||||
uint32 curDest = GetPlayer()->m_taxi.GetTaxiDestination();
|
||||
if(!curDest)
|
||||
return;
|
||||
|
||||
@@ -132,11 +132,11 @@ void HostilReference::updateOnlineStatus()
|
||||
!getTarget()->hasUnitState(UNIT_STAT_IN_FLIGHT)))
|
||||
{
|
||||
Creature* creature = (Creature* ) getSourceUnit();
|
||||
online = getTarget()->isInAccessablePlaceFor(creature);
|
||||
online = getTarget()->isInAccessiblePlaceFor(creature);
|
||||
if(!online)
|
||||
{
|
||||
if(creature->AI()->canReachByRangeAttack(getTarget()))
|
||||
online = true; // not accessable but stays online
|
||||
online = true; // not accessible but stays online
|
||||
}
|
||||
else
|
||||
accessible = true;
|
||||
@@ -155,7 +155,7 @@ void HostilReference::setOnlineOfflineState(bool pIsOnline)
|
||||
{
|
||||
iOnline = pIsOnline;
|
||||
if(!iOnline)
|
||||
setAccessibleState(false); // if not online that not accessable as well
|
||||
setAccessibleState(false); // if not online that not accessible as well
|
||||
fireStatusChanged(ThreatRefStatusChangeEvent(UEV_THREAT_REF_ONLINE_STATUS, this));
|
||||
}
|
||||
}
|
||||
@@ -278,7 +278,7 @@ HostilReference* ThreatContainer::selectNextVictim(Creature* pAttacker, HostilRe
|
||||
Unit* target = currentRef->getTarget();
|
||||
assert(target); // if the ref has status online the target must be there !
|
||||
|
||||
// some units are prefered in comparison to others
|
||||
// some units are preferred in comparison to others
|
||||
if(iter != lastRef && (target->IsImmunedToDamage(pAttacker->GetMeleeDamageSchoolMask(), false) ||
|
||||
target->hasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_FLEEING)
|
||||
) )
|
||||
|
||||
@@ -74,8 +74,8 @@ class TRINITY_DLL_SPEC HostilReference : public Reference<Unit, ThreatManager>
|
||||
bool isOnline() const { return iOnline; }
|
||||
|
||||
// The Unit might be in water and the creature can not enter the water, but has range attack
|
||||
// in this case online = true, but accessable = false
|
||||
bool isAccessable() const { return iAccessible; }
|
||||
// in this case online = true, but accessible = false
|
||||
bool isAccessible() const { return iAccessible; }
|
||||
|
||||
// used for temporary setting a threat and reducting it later again.
|
||||
// the threat modification is stored
|
||||
|
||||
+67
-62
@@ -387,10 +387,15 @@ void Unit::SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end, uin
|
||||
|
||||
WorldPacket data( SMSG_MONSTER_MOVE, (GetPackGUID().size()+4+4+4+4+1+4+4+4+pathSize*4*3) );
|
||||
data.append(GetPackGUID());
|
||||
data << GetPositionX( )
|
||||
<< GetPositionY( )
|
||||
<< GetPositionZ( );
|
||||
data << GetOrientation( );
|
||||
data << GetPositionX();
|
||||
data << GetPositionY();
|
||||
data << GetPositionZ();
|
||||
|
||||
// unknown field - unrelated to orientation
|
||||
// seems to increment about 1000 for every 1.7 seconds
|
||||
// for now, we'll just use mstime
|
||||
data << getMSTime();
|
||||
|
||||
data << uint8( 0 );
|
||||
data << uint32( MovementFlags );
|
||||
data << uint32( traveltime );
|
||||
@@ -868,7 +873,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
||||
{
|
||||
if(getVictim())
|
||||
{
|
||||
// if have target and damage pVictim just call AI recation
|
||||
// if have target and damage pVictim just call AI reaction
|
||||
if(pVictim != getVictim() && pVictim->GetTypeId()==TYPEID_UNIT && ((Creature*)pVictim)->AI())
|
||||
((Creature*)pVictim)->AI()->AttackedBy(this);
|
||||
}
|
||||
@@ -982,7 +987,7 @@ void Unit::CastStop(uint32 except_spellid)
|
||||
InterruptSpell(i,false);
|
||||
}
|
||||
|
||||
void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem, Aura* triggredByAura, uint64 originalCaster)
|
||||
void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster)
|
||||
{
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId );
|
||||
|
||||
@@ -992,10 +997,10 @@ void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castIte
|
||||
return;
|
||||
}
|
||||
|
||||
CastSpell(Victim,spellInfo,triggered,castItem,triggredByAura, originalCaster);
|
||||
CastSpell(Victim,spellInfo,triggered,castItem,triggeredByAura, originalCaster);
|
||||
}
|
||||
|
||||
void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem, Aura* triggredByAura, uint64 originalCaster)
|
||||
void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster)
|
||||
{
|
||||
assert(Victim);
|
||||
if(!spellInfo)
|
||||
@@ -1007,8 +1012,8 @@ void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, I
|
||||
if (castItem)
|
||||
DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id);
|
||||
|
||||
if(!originalCaster && triggredByAura)
|
||||
originalCaster = triggredByAura->GetCasterGUID();
|
||||
if(!originalCaster && triggeredByAura)
|
||||
originalCaster = triggeredByAura->GetCasterGUID();
|
||||
|
||||
Spell *spell = new Spell(this, spellInfo, triggered, originalCaster );
|
||||
|
||||
@@ -1016,10 +1021,10 @@ void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, I
|
||||
targets.setUnitTarget( Victim );
|
||||
targets.setDestination( Victim->GetPositionX(), Victim->GetPositionY(), Victim->GetPositionZ(), false);
|
||||
spell->m_CastItem = castItem;
|
||||
spell->prepare(&targets, triggredByAura);
|
||||
spell->prepare(&targets, triggeredByAura);
|
||||
}
|
||||
|
||||
void Unit::CastCustomSpell(Unit* Victim,uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem, Aura* triggredByAura, uint64 originalCaster)
|
||||
void Unit::CastCustomSpell(Unit* Victim,uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster)
|
||||
{
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId );
|
||||
|
||||
@@ -1029,10 +1034,10 @@ void Unit::CastCustomSpell(Unit* Victim,uint32 spellId, int32 const* bp0, int32
|
||||
return;
|
||||
}
|
||||
|
||||
CastCustomSpell(Victim,spellInfo,bp0,bp1,bp2,triggered,castItem,triggredByAura, originalCaster);
|
||||
CastCustomSpell(Victim,spellInfo,bp0,bp1,bp2,triggered,castItem,triggeredByAura, originalCaster);
|
||||
}
|
||||
|
||||
void Unit::CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem, Aura* triggredByAura, uint64 originalCaster)
|
||||
void Unit::CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster)
|
||||
{
|
||||
if(!spellInfo)
|
||||
{
|
||||
@@ -1043,8 +1048,8 @@ void Unit::CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const
|
||||
if (castItem)
|
||||
DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id);
|
||||
|
||||
if(!originalCaster && triggredByAura)
|
||||
originalCaster = triggredByAura->GetCasterGUID();
|
||||
if(!originalCaster && triggeredByAura)
|
||||
originalCaster = triggeredByAura->GetCasterGUID();
|
||||
|
||||
Spell *spell = new Spell(this, spellInfo, triggered, originalCaster);
|
||||
|
||||
@@ -1060,11 +1065,11 @@ void Unit::CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const
|
||||
SpellCastTargets targets;
|
||||
targets.setUnitTarget( Victim );
|
||||
spell->m_CastItem = castItem;
|
||||
spell->prepare(&targets, triggredByAura);
|
||||
spell->prepare(&targets, triggeredByAura);
|
||||
}
|
||||
|
||||
// used for scripting
|
||||
void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem, Aura* triggredByAura, uint64 originalCaster)
|
||||
void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster)
|
||||
{
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId );
|
||||
|
||||
@@ -1074,11 +1079,11 @@ void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered,
|
||||
return;
|
||||
}
|
||||
|
||||
CastSpell(x, y, z,spellInfo,triggered,castItem,triggredByAura, originalCaster);
|
||||
CastSpell(x, y, z,spellInfo,triggered,castItem,triggeredByAura, originalCaster);
|
||||
}
|
||||
|
||||
// used for scripting
|
||||
void Unit::CastSpell(float x, float y, float z, SpellEntry const *spellInfo, bool triggered, Item *castItem, Aura* triggredByAura, uint64 originalCaster)
|
||||
void Unit::CastSpell(float x, float y, float z, SpellEntry const *spellInfo, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster)
|
||||
{
|
||||
if(!spellInfo)
|
||||
{
|
||||
@@ -1089,15 +1094,15 @@ void Unit::CastSpell(float x, float y, float z, SpellEntry const *spellInfo, boo
|
||||
if (castItem)
|
||||
DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id);
|
||||
|
||||
if(!originalCaster && triggredByAura)
|
||||
originalCaster = triggredByAura->GetCasterGUID();
|
||||
if(!originalCaster && triggeredByAura)
|
||||
originalCaster = triggeredByAura->GetCasterGUID();
|
||||
|
||||
Spell *spell = new Spell(this, spellInfo, triggered, originalCaster );
|
||||
|
||||
SpellCastTargets targets;
|
||||
targets.setDestination(x, y, z);
|
||||
spell->m_CastItem = castItem;
|
||||
spell->prepare(&targets, triggredByAura);
|
||||
spell->prepare(&targets, triggeredByAura);
|
||||
}
|
||||
|
||||
void Unit::DealFlatDamage(Unit *pVictim, SpellEntry const *spellInfo, uint32 *damage, CleanDamage *cleanDamage, bool *crit, bool isTriggeredSpell)
|
||||
@@ -1105,7 +1110,7 @@ void Unit::DealFlatDamage(Unit *pVictim, SpellEntry const *spellInfo, uint32 *da
|
||||
// TODO this in only generic way, check for exceptions
|
||||
DEBUG_LOG("DealFlatDamage (BEFORE) >> DMG:%u", *damage);
|
||||
|
||||
// Per-damage calss calculation
|
||||
// Per-damage class calculation
|
||||
switch (spellInfo->DmgClass)
|
||||
{
|
||||
// Melee and Ranged Spells
|
||||
@@ -1711,7 +1716,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
|
||||
RemainingDamage -= currentAbsorb;
|
||||
}
|
||||
|
||||
// only split damage if not damaing yourself
|
||||
// only split damage if not damaging yourself
|
||||
if(pVictim != this)
|
||||
{
|
||||
AuraList const& vSplitDamageFlat = pVictim->GetAurasByType(SPELL_AURA_SPLIT_DAMAGE_FLAT);
|
||||
@@ -2191,7 +2196,7 @@ void Unit::AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType, bool ex
|
||||
else if (attType == OFF_ATTACK)
|
||||
hitInfo = HITINFO_LEFTSWING;
|
||||
else
|
||||
return; // ignore ranaged case
|
||||
return; // ignore ranged case
|
||||
|
||||
uint32 extraAttacks = m_extraAttacks;
|
||||
|
||||
@@ -2305,7 +2310,7 @@ MeleeHitOutcome Unit::RollPhysicalOutcomeAgainst (Unit const *pVictim, WeaponAtt
|
||||
}
|
||||
else
|
||||
{
|
||||
// parry can be avoided only by some abilites
|
||||
// parry can be avoided only by some abilities
|
||||
parry_chance = pVictim->GetUnitParryChance();
|
||||
// block might be bypassed by it as well
|
||||
block_chance = pVictim->GetUnitBlockChance();
|
||||
@@ -2319,7 +2324,7 @@ MeleeHitOutcome Unit::RollPhysicalOutcomeAgainst (Unit const *pVictim, WeaponAtt
|
||||
// Increase from SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL aura
|
||||
crit_chance += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL, spellInfo->SchoolMask);
|
||||
|
||||
if( dodge_chance != 0.0f ) // if dodge chance is already 0, ignore talents fpr speed
|
||||
if( dodge_chance != 0.0f ) // if dodge chance is already 0, ignore talents for speed
|
||||
{
|
||||
AuraList const& mCanNotBeDodge = GetAurasByType(SPELL_AURA_IGNORE_COMBAT_RESULT);
|
||||
for(AuraList::const_iterator i = mCanNotBeDodge.begin(); i != mCanNotBeDodge.end(); ++i)
|
||||
@@ -2885,7 +2890,7 @@ SpellMissInfo Unit::SpellHitResult(Unit *pVictim, SpellEntry const *spell, bool
|
||||
}
|
||||
|
||||
// TODO need use this code for spell hit result calculation
|
||||
// now code commented for compotability
|
||||
// now code commented for computability
|
||||
switch (spell->DmgClass)
|
||||
{
|
||||
case SPELL_DAMAGE_CLASS_RANGED:
|
||||
@@ -3057,7 +3062,7 @@ float Unit::GetUnitBlockChance() const
|
||||
if(tmpitem && !tmpitem->IsBroken() && tmpitem->GetProto()->Block)
|
||||
return GetFloatValue(PLAYER_BLOCK_PERCENTAGE);
|
||||
}
|
||||
// is player but has no block ability or no not broken shield equiped
|
||||
// is player but has no block ability or no not broken shield equipped
|
||||
return 0.0f;
|
||||
}
|
||||
else
|
||||
@@ -3138,7 +3143,7 @@ uint32 Unit::GetWeaponSkillValue (WeaponAttackType attType, Unit const* target)
|
||||
if(((Player*)this)->IsInFeralForm())
|
||||
return GetMaxSkillValueForLevel(); // always maximized SKILL_FERAL_COMBAT in fact
|
||||
|
||||
// weaon skill or (unarmed for base attack)
|
||||
// weapon skill or (unarmed for base attack)
|
||||
uint32 skill = item ? item->GetSkill() : SKILL_UNARMED;
|
||||
|
||||
// in PvP use full skill instead current skill value
|
||||
@@ -3456,7 +3461,7 @@ bool Unit::isInLine(Unit const* target, float distance) const
|
||||
return abs(sin(angle)) * distance < width;
|
||||
}
|
||||
|
||||
bool Unit::isInAccessablePlaceFor(Creature const* c) const
|
||||
bool Unit::isInAccessiblePlaceFor(Creature const* c) const
|
||||
{
|
||||
if(IsInWater())
|
||||
return c->canSwim();
|
||||
@@ -3492,13 +3497,13 @@ int32 Unit::GetTotalAuraModifier(AuraType auratype) const
|
||||
|
||||
float Unit::GetTotalAuraMultiplier(AuraType auratype) const
|
||||
{
|
||||
float multipler = 1.0f;
|
||||
float multiplier = 1.0f;
|
||||
|
||||
AuraList const& mTotalAuraList = GetAurasByType(auratype);
|
||||
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
|
||||
multipler *= (100.0f + (*i)->GetModifier()->m_amount)/100.0f;
|
||||
multiplier *= (100.0f + (*i)->GetModifier()->m_amount)/100.0f;
|
||||
|
||||
return multipler;
|
||||
return multiplier;
|
||||
}
|
||||
|
||||
int32 Unit::GetMaxPositiveAuraModifier(AuraType auratype) const
|
||||
@@ -3541,16 +3546,16 @@ int32 Unit::GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask)
|
||||
|
||||
float Unit::GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask) const
|
||||
{
|
||||
float multipler = 1.0f;
|
||||
float multiplier = 1.0f;
|
||||
|
||||
AuraList const& mTotalAuraList = GetAurasByType(auratype);
|
||||
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
|
||||
{
|
||||
Modifier* mod = (*i)->GetModifier();
|
||||
if (mod->m_miscvalue & misc_mask)
|
||||
multipler *= (100.0f + mod->m_amount)/100.0f;
|
||||
multiplier *= (100.0f + mod->m_amount)/100.0f;
|
||||
}
|
||||
return multipler;
|
||||
return multiplier;
|
||||
}
|
||||
|
||||
int32 Unit::GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const
|
||||
@@ -3599,16 +3604,16 @@ int32 Unit::GetTotalAuraModifierByMiscValue(AuraType auratype, int32 misc_value)
|
||||
|
||||
float Unit::GetTotalAuraMultiplierByMiscValue(AuraType auratype, int32 misc_value) const
|
||||
{
|
||||
float multipler = 1.0f;
|
||||
float multiplier = 1.0f;
|
||||
|
||||
AuraList const& mTotalAuraList = GetAurasByType(auratype);
|
||||
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
|
||||
{
|
||||
Modifier* mod = (*i)->GetModifier();
|
||||
if (mod->m_miscvalue == misc_value)
|
||||
multipler *= (100.0f + mod->m_amount)/100.0f;
|
||||
multiplier *= (100.0f + mod->m_amount)/100.0f;
|
||||
}
|
||||
return multipler;
|
||||
return multiplier;
|
||||
}
|
||||
|
||||
int32 Unit::GetMaxPositiveAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const
|
||||
@@ -3724,7 +3729,7 @@ bool Unit::AddAura(Aura *Aur)
|
||||
if (!RemoveNoStackAurasDueToAura(Aur))
|
||||
{
|
||||
delete Aur;
|
||||
return false; // couldnt remove conflicting aura with higher rank
|
||||
return false; // couldn't remove conflicting aura with higher rank
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3866,7 +3871,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
|
||||
for(int j = 0; j < 3; ++j)
|
||||
{
|
||||
// prevent remove dummy triggered spells at next effect aura add
|
||||
switch(spellProto->Effect[j]) // main spell auras added added after triggred spell
|
||||
switch(spellProto->Effect[j]) // main spell auras added added after triggered spell
|
||||
{
|
||||
case SPELL_EFFECT_DUMMY:
|
||||
switch(spellId)
|
||||
@@ -3879,7 +3884,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
|
||||
if(is_triggered_by_spell)
|
||||
break;
|
||||
|
||||
// prevent remove form main spell by triggred passive spells
|
||||
// prevent remove form main spell by triggered passive spells
|
||||
switch(i_spellProto->EffectApplyAuraName[j]) // main aura added before triggered spell
|
||||
{
|
||||
case SPELL_AURA_MOD_SHAPESHIFT:
|
||||
@@ -4048,7 +4053,7 @@ void Unit::RemoveAurasWithDispelType( DispelType type )
|
||||
{
|
||||
// Create dispel mask by dispel type
|
||||
uint32 dispelMask = GetDispellMask(type);
|
||||
// Dispel all existing auras vs current dispell type
|
||||
// Dispel all existing auras vs current dispel type
|
||||
AuraMap& auras = GetAuras();
|
||||
for(AuraMap::iterator itr = auras.begin(); itr != auras.end(); )
|
||||
{
|
||||
@@ -4481,7 +4486,7 @@ void Unit::ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVic
|
||||
sLog.outDebug("ProcDamageAndSpell: invoked due to spell id %u %s", procSpell->Id, (isTriggeredSpell?"(triggered)":""));
|
||||
|
||||
// Assign melee/ranged proc flags for magic attacks, that are actually melee/ranged abilities
|
||||
// not assign for spell proc triggered spell to prevent infinity (or unexpacted 2-3 times) melee damage spell proc call with melee damage effect
|
||||
// not assign for spell proc triggered spell to prevent infinity (or unexpected 2-3 times) melee damage spell proc call with melee damage effect
|
||||
// That is the question though if it's fully correct
|
||||
if(procSpell && !isTriggeredSpell)
|
||||
{
|
||||
@@ -4508,7 +4513,7 @@ void Unit::ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVic
|
||||
// Not much to do if no flags are set.
|
||||
if (procAttacker)
|
||||
{
|
||||
// procces auras that not generate casts at proc event before auras that generate casts to prevent proc aura added at prev. proc aura execute in set
|
||||
// processing auras that not generate casts at proc event before auras that generate casts to prevent proc aura added at prev. proc aura execute in set
|
||||
ProcDamageAndSpellFor(false,pVictim,procAttacker,attackerProcEffectAuraTypes,attType, procSpell, damage, damageSchoolMask);
|
||||
ProcDamageAndSpellFor(false,pVictim,procAttacker,attackerProcCastAuraTypes,attType, procSpell, damage, damageSchoolMask);
|
||||
}
|
||||
@@ -4517,7 +4522,7 @@ void Unit::ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVic
|
||||
// Not much to do if no flags are set or there is no victim
|
||||
if(pVictim && pVictim->isAlive() && procVictim)
|
||||
{
|
||||
// procces auras that not generate casts at proc event before auras that generate casts to prevent proc aura added at prev. proc aura execute in set
|
||||
// processing auras that not generate casts at proc event before auras that generate casts to prevent proc aura added at prev. proc aura execute in set
|
||||
pVictim->ProcDamageAndSpellFor(true,this,procVictim,victimProcEffectAuraTypes,attType,procSpell, damage, damageSchoolMask);
|
||||
pVictim->ProcDamageAndSpellFor(true,this,procVictim,victimProcCastAuraTypes,attType,procSpell, damage, damageSchoolMask);
|
||||
}
|
||||
@@ -4706,7 +4711,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, SpellEntry const *dummySpell, uint
|
||||
case 18765:
|
||||
case 35429:
|
||||
{
|
||||
// prevent chain of triggred spell from same triggred spell
|
||||
// prevent chain of triggered spell from same triggered spell
|
||||
if(procSpell && procSpell->Id==26654)
|
||||
return false;
|
||||
|
||||
@@ -5728,7 +5733,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, SpellEntry const *dummySpell, uint
|
||||
return false;
|
||||
|
||||
uint32 spellId = 0;
|
||||
// Every Lightning Bolt and Chain Lightning spell have dublicate vs half damage and zero cost
|
||||
// Every Lightning Bolt and Chain Lightning spell have duplicate vs half damage and zero cost
|
||||
switch (procSpell->Id)
|
||||
{
|
||||
// Lightning Bolt
|
||||
@@ -5771,7 +5776,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, SpellEntry const *dummySpell, uint
|
||||
if (procSpell->SpellFamilyFlags & 0x0000000000000002LL)
|
||||
((Player*)this)->RemoveSpellCooldown(spellId);
|
||||
|
||||
// Hmmm.. in most case spells alredy set half basepoints but...
|
||||
// Hmmm.. in most case spells already set half basepoints but...
|
||||
// Lightning Bolt (2-10 rank) have full basepoint and half bonus from level
|
||||
// As on wiki:
|
||||
// BUG: Rank 2 to 10 (and maybe 11) of Lightning Bolt will proc another Bolt with FULL damage (not halved). This bug is known and will probably be fixed soon.
|
||||
@@ -5989,7 +5994,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
|
||||
if( pVictim == this )
|
||||
return false;
|
||||
|
||||
// custom chnace
|
||||
// custom chance
|
||||
float chance = 0;
|
||||
switch (triggeredByAura->GetId())
|
||||
{
|
||||
@@ -7053,7 +7058,7 @@ void Unit::RemoveAllAttackers()
|
||||
AttackerSet::iterator iter = m_attackers.begin();
|
||||
if(!(*iter)->AttackStop())
|
||||
{
|
||||
sLog.outError("WORLD: Unit has an attacker that isnt attacking it!");
|
||||
sLog.outError("WORLD: Unit has an attacker that isn't attacking it!");
|
||||
m_attackers.erase(iter);
|
||||
}
|
||||
}
|
||||
@@ -8374,7 +8379,7 @@ void Unit::ApplySpellDispelImmunity(const SpellEntry * spellProto, DispelType ty
|
||||
float Unit::GetWeaponProcChance() const
|
||||
{
|
||||
// normalized proc chance for weapon attack speed
|
||||
// (odd formulae...)
|
||||
// (odd formula...)
|
||||
if(isAttackReady(BASE_ATTACK))
|
||||
return (GetAttackTime(BASE_ATTACK) * 1.8f / 1000.0f);
|
||||
else if (haveOffhandWeapon() && isAttackReady(OFF_ATTACK))
|
||||
@@ -9063,7 +9068,7 @@ bool Unit::SelectHostilTarget()
|
||||
assert(GetTypeId()== TYPEID_UNIT);
|
||||
Unit* target = NULL;
|
||||
|
||||
//This function only useful once AI has been initilazied
|
||||
//This function only useful once AI has been initialized
|
||||
if (!((Creature*)this)->AI())
|
||||
return false;
|
||||
|
||||
@@ -9095,7 +9100,7 @@ bool Unit::SelectHostilTarget()
|
||||
{
|
||||
for(AttackerSet::const_iterator itr = m_attackers.begin(); itr != m_attackers.end(); ++itr)
|
||||
{
|
||||
if( (*itr)->IsInMap(this) && canAttack(*itr) && (*itr)->isInAccessablePlaceFor((Creature*)this) )
|
||||
if( (*itr)->IsInMap(this) && canAttack(*itr) && (*itr)->isInAccessiblePlaceFor((Creature*)this) )
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -9337,7 +9342,7 @@ bool Unit::HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, f
|
||||
{
|
||||
if(unitMod >= UNIT_MOD_END || modifierType >= MODIFIER_TYPE_END)
|
||||
{
|
||||
sLog.outError("ERROR in HandleStatModifier(): nonexisted UnitMods or wrong UnitModifierType!");
|
||||
sLog.outError("ERROR in HandleStatModifier(): non existed UnitMods or wrong UnitModifierType!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -9407,7 +9412,7 @@ float Unit::GetModifierValue(UnitMods unitMod, UnitModifierType modifierType) co
|
||||
{
|
||||
if( unitMod >= UNIT_MOD_END || modifierType >= MODIFIER_TYPE_END)
|
||||
{
|
||||
sLog.outError("ERROR: trial to access nonexisted modifier value from UnitMods!");
|
||||
sLog.outError("ERROR: trial to access non existed modifier value from UnitMods!");
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -9437,7 +9442,7 @@ float Unit::GetTotalAuraModValue(UnitMods unitMod) const
|
||||
{
|
||||
if(unitMod >= UNIT_MOD_END)
|
||||
{
|
||||
sLog.outError("ERROR: trial to access nonexisted UnitMods in GetTotalAuraModValue()!");
|
||||
sLog.outError("ERROR: trial to access non existed UnitMods in GetTotalAuraModValue()!");
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -9737,7 +9742,7 @@ void Unit::CleanupsBeforeDelete()
|
||||
if(m_uint32Values) // only for fully created object
|
||||
{
|
||||
InterruptNonMeleeSpells(true);
|
||||
m_Events.KillAllEvents(false); // non-delatable (currently casted spells) will not deleted ans will deleated at call in Map::RemoveAllObjectsInRemoveList
|
||||
m_Events.KillAllEvents(false); // non-delatable (currently casted spells) will not deleted now but it will deleted at call in Map::RemoveAllObjectsInRemoveList
|
||||
CombatStop();
|
||||
ClearComboPointHolders();
|
||||
DeleteThreatList();
|
||||
@@ -10047,7 +10052,7 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
|
||||
if(!found)
|
||||
{
|
||||
sLog.outError("Spell aura %u (id:%u effect:%u) has been deleted before call spell proc event handler",*aur,i->triggeredByAura_SpellPair.first,i->triggeredByAura_SpellPair.second);
|
||||
sLog.outError("It can be deleted one from early proccesed auras:");
|
||||
sLog.outError("It can be deleted one from early processed auras:");
|
||||
for(ProcTriggeredList::iterator i2 = procTriggered.begin(); i != i2; ++i2)
|
||||
sLog.outError(" Spell aura %u (id:%u effect:%u)",*aur,i2->triggeredByAura_SpellPair.first,i2->triggeredByAura_SpellPair.second);
|
||||
sLog.outError(" <end of list>");
|
||||
@@ -10297,7 +10302,7 @@ void Unit::StopMoving()
|
||||
clearUnitState(UNIT_STAT_MOVING);
|
||||
|
||||
// send explicit stop packet
|
||||
// rely on vmaps here because for exemple stormwind is in air
|
||||
// rely on vmaps here because for example stormwind is in air
|
||||
float z = MapManager::Instance().GetBaseMap(GetMapId())->GetHeight(GetPositionX(), GetPositionY(), GetPositionZ(), true);
|
||||
//if (fabs(GetPositionZ() - z) < 2.0f)
|
||||
// Relocate(GetPositionX(), GetPositionY(), z);
|
||||
|
||||
+12
-12
@@ -213,7 +213,7 @@ enum HitInfo
|
||||
HITINFO_LEFTSWING = 0x00000004,
|
||||
HITINFO_MISS = 0x00000010,
|
||||
HITINFO_ABSORB = 0x00000020, // plays absorb sound
|
||||
HITINFO_RESIST = 0x00000040, // resisted atleast some damage
|
||||
HITINFO_RESIST = 0x00000040, // resisted at least some damage
|
||||
HITINFO_CRITICALHIT = 0x00000080,
|
||||
HITINFO_UNK2 = 0x00000100, // wotlk?
|
||||
HITINFO_UNK3 = 0x00002000, // wotlk?
|
||||
@@ -927,17 +927,17 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
bool canAttack(Unit const* target) const;
|
||||
virtual bool IsInWater() const;
|
||||
virtual bool IsUnderWater() const;
|
||||
bool isInAccessablePlaceFor(Creature const* c) const;
|
||||
bool isInAccessiblePlaceFor(Creature const* c) const;
|
||||
|
||||
void SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, bool critical = false);
|
||||
void SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage,Powers powertype, bool critical = false);
|
||||
uint32 SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage, bool isTriggeredSpell = false, bool useSpellDamage = true);
|
||||
void CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0);
|
||||
void CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem= NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0);
|
||||
void CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0);
|
||||
void CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0);
|
||||
void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0);
|
||||
void CastSpell(float x, float y, float z, SpellEntry const *spellInfo, bool triggered, Item *castItem = NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0);
|
||||
void CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
|
||||
void CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
|
||||
void CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
|
||||
void CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
|
||||
void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
|
||||
void CastSpell(float x, float y, float z, SpellEntry const *spellInfo, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
|
||||
|
||||
bool IsDamageToThreatSpell(SpellEntry const * spellInfo) const;
|
||||
|
||||
@@ -1362,10 +1362,10 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
//void SendAttackStart(Unit* pVictim); // only from Unit::AttackStart(Unit*)
|
||||
|
||||
void ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, AuraTypeSet const& procAuraTypes, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage, SpellSchoolMask damageSchoolMask );
|
||||
bool HandleDummyAuraProc(Unit *pVictim, SpellEntry const *spellProto, uint32 effIndex, uint32 damage, Aura* triggredByAura, SpellEntry const * procSpell, uint32 procFlag,uint32 cooldown);
|
||||
bool HandleProcTriggerSpell(Unit *pVictim,uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlags,WeaponAttackType attType,uint32 cooldown);
|
||||
bool HandleHasteAuraProc(Unit *pVictim, SpellEntry const *spellProto, uint32 effIndex, uint32 damage, Aura* triggredByAura, SpellEntry const * procSpell, uint32 procFlag,uint32 cooldown);
|
||||
bool HandleOverrideClassScriptAuraProc(Unit *pVictim, int32 scriptId, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell,uint32 cooldown);
|
||||
bool HandleDummyAuraProc(Unit *pVictim, SpellEntry const *spellProto, uint32 effIndex, uint32 damage, Aura* triggeredByAura, SpellEntry const * procSpell, uint32 procFlag,uint32 cooldown);
|
||||
bool HandleProcTriggerSpell(Unit *pVictim,uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlags,WeaponAttackType attType,uint32 cooldown);
|
||||
bool HandleHasteAuraProc(Unit *pVictim, SpellEntry const *spellProto, uint32 effIndex, uint32 damage, Aura* triggeredByAura, SpellEntry const * procSpell, uint32 procFlag,uint32 cooldown);
|
||||
bool HandleOverrideClassScriptAuraProc(Unit *pVictim, int32 scriptId, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell,uint32 cooldown);
|
||||
|
||||
uint32 m_state; // Even derived shouldn't modify
|
||||
uint32 m_CombatTimer;
|
||||
|
||||
@@ -153,7 +153,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &creature, const uint32 &di
|
||||
// Only one text is set
|
||||
if( !behavior->text[1].empty() )
|
||||
{
|
||||
// Select one from max 5 texts (0 and 1 laready checked)
|
||||
// Select one from max 5 texts (0 and 1 already checked)
|
||||
int i = 2;
|
||||
for( ; i < 5; ++i )
|
||||
if( behavior->text[i].empty() )
|
||||
|
||||
+2
-2
@@ -720,7 +720,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
m_configs[CONFIG_MAX_OVERSPEED_PINGS] = 2;
|
||||
}
|
||||
|
||||
m_configs[CONFIG_SAVE_RESPAWN_TIME_IMMEDIATLY] = sConfig.GetBoolDefault("SaveRespawnTimeImmediately",true);
|
||||
m_configs[CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY] = sConfig.GetBoolDefault("SaveRespawnTimeImmediately",true);
|
||||
m_configs[CONFIG_WEATHER] = sConfig.GetBoolDefault("ActivateWeather",true);
|
||||
|
||||
if(reload)
|
||||
@@ -2455,7 +2455,7 @@ void World::ShutdownCancel()
|
||||
m_ShutdownTimer = 0;
|
||||
SendServerMessage(msgid);
|
||||
|
||||
DEBUG_LOG("Server %s cancelled.",(m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"));
|
||||
DEBUG_LOG("Server %s canceled.",(m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"));
|
||||
}
|
||||
|
||||
/// Send a server message to the user(s)
|
||||
|
||||
+1
-1
@@ -132,7 +132,7 @@ enum WorldConfigs
|
||||
CONFIG_SKILL_GAIN_GATHERING,
|
||||
CONFIG_SKILL_GAIN_WEAPON,
|
||||
CONFIG_MAX_OVERSPEED_PINGS,
|
||||
CONFIG_SAVE_RESPAWN_TIME_IMMEDIATLY,
|
||||
CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY,
|
||||
CONFIG_WEATHER,
|
||||
CONFIG_EXPANSION,
|
||||
CONFIG_CHATFLOOD_MESSAGE_COUNT,
|
||||
|
||||
@@ -485,7 +485,7 @@ void WorldSession::Handle_NULL( WorldPacket& recvPacket )
|
||||
|
||||
void WorldSession::Handle_EarlyProccess( WorldPacket& recvPacket )
|
||||
{
|
||||
sLog.outError( "SESSION: received opcode %s (0x%.4X) that must be proccessed in WorldSocket::OnRead",
|
||||
sLog.outError( "SESSION: received opcode %s (0x%.4X) that must be processed in WorldSocket::OnRead",
|
||||
LookupOpcodeName(recvPacket.GetOpcode()),
|
||||
recvPacket.GetOpcode());
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ int WorldSocket::handle_input (ACE_HANDLE)
|
||||
if ((errno == EWOULDBLOCK) ||
|
||||
(errno == EAGAIN))
|
||||
{
|
||||
return Update (); // interesting line ,isnt it ?
|
||||
return Update (); // interesting line ,isn't it ?
|
||||
}
|
||||
|
||||
DEBUG_LOG ("WorldSocket::handle_input: Peer error closing connection errno = %s", ACE_OS::strerror (errno));
|
||||
@@ -469,7 +469,7 @@ int WorldSocket::handle_input_missing_data (void)
|
||||
|
||||
if (m_Header.space () > 0)
|
||||
{
|
||||
//couldnt recieve the whole header this time
|
||||
//couldn't recieve the whole header this time
|
||||
ACE_ASSERT (message_block.length () == 0);
|
||||
errno = EWOULDBLOCK;
|
||||
return -1;
|
||||
@@ -503,7 +503,7 @@ int WorldSocket::handle_input_missing_data (void)
|
||||
|
||||
if (m_RecvPct.space () > 0)
|
||||
{
|
||||
//couldnt recieve the whole data this time
|
||||
//couldn't recieve the whole data this time
|
||||
ACE_ASSERT (message_block.length () == 0);
|
||||
errno = EWOULDBLOCK;
|
||||
return -1;
|
||||
|
||||
@@ -165,7 +165,7 @@ protected:
|
||||
|
||||
while (!m_Reactor->reactor_event_loop_done ())
|
||||
{
|
||||
// dont be too smart to move this outside the loop
|
||||
// Don't be too smart to move this outside the loop
|
||||
// the run_reactor_event_loop will modify interval
|
||||
ACE_Time_Value interval (0, 10000);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user