[12069] Cleanup comment style

This commit is contained in:
Schmoozerd 2012-07-22 02:54:31 +02:00
parent 5efb3867f5
commit 835d1c7479
205 changed files with 2835 additions and 2835 deletions

View file

@ -26,7 +26,7 @@
#include "../../game/ScriptMgr.h" #include "../../game/ScriptMgr.h"
#include "../../game/SpellAuras.h" #include "../../game/SpellAuras.h"
//uint8 loglevel = 0; // uint8 loglevel = 0;
int nrscripts; int nrscripts;
Script* m_scripts[MAX_SCRIPTS]; Script* m_scripts[MAX_SCRIPTS];
@ -376,10 +376,10 @@ bool EffectAuraDummy(const Aura* pAura, bool apply)
void ScriptedAI::UpdateAI(const uint32) void ScriptedAI::UpdateAI(const uint32)
{ {
//Check if we have a current target // Check if we have a current target
if (m_creature->isAlive() && m_creature->SelectHostileTarget() && m_creature->getVictim()) if (m_creature->isAlive() && m_creature->SelectHostileTarget() && m_creature->getVictim())
{ {
//If we are within range melee the target // If we are within range melee the target
if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE)) if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
{ {
if (m_creature->isAttackReady()) if (m_creature->isAttackReady())

View file

@ -19,7 +19,7 @@
#ifndef SCRIPTMGR_H #ifndef SCRIPTMGR_H
#define SCRIPTMGR_H #define SCRIPTMGR_H
//Only required includes // Only required includes
#include "../../game/CreatureAI.h" #include "../../game/CreatureAI.h"
#include "../../game/Creature.h" #include "../../game/Creature.h"
#include "../../game/InstanceData.h" #include "../../game/InstanceData.h"

View file

@ -67,7 +67,7 @@ namespace MaNGOS
template<class SPECIFIC_TYPE> template<class SPECIFIC_TYPE>
SPECIFIC_TYPE* Insert(ContainerMapList<SPECIFIC_TYPE>& elements, SPECIFIC_TYPE* obj) SPECIFIC_TYPE* Insert(ContainerMapList<SPECIFIC_TYPE>& elements, SPECIFIC_TYPE* obj)
{ {
//elements._element[hdl] = obj; // elements._element[hdl] = obj;
obj->GetGridRef().link(&elements._element, obj); obj->GetGridRef().link(&elements._element, obj);
return obj; return obj;
} }

View file

@ -34,10 +34,10 @@
#if !defined(MANGOS_ENDIAN) #if !defined(MANGOS_ENDIAN)
# if defined (ACE_BIG_ENDIAN) # if defined (ACE_BIG_ENDIAN)
# define MANGOS_ENDIAN MANGOS_BIGENDIAN # define MANGOS_ENDIAN MANGOS_BIGENDIAN
# else //ACE_BYTE_ORDER != ACE_BIG_ENDIAN # else // ACE_BYTE_ORDER != ACE_BIG_ENDIAN
# define MANGOS_ENDIAN MANGOS_LITTLEENDIAN # define MANGOS_ENDIAN MANGOS_LITTLEENDIAN
# endif //ACE_BYTE_ORDER # endif // ACE_BYTE_ORDER
#endif //MANGOS_ENDIAN #endif // MANGOS_ENDIAN
typedef ACE_SHLIB_HANDLE MANGOS_LIBRARY_HANDLE; typedef ACE_SHLIB_HANDLE MANGOS_LIBRARY_HANDLE;
@ -53,7 +53,7 @@ typedef ACE_SHLIB_HANDLE MANGOS_LIBRARY_HANDLE;
#if PLATFORM == PLATFORM_WINDOWS #if PLATFORM == PLATFORM_WINDOWS
# define MANGOS_EXPORT __declspec(dllexport) # define MANGOS_EXPORT __declspec(dllexport)
# define MANGOS_IMPORT __cdecl # define MANGOS_IMPORT __cdecl
#else //PLATFORM != PLATFORM_WINDOWS #else // PLATFORM != PLATFORM_WINDOWS
# define MANGOS_EXPORT export # define MANGOS_EXPORT export
# if defined(__APPLE_CC__) && defined(BIG_ENDIAN) # if defined(__APPLE_CC__) && defined(BIG_ENDIAN)
# define MANGOS_IMPORT __attribute__ ((longcall)) # define MANGOS_IMPORT __attribute__ ((longcall))
@ -62,7 +62,7 @@ typedef ACE_SHLIB_HANDLE MANGOS_LIBRARY_HANDLE;
# else # else
# define MANGOS_IMPORT __attribute__ ((cdecl)) # define MANGOS_IMPORT __attribute__ ((cdecl))
# endif //__APPLE_CC__ && BIG_ENDIAN # endif //__APPLE_CC__ && BIG_ENDIAN
#endif //PLATFORM #endif // PLATFORM
#if PLATFORM == PLATFORM_WINDOWS #if PLATFORM == PLATFORM_WINDOWS
# ifdef MANGOS_WIN32_DLL_IMPORT # ifdef MANGOS_WIN32_DLL_IMPORT
@ -72,38 +72,38 @@ typedef ACE_SHLIB_HANDLE MANGOS_LIBRARY_HANDLE;
# define MANGOS_DLL_DECL __declspec(dllexport) # define MANGOS_DLL_DECL __declspec(dllexport)
# else //!MANGOS_WIND_DLL_EXPORT # else //!MANGOS_WIND_DLL_EXPORT
# define MANGOS_DLL_DECL # define MANGOS_DLL_DECL
# endif //MANGOS_WIND_DLL_EXPORT # endif // MANGOS_WIND_DLL_EXPORT
# endif //MANGOS_WIN32_DLL_IMPORT # endif // MANGOS_WIN32_DLL_IMPORT
#else //PLATFORM != PLATFORM_WINDOWS #else // PLATFORM != PLATFORM_WINDOWS
# define MANGOS_DLL_DECL # define MANGOS_DLL_DECL
#endif //PLATFORM #endif // PLATFORM
#if PLATFORM == PLATFORM_WINDOWS #if PLATFORM == PLATFORM_WINDOWS
# define MANGOS_DLL_SPEC __declspec(dllexport) # define MANGOS_DLL_SPEC __declspec(dllexport)
# ifndef DECLSPEC_NORETURN # ifndef DECLSPEC_NORETURN
# define DECLSPEC_NORETURN __declspec(noreturn) # define DECLSPEC_NORETURN __declspec(noreturn)
# endif //DECLSPEC_NORETURN # endif // DECLSPEC_NORETURN
#else //PLATFORM != PLATFORM_WINDOWS #else // PLATFORM != PLATFORM_WINDOWS
# define MANGOS_DLL_SPEC # define MANGOS_DLL_SPEC
# define DECLSPEC_NORETURN # define DECLSPEC_NORETURN
#endif //PLATFORM #endif // PLATFORM
#if !defined(DEBUG) #if !defined(DEBUG)
# define MANGOS_INLINE inline # define MANGOS_INLINE inline
#else //DEBUG #else // DEBUG
# if !defined(MANGOS_DEBUG) # if !defined(MANGOS_DEBUG)
# define MANGOS_DEBUG # define MANGOS_DEBUG
# endif //MANGOS_DEBUG # endif // MANGOS_DEBUG
# define MANGOS_INLINE # define MANGOS_INLINE
#endif //!DEBUG #endif //!DEBUG
#if COMPILER == COMPILER_GNU #if COMPILER == COMPILER_GNU
# define ATTR_NORETURN __attribute__((noreturn)) # define ATTR_NORETURN __attribute__((noreturn))
# define ATTR_PRINTF(F,V) __attribute__ ((format (printf, F, V))) # define ATTR_PRINTF(F,V) __attribute__ ((format (printf, F, V)))
#else //COMPILER != COMPILER_GNU #else // COMPILER != COMPILER_GNU
# define ATTR_NORETURN # define ATTR_NORETURN
# define ATTR_PRINTF(F,V) # define ATTR_PRINTF(F,V)
#endif //COMPILER == COMPILER_GNU #endif // COMPILER == COMPILER_GNU
typedef ACE_INT64 int64; typedef ACE_INT64 int64;
typedef ACE_INT32 int32; typedef ACE_INT32 int32;
@ -117,7 +117,7 @@ typedef ACE_UINT8 uint8;
#if COMPILER != COMPILER_MICROSOFT #if COMPILER != COMPILER_MICROSOFT
typedef uint16 WORD; typedef uint16 WORD;
typedef uint32 DWORD; typedef uint32 DWORD;
#endif //COMPILER #endif // COMPILER
#if COMPILER == COMPILER_GNU #if COMPILER == COMPILER_GNU
# if !defined(__GXX_EXPERIMENTAL_CXX0X__) || (__GNUC__ < 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ < 7) # if !defined(__GXX_EXPERIMENTAL_CXX0X__) || (__GNUC__ < 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ < 7)
@ -127,4 +127,4 @@ typedef uint32 DWORD;
typedef uint64 OBJECT_HANDLE; typedef uint64 OBJECT_HANDLE;
#endif //MANGOS_DEFINE_H #endif // MANGOS_DEFINE_H

View file

@ -16,8 +16,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
//lets use Intel scalable_allocator by default and // lets use Intel scalable_allocator by default and
//switch to OS specific allocator only when _STANDARD_MALLOC is defined // switch to OS specific allocator only when _STANDARD_MALLOC is defined
#ifndef USE_STANDARD_MALLOC #ifndef USE_STANDARD_MALLOC
#include "../../dep/tbb/include/tbb/scalable_allocator.h" #include "../../dep/tbb/include/tbb/scalable_allocator.h"

View file

@ -19,7 +19,7 @@
#ifndef MANGOS_CALLBACK_H #ifndef MANGOS_CALLBACK_H
#define MANGOS_CALLBACK_H #define MANGOS_CALLBACK_H
//defines to simplify multi param templates code and readablity // defines to simplify multi param templates code and readablity
#define TYPENAMES_1 typename T1 #define TYPENAMES_1 typename T1
#define TYPENAMES_2 TYPENAMES_1, typename T2 #define TYPENAMES_2 TYPENAMES_1, typename T2
#define TYPENAMES_3 TYPENAMES_2, typename T3 #define TYPENAMES_3 TYPENAMES_2, typename T3
@ -42,7 +42,7 @@
#define PARAMS_9 PARAMS_8, T9 param9 #define PARAMS_9 PARAMS_8, T9 param9
#define PARAMS_10 PARAMS_9, T10 param10 #define PARAMS_10 PARAMS_9, T10 param10
//empty struct to use in templates instead of void type // empty struct to use in templates instead of void type
struct null { null() {} }; struct null { null() {} };
/// ------------ BASE CLASSES ------------ /// ------------ BASE CLASSES ------------

View file

@ -481,7 +481,7 @@ void AchievementMgr::SaveToDB()
if (!m_completedAchievements.empty()) if (!m_completedAchievements.empty())
{ {
//delete existing achievements in the loop // delete existing achievements in the loop
for (CompletedAchievementMap::iterator iter = m_completedAchievements.begin(); iter != m_completedAchievements.end(); ++iter) for (CompletedAchievementMap::iterator iter = m_completedAchievements.begin(); iter != m_completedAchievements.end(); ++iter)
{ {
if (!iter->second.changed) if (!iter->second.changed)
@ -500,7 +500,7 @@ void AchievementMgr::SaveToDB()
if (!m_criteriaProgress.empty()) if (!m_criteriaProgress.empty())
{ {
//insert achievements // insert achievements
for (CriteriaProgressMap::iterator iter = m_criteriaProgress.begin(); iter != m_criteriaProgress.end(); ++iter) for (CriteriaProgressMap::iterator iter = m_criteriaProgress.begin(); iter != m_criteriaProgress.end(); ++iter)
{ {
if (!iter->second.changed) if (!iter->second.changed)
@ -1126,7 +1126,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if (!found) if (!found)
continue; continue;
//FIXME: work only for instances where max==min for players // FIXME: work only for instances where max==min for players
if (map->GetMaxPlayers() != achievementCriteria->death_in_dungeon.manLimit) if (map->GetMaxPlayers() != achievementCriteria->death_in_dungeon.manLimit)
continue; continue;
@ -1200,9 +1200,9 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
switch (achievement->ID) switch (achievement->ID)
{ {
case 31: case 31:
//case 1275: // these timed achievements have to be "started" on Quest Accept // case 1275: // these timed achievements have to be "started" on Quest Accept
//case 1276: // case 1276:
//case 1277: // case 1277:
case 1282: case 1282:
case 1789: case 1789:
{ {
@ -2472,9 +2472,9 @@ void AchievementGlobalMgr::LoadAchievementCriteriaRequirements()
switch (achievement->ID) switch (achievement->ID)
{ {
case 31: case 31:
//case 1275: // these timed achievements are "started" on Quest Accept, and simple ended on quest-complete // case 1275: // these timed achievements are "started" on Quest Accept, and simple ended on quest-complete
//case 1276: // case 1276:
//case 1277: // case 1277:
case 1282: case 1282:
case 1789: case 1789:
break; break;
@ -2650,7 +2650,7 @@ void AchievementGlobalMgr::LoadRewards()
} }
} }
//check mail data before item for report including wrong item case // check mail data before item for report including wrong item case
if (reward.sender) if (reward.sender)
{ {
if (!ObjectMgr::GetCreatureTemplate(reward.sender)) if (!ObjectMgr::GetCreatureTemplate(reward.sender))

View file

@ -100,8 +100,8 @@ void AggressorAI::EnterEvadeMode()
else else
{ {
DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Creature stopped attacking, victim out run him [guid=%u]", m_creature->GetGUIDLow()); DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Creature stopped attacking, victim out run him [guid=%u]", m_creature->GetGUIDLow());
//i_state = STATE_LOOK_AT_VICTIM; // i_state = STATE_LOOK_AT_VICTIM;
//i_tracker.Reset(TIME_INTERVAL_LOOK); // i_tracker.Reset(TIME_INTERVAL_LOOK);
} }
if (!m_creature->isCharmed()) if (!m_creature->isCharmed())

View file

@ -209,7 +209,7 @@ bool ArenaTeam::LoadArenaTeamFromDB(QueryResult* arenaTeamDataResult)
m_EmblemColor = fields[6].GetUInt32(); m_EmblemColor = fields[6].GetUInt32();
m_BorderStyle = fields[7].GetUInt32(); m_BorderStyle = fields[7].GetUInt32();
m_BorderColor = fields[8].GetUInt32(); m_BorderColor = fields[8].GetUInt32();
//load team stats // load team stats
m_stats.rating = fields[9].GetUInt32(); m_stats.rating = fields[9].GetUInt32();
m_stats.games_week = fields[10].GetUInt32(); m_stats.games_week = fields[10].GetUInt32();
m_stats.wins_week = fields[11].GetUInt32(); m_stats.wins_week = fields[11].GetUInt32();
@ -230,20 +230,20 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult* arenaTeamMembersResult)
do do
{ {
Field* fields = arenaTeamMembersResult->Fetch(); Field* fields = arenaTeamMembersResult->Fetch();
//prevent crash if db records are broken, when all members in result are already processed and current team hasn't got any members // prevent crash if db records are broken, when all members in result are already processed and current team hasn't got any members
if (!fields) if (!fields)
break; break;
uint32 arenaTeamId = fields[0].GetUInt32(); uint32 arenaTeamId = fields[0].GetUInt32();
if (arenaTeamId < m_TeamId) if (arenaTeamId < m_TeamId)
{ {
//there is in table arena_team_member record which doesn't have arenateamid in arena_team table, report error // there is in table arena_team_member record which doesn't have arenateamid in arena_team table, report error
sLog.outErrorDb("ArenaTeam %u does not exist but it has record in arena_team_member table, deleting it!", arenaTeamId); sLog.outErrorDb("ArenaTeam %u does not exist but it has record in arena_team_member table, deleting it!", arenaTeamId);
CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u'", arenaTeamId); CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u'", arenaTeamId);
continue; continue;
} }
if (arenaTeamId > m_TeamId) if (arenaTeamId > m_TeamId)
//we loaded all members for this arena_team already, break cycle // we loaded all members for this arena_team already, break cycle
break; break;
ArenaTeamMember newmember; ArenaTeamMember newmember;
@ -256,7 +256,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult* arenaTeamMembersResult)
newmember.name = fields[7].GetCppString(); newmember.name = fields[7].GetCppString();
newmember.Class = fields[8].GetUInt8(); newmember.Class = fields[8].GetUInt8();
//check if member exists in characters table // check if member exists in characters table
if (newmember.name.empty()) if (newmember.name.empty())
{ {
sLog.outErrorDb("ArenaTeam %u has member with empty name - probably player %s doesn't exist, deleting him from memberlist!", arenaTeamId, newmember.guid.GetString().c_str()); sLog.outErrorDb("ArenaTeam %u has member with empty name - probably player %s doesn't exist, deleting him from memberlist!", arenaTeamId, newmember.guid.GetString().c_str());
@ -735,7 +735,7 @@ void ArenaTeam::UpdateArenaPointsHelper(std::map<uint32, uint32>& PlayerPoints)
std::map<uint32, uint32>::iterator plr_itr = PlayerPoints.find(itr->guid.GetCounter()); std::map<uint32, uint32>::iterator plr_itr = PlayerPoints.find(itr->guid.GetCounter());
if (plr_itr != PlayerPoints.end()) if (plr_itr != PlayerPoints.end())
{ {
//check if there is already more points // check if there is already more points
if (plr_itr->second < points_to_add) if (plr_itr->second < points_to_add)
PlayerPoints[itr->guid.GetCounter()] = points_to_add; PlayerPoints[itr->guid.GetCounter()] = points_to_add;
} }

View file

@ -294,10 +294,10 @@ void AuctionBotConfig::setConfig(AuctionBotConfigBoolValues index, char const* f
setConfig(index, m_AhBotCfg.GetBoolDefault(fieldname, defvalue)); setConfig(index, m_AhBotCfg.GetBoolDefault(fieldname, defvalue));
} }
//Get AuctionHousebot configuration file // Get AuctionHousebot configuration file
void AuctionBotConfig::GetConfigFromFile() void AuctionBotConfig::GetConfigFromFile()
{ {
//Check config file version // Check config file version
if (m_AhBotCfg.GetIntDefault("ConfVersion", 0) != AUCTIONHOUSEBOT_CONF_VERSION) if (m_AhBotCfg.GetIntDefault("ConfVersion", 0) != AUCTIONHOUSEBOT_CONF_VERSION)
sLog.outError("AHBot: Configuration file version doesn't match expected version. Some config variables may be wrong or missing."); sLog.outError("AHBot: Configuration file version doesn't match expected version. Some config variables may be wrong or missing.");
@ -476,7 +476,7 @@ bool AuctionBotBuyer::Initialize()
if (!active_house) if (!active_house)
return false; return false;
//load Check interval // load Check interval
m_CheckInterval = sAuctionBotConfig.getConfig(CONFIG_UINT32_AHBOT_BUYER_RECHECK_INTERVAL) * MINUTE; m_CheckInterval = sAuctionBotConfig.getConfig(CONFIG_UINT32_AHBOT_BUYER_RECHECK_INTERVAL) * MINUTE;
DETAIL_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot buyer interval between 2 check = %u", m_CheckInterval); DETAIL_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot buyer interval between 2 check = %u", m_CheckInterval);
sLog.SetLogFilter(LOG_FILTER_AHBOT_BUYER, !sAuctionBotConfig.getConfig(CONFIG_BOOL_AHBOT_DEBUG_BUYER)); sLog.SetLogFilter(LOG_FILTER_AHBOT_BUYER, !sAuctionBotConfig.getConfig(CONFIG_BOOL_AHBOT_DEBUG_BUYER));
@ -1387,7 +1387,7 @@ void AuctionBotSeller::LoadSellerValues(AHB_Seller_Config& config)
config.SetPriceRatioPerQuality(AUCTION_QUALITY_ORANGE, PriceRatio); config.SetPriceRatioPerQuality(AUCTION_QUALITY_ORANGE, PriceRatio);
config.SetPriceRatioPerQuality(AUCTION_QUALITY_YELLOW, PriceRatio); config.SetPriceRatioPerQuality(AUCTION_QUALITY_YELLOW, PriceRatio);
//load min and max auction times // load min and max auction times
config.SetMinTime(sAuctionBotConfig.getConfig(CONFIG_UINT32_AHBOT_MINTIME)); config.SetMinTime(sAuctionBotConfig.getConfig(CONFIG_UINT32_AHBOT_MINTIME));
config.SetMaxTime(sAuctionBotConfig.getConfig(CONFIG_UINT32_AHBOT_MAXTIME)); config.SetMaxTime(sAuctionBotConfig.getConfig(CONFIG_UINT32_AHBOT_MAXTIME));

View file

@ -461,7 +461,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket& recv_data)
uint32 auctionId; uint32 auctionId;
recv_data >> auctioneerGuid; recv_data >> auctioneerGuid;
recv_data >> auctionId; recv_data >> auctionId;
//DEBUG_LOG("Cancel AUCTION AuctionID: %u", auctionId); // DEBUG_LOG("Cancel AUCTION AuctionID: %u", auctionId);
AuctionHouseEntry const* auctionHouseEntry = GetCheckedAuctionHouseForAuctioneer(auctioneerGuid); AuctionHouseEntry const* auctionHouseEntry = GetCheckedAuctionHouseForAuctioneer(auctioneerGuid);
if (!auctionHouseEntry) if (!auctionHouseEntry)
@ -672,7 +672,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket& recv_data)
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH); GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
//DEBUG_LOG("Auctionhouse search %s list from: %u, searchedname: %s, levelmin: %u, levelmax: %u, auctionSlotID: %u, auctionMainCategory: %u, auctionSubCategory: %u, quality: %u, usable: %u", // DEBUG_LOG("Auctionhouse search %s list from: %u, searchedname: %s, levelmin: %u, levelmax: %u, auctionSlotID: %u, auctionMainCategory: %u, auctionSubCategory: %u, quality: %u, usable: %u",
// auctioneerGuid.GetString().c_str(), listfrom, searchedname.c_str(), levelmin, levelmax, auctionSlotID, auctionMainCategory, auctionSubCategory, quality, usable); // auctioneerGuid.GetString().c_str(), listfrom, searchedname.c_str(), levelmin, levelmax, auctionSlotID, auctionMainCategory, auctionSubCategory, quality, usable);
WorldPacket data(SMSG_AUCTION_LIST_RESULT, (4 + 4 + 4)); WorldPacket data(SMSG_AUCTION_LIST_RESULT, (4 + 4 + 4));

View file

@ -418,7 +418,7 @@ void AuctionHouseMgr::LoadAuctions()
auction->itemCount = pItem->GetCount(); auction->itemCount = pItem->GetCount();
auction->itemRandomPropertyId = pItem->GetItemRandomPropertyId(); auction->itemRandomPropertyId = pItem->GetItemRandomPropertyId();
//No SQL injection (no strings) // No SQL injection (no strings)
CharacterDatabase.PExecute("UPDATE auction SET item_template = %u, item_count = %u, item_randompropertyid = %i WHERE itemguid = %u", CharacterDatabase.PExecute("UPDATE auction SET item_template = %u, item_count = %u, item_randompropertyid = %i WHERE itemguid = %u",
auction->itemTemplate, auction->itemCount, auction->itemRandomPropertyId, auction->itemGuidLow); auction->itemTemplate, auction->itemCount, auction->itemRandomPropertyId, auction->itemGuidLow);
} }
@ -443,7 +443,7 @@ void AuctionHouseMgr::LoadAuctions()
auction->itemGuidLow = 0; auction->itemGuidLow = 0;
// item will deleted or added to received mail list // item will deleted or added to received mail list
MailDraft(msgAuctionCanceledOwner.str(), "") // TODO: fix body MailDraft(msgAuctionCanceledOwner.str(), "")// TODO: fix body
.AddItem(pItem) .AddItem(pItem)
.SendMailTo(MailReceiver(ObjectGuid(HIGHGUID_PLAYER, auction->owner)), auction, MAIL_CHECK_MASK_COPIED); .SendMailTo(MailReceiver(ObjectGuid(HIGHGUID_PLAYER, auction->owner)), auction, MAIL_CHECK_MASK_COPIED);
} }
@ -971,13 +971,13 @@ uint32 AuctionEntry::GetAuctionOutBid() const
void AuctionEntry::DeleteFromDB() const void AuctionEntry::DeleteFromDB() const
{ {
//No SQL injection (Id is integer) // No SQL injection (Id is integer)
CharacterDatabase.PExecute("DELETE FROM auction WHERE id = '%u'", Id); CharacterDatabase.PExecute("DELETE FROM auction WHERE id = '%u'", Id);
} }
void AuctionEntry::SaveToDB() const void AuctionEntry::SaveToDB() const
{ {
//No SQL injection (no strings) // No SQL injection (no strings)
CharacterDatabase.PExecute("INSERT INTO auction (id,houseid,itemguid,item_template,item_count,item_randompropertyid,itemowner,buyoutprice,time,moneyTime,buyguid,lastbid,startbid,deposit) " CharacterDatabase.PExecute("INSERT INTO auction (id,houseid,itemguid,item_template,item_count,item_randompropertyid,itemowner,buyoutprice,time,moneyTime,buyguid,lastbid,startbid,deposit) "
"VALUES ('%u', '%u', '%u', '%u', '%u', '%i', '%u', '%u', '" UI64FMTD "', '" UI64FMTD "', '%u', '%u', '%u', '%u')", "VALUES ('%u', '%u', '%u', '%u', '%u', '%i', '%u', '%u', '" UI64FMTD "', '" UI64FMTD "', '%u', '%u', '%u', '%u')",
Id, auctionHouseEntry->houseId, itemGuidLow, itemTemplate, itemCount, itemRandomPropertyId, owner, buyout, (uint64)expireTime, (uint64)moneyDeliveryTime, bidder, bid, startbid, deposit); Id, auctionHouseEntry->houseId, itemGuidLow, itemTemplate, itemCount, itemRandomPropertyId, owner, buyout, (uint64)expireTime, (uint64)moneyDeliveryTime, bidder, bid, startbid, deposit);

View file

@ -87,7 +87,7 @@ struct AuctionEntry
bool UpdateBid(uint32 newbid, Player* newbidder = NULL);// true if normal bid, false if buyout, bidder==NULL for generated bid bool UpdateBid(uint32 newbid, Player* newbidder = NULL);// true if normal bid, false if buyout, bidder==NULL for generated bid
}; };
//this class is used as auctionhouse instance // this class is used as auctionhouse instance
class AuctionHouseObject class AuctionHouseObject
{ {
public: public:
@ -176,7 +176,7 @@ class AuctionHouseMgr
return NULL; return NULL;
} }
//auction messages // auction messages
void SendAuctionWonMail(AuctionEntry* auction); void SendAuctionWonMail(AuctionEntry* auction);
void SendAuctionSuccessfulMail(AuctionEntry* auction); void SendAuctionSuccessfulMail(AuctionEntry* auction);
void SendAuctionExpiredMail(AuctionEntry* auction); void SendAuctionExpiredMail(AuctionEntry* auction);
@ -186,7 +186,7 @@ class AuctionHouseMgr
static AuctionHouseEntry const* GetAuctionHouseEntry(Unit* unit); static AuctionHouseEntry const* GetAuctionHouseEntry(Unit* unit);
public: public:
//load first auction items, because of check if item exists, when loading // load first auction items, because of check if item exists, when loading
void LoadAuctionItems(); void LoadAuctionItems();
void LoadAuctions(); void LoadAuctions();

View file

@ -109,7 +109,7 @@ namespace MaNGOS
private: private:
void do_helper(WorldPacket& data, char const* text) void do_helper(WorldPacket& data, char const* text)
{ {
//copyied from BuildMonsterChat // copyied from BuildMonsterChat
data << uint8(CHAT_MSG_MONSTER_YELL); data << uint8(CHAT_MSG_MONSTER_YELL);
data << uint32(i_language); data << uint32(i_language);
data << ObjectGuid(i_source->GetObjectGuid()); data << ObjectGuid(i_source->GetObjectGuid());
@ -176,7 +176,7 @@ namespace MaNGOS
char str [2048]; char str [2048];
snprintf(str, 2048, text, arg1str, arg2str); snprintf(str, 2048, text, arg1str, arg2str);
//copyied from BuildMonsterChat // copyied from BuildMonsterChat
data << uint8(CHAT_MSG_MONSTER_YELL); data << uint8(CHAT_MSG_MONSTER_YELL);
data << uint32(i_language); data << uint32(i_language);
data << ObjectGuid(i_source->GetObjectGuid()); data << ObjectGuid(i_source->GetObjectGuid());
@ -269,7 +269,7 @@ BattleGround::BattleGround()
m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_1M; m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_1M;
m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_30S; m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_30S;
m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE; m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE;
//we must set to some default existing values // we must set to some default existing values
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = 0; m_StartMessageIds[BG_STARTING_EVENT_FIRST] = 0;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_WS_START_ONE_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_WS_START_ONE_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_WS_START_HALF_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_WS_START_HALF_MINUTE;
@ -334,7 +334,7 @@ void BattleGround::Update(uint32 diff)
{ {
RemovePlayerAtLeave(itr->first, true, true);// remove player from BG RemovePlayerAtLeave(itr->first, true, true);// remove player from BG
m_OfflineQueue.pop_front(); // remove from offline queue m_OfflineQueue.pop_front(); // remove from offline queue
//do not use itr for anything, because it is erased in RemovePlayerAtLeave() // do not use itr for anything, because it is erased in RemovePlayerAtLeave()
} }
} }
} }
@ -374,7 +374,7 @@ void BattleGround::Update(uint32 diff)
} }
else else
{ {
//announce every 15 seconds // announce every 15 seconds
if (newtime / (15 * IN_MILLISECONDS) != m_PrematureCountDownTimer / (15 * IN_MILLISECONDS)) if (newtime / (15 * IN_MILLISECONDS) != m_PrematureCountDownTimer / (15 * IN_MILLISECONDS))
PSendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING_SECS, CHAT_MSG_SYSTEM, NULL, (uint32)(m_PrematureCountDownTimer / IN_MILLISECONDS)); PSendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING_SECS, CHAT_MSG_SYSTEM, NULL, (uint32)(m_PrematureCountDownTimer / IN_MILLISECONDS));
} }
@ -419,7 +419,7 @@ void BattleGround::Update(uint32 diff)
StartingEventCloseDoors(); StartingEventCloseDoors();
SetStartDelayTime(m_StartDelayTimes[BG_STARTING_EVENT_FIRST]); SetStartDelayTime(m_StartDelayTimes[BG_STARTING_EVENT_FIRST]);
//first start warning - 2 or 1 minute, only if defined // first start warning - 2 or 1 minute, only if defined
if (m_StartMessageIds[BG_STARTING_EVENT_FIRST]) if (m_StartMessageIds[BG_STARTING_EVENT_FIRST])
SendMessageToAll(m_StartMessageIds[BG_STARTING_EVENT_FIRST], CHAT_MSG_BG_SYSTEM_NEUTRAL); SendMessageToAll(m_StartMessageIds[BG_STARTING_EVENT_FIRST], CHAT_MSG_BG_SYSTEM_NEUTRAL);
} }
@ -465,7 +465,7 @@ void BattleGround::Update(uint32 diff)
for (BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) for (BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
if (Player* plr = sObjectMgr.GetPlayer(itr->first)) if (Player* plr = sObjectMgr.GetPlayer(itr->first))
plr->RemoveAurasDueToSpell(SPELL_PREPARATION); plr->RemoveAurasDueToSpell(SPELL_PREPARATION);
//Announce BG starting // Announce BG starting
if (sWorld.getConfig(CONFIG_BOOL_BATTLEGROUND_QUEUE_ANNOUNCER_START)) if (sWorld.getConfig(CONFIG_BOOL_BATTLEGROUND_QUEUE_ANNOUNCER_START))
{ {
sWorld.SendWorldText(LANG_BG_STARTED_ANNOUNCE_WORLD, GetName(), GetMinLevel(), GetMaxLevel()); sWorld.SendWorldText(LANG_BG_STARTED_ANNOUNCE_WORLD, GetName(), GetMinLevel(), GetMaxLevel());
@ -490,14 +490,14 @@ void BattleGround::Update(uint32 diff)
{ {
next = itr; next = itr;
++next; ++next;
//itr is erased here! // itr is erased here!
RemovePlayerAtLeave(itr->first, true, true);// remove player from BG RemovePlayerAtLeave(itr->first, true, true);// remove player from BG
// do not change any battleground's private variables // do not change any battleground's private variables
} }
} }
} }
//update start time // update start time
m_StartTime += diff; m_StartTime += diff;
} }
@ -698,7 +698,7 @@ void BattleGround::EndBattleGround(Team winner)
SetWinner(winner); SetWinner(winner);
SetStatus(STATUS_WAIT_LEAVE); SetStatus(STATUS_WAIT_LEAVE);
//we must set it this way, because end time is sent in packet! // we must set it this way, because end time is sent in packet!
m_EndTime = TIME_TO_AUTOREMOVE; m_EndTime = TIME_TO_AUTOREMOVE;
// arena rating calculation // arena rating calculation
@ -729,7 +729,7 @@ void BattleGround::EndBattleGround(Team winner)
if (itr->second.OfflineRemoveTime) if (itr->second.OfflineRemoveTime)
{ {
//if rated arena match - make member lost! // if rated arena match - make member lost!
if (isArena() && isRated() && winner_arena_team && loser_arena_team) if (isArena() && isRated() && winner_arena_team && loser_arena_team)
{ {
if (team == winner) if (team == winner)
@ -758,13 +758,13 @@ void BattleGround::EndBattleGround(Team winner)
} }
else else
{ {
//needed cause else in av some creatures will kill the players at the end // needed cause else in av some creatures will kill the players at the end
plr->CombatStop(); plr->CombatStop();
plr->getHostileRefManager().deleteReferences(); plr->getHostileRefManager().deleteReferences();
} }
//this line is obsolete - team is set ALWAYS // this line is obsolete - team is set ALWAYS
//if(!team) team = plr->GetTeam(); // if(!team) team = plr->GetTeam();
// per player calculation // per player calculation
if (isArena() && isRated() && winner_arena_team && loser_arena_team) if (isArena() && isRated() && winner_arena_team && loser_arena_team)
@ -818,8 +818,8 @@ void BattleGround::EndBattleGround(Team winner)
if (isArena() && isRated() && winner_arena_team && loser_arena_team) if (isArena() && isRated() && winner_arena_team && loser_arena_team)
{ {
// update arena points only after increasing the player's match count! // update arena points only after increasing the player's match count!
//obsolete: winner_arena_team->UpdateArenaPointsHelper(); // obsolete: winner_arena_team->UpdateArenaPointsHelper();
//obsolete: loser_arena_team->UpdateArenaPointsHelper(); // obsolete: loser_arena_team->UpdateArenaPointsHelper();
// save the stat changes // save the stat changes
winner_arena_team->SaveToDB(); winner_arena_team->SaveToDB();
loser_arena_team->SaveToDB(); loser_arena_team->SaveToDB();
@ -835,7 +835,7 @@ void BattleGround::EndBattleGround(Team winner)
uint32 BattleGround::GetBonusHonorFromKill(uint32 kills) const uint32 BattleGround::GetBonusHonorFromKill(uint32 kills) const
{ {
//variable kills means how many honorable kills you scored (so we need kills * honor_for_one_kill) // variable kills means how many honorable kills you scored (so we need kills * honor_for_one_kill)
return (uint32)MaNGOS::Honor::hk_honor_at_level(GetMaxLevel(), kills); return (uint32)MaNGOS::Honor::hk_honor_at_level(GetMaxLevel(), kills);
} }
@ -1046,7 +1046,7 @@ void BattleGround::RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool Sen
if (isRated() && GetStatus() == STATUS_IN_PROGRESS) if (isRated() && GetStatus() == STATUS_IN_PROGRESS)
{ {
//left a rated match while the encounter was in progress, consider as loser // left a rated match while the encounter was in progress, consider as loser
ArenaTeam* winner_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team))); ArenaTeam* winner_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
ArenaTeam* loser_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(team)); ArenaTeam* loser_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(team));
if (winner_arena_team && loser_arena_team) if (winner_arena_team && loser_arena_team)
@ -1068,7 +1068,7 @@ void BattleGround::RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool Sen
{ {
if (isRated() && GetStatus() == STATUS_IN_PROGRESS) if (isRated() && GetStatus() == STATUS_IN_PROGRESS)
{ {
//left a rated match while the encounter was in progress, consider as loser // left a rated match while the encounter was in progress, consider as loser
ArenaTeam* others_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team))); ArenaTeam* others_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
ArenaTeam* players_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(team)); ArenaTeam* players_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(team));
if (others_arena_team && players_arena_team) if (others_arena_team && players_arena_team)
@ -1086,7 +1086,7 @@ void BattleGround::RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool Sen
} }
} }
DecreaseInvitedCount(team); DecreaseInvitedCount(team);
//we should update battleground queue, but only if bg isn't ending // we should update battleground queue, but only if bg isn't ending
if (isBattleGround() && GetStatus() < STATUS_WAIT_LEAVE) if (isBattleGround() && GetStatus() < STATUS_WAIT_LEAVE)
{ {
// a player has left the battleground, so there are free slots -> add to queue // a player has left the battleground, so there are free slots -> add to queue
@ -1113,7 +1113,7 @@ void BattleGround::RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool Sen
DETAIL_LOG("BATTLEGROUND: Removed player %s from BattleGround.", plr->GetName()); DETAIL_LOG("BATTLEGROUND: Removed player %s from BattleGround.", plr->GetName());
} }
//battleground object will be deleted next BattleGround::Update() call // battleground object will be deleted next BattleGround::Update() call
} }
// this method is called when no players remains in battleground // this method is called when no players remains in battleground
@ -1334,7 +1334,7 @@ void BattleGround::RemoveFromBGFreeSlotQueue()
// returns the number how many players can join battleground to MaxPlayersPerTeam // returns the number how many players can join battleground to MaxPlayersPerTeam
uint32 BattleGround::GetFreeSlotsForTeam(Team team) const uint32 BattleGround::GetFreeSlotsForTeam(Team team) const
{ {
//return free slot count to MaxPlayerPerTeam // return free slot count to MaxPlayerPerTeam
if (GetStatus() == STATUS_WAIT_JOIN || GetStatus() == STATUS_IN_PROGRESS) if (GetStatus() == STATUS_WAIT_JOIN || GetStatus() == STATUS_IN_PROGRESS)
return (GetInvitedCount(team) < GetMaxPlayersPerTeam()) ? GetMaxPlayersPerTeam() - GetInvitedCount(team) : 0; return (GetInvitedCount(team) < GetMaxPlayersPerTeam()) ? GetMaxPlayersPerTeam() - GetInvitedCount(team) : 0;
@ -1348,7 +1348,7 @@ bool BattleGround::HasFreeSlots() const
void BattleGround::UpdatePlayerScore(Player* Source, uint32 type, uint32 value) void BattleGround::UpdatePlayerScore(Player* Source, uint32 type, uint32 value)
{ {
//this procedure is called from virtual function implemented in bg subclass // this procedure is called from virtual function implemented in bg subclass
BattleGroundScoreMap::const_iterator itr = m_PlayerScores.find(Source->GetObjectGuid()); BattleGroundScoreMap::const_iterator itr = m_PlayerScores.find(Source->GetObjectGuid());
if (itr == m_PlayerScores.end()) // player not found... if (itr == m_PlayerScores.end()) // player not found...
@ -1374,7 +1374,7 @@ void BattleGround::UpdatePlayerScore(Player* Source, uint32 type, uint32 value)
itr->second->BonusHonor += value; itr->second->BonusHonor += value;
} }
break; break;
//used only in EY, but in MSG_PVP_LOG_DATA opcode // used only in EY, but in MSG_PVP_LOG_DATA opcode
case SCORE_DAMAGE_DONE: // Damage Done case SCORE_DAMAGE_DONE: // Damage Done
itr->second->DamageDone += value; itr->second->DamageDone += value;
break; break;
@ -1429,17 +1429,17 @@ bool BattleGround::AddObject(uint32 type, uint32 entry, float x, float y, float
return true; return true;
} }
//some doors aren't despawned so we cannot handle their closing in gameobject::update() // some doors aren't despawned so we cannot handle their closing in gameobject::update()
//it would be nice to correctly implement GO_ACTIVATED state and open/close doors in gameobject code // it would be nice to correctly implement GO_ACTIVATED state and open/close doors in gameobject code
void BattleGround::DoorClose(ObjectGuid guid) void BattleGround::DoorClose(ObjectGuid guid)
{ {
GameObject* obj = GetBgMap()->GetGameObject(guid); GameObject* obj = GetBgMap()->GetGameObject(guid);
if (obj) if (obj)
{ {
//if doors are open, close it // if doors are open, close it
if (obj->getLootState() == GO_ACTIVATED && obj->GetGoState() != GO_STATE_READY) if (obj->getLootState() == GO_ACTIVATED && obj->GetGoState() != GO_STATE_READY)
{ {
//change state to allow door to be closed // change state to allow door to be closed
obj->SetLootState(GO_READY); obj->SetLootState(GO_READY);
obj->UseDoorOrButton(RESPAWN_ONE_DAY); obj->UseDoorOrButton(RESPAWN_ONE_DAY);
} }
@ -1453,7 +1453,7 @@ void BattleGround::DoorOpen(ObjectGuid guid)
GameObject* obj = GetBgMap()->GetGameObject(guid); GameObject* obj = GetBgMap()->GetGameObject(guid);
if (obj) if (obj)
{ {
//change state to be sure they will be opened // change state to be sure they will be opened
obj->SetLootState(GO_READY); obj->SetLootState(GO_READY);
obj->UseDoorOrButton(RESPAWN_ONE_DAY); obj->UseDoorOrButton(RESPAWN_ONE_DAY);
} }
@ -1562,7 +1562,7 @@ void BattleGround::SpawnBGObject(ObjectGuid guid, uint32 respawntime)
return; return;
if (respawntime == 0) if (respawntime == 0)
{ {
//we need to change state from GO_JUST_DEACTIVATED to GO_READY in case battleground is starting again // we need to change state from GO_JUST_DEACTIVATED to GO_READY in case battleground is starting again
if (obj->getLootState() == GO_JUST_DEACTIVATED) if (obj->getLootState() == GO_JUST_DEACTIVATED)
obj->SetLootState(GO_READY); obj->SetLootState(GO_READY);
obj->SetRespawnTime(0); obj->SetRespawnTime(0);
@ -1699,14 +1699,14 @@ void BattleGround::HandleTriggerBuff(ObjectGuid go_guid)
return; return;
} }
//randomly select new buff // randomly select new buff
uint8 buff = urand(0, 2); uint8 buff = urand(0, 2);
uint32 entry = obj->GetEntry(); uint32 entry = obj->GetEntry();
if (m_BuffChange && entry != Buff_Entries[buff]) if (m_BuffChange && entry != Buff_Entries[buff])
{ {
//despawn current buff // despawn current buff
SpawnBGObject(m_BgObjects[index], RESPAWN_ONE_DAY); SpawnBGObject(m_BgObjects[index], RESPAWN_ONE_DAY);
//set index for new one // set index for new one
for (uint8 currBuffTypeIndex = 0; currBuffTypeIndex < 3; ++currBuffTypeIndex) for (uint8 currBuffTypeIndex = 0; currBuffTypeIndex < 3; ++currBuffTypeIndex)
{ {
if (entry == Buff_Entries[currBuffTypeIndex]) if (entry == Buff_Entries[currBuffTypeIndex])

View file

@ -178,16 +178,16 @@ enum ScoreType
SCORE_DEATHS = 2, SCORE_DEATHS = 2,
SCORE_HONORABLE_KILLS = 3, SCORE_HONORABLE_KILLS = 3,
SCORE_BONUS_HONOR = 4, SCORE_BONUS_HONOR = 4,
//EY, but in MSG_PVP_LOG_DATA opcode! // EY, but in MSG_PVP_LOG_DATA opcode!
SCORE_DAMAGE_DONE = 5, SCORE_DAMAGE_DONE = 5,
SCORE_HEALING_DONE = 6, SCORE_HEALING_DONE = 6,
//WS // WS
SCORE_FLAG_CAPTURES = 7, SCORE_FLAG_CAPTURES = 7,
SCORE_FLAG_RETURNS = 8, SCORE_FLAG_RETURNS = 8,
//AB // AB
SCORE_BASES_ASSAULTED = 9, SCORE_BASES_ASSAULTED = 9,
SCORE_BASES_DEFENDED = 10, SCORE_BASES_DEFENDED = 10,
//AV // AV
SCORE_GRAVEYARDS_ASSAULTED = 11, SCORE_GRAVEYARDS_ASSAULTED = 11,
SCORE_GRAVEYARDS_DEFENDED = 12, SCORE_GRAVEYARDS_DEFENDED = 12,
SCORE_TOWERS_ASSAULTED = 13, SCORE_TOWERS_ASSAULTED = 13,
@ -254,7 +254,7 @@ class BattleGroundScore
BattleGroundScore() : KillingBlows(0), Deaths(0), HonorableKills(0), BattleGroundScore() : KillingBlows(0), Deaths(0), HonorableKills(0),
BonusHonor(0), DamageDone(0), HealingDone(0) BonusHonor(0), DamageDone(0), HealingDone(0)
{} {}
virtual ~BattleGroundScore() {} //virtual destructor is used when deleting score from scores map virtual ~BattleGroundScore() {} // virtual destructor is used when deleting score from scores map
uint32 KillingBlows; uint32 KillingBlows;
uint32 Deaths; uint32 Deaths;
@ -323,7 +323,7 @@ class BattleGround
// Set methods: // Set methods:
void SetName(char const* Name) { m_Name = Name; } void SetName(char const* Name) { m_Name = Name; }
void SetTypeID(BattleGroundTypeId TypeID) { m_TypeID = TypeID; } void SetTypeID(BattleGroundTypeId TypeID) { m_TypeID = TypeID; }
//here we can count minlevel and maxlevel for players // here we can count minlevel and maxlevel for players
void SetBracket(PvPDifficultyEntry const* bracketEntry); void SetBracket(PvPDifficultyEntry const* bracketEntry);
void SetStatus(BattleGroundStatus Status) { m_Status = Status; } void SetStatus(BattleGroundStatus Status) { m_Status = Status; }
void SetClientInstanceID(uint32 InstanceID) { m_ClientInstanceID = InstanceID; } void SetClientInstanceID(uint32 InstanceID) { m_ClientInstanceID = InstanceID; }
@ -343,8 +343,8 @@ class BattleGround
void SetMaxPlayersPerTeam(uint32 MaxPlayers) { m_MaxPlayersPerTeam = MaxPlayers; } void SetMaxPlayersPerTeam(uint32 MaxPlayers) { m_MaxPlayersPerTeam = MaxPlayers; }
void SetMinPlayersPerTeam(uint32 MinPlayers) { m_MinPlayersPerTeam = MinPlayers; } void SetMinPlayersPerTeam(uint32 MinPlayers) { m_MinPlayersPerTeam = MinPlayers; }
void AddToBGFreeSlotQueue(); //this queue will be useful when more battlegrounds instances will be available void AddToBGFreeSlotQueue(); // this queue will be useful when more battlegrounds instances will be available
void RemoveFromBGFreeSlotQueue(); //this method could delete whole BG instance, if another free is available void RemoveFromBGFreeSlotQueue(); // this method could delete whole BG instance, if another free is available
void DecreaseInvitedCount(Team team) { (team == ALLIANCE) ? --m_InvitedAlliance : --m_InvitedHorde; } void DecreaseInvitedCount(Team team) { (team == ALLIANCE) ? --m_InvitedAlliance : --m_InvitedHorde; }
void IncreaseInvitedCount(Team team) { (team == ALLIANCE) ? ++m_InvitedAlliance : ++m_InvitedHorde; } void IncreaseInvitedCount(Team team) { (team == ALLIANCE) ? ++m_InvitedAlliance : ++m_InvitedHorde; }
@ -535,7 +535,7 @@ class BattleGround
protected: protected:
//this method is called, when BG cannot spawn its own spirit guide, or something is wrong, It correctly ends BattleGround // this method is called, when BG cannot spawn its own spirit guide, or something is wrong, It correctly ends BattleGround
void EndNow(); void EndNow();
void PlayerAddedToBGCheckIfBGIsRunning(Player* plr); void PlayerAddedToBGCheckIfBGIsRunning(Player* plr);
@ -553,7 +553,7 @@ class BattleGround
*/ */
uint8 m_Events; uint8 m_Events;
BattleGroundStartTimeIntervals m_StartDelayTimes[BG_STARTING_EVENT_COUNT]; BattleGroundStartTimeIntervals m_StartDelayTimes[BG_STARTING_EVENT_COUNT];
//this must be filled in constructors! // this must be filled in constructors!
uint32 m_StartMessageIds[BG_STARTING_EVENT_COUNT]; uint32 m_StartMessageIds[BG_STARTING_EVENT_COUNT];
bool m_BuffChange; bool m_BuffChange;
@ -562,7 +562,7 @@ class BattleGround
/* Battleground */ /* Battleground */
BattleGroundTypeId m_TypeID; BattleGroundTypeId m_TypeID;
BattleGroundStatus m_Status; BattleGroundStatus m_Status;
uint32 m_ClientInstanceID; //the instance-id which is sent to the client and without any other internal use uint32 m_ClientInstanceID; // the instance-id which is sent to the client and without any other internal use
uint32 m_StartTime; uint32 m_StartTime;
bool m_ArenaBuffSpawned; // to cache if arenabuff event is started (cause bool is faster than checking IsActiveEvent) bool m_ArenaBuffSpawned; // to cache if arenabuff event is started (cause bool is faster than checking IsActiveEvent)
int32 m_EndTime; // it is set to 120000 when bg is ending and it decreases itself int32 m_EndTime; // it is set to 120000 when bg is ending and it decreases itself

View file

@ -28,7 +28,7 @@ BattleGroundAA::BattleGroundAA()
m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S; m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S; m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE; m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE;
//we must set messageIds // we must set messageIds
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS; m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS;
m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS; m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS;
@ -56,7 +56,7 @@ void BattleGroundAA::StartingEventOpenDoors()
void BattleGroundAA::AddPlayer(Player* plr) void BattleGroundAA::AddPlayer(Player* plr)
{ {
BattleGround::AddPlayer(plr); BattleGround::AddPlayer(plr);
//create score and add it to map, default values are set in constructor // create score and add it to map, default values are set in constructor
BattleGroundAAScore* sc = new BattleGroundAAScore; BattleGroundAAScore* sc = new BattleGroundAAScore;
m_PlayerScores[plr->GetObjectGuid()] = sc; m_PlayerScores[plr->GetObjectGuid()] = sc;

View file

@ -25,7 +25,7 @@ class BattleGroundAAScore : public BattleGroundScore
public: public:
BattleGroundAAScore() {}; BattleGroundAAScore() {};
virtual ~BattleGroundAAScore() {}; virtual ~BattleGroundAAScore() {};
//TODO fix me // TODO fix me
}; };
class BattleGroundAA : public BattleGround class BattleGroundAA : public BattleGround

View file

@ -170,7 +170,7 @@ void BattleGroundAB::StartingEventOpenDoors()
{ {
for (uint8 i = 0; i < BG_AB_NODES_MAX; ++i) for (uint8 i = 0; i < BG_AB_NODES_MAX; ++i)
{ {
//randomly select buff to spawn // randomly select buff to spawn
uint8 buff = urand(0, 2); uint8 buff = urand(0, 2);
SpawnBGObject(m_BgObjects[BG_AB_OBJECT_SPEEDBUFF_STABLES + buff + i * 3], RESPAWN_IMMEDIATELY); SpawnBGObject(m_BgObjects[BG_AB_OBJECT_SPEEDBUFF_STABLES + buff + i * 3], RESPAWN_IMMEDIATELY);
} }
@ -183,7 +183,7 @@ void BattleGroundAB::StartingEventOpenDoors()
void BattleGroundAB::AddPlayer(Player* plr) void BattleGroundAB::AddPlayer(Player* plr)
{ {
BattleGround::AddPlayer(plr); BattleGround::AddPlayer(plr);
//create score and add it to map, default values are set in the constructor // create score and add it to map, default values are set in the constructor
BattleGroundABScore* sc = new BattleGroundABScore; BattleGroundABScore* sc = new BattleGroundABScore;
m_PlayerScores[plr->GetObjectGuid()] = sc; m_PlayerScores[plr->GetObjectGuid()] = sc;
@ -217,10 +217,10 @@ void BattleGroundAB::HandleAreaTrigger(Player* source, uint32 trigger)
case 3870: // Black Smith case 3870: // Black Smith
case 4020: // Unk1 case 4020: // Unk1
case 4021: // Unk2 case 4021: // Unk2
//break; // break;
default: default:
//sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", trigger); // sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", trigger);
//source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", trigger); // source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", trigger);
break; break;
} }
} }
@ -443,7 +443,7 @@ void BattleGroundAB::EventPlayerClickedOnFlag(Player* source, GameObject* target
bool BattleGroundAB::SetupBattleGround() bool BattleGroundAB::SetupBattleGround()
{ {
//buffs // buffs
for (uint8 i = 0; i < BG_AB_NODES_MAX; ++i) for (uint8 i = 0; i < BG_AB_NODES_MAX; ++i)
{ {
if (!AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i, Buff_Entries[0], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, sin(BG_AB_BuffPositions[i][3] / 2), cos(BG_AB_BuffPositions[i][3] / 2), RESPAWN_ONE_DAY) if (!AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i, Buff_Entries[0], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, sin(BG_AB_BuffPositions[i][3] / 2), cos(BG_AB_BuffPositions[i][3] / 2), RESPAWN_ONE_DAY)
@ -458,7 +458,7 @@ bool BattleGroundAB::SetupBattleGround()
void BattleGroundAB::Reset() void BattleGroundAB::Reset()
{ {
//call parent's class reset // call parent's class reset
BattleGround::Reset(); BattleGround::Reset();
for (uint8 i = 0; i < BG_TEAMS_COUNT; ++i) for (uint8 i = 0; i < BG_TEAMS_COUNT; ++i)
@ -490,12 +490,12 @@ void BattleGroundAB::Reset()
void BattleGroundAB::EndBattleGround(Team winner) void BattleGroundAB::EndBattleGround(Team winner)
{ {
//win reward // win reward
if (winner == ALLIANCE) if (winner == ALLIANCE)
RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE); RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE);
if (winner == HORDE) if (winner == HORDE)
RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE); RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE);
//complete map_end rewards (even if no team wins) // complete map_end rewards (even if no team wins)
RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE); RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE);
RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE); RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE);

View file

@ -30,32 +30,32 @@ enum BG_AB_WorldStates
BG_AB_OP_RESOURCES_MAX = 1780, BG_AB_OP_RESOURCES_MAX = 1780,
BG_AB_OP_RESOURCES_WARNING = 1955 BG_AB_OP_RESOURCES_WARNING = 1955
/* /*
BG_AB_OP_STABLE_ICON = 1842, //Stable map icon (NONE) BG_AB_OP_STABLE_ICON = 1842, // Stable map icon (NONE)
BG_AB_OP_STABLE_STATE_ALIENCE = 1767, //Stable map state (ALIENCE) BG_AB_OP_STABLE_STATE_ALIENCE = 1767, // Stable map state (ALIENCE)
BG_AB_OP_STABLE_STATE_HORDE = 1768, //Stable map state (HORDE) BG_AB_OP_STABLE_STATE_HORDE = 1768, // Stable map state (HORDE)
BG_AB_OP_STABLE_STATE_CON_ALI = 1769, //Stable map state (CON ALIENCE) BG_AB_OP_STABLE_STATE_CON_ALI = 1769, // Stable map state (CON ALIENCE)
BG_AB_OP_STABLE_STATE_CON_HOR = 1770, //Stable map state (CON HORDE) BG_AB_OP_STABLE_STATE_CON_HOR = 1770, // Stable map state (CON HORDE)
BG_AB_OP_FARM_ICON = 1845, //Farm map icon (NONE) BG_AB_OP_FARM_ICON = 1845, // Farm map icon (NONE)
BG_AB_OP_FARM_STATE_ALIENCE = 1772, //Farm state (ALIENCE) BG_AB_OP_FARM_STATE_ALIENCE = 1772, // Farm state (ALIENCE)
BG_AB_OP_FARM_STATE_HORDE = 1773, //Farm state (HORDE) BG_AB_OP_FARM_STATE_HORDE = 1773, // Farm state (HORDE)
BG_AB_OP_FARM_STATE_CON_ALI = 1774, //Farm state (CON ALIENCE) BG_AB_OP_FARM_STATE_CON_ALI = 1774, // Farm state (CON ALIENCE)
BG_AB_OP_FARM_STATE_CON_HOR = 1775, //Farm state (CON HORDE) BG_AB_OP_FARM_STATE_CON_HOR = 1775, // Farm state (CON HORDE)
BG_AB_OP_BLACKSMITH_ICON = 1846, //Blacksmith map icon (NONE) BG_AB_OP_BLACKSMITH_ICON = 1846, // Blacksmith map icon (NONE)
BG_AB_OP_BLACKSMITH_STATE_ALIENCE = 1782, //Blacksmith map state (ALIENCE) BG_AB_OP_BLACKSMITH_STATE_ALIENCE = 1782, // Blacksmith map state (ALIENCE)
BG_AB_OP_BLACKSMITH_STATE_HORDE = 1783, //Blacksmith map state (HORDE) BG_AB_OP_BLACKSMITH_STATE_HORDE = 1783, // Blacksmith map state (HORDE)
BG_AB_OP_BLACKSMITH_STATE_CON_ALI = 1784, //Blacksmith map state (CON ALIENCE) BG_AB_OP_BLACKSMITH_STATE_CON_ALI = 1784, // Blacksmith map state (CON ALIENCE)
BG_AB_OP_BLACKSMITH_STATE_CON_HOR = 1785, //Blacksmith map state (CON HORDE) BG_AB_OP_BLACKSMITH_STATE_CON_HOR = 1785, // Blacksmith map state (CON HORDE)
BG_AB_OP_LUMBERMILL_ICON = 1844, //Lumber Mill map icon (NONE) BG_AB_OP_LUMBERMILL_ICON = 1844, // Lumber Mill map icon (NONE)
BG_AB_OP_LUMBERMILL_STATE_ALIENCE = 1792, //Lumber Mill map state (ALIENCE) BG_AB_OP_LUMBERMILL_STATE_ALIENCE = 1792, // Lumber Mill map state (ALIENCE)
BG_AB_OP_LUMBERMILL_STATE_HORDE = 1793, //Lumber Mill map state (HORDE) BG_AB_OP_LUMBERMILL_STATE_HORDE = 1793, // Lumber Mill map state (HORDE)
BG_AB_OP_LUMBERMILL_STATE_CON_ALI = 1794, //Lumber Mill map state (CON ALIENCE) BG_AB_OP_LUMBERMILL_STATE_CON_ALI = 1794, // Lumber Mill map state (CON ALIENCE)
BG_AB_OP_LUMBERMILL_STATE_CON_HOR = 1795, //Lumber Mill map state (CON HORDE) BG_AB_OP_LUMBERMILL_STATE_CON_HOR = 1795, // Lumber Mill map state (CON HORDE)
BG_AB_OP_GOLDMINE_ICON = 1843, //Gold Mine map icon (NONE) BG_AB_OP_GOLDMINE_ICON = 1843, // Gold Mine map icon (NONE)
BG_AB_OP_GOLDMINE_STATE_ALIENCE = 1787, //Gold Mine map state (ALIENCE) BG_AB_OP_GOLDMINE_STATE_ALIENCE = 1787, // Gold Mine map state (ALIENCE)
BG_AB_OP_GOLDMINE_STATE_HORDE = 1788, //Gold Mine map state (HORDE) BG_AB_OP_GOLDMINE_STATE_HORDE = 1788, // Gold Mine map state (HORDE)
BG_AB_OP_GOLDMINE_STATE_CON_ALI = 1789, //Gold Mine map state (CON ALIENCE BG_AB_OP_GOLDMINE_STATE_CON_ALI = 1789, // Gold Mine map state (CON ALIENCE
BG_AB_OP_GOLDMINE_STATE_CON_HOR = 1790, //Gold Mine map state (CON HORDE) BG_AB_OP_GOLDMINE_STATE_CON_HOR = 1790, // Gold Mine map state (CON HORDE)
*/ */
}; };
@ -66,7 +66,7 @@ const uint32 BG_AB_OP_NODEICONS[5] = {1842, 1846, 1845, 1844, 1843};
enum BG_AB_ObjectType enum BG_AB_ObjectType
{ {
// TODO drop them (pool-system should be used for this) // TODO drop them (pool-system should be used for this)
//buffs // buffs
BG_AB_OBJECT_SPEEDBUFF_STABLES = 1, BG_AB_OBJECT_SPEEDBUFF_STABLES = 1,
BG_AB_OBJECT_REGENBUFF_STABLES = 2, BG_AB_OBJECT_REGENBUFF_STABLES = 2,
BG_AB_OBJECT_BERSERKBUFF_STABLES = 3, BG_AB_OBJECT_BERSERKBUFF_STABLES = 3,

View file

@ -382,7 +382,7 @@ void BattleGroundAV::HandleAreaTrigger(Player* source, uint32 trigger)
case 3329: case 3329:
case 3330: case 3330:
case 3331: case 3331:
//source->Unmount(); // source->Unmount();
break; break;
default: default:
DEBUG_LOG("BattleGroundAV: WARNING: Unhandled AreaTrigger in Battleground: %u", trigger); DEBUG_LOG("BattleGroundAV: WARNING: Unhandled AreaTrigger in Battleground: %u", trigger);

View file

@ -30,7 +30,7 @@ BattleGroundBE::BattleGroundBE()
m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S; m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S; m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE; m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE;
//we must set messageIds // we must set messageIds
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS; m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS;
m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS; m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS;
@ -63,7 +63,7 @@ void BattleGroundBE::StartingEventOpenDoors()
void BattleGroundBE::AddPlayer(Player* plr) void BattleGroundBE::AddPlayer(Player* plr)
{ {
BattleGround::AddPlayer(plr); BattleGround::AddPlayer(plr);
//create score and add it to map, default values are set in constructor // create score and add it to map, default values are set in constructor
BattleGroundBEScore* sc = new BattleGroundBEScore; BattleGroundBEScore* sc = new BattleGroundBEScore;
m_PlayerScores[plr->GetObjectGuid()] = sc; m_PlayerScores[plr->GetObjectGuid()] = sc;
@ -114,15 +114,15 @@ void BattleGroundBE::HandleAreaTrigger(Player* source, uint32 trigger)
if (GetStatus() != STATUS_IN_PROGRESS) if (GetStatus() != STATUS_IN_PROGRESS)
return; return;
//uint32 spellId = 0; // uint32 spellId = 0;
//uint64 buff_guid = 0; // uint64 buff_guid = 0;
switch (trigger) switch (trigger)
{ {
case 4538: // buff trigger? case 4538: // buff trigger?
//buff_guid = m_BgObjects[BG_BE_OBJECT_BUFF_1]; // buff_guid = m_BgObjects[BG_BE_OBJECT_BUFF_1];
break; break;
case 4539: // buff trigger? case 4539: // buff trigger?
//buff_guid = m_BgObjects[BG_BE_OBJECT_BUFF_2]; // buff_guid = m_BgObjects[BG_BE_OBJECT_BUFF_2];
break; break;
default: default:
sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", trigger); sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", trigger);
@ -130,7 +130,7 @@ void BattleGroundBE::HandleAreaTrigger(Player* source, uint32 trigger)
break; break;
} }
//if (buff_guid) // if (buff_guid)
// HandleTriggerBuff(buff_guid, source); // HandleTriggerBuff(buff_guid, source);
} }
@ -143,7 +143,7 @@ void BattleGroundBE::FillInitialWorldStates(WorldPacket& data, uint32& count)
void BattleGroundBE::Reset() void BattleGroundBE::Reset()
{ {
//call parent's class reset // call parent's class reset
BattleGround::Reset(); BattleGround::Reset();
} }
@ -159,7 +159,7 @@ void BattleGroundBE::UpdatePlayerScore(Player* source, uint32 type, uint32 value
if (itr == m_PlayerScores.end()) // player not found... if (itr == m_PlayerScores.end()) // player not found...
return; return;
//there is nothing special in this score // there is nothing special in this score
BattleGround::UpdatePlayerScore(source, type, value); BattleGround::UpdatePlayerScore(source, type, value);
} }

View file

@ -28,7 +28,7 @@ BattleGroundDS::BattleGroundDS()
m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S; m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S; m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE; m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE;
//we must set messageIds // we must set messageIds
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS; m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS;
m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS; m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS;
@ -56,7 +56,7 @@ void BattleGroundDS::StartingEventOpenDoors()
void BattleGroundDS::AddPlayer(Player* plr) void BattleGroundDS::AddPlayer(Player* plr)
{ {
BattleGround::AddPlayer(plr); BattleGround::AddPlayer(plr);
//create score and add it to map, default values are set in constructor // create score and add it to map, default values are set in constructor
BattleGroundDSScore* sc = new BattleGroundDSScore; BattleGroundDSScore* sc = new BattleGroundDSScore;
m_PlayerScores[plr->GetObjectGuid()] = sc; m_PlayerScores[plr->GetObjectGuid()] = sc;

View file

@ -25,7 +25,7 @@ class BattleGroundDSScore : public BattleGroundScore
public: public:
BattleGroundDSScore() {}; BattleGroundDSScore() {};
virtual ~BattleGroundDSScore() {}; virtual ~BattleGroundDSScore() {};
//TODO fix me // TODO fix me
}; };
class BattleGroundDS : public BattleGround class BattleGroundDS : public BattleGround

View file

@ -81,12 +81,12 @@ void BattleGroundEY::Update(uint32 diff)
m_TowerCapCheckTimer -= diff; m_TowerCapCheckTimer -= diff;
if (m_TowerCapCheckTimer <= 0) if (m_TowerCapCheckTimer <= 0)
{ {
//check if player joined point // check if player joined point
/*I used this order of calls, because although we will check if one player is in gameobject's distance 2 times /*I used this order of calls, because although we will check if one player is in gameobject's distance 2 times
but we can count of players on current point in CheckSomeoneLeftPoint but we can count of players on current point in CheckSomeoneLeftPoint
*/ */
CheckSomeoneJoinedPoint(); CheckSomeoneJoinedPoint();
//check if player left point // check if player left point
CheckSomeoneLeftPoint(); CheckSomeoneLeftPoint();
UpdatePointStatuses(); UpdatePointStatuses();
m_TowerCapCheckTimer = BG_EY_FPOINTS_TICK_TIME; m_TowerCapCheckTimer = BG_EY_FPOINTS_TICK_TIME;
@ -105,7 +105,7 @@ void BattleGroundEY::StartingEventOpenDoors()
for (uint8 i = 0; i < BG_EY_NODES_MAX; ++i) for (uint8 i = 0; i < BG_EY_NODES_MAX; ++i)
{ {
//randomly spawn buff // randomly spawn buff
uint8 buff = urand(0, 2); uint8 buff = urand(0, 2);
SpawnBGObject(m_BgObjects[BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + buff + i * 3], RESPAWN_IMMEDIATELY); SpawnBGObject(m_BgObjects[BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + buff + i * 3], RESPAWN_IMMEDIATELY);
} }
@ -144,14 +144,14 @@ void BattleGroundEY::CheckSomeoneJoinedPoint()
if (plr->CanUseCapturePoint() && if (plr->CanUseCapturePoint() &&
plr->IsWithinDist3d(BG_EY_NodePositions[i][0], BG_EY_NodePositions[i][1], BG_EY_NodePositions[i][2], BG_EY_POINT_RADIUS)) plr->IsWithinDist3d(BG_EY_NodePositions[i][0], BG_EY_NodePositions[i][1], BG_EY_NodePositions[i][2], BG_EY_POINT_RADIUS))
{ {
//player joined point! // player joined point!
//show progress bar // show progress bar
UpdateWorldStateForPlayer(PROGRESS_BAR_PERCENT_GREY, BG_EY_PROGRESS_BAR_PERCENT_GREY, plr); UpdateWorldStateForPlayer(PROGRESS_BAR_PERCENT_GREY, BG_EY_PROGRESS_BAR_PERCENT_GREY, plr);
UpdateWorldStateForPlayer(PROGRESS_BAR_STATUS, m_PointBarStatus[i], plr); UpdateWorldStateForPlayer(PROGRESS_BAR_STATUS, m_PointBarStatus[i], plr);
UpdateWorldStateForPlayer(PROGRESS_BAR_SHOW, BG_EY_PROGRESS_BAR_SHOW, plr); UpdateWorldStateForPlayer(PROGRESS_BAR_SHOW, BG_EY_PROGRESS_BAR_SHOW, plr);
//add player to point // add player to point
m_PlayersNearPoint[i].push_back(m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS][j]); m_PlayersNearPoint[i].push_back(m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS][j]);
//remove player from "free space" // remove player from "free space"
m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].erase(m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].begin() + j); m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].erase(m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].begin() + j);
} }
else else
@ -162,7 +162,7 @@ void BattleGroundEY::CheckSomeoneJoinedPoint()
void BattleGroundEY::CheckSomeoneLeftPoint() void BattleGroundEY::CheckSomeoneLeftPoint()
{ {
//reset current point counts // reset current point counts
for (uint8 i = 0; i < 2 * BG_EY_NODES_MAX; ++i) for (uint8 i = 0; i < 2 * BG_EY_NODES_MAX; ++i)
m_CurrentPointPlayersCount[i] = 0; m_CurrentPointPlayersCount[i] = 0;
for (uint8 i = 0; i < BG_EY_NODES_MAX; ++i) for (uint8 i = 0; i < BG_EY_NODES_MAX; ++i)
@ -174,7 +174,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint()
if (!plr) if (!plr)
{ {
sLog.outError("BattleGroundEY:CheckSomeoneLeftPoint %s not found!", m_PlayersNearPoint[i][j].GetString().c_str()); sLog.outError("BattleGroundEY:CheckSomeoneLeftPoint %s not found!", m_PlayersNearPoint[i][j].GetString().c_str());
//move nonexistent player to "free space" - this will cause many error showing in log, but it is a very important bug // move nonexistent player to "free space" - this will cause many error showing in log, but it is a very important bug
m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].push_back(m_PlayersNearPoint[i][j]); m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].push_back(m_PlayersNearPoint[i][j]);
m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j); m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j);
++j; ++j;
@ -182,7 +182,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint()
} }
if (!plr->CanUseCapturePoint() || if (!plr->CanUseCapturePoint() ||
!plr->IsWithinDist3d(BG_EY_NodePositions[i][0], BG_EY_NodePositions[i][1], BG_EY_NodePositions[i][2], BG_EY_POINT_RADIUS)) !plr->IsWithinDist3d(BG_EY_NodePositions[i][0], BG_EY_NodePositions[i][1], BG_EY_NodePositions[i][2], BG_EY_POINT_RADIUS))
//move player out of point (add him to players that are out of points // move player out of point (add him to players that are out of points
{ {
m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].push_back(m_PlayersNearPoint[i][j]); m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].push_back(m_PlayersNearPoint[i][j]);
m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j); m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j);
@ -190,7 +190,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint()
} }
else else
{ {
//player is neat flag, so update count: // player is neat flag, so update count:
m_CurrentPointPlayersCount[2 * i + GetTeamIndexByTeamId(plr->GetTeam())]++; m_CurrentPointPlayersCount[2 * i + GetTeamIndexByTeamId(plr->GetTeam())]++;
++j; ++j;
} }
@ -204,18 +204,18 @@ void BattleGroundEY::UpdatePointStatuses()
{ {
if (m_PlayersNearPoint[point].empty()) if (m_PlayersNearPoint[point].empty())
continue; continue;
//count new point bar status: // count new point bar status:
m_PointBarStatus[point] += (m_CurrentPointPlayersCount[2 * point] - m_CurrentPointPlayersCount[2 * point + 1] < BG_EY_POINT_MAX_CAPTURERS_COUNT) ? m_CurrentPointPlayersCount[2 * point] - m_CurrentPointPlayersCount[2 * point + 1] : BG_EY_POINT_MAX_CAPTURERS_COUNT; m_PointBarStatus[point] += (m_CurrentPointPlayersCount[2 * point] - m_CurrentPointPlayersCount[2 * point + 1] < BG_EY_POINT_MAX_CAPTURERS_COUNT) ? m_CurrentPointPlayersCount[2 * point] - m_CurrentPointPlayersCount[2 * point + 1] : BG_EY_POINT_MAX_CAPTURERS_COUNT;
if (m_PointBarStatus[point] > BG_EY_PROGRESS_BAR_ALI_CONTROLLED) if (m_PointBarStatus[point] > BG_EY_PROGRESS_BAR_ALI_CONTROLLED)
//point is fully alliance's // point is fully alliance's
m_PointBarStatus[point] = BG_EY_PROGRESS_BAR_ALI_CONTROLLED; m_PointBarStatus[point] = BG_EY_PROGRESS_BAR_ALI_CONTROLLED;
if (m_PointBarStatus[point] < BG_EY_PROGRESS_BAR_HORDE_CONTROLLED) if (m_PointBarStatus[point] < BG_EY_PROGRESS_BAR_HORDE_CONTROLLED)
//point is fully horde's // point is fully horde's
m_PointBarStatus[point] = BG_EY_PROGRESS_BAR_HORDE_CONTROLLED; m_PointBarStatus[point] = BG_EY_PROGRESS_BAR_HORDE_CONTROLLED;
Team pointOwnerTeamId; Team pointOwnerTeamId;
//find which team should own this point // find which team should own this point
if (m_PointBarStatus[point] <= BG_EY_PROGRESS_BAR_NEUTRAL_LOW) if (m_PointBarStatus[point] <= BG_EY_PROGRESS_BAR_NEUTRAL_LOW)
pointOwnerTeamId = HORDE; pointOwnerTeamId = HORDE;
else if (m_PointBarStatus[point] >= BG_EY_PROGRESS_BAR_NEUTRAL_HIGH) else if (m_PointBarStatus[point] >= BG_EY_PROGRESS_BAR_NEUTRAL_HIGH)
@ -228,14 +228,14 @@ void BattleGroundEY::UpdatePointStatuses()
if (Player* plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[point][i])) if (Player* plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[point][i]))
{ {
UpdateWorldStateForPlayer(PROGRESS_BAR_STATUS, m_PointBarStatus[point], plr); UpdateWorldStateForPlayer(PROGRESS_BAR_STATUS, m_PointBarStatus[point], plr);
//if point owner changed we must evoke event! // if point owner changed we must evoke event!
if (pointOwnerTeamId != m_PointOwnedByTeam[point]) if (pointOwnerTeamId != m_PointOwnedByTeam[point])
{ {
//point was uncontrolled and player is from team which captured point // point was uncontrolled and player is from team which captured point
if (m_PointState[point] == EY_POINT_STATE_UNCONTROLLED && plr->GetTeam() == pointOwnerTeamId) if (m_PointState[point] == EY_POINT_STATE_UNCONTROLLED && plr->GetTeam() == pointOwnerTeamId)
EventTeamCapturedPoint(plr, point); EventTeamCapturedPoint(plr, point);
//point was under control and player isn't from team which controlled it // point was under control and player isn't from team which controlled it
if (m_PointState[point] == EY_POINT_UNDER_CONTROL && plr->GetTeam() != m_PointOwnedByTeam[point]) if (m_PointState[point] == EY_POINT_UNDER_CONTROL && plr->GetTeam() != m_PointOwnedByTeam[point])
EventTeamLostPoint(plr, point); EventTeamLostPoint(plr, point);
} }
@ -262,12 +262,12 @@ void BattleGroundEY::UpdateTeamScore(Team team)
void BattleGroundEY::EndBattleGround(Team winner) void BattleGroundEY::EndBattleGround(Team winner)
{ {
//win reward // win reward
if (winner == ALLIANCE) if (winner == ALLIANCE)
RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE); RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE);
if (winner == HORDE) if (winner == HORDE)
RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE); RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE);
//complete map reward // complete map reward
RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE); RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE);
RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE); RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE);
@ -306,7 +306,7 @@ void BattleGroundEY::UpdatePointsIcons(Team team, uint32 point)
void BattleGroundEY::AddPlayer(Player* plr) void BattleGroundEY::AddPlayer(Player* plr)
{ {
BattleGround::AddPlayer(plr); BattleGround::AddPlayer(plr);
//create score and add it to map // create score and add it to map
BattleGroundEYScore* sc = new BattleGroundEYScore; BattleGroundEYScore* sc = new BattleGroundEYScore;
m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].push_back(plr->GetObjectGuid()); m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].push_back(plr->GetObjectGuid());
@ -343,7 +343,7 @@ void BattleGroundEY::HandleAreaTrigger(Player* source, uint32 trigger)
if (GetStatus() != STATUS_IN_PROGRESS) if (GetStatus() != STATUS_IN_PROGRESS)
return; return;
if (!source->isAlive()) //hack code, must be removed later if (!source->isAlive()) // hack code, must be removed later
return; return;
switch (trigger) switch (trigger)
@ -389,7 +389,7 @@ void BattleGroundEY::HandleAreaTrigger(Player* source, uint32 trigger)
bool BattleGroundEY::SetupBattleGround() bool BattleGroundEY::SetupBattleGround()
{ {
//buffs // buffs
for (uint8 i = 0; i < BG_EY_NODES_MAX; ++i) for (uint8 i = 0; i < BG_EY_NODES_MAX; ++i)
{ {
AreaTriggerEntry const* at = sAreaTriggerStore.LookupEntry(m_Points_Trigger[i]); AreaTriggerEntry const* at = sAreaTriggerStore.LookupEntry(m_Points_Trigger[i]);
@ -410,7 +410,7 @@ bool BattleGroundEY::SetupBattleGround()
void BattleGroundEY::Reset() void BattleGroundEY::Reset()
{ {
//call parent's class reset // call parent's class reset
BattleGround::Reset(); BattleGround::Reset();
m_TeamScores[BG_TEAM_ALLIANCE] = 0; m_TeamScores[BG_TEAM_ALLIANCE] = 0;
@ -433,7 +433,7 @@ void BattleGroundEY::Reset()
m_PointState[i] = EY_POINT_STATE_UNCONTROLLED; m_PointState[i] = EY_POINT_STATE_UNCONTROLLED;
m_PointBarStatus[i] = BG_EY_PROGRESS_BAR_STATE_MIDDLE; m_PointBarStatus[i] = BG_EY_PROGRESS_BAR_STATE_MIDDLE;
m_PlayersNearPoint[i].clear(); m_PlayersNearPoint[i].clear();
m_PlayersNearPoint[i].reserve(15); //tip size m_PlayersNearPoint[i].reserve(15); // tip size
m_ActiveEvents[i] = BG_EYE_NEUTRAL_TEAM; // neutral team owns every node m_ActiveEvents[i] = BG_EYE_NEUTRAL_TEAM; // neutral team owns every node
} }
// the flag in the middle is spawned at beginning // the flag in the middle is spawned at beginning
@ -506,7 +506,7 @@ void BattleGroundEY::EventPlayerDroppedFlag(Player* source)
m_FlagsTimer = BG_EY_FLAG_RESPAWN_TIME; m_FlagsTimer = BG_EY_FLAG_RESPAWN_TIME;
source->CastSpell(source, SPELL_RECENTLY_DROPPED_FLAG, true); source->CastSpell(source, SPELL_RECENTLY_DROPPED_FLAG, true);
source->CastSpell(source, BG_EY_PLAYER_DROPPED_FLAG_SPELL, true); source->CastSpell(source, BG_EY_PLAYER_DROPPED_FLAG_SPELL, true);
//this does not work correctly :( (it should remove flag carrier name) // this does not work correctly :( (it should remove flag carrier name)
UpdateWorldState(NETHERSTORM_FLAG_STATE_HORDE, BG_EY_FLAG_STATE_WAIT_RESPAWN); UpdateWorldState(NETHERSTORM_FLAG_STATE_HORDE, BG_EY_FLAG_STATE_WAIT_RESPAWN);
UpdateWorldState(NETHERSTORM_FLAG_STATE_ALLIANCE, BG_EY_FLAG_STATE_WAIT_RESPAWN); UpdateWorldState(NETHERSTORM_FLAG_STATE_ALLIANCE, BG_EY_FLAG_STATE_WAIT_RESPAWN);
@ -540,7 +540,7 @@ void BattleGroundEY::EventPlayerClickedOnFlag(Player* source, GameObject* target
SpawnEvent(BG_EY_EVENT_CAPTURE_FLAG, BG_EY_EVENT2_FLAG_CENTER, false); SpawnEvent(BG_EY_EVENT_CAPTURE_FLAG, BG_EY_EVENT2_FLAG_CENTER, false);
SetFlagPicker(source->GetObjectGuid()); SetFlagPicker(source->GetObjectGuid());
//get flag aura on player // get flag aura on player
source->CastSpell(source, BG_EY_NETHERSTORM_FLAG_SPELL, true); source->CastSpell(source, BG_EY_NETHERSTORM_FLAG_SPELL, true);
source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT); source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
@ -573,7 +573,7 @@ void BattleGroundEY::EventTeamLostPoint(Player* source, uint32 point)
SpawnEvent(point, BG_EYE_NEUTRAL_TEAM, true); // will despawn alliance/horde SpawnEvent(point, BG_EYE_NEUTRAL_TEAM, true); // will despawn alliance/horde
//buff isn't despawned // buff isn't despawned
if (team == ALLIANCE) if (team == ALLIANCE)
SendMessageToAll(LoosingPointTypes[point].MessageIdAlliance, CHAT_MSG_BG_SYSTEM_ALLIANCE, source); SendMessageToAll(LoosingPointTypes[point].MessageIdAlliance, CHAT_MSG_BG_SYSTEM_ALLIANCE, source);
@ -594,7 +594,7 @@ void BattleGroundEY::EventTeamCapturedPoint(Player* source, uint32 point)
++m_TeamPointsCount[GetTeamIndexByTeamId(team)]; ++m_TeamPointsCount[GetTeamIndexByTeamId(team)];
SpawnEvent(point, GetTeamIndexByTeamId(team), true); SpawnEvent(point, GetTeamIndexByTeamId(team), true);
//buff isn't respawned // buff isn't respawned
m_PointOwnedByTeam[point] = team; m_PointOwnedByTeam[point] = team;
m_PointState[point] = EY_POINT_UNDER_CONTROL; m_PointState[point] = EY_POINT_UNDER_CONTROL;

View file

@ -23,7 +23,7 @@
class BattleGround; class BattleGround;
#define BG_EY_FLAG_RESPAWN_TIME (10*IN_MILLISECONDS) //10 seconds #define BG_EY_FLAG_RESPAWN_TIME (10*IN_MILLISECONDS)//10 seconds
#define BG_EY_FPOINTS_TICK_TIME (2*IN_MILLISECONDS) //2 seconds #define BG_EY_FPOINTS_TICK_TIME (2*IN_MILLISECONDS) //2 seconds
enum BG_EY_WorldStates enum BG_EY_WorldStates
@ -48,7 +48,7 @@ enum BG_EY_WorldStates
PROGRESS_BAR_STATUS = 2719, //50 init!, 48 ... hordak bere .. 33 .. 0 = full 100% hordacky , 100 = full alliance PROGRESS_BAR_STATUS = 2719, //50 init!, 48 ... hordak bere .. 33 .. 0 = full 100% hordacky , 100 = full alliance
PROGRESS_BAR_SHOW = 2718, //1 init, 0 druhy send - bez messagu, 1 = controlled alliance PROGRESS_BAR_SHOW = 2718, //1 init, 0 druhy send - bez messagu, 1 = controlled alliance
NETHERSTORM_FLAG = 2757, NETHERSTORM_FLAG = 2757,
//set to 2 when flag is picked up, and to 1 if it is dropped // set to 2 when flag is picked up, and to 1 if it is dropped
NETHERSTORM_FLAG_STATE_ALLIANCE = 2769, NETHERSTORM_FLAG_STATE_ALLIANCE = 2769,
NETHERSTORM_FLAG_STATE_HORDE = 2770 NETHERSTORM_FLAG_STATE_HORDE = 2770
}; };
@ -69,7 +69,7 @@ enum BG_EY_ProgressBarConsts
enum BG_EY_Sounds enum BG_EY_Sounds
{ {
//strange ids, but sure about them // strange ids, but sure about them
BG_EY_SOUND_FLAG_PICKED_UP_ALLIANCE = 8212, BG_EY_SOUND_FLAG_PICKED_UP_ALLIANCE = 8212,
BG_EY_SOUND_FLAG_CAPTURED_HORDE = 8213, BG_EY_SOUND_FLAG_CAPTURED_HORDE = 8213,
BG_EY_SOUND_FLAG_PICKED_UP_HORDE = 8174, BG_EY_SOUND_FLAG_PICKED_UP_HORDE = 8174,
@ -137,7 +137,7 @@ const float BG_EY_NodePositions[BG_EY_NODES_MAX][3] =
enum EYBattleGroundObjectTypes enum EYBattleGroundObjectTypes
{ {
//buffs // buffs
BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER = 1, BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER = 1,
BG_EY_OBJECT_REGENBUFF_FEL_REAVER = 2, BG_EY_OBJECT_REGENBUFF_FEL_REAVER = 2,
BG_EY_OBJECT_BERSERKBUFF_FEL_REAVER = 3, BG_EY_OBJECT_BERSERKBUFF_FEL_REAVER = 3,
@ -210,7 +210,7 @@ struct BattleGroundEYCapturingPointStruct
const uint8 BG_EY_TickPoints[BG_EY_NODES_MAX] = {1, 2, 5, 10}; const uint8 BG_EY_TickPoints[BG_EY_NODES_MAX] = {1, 2, 5, 10};
const uint32 BG_EY_FlagPoints[BG_EY_NODES_MAX] = {75, 85, 100, 500}; const uint32 BG_EY_FlagPoints[BG_EY_NODES_MAX] = {75, 85, 100, 500};
//constant arrays: // constant arrays:
const BattleGroundEYPointIconsStruct PointsIconStruct[BG_EY_NODES_MAX] = const BattleGroundEYPointIconsStruct PointsIconStruct[BG_EY_NODES_MAX] =
{ {
BattleGroundEYPointIconsStruct(FEL_REAVER_UNCONTROL, FEL_REAVER_ALLIANCE_CONTROL, FEL_REAVER_HORDE_CONTROL), BattleGroundEYPointIconsStruct(FEL_REAVER_UNCONTROL, FEL_REAVER_ALLIANCE_CONTROL, FEL_REAVER_HORDE_CONTROL),

View file

@ -137,7 +137,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recv_data)
} }
// check if already in queue // check if already in queue
if (_player->GetBattleGroundQueueIndex(bgQueueTypeId) < PLAYER_MAX_BATTLEGROUND_QUEUES) if (_player->GetBattleGroundQueueIndex(bgQueueTypeId) < PLAYER_MAX_BATTLEGROUND_QUEUES)
//player is already in this queue // player is already in this queue
return; return;
// check if has free queue slots // check if has free queue slots
if (!_player->HasFreeBattleGroundQueueId()) if (!_player->HasFreeBattleGroundQueueId())
@ -264,12 +264,12 @@ void WorldSession::HandleBattleGroundPlayerPositionsOpcode(WorldPacket& /*recv_d
} }
break; break;
case BATTLEGROUND_EY: case BATTLEGROUND_EY:
//TODO : fix me! // TODO : fix me!
break; break;
case BATTLEGROUND_AB: case BATTLEGROUND_AB:
case BATTLEGROUND_AV: case BATTLEGROUND_AV:
{ {
//for other BG types - send default // for other BG types - send default
WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, (4 + 4)); WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, (4 + 4));
data << uint32(0); data << uint32(0);
data << uint32(0); data << uint32(0);
@ -277,7 +277,7 @@ void WorldSession::HandleBattleGroundPlayerPositionsOpcode(WorldPacket& /*recv_d
} }
break; break;
default: default:
//maybe it is sent also in arena - do nothing // maybe it is sent also in arena - do nothing
break; break;
} }
} }
@ -356,11 +356,11 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket& recv_data)
return; return;
} }
//get GroupQueueInfo from BattleGroundQueue // get GroupQueueInfo from BattleGroundQueue
BattleGroundTypeId bgTypeId = BattleGroundTypeId(bgTypeId_); BattleGroundTypeId bgTypeId = BattleGroundTypeId(bgTypeId_);
BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(bgTypeId, ArenaType(type)); BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(bgTypeId, ArenaType(type));
BattleGroundQueue& bgQueue = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId]; BattleGroundQueue& bgQueue = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId];
//we must use temporary variable, because GroupQueueInfo pointer can be deleted in BattleGroundQueue::RemovePlayer() function // we must use temporary variable, because GroupQueueInfo pointer can be deleted in BattleGroundQueue::RemovePlayer() function
GroupQueueInfo ginfo; GroupQueueInfo ginfo;
if (!bgQueue.GetPlayerGroupInfoData(_player->GetObjectGuid(), &ginfo)) if (!bgQueue.GetPlayerGroupInfoData(_player->GetObjectGuid(), &ginfo))
{ {
@ -390,20 +390,20 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket& recv_data)
if (!bracketEntry) if (!bracketEntry)
return; return;
//some checks if player isn't cheating - it is not exactly cheating, but we cannot allow it // some checks if player isn't cheating - it is not exactly cheating, but we cannot allow it
if (action == 1 && ginfo.arenaType == ARENA_TYPE_NONE) if (action == 1 && ginfo.arenaType == ARENA_TYPE_NONE)
{ {
//if player is trying to enter battleground (not arena!) and he has deserter debuff, we must just remove him from queue // if player is trying to enter battleground (not arena!) and he has deserter debuff, we must just remove him from queue
if (!_player->CanJoinToBattleground()) if (!_player->CanJoinToBattleground())
{ {
//send bg command result to show nice message // send bg command result to show nice message
WorldPacket data2; WorldPacket data2;
sBattleGroundMgr.BuildGroupJoinedBattlegroundPacket(&data2, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS); sBattleGroundMgr.BuildGroupJoinedBattlegroundPacket(&data2, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS);
_player->GetSession()->SendPacket(&data2); _player->GetSession()->SendPacket(&data2);
action = 0; action = 0;
DEBUG_LOG("Battleground: player %s (%u) has a deserter debuff, do not port him to battleground!", _player->GetName(), _player->GetGUIDLow()); DEBUG_LOG("Battleground: player %s (%u) has a deserter debuff, do not port him to battleground!", _player->GetName(), _player->GetGUIDLow());
} }
//if player don't match battleground max level, then do not allow him to enter! (this might happen when player leveled up during his waiting in queue // if player don't match battleground max level, then do not allow him to enter! (this might happen when player leveled up during his waiting in queue
if (_player->getLevel() > bg->GetMaxLevel()) if (_player->getLevel() > bg->GetMaxLevel())
{ {
sLog.outError("Battleground: Player %s (%u) has level (%u) higher than maxlevel (%u) of battleground (%u)! Do not port him to battleground!", sLog.outError("Battleground: Player %s (%u) has level (%u) higher than maxlevel (%u) of battleground (%u)! Do not port him to battleground!",
@ -490,7 +490,7 @@ void WorldSession::HandleLeaveBattlefieldOpcode(WorldPacket& recv_data)
recv_data.read_skip<uint32>(); // BattleGroundTypeId recv_data.read_skip<uint32>(); // BattleGroundTypeId
recv_data.read_skip<uint16>(); // unk3 recv_data.read_skip<uint16>(); // unk3
//if(bgTypeId >= MAX_BATTLEGROUND_TYPES) // cheating? but not important in this case // if(bgTypeId >= MAX_BATTLEGROUND_TYPES) // cheating? but not important in this case
// return; // return;
// not allow leave battleground in combat // not allow leave battleground in combat
@ -521,8 +521,8 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket& /*recv_data*/)
if (bgTypeId == _player->GetBattleGroundTypeId()) if (bgTypeId == _player->GetBattleGroundTypeId())
{ {
bg = _player->GetBattleGround(); bg = _player->GetBattleGround();
//i cannot check any variable from player class because player class doesn't know if player is in 2v2 / 3v3 or 5v5 arena // i cannot check any variable from player class because player class doesn't know if player is in 2v2 / 3v3 or 5v5 arena
//so i must use bg pointer to get that information // so i must use bg pointer to get that information
if (bg && bg->GetArenaType() == arenaType) if (bg && bg->GetArenaType() == arenaType)
{ {
// this line is checked, i only don't know if GetStartTime is changing itself after bg end! // this line is checked, i only don't know if GetStartTime is changing itself after bg end!
@ -532,8 +532,8 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket& /*recv_data*/)
continue; continue;
} }
} }
//we are sending update to player about queue - he can be invited there! // we are sending update to player about queue - he can be invited there!
//get GroupQueueInfo for queue status // get GroupQueueInfo for queue status
BattleGroundQueue& bgQueue = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId]; BattleGroundQueue& bgQueue = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId];
GroupQueueInfo ginfo; GroupQueueInfo ginfo;
if (!bgQueue.GetPlayerGroupInfoData(_player->GetObjectGuid(), &ginfo)) if (!bgQueue.GetPlayerGroupInfoData(_player->GetObjectGuid(), &ginfo))
@ -612,7 +612,7 @@ void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket& recv_data)
void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recv_data) void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recv_data)
{ {
DEBUG_LOG("WORLD: CMSG_BATTLEMASTER_JOIN_ARENA"); DEBUG_LOG("WORLD: CMSG_BATTLEMASTER_JOIN_ARENA");
//recv_data.hexlike(); // recv_data.hexlike();
ObjectGuid guid; // arena Battlemaster guid ObjectGuid guid; // arena Battlemaster guid
uint8 arenaslot; // 2v2, 3v3 or 5v5 uint8 arenaslot; // 2v2, 3v3 or 5v5
@ -678,7 +678,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recv_data)
// check if already in queue // check if already in queue
if (_player->GetBattleGroundQueueIndex(bgQueueTypeId) < PLAYER_MAX_BATTLEGROUND_QUEUES) if (_player->GetBattleGroundQueueIndex(bgQueueTypeId) < PLAYER_MAX_BATTLEGROUND_QUEUES)
//player is already in this queue // player is already in this queue
return; return;
// check if has free queue slots // check if has free queue slots
if (!_player->HasFreeBattleGroundQueueId()) if (!_player->HasFreeBattleGroundQueueId())

View file

@ -23,7 +23,7 @@
BattleGroundIC::BattleGroundIC() BattleGroundIC::BattleGroundIC()
{ {
//TODO FIX ME! // TODO FIX ME!
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = 0; m_StartMessageIds[BG_STARTING_EVENT_FIRST] = 0;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_WS_START_ONE_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_WS_START_ONE_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_WS_START_HALF_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_WS_START_HALF_MINUTE;
@ -51,7 +51,7 @@ void BattleGroundIC::StartingEventOpenDoors()
void BattleGroundIC::AddPlayer(Player* plr) void BattleGroundIC::AddPlayer(Player* plr)
{ {
BattleGround::AddPlayer(plr); BattleGround::AddPlayer(plr);
//create score and add it to map, default values are set in constructor // create score and add it to map, default values are set in constructor
BattleGroundICScore* sc = new BattleGroundICScore; BattleGroundICScore* sc = new BattleGroundICScore;
m_PlayerScores[plr->GetObjectGuid()] = sc; m_PlayerScores[plr->GetObjectGuid()] = sc;

View file

@ -44,7 +44,7 @@ class BattleGroundIC : public BattleGround
void RemovePlayer(Player* plr, ObjectGuid guid); void RemovePlayer(Player* plr, ObjectGuid guid);
void HandleAreaTrigger(Player* source, uint32 trigger); void HandleAreaTrigger(Player* source, uint32 trigger);
//bool SetupBattleGround(); // bool SetupBattleGround();
/* Scorekeeping */ /* Scorekeeping */
void UpdatePlayerScore(Player* source, uint32 type, uint32 value); void UpdatePlayerScore(Player* source, uint32 type, uint32 value);

View file

@ -96,7 +96,7 @@ void BattleGroundQueue::SelectionPool::Init()
// sometimes it can be called on empty selection pool // sometimes it can be called on empty selection pool
bool BattleGroundQueue::SelectionPool::KickGroup(uint32 size) bool BattleGroundQueue::SelectionPool::KickGroup(uint32 size)
{ {
//find maxgroup or LAST group with size == size and kick it // find maxgroup or LAST group with size == size and kick it
bool found = false; bool found = false;
GroupsQueueType::iterator groupToKick = SelectedGroups.begin(); GroupsQueueType::iterator groupToKick = SelectedGroups.begin();
for (GroupsQueueType::iterator itr = groupToKick; itr != SelectedGroups.end(); ++itr) for (GroupsQueueType::iterator itr = groupToKick; itr != SelectedGroups.end(); ++itr)
@ -109,14 +109,14 @@ bool BattleGroundQueue::SelectionPool::KickGroup(uint32 size)
else if (!found && (*itr)->Players.size() >= (*groupToKick)->Players.size()) else if (!found && (*itr)->Players.size() >= (*groupToKick)->Players.size())
groupToKick = itr; groupToKick = itr;
} }
//if pool is empty, do nothing // if pool is empty, do nothing
if (GetPlayerCount()) if (GetPlayerCount())
{ {
//update player count // update player count
GroupQueueInfo* ginfo = (*groupToKick); GroupQueueInfo* ginfo = (*groupToKick);
SelectedGroups.erase(groupToKick); SelectedGroups.erase(groupToKick);
PlayerCount -= ginfo->Players.size(); PlayerCount -= ginfo->Players.size();
//return false if we kicked smaller group or there are enough players in selection pool // return false if we kicked smaller group or there are enough players in selection pool
if (ginfo->Players.size() <= size + 1) if (ginfo->Players.size() <= size + 1)
return false; return false;
} }
@ -129,7 +129,7 @@ bool BattleGroundQueue::SelectionPool::KickGroup(uint32 size)
// returns false when selection pool is full // returns false when selection pool is full
bool BattleGroundQueue::SelectionPool::AddGroup(GroupQueueInfo* ginfo, uint32 desiredCount) bool BattleGroundQueue::SelectionPool::AddGroup(GroupQueueInfo* ginfo, uint32 desiredCount)
{ {
//if group is larger than desired count - don't allow to add it to pool // if group is larger than desired count - don't allow to add it to pool
if (!ginfo->IsInvitedToBGInstanceGUID && desiredCount >= PlayerCount + ginfo->Players.size()) if (!ginfo->IsInvitedToBGInstanceGUID && desiredCount >= PlayerCount + ginfo->Players.size())
{ {
SelectedGroups.push_back(ginfo); SelectedGroups.push_back(ginfo);
@ -166,7 +166,7 @@ GroupQueueInfo* BattleGroundQueue::AddGroup(Player* leader, Group* grp, BattleGr
ginfo->Players.clear(); ginfo->Players.clear();
//compute index (if group is premade or joined a rated match) to queues // compute index (if group is premade or joined a rated match) to queues
uint32 index = 0; uint32 index = 0;
if (!isRated && !isPremade) if (!isRated && !isPremade)
index += BG_TEAMS_COUNT; // BG_QUEUE_PREMADE_* -> BG_QUEUE_NORMAL_* index += BG_TEAMS_COUNT; // BG_QUEUE_PREMADE_* -> BG_QUEUE_NORMAL_*
@ -178,15 +178,15 @@ GroupQueueInfo* BattleGroundQueue::AddGroup(Player* leader, Group* grp, BattleGr
uint32 lastOnlineTime = WorldTimer::getMSTime(); uint32 lastOnlineTime = WorldTimer::getMSTime();
//announce world (this don't need mutex) // announce world (this don't need mutex)
if (isRated && sWorld.getConfig(CONFIG_BOOL_ARENA_QUEUE_ANNOUNCER_JOIN)) if (isRated && sWorld.getConfig(CONFIG_BOOL_ARENA_QUEUE_ANNOUNCER_JOIN))
{ {
sWorld.SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, ginfo->arenaType, ginfo->arenaType, ginfo->ArenaTeamRating); sWorld.SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, ginfo->arenaType, ginfo->arenaType, ginfo->ArenaTeamRating);
} }
//add players from group to ginfo // add players from group to ginfo
{ {
//ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_Lock); // ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_Lock);
if (grp) if (grp)
{ {
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
@ -209,10 +209,10 @@ GroupQueueInfo* BattleGroundQueue::AddGroup(Player* leader, Group* grp, BattleGr
ginfo->Players[leader->GetObjectGuid()] = &pl_info; ginfo->Players[leader->GetObjectGuid()] = &pl_info;
} }
//add GroupInfo to m_QueuedGroups // add GroupInfo to m_QueuedGroups
m_QueuedGroups[bracketId][index].push_back(ginfo); m_QueuedGroups[bracketId][index].push_back(ginfo);
//announce to world, this code needs mutex // announce to world, this code needs mutex
if (arenaType == ARENA_TYPE_NONE && !isRated && !isPremade && sWorld.getConfig(CONFIG_UINT32_BATTLEGROUND_QUEUE_ANNOUNCER_JOIN)) if (arenaType == ARENA_TYPE_NONE && !isRated && !isPremade && sWorld.getConfig(CONFIG_UINT32_BATTLEGROUND_QUEUE_ANNOUNCER_JOIN))
{ {
if (BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(ginfo->BgTypeId)) if (BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(ginfo->BgTypeId))
@ -245,7 +245,7 @@ GroupQueueInfo* BattleGroundQueue::AddGroup(Player* leader, Group* grp, BattleGr
} }
} }
} }
//release mutex // release mutex
} }
return ginfo; return ginfo;
@ -254,7 +254,7 @@ GroupQueueInfo* BattleGroundQueue::AddGroup(Player* leader, Group* grp, BattleGr
void BattleGroundQueue::PlayerInvitedToBGUpdateAverageWaitTime(GroupQueueInfo* ginfo, BattleGroundBracketId bracket_id) void BattleGroundQueue::PlayerInvitedToBGUpdateAverageWaitTime(GroupQueueInfo* ginfo, BattleGroundBracketId bracket_id)
{ {
uint32 timeInQueue = WorldTimer::getMSTimeDiff(ginfo->JoinTime, WorldTimer::getMSTime()); uint32 timeInQueue = WorldTimer::getMSTimeDiff(ginfo->JoinTime, WorldTimer::getMSTime());
uint8 team_index = BG_TEAM_ALLIANCE; //default set to BG_TEAM_ALLIANCE - or non rated arenas! uint8 team_index = BG_TEAM_ALLIANCE; // default set to BG_TEAM_ALLIANCE - or non rated arenas!
if (ginfo->arenaType == ARENA_TYPE_NONE) if (ginfo->arenaType == ARENA_TYPE_NONE)
{ {
if (ginfo->GroupTeam == HORDE) if (ginfo->GroupTeam == HORDE)
@ -263,25 +263,25 @@ void BattleGroundQueue::PlayerInvitedToBGUpdateAverageWaitTime(GroupQueueInfo* g
else else
{ {
if (ginfo->IsRated) if (ginfo->IsRated)
team_index = BG_TEAM_HORDE; //for rated arenas use BG_TEAM_HORDE team_index = BG_TEAM_HORDE; // for rated arenas use BG_TEAM_HORDE
} }
//store pointer to arrayindex of player that was added first // store pointer to arrayindex of player that was added first
uint32* lastPlayerAddedPointer = &(m_WaitTimeLastPlayer[team_index][bracket_id]); uint32* lastPlayerAddedPointer = &(m_WaitTimeLastPlayer[team_index][bracket_id]);
//remove his time from sum // remove his time from sum
m_SumOfWaitTimes[team_index][bracket_id] -= m_WaitTimes[team_index][bracket_id][(*lastPlayerAddedPointer)]; m_SumOfWaitTimes[team_index][bracket_id] -= m_WaitTimes[team_index][bracket_id][(*lastPlayerAddedPointer)];
//set average time to new // set average time to new
m_WaitTimes[team_index][bracket_id][(*lastPlayerAddedPointer)] = timeInQueue; m_WaitTimes[team_index][bracket_id][(*lastPlayerAddedPointer)] = timeInQueue;
//add new time to sum // add new time to sum
m_SumOfWaitTimes[team_index][bracket_id] += timeInQueue; m_SumOfWaitTimes[team_index][bracket_id] += timeInQueue;
//set index of last player added to next one // set index of last player added to next one
(*lastPlayerAddedPointer)++; (*lastPlayerAddedPointer)++;
(*lastPlayerAddedPointer) %= COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME; (*lastPlayerAddedPointer) %= COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME;
} }
uint32 BattleGroundQueue::GetAverageQueueWaitTime(GroupQueueInfo* ginfo, BattleGroundBracketId bracket_id) uint32 BattleGroundQueue::GetAverageQueueWaitTime(GroupQueueInfo* ginfo, BattleGroundBracketId bracket_id)
{ {
uint8 team_index = BG_TEAM_ALLIANCE; //default set to BG_TEAM_ALLIANCE - or non rated arenas! uint8 team_index = BG_TEAM_ALLIANCE; // default set to BG_TEAM_ALLIANCE - or non rated arenas!
if (ginfo->arenaType == ARENA_TYPE_NONE) if (ginfo->arenaType == ARENA_TYPE_NONE)
{ {
if (ginfo->GroupTeam == HORDE) if (ginfo->GroupTeam == HORDE)
@ -290,26 +290,26 @@ uint32 BattleGroundQueue::GetAverageQueueWaitTime(GroupQueueInfo* ginfo, BattleG
else else
{ {
if (ginfo->IsRated) if (ginfo->IsRated)
team_index = BG_TEAM_HORDE; //for rated arenas use BG_TEAM_HORDE team_index = BG_TEAM_HORDE; // for rated arenas use BG_TEAM_HORDE
} }
//check if there is enought values(we always add values > 0) // check if there is enought values(we always add values > 0)
if (m_WaitTimes[team_index][bracket_id][COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME - 1]) if (m_WaitTimes[team_index][bracket_id][COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME - 1])
return (m_SumOfWaitTimes[team_index][bracket_id] / COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME); return (m_SumOfWaitTimes[team_index][bracket_id] / COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME);
else else
//if there aren't enough values return 0 - not available // if there aren't enough values return 0 - not available
return 0; return 0;
} }
//remove player from queue and from group info, if group info is empty then remove it too // remove player from queue and from group info, if group info is empty then remove it too
void BattleGroundQueue::RemovePlayer(ObjectGuid guid, bool decreaseInvitedCount) void BattleGroundQueue::RemovePlayer(ObjectGuid guid, bool decreaseInvitedCount)
{ {
//Player *plr = sObjectMgr.GetPlayer(guid); // Player *plr = sObjectMgr.GetPlayer(guid);
//ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_Lock); // ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_Lock);
int32 bracket_id = -1; // signed for proper for-loop finish int32 bracket_id = -1; // signed for proper for-loop finish
QueuedPlayersMap::iterator itr; QueuedPlayersMap::iterator itr;
//remove player from map, if he's there // remove player from map, if he's there
itr = m_QueuedPlayers.find(guid); itr = m_QueuedPlayers.find(guid);
if (itr == m_QueuedPlayers.end()) if (itr == m_QueuedPlayers.end())
{ {
@ -326,8 +326,8 @@ void BattleGroundQueue::RemovePlayer(ObjectGuid guid, bool decreaseInvitedCount)
for (int8 bracket_id_tmp = MAX_BATTLEGROUND_BRACKETS - 1; bracket_id_tmp >= 0 && bracket_id == -1; --bracket_id_tmp) for (int8 bracket_id_tmp = MAX_BATTLEGROUND_BRACKETS - 1; bracket_id_tmp >= 0 && bracket_id == -1; --bracket_id_tmp)
{ {
//we must check premade and normal team's queue - because when players from premade are joining bg, // we must check premade and normal team's queue - because when players from premade are joining bg,
//they leave groupinfo so we can't use its players size to find out index // they leave groupinfo so we can't use its players size to find out index
for (uint8 j = index; j < BG_QUEUE_GROUP_TYPES_COUNT; j += BG_QUEUE_NORMAL_ALLIANCE) for (uint8 j = index; j < BG_QUEUE_GROUP_TYPES_COUNT; j += BG_QUEUE_NORMAL_ALLIANCE)
{ {
for (group_itr_tmp = m_QueuedGroups[bracket_id_tmp][j].begin(); group_itr_tmp != m_QueuedGroups[bracket_id_tmp][j].end(); ++group_itr_tmp) for (group_itr_tmp = m_QueuedGroups[bracket_id_tmp][j].begin(); group_itr_tmp != m_QueuedGroups[bracket_id_tmp][j].end(); ++group_itr_tmp)
@ -336,14 +336,14 @@ void BattleGroundQueue::RemovePlayer(ObjectGuid guid, bool decreaseInvitedCount)
{ {
bracket_id = bracket_id_tmp; bracket_id = bracket_id_tmp;
group_itr = group_itr_tmp; group_itr = group_itr_tmp;
//we must store index to be able to erase iterator // we must store index to be able to erase iterator
index = j; index = j;
break; break;
} }
} }
} }
} }
//player can't be in queue without group, but just in case // player can't be in queue without group, but just in case
if (bracket_id == -1) if (bracket_id == -1)
{ {
sLog.outError("BattleGroundQueue: ERROR Cannot find groupinfo for %s", guid.GetString().c_str()); sLog.outError("BattleGroundQueue: ERROR Cannot find groupinfo for %s", guid.GetString().c_str());
@ -376,7 +376,7 @@ void BattleGroundQueue::RemovePlayer(ObjectGuid guid, bool decreaseInvitedCount)
if (group->arenaType != ARENA_TYPE_NONE && group->IsRated && group->Players.empty() && sWorld.getConfig(CONFIG_BOOL_ARENA_QUEUE_ANNOUNCER_EXIT)) if (group->arenaType != ARENA_TYPE_NONE && group->IsRated && group->Players.empty() && sWorld.getConfig(CONFIG_BOOL_ARENA_QUEUE_ANNOUNCER_EXIT))
sWorld.SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, group->arenaType, group->arenaType, group->ArenaTeamRating); sWorld.SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, group->arenaType, group->arenaType, group->ArenaTeamRating);
//if player leaves queue and he is invited to rated arena match, then he have to loose // if player leaves queue and he is invited to rated arena match, then he have to loose
if (group->IsInvitedToBGInstanceGUID && group->IsRated && decreaseInvitedCount) if (group->IsInvitedToBGInstanceGUID && group->IsRated && decreaseInvitedCount)
{ {
ArenaTeam* at = sObjectMgr.GetArenaTeamById(group->ArenaTeamId); ArenaTeam* at = sObjectMgr.GetArenaTeamById(group->ArenaTeamId);
@ -421,10 +421,10 @@ void BattleGroundQueue::RemovePlayer(ObjectGuid guid, bool decreaseInvitedCount)
} }
} }
//returns true when player pl_guid is in queue and is invited to bgInstanceGuid // returns true when player pl_guid is in queue and is invited to bgInstanceGuid
bool BattleGroundQueue::IsPlayerInvited(ObjectGuid pl_guid, const uint32 bgInstanceGuid, const uint32 removeTime) bool BattleGroundQueue::IsPlayerInvited(ObjectGuid pl_guid, const uint32 bgInstanceGuid, const uint32 removeTime)
{ {
//ACE_Guard<ACE_Recursive_Thread_Mutex> g(m_Lock); // ACE_Guard<ACE_Recursive_Thread_Mutex> g(m_Lock);
QueuedPlayersMap::const_iterator qItr = m_QueuedPlayers.find(pl_guid); QueuedPlayersMap::const_iterator qItr = m_QueuedPlayers.find(pl_guid);
return (qItr != m_QueuedPlayers.end() return (qItr != m_QueuedPlayers.end()
&& qItr->second.GroupInfo->IsInvitedToBGInstanceGUID == bgInstanceGuid && qItr->second.GroupInfo->IsInvitedToBGInstanceGUID == bgInstanceGuid
@ -433,7 +433,7 @@ bool BattleGroundQueue::IsPlayerInvited(ObjectGuid pl_guid, const uint32 bgInsta
bool BattleGroundQueue::GetPlayerGroupInfoData(ObjectGuid guid, GroupQueueInfo* ginfo) bool BattleGroundQueue::GetPlayerGroupInfoData(ObjectGuid guid, GroupQueueInfo* ginfo)
{ {
//ACE_Guard<ACE_Recursive_Thread_Mutex> g(m_Lock); // ACE_Guard<ACE_Recursive_Thread_Mutex> g(m_Lock);
QueuedPlayersMap::const_iterator qItr = m_QueuedPlayers.find(guid); QueuedPlayersMap::const_iterator qItr = m_QueuedPlayers.find(guid);
if (qItr == m_QueuedPlayers.end()) if (qItr == m_QueuedPlayers.end())
return false; return false;
@ -473,7 +473,7 @@ bool BattleGroundQueue::InviteGroupToBG(GroupQueueInfo* ginfo, BattleGround* bg,
// invite the player // invite the player
PlayerInvitedToBGUpdateAverageWaitTime(ginfo, bracket_id); PlayerInvitedToBGUpdateAverageWaitTime(ginfo, bracket_id);
//sBattleGroundMgr.InvitePlayer(plr, bg, ginfo->Team); // sBattleGroundMgr.InvitePlayer(plr, bg, ginfo->Team);
// set invited player counters // set invited player counters
bg->IncreaseInvitedCount(ginfo->GroupTeam); bg->IncreaseInvitedCount(ginfo->GroupTeam);
@ -514,22 +514,22 @@ void BattleGroundQueue::FillPlayersToBG(BattleGround* bg, BattleGroundBracketId
int32 hordeFree = bg->GetFreeSlotsForTeam(HORDE); int32 hordeFree = bg->GetFreeSlotsForTeam(HORDE);
int32 aliFree = bg->GetFreeSlotsForTeam(ALLIANCE); int32 aliFree = bg->GetFreeSlotsForTeam(ALLIANCE);
//iterator for iterating through bg queue // iterator for iterating through bg queue
GroupsQueueType::const_iterator Ali_itr = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].begin(); GroupsQueueType::const_iterator Ali_itr = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].begin();
//count of groups in queue - used to stop cycles // count of groups in queue - used to stop cycles
uint32 aliCount = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].size(); uint32 aliCount = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].size();
//index to queue which group is current // index to queue which group is current
uint32 aliIndex = 0; uint32 aliIndex = 0;
for (; aliIndex < aliCount && m_SelectionPools[BG_TEAM_ALLIANCE].AddGroup((*Ali_itr), aliFree); ++aliIndex) for (; aliIndex < aliCount && m_SelectionPools[BG_TEAM_ALLIANCE].AddGroup((*Ali_itr), aliFree); ++aliIndex)
++Ali_itr; ++Ali_itr;
//the same thing for horde // the same thing for horde
GroupsQueueType::const_iterator Horde_itr = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].begin(); GroupsQueueType::const_iterator Horde_itr = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].begin();
uint32 hordeCount = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].size(); uint32 hordeCount = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].size();
uint32 hordeIndex = 0; uint32 hordeIndex = 0;
for (; hordeIndex < hordeCount && m_SelectionPools[BG_TEAM_HORDE].AddGroup((*Horde_itr), hordeFree); ++hordeIndex) for (; hordeIndex < hordeCount && m_SelectionPools[BG_TEAM_HORDE].AddGroup((*Horde_itr), hordeFree); ++hordeIndex)
++Horde_itr; ++Horde_itr;
//if ofc like BG queue invitation is set in config, then we are happy // if ofc like BG queue invitation is set in config, then we are happy
if (sWorld.getConfig(CONFIG_UINT32_BATTLEGROUND_INVITATION_TYPE) == 0) if (sWorld.getConfig(CONFIG_UINT32_BATTLEGROUND_INVITATION_TYPE) == 0)
return; return;
@ -546,16 +546,16 @@ void BattleGroundQueue::FillPlayersToBG(BattleGround* bg, BattleGroundBracketId
int32 diffHorde = hordeFree - int32(m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount()); int32 diffHorde = hordeFree - int32(m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount());
while (abs(diffAli - diffHorde) > 1 && (m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() > 0 || m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() > 0)) while (abs(diffAli - diffHorde) > 1 && (m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() > 0 || m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() > 0))
{ {
//each cycle execution we need to kick at least 1 group // each cycle execution we need to kick at least 1 group
if (diffAli < diffHorde) if (diffAli < diffHorde)
{ {
//kick alliance group, add to pool new group if needed // kick alliance group, add to pool new group if needed
if (m_SelectionPools[BG_TEAM_ALLIANCE].KickGroup(diffHorde - diffAli)) if (m_SelectionPools[BG_TEAM_ALLIANCE].KickGroup(diffHorde - diffAli))
{ {
for (; aliIndex < aliCount && m_SelectionPools[BG_TEAM_ALLIANCE].AddGroup((*Ali_itr), (aliFree >= diffHorde) ? aliFree - diffHorde : 0); ++aliIndex) for (; aliIndex < aliCount && m_SelectionPools[BG_TEAM_ALLIANCE].AddGroup((*Ali_itr), (aliFree >= diffHorde) ? aliFree - diffHorde : 0); ++aliIndex)
++Ali_itr; ++Ali_itr;
} }
//if ali selection is already empty, then kick horde group, but if there are less horde than ali in bg - break; // if ali selection is already empty, then kick horde group, but if there are less horde than ali in bg - break;
if (!m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount()) if (!m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount())
{ {
if (aliFree <= diffHorde + 1) if (aliFree <= diffHorde + 1)
@ -565,7 +565,7 @@ void BattleGroundQueue::FillPlayersToBG(BattleGround* bg, BattleGroundBracketId
} }
else else
{ {
//kick horde group, add to pool new group if needed // kick horde group, add to pool new group if needed
if (m_SelectionPools[BG_TEAM_HORDE].KickGroup(diffAli - diffHorde)) if (m_SelectionPools[BG_TEAM_HORDE].KickGroup(diffAli - diffHorde))
{ {
for (; hordeIndex < hordeCount && m_SelectionPools[BG_TEAM_HORDE].AddGroup((*Horde_itr), (hordeFree >= diffAli) ? hordeFree - diffAli : 0); ++hordeIndex) for (; hordeIndex < hordeCount && m_SelectionPools[BG_TEAM_HORDE].AddGroup((*Horde_itr), (hordeFree >= diffAli) ? hordeFree - diffAli : 0); ++hordeIndex)
@ -578,7 +578,7 @@ void BattleGroundQueue::FillPlayersToBG(BattleGround* bg, BattleGroundBracketId
m_SelectionPools[BG_TEAM_ALLIANCE].KickGroup(diffAli - diffHorde); m_SelectionPools[BG_TEAM_ALLIANCE].KickGroup(diffAli - diffHorde);
} }
} }
//count diffs after small update // count diffs after small update
diffAli = aliFree - int32(m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount()); diffAli = aliFree - int32(m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount());
diffHorde = hordeFree - int32(m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount()); diffHorde = hordeFree - int32(m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount());
} }
@ -589,11 +589,11 @@ void BattleGroundQueue::FillPlayersToBG(BattleGround* bg, BattleGroundBracketId
// it tries to invite as much players as it can - to MaxPlayersPerTeam, because premade groups have more than MinPlayersPerTeam players // it tries to invite as much players as it can - to MaxPlayersPerTeam, because premade groups have more than MinPlayersPerTeam players
bool BattleGroundQueue::CheckPremadeMatch(BattleGroundBracketId bracket_id, uint32 MinPlayersPerTeam, uint32 MaxPlayersPerTeam) bool BattleGroundQueue::CheckPremadeMatch(BattleGroundBracketId bracket_id, uint32 MinPlayersPerTeam, uint32 MaxPlayersPerTeam)
{ {
//check match // check match
if (!m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE].empty() && !m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_HORDE].empty()) if (!m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE].empty() && !m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_HORDE].empty())
{ {
//start premade match // start premade match
//if groups aren't invited // if groups aren't invited
GroupsQueueType::const_iterator ali_group, horde_group; GroupsQueueType::const_iterator ali_group, horde_group;
for (ali_group = m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE].begin(); ali_group != m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE].end(); ++ali_group) for (ali_group = m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE].begin(); ali_group != m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE].end(); ++ali_group)
if (!(*ali_group)->IsInvitedToBGInstanceGUID) if (!(*ali_group)->IsInvitedToBGInstanceGUID)
@ -606,19 +606,19 @@ bool BattleGroundQueue::CheckPremadeMatch(BattleGroundBracketId bracket_id, uint
{ {
m_SelectionPools[BG_TEAM_ALLIANCE].AddGroup((*ali_group), MaxPlayersPerTeam); m_SelectionPools[BG_TEAM_ALLIANCE].AddGroup((*ali_group), MaxPlayersPerTeam);
m_SelectionPools[BG_TEAM_HORDE].AddGroup((*horde_group), MaxPlayersPerTeam); m_SelectionPools[BG_TEAM_HORDE].AddGroup((*horde_group), MaxPlayersPerTeam);
//add groups/players from normal queue to size of bigger group // add groups/players from normal queue to size of bigger group
uint32 maxPlayers = std::max(m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount(), m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount()); uint32 maxPlayers = std::max(m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount(), m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount());
GroupsQueueType::const_iterator itr; GroupsQueueType::const_iterator itr;
for (uint8 i = 0; i < BG_TEAMS_COUNT; ++i) for (uint8 i = 0; i < BG_TEAMS_COUNT; ++i)
{ {
for (itr = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + i].begin(); itr != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + i].end(); ++itr) for (itr = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + i].begin(); itr != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + i].end(); ++itr)
{ {
//if itr can join BG and player count is less that maxPlayers, then add group to selectionpool // if itr can join BG and player count is less that maxPlayers, then add group to selectionpool
if (!(*itr)->IsInvitedToBGInstanceGUID && !m_SelectionPools[i].AddGroup((*itr), maxPlayers)) if (!(*itr)->IsInvitedToBGInstanceGUID && !m_SelectionPools[i].AddGroup((*itr), maxPlayers))
break; break;
} }
} }
//premade selection pools are set // premade selection pools are set
return true; return true;
} }
} }
@ -634,13 +634,13 @@ bool BattleGroundQueue::CheckPremadeMatch(BattleGroundBracketId bracket_id, uint
GroupsQueueType::iterator itr = m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE + i].begin(); GroupsQueueType::iterator itr = m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE + i].begin();
if (!(*itr)->IsInvitedToBGInstanceGUID && ((*itr)->JoinTime < time_before || (*itr)->Players.size() < MinPlayersPerTeam)) if (!(*itr)->IsInvitedToBGInstanceGUID && ((*itr)->JoinTime < time_before || (*itr)->Players.size() < MinPlayersPerTeam))
{ {
//we must insert group to normal queue and erase pointer from premade queue // we must insert group to normal queue and erase pointer from premade queue
m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + i].push_front((*itr)); m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + i].push_front((*itr));
m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE + i].erase(itr); m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE + i].erase(itr);
} }
} }
} }
//selection pools are not set // selection pools are not set
return false; return false;
} }
@ -661,15 +661,15 @@ bool BattleGroundQueue::CheckNormalMatch(BattleGround* bg_template, BattleGround
} }
} }
} }
//try to invite same number of players - this cycle may cause longer wait time even if there are enough players in queue, but we want ballanced bg // try to invite same number of players - this cycle may cause longer wait time even if there are enough players in queue, but we want ballanced bg
uint32 j = BG_TEAM_ALLIANCE; uint32 j = BG_TEAM_ALLIANCE;
if (m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() < m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount()) if (m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() < m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount())
j = BG_TEAM_HORDE; j = BG_TEAM_HORDE;
if (sWorld.getConfig(CONFIG_UINT32_BATTLEGROUND_INVITATION_TYPE) != 0 if (sWorld.getConfig(CONFIG_UINT32_BATTLEGROUND_INVITATION_TYPE) != 0
&& m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() >= minPlayers && m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() >= minPlayers) && m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() >= minPlayers && m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() >= minPlayers)
{ {
//we will try to invite more groups to team with less players indexed by j // we will try to invite more groups to team with less players indexed by j
++(itr_team[j]); //this will not cause a crash, because for cycle above reached break; ++(itr_team[j]); // this will not cause a crash, because for cycle above reached break;
for (; itr_team[j] != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + j].end(); ++(itr_team[j])) for (; itr_team[j] != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + j].end(); ++(itr_team[j]))
{ {
if (!(*(itr_team[j]))->IsInvitedToBGInstanceGUID) if (!(*(itr_team[j]))->IsInvitedToBGInstanceGUID)
@ -680,10 +680,10 @@ bool BattleGroundQueue::CheckNormalMatch(BattleGround* bg_template, BattleGround
if (abs((int32)(m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() - m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount())) > 2) if (abs((int32)(m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() - m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount())) > 2)
return false; return false;
} }
//allow 1v0 if debug bg // allow 1v0 if debug bg
if (sBattleGroundMgr.isTesting() && bg_template->isBattleGround() && (m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() || m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount())) if (sBattleGroundMgr.isTesting() && bg_template->isBattleGround() && (m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() || m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount()))
return true; return true;
//return true if there are enough players in selection pools - enable to work .debug bg command correctly // return true if there are enough players in selection pools - enable to work .debug bg command correctly
return m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() >= minPlayers && m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() >= minPlayers; return m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() >= minPlayers && m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() >= minPlayers;
} }
@ -701,11 +701,11 @@ bool BattleGroundQueue::CheckSkirmishForSameFaction(BattleGroundBracketId bracke
otherTeamIdx = BG_TEAM_ALLIANCE; otherTeamIdx = BG_TEAM_ALLIANCE;
otherTeamId = ALLIANCE; otherTeamId = ALLIANCE;
} }
//clear other team's selection // clear other team's selection
m_SelectionPools[otherTeamIdx].Init(); m_SelectionPools[otherTeamIdx].Init();
//store last ginfo pointer // store last ginfo pointer
GroupQueueInfo* ginfo = m_SelectionPools[teamIdx].SelectedGroups.back(); GroupQueueInfo* ginfo = m_SelectionPools[teamIdx].SelectedGroups.back();
//set itr_team to group that was added to selection pool latest // set itr_team to group that was added to selection pool latest
GroupsQueueType::iterator itr_team = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + teamIdx].begin(); GroupsQueueType::iterator itr_team = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + teamIdx].begin();
for (; itr_team != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + teamIdx].end(); ++itr_team) for (; itr_team != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + teamIdx].end(); ++itr_team)
if (ginfo == *itr_team) if (ginfo == *itr_team)
@ -714,24 +714,24 @@ bool BattleGroundQueue::CheckSkirmishForSameFaction(BattleGroundBracketId bracke
return false; return false;
GroupsQueueType::iterator itr_team2 = itr_team; GroupsQueueType::iterator itr_team2 = itr_team;
++itr_team2; ++itr_team2;
//invite players to other selection pool // invite players to other selection pool
for (; itr_team2 != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + teamIdx].end(); ++itr_team2) for (; itr_team2 != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + teamIdx].end(); ++itr_team2)
{ {
//if selection pool is full then break; // if selection pool is full then break;
if (!(*itr_team2)->IsInvitedToBGInstanceGUID && !m_SelectionPools[otherTeamIdx].AddGroup(*itr_team2, minPlayersPerTeam)) if (!(*itr_team2)->IsInvitedToBGInstanceGUID && !m_SelectionPools[otherTeamIdx].AddGroup(*itr_team2, minPlayersPerTeam))
break; break;
} }
if (m_SelectionPools[otherTeamIdx].GetPlayerCount() != minPlayersPerTeam) if (m_SelectionPools[otherTeamIdx].GetPlayerCount() != minPlayersPerTeam)
return false; return false;
//here we have correct 2 selections and we need to change one teams team and move selection pool teams to other team's queue // here we have correct 2 selections and we need to change one teams team and move selection pool teams to other team's queue
for (GroupsQueueType::iterator itr = m_SelectionPools[otherTeamIdx].SelectedGroups.begin(); itr != m_SelectionPools[otherTeamIdx].SelectedGroups.end(); ++itr) for (GroupsQueueType::iterator itr = m_SelectionPools[otherTeamIdx].SelectedGroups.begin(); itr != m_SelectionPools[otherTeamIdx].SelectedGroups.end(); ++itr)
{ {
//set correct team // set correct team
(*itr)->GroupTeam = otherTeamId; (*itr)->GroupTeam = otherTeamId;
//add team to other queue // add team to other queue
m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + otherTeamIdx].push_front(*itr); m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + otherTeamIdx].push_front(*itr);
//remove team from old queue // remove team from old queue
GroupsQueueType::iterator itr2 = itr_team; GroupsQueueType::iterator itr2 = itr_team;
++itr2; ++itr2;
for (; itr2 != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + teamIdx].end(); ++itr2) for (; itr2 != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + teamIdx].end(); ++itr2)
@ -753,15 +753,15 @@ should be called from BattleGround::RemovePlayer function in some cases
*/ */
void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BattleGroundBracketId bracket_id, ArenaType arenaType, bool isRated, uint32 arenaRating) void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BattleGroundBracketId bracket_id, ArenaType arenaType, bool isRated, uint32 arenaRating)
{ {
//ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_Lock); // ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_Lock);
//if no players in queue - do nothing // if no players in queue - do nothing
if (m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE].empty() && if (m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE].empty() &&
m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_HORDE].empty() && m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_HORDE].empty() &&
m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].empty() && m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].empty() &&
m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].empty()) m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].empty())
return; return;
//battleground with free slot for player should be always in the beggining of the queue // battleground with free slot for player should be always in the beggining of the queue
// maybe it would be better to create bgfreeslotqueue for each bracket_id // maybe it would be better to create bgfreeslotqueue for each bracket_id
BGFreeSlotQueueType::iterator itr, next; BGFreeSlotQueueType::iterator itr, next;
for (itr = sBattleGroundMgr.BGFreeSlotQueue[bgTypeId].begin(); itr != sBattleGroundMgr.BGFreeSlotQueue[bgTypeId].end(); itr = next) for (itr = sBattleGroundMgr.BGFreeSlotQueue[bgTypeId].begin(); itr != sBattleGroundMgr.BGFreeSlotQueue[bgTypeId].end(); itr = next)
@ -772,7 +772,7 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BattleGroundBracketI
if ((*itr)->isBattleGround() && (*itr)->GetTypeID() == bgTypeId && (*itr)->GetBracketId() == bracket_id && if ((*itr)->isBattleGround() && (*itr)->GetTypeID() == bgTypeId && (*itr)->GetBracketId() == bracket_id &&
(*itr)->GetStatus() > STATUS_WAIT_QUEUE && (*itr)->GetStatus() < STATUS_WAIT_LEAVE) (*itr)->GetStatus() > STATUS_WAIT_QUEUE && (*itr)->GetStatus() < STATUS_WAIT_LEAVE)
{ {
BattleGround* bg = *itr; //we have to store battleground pointer here, because when battleground is full, it is removed from free queue (not yet implemented!!) BattleGround* bg = *itr; // we have to store battleground pointer here, because when battleground is full, it is removed from free queue (not yet implemented!!)
// and iterator is invalid // and iterator is invalid
// clear selection pools // clear selection pools
@ -826,7 +826,7 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BattleGroundBracketI
} }
else else
{ {
//this switch can be much shorter // this switch can be much shorter
MaxPlayersPerTeam = arenaType; MaxPlayersPerTeam = arenaType;
MinPlayersPerTeam = arenaType; MinPlayersPerTeam = arenaType;
/*switch(arenaType) /*switch(arenaType)
@ -852,23 +852,23 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BattleGroundBracketI
if (bg_template->isBattleGround()) if (bg_template->isBattleGround())
{ {
//check if there is premade against premade match // check if there is premade against premade match
if (CheckPremadeMatch(bracket_id, MinPlayersPerTeam, MaxPlayersPerTeam)) if (CheckPremadeMatch(bracket_id, MinPlayersPerTeam, MaxPlayersPerTeam))
{ {
//create new battleground // create new battleground
BattleGround* bg2 = sBattleGroundMgr.CreateNewBattleGround(bgTypeId, bracketEntry, ARENA_TYPE_NONE, false); BattleGround* bg2 = sBattleGroundMgr.CreateNewBattleGround(bgTypeId, bracketEntry, ARENA_TYPE_NONE, false);
if (!bg2) if (!bg2)
{ {
sLog.outError("BattleGroundQueue::Update - Cannot create battleground: %u", bgTypeId); sLog.outError("BattleGroundQueue::Update - Cannot create battleground: %u", bgTypeId);
return; return;
} }
//invite those selection pools // invite those selection pools
for (uint8 i = 0; i < BG_TEAMS_COUNT; ++i) for (uint8 i = 0; i < BG_TEAMS_COUNT; ++i)
for (GroupsQueueType::const_iterator citr = m_SelectionPools[BG_TEAM_ALLIANCE + i].SelectedGroups.begin(); citr != m_SelectionPools[BG_TEAM_ALLIANCE + i].SelectedGroups.end(); ++citr) for (GroupsQueueType::const_iterator citr = m_SelectionPools[BG_TEAM_ALLIANCE + i].SelectedGroups.begin(); citr != m_SelectionPools[BG_TEAM_ALLIANCE + i].SelectedGroups.end(); ++citr)
InviteGroupToBG((*citr), bg2, (*citr)->GroupTeam); InviteGroupToBG((*citr), bg2, (*citr)->GroupTeam);
//start bg // start bg
bg2->StartBattleGround(); bg2->StartBattleGround();
//clear structures // clear structures
m_SelectionPools[BG_TEAM_ALLIANCE].Init(); m_SelectionPools[BG_TEAM_ALLIANCE].Init();
m_SelectionPools[BG_TEAM_HORDE].Init(); m_SelectionPools[BG_TEAM_HORDE].Init();
} }
@ -922,10 +922,10 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BattleGroundBracketI
arenaRating = front1->ArenaTeamRating; arenaRating = front1->ArenaTeamRating;
} }
else if (!front1 && !front2) else if (!front1 && !front2)
return; //queues are empty return; // queues are empty
} }
//set rating range // set rating range
uint32 arenaMinRating = (arenaRating <= sBattleGroundMgr.GetMaxRatingDifference()) ? 0 : arenaRating - sBattleGroundMgr.GetMaxRatingDifference(); uint32 arenaMinRating = (arenaRating <= sBattleGroundMgr.GetMaxRatingDifference()) ? 0 : arenaRating - sBattleGroundMgr.GetMaxRatingDifference();
uint32 arenaMaxRating = arenaRating + sBattleGroundMgr.GetMaxRatingDifference(); uint32 arenaMaxRating = arenaRating + sBattleGroundMgr.GetMaxRatingDifference();
// if max rating difference is set and the time past since server startup is greater than the rating discard time // if max rating difference is set and the time past since server startup is greater than the rating discard time
@ -938,7 +938,7 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BattleGroundBracketI
GroupsQueueType::iterator itr_team[BG_TEAMS_COUNT]; GroupsQueueType::iterator itr_team[BG_TEAMS_COUNT];
//optimalization : --- we dont need to use selection_pools - each update we select max 2 groups // optimalization : --- we dont need to use selection_pools - each update we select max 2 groups
for (uint8 i = BG_QUEUE_PREMADE_ALLIANCE; i < BG_QUEUE_NORMAL_ALLIANCE; ++i) for (uint8 i = BG_QUEUE_PREMADE_ALLIANCE; i < BG_QUEUE_NORMAL_ALLIANCE; ++i)
{ {
@ -993,7 +993,7 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BattleGroundBracketI
} }
} }
//if we have 2 teams, then start new arena and invite players! // if we have 2 teams, then start new arena and invite players!
if (m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() && m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount()) if (m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() && m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount())
{ {
BattleGround* arena = sBattleGroundMgr.CreateNewBattleGround(bgTypeId, bracketEntry, arenaType, true); BattleGround* arena = sBattleGroundMgr.CreateNewBattleGround(bgTypeId, bracketEntry, arenaType, true);
@ -1045,7 +1045,7 @@ bool BGQueueInviteEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
return true; return true;
BattleGround* bg = sBattleGroundMgr.GetBattleGround(m_BgInstanceGUID, m_BgTypeId); BattleGround* bg = sBattleGroundMgr.GetBattleGround(m_BgInstanceGUID, m_BgTypeId);
//if battleground ended and its instance deleted - do nothing // if battleground ended and its instance deleted - do nothing
if (!bg) if (!bg)
return true; return true;
@ -1058,17 +1058,17 @@ bool BGQueueInviteEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
if (bgQueue.IsPlayerInvited(m_PlayerGuid, m_BgInstanceGUID, m_RemoveTime)) if (bgQueue.IsPlayerInvited(m_PlayerGuid, m_BgInstanceGUID, m_RemoveTime))
{ {
WorldPacket data; WorldPacket data;
//we must send remaining time in queue // we must send remaining time in queue
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME - INVITATION_REMIND_TIME, 0, m_ArenaType); sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME - INVITATION_REMIND_TIME, 0, m_ArenaType);
plr->GetSession()->SendPacket(&data); plr->GetSession()->SendPacket(&data);
} }
} }
return true; //event will be deleted return true; // event will be deleted
} }
void BGQueueInviteEvent::Abort(uint64 /*e_time*/) void BGQueueInviteEvent::Abort(uint64 /*e_time*/)
{ {
//do nothing // do nothing
} }
/* /*
@ -1088,8 +1088,8 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
return true; return true;
BattleGround* bg = sBattleGroundMgr.GetBattleGround(m_BgInstanceGUID, m_BgTypeId); BattleGround* bg = sBattleGroundMgr.GetBattleGround(m_BgInstanceGUID, m_BgTypeId);
//battleground can be deleted already when we are removing queue info // battleground can be deleted already when we are removing queue info
//bg pointer can be NULL! so use it carefully! // bg pointer can be NULL! so use it carefully!
uint32 queueSlot = plr->GetBattleGroundQueueIndex(m_BgQueueTypeId); uint32 queueSlot = plr->GetBattleGroundQueueIndex(m_BgQueueTypeId);
if (queueSlot < PLAYER_MAX_BATTLEGROUND_QUEUES) // player is in queue, or in Battleground if (queueSlot < PLAYER_MAX_BATTLEGROUND_QUEUES) // player is in queue, or in Battleground
@ -1102,7 +1102,7 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
plr->RemoveBattleGroundQueueId(m_BgQueueTypeId); plr->RemoveBattleGroundQueueId(m_BgQueueTypeId);
bgQueue.RemovePlayer(m_PlayerGuid, true); bgQueue.RemovePlayer(m_PlayerGuid, true);
//update queues if battleground isn't ended // update queues if battleground isn't ended
if (bg && bg->isBattleGround() && bg->GetStatus() != STATUS_WAIT_LEAVE) if (bg && bg->isBattleGround() && bg->GetStatus() != STATUS_WAIT_LEAVE)
sBattleGroundMgr.ScheduleQueueUpdate(0, ARENA_TYPE_NONE, m_BgQueueTypeId, m_BgTypeId, bg->GetBracketId()); sBattleGroundMgr.ScheduleQueueUpdate(0, ARENA_TYPE_NONE, m_BgQueueTypeId, m_BgTypeId, bg->GetBracketId());
@ -1112,13 +1112,13 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
} }
} }
//event will be deleted // event will be deleted
return true; return true;
} }
void BGQueueRemoveEvent::Abort(uint64 /*e_time*/) void BGQueueRemoveEvent::Abort(uint64 /*e_time*/)
{ {
//do nothing // do nothing
} }
/*********************************************************/ /*********************************************************/
@ -1160,12 +1160,12 @@ void BattleGroundMgr::Update(uint32 diff)
{ {
std::vector<uint64> scheduled; std::vector<uint64> scheduled;
{ {
//create mutex // create mutex
//ACE_Guard<ACE_Thread_Mutex> guard(SchedulerLock); // ACE_Guard<ACE_Thread_Mutex> guard(SchedulerLock);
//copy vector and clear the other // copy vector and clear the other
scheduled = std::vector<uint64>(m_QueueUpdateScheduler); scheduled = std::vector<uint64>(m_QueueUpdateScheduler);
m_QueueUpdateScheduler.clear(); m_QueueUpdateScheduler.clear();
//release lock // release lock
} }
for (uint8 i = 0; i < scheduled.size(); ++i) for (uint8 i = 0; i < scheduled.size(); ++i)
@ -1407,8 +1407,8 @@ void BattleGroundMgr::BuildPlayerJoinedBattleGroundPacket(WorldPacket* data, Pla
BattleGround* BattleGroundMgr::GetBattleGroundThroughClientInstance(uint32 instanceId, BattleGroundTypeId bgTypeId) BattleGround* BattleGroundMgr::GetBattleGroundThroughClientInstance(uint32 instanceId, BattleGroundTypeId bgTypeId)
{ {
//cause at HandleBattleGroundJoinOpcode the clients sends the instanceid he gets from // cause at HandleBattleGroundJoinOpcode the clients sends the instanceid he gets from
//SMSG_BATTLEFIELD_LIST we need to find the battleground with this clientinstance-id // SMSG_BATTLEFIELD_LIST we need to find the battleground with this clientinstance-id
BattleGround* bg = GetBattleGroundTemplate(bgTypeId); BattleGround* bg = GetBattleGroundTemplate(bgTypeId);
if (!bg) if (!bg)
return NULL; return NULL;
@ -1426,7 +1426,7 @@ BattleGround* BattleGroundMgr::GetBattleGroundThroughClientInstance(uint32 insta
BattleGround* BattleGroundMgr::GetBattleGround(uint32 InstanceID, BattleGroundTypeId bgTypeId) BattleGround* BattleGroundMgr::GetBattleGround(uint32 InstanceID, BattleGroundTypeId bgTypeId)
{ {
//search if needed // search if needed
BattleGroundSet::iterator itr; BattleGroundSet::iterator itr;
if (bgTypeId == BATTLEGROUND_TYPE_NONE) if (bgTypeId == BATTLEGROUND_TYPE_NONE)
{ {
@ -1444,14 +1444,14 @@ BattleGround* BattleGroundMgr::GetBattleGround(uint32 InstanceID, BattleGroundTy
BattleGround* BattleGroundMgr::GetBattleGroundTemplate(BattleGroundTypeId bgTypeId) BattleGround* BattleGroundMgr::GetBattleGroundTemplate(BattleGroundTypeId bgTypeId)
{ {
//map is sorted and we can be sure that lowest instance id has only BG template // map is sorted and we can be sure that lowest instance id has only BG template
return m_BattleGrounds[bgTypeId].empty() ? NULL : m_BattleGrounds[bgTypeId].begin()->second; return m_BattleGrounds[bgTypeId].empty() ? NULL : m_BattleGrounds[bgTypeId].begin()->second;
} }
uint32 BattleGroundMgr::CreateClientVisibleInstanceId(BattleGroundTypeId bgTypeId, BattleGroundBracketId bracket_id) uint32 BattleGroundMgr::CreateClientVisibleInstanceId(BattleGroundTypeId bgTypeId, BattleGroundBracketId bracket_id)
{ {
if (IsArenaType(bgTypeId)) if (IsArenaType(bgTypeId))
return 0; //arenas don't have client-instanceids return 0; // arenas don't have client-instanceids
// we create here an instanceid, which is just for // we create here an instanceid, which is just for
// displaying this to the client and without any other use.. // displaying this to the client and without any other use..
@ -1463,7 +1463,7 @@ uint32 BattleGroundMgr::CreateClientVisibleInstanceId(BattleGroundTypeId bgTypeI
ClientBattleGroundIdSet& ids = m_ClientBattleGroundIds[bgTypeId][bracket_id]; ClientBattleGroundIdSet& ids = m_ClientBattleGroundIds[bgTypeId][bracket_id];
for (ClientBattleGroundIdSet::const_iterator itr = ids.begin(); itr != ids.end();) for (ClientBattleGroundIdSet::const_iterator itr = ids.begin(); itr != ids.end();)
{ {
if ((++lastId) != *itr) //if there is a gap between the ids, we will break.. if ((++lastId) != *itr) // if there is a gap between the ids, we will break..
break; break;
lastId = *itr; lastId = *itr;
} }
@ -1482,7 +1482,7 @@ BattleGround* BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeId
return NULL; return NULL;
} }
//for arenas there is random map used // for arenas there is random map used
if (bg_template->isArena()) if (bg_template->isArena())
{ {
BattleGroundTypeId arenas[] = { BATTLEGROUND_NA, BATTLEGROUND_BE, BATTLEGROUND_RL/*, BATTLEGROUND_DS, BATTLEGROUND_RV*/ }; BattleGroundTypeId arenas[] = { BATTLEGROUND_NA, BATTLEGROUND_BE, BATTLEGROUND_RL/*, BATTLEGROUND_DS, BATTLEGROUND_RV*/ };
@ -1539,7 +1539,7 @@ BattleGround* BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeId
bg = new BattleGroundRB(*(BattleGroundRB*)bg_template); bg = new BattleGroundRB(*(BattleGroundRB*)bg_template);
break; break;
default: default:
//error, but it is handled few lines above // error, but it is handled few lines above
return 0; return 0;
} }
@ -1645,7 +1645,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
uint32 MinPlayersPerTeam = fields[1].GetUInt32(); uint32 MinPlayersPerTeam = fields[1].GetUInt32();
uint32 MaxPlayersPerTeam = fields[2].GetUInt32(); uint32 MaxPlayersPerTeam = fields[2].GetUInt32();
//check values from DB // check values from DB
if (MaxPlayersPerTeam == 0 || MinPlayersPerTeam == 0) if (MaxPlayersPerTeam == 0 || MinPlayersPerTeam == 0)
{ {
sLog.outErrorDb("Table `battleground_template` for id %u have wrong min/max players per team settings. BG not created.", bgTypeID); sLog.outErrorDb("Table `battleground_template` for id %u have wrong min/max players per team settings. BG not created.", bgTypeID);
@ -1704,7 +1704,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
continue; continue;
} }
//sLog.outDetail("Creating battleground %s, %u-%u", bl->name[sWorld.GetDBClang()], MinLvl, MaxLvl); // sLog.outDetail("Creating battleground %s, %u-%u", bl->name[sWorld.GetDBClang()], MinLvl, MaxLvl);
if (!CreateBattleGround(bgTypeID, IsArena, MinPlayersPerTeam, MaxPlayersPerTeam, bl->minLevel, bl->maxLevel, bl->name[sWorld.GetDefaultDbcLocale()], bl->mapid[0], AStartLoc[0], AStartLoc[1], AStartLoc[2], AStartLoc[3], HStartLoc[0], HStartLoc[1], HStartLoc[2], HStartLoc[3])) if (!CreateBattleGround(bgTypeID, IsArena, MinPlayersPerTeam, MaxPlayersPerTeam, bl->minLevel, bl->maxLevel, bl->name[sWorld.GetDefaultDbcLocale()], bl->mapid[0], AStartLoc[0], AStartLoc[1], AStartLoc[2], AStartLoc[3], HStartLoc[0], HStartLoc[1], HStartLoc[2], HStartLoc[3]))
continue; continue;
@ -1746,10 +1746,10 @@ void BattleGroundMgr::DistributeArenaPoints()
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_START); sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_START);
//temporary structure for storing maximum points to add values for all players // temporary structure for storing maximum points to add values for all players
std::map<uint32, uint32> PlayerPoints; std::map<uint32, uint32> PlayerPoints;
//at first update all points for all team members // at first update all points for all team members
for (ObjectMgr::ArenaTeamMap::iterator team_itr = sObjectMgr.GetArenaTeamMapBegin(); team_itr != sObjectMgr.GetArenaTeamMapEnd(); ++team_itr) for (ObjectMgr::ArenaTeamMap::iterator team_itr = sObjectMgr.GetArenaTeamMapBegin(); team_itr != sObjectMgr.GetArenaTeamMapEnd(); ++team_itr)
{ {
if (ArenaTeam* at = team_itr->second) if (ArenaTeam* at = team_itr->second)
@ -1758,12 +1758,12 @@ void BattleGroundMgr::DistributeArenaPoints()
} }
} }
//cycle that gives points to all players // cycle that gives points to all players
for (std::map<uint32, uint32>::iterator plr_itr = PlayerPoints.begin(); plr_itr != PlayerPoints.end(); ++plr_itr) for (std::map<uint32, uint32>::iterator plr_itr = PlayerPoints.begin(); plr_itr != PlayerPoints.end(); ++plr_itr)
{ {
//update to database // update to database
CharacterDatabase.PExecute("UPDATE characters SET arenaPoints = arenaPoints + '%u' WHERE guid = '%u'", plr_itr->second, plr_itr->first); CharacterDatabase.PExecute("UPDATE characters SET arenaPoints = arenaPoints + '%u' WHERE guid = '%u'", plr_itr->second, plr_itr->first);
//add points if player is online // add points if player is online
if (Player* pl = sObjectMgr.GetPlayer(ObjectGuid(HIGHGUID_PLAYER, plr_itr->first))) if (Player* pl = sObjectMgr.GetPlayer(ObjectGuid(HIGHGUID_PLAYER, plr_itr->first)))
pl->ModifyArenaPoints(plr_itr->second); pl->ModifyArenaPoints(plr_itr->second);
} }
@ -1982,8 +1982,8 @@ void BattleGroundMgr::ToggleArenaTesting()
void BattleGroundMgr::ScheduleQueueUpdate(uint32 arenaRating, ArenaType arenaType, BattleGroundQueueTypeId bgQueueTypeId, BattleGroundTypeId bgTypeId, BattleGroundBracketId bracket_id) void BattleGroundMgr::ScheduleQueueUpdate(uint32 arenaRating, ArenaType arenaType, BattleGroundQueueTypeId bgQueueTypeId, BattleGroundTypeId bgTypeId, BattleGroundBracketId bracket_id)
{ {
//ACE_Guard<ACE_Thread_Mutex> guard(SchedulerLock); // ACE_Guard<ACE_Thread_Mutex> guard(SchedulerLock);
//we will use only 1 number created of bgTypeId and bracket_id // we will use only 1 number created of bgTypeId and bracket_id
uint64 schedule_id = ((uint64)arenaRating << 32) | (arenaType << 24) | (bgQueueTypeId << 16) | (bgTypeId << 8) | bracket_id; uint64 schedule_id = ((uint64)arenaRating << 32) | (arenaType << 24) | (bgQueueTypeId << 16) | (bgTypeId << 8) | bracket_id;
bool found = false; bool found = false;
for (uint8 i = 0; i < m_QueueUpdateScheduler.size(); ++i) for (uint8 i = 0; i < m_QueueUpdateScheduler.size(); ++i)

View file

@ -29,7 +29,7 @@
typedef std::map<uint32, BattleGround*> BattleGroundSet; typedef std::map<uint32, BattleGround*> BattleGroundSet;
//this container can't be deque, because deque doesn't like removing the last element - if you remove it, it invalidates next iterator and crash appears // this container can't be deque, because deque doesn't like removing the last element - if you remove it, it invalidates next iterator and crash appears
typedef std::list<BattleGround*> BGFreeSlotQueueType; typedef std::list<BattleGround*> BGFreeSlotQueueType;
typedef UNORDERED_MAP<uint32, BattleGroundTypeId> BattleMastersMap; typedef UNORDERED_MAP<uint32, BattleGroundTypeId> BattleMastersMap;
@ -93,14 +93,14 @@ class BattleGroundQueue
uint32 GetAverageQueueWaitTime(GroupQueueInfo* ginfo, BattleGroundBracketId bracket_id); uint32 GetAverageQueueWaitTime(GroupQueueInfo* ginfo, BattleGroundBracketId bracket_id);
private: private:
//mutex that should not allow changing private data, nor allowing to update Queue during private data change. // mutex that should not allow changing private data, nor allowing to update Queue during private data change.
ACE_Recursive_Thread_Mutex m_Lock; ACE_Recursive_Thread_Mutex m_Lock;
typedef std::map<ObjectGuid, PlayerQueueInfo> QueuedPlayersMap; typedef std::map<ObjectGuid, PlayerQueueInfo> QueuedPlayersMap;
QueuedPlayersMap m_QueuedPlayers; QueuedPlayersMap m_QueuedPlayers;
//we need constant add to begin and constant remove / add from the end, therefore deque suits our problem well // we need constant add to begin and constant remove / add from the end, therefore deque suits our problem well
typedef std::list<GroupQueueInfo*> GroupsQueueType; typedef std::list<GroupQueueInfo*> GroupsQueueType;
/* /*
@ -128,7 +128,7 @@ class BattleGroundQueue
uint32 PlayerCount; uint32 PlayerCount;
}; };
//one selection pool for horde, other one for alliance // one selection pool for horde, other one for alliance
SelectionPool m_SelectionPools[BG_TEAMS_COUNT]; SelectionPool m_SelectionPools[BG_TEAMS_COUNT];
bool InviteGroupToBG(GroupQueueInfo* ginfo, BattleGround* bg, Team side); bool InviteGroupToBG(GroupQueueInfo* ginfo, BattleGround* bg, Team side);
@ -204,7 +204,7 @@ class BattleGroundMgr
/* Battlegrounds */ /* Battlegrounds */
BattleGround* GetBattleGroundThroughClientInstance(uint32 instanceId, BattleGroundTypeId bgTypeId); BattleGround* GetBattleGroundThroughClientInstance(uint32 instanceId, BattleGroundTypeId bgTypeId);
BattleGround* GetBattleGround(uint32 InstanceID, BattleGroundTypeId bgTypeId); //there must be uint32 because MAX_BATTLEGROUND_TYPE_ID means unknown BattleGround* GetBattleGround(uint32 InstanceID, BattleGroundTypeId bgTypeId); // there must be uint32 because MAX_BATTLEGROUND_TYPE_ID means unknown
BattleGround* GetBattleGroundTemplate(BattleGroundTypeId bgTypeId); BattleGround* GetBattleGroundTemplate(BattleGroundTypeId bgTypeId);
BattleGround* CreateNewBattleGround(BattleGroundTypeId bgTypeId, PvPDifficultyEntry const* bracketEntry, ArenaType arenaType, bool isRated); BattleGround* CreateNewBattleGround(BattleGroundTypeId bgTypeId, PvPDifficultyEntry const* bracketEntry, ArenaType arenaType, bool isRated);
@ -225,7 +225,7 @@ class BattleGroundMgr
void SendToBattleGround(Player* pl, uint32 InstanceID, BattleGroundTypeId bgTypeId); void SendToBattleGround(Player* pl, uint32 InstanceID, BattleGroundTypeId bgTypeId);
/* Battleground queues */ /* Battleground queues */
//these queues are instantiated when creating BattlegroundMrg // these queues are instantiated when creating BattlegroundMrg
BattleGroundQueue m_BattleGroundQueues[MAX_BATTLEGROUND_QUEUE_TYPES]; // public, because we need to access them in BG handler code BattleGroundQueue m_BattleGroundQueues[MAX_BATTLEGROUND_QUEUE_TYPES]; // public, because we need to access them in BG handler code
BGFreeSlotQueueType BGFreeSlotQueue[MAX_BATTLEGROUND_TYPE_ID]; BGFreeSlotQueueType BGFreeSlotQueue[MAX_BATTLEGROUND_TYPE_ID];
@ -287,7 +287,7 @@ class BattleGroundMgr
BattleGroundSet m_BattleGrounds[MAX_BATTLEGROUND_TYPE_ID]; BattleGroundSet m_BattleGrounds[MAX_BATTLEGROUND_TYPE_ID];
std::vector<uint64> m_QueueUpdateScheduler; std::vector<uint64> m_QueueUpdateScheduler;
typedef std::set<uint32> ClientBattleGroundIdSet; typedef std::set<uint32> ClientBattleGroundIdSet;
ClientBattleGroundIdSet m_ClientBattleGroundIds[MAX_BATTLEGROUND_TYPE_ID][MAX_BATTLEGROUND_BRACKETS]; //the instanceids just visible for the client ClientBattleGroundIdSet m_ClientBattleGroundIds[MAX_BATTLEGROUND_TYPE_ID][MAX_BATTLEGROUND_BRACKETS]; // the instanceids just visible for the client
uint32 m_NextRatingDiscardUpdate; uint32 m_NextRatingDiscardUpdate;
time_t m_NextAutoDistributionTime; time_t m_NextAutoDistributionTime;
uint32 m_AutoDistributionTimeChecker; uint32 m_AutoDistributionTimeChecker;

View file

@ -30,7 +30,7 @@ BattleGroundNA::BattleGroundNA()
m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S; m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S; m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE; m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE;
//we must set messageIds // we must set messageIds
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS; m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS;
m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS; m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS;
@ -64,7 +64,7 @@ void BattleGroundNA::StartingEventOpenDoors()
void BattleGroundNA::AddPlayer(Player* plr) void BattleGroundNA::AddPlayer(Player* plr)
{ {
BattleGround::AddPlayer(plr); BattleGround::AddPlayer(plr);
//create score and add it to map, default values are set in constructor // create score and add it to map, default values are set in constructor
BattleGroundNAScore* sc = new BattleGroundNAScore; BattleGroundNAScore* sc = new BattleGroundNAScore;
m_PlayerScores[plr->GetObjectGuid()] = sc; m_PlayerScores[plr->GetObjectGuid()] = sc;
@ -114,8 +114,8 @@ void BattleGroundNA::HandleAreaTrigger(Player* source, uint32 trigger)
if (GetStatus() != STATUS_IN_PROGRESS) if (GetStatus() != STATUS_IN_PROGRESS)
return; return;
//uint32 spellId = 0; // uint32 spellId = 0;
//uint64 buff_guid = 0; // uint64 buff_guid = 0;
switch (trigger) switch (trigger)
{ {
case 4536: // buff trigger? case 4536: // buff trigger?
@ -127,7 +127,7 @@ void BattleGroundNA::HandleAreaTrigger(Player* source, uint32 trigger)
break; break;
} }
//if (buff_guid) // if (buff_guid)
// HandleTriggerBuff(buff_guid, source); // HandleTriggerBuff(buff_guid, source);
} }
@ -140,7 +140,7 @@ void BattleGroundNA::FillInitialWorldStates(WorldPacket& data, uint32& count)
void BattleGroundNA::Reset() void BattleGroundNA::Reset()
{ {
//call parent's class reset // call parent's class reset
BattleGround::Reset(); BattleGround::Reset();
} }

View file

@ -25,7 +25,7 @@ class BattleGroundNAScore : public BattleGroundScore
public: public:
BattleGroundNAScore() {}; BattleGroundNAScore() {};
virtual ~BattleGroundNAScore() {}; virtual ~BattleGroundNAScore() {};
//TODO fix me // TODO fix me
}; };
class BattleGroundNA : public BattleGround class BattleGroundNA : public BattleGround

View file

@ -23,7 +23,7 @@
BattleGroundRB::BattleGroundRB() BattleGroundRB::BattleGroundRB()
{ {
//TODO FIX ME! // TODO FIX ME!
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = 0; m_StartMessageIds[BG_STARTING_EVENT_FIRST] = 0;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_WS_START_ONE_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_WS_START_ONE_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_WS_START_HALF_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_WS_START_HALF_MINUTE;
@ -51,7 +51,7 @@ void BattleGroundRB::StartingEventOpenDoors()
void BattleGroundRB::AddPlayer(Player* plr) void BattleGroundRB::AddPlayer(Player* plr)
{ {
BattleGround::AddPlayer(plr); BattleGround::AddPlayer(plr);
//create score and add it to map, default values are set in constructor // create score and add it to map, default values are set in constructor
BattleGroundABGScore* sc = new BattleGroundABGScore; BattleGroundABGScore* sc = new BattleGroundABGScore;
m_PlayerScores[plr->GetObjectGuid()] = sc; m_PlayerScores[plr->GetObjectGuid()] = sc;

View file

@ -44,7 +44,7 @@ class BattleGroundRB : public BattleGround
void RemovePlayer(Player* plr, ObjectGuid guid); void RemovePlayer(Player* plr, ObjectGuid guid);
void HandleAreaTrigger(Player* source, uint32 trigger); void HandleAreaTrigger(Player* source, uint32 trigger);
//bool SetupBattleGround(); // bool SetupBattleGround();
/* Scorekeeping */ /* Scorekeeping */
void UpdatePlayerScore(Player* source, uint32 type, uint32 value); void UpdatePlayerScore(Player* source, uint32 type, uint32 value);

View file

@ -30,7 +30,7 @@ BattleGroundRL::BattleGroundRL()
m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S; m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S; m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE; m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE;
//we must set messageIds // we must set messageIds
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS; m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS;
m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS; m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS;
@ -63,7 +63,7 @@ void BattleGroundRL::StartingEventOpenDoors()
void BattleGroundRL::AddPlayer(Player* plr) void BattleGroundRL::AddPlayer(Player* plr)
{ {
BattleGround::AddPlayer(plr); BattleGround::AddPlayer(plr);
//create score and add it to map, default values are set in constructor // create score and add it to map, default values are set in constructor
BattleGroundRLScore* sc = new BattleGroundRLScore; BattleGroundRLScore* sc = new BattleGroundRLScore;
m_PlayerScores[plr->GetObjectGuid()] = sc; m_PlayerScores[plr->GetObjectGuid()] = sc;
@ -114,8 +114,8 @@ void BattleGroundRL::HandleAreaTrigger(Player* source, uint32 trigger)
if (GetStatus() != STATUS_IN_PROGRESS) if (GetStatus() != STATUS_IN_PROGRESS)
return; return;
//uint32 spellId = 0; // uint32 spellId = 0;
//uint64 buff_guid = 0; // uint64 buff_guid = 0;
switch (trigger) switch (trigger)
{ {
case 4696: // buff trigger? case 4696: // buff trigger?
@ -127,7 +127,7 @@ void BattleGroundRL::HandleAreaTrigger(Player* source, uint32 trigger)
break; break;
} }
//if (buff_guid) // if (buff_guid)
// HandleTriggerBuff(buff_guid, source); // HandleTriggerBuff(buff_guid, source);
} }
@ -140,7 +140,7 @@ void BattleGroundRL::FillInitialWorldStates(WorldPacket& data, uint32& count)
void BattleGroundRL::Reset() void BattleGroundRL::Reset()
{ {
//call parent's reset // call parent's reset
BattleGround::Reset(); BattleGround::Reset();
} }

View file

@ -25,7 +25,7 @@ class BattleGroundRLScore : public BattleGroundScore
public: public:
BattleGroundRLScore() {}; BattleGroundRLScore() {};
virtual ~BattleGroundRLScore() {}; virtual ~BattleGroundRLScore() {};
//TODO fix me // TODO fix me
}; };
class BattleGroundRL : public BattleGround class BattleGroundRL : public BattleGround

View file

@ -28,7 +28,7 @@ BattleGroundRV::BattleGroundRV()
m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S; m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S; m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE; m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE;
//we must set messageIds // we must set messageIds
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS; m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS;
m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS; m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS;
@ -56,7 +56,7 @@ void BattleGroundRV::StartingEventOpenDoors()
void BattleGroundRV::AddPlayer(Player* plr) void BattleGroundRV::AddPlayer(Player* plr)
{ {
BattleGround::AddPlayer(plr); BattleGround::AddPlayer(plr);
//create score and add it to map, default values are set in constructor // create score and add it to map, default values are set in constructor
BattleGroundRVScore* sc = new BattleGroundRVScore; BattleGroundRVScore* sc = new BattleGroundRVScore;
m_PlayerScores[plr->GetObjectGuid()] = sc; m_PlayerScores[plr->GetObjectGuid()] = sc;

View file

@ -25,7 +25,7 @@ class BattleGroundRVScore : public BattleGroundScore
public: public:
BattleGroundRVScore() {}; BattleGroundRVScore() {};
virtual ~BattleGroundRVScore() {}; virtual ~BattleGroundRVScore() {};
//TODO fix me // TODO fix me
}; };
class BattleGroundRV : public BattleGround class BattleGroundRV : public BattleGround

View file

@ -23,7 +23,7 @@
BattleGroundSA::BattleGroundSA() BattleGroundSA::BattleGroundSA()
{ {
//TODO FIX ME! // TODO FIX ME!
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = 0; m_StartMessageIds[BG_STARTING_EVENT_FIRST] = 0;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_WS_START_ONE_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_WS_START_ONE_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_WS_START_HALF_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_WS_START_HALF_MINUTE;
@ -51,7 +51,7 @@ void BattleGroundSA::StartingEventOpenDoors()
void BattleGroundSA::AddPlayer(Player* plr) void BattleGroundSA::AddPlayer(Player* plr)
{ {
BattleGround::AddPlayer(plr); BattleGround::AddPlayer(plr);
//create score and add it to map, default values are set in constructor // create score and add it to map, default values are set in constructor
BattleGroundSAScore* sc = new BattleGroundSAScore; BattleGroundSAScore* sc = new BattleGroundSAScore;
m_PlayerScores[plr->GetObjectGuid()] = sc; m_PlayerScores[plr->GetObjectGuid()] = sc;

View file

@ -47,7 +47,7 @@ class BattleGroundSA : public BattleGround
void RemovePlayer(Player* plr, ObjectGuid guid); void RemovePlayer(Player* plr, ObjectGuid guid);
void HandleAreaTrigger(Player* source, uint32 trigger); void HandleAreaTrigger(Player* source, uint32 trigger);
//bool SetupBattleGround(); // bool SetupBattleGround();
/* Scorekeeping */ /* Scorekeeping */
void UpdatePlayerScore(Player* source, uint32 type, uint32 value); void UpdatePlayerScore(Player* source, uint32 type, uint32 value);

View file

@ -135,7 +135,7 @@ void BattleGroundWS::StartingEventOpenDoors()
void BattleGroundWS::AddPlayer(Player* plr) void BattleGroundWS::AddPlayer(Player* plr)
{ {
BattleGround::AddPlayer(plr); BattleGround::AddPlayer(plr);
//create score and add it to map, default values are set in constructor // create score and add it to map, default values are set in constructor
BattleGroundWGScore* sc = new BattleGroundWGScore; BattleGroundWGScore* sc = new BattleGroundWGScore;
m_PlayerScores[plr->GetObjectGuid()] = sc; m_PlayerScores[plr->GetObjectGuid()] = sc;
@ -158,7 +158,7 @@ void BattleGroundWS::RespawnFlag(Team team, bool captured)
if (captured) if (captured)
{ {
//when map_update will be allowed for battlegrounds this code will be useless // when map_update will be allowed for battlegrounds this code will be useless
SpawnEvent(WS_EVENT_FLAG_A, 0, true); SpawnEvent(WS_EVENT_FLAG_A, 0, true);
SpawnEvent(WS_EVENT_FLAG_H, 0, true); SpawnEvent(WS_EVENT_FLAG_H, 0, true);
SendMessageToAll(LANG_BG_WS_F_PLACED, CHAT_MSG_BG_SYSTEM_NEUTRAL); SendMessageToAll(LANG_BG_WS_F_PLACED, CHAT_MSG_BG_SYSTEM_NEUTRAL);
@ -226,7 +226,7 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player* source)
PlaySoundToAll(BG_WS_SOUND_FLAG_CAPTURED_HORDE); PlaySoundToAll(BG_WS_SOUND_FLAG_CAPTURED_HORDE);
RewardReputationToTeam(889, m_ReputationCapture, HORDE); RewardReputationToTeam(889, m_ReputationCapture, HORDE);
} }
//for flag capture is reward 2 honorable kills // for flag capture is reward 2 honorable kills
RewardHonorToTeam(GetBonusHonorFromKill(2), source->GetTeam()); RewardHonorToTeam(GetBonusHonorFromKill(2), source->GetTeam());
// despawn flags // despawn flags
@ -352,7 +352,7 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player* source, GameObject* target
uint8 event = (sBattleGroundMgr.GetGameObjectEventIndex(target_obj->GetGUIDLow())).event1; uint8 event = (sBattleGroundMgr.GetGameObjectEventIndex(target_obj->GetGUIDLow())).event1;
//alliance flag picked up from base // alliance flag picked up from base
if (source->GetTeam() == HORDE && GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_BASE if (source->GetTeam() == HORDE && GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_BASE
&& event == WS_EVENT_FLAG_A) && event == WS_EVENT_FLAG_A)
{ {
@ -362,13 +362,13 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player* source, GameObject* target
SpawnEvent(WS_EVENT_FLAG_A, 0, false); SpawnEvent(WS_EVENT_FLAG_A, 0, false);
SetAllianceFlagPicker(source->GetObjectGuid()); SetAllianceFlagPicker(source->GetObjectGuid());
m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_PLAYER; m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_PLAYER;
//update world state to show correct flag carrier // update world state to show correct flag carrier
UpdateFlagState(HORDE, BG_WS_FLAG_STATE_ON_PLAYER); UpdateFlagState(HORDE, BG_WS_FLAG_STATE_ON_PLAYER);
UpdateWorldState(BG_WS_FLAG_UNK_ALLIANCE, 1); UpdateWorldState(BG_WS_FLAG_UNK_ALLIANCE, 1);
source->CastSpell(source, BG_WS_SPELL_SILVERWING_FLAG, true); source->CastSpell(source, BG_WS_SPELL_SILVERWING_FLAG, true);
} }
//horde flag picked up from base // horde flag picked up from base
if (source->GetTeam() == ALLIANCE && GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_BASE if (source->GetTeam() == ALLIANCE && GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_BASE
&& event == WS_EVENT_FLAG_H) && event == WS_EVENT_FLAG_H)
{ {
@ -378,13 +378,13 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player* source, GameObject* target
SpawnEvent(WS_EVENT_FLAG_H, 0, false); SpawnEvent(WS_EVENT_FLAG_H, 0, false);
SetHordeFlagPicker(source->GetObjectGuid()); SetHordeFlagPicker(source->GetObjectGuid());
m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_PLAYER; m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_PLAYER;
//update world state to show correct flag carrier // update world state to show correct flag carrier
UpdateFlagState(ALLIANCE, BG_WS_FLAG_STATE_ON_PLAYER); UpdateFlagState(ALLIANCE, BG_WS_FLAG_STATE_ON_PLAYER);
UpdateWorldState(BG_WS_FLAG_UNK_HORDE, 1); UpdateWorldState(BG_WS_FLAG_UNK_HORDE, 1);
source->CastSpell(source, BG_WS_SPELL_WARSONG_FLAG, true); source->CastSpell(source, BG_WS_SPELL_WARSONG_FLAG, true);
} }
//Alliance flag on ground(not in base) (returned or picked up again from ground!) // Alliance flag on ground(not in base) (returned or picked up again from ground!)
if (GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_GROUND && source->IsWithinDistInMap(target_obj, 10)) if (GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_GROUND && source->IsWithinDistInMap(target_obj, 10))
{ {
if (source->GetTeam() == ALLIANCE) if (source->GetTeam() == ALLIANCE)
@ -408,11 +408,11 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player* source, GameObject* target
UpdateFlagState(HORDE, BG_WS_FLAG_STATE_ON_PLAYER); UpdateFlagState(HORDE, BG_WS_FLAG_STATE_ON_PLAYER);
UpdateWorldState(BG_WS_FLAG_UNK_ALLIANCE, 1); UpdateWorldState(BG_WS_FLAG_UNK_ALLIANCE, 1);
} }
//called in HandleGameObjectUseOpcode: // called in HandleGameObjectUseOpcode:
//target_obj->Delete(); // target_obj->Delete();
} }
//Horde flag on ground(not in base) (returned or picked up again) // Horde flag on ground(not in base) (returned or picked up again)
if (GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_GROUND && source->IsWithinDistInMap(target_obj, 10)) if (GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_GROUND && source->IsWithinDistInMap(target_obj, 10))
{ {
if (source->GetTeam() == HORDE) if (source->GetTeam() == HORDE)
@ -436,8 +436,8 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player* source, GameObject* target
UpdateFlagState(ALLIANCE, BG_WS_FLAG_STATE_ON_PLAYER); UpdateFlagState(ALLIANCE, BG_WS_FLAG_STATE_ON_PLAYER);
UpdateWorldState(BG_WS_FLAG_UNK_HORDE, 1); UpdateWorldState(BG_WS_FLAG_UNK_HORDE, 1);
} }
//called in HandleGameObjectUseOpcode: // called in HandleGameObjectUseOpcode:
//target_obj->Delete(); // target_obj->Delete();
} }
if (!message_id) if (!message_id)
@ -496,8 +496,8 @@ void BattleGroundWS::HandleAreaTrigger(Player* source, uint32 trigger)
if (GetStatus() != STATUS_IN_PROGRESS) if (GetStatus() != STATUS_IN_PROGRESS)
return; return;
//uint32 SpellId = 0; // uint32 SpellId = 0;
//uint64 buff_guid = 0; // uint64 buff_guid = 0;
switch (trigger) switch (trigger)
{ {
case 3686: // Alliance elixir of speed spawn. Trigger not working, because located inside other areatrigger, can be replaced by IsWithinDist(object, dist) in BattleGround::Update(). case 3686: // Alliance elixir of speed spawn. Trigger not working, because located inside other areatrigger, can be replaced by IsWithinDist(object, dist) in BattleGround::Update().
@ -536,7 +536,7 @@ bool BattleGroundWS::SetupBattleGround()
void BattleGroundWS::Reset() void BattleGroundWS::Reset()
{ {
//call parent's class reset // call parent's class reset
BattleGround::Reset(); BattleGround::Reset();
// spiritguides and flags not spawned at beginning // spiritguides and flags not spawned at beginning
@ -562,12 +562,12 @@ void BattleGroundWS::Reset()
void BattleGroundWS::EndBattleGround(Team winner) void BattleGroundWS::EndBattleGround(Team winner)
{ {
//win reward // win reward
if (winner == ALLIANCE) if (winner == ALLIANCE)
RewardHonorToTeam(GetBonusHonorFromKill(m_HonorWinKills), ALLIANCE); RewardHonorToTeam(GetBonusHonorFromKill(m_HonorWinKills), ALLIANCE);
if (winner == HORDE) if (winner == HORDE)
RewardHonorToTeam(GetBonusHonorFromKill(m_HonorWinKills), HORDE); RewardHonorToTeam(GetBonusHonorFromKill(m_HonorWinKills), HORDE);
//complete map_end rewards (even if no team wins) // complete map_end rewards (even if no team wins)
RewardHonorToTeam(GetBonusHonorFromKill(m_HonorEndKills), ALLIANCE); RewardHonorToTeam(GetBonusHonorFromKill(m_HonorEndKills), ALLIANCE);
RewardHonorToTeam(GetBonusHonorFromKill(m_HonorEndKills), HORDE); RewardHonorToTeam(GetBonusHonorFromKill(m_HonorEndKills), HORDE);
@ -607,11 +607,11 @@ void BattleGroundWS::UpdatePlayerScore(Player* source, uint32 type, uint32 value
WorldSafeLocsEntry const* BattleGroundWS::GetClosestGraveYard(Player* player) WorldSafeLocsEntry const* BattleGroundWS::GetClosestGraveYard(Player* player)
{ {
//if status in progress, it returns main graveyards with spiritguides // if status in progress, it returns main graveyards with spiritguides
//else it will return the graveyard in the flagroom - this is especially good // else it will return the graveyard in the flagroom - this is especially good
//if a player dies in preparation phase - then the player can't cheat // if a player dies in preparation phase - then the player can't cheat
//and teleport to the graveyard outside the flagroom // and teleport to the graveyard outside the flagroom
//and start running around, while the doors are still closed // and start running around, while the doors are still closed
if (player->GetTeam() == ALLIANCE) if (player->GetTeam() == ALLIANCE)
{ {
if (GetStatus() == STATUS_IN_PROGRESS) if (GetStatus() == STATUS_IN_PROGRESS)

View file

@ -85,8 +85,8 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/)
data << ""; // Holidays.dbc textureFilename data << ""; // Holidays.dbc textureFilename
} }
*/ */
//DEBUG_LOG("Sending calendar"); // DEBUG_LOG("Sending calendar");
//data.hexlike(); // data.hexlike();
SendPacket(&data); SendPacket(&data);
} }
@ -119,20 +119,20 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data)
recv_data.hexlike(); recv_data.hexlike();
recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam
//std::string unk1, unk2; // std::string unk1, unk2;
//recv_data >> (std::string)unk1; // recv_data >> (std::string)unk1;
//recv_data >> (std::string)unk2; // recv_data >> (std::string)unk2;
//uint8 unk3, unk4; // uint8 unk3, unk4;
//uint32 unk5, unk6, unk7, unk8, unk9, count = 0; // uint32 unk5, unk6, unk7, unk8, unk9, count = 0;
//recv_data >> (uint8)unk3; // recv_data >> (uint8)unk3;
//recv_data >> (uint8)unk4; // recv_data >> (uint8)unk4;
//recv_data >> (uint32)unk5; // recv_data >> (uint32)unk5;
//recv_data >> (uint32)unk6; // recv_data >> (uint32)unk6;
//recv_data >> (uint32)unk7; // recv_data >> (uint32)unk7;
//recv_data >> (uint32)unk8; // recv_data >> (uint32)unk8;
//recv_data >> (uint32)unk9; // recv_data >> (uint32)unk9;
//if (!((unk9 >> 6) & 1)) // if (!((unk9 >> 6) & 1))
//{ //{
// recv_data >> (uint32)count; // recv_data >> (uint32)count;
// if (count) // if (count)
@ -155,17 +155,17 @@ void WorldSession::HandleCalendarUpdateEvent(WorldPacket& recv_data)
recv_data.hexlike(); recv_data.hexlike();
recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam
//recv_data >> uint64 // recv_data >> uint64
//recv_data >> uint64 // recv_data >> uint64
//recv_data >> std::string // recv_data >> std::string
//recv_data >> std::string // recv_data >> std::string
//recv_data >> uint8 // recv_data >> uint8
//recv_data >> uint8 // recv_data >> uint8
//recv_data >> uint32 // recv_data >> uint32
//recv_data >> uint32 // recv_data >> uint32
//recv_data >> uint32 // recv_data >> uint32
//recv_data >> uint32 // recv_data >> uint32
//recv_data >> uint32 // recv_data >> uint32
} }
void WorldSession::HandleCalendarRemoveEvent(WorldPacket& recv_data) void WorldSession::HandleCalendarRemoveEvent(WorldPacket& recv_data)
@ -174,9 +174,9 @@ void WorldSession::HandleCalendarRemoveEvent(WorldPacket& recv_data)
recv_data.hexlike(); recv_data.hexlike();
recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam
//recv_data >> uint64 // recv_data >> uint64
//recv_data >> uint64 // recv_data >> uint64
//recv_data >> uint32 // recv_data >> uint32
} }
@ -186,9 +186,9 @@ void WorldSession::HandleCalendarCopyEvent(WorldPacket& recv_data)
recv_data.hexlike(); recv_data.hexlike();
recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam
//recv_data >> uint64 // recv_data >> uint64
//recv_data >> uint64 // recv_data >> uint64
//recv_data >> uint32 // recv_data >> uint32
} }
@ -198,11 +198,11 @@ void WorldSession::HandleCalendarEventInvite(WorldPacket& recv_data)
recv_data.hexlike(); recv_data.hexlike();
recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam
//recv_data >> uint64 // recv_data >> uint64
//recv_data >> uint64 // recv_data >> uint64
//recv_data >> std::string // recv_data >> std::string
//recv_data >> uint8 // recv_data >> uint8
//recv_data >> uint8 // recv_data >> uint8
} }
@ -212,9 +212,9 @@ void WorldSession::HandleCalendarEventRsvp(WorldPacket& recv_data)
recv_data.hexlike(); recv_data.hexlike();
recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam
//recv_data >> uint64 // recv_data >> uint64
//recv_data >> uint64 // recv_data >> uint64
//recv_data >> uint32 // recv_data >> uint32
} }
void WorldSession::HandleCalendarEventRemoveInvite(WorldPacket& recv_data) void WorldSession::HandleCalendarEventRemoveInvite(WorldPacket& recv_data)
@ -223,10 +223,10 @@ void WorldSession::HandleCalendarEventRemoveInvite(WorldPacket& recv_data)
recv_data.hexlike(); recv_data.hexlike();
recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam
//recv_data.readPackGUID(guid) // recv_data.readPackGUID(guid)
//recv_data >> uint64 // recv_data >> uint64
//recv_data >> uint64 // recv_data >> uint64
//recv_data >> uint64 // recv_data >> uint64
} }
void WorldSession::HandleCalendarEventStatus(WorldPacket& recv_data) void WorldSession::HandleCalendarEventStatus(WorldPacket& recv_data)
@ -235,11 +235,11 @@ void WorldSession::HandleCalendarEventStatus(WorldPacket& recv_data)
recv_data.hexlike(); recv_data.hexlike();
recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam
//recv_data.readPackGUID(guid) // recv_data.readPackGUID(guid)
//recv_data >> uint64 // recv_data >> uint64
//recv_data >> uint64 // recv_data >> uint64
//recv_data >> uint64 // recv_data >> uint64
//recv_data >> uint32 // recv_data >> uint32
} }
void WorldSession::HandleCalendarEventModeratorStatus(WorldPacket& recv_data) void WorldSession::HandleCalendarEventModeratorStatus(WorldPacket& recv_data)
@ -248,11 +248,11 @@ void WorldSession::HandleCalendarEventModeratorStatus(WorldPacket& recv_data)
recv_data.hexlike(); recv_data.hexlike();
recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam
//recv_data.readPackGUID(guid) // recv_data.readPackGUID(guid)
//recv_data >> uint64 // recv_data >> uint64
//recv_data >> uint64 // recv_data >> uint64
//recv_data >> uint64 // recv_data >> uint64
//recv_data >> uint32 // recv_data >> uint32
} }
void WorldSession::HandleCalendarComplain(WorldPacket& recv_data) void WorldSession::HandleCalendarComplain(WorldPacket& recv_data)
@ -261,9 +261,9 @@ void WorldSession::HandleCalendarComplain(WorldPacket& recv_data)
recv_data.hexlike(); recv_data.hexlike();
recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam
//recv_data >> uint64 // recv_data >> uint64
//recv_data >> uint64 // recv_data >> uint64
//recv_data >> uint64 // recv_data >> uint64
} }
void WorldSession::HandleCalendarGetNumPending(WorldPacket& /*recv_data*/) void WorldSession::HandleCalendarGetNumPending(WorldPacket& /*recv_data*/)

View file

@ -64,21 +64,21 @@ Cell::Visit(const CellPair& standing_cell, TypeContainerVisitor<T, CONTAINER>& v
if (standing_cell.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || standing_cell.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP) if (standing_cell.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || standing_cell.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP)
return; return;
//no jokes here... Actually placing ASSERT() here was good idea, but // no jokes here... Actually placing ASSERT() here was good idea, but
//we had some problems with DynamicObjects, which pass radius = 0.0f (DB issue?) // we had some problems with DynamicObjects, which pass radius = 0.0f (DB issue?)
//maybe it is better to just return when radius <= 0.0f? // maybe it is better to just return when radius <= 0.0f?
if (radius <= 0.0f) if (radius <= 0.0f)
{ {
m.Visit(*this, visitor); m.Visit(*this, visitor);
return; return;
} }
//lets limit the upper value for search radius // lets limit the upper value for search radius
if (radius > 333.0f) if (radius > 333.0f)
radius = 333.0f; radius = 333.0f;
//lets calculate object coord offsets from cell borders. // lets calculate object coord offsets from cell borders.
CellArea area = Cell::CalculateCellArea(x, y, radius); CellArea area = Cell::CalculateCellArea(x, y, radius);
//if radius fits inside standing cell // if radius fits inside standing cell
if (!area) if (!area)
{ {
m.Visit(*this, visitor); m.Visit(*this, visitor);
@ -87,18 +87,18 @@ Cell::Visit(const CellPair& standing_cell, TypeContainerVisitor<T, CONTAINER>& v
CellPair& begin_cell = area.low_bound; CellPair& begin_cell = area.low_bound;
CellPair& end_cell = area.high_bound; CellPair& end_cell = area.high_bound;
//visit all cells, found in CalculateCellArea() // visit all cells, found in CalculateCellArea()
//if radius is known to reach cell area more than 4x4 then we should call optimized VisitCircle // if radius is known to reach cell area more than 4x4 then we should call optimized VisitCircle
//currently this technique works with MAX_NUMBER_OF_CELLS 16 and higher, with lower values // currently this technique works with MAX_NUMBER_OF_CELLS 16 and higher, with lower values
//there are nothing to optimize because SIZE_OF_GRID_CELL is too big... // there are nothing to optimize because SIZE_OF_GRID_CELL is too big...
if (((end_cell.x_coord - begin_cell.x_coord) > 4) && ((end_cell.y_coord - begin_cell.y_coord) > 4)) if (((end_cell.x_coord - begin_cell.x_coord) > 4) && ((end_cell.y_coord - begin_cell.y_coord) > 4))
{ {
VisitCircle(visitor, m, begin_cell, end_cell); VisitCircle(visitor, m, begin_cell, end_cell);
return; return;
} }
//ALWAYS visit standing cell first!!! Since we deal with small radiuses // ALWAYS visit standing cell first!!! Since we deal with small radiuses
//it is very essential to call visitor for standing cell firstly... // it is very essential to call visitor for standing cell firstly...
m.Visit(*this, visitor); m.Visit(*this, visitor);
// loop the cell range // loop the cell range
@ -107,7 +107,7 @@ Cell::Visit(const CellPair& standing_cell, TypeContainerVisitor<T, CONTAINER>& v
for (uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; ++y) for (uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; ++y)
{ {
CellPair cell_pair(x, y); CellPair cell_pair(x, y);
//lets skip standing cell since we already visited it // lets skip standing cell since we already visited it
if (cell_pair != standing_cell) if (cell_pair != standing_cell)
{ {
Cell r_zone(cell_pair); Cell r_zone(cell_pair);
@ -122,13 +122,13 @@ template<class T, class CONTAINER>
inline void inline void
Cell::VisitCircle(TypeContainerVisitor<T, CONTAINER>& visitor, Map& m, const CellPair& begin_cell, const CellPair& end_cell) const Cell::VisitCircle(TypeContainerVisitor<T, CONTAINER>& visitor, Map& m, const CellPair& begin_cell, const CellPair& end_cell) const
{ {
//here is an algorithm for 'filling' circum-squared octagon // here is an algorithm for 'filling' circum-squared octagon
uint32 x_shift = (uint32)ceilf((end_cell.x_coord - begin_cell.x_coord) * 0.3f - 0.5f); uint32 x_shift = (uint32)ceilf((end_cell.x_coord - begin_cell.x_coord) * 0.3f - 0.5f);
//lets calculate x_start/x_end coords for central strip... // lets calculate x_start/x_end coords for central strip...
const uint32 x_start = begin_cell.x_coord + x_shift; const uint32 x_start = begin_cell.x_coord + x_shift;
const uint32 x_end = end_cell.x_coord - x_shift; const uint32 x_end = end_cell.x_coord - x_shift;
//visit central strip with constant width... // visit central strip with constant width...
for (uint32 x = x_start; x <= x_end; ++x) for (uint32 x = x_start; x <= x_end; ++x)
{ {
for (uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; ++y) for (uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; ++y)
@ -140,29 +140,29 @@ Cell::VisitCircle(TypeContainerVisitor<T, CONTAINER>& visitor, Map& m, const Cel
} }
} }
//if x_shift == 0 then we have too small cell area, which were already // if x_shift == 0 then we have too small cell area, which were already
//visited at previous step, so just return from procedure... // visited at previous step, so just return from procedure...
if (x_shift == 0) if (x_shift == 0)
return; return;
uint32 y_start = end_cell.y_coord; uint32 y_start = end_cell.y_coord;
uint32 y_end = begin_cell.y_coord; uint32 y_end = begin_cell.y_coord;
//now we are visiting borders of an octagon... // now we are visiting borders of an octagon...
for (uint32 step = 1; step <= (x_start - begin_cell.x_coord); ++step) for (uint32 step = 1; step <= (x_start - begin_cell.x_coord); ++step)
{ {
//each step reduces strip height by 2 cells... // each step reduces strip height by 2 cells...
y_end += 1; y_end += 1;
y_start -= 1; y_start -= 1;
for (uint32 y = y_start; y >= y_end; --y) for (uint32 y = y_start; y >= y_end; --y)
{ {
//we visit cells symmetrically from both sides, heading from center to sides and from up to bottom // we visit cells symmetrically from both sides, heading from center to sides and from up to bottom
//e.g. filling 2 trapezoids after filling central cell strip... // e.g. filling 2 trapezoids after filling central cell strip...
CellPair cell_pair_left(x_start - step, y); CellPair cell_pair_left(x_start - step, y);
Cell r_zone_left(cell_pair_left); Cell r_zone_left(cell_pair_left);
r_zone_left.data.Part.nocreate = data.Part.nocreate; r_zone_left.data.Part.nocreate = data.Part.nocreate;
m.Visit(r_zone_left, visitor); m.Visit(r_zone_left, visitor);
//right trapezoid cell visit // right trapezoid cell visit
CellPair cell_pair_right(x_end + step, y); CellPair cell_pair_right(x_end + step, y);
Cell r_zone_right(cell_pair_right); Cell r_zone_right(cell_pair_right);
r_zone_right.data.Part.nocreate = data.Part.nocreate; r_zone_right.data.Part.nocreate = data.Part.nocreate;

View file

@ -33,9 +33,9 @@ enum ChatNotify
{ {
CHAT_JOINED_NOTICE = 0x00, //+ "%s joined channel."; CHAT_JOINED_NOTICE = 0x00, //+ "%s joined channel.";
CHAT_LEFT_NOTICE = 0x01, //+ "%s left channel."; CHAT_LEFT_NOTICE = 0x01, //+ "%s left channel.";
//CHAT_SUSPENDED_NOTICE = 0x01, // "%s left channel."; // CHAT_SUSPENDED_NOTICE = 0x01, // "%s left channel.";
CHAT_YOU_JOINED_NOTICE = 0x02, //+ "Joined Channel: [%s]"; -- You joined CHAT_YOU_JOINED_NOTICE = 0x02, //+ "Joined Channel: [%s]"; -- You joined
//CHAT_YOU_CHANGED_NOTICE = 0x02, // "Changed Channel: [%s]"; // CHAT_YOU_CHANGED_NOTICE = 0x02, // "Changed Channel: [%s]";
CHAT_YOU_LEFT_NOTICE = 0x03, //+ "Left Channel: [%s]"; -- You left CHAT_YOU_LEFT_NOTICE = 0x03, //+ "Left Channel: [%s]"; -- You left
CHAT_WRONG_PASSWORD_NOTICE = 0x04, //+ "Wrong password for %s."; CHAT_WRONG_PASSWORD_NOTICE = 0x04, //+ "Wrong password for %s.";
CHAT_NOT_MEMBER_NOTICE = 0x05, //+ "Not on channel %s."; CHAT_NOT_MEMBER_NOTICE = 0x05, //+ "Not on channel %s.";

View file

@ -42,7 +42,7 @@ void WorldSession::HandleJoinChannelOpcode(WorldPacket& recvPacket)
void WorldSession::HandleLeaveChannelOpcode(WorldPacket& recvPacket) void WorldSession::HandleLeaveChannelOpcode(WorldPacket& recvPacket)
{ {
DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); DEBUG_LOG("Opcode %u", recvPacket.GetOpcode());
//recvPacket.hexlike(); // recvPacket.hexlike();
uint32 unk; uint32 unk;
std::string channelname; std::string channelname;
@ -63,7 +63,7 @@ void WorldSession::HandleLeaveChannelOpcode(WorldPacket& recvPacket)
void WorldSession::HandleChannelListOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelListOpcode(WorldPacket& recvPacket)
{ {
DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); DEBUG_LOG("Opcode %u", recvPacket.GetOpcode());
//recvPacket.hexlike(); // recvPacket.hexlike();
std::string channelname; std::string channelname;
recvPacket >> channelname; recvPacket >> channelname;
@ -75,7 +75,7 @@ void WorldSession::HandleChannelListOpcode(WorldPacket& recvPacket)
void WorldSession::HandleChannelPasswordOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelPasswordOpcode(WorldPacket& recvPacket)
{ {
DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); DEBUG_LOG("Opcode %u", recvPacket.GetOpcode());
//recvPacket.hexlike(); // recvPacket.hexlike();
std::string channelname, pass; std::string channelname, pass;
recvPacket >> channelname; recvPacket >> channelname;
@ -89,7 +89,7 @@ void WorldSession::HandleChannelPasswordOpcode(WorldPacket& recvPacket)
void WorldSession::HandleChannelSetOwnerOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelSetOwnerOpcode(WorldPacket& recvPacket)
{ {
DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); DEBUG_LOG("Opcode %u", recvPacket.GetOpcode());
//recvPacket.hexlike(); // recvPacket.hexlike();
std::string channelname, newp; std::string channelname, newp;
recvPacket >> channelname; recvPacket >> channelname;
@ -107,7 +107,7 @@ void WorldSession::HandleChannelSetOwnerOpcode(WorldPacket& recvPacket)
void WorldSession::HandleChannelOwnerOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelOwnerOpcode(WorldPacket& recvPacket)
{ {
DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); DEBUG_LOG("Opcode %u", recvPacket.GetOpcode());
//recvPacket.hexlike(); // recvPacket.hexlike();
std::string channelname; std::string channelname;
recvPacket >> channelname; recvPacket >> channelname;
if (ChannelMgr* cMgr = channelMgr(_player->GetTeam())) if (ChannelMgr* cMgr = channelMgr(_player->GetTeam()))
@ -118,7 +118,7 @@ void WorldSession::HandleChannelOwnerOpcode(WorldPacket& recvPacket)
void WorldSession::HandleChannelModeratorOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelModeratorOpcode(WorldPacket& recvPacket)
{ {
DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); DEBUG_LOG("Opcode %u", recvPacket.GetOpcode());
//recvPacket.hexlike(); // recvPacket.hexlike();
std::string channelname, otp; std::string channelname, otp;
recvPacket >> channelname; recvPacket >> channelname;
@ -135,7 +135,7 @@ void WorldSession::HandleChannelModeratorOpcode(WorldPacket& recvPacket)
void WorldSession::HandleChannelUnmoderatorOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelUnmoderatorOpcode(WorldPacket& recvPacket)
{ {
DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); DEBUG_LOG("Opcode %u", recvPacket.GetOpcode());
//recvPacket.hexlike(); // recvPacket.hexlike();
std::string channelname, otp; std::string channelname, otp;
recvPacket >> channelname; recvPacket >> channelname;
@ -152,7 +152,7 @@ void WorldSession::HandleChannelUnmoderatorOpcode(WorldPacket& recvPacket)
void WorldSession::HandleChannelMuteOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelMuteOpcode(WorldPacket& recvPacket)
{ {
DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); DEBUG_LOG("Opcode %u", recvPacket.GetOpcode());
//recvPacket.hexlike(); // recvPacket.hexlike();
std::string channelname, otp; std::string channelname, otp;
recvPacket >> channelname; recvPacket >> channelname;
@ -169,7 +169,7 @@ void WorldSession::HandleChannelMuteOpcode(WorldPacket& recvPacket)
void WorldSession::HandleChannelUnmuteOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelUnmuteOpcode(WorldPacket& recvPacket)
{ {
DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); DEBUG_LOG("Opcode %u", recvPacket.GetOpcode());
//recvPacket.hexlike(); // recvPacket.hexlike();
std::string channelname, otp; std::string channelname, otp;
recvPacket >> channelname; recvPacket >> channelname;
@ -187,7 +187,7 @@ void WorldSession::HandleChannelUnmuteOpcode(WorldPacket& recvPacket)
void WorldSession::HandleChannelInviteOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelInviteOpcode(WorldPacket& recvPacket)
{ {
DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); DEBUG_LOG("Opcode %u", recvPacket.GetOpcode());
//recvPacket.hexlike(); // recvPacket.hexlike();
std::string channelname, otp; std::string channelname, otp;
recvPacket >> channelname; recvPacket >> channelname;
@ -204,7 +204,7 @@ void WorldSession::HandleChannelInviteOpcode(WorldPacket& recvPacket)
void WorldSession::HandleChannelKickOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelKickOpcode(WorldPacket& recvPacket)
{ {
DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); DEBUG_LOG("Opcode %u", recvPacket.GetOpcode());
//recvPacket.hexlike(); // recvPacket.hexlike();
std::string channelname, otp; std::string channelname, otp;
recvPacket >> channelname; recvPacket >> channelname;
@ -220,7 +220,7 @@ void WorldSession::HandleChannelKickOpcode(WorldPacket& recvPacket)
void WorldSession::HandleChannelBanOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelBanOpcode(WorldPacket& recvPacket)
{ {
DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); DEBUG_LOG("Opcode %u", recvPacket.GetOpcode());
//recvPacket.hexlike(); // recvPacket.hexlike();
std::string channelname, otp; std::string channelname, otp;
recvPacket >> channelname; recvPacket >> channelname;
@ -237,7 +237,7 @@ void WorldSession::HandleChannelBanOpcode(WorldPacket& recvPacket)
void WorldSession::HandleChannelUnbanOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelUnbanOpcode(WorldPacket& recvPacket)
{ {
DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); DEBUG_LOG("Opcode %u", recvPacket.GetOpcode());
//recvPacket.hexlike(); // recvPacket.hexlike();
std::string channelname, otp; std::string channelname, otp;
recvPacket >> channelname; recvPacket >> channelname;
@ -255,7 +255,7 @@ void WorldSession::HandleChannelUnbanOpcode(WorldPacket& recvPacket)
void WorldSession::HandleChannelAnnouncementsOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelAnnouncementsOpcode(WorldPacket& recvPacket)
{ {
DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); DEBUG_LOG("Opcode %u", recvPacket.GetOpcode());
//recvPacket.hexlike(); // recvPacket.hexlike();
std::string channelname; std::string channelname;
recvPacket >> channelname; recvPacket >> channelname;
if (ChannelMgr* cMgr = channelMgr(_player->GetTeam())) if (ChannelMgr* cMgr = channelMgr(_player->GetTeam()))
@ -266,7 +266,7 @@ void WorldSession::HandleChannelAnnouncementsOpcode(WorldPacket& recvPacket)
void WorldSession::HandleChannelModerateOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelModerateOpcode(WorldPacket& recvPacket)
{ {
DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); DEBUG_LOG("Opcode %u", recvPacket.GetOpcode());
//recvPacket.hexlike(); // recvPacket.hexlike();
std::string channelname; std::string channelname;
recvPacket >> channelname; recvPacket >> channelname;
if (ChannelMgr* cMgr = channelMgr(_player->GetTeam())) if (ChannelMgr* cMgr = channelMgr(_player->GetTeam()))
@ -277,7 +277,7 @@ void WorldSession::HandleChannelModerateOpcode(WorldPacket& recvPacket)
void WorldSession::HandleChannelDisplayListQueryOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelDisplayListQueryOpcode(WorldPacket& recvPacket)
{ {
DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); DEBUG_LOG("Opcode %u", recvPacket.GetOpcode());
//recvPacket.hexlike(); // recvPacket.hexlike();
std::string channelname; std::string channelname;
recvPacket >> channelname; recvPacket >> channelname;
if (ChannelMgr* cMgr = channelMgr(_player->GetTeam())) if (ChannelMgr* cMgr = channelMgr(_player->GetTeam()))
@ -288,7 +288,7 @@ void WorldSession::HandleChannelDisplayListQueryOpcode(WorldPacket& recvPacket)
void WorldSession::HandleGetChannelMemberCountOpcode(WorldPacket& recvPacket) void WorldSession::HandleGetChannelMemberCountOpcode(WorldPacket& recvPacket)
{ {
DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); DEBUG_LOG("Opcode %u", recvPacket.GetOpcode());
//recvPacket.hexlike(); // recvPacket.hexlike();
std::string channelname; std::string channelname;
recvPacket >> channelname; recvPacket >> channelname;
if (ChannelMgr* cMgr = channelMgr(_player->GetTeam())) if (ChannelMgr* cMgr = channelMgr(_player->GetTeam()))
@ -307,7 +307,7 @@ void WorldSession::HandleGetChannelMemberCountOpcode(WorldPacket& recvPacket)
void WorldSession::HandleSetChannelWatchOpcode(WorldPacket& recvPacket) void WorldSession::HandleSetChannelWatchOpcode(WorldPacket& recvPacket)
{ {
DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); DEBUG_LOG("Opcode %u", recvPacket.GetOpcode());
//recvPacket.hexlike(); // recvPacket.hexlike();
std::string channelname; std::string channelname;
recvPacket >> channelname; recvPacket >> channelname;
/*if(ChannelMgr* cMgr = channelMgr(_player->GetTeam())) /*if(ChannelMgr* cMgr = channelMgr(_player->GetTeam()))

View file

@ -641,7 +641,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
DEBUG_LOG("WORLD: Sent motd (SMSG_MOTD)"); DEBUG_LOG("WORLD: Sent motd (SMSG_MOTD)");
} }
//QueryResult *result = CharacterDatabase.PQuery("SELECT guildid,rank FROM guild_member WHERE guid = '%u'",pCurrChar->GetGUIDLow()); // QueryResult *result = CharacterDatabase.PQuery("SELECT guildid,rank FROM guild_member WHERE guid = '%u'",pCurrChar->GetGUIDLow());
QueryResult* resultGuild = holder->GetResult(PLAYER_LOGIN_QUERY_LOADGUILD); QueryResult* resultGuild = holder->GetResult(PLAYER_LOGIN_QUERY_LOADGUILD);
if (resultGuild) if (resultGuild)
@ -688,7 +688,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
pCurrChar->SendInitialPacketsBeforeAddToMap(); pCurrChar->SendInitialPacketsBeforeAddToMap();
//Show cinematic at the first time that player login // Show cinematic at the first time that player login
if (!pCurrChar->getCinematic()) if (!pCurrChar->getCinematic())
{ {
pCurrChar->setCinematic(1); pCurrChar->setCinematic(1);
@ -713,7 +713,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
} }
sObjectAccessor.AddObject(pCurrChar); sObjectAccessor.AddObject(pCurrChar);
//DEBUG_LOG("Player %s added to Map.",pCurrChar->GetName()); // DEBUG_LOG("Player %s added to Map.",pCurrChar->GetName());
pCurrChar->SendInitialPacketsAfterAddToMap(); pCurrChar->SendInitialPacketsAfterAddToMap();
@ -836,7 +836,7 @@ void WorldSession::HandleTutorialFlagOpcode(WorldPacket& recv_data)
uint32 wInt = (iFlag / 32); uint32 wInt = (iFlag / 32);
if (wInt >= 8) if (wInt >= 8)
{ {
//sLog.outError("CHEATER? Account:[%d] Guid[%u] tried to send wrong CMSG_TUTORIAL_FLAG", GetAccountId(),GetGUID()); // sLog.outError("CHEATER? Account:[%d] Guid[%u] tried to send wrong CMSG_TUTORIAL_FLAG", GetAccountId(),GetGUID());
return; return;
} }
uint32 rInt = (iFlag % 32); uint32 rInt = (iFlag % 32);
@ -845,7 +845,7 @@ void WorldSession::HandleTutorialFlagOpcode(WorldPacket& recv_data)
tutflag |= (1 << rInt); tutflag |= (1 << rInt);
SetTutorialInt(wInt, tutflag); SetTutorialInt(wInt, tutflag);
//DEBUG_LOG("Received Tutorial Flag Set {%u}.", iFlag); // DEBUG_LOG("Received Tutorial Flag Set {%u}.", iFlag);
} }
void WorldSession::HandleTutorialClearOpcode(WorldPacket& /*recv_data*/) void WorldSession::HandleTutorialClearOpcode(WorldPacket& /*recv_data*/)

View file

@ -1328,7 +1328,7 @@ bool ChatHandler::ParseCommands(const char* text)
MANGOS_ASSERT(text); MANGOS_ASSERT(text);
MANGOS_ASSERT(*text); MANGOS_ASSERT(*text);
//if(m_session->GetSecurity() == SEC_PLAYER) // if(m_session->GetSecurity() == SEC_PLAYER)
// return false; // return false;
/// chat case (.command or !command format) /// chat case (.command or !command format)
@ -2042,7 +2042,7 @@ bool ChatHandler::isValidChatMessage(const char* message)
return validSequence == validSequenceIterator; return validSequence == validSequenceIterator;
} }
//Note: target_guid used only in CHAT_MSG_WHISPER_INFORM mode (in this case channelName ignored) // Note: target_guid used only in CHAT_MSG_WHISPER_INFORM mode (in this case channelName ignored)
void ChatHandler::FillMessageData(WorldPacket* data, WorldSession* session, uint8 type, uint32 language, const char* channelName, ObjectGuid targetGuid, const char* message, Unit* speaker) void ChatHandler::FillMessageData(WorldPacket* data, WorldSession* session, uint8 type, uint32 language, const char* channelName, ObjectGuid targetGuid, const char* message, Unit* speaker)
{ {
uint32 messageLength = (message ? strlen(message) : 0) + 1; uint32 messageLength = (message ? strlen(message) : 0) + 1;

View file

@ -365,7 +365,7 @@ class MANGOS_DLL_SPEC ChatHandler
bool HandleNpcWhisperCommand(char* args); bool HandleNpcWhisperCommand(char* args);
bool HandleNpcYellCommand(char* args); bool HandleNpcYellCommand(char* args);
//TODO: NpcCommands that needs to be fixed : // TODO: NpcCommands that needs to be fixed :
bool HandleNpcAddWeaponCommand(char* args); bool HandleNpcAddWeaponCommand(char* args);
bool HandleNpcNameCommand(char* args); bool HandleNpcNameCommand(char* args);
bool HandleNpcSubNameCommand(char* args); bool HandleNpcSubNameCommand(char* args);

View file

@ -386,7 +386,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recv_data)
return; return;
WorldPacket data; WorldPacket data;
//in battleground, raid warning is sent only to players in battleground - code is ok // in battleground, raid warning is sent only to players in battleground - code is ok
ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID_WARNING, lang, msg.c_str()); ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID_WARNING, lang, msg.c_str());
group->BroadcastPacket(&data, false); group->BroadcastPacket(&data, false);
} break; } break;
@ -600,7 +600,7 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket& recv_data)
GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, text_emote, 0, unit); GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, text_emote, 0, unit);
//Send scripted event call // Send scripted event call
if (unit && unit->GetTypeId() == TYPEID_UNIT && ((Creature*)unit)->AI()) if (unit && unit->GetTypeId() == TYPEID_UNIT && ((Creature*)unit)->AI())
((Creature*)unit)->AI()->ReceiveEmote(GetPlayer(), text_emote); ((Creature*)unit)->AI()->ReceiveEmote(GetPlayer(), text_emote);
} }
@ -609,7 +609,7 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recv_data)
{ {
ObjectGuid iguid; ObjectGuid iguid;
uint8 unk; uint8 unk;
//DEBUG_LOG("WORLD: Received CMSG_CHAT_IGNORED"); // DEBUG_LOG("WORLD: Received CMSG_CHAT_IGNORED");
recv_data >> iguid; recv_data >> iguid;
recv_data >> unk; // probably related to spam reporting recv_data >> unk; // probably related to spam reporting

View file

@ -78,7 +78,7 @@ void WorldSession::HandleSetSheathedOpcode(WorldPacket& recv_data)
uint32 sheathed; uint32 sheathed;
recv_data >> sheathed; recv_data >> sheathed;
//DEBUG_LOG( "WORLD: Recvd CMSG_SETSHEATHED Message guidlow:%u value1:%u", GetPlayer()->GetGUIDLow(), sheathed ); // DEBUG_LOG( "WORLD: Recvd CMSG_SETSHEATHED Message guidlow:%u value1:%u", GetPlayer()->GetGUIDLow(), sheathed );
if (sheathed >= MAX_SHEATH_STATE) if (sheathed >= MAX_SHEATH_STATE)
{ {

View file

@ -78,8 +78,8 @@ bool Corpse::Create(uint32 guidlow, Player* owner)
WorldObject::_Create(guidlow, HIGHGUID_CORPSE, owner->GetPhaseMask()); WorldObject::_Create(guidlow, HIGHGUID_CORPSE, owner->GetPhaseMask());
Relocate(owner->GetPositionX(), owner->GetPositionY(), owner->GetPositionZ(), owner->GetOrientation()); Relocate(owner->GetPositionX(), owner->GetPositionY(), owner->GetPositionZ(), owner->GetOrientation());
//we need to assign owner's map for corpse // we need to assign owner's map for corpse
//in other way we will get a crash in Corpse::SaveToDB() // in other way we will get a crash in Corpse::SaveToDB()
SetMap(owner->GetMap()); SetMap(owner->GetMap());
if (!IsPositionValid()) if (!IsPositionValid())
@ -152,7 +152,7 @@ void Corpse::DeleteFromDB()
bool Corpse::LoadFromDB(uint32 lowguid, Field* fields) bool Corpse::LoadFromDB(uint32 lowguid, Field* fields)
{ {
//// 0 1 2 3 4 5 6 //// 0 1 2 3 4 5 6
//QueryResult *result = CharacterDatabase.Query("SELECT corpse.guid, player, corpse.position_x, corpse.position_y, corpse.position_z, corpse.orientation, corpse.map," // QueryResult *result = CharacterDatabase.Query("SELECT corpse.guid, player, corpse.position_x, corpse.position_y, corpse.position_z, corpse.orientation, corpse.map,"
//// 7 8 9 10 11 12 13 14 15 16 17 18 //// 7 8 9 10 11 12 13 14 15 16 17 18
// "time, corpse_type, instance, phaseMask, gender, race, class, playerBytes, playerBytes2, equipmentCache, guildId, playerFlags FROM corpse" // "time, corpse_type, instance, phaseMask, gender, race, class, playerBytes, playerBytes2, equipmentCache, guildId, playerFlags FROM corpse"
uint32 playerLowGuid = fields[1].GetUInt32(); uint32 playerLowGuid = fields[1].GetUInt32();

View file

@ -503,7 +503,7 @@ void Creature::Update(uint32 update_diff, uint32 diff)
else else
SetDeathState(JUST_ALIVED); SetDeathState(JUST_ALIVED);
//Call AI respawn virtual function // Call AI respawn virtual function
if (AI()) if (AI())
AI()->JustRespawned(); AI()->JustRespawned();
@ -750,9 +750,9 @@ bool Creature::Create(uint32 guidlow, CreatureCreatePos& cPos, CreatureInfo cons
if (!cPos.Relocate(this)) if (!cPos.Relocate(this))
return false; return false;
//Notify the map's instance data. // Notify the map's instance data.
//Only works if you create the object in it, not if it is moves to that map. // Only works if you create the object in it, not if it is moves to that map.
//Normally non-players do not teleport to other maps. // Normally non-players do not teleport to other maps.
if (InstanceData* iData = GetMap()->GetInstanceData()) if (InstanceData* iData = GetMap()->GetInstanceData())
iData->OnCreatureCreate(this); iData->OnCreatureCreate(this);
@ -1129,13 +1129,13 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
<< data.posY << "," << data.posY << ","
<< data.posZ << "," << data.posZ << ","
<< data.orientation << "," << data.orientation << ","
<< data.spawntimesecs << "," //respawn time << data.spawntimesecs << "," // respawn time
<< (float) data.spawndist << "," //spawn distance (float) << (float) data.spawndist << "," // spawn distance (float)
<< data.currentwaypoint << "," //currentwaypoint << data.currentwaypoint << "," // currentwaypoint
<< data.curhealth << "," //curhealth << data.curhealth << "," // curhealth
<< data.curmana << "," //curmana << data.curmana << "," // curmana
<< (data.is_dead ? 1 : 0) << "," //is_dead << (data.is_dead ? 1 : 0) << "," // is_dead
<< uint32(data.movementType) << ")"; //default movement generator type, cast to prevent save as symbol << uint32(data.movementType) << ")"; // default movement generator type, cast to prevent save as symbol
WorldDatabase.PExecuteLog("%s", ss.str().c_str()); WorldDatabase.PExecuteLog("%s", ss.str().c_str());
@ -1175,7 +1175,7 @@ void Creature::SelectLevel(const CreatureInfo* cinfo, float percentHealth, float
uint32 mana = minmana + uint32(rellevel * (maxmana - minmana)); uint32 mana = minmana + uint32(rellevel * (maxmana - minmana));
SetCreateMana(mana); SetCreateMana(mana);
SetMaxPower(POWER_MANA, mana); //MAX Mana SetMaxPower(POWER_MANA, mana); // MAX Mana
SetPower(POWER_MANA, mana); SetPower(POWER_MANA, mana);
// TODO: set UNIT_FIELD_POWER*, for some creature class case (energy, etc) // TODO: set UNIT_FIELD_POWER*, for some creature class case (energy, etc)
@ -1655,7 +1655,7 @@ SpellEntry const* Creature::ReachWithSpellAttack(Unit* pVictim)
float dist = GetCombatDistance(pVictim); float dist = GetCombatDistance(pVictim);
//if(!isInFront( pVictim, range ) && spellInfo->AttributesEx ) // if(!isInFront( pVictim, range ) && spellInfo->AttributesEx )
// continue; // continue;
if (dist > range || dist < minrange) if (dist > range || dist < minrange)
continue; continue;
@ -1704,7 +1704,7 @@ SpellEntry const* Creature::ReachWithSpellCure(Unit* pVictim)
float dist = GetCombatDistance(pVictim); float dist = GetCombatDistance(pVictim);
//if(!isInFront( pVictim, range ) && spellInfo->AttributesEx ) // if(!isInFront( pVictim, range ) && spellInfo->AttributesEx )
// continue; // continue;
if (dist > range || dist < minrange) if (dist > range || dist < minrange)
continue; continue;
@ -1889,7 +1889,7 @@ bool Creature::IsOutOfThreatArea(Unit* pVictim) const
float AttackDist = GetAttackDistance(pVictim); float AttackDist = GetAttackDistance(pVictim);
float ThreatRadius = sWorld.getConfig(CONFIG_FLOAT_THREAT_RADIUS); float ThreatRadius = sWorld.getConfig(CONFIG_FLOAT_THREAT_RADIUS);
//Use AttackDistance in distance check if threat radius is lower. This prevents creature bounce in and out 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 !pVictim->IsWithinDist3d(m_combatStartX, m_combatStartY, m_combatStartZ, return !pVictim->IsWithinDist3d(m_combatStartX, m_combatStartY, m_combatStartZ,
ThreatRadius > AttackDist ? ThreatRadius : AttackDist); ThreatRadius > AttackDist ? ThreatRadius : AttackDist);
} }
@ -1911,7 +1911,7 @@ CreatureDataAddon const* Creature::GetCreatureAddon() const
return ObjectMgr::GetCreatureTemplateAddon(GetEntry()); return ObjectMgr::GetCreatureTemplateAddon(GetEntry());
} }
//creature_addon table // creature_addon table
bool Creature::LoadCreatureAddon(bool reload) bool Creature::LoadCreatureAddon(bool reload)
{ {
CreatureDataAddon const* cainfo = GetCreatureAddon(); CreatureDataAddon const* cainfo = GetCreatureAddon();
@ -1929,7 +1929,7 @@ bool Creature::LoadCreatureAddon(bool reload)
// 3 StandMiscFlags // 3 StandMiscFlags
SetByteValue(UNIT_FIELD_BYTES_1, 0, uint8(cainfo->bytes1 & 0xFF)); SetByteValue(UNIT_FIELD_BYTES_1, 0, uint8(cainfo->bytes1 & 0xFF));
//SetByteValue(UNIT_FIELD_BYTES_1, 1, uint8((cainfo->bytes1 >> 8) & 0xFF)); // SetByteValue(UNIT_FIELD_BYTES_1, 1, uint8((cainfo->bytes1 >> 8) & 0xFF));
SetByteValue(UNIT_FIELD_BYTES_1, 1, 0); SetByteValue(UNIT_FIELD_BYTES_1, 1, 0);
SetByteValue(UNIT_FIELD_BYTES_1, 2, uint8((cainfo->bytes1 >> 16) & 0xFF)); SetByteValue(UNIT_FIELD_BYTES_1, 2, uint8((cainfo->bytes1 >> 16) & 0xFF));
SetByteValue(UNIT_FIELD_BYTES_1, 3, uint8((cainfo->bytes1 >> 24) & 0xFF)); SetByteValue(UNIT_FIELD_BYTES_1, 3, uint8((cainfo->bytes1 >> 24) & 0xFF));
@ -1945,8 +1945,8 @@ bool Creature::LoadCreatureAddon(bool reload)
if (cainfo->pvp_state != 0) if (cainfo->pvp_state != 0)
SetByteValue(UNIT_FIELD_BYTES_2, 1, cainfo->pvp_state); SetByteValue(UNIT_FIELD_BYTES_2, 1, cainfo->pvp_state);
//SetByteValue(UNIT_FIELD_BYTES_2, 2, 0); // SetByteValue(UNIT_FIELD_BYTES_2, 2, 0);
//SetByteValue(UNIT_FIELD_BYTES_2, 3, 0); // SetByteValue(UNIT_FIELD_BYTES_2, 3, 0);
if (cainfo->emote != 0) if (cainfo->emote != 0)
SetUInt32Value(UNIT_NPC_EMOTESTATE, cainfo->emote); SetUInt32Value(UNIT_NPC_EMOTESTATE, cainfo->emote);
@ -2223,7 +2223,7 @@ void Creature::GetRespawnCoord(float& x, float& y, float& z, float* ori, float*
*dist = GetRespawnRadius(); *dist = GetRespawnRadius();
} }
//lets check if our creatures have valid spawn coordinates // lets check if our creatures have valid spawn coordinates
MANGOS_ASSERT(MaNGOS::IsValidMapCoord(x, y, z) || PrintCoordinatesError(x, y, z, "respawn")); MANGOS_ASSERT(MaNGOS::IsValidMapCoord(x, y, z) || PrintCoordinatesError(x, y, z, "respawn"));
} }
@ -2494,7 +2494,7 @@ struct SpawnCreatureInMapsWorker
if (map->IsLoaded(i_data->posX, i_data->posY)) if (map->IsLoaded(i_data->posX, i_data->posY))
{ {
Creature* pCreature = new Creature; Creature* pCreature = new Creature;
//DEBUG_LOG("Spawning creature %u",*itr); // DEBUG_LOG("Spawning creature %u",*itr);
if (!pCreature->LoadFromDB(i_guid, map)) if (!pCreature->LoadFromDB(i_guid, map))
{ {
delete pCreature; delete pCreature;

View file

@ -292,9 +292,9 @@ enum ChatType
// Selection method used by SelectAttackingTarget // Selection method used by SelectAttackingTarget
enum AttackingTarget enum AttackingTarget
{ {
ATTACKING_TARGET_RANDOM = 0, //Just selects a random target ATTACKING_TARGET_RANDOM = 0, // Just selects a random target
ATTACKING_TARGET_TOPAGGRO, //Selects targes from top aggro to bottom ATTACKING_TARGET_TOPAGGRO, // Selects targes from top aggro to bottom
ATTACKING_TARGET_BOTTOMAGGRO, //Selects targets from bottom aggro to top ATTACKING_TARGET_BOTTOMAGGRO, // Selects targets from bottom aggro to top
}; };
enum SelectFlags enum SelectFlags

View file

@ -51,12 +51,12 @@ enum CanCastResult
enum CastFlags enum CastFlags
{ {
CAST_INTERRUPT_PREVIOUS = 0x01, //Interrupt any spell casting CAST_INTERRUPT_PREVIOUS = 0x01, // Interrupt any spell casting
CAST_TRIGGERED = 0x02, //Triggered (this makes spell cost zero mana and have no cast time) CAST_TRIGGERED = 0x02, // Triggered (this makes spell cost zero mana and have no cast time)
CAST_FORCE_CAST = 0x04, //Forces cast even if creature is out of mana or out of range CAST_FORCE_CAST = 0x04, // Forces cast even if creature is out of mana or out of range
CAST_NO_MELEE_IF_OOM = 0x08, //Prevents creature from entering melee if out of mana or out of range CAST_NO_MELEE_IF_OOM = 0x08, // Prevents creature from entering melee if out of mana or out of range
CAST_FORCE_TARGET_SELF = 0x10, //Forces the target to cast this spell on itself CAST_FORCE_TARGET_SELF = 0x10, // Forces the target to cast this spell on itself
CAST_AURA_NOT_PRESENT = 0x20, //Only casts the spell if the target does not have an aura from the spell CAST_AURA_NOT_PRESENT = 0x20, // Only casts the spell if the target does not have an aura from the spell
}; };
class MANGOS_DLL_SPEC CreatureAI class MANGOS_DLL_SPEC CreatureAI

View file

@ -70,7 +70,7 @@ CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c)
uint32 events_count = 0; uint32 events_count = 0;
for (CreatureEventAI_Event_Vec::const_iterator i = (*creatureEventsItr).second.begin(); i != (*creatureEventsItr).second.end(); ++i) for (CreatureEventAI_Event_Vec::const_iterator i = (*creatureEventsItr).second.begin(); i != (*creatureEventsItr).second.end(); ++i)
{ {
//Debug check // Debug check
#ifndef MANGOS_DEBUG #ifndef MANGOS_DEBUG
if ((*i).event_flags & EFLAG_DEBUG_ONLY) if ((*i).event_flags & EFLAG_DEBUG_ONLY)
continue; continue;
@ -85,7 +85,7 @@ CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c)
else else
++events_count; ++events_count;
} }
//EventMap had events but they were not added because they must be for instance // EventMap had events but they were not added because they must be for instance
if (events_count == 0) if (events_count == 0)
sLog.outError("CreatureEventAI: Creature %u has events but no events added to list because of instance flags.", m_creature->GetEntry()); sLog.outError("CreatureEventAI: Creature %u has events but no events added to list because of instance flags.", m_creature->GetEntry());
else else
@ -94,7 +94,7 @@ CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c)
for (CreatureEventAI_Event_Vec::const_iterator i = (*creatureEventsItr).second.begin(); i != (*creatureEventsItr).second.end(); ++i) for (CreatureEventAI_Event_Vec::const_iterator i = (*creatureEventsItr).second.begin(); i != (*creatureEventsItr).second.end(); ++i)
{ {
//Debug check // Debug check
#ifndef MANGOS_DEBUG #ifndef MANGOS_DEBUG
if ((*i).event_flags & EFLAG_DEBUG_ONLY) if ((*i).event_flags & EFLAG_DEBUG_ONLY)
continue; continue;
@ -103,7 +103,7 @@ CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c)
{ {
if ((1 << (m_creature->GetMap()->GetSpawnMode() + 1)) & (*i).event_flags) if ((1 << (m_creature->GetMap()->GetSpawnMode() + 1)) & (*i).event_flags)
{ {
//event flagged for instance mode // event flagged for instance mode
m_CreatureEventAIList.push_back(CreatureEventAIHolder(*i)); m_CreatureEventAIList.push_back(CreatureEventAIHolder(*i));
} }
} }
@ -124,7 +124,7 @@ CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c)
m_InvinceabilityHpLevel = 0; m_InvinceabilityHpLevel = 0;
//Handle Spawned Events // Handle Spawned Events
if (!m_bEmptyList) if (!m_bEmptyList)
{ {
for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i)
@ -139,27 +139,27 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
if (!pHolder.Enabled || pHolder.Time) if (!pHolder.Enabled || pHolder.Time)
return false; return false;
//Check the inverse phase mask (event doesn't trigger if current phase bit is set in mask) // Check the inverse phase mask (event doesn't trigger if current phase bit is set in mask)
if (pHolder.Event.event_inverse_phase_mask & (1 << m_Phase)) if (pHolder.Event.event_inverse_phase_mask & (1 << m_Phase))
return false; return false;
CreatureEventAI_Event const& event = pHolder.Event; CreatureEventAI_Event const& event = pHolder.Event;
//Check event conditions based on the event type, also reset events // Check event conditions based on the event type, also reset events
switch (event.event_type) switch (event.event_type)
{ {
case EVENT_T_TIMER: case EVENT_T_TIMER:
if (!m_creature->isInCombat()) if (!m_creature->isInCombat())
return false; return false;
//Repeat Timers // Repeat Timers
pHolder.UpdateRepeatTimer(m_creature, event.timer.repeatMin, event.timer.repeatMax); pHolder.UpdateRepeatTimer(m_creature, event.timer.repeatMin, event.timer.repeatMax);
break; break;
case EVENT_T_TIMER_OOC: case EVENT_T_TIMER_OOC:
if (m_creature->isInCombat() || m_creature->IsInEvadeMode()) if (m_creature->isInCombat() || m_creature->IsInEvadeMode())
return false; return false;
//Repeat Timers // Repeat Timers
pHolder.UpdateRepeatTimer(m_creature, event.timer.repeatMin, event.timer.repeatMax); pHolder.UpdateRepeatTimer(m_creature, event.timer.repeatMin, event.timer.repeatMax);
break; break;
case EVENT_T_HP: case EVENT_T_HP:
@ -172,7 +172,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin) if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin)
return false; return false;
//Repeat Timers // Repeat Timers
pHolder.UpdateRepeatTimer(m_creature, event.percent_range.repeatMin, event.percent_range.repeatMax); pHolder.UpdateRepeatTimer(m_creature, event.percent_range.repeatMin, event.percent_range.repeatMax);
break; break;
} }
@ -186,31 +186,31 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin) if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin)
return false; return false;
//Repeat Timers // Repeat Timers
pHolder.UpdateRepeatTimer(m_creature, event.percent_range.repeatMin, event.percent_range.repeatMax); pHolder.UpdateRepeatTimer(m_creature, event.percent_range.repeatMin, event.percent_range.repeatMax);
break; break;
} }
case EVENT_T_AGGRO: case EVENT_T_AGGRO:
break; break;
case EVENT_T_KILL: case EVENT_T_KILL:
//Repeat Timers // Repeat Timers
pHolder.UpdateRepeatTimer(m_creature, event.kill.repeatMin, event.kill.repeatMax); pHolder.UpdateRepeatTimer(m_creature, event.kill.repeatMin, event.kill.repeatMax);
break; break;
case EVENT_T_DEATH: case EVENT_T_DEATH:
case EVENT_T_EVADE: case EVENT_T_EVADE:
break; break;
case EVENT_T_SPELLHIT: case EVENT_T_SPELLHIT:
//Spell hit is special case, param1 and param2 handled within CreatureEventAI::SpellHit // Spell hit is special case, param1 and param2 handled within CreatureEventAI::SpellHit
//Repeat Timers // Repeat Timers
pHolder.UpdateRepeatTimer(m_creature, event.spell_hit.repeatMin, event.spell_hit.repeatMax); pHolder.UpdateRepeatTimer(m_creature, event.spell_hit.repeatMin, event.spell_hit.repeatMax);
break; break;
case EVENT_T_RANGE: case EVENT_T_RANGE:
//Repeat Timers // Repeat Timers
pHolder.UpdateRepeatTimer(m_creature, event.range.repeatMin, event.range.repeatMax); pHolder.UpdateRepeatTimer(m_creature, event.range.repeatMin, event.range.repeatMax);
break; break;
case EVENT_T_OOC_LOS: case EVENT_T_OOC_LOS:
//Repeat Timers // Repeat Timers
pHolder.UpdateRepeatTimer(m_creature, event.ooc_los.repeatMin, event.ooc_los.repeatMax); pHolder.UpdateRepeatTimer(m_creature, event.ooc_los.repeatMin, event.ooc_los.repeatMax);
break; break;
case EVENT_T_SPAWNED: case EVENT_T_SPAWNED:
@ -225,7 +225,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin) if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin)
return false; return false;
//Repeat Timers // Repeat Timers
pHolder.UpdateRepeatTimer(m_creature, event.percent_range.repeatMin, event.percent_range.repeatMax); pHolder.UpdateRepeatTimer(m_creature, event.percent_range.repeatMin, event.percent_range.repeatMax);
break; break;
} }
@ -233,7 +233,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
if (!m_creature->isInCombat() || !m_creature->getVictim() || !m_creature->getVictim()->IsNonMeleeSpellCasted(false, false, true)) if (!m_creature->isInCombat() || !m_creature->getVictim() || !m_creature->getVictim()->IsNonMeleeSpellCasted(false, false, true))
return false; return false;
//Repeat Timers // Repeat Timers
pHolder.UpdateRepeatTimer(m_creature, event.target_casting.repeatMin, event.target_casting.repeatMax); pHolder.UpdateRepeatTimer(m_creature, event.target_casting.repeatMin, event.target_casting.repeatMax);
break; break;
case EVENT_T_FRIENDLY_HP: case EVENT_T_FRIENDLY_HP:
@ -247,7 +247,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
pActionInvoker = pUnit; pActionInvoker = pUnit;
//Repeat Timers // Repeat Timers
pHolder.UpdateRepeatTimer(m_creature, event.friendly_hp.repeatMin, event.friendly_hp.repeatMax); pHolder.UpdateRepeatTimer(m_creature, event.friendly_hp.repeatMin, event.friendly_hp.repeatMax);
break; break;
} }
@ -259,14 +259,14 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
std::list<Creature*> pList; std::list<Creature*> pList;
DoFindFriendlyCC(pList, (float)event.friendly_is_cc.radius); DoFindFriendlyCC(pList, (float)event.friendly_is_cc.radius);
//List is empty // List is empty
if (pList.empty()) if (pList.empty())
return false; return false;
//We don't really care about the whole list, just return first available // We don't really care about the whole list, just return first available
pActionInvoker = *(pList.begin()); pActionInvoker = *(pList.begin());
//Repeat Timers // Repeat Timers
pHolder.UpdateRepeatTimer(m_creature, event.friendly_is_cc.repeatMin, event.friendly_is_cc.repeatMax); pHolder.UpdateRepeatTimer(m_creature, event.friendly_is_cc.repeatMin, event.friendly_is_cc.repeatMax);
break; break;
} }
@ -275,14 +275,14 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
std::list<Creature*> pList; std::list<Creature*> pList;
DoFindFriendlyMissingBuff(pList, (float)event.friendly_buff.radius, event.friendly_buff.spellId); DoFindFriendlyMissingBuff(pList, (float)event.friendly_buff.radius, event.friendly_buff.spellId);
//List is empty // List is empty
if (pList.empty()) if (pList.empty())
return false; return false;
//We don't really care about the whole list, just return first available // We don't really care about the whole list, just return first available
pActionInvoker = *(pList.begin()); pActionInvoker = *(pList.begin());
//Repeat Timers // Repeat Timers
pHolder.UpdateRepeatTimer(m_creature, event.friendly_buff.repeatMin, event.friendly_buff.repeatMax); pHolder.UpdateRepeatTimer(m_creature, event.friendly_buff.repeatMin, event.friendly_buff.repeatMax);
break; break;
} }
@ -290,15 +290,15 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
case EVENT_T_SUMMONED_JUST_DIED: case EVENT_T_SUMMONED_JUST_DIED:
case EVENT_T_SUMMONED_JUST_DESPAWN: case EVENT_T_SUMMONED_JUST_DESPAWN:
{ {
//Prevent event from occuring on no unit or non creatures // Prevent event from occuring on no unit or non creatures
if (!pActionInvoker || pActionInvoker->GetTypeId() != TYPEID_UNIT) if (!pActionInvoker || pActionInvoker->GetTypeId() != TYPEID_UNIT)
return false; return false;
//Creature id doesn't match up // Creature id doesn't match up
if (((Creature*)pActionInvoker)->GetEntry() != event.summoned.creatureId) if (((Creature*)pActionInvoker)->GetEntry() != event.summoned.creatureId)
return false; return false;
//Repeat Timers // Repeat Timers
pHolder.UpdateRepeatTimer(m_creature, event.summoned.repeatMin, event.summoned.repeatMax); pHolder.UpdateRepeatTimer(m_creature, event.summoned.repeatMin, event.summoned.repeatMax);
break; break;
} }
@ -312,7 +312,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin) if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin)
return false; return false;
//Repeat Timers // Repeat Timers
pHolder.UpdateRepeatTimer(m_creature, event.percent_range.repeatMin, event.percent_range.repeatMax); pHolder.UpdateRepeatTimer(m_creature, event.percent_range.repeatMin, event.percent_range.repeatMax);
break; break;
} }
@ -325,7 +325,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
if (!holder || holder->GetStackAmount() < event.buffed.amount) if (!holder || holder->GetStackAmount() < event.buffed.amount)
return false; return false;
//Repeat Timers // Repeat Timers
pHolder.UpdateRepeatTimer(m_creature, event.buffed.repeatMin, event.buffed.repeatMax); pHolder.UpdateRepeatTimer(m_creature, event.buffed.repeatMin, event.buffed.repeatMax);
break; break;
} }
@ -338,7 +338,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
if (!holder || holder->GetStackAmount() < event.buffed.amount) if (!holder || holder->GetStackAmount() < event.buffed.amount)
return false; return false;
//Repeat Timers // Repeat Timers
pHolder.UpdateRepeatTimer(m_creature, event.buffed.repeatMin, event.buffed.repeatMax); pHolder.UpdateRepeatTimer(m_creature, event.buffed.repeatMin, event.buffed.repeatMax);
break; break;
} }
@ -348,7 +348,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
if (holder && holder->GetStackAmount() >= event.buffed.amount) if (holder && holder->GetStackAmount() >= event.buffed.amount)
return false; return false;
//Repeat Timers // Repeat Timers
pHolder.UpdateRepeatTimer(m_creature, event.buffed.repeatMin, event.buffed.repeatMax); pHolder.UpdateRepeatTimer(m_creature, event.buffed.repeatMin, event.buffed.repeatMax);
break; break;
} }
@ -361,7 +361,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
if (holder && holder->GetStackAmount() >= event.buffed.amount) if (holder && holder->GetStackAmount() >= event.buffed.amount)
return false; return false;
//Repeat Timers // Repeat Timers
pHolder.UpdateRepeatTimer(m_creature, event.buffed.repeatMin, event.buffed.repeatMax); pHolder.UpdateRepeatTimer(m_creature, event.buffed.repeatMin, event.buffed.repeatMax);
break; break;
} }
@ -370,24 +370,24 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
break; break;
} }
//Disable non-repeatable events // Disable non-repeatable events
if (!(pHolder.Event.event_flags & EFLAG_REPEATABLE)) if (!(pHolder.Event.event_flags & EFLAG_REPEATABLE))
pHolder.Enabled = false; pHolder.Enabled = false;
//Store random here so that all random actions match up // Store random here so that all random actions match up
uint32 rnd = rand(); uint32 rnd = rand();
//Return if chance for event is not met // Return if chance for event is not met
if (pHolder.Event.event_chance <= rnd % 100) if (pHolder.Event.event_chance <= rnd % 100)
return false; return false;
//Process actions, normal case // Process actions, normal case
if (!(pHolder.Event.event_flags & EFLAG_RANDOM_ACTION)) if (!(pHolder.Event.event_flags & EFLAG_RANDOM_ACTION))
{ {
for (uint32 j = 0; j < MAX_ACTIONS; ++j) for (uint32 j = 0; j < MAX_ACTIONS; ++j)
ProcessAction(pHolder.Event.action[j], rnd, pHolder.Event.event_id, pActionInvoker); ProcessAction(pHolder.Event.action[j], rnd, pHolder.Event.event_id, pActionInvoker);
} }
//Process actions, random case // Process actions, random case
else else
{ {
// amount of real actions // amount of real actions
@ -476,7 +476,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
{ {
if (action.morph.creatureId || action.morph.modelId) if (action.morph.creatureId || action.morph.modelId)
{ {
//set model based on entry from creature_template // set model based on entry from creature_template
if (action.morph.creatureId) if (action.morph.creatureId)
{ {
if (CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(action.morph.creatureId)) if (CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(action.morph.creatureId))
@ -485,7 +485,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
m_creature->SetDisplayId(display_id); m_creature->SetDisplayId(display_id);
} }
} }
//if no param1, then use value from param2 (modelId) // if no param1, then use value from param2 (modelId)
else else
m_creature->SetDisplayId(action.morph.modelId); m_creature->SetDisplayId(action.morph.modelId);
} }
@ -625,7 +625,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
m_CombatMovementEnabled = action.combat_movement.state != 0; m_CombatMovementEnabled = action.combat_movement.state != 0;
//Allow movement (create new targeted movement gen only if idle) // Allow movement (create new targeted movement gen only if idle)
if (m_CombatMovementEnabled) if (m_CombatMovementEnabled)
{ {
if (action.combat_movement.melee && m_creature->isInCombat()) if (action.combat_movement.melee && m_creature->isInCombat())
@ -703,7 +703,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
{ {
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)
{ {
//Drop current movement gen // Drop current movement gen
m_creature->GetMotionMaster()->Clear(false); m_creature->GetMotionMaster()->Clear(false);
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), m_AttackDistance, m_AttackAngle); m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), m_AttackDistance, m_AttackAngle);
} }
@ -743,12 +743,12 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
break; break;
} }
case ACTION_T_KILLED_MONSTER: case ACTION_T_KILLED_MONSTER:
//first attempt player/group who tapped creature // first attempt player/group who tapped creature
if (Player* pPlayer = m_creature->GetLootRecipient()) if (Player* pPlayer = m_creature->GetLootRecipient())
pPlayer->RewardPlayerAndGroupAtEvent(action.killed_monster.creatureId, m_creature); pPlayer->RewardPlayerAndGroupAtEvent(action.killed_monster.creatureId, m_creature);
else else
{ {
//if not available, use pActionInvoker // if not available, use pActionInvoker
if (Unit* pTarget = GetTargetByType(action.killed_monster.target, pActionInvoker)) if (Unit* pTarget = GetTargetByType(action.killed_monster.target, pActionInvoker))
if (Player* pPlayer2 = pTarget->GetCharmerOrOwnerPlayerOrPlayerItself()) if (Player* pPlayer2 = pTarget->GetCharmerOrOwnerPlayerOrPlayerItself())
pPlayer2->RewardPlayerAndGroupAtEvent(action.killed_monster.creatureId, m_creature); pPlayer2->RewardPlayerAndGroupAtEvent(action.killed_monster.creatureId, m_creature);
@ -845,7 +845,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
m_creature->Mount(display_id); m_creature->Mount(display_id);
} }
} }
//if no param1, then use value from param2 (modelId) // if no param1, then use value from param2 (modelId)
else else
m_creature->Mount(action.mount.modelId); m_creature->Mount(action.mount.modelId);
} }
@ -864,7 +864,7 @@ void CreatureEventAI::JustRespawned()
if (m_bEmptyList) if (m_bEmptyList)
return; return;
//Handle Spawned Events // Handle Spawned Events
for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i)
if (SpawnedEventConditionsCheck((*i).Event)) if (SpawnedEventConditionsCheck((*i).Event))
ProcessEvent(*i); ProcessEvent(*i);
@ -878,24 +878,24 @@ void CreatureEventAI::Reset()
if (m_bEmptyList) if (m_bEmptyList)
return; return;
//Reset all events to enabled // Reset all events to enabled
for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i)
{ {
CreatureEventAI_Event const& event = (*i).Event; CreatureEventAI_Event const& event = (*i).Event;
switch (event.event_type) switch (event.event_type)
{ {
//Reset all out of combat timers // Reset all out of combat timers
case EVENT_T_TIMER_OOC: case EVENT_T_TIMER_OOC:
{ {
if ((*i).UpdateRepeatTimer(m_creature, event.timer.initialMin, event.timer.initialMax)) if ((*i).UpdateRepeatTimer(m_creature, event.timer.initialMin, event.timer.initialMax))
(*i).Enabled = true; (*i).Enabled = true;
break; break;
} }
//default: // default:
//TODO: enable below code line / verify this is correct to enable events previously disabled (ex. aggro yell), instead of enable this in void Aggro() // TODO: enable below code line / verify this is correct to enable events previously disabled (ex. aggro yell), instead of enable this in void Aggro()
//(*i).Enabled = true; //(*i).Enabled = true;
//(*i).Time = 0; //(*i).Time = 0;
//break; // break;
} }
} }
} }
@ -928,7 +928,7 @@ void CreatureEventAI::EnterEvadeMode()
if (m_bEmptyList) if (m_bEmptyList)
return; return;
//Handle Evade events // Handle Evade events
for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i)
{ {
if ((*i).Event.event_type == EVENT_T_EVADE) if ((*i).Event.event_type == EVENT_T_EVADE)
@ -942,7 +942,7 @@ void CreatureEventAI::JustDied(Unit* killer)
if (m_creature->IsGuard()) if (m_creature->IsGuard())
{ {
//Send Zone Under Attack message to the LocalDefense and WorldDefense Channels // Send Zone Under Attack message to the LocalDefense and WorldDefense Channels
if (Player* pKiller = killer->GetCharmerOrOwnerPlayerOrPlayerItself()) if (Player* pKiller = killer->GetCharmerOrOwnerPlayerOrPlayerItself())
m_creature->SendZoneUnderAttackMessage(pKiller); m_creature->SendZoneUnderAttackMessage(pKiller);
} }
@ -950,7 +950,7 @@ void CreatureEventAI::JustDied(Unit* killer)
if (m_bEmptyList) if (m_bEmptyList)
return; return;
//Handle Evade events // Handle Evade events
for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i)
{ {
if ((*i).Event.event_type == EVENT_T_DEATH) if ((*i).Event.event_type == EVENT_T_DEATH)
@ -1011,7 +1011,7 @@ void CreatureEventAI::SummonedCreatureDespawn(Creature* pUnit)
void CreatureEventAI::EnterCombat(Unit* enemy) void CreatureEventAI::EnterCombat(Unit* enemy)
{ {
//Check for on combat start events // Check for on combat start events
if (!m_bEmptyList) if (!m_bEmptyList)
{ {
for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i)
@ -1023,12 +1023,12 @@ void CreatureEventAI::EnterCombat(Unit* enemy)
(*i).Enabled = true; (*i).Enabled = true;
ProcessEvent(*i, enemy); ProcessEvent(*i, enemy);
break; break;
//Reset all in combat timers // Reset all in combat timers
case EVENT_T_TIMER: case EVENT_T_TIMER:
if ((*i).UpdateRepeatTimer(m_creature, event.timer.initialMin, event.timer.initialMax)) if ((*i).UpdateRepeatTimer(m_creature, event.timer.initialMin, event.timer.initialMax))
(*i).Enabled = true; (*i).Enabled = true;
break; break;
//All normal events need to be re-enabled and their time set to 0 // All normal events need to be re-enabled and their time set to 0
default: default:
(*i).Enabled = true; (*i).Enabled = true;
(*i).Time = 0; (*i).Time = 0;
@ -1069,20 +1069,20 @@ void CreatureEventAI::MoveInLineOfSight(Unit* who)
if (!who) if (!who)
return; return;
//Check for OOC LOS Event // Check for OOC LOS Event
if (!m_bEmptyList && !m_creature->getVictim()) if (!m_bEmptyList && !m_creature->getVictim())
{ {
for (CreatureEventAIList::iterator itr = m_CreatureEventAIList.begin(); itr != m_CreatureEventAIList.end(); ++itr) for (CreatureEventAIList::iterator itr = m_CreatureEventAIList.begin(); itr != m_CreatureEventAIList.end(); ++itr)
{ {
if ((*itr).Event.event_type == EVENT_T_OOC_LOS) if ((*itr).Event.event_type == EVENT_T_OOC_LOS)
{ {
//can trigger if closer than fMaxAllowedRange // can trigger if closer than fMaxAllowedRange
float fMaxAllowedRange = (float)(*itr).Event.ooc_los.maxRange; float fMaxAllowedRange = (float)(*itr).Event.ooc_los.maxRange;
//if range is ok and we are actually in LOS // if range is ok and we are actually in LOS
if (m_creature->IsWithinDistInMap(who, fMaxAllowedRange) && m_creature->IsWithinLOSInMap(who)) if (m_creature->IsWithinDistInMap(who, fMaxAllowedRange) && m_creature->IsWithinLOSInMap(who))
{ {
//if friendly event&&who is not hostile OR hostile event&&who is hostile // if friendly event&&who is not hostile OR hostile event&&who is hostile
if (((*itr).Event.ooc_los.noHostile && !m_creature->IsHostileTo(who)) || if (((*itr).Event.ooc_los.noHostile && !m_creature->IsHostileTo(who)) ||
((!(*itr).Event.ooc_los.noHostile) && m_creature->IsHostileTo(who))) ((!(*itr).Event.ooc_los.noHostile) && m_creature->IsHostileTo(who)))
ProcessEvent(*itr, who); ProcessEvent(*itr, who);
@ -1125,7 +1125,7 @@ void CreatureEventAI::SpellHit(Unit* pUnit, const SpellEntry* pSpell)
for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i)
if ((*i).Event.event_type == EVENT_T_SPELLHIT) if ((*i).Event.event_type == EVENT_T_SPELLHIT)
//If spell id matches (or no spell id) & if spell school matches (or no spell school) // If spell id matches (or no spell id) & if spell school matches (or no spell school)
if (!(*i).Event.spell_hit.spellId || pSpell->Id == (*i).Event.spell_hit.spellId) if (!(*i).Event.spell_hit.spellId || pSpell->Id == (*i).Event.spell_hit.spellId)
if (pSpell->SchoolMask & (*i).Event.spell_hit.schoolMask) if (pSpell->SchoolMask & (*i).Event.spell_hit.schoolMask)
ProcessEvent(*i, pUnit); ProcessEvent(*i, pUnit);
@ -1133,35 +1133,35 @@ void CreatureEventAI::SpellHit(Unit* pUnit, const SpellEntry* pSpell)
void CreatureEventAI::UpdateAI(const uint32 diff) void CreatureEventAI::UpdateAI(const uint32 diff)
{ {
//Check if we are in combat (also updates calls threat update code) // Check if we are in combat (also updates calls threat update code)
bool Combat = m_creature->SelectHostileTarget() && m_creature->getVictim(); bool Combat = m_creature->SelectHostileTarget() && m_creature->getVictim();
if (!m_bEmptyList) if (!m_bEmptyList)
{ {
//Events are only updated once every EVENT_UPDATE_TIME ms to prevent lag with large amount of events // Events are only updated once every EVENT_UPDATE_TIME ms to prevent lag with large amount of events
if (m_EventUpdateTime < diff) if (m_EventUpdateTime < diff)
{ {
m_EventDiff += diff; m_EventDiff += diff;
//Check for time based events // Check for time based events
for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i)
{ {
//Decrement Timers // Decrement Timers
if ((*i).Time) if ((*i).Time)
{ {
if ((*i).Time > m_EventDiff) if ((*i).Time > m_EventDiff)
{ {
//Do not decrement timers if event cannot trigger in this phase // Do not decrement timers if event cannot trigger in this phase
if (!((*i).Event.event_inverse_phase_mask & (1 << m_Phase))) if (!((*i).Event.event_inverse_phase_mask & (1 << m_Phase)))
(*i).Time -= m_EventDiff; (*i).Time -= m_EventDiff;
//Skip processing of events that have time remaining // Skip processing of events that have time remaining
continue; continue;
} }
else (*i).Time = 0; else (*i).Time = 0;
} }
//Events that are updated every EVENT_UPDATE_TIME // Events that are updated every EVENT_UPDATE_TIME
switch ((*i).Event.event_type) switch ((*i).Event.event_type)
{ {
case EVENT_T_TIMER_OOC: case EVENT_T_TIMER_OOC:
@ -1201,7 +1201,7 @@ void CreatureEventAI::UpdateAI(const uint32 diff)
} }
} }
//Melee Auto-Attack // Melee Auto-Attack
if (Combat && m_MeleeEnabled) if (Combat && m_MeleeEnabled)
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
@ -1365,16 +1365,16 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* pSource, Unit*
bool CreatureEventAI::CanCast(Unit* Target, SpellEntry const* Spell, bool Triggered) bool CreatureEventAI::CanCast(Unit* Target, SpellEntry const* Spell, bool Triggered)
{ {
//No target so we can't cast // No target so we can't cast
if (!Target || !Spell) if (!Target || !Spell)
return false; return false;
//Silenced so we can't cast // Silenced so we can't cast
if (!Triggered && (m_creature->hasUnitState(UNIT_STAT_CAN_NOT_REACT_OR_LOST_CONTROL) || if (!Triggered && (m_creature->hasUnitState(UNIT_STAT_CAN_NOT_REACT_OR_LOST_CONTROL) ||
m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED))) m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED)))
return false; return false;
//Check for power // Check for power
if (!Triggered && m_creature->GetPower((Powers)Spell->powerType) < Spell::CalculatePowerCost(Spell, m_creature)) if (!Triggered && m_creature->GetPower((Powers)Spell->powerType) < Spell::CalculatePowerCost(Spell, m_creature))
return false; return false;
@ -1382,11 +1382,11 @@ bool CreatureEventAI::CanCast(Unit* Target, SpellEntry const* Spell, bool Trigge
TempRange = GetSpellRangeStore()->LookupEntry(Spell->rangeIndex); TempRange = GetSpellRangeStore()->LookupEntry(Spell->rangeIndex);
//Spell has invalid range store so we can't use it // Spell has invalid range store so we can't use it
if (!TempRange) if (!TempRange)
return false; return false;
//Unit is out of range of this spell // Unit is out of range of this spell
if (!m_creature->IsInRange(Target, TempRange->minRange, TempRange->maxRange)) if (!m_creature->IsInRange(Target, TempRange->minRange, TempRange->maxRange))
return false; return false;

View file

@ -117,25 +117,25 @@ enum EventAI_ActionType
enum Target enum Target
{ {
//Self (m_creature) // Self (m_creature)
TARGET_T_SELF = 0, //Self cast TARGET_T_SELF = 0, // Self cast
//Hostile targets (if pet then returns pet owner) // Hostile targets (if pet then returns pet owner)
TARGET_T_HOSTILE, //Our current target (ie: highest aggro) TARGET_T_HOSTILE, // Our current target (ie: highest aggro)
TARGET_T_HOSTILE_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks) TARGET_T_HOSTILE_SECOND_AGGRO, // Second highest aggro (generaly used for cleaves and some special attacks)
TARGET_T_HOSTILE_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for) TARGET_T_HOSTILE_LAST_AGGRO, // Dead last on aggro (no idea what this could be used for)
TARGET_T_HOSTILE_RANDOM, //Just any random target on our threat list TARGET_T_HOSTILE_RANDOM, // Just any random target on our threat list
TARGET_T_HOSTILE_RANDOM_NOT_TOP, //Any random target except top threat TARGET_T_HOSTILE_RANDOM_NOT_TOP, // Any random target except top threat
//Invoker targets (if pet then returns pet owner) // Invoker targets (if pet then returns pet owner)
TARGET_T_ACTION_INVOKER, //Unit who caused this Event to occur (only works for EVENT_T_AGGRO, EVENT_T_KILL, EVENT_T_DEATH, EVENT_T_SPELLHIT, EVENT_T_OOC_LOS, EVENT_T_FRIENDLY_HP, EVENT_T_FRIENDLY_IS_CC, EVENT_T_FRIENDLY_MISSING_BUFF) TARGET_T_ACTION_INVOKER, // Unit who caused this Event to occur (only works for EVENT_T_AGGRO, EVENT_T_KILL, EVENT_T_DEATH, EVENT_T_SPELLHIT, EVENT_T_OOC_LOS, EVENT_T_FRIENDLY_HP, EVENT_T_FRIENDLY_IS_CC, EVENT_T_FRIENDLY_MISSING_BUFF)
//Hostile targets (including pets) // Hostile targets (including pets)
TARGET_T_HOSTILE_WPET, //Current target (can be a pet) TARGET_T_HOSTILE_WPET, // Current target (can be a pet)
TARGET_T_HOSTILE_WPET_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks) TARGET_T_HOSTILE_WPET_SECOND_AGGRO, // Second highest aggro (generaly used for cleaves and some special attacks)
TARGET_T_HOSTILE_WPET_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for) TARGET_T_HOSTILE_WPET_LAST_AGGRO, // Dead last on aggro (no idea what this could be used for)
TARGET_T_HOSTILE_WPET_RANDOM, //Just any random target on our threat list TARGET_T_HOSTILE_WPET_RANDOM, // Just any random target on our threat list
TARGET_T_HOSTILE_WPET_RANDOM_NOT_TOP, //Any random target except top threat TARGET_T_HOSTILE_WPET_RANDOM_NOT_TOP, // Any random target except top threat
TARGET_T_ACTION_INVOKER_WPET, TARGET_T_ACTION_INVOKER_WPET,
@ -144,14 +144,14 @@ enum Target
enum EventFlags enum EventFlags
{ {
EFLAG_REPEATABLE = 0x01, //Event repeats EFLAG_REPEATABLE = 0x01, // Event repeats
EFLAG_DIFFICULTY_0 = 0x02, //Event only occurs in instance difficulty 0 EFLAG_DIFFICULTY_0 = 0x02, // Event only occurs in instance difficulty 0
EFLAG_DIFFICULTY_1 = 0x04, //Event only occurs in instance difficulty 1 EFLAG_DIFFICULTY_1 = 0x04, // Event only occurs in instance difficulty 1
EFLAG_DIFFICULTY_2 = 0x08, //Event only occurs in instance difficulty 2 EFLAG_DIFFICULTY_2 = 0x08, // Event only occurs in instance difficulty 2
EFLAG_DIFFICULTY_3 = 0x10, //Event only occurs in instance difficulty 3 EFLAG_DIFFICULTY_3 = 0x10, // Event only occurs in instance difficulty 3
EFLAG_RANDOM_ACTION = 0x20, //Event only execute one from existed actions instead each action. EFLAG_RANDOM_ACTION = 0x20, // Event only execute one from existed actions instead each action.
EFLAG_RESERVED_6 = 0x40, EFLAG_RESERVED_6 = 0x40,
EFLAG_DEBUG_ONLY = 0x80, //Event only occurs in debug build EFLAG_DEBUG_ONLY = 0x80, // Event only occurs in debug build
// no free bits, uint8 field // no free bits, uint8 field
EFLAG_DIFFICULTY_ALL = (EFLAG_DIFFICULTY_0 | EFLAG_DIFFICULTY_1 | EFLAG_DIFFICULTY_2 | EFLAG_DIFFICULTY_3) EFLAG_DIFFICULTY_ALL = (EFLAG_DIFFICULTY_0 | EFLAG_DIFFICULTY_1 | EFLAG_DIFFICULTY_2 | EFLAG_DIFFICULTY_3)
}; };
@ -498,8 +498,8 @@ struct CreatureEventAI_Event
uint32 repeatMax; uint32 repeatMax;
} friendly_buff; } friendly_buff;
// EVENT_T_SUMMONED_UNIT = 17 // EVENT_T_SUMMONED_UNIT = 17
//EVENT_T_SUMMONED_JUST_DIED = 25 // EVENT_T_SUMMONED_JUST_DIED = 25
//EVENT_T_SUMMONED_JUST_DESPAWN = 26 // EVENT_T_SUMMONED_JUST_DESPAWN = 26
struct struct
{ {
uint32 creatureId; uint32 creatureId;
@ -543,7 +543,7 @@ struct CreatureEventAI_Event
CreatureEventAI_Action action[MAX_ACTIONS]; CreatureEventAI_Action action[MAX_ACTIONS];
}; };
//Event_Map // Event_Map
typedef std::vector<CreatureEventAI_Event> CreatureEventAI_Event_Vec; typedef std::vector<CreatureEventAI_Event> CreatureEventAI_Event_Vec;
typedef UNORDERED_MAP<uint32, CreatureEventAI_Event_Vec > CreatureEventAI_Event_Map; typedef UNORDERED_MAP<uint32, CreatureEventAI_Event_Vec > CreatureEventAI_Event_Map;
@ -558,7 +558,7 @@ struct CreatureEventAI_Summon
uint32 SpawnTimeSecs; uint32 SpawnTimeSecs;
}; };
//EventSummon_Map // EventSummon_Map
typedef UNORDERED_MAP<uint32, CreatureEventAI_Summon> CreatureEventAI_Summon_Map; typedef UNORDERED_MAP<uint32, CreatureEventAI_Summon> CreatureEventAI_Summon_Map;
struct CreatureEventAIHolder struct CreatureEventAIHolder
@ -620,13 +620,13 @@ class MANGOS_DLL_SPEC CreatureEventAI : public CreatureAI
void DoFindFriendlyCC(std::list<Creature*>& _list, float range); void DoFindFriendlyCC(std::list<Creature*>& _list, float range);
protected: protected:
uint32 m_EventUpdateTime; //Time between event updates uint32 m_EventUpdateTime; // Time between event updates
uint32 m_EventDiff; //Time between the last event call uint32 m_EventDiff; // Time between the last event call
bool m_bEmptyList; bool m_bEmptyList;
//Variables used by Events themselves // Variables used by Events themselves
typedef std::vector<CreatureEventAIHolder> CreatureEventAIList; typedef std::vector<CreatureEventAIHolder> CreatureEventAIList;
CreatureEventAIList m_CreatureEventAIList; //Holder for events (stores enabled, time, and eventid) CreatureEventAIList m_CreatureEventAIList; // Holder for events (stores enabled, time, and eventid)
uint8 m_Phase; // Current phase, max 32 phases uint8 m_Phase; // Current phase, max 32 phases
bool m_CombatMovementEnabled; // If we allow targeted movment gen (movement twoards top threat) bool m_CombatMovementEnabled; // If we allow targeted movment gen (movement twoards top threat)

View file

@ -153,7 +153,7 @@ void CreatureEventAIMgr::CheckUnusedAITexts()
void CreatureEventAIMgr::LoadCreatureEventAI_Summons(bool check_entry_use) void CreatureEventAIMgr::LoadCreatureEventAI_Summons(bool check_entry_use)
{ {
//Drop Existing EventSummon Map // Drop Existing EventSummon Map
m_CreatureEventAI_Summon_Map.clear(); m_CreatureEventAI_Summon_Map.clear();
// Gather additional data for EventAI // Gather additional data for EventAI
@ -183,7 +183,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons(bool check_entry_use)
continue; continue;
} }
//Add to map // Add to map
m_CreatureEventAI_Summon_Map[temp.id] = temp; m_CreatureEventAI_Summon_Map[temp.id] = temp;
++Count; ++Count;
} }
@ -244,7 +244,7 @@ void CreatureEventAIMgr::CheckUnusedAISummons()
// ------------------- // -------------------
void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
{ {
//Drop Existing EventAI List // Drop Existing EventAI List
m_CreatureEventAI_Event_Map.clear(); m_CreatureEventAI_Event_Map.clear();
// Gather event data // Gather event data
@ -272,7 +272,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
uint32 creature_id = temp.creature_id; uint32 creature_id = temp.creature_id;
uint32 e_type = fields[2].GetUInt32(); uint32 e_type = fields[2].GetUInt32();
//Report any errors in event // Report any errors in event
if (e_type >= EVENT_T_END) if (e_type >= EVENT_T_END)
{ {
sLog.outErrorDb("CreatureEventAI: Event %u have wrong type (%u), skipping.", i, e_type); sLog.outErrorDb("CreatureEventAI: Event %u have wrong type (%u), skipping.", i, e_type);
@ -288,24 +288,24 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
temp.raw.param3 = fields[8].GetUInt32(); temp.raw.param3 = fields[8].GetUInt32();
temp.raw.param4 = fields[9].GetUInt32(); temp.raw.param4 = fields[9].GetUInt32();
//Creature does not exist in database // Creature does not exist in database
if (!sCreatureStorage.LookupEntry<CreatureInfo>(temp.creature_id)) if (!sCreatureStorage.LookupEntry<CreatureInfo>(temp.creature_id))
{ {
sLog.outErrorDb("CreatureEventAI: Event %u has script for non-existing creature entry (%u), skipping.", i, temp.creature_id); sLog.outErrorDb("CreatureEventAI: Event %u has script for non-existing creature entry (%u), skipping.", i, temp.creature_id);
continue; continue;
} }
//No chance of this event occuring // No chance of this event occuring
if (temp.event_chance == 0) if (temp.event_chance == 0)
sLog.outErrorDb("CreatureEventAI: Event %u has 0 percent chance. Event will never trigger!", i); sLog.outErrorDb("CreatureEventAI: Event %u has 0 percent chance. Event will never trigger!", i);
//Chance above 100, force it to be 100 // Chance above 100, force it to be 100
else if (temp.event_chance > 100) else if (temp.event_chance > 100)
{ {
sLog.outErrorDb("CreatureEventAI: Creature %u are using event %u with more than 100 percent chance. Adjusting to 100 percent.", temp.creature_id, i); sLog.outErrorDb("CreatureEventAI: Creature %u are using event %u with more than 100 percent chance. Adjusting to 100 percent.", temp.creature_id, i);
temp.event_chance = 100; temp.event_chance = 100;
} }
//Individual event checks // Individual event checks
switch (temp.event_type) switch (temp.event_type)
{ {
case EVENT_T_TIMER: case EVENT_T_TIMER:
@ -506,7 +506,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
action.raw.param2 = fields[12 + (j * 4)].GetUInt32(); action.raw.param2 = fields[12 + (j * 4)].GetUInt32();
action.raw.param3 = fields[13 + (j * 4)].GetUInt32(); action.raw.param3 = fields[13 + (j * 4)].GetUInt32();
//Report any errors in actions // Report any errors in actions
switch (action.type) switch (action.type)
{ {
case ACTION_T_NONE: case ACTION_T_NONE:
@ -603,14 +603,14 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
{ {
if (spell->RecoveryTime > 0 && temp.event_flags & EFLAG_REPEATABLE) if (spell->RecoveryTime > 0 && temp.event_flags & EFLAG_REPEATABLE)
{ {
//output as debug for now, also because there's no general rule all spells have RecoveryTime // output as debug for now, also because there's no general rule all spells have RecoveryTime
if (temp.event_param3 < spell->RecoveryTime) if (temp.event_param3 < spell->RecoveryTime)
DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "CreatureEventAI: Event %u Action %u uses SpellID %u but cooldown is longer(%u) than minumum defined in event param3(%u).", i, j+1,action.cast.spellId, spell->RecoveryTime, temp.event_param3); DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "CreatureEventAI: Event %u Action %u uses SpellID %u but cooldown is longer(%u) than minumum defined in event param3(%u).", i, j+1,action.cast.spellId, spell->RecoveryTime, temp.event_param3);
} }
} }
*/ */
//Cast is always triggered if target is forced to cast on self // Cast is always triggered if target is forced to cast on self
if (action.cast.castFlags & CAST_FORCE_TARGET_SELF) if (action.cast.castFlags & CAST_FORCE_TARGET_SELF)
action.cast.castFlags |= CAST_TRIGGERED; action.cast.castFlags |= CAST_TRIGGERED;
@ -698,7 +698,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
if (action.remove_aura.target >= TARGET_T_END) if (action.remove_aura.target >= TARGET_T_END)
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1); sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1);
break; break;
case ACTION_T_RANDOM_PHASE: //PhaseId1, PhaseId2, PhaseId3 case ACTION_T_RANDOM_PHASE: // PhaseId1, PhaseId2, PhaseId3
if (action.random_phase.phase1 >= MAX_PHASE) if (action.random_phase.phase1 >= MAX_PHASE)
sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase1 >= %u. Phase mask cannot be used past phase %u.", i, j + 1, MAX_PHASE, MAX_PHASE - 1); sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase1 >= %u. Phase mask cannot be used past phase %u.", i, j + 1, MAX_PHASE, MAX_PHASE - 1);
if (action.random_phase.phase2 >= MAX_PHASE) if (action.random_phase.phase2 >= MAX_PHASE)
@ -706,7 +706,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
if (action.random_phase.phase3 >= MAX_PHASE) if (action.random_phase.phase3 >= MAX_PHASE)
sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase3 >= %u. Phase mask cannot be used past phase %u.", i, j + 1, MAX_PHASE, MAX_PHASE - 1); sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase3 >= %u. Phase mask cannot be used past phase %u.", i, j + 1, MAX_PHASE, MAX_PHASE - 1);
break; break;
case ACTION_T_RANDOM_PHASE_RANGE: //PhaseMin, PhaseMax case ACTION_T_RANDOM_PHASE_RANGE: // PhaseMin, PhaseMax
if (action.random_phase_range.phaseMin >= MAX_PHASE) if (action.random_phase_range.phaseMin >= MAX_PHASE)
sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phaseMin >= %u. Phase mask cannot be used past phase %u.", i, j + 1, MAX_PHASE, MAX_PHASE - 1); sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phaseMin >= %u. Phase mask cannot be used past phase %u.", i, j + 1, MAX_PHASE, MAX_PHASE - 1);
if (action.random_phase_range.phaseMin >= MAX_PHASE) if (action.random_phase_range.phaseMin >= MAX_PHASE)
@ -789,15 +789,15 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
} }
} }
break; break;
case ACTION_T_EVADE: //No Params case ACTION_T_EVADE: // No Params
case ACTION_T_FLEE_FOR_ASSIST: //No Params case ACTION_T_FLEE_FOR_ASSIST: // No Params
case ACTION_T_DIE: //No Params case ACTION_T_DIE: // No Params
case ACTION_T_ZONE_COMBAT_PULSE: //No Params case ACTION_T_ZONE_COMBAT_PULSE: // No Params
case ACTION_T_FORCE_DESPAWN: //Delay case ACTION_T_FORCE_DESPAWN: // Delay
case ACTION_T_AUTO_ATTACK: //AllowAttackState (0 = stop attack, anything else means continue attacking) case ACTION_T_AUTO_ATTACK: // AllowAttackState (0 = stop attack, anything else means continue attacking)
case ACTION_T_COMBAT_MOVEMENT: //AllowCombatMovement (0 = stop combat based movement, anything else continue attacking) case ACTION_T_COMBAT_MOVEMENT: // AllowCombatMovement (0 = stop combat based movement, anything else continue attacking)
case ACTION_T_RANGED_MOVEMENT: //Distance, Angle case ACTION_T_RANGED_MOVEMENT: // Distance, Angle
case ACTION_T_CALL_FOR_HELP: //Distance case ACTION_T_CALL_FOR_HELP: // Distance
break; break;
case ACTION_T_RANDOM_SAY: case ACTION_T_RANDOM_SAY:
@ -811,7 +811,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
} }
} }
//Add to list // Add to list
m_CreatureEventAI_Event_Map[creature_id].push_back(temp); m_CreatureEventAI_Event_Map[creature_id].push_back(temp);
++Count; ++Count;
} }

View file

@ -253,7 +253,7 @@ enum Difficulty
DUNGEON_DIFFICULTY_NORMAL = 0, DUNGEON_DIFFICULTY_NORMAL = 0,
DUNGEON_DIFFICULTY_HEROIC = 1, DUNGEON_DIFFICULTY_HEROIC = 1,
//DUNGEON_DIFFICULTY_EPIC = 2, // not used, but exists // DUNGEON_DIFFICULTY_EPIC = 2, // not used, but exists
RAID_DIFFICULTY_10MAN_NORMAL = 0, RAID_DIFFICULTY_10MAN_NORMAL = 0,
RAID_DIFFICULTY_25MAN_NORMAL = 1, RAID_DIFFICULTY_25MAN_NORMAL = 1,

View file

@ -101,7 +101,7 @@ DBCStorage <GtChanceToSpellCritBaseEntry> sGtChanceToSpellCritBaseStore(GtChance
DBCStorage <GtChanceToSpellCritEntry> sGtChanceToSpellCritStore(GtChanceToSpellCritfmt); DBCStorage <GtChanceToSpellCritEntry> sGtChanceToSpellCritStore(GtChanceToSpellCritfmt);
DBCStorage <GtOCTClassCombatRatingScalarEntry> sGtOCTClassCombatRatingScalarStore(GtOCTClassCombatRatingScalarfmt); DBCStorage <GtOCTClassCombatRatingScalarEntry> sGtOCTClassCombatRatingScalarStore(GtOCTClassCombatRatingScalarfmt);
DBCStorage <GtOCTRegenHPEntry> sGtOCTRegenHPStore(GtOCTRegenHPfmt); DBCStorage <GtOCTRegenHPEntry> sGtOCTRegenHPStore(GtOCTRegenHPfmt);
//DBCStorage <GtOCTRegenMPEntry> sGtOCTRegenMPStore(GtOCTRegenMPfmt); -- not used currently // DBCStorage <GtOCTRegenMPEntry> sGtOCTRegenMPStore(GtOCTRegenMPfmt); -- not used currently
DBCStorage <GtRegenHPPerSptEntry> sGtRegenHPPerSptStore(GtRegenHPPerSptfmt); DBCStorage <GtRegenHPPerSptEntry> sGtRegenHPPerSptStore(GtRegenHPPerSptfmt);
DBCStorage <GtRegenMPPerSptEntry> sGtRegenMPPerSptStore(GtRegenMPPerSptfmt); DBCStorage <GtRegenMPPerSptEntry> sGtRegenMPPerSptStore(GtRegenMPPerSptfmt);
@ -110,8 +110,8 @@ DBCStorage <HolidaysEntry> sHolidaysStore(Holidaysfmt);
DBCStorage <ItemEntry> sItemStore(Itemfmt); DBCStorage <ItemEntry> sItemStore(Itemfmt);
DBCStorage <ItemBagFamilyEntry> sItemBagFamilyStore(ItemBagFamilyfmt); DBCStorage <ItemBagFamilyEntry> sItemBagFamilyStore(ItemBagFamilyfmt);
DBCStorage <ItemClassEntry> sItemClassStore(ItemClassfmt); DBCStorage <ItemClassEntry> sItemClassStore(ItemClassfmt);
//DBCStorage <ItemCondExtCostsEntry> sItemCondExtCostsStore(ItemCondExtCostsEntryfmt); // DBCStorage <ItemCondExtCostsEntry> sItemCondExtCostsStore(ItemCondExtCostsEntryfmt);
//DBCStorage <ItemDisplayInfoEntry> sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently // DBCStorage <ItemDisplayInfoEntry> sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently
DBCStorage <ItemExtendedCostEntry> sItemExtendedCostStore(ItemExtendedCostEntryfmt); DBCStorage <ItemExtendedCostEntry> sItemExtendedCostStore(ItemExtendedCostEntryfmt);
DBCStorage <ItemLimitCategoryEntry> sItemLimitCategoryStore(ItemLimitCategoryEntryfmt); DBCStorage <ItemLimitCategoryEntry> sItemLimitCategoryStore(ItemLimitCategoryEntryfmt);
DBCStorage <ItemRandomPropertiesEntry> sItemRandomPropertiesStore(ItemRandomPropertiesfmt); DBCStorage <ItemRandomPropertiesEntry> sItemRandomPropertiesStore(ItemRandomPropertiesfmt);
@ -328,7 +328,7 @@ inline void LoadDBC(LocalData& localeData, BarGoLink& bar, StoreProblemList& err
std::string dbc_filename_loc = dbc_path + localStr->name + "/" + filename; std::string dbc_filename_loc = dbc_path + localStr->name + "/" + filename;
if (!storage.LoadStringsFrom(dbc_filename_loc.c_str())) if (!storage.LoadStringsFrom(dbc_filename_loc.c_str()))
localeData.availableDbcLocales &= ~(1 << i); // mark as not available for speedup next checks localeData.availableDbcLocales &= ~(1 << i);// mark as not available for speedup next checks
} }
} }
else else
@ -441,15 +441,15 @@ void LoadDBCStores(const std::string& dataPath)
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtOCTClassCombatRatingScalarStore, dbcPath, "gtOCTClassCombatRatingScalar.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtOCTClassCombatRatingScalarStore, dbcPath, "gtOCTClassCombatRatingScalar.dbc");
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtOCTRegenHPStore, dbcPath, "gtOCTRegenHP.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtOCTRegenHPStore, dbcPath, "gtOCTRegenHP.dbc");
//LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTRegenMPStore, dbcPath,"gtOCTRegenMP.dbc"); -- not used currently // LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTRegenMPStore, dbcPath,"gtOCTRegenMP.dbc"); -- not used currently
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtRegenHPPerSptStore, dbcPath, "gtRegenHPPerSpt.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtRegenHPPerSptStore, dbcPath, "gtRegenHPPerSpt.dbc");
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtRegenMPPerSptStore, dbcPath, "gtRegenMPPerSpt.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtRegenMPPerSptStore, dbcPath, "gtRegenMPPerSpt.dbc");
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sHolidaysStore, dbcPath, "Holidays.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sHolidaysStore, dbcPath, "Holidays.dbc");
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemStore, dbcPath, "Item.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemStore, dbcPath, "Item.dbc");
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemBagFamilyStore, dbcPath, "ItemBagFamily.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemBagFamilyStore, dbcPath, "ItemBagFamily.dbc");
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemClassStore, dbcPath, "ItemClass.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemClassStore, dbcPath, "ItemClass.dbc");
//LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDisplayInfoStore, dbcPath,"ItemDisplayInfo.dbc"); -- not used currently // LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDisplayInfoStore, dbcPath,"ItemDisplayInfo.dbc"); -- not used currently
//LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemCondExtCostsStore, dbcPath,"ItemCondExtCosts.dbc"); // LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemCondExtCostsStore, dbcPath,"ItemCondExtCosts.dbc");
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemExtendedCostStore, dbcPath, "ItemExtendedCost.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemExtendedCostStore, dbcPath, "ItemExtendedCost.dbc");
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemLimitCategoryStore, dbcPath, "ItemLimitCategory.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemLimitCategoryStore, dbcPath, "ItemLimitCategory.dbc");
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemRandomPropertiesStore, dbcPath, "ItemRandomProperties.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemRandomPropertiesStore, dbcPath, "ItemRandomProperties.dbc");

View file

@ -104,7 +104,7 @@ extern DBCStorage <AuctionHouseEntry> sAuctionHouseStore;
extern DBCStorage <BankBagSlotPricesEntry> sBankBagSlotPricesStore; extern DBCStorage <BankBagSlotPricesEntry> sBankBagSlotPricesStore;
extern DBCStorage <BarberShopStyleEntry> sBarberShopStyleStore; extern DBCStorage <BarberShopStyleEntry> sBarberShopStyleStore;
extern DBCStorage <BattlemasterListEntry> sBattlemasterListStore; extern DBCStorage <BattlemasterListEntry> sBattlemasterListStore;
//extern DBCStorage <ChatChannelsEntry> sChatChannelsStore; -- accessed using function, no usable index // extern DBCStorage <ChatChannelsEntry> sChatChannelsStore; -- accessed using function, no usable index
extern DBCStorage <CharStartOutfitEntry> sCharStartOutfitStore; extern DBCStorage <CharStartOutfitEntry> sCharStartOutfitStore;
extern DBCStorage <CharTitlesEntry> sCharTitlesStore; extern DBCStorage <CharTitlesEntry> sCharTitlesStore;
extern DBCStorage <ChrClassesEntry> sChrClassesStore; extern DBCStorage <ChrClassesEntry> sChrClassesStore;
@ -136,14 +136,14 @@ extern DBCStorage <GtChanceToSpellCritBaseEntry> sGtChanceToSpellCritBaseStore;
extern DBCStorage <GtChanceToSpellCritEntry> sGtChanceToSpellCritStore; extern DBCStorage <GtChanceToSpellCritEntry> sGtChanceToSpellCritStore;
extern DBCStorage <GtOCTClassCombatRatingScalarEntry> sGtOCTClassCombatRatingScalarStore; extern DBCStorage <GtOCTClassCombatRatingScalarEntry> sGtOCTClassCombatRatingScalarStore;
extern DBCStorage <GtOCTRegenHPEntry> sGtOCTRegenHPStore; extern DBCStorage <GtOCTRegenHPEntry> sGtOCTRegenHPStore;
//extern DBCStorage <GtOCTRegenMPEntry> sGtOCTRegenMPStore; -- not used currently // extern DBCStorage <GtOCTRegenMPEntry> sGtOCTRegenMPStore; -- not used currently
extern DBCStorage <GtRegenHPPerSptEntry> sGtRegenHPPerSptStore; extern DBCStorage <GtRegenHPPerSptEntry> sGtRegenHPPerSptStore;
extern DBCStorage <GtRegenMPPerSptEntry> sGtRegenMPPerSptStore; extern DBCStorage <GtRegenMPPerSptEntry> sGtRegenMPPerSptStore;
extern DBCStorage <HolidaysEntry> sHolidaysStore; extern DBCStorage <HolidaysEntry> sHolidaysStore;
extern DBCStorage <ItemEntry> sItemStore; extern DBCStorage <ItemEntry> sItemStore;
extern DBCStorage <ItemBagFamilyEntry> sItemBagFamilyStore; extern DBCStorage <ItemBagFamilyEntry> sItemBagFamilyStore;
extern DBCStorage <ItemClassEntry> sItemClassStore; extern DBCStorage <ItemClassEntry> sItemClassStore;
//extern DBCStorage <ItemDisplayInfoEntry> sItemDisplayInfoStore; -- not used currently // extern DBCStorage <ItemDisplayInfoEntry> sItemDisplayInfoStore; -- not used currently
extern DBCStorage <ItemExtendedCostEntry> sItemExtendedCostStore; extern DBCStorage <ItemExtendedCostEntry> sItemExtendedCostStore;
extern DBCStorage <ItemLimitCategoryEntry> sItemLimitCategoryStore; extern DBCStorage <ItemLimitCategoryEntry> sItemLimitCategoryStore;
extern DBCStorage <ItemRandomPropertiesEntry> sItemRandomPropertiesStore; extern DBCStorage <ItemRandomPropertiesEntry> sItemRandomPropertiesStore;
@ -152,14 +152,14 @@ extern DBCStorage <ItemSetEntry> sItemSetStore;
extern DBCStorage <LockEntry> sLockStore; extern DBCStorage <LockEntry> sLockStore;
extern DBCStorage <MailTemplateEntry> sMailTemplateStore; extern DBCStorage <MailTemplateEntry> sMailTemplateStore;
extern DBCStorage <MapEntry> sMapStore; extern DBCStorage <MapEntry> sMapStore;
//extern DBCStorage <MapDifficultyEntry> sMapDifficultyStore; -- use GetMapDifficultyData insteed // extern DBCStorage <MapDifficultyEntry> sMapDifficultyStore; -- use GetMapDifficultyData insteed
extern MapDifficultyMap sMapDifficultyMap; extern MapDifficultyMap sMapDifficultyMap;
extern DBCStorage <MovieEntry> sMovieStore; extern DBCStorage <MovieEntry> sMovieStore;
extern DBCStorage <OverrideSpellDataEntry> sOverrideSpellDataStore; extern DBCStorage <OverrideSpellDataEntry> sOverrideSpellDataStore;
extern DBCStorage <QuestFactionRewardEntry> sQuestFactionRewardStore; extern DBCStorage <QuestFactionRewardEntry> sQuestFactionRewardStore;
extern DBCStorage <QuestSortEntry> sQuestSortStore; extern DBCStorage <QuestSortEntry> sQuestSortStore;
extern DBCStorage <QuestXPLevel> sQuestXPLevelStore; extern DBCStorage <QuestXPLevel> sQuestXPLevelStore;
//extern DBCStorage <PvPDifficultyEntry> sPvPDifficultyStore; -- use GetBattlegroundSlotByLevel for access // extern DBCStorage <PvPDifficultyEntry> sPvPDifficultyStore; -- use GetBattlegroundSlotByLevel for access
extern DBCStorage <RandomPropertiesPointsEntry> sRandomPropertiesPointsStore; extern DBCStorage <RandomPropertiesPointsEntry> sRandomPropertiesPointsStore;
extern DBCStorage <ScalingStatDistributionEntry> sScalingStatDistributionStore; extern DBCStorage <ScalingStatDistributionEntry> sScalingStatDistributionStore;
extern DBCStorage <ScalingStatValuesEntry> sScalingStatValuesStore; extern DBCStorage <ScalingStatValuesEntry> sScalingStatValuesStore;
@ -195,7 +195,7 @@ extern DBCStorage <TotemCategoryEntry> sTotemCategoryStore;
extern DBCStorage <VehicleEntry> sVehicleStore; extern DBCStorage <VehicleEntry> sVehicleStore;
extern DBCStorage <VehicleSeatEntry> sVehicleSeatStore; extern DBCStorage <VehicleSeatEntry> sVehicleSeatStore;
extern DBCStorage <WMOAreaTableEntry> sWMOAreaTableStore; extern DBCStorage <WMOAreaTableEntry> sWMOAreaTableStore;
//extern DBCStorage <WorldMapAreaEntry> sWorldMapAreaStore; -- use Zone2MapCoordinates and Map2ZoneCoordinates // extern DBCStorage <WorldMapAreaEntry> sWorldMapAreaStore; -- use Zone2MapCoordinates and Map2ZoneCoordinates
extern DBCStorage <WorldMapOverlayEntry> sWorldMapOverlayStore; extern DBCStorage <WorldMapOverlayEntry> sWorldMapOverlayStore;
extern DBCStorage <WorldSafeLocsEntry> sWorldSafeLocsStore; extern DBCStorage <WorldSafeLocsEntry> sWorldSafeLocsStore;

View file

@ -43,18 +43,18 @@ struct AchievementEntry
uint32 ID; // 0 m_ID uint32 ID; // 0 m_ID
uint32 factionFlag; // 1 m_faction -1=all, 0=horde, 1=alliance uint32 factionFlag; // 1 m_faction -1=all, 0=horde, 1=alliance
uint32 mapID; // 2 m_instance_id -1=none uint32 mapID; // 2 m_instance_id -1=none
//uint32 parentAchievement; // 3 m_supercedes its Achievement parent (can`t start while parent uncomplete, use its Criteria if don`t have own, use its progress on begin) // uint32 parentAchievement; // 3 m_supercedes its Achievement parent (can`t start while parent uncomplete, use its Criteria if don`t have own, use its progress on begin)
char* name[16]; // 4-19 m_title_lang char* name[16]; // 4-19 m_title_lang
//uint32 name_flags; // 20 string flags // uint32 name_flags; // 20 string flags
//char *description[16]; // 21-36 m_description_lang // char *description[16]; // 21-36 m_description_lang
//uint32 desc_flags; // 37 string flags // uint32 desc_flags; // 37 string flags
uint32 categoryId; // 38 m_category uint32 categoryId; // 38 m_category
uint32 points; // 39 m_points uint32 points; // 39 m_points
//uint32 OrderInCategory; // 40 m_ui_order // uint32 OrderInCategory; // 40 m_ui_order
uint32 flags; // 41 m_flags uint32 flags; // 41 m_flags
//uint32 icon; // 42 m_iconID // uint32 icon; // 42 m_iconID
//char *titleReward[16]; // 43-58 m_reward_lang // char *titleReward[16]; // 43-58 m_reward_lang
//uint32 titleReward_flags; // 59 string flags // uint32 titleReward_flags; // 59 string flags
uint32 count; // 60 m_minimum_criteria - need this count of completed criterias (own or referenced achievement criterias) uint32 count; // 60 m_minimum_criteria - need this count of completed criterias (own or referenced achievement criterias)
uint32 refAchievement; // 61 m_shares_criteria - referenced achievement (counting of all completed criterias) uint32 refAchievement; // 61 m_shares_criteria - referenced achievement (counting of all completed criterias)
}; };
@ -63,9 +63,9 @@ struct AchievementCategoryEntry
{ {
uint32 ID; // 0 m_ID uint32 ID; // 0 m_ID
uint32 parentCategory; // 1 m_parent -1 for main category uint32 parentCategory; // 1 m_parent -1 for main category
//char *name[16]; // 2-17 m_name_lang // char *name[16]; // 2-17 m_name_lang
//uint32 name_flags; // 18 string flags // uint32 name_flags; // 18 string flags
//uint32 sortOrder; // 19 m_ui_order // uint32 sortOrder; // 19 m_ui_order
}; };
struct AchievementCriteriaEntry struct AchievementCriteriaEntry
@ -491,9 +491,9 @@ struct AchievementCriteriaEntry
} raw; } raw;
}; };
char* name[16]; // 9-24 m_description_lang char* name[16]; // 9-24 m_description_lang
//uint32 name_flags; // 25 // uint32 name_flags; // 25
uint32 completionFlag; // 26 m_flags uint32 completionFlag; // 26 m_flags
//uint32 timedCriteriaStartType; // 27 m_timer_start_event Only appears with timed achievements, seems to be the type of starting a timed Achievement, only type 1 and some of type 6 need manual starting: 1: ByEventId(?) (serverside IDs), 2: ByQuestId, 5: ByCastSpellId(?), 6: BySpellIdTarget(some of these are unknown spells, some not, some maybe spells), 7: ByKillNpcId, 9: ByUseItemId // uint32 timedCriteriaStartType; // 27 m_timer_start_event Only appears with timed achievements, seems to be the type of starting a timed Achievement, only type 1 and some of type 6 need manual starting: 1: ByEventId(?) (serverside IDs), 2: ByQuestId, 5: ByCastSpellId(?), 6: BySpellIdTarget(some of these are unknown spells, some not, some maybe spells), 7: ByKillNpcId, 9: ByUseItemId
uint32 timedCriteriaMiscId; // 28 m_timer_asset_id Alway appears with timed events, used internally to start the achievement, store uint32 timedCriteriaMiscId; // 28 m_timer_asset_id Alway appears with timed events, used internally to start the achievement, store
uint32 timeLimit; // 29 m_timer_time uint32 timeLimit; // 29 m_timer_time
uint32 showOrder; // 30 m_ui_order also used in achievement shift-links as index in state bitmask uint32 showOrder; // 30 m_ui_order also used in achievement shift-links as index in state bitmask
@ -558,7 +558,7 @@ struct AuctionHouseEntry
uint32 faction; // 1 m_factionID uint32 faction; // 1 m_factionID
uint32 depositPercent; // 2 m_depositRate uint32 depositPercent; // 2 m_depositRate
uint32 cutPercent; // 3 m_consignmentRate uint32 cutPercent; // 3 m_consignmentRate
//char* name[16]; // 4-19 m_name_lang // char* name[16]; // 4-19 m_name_lang
// 20 string flags // 20 string flags
}; };
@ -572,11 +572,11 @@ struct BarberShopStyleEntry
{ {
uint32 Id; // 0 m_ID uint32 Id; // 0 m_ID
uint32 type; // 1 m_type uint32 type; // 1 m_type
//char* name[16]; // 2-17 m_DisplayName_lang // char* name[16]; // 2-17 m_DisplayName_lang
//uint32 name_flags; // 18 string flags // uint32 name_flags; // 18 string flags
//uint32 unk_name[16]; // 19-34 m_Description_lang // uint32 unk_name[16]; // 19-34 m_Description_lang
//uint32 unk_flags; // 35 string flags // uint32 unk_flags; // 35 string flags
//float CostMultiplier; // 36 m_Cost_Modifier // float CostMultiplier; // 36 m_Cost_Modifier
uint32 race; // 37 m_race uint32 race; // 37 m_race
uint32 gender; // 38 m_sex uint32 gender; // 38 m_sex
uint32 hair_id; // 39 m_data (real ID to hair/facial hair) uint32 hair_id; // 39 m_data (real ID to hair/facial hair)
@ -587,9 +587,9 @@ struct BattlemasterListEntry
uint32 id; // 0 m_ID uint32 id; // 0 m_ID
int32 mapid[8]; // 1-8 m_mapID[8] int32 mapid[8]; // 1-8 m_mapID[8]
uint32 type; // 9 m_instanceType uint32 type; // 9 m_instanceType
//uint32 canJoinAsGroup; // 10 m_groupsAllowed // uint32 canJoinAsGroup; // 10 m_groupsAllowed
char* name[16]; // 11-26 m_name_lang char* name[16]; // 11-26 m_name_lang
//uint32 nameFlags // 27 string flags // uint32 nameFlags // 27 string flags
uint32 maxGroupSize; // 28 m_maxGroupSize uint32 maxGroupSize; // 28 m_maxGroupSize
uint32 HolidayWorldStateId; // 29 m_holidayWorldState uint32 HolidayWorldStateId; // 29 m_holidayWorldState
uint32 minLevel; // 30 m_minlevel (sync with PvPDifficulty.dbc content) uint32 minLevel; // 30 m_minlevel (sync with PvPDifficulty.dbc content)
@ -618,23 +618,23 @@ struct BattlemasterListEntry
struct CharStartOutfitEntry struct CharStartOutfitEntry
{ {
//uint32 Id; // 0 m_ID // uint32 Id; // 0 m_ID
uint32 RaceClassGender; // 1 m_raceID m_classID m_sexID m_outfitID (UNIT_FIELD_BYTES_0 & 0x00FFFFFF) comparable (0 byte = race, 1 byte = class, 2 byte = gender) uint32 RaceClassGender; // 1 m_raceID m_classID m_sexID m_outfitID (UNIT_FIELD_BYTES_0 & 0x00FFFFFF) comparable (0 byte = race, 1 byte = class, 2 byte = gender)
int32 ItemId[MAX_OUTFIT_ITEMS]; // 2-25 m_ItemID int32 ItemId[MAX_OUTFIT_ITEMS]; // 2-25 m_ItemID
//int32 ItemDisplayId[MAX_OUTFIT_ITEMS]; // 26-29 m_DisplayItemID not required at server side // int32 ItemDisplayId[MAX_OUTFIT_ITEMS]; // 26-29 m_DisplayItemID not required at server side
//int32 ItemInventorySlot[MAX_OUTFIT_ITEMS]; // 50-73 m_InventoryType not required at server side // int32 ItemInventorySlot[MAX_OUTFIT_ITEMS]; // 50-73 m_InventoryType not required at server side
//uint32 Unknown1; // 74 unique values (index-like with gaps ordered in other way as ids) // uint32 Unknown1; // 74 unique values (index-like with gaps ordered in other way as ids)
//uint32 Unknown2; // 75 // uint32 Unknown2; // 75
//uint32 Unknown3; // 76 // uint32 Unknown3; // 76
}; };
struct CharTitlesEntry struct CharTitlesEntry
{ {
uint32 ID; // 0, m_ID uint32 ID; // 0, m_ID
//uint32 unk1; // 1 m_Condition_ID // uint32 unk1; // 1 m_Condition_ID
char* name[16]; // 2-17 m_name_lang char* name[16]; // 2-17 m_name_lang
// 18 string flags // 18 string flags
//char* name2[16]; // 19-34 m_name1_lang // char* name2[16]; // 19-34 m_name1_lang
// 35 string flags // 35 string flags
uint32 bit_index; // 36 m_mask_ID used in PLAYER_CHOSEN_TITLE and 1<<index in PLAYER__FIELD_KNOWN_TITLES uint32 bit_index; // 36 m_mask_ID used in PLAYER_CHOSEN_TITLE and 1<<index in PLAYER__FIELD_KNOWN_TITLES
}; };
@ -646,25 +646,25 @@ struct ChatChannelsEntry
// 2 m_factionGroup // 2 m_factionGroup
char* pattern[16]; // 3-18 m_name_lang char* pattern[16]; // 3-18 m_name_lang
// 19 string flags // 19 string flags
//char* name[16]; // 20-35 m_shortcut_lang // char* name[16]; // 20-35 m_shortcut_lang
// 36 string flags // 36 string flags
}; };
struct ChrClassesEntry struct ChrClassesEntry
{ {
uint32 ClassID; // 0 m_ID uint32 ClassID; // 0 m_ID
//uint32 flags; // 1 unknown // uint32 flags; // 1 unknown
uint32 powerType; // 2 m_DisplayPower uint32 powerType; // 2 m_DisplayPower
// 3 m_petNameToken // 3 m_petNameToken
char const* name[16]; // 4-19 m_name_lang char const* name[16]; // 4-19 m_name_lang
// 20 string flags // 20 string flags
//char* nameFemale[16]; // 21-36 m_name_female_lang // char* nameFemale[16]; // 21-36 m_name_female_lang
// 37 string flags // 37 string flags
//char* nameNeutralGender[16]; // 38-53 m_name_male_lang // char* nameNeutralGender[16]; // 38-53 m_name_male_lang
// 54 string flags // 54 string flags
// 55 m_filename // 55 m_filename
uint32 spellfamily; // 56 m_spellClassSet uint32 spellfamily; // 56 m_spellClassSet
//uint32 flags2; // 57 m_flags (0x08 HasRelicSlot) // uint32 flags2; // 57 m_flags (0x08 HasRelicSlot)
uint32 CinematicSequence; // 58 m_cinematicSequenceID uint32 CinematicSequence; // 58 m_cinematicSequenceID
uint32 expansion; // 59 m_required_expansion uint32 expansion; // 59 m_required_expansion
}; };
@ -684,12 +684,12 @@ struct ChrRacesEntry
// 10 m_SplashSoundID // 10 m_SplashSoundID
// 11 m_clientFileString // 11 m_clientFileString
uint32 CinematicSequence; // 12 m_cinematicSequenceID uint32 CinematicSequence; // 12 m_cinematicSequenceID
//uint32 unk_322; // 13 m_alliance (0 alliance, 1 horde, 2 not available?) // uint32 unk_322; // 13 m_alliance (0 alliance, 1 horde, 2 not available?)
char* name[16]; // 14-29 m_name_lang used for DBC language detection/selection char* name[16]; // 14-29 m_name_lang used for DBC language detection/selection
// 30 string flags // 30 string flags
//char* nameFemale[16]; // 31-46 m_name_female_lang // char* nameFemale[16]; // 31-46 m_name_female_lang
// 47 string flags // 47 string flags
//char* nameNeutralGender[16]; // 48-63 m_name_male_lang // char* nameNeutralGender[16]; // 48-63 m_name_male_lang
// 64 string flags // 64 string flags
// 65-66 m_facialHairCustomization[2] // 65-66 m_facialHairCustomization[2]
// 67 m_hairCustomization // 67 m_hairCustomization
@ -710,8 +710,8 @@ struct ChrRacesEntry
struct CinematicSequencesEntry struct CinematicSequencesEntry
{ {
uint32 Id; // 0 m_ID uint32 Id; // 0 m_ID
//uint32 unk1; // 1 m_soundID // uint32 unk1; // 1 m_soundID
//uint32 cinematicCamera; // 2 m_camera[8] // uint32 cinematicCamera; // 2 m_camera[8]
}; };
struct CreatureDisplayInfoEntry struct CreatureDisplayInfoEntry
@ -736,15 +736,15 @@ struct CreatureDisplayInfoExtraEntry
{ {
uint32 DisplayExtraId; // 0 m_ID CreatureDisplayInfoEntry::m_extendedDisplayInfoID uint32 DisplayExtraId; // 0 m_ID CreatureDisplayInfoEntry::m_extendedDisplayInfoID
uint32 Race; // 1 m_DisplayRaceID uint32 Race; // 1 m_DisplayRaceID
//uint32 Gender; // 2 m_DisplaySexID // uint32 Gender; // 2 m_DisplaySexID
//uint32 SkinColor; // 3 m_SkinID // uint32 SkinColor; // 3 m_SkinID
//uint32 FaceType; // 4 m_FaceID // uint32 FaceType; // 4 m_FaceID
//uint32 HairType; // 5 m_HairStyleID // uint32 HairType; // 5 m_HairStyleID
//uint32 HairStyle; // 6 m_HairColorID // uint32 HairStyle; // 6 m_HairColorID
//uint32 BeardStyle; // 7 m_FacialHairID // uint32 BeardStyle; // 7 m_FacialHairID
//uint32 Equipment[11]; // 8-18 m_NPCItemDisplay equipped static items EQUIPMENT_SLOT_HEAD..EQUIPMENT_SLOT_HANDS, client show its by self // uint32 Equipment[11]; // 8-18 m_NPCItemDisplay equipped static items EQUIPMENT_SLOT_HEAD..EQUIPMENT_SLOT_HANDS, client show its by self
//uint32 CanEquip; // 19 m_flags 0..1 Can equip additional things when used for players // uint32 CanEquip; // 19 m_flags 0..1 Can equip additional things when used for players
//char* // 20 m_BakeName CreatureDisplayExtra-*.blp // char* // 20 m_BakeName CreatureDisplayExtra-*.blp
}; };
struct CreatureFamilyEntry struct CreatureFamilyEntry
@ -769,15 +769,15 @@ struct CreatureSpellDataEntry
{ {
uint32 ID; // 0 m_ID uint32 ID; // 0 m_ID
uint32 spellId[MAX_CREATURE_SPELL_DATA_SLOT]; // 1-4 m_spells[4] uint32 spellId[MAX_CREATURE_SPELL_DATA_SLOT]; // 1-4 m_spells[4]
//uint32 availability[MAX_CREATURE_SPELL_DATA_SLOT]; // 4-7 m_availability[4] // uint32 availability[MAX_CREATURE_SPELL_DATA_SLOT];// 4-7 m_availability[4]
}; };
struct CreatureTypeEntry struct CreatureTypeEntry
{ {
uint32 ID; // 0 m_ID uint32 ID; // 0 m_ID
//char* Name[16]; // 1-16 m_name_lang // char* Name[16]; // 1-16 m_name_lang
// 17 string flags // 17 string flags
//uint32 no_expirience; // 18 m_flags // uint32 no_expirience; // 18 m_flags
}; };
/* not used /* not used
@ -792,9 +792,9 @@ struct CurrencyCategoryEntry
struct CurrencyTypesEntry struct CurrencyTypesEntry
{ {
//uint32 ID; // 0 m_ID // uint32 ID; // 0 m_ID
uint32 ItemId; // 1 m_itemID used as real index uint32 ItemId; // 1 m_itemID used as real index
//uint32 Category; // 2 m_categoryID may be category // uint32 Category; // 2 m_categoryID may be category
uint32 BitIndex; // 3 m_bitIndex bit index in PLAYER_FIELD_KNOWN_CURRENCIES (1 << (index-1)) uint32 BitIndex; // 3 m_bitIndex bit index in PLAYER_FIELD_KNOWN_CURRENCIES (1 << (index-1))
}; };
@ -806,8 +806,8 @@ struct DungeonEncounterEntry
uint32 encounterData; // 3 m_orderIndex uint32 encounterData; // 3 m_orderIndex
uint32 encounterIndex; // 4 m_Bit uint32 encounterIndex; // 4 m_Bit
char* encounterName[16]; // 5-20 m_name_lang char* encounterName[16]; // 5-20 m_name_lang
//uint32 nameLangFlags; // 21 m_name_lang_flags // uint32 nameLangFlags; // 21 m_name_lang_flags
//uint32 spellIconID; // 22 m_spellIconID // uint32 spellIconID; // 22 m_spellIconID
}; };
struct DurabilityCostsEntry struct DurabilityCostsEntry
@ -825,12 +825,12 @@ struct DurabilityQualityEntry
struct EmotesEntry struct EmotesEntry
{ {
uint32 Id; // 0 m_ID uint32 Id; // 0 m_ID
//char* Name; // 1 m_EmoteSlashCommand // char* Name; // 1 m_EmoteSlashCommand
//uint32 AnimationId; // 2 m_AnimID // uint32 AnimationId; // 2 m_AnimID
uint32 Flags; // 3 m_EmoteFlags uint32 Flags; // 3 m_EmoteFlags
uint32 EmoteType; // 4 m_EmoteSpecProc (determine how emote are shown) uint32 EmoteType; // 4 m_EmoteSpecProc (determine how emote are shown)
uint32 UnitStandState; // 5 m_EmoteSpecProcParam uint32 UnitStandState; // 5 m_EmoteSpecProcParam
//uint32 SoundId; // 6 m_EventSoundID // uint32 SoundId; // 6 m_EventSoundID
}; };
struct EmotesTextEntry struct EmotesTextEntry
@ -853,10 +853,10 @@ struct FactionEntry
float spilloverRateIn; // 19 m_parentFactionMod[2] Faction gains incoming rep * spilloverRateIn float spilloverRateIn; // 19 m_parentFactionMod[2] Faction gains incoming rep * spilloverRateIn
float spilloverRateOut; // 20 Faction outputs rep * spilloverRateOut as spillover reputation float spilloverRateOut; // 20 Faction outputs rep * spilloverRateOut as spillover reputation
uint32 spilloverMaxRankIn; // 21 m_parentFactionCap[2] The highest rank the faction will profit from incoming spillover uint32 spilloverMaxRankIn; // 21 m_parentFactionCap[2] The highest rank the faction will profit from incoming spillover
//uint32 spilloverRank_unk; // 22 It does not seem to be the max standing at which a faction outputs spillover ...so no idea // uint32 spilloverRank_unk; // 22 It does not seem to be the max standing at which a faction outputs spillover ...so no idea
char* name[16]; // 23-38 m_name_lang char* name[16]; // 23-38 m_name_lang
// 39 string flags // 39 string flags
//char* description[16]; // 40-55 m_description_lang // char* description[16]; // 40-55 m_description_lang
// 56 string flags // 56 string flags
// helpers // helpers
@ -1007,7 +1007,7 @@ struct GtOCTRegenHPEntry
float ratio; float ratio;
}; };
//struct GtOCTRegenMPEntry // struct GtOCTRegenMPEntry
//{ //{
// float ratio; // float ratio;
//}; //};
@ -1025,7 +1025,7 @@ struct GtRegenMPPerSptEntry
/*struct HolidayDescriptionsEntry /*struct HolidayDescriptionsEntry
{ {
uint32 ID; // 0 m_ID this is NOT holiday id uint32 ID; // 0 m_ID this is NOT holiday id
//char* name[16] // 1-16 m_name_lang // char* name[16] // 1-16 m_name_lang
// 17 string flags // 17 string flags
};*/ };*/
@ -1033,7 +1033,7 @@ struct GtRegenMPPerSptEntry
struct HolidayNamesEntry struct HolidayNamesEntry
{ {
uint32 ID; // 0 m_ID this is NOT holiday id uint32 ID; // 0 m_ID this is NOT holiday id
//char* name[16] // 1-16 m_name_lang // char* name[16] // 1-16 m_name_lang
// 17 string flags // 17 string flags
}; };
*/ */
@ -1041,17 +1041,17 @@ struct HolidayNamesEntry
struct HolidaysEntry struct HolidaysEntry
{ {
uint32 ID; // 0 m_ID uint32 ID; // 0 m_ID
//uint32 duration[10]; // 1-10 m_duration // uint32 duration[10]; // 1-10 m_duration
//uint32 date[26]; // 11-36 m_date (dates in unix time starting at January, 1, 2000) // uint32 date[26]; // 11-36 m_date (dates in unix time starting at January, 1, 2000)
//uint32 region; // 37 m_region (wow region) // uint32 region; // 37 m_region (wow region)
//uint32 looping; // 38 m_looping // uint32 looping; // 38 m_looping
//uint32 calendarFlags[10]; // 39-48 m_calendarFlags // uint32 calendarFlags[10]; // 39-48 m_calendarFlags
//uint32 holidayNameId; // 49 m_holidayNameID (HolidayNames.dbc) // uint32 holidayNameId; // 49 m_holidayNameID (HolidayNames.dbc)
//uint32 holidayDescriptionId; // 50 m_holidayDescriptionID (HolidayDescriptions.dbc) // uint32 holidayDescriptionId; // 50 m_holidayDescriptionID (HolidayDescriptions.dbc)
//char *textureFilename; // 51 m_textureFilename // char *textureFilename; // 51 m_textureFilename
//uint32 priority; // 52 m_priority // uint32 priority; // 52 m_priority
//uint32 calendarFilterType; // 53 m_calendarFilterType (-1,0,1 or 2) // uint32 calendarFilterType; // 53 m_calendarFilterType (-1,0,1 or 2)
//uint32 flags; // 54 m_flags // uint32 flags; // 54 m_flags
}; };
struct ItemEntry struct ItemEntry
@ -1069,15 +1069,15 @@ struct ItemEntry
struct ItemBagFamilyEntry struct ItemBagFamilyEntry
{ {
uint32 ID; // 0 m_ID uint32 ID; // 0 m_ID
//char* name[16] // 1-16 m_name_lang // char* name[16] // 1-16 m_name_lang
// // 17 name flags // // 17 name flags
}; };
struct ItemClassEntry struct ItemClassEntry
{ {
uint32 ID; // 0 m_ID uint32 ID; // 0 m_ID
//uint32 unk1; // 1 // uint32 unk1; // 1
//uint32 unk2; // 2 only weapon have 1 in field, other 0 // uint32 unk2; // 2 only weapon have 1 in field, other 0
char* name[16]; // 3-19 m_name_lang char* name[16]; // 3-19 m_name_lang
// // 20 name flags // // 20 name flags
}; };
@ -1098,7 +1098,7 @@ struct ItemDisplayInfoEntry
// 11 m_particleColorID // 11 m_particleColorID
}; };
//struct ItemCondExtCostsEntry // struct ItemCondExtCostsEntry
//{ //{
// uint32 ID; // uint32 ID;
// uint32 condExtendedCost; // ItemPrototype::CondExtendedCost // uint32 condExtendedCost; // ItemPrototype::CondExtendedCost
@ -1123,7 +1123,7 @@ struct ItemExtendedCostEntry
struct ItemLimitCategoryEntry struct ItemLimitCategoryEntry
{ {
uint32 ID; // 0 Id m_ID uint32 ID; // 0 Id m_ID
//char* name[16] // 1-16 m_name_lang // char* name[16] // 1-16 m_name_lang
// 17 string flags // 17 string flags
uint32 maxCount; // 18 m_quantity max allowed equipped as item or in gem slot uint32 maxCount; // 18 m_quantity max allowed equipped as item or in gem slot
uint32 mode; // 19 m_flags 0 = have, 1 = equip (enum ItemLimitCategoryMode) uint32 mode; // 19 m_flags 0 = have, 1 = equip (enum ItemLimitCategoryMode)
@ -1132,7 +1132,7 @@ struct ItemLimitCategoryEntry
struct ItemRandomPropertiesEntry struct ItemRandomPropertiesEntry
{ {
uint32 ID; // 0 m_ID uint32 ID; // 0 m_ID
//char* internalName // 1 m_Name // char* internalName // 1 m_Name
uint32 enchant_id[5]; // 2-6 m_Enchantment uint32 enchant_id[5]; // 2-6 m_Enchantment
char* nameSuffix[16]; // 7-22 m_name_lang char* nameSuffix[16]; // 7-22 m_name_lang
// 23 string flags // 23 string flags
@ -1150,10 +1150,10 @@ struct ItemRandomSuffixEntry
struct ItemSetEntry struct ItemSetEntry
{ {
//uint32 id // 0 m_ID // uint32 id // 0 m_ID
char* name[16]; // 1-16 m_name_lang char* name[16]; // 1-16 m_name_lang
// 17 string flags // 17 string flags
//uint32 itemId[17]; // 18-34 m_itemID // uint32 itemId[17]; // 18-34 m_itemID
uint32 spells[8]; // 35-42 m_setSpellID uint32 spells[8]; // 35-42 m_setSpellID
uint32 items_to_triggerspell[8]; // 43-50 m_setThreshold uint32 items_to_triggerspell[8]; // 43-50 m_setThreshold
uint32 required_skill_id; // 51 m_requiredSkill uint32 required_skill_id; // 51 m_requiredSkill
@ -1210,13 +1210,13 @@ struct LockEntry
uint32 Type[MAX_LOCK_CASE]; // 1-8 m_Type uint32 Type[MAX_LOCK_CASE]; // 1-8 m_Type
uint32 Index[MAX_LOCK_CASE]; // 9-16 m_Index uint32 Index[MAX_LOCK_CASE]; // 9-16 m_Index
uint32 Skill[MAX_LOCK_CASE]; // 17-24 m_Skill uint32 Skill[MAX_LOCK_CASE]; // 17-24 m_Skill
//uint32 Action[MAX_LOCK_CASE]; // 25-32 m_Action // uint32 Action[MAX_LOCK_CASE]; // 25-32 m_Action
}; };
struct MailTemplateEntry struct MailTemplateEntry
{ {
uint32 ID; // 0 m_ID uint32 ID; // 0 m_ID
//char* subject[16]; // 1-16 m_subject_lang // char* subject[16]; // 1-16 m_subject_lang
// 17 string flags // 17 string flags
char* content[16]; // 18-33 m_body_lang char* content[16]; // 18-33 m_body_lang
}; };
@ -1224,26 +1224,26 @@ struct MailTemplateEntry
struct MapEntry struct MapEntry
{ {
uint32 MapID; // 0 m_ID uint32 MapID; // 0 m_ID
//char* internalname; // 1 m_Directory // char* internalname; // 1 m_Directory
uint32 map_type; // 2 m_InstanceType uint32 map_type; // 2 m_InstanceType
//uint32 mapFlags; // 3 m_Flags (0x100 - CAN_CHANGE_PLAYER_DIFFICULTY) // uint32 mapFlags; // 3 m_Flags (0x100 - CAN_CHANGE_PLAYER_DIFFICULTY)
//uint32 isPvP; // 4 m_PVP 0 or 1 for battlegrounds (not arenas) // uint32 isPvP; // 4 m_PVP 0 or 1 for battlegrounds (not arenas)
char* name[16]; // 5-20 m_MapName_lang char* name[16]; // 5-20 m_MapName_lang
// 21 string flags // 21 string flags
uint32 linked_zone; // 22 m_areaTableID uint32 linked_zone; // 22 m_areaTableID
//char* hordeIntro[16]; // 23-38 m_MapDescription0_lang // char* hordeIntro[16]; // 23-38 m_MapDescription0_lang
// 39 string flags // 39 string flags
//char* allianceIntro[16]; // 40-55 m_MapDescription1_lang // char* allianceIntro[16]; // 40-55 m_MapDescription1_lang
// 56 string flags // 56 string flags
uint32 multimap_id; // 57 m_LoadingScreenID (LoadingScreens.dbc) uint32 multimap_id; // 57 m_LoadingScreenID (LoadingScreens.dbc)
//float BattlefieldMapIconScale; // 58 m_minimapIconScale // float BattlefieldMapIconScale; // 58 m_minimapIconScale
int32 ghost_entrance_map; // 59 m_corpseMapID map_id of entrance map in ghost mode (continent always and in most cases = normal entrance) int32 ghost_entrance_map; // 59 m_corpseMapID map_id of entrance map in ghost mode (continent always and in most cases = normal entrance)
float ghost_entrance_x; // 60 m_corpseX entrance x coordinate in ghost mode (in most cases = normal entrance) float ghost_entrance_x; // 60 m_corpseX entrance x coordinate in ghost mode (in most cases = normal entrance)
float ghost_entrance_y; // 61 m_corpseY entrance y coordinate in ghost mode (in most cases = normal entrance) float ghost_entrance_y; // 61 m_corpseY entrance y coordinate in ghost mode (in most cases = normal entrance)
//uint32 timeOfDayOverride; // 62 m_timeOfDayOverride // uint32 timeOfDayOverride; // 62 m_timeOfDayOverride
uint32 addon; // 63 m_expansionID uint32 addon; // 63 m_expansionID
// 64 m_raidOffset // 64 m_raidOffset
//uint32 maxPlayers; // 65 m_maxPlayers // uint32 maxPlayers; // 65 m_maxPlayers
// Helpers // Helpers
uint32 Expansion() const { return addon; } uint32 Expansion() const { return addon; }
@ -1262,7 +1262,7 @@ struct MapEntry
MapID == 209 || MapID == 269 || MapID == 309 || // TanarisInstance, CavernsOfTime, Zul'gurub MapID == 209 || MapID == 269 || MapID == 309 || // TanarisInstance, CavernsOfTime, Zul'gurub
MapID == 509 || MapID == 534 || MapID == 560 || // AhnQiraj, HyjalPast, HillsbradPast MapID == 509 || MapID == 534 || MapID == 560 || // AhnQiraj, HyjalPast, HillsbradPast
MapID == 568 || MapID == 580 || MapID == 595 || // ZulAman, Sunwell Plateau, Culling of Stratholme MapID == 568 || MapID == 580 || MapID == 595 || // ZulAman, Sunwell Plateau, Culling of Stratholme
MapID == 603 || MapID == 615 || MapID == 616; // Ulduar, The Obsidian Sanctum, The Eye Of Eternity MapID == 603 || MapID == 615 || MapID == 616;// Ulduar, The Obsidian Sanctum, The Eye Of Eternity
} }
bool IsContinent() const bool IsContinent() const
@ -1273,21 +1273,21 @@ struct MapEntry
struct MapDifficultyEntry struct MapDifficultyEntry
{ {
//uint32 Id; // 0 m_ID // uint32 Id; // 0 m_ID
uint32 MapId; // 1 m_mapID uint32 MapId; // 1 m_mapID
uint32 Difficulty; // 2 m_difficulty (for arenas: arena slot) uint32 Difficulty; // 2 m_difficulty (for arenas: arena slot)
//char* areaTriggerText[16]; // 3-18 m_message_lang (text showed when transfer to map failed) // char* areaTriggerText[16]; // 3-18 m_message_lang (text showed when transfer to map failed)
//uint32 textFlags; // 19 // uint32 textFlags; // 19
uint32 resetTime; // 20 m_raidDuration in secs, 0 if no fixed reset time uint32 resetTime; // 20 m_raidDuration in secs, 0 if no fixed reset time
uint32 maxPlayers; // 21 m_maxPlayers some heroic versions have 0 when expected same amount as in normal version uint32 maxPlayers; // 21 m_maxPlayers some heroic versions have 0 when expected same amount as in normal version
//char* difficultyString; // 22 m_difficultystring // char* difficultyString; // 22 m_difficultystring
}; };
struct MovieEntry struct MovieEntry
{ {
uint32 Id; // 0 m_ID uint32 Id; // 0 m_ID
//char* filename; // 1 m_filename // char* filename; // 1 m_filename
//uint32 unk2; // 2 m_volume // uint32 unk2; // 2 m_volume
}; };
#define MAX_OVERRIDE_SPELLS 10 #define MAX_OVERRIDE_SPELLS 10
@ -1296,12 +1296,12 @@ struct OverrideSpellDataEntry
{ {
uint32 Id; // 0 m_ID uint32 Id; // 0 m_ID
uint32 Spells[MAX_OVERRIDE_SPELLS]; // 1-10 m_spells uint32 Spells[MAX_OVERRIDE_SPELLS]; // 1-10 m_spells
//uint32 unk2; // 11 m_flags // uint32 unk2; // 11 m_flags
}; };
struct PvPDifficultyEntry struct PvPDifficultyEntry
{ {
//uint32 id; // 0 m_ID // uint32 id; // 0 m_ID
uint32 mapId; // 1 m_mapID uint32 mapId; // 1 m_mapID
uint32 bracketId; // 2 m_rangeIndex uint32 bracketId; // 2 m_rangeIndex
uint32 minLevel; // 3 m_minLevel uint32 minLevel; // 3 m_minLevel
@ -1321,7 +1321,7 @@ struct QuestFactionRewardEntry
struct QuestSortEntry struct QuestSortEntry
{ {
uint32 id; // 0 m_ID uint32 id; // 0 m_ID
//char* name[16]; // 1-16 m_SortName_lang // char* name[16]; // 1-16 m_SortName_lang
// 17 string flags // 17 string flags
}; };
@ -1333,7 +1333,7 @@ struct QuestXPLevel
struct RandomPropertiesPointsEntry struct RandomPropertiesPointsEntry
{ {
//uint32 Id; // 0 m_ID // uint32 Id; // 0 m_ID
uint32 itemLevel; // 1 m_ItemLevel uint32 itemLevel; // 1 m_ItemLevel
uint32 EpicPropertiesPoints[5]; // 2-6 m_Epic uint32 EpicPropertiesPoints[5]; // 2-6 m_Epic
uint32 RarePropertiesPoints[5]; // 7-11 m_Superior uint32 RarePropertiesPoints[5]; // 7-11 m_Superior
@ -1358,7 +1358,7 @@ struct ScalingStatValuesEntry
uint32 spellBonus; // 16 spell power for level uint32 spellBonus; // 16 spell power for level
uint32 ssdMultiplier2; // 17 there's data from 3.1 dbc ssdMultiplier[3] uint32 ssdMultiplier2; // 17 there's data from 3.1 dbc ssdMultiplier[3]
uint32 ssdMultiplier3; // 18 3.3 uint32 ssdMultiplier3; // 18 3.3
//uint32 unk2; // 19 unk, probably also Armor for level (flag 0x80000?) // uint32 unk2; // 19 unk, probably also Armor for level (flag 0x80000?)
uint32 armorMod2[4]; // 20-23 Armor for level uint32 armorMod2[4]; // 20-23 Armor for level
/*struct ScalingStatValuesEntry /*struct ScalingStatValuesEntry
@ -1458,14 +1458,14 @@ struct ScalingStatValuesEntry
struct SkillRaceClassInfoEntry struct SkillRaceClassInfoEntry
{ {
//uint32 id; // 0 m_ID // uint32 id; // 0 m_ID
uint32 skillId; // 1 m_skillID uint32 skillId; // 1 m_skillID
uint32 raceMask; // 2 m_raceMask uint32 raceMask; // 2 m_raceMask
uint32 classMask; // 3 m_classMask uint32 classMask; // 3 m_classMask
uint32 flags; // 4 m_flags uint32 flags; // 4 m_flags
uint32 reqLevel; // 5 m_minLevel uint32 reqLevel; // 5 m_minLevel
//uint32 skillTierId; // 6 m_skillTierID // uint32 skillTierId; // 6 m_skillTierID
//uint32 skillCostID; // 7 m_skillCostIndex // uint32 skillCostID; // 7 m_skillCostIndex
}; };
/*struct SkillTiersEntry{ /*struct SkillTiersEntry{
@ -1478,13 +1478,13 @@ struct SkillLineEntry
{ {
uint32 id; // 0 m_ID uint32 id; // 0 m_ID
int32 categoryId; // 1 m_categoryID int32 categoryId; // 1 m_categoryID
//uint32 skillCostID; // 2 m_skillCostsID // uint32 skillCostID; // 2 m_skillCostsID
char* name[16]; // 3-18 m_displayName_lang char* name[16]; // 3-18 m_displayName_lang
// 19 string flags // 19 string flags
//char* description[16]; // 20-35 m_description_lang // char* description[16]; // 20-35 m_description_lang
// 36 string flags // 36 string flags
uint32 spellIcon; // 37 m_spellIconID uint32 spellIcon; // 37 m_spellIconID
//char* alternateVerb[16]; // 38-53 m_alternateVerb_lang // char* alternateVerb[16]; // 38-53 m_alternateVerb_lang
// 54 string flags // 54 string flags
uint32 canLink; // 55 m_canLink (prof. with recipes) uint32 canLink; // 55 m_canLink (prof. with recipes)
}; };
@ -1496,24 +1496,24 @@ struct SkillLineAbilityEntry
uint32 spellId; // 2 m_spell uint32 spellId; // 2 m_spell
uint32 racemask; // 3 m_raceMask uint32 racemask; // 3 m_raceMask
uint32 classmask; // 4 m_classMask uint32 classmask; // 4 m_classMask
//uint32 racemaskNot; // 5 m_excludeRace // uint32 racemaskNot; // 5 m_excludeRace
//uint32 classmaskNot; // 6 m_excludeClass // uint32 classmaskNot; // 6 m_excludeClass
uint32 req_skill_value; // 7 m_minSkillLineRank uint32 req_skill_value; // 7 m_minSkillLineRank
uint32 forward_spellid; // 8 m_supercededBySpell uint32 forward_spellid; // 8 m_supercededBySpell
uint32 learnOnGetSkill; // 9 m_acquireMethod uint32 learnOnGetSkill; // 9 m_acquireMethod
uint32 max_value; // 10 m_trivialSkillLineRankHigh uint32 max_value; // 10 m_trivialSkillLineRankHigh
uint32 min_value; // 11 m_trivialSkillLineRankLow uint32 min_value; // 11 m_trivialSkillLineRankLow
//uint32 characterPoints[2]; // 12-13 m_characterPoints[2] // uint32 characterPoints[2]; // 12-13 m_characterPoints[2]
}; };
struct SoundEntriesEntry struct SoundEntriesEntry
{ {
uint32 Id; // 0 m_ID uint32 Id; // 0 m_ID
//uint32 Type; // 1 m_soundType // uint32 Type; // 1 m_soundType
//char* InternalName; // 2 m_name // char* InternalName; // 2 m_name
//char* FileName[10]; // 3-12 m_File[10] // char* FileName[10]; // 3-12 m_File[10]
//uint32 Unk13[10]; // 13-22 m_Freq[10] // uint32 Unk13[10]; // 13-22 m_Freq[10]
//char* Path; // 23 m_DirectoryBase // char* Path; // 23 m_DirectoryBase
// 24 m_volumeFloat // 24 m_volumeFloat
// 25 m_flags // 25 m_flags
// 26 m_minDistance // 26 m_minDistance
@ -1611,7 +1611,7 @@ struct SpellEntry
uint32 manaPerSecondPerLevel; // 45 m_manaPerSecondPerLevel uint32 manaPerSecondPerLevel; // 45 m_manaPerSecondPerLevel
uint32 rangeIndex; // 46 m_rangeIndex uint32 rangeIndex; // 46 m_rangeIndex
float speed; // 47 m_speed float speed; // 47 m_speed
//uint32 modalNextSpell; // 48 m_modalNextSpell not used // uint32 modalNextSpell; // 48 m_modalNextSpell not used
uint32 StackAmount; // 49 m_cumulativeAura uint32 StackAmount; // 49 m_cumulativeAura
uint32 Totem[MAX_SPELL_TOTEMS]; // 50-51 m_totem uint32 Totem[MAX_SPELL_TOTEMS]; // 50-51 m_totem
int32 Reagent[MAX_SPELL_REAGENTS]; // 52-59 m_reagent int32 Reagent[MAX_SPELL_REAGENTS]; // 52-59 m_reagent
@ -1640,15 +1640,15 @@ struct SpellEntry
uint32 SpellVisual[2]; // 131-132 m_spellVisualID uint32 SpellVisual[2]; // 131-132 m_spellVisualID
uint32 SpellIconID; // 133 m_spellIconID uint32 SpellIconID; // 133 m_spellIconID
uint32 activeIconID; // 134 m_activeIconID uint32 activeIconID; // 134 m_activeIconID
//uint32 spellPriority; // 135 m_spellPriority not used // uint32 spellPriority; // 135 m_spellPriority not used
char* SpellName[16]; // 136-151 m_name_lang char* SpellName[16]; // 136-151 m_name_lang
//uint32 SpellNameFlag; // 152 m_name_flag not used // uint32 SpellNameFlag; // 152 m_name_flag not used
char* Rank[16]; // 153-168 m_nameSubtext_lang char* Rank[16]; // 153-168 m_nameSubtext_lang
//uint32 RankFlags; // 169 m_nameSubtext_flag not used // uint32 RankFlags; // 169 m_nameSubtext_flag not used
//char* Description[16]; // 170-185 m_description_lang not used // char* Description[16]; // 170-185 m_description_lang not used
//uint32 DescriptionFlags; // 186 m_description_flag not used // uint32 DescriptionFlags; // 186 m_description_flag not used
//char* ToolTip[16]; // 187-202 m_auraDescription_lang not used // char* ToolTip[16]; // 187-202 m_auraDescription_lang not used
//uint32 ToolTipFlags; // 203 m_auraDescription_flag not used // uint32 ToolTipFlags; // 203 m_auraDescription_flag not used
uint32 ManaCostPercentage; // 204 m_manaCostPct uint32 ManaCostPercentage; // 204 m_manaCostPct
uint32 StartRecoveryCategory; // 205 m_startRecoveryCategory uint32 StartRecoveryCategory; // 205 m_startRecoveryCategory
uint32 StartRecoveryTime; // 206 m_startRecoveryTime uint32 StartRecoveryTime; // 206 m_startRecoveryTime
@ -1658,19 +1658,19 @@ struct SpellEntry
uint32 MaxAffectedTargets; // 212 m_maxTargets uint32 MaxAffectedTargets; // 212 m_maxTargets
uint32 DmgClass; // 213 m_defenseType uint32 DmgClass; // 213 m_defenseType
uint32 PreventionType; // 214 m_preventionType uint32 PreventionType; // 214 m_preventionType
//uint32 StanceBarOrder; // 215 m_stanceBarOrder not used // uint32 StanceBarOrder; // 215 m_stanceBarOrder not used
float DmgMultiplier[MAX_EFFECT_INDEX]; // 216-218 m_effectChainAmplitude float DmgMultiplier[MAX_EFFECT_INDEX]; // 216-218 m_effectChainAmplitude
//uint32 MinFactionId; // 219 m_minFactionID not used // uint32 MinFactionId; // 219 m_minFactionID not used
//uint32 MinReputation; // 220 m_minReputation not used // uint32 MinReputation; // 220 m_minReputation not used
//uint32 RequiredAuraVision; // 221 m_requiredAuraVision not used // uint32 RequiredAuraVision; // 221 m_requiredAuraVision not used
uint32 TotemCategory[MAX_SPELL_TOTEM_CATEGORIES]; // 222-223 m_requiredTotemCategoryID uint32 TotemCategory[MAX_SPELL_TOTEM_CATEGORIES];// 222-223 m_requiredTotemCategoryID
int32 AreaGroupId; // 224 m_requiredAreasId int32 AreaGroupId; // 224 m_requiredAreasId
uint32 SchoolMask; // 225 m_schoolMask uint32 SchoolMask; // 225 m_schoolMask
uint32 runeCostID; // 226 m_runeCostID uint32 runeCostID; // 226 m_runeCostID
//uint32 spellMissileID; // 227 m_spellMissileID // uint32 spellMissileID; // 227 m_spellMissileID
//uint32 PowerDisplayId; // 228 m_powerDisplayID (PowerDisplay.dbc) // uint32 PowerDisplayId; // 228 m_powerDisplayID (PowerDisplay.dbc)
//float effectBonusCoefficient[3]; // 229-231 m_effectBonusCoefficient // float effectBonusCoefficient[3]; // 229-231 m_effectBonusCoefficient
//uint32 spellDescriptionVariableID; // 232 m_descriptionVariablesID // uint32 spellDescriptionVariableID; // 232 m_descriptionVariablesID
uint32 SpellDifficultyId; // 233 m_difficulty (SpellDifficulty.dbc) uint32 SpellDifficultyId; // 233 m_difficulty (SpellDifficulty.dbc)
// helpers // helpers
@ -1727,14 +1727,14 @@ struct SpellCastTimesEntry
{ {
uint32 ID; // 0 m_ID uint32 ID; // 0 m_ID
int32 CastTime; // 1 m_base int32 CastTime; // 1 m_base
//float CastTimePerLevel; // 2 m_perLevel // float CastTimePerLevel; // 2 m_perLevel
//int32 MinCastTime; // 3 m_minimum // int32 MinCastTime; // 3 m_minimum
}; };
struct SpellFocusObjectEntry struct SpellFocusObjectEntry
{ {
uint32 ID; // 0 m_ID uint32 ID; // 0 m_ID
//char* Name[16]; // 1-15 m_name_lang // char* Name[16]; // 1-15 m_name_lang
// 16 string flags // 16 string flags
}; };
@ -1743,7 +1743,7 @@ struct SpellRadiusEntry
uint32 ID; // m_ID uint32 ID; // m_ID
float Radius; // m_radius float Radius; // m_radius
// m_radiusPerLevel // m_radiusPerLevel
//float RadiusMax; // m_radiusMax // float RadiusMax; // m_radiusMax
}; };
struct SpellRangeEntry struct SpellRangeEntry
@ -1753,11 +1753,11 @@ struct SpellRangeEntry
float minRangeFriendly; // 2 float minRangeFriendly; // 2
float maxRange; // 3 m_rangeMax[2] float maxRange; // 3 m_rangeMax[2]
float maxRangeFriendly; // 4 float maxRangeFriendly; // 4
//uint32 Flags; // 5 m_flags // uint32 Flags; // 5 m_flags
//char* Name[16]; // 6-21 m_displayName_lang // char* Name[16]; // 6-21 m_displayName_lang
//uint32 NameFlags; // 22 string flags // uint32 NameFlags; // 22 string flags
//char* ShortName[16]; // 23-38 m_displayNameShort_lang // char* ShortName[16]; // 23-38 m_displayNameShort_lang
//uint32 NameFlags; // 39 string flags // uint32 NameFlags; // 39 string flags
}; };
struct SpellRuneCostEntry struct SpellRuneCostEntry
@ -1773,17 +1773,17 @@ struct SpellRuneCostEntry
struct SpellShapeshiftFormEntry struct SpellShapeshiftFormEntry
{ {
uint32 ID; // 0 m_ID uint32 ID; // 0 m_ID
//uint32 buttonPosition; // 1 m_bonusActionBar // uint32 buttonPosition; // 1 m_bonusActionBar
//char* Name[16]; // 2-17 m_name_lang // char* Name[16]; // 2-17 m_name_lang
//uint32 NameFlags; // 18 string flags // uint32 NameFlags; // 18 string flags
uint32 flags1; // 19 m_flags uint32 flags1; // 19 m_flags
int32 creatureType; // 20 m_creatureType <=0 humanoid, other normal creature types int32 creatureType; // 20 m_creatureType <=0 humanoid, other normal creature types
//uint32 unk1; // 21 m_attackIconID // uint32 unk1; // 21 m_attackIconID
uint32 attackSpeed; // 22 m_combatRoundTime uint32 attackSpeed; // 22 m_combatRoundTime
uint32 modelID_A; // 23 m_creatureDisplayID[4] uint32 modelID_A; // 23 m_creatureDisplayID[4]
uint32 modelID_H; // 24 uint32 modelID_H; // 24
//uint32 unk3; // 25 // uint32 unk3; // 25
//uint32 unk4; // 26 // uint32 unk4; // 26
uint32 spellId[8]; // 27-34 m_presetSpellID[8] uint32 spellId[8]; // 27-34 m_presetSpellID[8]
}; };
@ -1802,19 +1802,19 @@ struct SpellDurationEntry
struct SpellItemEnchantmentEntry struct SpellItemEnchantmentEntry
{ {
uint32 ID; // 0 m_ID uint32 ID; // 0 m_ID
//uint32 charges; // 1 m_charges // uint32 charges; // 1 m_charges
uint32 type[3]; // 2-4 m_effect[3] uint32 type[3]; // 2-4 m_effect[3]
uint32 amount[3]; // 5-7 m_effectPointsMin[3] uint32 amount[3]; // 5-7 m_effectPointsMin[3]
//uint32 amount2[3] // 8-10 m_effectPointsMax[3] // uint32 amount2[3] // 8-10 m_effectPointsMax[3]
uint32 spellid[3]; // 11-13 m_effectArg[3] uint32 spellid[3]; // 11-13 m_effectArg[3]
char* description[16]; // 14-29 m_name_lang[16] char* description[16]; // 14-29 m_name_lang[16]
//uint32 descriptionFlags; // 30 string flags // uint32 descriptionFlags; // 30 string flags
uint32 aura_id; // 31 m_itemVisual uint32 aura_id; // 31 m_itemVisual
uint32 slot; // 32 m_flags uint32 slot; // 32 m_flags
uint32 GemID; // 33 m_src_itemID uint32 GemID; // 33 m_src_itemID
uint32 EnchantmentCondition; // 34 m_condition_id uint32 EnchantmentCondition; // 34 m_condition_id
//uint32 requiredSkill; // 35 m_requiredSkillID // uint32 requiredSkill; // 35 m_requiredSkillID
//uint32 requiredSkillValue; // 36 m_requiredSkillRank // uint32 requiredSkillValue; // 36 m_requiredSkillRank
// 37 m_minLevel // 37 m_minLevel
}; };
@ -1822,11 +1822,11 @@ struct SpellItemEnchantmentConditionEntry
{ {
uint32 ID; // 0 m_ID uint32 ID; // 0 m_ID
uint8 Color[5]; // 1-5 m_lt_operandType[5] uint8 Color[5]; // 1-5 m_lt_operandType[5]
//uint32 LT_Operand[5]; // 6-10 m_lt_operand[5] // uint32 LT_Operand[5]; // 6-10 m_lt_operand[5]
uint8 Comparator[5]; // 11-15 m_operator[5] uint8 Comparator[5]; // 11-15 m_operator[5]
uint8 CompareColor[5]; // 15-20 m_rt_operandType[5] uint8 CompareColor[5]; // 15-20 m_rt_operandType[5]
uint32 Value[5]; // 21-25 m_rt_operand[5] uint32 Value[5]; // 21-25 m_rt_operand[5]
//uint8 Logic[5] // 25-30 m_logic[5] // uint8 Logic[5] // 25-30 m_logic[5]
}; };
struct StableSlotPricesEntry struct StableSlotPricesEntry
@ -1862,22 +1862,22 @@ struct TalentEntry
// 14-15 part of prev field // 14-15 part of prev field
uint32 DependsOnRank; // 16 m_prereqRank uint32 DependsOnRank; // 16 m_prereqRank
// 17-18 part of prev field // 17-18 part of prev field
//uint32 needAddInSpellBook; // 19 m_flags also need disable higest ranks on reset talent tree // uint32 needAddInSpellBook; // 19 m_flags also need disable higest ranks on reset talent tree
//uint32 unk2; // 20 m_requiredSpellID // uint32 unk2; // 20 m_requiredSpellID
//uint64 allowForPet; // 21 m_categoryMask its a 64 bit mask for pet 1<<m_categoryEnumID in CreatureFamily.dbc // uint64 allowForPet; // 21 m_categoryMask its a 64 bit mask for pet 1<<m_categoryEnumID in CreatureFamily.dbc
}; };
struct TalentTabEntry struct TalentTabEntry
{ {
uint32 TalentTabID; // 0 m_ID uint32 TalentTabID; // 0 m_ID
//char* name[16]; // 1-16 m_name_lang // char* name[16]; // 1-16 m_name_lang
//uint32 nameFlags; // 17 string flags // uint32 nameFlags; // 17 string flags
//unit32 spellicon; // 18 m_spellIconID // unit32 spellicon; // 18 m_spellIconID
// 19 m_raceMask // 19 m_raceMask
uint32 ClassMask; // 20 m_classMask uint32 ClassMask; // 20 m_classMask
uint32 petTalentMask; // 21 m_petTalentMask uint32 petTalentMask; // 21 m_petTalentMask
uint32 tabpage; // 22 m_orderIndex uint32 tabpage; // 22 m_orderIndex
//char* internalname; // 23 m_backgroundFile // char* internalname; // 23 m_backgroundFile
}; };
struct TaxiNodesEntry struct TaxiNodesEntry
@ -1917,14 +1917,14 @@ struct TaxiPathNodeEntry
struct TeamContributionPoints struct TeamContributionPoints
{ {
//uint32 Entry; // 0 m_ID // uint32 Entry; // 0 m_ID
float Value; // 1 m_data float Value; // 1 m_data
}; };
struct TotemCategoryEntry struct TotemCategoryEntry
{ {
uint32 ID; // 0 m_ID uint32 ID; // 0 m_ID
//char* name[16]; // 1-16 m_name_lang // char* name[16]; // 1-16 m_name_lang
// 17 string flags // 17 string flags
uint32 categoryType; // 18 m_totemCategoryType (one for specialization) uint32 categoryType; // 18 m_totemCategoryType (one for specialization)
uint32 categoryMask; // 19 m_totemCategoryMask (compatibility mask for same type: different for totems, compatible from high to low for rods) uint32 categoryMask; // 19 m_totemCategoryMask (compatibility mask for same type: different for totems, compatible from high to low for rods)
@ -2035,23 +2035,23 @@ struct WMOAreaTableEntry
int32 rootId; // 1 m_WMOID used in root WMO int32 rootId; // 1 m_WMOID used in root WMO
int32 adtId; // 2 m_NameSetID used in adt file int32 adtId; // 2 m_NameSetID used in adt file
int32 groupId; // 3 m_WMOGroupID used in group WMO int32 groupId; // 3 m_WMOGroupID used in group WMO
//uint32 field4; // 4 m_SoundProviderPref // uint32 field4; // 4 m_SoundProviderPref
//uint32 field5; // 5 m_SoundProviderPrefUnderwater // uint32 field5; // 5 m_SoundProviderPrefUnderwater
//uint32 field6; // 6 m_AmbienceID // uint32 field6; // 6 m_AmbienceID
//uint32 field7; // 7 m_ZoneMusic // uint32 field7; // 7 m_ZoneMusic
//uint32 field8; // 8 m_IntroSound // uint32 field8; // 8 m_IntroSound
uint32 Flags; // 9 m_flags (used for indoor/outdoor determination) uint32 Flags; // 9 m_flags (used for indoor/outdoor determination)
uint32 areaId; // 10 m_AreaTableID (AreaTable.dbc) uint32 areaId; // 10 m_AreaTableID (AreaTable.dbc)
//char *Name[16]; // m_AreaName_lang // char *Name[16]; // m_AreaName_lang
//uint32 nameFlags; // uint32 nameFlags;
}; };
struct WorldMapAreaEntry struct WorldMapAreaEntry
{ {
//uint32 ID; // 0 m_ID // uint32 ID; // 0 m_ID
uint32 map_id; // 1 m_mapID uint32 map_id; // 1 m_mapID
uint32 area_id; // 2 m_areaID index (continent 0 areas ignored) uint32 area_id; // 2 m_areaID index (continent 0 areas ignored)
//char* internal_name // 3 m_areaName // char* internal_name // 3 m_areaName
float y1; // 4 m_locLeft float y1; // 4 m_locLeft
float y2; // 5 m_locRight float y2; // 5 m_locRight
float x1; // 6 m_locTop float x1; // 6 m_locTop
@ -2066,11 +2066,11 @@ struct WorldMapAreaEntry
struct WorldMapOverlayEntry struct WorldMapOverlayEntry
{ {
uint32 ID; // 0 m_ID uint32 ID; // 0 m_ID
//uint32 worldMapAreaId; // 1 m_mapAreaID (WorldMapArea.dbc) // uint32 worldMapAreaId; // 1 m_mapAreaID (WorldMapArea.dbc)
uint32 areatableID[MAX_WORLD_MAP_OVERLAY_AREA_IDX]; // 2-5 m_areaID uint32 areatableID[MAX_WORLD_MAP_OVERLAY_AREA_IDX]; // 2-5 m_areaID
// 6 m_mapPointX // 6 m_mapPointX
// 7 m_mapPointY // 7 m_mapPointY
//char* internal_name // 8 m_textureName // char* internal_name // 8 m_textureName
// 9 m_textureWidth // 9 m_textureWidth
// 10 m_textureHeight // 10 m_textureHeight
// 11 m_offsetX // 11 m_offsetX
@ -2088,7 +2088,7 @@ struct WorldSafeLocsEntry
float x; // 2 m_locX float x; // 2 m_locX
float y; // 3 m_locY float y; // 3 m_locY
float z; // 4 m_locZ float z; // 4 m_locZ
//char* name[16] // 5-20 m_AreaName_lang // char* name[16] // 5-20 m_AreaName_lang
// 21 string flags // 21 string flags
}; };

View file

@ -60,15 +60,15 @@ const char GtChanceToSpellCritBasefmt[] = "f";
const char GtChanceToSpellCritfmt[] = "f"; const char GtChanceToSpellCritfmt[] = "f";
const char GtOCTClassCombatRatingScalarfmt[] = "df"; const char GtOCTClassCombatRatingScalarfmt[] = "df";
const char GtOCTRegenHPfmt[] = "f"; const char GtOCTRegenHPfmt[] = "f";
//const char GtOCTRegenMPfmt[]="f"; // const char GtOCTRegenMPfmt[]="f";
const char GtRegenHPPerSptfmt[] = "f"; const char GtRegenHPPerSptfmt[] = "f";
const char GtRegenMPPerSptfmt[] = "f"; const char GtRegenMPPerSptfmt[] = "f";
const char Holidaysfmt[] = "nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const char Holidaysfmt[] = "nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
const char Itemfmt[] = "niiiiiii"; const char Itemfmt[] = "niiiiiii";
const char ItemBagFamilyfmt[] = "nxxxxxxxxxxxxxxxxx"; const char ItemBagFamilyfmt[] = "nxxxxxxxxxxxxxxxxx";
const char ItemClassfmt[] = "nxxssssssssssssssssx"; const char ItemClassfmt[] = "nxxssssssssssssssssx";
//const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx"; // const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx";
//const char ItemCondExtCostsEntryfmt[]="xiii"; // const char ItemCondExtCostsEntryfmt[]="xiii";
const char ItemExtendedCostEntryfmt[] = "niiiiiiiiiiiiiix"; const char ItemExtendedCostEntryfmt[] = "niiiiiiiiiiiiiix";
const char ItemLimitCategoryEntryfmt[] = "nxxxxxxxxxxxxxxxxxii"; const char ItemLimitCategoryEntryfmt[] = "nxxxxxxxxxxxxxxxxxii";
const char ItemRandomPropertiesfmt[] = "nxiiiiissssssssssssssssx"; const char ItemRandomPropertiesfmt[] = "nxiiiiissssssssssssssssx";

View file

@ -52,7 +52,7 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket)
void WorldSession::HandleDuelCancelledOpcode(WorldPacket& recvPacket) void WorldSession::HandleDuelCancelledOpcode(WorldPacket& recvPacket)
{ {
//DEBUG_LOG( "WORLD: received CMSG_DUEL_CANCELLED" ); // DEBUG_LOG( "WORLD: received CMSG_DUEL_CANCELLED" );
// no duel requested // no duel requested
if (!GetPlayer()->duel) if (!GetPlayer()->duel)

View file

@ -132,7 +132,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket& recv_data)
data << uint32(2); // 2 - nothing appears (3-error creating, 5-error updating) data << uint32(2); // 2 - nothing appears (3-error creating, 5-error updating)
SendPacket(&data); SendPacket(&data);
//TODO: Guard player map // TODO: Guard player map
HashMapHolder<Player>::MapType& m = sObjectAccessor.GetPlayers(); HashMapHolder<Player>::MapType& m = sObjectAccessor.GetPlayers();
for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr) for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
{ {

View file

@ -623,10 +623,10 @@ uint32 GameEventMgr::Update(ActiveEvents const* activeAtShutdown /*= NULL*/)
uint32 calcDelay; uint32 calcDelay;
for (uint16 itr = 1; itr < mGameEvent.size(); ++itr) for (uint16 itr = 1; itr < mGameEvent.size(); ++itr)
{ {
//sLog.outErrorDb("Checking event %u",itr); // sLog.outErrorDb("Checking event %u",itr);
if (CheckOneGameEvent(itr, currenttime)) if (CheckOneGameEvent(itr, currenttime))
{ {
//DEBUG_LOG("GameEvent %u is active",itr->first); // DEBUG_LOG("GameEvent %u is active",itr->first);
if (!IsActiveEvent(itr)) if (!IsActiveEvent(itr))
{ {
bool resume = activeAtShutdown && (activeAtShutdown->find(itr) != activeAtShutdown->end()); bool resume = activeAtShutdown && (activeAtShutdown->find(itr) != activeAtShutdown->end());
@ -635,7 +635,7 @@ uint32 GameEventMgr::Update(ActiveEvents const* activeAtShutdown /*= NULL*/)
} }
else else
{ {
//DEBUG_LOG("GameEvent %u is not active",itr->first); // DEBUG_LOG("GameEvent %u is not active",itr->first);
if (IsActiveEvent(itr)) if (IsActiveEvent(itr))
StopEvent(itr); StopEvent(itr);
else else
@ -926,7 +926,7 @@ void GameEventMgr::UpdateEventQuests(uint16 event_id, bool Activate)
{ {
const Quest* pQuest = sObjectMgr.GetQuestTemplate(*itr); const Quest* pQuest = sObjectMgr.GetQuestTemplate(*itr);
//if (Activate) // if (Activate)
//{ //{
// TODO: implement way to reset quests when event begin. // TODO: implement way to reset quests when event begin.
//} //}

View file

@ -161,9 +161,9 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa
if (goinfo->type == GAMEOBJECT_TYPE_CAPTURE_POINT && goinfo->capturePoint.radius) if (goinfo->type == GAMEOBJECT_TYPE_CAPTURE_POINT && goinfo->capturePoint.radius)
SetCapturePointSlider(CAPTURE_SLIDER_NEUTRAL); SetCapturePointSlider(CAPTURE_SLIDER_NEUTRAL);
//Notify the map's instance data. // Notify the map's instance data.
//Only works if you create the object in it, not if it is moves to that map. // Only works if you create the object in it, not if it is moves to that map.
//Normally non-players do not teleport to other maps. // Normally non-players do not teleport to other maps.
if (InstanceData* iData = map->GetInstanceData()) if (InstanceData* iData = map->GetInstanceData())
iData->OnObjectCreate(this); iData->OnObjectCreate(this);
@ -247,10 +247,10 @@ void GameObject::Update(uint32 update_diff, uint32 p_time)
} }
case GAMEOBJECT_TYPE_DOOR: case GAMEOBJECT_TYPE_DOOR:
case GAMEOBJECT_TYPE_BUTTON: case GAMEOBJECT_TYPE_BUTTON:
//we need to open doors if they are closed (add there another condition if this code breaks some usage, but it need to be here for battlegrounds) // we need to open doors if they are closed (add there another condition if this code breaks some usage, but it need to be here for battlegrounds)
if (GetGoState() != GO_STATE_READY) if (GetGoState() != GO_STATE_READY)
ResetDoorOrButton(); ResetDoorOrButton();
//flags in AB are type_button and we need to add them here so no break! // flags in AB are type_button and we need to add them here so no break!
default: default:
if (!m_spawnedByDefault) // despawn timer if (!m_spawnedByDefault) // despawn timer
{ {
@ -280,8 +280,8 @@ void GameObject::Update(uint32 update_diff, uint32 p_time)
Unit* ok = NULL; // pointer to appropriate target if found any Unit* ok = NULL; // pointer to appropriate target if found any
bool IsBattleGroundTrap = false; bool IsBattleGroundTrap = false;
//FIXME: this is activation radius (in different casting radius that must be selected from spell data) // FIXME: this is activation radius (in different casting radius that must be selected from spell data)
//TODO: move activated state code (cast itself) to GO_ACTIVATED, in this place only check activating and set state // TODO: move activated state code (cast itself) to GO_ACTIVATED, in this place only check activating and set state
float radius = float(goInfo->trap.radius); float radius = float(goInfo->trap.radius);
if (!radius) if (!radius)
{ {
@ -334,7 +334,7 @@ void GameObject::Update(uint32 update_diff, uint32 p_time)
if (IsBattleGroundTrap && ok->GetTypeId() == TYPEID_PLAYER) if (IsBattleGroundTrap && ok->GetTypeId() == TYPEID_PLAYER)
{ {
//BattleGround gameobjects case // BattleGround gameobjects case
if (((Player*)ok)->InBattleGround()) if (((Player*)ok)->InBattleGround())
if (BattleGround* bg = ((Player*)ok)->GetBattleGround()) if (BattleGround* bg = ((Player*)ok)->GetBattleGround())
bg->HandleTriggerBuff(GetObjectGuid()); bg->HandleTriggerBuff(GetObjectGuid());
@ -412,7 +412,7 @@ void GameObject::Update(uint32 update_diff, uint32 p_time)
SetGoState(GO_STATE_READY); SetGoState(GO_STATE_READY);
//any return here in case battleground traps // any return here in case battleground traps
break; break;
case GAMEOBJECT_TYPE_CAPTURE_POINT: case GAMEOBJECT_TYPE_CAPTURE_POINT:
// remove capturing players because slider wont be displayed if capture point is being locked // remove capturing players because slider wont be displayed if capture point is being locked
@ -605,7 +605,7 @@ bool GameObject::LoadFromDB(uint32 guid, Map* map)
} }
uint32 entry = data->id; uint32 entry = data->id;
//uint32 map_id = data->mapid; // already used before call // uint32 map_id = data->mapid; // already used before call
uint32 phaseMask = data->phaseMask; uint32 phaseMask = data->phaseMask;
float x = data->posX; float x = data->posX;
float y = data->posY; float y = data->posY;
@ -822,7 +822,7 @@ bool GameObject::ActivateToQuest(Player* pTarget) const
if (LootTemplates_Gameobject.HaveQuestLootForPlayer(GetGOInfo()->GetLootId(), pTarget)) if (LootTemplates_Gameobject.HaveQuestLootForPlayer(GetGOInfo()->GetLootId(), pTarget))
{ {
//look for battlegroundAV for some objects which are only activated after mine gots captured by own team // look for battlegroundAV for some objects which are only activated after mine gots captured by own team
if (GetEntry() == BG_AV_OBJECTID_MINE_N || GetEntry() == BG_AV_OBJECTID_MINE_S) if (GetEntry() == BG_AV_OBJECTID_MINE_N || GetEntry() == BG_AV_OBJECTID_MINE_S)
if (BattleGround* bg = pTarget->GetBattleGround()) if (BattleGround* bg = pTarget->GetBattleGround())
if (bg->GetTypeID() == BATTLEGROUND_AV && !(((BattleGroundAV*)bg)->PlayerCanDoMineQuest(GetEntry(), pTarget->GetTeam()))) if (bg->GetTypeID() == BATTLEGROUND_AV && !(((BattleGroundAV*)bg)->PlayerCanDoMineQuest(GetEntry(), pTarget->GetTeam())))
@ -961,9 +961,9 @@ void GameObject::SwitchDoorOrButton(bool activate, bool alternative /* = false *
else else
RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
if (GetGoState() == GO_STATE_READY) //if closed -> open if (GetGoState() == GO_STATE_READY) // if closed -> open
SetGoState(alternative ? GO_STATE_ACTIVE_ALTERNATIVE : GO_STATE_ACTIVE); SetGoState(alternative ? GO_STATE_ACTIVE_ALTERNATIVE : GO_STATE_ACTIVE);
else //if open -> close else // if open -> close
SetGoState(GO_STATE_READY); SetGoState(GO_STATE_READY);
} }
@ -994,7 +994,7 @@ void GameObject::Use(Unit* user)
{ {
case GAMEOBJECT_TYPE_DOOR: // 0 case GAMEOBJECT_TYPE_DOOR: // 0
{ {
//doors never really despawn, only reset to default state/flags // doors never really despawn, only reset to default state/flags
UseDoorOrButton(); UseDoorOrButton();
// activate script // activate script
@ -1004,7 +1004,7 @@ void GameObject::Use(Unit* user)
} }
case GAMEOBJECT_TYPE_BUTTON: // 1 case GAMEOBJECT_TYPE_BUTTON: // 1
{ {
//buttons never really despawn, only reset to default state/flags // buttons never really despawn, only reset to default state/flags
UseDoorOrButton(); UseDoorOrButton();
TriggerLinkedGameObject(user); TriggerLinkedGameObject(user);
@ -1192,7 +1192,7 @@ void GameObject::Use(Unit* user)
// possible quest objective for active quests // possible quest objective for active quests
if (info->goober.questId && sObjectMgr.GetQuestTemplate(info->goober.questId)) if (info->goober.questId && sObjectMgr.GetQuestTemplate(info->goober.questId))
{ {
//Quest require to be active for GO using // Quest require to be active for GO using
if (player->GetQuestStatus(info->goober.questId) != QUEST_STATUS_INCOMPLETE) if (player->GetQuestStatus(info->goober.questId) != QUEST_STATUS_INCOMPLETE)
break; break;
} }
@ -1265,7 +1265,7 @@ void GameObject::Use(Unit* user)
if (!zone_skill) if (!zone_skill)
zone_skill = sObjectMgr.GetFishingBaseSkillLevel(zone); zone_skill = sObjectMgr.GetFishingBaseSkillLevel(zone);
//provide error, no fishable zone or area should be 0 // provide error, no fishable zone or area should be 0
if (!zone_skill) if (!zone_skill)
sLog.outErrorDb("Fishable areaId %u are not properly defined in `skill_fishing_base_level`.", subzone); sLog.outErrorDb("Fishable areaId %u are not properly defined in `skill_fishing_base_level`.", subzone);
@ -1284,7 +1284,7 @@ void GameObject::Use(Unit* user)
{ {
if (!sWorld.getConfig(CONFIG_BOOL_SKILL_FAIL_POSSIBLE_FISHINGPOOL)) if (!sWorld.getConfig(CONFIG_BOOL_SKILL_FAIL_POSSIBLE_FISHINGPOOL))
{ {
//TODO: find reasonable value for fishing hole search // TODO: find reasonable value for fishing hole search
fishingHole = LookupFishingHoleAround(20.0f + CONTACT_DISTANCE); fishingHole = LookupFishingHoleAround(20.0f + CONTACT_DISTANCE);
if (fishingHole) if (fishingHole)
success = true; success = true;
@ -1292,7 +1292,7 @@ void GameObject::Use(Unit* user)
} }
// just search fishhole for success case // just search fishhole for success case
else else
//TODO: find reasonable value for fishing hole search // TODO: find reasonable value for fishing hole search
fishingHole = LookupFishingHoleAround(20.0f + CONTACT_DISTANCE); fishingHole = LookupFishingHoleAround(20.0f + CONTACT_DISTANCE);
if (success || sWorld.getConfig(CONFIG_BOOL_SKILL_FAIL_GAIN_FISHING)) if (success || sWorld.getConfig(CONFIG_BOOL_SKILL_FAIL_GAIN_FISHING))
@ -1461,7 +1461,7 @@ void GameObject::Use(Unit* user)
if (!targetPlayer || targetPlayer == player || !targetPlayer->IsInSameGroupWith(player)) if (!targetPlayer || targetPlayer == player || !targetPlayer->IsInSameGroupWith(player))
return; return;
//required lvl checks! // required lvl checks!
uint8 level = player->getLevel(); uint8 level = player->getLevel();
if (level < info->meetingstone.minLevel || level > info->meetingstone.maxLevel) if (level < info->meetingstone.minLevel || level > info->meetingstone.maxLevel)
return; return;
@ -1498,7 +1498,7 @@ void GameObject::Use(Unit* user)
// 15004 // 15004
// 15005 // 15005
bg->EventPlayerClickedOnFlag(player, this); bg->EventPlayerClickedOnFlag(player, this);
return; //we don't need to delete flag ... it is despawned! return; // we don't need to delete flag ... it is despawned!
} }
break; break;
} }
@ -1549,7 +1549,7 @@ void GameObject::Use(Unit* user)
break; break;
} }
} }
//this cause to call return, all flags must be deleted here!! // this cause to call return, all flags must be deleted here!!
spellId = 0; spellId = 0;
Delete(); Delete();
} }
@ -1855,7 +1855,7 @@ void GameObject::SetLootRecipient(Unit* pUnit)
float GameObject::GetObjectBoundingRadius() const float GameObject::GetObjectBoundingRadius() const
{ {
//FIXME: // FIXME:
// 1. This is clearly hack way because GameObjectDisplayInfoEntry have 6 floats related to GO sizes, but better that use DEFAULT_WORLD_OBJECT_SIZE // 1. This is clearly hack way because GameObjectDisplayInfoEntry have 6 floats related to GO sizes, but better that use DEFAULT_WORLD_OBJECT_SIZE
// 2. In some cases this must be only interactive size, not GO size, current way can affect creature target point auto-selection in strange ways for big underground/virtual GOs // 2. In some cases this must be only interactive size, not GO size, current way can affect creature target point auto-selection in strange ways for big underground/virtual GOs
if (m_displayInfo) if (m_displayInfo)
@ -1904,7 +1904,7 @@ struct SpawnGameObjectInMapsWorker
if (map->IsLoaded(i_data->posX, i_data->posY)) if (map->IsLoaded(i_data->posX, i_data->posY))
{ {
GameObject* pGameobject = new GameObject; GameObject* pGameobject = new GameObject;
//DEBUG_LOG("Spawning gameobject %u", *itr); // DEBUG_LOG("Spawning gameobject %u", *itr);
if (!pGameobject->LoadFromDB(i_guid, map)) if (!pGameobject->LoadFromDB(i_guid, map))
{ {
delete pGameobject; delete pGameobject;

View file

@ -190,7 +190,7 @@ void PlayerMenu::SendGossipMenu(uint32 TitleTextId, ObjectGuid objectGuid)
} }
GetMenuSession()->SendPacket(&data); GetMenuSession()->SendPacket(&data);
//DEBUG_LOG( "WORLD: Sent SMSG_GOSSIP_MESSAGE NPCGuid=%u",GUID_LOPART(npcGUID) ); // DEBUG_LOG( "WORLD: Sent SMSG_GOSSIP_MESSAGE NPCGuid=%u",GUID_LOPART(npcGUID) );
} }
void PlayerMenu::CloseGossip() void PlayerMenu::CloseGossip()
@ -198,7 +198,7 @@ void PlayerMenu::CloseGossip()
WorldPacket data(SMSG_GOSSIP_COMPLETE, 0); WorldPacket data(SMSG_GOSSIP_COMPLETE, 0);
GetMenuSession()->SendPacket(&data); GetMenuSession()->SendPacket(&data);
//DEBUG_LOG( "WORLD: Sent SMSG_GOSSIP_COMPLETE" ); // DEBUG_LOG( "WORLD: Sent SMSG_GOSSIP_COMPLETE" );
} }
// Outdated // Outdated
@ -213,7 +213,7 @@ void PlayerMenu::SendPointOfInterest(float X, float Y, uint32 Icon, uint32 Flags
data << locName; data << locName;
GetMenuSession()->SendPacket(&data); GetMenuSession()->SendPacket(&data);
//DEBUG_LOG("WORLD: Sent SMSG_GOSSIP_POI"); // DEBUG_LOG("WORLD: Sent SMSG_GOSSIP_POI");
} }
void PlayerMenu::SendPointOfInterest(uint32 poi_id) void PlayerMenu::SendPointOfInterest(uint32 poi_id)
@ -242,7 +242,7 @@ void PlayerMenu::SendPointOfInterest(uint32 poi_id)
data << icon_name; data << icon_name;
GetMenuSession()->SendPacket(&data); GetMenuSession()->SendPacket(&data);
//DEBUG_LOG("WORLD: Sent SMSG_GOSSIP_POI"); // DEBUG_LOG("WORLD: Sent SMSG_GOSSIP_POI");
} }
void PlayerMenu::SendTalking(uint32 textID) void PlayerMenu::SendTalking(uint32 textID)
@ -528,7 +528,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* pQuest, ObjectGuid guid
for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward reputation override. No bonus is expected given for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward reputation override. No bonus is expected given
data << int32(0); data << int32(0);
//data << int32(pQuest->RewRepValue[i]); // current field for store of rep value, can be reused to implement "override value" // data << int32(pQuest->RewRepValue[i]); // current field for store of rep value, can be reused to implement "override value"
data << uint32(QUEST_EMOTE_COUNT); data << uint32(QUEST_EMOTE_COUNT);
@ -651,7 +651,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* pQuest)
for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward reputation override. No bonus is expected given for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward reputation override. No bonus is expected given
data << int32(0); data << int32(0);
//data << int32(pQuest->RewRepValue[i]); // current field for store of rep value, can be reused to implement "override value" // data << int32(pQuest->RewRepValue[i]); // current field for store of rep value, can be reused to implement "override value"
data << pQuest->GetPointMapId(); data << pQuest->GetPointMapId();
data << pQuest->GetPointX(); data << pQuest->GetPointX();
@ -795,7 +795,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, ObjectGuid npcGU
for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward reputation override. No diplomacy bonus is expected given, reward also does not display in chat window for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward reputation override. No diplomacy bonus is expected given, reward also does not display in chat window
data << int32(0); data << int32(0);
//data << int32(pQuest->RewRepValue[i]); // data << int32(pQuest->RewRepValue[i]);
GetMenuSession()->SendPacket(&data); GetMenuSession()->SendPacket(&data);
DEBUG_LOG("WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid = %s, questid = %u", npcGUID.GetString().c_str(), pQuest->GetQuestId()); DEBUG_LOG("WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid = %s, questid = %u", npcGUID.GetString().c_str(), pQuest->GetQuestId());

View file

@ -55,19 +55,19 @@ enum Gossip_Option
enum GossipOptionIcon enum GossipOptionIcon
{ {
GOSSIP_ICON_CHAT = 0, //white chat bubble GOSSIP_ICON_CHAT = 0, // white chat bubble
GOSSIP_ICON_VENDOR = 1, //brown bag GOSSIP_ICON_VENDOR = 1, // brown bag
GOSSIP_ICON_TAXI = 2, //flight GOSSIP_ICON_TAXI = 2, // flight
GOSSIP_ICON_TRAINER = 3, //book GOSSIP_ICON_TRAINER = 3, // book
GOSSIP_ICON_INTERACT_1 = 4, //interaction wheel GOSSIP_ICON_INTERACT_1 = 4, // interaction wheel
GOSSIP_ICON_INTERACT_2 = 5, //interaction wheel GOSSIP_ICON_INTERACT_2 = 5, // interaction wheel
GOSSIP_ICON_MONEY_BAG = 6, //brown bag with yellow dot GOSSIP_ICON_MONEY_BAG = 6, // brown bag with yellow dot
GOSSIP_ICON_TALK = 7, //white chat bubble with black dots GOSSIP_ICON_TALK = 7, // white chat bubble with black dots
GOSSIP_ICON_TABARD = 8, //tabard GOSSIP_ICON_TABARD = 8, // tabard
GOSSIP_ICON_BATTLE = 9, //two swords GOSSIP_ICON_BATTLE = 9, // two swords
GOSSIP_ICON_DOT = 10, //yellow dot GOSSIP_ICON_DOT = 10, // yellow dot
GOSSIP_ICON_CHAT_11 = 11, //This and below are most the same visual as GOSSIP_ICON_CHAT GOSSIP_ICON_CHAT_11 = 11, // This and below are most the same visual as GOSSIP_ICON_CHAT
GOSSIP_ICON_CHAT_12 = 12, //but are still used for unknown reasons. GOSSIP_ICON_CHAT_12 = 12, // but are still used for unknown reasons.
GOSSIP_ICON_CHAT_13 = 13, GOSSIP_ICON_CHAT_13 = 13,
GOSSIP_ICON_CHAT_14 = 14, // probably invalid GOSSIP_ICON_CHAT_14 = 14, // probably invalid
GOSSIP_ICON_CHAT_15 = 15, // probably invalid GOSSIP_ICON_CHAT_15 = 15, // probably invalid
@ -79,7 +79,7 @@ enum GossipOptionIcon
GOSSIP_ICON_MAX GOSSIP_ICON_MAX
}; };
//POI icons. Many more exist, list not complete. // POI icons. Many more exist, list not complete.
enum Poi_Icon enum Poi_Icon
{ {
ICON_POI_BLANK = 0, // Blank (not visible), in 2.4.3 have value 15 with 1..15 values in 0..14 range ICON_POI_BLANK = 0, // Blank (not visible), in 2.4.3 have value 15 with 1..15 values in 0..14 range

View file

@ -589,7 +589,7 @@ bool GridMap::ExistMap(uint32 mapid, int gx, int gy)
{ {
sLog.outError("Map file '%s' is non-compatible version (outdated?). Please, create new using ad.exe program.", tmp); sLog.outError("Map file '%s' is non-compatible version (outdated?). Please, create new using ad.exe program.", tmp);
delete [] tmp; delete [] tmp;
fclose(pf); //close file before return fclose(pf); // close file before return
return false; return false;
} }
@ -630,9 +630,9 @@ TerrainInfo::TerrainInfo(uint32 mapid) : m_mapId(mapid)
} }
} }
//clean up GridMap objects every minute // clean up GridMap objects every minute
const uint32 iCleanUpInterval = 60; const uint32 iCleanUpInterval = 60;
//schedule start randlomly // schedule start randlomly
const uint32 iRandomStart = urand(20, 40); const uint32 iRandomStart = urand(20, 40);
i_timer.SetInterval(iCleanUpInterval * 1000); i_timer.SetInterval(iCleanUpInterval * 1000);
@ -654,10 +654,10 @@ GridMap* TerrainInfo::Load(const uint32 x, const uint32 y)
MANGOS_ASSERT(x < MAX_NUMBER_OF_GRIDS); MANGOS_ASSERT(x < MAX_NUMBER_OF_GRIDS);
MANGOS_ASSERT(y < MAX_NUMBER_OF_GRIDS); MANGOS_ASSERT(y < MAX_NUMBER_OF_GRIDS);
//reference grid as a first step // reference grid as a first step
RefGrid(x, y); RefGrid(x, y);
//quick check if GridMap already loaded // quick check if GridMap already loaded
GridMap* pMap = m_GridMaps[x][y]; GridMap* pMap = m_GridMaps[x][y];
if (!pMap) if (!pMap)
pMap = LoadMapAndVMap(x, y); pMap = LoadMapAndVMap(x, y);
@ -665,7 +665,7 @@ GridMap* TerrainInfo::Load(const uint32 x, const uint32 y)
return pMap; return pMap;
} }
//schedule lazy GridMap object cleanup // schedule lazy GridMap object cleanup
void TerrainInfo::Unload(const uint32 x, const uint32 y) void TerrainInfo::Unload(const uint32 x, const uint32 y)
{ {
MANGOS_ASSERT(x < MAX_NUMBER_OF_GRIDS); MANGOS_ASSERT(x < MAX_NUMBER_OF_GRIDS);
@ -673,17 +673,17 @@ void TerrainInfo::Unload(const uint32 x, const uint32 y)
if (m_GridMaps[x][y]) if (m_GridMaps[x][y])
{ {
//decrease grid reference count... // decrease grid reference count...
if (UnrefGrid(x, y) == 0) if (UnrefGrid(x, y) == 0)
{ {
//TODO: add your additional logic here // TODO: add your additional logic here
} }
} }
} }
//call this method only // call this method only
void TerrainInfo::CleanUpGrids(const uint32 diff) void TerrainInfo::CleanUpGrids(const uint32 diff)
{ {
i_timer.Update(diff); i_timer.Update(diff);
@ -697,18 +697,18 @@ void TerrainInfo::CleanUpGrids(const uint32 diff)
const int16& iRef = m_GridRef[x][y]; const int16& iRef = m_GridRef[x][y];
GridMap* pMap = m_GridMaps[x][y]; GridMap* pMap = m_GridMaps[x][y];
//delete those GridMap objects which have refcount = 0 // delete those GridMap objects which have refcount = 0
if (pMap && iRef == 0) if (pMap && iRef == 0)
{ {
m_GridMaps[x][y] = NULL; m_GridMaps[x][y] = NULL;
//delete grid data if reference count == 0 // delete grid data if reference count == 0
pMap->unloadData(); pMap->unloadData();
delete pMap; delete pMap;
//unload VMAPS... // unload VMAPS...
VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(m_mapId, x, y); VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(m_mapId, x, y);
//unload mmap... // unload mmap...
MMAP::MMapFactory::createOrGetMMapManager()->unloadMap(m_mapId, x, y); MMAP::MMapFactory::createOrGetMMapManager()->unloadMap(m_mapId, x, y);
} }
} }
@ -988,7 +988,7 @@ bool TerrainInfo::IsInWater(float x, float y, float pZ, GridMapLiquidData* data)
GridMapLiquidData* liquid_ptr = data ? data : &liquid_status; GridMapLiquidData* liquid_ptr = data ? data : &liquid_status;
if (getLiquidStatus(x, y, pZ, MAP_ALL_LIQUIDS, liquid_ptr)) if (getLiquidStatus(x, y, pZ, MAP_ALL_LIQUIDS, liquid_ptr))
{ {
//if (liquid_prt->level - liquid_prt->depth_level > 2) //??? // if (liquid_prt->level - liquid_prt->depth_level > 2) //???
return true; return true;
} }
} }
@ -1038,10 +1038,10 @@ float TerrainInfo::GetWaterOrGroundLevel(float x, float y, float z, float* pGrou
GridMap* TerrainInfo::GetGrid(const float x, const float y) GridMap* TerrainInfo::GetGrid(const float x, const float y)
{ {
// half opt method // half opt method
int gx = (int)(32 - x / SIZE_OF_GRIDS); //grid x int gx = (int)(32 - x / SIZE_OF_GRIDS); // grid x
int gy = (int)(32 - y / SIZE_OF_GRIDS); //grid y int gy = (int)(32 - y / SIZE_OF_GRIDS); // grid y
//quick check if GridMap already loaded // quick check if GridMap already loaded
GridMap* pMap = m_GridMaps[gx][gy]; GridMap* pMap = m_GridMaps[gx][gy];
if (!pMap) if (!pMap)
pMap = LoadMapAndVMap(gx, gy); pMap = LoadMapAndVMap(gx, gy);
@ -1051,7 +1051,7 @@ GridMap* TerrainInfo::GetGrid(const float x, const float y)
GridMap* TerrainInfo::LoadMapAndVMap(const uint32 x, const uint32 y) GridMap* TerrainInfo::LoadMapAndVMap(const uint32 x, const uint32 y)
{ {
//double checked lock pattern // double checked lock pattern
if (!m_GridMaps[x][y]) if (!m_GridMaps[x][y])
{ {
LOCK_GUARD lock(m_mutex); LOCK_GUARD lock(m_mutex);
@ -1070,13 +1070,13 @@ GridMap* TerrainInfo::LoadMapAndVMap(const uint32 x, const uint32 y)
if (!map->loadData(tmp)) if (!map->loadData(tmp))
{ {
sLog.outError("Error load map file: \n %s\n", tmp); sLog.outError("Error load map file: \n %s\n", tmp);
//ASSERT(false); // ASSERT(false);
} }
delete [] tmp; delete [] tmp;
m_GridMaps[x][y] = map; m_GridMaps[x][y] = map;
//load VMAPs for current map/grid... // load VMAPs for current map/grid...
const MapEntry* i_mapEntry = sMapStore.LookupEntry(m_mapId); const MapEntry* i_mapEntry = sMapStore.LookupEntry(m_mapId);
const char* mapName = i_mapEntry ? i_mapEntry->name[sWorld.GetDefaultDbcLocale()] : "UNNAMEDMAP\x0"; const char* mapName = i_mapEntry ? i_mapEntry->name[sWorld.GetDefaultDbcLocale()] : "UNNAMEDMAP\x0";
@ -1167,7 +1167,7 @@ void TerrainManager::UnloadTerrain(const uint32 mapId)
if (iter != i_TerrainMap.end()) if (iter != i_TerrainMap.end())
{ {
TerrainInfo* ptr = (*iter).second; TerrainInfo* ptr = (*iter).second;
//lets check if this object can be actually freed // lets check if this object can be actually freed
if (ptr->IsReferenced() == false) if (ptr->IsReferenced() == false)
{ {
i_TerrainMap.erase(iter); i_TerrainMap.erase(iter);
@ -1178,7 +1178,7 @@ void TerrainManager::UnloadTerrain(const uint32 mapId)
void TerrainManager::Update(const uint32 diff) void TerrainManager::Update(const uint32 diff)
{ {
//global garbage collection for GridMap objects and VMaps // global garbage collection for GridMap objects and VMaps
for (TerrainDataMap::iterator iter = i_TerrainMap.begin(); iter != i_TerrainMap.end(); ++iter) for (TerrainDataMap::iterator iter = i_TerrainMap.begin(); iter != i_TerrainMap.end(); ++iter)
iter->second->CleanUpGrids(diff); iter->second->CleanUpGrids(diff);
} }

View file

@ -207,7 +207,7 @@ typedef ACE_Atomic_Op<ACE_Thread_Mutex, long> AtomicLong;
#define DEFAULT_HEIGHT_SEARCH 10.0f // default search distance to find height at nearby locations #define DEFAULT_HEIGHT_SEARCH 10.0f // default search distance to find height at nearby locations
#define DEFAULT_WATER_SEARCH 50.0f // default search distance to case detection water level #define DEFAULT_WATER_SEARCH 50.0f // default search distance to case detection water level
//class for sharing and managin GridMap objects // class for sharing and managin GridMap objects
class MANGOS_DLL_SPEC TerrainInfo : public Referencable<AtomicLong> class MANGOS_DLL_SPEC TerrainInfo : public Referencable<AtomicLong>
{ {
public: public:
@ -216,8 +216,8 @@ class MANGOS_DLL_SPEC TerrainInfo : public Referencable<AtomicLong>
uint32 GetMapId() const { return m_mapId; } uint32 GetMapId() const { return m_mapId; }
//TODO: move all terrain/vmaps data info query functions // TODO: move all terrain/vmaps data info query functions
//from 'Map' class into this class // from 'Map' class into this class
float GetHeight(float x, float y, float z, bool pCheckVMap = true, float maxSearchDist = DEFAULT_HEIGHT_SEARCH) const; float GetHeight(float x, float y, float z, bool pCheckVMap = true, float maxSearchDist = DEFAULT_HEIGHT_SEARCH) const;
float GetWaterLevel(float x, float y, float z, float* pGround = NULL) const; float GetWaterLevel(float x, float y, float z, float* pGround = NULL) const;
float GetWaterOrGroundLevel(float x, float y, float z, float* pGround = NULL, bool swim = false) const; float GetWaterOrGroundLevel(float x, float y, float z, float* pGround = NULL, bool swim = false) const;
@ -237,15 +237,15 @@ class MANGOS_DLL_SPEC TerrainInfo : public Referencable<AtomicLong>
bool IsOutdoors(float x, float y, float z) const; bool IsOutdoors(float x, float y, float z) const;
//this method should be used only by TerrainManager // this method should be used only by TerrainManager
//to cleanup unreferenced GridMap objects - they are too heavy // to cleanup unreferenced GridMap objects - they are too heavy
//to destroy them dynamically, especially on highly populated servers // to destroy them dynamically, especially on highly populated servers
//THIS METHOD IS NOT THREAD-SAFE!!!! AND IT SHOULDN'T BE THREAD-SAFE!!!! // THIS METHOD IS NOT THREAD-SAFE!!!! AND IT SHOULDN'T BE THREAD-SAFE!!!!
void CleanUpGrids(const uint32 diff); void CleanUpGrids(const uint32 diff);
protected: protected:
friend class Map; friend class Map;
//load/unload terrain data // load/unload terrain data
GridMap* Load(const uint32 x, const uint32 y); GridMap* Load(const uint32 x, const uint32 y);
void Unload(const uint32 x, const uint32 y); void Unload(const uint32 x, const uint32 y);
@ -264,7 +264,7 @@ class MANGOS_DLL_SPEC TerrainInfo : public Referencable<AtomicLong>
GridMap* m_GridMaps[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS]; GridMap* m_GridMaps[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS];
int16 m_GridRef[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS]; int16 m_GridRef[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS];
//global garbage collection timer // global garbage collection timer
ShortIntervalTimer i_timer; ShortIntervalTimer i_timer;
typedef ACE_Thread_Mutex LOCK_TYPE; typedef ACE_Thread_Mutex LOCK_TYPE;
@ -273,7 +273,7 @@ class MANGOS_DLL_SPEC TerrainInfo : public Referencable<AtomicLong>
LOCK_TYPE m_refMutex; LOCK_TYPE m_refMutex;
}; };
//class for managing TerrainData object and all sort of geometry querying operations // class for managing TerrainData object and all sort of geometry querying operations
class MANGOS_DLL_DECL TerrainManager : public MaNGOS::Singleton<TerrainManager, MaNGOS::ClassLevelLockable<TerrainManager, ACE_Thread_Mutex> > class MANGOS_DLL_DECL TerrainManager : public MaNGOS::Singleton<TerrainManager, MaNGOS::ClassLevelLockable<TerrainManager, ACE_Thread_Mutex> >
{ {
typedef UNORDERED_MAP<uint32, TerrainInfo*> TerrainDataMap; typedef UNORDERED_MAP<uint32, TerrainInfo*> TerrainDataMap;

View file

@ -125,7 +125,7 @@ inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target)
if (!i_dynobject.IsWithinDistInMap(target, i_dynobject.GetRadius())) if (!i_dynobject.IsWithinDistInMap(target, i_dynobject.GetRadius()))
return; return;
//Check targets for not_selectable unit flag and remove // Check targets for not_selectable unit flag and remove
if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE)) if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE))
return; return;
@ -133,7 +133,7 @@ inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target)
if (target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->IsInEvadeMode()) if (target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->IsInEvadeMode())
return; return;
//Check player targets and remove if in GM mode or GM invisibility (for not self casting case) // Check player targets and remove if in GM mode or GM invisibility (for not self casting case)
if (target->GetTypeId() == TYPEID_PLAYER && target != i_check && (((Player*)target)->isGameMaster() || ((Player*)target)->GetVisibility() == VISIBILITY_OFF)) if (target->GetTypeId() == TYPEID_PLAYER && target != i_check && (((Player*)target)->isGameMaster() || ((Player*)target)->GetVisibility() == VISIBILITY_OFF))
return; return;

View file

@ -366,7 +366,7 @@ uint32 Group::RemoveMember(ObjectGuid guid, uint8 method)
player->GetSession()->SendPacket(&data); player->GetSession()->SendPacket(&data);
} }
//we already removed player from group and in player->GetGroup() is his original group! // we already removed player from group and in player->GetGroup() is his original group!
if (Group* group = player->GetGroup()) if (Group* group = player->GetGroup())
{ {
group->SendUpdate(); group->SendUpdate();
@ -422,13 +422,13 @@ void Group::Disband(bool hideDestroy)
if (!player) if (!player)
continue; continue;
//we cannot call _removeMember because it would invalidate member iterator // we cannot call _removeMember because it would invalidate member iterator
//if we are removing player from battleground raid // if we are removing player from battleground raid
if (isBGGroup()) if (isBGGroup())
player->RemoveFromBattleGroundRaid(); player->RemoveFromBattleGroundRaid();
else else
{ {
//we can remove player who is in battleground from his original group // we can remove player who is in battleground from his original group
if (player->GetOriginalGroup() == this) if (player->GetOriginalGroup() == this)
player->SetOriginalGroup(NULL); player->SetOriginalGroup(NULL);
else else
@ -449,7 +449,7 @@ void Group::Disband(bool hideDestroy)
player->GetSession()->SendPacket(&data); player->GetSession()->SendPacket(&data);
} }
//we already removed player from group and in player->GetGroup() is his original group, send update // we already removed player from group and in player->GetGroup() is his original group, send update
if (Group* group = player->GetGroup()) if (Group* group = player->GetGroup())
{ {
group->SendUpdate(); group->SendUpdate();
@ -600,7 +600,7 @@ void Group::GroupLoot(WorldObject* pSource, Loot* loot)
continue; continue;
} }
//roll for over-threshold item if it's one-player loot // roll for over-threshold item if it's one-player loot
if (itemProto->Quality >= uint32(m_lootThreshold) && !lootItem.freeforall) if (itemProto->Quality >= uint32(m_lootThreshold) && !lootItem.freeforall)
StartLootRoll(pSource, GROUP_LOOT, loot, itemSlot, maxEnchantingSkill); StartLootRoll(pSource, GROUP_LOOT, loot, itemSlot, maxEnchantingSkill);
else else
@ -622,7 +622,7 @@ void Group::NeedBeforeGreed(WorldObject* pSource, Loot* loot)
continue; continue;
} }
//only roll for one-player items, not for ones everyone can get // only roll for one-player items, not for ones everyone can get
if (itemProto->Quality >= uint32(m_lootThreshold) && !lootItem.freeforall) if (itemProto->Quality >= uint32(m_lootThreshold) && !lootItem.freeforall)
StartLootRoll(pSource, NEED_BEFORE_GREED, loot, itemSlot, maxEnchantingSkill); StartLootRoll(pSource, NEED_BEFORE_GREED, loot, itemSlot, maxEnchantingSkill);
else else
@ -753,7 +753,7 @@ void Group::StartLootRoll(WorldObject* lootTarget, LootMethod method, Loot* loot
Roll* r = new Roll(lootTarget->GetObjectGuid(), method, lootItem); Roll* r = new Roll(lootTarget->GetObjectGuid(), method, lootItem);
//a vector is filled with only near party members // a vector is filled with only near party members
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next()) for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
{ {
Player* playerToRoll = itr->getSource(); Player* playerToRoll = itr->getSource();
@ -801,9 +801,9 @@ void Group::EndRoll()
{ {
while (!RollId.empty()) while (!RollId.empty())
{ {
//need more testing here, if rolls disappear // need more testing here, if rolls disappear
Rolls::iterator itr = RollId.begin(); Rolls::iterator itr = RollId.begin();
CountTheRoll(itr); //i don't have to edit player votes, who didn't vote ... he will pass CountTheRoll(itr); // i don't have to edit player votes, who didn't vote ... he will pass
} }
} }
@ -817,7 +817,7 @@ void Group::CountTheRoll(Rolls::iterator& rollI)
return; return;
} }
//end of the roll // end of the roll
if (roll->totalNeed > 0) if (roll->totalNeed > 0)
{ {
if (!roll->playerVote.empty()) if (!roll->playerVote.empty())
@ -874,7 +874,7 @@ void Group::CountTheRoll(Rolls::iterator& rollI)
uint8 maxresul = 0; uint8 maxresul = 0;
ObjectGuid maxguid = (*roll->playerVote.begin()).first; ObjectGuid maxguid = (*roll->playerVote.begin()).first;
Player* player; Player* player;
RollVote rollvote = ROLL_PASS; //Fixed: Using uninitialized memory 'rollvote' RollVote rollvote = ROLL_PASS; // Fixed: Using uninitialized memory 'rollvote'
Roll::PlayerVote::iterator itr; Roll::PlayerVote::iterator itr;
for (itr = roll->playerVote.begin(); itr != roll->playerVote.end(); ++itr) for (itr = roll->playerVote.begin(); itr != roll->playerVote.end(); ++itr)
@ -1183,13 +1183,13 @@ bool Group::_addMember(ObjectGuid guid, const char* name, bool isAssistant, uint
if (player) if (player)
{ {
player->SetGroupInvite(NULL); player->SetGroupInvite(NULL);
//if player is in group and he is being added to BG raid group, then call SetBattleGroundRaid() // if player is in group and he is being added to BG raid group, then call SetBattleGroundRaid()
if (player->GetGroup() && isBGGroup()) if (player->GetGroup() && isBGGroup())
player->SetBattleGroundRaid(this, group); player->SetBattleGroundRaid(this, group);
//if player is in bg raid and we are adding him to normal group, then call SetOriginalGroup() // if player is in bg raid and we are adding him to normal group, then call SetOriginalGroup()
else if (player->GetGroup()) else if (player->GetGroup())
player->SetOriginalGroup(this, group); player->SetOriginalGroup(this, group);
//if player is not in group, then call set group // if player is not in group, then call set group
else else
player->SetGroup(this, group); player->SetGroup(this, group);
@ -1223,12 +1223,12 @@ bool Group::_removeMember(ObjectGuid guid)
Player* player = sObjectMgr.GetPlayer(guid); Player* player = sObjectMgr.GetPlayer(guid);
if (player) if (player)
{ {
//if we are removing player from battleground raid // if we are removing player from battleground raid
if (isBGGroup()) if (isBGGroup())
player->RemoveFromBattleGroundRaid(); player->RemoveFromBattleGroundRaid();
else else
{ {
//we can remove player who is in battleground from his original group // we can remove player who is in battleground from his original group
if (player->GetOriginalGroup() == this) if (player->GetOriginalGroup() == this)
player->SetOriginalGroup(NULL); player->SetOriginalGroup(NULL);
else else
@ -1473,7 +1473,7 @@ void Group::ChangeMembersGroup(Player* player, uint8 group)
{ {
if (player->GetGroup() == this) if (player->GetGroup() == this)
player->GetGroupRef().setSubGroup(group); player->GetGroupRef().setSubGroup(group);
//if player is in BG raid, it is possible that he is also in normal raid - and that normal raid is stored in m_originalGroup reference // if player is in BG raid, it is possible that he is also in normal raid - and that normal raid is stored in m_originalGroup reference
else else
{ {
prevSubGroup = player->GetOriginalSubGroup(); prevSubGroup = player->GetOriginalSubGroup();
@ -1540,7 +1540,7 @@ void Group::UpdateLooterGuid(WorldObject* pSource, bool ifneed)
{ {
bool refresh = pl->GetLootGuid() == pSource->GetObjectGuid(); bool refresh = pl->GetLootGuid() == pSource->GetObjectGuid();
//if(refresh) // update loot for new looter // if(refresh) // update loot for new looter
// pl->GetSession()->DoLootRelease(pl->GetLootGUID()); // pl->GetSession()->DoLootRelease(pl->GetLootGUID());
SetLooterGuid(pl->GetObjectGuid()); SetLooterGuid(pl->GetObjectGuid());
SendUpdate(); SendUpdate();
@ -1561,7 +1561,7 @@ void Group::UpdateLooterGuid(WorldObject* pSource, bool ifneed)
{ {
bool refresh = pl->GetLootGuid() == pSource->GetObjectGuid(); bool refresh = pl->GetLootGuid() == pSource->GetObjectGuid();
//if(refresh) // update loot for new looter // if(refresh) // update loot for new looter
// pl->GetSession()->DoLootRelease(pl->GetLootGUID()); // pl->GetSession()->DoLootRelease(pl->GetLootGUID());
SetLooterGuid(pl->GetObjectGuid()); SetLooterGuid(pl->GetObjectGuid());
SendUpdate(); SendUpdate();

View file

@ -163,7 +163,7 @@ class Roll : public LootValidatorRef
uint32 itemRandomSuffix; uint32 itemRandomSuffix;
uint8 itemCount; uint8 itemCount;
typedef UNORDERED_MAP<ObjectGuid, RollVote> PlayerVote; typedef UNORDERED_MAP<ObjectGuid, RollVote> PlayerVote;
PlayerVote playerVote; //vote position correspond with player position (in group) PlayerVote playerVote; // vote position correspond with player position (in group)
uint8 totalPlayersRolling; uint8 totalPlayersRolling;
uint8 totalNeed; uint8 totalNeed;
uint8 totalGreed; uint8 totalGreed;

View file

@ -164,7 +164,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket& recv_data)
data << GetPlayer()->GetName(); // max len 48 data << GetPlayer()->GetName(); // max len 48
data << uint32(0); // unk data << uint32(0); // unk
data << uint8(0); // count data << uint8(0); // count
//for(int i = 0; i < count; ++i) // for(int i = 0; i < count; ++i)
// data << uint32(0); // data << uint32(0);
data << uint32(0); // unk data << uint32(0); // unk
player->GetSession()->SendPacket(&data); player->GetSession()->SendPacket(&data);
@ -388,11 +388,11 @@ void WorldSession::HandleLootRoll(WorldPacket& recv_data)
ObjectGuid lootedTarget; ObjectGuid lootedTarget;
uint32 itemSlot; uint32 itemSlot;
uint8 rollType; uint8 rollType;
recv_data >> lootedTarget; //guid of the item rolled recv_data >> lootedTarget; // guid of the item rolled
recv_data >> itemSlot; recv_data >> itemSlot;
recv_data >> rollType; recv_data >> rollType;
//DEBUG_LOG("WORLD RECIEVE CMSG_LOOT_ROLL, From:%u, Numberofplayers:%u, rollType:%u", (uint32)Guid, NumberOfPlayers, rollType); // DEBUG_LOG("WORLD RECIEVE CMSG_LOOT_ROLL, From:%u, Numberofplayers:%u, rollType:%u", (uint32)Guid, NumberOfPlayers, rollType);
Group* group = GetPlayer()->GetGroup(); Group* group = GetPlayer()->GetGroup();
if (!group) if (!group)
@ -426,7 +426,7 @@ void WorldSession::HandleMinimapPingOpcode(WorldPacket& recv_data)
if (!GetPlayer()->GetGroup()) if (!GetPlayer()->GetGroup())
return; return;
//DEBUG_LOG("Received opcode MSG_MINIMAP_PING X: %f, Y: %f", x, y); // DEBUG_LOG("Received opcode MSG_MINIMAP_PING X: %f, Y: %f", x, y);
/** error handling **/ /** error handling **/
/********************/ /********************/
@ -453,7 +453,7 @@ void WorldSession::HandleRandomRollOpcode(WorldPacket& recv_data)
// everything is fine, do it // everything is fine, do it
roll = urand(minimum, maximum); roll = urand(minimum, maximum);
//DEBUG_LOG("ROLL: MIN: %u, MAX: %u, ROLL: %u", minimum, maximum, roll); // DEBUG_LOG("ROLL: MIN: %u, MAX: %u, ROLL: %u", minimum, maximum, roll);
WorldPacket data(MSG_RANDOM_ROLL, 4 + 4 + 4 + 8); WorldPacket data(MSG_RANDOM_ROLL, 4 + 4 + 4 + 8);
data << uint32(minimum); data << uint32(minimum);
@ -648,11 +648,11 @@ void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket& recv_data)
void WorldSession::HandleRaidReadyCheckFinishedOpcode(WorldPacket& /*recv_data*/) void WorldSession::HandleRaidReadyCheckFinishedOpcode(WorldPacket& /*recv_data*/)
{ {
//Group* group = GetPlayer()->GetGroup(); // Group* group = GetPlayer()->GetGroup();
//if(!group) // if(!group)
// return; // return;
//if(!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID())) // if(!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID()))
// return; // return;
// Is any reaction need? // Is any reaction need?
@ -843,7 +843,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recv_data)
data << uint16(player->GetMaxPower(powerType)); // GROUP_UPDATE_FLAG_MAX_POWER data << uint16(player->GetMaxPower(powerType)); // GROUP_UPDATE_FLAG_MAX_POWER
data << uint16(player->getLevel()); // GROUP_UPDATE_FLAG_LEVEL data << uint16(player->getLevel()); // GROUP_UPDATE_FLAG_LEVEL
//verify player coordinates and zoneid to send to teammates // verify player coordinates and zoneid to send to teammates
uint16 iZoneId = 0; uint16 iZoneId = 0;
uint16 iCoordX = 0; uint16 iCoordX = 0;
uint16 iCoordY = 0; uint16 iCoordY = 0;
@ -863,7 +863,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recv_data)
} }
else else
{ {
//unknown player status. // unknown player status.
} }
data << uint16(iZoneId); // GROUP_UPDATE_FLAG_ZONE data << uint16(iZoneId); // GROUP_UPDATE_FLAG_ZONE

View file

@ -47,7 +47,7 @@ void GuardAI::MoveInLineOfSight(Unit* u)
float attackRadius = m_creature->GetAttackDistance(u); float attackRadius = m_creature->GetAttackDistance(u);
if (m_creature->IsWithinDistInMap(u, attackRadius)) if (m_creature->IsWithinDistInMap(u, attackRadius))
{ {
//Need add code to let guard support player // Need add code to let guard support player
AttackStart(u); AttackStart(u);
u->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); u->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
} }

View file

@ -336,20 +336,20 @@ bool Guild::LoadRanksFromDB(QueryResult* guildRanksResult)
do do
{ {
fields = guildRanksResult->Fetch(); fields = guildRanksResult->Fetch();
//condition that would be true when all ranks in QueryResult will be processed and guild without ranks is being processed // condition that would be true when all ranks in QueryResult will be processed and guild without ranks is being processed
if (!fields) if (!fields)
break; break;
uint32 guildId = fields[0].GetUInt32(); uint32 guildId = fields[0].GetUInt32();
if (guildId < m_Id) if (guildId < m_Id)
{ {
//there is in table guild_rank record which doesn't have guildid in guild table, report error // there is in table guild_rank record which doesn't have guildid in guild table, report error
sLog.outErrorDb("Guild %u does not exist but it has a record in guild_rank table, deleting it!", guildId); sLog.outErrorDb("Guild %u does not exist but it has a record in guild_rank table, deleting it!", guildId);
CharacterDatabase.PExecute("DELETE FROM guild_rank WHERE guildid = '%u'", guildId); CharacterDatabase.PExecute("DELETE FROM guild_rank WHERE guildid = '%u'", guildId);
continue; continue;
} }
if (guildId > m_Id) //we loaded all ranks for this guild already, break cycle if (guildId > m_Id) // we loaded all ranks for this guild already, break cycle
break; break;
uint32 rankID = fields[1].GetUInt32(); uint32 rankID = fields[1].GetUInt32();
@ -714,7 +714,7 @@ void Guild::Disband()
CharacterDatabase.PExecute("DELETE FROM guild_rank WHERE guildid = '%u'", m_Id); CharacterDatabase.PExecute("DELETE FROM guild_rank WHERE guildid = '%u'", m_Id);
CharacterDatabase.PExecute("DELETE FROM guild_bank_tab WHERE guildid = '%u'", m_Id); CharacterDatabase.PExecute("DELETE FROM guild_bank_tab WHERE guildid = '%u'", m_Id);
//Free bank tab used memory and delete items stored in them // Free bank tab used memory and delete items stored in them
DeleteGuildBankItems(true); DeleteGuildBankItems(true);
CharacterDatabase.PExecute("DELETE FROM guild_bank_item WHERE guildid = '%u'", m_Id); CharacterDatabase.PExecute("DELETE FROM guild_bank_item WHERE guildid = '%u'", m_Id);
@ -828,7 +828,7 @@ uint32 Guild::GetAccountsNumber()
if (m_accountsNumber) if (m_accountsNumber)
return m_accountsNumber; return m_accountsNumber;
//We use a set to be sure each element will be unique // We use a set to be sure each element will be unique
std::set<uint32> accountsIdSet; std::set<uint32> accountsIdSet;
for (MemberList::const_iterator itr = members.begin(); itr != members.end(); ++itr) for (MemberList::const_iterator itr = members.begin(); itr != members.end(); ++itr)
accountsIdSet.insert(itr->second.accountId); accountsIdSet.insert(itr->second.accountId);
@ -875,7 +875,7 @@ void Guild::LoadGuildEventLogFromDB()
if (!result) if (!result)
return; return;
bool isNextLogGuidSet = false; bool isNextLogGuidSet = false;
//uint32 configCount = sWorld.getConfig(CONFIG_UINT32_GUILD_EVENT_LOG_COUNT); // uint32 configCount = sWorld.getConfig(CONFIG_UINT32_GUILD_EVENT_LOG_COUNT);
// First event in list will be the oldest and the latest event is last event in list // First event in list will be the oldest and the latest event is last event in list
do do
{ {

View file

@ -34,14 +34,14 @@ class Item;
enum GuildDefaultRanks enum GuildDefaultRanks
{ {
//these ranks can be modified, but they cannot be deleted // these ranks can be modified, but they cannot be deleted
GR_GUILDMASTER = 0, GR_GUILDMASTER = 0,
GR_OFFICER = 1, GR_OFFICER = 1,
GR_VETERAN = 2, GR_VETERAN = 2,
GR_MEMBER = 3, GR_MEMBER = 3,
GR_INITIATE = 4, GR_INITIATE = 4,
//When promoting member server does: rank--;! // When promoting member server does: rank--;!
//When demoting member server does: rank++;! // When demoting member server does: rank++;!
}; };
enum GuildRankRights enum GuildRankRights
@ -324,7 +324,7 @@ class Guild
void SetLeader(ObjectGuid guid); void SetLeader(ObjectGuid guid);
bool AddMember(ObjectGuid plGuid, uint32 plRank); bool AddMember(ObjectGuid plGuid, uint32 plRank);
bool DelMember(ObjectGuid guid, bool isDisbanding = false); bool DelMember(ObjectGuid guid, bool isDisbanding = false);
//lowest rank is the count of ranks - 1 (the highest rank_id in table) // lowest rank is the count of ranks - 1 (the highest rank_id in table)
uint32 GetLowestRank() const { return m_Ranks.size() - 1; } uint32 GetLowestRank() const { return m_Ranks.size() - 1; }
void SetMOTD(std::string motd); void SetMOTD(std::string motd);

View file

@ -293,7 +293,7 @@ void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket)
return; return;
} }
uint32 newRankId = slot->RankId - 1; //when promoting player, rank is decreased uint32 newRankId = slot->RankId - 1; // when promoting player, rank is decreased
slot->ChangeRank(newRankId); slot->ChangeRank(newRankId);
// Put record into guild log // Put record into guild log
@ -354,7 +354,7 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket)
return; return;
} }
uint32 newRankId = slot->RankId + 1; //when demoting player, rank is increased uint32 newRankId = slot->RankId + 1; // when demoting player, rank is increased
slot->ChangeRank(newRankId); slot->ChangeRank(newRankId);
// Put record into guild log // Put record into guild log

View file

@ -127,7 +127,7 @@ void GuildMgr::LoadGuilds()
do do
{ {
//Field *fields = result->Fetch(); // Field *fields = result->Fetch();
bar.step(); bar.step();
++count; ++count;
@ -157,8 +157,8 @@ void GuildMgr::LoadGuilds()
delete guildMembersResult; delete guildMembersResult;
delete guildBankTabRightsResult; delete guildBankTabRightsResult;
//delete unused LogGuid records in guild_eventlog and guild_bank_eventlog table // delete unused LogGuid records in guild_eventlog and guild_bank_eventlog table
//you can comment these lines if you don't plan to change CONFIG_UINT32_GUILD_EVENT_LOG_COUNT and CONFIG_UINT32_GUILD_BANK_EVENT_LOG_COUNT // you can comment these lines if you don't plan to change CONFIG_UINT32_GUILD_EVENT_LOG_COUNT and CONFIG_UINT32_GUILD_BANK_EVENT_LOG_COUNT
CharacterDatabase.PExecute("DELETE FROM guild_eventlog WHERE LogGuid > '%u'", sWorld.getConfig(CONFIG_UINT32_GUILD_EVENT_LOG_COUNT)); CharacterDatabase.PExecute("DELETE FROM guild_eventlog WHERE LogGuid > '%u'", sWorld.getConfig(CONFIG_UINT32_GUILD_EVENT_LOG_COUNT));
CharacterDatabase.PExecute("DELETE FROM guild_bank_eventlog WHERE LogGuid > '%u'", sWorld.getConfig(CONFIG_UINT32_GUILD_BANK_EVENT_LOG_COUNT)); CharacterDatabase.PExecute("DELETE FROM guild_bank_eventlog WHERE LogGuid > '%u'", sWorld.getConfig(CONFIG_UINT32_GUILD_BANK_EVENT_LOG_COUNT));

View file

@ -37,57 +37,57 @@ class MANGOS_DLL_SPEC InstanceData
Map* instance; Map* instance;
//On creation, NOT load. // On creation, NOT load.
virtual void Initialize() {} virtual void Initialize() {}
//On load // On load
virtual void Load(const char* /*data*/) {} virtual void Load(const char* /*data*/) {}
//When save is needed, this function generates the data // When save is needed, this function generates the data
virtual const char* Save() { return ""; } virtual const char* Save() { return ""; }
void SaveToDB(); void SaveToDB();
//Called every map update // Called every map update
virtual void Update(uint32 /*diff*/) {} virtual void Update(uint32 /*diff*/) {}
//Used by the map's CanEnter function. // Used by the map's CanEnter function.
//This is to prevent players from entering during boss encounters. // This is to prevent players from entering during boss encounters.
virtual bool IsEncounterInProgress() const { return false; }; virtual bool IsEncounterInProgress() const { return false; };
//Called when a player successfully enters the instance (after really added to map) // Called when a player successfully enters the instance (after really added to map)
virtual void OnPlayerEnter(Player*) {} virtual void OnPlayerEnter(Player*) {}
//Called when a player dies inside instance // Called when a player dies inside instance
virtual void OnPlayerDeath(Player*) {} virtual void OnPlayerDeath(Player*) {}
//Called when a player leaves the instance (before really removed from map (or possibly world)) // Called when a player leaves the instance (before really removed from map (or possibly world))
virtual void OnPlayerLeave(Player*) {} virtual void OnPlayerLeave(Player*) {}
//Called when a gameobject is created // Called when a gameobject is created
virtual void OnObjectCreate(GameObject*) {} virtual void OnObjectCreate(GameObject*) {}
//called on creature creation // called on creature creation
virtual void OnCreatureCreate(Creature* /*creature*/) {} virtual void OnCreatureCreate(Creature* /*creature*/) {}
//called on creature enter combat // called on creature enter combat
virtual void OnCreatureEnterCombat(Creature* /*creature*/) {} virtual void OnCreatureEnterCombat(Creature* /*creature*/) {}
//called on creature evade // called on creature evade
virtual void OnCreatureEvade(Creature* /*creature*/) {} virtual void OnCreatureEvade(Creature* /*creature*/) {}
//called on creature death // called on creature death
virtual void OnCreatureDeath(Creature* /*creature*/) {} virtual void OnCreatureDeath(Creature* /*creature*/) {}
//All-purpose data storage 64 bit // All-purpose data storage 64 bit
virtual uint64 GetData64(uint32 /*Data*/) { return 0; } virtual uint64 GetData64(uint32 /*Data*/) { return 0; }
virtual void SetData64(uint32 /*Data*/, uint64 /*Value*/) { } virtual void SetData64(uint32 /*Data*/, uint64 /*Value*/) { }
//Guid data storage (wrapper for set/get from uint64 storage // Guid data storage (wrapper for set/get from uint64 storage
ObjectGuid GetGuid(uint32 dataIdx) { return ObjectGuid(GetData64(dataIdx)); } ObjectGuid GetGuid(uint32 dataIdx) { return ObjectGuid(GetData64(dataIdx)); }
void SetGuid(uint32 dataIdx, ObjectGuid value) { SetData64(dataIdx, value.GetRawValue()); } void SetGuid(uint32 dataIdx, ObjectGuid value) { SetData64(dataIdx, value.GetRawValue()); }
//All-purpose data storage 32 bit // All-purpose data storage 32 bit
virtual uint32 GetData(uint32 /*Type*/) { return 0; } virtual uint32 GetData(uint32 /*Type*/) { return 0; }
virtual void SetData(uint32 /*Type*/, uint32 /*Data*/) {} virtual void SetData(uint32 /*Type*/, uint32 /*Data*/) {}

View file

@ -277,7 +277,7 @@ void Item::UpdateDuration(Player* owner, uint32 diff)
if (!GetUInt32Value(ITEM_FIELD_DURATION)) if (!GetUInt32Value(ITEM_FIELD_DURATION))
return; return;
//DEBUG_LOG("Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)", GetEntry(), GetUInt32Value(ITEM_FIELD_DURATION), diff); // DEBUG_LOG("Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)", GetEntry(), GetUInt32Value(ITEM_FIELD_DURATION), diff);
if (GetUInt32Value(ITEM_FIELD_DURATION) <= diff) if (GetUInt32Value(ITEM_FIELD_DURATION) <= diff)
{ {
@ -1081,7 +1081,7 @@ void Item::SendTimeUpdate(Player* owner)
Item* Item::CreateItem(uint32 item, uint32 count, Player const* player, uint32 randomPropertyId) Item* Item::CreateItem(uint32 item, uint32 count, Player const* player, uint32 randomPropertyId)
{ {
if (count < 1) if (count < 1)
return NULL; //don't create item at zero count return NULL; // don't create item at zero count
if (ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(item)) if (ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(item))
{ {

View file

@ -109,7 +109,7 @@ uint32 GetItemEnchantMod(uint32 entry)
if (fCount > dRoll) return ench_iter->ench; if (fCount > dRoll) return ench_iter->ench;
} }
//we could get here only if sum of all enchantment chances is lower than 100% // we could get here only if sum of all enchantment chances is lower than 100%
dRoll = (irand(0, (int)floor(fCount * 100) + 1)) / 100; dRoll = (irand(0, (int)floor(fCount * 100) + 1)) / 100;
fCount = 0; fCount = 0;

View file

@ -29,12 +29,12 @@
void WorldSession::HandleSplitItemOpcode(WorldPacket& recv_data) void WorldSession::HandleSplitItemOpcode(WorldPacket& recv_data)
{ {
//DEBUG_LOG("WORLD: CMSG_SPLIT_ITEM"); // DEBUG_LOG("WORLD: CMSG_SPLIT_ITEM");
uint8 srcbag, srcslot, dstbag, dstslot; uint8 srcbag, srcslot, dstbag, dstslot;
uint32 count; uint32 count;
recv_data >> srcbag >> srcslot >> dstbag >> dstslot >> count; recv_data >> srcbag >> srcslot >> dstbag >> dstslot >> count;
//DEBUG_LOG("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u, dstslot = %u, count = %u", srcbag, srcslot, dstbag, dstslot, count); // DEBUG_LOG("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u, dstslot = %u, count = %u", srcbag, srcslot, dstbag, dstslot, count);
uint16 src = ((srcbag << 8) | srcslot); uint16 src = ((srcbag << 8) | srcslot);
uint16 dst = ((dstbag << 8) | dstslot); uint16 dst = ((dstbag << 8) | dstslot);
@ -43,7 +43,7 @@ void WorldSession::HandleSplitItemOpcode(WorldPacket& recv_data)
return; return;
if (count == 0) if (count == 0)
return; //check count - if zero it's fake packet return; // check count - if zero it's fake packet
if (!_player->IsValidPos(srcbag, srcslot, true)) if (!_player->IsValidPos(srcbag, srcslot, true))
{ {
@ -62,11 +62,11 @@ void WorldSession::HandleSplitItemOpcode(WorldPacket& recv_data)
void WorldSession::HandleSwapInvItemOpcode(WorldPacket& recv_data) void WorldSession::HandleSwapInvItemOpcode(WorldPacket& recv_data)
{ {
//DEBUG_LOG("WORLD: CMSG_SWAP_INV_ITEM"); // DEBUG_LOG("WORLD: CMSG_SWAP_INV_ITEM");
uint8 srcslot, dstslot; uint8 srcslot, dstslot;
recv_data >> dstslot >> srcslot; recv_data >> dstslot >> srcslot;
//DEBUG_LOG("STORAGE: receive srcslot = %u, dstslot = %u", srcslot, dstslot); // DEBUG_LOG("STORAGE: receive srcslot = %u, dstslot = %u", srcslot, dstslot);
// prevent attempt swap same item to current position generated by client at special cheating sequence // prevent attempt swap same item to current position generated by client at special cheating sequence
if (srcslot == dstslot) if (srcslot == dstslot)
@ -111,11 +111,11 @@ void WorldSession::HandleAutoEquipItemSlotOpcode(WorldPacket& recv_data)
void WorldSession::HandleSwapItem(WorldPacket& recv_data) void WorldSession::HandleSwapItem(WorldPacket& recv_data)
{ {
//DEBUG_LOG("WORLD: CMSG_SWAP_ITEM"); // DEBUG_LOG("WORLD: CMSG_SWAP_ITEM");
uint8 dstbag, dstslot, srcbag, srcslot; uint8 dstbag, dstslot, srcbag, srcslot;
recv_data >> dstbag >> dstslot >> srcbag >> srcslot ; recv_data >> dstbag >> dstslot >> srcbag >> srcslot ;
//DEBUG_LOG("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u, dstslot = %u", srcbag, srcslot, dstbag, dstslot); // DEBUG_LOG("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u, dstslot = %u", srcbag, srcslot, dstbag, dstslot);
uint16 src = ((srcbag << 8) | srcslot); uint16 src = ((srcbag << 8) | srcslot);
uint16 dst = ((dstbag << 8) | dstslot); uint16 dst = ((dstbag << 8) | dstslot);
@ -141,11 +141,11 @@ void WorldSession::HandleSwapItem(WorldPacket& recv_data)
void WorldSession::HandleAutoEquipItemOpcode(WorldPacket& recv_data) void WorldSession::HandleAutoEquipItemOpcode(WorldPacket& recv_data)
{ {
//DEBUG_LOG("WORLD: CMSG_AUTOEQUIP_ITEM"); // DEBUG_LOG("WORLD: CMSG_AUTOEQUIP_ITEM");
uint8 srcbag, srcslot; uint8 srcbag, srcslot;
recv_data >> srcbag >> srcslot; recv_data >> srcbag >> srcslot;
//DEBUG_LOG("STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); // DEBUG_LOG("STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot);
Item* pSrcItem = _player->GetItemByPos(srcbag, srcslot); Item* pSrcItem = _player->GetItemByPos(srcbag, srcslot);
if (!pSrcItem) if (!pSrcItem)
@ -235,11 +235,11 @@ void WorldSession::HandleAutoEquipItemOpcode(WorldPacket& recv_data)
void WorldSession::HandleDestroyItemOpcode(WorldPacket& recv_data) void WorldSession::HandleDestroyItemOpcode(WorldPacket& recv_data)
{ {
//DEBUG_LOG("WORLD: CMSG_DESTROYITEM"); // DEBUG_LOG("WORLD: CMSG_DESTROYITEM");
uint8 bag, slot, count, data1, data2, data3; uint8 bag, slot, count, data1, data2, data3;
recv_data >> bag >> slot >> count >> data1 >> data2 >> data3; recv_data >> bag >> slot >> count >> data1 >> data2 >> data3;
//DEBUG_LOG("STORAGE: receive bag = %u, slot = %u, count = %u", bag, slot, count); // DEBUG_LOG("STORAGE: receive bag = %u, slot = %u, count = %u", bag, slot, count);
uint16 pos = (bag << 8) | slot; uint16 pos = (bag << 8) | slot;
@ -280,7 +280,7 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket& recv_data)
// Only _static_ data send in this packet !!! // Only _static_ data send in this packet !!!
void WorldSession::HandleItemQuerySingleOpcode(WorldPacket& recv_data) void WorldSession::HandleItemQuerySingleOpcode(WorldPacket& recv_data)
{ {
//DEBUG_LOG("WORLD: CMSG_ITEM_QUERY_SINGLE"); // DEBUG_LOG("WORLD: CMSG_ITEM_QUERY_SINGLE");
uint32 item; uint32 item;
recv_data >> item; recv_data >> item;
@ -302,9 +302,9 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket& recv_data)
data << pProto->SubClass; data << pProto->SubClass;
data << int32(pProto->Unk0); // new 2.0.3, not exist in wdb cache? data << int32(pProto->Unk0); // new 2.0.3, not exist in wdb cache?
data << name; data << name;
data << uint8(0x00); //pProto->Name2; // blizz not send name there, just uint8(0x00); <-- \0 = empty string = empty name... data << uint8(0x00); // pProto->Name2; // blizz not send name there, just uint8(0x00); <-- \0 = empty string = empty name...
data << uint8(0x00); //pProto->Name3; // blizz not send name there, just uint8(0x00); data << uint8(0x00); // pProto->Name3; // blizz not send name there, just uint8(0x00);
data << uint8(0x00); //pProto->Name4; // blizz not send name there, just uint8(0x00); data << uint8(0x00); // pProto->Name4; // blizz not send name there, just uint8(0x00);
data << pProto->DisplayInfoID; data << pProto->DisplayInfoID;
data << pProto->Quality; data << pProto->Quality;
data << pProto->Flags; data << pProto->Flags;
@ -433,12 +433,12 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket& recv_data)
void WorldSession::HandleReadItemOpcode(WorldPacket& recv_data) void WorldSession::HandleReadItemOpcode(WorldPacket& recv_data)
{ {
//DEBUG_LOG( "WORLD: CMSG_READ_ITEM"); // DEBUG_LOG( "WORLD: CMSG_READ_ITEM");
uint8 bag, slot; uint8 bag, slot;
recv_data >> bag >> slot; recv_data >> bag >> slot;
//sLog.outDetail("STORAGE: Read bag = %u, slot = %u", bag, slot); // sLog.outDetail("STORAGE: Read bag = %u, slot = %u", bag, slot);
Item* pItem = _player->GetItemByPos(bag, slot); Item* pItem = _player->GetItemByPos(bag, slot);
if (pItem && pItem->GetProto()->PageText) if (pItem && pItem->GetProto()->PageText)
@ -828,11 +828,11 @@ void WorldSession::SendListInventory(ObjectGuid vendorguid)
void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket& recv_data) void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket& recv_data)
{ {
//DEBUG_LOG("WORLD: CMSG_AUTOSTORE_BAG_ITEM"); // DEBUG_LOG("WORLD: CMSG_AUTOSTORE_BAG_ITEM");
uint8 srcbag, srcslot, dstbag; uint8 srcbag, srcslot, dstbag;
recv_data >> srcbag >> srcslot >> dstbag; recv_data >> srcbag >> srcslot >> dstbag;
//DEBUG_LOG("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u", srcbag, srcslot, dstbag); // DEBUG_LOG("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u", srcbag, srcslot, dstbag);
Item* pItem = _player->GetItemByPos(srcbag, srcslot); Item* pItem = _player->GetItemByPos(srcbag, srcslot);
if (!pItem) if (!pItem)
@ -1098,7 +1098,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data)
DEBUG_LOG("Received opcode CMSG_WRAP_ITEM"); DEBUG_LOG("Received opcode CMSG_WRAP_ITEM");
uint8 gift_bag, gift_slot, item_bag, item_slot; uint8 gift_bag, gift_slot, item_bag, item_slot;
//recv_data.hexlike(); // recv_data.hexlike();
recv_data >> gift_bag >> gift_slot; // paper recv_data >> gift_bag >> gift_slot; // paper
recv_data >> item_bag >> item_slot; // item recv_data >> item_bag >> item_slot; // item
@ -1213,7 +1213,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
for (int i = 0; i < MAX_GEM_SOCKETS; ++i) for (int i = 0; i < MAX_GEM_SOCKETS; ++i)
recv_data >> gemGuids[i]; recv_data >> gemGuids[i];
//cheat -> tried to socket same gem multiple times // cheat -> tried to socket same gem multiple times
for (int i = 0; i < MAX_GEM_SOCKETS; ++i) for (int i = 0; i < MAX_GEM_SOCKETS; ++i)
{ {
ObjectGuid gemGuid = gemGuids[i]; ObjectGuid gemGuid = gemGuids[i];
@ -1229,14 +1229,14 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
} }
Item* itemTarget = _player->GetItemByGuid(itemGuid); Item* itemTarget = _player->GetItemByGuid(itemGuid);
if (!itemTarget) //missing item to socket if (!itemTarget) // missing item to socket
return; return;
ItemPrototype const* itemProto = itemTarget->GetProto(); ItemPrototype const* itemProto = itemTarget->GetProto();
if (!itemProto) if (!itemProto)
return; return;
//this slot is excepted when applying / removing meta gem bonus // this slot is excepted when applying / removing meta gem bonus
uint8 slot = itemTarget->IsEquipped() ? itemTarget->GetSlot() : uint8(NULL_SLOT); uint8 slot = itemTarget->IsEquipped() ? itemTarget->GetSlot() : uint8(NULL_SLOT);
Item* Gems[MAX_GEM_SOCKETS]; Item* Gems[MAX_GEM_SOCKETS];
@ -1244,10 +1244,10 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
Gems[i] = gemGuids[i] ? _player->GetItemByGuid(gemGuids[i]) : NULL; Gems[i] = gemGuids[i] ? _player->GetItemByGuid(gemGuids[i]) : NULL;
GemPropertiesEntry const* GemProps[MAX_GEM_SOCKETS]; GemPropertiesEntry const* GemProps[MAX_GEM_SOCKETS];
for (int i = 0; i < MAX_GEM_SOCKETS; ++i) //get geminfo from dbc storage for (int i = 0; i < MAX_GEM_SOCKETS; ++i) // get geminfo from dbc storage
GemProps[i] = (Gems[i]) ? sGemPropertiesStore.LookupEntry(Gems[i]->GetProto()->GemProperties) : NULL; GemProps[i] = (Gems[i]) ? sGemPropertiesStore.LookupEntry(Gems[i]->GetProto()->GemProperties) : NULL;
for (int i = 0; i < MAX_GEM_SOCKETS; ++i) //check for hack maybe for (int i = 0; i < MAX_GEM_SOCKETS; ++i) // check for hack maybe
{ {
if (!GemProps[i]) if (!GemProps[i])
continue; continue;
@ -1277,7 +1277,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
uint32 GemEnchants[MAX_GEM_SOCKETS]; uint32 GemEnchants[MAX_GEM_SOCKETS];
uint32 OldEnchants[MAX_GEM_SOCKETS]; uint32 OldEnchants[MAX_GEM_SOCKETS];
for (int i = 0; i < MAX_GEM_SOCKETS; ++i) //get new and old enchantments for (int i = 0; i < MAX_GEM_SOCKETS; ++i) // get new and old enchantments
{ {
GemEnchants[i] = (GemProps[i]) ? GemProps[i]->spellitemenchantement : 0; GemEnchants[i] = (GemProps[i]) ? GemProps[i]->spellitemenchantement : 0;
OldEnchants[i] = itemTarget->GetEnchantmentId(EnchantmentSlot(SOCK_ENCHANTMENT_SLOT + i)); OldEnchants[i] = itemTarget->GetEnchantmentId(EnchantmentSlot(SOCK_ENCHANTMENT_SLOT + i));
@ -1377,12 +1377,12 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
} }
} }
bool SocketBonusActivated = itemTarget->GemsFitSockets(); //save state of socketbonus bool SocketBonusActivated = itemTarget->GemsFitSockets(); // save state of socketbonus
_player->ToggleMetaGemsActive(slot, false); //turn off all metagems (except for the target item) _player->ToggleMetaGemsActive(slot, false); // turn off all metagems (except for the target item)
//if a meta gem is being equipped, all information has to be written to the item before testing if the conditions for the gem are met // if a meta gem is being equipped, all information has to be written to the item before testing if the conditions for the gem are met
//remove ALL enchants // remove ALL enchants
for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT + MAX_GEM_SOCKETS; ++enchant_slot) for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT + MAX_GEM_SOCKETS; ++enchant_slot)
_player->ApplyEnchantment(itemTarget, EnchantmentSlot(enchant_slot), false); _player->ApplyEnchantment(itemTarget, EnchantmentSlot(enchant_slot), false);
@ -1405,7 +1405,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
_player->ApplyEnchantment(itemTarget, BONUS_ENCHANTMENT_SLOT, false); _player->ApplyEnchantment(itemTarget, BONUS_ENCHANTMENT_SLOT, false);
itemTarget->SetEnchantment(BONUS_ENCHANTMENT_SLOT, (SocketBonusToBeActivated ? itemTarget->GetProto()->socketBonus : 0), 0, 0); itemTarget->SetEnchantment(BONUS_ENCHANTMENT_SLOT, (SocketBonusToBeActivated ? itemTarget->GetProto()->socketBonus : 0), 0, 0);
_player->ApplyEnchantment(itemTarget, BONUS_ENCHANTMENT_SLOT, true); _player->ApplyEnchantment(itemTarget, BONUS_ENCHANTMENT_SLOT, true);
//it is not displayed, client has an inbuilt system to determine if the bonus is activated // it is not displayed, client has an inbuilt system to determine if the bonus is activated
} }
_player->ToggleMetaGemsActive(slot, true); // turn on all metagems (except for target item) _player->ToggleMetaGemsActive(slot, true); // turn on all metagems (except for target item)

View file

@ -49,15 +49,15 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket& recv_data)
recv_data >> comment; // lfg comment recv_data >> comment; // lfg comment
//SendLfgJoinResult(ERR_LFG_OK); // SendLfgJoinResult(ERR_LFG_OK);
//SendLfgUpdate(false, LFG_UPDATE_JOIN, dungeons[0]); // SendLfgUpdate(false, LFG_UPDATE_JOIN, dungeons[0]);
} }
void WorldSession::HandleLfgLeaveOpcode(WorldPacket& /*recv_data*/) void WorldSession::HandleLfgLeaveOpcode(WorldPacket& /*recv_data*/)
{ {
DEBUG_LOG("CMSG_LFG_LEAVE"); DEBUG_LOG("CMSG_LFG_LEAVE");
//SendLfgUpdate(false, LFG_UPDATE_LEAVE, 0); // SendLfgUpdate(false, LFG_UPDATE_LEAVE, 0);
} }
void WorldSession::HandleSearchLfgJoinOpcode(WorldPacket& recv_data) void WorldSession::HandleSearchLfgJoinOpcode(WorldPacket& recv_data)
@ -70,7 +70,7 @@ void WorldSession::HandleSearchLfgJoinOpcode(WorldPacket& recv_data)
entry = (temp & 0x00FFFFFF); entry = (temp & 0x00FFFFFF);
// LfgType type = LfgType((temp >> 24) & 0x000000FF); // LfgType type = LfgType((temp >> 24) & 0x000000FF);
//SendLfgSearchResults(type, entry); // SendLfgSearchResults(type, entry);
} }
void WorldSession::HandleSearchLfgLeaveOpcode(WorldPacket& recv_data) void WorldSession::HandleSearchLfgLeaveOpcode(WorldPacket& recv_data)
@ -136,7 +136,7 @@ void WorldSession::SendLfgSearchResults(LfgType type, uint32 entry)
} }
} }
//TODO: Guard Player map // TODO: Guard Player map
HashMapHolder<Player>::MapType const& players = sObjectAccessor.GetPlayers(); HashMapHolder<Player>::MapType const& players = sObjectAccessor.GetPlayers();
uint32 playersSize = players.size(); uint32 playersSize = players.size();
data << uint32(playersSize); // players count data << uint32(playersSize); // players count

View file

@ -42,8 +42,8 @@ enum MangosStrings
LANG_GMS_ON_SRV = 16, LANG_GMS_ON_SRV = 16,
LANG_GMS_NOT_LOGGED = 17, LANG_GMS_NOT_LOGGED = 17,
LANG_YOU_IN_FLIGHT = 18, LANG_YOU_IN_FLIGHT = 18,
//LANG_YOU_IN_BATTLEGROUND = 19, not used // LANG_YOU_IN_BATTLEGROUND = 19, not used
//LANG_TARGET_IN_FLIGHT = 20, not used // LANG_TARGET_IN_FLIGHT = 20, not used
LANG_CHAR_IN_FLIGHT = 21, LANG_CHAR_IN_FLIGHT = 21,
LANG_CHAR_NON_MOUNTED = 22, LANG_CHAR_NON_MOUNTED = 22,
LANG_YOU_IN_COMBAT = 23, LANG_YOU_IN_COMBAT = 23,
@ -83,7 +83,7 @@ enum MangosStrings
LANG_USING_WORLD_DB = 57, LANG_USING_WORLD_DB = 57,
LANG_USING_SCRIPT_LIB = 58, LANG_USING_SCRIPT_LIB = 58,
LANG_USING_EVENT_AI = 59, LANG_USING_EVENT_AI = 59,
//LANG_RA_BUSY = 60, not used // LANG_RA_BUSY = 60, not used
LANG_RA_USER = 61, LANG_RA_USER = 61,
LANG_RA_PASS = 62, LANG_RA_PASS = 62,
LANG_GM_ACCEPTS_WHISPER = 63, LANG_GM_ACCEPTS_WHISPER = 63,
@ -119,7 +119,7 @@ enum MangosStrings
LANG_YOU_CHANGE_ENERGY = 122, LANG_YOU_CHANGE_ENERGY = 122,
LANG_YOURS_ENERGY_CHANGED = 123, LANG_YOURS_ENERGY_CHANGED = 123,
LANG_CURRENT_ENERGY = 124, //log LANG_CURRENT_ENERGY = 124, // log
LANG_YOU_CHANGE_RAGE = 125, LANG_YOU_CHANGE_RAGE = 125,
LANG_YOURS_RAGE_CHANGED = 126, LANG_YOURS_RAGE_CHANGED = 126,
LANG_YOU_CHANGE_LVL = 127, LANG_YOU_CHANGE_LVL = 127,
@ -501,8 +501,8 @@ enum MangosStrings
LANG_REMOVEALL_COOLDOWN = 492, LANG_REMOVEALL_COOLDOWN = 492,
LANG_REMOVE_COOLDOWN = 493, LANG_REMOVE_COOLDOWN = 493,
LANG_ADDITEM = 494, //log LANG_ADDITEM = 494, // log
LANG_ADDITEMSET = 495, //log LANG_ADDITEMSET = 495, // log
LANG_REMOVEITEM = 496, LANG_REMOVEITEM = 496,
LANG_ITEM_CANNOT_CREATE = 497, LANG_ITEM_CANNOT_CREATE = 497,
LANG_INSERT_GUILD_NAME = 498, LANG_INSERT_GUILD_NAME = 498,
@ -535,7 +535,7 @@ enum MangosStrings
LANG_GAMEOBJECT_NOT_EXIST = 522, LANG_GAMEOBJECT_NOT_EXIST = 522,
LANG_GAMEOBJECT_CURRENT = 523, //log LANG_GAMEOBJECT_CURRENT = 523, // log
LANG_GAMEOBJECT_DETAIL = 524, LANG_GAMEOBJECT_DETAIL = 524,
LANG_GAMEOBJECT_ADD = 525, LANG_GAMEOBJECT_ADD = 525,
@ -583,17 +583,17 @@ enum MangosStrings
// 562, // not used // 562, // not used
// 563, // not used // 563, // not used
LANG_TOO_BIG_INDEX = 564, LANG_TOO_BIG_INDEX = 564,
LANG_SET_UINT = 565, //log LANG_SET_UINT = 565, // log
LANG_SET_UINT_FIELD = 566, LANG_SET_UINT_FIELD = 566,
LANG_SET_FLOAT = 567, //log LANG_SET_FLOAT = 567, // log
LANG_SET_FLOAT_FIELD = 568, LANG_SET_FLOAT_FIELD = 568,
LANG_GET_UINT = 569, //log LANG_GET_UINT = 569, // log
LANG_GET_UINT_FIELD = 570, LANG_GET_UINT_FIELD = 570,
LANG_GET_FLOAT = 571, //log LANG_GET_FLOAT = 571, // log
LANG_GET_FLOAT_FIELD = 572, LANG_GET_FLOAT_FIELD = 572,
// 573, //not used // 573, // not used
// 574, //not used // 574, // not used
LANG_CHANGE_INT32 = 575, //log LANG_CHANGE_INT32 = 575, // log
LANG_CHANGE_INT32_FIELD = 576, LANG_CHANGE_INT32_FIELD = 576,
LANG_INVISIBLE_INVISIBLE = 577, LANG_INVISIBLE_INVISIBLE = 577,
@ -898,13 +898,13 @@ enum MangosStrings
LANG_NPC_GO_INFO_EVENT_STRING = 1150, LANG_NPC_GO_INFO_EVENT_STRING = 1150,
LANG_NPC_GO_INFO_POOL_EVENT_STRING = 1151, LANG_NPC_GO_INFO_POOL_EVENT_STRING = 1151,
LANG_COMMAND_ITEM_USABLE = 1152, LANG_COMMAND_ITEM_USABLE = 1152,
LANG_GET_BITSTR = 1153, //log LANG_GET_BITSTR = 1153, // log
LANG_GET_BITSTR_FIELD = 1154, LANG_GET_BITSTR_FIELD = 1154,
LANG_GET_HEX = 1155, //log LANG_GET_HEX = 1155, // log
LANG_GET_HEX_FIELD = 1156, LANG_GET_HEX_FIELD = 1156,
LANG_CHANGE_HEX = 1157, //log LANG_CHANGE_HEX = 1157, // log
LANG_CHANGE_HEX_FIELD = 1158, LANG_CHANGE_HEX_FIELD = 1158,
LANG_CHANGE_FLOAT = 1159, //log LANG_CHANGE_FLOAT = 1159, // log
LANG_CHANGE_FLOAT_FIELD = 1160, LANG_CHANGE_FLOAT_FIELD = 1160,
LANG_COMMAND_ACHIEVEMENT_CRITERIA = 1161, LANG_COMMAND_ACHIEVEMENT_CRITERIA = 1161,
LANG_COUNTER = 1162, LANG_COUNTER = 1162,

View file

@ -123,7 +123,7 @@ bool ChatHandler::HandleServerInfoCommand(char* /*args*/)
bool ChatHandler::HandleDismountCommand(char* /*args*/) bool ChatHandler::HandleDismountCommand(char* /*args*/)
{ {
//If player is not mounted, so go out :) // If player is not mounted, so go out :)
if (!m_session->GetPlayer()->IsMounted()) if (!m_session->GetPlayer()->IsMounted())
{ {
SendSysMessage(LANG_CHAR_NON_MOUNTED); SendSysMessage(LANG_CHAR_NON_MOUNTED);

View file

@ -75,7 +75,7 @@ bool ChatHandler::HandleNpcYellCommand(char* args)
return true; return true;
} }
//show text emote by creature in chat // show text emote by creature in chat
bool ChatHandler::HandleNpcTextEmoteCommand(char* args) bool ChatHandler::HandleNpcTextEmoteCommand(char* args)
{ {
if (!*args) if (!*args)
@ -131,7 +131,7 @@ bool ChatHandler::HandleAnnounceCommand(char* args)
return true; return true;
} }
//notification player at the screen // notification player at the screen
bool ChatHandler::HandleNotifyCommand(char* args) bool ChatHandler::HandleNotifyCommand(char* args)
{ {
if (!*args) if (!*args)
@ -147,7 +147,7 @@ bool ChatHandler::HandleNotifyCommand(char* args)
return true; return true;
} }
//Enable\Dissable GM Mode // Enable\Dissable GM Mode
bool ChatHandler::HandleGMCommand(char* args) bool ChatHandler::HandleGMCommand(char* args)
{ {
if (!*args) if (!*args)
@ -215,7 +215,7 @@ bool ChatHandler::HandleGMChatCommand(char* args)
return true; return true;
} }
//Enable\Dissable Invisible mode // Enable\Dissable Invisible mode
bool ChatHandler::HandleGMVisibleCommand(char* args) bool ChatHandler::HandleGMVisibleCommand(char* args)
{ {
if (!*args) if (!*args)
@ -353,7 +353,7 @@ bool ChatHandler::HandleGPSCommand(char* args)
return true; return true;
} }
//Summon Player // Summon Player
bool ChatHandler::HandleNamegoCommand(char* args) bool ChatHandler::HandleNamegoCommand(char* args)
{ {
Player* target; Player* target;
@ -473,7 +473,7 @@ bool ChatHandler::HandleNamegoCommand(char* args)
return true; return true;
} }
//Teleport to Player // Teleport to Player
bool ChatHandler::HandleGonameCommand(char* args) bool ChatHandler::HandleGonameCommand(char* args)
{ {
Player* target; Player* target;
@ -640,7 +640,7 @@ bool ChatHandler::HandleRecallCommand(char* args)
return HandleGoHelper(target, target->m_recallMap, target->m_recallX, target->m_recallY, &target->m_recallZ, &target->m_recallO); return HandleGoHelper(target, target->m_recallMap, target->m_recallX, target->m_recallY, &target->m_recallZ, &target->m_recallO);
} }
//Edit Player HP // Edit Player HP
bool ChatHandler::HandleModifyHPCommand(char* args) bool ChatHandler::HandleModifyHPCommand(char* args)
{ {
if (!*args) if (!*args)
@ -678,7 +678,7 @@ bool ChatHandler::HandleModifyHPCommand(char* args)
return true; return true;
} }
//Edit Player Mana // Edit Player Mana
bool ChatHandler::HandleModifyManaCommand(char* args) bool ChatHandler::HandleModifyManaCommand(char* args)
{ {
if (!*args) if (!*args)
@ -716,7 +716,7 @@ bool ChatHandler::HandleModifyManaCommand(char* args)
return true; return true;
} }
//Edit Player Energy // Edit Player Energy
bool ChatHandler::HandleModifyEnergyCommand(char* args) bool ChatHandler::HandleModifyEnergyCommand(char* args)
{ {
if (!*args) if (!*args)
@ -756,7 +756,7 @@ bool ChatHandler::HandleModifyEnergyCommand(char* args)
return true; return true;
} }
//Edit Player Rage // Edit Player Rage
bool ChatHandler::HandleModifyRageCommand(char* args) bool ChatHandler::HandleModifyRageCommand(char* args)
{ {
if (!*args) if (!*args)
@ -828,7 +828,7 @@ bool ChatHandler::HandleModifyRunicPowerCommand(char* args)
return true; return true;
} }
//Edit Player Faction // Edit Player Faction
bool ChatHandler::HandleModifyFactionCommand(char* args) bool ChatHandler::HandleModifyFactionCommand(char* args)
{ {
Creature* chr = getSelectedCreature(); Creature* chr = getSelectedCreature();
@ -892,7 +892,7 @@ bool ChatHandler::HandleModifyFactionCommand(char* args)
return true; return true;
} }
//Edit Player TP // Edit Player TP
bool ChatHandler::HandleModifyTalentCommand(char* args) bool ChatHandler::HandleModifyTalentCommand(char* args)
{ {
if (!*args) if (!*args)
@ -940,7 +940,7 @@ bool ChatHandler::HandleModifyTalentCommand(char* args)
return false; return false;
} }
//Enable On\OFF all taxi paths // Enable On\OFF all taxi paths
bool ChatHandler::HandleTaxiCheatCommand(char* args) bool ChatHandler::HandleTaxiCheatCommand(char* args)
{ {
bool value; bool value;
@ -976,7 +976,7 @@ bool ChatHandler::HandleTaxiCheatCommand(char* args)
return true; return true;
} }
//Edit Player Aspeed // Edit Player Aspeed
bool ChatHandler::HandleModifyASpeedCommand(char* args) bool ChatHandler::HandleModifyASpeedCommand(char* args)
{ {
if (!*args) if (!*args)
@ -1019,12 +1019,12 @@ bool ChatHandler::HandleModifyASpeedCommand(char* args)
chr->UpdateSpeed(MOVE_WALK, true, modSpeed); chr->UpdateSpeed(MOVE_WALK, true, modSpeed);
chr->UpdateSpeed(MOVE_RUN, true, modSpeed); chr->UpdateSpeed(MOVE_RUN, true, modSpeed);
chr->UpdateSpeed(MOVE_SWIM, true, modSpeed); chr->UpdateSpeed(MOVE_SWIM, true, modSpeed);
//chr->UpdateSpeed(MOVE_TURN, true, modSpeed); // chr->UpdateSpeed(MOVE_TURN, true, modSpeed);
chr->UpdateSpeed(MOVE_FLIGHT, true, modSpeed); chr->UpdateSpeed(MOVE_FLIGHT, true, modSpeed);
return true; return true;
} }
//Edit Player Speed // Edit Player Speed
bool ChatHandler::HandleModifySpeedCommand(char* args) bool ChatHandler::HandleModifySpeedCommand(char* args)
{ {
if (!*args) if (!*args)
@ -1069,7 +1069,7 @@ bool ChatHandler::HandleModifySpeedCommand(char* args)
return true; return true;
} }
//Edit Player Swim Speed // Edit Player Swim Speed
bool ChatHandler::HandleModifySwimCommand(char* args) bool ChatHandler::HandleModifySwimCommand(char* args)
{ {
if (!*args) if (!*args)
@ -1114,7 +1114,7 @@ bool ChatHandler::HandleModifySwimCommand(char* args)
return true; return true;
} }
//Edit Player Walk Speed // Edit Player Walk Speed
bool ChatHandler::HandleModifyBWalkCommand(char* args) bool ChatHandler::HandleModifyBWalkCommand(char* args)
{ {
if (!*args) if (!*args)
@ -1159,7 +1159,7 @@ bool ChatHandler::HandleModifyBWalkCommand(char* args)
return true; return true;
} }
//Edit Player Fly // Edit Player Fly
bool ChatHandler::HandleModifyFlyCommand(char* args) bool ChatHandler::HandleModifyFlyCommand(char* args)
{ {
if (!*args) if (!*args)
@ -1195,7 +1195,7 @@ bool ChatHandler::HandleModifyFlyCommand(char* args)
return true; return true;
} }
//Edit Player Scale // Edit Player Scale
bool ChatHandler::HandleModifyScaleCommand(char* args) bool ChatHandler::HandleModifyScaleCommand(char* args)
{ {
if (!*args) if (!*args)
@ -1234,7 +1234,7 @@ bool ChatHandler::HandleModifyScaleCommand(char* args)
return true; return true;
} }
//Enable Player mount // Enable Player mount
bool ChatHandler::HandleModifyMountCommand(char* args) bool ChatHandler::HandleModifyMountCommand(char* args)
{ {
if (!*args) if (!*args)
@ -1480,7 +1480,7 @@ bool ChatHandler::HandleModifyMountCommand(char* args)
WorldPacket data(SMSG_FORCE_RUN_SPEED_CHANGE, (8 + 4 + 1 + 4)); WorldPacket data(SMSG_FORCE_RUN_SPEED_CHANGE, (8 + 4 + 1 + 4));
data << chr->GetPackGUID(); data << chr->GetPackGUID();
data << (uint32)0; data << (uint32)0;
data << (uint8)0; //new 2.1.0 data << (uint8)0; // new 2.1.0
data << float(speed); data << float(speed);
chr->SendMessageToSet(&data, true); chr->SendMessageToSet(&data, true);
@ -1493,7 +1493,7 @@ bool ChatHandler::HandleModifyMountCommand(char* args)
return true; return true;
} }
//Edit Player money // Edit Player money
bool ChatHandler::HandleModifyMoneyCommand(char* args) bool ChatHandler::HandleModifyMoneyCommand(char* args)
{ {
if (!*args) if (!*args)
@ -1668,7 +1668,7 @@ bool ChatHandler::HandleLookupAreaCommand(char* args)
return true; return true;
} }
//Find tele in game_tele order by name // Find tele in game_tele order by name
bool ChatHandler::HandleLookupTeleCommand(char* args) bool ChatHandler::HandleLookupTeleCommand(char* args)
{ {
if (!*args) if (!*args)
@ -1711,7 +1711,7 @@ bool ChatHandler::HandleLookupTeleCommand(char* args)
return true; return true;
} }
//Enable\Dissable accept whispers (for GM) // Enable\Dissable accept whispers (for GM)
bool ChatHandler::HandleWhispersCommand(char* args) bool ChatHandler::HandleWhispersCommand(char* args)
{ {
if (!*args) if (!*args)
@ -1744,7 +1744,7 @@ bool ChatHandler::HandleWhispersCommand(char* args)
return true; return true;
} }
//Save all players in the world // Save all players in the world
bool ChatHandler::HandleSaveAllCommand(char* /*args*/) bool ChatHandler::HandleSaveAllCommand(char* /*args*/)
{ {
sObjectAccessor.SaveAllPlayers(); sObjectAccessor.SaveAllPlayers();
@ -1752,7 +1752,7 @@ bool ChatHandler::HandleSaveAllCommand(char* /*args*/)
return true; return true;
} }
//Send mail by command // Send mail by command
bool ChatHandler::HandleSendMailCommand(char* args) bool ChatHandler::HandleSendMailCommand(char* args)
{ {
// format: name "subject text" "mail text" // format: name "subject text" "mail text"
@ -1836,7 +1836,7 @@ bool ChatHandler::HandleTeleNameCommand(char* args)
return true; return true;
} }
//Teleport group to given game_tele.entry // Teleport group to given game_tele.entry
bool ChatHandler::HandleTeleGroupCommand(char* args) bool ChatHandler::HandleTeleGroupCommand(char* args)
{ {
if (!*args) if (!*args)
@ -1912,7 +1912,7 @@ bool ChatHandler::HandleTeleGroupCommand(char* args)
return true; return true;
} }
//Summon group of player // Summon group of player
bool ChatHandler::HandleGroupgoCommand(char* args) bool ChatHandler::HandleGroupgoCommand(char* args)
{ {
Player* target; Player* target;
@ -2110,7 +2110,7 @@ bool ChatHandler::HandleGoCommand(char* args)
//teleport at coordinates // teleport at coordinates
bool ChatHandler::HandleGoXYCommand(char* args) bool ChatHandler::HandleGoXYCommand(char* args)
{ {
Player* _player = m_session->GetPlayer(); Player* _player = m_session->GetPlayer();
@ -2130,7 +2130,7 @@ bool ChatHandler::HandleGoXYCommand(char* args)
return HandleGoHelper(_player, mapid, x, y); return HandleGoHelper(_player, mapid, x, y);
} }
//teleport at coordinates, including Z // teleport at coordinates, including Z
bool ChatHandler::HandleGoXYZCommand(char* args) bool ChatHandler::HandleGoXYZCommand(char* args)
{ {
Player* _player = m_session->GetPlayer(); Player* _player = m_session->GetPlayer();
@ -2154,7 +2154,7 @@ bool ChatHandler::HandleGoXYZCommand(char* args)
return HandleGoHelper(_player, mapid, x, y, &z); return HandleGoHelper(_player, mapid, x, y, &z);
} }
//teleport at coordinates // teleport at coordinates
bool ChatHandler::HandleGoZoneXYCommand(char* args) bool ChatHandler::HandleGoZoneXYCommand(char* args)
{ {
Player* _player = m_session->GetPlayer(); Player* _player = m_session->GetPlayer();
@ -2209,7 +2209,7 @@ bool ChatHandler::HandleGoZoneXYCommand(char* args)
return HandleGoHelper(_player, mapEntry->MapID, x, y); return HandleGoHelper(_player, mapEntry->MapID, x, y);
} }
//teleport to grid // teleport to grid
bool ChatHandler::HandleGoGridCommand(char* args) bool ChatHandler::HandleGoGridCommand(char* args)
{ {
Player* _player = m_session->GetPlayer(); Player* _player = m_session->GetPlayer();

View file

@ -58,7 +58,7 @@ static uint32 ReputationRankStrIndex[MAX_REPUTATION_RANK] =
LANG_REP_FRIENDLY, LANG_REP_HONORED, LANG_REP_REVERED, LANG_REP_EXALTED LANG_REP_FRIENDLY, LANG_REP_HONORED, LANG_REP_REVERED, LANG_REP_EXALTED
}; };
//mute player for some times // mute player for some times
bool ChatHandler::HandleMuteCommand(char* args) bool ChatHandler::HandleMuteCommand(char* args)
{ {
char* nameStr = ExtractOptNotLastArg(&args); char* nameStr = ExtractOptNotLastArg(&args);
@ -102,7 +102,7 @@ bool ChatHandler::HandleMuteCommand(char* args)
return true; return true;
} }
//unmute player // unmute player
bool ChatHandler::HandleUnmuteCommand(char* args) bool ChatHandler::HandleUnmuteCommand(char* args)
{ {
Player* target; Player* target;
@ -491,7 +491,7 @@ static char const* const creatureKeys[] =
* Warning: If there is more than one mob with this "id" * Warning: If there is more than one mob with this "id"
* you will be teleported to the first one that is found. * you will be teleported to the first one that is found.
*/ */
//teleport to creature // teleport to creature
bool ChatHandler::HandleGoCreatureCommand(char* args) bool ChatHandler::HandleGoCreatureCommand(char* args)
{ {
if (!*args) if (!*args)
@ -641,7 +641,7 @@ static char const* const gameobjectKeys[] =
NULL NULL
}; };
//teleport to gameobject // teleport to gameobject
bool ChatHandler::HandleGoObjectCommand(char* args) bool ChatHandler::HandleGoObjectCommand(char* args)
{ {
Player* _player = m_session->GetPlayer(); Player* _player = m_session->GetPlayer();
@ -895,7 +895,7 @@ bool ChatHandler::HandleGameObjectTargetCommand(char* args)
return true; return true;
} }
//delete object by selection or guid // delete object by selection or guid
bool ChatHandler::HandleGameObjectDeleteCommand(char* args) bool ChatHandler::HandleGameObjectDeleteCommand(char* args)
{ {
// number or [name] Shift-click form |color|Hgameobject:go_guid|h[name]|h|r // number or [name] Shift-click form |color|Hgameobject:go_guid|h[name]|h|r
@ -941,7 +941,7 @@ bool ChatHandler::HandleGameObjectDeleteCommand(char* args)
return true; return true;
} }
//turn selected object // turn selected object
bool ChatHandler::HandleGameObjectTurnCommand(char* args) bool ChatHandler::HandleGameObjectTurnCommand(char* args)
{ {
// number or [name] Shift-click form |color|Hgameobject:go_id|h[name]|h|r // number or [name] Shift-click form |color|Hgameobject:go_id|h[name]|h|r
@ -975,7 +975,7 @@ bool ChatHandler::HandleGameObjectTurnCommand(char* args)
return true; return true;
} }
//move selected object // move selected object
bool ChatHandler::HandleGameObjectMoveCommand(char* args) bool ChatHandler::HandleGameObjectMoveCommand(char* args)
{ {
// number or [name] Shift-click form |color|Hgameobject:go_guid|h[name]|h|r // number or [name] Shift-click form |color|Hgameobject:go_guid|h[name]|h|r
@ -1047,7 +1047,7 @@ bool ChatHandler::HandleGameObjectMoveCommand(char* args)
return true; return true;
} }
//spawn go // spawn go
bool ChatHandler::HandleGameObjectAddCommand(char* args) bool ChatHandler::HandleGameObjectAddCommand(char* args)
{ {
// number or [name] Shift-click form |color|Hgameobject_entry:go_id|h[name]|h|r // number or [name] Shift-click form |color|Hgameobject_entry:go_id|h[name]|h|r
@ -1125,7 +1125,7 @@ bool ChatHandler::HandleGameObjectAddCommand(char* args)
return true; return true;
} }
//set pahsemask for selected object // set pahsemask for selected object
bool ChatHandler::HandleGameObjectPhaseCommand(char* args) bool ChatHandler::HandleGameObjectPhaseCommand(char* args)
{ {
// number or [name] Shift-click form |color|Hgameobject:go_id|h[name]|h|r // number or [name] Shift-click form |color|Hgameobject:go_id|h[name]|h|r
@ -1549,7 +1549,7 @@ bool ChatHandler::HandleModifyRepCommand(char* args)
} }
//-----------------------Npc Commands----------------------- //-----------------------Npc Commands-----------------------
//add spawn of creature // add spawn of creature
bool ChatHandler::HandleNpcAddCommand(char* args) bool ChatHandler::HandleNpcAddCommand(char* args)
{ {
if (!*args) if (!*args)
@ -1600,7 +1600,7 @@ bool ChatHandler::HandleNpcAddCommand(char* args)
return true; return true;
} }
//add item in vendorlist // add item in vendorlist
bool ChatHandler::HandleNpcAddVendorItemCommand(char* args) bool ChatHandler::HandleNpcAddVendorItemCommand(char* args)
{ {
uint32 itemId; uint32 itemId;
@ -1641,7 +1641,7 @@ bool ChatHandler::HandleNpcAddVendorItemCommand(char* args)
return true; return true;
} }
//del item from vendor list // del item from vendor list
bool ChatHandler::HandleNpcDelVendorItemCommand(char* args) bool ChatHandler::HandleNpcDelVendorItemCommand(char* args)
{ {
if (!*args) if (!*args)
@ -1676,7 +1676,7 @@ bool ChatHandler::HandleNpcDelVendorItemCommand(char* args)
return true; return true;
} }
//show info about AI // show info about AI
bool ChatHandler::HandleNpcAIInfoCommand(char* /*args*/) bool ChatHandler::HandleNpcAIInfoCommand(char* /*args*/)
{ {
Creature* pTarget = getSelectedCreature(); Creature* pTarget = getSelectedCreature();
@ -1705,7 +1705,7 @@ bool ChatHandler::HandleNpcAIInfoCommand(char* /*args*/)
return true; return true;
} }
//add move for creature // add move for creature
bool ChatHandler::HandleNpcAddMoveCommand(char* args) bool ChatHandler::HandleNpcAddMoveCommand(char* args)
{ {
uint32 lowguid; uint32 lowguid;
@ -1756,7 +1756,7 @@ bool ChatHandler::HandleNpcAddMoveCommand(char* args)
return true; return true;
} }
//change level of creature or pet // change level of creature or pet
bool ChatHandler::HandleNpcChangeLevelCommand(char* args) bool ChatHandler::HandleNpcChangeLevelCommand(char* args)
{ {
if (!*args) if (!*args)
@ -1793,7 +1793,7 @@ bool ChatHandler::HandleNpcChangeLevelCommand(char* args)
return true; return true;
} }
//set npcflag of creature // set npcflag of creature
bool ChatHandler::HandleNpcFlagCommand(char* args) bool ChatHandler::HandleNpcFlagCommand(char* args)
{ {
if (!*args) if (!*args)
@ -1878,7 +1878,7 @@ bool ChatHandler::HandleNpcDeleteCommand(char* args)
return true; return true;
} }
//move selected creature // move selected creature
bool ChatHandler::HandleNpcMoveCommand(char* args) bool ChatHandler::HandleNpcMoveCommand(char* args)
{ {
uint32 lowguid = 0; uint32 lowguid = 0;
@ -2039,7 +2039,7 @@ bool ChatHandler::HandleNpcSetMoveTypeCommand(char* args)
return true; return true;
} }
//set model of creature // set model of creature
bool ChatHandler::HandleNpcSetModelCommand(char* args) bool ChatHandler::HandleNpcSetModelCommand(char* args)
{ {
if (!*args) if (!*args)
@ -2064,7 +2064,7 @@ bool ChatHandler::HandleNpcSetModelCommand(char* args)
return true; return true;
} }
//set faction of creature // set faction of creature
bool ChatHandler::HandleNpcFactionIdCommand(char* args) bool ChatHandler::HandleNpcFactionIdCommand(char* args)
{ {
if (!*args) if (!*args)
@ -2104,7 +2104,7 @@ bool ChatHandler::HandleNpcFactionIdCommand(char* args)
return true; return true;
} }
//set spawn dist of creature // set spawn dist of creature
bool ChatHandler::HandleNpcSpawnDistCommand(char* args) bool ChatHandler::HandleNpcSpawnDistCommand(char* args)
{ {
if (!*args) if (!*args)
@ -2142,7 +2142,7 @@ bool ChatHandler::HandleNpcSpawnDistCommand(char* args)
PSendSysMessage(LANG_COMMAND_SPAWNDIST, option); PSendSysMessage(LANG_COMMAND_SPAWNDIST, option);
return true; return true;
} }
//spawn time handling // spawn time handling
bool ChatHandler::HandleNpcSpawnTimeCommand(char* args) bool ChatHandler::HandleNpcSpawnTimeCommand(char* args)
{ {
uint32 stime; uint32 stime;
@ -2165,7 +2165,7 @@ bool ChatHandler::HandleNpcSpawnTimeCommand(char* args)
return true; return true;
} }
//npc follow handling // npc follow handling
bool ChatHandler::HandleNpcFollowCommand(char* /*args*/) bool ChatHandler::HandleNpcFollowCommand(char* /*args*/)
{ {
Player* player = m_session->GetPlayer(); Player* player = m_session->GetPlayer();
@ -2184,7 +2184,7 @@ bool ChatHandler::HandleNpcFollowCommand(char* /*args*/)
PSendSysMessage(LANG_CREATURE_FOLLOW_YOU_NOW, creature->GetName()); PSendSysMessage(LANG_CREATURE_FOLLOW_YOU_NOW, creature->GetName());
return true; return true;
} }
//npc unfollow handling // npc unfollow handling
bool ChatHandler::HandleNpcUnFollowCommand(char* /*args*/) bool ChatHandler::HandleNpcUnFollowCommand(char* /*args*/)
{ {
Player* player = m_session->GetPlayer(); Player* player = m_session->GetPlayer();
@ -2221,7 +2221,7 @@ bool ChatHandler::HandleNpcUnFollowCommand(char* /*args*/)
PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU_NOW, creature->GetName()); PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU_NOW, creature->GetName());
return true; return true;
} }
//npc tame handling // npc tame handling
bool ChatHandler::HandleNpcTameCommand(char* /*args*/) bool ChatHandler::HandleNpcTameCommand(char* /*args*/)
{ {
Creature* creatureTarget = getSelectedCreature(); Creature* creatureTarget = getSelectedCreature();
@ -2245,8 +2245,8 @@ bool ChatHandler::HandleNpcTameCommand(char* /*args*/)
player->CastSpell(creatureTarget, 13481, true); // Tame Beast, triggered effect player->CastSpell(creatureTarget, 13481, true); // Tame Beast, triggered effect
return true; return true;
} }
//npc phasemask handling // npc phasemask handling
//change phasemask of creature or pet // change phasemask of creature or pet
bool ChatHandler::HandleNpcSetPhaseCommand(char* args) bool ChatHandler::HandleNpcSetPhaseCommand(char* args)
{ {
if (!*args) if (!*args)
@ -2275,7 +2275,7 @@ bool ChatHandler::HandleNpcSetPhaseCommand(char* args)
return true; return true;
} }
//npc deathstate handling // npc deathstate handling
bool ChatHandler::HandleNpcSetDeathStateCommand(char* args) bool ChatHandler::HandleNpcSetDeathStateCommand(char* args)
{ {
bool value; bool value;
@ -2305,7 +2305,7 @@ bool ChatHandler::HandleNpcSetDeathStateCommand(char* args)
return true; return true;
} }
//TODO: NpcCommands that need to be fixed : // TODO: NpcCommands that need to be fixed :
bool ChatHandler::HandleNpcNameCommand(char* /*args*/) bool ChatHandler::HandleNpcNameCommand(char* /*args*/)
{ {
@ -2399,7 +2399,7 @@ bool ChatHandler::HandleNpcSubNameCommand(char* /*args*/)
return true; return true;
} }
//move item to other slot // move item to other slot
bool ChatHandler::HandleItemMoveCommand(char* args) bool ChatHandler::HandleItemMoveCommand(char* args)
{ {
if (!*args) if (!*args)
@ -2435,7 +2435,7 @@ bool ChatHandler::HandleItemMoveCommand(char* args)
return true; return true;
} }
//demorph player or unit // demorph player or unit
bool ChatHandler::HandleDeMorphCommand(char* /*args*/) bool ChatHandler::HandleDeMorphCommand(char* /*args*/)
{ {
Unit* target = getSelectedUnit(); Unit* target = getSelectedUnit();
@ -2452,7 +2452,7 @@ bool ChatHandler::HandleDeMorphCommand(char* /*args*/)
return true; return true;
} }
//morph creature or player // morph creature or player
bool ChatHandler::HandleModifyMorphCommand(char* args) bool ChatHandler::HandleModifyMorphCommand(char* args)
{ {
if (!*args) if (!*args)
@ -2481,7 +2481,7 @@ bool ChatHandler::HandleModifyMorphCommand(char* args)
return true; return true;
} }
//kick player // kick player
bool ChatHandler::HandleKickPlayerCommand(char* args) bool ChatHandler::HandleKickPlayerCommand(char* args)
{ {
Player* target; Player* target;
@ -2505,7 +2505,7 @@ bool ChatHandler::HandleKickPlayerCommand(char* args)
return true; return true;
} }
//set temporary phase mask for player // set temporary phase mask for player
bool ChatHandler::HandleModifyPhaseCommand(char* args) bool ChatHandler::HandleModifyPhaseCommand(char* args)
{ {
if (!*args) if (!*args)
@ -2526,7 +2526,7 @@ bool ChatHandler::HandleModifyPhaseCommand(char* args)
return true; return true;
} }
//show info of player // show info of player
bool ChatHandler::HandlePInfoCommand(char* args) bool ChatHandler::HandlePInfoCommand(char* args)
{ {
Player* target; Player* target;
@ -2613,7 +2613,7 @@ bool ChatHandler::HandlePInfoCommand(char* args)
return true; return true;
} }
//show tickets // show tickets
void ChatHandler::ShowTicket(GMTicket const* ticket) void ChatHandler::ShowTicket(GMTicket const* ticket)
{ {
std::string lastupdated = TimeToTimestampStr(ticket->GetLastUpdate()); std::string lastupdated = TimeToTimestampStr(ticket->GetLastUpdate());
@ -2631,7 +2631,7 @@ void ChatHandler::ShowTicket(GMTicket const* ticket)
PSendSysMessage(LANG_COMMAND_TICKETRESPONSE, ticket->GetResponse()); PSendSysMessage(LANG_COMMAND_TICKETRESPONSE, ticket->GetResponse());
} }
//ticket commands // ticket commands
bool ChatHandler::HandleTicketCommand(char* args) bool ChatHandler::HandleTicketCommand(char* args)
{ {
char* px = ExtractLiteralArg(&args); char* px = ExtractLiteralArg(&args);
@ -2774,7 +2774,7 @@ bool ChatHandler::HandleTicketCommand(char* args)
return true; return true;
} }
//dell all tickets // dell all tickets
bool ChatHandler::HandleDelTicketCommand(char* args) bool ChatHandler::HandleDelTicketCommand(char* args)
{ {
char* px = ExtractLiteralArg(&args); char* px = ExtractLiteralArg(&args);
@ -2811,7 +2811,7 @@ bool ChatHandler::HandleDelTicketCommand(char* args)
sTicketMgr.Delete(guid); sTicketMgr.Delete(guid);
//notify player // notify player
if (Player* pl = sObjectMgr.GetPlayer(guid)) if (Player* pl = sObjectMgr.GetPlayer(guid))
{ {
pl->GetSession()->SendGMTicketGetTicket(0x0A); pl->GetSession()->SendGMTicketGetTicket(0x0A);
@ -3349,7 +3349,7 @@ bool ChatHandler::HandleWpModifyCommand(char* args)
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells(); // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
wpCreature2->LoadFromDB(wpCreature2->GetGUIDLow(), map); wpCreature2->LoadFromDB(wpCreature2->GetGUIDLow(), map);
map->Add(wpCreature2); map->Add(wpCreature2);
//npcCreature->GetMap()->Add(wpCreature2); // npcCreature->GetMap()->Add(wpCreature2);
} }
sWaypointMgr.SetNodePosition(lowguid, point, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ()); sWaypointMgr.SetNodePosition(lowguid, point, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ());
@ -3447,7 +3447,7 @@ bool ChatHandler::HandleWpShowCommand(char* args)
// second arg: GUID (optional, if a creature is selected) // second arg: GUID (optional, if a creature is selected)
char* guid_str = strtok((char*)NULL, " "); char* guid_str = strtok((char*)NULL, " ");
DEBUG_LOG("DEBUG: HandleWpShowCommand: show_str: %s guid_str: %s", show_str, guid_str); DEBUG_LOG("DEBUG: HandleWpShowCommand: show_str: %s guid_str: %s", show_str, guid_str);
//if (!guid_str) { // if (!guid_str) {
// return false; // return false;
//} //}
@ -3520,9 +3520,9 @@ bool ChatHandler::HandleWpShowCommand(char* args)
return false; return false;
} }
//PSendSysMessage("wp on, GUID: %u", lowguid); // PSendSysMessage("wp on, GUID: %u", lowguid);
//pCreature->GetPositionX(); // pCreature->GetPositionX();
QueryResult* result = QueryResult* result =
WorldDatabase.PQuery("SELECT id, point, waittime, emote, spell, textid1, textid2, textid3, textid4, textid5, model1, model2 FROM creature_movement WHERE wpguid = %u", WorldDatabase.PQuery("SELECT id, point, waittime, emote, spell, textid1, textid2, textid3, textid4, textid5, model1, model2 FROM creature_movement WHERE wpguid = %u",
@ -3652,7 +3652,7 @@ bool ChatHandler::HandleWpShowCommand(char* args)
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells(); // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
wpCreature->LoadFromDB(wpCreature->GetGUIDLow(), map); wpCreature->LoadFromDB(wpCreature->GetGUIDLow(), map);
map->Add(wpCreature); map->Add(wpCreature);
//wpCreature->GetMap()->Add(wpCreature); // wpCreature->GetMap()->Add(wpCreature);
} }
while (result->NextRow()); while (result->NextRow());
@ -3692,7 +3692,7 @@ bool ChatHandler::HandleWpShowCommand(char* args)
pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn()); pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
pCreature->LoadFromDB(pCreature->GetGUIDLow(), map); pCreature->LoadFromDB(pCreature->GetGUIDLow(), map);
map->Add(pCreature); map->Add(pCreature);
//player->PlayerTalkClass->SendPointOfInterest(x, y, 6, 6, 0, "First Waypoint"); // player->PlayerTalkClass->SendPointOfInterest(x, y, 6, 6, 0, "First Waypoint");
// Cleanup memory // Cleanup memory
delete result; delete result;
@ -3740,7 +3740,7 @@ bool ChatHandler::HandleWpShowCommand(char* args)
pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn()); pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
pCreature->LoadFromDB(pCreature->GetGUIDLow(), map); pCreature->LoadFromDB(pCreature->GetGUIDLow(), map);
map->Add(pCreature); map->Add(pCreature);
//player->PlayerTalkClass->SendPointOfInterest(x, y, 6, 6, 0, "Last Waypoint"); // player->PlayerTalkClass->SendPointOfInterest(x, y, 6, 6, 0, "Last Waypoint");
// Cleanup memory // Cleanup memory
delete result; delete result;
return true; return true;
@ -3931,7 +3931,7 @@ bool ChatHandler::HandleWpImportCommand(char* args)
while (! infile.eof()) while (! infile.eof())
{ {
getline(infile, line); getline(infile, line);
//cout << line << endl; // cout << line << endl;
QueryResult* result = WorldDatabase.Query(line.c_str()); QueryResult* result = WorldDatabase.Query(line.c_str());
delete result; delete result;
} }
@ -3942,7 +3942,7 @@ bool ChatHandler::HandleWpImportCommand(char* args)
return true; return true;
} }
//rename characters // rename characters
bool ChatHandler::HandleCharacterRenameCommand(char* args) bool ChatHandler::HandleCharacterRenameCommand(char* args)
{ {
Player* target; Player* target;
@ -4020,7 +4020,7 @@ bool ChatHandler::HandleCharacterReputationCommand(char* args)
return true; return true;
} }
//change standstate // change standstate
bool ChatHandler::HandleModifyStandStateCommand(char* args) bool ChatHandler::HandleModifyStandStateCommand(char* args)
{ {
uint32 anim_id; uint32 anim_id;
@ -5183,7 +5183,7 @@ bool ChatHandler::HandleTitlesRemoveCommand(char* args)
return true; return true;
} }
//Edit Player KnownTitles // Edit Player KnownTitles
bool ChatHandler::HandleTitlesSetMaskCommand(char* args) bool ChatHandler::HandleTitlesSetMaskCommand(char* args)
{ {
if (!*args) if (!*args)

View file

@ -224,7 +224,7 @@ bool ChatHandler::HandleAHBotStatusCommand(char* args)
return true; return true;
} }
//reload commands // reload commands
bool ChatHandler::HandleReloadAllCommand(char* /*args*/) bool ChatHandler::HandleReloadAllCommand(char* /*args*/)
{ {
HandleReloadSkillFishingBaseLevelCommand((char*)""); HandleReloadSkillFishingBaseLevelCommand((char*)"");
@ -257,7 +257,7 @@ bool ChatHandler::HandleReloadAllAchievementCommand(char* /*args*/)
bool ChatHandler::HandleReloadAllAreaCommand(char* /*args*/) bool ChatHandler::HandleReloadAllAreaCommand(char* /*args*/)
{ {
//HandleReloadQuestAreaTriggersCommand((char*)""); -- reloaded in HandleReloadAllQuestCommand // HandleReloadQuestAreaTriggersCommand((char*)""); -- reloaded in HandleReloadAllQuestCommand
HandleReloadAreaTriggerTeleportCommand((char*)""); HandleReloadAreaTriggerTeleportCommand((char*)"");
HandleReloadAreaTriggerTavernCommand((char*)""); HandleReloadAreaTriggerTavernCommand((char*)"");
HandleReloadGameGraveyardZoneCommand((char*)""); HandleReloadGameGraveyardZoneCommand((char*)"");
@ -2296,8 +2296,8 @@ bool ChatHandler::HandleLearnAllGMCommand(char* /*args*/)
"29878", // Kill My Self "29878", // Kill My Self
"26644", // More Kill "26644", // More Kill
"28550", //Invisible 24 "28550", // Invisible 24
"23452", //Invisible + Target "23452", // Invisible + Target
"0" "0"
}; };
@ -2611,7 +2611,7 @@ bool ChatHandler::HandleAddItemCommand(char* args)
return false; return false;
} }
//Subtract // Subtract
if (count < 0) if (count < 0)
{ {
plTarget->DestroyItemCount(itemId, -count, true, false); plTarget->DestroyItemCount(itemId, -count, true, false);
@ -2619,7 +2619,7 @@ bool ChatHandler::HandleAddItemCommand(char* args)
return true; return true;
} }
//Adding items // Adding items
uint32 noSpaceForCount = 0; uint32 noSpaceForCount = 0;
// check space and find places // check space and find places
@ -4254,7 +4254,7 @@ bool ChatHandler::HandleNpcInfoCommand(char* /*args*/)
return true; return true;
} }
//play npc emote // play npc emote
bool ChatHandler::HandleNpcPlayEmoteCommand(char* args) bool ChatHandler::HandleNpcPlayEmoteCommand(char* args)
{ {
uint32 emote = atoi(args); uint32 emote = atoi(args);
@ -4272,7 +4272,7 @@ bool ChatHandler::HandleNpcPlayEmoteCommand(char* args)
return true; return true;
} }
//TODO: NpcCommands that needs to be fixed : // TODO: NpcCommands that needs to be fixed :
bool ChatHandler::HandleNpcAddWeaponCommand(char* /*args*/) bool ChatHandler::HandleNpcAddWeaponCommand(char* /*args*/)
{ {
@ -4707,7 +4707,7 @@ bool ChatHandler::HandleStableCommand(char* /*args*/)
bool ChatHandler::HandleChangeWeatherCommand(char* args) bool ChatHandler::HandleChangeWeatherCommand(char* args)
{ {
//Weather is OFF // Weather is OFF
if (!sWorld.getConfig(CONFIG_BOOL_WEATHER)) if (!sWorld.getConfig(CONFIG_BOOL_WEATHER))
{ {
SendSysMessage(LANG_WEATHER_DISABLED); SendSysMessage(LANG_WEATHER_DISABLED);
@ -4989,7 +4989,7 @@ static bool HandleResetStatsOrLevelHelper(Player* player)
//-1 is default value //-1 is default value
player->SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, -1); player->SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, -1);
//player->SetUInt32Value(PLAYER_FIELD_BYTES, 0xEEE00000 ); // player->SetUInt32Value(PLAYER_FIELD_BYTES, 0xEEE00000 );
return true; return true;
} }
@ -7003,11 +7003,11 @@ bool ChatHandler::HandleSendMessageCommand(char* args)
} }
///- Send the message ///- Send the message
//Use SendAreaTriggerMessage for fastest delivery. // Use SendAreaTriggerMessage for fastest delivery.
rPlayer->GetSession()->SendAreaTriggerMessage("%s", args); rPlayer->GetSession()->SendAreaTriggerMessage("%s", args);
rPlayer->GetSession()->SendAreaTriggerMessage("|cffff0000[Message from administrator]:|r"); rPlayer->GetSession()->SendAreaTriggerMessage("|cffff0000[Message from administrator]:|r");
//Confirmation message // Confirmation message
std::string nameLink = GetNameLink(rPlayer); std::string nameLink = GetNameLink(rPlayer);
PSendSysMessage(LANG_SENDMESSAGE, nameLink.c_str(), args); PSendSysMessage(LANG_SENDMESSAGE, nameLink.c_str(), args);
return true; return true;

View file

@ -137,7 +137,7 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket& recv_data)
if (qitem) if (qitem)
{ {
qitem->is_looted = true; qitem->is_looted = true;
//freeforall is 1 if everyone's supposed to get the quest item. // freeforall is 1 if everyone's supposed to get the quest item.
if (item->freeforall || loot->GetPlayerQuestItems().size() == 1) if (item->freeforall || loot->GetPlayerQuestItems().size() == 1)
player->SendNotifyLootItemRemoved(lootSlot); player->SendNotifyLootItemRemoved(lootSlot);
else else
@ -147,20 +147,20 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket& recv_data)
{ {
if (ffaitem) if (ffaitem)
{ {
//freeforall case, notify only one player of the removal // freeforall case, notify only one player of the removal
ffaitem->is_looted = true; ffaitem->is_looted = true;
player->SendNotifyLootItemRemoved(lootSlot); player->SendNotifyLootItemRemoved(lootSlot);
} }
else else
{ {
//not freeforall, notify everyone // not freeforall, notify everyone
if (conditem) if (conditem)
conditem->is_looted = true; conditem->is_looted = true;
loot->NotifyItemRemoved(lootSlot); loot->NotifyItemRemoved(lootSlot);
} }
} }
//if only one person is supposed to loot the item, then set it to looted // if only one person is supposed to loot the item, then set it to looted
if (!item->freeforall) if (!item->freeforall)
item->is_looted = true; item->is_looted = true;
@ -237,7 +237,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recv_data*/)
{ {
pLoot->NotifyMoneyRemoved(); pLoot->NotifyMoneyRemoved();
if (!guid.IsItem() && player->GetGroup()) //item can be looted only single player if (!guid.IsItem() && player->GetGroup()) // item can be looted only single player
{ {
Group* group = player->GetGroup(); Group* group = player->GetGroup();
@ -503,7 +503,7 @@ void WorldSession::DoLootRelease(ObjectGuid lguid)
} }
} }
//Player is not looking at loot list, he doesn't need to see updates on the loot list // Player is not looking at loot list, he doesn't need to see updates on the loot list
loot->RemoveLooter(player->GetObjectGuid()); loot->RemoveLooter(player->GetObjectGuid());
} }

View file

@ -72,7 +72,7 @@ class LootTemplate::LootGroup // A set of loot def
LootStoreItem const* Roll() const; // Rolls an item from the group, returns NULL if all miss their chances LootStoreItem const* Roll() const; // Rolls an item from the group, returns NULL if all miss their chances
}; };
//Remove all data and free all memory // Remove all data and free all memory
void LootStore::Clear() void LootStore::Clear()
{ {
for (LootTemplateMap::const_iterator itr = m_LootTemplates.begin(); itr != m_LootTemplates.end(); ++itr) for (LootTemplateMap::const_iterator itr = m_LootTemplates.begin(); itr != m_LootTemplates.end(); ++itr)
@ -739,7 +739,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootItem const& li)
b << uint32(ObjectMgr::GetItemPrototype(li.itemid)->DisplayInfoID); b << uint32(ObjectMgr::GetItemPrototype(li.itemid)->DisplayInfoID);
b << uint32(li.randomSuffix); b << uint32(li.randomSuffix);
b << uint32(li.randomPropertyId); b << uint32(li.randomPropertyId);
//b << uint8(0); // slot type - will send after this function call // b << uint8(0); // slot type - will send after this function call
return b; return b;
} }
@ -747,7 +747,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
{ {
if (lv.permission == NONE_PERMISSION) if (lv.permission == NONE_PERMISSION)
{ {
b << uint32(0); //gold b << uint32(0); // gold
b << uint8(0); // item count b << uint8(0); // item count
return b; // nothing output more return b; // nothing output more
} }
@ -756,7 +756,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
uint8 itemsShown = 0; uint8 itemsShown = 0;
//gold // gold
b << uint32(l.gold); b << uint32(l.gold);
size_t count_pos = b.wpos(); // pos of item count byte size_t count_pos = b.wpos(); // pos of item count byte
@ -834,7 +834,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
} }
} }
//update number of items shown // update number of items shown
b.put<uint8>(count_pos, itemsShown); b.put<uint8>(count_pos, itemsShown);
return b; return b;
@ -860,7 +860,7 @@ LootStoreItem const* LootTemplate::LootGroup::Roll() const
{ {
float Roll = rand_chance_f(); float Roll = rand_chance_f();
for (uint32 i = 0; i < ExplicitlyChanced.size(); ++i) //check each explicitly chanced entry in the template and modify its chance based on quality. for (uint32 i = 0; i < ExplicitlyChanced.size(); ++i) // check each explicitly chanced entry in the template and modify its chance based on quality.
{ {
if (ExplicitlyChanced[i].chance >= 100.0f) if (ExplicitlyChanced[i].chance >= 100.0f)
return &ExplicitlyChanced[i]; return &ExplicitlyChanced[i];
@ -1310,7 +1310,7 @@ void LoadLootTemplates_Prospecting()
if (ids_set.find(proto->ItemId) != ids_set.end()) if (ids_set.find(proto->ItemId) != ids_set.end())
ids_set.erase(proto->ItemId); ids_set.erase(proto->ItemId);
//else -- exist some cases that possible can be prospected but not expected have any result loot // else -- exist some cases that possible can be prospected but not expected have any result loot
// LootTemplates_Prospecting.ReportNotExistedId(proto->ItemId); // LootTemplates_Prospecting.ReportNotExistedId(proto->ItemId);
} }

View file

@ -423,8 +423,8 @@ void WorldSession::HandleMailReturnToSender(WorldPacket& recv_data)
return; return;
} }
//we can return mail now // we can return mail now
//so firstly delete the old one // so firstly delete the old one
CharacterDatabase.BeginTransaction(); CharacterDatabase.BeginTransaction();
CharacterDatabase.PExecute("DELETE FROM mail WHERE id = '%u'", mailId); CharacterDatabase.PExecute("DELETE FROM mail WHERE id = '%u'", mailId);
// needed? // needed?

View file

@ -57,7 +57,7 @@ Map::~Map()
// unload instance specific navigation data // unload instance specific navigation data
MMAP::MMapFactory::createOrGetMMapManager()->unloadMapInstance(m_TerrainData->GetMapId(), GetInstanceId()); MMAP::MMapFactory::createOrGetMMapManager()->unloadMapInstance(m_TerrainData->GetMapId(), GetInstanceId());
//release reference count // release reference count
if (m_TerrainData->Release()) if (m_TerrainData->Release())
sTerrainMgr.UnloadTerrain(m_TerrainData->GetMapId()); sTerrainMgr.UnloadTerrain(m_TerrainData->GetMapId());
} }
@ -87,16 +87,16 @@ Map::Map(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode)
{ {
for (unsigned int idx = 0; idx < MAX_NUMBER_OF_GRIDS; ++idx) for (unsigned int idx = 0; idx < MAX_NUMBER_OF_GRIDS; ++idx)
{ {
//z code // z code
m_bLoadedGrids[idx][j] = false; m_bLoadedGrids[idx][j] = false;
setNGrid(NULL, idx, j); setNGrid(NULL, idx, j);
} }
} }
//lets initialize visibility distance for map // lets initialize visibility distance for map
Map::InitVisibilityDistance(); Map::InitVisibilityDistance();
//add reference for TerrainData object // add reference for TerrainData object
m_TerrainData->AddRef(); m_TerrainData->AddRef();
m_persistentState = sMapPersistentStateMgr.AddPersistentState(i_mapEntry, GetInstanceId(), GetDifficulty(), 0, IsDungeon()); m_persistentState = sMapPersistentStateMgr.AddPersistentState(i_mapEntry, GetInstanceId(), GetDifficulty(), 0, IsDungeon());
@ -105,7 +105,7 @@ Map::Map(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode)
void Map::InitVisibilityDistance() void Map::InitVisibilityDistance()
{ {
//init visibility for continents // init visibility for continents
m_VisibleDistance = World::GetMaxVisibleDistanceOnContinents(); m_VisibleDistance = World::GetMaxVisibleDistanceOnContinents();
} }
@ -215,7 +215,7 @@ Map::EnsureGridCreated(const GridPair& p)
getNGrid(p.x_coord, p.y_coord)->SetGridState(GRID_STATE_IDLE); getNGrid(p.x_coord, p.y_coord)->SetGridState(GRID_STATE_IDLE);
//z coord // z coord
int gx = (MAX_NUMBER_OF_GRIDS - 1) - p.x_coord; int gx = (MAX_NUMBER_OF_GRIDS - 1) - p.x_coord;
int gy = (MAX_NUMBER_OF_GRIDS - 1) - p.y_coord; int gy = (MAX_NUMBER_OF_GRIDS - 1) - p.y_coord;
@ -260,11 +260,11 @@ bool Map::EnsureGridLoaded(const Cell& cell)
MANGOS_ASSERT(grid != NULL); MANGOS_ASSERT(grid != NULL);
if (!isGridObjectDataLoaded(cell.GridX(), cell.GridY())) if (!isGridObjectDataLoaded(cell.GridX(), cell.GridY()))
{ {
//it's important to set it loaded before loading! // it's important to set it loaded before loading!
//otherwise there is a possibility of infinity chain (grid loading will be called many times for the same grid) // otherwise there is a possibility of infinity chain (grid loading will be called many times for the same grid)
//possible scenario: // possible scenario:
//active object A(loaded with loader.LoadN call and added to the map) // active object A(loaded with loader.LoadN call and added to the map)
//summons some active object B, while B added to map grid loading called again and so on.. // summons some active object B, while B added to map grid loading called again and so on..
setGridObjectDataLoaded(true, cell.GridX(), cell.GridY()); setGridObjectDataLoaded(true, cell.GridX(), cell.GridY());
ObjectGridLoader loader(*grid, this, cell); ObjectGridLoader loader(*grid, this, cell);
loader.LoadN(); loader.LoadN();
@ -382,8 +382,8 @@ void Map::MessageBroadcast(WorldObject* obj, WorldPacket* msg)
if (!loaded(GridPair(cell.data.Part.grid_x, cell.data.Part.grid_y))) if (!loaded(GridPair(cell.data.Part.grid_x, cell.data.Part.grid_y)))
return; return;
//TODO: currently on continents when Visibility.Distance.InFlight > Visibility.Distance.Continents // TODO: currently on continents when Visibility.Distance.InFlight > Visibility.Distance.Continents
//we have alot of blinking mobs because monster move packet send is broken... // we have alot of blinking mobs because monster move packet send is broken...
MaNGOS::ObjectMessageDeliverer post_man(*obj, msg); MaNGOS::ObjectMessageDeliverer post_man(*obj, msg);
TypeContainerVisitor<MaNGOS::ObjectMessageDeliverer, WorldTypeMapContainer > message(post_man); TypeContainerVisitor<MaNGOS::ObjectMessageDeliverer, WorldTypeMapContainer > message(post_man);
cell.Visit(p, message, *this, *obj, GetVisibilityDistance()); cell.Visit(p, message, *this, *obj, GetVisibilityDistance());
@ -480,7 +480,7 @@ void Map::Update(const uint32& t_diff)
if (!plr->IsInWorld() || !plr->IsPositionValid()) if (!plr->IsInWorld() || !plr->IsPositionValid())
continue; continue;
//lets update mobs/objects in ALL visible cells around player! // lets update mobs/objects in ALL visible cells around player!
CellArea area = Cell::CalculateCellArea(plr->GetPositionX(), plr->GetPositionY(), GetVisibilityDistance()); CellArea area = Cell::CalculateCellArea(plr->GetPositionX(), plr->GetPositionY(), GetVisibilityDistance());
for (uint32 x = area.low_bound.x_coord; x <= area.high_bound.x_coord; ++x) for (uint32 x = area.low_bound.x_coord; x <= area.high_bound.x_coord; ++x)
@ -518,7 +518,7 @@ void Map::Update(const uint32& t_diff)
if (!obj->IsInWorld() || !obj->IsPositionValid()) if (!obj->IsInWorld() || !obj->IsPositionValid())
continue; continue;
//lets update mobs/objects in ALL visible cells around player! // lets update mobs/objects in ALL visible cells around player!
CellArea area = Cell::CalculateCellArea(obj->GetPositionX(), obj->GetPositionY(), GetVisibilityDistance()); CellArea area = Cell::CalculateCellArea(obj->GetPositionX(), obj->GetPositionY(), GetVisibilityDistance());
for (uint32 x = area.low_bound.x_coord; x <= area.high_bound.x_coord; ++x) for (uint32 x = area.low_bound.x_coord; x <= area.high_bound.x_coord; ++x)
@ -985,7 +985,7 @@ void Map::AddObjectToRemoveList(WorldObject* obj)
obj->CleanupsBeforeDelete(); // remove or simplify at least cross referenced links obj->CleanupsBeforeDelete(); // remove or simplify at least cross referenced links
i_objectsToRemove.insert(obj); i_objectsToRemove.insert(obj);
//DEBUG_LOG("Object (GUID: %u TypeId: %u ) added to removing list.",obj->GetGUIDLow(),obj->GetTypeId()); // DEBUG_LOG("Object (GUID: %u TypeId: %u ) added to removing list.",obj->GetGUIDLow(),obj->GetTypeId());
} }
void Map::RemoveAllObjectsInRemoveList() void Map::RemoveAllObjectsInRemoveList()
@ -993,7 +993,7 @@ void Map::RemoveAllObjectsInRemoveList()
if (i_objectsToRemove.empty()) if (i_objectsToRemove.empty())
return; return;
//DEBUG_LOG("Object remover 1 check."); // DEBUG_LOG("Object remover 1 check.");
while (!i_objectsToRemove.empty()) while (!i_objectsToRemove.empty())
{ {
WorldObject* obj = *i_objectsToRemove.begin(); WorldObject* obj = *i_objectsToRemove.begin();
@ -1025,7 +1025,7 @@ void Map::RemoveAllObjectsInRemoveList()
break; break;
} }
} }
//DEBUG_LOG("Object remover 2 check."); // DEBUG_LOG("Object remover 2 check.");
} }
uint32 Map::GetPlayersCountExceptGMs() const uint32 Map::GetPlayersCountExceptGMs() const
@ -1051,7 +1051,7 @@ bool Map::ActiveObjectsNearGrid(uint32 x, uint32 y) const
CellPair cell_min(x * MAX_NUMBER_OF_CELLS, y * MAX_NUMBER_OF_CELLS); CellPair cell_min(x * MAX_NUMBER_OF_CELLS, y * MAX_NUMBER_OF_CELLS);
CellPair cell_max(cell_min.x_coord + MAX_NUMBER_OF_CELLS, cell_min.y_coord + MAX_NUMBER_OF_CELLS); CellPair cell_max(cell_min.x_coord + MAX_NUMBER_OF_CELLS, cell_min.y_coord + MAX_NUMBER_OF_CELLS);
//we must find visible range in cells so we unload only non-visible cells... // we must find visible range in cells so we unload only non-visible cells...
float viewDist = GetVisibilityDistance(); float viewDist = GetVisibilityDistance();
int cell_range = (int)ceilf(viewDist / SIZE_OF_GRID_CELL) + 1; int cell_range = (int)ceilf(viewDist / SIZE_OF_GRID_CELL) + 1;
@ -1229,7 +1229,7 @@ DungeonMap::DungeonMap(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnM
{ {
MANGOS_ASSERT(i_mapEntry->IsDungeon()); MANGOS_ASSERT(i_mapEntry->IsDungeon());
//lets initialize visibility distance for dungeons // lets initialize visibility distance for dungeons
DungeonMap::InitVisibilityDistance(); DungeonMap::InitVisibilityDistance();
// the timer is started by default, and stopped when the first player joins // the timer is started by default, and stopped when the first player joins
@ -1243,7 +1243,7 @@ DungeonMap::~DungeonMap()
void DungeonMap::InitVisibilityDistance() void DungeonMap::InitVisibilityDistance()
{ {
//init visibility distance for instances // init visibility distance for instances
m_VisibleDistance = World::GetMaxVisibleDistanceInInstances(); m_VisibleDistance = World::GetMaxVisibleDistanceInInstances();
} }
@ -1404,7 +1404,7 @@ void DungeonMap::Remove(Player* player, bool remove)
{ {
DETAIL_LOG("MAP: Removing player '%s' from instance '%u' of map '%s' before relocating to other map", player->GetName(), GetInstanceId(), GetMapName()); DETAIL_LOG("MAP: Removing player '%s' from instance '%u' of map '%s' before relocating to other map", player->GetName(), GetInstanceId(), GetMapName());
//if last player set unload timer // if last player set unload timer
if (!m_unloadTimer && m_mapRefManager.getSize() == 1) if (!m_unloadTimer && m_mapRefManager.getSize() == 1)
m_unloadTimer = m_unloadWhenEmpty ? MIN_UNLOAD_DELAY : std::max(sWorld.getConfig(CONFIG_UINT32_INSTANCE_UNLOAD_DELAY), (uint32)MIN_UNLOAD_DELAY); m_unloadTimer = m_unloadWhenEmpty ? MIN_UNLOAD_DELAY : std::max(sWorld.getConfig(CONFIG_UINT32_INSTANCE_UNLOAD_DELAY), (uint32)MIN_UNLOAD_DELAY);
@ -1523,7 +1523,7 @@ DungeonPersistentState* DungeonMap::GetPersistanceState() const
BattleGroundMap::BattleGroundMap(uint32 id, time_t expiry, uint32 InstanceId, uint8 spawnMode) BattleGroundMap::BattleGroundMap(uint32 id, time_t expiry, uint32 InstanceId, uint8 spawnMode)
: Map(id, expiry, InstanceId, spawnMode) : Map(id, expiry, InstanceId, spawnMode)
{ {
//lets initialize visibility distance for BG/Arenas // lets initialize visibility distance for BG/Arenas
BattleGroundMap::InitVisibilityDistance(); BattleGroundMap::InitVisibilityDistance();
} }
@ -1546,7 +1546,7 @@ BattleGroundPersistentState* BattleGroundMap::GetPersistanceState() const
void BattleGroundMap::InitVisibilityDistance() void BattleGroundMap::InitVisibilityDistance()
{ {
//init visibility distance for BG/Arenas // init visibility distance for BG/Arenas
m_VisibleDistance = World::GetMaxVisibleDistanceInBGArenas(); m_VisibleDistance = World::GetMaxVisibleDistanceInBGArenas();
} }

View file

@ -127,7 +127,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>
void MessageDistBroadcast(WorldObject*, WorldPacket*, float dist); void MessageDistBroadcast(WorldObject*, WorldPacket*, float dist);
float GetVisibilityDistance() const { return m_VisibleDistance; } float GetVisibilityDistance() const { return m_VisibleDistance; }
//function for setting up visibility distance for maps on per-type/per-Id basis // function for setting up visibility distance for maps on per-type/per-Id basis
virtual void InitVisibilityDistance(); virtual void InitVisibilityDistance();
void PlayerRelocation(Player*, float x, float y, float z, float angl); void PlayerRelocation(Player*, float x, float y, float z, float angl);
@ -214,7 +214,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>
typedef MapRefManager PlayerList; typedef MapRefManager PlayerList;
PlayerList const& GetPlayers() const { return m_mapRefManager; } PlayerList const& GetPlayers() const { return m_mapRefManager; }
//per-map script storage // per-map script storage
bool ScriptsStart(ScriptMapMapName const& scripts, uint32 id, Object* source, Object* target); bool ScriptsStart(ScriptMapMapName const& scripts, uint32 id, Object* source, Object* target);
void ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* source, Object* target); void ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* source, Object* target);
@ -249,7 +249,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>
// DynObjects currently // DynObjects currently
uint32 GenerateLocalLowGuid(HighGuid guidhigh); uint32 GenerateLocalLowGuid(HighGuid guidhigh);
//get corresponding TerrainData object for this particular map // get corresponding TerrainData object for this particular map
const TerrainInfo* GetTerrain() const { return m_TerrainData; } const TerrainInfo* GetTerrain() const { return m_TerrainData; }
void CreateInstanceData(bool load); void CreateInstanceData(bool load);
@ -327,7 +327,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>
NGridType* i_grids[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS]; NGridType* i_grids[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS];
//Shared geodata object with map coord info... // Shared geodata object with map coord info...
TerrainInfo* const m_TerrainData; TerrainInfo* const m_TerrainData;
bool m_bLoadedGrids[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS]; bool m_bLoadedGrids[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS];

View file

@ -89,7 +89,7 @@ void MapManager::InitializeVisibilityDistanceInfo()
Map* MapManager::CreateMap(uint32 id, const WorldObject* obj) Map* MapManager::CreateMap(uint32 id, const WorldObject* obj)
{ {
MANGOS_ASSERT(obj); MANGOS_ASSERT(obj);
//if(!obj->IsInWorld()) sLog.outError("GetMap: called for map %d with object (typeid %d, guid %d, mapid %d, instanceid %d) who is not in world!", id, obj->GetTypeId(), obj->GetGUIDLow(), obj->GetMapId(), obj->GetInstanceId()); // if(!obj->IsInWorld()) sLog.outError("GetMap: called for map %d with object (typeid %d, guid %d, mapid %d, instanceid %d) who is not in world!", id, obj->GetTypeId(), obj->GetGUIDLow(), obj->GetMapId(), obj->GetInstanceId());
Guard _guard(*this); Guard _guard(*this);
Map* m = NULL; Map* m = NULL;
@ -101,18 +101,18 @@ Map* MapManager::CreateMap(uint32 id, const WorldObject* obj)
if (entry->Instanceable()) if (entry->Instanceable())
{ {
MANGOS_ASSERT(obj->GetTypeId() == TYPEID_PLAYER); MANGOS_ASSERT(obj->GetTypeId() == TYPEID_PLAYER);
//create DungeonMap object // create DungeonMap object
if (obj->GetTypeId() == TYPEID_PLAYER) if (obj->GetTypeId() == TYPEID_PLAYER)
m = CreateInstance(id, (Player*)obj); m = CreateInstance(id, (Player*)obj);
} }
else else
{ {
//create regular non-instanceable map // create regular non-instanceable map
m = FindMap(id); m = FindMap(id);
if (m == NULL) if (m == NULL)
{ {
m = new WorldMap(id, i_gridCleanUpDelay); m = new WorldMap(id, i_gridCleanUpDelay);
//add map into container // add map into container
i_maps[MapID(id)] = m; i_maps[MapID(id)] = m;
// non-instanceable maps always expected have saved state // non-instanceable maps always expected have saved state
@ -139,7 +139,7 @@ Map* MapManager::FindMap(uint32 mapid, uint32 instanceId) const
if (iter == i_maps.end()) if (iter == i_maps.end())
return NULL; return NULL;
//this is a small workaround for transports // this is a small workaround for transports
if (instanceId == 0 && iter->second->Instanceable()) if (instanceId == 0 && iter->second->Instanceable())
{ {
assert(false); assert(false);
@ -181,13 +181,13 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player)
} }
} }
//The player has a heroic mode and tries to enter into instance which has no a heroic mode // The player has a heroic mode and tries to enter into instance which has no a heroic mode
MapDifficulty const* mapDiff = GetMapDifficultyData(entry->MapID, player->GetDifficulty(entry->map_type == MAP_RAID)); MapDifficulty const* mapDiff = GetMapDifficultyData(entry->MapID, player->GetDifficulty(entry->map_type == MAP_RAID));
if (!mapDiff) if (!mapDiff)
{ {
bool isRegularTargetMap = player->GetDifficulty(entry->IsRaid()) == REGULAR_DIFFICULTY; bool isRegularTargetMap = player->GetDifficulty(entry->IsRaid()) == REGULAR_DIFFICULTY;
//Send aborted message // Send aborted message
// FIX ME: what about absent normal/heroic mode with specific players limit... // FIX ME: what about absent normal/heroic mode with specific players limit...
player->SendTransferAborted(mapid, TRANSFER_ABORT_DIFFICULTY, isRegularTargetMap ? DUNGEON_DIFFICULTY_NORMAL : DUNGEON_DIFFICULTY_HEROIC); player->SendTransferAborted(mapid, TRANSFER_ABORT_DIFFICULTY, isRegularTargetMap ? DUNGEON_DIFFICULTY_NORMAL : DUNGEON_DIFFICULTY_HEROIC);
return false; return false;
@ -239,12 +239,12 @@ MapManager::Update(uint32 diff)
helper.Update((uint32)i_timer.GetCurrent()); helper.Update((uint32)i_timer.GetCurrent());
} }
//remove all maps which can be unloaded // remove all maps which can be unloaded
MapMapType::iterator iter = i_maps.begin(); MapMapType::iterator iter = i_maps.begin();
while (iter != i_maps.end()) while (iter != i_maps.end())
{ {
Map* pMap = iter->second; Map* pMap = iter->second;
//check if map can be unloaded // check if map can be unloaded
if (pMap->CanUnload((uint32)i_timer.GetCurrent())) if (pMap->CanUnload((uint32)i_timer.GetCurrent()))
{ {
pMap->UnloadAll(true); pMap->UnloadAll(true);
@ -356,7 +356,7 @@ Map* MapManager::CreateInstance(uint32 id, Player* player)
pNewMap = CreateDungeonMap(id, NewInstanceId, diff); pNewMap = CreateDungeonMap(id, NewInstanceId, diff);
} }
//add a new map object into the registry // add a new map object into the registry
if (pNewMap) if (pNewMap)
{ {
i_maps[MapID(id, NewInstanceId)] = pNewMap; i_maps[MapID(id, NewInstanceId)] = pNewMap;
@ -408,7 +408,7 @@ BattleGroundMap* MapManager::CreateBattleGroundMap(uint32 id, uint32 InstanceId,
map->SetBG(bg); map->SetBG(bg);
bg->SetBgMap(map); bg->SetBgMap(map);
//add map into map container // add map into map container
i_maps[MapID(id, InstanceId)] = map; i_maps[MapID(id, InstanceId)] = map;
// BGs/Arenas not have saved instance data // BGs/Arenas not have saved instance data

View file

@ -88,7 +88,7 @@ class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton<MapManager, MaNGOS::
i_timer.Reset(); i_timer.Reset();
} }
//void LoadGrid(int mapid, int instId, float x, float y, const WorldObject* obj, bool no_unload = false); // void LoadGrid(int mapid, int instId, float x, float y, const WorldObject* obj, bool no_unload = false);
void UnloadAll(); void UnloadAll();
static bool ExistMapAndVMap(uint32 mapid, float x, float y); static bool ExistMapAndVMap(uint32 mapid, float x, float y);
@ -147,7 +147,7 @@ class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton<MapManager, MaNGOS::
uint32 GetNumPlayersInInstances(); uint32 GetNumPlayersInInstances();
//get list of all maps // get list of all maps
const MapMapType& Maps() const { return i_maps; } const MapMapType& Maps() const { return i_maps; }
template<typename Do> template<typename Do>

View file

@ -753,7 +753,7 @@ void MapPersistentStateManager::CleanupInstances()
// clean unused respawn data // clean unused respawn data
CharacterDatabase.Execute("DELETE FROM creature_respawn WHERE instance <> 0 AND instance NOT IN (SELECT id FROM instance)"); CharacterDatabase.Execute("DELETE FROM creature_respawn WHERE instance <> 0 AND instance NOT IN (SELECT id FROM instance)");
CharacterDatabase.Execute("DELETE FROM gameobject_respawn WHERE instance <> 0 AND instance NOT IN (SELECT id FROM instance)"); CharacterDatabase.Execute("DELETE FROM gameobject_respawn WHERE instance <> 0 AND instance NOT IN (SELECT id FROM instance)");
//execute transaction directly // execute transaction directly
CharacterDatabase.CommitTransaction(); CharacterDatabase.CommitTransaction();
bar.step(); bar.step();
@ -801,7 +801,7 @@ void MapPersistentStateManager::PackInstances()
CharacterDatabase.PExecute("UPDATE character_instance SET instance = '%u' WHERE instance = '%u'", InstanceNumber, *i); CharacterDatabase.PExecute("UPDATE character_instance SET instance = '%u' WHERE instance = '%u'", InstanceNumber, *i);
CharacterDatabase.PExecute("UPDATE instance SET id = '%u' WHERE id = '%u'", InstanceNumber, *i); CharacterDatabase.PExecute("UPDATE instance SET id = '%u' WHERE id = '%u'", InstanceNumber, *i);
CharacterDatabase.PExecute("UPDATE group_instance SET instance = '%u' WHERE instance = '%u'", InstanceNumber, *i); CharacterDatabase.PExecute("UPDATE group_instance SET instance = '%u' WHERE instance = '%u'", InstanceNumber, *i);
//execute transaction synchronously // execute transaction synchronously
CharacterDatabase.CommitTransaction(); CharacterDatabase.CommitTransaction();
} }

View file

@ -62,7 +62,7 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket& recv_data)
GetPlayer()->KillPlayer(); GetPlayer()->KillPlayer();
} }
//this is spirit release confirm? // this is spirit release confirm?
GetPlayer()->RemovePet(PET_SAVE_REAGENTS); GetPlayer()->RemovePet(PET_SAVE_REAGENTS);
GetPlayer()->BuildPlayerRepop(); GetPlayer()->BuildPlayerRepop();
GetPlayer()->RepopAtGraveyard(); GetPlayer()->RepopAtGraveyard();
@ -71,7 +71,7 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket& recv_data)
void WorldSession::HandleWhoOpcode(WorldPacket& recv_data) void WorldSession::HandleWhoOpcode(WorldPacket& recv_data)
{ {
DEBUG_LOG("WORLD: Recvd CMSG_WHO Message"); DEBUG_LOG("WORLD: Recvd CMSG_WHO Message");
//recv_data.hexlike(); // recv_data.hexlike();
uint32 clientcount = 0; uint32 clientcount = 0;
@ -267,7 +267,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket& /*recv_data*/)
if (ObjectGuid lootGuid = GetPlayer()->GetLootGuid()) if (ObjectGuid lootGuid = GetPlayer()->GetLootGuid())
DoLootRelease(lootGuid); DoLootRelease(lootGuid);
//Can not logout if... // Can not logout if...
if (GetPlayer()->isInCombat() || //...is in combat if (GetPlayer()->isInCombat() || //...is in combat
GetPlayer()->duel || //...is in Duel GetPlayer()->duel || //...is in Duel
//...is jumping ...is falling //...is jumping ...is falling
@ -281,7 +281,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket& /*recv_data*/)
return; return;
} }
//instant logout in taverns/cities or on taxi or for admins, gm's, mod's if its enabled in mangosd.conf // instant logout in taverns/cities or on taxi or for admins, gm's, mod's if its enabled in mangosd.conf
if (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->IsTaxiFlying() || if (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->IsTaxiFlying() ||
GetSecurity() >= (AccountTypes)sWorld.getConfig(CONFIG_UINT32_INSTANT_LOGOUT)) GetSecurity() >= (AccountTypes)sWorld.getConfig(CONFIG_UINT32_INSTANT_LOGOUT))
{ {
@ -1195,7 +1195,7 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data)
recv_data >> PositionZ; recv_data >> PositionZ;
recv_data >> Orientation; // o (3.141593 = 180 degrees) recv_data >> Orientation; // o (3.141593 = 180 degrees)
//DEBUG_LOG("Received opcode CMSG_WORLD_TELEPORT"); // DEBUG_LOG("Received opcode CMSG_WORLD_TELEPORT");
if (GetPlayer()->IsTaxiFlying()) if (GetPlayer()->IsTaxiFlying())
{ {
@ -1327,13 +1327,13 @@ void WorldSession::HandleRealmSplitOpcode(WorldPacket& recv_data)
// 0x2 realm split pending // 0x2 realm split pending
data << split_date; data << split_date;
SendPacket(&data); SendPacket(&data);
//DEBUG_LOG("response sent %u", unk); // DEBUG_LOG("response sent %u", unk);
} }
void WorldSession::HandleFarSightOpcode(WorldPacket& recv_data) void WorldSession::HandleFarSightOpcode(WorldPacket& recv_data)
{ {
DEBUG_LOG("WORLD: CMSG_FAR_SIGHT"); DEBUG_LOG("WORLD: CMSG_FAR_SIGHT");
//recv_data.hexlike(); // recv_data.hexlike();
uint8 op; uint8 op;
recv_data >> op; recv_data >> op;
@ -1499,7 +1499,7 @@ void WorldSession::HandleCancelMountAuraOpcode(WorldPacket& /*recv_data*/)
{ {
DEBUG_LOG("WORLD: CMSG_CANCEL_MOUNT_AURA"); DEBUG_LOG("WORLD: CMSG_CANCEL_MOUNT_AURA");
//If player is not mounted, so go out :) // If player is not mounted, so go out :)
if (!_player->IsMounted()) // not blizz like; no any messages on blizz if (!_player->IsMounted()) // not blizz like; no any messages on blizz
{ {
ChatHandler(this).SendSysMessage(LANG_CHAR_NON_MOUNTED); ChatHandler(this).SendSysMessage(LANG_CHAR_NON_MOUNTED);
@ -1520,7 +1520,7 @@ void WorldSession::HandleMoveSetCanFlyAckOpcode(WorldPacket& recv_data)
{ {
// fly mode on/off // fly mode on/off
DEBUG_LOG("WORLD: CMSG_MOVE_SET_CAN_FLY_ACK"); DEBUG_LOG("WORLD: CMSG_MOVE_SET_CAN_FLY_ACK");
//recv_data.hexlike(); // recv_data.hexlike();
ObjectGuid guid; ObjectGuid guid;
MovementInfo movementInfo; MovementInfo movementInfo;

View file

@ -68,32 +68,32 @@ class MANGOS_DLL_SPEC MovementGeneratorMedium : public MovementGenerator
public: public:
void Initialize(Unit& u) void Initialize(Unit& u)
{ {
//u->AssertIsType<T>(); // u->AssertIsType<T>();
(static_cast<D*>(this))->Initialize(*((T*)&u)); (static_cast<D*>(this))->Initialize(*((T*)&u));
} }
void Finalize(Unit& u) void Finalize(Unit& u)
{ {
//u->AssertIsType<T>(); // u->AssertIsType<T>();
(static_cast<D*>(this))->Finalize(*((T*)&u)); (static_cast<D*>(this))->Finalize(*((T*)&u));
} }
void Interrupt(Unit& u) void Interrupt(Unit& u)
{ {
//u->AssertIsType<T>(); // u->AssertIsType<T>();
(static_cast<D*>(this))->Interrupt(*((T*)&u)); (static_cast<D*>(this))->Interrupt(*((T*)&u));
} }
void Reset(Unit& u) void Reset(Unit& u)
{ {
//u->AssertIsType<T>(); // u->AssertIsType<T>();
(static_cast<D*>(this))->Reset(*((T*)&u)); (static_cast<D*>(this))->Reset(*((T*)&u));
} }
bool Update(Unit& u, const uint32& time_diff) bool Update(Unit& u, const uint32& time_diff)
{ {
//u->AssertIsType<T>(); // u->AssertIsType<T>();
return (static_cast<D*>(this))->Update(*((T*)&u), time_diff); return (static_cast<D*>(this))->Update(*((T*)&u), time_diff);
} }
bool GetResetPosition(Unit& u, float& x, float& y, float& z) bool GetResetPosition(Unit& u, float& x, float& y, float& z)
{ {
//u->AssertIsType<T>(); // u->AssertIsType<T>();
return (static_cast<D*>(this))->GetResetPosition(*((T*)&u), x, y, z); return (static_cast<D*>(this))->GetResetPosition(*((T*)&u), x, y, z);
} }
public: public:

View file

@ -196,7 +196,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
// resummon pet // resummon pet
GetPlayer()->ResummonPetTemporaryUnSummonedIfAny(); GetPlayer()->ResummonPetTemporaryUnSummonedIfAny();
//lets process all delayed operations on successful teleport // lets process all delayed operations on successful teleport
GetPlayer()->ProcessDelayedOperations(); GetPlayer()->ProcessDelayedOperations();
} }
@ -245,7 +245,7 @@ void WorldSession::HandleMoveTeleportAckOpcode(WorldPacket& recv_data)
// resummon pet // resummon pet
GetPlayer()->ResummonPetTemporaryUnSummonedIfAny(); GetPlayer()->ResummonPetTemporaryUnSummonedIfAny();
//lets process all delayed operations on successful teleport // lets process all delayed operations on successful teleport
GetPlayer()->ProcessDelayedOperations(); GetPlayer()->ProcessDelayedOperations();
} }
@ -424,7 +424,7 @@ void WorldSession::HandleDismissControlledVehicle(WorldPacket& recv_data)
void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recvdata*/) void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recvdata*/)
{ {
//DEBUG_LOG("WORLD: Recvd CMSG_MOUNTSPECIAL_ANIM"); // DEBUG_LOG("WORLD: Recvd CMSG_MOUNTSPECIAL_ANIM");
WorldPacket data(SMSG_MOUNTSPECIAL_ANIM, 8); WorldPacket data(SMSG_MOUNTSPECIAL_ANIM, 8);
data << GetPlayer()->GetObjectGuid(); data << GetPlayer()->GetObjectGuid();

Some files were not shown because too many files have changed in this diff Show more