Added placeholders for new battlegrounds, some other stuff.

This commit is contained in:
tomrus88 2009-06-25 19:08:53 +04:00
parent 7df6372458
commit 02bcc56919
43 changed files with 567 additions and 113 deletions

View file

@ -0,0 +1,3 @@
alter table `creature_template`
add column `questItem5` int(11) UNSIGNED DEFAULT '0' NOT NULL after `questItem4`,
add column `questItem6` int(11) UNSIGNED DEFAULT '0' NOT NULL after `questItem5`;

View file

@ -0,0 +1,3 @@
alter table `gameobject_template`
add column `questItem5` int(11) UNSIGNED DEFAULT '0' NOT NULL after `questItem4`,
add column `questItem6` int(11) UNSIGNED DEFAULT '0' NOT NULL after `questItem5`;

View file

@ -0,0 +1,2 @@
alter table `item_template`
add column `Faction` int(11) UNSIGNED DEFAULT '0' NOT NULL after `Flags`;

2
sql/320/4_groups.sql Normal file
View file

@ -0,0 +1,2 @@
alter table `groups`
add column `raiddifficulty` int(11) UNSIGNED DEFAULT '0' NOT NULL after `difficulty`;

View file

@ -0,0 +1,2 @@
insert into `battleground_template`(`id`,`MinPlayersPerTeam`,`MaxPlayersPerTeam`,`MinLvl`,`MaxLvl`,`AllianceStartLoc`,`AllianceStartO`,`HordeStartLoc`,`HordeStartO`) values (30,20,40,71,80,1485,0,1486,0);
insert into `battleground_template`(`id`,`MinPlayersPerTeam`,`MaxPlayersPerTeam`,`MinLvl`,`MaxLvl`,`AllianceStartLoc`,`AllianceStartO`,`HordeStartLoc`,`HordeStartO`) values (32,0,40,0,80,0,0,0,0);

View file

@ -191,7 +191,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
} }
return true; return true;
case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY: case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY:
if (difficalty.difficalty >= TOTAL_DIFFICULTIES) if (difficalty.difficalty >= TOTAL_DUNGEON_DIFFICULTIES)
{ {
sLog.outErrorDb( "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY (%u) have wrong difficulty in value1 (%u), ignore.", sLog.outErrorDb( "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY (%u) have wrong difficulty in value1 (%u), ignore.",
criteria->ID, criteria->requiredType,dataType,difficalty.difficalty); criteria->ID, criteria->requiredType,dataType,difficalty.difficalty);
@ -841,7 +841,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if(!achievIdForDangeon[j][2]) if(!achievIdForDangeon[j][2])
break; // for break; // for
} }
else if(GetPlayer()->GetDifficulty()==DIFFICULTY_NORMAL) else if(GetPlayer()->GetDungeonDifficulty()==DUNGEON_DIFFICULTY_NORMAL)
{ {
// dungeon in normal mode accepted // dungeon in normal mode accepted
if(!achievIdForDangeon[j][1]) if(!achievIdForDangeon[j][1])

View file

@ -146,11 +146,12 @@ enum BattleGroundQueueTypeId
BATTLEGROUND_QUEUE_AB = 3, BATTLEGROUND_QUEUE_AB = 3,
BATTLEGROUND_QUEUE_EY = 4, BATTLEGROUND_QUEUE_EY = 4,
BATTLEGROUND_QUEUE_SA = 5, BATTLEGROUND_QUEUE_SA = 5,
BATTLEGROUND_QUEUE_2v2 = 6, BATTLEGROUND_QUEUE_IC = 6,
BATTLEGROUND_QUEUE_3v3 = 7, BATTLEGROUND_QUEUE_2v2 = 7,
BATTLEGROUND_QUEUE_5v5 = 8 BATTLEGROUND_QUEUE_3v3 = 8,
BATTLEGROUND_QUEUE_5v5 = 9
}; };
#define MAX_BATTLEGROUND_QUEUE_TYPES 9 #define MAX_BATTLEGROUND_QUEUE_TYPES 10
enum BGQueueIdBasedOnLevel // queue_id for level ranges enum BGQueueIdBasedOnLevel // queue_id for level ranges
{ {

View file

@ -0,0 +1,81 @@
/*
* Copyright (C) 2005-2009 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 "Player.h"
#include "BattleGround.h"
#include "BattleGroundABG.h"
#include "Language.h"
BattleGroundABG::BattleGroundABG()
{
//TODO FIX ME!
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_WS_START_TWO_MINUTES;
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_FOURTH] = LANG_BG_WS_HAS_BEGUN;
}
BattleGroundABG::~BattleGroundABG()
{
}
void BattleGroundABG::Update(uint32 diff)
{
BattleGround::Update(diff);
}
void BattleGroundABG::StartingEventCloseDoors()
{
}
void BattleGroundABG::StartingEventOpenDoors()
{
}
void BattleGroundABG::AddPlayer(Player *plr)
{
BattleGround::AddPlayer(plr);
//create score and add it to map, default values are set in constructor
BattleGroundABGScore* sc = new BattleGroundABGScore;
m_PlayerScores[plr->GetGUID()] = sc;
}
void BattleGroundABG::RemovePlayer(Player* /*plr*/,uint64 /*guid*/)
{
}
void BattleGroundABG::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
{
// this is wrong way to implement these things. On official it done by gameobject spell cast.
if (GetStatus() != STATUS_IN_PROGRESS)
return;
}
void BattleGroundABG::UpdatePlayerScore(Player* Source, uint32 type, uint32 value)
{
std::map<uint64, BattleGroundScore*>::iterator itr = m_PlayerScores.find(Source->GetGUID());
if(itr == m_PlayerScores.end()) // player not found...
return;
BattleGround::UpdatePlayerScore(Source,type,value);
}

View file

@ -0,0 +1,54 @@
/*
* Copyright (C) 2005-2009 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 __BATTLEGROUNDABG_H
#define __BATTLEGROUNDABG_H
class BattleGround;
class BattleGroundABGScore : public BattleGroundScore
{
public:
BattleGroundABGScore() {};
virtual ~BattleGroundABGScore() {};
};
class BattleGroundABG : public BattleGround
{
friend class BattleGroundMgr;
public:
BattleGroundABG();
~BattleGroundABG();
void Update(uint32 diff);
/* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr,uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
//bool SetupBattleGround();
/* Scorekeeping */
void UpdatePlayerScore(Player *Source, uint32 type, uint32 value);
private:
};
#endif

View file

@ -0,0 +1,81 @@
/*
* Copyright (C) 2005-2009 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 "Player.h"
#include "BattleGround.h"
#include "BattleGroundIC.h"
#include "Language.h"
BattleGroundIC::BattleGroundIC()
{
//TODO FIX ME!
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_WS_START_TWO_MINUTES;
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_FOURTH] = LANG_BG_WS_HAS_BEGUN;
}
BattleGroundIC::~BattleGroundIC()
{
}
void BattleGroundIC::Update(uint32 diff)
{
BattleGround::Update(diff);
}
void BattleGroundIC::StartingEventCloseDoors()
{
}
void BattleGroundIC::StartingEventOpenDoors()
{
}
void BattleGroundIC::AddPlayer(Player *plr)
{
BattleGround::AddPlayer(plr);
//create score and add it to map, default values are set in constructor
BattleGroundICScore* sc = new BattleGroundICScore;
m_PlayerScores[plr->GetGUID()] = sc;
}
void BattleGroundIC::RemovePlayer(Player* /*plr*/,uint64 /*guid*/)
{
}
void BattleGroundIC::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
{
// this is wrong way to implement these things. On official it done by gameobject spell cast.
if (GetStatus() != STATUS_IN_PROGRESS)
return;
}
void BattleGroundIC::UpdatePlayerScore(Player* Source, uint32 type, uint32 value)
{
std::map<uint64, BattleGroundScore*>::iterator itr = m_PlayerScores.find(Source->GetGUID());
if(itr == m_PlayerScores.end()) // player not found...
return;
BattleGround::UpdatePlayerScore(Source,type,value);
}

54
src/game/BattleGroundIC.h Normal file
View file

@ -0,0 +1,54 @@
/*
* Copyright (C) 2005-2009 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 __BATTLEGROUNDIC_H
#define __BATTLEGROUNDIC_H
class BattleGround;
class BattleGroundICScore : public BattleGroundScore
{
public:
BattleGroundICScore() {};
virtual ~BattleGroundICScore() {};
};
class BattleGroundIC : public BattleGround
{
friend class BattleGroundMgr;
public:
BattleGroundIC();
~BattleGroundIC();
void Update(uint32 diff);
/* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr,uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
//bool SetupBattleGround();
/* Scorekeeping */
void UpdatePlayerScore(Player *Source, uint32 type, uint32 value);
private:
};
#endif

View file

@ -31,6 +31,8 @@
#include "BattleGroundSA.h" #include "BattleGroundSA.h"
#include "BattleGroundDS.h" #include "BattleGroundDS.h"
#include "BattleGroundRV.h" #include "BattleGroundRV.h"
#include "BattleGroundIC.h"
#include "BattleGroundABG.h"
#include "MapManager.h" #include "MapManager.h"
#include "Map.h" #include "Map.h"
#include "MapInstanced.h" #include "MapInstanced.h"
@ -1385,6 +1387,8 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg)
case BATTLEGROUND_SA: // wotlk case BATTLEGROUND_SA: // wotlk
case BATTLEGROUND_DS: // wotlk case BATTLEGROUND_DS: // wotlk
case BATTLEGROUND_RV: // wotlk case BATTLEGROUND_RV: // wotlk
case BATTLEGROUND_IC: // wotlk
case BATTLEGROUND_ABG: // wotlk
*data << (int32)0; // 0 *data << (int32)0; // 0
break; break;
default: default:
@ -1562,6 +1566,12 @@ BattleGround * BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeI
case BATTLEGROUND_RV: case BATTLEGROUND_RV:
bg = new BattleGroundRV(*(BattleGroundRV*)bg_template); bg = new BattleGroundRV(*(BattleGroundRV*)bg_template);
break; break;
case BATTLEGROUND_IC:
bg = new BattleGroundIC(*(BattleGroundIC*)bg_template);
break;
case BATTLEGROUND_ABG:
bg = new BattleGroundABG(*(BattleGroundABG*)bg_template);
break;
default: default:
//error, but it is handled few lines above //error, but it is handled few lines above
return 0; return 0;
@ -1607,6 +1617,8 @@ uint32 BattleGroundMgr::CreateBattleGround(BattleGroundTypeId bgTypeId, bool IsA
case BATTLEGROUND_SA: bg = new BattleGroundSA; break; case BATTLEGROUND_SA: bg = new BattleGroundSA; break;
case BATTLEGROUND_DS: bg = new BattleGroundDS; break; case BATTLEGROUND_DS: bg = new BattleGroundDS; break;
case BATTLEGROUND_RV: bg = new BattleGroundRV; break; case BATTLEGROUND_RV: bg = new BattleGroundRV; break;
case BATTLEGROUND_IC: bg = new BattleGroundIC; break;
case BATTLEGROUND_ABG: bg = new BattleGroundABG; break;
default:bg = new BattleGround; break; // placeholder for non implemented BG default:bg = new BattleGround; break; // placeholder for non implemented BG
} }
@ -1701,7 +1713,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
AStartLoc[2] = start->z; AStartLoc[2] = start->z;
AStartLoc[3] = fields[6].GetFloat(); AStartLoc[3] = fields[6].GetFloat();
} }
else if (bgTypeID == BATTLEGROUND_AA) else if (bgTypeID == BATTLEGROUND_AA || bgTypeID == BATTLEGROUND_ABG)
{ {
AStartLoc[0] = 0; AStartLoc[0] = 0;
AStartLoc[1] = 0; AStartLoc[1] = 0;
@ -1724,7 +1736,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
HStartLoc[2] = start->z; HStartLoc[2] = start->z;
HStartLoc[3] = fields[8].GetFloat(); HStartLoc[3] = fields[8].GetFloat();
} }
else if (bgTypeID == BATTLEGROUND_AA) else if (bgTypeID == BATTLEGROUND_AA || bgTypeID == BATTLEGROUND_ABG)
{ {
HStartLoc[0] = 0; HStartLoc[0] = 0;
HStartLoc[1] = 0; HStartLoc[1] = 0;
@ -1909,6 +1921,10 @@ BattleGroundQueueTypeId BattleGroundMgr::BGQueueTypeId(BattleGroundTypeId bgType
return BATTLEGROUND_QUEUE_EY; return BATTLEGROUND_QUEUE_EY;
case BATTLEGROUND_SA: case BATTLEGROUND_SA:
return BATTLEGROUND_QUEUE_SA; return BATTLEGROUND_QUEUE_SA;
case BATTLEGROUND_IC:
return BATTLEGROUND_QUEUE_IC;
case BATTLEGROUND_ABG:
return BATTLEGROUND_QUEUE_NONE;
case BATTLEGROUND_AA: case BATTLEGROUND_AA:
case BATTLEGROUND_NA: case BATTLEGROUND_NA:
case BATTLEGROUND_RL: case BATTLEGROUND_RL:
@ -1945,6 +1961,8 @@ BattleGroundTypeId BattleGroundMgr::BGTemplateId(BattleGroundQueueTypeId bgQueue
return BATTLEGROUND_EY; return BATTLEGROUND_EY;
case BATTLEGROUND_QUEUE_SA: case BATTLEGROUND_QUEUE_SA:
return BATTLEGROUND_SA; return BATTLEGROUND_SA;
case BATTLEGROUND_QUEUE_IC:
return BATTLEGROUND_IC;
case BATTLEGROUND_QUEUE_2v2: case BATTLEGROUND_QUEUE_2v2:
case BATTLEGROUND_QUEUE_3v3: case BATTLEGROUND_QUEUE_3v3:
case BATTLEGROUND_QUEUE_5v5: case BATTLEGROUND_QUEUE_5v5:

View file

@ -45,7 +45,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket &recv_data)
size_t p_counter = data.wpos(); size_t p_counter = data.wpos();
data << uint32(counter); // instance save count data << uint32(counter); // instance save count
for(int i = 0; i < TOTAL_DIFFICULTIES; ++i) for(int i = 0; i < TOTAL_DUNGEON_DIFFICULTIES; ++i)
{ {
for (Player::BoundInstancesMap::const_iterator itr = _player->m_boundInstances[i].begin(); itr != _player->m_boundInstances[i].end(); ++itr) for (Player::BoundInstancesMap::const_iterator itr = _player->m_boundInstances[i].begin(); itr != _player->m_boundInstances[i].end(); ++itr)
{ {

View file

@ -216,7 +216,7 @@ struct CreatureInfo
float unk16; float unk16;
float unk17; float unk17;
bool RacialLeader; bool RacialLeader;
uint32 questItems[4]; uint32 questItems[6];
uint32 movementId; uint32 movementId;
bool RegenHealth; bool RegenHealth;
uint32 equipmentId; uint32 equipmentId;

View file

@ -1001,6 +1001,7 @@ struct ItemExtendedCostEntry
uint32 ID; // 0 extended-cost entry id uint32 ID; // 0 extended-cost entry id
uint32 reqhonorpoints; // 1 required honor points uint32 reqhonorpoints; // 1 required honor points
uint32 reqarenapoints; // 2 required arena points uint32 reqarenapoints; // 2 required arena points
//uint32 unk1; // 3.2
uint32 reqitem[5]; // 3-7 required item id uint32 reqitem[5]; // 3-7 required item id
uint32 reqitemcount[5]; // 8-12 required count of 1st item uint32 reqitemcount[5]; // 8-12 required count of 1st item
uint32 reqpersonalarenarating; // 13 required personal arena rating uint32 reqpersonalarenarating; // 13 required personal arena rating
@ -1155,6 +1156,7 @@ struct ScalingStatValuesEntry
uint32 dpsMod[6]; // DPS mod for level uint32 dpsMod[6]; // DPS mod for level
uint32 spellBonus; // not sure.. TODO: need more info about uint32 spellBonus; // not sure.. TODO: need more info about
uint32 feralBonus; // Feral AP bonus uint32 feralBonus; // Feral AP bonus
//uint32 unk1[6]; // 3.2
uint32 getssdMultiplier(uint32 mask) const uint32 getssdMultiplier(uint32 mask) const
{ {
@ -1389,6 +1391,10 @@ struct SpellEntry
uint32 runeCostID; // 229 m_runeCostID uint32 runeCostID; // 229 m_runeCostID
//uint32 spellMissileID; // 230 m_spellMissileID not used //uint32 spellMissileID; // 230 m_spellMissileID not used
//uint32 PowerDisplayId; // 231 PowerDisplay.dbc, new in 3.1 //uint32 PowerDisplayId; // 231 PowerDisplay.dbc, new in 3.1
//uint32 unk1; // 3.2
//uint32 unk2; // 3.2
//uint32 unk3; // 3.2
//uint32 unk4; // 3.2
// helpers // helpers
int32 CalculateSimpleValue(uint8 eff) const { return EffectBasePoints[eff]+int32(EffectBaseDice[eff]); } int32 CalculateSimpleValue(uint8 eff) const { return EffectBasePoints[eff]+int32(EffectBaseDice[eff]); }

View file

@ -26,7 +26,7 @@
void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket) void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket)
{ {
CHECK_PACKET_SIZE(recvPacket,8); CHECK_PACKET_SIZE(recvPacket, 8);
uint64 guid; uint64 guid;
Player *pl; Player *pl;
@ -44,22 +44,20 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket)
return; return;
//sLog.outDebug( "WORLD: received CMSG_DUEL_ACCEPTED" ); //sLog.outDebug( "WORLD: received CMSG_DUEL_ACCEPTED" );
DEBUG_LOG("Player 1 is: %u (%s)", pl->GetGUIDLow(),pl->GetName()); DEBUG_LOG("Player 1 is: %u (%s)", pl->GetGUIDLow(), pl->GetName());
DEBUG_LOG("Player 2 is: %u (%s)", plTarget->GetGUIDLow(),plTarget->GetName()); DEBUG_LOG("Player 2 is: %u (%s)", plTarget->GetGUIDLow(), plTarget->GetName());
time_t now = time(NULL); time_t now = time(NULL);
pl->duel->startTimer = now; pl->duel->startTimer = now;
plTarget->duel->startTimer = now; plTarget->duel->startTimer = now;
WorldPacket data(SMSG_DUEL_COUNTDOWN, 4); pl->SendDuelCountdown(3000);
data << (uint32)3000; // 3 seconds plTarget->SendDuelCountdown(3000);
pl->GetSession()->SendPacket(&data);
plTarget->GetSession()->SendPacket(&data);
} }
void WorldSession::HandleDuelCancelledOpcode(WorldPacket& recvPacket) void WorldSession::HandleDuelCancelledOpcode(WorldPacket& recvPacket)
{ {
CHECK_PACKET_SIZE(recvPacket,8); CHECK_PACKET_SIZE(recvPacket, 8);
//sLog.outDebug( "WORLD: received CMSG_DUEL_CANCELLED" ); //sLog.outDebug( "WORLD: received CMSG_DUEL_CANCELLED" );

View file

@ -45,7 +45,7 @@ struct GameObjectInfo
uint32 faction; uint32 faction;
uint32 flags; uint32 flags;
float size; float size;
uint32 questItems[4]; uint32 questItems[6];
union // different GO types have different data field union // different GO types have different data field
{ {
//0 GAMEOBJECT_TYPE_DOOR //0 GAMEOBJECT_TYPE_DOOR

View file

@ -69,7 +69,7 @@ Group::~Group()
// it is undefined whether objectmgr (which stores the groups) or instancesavemgr // it is undefined whether objectmgr (which stores the groups) or instancesavemgr
// will be unloaded first so we must be prepared for both cases // will be unloaded first so we must be prepared for both cases
// this may unload some instance saves // this may unload some instance saves
for(uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i) for(uint8 i = 0; i < TOTAL_DUNGEON_DIFFICULTIES; ++i)
for(BoundInstancesMap::iterator itr2 = m_boundInstances[i].begin(); itr2 != m_boundInstances[i].end(); ++itr2) for(BoundInstancesMap::iterator itr2 = m_boundInstances[i].begin(); itr2 != m_boundInstances[i].end(); ++itr2)
itr2->second.save->RemoveGroup(this); itr2->second.save->RemoveGroup(this);
@ -92,11 +92,16 @@ bool Group::Create(const uint64 &guid, const char * name)
m_lootThreshold = ITEM_QUALITY_UNCOMMON; m_lootThreshold = ITEM_QUALITY_UNCOMMON;
m_looterGuid = guid; m_looterGuid = guid;
m_difficulty = DIFFICULTY_NORMAL; m_dungeonDifficulty = DUNGEON_DIFFICULTY_NORMAL;
m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL;
if(!isBGGroup()) if(!isBGGroup())
{ {
Player *leader = objmgr.GetPlayer(guid); Player *leader = objmgr.GetPlayer(guid);
if(leader) m_difficulty = leader->GetDifficulty(); if(leader)
{
m_dungeonDifficulty = leader->GetDungeonDifficulty();
m_raidDifficulty = leader->GetRaidDifficulty();
}
Player::ConvertInstancesToGroup(leader, this, guid); Player::ConvertInstancesToGroup(leader, this, guid);
@ -104,10 +109,10 @@ bool Group::Create(const uint64 &guid, const char * name)
CharacterDatabase.BeginTransaction(); CharacterDatabase.BeginTransaction();
CharacterDatabase.PExecute("DELETE FROM groups WHERE leaderGuid ='%u'", GUID_LOPART(m_leaderGuid)); CharacterDatabase.PExecute("DELETE FROM groups WHERE leaderGuid ='%u'", GUID_LOPART(m_leaderGuid));
CharacterDatabase.PExecute("DELETE FROM group_member WHERE leaderGuid ='%u'", GUID_LOPART(m_leaderGuid)); CharacterDatabase.PExecute("DELETE FROM group_member WHERE leaderGuid ='%u'", GUID_LOPART(m_leaderGuid));
CharacterDatabase.PExecute("INSERT INTO groups(leaderGuid,mainTank,mainAssistant,lootMethod,looterGuid,lootThreshold,icon1,icon2,icon3,icon4,icon5,icon6,icon7,icon8,isRaid,difficulty) " CharacterDatabase.PExecute("INSERT INTO groups(leaderGuid,mainTank,mainAssistant,lootMethod,looterGuid,lootThreshold,icon1,icon2,icon3,icon4,icon5,icon6,icon7,icon8,isRaid,difficulty,raiddifficulty) "
"VALUES('%u','%u','%u','%u','%u','%u','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','%u','%u')", "VALUES('%u','%u','%u','%u','%u','%u','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','%u','%u')",
GUID_LOPART(m_leaderGuid), GUID_LOPART(m_mainTank), GUID_LOPART(m_mainAssistant), uint32(m_lootMethod), GUID_LOPART(m_leaderGuid), GUID_LOPART(m_mainTank), GUID_LOPART(m_mainAssistant), uint32(m_lootMethod),
GUID_LOPART(m_looterGuid), uint32(m_lootThreshold), m_targetIcons[0], m_targetIcons[1], m_targetIcons[2], m_targetIcons[3], m_targetIcons[4], m_targetIcons[5], m_targetIcons[6], m_targetIcons[7], isRaidGroup(), m_difficulty); GUID_LOPART(m_looterGuid), uint32(m_lootThreshold), m_targetIcons[0], m_targetIcons[1], m_targetIcons[2], m_targetIcons[3], m_targetIcons[4], m_targetIcons[5], m_targetIcons[6], m_targetIcons[7], isRaidGroup(), m_dungeonDifficulty, m_raidDifficulty);
} }
if(!AddMember(guid, name)) if(!AddMember(guid, name))
@ -127,8 +132,8 @@ bool Group::LoadGroupFromDB(const uint64 &leaderGuid, QueryResult *result, bool
if(!result) if(!result)
{ {
external = false; external = false;
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
result = CharacterDatabase.PQuery("SELECT mainTank, mainAssistant, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, isRaid, difficulty FROM groups WHERE leaderGuid ='%u'", GUID_LOPART(leaderGuid)); result = CharacterDatabase.PQuery("SELECT mainTank, mainAssistant, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, isRaid, difficulty, raiddifficulty FROM groups WHERE leaderGuid ='%u'", GUID_LOPART(leaderGuid));
if(!result) if(!result)
return false; return false;
} }
@ -147,7 +152,8 @@ bool Group::LoadGroupFromDB(const uint64 &leaderGuid, QueryResult *result, bool
if (m_groupType == GROUPTYPE_RAID) if (m_groupType == GROUPTYPE_RAID)
_initRaidSubGroupsCounter(); _initRaidSubGroupsCounter();
m_difficulty = (*result)[14].GetUInt8(); m_dungeonDifficulty = (*result)[14].GetUInt8();
m_raidDifficulty = (*result)[15].GetUInt8();
m_mainTank = (*result)[0].GetUInt64(); m_mainTank = (*result)[0].GetUInt64();
m_mainAssistant = (*result)[1].GetUInt64(); m_mainAssistant = (*result)[1].GetUInt64();
m_lootMethod = (LootMethod)(*result)[2].GetUInt8(); m_lootMethod = (LootMethod)(*result)[2].GetUInt8();
@ -291,16 +297,16 @@ bool Group::AddMember(const uint64 &guid, const char* name)
// including raid/heroic instances that they are not permanently bound to! // including raid/heroic instances that they are not permanently bound to!
player->ResetInstances(INSTANCE_RESET_GROUP_JOIN); player->ResetInstances(INSTANCE_RESET_GROUP_JOIN);
if(player->getLevel() >= LEVELREQUIREMENT_HEROIC && player->GetDifficulty() != GetDifficulty() ) if(player->getLevel() >= LEVELREQUIREMENT_HEROIC && player->GetDungeonDifficulty() != GetDungeonDifficulty() )
{ {
player->SetDifficulty(m_difficulty); player->SetDungeonDifficulty(m_dungeonDifficulty);
player->SendDungeonDifficulty(true); player->SendDungeonDifficulty(true);
} }
} }
player->SetGroupUpdateFlag(GROUP_UPDATE_FULL); player->SetGroupUpdateFlag(GROUP_UPDATE_FULL);
UpdatePlayerOutOfRange(player); UpdatePlayerOutOfRange(player);
// quest related GO state dependent from raid memebership // quest related GO state dependent from raid membership
if(isRaidGroup()) if(isRaidGroup())
player->UpdateForQuestWorldObjects(); player->UpdateForQuestWorldObjects();
} }
@ -364,7 +370,7 @@ void Group::ChangeLeader(const uint64 &guid)
{ {
member_citerator slot = _getMemberCSlot(guid); member_citerator slot = _getMemberCSlot(guid);
if(slot==m_memberSlots.end()) if(slot == m_memberSlots.end())
return; return;
_setLeader(guid); _setLeader(guid);
@ -955,7 +961,8 @@ void Group::SendUpdate()
data << (uint8)m_lootMethod; // loot method data << (uint8)m_lootMethod; // loot method
data << (uint64)m_looterGuid; // looter guid data << (uint64)m_looterGuid; // looter guid
data << (uint8)m_lootThreshold; // loot threshold data << (uint8)m_lootThreshold; // loot threshold
data << (uint8)m_difficulty; // Heroic Mod Group data << (uint8)m_dungeonDifficulty; // Dungeon Difficulty
data << (uint8)m_raidDifficulty; // Raid Difficulty
} }
player->GetSession()->SendPacket( &data ); player->GetSession()->SendPacket( &data );
} }
@ -1072,7 +1079,7 @@ bool Group::_addMember(const uint64 &guid, const char* name, bool isAssistant, u
else else
player->SetGroup(this, group); player->SetGroup(this, group);
// if the same group invites the player back, cancel the homebind timer // if the same group invites the player back, cancel the homebind timer
InstanceGroupBind *bind = GetBoundInstance(player->GetMapId(), player->GetDifficulty()); InstanceGroupBind *bind = GetBoundInstance(player->GetMapId(), player->GetDungeonDifficulty());
if(bind && bind->save->GetInstanceId() == player->GetInstanceId()) if(bind && bind->save->GetInstanceId() == player->GetInstanceId())
player->m_InstanceValid = true; player->m_InstanceValid = true;
} }
@ -1158,7 +1165,7 @@ void Group::_setLeader(const uint64 &guid)
Player *player = objmgr.GetPlayer(slot->guid); Player *player = objmgr.GetPlayer(slot->guid);
if(player) if(player)
{ {
for(uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i) for(uint8 i = 0; i < TOTAL_DUNGEON_DIFFICULTIES; ++i)
{ {
for(BoundInstancesMap::iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end();) for(BoundInstancesMap::iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end();)
{ {
@ -1445,21 +1452,36 @@ void Roll::targetObjectBuildLink()
getTarget()->addLootValidatorRef(this); getTarget()->addLootValidatorRef(this);
} }
void Group::SetDifficulty(uint8 difficulty) void Group::SetDungeonDifficulty(uint8 difficulty)
{ {
m_difficulty = difficulty; m_dungeonDifficulty = difficulty;
if(!isBGGroup()) CharacterDatabase.PExecute("UPDATE groups SET difficulty = %u WHERE leaderGuid ='%u'", m_difficulty, GUID_LOPART(m_leaderGuid)); if(!isBGGroup()) CharacterDatabase.PExecute("UPDATE groups SET difficulty = %u WHERE leaderGuid ='%u'", m_dungeonDifficulty, GUID_LOPART(m_leaderGuid));
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next()) for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
{ {
Player *player = itr->getSource(); Player *player = itr->getSource();
if(!player->GetSession() || player->getLevel() < LEVELREQUIREMENT_HEROIC) if(!player->GetSession() || player->getLevel() < LEVELREQUIREMENT_HEROIC)
continue; continue;
player->SetDifficulty(difficulty); player->SetDungeonDifficulty(difficulty);
player->SendDungeonDifficulty(true); player->SendDungeonDifficulty(true);
} }
} }
void Group::SetRaidDifficulty(uint8 difficulty)
{
m_raidDifficulty = difficulty;
if(!isBGGroup()) CharacterDatabase.PExecute("UPDATE groups SET raiddifficulty = %u WHERE leaderGuid ='%u'", m_raidDifficulty, GUID_LOPART(m_leaderGuid));
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
{
Player *player = itr->getSource();
if(!player->GetSession() || player->getLevel() < LEVELREQUIREMENT_HEROIC)
continue;
player->SetRaidDifficulty(difficulty);
player->SendRaidDifficulty(true);
}
}
bool Group::InCombatToInstance(uint32 instanceId) bool Group::InCombatToInstance(uint32 instanceId)
{ {
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next()) for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
@ -1479,7 +1501,7 @@ void Group::ResetInstances(uint8 method, Player* SendMsgTo)
// method can be INSTANCE_RESET_ALL, INSTANCE_RESET_CHANGE_DIFFICULTY, INSTANCE_RESET_GROUP_DISBAND // method can be INSTANCE_RESET_ALL, INSTANCE_RESET_CHANGE_DIFFICULTY, INSTANCE_RESET_GROUP_DISBAND
// we assume that when the difficulty changes, all instances that can be reset will be // we assume that when the difficulty changes, all instances that can be reset will be
uint8 dif = GetDifficulty(); uint8 dif = GetDungeonDifficulty();
for(BoundInstancesMap::iterator itr = m_boundInstances[dif].begin(); itr != m_boundInstances[dif].end();) for(BoundInstancesMap::iterator itr = m_boundInstances[dif].begin(); itr != m_boundInstances[dif].end();)
{ {
@ -1494,7 +1516,7 @@ void Group::ResetInstances(uint8 method, Player* SendMsgTo)
if(method == INSTANCE_RESET_ALL) if(method == INSTANCE_RESET_ALL)
{ {
// the "reset all instances" method can only reset normal maps // the "reset all instances" method can only reset normal maps
if(dif == DIFFICULTY_HEROIC || entry->map_type == MAP_RAID) if(dif == DUNGEON_DIFFICULTY_HEROIC || entry->map_type == MAP_RAID)
{ {
++itr; ++itr;
continue; continue;
@ -1534,7 +1556,7 @@ InstanceGroupBind* Group::GetBoundInstance(uint32 mapid, uint8 difficulty)
{ {
// some instances only have one difficulty // some instances only have one difficulty
const MapEntry* entry = sMapStore.LookupEntry(mapid); const MapEntry* entry = sMapStore.LookupEntry(mapid);
if(!entry || !entry->SupportsHeroicMode()) difficulty = DIFFICULTY_NORMAL; if(!entry || !entry->SupportsHeroicMode()) difficulty = DUNGEON_DIFFICULTY_NORMAL;
BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapid); BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapid);
if(itr != m_boundInstances[difficulty].end()) if(itr != m_boundInstances[difficulty].end())

View file

@ -279,8 +279,10 @@ class MANGOS_DLL_SPEC Group
} }
void SetTargetIcon(uint8 id, uint64 guid); void SetTargetIcon(uint8 id, uint64 guid);
void SetDifficulty(uint8 difficulty); void SetDungeonDifficulty(uint8 difficulty);
uint8 GetDifficulty() { return m_difficulty; } uint8 GetDungeonDifficulty() { return m_dungeonDifficulty; }
void SetRaidDifficulty(uint8 difficulty);
uint8 GetRaidDifficulty() { return m_raidDifficulty; }
uint16 InInstance(); uint16 InInstance();
bool InCombatToInstance(uint32 instanceId); bool InCombatToInstance(uint32 instanceId);
void ResetInstances(uint8 method, Player* SendMsgTo); void ResetInstances(uint8 method, Player* SendMsgTo);
@ -397,14 +399,15 @@ class MANGOS_DLL_SPEC Group
uint64 m_mainTank; uint64 m_mainTank;
uint64 m_mainAssistant; uint64 m_mainAssistant;
GroupType m_groupType; GroupType m_groupType;
uint8 m_difficulty; uint8 m_dungeonDifficulty;
uint8 m_raidDifficulty;
BattleGround* m_bgGroup; BattleGround* m_bgGroup;
uint64 m_targetIcons[TARGETICONCOUNT]; uint64 m_targetIcons[TARGETICONCOUNT];
LootMethod m_lootMethod; LootMethod m_lootMethod;
ItemQualities m_lootThreshold; ItemQualities m_lootThreshold;
uint64 m_looterGuid; uint64 m_looterGuid;
Rolls RollId; Rolls RollId;
BoundInstancesMap m_boundInstances[TOTAL_DIFFICULTIES]; BoundInstancesMap m_boundInstances[TOTAL_DUNGEON_DIFFICULTIES];
uint8* m_subGroupsCounts; uint8* m_subGroupsCounts;
}; };
#endif #endif

View file

@ -88,7 +88,7 @@ InstanceSave* InstanceSaveManager::AddInstanceSave(uint32 mapId, uint32 instance
{ {
// initialize reset time // initialize reset time
// for normal instances if no creatures are killed the instance will reset in two hours // for normal instances if no creatures are killed the instance will reset in two hours
if(entry->map_type == MAP_RAID || difficulty == DIFFICULTY_HEROIC) if(entry->map_type == MAP_RAID || difficulty == DUNGEON_DIFFICULTY_HEROIC)
resetTime = GetResetTimeFor(mapId); resetTime = GetResetTimeFor(mapId);
else else
{ {
@ -175,7 +175,7 @@ time_t InstanceSave::GetResetTimeForDB()
{ {
// only save the reset time for normal instances // only save the reset time for normal instances
const MapEntry *entry = sMapStore.LookupEntry(GetMapId()); const MapEntry *entry = sMapStore.LookupEntry(GetMapId());
if(!entry || entry->map_type == MAP_RAID || GetDifficulty() == DIFFICULTY_HEROIC) if(!entry || entry->map_type == MAP_RAID || GetDifficulty() == DUNGEON_DIFFICULTY_HEROIC)
return 0; return 0;
else else
return GetResetTime(); return GetResetTime();

View file

@ -329,6 +329,7 @@ void WorldSession::HandleItemQuerySingleOpcode( WorldPacket & recv_data )
data << pProto->DisplayInfoID; data << pProto->DisplayInfoID;
data << pProto->Quality; data << pProto->Quality;
data << pProto->Flags; data << pProto->Flags;
data << pProto->Faction; // 3.2 faction?
data << pProto->BuyPrice; data << pProto->BuyPrice;
data << pProto->SellPrice; data << pProto->SellPrice;
data << pProto->InventoryType; data << pProto->InventoryType;

View file

@ -511,6 +511,7 @@ struct ItemPrototype
uint32 DisplayInfoID; // id from ItemDisplayInfo.dbc uint32 DisplayInfoID; // id from ItemDisplayInfo.dbc
uint32 Quality; uint32 Quality;
uint32 Flags; uint32 Flags;
uint32 Faction;
uint32 BuyCount; uint32 BuyCount;
uint32 BuyPrice; uint32 BuyPrice;
uint32 SellPrice; uint32 SellPrice;

View file

@ -537,19 +537,19 @@ bool ChatHandler::HandleGonameCommand(const char* args)
// if the player or the player's group is bound to another instance // if the player or the player's group is bound to another instance
// the player will not be bound to another one // the player will not be bound to another one
InstancePlayerBind *pBind = _player->GetBoundInstance(target->GetMapId(), target->GetDifficulty()); InstancePlayerBind *pBind = _player->GetBoundInstance(target->GetMapId(), target->GetDungeonDifficulty());
if (!pBind) if (!pBind)
{ {
Group *group = _player->GetGroup(); Group *group = _player->GetGroup();
// if no bind exists, create a solo bind // if no bind exists, create a solo bind
InstanceGroupBind *gBind = group ? group->GetBoundInstance(target->GetMapId(), target->GetDifficulty()) : NULL; InstanceGroupBind *gBind = group ? group->GetBoundInstance(target->GetMapId(), target->GetDungeonDifficulty()) : NULL;
// if no bind exists, create a solo bind // if no bind exists, create a solo bind
if (!gBind) if (!gBind)
if (InstanceSave *save = sInstanceSaveManager.GetInstanceSave(target->GetInstanceId())) if (InstanceSave *save = sInstanceSaveManager.GetInstanceSave(target->GetInstanceId()))
_player->BindToInstance(save, !save->CanReset()); _player->BindToInstance(save, !save->CanReset());
} }
_player->SetDifficulty(target->GetDifficulty()); _player->SetDungeonDifficulty(target->GetDungeonDifficulty());
} }
PSendSysMessage(LANG_APPEARING_AT, chrNameLink.c_str()); PSendSysMessage(LANG_APPEARING_AT, chrNameLink.c_str());

View file

@ -6115,14 +6115,14 @@ bool ChatHandler::HandleInstanceListBindsCommand(const char* /*args*/)
Player* player = getSelectedPlayer(); Player* player = getSelectedPlayer();
if (!player) player = m_session->GetPlayer(); if (!player) player = m_session->GetPlayer();
uint32 counter = 0; uint32 counter = 0;
for(uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i) for(uint8 i = 0; i < TOTAL_DUNGEON_DIFFICULTIES; ++i)
{ {
Player::BoundInstancesMap &binds = player->GetBoundInstances(i); Player::BoundInstancesMap &binds = player->GetBoundInstances(i);
for(Player::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr) for(Player::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)
{ {
InstanceSave *save = itr->second.save; InstanceSave *save = itr->second.save;
std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
PSendSysMessage("map: %d inst: %d perm: %s diff: %s canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty() == DIFFICULTY_NORMAL ? "normal" : "heroic", save->CanReset() ? "yes" : "no", timeleft.c_str()); PSendSysMessage("map: %d inst: %d perm: %s diff: %s canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty() == DUNGEON_DIFFICULTY_NORMAL ? "normal" : "heroic", save->CanReset() ? "yes" : "no", timeleft.c_str());
counter++; counter++;
} }
} }
@ -6131,14 +6131,14 @@ bool ChatHandler::HandleInstanceListBindsCommand(const char* /*args*/)
Group *group = player->GetGroup(); Group *group = player->GetGroup();
if(group) if(group)
{ {
for(uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i) for(uint8 i = 0; i < TOTAL_DUNGEON_DIFFICULTIES; ++i)
{ {
Group::BoundInstancesMap &binds = group->GetBoundInstances(i); Group::BoundInstancesMap &binds = group->GetBoundInstances(i);
for(Group::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr) for(Group::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)
{ {
InstanceSave *save = itr->second.save; InstanceSave *save = itr->second.save;
std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
PSendSysMessage("map: %d inst: %d perm: %s diff: %s canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty() == DIFFICULTY_NORMAL ? "normal" : "heroic", save->CanReset() ? "yes" : "no", timeleft.c_str()); PSendSysMessage("map: %d inst: %d perm: %s diff: %s canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty() == DUNGEON_DIFFICULTY_NORMAL ? "normal" : "heroic", save->CanReset() ? "yes" : "no", timeleft.c_str());
counter++; counter++;
} }
} }
@ -6159,7 +6159,7 @@ bool ChatHandler::HandleInstanceUnbindCommand(const char* args)
Player* player = getSelectedPlayer(); Player* player = getSelectedPlayer();
if (!player) player = m_session->GetPlayer(); if (!player) player = m_session->GetPlayer();
uint32 counter = 0; uint32 counter = 0;
for(uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i) for(uint8 i = 0; i < TOTAL_DUNGEON_DIFFICULTIES; ++i)
{ {
Player::BoundInstancesMap &binds = player->GetBoundInstances(i); Player::BoundInstancesMap &binds = player->GetBoundInstances(i);
for(Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end();) for(Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end();)
@ -6168,7 +6168,7 @@ bool ChatHandler::HandleInstanceUnbindCommand(const char* args)
{ {
InstanceSave *save = itr->second.save; InstanceSave *save = itr->second.save;
std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
PSendSysMessage("unbinding map: %d inst: %d perm: %s diff: %s canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty() == DIFFICULTY_NORMAL ? "normal" : "heroic", save->CanReset() ? "yes" : "no", timeleft.c_str()); PSendSysMessage("unbinding map: %d inst: %d perm: %s diff: %s canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty() == DUNGEON_DIFFICULTY_NORMAL ? "normal" : "heroic", save->CanReset() ? "yes" : "no", timeleft.c_str());
player->UnbindInstance(itr, i); player->UnbindInstance(itr, i);
counter++; counter++;
} }

View file

@ -46,10 +46,12 @@ libmangosgame_a_SOURCES = \
BattleGround.cpp \ BattleGround.cpp \
BattleGroundAA.cpp \ BattleGroundAA.cpp \
BattleGroundAB.cpp \ BattleGroundAB.cpp \
BattleGroundABG.cpp \
BattleGroundAV.cpp \ BattleGroundAV.cpp \
BattleGroundBE.cpp \ BattleGroundBE.cpp \
BattleGroundDS.cpp \ BattleGroundDS.cpp \
BattleGroundEY.cpp \ BattleGroundEY.cpp \
BattleGroundIC.cpp \
BattleGroundNA.cpp \ BattleGroundNA.cpp \
BattleGroundRL.cpp \ BattleGroundRL.cpp \
BattleGroundRV.cpp \ BattleGroundRV.cpp \
@ -58,10 +60,12 @@ libmangosgame_a_SOURCES = \
BattleGround.h \ BattleGround.h \
BattleGroundAA.h \ BattleGroundAA.h \
BattleGroundAB.h \ BattleGroundAB.h \
BattleGroundABG.h \
BattleGroundAV.h \ BattleGroundAV.h \
BattleGroundBE.h \ BattleGroundBE.h \
BattleGroundDS.h \ BattleGroundDS.h \
BattleGroundEY.h \ BattleGroundEY.h \
BattleGroundIC.h \
BattleGroundNA.h \ BattleGroundNA.h \
BattleGroundRL.h \ BattleGroundRL.h \
BattleGroundRV.h \ BattleGroundRV.h \

View file

@ -2507,7 +2507,7 @@ void InstanceMap::UnloadAll(bool pForce)
void InstanceMap::SendResetWarnings(uint32 timeLeft) const void InstanceMap::SendResetWarnings(uint32 timeLeft) const
{ {
for(MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr) for(MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
itr->getSource()->SendInstanceResetWarning(GetId(), itr->getSource()->GetDifficulty(), timeLeft); itr->getSource()->SendInstanceResetWarning(GetId(), itr->getSource()->GetDungeonDifficulty(), timeLeft);
} }
void InstanceMap::SetResetSchedule(bool on) void InstanceMap::SetResetSchedule(bool on)
@ -2534,7 +2534,7 @@ uint32 InstanceMap::GetMaxPlayers() const
/* ******* Battleground Instance Maps ******* */ /* ******* Battleground Instance Maps ******* */
BattleGroundMap::BattleGroundMap(uint32 id, time_t expiry, uint32 InstanceId) BattleGroundMap::BattleGroundMap(uint32 id, time_t expiry, uint32 InstanceId)
: Map(id, expiry, InstanceId, DIFFICULTY_NORMAL) : Map(id, expiry, InstanceId, DUNGEON_DIFFICULTY_NORMAL)
{ {
} }

View file

@ -348,7 +348,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
// NOTE: this duplicate of Instanceable(), but Instanceable() can be changed when BG also will be instanceable // NOTE: this duplicate of Instanceable(), but Instanceable() can be changed when BG also will be instanceable
bool IsDungeon() const { return i_mapEntry && i_mapEntry->IsDungeon(); } bool IsDungeon() const { return i_mapEntry && i_mapEntry->IsDungeon(); }
bool IsRaid() const { return i_mapEntry && i_mapEntry->IsRaid(); } bool IsRaid() const { return i_mapEntry && i_mapEntry->IsRaid(); }
bool IsHeroic() const { return i_spawnMode == DIFFICULTY_HEROIC; } bool IsHeroic() const { return i_spawnMode == DUNGEON_DIFFICULTY_HEROIC; }
bool IsBattleGround() const { return i_mapEntry && i_mapEntry->IsBattleGround(); } bool IsBattleGround() const { return i_mapEntry && i_mapEntry->IsBattleGround(); }
bool IsBattleArena() const { return i_mapEntry && i_mapEntry->IsBattleArena(); } bool IsBattleArena() const { return i_mapEntry && i_mapEntry->IsBattleArena(); }
bool IsBattleGroundOrArena() const { return i_mapEntry && i_mapEntry->IsBattleGroundOrArena(); } bool IsBattleGroundOrArena() const { return i_mapEntry && i_mapEntry->IsBattleGroundOrArena(); }

View file

@ -153,7 +153,7 @@ Map* MapInstanced::GetInstance(const WorldObject* obj)
return map; return map;
} }
InstancePlayerBind *pBind = player->GetBoundInstance(GetId(), player->GetDifficulty()); InstancePlayerBind *pBind = player->GetBoundInstance(GetId(), player->GetDungeonDifficulty());
InstanceSave *pSave = pBind ? pBind->save : NULL; InstanceSave *pSave = pBind ? pBind->save : NULL;
// the player's permanet player bind is taken into consideration first // the player's permanet player bind is taken into consideration first
@ -163,7 +163,7 @@ Map* MapInstanced::GetInstance(const WorldObject* obj)
InstanceGroupBind *groupBind = NULL; InstanceGroupBind *groupBind = NULL;
Group *group = player->GetGroup(); Group *group = player->GetGroup();
// use the player's difficulty setting (it may not be the same as the group's) // use the player's difficulty setting (it may not be the same as the group's)
if(group && (groupBind = group->GetBoundInstance(GetId(), player->GetDifficulty()))) if(group && (groupBind = group->GetBoundInstance(GetId(), player->GetDungeonDifficulty())))
pSave = groupBind->save; pSave = groupBind->save;
} }
@ -182,7 +182,7 @@ Map* MapInstanced::GetInstance(const WorldObject* obj)
// if no instanceId via group members or instance saves is found // if no instanceId via group members or instance saves is found
// the instance will be created for the first time // the instance will be created for the first time
NewInstanceId = MapManager::Instance().GenerateInstanceId(); NewInstanceId = MapManager::Instance().GenerateInstanceId();
return CreateInstance(NewInstanceId, NULL, player->GetDifficulty()); return CreateInstance(NewInstanceId, NULL, player->GetDungeonDifficulty());
} }
} }
} }
@ -208,7 +208,7 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave *save,
} }
// some instances only have one difficulty // some instances only have one difficulty
if (entry && !entry->SupportsHeroicMode()) difficulty = DIFFICULTY_NORMAL; if (entry && !entry->SupportsHeroicMode()) difficulty = DUNGEON_DIFFICULTY_NORMAL;
sLog.outDebug("MapInstanced::CreateInstance: %smap instance %d for %d created with difficulty %s", save?"":"new ", InstanceId, GetId(), difficulty?"heroic":"normal"); sLog.outDebug("MapInstanced::CreateInstance: %smap instance %d for %d created with difficulty %s", save?"":"new ", InstanceId, GetId(), difficulty?"heroic":"normal");

View file

@ -176,10 +176,10 @@ 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
if (!entry->SupportsHeroicMode() && player->GetDifficulty() == DIFFICULTY_HEROIC) if (!entry->SupportsHeroicMode() && player->GetDungeonDifficulty() == DUNGEON_DIFFICULTY_HEROIC)
{ {
//Send aborted message //Send aborted message
player->SendTransferAborted(mapid, TRANSFER_ABORT_DIFFICULTY, DIFFICULTY_HEROIC); player->SendTransferAborted(mapid, TRANSFER_ABORT_DIFFICULTY, DUNGEON_DIFFICULTY_HEROIC);
return false; return false;
} }

View file

@ -845,7 +845,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
missingItem = at->requiredItem2; missingItem = at->requiredItem2;
uint32 missingKey = 0; uint32 missingKey = 0;
if(GetPlayer()->GetDifficulty() == DIFFICULTY_HEROIC) if(GetPlayer()->GetDungeonDifficulty() == DUNGEON_DIFFICULTY_HEROIC)
{ {
if(at->heroicKey) if(at->heroicKey)
{ {
@ -858,7 +858,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
} }
uint32 missingQuest = 0; uint32 missingQuest = 0;
if(GetPlayer()->GetDifficulty() == DIFFICULTY_HEROIC) if(GetPlayer()->GetDungeonDifficulty() == DUNGEON_DIFFICULTY_HEROIC)
{ {
if (at->requiredQuestHeroic && !GetPlayer()->GetQuestRewardStatus(at->requiredQuestHeroic)) if (at->requiredQuestHeroic && !GetPlayer()->GetQuestRewardStatus(at->requiredQuestHeroic))
missingQuest = at->requiredQuestHeroic; missingQuest = at->requiredQuestHeroic;
@ -875,7 +875,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
if(missingItem) if(missingItem)
SendAreaTriggerMessage(GetMangosString(LANG_LEVEL_MINREQUIRED_AND_ITEM), at->requiredLevel, objmgr.GetItemPrototype(missingItem)->Name1); SendAreaTriggerMessage(GetMangosString(LANG_LEVEL_MINREQUIRED_AND_ITEM), at->requiredLevel, objmgr.GetItemPrototype(missingItem)->Name1);
else if(missingKey) else if(missingKey)
GetPlayer()->SendTransferAborted(at->target_mapId, TRANSFER_ABORT_DIFFICULTY, DIFFICULTY_HEROIC); GetPlayer()->SendTransferAborted(at->target_mapId, TRANSFER_ABORT_DIFFICULTY, DUNGEON_DIFFICULTY_HEROIC);
else if(missingQuest) else if(missingQuest)
SendAreaTriggerMessage(at->requiredFailedText.c_str()); SendAreaTriggerMessage(at->requiredFailedText.c_str());
else if(missingLevel) else if(missingLevel)
@ -1469,10 +1469,10 @@ void WorldSession::HandleSetDungeonDifficultyOpcode( WorldPacket & recv_data )
uint32 mode; uint32 mode;
recv_data >> mode; recv_data >> mode;
if(mode == _player->GetDifficulty()) if(mode == _player->GetDungeonDifficulty())
return; return;
if(mode > DIFFICULTY_HEROIC) if(mode > DUNGEON_DIFFICULTY_HEROIC)
{ {
sLog.outError("WorldSession::HandleSetDungeonDifficultyOpcode: player %d sent an invalid instance mode %d!", _player->GetGUIDLow(), mode); sLog.outError("WorldSession::HandleSetDungeonDifficultyOpcode: player %d sent an invalid instance mode %d!", _player->GetGUIDLow(), mode);
return; return;
@ -1496,13 +1496,60 @@ void WorldSession::HandleSetDungeonDifficultyOpcode( WorldPacket & recv_data )
// the difficulty is set even if the instances can't be reset // the difficulty is set even if the instances can't be reset
//_player->SendDungeonDifficulty(true); //_player->SendDungeonDifficulty(true);
pGroup->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, _player); pGroup->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, _player);
pGroup->SetDifficulty(mode); pGroup->SetDungeonDifficulty(mode);
} }
} }
else else
{ {
_player->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY); _player->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY);
_player->SetDifficulty(mode); _player->SetDungeonDifficulty(mode);
}
}
void WorldSession::HandleSetRaidDifficultyOpcode( WorldPacket & recv_data )
{
CHECK_PACKET_SIZE(recv_data, 4);
sLog.outDebug("MSG_SET_RAID_DIFFICULTY");
uint32 mode;
recv_data >> mode;
if(mode == _player->GetRaidDifficulty())
return;
if(mode > RAID_DIFFICULTY_25MAN_HEROIC)
{
sLog.outError("WorldSession::HandleSetRaidDifficultyOpcode: player %d sent an invalid instance mode %d!", _player->GetGUIDLow(), mode);
return;
}
// cannot reset while in an instance
Map *map = _player->GetMap();
if(map && map->IsDungeon())
{
sLog.outError("WorldSession::HandleSetRaidDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow());
return;
}
if(_player->getLevel() < LEVELREQUIREMENT_HEROIC)
return;
Group *pGroup = _player->GetGroup();
if(pGroup)
{
if(pGroup->IsLeader(_player->GetGUID()))
{
// the difficulty is set even if the instances can't be reset
//_player->SendDungeonDifficulty(true);
pGroup->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, _player);
pGroup->SetRaidDifficulty(mode);
}
}
else
{
_player->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY);
_player->SetRaidDifficulty(mode);
} }
} }

View file

@ -138,10 +138,10 @@ void WorldSession::HandleMoveWorldportAckOpcode()
} }
} }
if((mEntry->IsRaid() || (mEntry->IsNonRaidDungeon() && mEntry->SupportsHeroicMode() && GetPlayer()->IsHeroic())) && mInstance) if((mEntry->IsRaid() || (mEntry->IsNonRaidDungeon() && mEntry->SupportsHeroicMode() && GetPlayer()->IsHeroicDungeon())) && mInstance)
{ {
uint32 timeleft = sInstanceSaveManager.GetResetTimeFor(GetPlayer()->GetMapId()) - time(NULL); uint32 timeleft = sInstanceSaveManager.GetResetTimeFor(GetPlayer()->GetMapId()) - time(NULL);
GetPlayer()->SendInstanceResetWarning(GetPlayer()->GetMapId(), GetPlayer()->GetDifficulty(), timeleft); GetPlayer()->SendInstanceResetWarning(GetPlayer()->GetMapId(), GetPlayer()->GetDungeonDifficulty(), timeleft);
} }
// mount allow check // mount allow check

View file

@ -2922,8 +2922,8 @@ void ObjectMgr::LoadGroups()
Group *group = NULL; Group *group = NULL;
uint64 leaderGuid = 0; uint64 leaderGuid = 0;
uint32 count = 0; uint32 count = 0;
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
QueryResult *result = CharacterDatabase.Query("SELECT mainTank, mainAssistant, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, isRaid, difficulty, leaderGuid FROM groups"); QueryResult *result = CharacterDatabase.Query("SELECT mainTank, mainAssistant, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, isRaid, difficulty, raiddifficulty, leaderGuid FROM groups");
if( !result ) if( !result )
{ {
@ -2943,7 +2943,7 @@ void ObjectMgr::LoadGroups()
bar.step(); bar.step();
Field *fields = result->Fetch(); Field *fields = result->Fetch();
++count; ++count;
leaderGuid = MAKE_NEW_GUID(fields[15].GetUInt32(),0,HIGHGUID_PLAYER); leaderGuid = MAKE_NEW_GUID(fields[16].GetUInt32(),0,HIGHGUID_PLAYER);
group = new Group; group = new Group;
if(!group->LoadGroupFromDB(leaderGuid, result, false)) if(!group->LoadGroupFromDB(leaderGuid, result, false))

View file

@ -1284,7 +1284,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] =
/*0x4E7*/ { "UMSG_UNKNOWN_1255", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4E7*/ { "UMSG_UNKNOWN_1255", STATUS_NEVER, &WorldSession::Handle_NULL },
/*0x4E8*/ { "UMSG_UNKNOWN_1256", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4E8*/ { "UMSG_UNKNOWN_1256", STATUS_NEVER, &WorldSession::Handle_NULL },
/*0x4E9*/ { "UMSG_UNKNOWN_1257", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4E9*/ { "UMSG_UNKNOWN_1257", STATUS_NEVER, &WorldSession::Handle_NULL },
/*0x4EA*/ { "UMSG_UNKNOWN_1258", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4EA*/ { "MSG_SET_RAID_DIFFICULTY", STATUS_LOGGEDIN, &WorldSession::HandleSetRaidDifficultyOpcode },
/*0x4EB*/ { "UMSG_UNKNOWN_1259", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4EB*/ { "UMSG_UNKNOWN_1259", STATUS_NEVER, &WorldSession::Handle_NULL },
/*0x4EC*/ { "UMSG_UNKNOWN_1260", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4EC*/ { "UMSG_UNKNOWN_1260", STATUS_NEVER, &WorldSession::Handle_NULL },
/*0x4ED*/ { "UMSG_UNKNOWN_1261", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4ED*/ { "UMSG_UNKNOWN_1261", STATUS_NEVER, &WorldSession::Handle_NULL },

View file

@ -1292,7 +1292,7 @@ enum Opcodes
CMSG_UNKNOWN_1255 = 0x4E7, // lua: BattlefieldMgrExitRequest CMSG_UNKNOWN_1255 = 0x4E7, // lua: BattlefieldMgrExitRequest
SMSG_UNKNOWN_1256 = 0x4E8, // uint32, uint32 SMSG_UNKNOWN_1256 = 0x4E8, // uint32, uint32
UMSG_UNKNOWN_1257 = 0x4E9, // not found 3.2 UMSG_UNKNOWN_1257 = 0x4E9, // not found 3.2
MSG_UNKNOWN_1258 = 0x4EA, // lua: SetRaidDificulty MSG_SET_RAID_DIFFICULTY = 0x4EA, // lua: SetRaidDificulty
UMSG_UNKNOWN_1259 = 0x4EB, // not found 3.2 UMSG_UNKNOWN_1259 = 0x4EB, // not found 3.2
SMSG_TOGGLE_XP_GAIN = 0x4EC, // enable/disable XP gain console message SMSG_TOGGLE_XP_GAIN = 0x4EC, // enable/disable XP gain console message
UMSG_UNKNOWN_1261 = 0x4ED, // not found 3.2 UMSG_UNKNOWN_1261 = 0x4ED, // not found 3.2

View file

@ -418,7 +418,8 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
m_HomebindTimer = 0; m_HomebindTimer = 0;
m_InstanceValid = true; m_InstanceValid = true;
m_dungeonDifficulty = DIFFICULTY_NORMAL; m_dungeonDifficulty = DUNGEON_DIFFICULTY_NORMAL;
m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL;
m_lastPotionId = 0; m_lastPotionId = 0;
@ -502,7 +503,7 @@ Player::~Player ()
delete ItemSetEff[x]; delete ItemSetEff[x];
// clean up player-instance binds, may unload some instance saves // clean up player-instance binds, may unload some instance saves
for(uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i) for(uint8 i = 0; i < TOTAL_DUNGEON_DIFFICULTIES; ++i)
for(BoundInstancesMap::iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr) for(BoundInstancesMap::iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr)
itr->second.save->RemovePlayer(this); itr->second.save->RemovePlayer(this);
@ -13995,7 +13996,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
uint32 transGUID = fields[31].GetUInt32(); uint32 transGUID = fields[31].GetUInt32();
Relocate(fields[13].GetFloat(),fields[14].GetFloat(),fields[15].GetFloat(),fields[17].GetFloat()); Relocate(fields[13].GetFloat(),fields[14].GetFloat(),fields[15].GetFloat(),fields[17].GetFloat());
SetMapId(fields[16].GetUInt32()); SetMapId(fields[16].GetUInt32());
SetDifficulty(fields[39].GetUInt32()); // may be changed in _LoadGroup SetDungeonDifficulty(fields[39].GetUInt32()); // may be changed in _LoadGroup
_LoadGroup(holder->GetResult(PLAYER_LOGIN_QUERY_LOADGROUP)); _LoadGroup(holder->GetResult(PLAYER_LOGIN_QUERY_LOADGROUP));
@ -15099,7 +15100,7 @@ void Player::_LoadGroup(QueryResult *result)
if(getLevel() >= LEVELREQUIREMENT_HEROIC) if(getLevel() >= LEVELREQUIREMENT_HEROIC)
{ {
// the group leader may change the instance difficulty while the player is offline // the group leader may change the instance difficulty while the player is offline
SetDifficulty(group->GetDifficulty()); SetDungeonDifficulty(group->GetDungeonDifficulty());
} }
} }
} }
@ -15107,7 +15108,7 @@ void Player::_LoadGroup(QueryResult *result)
void Player::_LoadBoundInstances(QueryResult *result) void Player::_LoadBoundInstances(QueryResult *result)
{ {
for(uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i) for(uint8 i = 0; i < TOTAL_DUNGEON_DIFFICULTIES; ++i)
m_boundInstances[i].clear(); m_boundInstances[i].clear();
Group *group = GetGroup(); Group *group = GetGroup();
@ -15154,7 +15155,7 @@ InstancePlayerBind* Player::GetBoundInstance(uint32 mapid, uint8 difficulty)
{ {
// some instances only have one difficulty // some instances only have one difficulty
const MapEntry* entry = sMapStore.LookupEntry(mapid); const MapEntry* entry = sMapStore.LookupEntry(mapid);
if(!entry || !entry->SupportsHeroicMode()) difficulty = DIFFICULTY_NORMAL; if(!entry || !entry->SupportsHeroicMode()) difficulty = DUNGEON_DIFFICULTY_NORMAL;
BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapid); BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapid);
if(itr != m_boundInstances[difficulty].end()) if(itr != m_boundInstances[difficulty].end())
@ -15221,7 +15222,7 @@ void Player::SendRaidInfo()
time_t now = time(NULL); time_t now = time(NULL);
for(int i = 0; i < TOTAL_DIFFICULTIES; ++i) for(int i = 0; i < TOTAL_DUNGEON_DIFFICULTIES; ++i)
{ {
for (BoundInstancesMap::const_iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr) for (BoundInstancesMap::const_iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr)
{ {
@ -15249,7 +15250,7 @@ void Player::SendSavedInstances()
bool hasBeenSaved = false; bool hasBeenSaved = false;
WorldPacket data; WorldPacket data;
for(uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i) for(uint8 i = 0; i < TOTAL_DUNGEON_DIFFICULTIES; ++i)
{ {
for (BoundInstancesMap::const_iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr) for (BoundInstancesMap::const_iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr)
{ {
@ -15269,7 +15270,7 @@ void Player::SendSavedInstances()
if(!hasBeenSaved) if(!hasBeenSaved)
return; return;
for(uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i) for(uint8 i = 0; i < TOTAL_DUNGEON_DIFFICULTIES; ++i)
{ {
for (BoundInstancesMap::const_iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr) for (BoundInstancesMap::const_iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr)
{ {
@ -15297,7 +15298,7 @@ void Player::ConvertInstancesToGroup(Player *player, Group *group, uint64 player
if(player) if(player)
{ {
for(uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i) for(uint8 i = 0; i < TOTAL_DUNGEON_DIFFICULTIES; ++i)
{ {
for (BoundInstancesMap::iterator itr = player->m_boundInstances[i].begin(); itr != player->m_boundInstances[i].end();) for (BoundInstancesMap::iterator itr = player->m_boundInstances[i].begin(); itr != player->m_boundInstances[i].end();)
{ {
@ -15434,7 +15435,7 @@ void Player::SaveToDB()
if(!IsBeingTeleported()) if(!IsBeingTeleported())
{ {
ss << GetMapId() << ", " ss << GetMapId() << ", "
<< (uint32)GetDifficulty() << ", " << (uint32)GetDungeonDifficulty() << ", "
<< finiteAlways(GetPositionX()) << ", " << finiteAlways(GetPositionX()) << ", "
<< finiteAlways(GetPositionY()) << ", " << finiteAlways(GetPositionY()) << ", "
<< finiteAlways(GetPositionZ()) << ", " << finiteAlways(GetPositionZ()) << ", "
@ -15443,7 +15444,7 @@ void Player::SaveToDB()
else else
{ {
ss << GetTeleportDest().mapid << ", " ss << GetTeleportDest().mapid << ", "
<< (uint32)GetDifficulty() << ", " << (uint32)GetDungeonDifficulty() << ", "
<< finiteAlways(GetTeleportDest().coord_x) << ", " << finiteAlways(GetTeleportDest().coord_x) << ", "
<< finiteAlways(GetTeleportDest().coord_y) << ", " << finiteAlways(GetTeleportDest().coord_y) << ", "
<< finiteAlways(GetTeleportDest().coord_z) << ", " << finiteAlways(GetTeleportDest().coord_z) << ", "
@ -16059,7 +16060,17 @@ void Player::SendDungeonDifficulty(bool IsInGroup)
{ {
uint8 val = 0x00000001; uint8 val = 0x00000001;
WorldPacket data(MSG_SET_DUNGEON_DIFFICULTY, 12); WorldPacket data(MSG_SET_DUNGEON_DIFFICULTY, 12);
data << (uint32)GetDifficulty(); data << (uint32)GetDungeonDifficulty();
data << uint32(val);
data << uint32(IsInGroup);
GetSession()->SendPacket(&data);
}
void Player::SendRaidDifficulty(bool IsInGroup)
{
uint8 val = 0x00000001;
WorldPacket data(MSG_SET_RAID_DIFFICULTY, 12);
data << uint32(GetRaidDifficulty());
data << uint32(val); data << uint32(val);
data << uint32(IsInGroup); data << uint32(IsInGroup);
GetSession()->SendPacket(&data); GetSession()->SendPacket(&data);
@ -16078,7 +16089,7 @@ void Player::ResetInstances(uint8 method)
// method can be INSTANCE_RESET_ALL, INSTANCE_RESET_CHANGE_DIFFICULTY, INSTANCE_RESET_GROUP_JOIN // method can be INSTANCE_RESET_ALL, INSTANCE_RESET_CHANGE_DIFFICULTY, INSTANCE_RESET_GROUP_JOIN
// we assume that when the difficulty changes, all instances that can be reset will be // we assume that when the difficulty changes, all instances that can be reset will be
uint8 dif = GetDifficulty(); uint8 dif = GetDungeonDifficulty();
for (BoundInstancesMap::iterator itr = m_boundInstances[dif].begin(); itr != m_boundInstances[dif].end();) for (BoundInstancesMap::iterator itr = m_boundInstances[dif].begin(); itr != m_boundInstances[dif].end();)
{ {
@ -16093,7 +16104,7 @@ void Player::ResetInstances(uint8 method)
if(method == INSTANCE_RESET_ALL) if(method == INSTANCE_RESET_ALL)
{ {
// the "reset all instances" method can only reset normal maps // the "reset all instances" method can only reset normal maps
if(dif == DIFFICULTY_HEROIC || entry->map_type == MAP_RAID) if(dif == DUNGEON_DIFFICULTY_HEROIC || entry->map_type == MAP_RAID)
{ {
++itr; ++itr;
continue; continue;
@ -20322,3 +20333,10 @@ void Player::SendClearCooldown( uint32 spell_id, Unit* target )
data << uint64(target->GetGUID()); data << uint64(target->GetGUID());
SendDirectMessage(&data); SendDirectMessage(&data);
} }
void Player::SendDuelCountdown(uint32 counter)
{
WorldPacket data(SMSG_DUEL_COUNTDOWN, 4);
data << uint32(counter); // seconds
GetSession()->SendPacket(&data);
}

View file

@ -1505,6 +1505,7 @@ class MANGOS_DLL_SPEC Player : public Unit
void UpdateDuelFlag(time_t currTime); void UpdateDuelFlag(time_t currTime);
void CheckDuelDistance(time_t currTime); void CheckDuelDistance(time_t currTime);
void DuelComplete(DuelCompleteType type); void DuelComplete(DuelCompleteType type);
void SendDuelCountdown(uint32 counter);
bool IsGroupVisibleFor(Player* p) const; bool IsGroupVisibleFor(Player* p) const;
bool IsInSameGroupWith(Player const* p) const; bool IsInSameGroupWith(Player const* p) const;
@ -1535,9 +1536,11 @@ class MANGOS_DLL_SPEC Player : public Unit
uint32 GetArenaTeamIdInvited() { return m_ArenaTeamIdInvited; } uint32 GetArenaTeamIdInvited() { return m_ArenaTeamIdInvited; }
static void LeaveAllArenaTeams(uint64 guid); static void LeaveAllArenaTeams(uint64 guid);
void SetDifficulty(uint32 dungeon_difficulty) { m_dungeonDifficulty = dungeon_difficulty; } void SetDungeonDifficulty(uint32 dungeon_difficulty) { m_dungeonDifficulty = dungeon_difficulty; }
uint8 GetDifficulty() { return m_dungeonDifficulty; } uint8 GetDungeonDifficulty() { return m_dungeonDifficulty; }
bool IsHeroic() { return m_dungeonDifficulty == DIFFICULTY_HEROIC; } bool IsHeroicDungeon() { return m_dungeonDifficulty == DUNGEON_DIFFICULTY_HEROIC; }
void SetRaidDifficulty(uint32 raid_difficulty) { m_raidDifficulty = raid_difficulty; }
uint8 GetRaidDifficulty() { return m_raidDifficulty; }
bool UpdateSkill(uint32 skill_id, uint32 step); bool UpdateSkill(uint32 skill_id, uint32 step);
bool UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step); bool UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step);
@ -1625,6 +1628,7 @@ class MANGOS_DLL_SPEC Player : public Unit
void SendExplorationExperience(uint32 Area, uint32 Experience); void SendExplorationExperience(uint32 Area, uint32 Experience);
void SendDungeonDifficulty(bool IsInGroup); void SendDungeonDifficulty(bool IsInGroup);
void SendRaidDifficulty(bool IsInGroup);
void ResetInstances(uint8 method); void ResetInstances(uint8 method);
void SendResetInstanceSuccess(uint32 MapId); void SendResetInstanceSuccess(uint32 MapId);
void SendResetInstanceFailed(uint32 reason, uint32 MapId); void SendResetInstanceFailed(uint32 reason, uint32 MapId);
@ -2037,7 +2041,7 @@ class MANGOS_DLL_SPEC Player : public Unit
uint32 m_HomebindTimer; uint32 m_HomebindTimer;
bool m_InstanceValid; bool m_InstanceValid;
// permanent binds and solo binds by difficulty // permanent binds and solo binds by difficulty
BoundInstancesMap m_boundInstances[TOTAL_DIFFICULTIES]; BoundInstancesMap m_boundInstances[TOTAL_DUNGEON_DIFFICULTIES];
InstancePlayerBind* GetBoundInstance(uint32 mapid, uint8 difficulty); InstancePlayerBind* GetBoundInstance(uint32 mapid, uint8 difficulty);
BoundInstancesMap& GetBoundInstances(uint8 difficulty) { return m_boundInstances[difficulty]; } BoundInstancesMap& GetBoundInstances(uint8 difficulty) { return m_boundInstances[difficulty]; }
void UnbindInstance(uint32 mapid, uint8 difficulty, bool unload = false); void UnbindInstance(uint32 mapid, uint8 difficulty, bool unload = false);
@ -2194,6 +2198,7 @@ class MANGOS_DLL_SPEC Player : public Unit
time_t m_speakTime; time_t m_speakTime;
uint32 m_speakCount; uint32 m_speakCount;
uint32 m_dungeonDifficulty; uint32 m_dungeonDifficulty;
uint32 m_raidDifficulty;
uint32 m_atLoginFlags; uint32 m_atLoginFlags;

View file

@ -198,8 +198,8 @@ void WorldSession::HandleCreatureQueryOpcode( WorldPacket & recv_data )
data << float(ci->unk16); // unk data << float(ci->unk16); // unk
data << float(ci->unk17); // unk data << float(ci->unk17); // unk
data << uint8(ci->RacialLeader); data << uint8(ci->RacialLeader);
for(uint32 i = 0; i < 4; ++i) for(uint32 i = 0; i < 6; ++i)
data << uint32(ci->questItems[i]); // itemId[4], quest drop data << uint32(ci->questItems[i]); // itemId[6], quest drop
data << uint32(ci->movementId); // CreatureMovementInfo.dbc data << uint32(ci->movementId); // CreatureMovementInfo.dbc
SendPacket( &data ); SendPacket( &data );
sLog.outDebug( "WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE" ); sLog.outDebug( "WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE" );
@ -261,8 +261,8 @@ void WorldSession::HandleGameObjectQueryOpcode( WorldPacket & recv_data )
data << info->unk1; // 2.0.3, string data << info->unk1; // 2.0.3, string
data.append(info->raw.data, 24); data.append(info->raw.data, 24);
data << float(info->size); // go size data << float(info->size); // go size
for(uint32 i = 0; i < 4; ++i) for(uint32 i = 0; i < 6; ++i)
data << uint32(info->questItems[i]); // itemId[4], quest drop data << uint32(info->questItems[i]); // itemId[6], quest drop
SendPacket( &data ); SendPacket( &data );
sLog.outDebug( "WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE" ); sLog.outDebug( "WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE" );
} }

View file

@ -2351,9 +2351,18 @@ enum DiminishingGroup
enum DungeonDifficulties enum DungeonDifficulties
{ {
DIFFICULTY_NORMAL = 0, DUNGEON_DIFFICULTY_NORMAL = 0,
DIFFICULTY_HEROIC = 1, DUNGEON_DIFFICULTY_HEROIC = 1,
TOTAL_DIFFICULTIES TOTAL_DUNGEON_DIFFICULTIES
};
enum RaidDifficulties
{
RAID_DIFFICULTY_10MAN_NORMAL = 0,
RAID_DIFFICULTY_10MAN_HEROIC = 1,
RAID_DIFFICULTY_25MAN_NORMAL = 2,
RAID_DIFFICULTY_25MAN_HEROIC = 3,
TOTAL_RAID_DIFFICULTIES
}; };
enum SummonType enum SummonType
@ -2519,9 +2528,11 @@ enum BattleGroundTypeId
BATTLEGROUND_RL = 8, BATTLEGROUND_RL = 8,
BATTLEGROUND_SA = 9, BATTLEGROUND_SA = 9,
BATTLEGROUND_DS = 10, BATTLEGROUND_DS = 10,
BATTLEGROUND_RV = 11 BATTLEGROUND_RV = 11,
BATTLEGROUND_IC = 30,
BATTLEGROUND_ABG = 32
}; };
#define MAX_BATTLEGROUND_TYPE_ID 12 #define MAX_BATTLEGROUND_TYPE_ID 33
enum MailResponseType enum MailResponseType
{ {

View file

@ -627,6 +627,7 @@ class MANGOS_DLL_SPEC WorldSession
void HandleFarSightOpcode(WorldPacket& recv_data); void HandleFarSightOpcode(WorldPacket& recv_data);
void HandleSetLfgOpcode(WorldPacket& recv_data); void HandleSetLfgOpcode(WorldPacket& recv_data);
void HandleSetDungeonDifficultyOpcode(WorldPacket& recv_data); void HandleSetDungeonDifficultyOpcode(WorldPacket& recv_data);
void HandleSetRaidDifficultyOpcode(WorldPacket& recv_data);
void HandleMoveSetCanFlyAckOpcode(WorldPacket& recv_data); void HandleMoveSetCanFlyAckOpcode(WorldPacket& recv_data);
void HandleLfgSetAutoJoinOpcode(WorldPacket& recv_data); void HandleLfgSetAutoJoinOpcode(WorldPacket& recv_data);
void HandleLfgClearAutoJoinOpcode(WorldPacket& recv_data); void HandleLfgClearAutoJoinOpcode(WorldPacket& recv_data);

View file

@ -25,16 +25,16 @@ extern DatabasePostgre WorldDatabase;
extern DatabaseMysql WorldDatabase; extern DatabaseMysql WorldDatabase;
#endif #endif
const char CreatureInfosrcfmt[]="iiiiiiiisssiiiiiiiiiiffiffiifiiiiiiiiiiffiiiiiiiiiiiiiiiiiiisiiffliiiiiliiis"; const char CreatureInfosrcfmt[]="iiiiiiiisssiiiiiiiiiiffiffiifiiiiiiiiiiffiiiiiiiiiiiiiiiiiiisiiffliiiiiiiliiis";
const char CreatureInfodstfmt[]="iiiiiiiisssiiiiiiiiiiffiffiifiiiiiiiiiiffiiiiiiiiiiiiiiiiiiisiiffliiiiiliiii"; const char CreatureInfodstfmt[]="iiiiiiiisssiiiiiiiiiiffiffiifiiiiiiiiiiffiiiiiiiiiiiiiiiiiiisiiffliiiiiiiliiii";
const char CreatureDataAddonInfofmt[]="iiiiiis"; const char CreatureDataAddonInfofmt[]="iiiiiis";
const char CreatureModelfmt[]="iffbi"; const char CreatureModelfmt[]="iffbi";
const char CreatureInfoAddonInfofmt[]="iiiiiis"; const char CreatureInfoAddonInfofmt[]="iiiiiis";
const char EquipmentInfofmt[]="iiii"; const char EquipmentInfofmt[]="iiii";
const char GameObjectInfosrcfmt[]="iiissssiifiiiiiiiiiiiiiiiiiiiiiiiiiiiis"; const char GameObjectInfosrcfmt[]="iiissssiifiiiiiiiiiiiiiiiiiiiiiiiiiiiiiis";
const char GameObjectInfodstfmt[]="iiissssiifiiiiiiiiiiiiiiiiiiiiiiiiiiiii"; const char GameObjectInfodstfmt[]="iiissssiifiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii";
const char ItemPrototypesrcfmt[]="iiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiiisiiii"; const char ItemPrototypesrcfmt[]="iiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiiisiiii";
const char ItemPrototypedstfmt[]="iiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiiiiiiii"; const char ItemPrototypedstfmt[]="iiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiiiiiiii";
const char PageTextfmt[]="isi"; const char PageTextfmt[]="isi";
const char SpellThreatfmt[]="ii"; const char SpellThreatfmt[]="ii";
const char InstanceTemplatesrcfmt[]="iiiiiiiffffs"; const char InstanceTemplatesrcfmt[]="iiiiiiiffffs";

View file

@ -355,11 +355,13 @@
<ClCompile Include="..\..\src\game\BattleGround.cpp" /> <ClCompile Include="..\..\src\game\BattleGround.cpp" />
<ClCompile Include="..\..\src\game\BattleGroundAA.cpp" /> <ClCompile Include="..\..\src\game\BattleGroundAA.cpp" />
<ClCompile Include="..\..\src\game\BattleGroundAB.cpp" /> <ClCompile Include="..\..\src\game\BattleGroundAB.cpp" />
<ClCompile Include="..\..\src\game\BattleGroundABG.cpp" />
<ClCompile Include="..\..\src\game\BattleGroundAV.cpp" /> <ClCompile Include="..\..\src\game\BattleGroundAV.cpp" />
<ClCompile Include="..\..\src\game\BattleGroundBE.cpp" /> <ClCompile Include="..\..\src\game\BattleGroundBE.cpp" />
<ClCompile Include="..\..\src\game\BattleGroundDS.cpp" /> <ClCompile Include="..\..\src\game\BattleGroundDS.cpp" />
<ClCompile Include="..\..\src\game\BattleGroundEY.cpp" /> <ClCompile Include="..\..\src\game\BattleGroundEY.cpp" />
<ClCompile Include="..\..\src\game\BattleGroundHandler.cpp" /> <ClCompile Include="..\..\src\game\BattleGroundHandler.cpp" />
<ClCompile Include="..\..\src\game\BattleGroundIC.cpp" />
<ClCompile Include="..\..\src\game\BattleGroundMgr.cpp" /> <ClCompile Include="..\..\src\game\BattleGroundMgr.cpp" />
<ClCompile Include="..\..\src\game\BattleGroundNA.cpp" /> <ClCompile Include="..\..\src\game\BattleGroundNA.cpp" />
<ClCompile Include="..\..\src\game\BattleGroundRL.cpp" /> <ClCompile Include="..\..\src\game\BattleGroundRL.cpp" />
@ -501,10 +503,12 @@
<ClInclude Include="..\..\src\game\BattleGround.h" /> <ClInclude Include="..\..\src\game\BattleGround.h" />
<ClInclude Include="..\..\src\game\BattleGroundAA.h" /> <ClInclude Include="..\..\src\game\BattleGroundAA.h" />
<ClInclude Include="..\..\src\game\BattleGroundAB.h" /> <ClInclude Include="..\..\src\game\BattleGroundAB.h" />
<ClInclude Include="..\..\src\game\BattleGroundABG.h" />
<ClInclude Include="..\..\src\game\BattleGroundAV.h" /> <ClInclude Include="..\..\src\game\BattleGroundAV.h" />
<ClInclude Include="..\..\src\game\BattleGroundBE.h" /> <ClInclude Include="..\..\src\game\BattleGroundBE.h" />
<ClInclude Include="..\..\src\game\BattleGroundDS.h" /> <ClInclude Include="..\..\src\game\BattleGroundDS.h" />
<ClInclude Include="..\..\src\game\BattleGroundEY.h" /> <ClInclude Include="..\..\src\game\BattleGroundEY.h" />
<ClInclude Include="..\..\src\game\BattleGroundIC.h" />
<ClInclude Include="..\..\src\game\BattleGroundMgr.h" /> <ClInclude Include="..\..\src\game\BattleGroundMgr.h" />
<ClInclude Include="..\..\src\game\BattleGroundNA.h" /> <ClInclude Include="..\..\src\game\BattleGroundNA.h" />
<ClInclude Include="..\..\src\game\BattleGroundRL.h" /> <ClInclude Include="..\..\src\game\BattleGroundRL.h" />

View file

@ -565,6 +565,14 @@
RelativePath="..\..\src\game\BattleGroundAB.h" RelativePath="..\..\src\game\BattleGroundAB.h"
> >
</File> </File>
<File
RelativePath="..\..\src\game\BattleGroundABG.cpp"
>
</File>
<File
RelativePath="..\..\src\game\BattleGroundABG.h"
>
</File>
<File <File
RelativePath="..\..\src\game\BattleGroundAV.cpp" RelativePath="..\..\src\game\BattleGroundAV.cpp"
> >
@ -601,6 +609,14 @@
RelativePath="..\..\src\game\BattleGroundHandler.cpp" RelativePath="..\..\src\game\BattleGroundHandler.cpp"
> >
</File> </File>
<File
RelativePath="..\..\src\game\BattleGroundIC.cpp"
>
</File>
<File
RelativePath="..\..\src\game\BattleGroundIC.h"
>
</File>
<File <File
RelativePath="..\..\src\game\BattleGroundMgr.cpp" RelativePath="..\..\src\game\BattleGroundMgr.cpp"
> >

View file

@ -565,6 +565,14 @@
RelativePath="..\..\src\game\BattleGroundAB.h" RelativePath="..\..\src\game\BattleGroundAB.h"
> >
</File> </File>
<File
RelativePath="..\..\src\game\BattleGroundABG.cpp"
>
</File>
<File
RelativePath="..\..\src\game\BattleGroundABG.h"
>
</File>
<File <File
RelativePath="..\..\src\game\BattleGroundAV.cpp" RelativePath="..\..\src\game\BattleGroundAV.cpp"
> >
@ -601,6 +609,14 @@
RelativePath="..\..\src\game\BattleGroundHandler.cpp" RelativePath="..\..\src\game\BattleGroundHandler.cpp"
> >
</File> </File>
<File
RelativePath="..\..\src\game\BattleGroundIC.cpp"
>
</File>
<File
RelativePath="..\..\src\game\BattleGroundIC.h"
>
</File>
<File <File
RelativePath="..\..\src\game\BattleGroundMgr.cpp" RelativePath="..\..\src\game\BattleGroundMgr.cpp"
> >