From 02bcc56919a1b16f750d0c0b030561500f8acaad Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Thu, 25 Jun 2009 19:08:53 +0400 Subject: [PATCH] Added placeholders for new battlegrounds, some other stuff. --- sql/320/1_creature_template.sql | 3 ++ sql/320/2_gameobject_template.sql | 3 ++ sql/320/3_item_template.sql | 2 + sql/320/4_groups.sql | 2 + sql/320/5_battleground_tempalate.sql | 2 + src/game/AchievementMgr.cpp | 4 +- src/game/BattleGround.h | 9 ++-- src/game/BattleGroundABG.cpp | 81 ++++++++++++++++++++++++++++ src/game/BattleGroundABG.h | 54 +++++++++++++++++++ src/game/BattleGroundIC.cpp | 81 ++++++++++++++++++++++++++++ src/game/BattleGroundIC.h | 54 +++++++++++++++++++ src/game/BattleGroundMgr.cpp | 22 +++++++- src/game/CalendarHandler.cpp | 2 +- src/game/Creature.h | 2 +- src/game/DBCStructure.h | 6 +++ src/game/DuelHandler.cpp | 14 +++-- src/game/GameObject.h | 2 +- src/game/Group.cpp | 66 +++++++++++++++-------- src/game/Group.h | 11 ++-- src/game/InstanceSaveMgr.cpp | 4 +- src/game/ItemHandler.cpp | 1 + src/game/ItemPrototype.h | 1 + src/game/Level1.cpp | 6 +-- src/game/Level3.cpp | 12 ++--- src/game/Makefile.am | 4 ++ src/game/Map.cpp | 4 +- src/game/Map.h | 2 +- src/game/MapInstanced.cpp | 8 +-- src/game/MapManager.cpp | 4 +- src/game/MiscHandler.cpp | 61 ++++++++++++++++++--- src/game/MovementHandler.cpp | 4 +- src/game/ObjectMgr.cpp | 6 +-- src/game/Opcodes.cpp | 2 +- src/game/Opcodes.h | 2 +- src/game/Player.cpp | 48 +++++++++++------ src/game/Player.h | 13 +++-- src/game/QueryHandler.cpp | 8 +-- src/game/SharedDefines.h | 21 ++++++-- src/game/WorldSession.h | 1 + src/shared/Database/SQLStorage.cpp | 12 ++--- win/VC100/game.vcxproj | 4 ++ win/VC80/game.vcproj | 16 ++++++ win/VC90/game.vcproj | 16 ++++++ 43 files changed, 567 insertions(+), 113 deletions(-) create mode 100644 sql/320/1_creature_template.sql create mode 100644 sql/320/2_gameobject_template.sql create mode 100644 sql/320/3_item_template.sql create mode 100644 sql/320/4_groups.sql create mode 100644 sql/320/5_battleground_tempalate.sql create mode 100644 src/game/BattleGroundABG.cpp create mode 100644 src/game/BattleGroundABG.h create mode 100644 src/game/BattleGroundIC.cpp create mode 100644 src/game/BattleGroundIC.h diff --git a/sql/320/1_creature_template.sql b/sql/320/1_creature_template.sql new file mode 100644 index 000000000..ae645af12 --- /dev/null +++ b/sql/320/1_creature_template.sql @@ -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`; diff --git a/sql/320/2_gameobject_template.sql b/sql/320/2_gameobject_template.sql new file mode 100644 index 000000000..5d5a13cd3 --- /dev/null +++ b/sql/320/2_gameobject_template.sql @@ -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`; diff --git a/sql/320/3_item_template.sql b/sql/320/3_item_template.sql new file mode 100644 index 000000000..c89d6da3a --- /dev/null +++ b/sql/320/3_item_template.sql @@ -0,0 +1,2 @@ +alter table `item_template` + add column `Faction` int(11) UNSIGNED DEFAULT '0' NOT NULL after `Flags`; diff --git a/sql/320/4_groups.sql b/sql/320/4_groups.sql new file mode 100644 index 000000000..0bce0691f --- /dev/null +++ b/sql/320/4_groups.sql @@ -0,0 +1,2 @@ +alter table `groups` + add column `raiddifficulty` int(11) UNSIGNED DEFAULT '0' NOT NULL after `difficulty`; diff --git a/sql/320/5_battleground_tempalate.sql b/sql/320/5_battleground_tempalate.sql new file mode 100644 index 000000000..699a0158d --- /dev/null +++ b/sql/320/5_battleground_tempalate.sql @@ -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); diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp index f350d6df5..cc8e8e6bc 100644 --- a/src/game/AchievementMgr.cpp +++ b/src/game/AchievementMgr.cpp @@ -191,7 +191,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) } return true; 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.", criteria->ID, criteria->requiredType,dataType,difficalty.difficalty); @@ -841,7 +841,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if(!achievIdForDangeon[j][2]) break; // for } - else if(GetPlayer()->GetDifficulty()==DIFFICULTY_NORMAL) + else if(GetPlayer()->GetDungeonDifficulty()==DUNGEON_DIFFICULTY_NORMAL) { // dungeon in normal mode accepted if(!achievIdForDangeon[j][1]) diff --git a/src/game/BattleGround.h b/src/game/BattleGround.h index 91eb32382..7d64036e2 100644 --- a/src/game/BattleGround.h +++ b/src/game/BattleGround.h @@ -146,11 +146,12 @@ enum BattleGroundQueueTypeId BATTLEGROUND_QUEUE_AB = 3, BATTLEGROUND_QUEUE_EY = 4, BATTLEGROUND_QUEUE_SA = 5, - BATTLEGROUND_QUEUE_2v2 = 6, - BATTLEGROUND_QUEUE_3v3 = 7, - BATTLEGROUND_QUEUE_5v5 = 8 + BATTLEGROUND_QUEUE_IC = 6, + BATTLEGROUND_QUEUE_2v2 = 7, + 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 { diff --git a/src/game/BattleGroundABG.cpp b/src/game/BattleGroundABG.cpp new file mode 100644 index 000000000..0d934659f --- /dev/null +++ b/src/game/BattleGroundABG.cpp @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2005-2009 MaNGOS + * + * 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::iterator itr = m_PlayerScores.find(Source->GetGUID()); + + if(itr == m_PlayerScores.end()) // player not found... + return; + + BattleGround::UpdatePlayerScore(Source,type,value); +} diff --git a/src/game/BattleGroundABG.h b/src/game/BattleGroundABG.h new file mode 100644 index 000000000..7d3e65ed3 --- /dev/null +++ b/src/game/BattleGroundABG.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2005-2009 MaNGOS + * + * 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 diff --git a/src/game/BattleGroundIC.cpp b/src/game/BattleGroundIC.cpp new file mode 100644 index 000000000..829dbcdb1 --- /dev/null +++ b/src/game/BattleGroundIC.cpp @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2005-2009 MaNGOS + * + * 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::iterator itr = m_PlayerScores.find(Source->GetGUID()); + + if(itr == m_PlayerScores.end()) // player not found... + return; + + BattleGround::UpdatePlayerScore(Source,type,value); +} diff --git a/src/game/BattleGroundIC.h b/src/game/BattleGroundIC.h new file mode 100644 index 000000000..9ca0f6d13 --- /dev/null +++ b/src/game/BattleGroundIC.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2005-2009 MaNGOS + * + * 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 diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp index df9276fe4..49f17630b 100644 --- a/src/game/BattleGroundMgr.cpp +++ b/src/game/BattleGroundMgr.cpp @@ -31,6 +31,8 @@ #include "BattleGroundSA.h" #include "BattleGroundDS.h" #include "BattleGroundRV.h" +#include "BattleGroundIC.h" +#include "BattleGroundABG.h" #include "MapManager.h" #include "Map.h" #include "MapInstanced.h" @@ -1385,6 +1387,8 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg) case BATTLEGROUND_SA: // wotlk case BATTLEGROUND_DS: // wotlk case BATTLEGROUND_RV: // wotlk + case BATTLEGROUND_IC: // wotlk + case BATTLEGROUND_ABG: // wotlk *data << (int32)0; // 0 break; default: @@ -1562,6 +1566,12 @@ BattleGround * BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeI case BATTLEGROUND_RV: bg = new BattleGroundRV(*(BattleGroundRV*)bg_template); break; + case BATTLEGROUND_IC: + bg = new BattleGroundIC(*(BattleGroundIC*)bg_template); + break; + case BATTLEGROUND_ABG: + bg = new BattleGroundABG(*(BattleGroundABG*)bg_template); + break; default: //error, but it is handled few lines above return 0; @@ -1607,6 +1617,8 @@ uint32 BattleGroundMgr::CreateBattleGround(BattleGroundTypeId bgTypeId, bool IsA case BATTLEGROUND_SA: bg = new BattleGroundSA; break; case BATTLEGROUND_DS: bg = new BattleGroundDS; 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 } @@ -1701,7 +1713,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds() AStartLoc[2] = start->z; AStartLoc[3] = fields[6].GetFloat(); } - else if (bgTypeID == BATTLEGROUND_AA) + else if (bgTypeID == BATTLEGROUND_AA || bgTypeID == BATTLEGROUND_ABG) { AStartLoc[0] = 0; AStartLoc[1] = 0; @@ -1724,7 +1736,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds() HStartLoc[2] = start->z; HStartLoc[3] = fields[8].GetFloat(); } - else if (bgTypeID == BATTLEGROUND_AA) + else if (bgTypeID == BATTLEGROUND_AA || bgTypeID == BATTLEGROUND_ABG) { HStartLoc[0] = 0; HStartLoc[1] = 0; @@ -1909,6 +1921,10 @@ BattleGroundQueueTypeId BattleGroundMgr::BGQueueTypeId(BattleGroundTypeId bgType return BATTLEGROUND_QUEUE_EY; case BATTLEGROUND_SA: return BATTLEGROUND_QUEUE_SA; + case BATTLEGROUND_IC: + return BATTLEGROUND_QUEUE_IC; + case BATTLEGROUND_ABG: + return BATTLEGROUND_QUEUE_NONE; case BATTLEGROUND_AA: case BATTLEGROUND_NA: case BATTLEGROUND_RL: @@ -1945,6 +1961,8 @@ BattleGroundTypeId BattleGroundMgr::BGTemplateId(BattleGroundQueueTypeId bgQueue return BATTLEGROUND_EY; case BATTLEGROUND_QUEUE_SA: return BATTLEGROUND_SA; + case BATTLEGROUND_QUEUE_IC: + return BATTLEGROUND_IC; case BATTLEGROUND_QUEUE_2v2: case BATTLEGROUND_QUEUE_3v3: case BATTLEGROUND_QUEUE_5v5: diff --git a/src/game/CalendarHandler.cpp b/src/game/CalendarHandler.cpp index 4d3f9f074..a700b8857 100644 --- a/src/game/CalendarHandler.cpp +++ b/src/game/CalendarHandler.cpp @@ -45,7 +45,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket &recv_data) size_t p_counter = data.wpos(); 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) { diff --git a/src/game/Creature.h b/src/game/Creature.h index 01259c3ea..b76685828 100644 --- a/src/game/Creature.h +++ b/src/game/Creature.h @@ -216,7 +216,7 @@ struct CreatureInfo float unk16; float unk17; bool RacialLeader; - uint32 questItems[4]; + uint32 questItems[6]; uint32 movementId; bool RegenHealth; uint32 equipmentId; diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 324d92998..5f9434e3b 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -1001,6 +1001,7 @@ struct ItemExtendedCostEntry uint32 ID; // 0 extended-cost entry id uint32 reqhonorpoints; // 1 required honor points uint32 reqarenapoints; // 2 required arena points + //uint32 unk1; // 3.2 uint32 reqitem[5]; // 3-7 required item id uint32 reqitemcount[5]; // 8-12 required count of 1st item uint32 reqpersonalarenarating; // 13 required personal arena rating @@ -1155,6 +1156,7 @@ struct ScalingStatValuesEntry uint32 dpsMod[6]; // DPS mod for level uint32 spellBonus; // not sure.. TODO: need more info about uint32 feralBonus; // Feral AP bonus + //uint32 unk1[6]; // 3.2 uint32 getssdMultiplier(uint32 mask) const { @@ -1389,6 +1391,10 @@ struct SpellEntry uint32 runeCostID; // 229 m_runeCostID //uint32 spellMissileID; // 230 m_spellMissileID not used //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 int32 CalculateSimpleValue(uint8 eff) const { return EffectBasePoints[eff]+int32(EffectBaseDice[eff]); } diff --git a/src/game/DuelHandler.cpp b/src/game/DuelHandler.cpp index e9e1fa0b6..fcceae73e 100644 --- a/src/game/DuelHandler.cpp +++ b/src/game/DuelHandler.cpp @@ -26,7 +26,7 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket) { - CHECK_PACKET_SIZE(recvPacket,8); + CHECK_PACKET_SIZE(recvPacket, 8); uint64 guid; Player *pl; @@ -44,22 +44,20 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket) return; //sLog.outDebug( "WORLD: received CMSG_DUEL_ACCEPTED" ); - 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 1 is: %u (%s)", pl->GetGUIDLow(), pl->GetName()); + DEBUG_LOG("Player 2 is: %u (%s)", plTarget->GetGUIDLow(), plTarget->GetName()); time_t now = time(NULL); pl->duel->startTimer = now; plTarget->duel->startTimer = now; - WorldPacket data(SMSG_DUEL_COUNTDOWN, 4); - data << (uint32)3000; // 3 seconds - pl->GetSession()->SendPacket(&data); - plTarget->GetSession()->SendPacket(&data); + pl->SendDuelCountdown(3000); + plTarget->SendDuelCountdown(3000); } void WorldSession::HandleDuelCancelledOpcode(WorldPacket& recvPacket) { - CHECK_PACKET_SIZE(recvPacket,8); + CHECK_PACKET_SIZE(recvPacket, 8); //sLog.outDebug( "WORLD: received CMSG_DUEL_CANCELLED" ); diff --git a/src/game/GameObject.h b/src/game/GameObject.h index 8f2e1908f..569d8059d 100644 --- a/src/game/GameObject.h +++ b/src/game/GameObject.h @@ -45,7 +45,7 @@ struct GameObjectInfo uint32 faction; uint32 flags; float size; - uint32 questItems[4]; + uint32 questItems[6]; union // different GO types have different data field { //0 GAMEOBJECT_TYPE_DOOR diff --git a/src/game/Group.cpp b/src/game/Group.cpp index 0e4cb4e87..3ea0a204e 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -69,7 +69,7 @@ Group::~Group() // it is undefined whether objectmgr (which stores the groups) or instancesavemgr // will be unloaded first so we must be prepared for both cases // 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) itr2->second.save->RemoveGroup(this); @@ -92,11 +92,16 @@ bool Group::Create(const uint64 &guid, const char * name) m_lootThreshold = ITEM_QUALITY_UNCOMMON; m_looterGuid = guid; - m_difficulty = DIFFICULTY_NORMAL; + m_dungeonDifficulty = DUNGEON_DIFFICULTY_NORMAL; + m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL; if(!isBGGroup()) { 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); @@ -104,10 +109,10 @@ bool Group::Create(const uint64 &guid, const char * name) CharacterDatabase.BeginTransaction(); 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("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')", 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)) @@ -127,8 +132,8 @@ bool Group::LoadGroupFromDB(const uint64 &leaderGuid, QueryResult *result, bool if(!result) { external = false; - // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 - 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)); + // 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, raiddifficulty FROM groups WHERE leaderGuid ='%u'", GUID_LOPART(leaderGuid)); if(!result) return false; } @@ -147,7 +152,8 @@ bool Group::LoadGroupFromDB(const uint64 &leaderGuid, QueryResult *result, bool if (m_groupType == GROUPTYPE_RAID) _initRaidSubGroupsCounter(); - m_difficulty = (*result)[14].GetUInt8(); + m_dungeonDifficulty = (*result)[14].GetUInt8(); + m_raidDifficulty = (*result)[15].GetUInt8(); m_mainTank = (*result)[0].GetUInt64(); m_mainAssistant = (*result)[1].GetUInt64(); 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! 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->SetGroupUpdateFlag(GROUP_UPDATE_FULL); UpdatePlayerOutOfRange(player); - // quest related GO state dependent from raid memebership + // quest related GO state dependent from raid membership if(isRaidGroup()) player->UpdateForQuestWorldObjects(); } @@ -364,7 +370,7 @@ void Group::ChangeLeader(const uint64 &guid) { member_citerator slot = _getMemberCSlot(guid); - if(slot==m_memberSlots.end()) + if(slot == m_memberSlots.end()) return; _setLeader(guid); @@ -955,7 +961,8 @@ void Group::SendUpdate() data << (uint8)m_lootMethod; // loot method data << (uint64)m_looterGuid; // looter guid 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 ); } @@ -1072,7 +1079,7 @@ bool Group::_addMember(const uint64 &guid, const char* name, bool isAssistant, u else player->SetGroup(this, group); // 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()) player->m_InstanceValid = true; } @@ -1158,7 +1165,7 @@ void Group::_setLeader(const uint64 &guid) Player *player = objmgr.GetPlayer(slot->guid); 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();) { @@ -1445,21 +1452,36 @@ void Roll::targetObjectBuildLink() getTarget()->addLootValidatorRef(this); } -void Group::SetDifficulty(uint8 difficulty) +void Group::SetDungeonDifficulty(uint8 difficulty) { - m_difficulty = difficulty; - if(!isBGGroup()) CharacterDatabase.PExecute("UPDATE groups SET difficulty = %u WHERE leaderGuid ='%u'", m_difficulty, GUID_LOPART(m_leaderGuid)); + m_dungeonDifficulty = difficulty; + 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()) { Player *player = itr->getSource(); if(!player->GetSession() || player->getLevel() < LEVELREQUIREMENT_HEROIC) continue; - player->SetDifficulty(difficulty); + player->SetDungeonDifficulty(difficulty); 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) { 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 // 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();) { @@ -1494,7 +1516,7 @@ void Group::ResetInstances(uint8 method, Player* SendMsgTo) if(method == INSTANCE_RESET_ALL) { // 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; continue; @@ -1534,7 +1556,7 @@ InstanceGroupBind* Group::GetBoundInstance(uint32 mapid, uint8 difficulty) { // some instances only have one difficulty 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); if(itr != m_boundInstances[difficulty].end()) diff --git a/src/game/Group.h b/src/game/Group.h index 478b7c5cb..f6837e410 100644 --- a/src/game/Group.h +++ b/src/game/Group.h @@ -279,8 +279,10 @@ class MANGOS_DLL_SPEC Group } void SetTargetIcon(uint8 id, uint64 guid); - void SetDifficulty(uint8 difficulty); - uint8 GetDifficulty() { return m_difficulty; } + void SetDungeonDifficulty(uint8 difficulty); + uint8 GetDungeonDifficulty() { return m_dungeonDifficulty; } + void SetRaidDifficulty(uint8 difficulty); + uint8 GetRaidDifficulty() { return m_raidDifficulty; } uint16 InInstance(); bool InCombatToInstance(uint32 instanceId); void ResetInstances(uint8 method, Player* SendMsgTo); @@ -397,14 +399,15 @@ class MANGOS_DLL_SPEC Group uint64 m_mainTank; uint64 m_mainAssistant; GroupType m_groupType; - uint8 m_difficulty; + uint8 m_dungeonDifficulty; + uint8 m_raidDifficulty; BattleGround* m_bgGroup; uint64 m_targetIcons[TARGETICONCOUNT]; LootMethod m_lootMethod; ItemQualities m_lootThreshold; uint64 m_looterGuid; Rolls RollId; - BoundInstancesMap m_boundInstances[TOTAL_DIFFICULTIES]; + BoundInstancesMap m_boundInstances[TOTAL_DUNGEON_DIFFICULTIES]; uint8* m_subGroupsCounts; }; #endif diff --git a/src/game/InstanceSaveMgr.cpp b/src/game/InstanceSaveMgr.cpp index c19462472..b52f74504 100644 --- a/src/game/InstanceSaveMgr.cpp +++ b/src/game/InstanceSaveMgr.cpp @@ -88,7 +88,7 @@ InstanceSave* InstanceSaveManager::AddInstanceSave(uint32 mapId, uint32 instance { // initialize reset time // 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); else { @@ -175,7 +175,7 @@ time_t InstanceSave::GetResetTimeForDB() { // only save the reset time for normal instances 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; else return GetResetTime(); diff --git a/src/game/ItemHandler.cpp b/src/game/ItemHandler.cpp index 5a9ff8172..ac030bd67 100644 --- a/src/game/ItemHandler.cpp +++ b/src/game/ItemHandler.cpp @@ -329,6 +329,7 @@ void WorldSession::HandleItemQuerySingleOpcode( WorldPacket & recv_data ) data << pProto->DisplayInfoID; data << pProto->Quality; data << pProto->Flags; + data << pProto->Faction; // 3.2 faction? data << pProto->BuyPrice; data << pProto->SellPrice; data << pProto->InventoryType; diff --git a/src/game/ItemPrototype.h b/src/game/ItemPrototype.h index b34488553..cfa41ac05 100644 --- a/src/game/ItemPrototype.h +++ b/src/game/ItemPrototype.h @@ -511,6 +511,7 @@ struct ItemPrototype uint32 DisplayInfoID; // id from ItemDisplayInfo.dbc uint32 Quality; uint32 Flags; + uint32 Faction; uint32 BuyCount; uint32 BuyPrice; uint32 SellPrice; diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp index ba089c72d..7bc7c8682 100644 --- a/src/game/Level1.cpp +++ b/src/game/Level1.cpp @@ -537,19 +537,19 @@ bool ChatHandler::HandleGonameCommand(const char* args) // if the player or the player's group is bound to another instance // 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) { Group *group = _player->GetGroup(); // 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 (!gBind) if (InstanceSave *save = sInstanceSaveManager.GetInstanceSave(target->GetInstanceId())) _player->BindToInstance(save, !save->CanReset()); } - _player->SetDifficulty(target->GetDifficulty()); + _player->SetDungeonDifficulty(target->GetDungeonDifficulty()); } PSendSysMessage(LANG_APPEARING_AT, chrNameLink.c_str()); diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 818864a51..87b26eed7 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -6115,14 +6115,14 @@ bool ChatHandler::HandleInstanceListBindsCommand(const char* /*args*/) Player* player = getSelectedPlayer(); if (!player) player = m_session->GetPlayer(); 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); for(Player::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr) { InstanceSave *save = itr->second.save; 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++; } } @@ -6131,14 +6131,14 @@ bool ChatHandler::HandleInstanceListBindsCommand(const char* /*args*/) Group *group = player->GetGroup(); 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); for(Group::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr) { InstanceSave *save = itr->second.save; 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++; } } @@ -6159,7 +6159,7 @@ bool ChatHandler::HandleInstanceUnbindCommand(const char* args) Player* player = getSelectedPlayer(); if (!player) player = m_session->GetPlayer(); 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); 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; 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); counter++; } diff --git a/src/game/Makefile.am b/src/game/Makefile.am index 96f9ae399..36f7f6a48 100644 --- a/src/game/Makefile.am +++ b/src/game/Makefile.am @@ -46,10 +46,12 @@ libmangosgame_a_SOURCES = \ BattleGround.cpp \ BattleGroundAA.cpp \ BattleGroundAB.cpp \ + BattleGroundABG.cpp \ BattleGroundAV.cpp \ BattleGroundBE.cpp \ BattleGroundDS.cpp \ BattleGroundEY.cpp \ + BattleGroundIC.cpp \ BattleGroundNA.cpp \ BattleGroundRL.cpp \ BattleGroundRV.cpp \ @@ -58,10 +60,12 @@ libmangosgame_a_SOURCES = \ BattleGround.h \ BattleGroundAA.h \ BattleGroundAB.h \ + BattleGroundABG.h \ BattleGroundAV.h \ BattleGroundBE.h \ BattleGroundDS.h \ BattleGroundEY.h \ + BattleGroundIC.h \ BattleGroundNA.h \ BattleGroundRL.h \ BattleGroundRV.h \ diff --git a/src/game/Map.cpp b/src/game/Map.cpp index f8c02b975..95470f94d 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -2507,7 +2507,7 @@ void InstanceMap::UnloadAll(bool pForce) void InstanceMap::SendResetWarnings(uint32 timeLeft) const { 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) @@ -2534,7 +2534,7 @@ uint32 InstanceMap::GetMaxPlayers() const /* ******* Battleground Instance Maps ******* */ BattleGroundMap::BattleGroundMap(uint32 id, time_t expiry, uint32 InstanceId) - : Map(id, expiry, InstanceId, DIFFICULTY_NORMAL) + : Map(id, expiry, InstanceId, DUNGEON_DIFFICULTY_NORMAL) { } diff --git a/src/game/Map.h b/src/game/Map.h index a07553181..faefcfa5b 100644 --- a/src/game/Map.h +++ b/src/game/Map.h @@ -348,7 +348,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager, public MaNGOS::Obj // 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 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 IsBattleArena() const { return i_mapEntry && i_mapEntry->IsBattleArena(); } bool IsBattleGroundOrArena() const { return i_mapEntry && i_mapEntry->IsBattleGroundOrArena(); } diff --git a/src/game/MapInstanced.cpp b/src/game/MapInstanced.cpp index e6eaa6298..43fc398f7 100644 --- a/src/game/MapInstanced.cpp +++ b/src/game/MapInstanced.cpp @@ -153,7 +153,7 @@ Map* MapInstanced::GetInstance(const WorldObject* obj) return map; } - InstancePlayerBind *pBind = player->GetBoundInstance(GetId(), player->GetDifficulty()); + InstancePlayerBind *pBind = player->GetBoundInstance(GetId(), player->GetDungeonDifficulty()); InstanceSave *pSave = pBind ? pBind->save : NULL; // the player's permanet player bind is taken into consideration first @@ -163,7 +163,7 @@ Map* MapInstanced::GetInstance(const WorldObject* obj) InstanceGroupBind *groupBind = NULL; Group *group = player->GetGroup(); // 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; } @@ -182,7 +182,7 @@ Map* MapInstanced::GetInstance(const WorldObject* obj) // if no instanceId via group members or instance saves is found // the instance will be created for the first time 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 - 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"); diff --git a/src/game/MapManager.cpp b/src/game/MapManager.cpp index 81b3786a5..314e44527 100644 --- a/src/game/MapManager.cpp +++ b/src/game/MapManager.cpp @@ -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 - if (!entry->SupportsHeroicMode() && player->GetDifficulty() == DIFFICULTY_HEROIC) + if (!entry->SupportsHeroicMode() && player->GetDungeonDifficulty() == DUNGEON_DIFFICULTY_HEROIC) { //Send aborted message - player->SendTransferAborted(mapid, TRANSFER_ABORT_DIFFICULTY, DIFFICULTY_HEROIC); + player->SendTransferAborted(mapid, TRANSFER_ABORT_DIFFICULTY, DUNGEON_DIFFICULTY_HEROIC); return false; } diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index 95730eb6a..30aa8a7cb 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -845,7 +845,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) missingItem = at->requiredItem2; uint32 missingKey = 0; - if(GetPlayer()->GetDifficulty() == DIFFICULTY_HEROIC) + if(GetPlayer()->GetDungeonDifficulty() == DUNGEON_DIFFICULTY_HEROIC) { if(at->heroicKey) { @@ -858,7 +858,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) } uint32 missingQuest = 0; - if(GetPlayer()->GetDifficulty() == DIFFICULTY_HEROIC) + if(GetPlayer()->GetDungeonDifficulty() == DUNGEON_DIFFICULTY_HEROIC) { if (at->requiredQuestHeroic && !GetPlayer()->GetQuestRewardStatus(at->requiredQuestHeroic)) missingQuest = at->requiredQuestHeroic; @@ -875,7 +875,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) if(missingItem) SendAreaTriggerMessage(GetMangosString(LANG_LEVEL_MINREQUIRED_AND_ITEM), at->requiredLevel, objmgr.GetItemPrototype(missingItem)->Name1); 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) SendAreaTriggerMessage(at->requiredFailedText.c_str()); else if(missingLevel) @@ -1469,10 +1469,10 @@ void WorldSession::HandleSetDungeonDifficultyOpcode( WorldPacket & recv_data ) uint32 mode; recv_data >> mode; - if(mode == _player->GetDifficulty()) + if(mode == _player->GetDungeonDifficulty()) 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); return; @@ -1496,13 +1496,60 @@ void WorldSession::HandleSetDungeonDifficultyOpcode( WorldPacket & recv_data ) // the difficulty is set even if the instances can't be reset //_player->SendDungeonDifficulty(true); pGroup->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, _player); - pGroup->SetDifficulty(mode); + pGroup->SetDungeonDifficulty(mode); } } else { _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); } } diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index ef6e0a136..9afab8936 100644 --- a/src/game/MovementHandler.cpp +++ b/src/game/MovementHandler.cpp @@ -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); - GetPlayer()->SendInstanceResetWarning(GetPlayer()->GetMapId(), GetPlayer()->GetDifficulty(), timeleft); + GetPlayer()->SendInstanceResetWarning(GetPlayer()->GetMapId(), GetPlayer()->GetDungeonDifficulty(), timeleft); } // mount allow check diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 81c3fba9e..691430a4d 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -2922,8 +2922,8 @@ void ObjectMgr::LoadGroups() Group *group = NULL; uint64 leaderGuid = 0; uint32 count = 0; - // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - QueryResult *result = CharacterDatabase.Query("SELECT mainTank, mainAssistant, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, isRaid, difficulty, leaderGuid FROM groups"); + // 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, raiddifficulty, leaderGuid FROM groups"); if( !result ) { @@ -2943,7 +2943,7 @@ void ObjectMgr::LoadGroups() bar.step(); Field *fields = result->Fetch(); ++count; - leaderGuid = MAKE_NEW_GUID(fields[15].GetUInt32(),0,HIGHGUID_PLAYER); + leaderGuid = MAKE_NEW_GUID(fields[16].GetUInt32(),0,HIGHGUID_PLAYER); group = new Group; if(!group->LoadGroupFromDB(leaderGuid, result, false)) diff --git a/src/game/Opcodes.cpp b/src/game/Opcodes.cpp index 6d6e08c0d..c2edf1e62 100644 --- a/src/game/Opcodes.cpp +++ b/src/game/Opcodes.cpp @@ -1284,7 +1284,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x4E7*/ { "UMSG_UNKNOWN_1255", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4E8*/ { "UMSG_UNKNOWN_1256", 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 }, /*0x4EC*/ { "UMSG_UNKNOWN_1260", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4ED*/ { "UMSG_UNKNOWN_1261", STATUS_NEVER, &WorldSession::Handle_NULL }, diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h index a68fd3f11..f2b561256 100644 --- a/src/game/Opcodes.h +++ b/src/game/Opcodes.h @@ -1292,7 +1292,7 @@ enum Opcodes CMSG_UNKNOWN_1255 = 0x4E7, // lua: BattlefieldMgrExitRequest SMSG_UNKNOWN_1256 = 0x4E8, // uint32, uint32 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 SMSG_TOGGLE_XP_GAIN = 0x4EC, // enable/disable XP gain console message UMSG_UNKNOWN_1261 = 0x4ED, // not found 3.2 diff --git a/src/game/Player.cpp b/src/game/Player.cpp index e4eecf09d..8d109da90 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -418,7 +418,8 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa m_HomebindTimer = 0; m_InstanceValid = true; - m_dungeonDifficulty = DIFFICULTY_NORMAL; + m_dungeonDifficulty = DUNGEON_DIFFICULTY_NORMAL; + m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL; m_lastPotionId = 0; @@ -502,7 +503,7 @@ Player::~Player () delete ItemSetEff[x]; // 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) itr->second.save->RemovePlayer(this); @@ -13995,7 +13996,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) uint32 transGUID = fields[31].GetUInt32(); Relocate(fields[13].GetFloat(),fields[14].GetFloat(),fields[15].GetFloat(),fields[17].GetFloat()); 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)); @@ -15099,7 +15100,7 @@ void Player::_LoadGroup(QueryResult *result) if(getLevel() >= LEVELREQUIREMENT_HEROIC) { // 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) { - for(uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i) + for(uint8 i = 0; i < TOTAL_DUNGEON_DIFFICULTIES; ++i) m_boundInstances[i].clear(); Group *group = GetGroup(); @@ -15154,7 +15155,7 @@ InstancePlayerBind* Player::GetBoundInstance(uint32 mapid, uint8 difficulty) { // some instances only have one difficulty 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); if(itr != m_boundInstances[difficulty].end()) @@ -15221,7 +15222,7 @@ void Player::SendRaidInfo() 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) { @@ -15249,7 +15250,7 @@ void Player::SendSavedInstances() bool hasBeenSaved = false; 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) { @@ -15269,7 +15270,7 @@ void Player::SendSavedInstances() if(!hasBeenSaved) 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) { @@ -15297,7 +15298,7 @@ void Player::ConvertInstancesToGroup(Player *player, Group *group, uint64 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();) { @@ -15434,7 +15435,7 @@ void Player::SaveToDB() if(!IsBeingTeleported()) { ss << GetMapId() << ", " - << (uint32)GetDifficulty() << ", " + << (uint32)GetDungeonDifficulty() << ", " << finiteAlways(GetPositionX()) << ", " << finiteAlways(GetPositionY()) << ", " << finiteAlways(GetPositionZ()) << ", " @@ -15443,7 +15444,7 @@ void Player::SaveToDB() else { ss << GetTeleportDest().mapid << ", " - << (uint32)GetDifficulty() << ", " + << (uint32)GetDungeonDifficulty() << ", " << finiteAlways(GetTeleportDest().coord_x) << ", " << finiteAlways(GetTeleportDest().coord_y) << ", " << finiteAlways(GetTeleportDest().coord_z) << ", " @@ -16059,7 +16060,17 @@ void Player::SendDungeonDifficulty(bool IsInGroup) { uint8 val = 0x00000001; 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(IsInGroup); 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 // 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();) { @@ -16093,7 +16104,7 @@ void Player::ResetInstances(uint8 method) if(method == INSTANCE_RESET_ALL) { // 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; continue; @@ -20322,3 +20333,10 @@ void Player::SendClearCooldown( uint32 spell_id, Unit* target ) data << uint64(target->GetGUID()); SendDirectMessage(&data); } + +void Player::SendDuelCountdown(uint32 counter) +{ + WorldPacket data(SMSG_DUEL_COUNTDOWN, 4); + data << uint32(counter); // seconds + GetSession()->SendPacket(&data); +} diff --git a/src/game/Player.h b/src/game/Player.h index 836eccb8b..f5600e409 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1505,6 +1505,7 @@ class MANGOS_DLL_SPEC Player : public Unit void UpdateDuelFlag(time_t currTime); void CheckDuelDistance(time_t currTime); void DuelComplete(DuelCompleteType type); + void SendDuelCountdown(uint32 counter); bool IsGroupVisibleFor(Player* p) const; bool IsInSameGroupWith(Player const* p) const; @@ -1535,9 +1536,11 @@ class MANGOS_DLL_SPEC Player : public Unit uint32 GetArenaTeamIdInvited() { return m_ArenaTeamIdInvited; } static void LeaveAllArenaTeams(uint64 guid); - void SetDifficulty(uint32 dungeon_difficulty) { m_dungeonDifficulty = dungeon_difficulty; } - uint8 GetDifficulty() { return m_dungeonDifficulty; } - bool IsHeroic() { return m_dungeonDifficulty == DIFFICULTY_HEROIC; } + void SetDungeonDifficulty(uint32 dungeon_difficulty) { m_dungeonDifficulty = dungeon_difficulty; } + uint8 GetDungeonDifficulty() { return m_dungeonDifficulty; } + 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 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 SendDungeonDifficulty(bool IsInGroup); + void SendRaidDifficulty(bool IsInGroup); void ResetInstances(uint8 method); void SendResetInstanceSuccess(uint32 MapId); void SendResetInstanceFailed(uint32 reason, uint32 MapId); @@ -2037,7 +2041,7 @@ class MANGOS_DLL_SPEC Player : public Unit uint32 m_HomebindTimer; bool m_InstanceValid; // permanent binds and solo binds by difficulty - BoundInstancesMap m_boundInstances[TOTAL_DIFFICULTIES]; + BoundInstancesMap m_boundInstances[TOTAL_DUNGEON_DIFFICULTIES]; InstancePlayerBind* GetBoundInstance(uint32 mapid, uint8 difficulty); BoundInstancesMap& GetBoundInstances(uint8 difficulty) { return m_boundInstances[difficulty]; } void UnbindInstance(uint32 mapid, uint8 difficulty, bool unload = false); @@ -2194,6 +2198,7 @@ class MANGOS_DLL_SPEC Player : public Unit time_t m_speakTime; uint32 m_speakCount; uint32 m_dungeonDifficulty; + uint32 m_raidDifficulty; uint32 m_atLoginFlags; diff --git a/src/game/QueryHandler.cpp b/src/game/QueryHandler.cpp index fd7846bdc..88f824ea5 100644 --- a/src/game/QueryHandler.cpp +++ b/src/game/QueryHandler.cpp @@ -198,8 +198,8 @@ void WorldSession::HandleCreatureQueryOpcode( WorldPacket & recv_data ) data << float(ci->unk16); // unk data << float(ci->unk17); // unk data << uint8(ci->RacialLeader); - for(uint32 i = 0; i < 4; ++i) - data << uint32(ci->questItems[i]); // itemId[4], quest drop + for(uint32 i = 0; i < 6; ++i) + data << uint32(ci->questItems[i]); // itemId[6], quest drop data << uint32(ci->movementId); // CreatureMovementInfo.dbc SendPacket( &data ); 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.append(info->raw.data, 24); data << float(info->size); // go size - for(uint32 i = 0; i < 4; ++i) - data << uint32(info->questItems[i]); // itemId[4], quest drop + for(uint32 i = 0; i < 6; ++i) + data << uint32(info->questItems[i]); // itemId[6], quest drop SendPacket( &data ); sLog.outDebug( "WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE" ); } diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index e4e89b963..66381f6ce 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -2351,9 +2351,18 @@ enum DiminishingGroup enum DungeonDifficulties { - DIFFICULTY_NORMAL = 0, - DIFFICULTY_HEROIC = 1, - TOTAL_DIFFICULTIES + DUNGEON_DIFFICULTY_NORMAL = 0, + DUNGEON_DIFFICULTY_HEROIC = 1, + 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 @@ -2519,9 +2528,11 @@ enum BattleGroundTypeId BATTLEGROUND_RL = 8, BATTLEGROUND_SA = 9, 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 { diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h index 38fe40af0..1f040849d 100644 --- a/src/game/WorldSession.h +++ b/src/game/WorldSession.h @@ -627,6 +627,7 @@ class MANGOS_DLL_SPEC WorldSession void HandleFarSightOpcode(WorldPacket& recv_data); void HandleSetLfgOpcode(WorldPacket& recv_data); void HandleSetDungeonDifficultyOpcode(WorldPacket& recv_data); + void HandleSetRaidDifficultyOpcode(WorldPacket& recv_data); void HandleMoveSetCanFlyAckOpcode(WorldPacket& recv_data); void HandleLfgSetAutoJoinOpcode(WorldPacket& recv_data); void HandleLfgClearAutoJoinOpcode(WorldPacket& recv_data); diff --git a/src/shared/Database/SQLStorage.cpp b/src/shared/Database/SQLStorage.cpp index 288b66539..74bbcef45 100644 --- a/src/shared/Database/SQLStorage.cpp +++ b/src/shared/Database/SQLStorage.cpp @@ -25,16 +25,16 @@ extern DatabasePostgre WorldDatabase; extern DatabaseMysql WorldDatabase; #endif -const char CreatureInfosrcfmt[]="iiiiiiiisssiiiiiiiiiiffiffiifiiiiiiiiiiffiiiiiiiiiiiiiiiiiiisiiffliiiiiliiis"; -const char CreatureInfodstfmt[]="iiiiiiiisssiiiiiiiiiiffiffiifiiiiiiiiiiffiiiiiiiiiiiiiiiiiiisiiffliiiiiliiii"; +const char CreatureInfosrcfmt[]="iiiiiiiisssiiiiiiiiiiffiffiifiiiiiiiiiiffiiiiiiiiiiiiiiiiiiisiiffliiiiiiiliiis"; +const char CreatureInfodstfmt[]="iiiiiiiisssiiiiiiiiiiffiffiifiiiiiiiiiiffiiiiiiiiiiiiiiiiiiisiiffliiiiiiiliiii"; const char CreatureDataAddonInfofmt[]="iiiiiis"; const char CreatureModelfmt[]="iffbi"; const char CreatureInfoAddonInfofmt[]="iiiiiis"; const char EquipmentInfofmt[]="iiii"; -const char GameObjectInfosrcfmt[]="iiissssiifiiiiiiiiiiiiiiiiiiiiiiiiiiiis"; -const char GameObjectInfodstfmt[]="iiissssiifiiiiiiiiiiiiiiiiiiiiiiiiiiiii"; -const char ItemPrototypesrcfmt[]="iiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiiisiiii"; -const char ItemPrototypedstfmt[]="iiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiiiiiiii"; +const char GameObjectInfosrcfmt[]="iiissssiifiiiiiiiiiiiiiiiiiiiiiiiiiiiiiis"; +const char GameObjectInfodstfmt[]="iiissssiifiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii"; +const char ItemPrototypesrcfmt[]="iiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiiisiiii"; +const char ItemPrototypedstfmt[]="iiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiiiiiiii"; const char PageTextfmt[]="isi"; const char SpellThreatfmt[]="ii"; const char InstanceTemplatesrcfmt[]="iiiiiiiffffs"; diff --git a/win/VC100/game.vcxproj b/win/VC100/game.vcxproj index c35c9ab4c..100e7dd1a 100644 --- a/win/VC100/game.vcxproj +++ b/win/VC100/game.vcxproj @@ -355,11 +355,13 @@ + + @@ -501,10 +503,12 @@ + + diff --git a/win/VC80/game.vcproj b/win/VC80/game.vcproj index e4b1c4567..aac5d0b5f 100644 --- a/win/VC80/game.vcproj +++ b/win/VC80/game.vcproj @@ -565,6 +565,14 @@ RelativePath="..\..\src\game\BattleGroundAB.h" > + + + + @@ -601,6 +609,14 @@ RelativePath="..\..\src\game\BattleGroundHandler.cpp" > + + + + diff --git a/win/VC90/game.vcproj b/win/VC90/game.vcproj index a634b2ec5..01beb6159 100644 --- a/win/VC90/game.vcproj +++ b/win/VC90/game.vcproj @@ -565,6 +565,14 @@ RelativePath="..\..\src\game\BattleGroundAB.h" > + + + + @@ -601,6 +609,14 @@ RelativePath="..\..\src\game\BattleGroundHandler.cpp" > + + + +