Merge branch 'master' of git@github.com:mangos/mangos into procflag

This commit is contained in:
DiSlord 2008-12-27 18:29:03 +03:00
commit 30908fb5ff
31 changed files with 305 additions and 276 deletions

17
dep/ACE_wrappers/m4/.gitignore vendored Normal file
View file

@ -0,0 +1,17 @@
#
# NOTE! Don't add files that are generated in specific
# subdirectories here. Add them in the ".gitignore" file
# in that subdirectory instead.
#
# NOTE! Please use 'git-ls-files -i --exclude-standard'
# command after changing this file, to see if there are
# any tracked files which get ignored after the change.
#
# MaNGOS generated files
#
libtool.m4
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4

View file

@ -22,7 +22,7 @@
DROP TABLE IF EXISTS `db_version`; DROP TABLE IF EXISTS `db_version`;
CREATE TABLE `db_version` ( CREATE TABLE `db_version` (
`version` varchar(120) default NULL, `version` varchar(120) default NULL,
`required_6941_01_mangos_spell_learn_spell` bit(1) default NULL `required_6944_01_mangos_mangos_string` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
-- --
@ -2721,11 +2721,31 @@ INSERT INTO `mangos_string` VALUES
(709,'Do not Disturb',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (709,'Do not Disturb',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(710,'Away from Keyboard',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (710,'Away from Keyboard',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(711,'Queue status for %s (Lvl: %u to %u)\nQueued alliances: %u (Need at least %u more)\nQueued hordes: %u (Need at least %u more)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (711,'Queue status for %s (Lvl: %u to %u)\nQueued alliances: %u (Need at least %u more)\nQueued hordes: %u (Need at least %u more)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(712,'|cffff0000[BG Queue Announcer]:|r %s -- [%u-%u] A: %u (Need: %u), H: %u (Needs %u)|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (712,'|cffff0000[BG Queue Announcer]:|r %s -- [%u-%u] A: %u/%u, H: %u/%u|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(713,'You must be level %u to join an arena team!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (713,'You must be level %u to join an arena team!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(714,'%s is not high enough level to join your team',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (714,'%s is not high enough level to join your team',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(715,'You don\'t meet Battleground level requirements',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (715,'You don\'t meet Battleground level requirements',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(716,'Your arena team is full, %s cannot join it.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (716,'Your arena team is full, %s cannot join it.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(717,'|cffff0000[BG Queue Announcer]:|r %s -- [%u-%u] Started!|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(718,'|cffff0000[Arena Queue Announcer]:|r %s -- Joined : %ux%u : %u|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(719,'|cffff0000[Arena Queue Announcer]:|r %s -- Exited : %ux%u : %u|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(720,'Your group is too large for this battleground. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(721,'Your group is too large for this arena. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(722,'Your group has members not in your arena team. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(723,'Your group does not have enough players to join this match.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(724,'The Gold Team wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(725,'The Green Team wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(726,'There aren\'t enough players in this battleground. It will end soon unless some more players join to balance the fight.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(727,'Your group has an offline member. Please remove him before joining.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(728,'Your group has players from the opposing faction. You can\'t join the battleground as a group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(729,'Your group has players from different battleground brakets. You can\'t join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(730,'Someone in your party is already in this battleground queue. (S)he must leave it before joining as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(731,'Someone in your party is Deserter. You can\'t join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(732,'Someone in your party is already in three battleground queues. You cannot join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(733,'You cannot teleport to a battleground or arena map.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(734,'You cannot summon players to a battleground or arena map.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(735,'You must be in GM mode to teleport to a player in a battleground.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(736,'You cannot teleport to a battleground from another battleground. Please leave the current battleground first.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(801,'You do not have enough gold',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (801,'You do not have enough gold',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(802,'You do not have enough free slots',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (802,'You do not have enough free slots',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(803,'Your partner does not have enough free bag slots',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (803,'Your partner does not have enough free bag slots',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
@ -2768,24 +2788,7 @@ INSERT INTO `mangos_string` VALUES
(1118,'%d - guild: %s (guid: %u) %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (1118,'%d - guild: %s (guid: %u) %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1119,'You must use male or female as gender.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (1119,'You must use male or female as gender.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1120,'You change gender of %s to %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (1120,'You change gender of %s to %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1121,'Your gender changed to %s by %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (1121,'Your gender changed to %s by %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
(1122,'Your group is too large for this battleground. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1123,'Your group is too large for this arena. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1124,'Your group has members not in your arena team. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1125,'Your group does not have enough players to join this match.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1126,'The Gold Team wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1127,'The Green Team wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1128,'There aren\'t enough players in this battleground. It will end soon unless some more players join to balance the fight.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1129,'Your group has an offline member. Please remove him before joining.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1130,'Your group has players from the opposing faction. You can\'t join the battleground as a group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1131,'Your group has players from different battleground brakets. You can\'t join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1132,'Someone in your party is already in this battleground queue. (S)he must leave it before joining as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1133,'Someone in your party is Deserter. You can\'t join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1134,'Someone in your party is already in three battleground queues. You cannot join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1135,'You cannot teleport to a battleground or arena map.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1136,'You cannot summon players to a battleground or arena map.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1137,'You must be in GM mode to teleport to a player in a battleground.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1138,'You cannot teleport to a battleground from another battleground. Please leave the current battleground first.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
/*!40000 ALTER TABLE `mangos_string` ENABLE KEYS */; /*!40000 ALTER TABLE `mangos_string` ENABLE KEYS */;
UNLOCK TABLES; UNLOCK TABLES;

View file

@ -0,0 +1,30 @@
ALTER TABLE db_version CHANGE COLUMN required_6941_01_mangos_spell_learn_spell required_6944_01_mangos_mangos_string bit;
DELETE FROM mangos_string WHERE entry in (712,717,718,719);
INSERT INTO mangos_string VALUES
(712,'|cffff0000[BG Queue Announcer]:|r %s -- [%u-%u] A: %u/%u, H: %u/%u|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(717,'|cffff0000[BG Queue Announcer]:|r %s -- [%u-%u] Started!|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(718,'|cffff0000[Arena Queue Announcer]:|r %s -- Joined : %ux%u : %u|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(719,'|cffff0000[Arena Queue Announcer]:|r %s -- Exited : %ux%u : %u|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
DELETE FROM mangos_string WHERE entry in (720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736);
INSERT INTO mangos_string VALUES
(720,'Your group is too large for this battleground. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(721,'Your group is too large for this arena. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(722,'Your group has members not in your arena team. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(723,'Your group does not have enough players to join this match.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(724,'The Gold Team wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(725,'The Green Team wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(726,'There aren\'t enough players in this battleground. It will end soon unless some more players join to balance the fight.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(727,'Your group has an offline member. Please remove him before joining.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(728,'Your group has players from the opposing faction. You can\'t join the battleground as a group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(729,'Your group has players from different battleground brakets. You can\'t join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(730,'Someone in your party is already in this battleground queue. (S)he must leave it before joining as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(731,'Someone in your party is Deserter. You can\'t join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(732,'Someone in your party is already in three battleground queues. You cannot join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(733,'You cannot teleport to a battleground or arena map.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(734,'You cannot summon players to a battleground or arena map.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(735,'You must be in GM mode to teleport to a player in a battleground.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(736,'You cannot teleport to a battleground from another battleground. Please leave the current battleground first.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
DELETE FROM mangos_string WHERE entry in (1122,1123,1124,1125,1126,1127,1128,1129,1130,1131,1132,1133,1134,1135,1136,1137,1138);

View file

@ -99,6 +99,7 @@ pkgdata_DATA = \
6939_01_mangos_quest_template.sql \ 6939_01_mangos_quest_template.sql \
6940_01_mangos_spell_learn_spell.sql \ 6940_01_mangos_spell_learn_spell.sql \
6941_01_mangos_spell_learn_spell.sql \ 6941_01_mangos_spell_learn_spell.sql \
6944_01_mangos_mangos_string.sql \
README README
## Additional files to include when running 'make dist' ## Additional files to include when running 'make dist'
@ -178,4 +179,5 @@ EXTRA_DIST = \
6939_01_mangos_quest_template.sql \ 6939_01_mangos_quest_template.sql \
6940_01_mangos_spell_learn_spell.sql \ 6940_01_mangos_spell_learn_spell.sql \
6941_01_mangos_spell_learn_spell.sql \ 6941_01_mangos_spell_learn_spell.sql \
6944_01_mangos_mangos_string.sql \
README README

View file

@ -178,6 +178,8 @@ void WorldSession::HandleBattleGroundJoinOpcode( WorldPacket & recv_data )
} }
sLog.outDebug("Battleground: group end"); sLog.outDebug("Battleground: group end");
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].Update(bgTypeId, _player->GetBattleGroundQueueIdFromLevel()); sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].Update(bgTypeId, _player->GetBattleGroundQueueIdFromLevel());
if(!ginfo->IsInvitedToBGInstanceGUID)
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AnnounceWorld(ginfo, _player->GetGUID(), true);
} }
else else
{ {
@ -194,6 +196,8 @@ void WorldSession::HandleBattleGroundJoinOpcode( WorldPacket & recv_data )
GroupQueueInfo * ginfo = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AddGroup(_player, bgTypeId, 0, false, 0); GroupQueueInfo * ginfo = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AddGroup(_player, bgTypeId, 0, false, 0);
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AddPlayer(_player, ginfo); sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AddPlayer(_player, ginfo);
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].Update(bgTypeId, _player->GetBattleGroundQueueIdFromLevel()); sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].Update(bgTypeId, _player->GetBattleGroundQueueIdFromLevel());
if(!ginfo->IsInvitedToBGInstanceGUID)
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AnnounceWorld(ginfo, _player->GetGUID(), true);
sLog.outDebug("Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,_player->GetGUIDLow(), _player->GetName()); sLog.outDebug("Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,_player->GetGUIDLow(), _player->GetName());
} }
} }
@ -782,6 +786,8 @@ void WorldSession::HandleBattleGroundArenaJoin( WorldPacket & recv_data )
} }
sLog.outDebug("Battleground: arena join as group end"); sLog.outDebug("Battleground: arena join as group end");
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].Update(bgTypeId, _player->GetBattleGroundQueueIdFromLevel(), arenatype, isRated, arenaRating); sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].Update(bgTypeId, _player->GetBattleGroundQueueIdFromLevel(), arenatype, isRated, arenaRating);
if(isRated)
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AnnounceWorld(ginfo, _player->GetGUID(), true);
} }
else else
{ {

View file

@ -241,38 +241,6 @@ void BattleGroundQueue::AddPlayer(Player *plr, GroupQueueInfo *ginfo)
// add the pinfo to ginfo's list // add the pinfo to ginfo's list
ginfo->Players[plr->GetGUID()] = &info; ginfo->Players[plr->GetGUID()] = &info;
/*
if( sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE) )
{
BattleGround* bg = sBattleGroundMgr.GetBattleGround(bgTypeId);
char const* bgName = bg->GetName();
uint32 q_min_level = Player::GetMinLevelForBattleGroundQueueId(queue_id);
uint32 q_max_level = Player::GetMaxLevelForBattleGroundQueueId(queue_id);
// replace hardcoded max level by player max level for nice output
if(q_max_level > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
q_max_level = sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL);
int8 MinPlayers = bg->GetMinPlayersPerTeam();
uint8 qHorde = m_QueuedPlayers[queue_id].Horde;
uint8 qAlliance = m_QueuedPlayers[queue_id].Alliance;
// Show queue status to player only (when joining queue)
if(sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY))
{
ChatHandler(plr).PSendSysMessage(LANG_BG_QUEUE_ANNOUNCE_SELF,
bgName, q_min_level, q_max_level, qAlliance, (MinPlayers > qAlliance) ? (MinPlayers - qAlliance) : 0, qHorde, (MinPlayers > qHorde) ? (MinPlayers - qHorde) : 0);
}
// System message
else
{
sWorld.SendWorldText(LANG_BG_QUEUE_ANNOUNCE_WORLD,
bgName, q_min_level, q_max_level, qAlliance, (MinPlayers > qAlliance) ? (MinPlayers - qAlliance) : 0, qHorde, (MinPlayers > qHorde) ? (MinPlayers - qHorde) : 0);
}
}*/
} }
void BattleGroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount) void BattleGroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount)
@ -358,6 +326,11 @@ void BattleGroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount)
// remove player queue info // remove player queue info
m_QueuedPlayers[queue_id].erase(itr); m_QueuedPlayers[queue_id].erase(itr);
// remove group queue info if needed // remove group queue info if needed
//if we left BG queue(not porting) OR if arena team left queue for rated match
if((decreaseInvitedCount && !group->ArenaType) || (group->ArenaType && group->IsRated && group->Players.empty()))
AnnounceWorld(group, guid, false);
if(group->Players.empty()) if(group->Players.empty())
{ {
m_QueuedGroups[queue_id].erase(group_itr); m_QueuedGroups[queue_id].erase(group_itr);
@ -386,6 +359,85 @@ void BattleGroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount)
} }
} }
void BattleGroundQueue::AnnounceWorld(GroupQueueInfo *ginfo, uint64 playerGUID, bool isAddedToQueue)
{
if(ginfo->ArenaType) //if Arena
{
if( sWorld.getConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE) && ginfo->IsRated)
{
BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(ginfo->BgTypeId);
if(!bg)
return;
char const* bgName = bg->GetName();
if(isAddedToQueue)
sWorld.SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, bgName, ginfo->ArenaType, ginfo->ArenaType, ginfo->ArenaTeamRating);
else
sWorld.SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, bgName, ginfo->ArenaType, ginfo->ArenaType, ginfo->ArenaTeamRating);
}
}
else //if BG
{
if( sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE) )
{
Player *plr = objmgr.GetPlayer(playerGUID);
if(!plr)
return;
BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(ginfo->BgTypeId);
if(!bg)
return;
uint32 queue_id = plr->GetBattleGroundQueueIdFromLevel();
char const* bgName = bg->GetName();
uint32 q_min_level = Player::GetMinLevelForBattleGroundQueueId(queue_id);
uint32 q_max_level = Player::GetMaxLevelForBattleGroundQueueId(queue_id);
// replace hardcoded max level by player max level for nice output
if(q_max_level > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
q_max_level = sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL);
int8 MinPlayers = bg->GetMinPlayersPerTeam();
uint8 qHorde = 0;
uint8 qAlliance = 0;
uint32 bgTypeId = ginfo->BgTypeId;
QueuedPlayersMap::iterator itr;
for(itr = m_QueuedPlayers[queue_id].begin(); itr!= m_QueuedPlayers[queue_id].end(); ++itr)
{
if(itr->second.GroupInfo->BgTypeId == bgTypeId)
{
switch(itr->second.GroupInfo->Team)
{
case HORDE:
qHorde++; break;
case ALLIANCE:
qAlliance++; break;
default:
break;
}
}
}
// Show queue status to player only (when joining queue)
if(sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY))
{
ChatHandler(plr).PSendSysMessage(LANG_BG_QUEUE_ANNOUNCE_SELF,
bgName, q_min_level, q_max_level, qAlliance, MinPlayers, qHorde, MinPlayers);
}
// System message
else
{
sWorld.SendWorldText(LANG_BG_QUEUE_ANNOUNCE_WORLD,
bgName, q_min_level, q_max_level, qAlliance, MinPlayers, qHorde, MinPlayers);
}
}
}
}
bool BattleGroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, BattleGround * bg, uint32 side) bool BattleGroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, BattleGround * bg, uint32 side)
{ {
// set side if needed // set side if needed
@ -713,6 +765,15 @@ void BattleGroundQueue::Update(uint32 bgTypeId, uint32 queue_id, uint8 arenatype
{ {
// create new battleground // create new battleground
bg2 = sBattleGroundMgr.CreateNewBattleGround(bgTypeId); bg2 = sBattleGroundMgr.CreateNewBattleGround(bgTypeId);
if( sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE) )
{
char const* bgName = bg2->GetName();
uint32 q_min_level = Player::GetMinLevelForBattleGroundQueueId(queue_id);
uint32 q_max_level = Player::GetMaxLevelForBattleGroundQueueId(queue_id);
if(q_max_level > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
q_max_level = sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL);
sWorld.SendWorldText(LANG_BG_STARTED_ANNOUNCE_WORLD, bgName, q_min_level, q_max_level);
}
} }
if(!bg2) if(!bg2)

View file

@ -75,6 +75,7 @@ class BattleGroundQueue
void RemovePlayer(uint64 guid, bool decreaseInvitedCount); void RemovePlayer(uint64 guid, bool decreaseInvitedCount);
void DecreaseGroupLength(uint32 queueId, uint32 AsGroup); void DecreaseGroupLength(uint32 queueId, uint32 AsGroup);
void BGEndedRemoveInvites(BattleGround * bg); void BGEndedRemoveInvites(BattleGround * bg);
void AnnounceWorld(GroupQueueInfo *ginfo, uint64 playerGUID, bool isAddedToQueue);
typedef std::map<uint64, PlayerQueueInfo> QueuedPlayersMap; typedef std::map<uint64, PlayerQueueInfo> QueuedPlayersMap;
QueuedPlayersMap m_QueuedPlayers[MAX_BATTLEGROUND_QUEUES]; QueuedPlayersMap m_QueuedPlayers[MAX_BATTLEGROUND_QUEUES];

View file

@ -154,6 +154,7 @@ void WorldSession::HandleGroupInviteOpcode( WorldPacket & recv_data )
// ok, we do it // ok, we do it
WorldPacket data(SMSG_GROUP_INVITE, 10); // guess size WorldPacket data(SMSG_GROUP_INVITE, 10); // guess size
data << uint8(1); // ok
data << GetPlayer()->GetName(); data << GetPlayer()->GetName();
player->GetSession()->SendPacket(&data); player->GetSession()->SendPacket(&data);

View file

@ -642,31 +642,33 @@ enum MangosStrings
LANG_BG_QUEUE_ANNOUNCE_SELF = 711, LANG_BG_QUEUE_ANNOUNCE_SELF = 711,
LANG_BG_QUEUE_ANNOUNCE_WORLD = 712, LANG_BG_QUEUE_ANNOUNCE_WORLD = 712,
LANG_YOUR_ARENA_LEVEL_REQ_ERROR = 713, LANG_YOUR_ARENA_LEVEL_REQ_ERROR = 713,
// LANG_HIS_ARENA_LEVEL_REQ_ERROR = 714, an opcode exists for this // = 714, not used
LANG_YOUR_BG_LEVEL_REQ_ERROR = 715, LANG_YOUR_BG_LEVEL_REQ_ERROR = 715,
// LANG_YOUR_ARENA_TEAM_FULL = 716, an opcode exists for this // = 716, not used
LANG_BG_STARTED_ANNOUNCE_WORLD = 717,
LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN= 718,
LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT= 719,
LANG_BG_GROUP_TOO_LARGE = 1122, // "Your group is too large for this battleground. Please regroup to join." LANG_BG_GROUP_TOO_LARGE = 720, // "Your group is too large for this battleground. Please regroup to join."
LANG_ARENA_GROUP_TOO_LARGE = 1123, // "Your group is too large for this arena. Please regroup to join." LANG_ARENA_GROUP_TOO_LARGE = 721, // "Your group is too large for this arena. Please regroup to join."
LANG_ARENA_YOUR_TEAM_ONLY = 1124, // "Your group has members not in your arena team. Please regroup to join." LANG_ARENA_YOUR_TEAM_ONLY = 722, // "Your group has members not in your arena team. Please regroup to join."
LANG_ARENA_NOT_ENOUGH_PLAYERS = 1125, // "Your group does not have enough players to join this match." LANG_ARENA_NOT_ENOUGH_PLAYERS = 723, // "Your group does not have enough players to join this match."
LANG_ARENA_GOLD_WINS = 1126, // "The Gold Team wins!" LANG_ARENA_GOLD_WINS = 724, // "The Gold Team wins!"
LANG_ARENA_GREEN_WINS = 1127, // "The Green Team wins!" LANG_ARENA_GREEN_WINS = 725, // "The Green Team wins!"
LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING = 1128, // The battleground will end soon, because there aren't enough players. Get more ppl or win already! LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING = 726, // The battleground will end soon, because there aren't enough players. Get more ppl or win already!
LANG_BG_GROUP_OFFLINE_MEMBER = 1129, // "Your group has an offline member. Please remove him before joining." LANG_BG_GROUP_OFFLINE_MEMBER = 727, // "Your group has an offline member. Please remove him before joining."
LANG_BG_GROUP_MIXED_FACTION = 1130, // "Your group has players from the opposing faction. You can't join the battleground as a group." LANG_BG_GROUP_MIXED_FACTION = 728, // "Your group has players from the opposing faction. You can't join the battleground as a group."
LANG_BG_GROUP_MIXED_LEVELS = 1131, // "Your group has players from different battleground brakets. You can't join as group." LANG_BG_GROUP_MIXED_LEVELS = 729, // "Your group has players from different battleground brakets. You can't join as group."
LANG_BG_GROUP_MEMBER_ALREADY_IN_QUEUE = 1132, // "Someone in your party is already in this battleground queue. (S)he must leave it before joining as group." LANG_BG_GROUP_MEMBER_ALREADY_IN_QUEUE = 730, // "Someone in your party is already in this battleground queue. (S)he must leave it before joining as group."
LANG_BG_GROUP_MEMBER_DESERTER = 1133, // "Someone in your party is Deserter. You can't join as group." LANG_BG_GROUP_MEMBER_DESERTER = 731, // "Someone in your party is Deserter. You can't join as group."
LANG_BG_GROUP_MEMBER_NO_FREE_QUEUE_SLOTS = 1134, // "Someone in your party is already in three battleground queues. You cannot join as group." LANG_BG_GROUP_MEMBER_NO_FREE_QUEUE_SLOTS = 732, // "Someone in your party is already in three battleground queues. You cannot join as group."
LANG_CANNOT_TELE_TO_BG = 1135, // "You cannot teleport to a battleground or arena map." LANG_CANNOT_TELE_TO_BG = 733, // "You cannot teleport to a battleground or arena map."
LANG_CANNOT_SUMMON_TO_BG = 1136, // "You cannot summon players to a battleground or arena map." LANG_CANNOT_SUMMON_TO_BG = 734, // "You cannot summon players to a battleground or arena map."
LANG_CANNOT_GO_TO_BG_GM = 1137, // "You must be in GM mode to teleport to a player in a battleground." LANG_CANNOT_GO_TO_BG_GM = 735, // "You must be in GM mode to teleport to a player in a battleground."
LANG_CANNOT_GO_TO_BG_FROM_BG = 1138, // "You cannot teleport to a battleground from another battleground. Please leave the current battleground first." LANG_CANNOT_GO_TO_BG_FROM_BG = 736, // "You cannot teleport to a battleground from another battleground. Please leave the current battleground first."
// Room for batleground/arena strings 737-799 not used
// in game strings // in game strings
// = 800, not used // = 800, not used

View file

@ -232,8 +232,6 @@ libmangosgame_a_SOURCES = \
TaxiHandler.cpp \ TaxiHandler.cpp \
TemporarySummon.cpp \ TemporarySummon.cpp \
TemporarySummon.h \ TemporarySummon.h \
tools.cpp \
Tools.h \
TotemAI.cpp \ TotemAI.cpp \
TotemAI.h \ TotemAI.h \
Totem.cpp \ Totem.cpp \

View file

@ -41,7 +41,6 @@
#include "SpellAuras.h" #include "SpellAuras.h"
#include "Pet.h" #include "Pet.h"
#include "SocialMgr.h" #include "SocialMgr.h"
#include "Tools.h"
void WorldSession::HandleRepopRequestOpcode( WorldPacket & /*recv_data*/ ) void WorldSession::HandleRepopRequestOpcode( WorldPacket & /*recv_data*/ )
{ {
@ -1649,7 +1648,7 @@ void WorldSession::HandleInspectAchievements( WorldPacket & recv_data )
{ {
CHECK_PACKET_SIZE(recv_data, 1); CHECK_PACKET_SIZE(recv_data, 1);
uint64 guid; uint64 guid;
if(!readGUID(recv_data, guid)) if(!recv_data.readPackGUID(guid))
return; return;
Player *player = objmgr.GetPlayer(guid); Player *player = objmgr.GetPlayer(guid);

View file

@ -1179,7 +1179,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] =
/*0x47E*/ { "CMSG_FORCE_SAY_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x47E*/ { "CMSG_FORCE_SAY_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
/*0x47F*/ { "SMSG_HEALTH_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x47F*/ { "SMSG_HEALTH_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
/*0x480*/ { "SMSG_POWER_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x480*/ { "SMSG_POWER_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
/*0x481*/ { "CMSG_GAMEOBJ_REPORT_USE", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x481*/ { "CMSG_GAMEOBJ_REPORT_USE", STATUS_LOGGEDIN, &WorldSession::HandleGameobjectReportUse },
/*0x482*/ { "SMSG_HIGHEST_THREAT_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x482*/ { "SMSG_HIGHEST_THREAT_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
/*0x483*/ { "SMSG_THREAT_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x483*/ { "SMSG_THREAT_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
/*0x484*/ { "SMSG_THREAT_REMOVE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x484*/ { "SMSG_THREAT_REMOVE", STATUS_NEVER, &WorldSession::Handle_ServerSide },

View file

@ -101,7 +101,7 @@ void Pet::RemoveFromWorld()
Unit::RemoveFromWorld(); Unit::RemoveFromWorld();
} }
bool Pet::LoadPetFromDB( Unit* owner, uint32 petentry, uint32 petnumber, bool current ) bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool current )
{ {
m_loading = true; m_loading = true;
@ -764,7 +764,6 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0); SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0); SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32((MaNGOS::XP::xp_to_level(creature->getLevel()))/4)); SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32((MaNGOS::XP::xp_to_level(creature->getLevel()))/4));
SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
SetUInt32Value(UNIT_NPC_FLAGS, 0); SetUInt32Value(UNIT_NPC_FLAGS, 0);
CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(creature->GetCreatureInfo()->family); CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(creature->GetCreatureInfo()->family);

View file

@ -133,7 +133,7 @@ class Pet : public Creature
bool Create (uint32 guidlow, Map *map, uint32 Entry, uint32 pet_number); bool Create (uint32 guidlow, Map *map, uint32 Entry, uint32 pet_number);
bool CreateBaseAtCreature(Creature* creature); bool CreateBaseAtCreature(Creature* creature);
bool LoadPetFromDB( Unit* owner,uint32 petentry = 0,uint32 petnumber = 0, bool current = false ); bool LoadPetFromDB( Player* owner,uint32 petentry = 0,uint32 petnumber = 0, bool current = false );
void SavePetToDB(PetSaveMode mode); void SavePetToDB(PetSaveMode mode);
void Remove(PetSaveMode mode, bool returnreagent = false); void Remove(PetSaveMode mode, bool returnreagent = false);
static void DeleteFromDB(uint32 guidlow); static void DeleteFromDB(uint32 guidlow);

View file

@ -41,7 +41,6 @@
#include "CellImpl.h" #include "CellImpl.h"
#include "Policies/SingletonImp.h" #include "Policies/SingletonImp.h"
#include "SharedDefines.h" #include "SharedDefines.h"
#include "Tools.h"
#include "LootMgr.h" #include "LootMgr.h"
#include "VMapFactory.h" #include "VMapFactory.h"
#include "BattleGround.h" #include "BattleGround.h"
@ -167,15 +166,15 @@ bool SpellCastTargets::read ( WorldPacket * data, Unit *caster )
// TARGET_FLAG_UNK2 is used for non-combat pets, maybe other? // TARGET_FLAG_UNK2 is used for non-combat pets, maybe other?
if( m_targetMask & ( TARGET_FLAG_UNIT | TARGET_FLAG_UNK2 )) if( m_targetMask & ( TARGET_FLAG_UNIT | TARGET_FLAG_UNK2 ))
if(!readGUID(*data, m_unitTargetGUID)) if(!data->readPackGUID(m_unitTargetGUID))
return false; return false;
if( m_targetMask & ( TARGET_FLAG_OBJECT | TARGET_FLAG_OBJECT_UNK )) if( m_targetMask & ( TARGET_FLAG_OBJECT | TARGET_FLAG_OBJECT_UNK ))
if(!readGUID(*data, m_GOTargetGUID)) if(!data->readPackGUID(m_GOTargetGUID))
return false; return false;
if(( m_targetMask & ( TARGET_FLAG_ITEM | TARGET_FLAG_TRADE_ITEM )) && caster->GetTypeId() == TYPEID_PLAYER) if(( m_targetMask & ( TARGET_FLAG_ITEM | TARGET_FLAG_TRADE_ITEM )) && caster->GetTypeId() == TYPEID_PLAYER)
if(!readGUID(*data, m_itemTargetGUID)) if(!data->readPackGUID(m_itemTargetGUID))
return false; return false;
if( m_targetMask & TARGET_FLAG_SOURCE_LOCATION ) if( m_targetMask & TARGET_FLAG_SOURCE_LOCATION )
@ -207,7 +206,7 @@ bool SpellCastTargets::read ( WorldPacket * data, Unit *caster )
} }
if( m_targetMask & (TARGET_FLAG_CORPSE | TARGET_FLAG_PVP_CORPSE ) ) if( m_targetMask & (TARGET_FLAG_CORPSE | TARGET_FLAG_PVP_CORPSE ) )
if(!readGUID(*data, m_CorpseTargetGUID)) if(!data->readPackGUID(m_CorpseTargetGUID))
return false; return false;
// find real units/GOs // find real units/GOs
@ -3702,10 +3701,14 @@ uint8 Spell::CanCast(bool strict)
//Must be behind the target. //Must be behind the target.
if( m_spellInfo->AttributesEx2 == 0x100000 && (m_spellInfo->AttributesEx & 0x200) == 0x200 && target->HasInArc(M_PI, m_caster) ) if( m_spellInfo->AttributesEx2 == 0x100000 && (m_spellInfo->AttributesEx & 0x200) == 0x200 && target->HasInArc(M_PI, m_caster) )
{
//Exclusion for Pounce: Facing Limitation was removed in 2.0.1, but it still uses the same, old Ex-Flags
if( m_spellInfo->SpellFamilyName != SPELLFAMILY_DRUID || m_spellInfo->SpellFamilyFlags != 0x0000000000020000LL )
{ {
SendInterrupted(2); SendInterrupted(2);
return SPELL_FAILED_NOT_BEHIND; return SPELL_FAILED_NOT_BEHIND;
} }
}
//Target must be facing you. //Target must be facing you.
if((m_spellInfo->Attributes == 0x150010) && !target->HasInArc(M_PI, m_caster) ) if((m_spellInfo->Attributes == 0x150010) && !target->HasInArc(M_PI, m_caster) )

View file

@ -2542,6 +2542,9 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
else else
modelid = 21244; modelid = 21244;
break; break;
case FORM_METAMORPHOSIS:
modelid = 25277;
break;
case FORM_AMBIENT: case FORM_AMBIENT:
case FORM_SHADOW: case FORM_SHADOW:
case FORM_STEALTH: case FORM_STEALTH:
@ -5305,6 +5308,10 @@ void Aura::HandleShapeshiftBoosts(bool apply)
spellId = 40122; spellId = 40122;
spellId2 = 40121; spellId2 = 40121;
break; break;
case FORM_METAMORPHOSIS:
spellId = 54817;
spellId2 = 54879;
break;
case FORM_SPIRITOFREDEMPTION: case FORM_SPIRITOFREDEMPTION:
spellId = 27792; spellId = 27792;
spellId2 = 27795; // must be second, this important at aura remove to prevent to early iterator invalidation. spellId2 = 27795; // must be second, this important at aura remove to prevent to early iterator invalidation.

View file

@ -3211,7 +3211,7 @@ void Spell::EffectSummon(uint32 i)
uint32 level = m_caster->getLevel(); uint32 level = m_caster->getLevel();
Pet* spawnCreature = new Pet(SUMMON_PET); Pet* spawnCreature = new Pet(SUMMON_PET);
if(spawnCreature->LoadPetFromDB(m_caster,pet_entry)) if(m_caster->GetTypeId()==TYPEID_PLAYER && spawnCreature->LoadPetFromDB((Player*)m_caster,pet_entry))
{ {
// set timer for unsummon // set timer for unsummon
int32 duration = GetSpellDuration(m_spellInfo); int32 duration = GetSpellDuration(m_spellInfo);
@ -4027,7 +4027,7 @@ void Spell::EffectSummonPet(uint32 i)
Pet* NewSummon = new Pet; Pet* NewSummon = new Pet;
// petentry==0 for hunter "call pet" (current pet summoned if any) // petentry==0 for hunter "call pet" (current pet summoned if any)
if(NewSummon->LoadPetFromDB(m_caster,petentry)) if(m_caster->GetTypeId() == TYPEID_PLAYER && NewSummon->LoadPetFromDB((Player*)m_caster,petentry))
{ {
if(NewSummon->getPetType()==SUMMON_PET) if(NewSummon->getPetType()==SUMMON_PET)
{ {
@ -4112,6 +4112,7 @@ void Spell::EffectSummonPet(uint32 i)
// this enables pet details window (Shift+P) // this enables pet details window (Shift+P)
// this enables popup window (pet dismiss, cancel), hunter pet additional flags set later // this enables popup window (pet dismiss, cancel), hunter pet additional flags set later
if(m_caster->GetTypeId() == TYPEID_PLAYER)
NewSummon->SetUInt32Value(UNIT_FIELD_FLAGS,UNIT_FLAG_PVP_ATTACKABLE); NewSummon->SetUInt32Value(UNIT_FIELD_FLAGS,UNIT_FLAG_PVP_ATTACKABLE);
NewSummon->InitStatsForLevel(petlevel); NewSummon->InitStatsForLevel(petlevel);
@ -5310,6 +5311,8 @@ void Spell::EffectSummonTotem(uint32 i)
} }
pTotem->SetUInt32Value(UNIT_CREATED_BY_SPELL,m_spellInfo->Id); pTotem->SetUInt32Value(UNIT_CREATED_BY_SPELL,m_spellInfo->Id);
if(m_caster->GetTypeId() == TYPEID_PLAYER)
pTotem->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_PVP_ATTACKABLE); pTotem->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_PVP_ATTACKABLE);
pTotem->ApplySpellImmune(m_spellInfo->Id,IMMUNITY_STATE,SPELL_AURA_MOD_FEAR,true); pTotem->ApplySpellImmune(m_spellInfo->Id,IMMUNITY_STATE,SPELL_AURA_MOD_FEAR,true);
@ -5854,6 +5857,9 @@ void Spell::EffectSendTaxi(uint32 i)
case 34905: //Stealth Flight case 34905: //Stealth Flight
mountid = 6851; mountid = 6851;
break; break;
case 53335: //Stormwind Harbor Flight - Peaceful
mountid = 6852;
break;
} }
((Player*)unitTarget)->ActivateTaxiPathTo(nodes,mountid); ((Player*)unitTarget)->ActivateTaxiPathTo(nodes,mountid);

View file

@ -282,6 +282,16 @@ void WorldSession::HandleGameObjectUseOpcode( WorldPacket & recv_data )
obj->Use(_player); obj->Use(_player);
} }
void WorldSession::HandleGameobjectReportUse(WorldPacket& recvPacket)
{
CHECK_PACKET_SIZE(recvPacket,8);
uint64 guid;
recvPacket >> guid;
sLog.outDebug( "WORLD: Recvd CMSG_GAMEOBJ_REPORT_USE Message [in game guid: %u]", GUID_LOPART(guid));
}
void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
{ {
CHECK_PACKET_SIZE(recvPacket,1+4+1); CHECK_PACKET_SIZE(recvPacket,1+4+1);

View file

@ -1815,7 +1815,13 @@ void SpellMgr::LoadSpellLearnSpells()
{ {
SpellLearnSpellNode dbc_node; SpellLearnSpellNode dbc_node;
dbc_node.spell = entry->EffectTriggerSpell[i]; dbc_node.spell = entry->EffectTriggerSpell[i];
dbc_node.autoLearned = true;
// ignore learning not existed spells (broken/outdated/or generic learnig spell 483
if(!sSpellStore.LookupEntry(dbc_node.spell))
continue;
// talent or passive spells or skill-step spells auto-casted, other required explicit dependent learning
dbc_node.autoLearned = GetTalentSpellCost(spell) > 0 || IsPassiveSpell(spell) || IsSpellHaveEffect(entry,SPELL_EFFECT_SKILL_STEP);
SpellLearnSpellMap::const_iterator db_node_begin = GetBeginSpellLearnSpell(spell); SpellLearnSpellMap::const_iterator db_node_begin = GetBeginSpellLearnSpell(spell);
SpellLearnSpellMap::const_iterator db_node_end = GetEndSpellLearnSpell(spell); SpellLearnSpellMap::const_iterator db_node_end = GetEndSpellLearnSpell(spell);

View file

@ -1,26 +0,0 @@
/*
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef MANGOS_TOOLS_H
#define MANGOS_TOOLS_H
#include "Common.h"
#include "WorldPacket.h"
bool readGUID(WorldPacket & data, uint64& guid);
void writeGUID(WorldPacket & data, uint64 & guid);
#endif

View file

@ -2051,15 +2051,18 @@ uint32 Unit::CalcArmorReducedDamage(Unit* pVictim, const uint32 damage)
// Ignore enemy armor by SPELL_AURA_MOD_TARGET_RESISTANCE aura // Ignore enemy armor by SPELL_AURA_MOD_TARGET_RESISTANCE aura
armor += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, SPELL_SCHOOL_MASK_NORMAL); armor += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, SPELL_SCHOOL_MASK_NORMAL);
// Apply Player CR_ARMOR_PENETRATION rating
if (GetTypeId()==TYPEID_PLAYER)
armor *= 1.0f - ((Player*)this)->GetRatingBonusValue(CR_ARMOR_PENETRATION) / 100.0f;
if (armor < 0.0f) armor=0.0f; if (armor < 0.0f) armor=0.0f;
float tmpvalue = 0.0f; float levelModifier = getLevel();
if(getLevel() <= 59) //Level 1-59 if ( levelModifier > 59 )
tmpvalue = armor / (armor + 400.0f + 85.0f * getLevel()); levelModifier = levelModifier + (4.5f * (levelModifier-59));
else if(getLevel() < 70) //Level 60-69
tmpvalue = armor / (armor - 22167.5f + 467.5f * getLevel()); float tmpvalue = 0.1f * armor / (8.5f * levelModifier + 40);
else //Level 70+ tmpvalue = tmpvalue/(1.0f + tmpvalue);
tmpvalue = armor / (armor + 10557.5f);
if(tmpvalue < 0.0f) if(tmpvalue < 0.0f)
tmpvalue = 0.0f; tmpvalue = 0.0f;
@ -9701,7 +9704,7 @@ void Unit::Unmount()
if(GetTypeId() == TYPEID_PLAYER && IsInWorld() && ((Player*)this)->GetTemporaryUnsummonedPetNumber() && isAlive()) if(GetTypeId() == TYPEID_PLAYER && IsInWorld() && ((Player*)this)->GetTemporaryUnsummonedPetNumber() && isAlive())
{ {
Pet* NewPet = new Pet; Pet* NewPet = new Pet;
if(!NewPet->LoadPetFromDB(this, 0, ((Player*)this)->GetTemporaryUnsummonedPetNumber(), true)) if(!NewPet->LoadPetFromDB((Player*)this, 0, ((Player*)this)->GetTemporaryUnsummonedPetNumber(), true))
delete NewPet; delete NewPet;
((Player*)this)->SetTemporaryUnsummonedPetNumber(0); ((Player*)this)->SetTemporaryUnsummonedPetNumber(0);
@ -12486,6 +12489,9 @@ Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id)
pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, getFaction()); pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, getFaction());
pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, spell_id); pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, spell_id);
if(GetTypeId()==TYPEID_PLAYER)
pet->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
uint32 level = (creatureTarget->getLevel() < (getLevel() - 5)) ? (getLevel() - 5) : creatureTarget->getLevel(); uint32 level = (creatureTarget->getLevel() < (getLevel() - 5)) ? (getLevel() - 5) : creatureTarget->getLevel();
pet->SetFreeTalentPoints(pet->GetMaxTalentPointsForLevel(level)); pet->SetFreeTalentPoints(pet->GetMaxTalentPointsForLevel(level));

View file

@ -759,8 +759,9 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_INSTANCE_IGNORE_RAID] = sConfig.GetBoolDefault("Instance.IgnoreRaid", false); m_configs[CONFIG_INSTANCE_IGNORE_RAID] = sConfig.GetBoolDefault("Instance.IgnoreRaid", false);
m_configs[CONFIG_BATTLEGROUND_CAST_DESERTER] = sConfig.GetBoolDefault("Battleground.CastDeserter", true); m_configs[CONFIG_BATTLEGROUND_CAST_DESERTER] = sConfig.GetBoolDefault("Battleground.CastDeserter", true);
m_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE] = sConfig.GetBoolDefault("Battleground.QueueAnnouncer.Enable", true); m_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE] = sConfig.GetBoolDefault("Battleground.QueueAnnouncer.Enable", false);
m_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY] = sConfig.GetBoolDefault("Battleground.QueueAnnouncer.PlayerOnly", false); m_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY] = sConfig.GetBoolDefault("Battleground.QueueAnnouncer.PlayerOnly", false);
m_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE] = sConfig.GetBoolDefault("Arena.QueueAnnouncer.Enable", false);
m_configs[CONFIG_CAST_UNSTUCK] = sConfig.GetBoolDefault("CastUnstuck", true); m_configs[CONFIG_CAST_UNSTUCK] = sConfig.GetBoolDefault("CastUnstuck", true);
m_configs[CONFIG_INSTANCE_RESET_TIME_HOUR] = sConfig.GetIntDefault("Instance.ResetTimeHour", 4); m_configs[CONFIG_INSTANCE_RESET_TIME_HOUR] = sConfig.GetIntDefault("Instance.ResetTimeHour", 4);

View file

@ -183,6 +183,7 @@ enum WorldConfigs
CONFIG_ARENA_RATING_DISCARD_TIMER, CONFIG_ARENA_RATING_DISCARD_TIMER,
CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS, CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS,
CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS, CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS,
CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE,
CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER, CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER,
CONFIG_SKILL_MILLING, CONFIG_SKILL_MILLING,
CONFIG_VALUE_COUNT CONFIG_VALUE_COUNT

View file

@ -324,6 +324,7 @@ class MANGOS_DLL_SPEC WorldSession
void HandleGameObjectUseOpcode(WorldPacket& recPacket); void HandleGameObjectUseOpcode(WorldPacket& recPacket);
void HandleMeetingStoneInfo(WorldPacket& recPacket); void HandleMeetingStoneInfo(WorldPacket& recPacket);
void HandleGameobjectReportUse(WorldPacket& recvPacket);
void HandleNameQueryOpcode(WorldPacket& recvPacket); void HandleNameQueryOpcode(WorldPacket& recvPacket);

View file

@ -1,114 +0,0 @@
/*
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "Tools.h"
// THIS CAN BE A LOT FASTER
bool readGUID(WorldPacket & data, uint64& guid)
{
if(data.rpos()+1 > data.size())
return false;
uint8 guidmark=0;
uint8 bit;
uint8 shiftdata=0x1;
uint64 Temp=0;
guid = 0;
data >> guidmark;
for(int i=0;i<8;i++)
{
if(guidmark & shiftdata)
{
Temp = 0;
if(data.rpos()+1 > data.size())
return false;
data >> bit;
Temp = bit;
Temp <<= i*8;
guid |= Temp;
}
shiftdata=shiftdata<<1;
}
return true;
}
void writeGUID(WorldPacket & data, uint64 & guid)
{
uint8 RAWmask = 0;
uint8 PackedGuid[8] = {0,0,0,0,0,0,0,0};
int j = 1;
uint8 * test = (uint8*)&guid;
if (*test)
{
PackedGuid[j] = *test;
RAWmask |= 1;
++j;
}
if (*(test+1))
{
PackedGuid[j] = *(test+1);
RAWmask |= 2;
++j;
}
if (*(test+2))
{
PackedGuid[j] = *(test+2);
RAWmask |= 4;
++j;
}
if (*(test+3))
{
PackedGuid[j] = *(test+3);
RAWmask |= 8;
++j;
}
if (*(test+4))
{
PackedGuid[j] = *(test+4);
RAWmask |= 16;
++j;
}
if (*(test+5))
{
PackedGuid[j] = *(test+5);
RAWmask |= 32;
++j;
}
if (*(test+6))
{
PackedGuid[j] = *(test+6);
RAWmask |= 64;
++j;
}
if (*(test+7))
{
PackedGuid[j] = *(test+7);
RAWmask |= 128;
++j;
}
PackedGuid[0] = RAWmask;
data.append(PackedGuid,j);
}

View file

@ -475,8 +475,8 @@ LogColors = ""
# #
# AlwaysMaxSkillForLevel # AlwaysMaxSkillForLevel
# Players will automatically gain max level dependent (weapon/defense) skill when logging in, leveling up etc. # Players will automatically gain max level dependent (weapon/defense) skill when logging in, leveling up etc.
# Default: 0 (true) # Default: 0 (false)
# 1 (false) # 1 (true)
# #
# ActivateWeather # ActivateWeather
# Activate weather system # Activate weather system
@ -490,14 +490,18 @@ LogColors = ""
# #
# Battleground.QueueAnnouncer.Enable # Battleground.QueueAnnouncer.Enable
# Enable queue announcer posting to chat # Enable queue announcer posting to chat
# Default: 1 (true) # Default: 0 (false)
# 0 (false) # 1 (true)
# #
# Battleground.QueueAnnouncer.PlayerOnly # Battleground.QueueAnnouncer.PlayerOnly
# Enable queue announcer posting to chat # Enable queue announcer posting to chat
# Default: 0 (false) # Default: 0 (false)
# 1 (true) # 1 (true)
# #
# Arena.QueueAnnouncer.Enable: Enable queue announcer posting to chat
# Default: 0 (false)
# 1 (true)
#
# CastUnstuck # CastUnstuck
# Allow cast or not Unstuck spell at .start or client Help option use # Allow cast or not Unstuck spell at .start or client Help option use
# Default: 1 (true) # Default: 1 (true)
@ -603,8 +607,9 @@ AllFlightPaths = 0
AlwaysMaxSkillForLevel = 0 AlwaysMaxSkillForLevel = 0
ActivateWeather = 1 ActivateWeather = 1
Battleground.CastDeserter = 1 Battleground.CastDeserter = 1
Battleground.QueueAnnouncer.Enable = 1 Battleground.QueueAnnouncer.Enable = 0
Battleground.QueueAnnouncer.PlayerOnly = 0 Battleground.QueueAnnouncer.PlayerOnly = 0
Arena.QueueAnnouncer.Enable = 0
CastUnstuck = 1 CastUnstuck = 1
Instance.IgnoreLevel = 0 Instance.IgnoreLevel = 0
Instance.IgnoreRaid = 0 Instance.IgnoreRaid = 0

View file

@ -241,6 +241,32 @@ class ByteBuffer
_rpos += len; _rpos += len;
} }
bool readPackGUID(uint64& guid)
{
if(rpos()+1 > size())
return false;
guid = 0;
uint8 guidmark=0;
(*this) >> guidmark;
for(int i=0;i<8;i++)
{
if(guidmark & (uint8(1) << i))
{
if(rpos()+1 > size())
return false;
uint8 bit;
(*this) >> bit;
guid |= (uint64(bit) << (i*8));
}
}
return true;
}
const uint8 *contents() const { return &_storage[0]; } const uint8 *contents() const { return &_storage[0]; }
size_t size() const { return _storage.size(); } size_t size() const { return _storage.size(); }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "6941" #define REVISION_NR "6953"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__

View file

@ -842,12 +842,6 @@
<File <File
RelativePath="..\..\src\game\PlayerDump.h"> RelativePath="..\..\src\game\PlayerDump.h">
</File> </File>
<File
RelativePath="..\..\src\game\tools.cpp">
</File>
<File
RelativePath="..\..\src\game\Tools.h">
</File>
</Filter> </Filter>
<Filter <Filter
Name="References" Name="References"

View file

@ -1294,14 +1294,6 @@
RelativePath="..\..\src\game\PlayerDump.h" RelativePath="..\..\src\game\PlayerDump.h"
> >
</File> </File>
<File
RelativePath="..\..\src\game\tools.cpp"
>
</File>
<File
RelativePath="..\..\src\game\Tools.h"
>
</File>
</Filter> </Filter>
<Filter <Filter
Name="References" Name="References"

View file

@ -1296,14 +1296,6 @@
RelativePath="..\..\src\game\PlayerDump.h" RelativePath="..\..\src\game\PlayerDump.h"
> >
</File> </File>
<File
RelativePath="..\..\src\game\tools.cpp"
>
</File>
<File
RelativePath="..\..\src\game\Tools.h"
>
</File>
</Filter> </Filter>
<Filter <Filter
Name="References" Name="References"