mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
[0028] Implented new phase/map/terrain swap system for cata.
This commit is contained in:
parent
3561a43fe1
commit
3b8fb556a7
20 changed files with 288 additions and 16 deletions
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `character_db_version`;
|
DROP TABLE IF EXISTS `character_db_version`;
|
||||||
CREATE TABLE `character_db_version` (
|
CREATE TABLE `character_db_version` (
|
||||||
`required_0001_xxxxx_01_characters` bit(1) default NULL
|
`required_0028_01_characters_character_phase_data` bit(1) default NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Last applied sql update to DB';
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Last applied sql update to DB';
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
@ -670,6 +670,27 @@ LOCK TABLES `character_pet_declinedname` WRITE;
|
||||||
/*!40000 ALTER TABLE `character_pet_declinedname` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `character_pet_declinedname` ENABLE KEYS */;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `character_phase_data`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `character_phase_data`;
|
||||||
|
CREATE TABLE `character_phase_data` (
|
||||||
|
`guid` int(11) NOT NULL,
|
||||||
|
`map` smallint(6) NOT NULL,
|
||||||
|
`phase` int(11) NOT NULL,
|
||||||
|
PRIMARY KEY (`guid`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `character_phase_data`
|
||||||
|
--
|
||||||
|
|
||||||
|
LOCK TABLES `character_phase_data` WRITE;
|
||||||
|
/*!40000 ALTER TABLE `character_phase_data` DISABLE KEYS */;
|
||||||
|
/*!40000 ALTER TABLE `character_phase_data` ENABLE KEYS */;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `character_queststatus`
|
-- Table structure for table `character_queststatus`
|
||||||
--
|
--
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
|
||||||
`version` varchar(120) default NULL,
|
`version` varchar(120) default NULL,
|
||||||
`creature_ai_version` varchar(120) default NULL,
|
`creature_ai_version` varchar(120) default NULL,
|
||||||
`cache_id` int(10) default '0',
|
`cache_id` int(10) default '0',
|
||||||
`required_0023_xxxxx_01_mangos_player_classlevelstats` bit(1) default NULL
|
`required_0028_03_mangos_playercreateinfo` bit(1) default NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
@ -10622,6 +10622,7 @@ CREATE TABLE `playercreateinfo` (
|
||||||
`position_y` float NOT NULL default '0',
|
`position_y` float NOT NULL default '0',
|
||||||
`position_z` float NOT NULL default '0',
|
`position_z` float NOT NULL default '0',
|
||||||
`orientation` float NOT NULL default '0',
|
`orientation` float NOT NULL default '0',
|
||||||
|
`phaseMap` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`race`,`class`)
|
PRIMARY KEY (`race`,`class`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
|
@ -14198,6 +14199,26 @@ LOCK TABLES `quest_end_scripts` WRITE;
|
||||||
/*!40000 ALTER TABLE `quest_end_scripts` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `quest_end_scripts` ENABLE KEYS */;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `quest_phase_maps`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `quest_phase_maps`;
|
||||||
|
CREATE TABLE `quest_phase_maps` (
|
||||||
|
`questId` int(11) NOT NULL,
|
||||||
|
`map` smallint(6) NOT NULL,
|
||||||
|
`phase` int(11) NOT NULL,
|
||||||
|
PRIMARY KEY (`questId`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `quest_phase_maps`
|
||||||
|
--
|
||||||
|
|
||||||
|
LOCK TABLES `quest_phase_maps` WRITE;
|
||||||
|
/*!40000 ALTER TABLE `quest_phase_maps` DISABLE KEYS */;
|
||||||
|
/*!40000 ALTER TABLE `quest_phase_maps` ENABLE KEYS */;
|
||||||
|
UNLOCK TABLES;
|
||||||
--
|
--
|
||||||
-- Table structure for table `quest_poi`
|
-- Table structure for table `quest_poi`
|
||||||
--
|
--
|
||||||
|
|
|
||||||
33
sql/updates/0028_01_characters_character_phase_data.sql
Normal file
33
sql/updates/0028_01_characters_character_phase_data.sql
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
ALTER TABLE db_version CHANGE COLUMN required_0001_xxxxx_01_characters required_0028_01_characters_character_phase_data bit;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Navicat MySQL Data Transfer
|
||||||
|
|
||||||
|
Source Server : local
|
||||||
|
Source Server Version : 50519
|
||||||
|
Source Host : localhost:3306
|
||||||
|
Source Database : chars
|
||||||
|
|
||||||
|
Target Server Type : MYSQL
|
||||||
|
Target Server Version : 50519
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 2012-07-11 19:50:47
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS=0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for `character_phase_data`
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `character_phase_data`;
|
||||||
|
CREATE TABLE `character_phase_data` (
|
||||||
|
`guid` int(11) NOT NULL,
|
||||||
|
`map` smallint(6) NOT NULL,
|
||||||
|
`phase` int(11) NOT NULL DEFAULT '1',
|
||||||
|
PRIMARY KEY (`guid`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of character_phase_data
|
||||||
|
-- ----------------------------
|
||||||
33
sql/updates/0028_02_mangos_quest_phase_maps.sql
Normal file
33
sql/updates/0028_02_mangos_quest_phase_maps.sql
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
ALTER TABLE db_version CHANGE COLUMN required_0023_xxxxx_01_mangos_player_classlevelstats required_0028_02_mangos_quest_phase_maps bit;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Navicat MySQL Data Transfer
|
||||||
|
|
||||||
|
Source Server : local
|
||||||
|
Source Server Version : 50519
|
||||||
|
Source Host : localhost:3306
|
||||||
|
Source Database : mangos
|
||||||
|
|
||||||
|
Target Server Type : MYSQL
|
||||||
|
Target Server Version : 50519
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 2012-07-11 19:28:57
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS=0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for `quest_phase_maps`
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `quest_phase_maps`;
|
||||||
|
CREATE TABLE `quest_phase_maps` (
|
||||||
|
`questId` int(11) NOT NULL,
|
||||||
|
`map` smallint(6) NOT NULL,
|
||||||
|
`phase` int(11) NOT NULL,
|
||||||
|
PRIMARY KEY (`questId`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of quest_phase_maps
|
||||||
|
-- ----------------------------
|
||||||
4
sql/updates/0028_03_mangos_playercreateinfo.sql
Normal file
4
sql/updates/0028_03_mangos_playercreateinfo.sql
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
ALTER TABLE db_version CHANGE COLUMN required_0028_02_mangos_quest_phase_maps required_0028_03_mangos_playercreateinfo bit;
|
||||||
|
|
||||||
|
ALTER TABLE `playercreateinfo`
|
||||||
|
ADD COLUMN `phaseMap` INT(11) UNSIGNED NOT NULL DEFAULT '0' AFTER `orientation`;
|
||||||
|
|
@ -553,6 +553,18 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recv_data)
|
||||||
LoginDatabase.PExecute("DELETE FROM realmcharacters WHERE acctid= '%u' AND realmid = '%u'", GetAccountId(), realmID);
|
LoginDatabase.PExecute("DELETE FROM realmcharacters WHERE acctid= '%u' AND realmid = '%u'", GetAccountId(), realmID);
|
||||||
LoginDatabase.PExecute("INSERT INTO realmcharacters (numchars, acctid, realmid) VALUES (%u, %u, %u)", charcount, GetAccountId(), realmID);
|
LoginDatabase.PExecute("INSERT INTO realmcharacters (numchars, acctid, realmid) VALUES (%u, %u, %u)", charcount, GetAccountId(), realmID);
|
||||||
|
|
||||||
|
result = WorldDatabase.PQuery("SELECT phaseMap FROM playercreateinfo WHERE race = '%u' AND class = '%u'", race_, class_);
|
||||||
|
if(result)
|
||||||
|
{
|
||||||
|
Field* field = result->Fetch();
|
||||||
|
uint16 mapId = field[0].GetUInt16();
|
||||||
|
|
||||||
|
if (mapId != 0)
|
||||||
|
CharacterDatabase.PExecute("INSERT INTO character_phase_data (`guid`, `map`) VALUES (%u, %u)", pNewChar->GetGUIDLow(), mapId);
|
||||||
|
|
||||||
|
delete result;
|
||||||
|
}
|
||||||
|
|
||||||
data << (uint8)CHAR_CREATE_SUCCESS;
|
data << (uint8)CHAR_CREATE_SUCCESS;
|
||||||
SendPacket(&data);
|
SendPacket(&data);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6650,6 +6650,50 @@ void ObjectMgr::LoadQuestPOI()
|
||||||
sLog.outString(">> Loaded %u quest POI definitions", count);
|
sLog.outString(">> Loaded %u quest POI definitions", count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ObjectMgr::LoadQuestPhaseMaps()
|
||||||
|
{
|
||||||
|
mQuestPhaseMap.clear(); // need for reload case
|
||||||
|
|
||||||
|
uint32 count = 0;
|
||||||
|
|
||||||
|
// 0 1
|
||||||
|
QueryResult *result = WorldDatabase.Query("SELECT questId, map, phase FROM quest_phase_maps");
|
||||||
|
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
BarGoLink bar(1);
|
||||||
|
|
||||||
|
bar.step();
|
||||||
|
|
||||||
|
sLog.outString();
|
||||||
|
sLog.outErrorDb(">> Loaded 0 quest phase maps definitions. DB table `quest_phase_maps` is empty.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
BarGoLink bar(result->GetRowCount());
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
Field *fields = result->Fetch();
|
||||||
|
bar.step();
|
||||||
|
|
||||||
|
uint32 questId = fields[0].GetUInt32();
|
||||||
|
uint16 mapId = fields[1].GetUInt16();
|
||||||
|
uint32 phase = fields[2].GetUInt32();
|
||||||
|
|
||||||
|
QuestPhaseMaps QuestPhase(mapId, phase);
|
||||||
|
|
||||||
|
mQuestPhaseMap[questId].push_back(QuestPhase);
|
||||||
|
|
||||||
|
++count;
|
||||||
|
} while (result->NextRow());
|
||||||
|
|
||||||
|
delete result;
|
||||||
|
|
||||||
|
sLog.outString();
|
||||||
|
sLog.outString(">> Loaded %u quest phase maps definitions", count);
|
||||||
|
}
|
||||||
|
|
||||||
void ObjectMgr::LoadNPCSpellClickSpells()
|
void ObjectMgr::LoadNPCSpellClickSpells()
|
||||||
{
|
{
|
||||||
uint32 count = 0;
|
uint32 count = 0;
|
||||||
|
|
|
||||||
|
|
@ -302,6 +302,17 @@ struct QuestPOI
|
||||||
typedef std::vector<QuestPOI> QuestPOIVector;
|
typedef std::vector<QuestPOI> QuestPOIVector;
|
||||||
typedef UNORDERED_MAP<uint32, QuestPOIVector> QuestPOIMap;
|
typedef UNORDERED_MAP<uint32, QuestPOIVector> QuestPOIMap;
|
||||||
|
|
||||||
|
struct QuestPhaseMaps
|
||||||
|
{
|
||||||
|
uint16 MapId;
|
||||||
|
uint32 PhaseMask;
|
||||||
|
|
||||||
|
QuestPhaseMaps(uint16 mapId, uint32 phaseMask) : MapId(mapId), PhaseMask(phaseMask) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef std::vector<QuestPhaseMaps> QuestPhaseMapsVector;
|
||||||
|
typedef UNORDERED_MAP<uint32, QuestPhaseMapsVector> QuestPhaseMapsMap;
|
||||||
|
|
||||||
#define WEATHER_SEASONS 4
|
#define WEATHER_SEASONS 4
|
||||||
struct WeatherSeasonChances
|
struct WeatherSeasonChances
|
||||||
{
|
{
|
||||||
|
|
@ -616,6 +627,15 @@ class ObjectMgr
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QuestPhaseMapsVector const* GetQuestPhaseMapVector(uint32 questId)
|
||||||
|
{
|
||||||
|
QuestPhaseMapsMap::const_iterator itr = mQuestPhaseMap.find(questId);
|
||||||
|
if(itr != mQuestPhaseMap.end())
|
||||||
|
return &itr->second;
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// Static wrappers for various accessors
|
// Static wrappers for various accessors
|
||||||
static GameObjectInfo const* GetGameObjectInfo(uint32 id); ///< Wrapper for sGOStorage.LookupEntry
|
static GameObjectInfo const* GetGameObjectInfo(uint32 id); ///< Wrapper for sGOStorage.LookupEntry
|
||||||
static Player* GetPlayer(const char* name); ///< Wrapper for ObjectAccessor::FindPlayerByName
|
static Player* GetPlayer(const char* name); ///< Wrapper for ObjectAccessor::FindPlayerByName
|
||||||
|
|
@ -696,6 +716,7 @@ class ObjectMgr
|
||||||
|
|
||||||
void LoadPointsOfInterest();
|
void LoadPointsOfInterest();
|
||||||
void LoadQuestPOI();
|
void LoadQuestPOI();
|
||||||
|
void LoadQuestPhaseMaps();
|
||||||
|
|
||||||
void LoadNPCSpellClickSpells();
|
void LoadNPCSpellClickSpells();
|
||||||
void LoadSpellTemplate();
|
void LoadSpellTemplate();
|
||||||
|
|
@ -1124,6 +1145,7 @@ class ObjectMgr
|
||||||
PointOfInterestMap mPointsOfInterest;
|
PointOfInterestMap mPointsOfInterest;
|
||||||
|
|
||||||
QuestPOIMap mQuestPOIMap;
|
QuestPOIMap mQuestPOIMap;
|
||||||
|
QuestPhaseMapsMap mQuestPhaseMap;
|
||||||
|
|
||||||
WeatherZoneMap mWeatherZoneMap;
|
WeatherZoneMap mWeatherZoneMap;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1190,7 +1190,7 @@ void InitializeOpcodes()
|
||||||
//OPCODE(CMSG_REQUEST_VEHICLE_SWITCH_SEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
|
//OPCODE(CMSG_REQUEST_VEHICLE_SWITCH_SEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
|
||||||
//OPCODE(CMSG_PET_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetLearnTalent );
|
//OPCODE(CMSG_PET_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetLearnTalent );
|
||||||
//OPCODE(CMSG_PET_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
|
//OPCODE(CMSG_PET_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
|
||||||
//OPCODE(SMSG_SET_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
OPCODE(SMSG_PHASE_SHIFT_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||||
OPCODE(SMSG_ALL_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
OPCODE(SMSG_ALL_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||||
//OPCODE(CMSG_FORCE_SAY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
|
//OPCODE(CMSG_FORCE_SAY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
|
||||||
//OPCODE(SMSG_HEALTH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
//OPCODE(SMSG_HEALTH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||||
|
|
|
||||||
|
|
@ -1184,7 +1184,7 @@ enum Opcodes
|
||||||
CMSG_REQUEST_VEHICLE_SWITCH_SEAT = 0x147A,
|
CMSG_REQUEST_VEHICLE_SWITCH_SEAT = 0x147A,
|
||||||
CMSG_PET_LEARN_TALENT = 0x147B,
|
CMSG_PET_LEARN_TALENT = 0x147B,
|
||||||
CMSG_PET_UNLEARN_TALENTS = 0x147C,
|
CMSG_PET_UNLEARN_TALENTS = 0x147C,
|
||||||
SMSG_SET_PHASE_SHIFT = 0x147D,
|
SMSG_PHASE_SHIFT_CHANGE = 0x70A0,
|
||||||
SMSG_ALL_ACHIEVEMENT_DATA = 0x58B1,
|
SMSG_ALL_ACHIEVEMENT_DATA = 0x58B1,
|
||||||
CMSG_FORCE_SAY_CHEAT = 0x147F,
|
CMSG_FORCE_SAY_CHEAT = 0x147F,
|
||||||
SMSG_HEALTH_UPDATE = 0x1480,
|
SMSG_HEALTH_UPDATE = 0x1480,
|
||||||
|
|
|
||||||
|
|
@ -4005,9 +4005,27 @@ void Player::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SetPhaseAndMap(target);
|
||||||
Unit::BuildCreateUpdateBlockForPlayer(data, target);
|
Unit::BuildCreateUpdateBlockForPlayer(data, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Player::SetPhaseAndMap(Player* target) const
|
||||||
|
{
|
||||||
|
QueryResult *result = CharacterDatabase.PQuery("SELECT map, phase FROM character_phase_data WHERE guid = '%u'", target->GetGUIDLow());
|
||||||
|
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
Field *fields = result->Fetch();
|
||||||
|
|
||||||
|
uint16 mapId = fields[0].GetUInt16();
|
||||||
|
uint32 phase = fields[1].GetUInt32();
|
||||||
|
|
||||||
|
target->GetSession()->SendSetPhaseShift(phase, mapId);
|
||||||
|
|
||||||
|
delete result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Player::DestroyForPlayer(Player* target, bool anim) const
|
void Player::DestroyForPlayer(Player* target, bool anim) const
|
||||||
{
|
{
|
||||||
Unit::DestroyForPlayer(target, anim);
|
Unit::DestroyForPlayer(target, anim);
|
||||||
|
|
@ -15347,6 +15365,17 @@ void Player::SendQuestReward(Quest const* pQuest, uint32 XP, Object* questGiver)
|
||||||
data << uint32(pQuest->GetBonusTalents()); // bonus talents
|
data << uint32(pQuest->GetBonusTalents()); // bonus talents
|
||||||
data << uint32(0); // arena points
|
data << uint32(0); // arena points
|
||||||
GetSession()->SendPacket(&data);
|
GetSession()->SendPacket(&data);
|
||||||
|
|
||||||
|
QuestPhaseMapsVector const* QuestPhaseVector = sObjectMgr.GetQuestPhaseMapVector(questid);
|
||||||
|
if (QuestPhaseVector)
|
||||||
|
{
|
||||||
|
for (QuestPhaseMapsVector::const_iterator itr = QuestPhaseVector->begin(); itr != QuestPhaseVector->end(); ++itr)
|
||||||
|
{
|
||||||
|
GetSession()->SendSetPhaseShift(itr->MapId, itr->PhaseMask);
|
||||||
|
CharacterDatabase.PExecute("DELETE FROM character_phase_data` WHERE `guid` = %u", GetSession()->GetPlayer()->GetGUIDLow());
|
||||||
|
CharacterDatabase.PExecute("INSERT INTO character_phase_data` (`guid`, `map`, `phase`) VALUES (%u, %u, %u)", GetSession()->GetPlayer()->GetGUIDLow(), itr->MapId, itr->PhaseMask);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::SendQuestFailed(uint32 quest_id, InventoryResult reason)
|
void Player::SendQuestFailed(uint32 quest_id, InventoryResult reason)
|
||||||
|
|
|
||||||
|
|
@ -56,9 +56,9 @@ class Item;
|
||||||
|
|
||||||
typedef std::deque<Mail*> PlayerMails;
|
typedef std::deque<Mail*> PlayerMails;
|
||||||
|
|
||||||
#define PLAYER_MAX_SKILLS 127
|
#define PLAYER_MAX_SKILLS 128
|
||||||
#define PLAYER_MAX_DAILY_QUESTS 25
|
#define PLAYER_MAX_DAILY_QUESTS 25
|
||||||
#define PLAYER_EXPLORED_ZONES_SIZE 128
|
#define PLAYER_EXPLORED_ZONES_SIZE 156
|
||||||
|
|
||||||
// Note: SPELLMOD_* values is aura types in fact
|
// Note: SPELLMOD_* values is aura types in fact
|
||||||
enum SpellModType
|
enum SpellModType
|
||||||
|
|
@ -1841,6 +1841,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||||
void SetSession(WorldSession* s) { m_session = s; }
|
void SetSession(WorldSession* s) { m_session = s; }
|
||||||
|
|
||||||
void BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const override;
|
void BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const override;
|
||||||
|
void SetPhaseAndMap(Player* target) const;
|
||||||
void DestroyForPlayer(Player* target, bool anim = false) const override;
|
void DestroyForPlayer(Player* target, bool anim = false) const override;
|
||||||
void SendLogXPGain(uint32 GivenXP, Unit* victim, uint32 RestXP);
|
void SendLogXPGain(uint32 GivenXP, Unit* victim, uint32 RestXP);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ class Player;
|
||||||
|
|
||||||
class ObjectMgr;
|
class ObjectMgr;
|
||||||
|
|
||||||
#define MAX_QUEST_LOG_SIZE 25
|
#define MAX_QUEST_LOG_SIZE 50
|
||||||
|
|
||||||
#define QUEST_OBJECTIVES_COUNT 4
|
#define QUEST_OBJECTIVES_COUNT 4
|
||||||
#define QUEST_ITEM_OBJECTIVES_COUNT 6
|
#define QUEST_ITEM_OBJECTIVES_COUNT 6
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,8 @@ class UpdateData
|
||||||
|
|
||||||
GuidSet const& GetOutOfRangeGUIDs() const { return m_outOfRangeGUIDs; }
|
GuidSet const& GetOutOfRangeGUIDs() const { return m_outOfRangeGUIDs; }
|
||||||
|
|
||||||
|
void SetMapId(uint16 mapId) { m_map = mapId; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
uint16 m_map;
|
uint16 m_map;
|
||||||
uint32 m_blockCount;
|
uint32 m_blockCount;
|
||||||
|
|
|
||||||
|
|
@ -1110,6 +1110,9 @@ void World::SetInitialWorldSettings()
|
||||||
sLog.outString("Loading Quest POI");
|
sLog.outString("Loading Quest POI");
|
||||||
sObjectMgr.LoadQuestPOI();
|
sObjectMgr.LoadQuestPOI();
|
||||||
|
|
||||||
|
sLog.outString("Loading Quest Phase Maps...");
|
||||||
|
sObjectMgr.LoadQuestPhaseMaps();
|
||||||
|
|
||||||
sLog.outString("Loading Quests Relations...");
|
sLog.outString("Loading Quests Relations...");
|
||||||
sLog.outString();
|
sLog.outString();
|
||||||
sObjectMgr.LoadQuestRelations(); // must be after quest load
|
sObjectMgr.LoadQuestRelations(); // must be after quest load
|
||||||
|
|
|
||||||
|
|
@ -569,10 +569,53 @@ void WorldSession::SendNotification(int32 string_id, ...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::SendSetPhaseShift(uint32 PhaseShift)
|
void WorldSession::SendSetPhaseShift(uint32 phaseMask, uint16 mapId)
|
||||||
{
|
{
|
||||||
WorldPacket data(SMSG_SET_PHASE_SHIFT, 4);
|
ObjectGuid guid = _player->GetObjectGuid();
|
||||||
data << uint32(PhaseShift);
|
uint8 guidMask[] = { 2, 3, 1, 6, 4, 5, 0, 7 };
|
||||||
|
uint8 guidBytes[] = { 1, 2, 6, 3, 0, 5 };
|
||||||
|
|
||||||
|
uint32 phaseFlags = 0;
|
||||||
|
|
||||||
|
for (uint32 i = 0; i < sPhaseStore.GetNumRows(); i++)
|
||||||
|
{
|
||||||
|
if (PhaseEntry const* phase = sPhaseStore.LookupEntry(i))
|
||||||
|
{
|
||||||
|
if (phase->PhaseShift == phaseMask)
|
||||||
|
{
|
||||||
|
phaseFlags = phase->Flags;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
WorldPacket data(SMSG_PHASE_SHIFT_CHANGE, 30);
|
||||||
|
data.WriteGuidMask<2, 3, 1, 6, 4, 5, 0, 7>(guid);
|
||||||
|
data.WriteGuidBytes<7, 4>(guid);
|
||||||
|
|
||||||
|
// Seen only 0 bytes
|
||||||
|
data << uint32(0);
|
||||||
|
|
||||||
|
data.WriteGuidBytes<1>(guid);
|
||||||
|
data << uint32(phaseMask ? phaseFlags : 8);
|
||||||
|
data.WriteGuidBytes<2, 6>(guid);
|
||||||
|
|
||||||
|
// Seen only 0 bytes
|
||||||
|
data << uint32(0);
|
||||||
|
|
||||||
|
// PhaseShift, uint16 (2 bytes)
|
||||||
|
data << uint32(phaseMask ? 2 : 0);
|
||||||
|
if (phaseMask)
|
||||||
|
data << uint16(phaseMask);
|
||||||
|
|
||||||
|
data.WriteGuidBytes<3, 0>(guid);
|
||||||
|
|
||||||
|
// MapId , uint16 (2 bytes)
|
||||||
|
data << uint32(mapId ? 2 : 0);
|
||||||
|
if (mapId)
|
||||||
|
data << uint16(mapId);
|
||||||
|
|
||||||
|
data.WriteGuidBytes<5>(guid);
|
||||||
SendPacket(&data);
|
SendPacket(&data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -250,7 +250,7 @@ class MANGOS_DLL_SPEC WorldSession
|
||||||
void SendPartyResult(PartyOperation operation, const std::string& member, PartyResult res);
|
void SendPartyResult(PartyOperation operation, const std::string& member, PartyResult res);
|
||||||
void SendGroupInvite(Player* player, bool alreadyInGroup = false);
|
void SendGroupInvite(Player* player, bool alreadyInGroup = false);
|
||||||
void SendAreaTriggerMessage(const char* Text, ...) ATTR_PRINTF(2, 3);
|
void SendAreaTriggerMessage(const char* Text, ...) ATTR_PRINTF(2, 3);
|
||||||
void SendSetPhaseShift(uint32 phaseShift);
|
void SendSetPhaseShift(uint32 phaseMask, uint16 mapId = 0);
|
||||||
void SendQueryTimeResponse();
|
void SendQueryTimeResponse();
|
||||||
void SendRedirectClient(std::string& ip, uint16 port);
|
void SendRedirectClient(std::string& ip, uint16 port);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -666,8 +666,12 @@ bool ChatHandler::HandleDebugSendSetPhaseShiftCommand(char* args)
|
||||||
if (!*args)
|
if (!*args)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint32 PhaseShift = atoi(args);
|
char* m = strtok((char*)args, " ");
|
||||||
m_session->SendSetPhaseShift(PhaseShift);
|
char* p = strtok(NULL, " ");
|
||||||
|
|
||||||
|
uint16 MapId = atoi(m);
|
||||||
|
uint32 PhaseShift = atoi(p);
|
||||||
|
m_session->SendSetPhaseShift(PhaseShift, MapId);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "0027"
|
#define REVISION_NR "0028"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#ifndef __REVISION_SQL_H__
|
#ifndef __REVISION_SQL_H__
|
||||||
#define __REVISION_SQL_H__
|
#define __REVISION_SQL_H__
|
||||||
#define REVISION_DB_CHARACTERS "required_0001_xxxxx_01_characters"
|
#define REVISION_DB_CHARACTERS "required_0028_01_characters_character_phase_data"
|
||||||
#define REVISION_DB_MANGOS "required_0023_xxxxx_01_mangos_player_classlevelstats"
|
#define REVISION_DB_MANGOS "required_0028_03_mangos_playercreateinfo"
|
||||||
#define REVISION_DB_REALMD "required_0014_xxxxx_01_realmd_account_access"
|
#define REVISION_DB_REALMD "required_0014_xxxxx_01_realmd_account_access"
|
||||||
#endif // __REVISION_SQL_H__
|
#endif // __REVISION_SQL_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue