mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
Fixed some bg and quest things
This commit is contained in:
parent
9d2acc22b4
commit
2a0fbbb0dd
9 changed files with 47 additions and 26 deletions
|
|
@ -65,7 +65,7 @@ void WorldSession::HandleBattleGroundHelloOpcode( WorldPacket & recv_data )
|
||||||
void WorldSession::SendBattlegGroundList( uint64 guid, BattleGroundTypeId bgTypeId )
|
void WorldSession::SendBattlegGroundList( uint64 guid, BattleGroundTypeId bgTypeId )
|
||||||
{
|
{
|
||||||
WorldPacket data;
|
WorldPacket data;
|
||||||
sBattleGroundMgr.BuildBattleGroundListPacket(&data, guid, _player, bgTypeId);
|
sBattleGroundMgr.BuildBattleGroundListPacket(&data, guid, _player, bgTypeId, 0);
|
||||||
SendPacket( &data );
|
SendPacket( &data );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -102,13 +102,6 @@ void WorldSession::HandleBattleGroundJoinOpcode( WorldPacket & recv_data )
|
||||||
if(_player->InBattleGround())
|
if(_player->InBattleGround())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Creature *unit = ObjectAccessor::GetCreature(*_player, guid);
|
|
||||||
if(!unit)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if(!unit->isBattleMaster()) // it's not battlemaster
|
|
||||||
return;
|
|
||||||
|
|
||||||
// get bg instance or bg template if instance not found
|
// get bg instance or bg template if instance not found
|
||||||
BattleGround * bg = NULL;
|
BattleGround * bg = NULL;
|
||||||
if(instanceId)
|
if(instanceId)
|
||||||
|
|
@ -272,8 +265,8 @@ void WorldSession::HandleBattleGroundListOpcode( WorldPacket &recv_data )
|
||||||
uint32 bgTypeId;
|
uint32 bgTypeId;
|
||||||
recv_data >> bgTypeId; // id from DBC
|
recv_data >> bgTypeId; // id from DBC
|
||||||
|
|
||||||
//uint8 unk;
|
uint8 fromWhere;
|
||||||
//recv_data >> unk; // that byte is constant 0 in 3.1
|
recv_data >> fromWhere; // 0 - battlemaster, 1 - UI
|
||||||
|
|
||||||
BattlemasterListEntry const* bl = sBattlemasterListStore.LookupEntry(bgTypeId);
|
BattlemasterListEntry const* bl = sBattlemasterListStore.LookupEntry(bgTypeId);
|
||||||
if(!bl)
|
if(!bl)
|
||||||
|
|
@ -283,7 +276,7 @@ void WorldSession::HandleBattleGroundListOpcode( WorldPacket &recv_data )
|
||||||
}
|
}
|
||||||
|
|
||||||
WorldPacket data;
|
WorldPacket data;
|
||||||
sBattleGroundMgr.BuildBattleGroundListPacket(&data, _player->GetGUID(), _player, BattleGroundTypeId(bgTypeId));
|
sBattleGroundMgr.BuildBattleGroundListPacket(&data, 0, _player, BattleGroundTypeId(bgTypeId), fromWhere);
|
||||||
SendPacket( &data );
|
SendPacket( &data );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1888,7 +1888,7 @@ void BattleGroundMgr::DistributeArenaPoints()
|
||||||
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_END);
|
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_END);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundMgr::BuildBattleGroundListPacket(WorldPacket *data, const uint64& guid, Player* plr, BattleGroundTypeId bgTypeId)
|
void BattleGroundMgr::BuildBattleGroundListPacket(WorldPacket *data, const uint64& guid, Player* plr, BattleGroundTypeId bgTypeId, uint8 fromWhere)
|
||||||
{
|
{
|
||||||
uint32 PlayerLevel = 10;
|
uint32 PlayerLevel = 10;
|
||||||
|
|
||||||
|
|
@ -1897,16 +1897,16 @@ void BattleGroundMgr::BuildBattleGroundListPacket(WorldPacket *data, const uint6
|
||||||
|
|
||||||
data->Initialize(SMSG_BATTLEFIELD_LIST);
|
data->Initialize(SMSG_BATTLEFIELD_LIST);
|
||||||
*data << uint64(guid); // battlemaster guid
|
*data << uint64(guid); // battlemaster guid
|
||||||
*data << uint8(0); // unknown 3.1
|
*data << uint8(fromWhere); // from where you joined
|
||||||
*data << uint32(bgTypeId); // battleground id
|
*data << uint32(bgTypeId); // battleground id
|
||||||
if(bgTypeId == BATTLEGROUND_AA) // arena
|
if(bgTypeId == BATTLEGROUND_AA) // arena
|
||||||
{
|
{
|
||||||
*data << uint8(5); // unk
|
*data << uint8(4); // unk
|
||||||
*data << uint32(0); // unk
|
*data << uint32(0); // unk (count?)
|
||||||
}
|
}
|
||||||
else // battleground
|
else // battleground
|
||||||
{
|
{
|
||||||
*data << uint8(0x00); // unk
|
*data << uint8(0x00); // unk, different for each bg type
|
||||||
|
|
||||||
size_t count_pos = data->wpos();
|
size_t count_pos = data->wpos();
|
||||||
uint32 count = 0;
|
uint32 count = 0;
|
||||||
|
|
|
||||||
|
|
@ -181,7 +181,7 @@ class BattleGroundMgr
|
||||||
/* Packet Building */
|
/* Packet Building */
|
||||||
void BuildPlayerJoinedBattleGroundPacket(WorldPacket *data, Player *plr);
|
void BuildPlayerJoinedBattleGroundPacket(WorldPacket *data, Player *plr);
|
||||||
void BuildPlayerLeftBattleGroundPacket(WorldPacket *data, const uint64& guid);
|
void BuildPlayerLeftBattleGroundPacket(WorldPacket *data, const uint64& guid);
|
||||||
void BuildBattleGroundListPacket(WorldPacket *data, const uint64& guid, Player *plr, BattleGroundTypeId bgTypeId);
|
void BuildBattleGroundListPacket(WorldPacket *data, const uint64& guid, Player *plr, BattleGroundTypeId bgTypeId, uint8 fromWhere);
|
||||||
void BuildGroupJoinedBattlegroundPacket(WorldPacket *data, BattleGroundTypeId bgTypeId);
|
void BuildGroupJoinedBattlegroundPacket(WorldPacket *data, BattleGroundTypeId bgTypeId);
|
||||||
void BuildUpdateWorldStatePacket(WorldPacket *data, uint32 field, uint32 value);
|
void BuildUpdateWorldStatePacket(WorldPacket *data, uint32 field, uint32 value);
|
||||||
void BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg);
|
void BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg);
|
||||||
|
|
|
||||||
|
|
@ -221,6 +221,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||||
{ "arena", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugArenaCommand, "", NULL },
|
{ "arena", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugArenaCommand, "", NULL },
|
||||||
{ "bg", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugBattlegroundCommand, "", NULL },
|
{ "bg", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugBattlegroundCommand, "", NULL },
|
||||||
{ "sendlargepacket",SEC_ADMINISTRATOR, false, &ChatHandler::HandleSendLargePacketCommand, "", NULL },
|
{ "sendlargepacket",SEC_ADMINISTRATOR, false, &ChatHandler::HandleSendLargePacketCommand, "", NULL },
|
||||||
|
{ "setitemflag", SEC_ADMINISTRATOR, false, &ChatHandler::HandleSetItemFlagCommand, "", NULL },
|
||||||
{ NULL, 0, false, NULL, "", NULL }
|
{ NULL, 0, false, NULL, "", NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -451,6 +451,7 @@ class ChatHandler
|
||||||
bool HandleSpawnVehicle(const char * args);
|
bool HandleSpawnVehicle(const char * args);
|
||||||
bool HandleSendLargePacketCommand(const char * args);
|
bool HandleSendLargePacketCommand(const char * args);
|
||||||
bool HandleSendSetPhaseShiftCommand(const char * args);
|
bool HandleSendSetPhaseShiftCommand(const char * args);
|
||||||
|
bool HandleSetItemFlagCommand(const char * args);
|
||||||
|
|
||||||
Player* getSelectedPlayer();
|
Player* getSelectedPlayer();
|
||||||
Creature* getSelectedCreature();
|
Creature* getSelectedCreature();
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,7 @@ enum ITEM_FLAGS
|
||||||
ITEM_FLAGS_CONJURED = 0x00000002,
|
ITEM_FLAGS_CONJURED = 0x00000002,
|
||||||
ITEM_FLAGS_OPENABLE = 0x00000004,
|
ITEM_FLAGS_OPENABLE = 0x00000004,
|
||||||
ITEM_FLAGS_WRAPPED = 0x00000008,
|
ITEM_FLAGS_WRAPPED = 0x00000008,
|
||||||
|
ITEM_FLAGS_BROKEN = 0x00000010, // appears red icon (like when item durability==0)
|
||||||
ITEM_FLAGS_WRAPPER = 0x00000200, // used or not used wrapper
|
ITEM_FLAGS_WRAPPER = 0x00000200, // used or not used wrapper
|
||||||
ITEM_FLAGS_PARTY_LOOT = 0x00000800, // determines if item is party loot or not
|
ITEM_FLAGS_PARTY_LOOT = 0x00000800, // determines if item is party loot or not
|
||||||
ITEM_FLAGS_CHARTER = 0x00002000, // arena/guild charter
|
ITEM_FLAGS_CHARTER = 0x00002000, // arena/guild charter
|
||||||
|
|
|
||||||
|
|
@ -104,13 +104,15 @@ enum __QuestGiverStatus
|
||||||
{
|
{
|
||||||
DIALOG_STATUS_NONE = 0,
|
DIALOG_STATUS_NONE = 0,
|
||||||
DIALOG_STATUS_UNAVAILABLE = 1,
|
DIALOG_STATUS_UNAVAILABLE = 1,
|
||||||
DIALOG_STATUS_CHAT = 2,
|
DIALOG_STATUS_CHAT = 2, // 3.1 - may be changed
|
||||||
DIALOG_STATUS_INCOMPLETE = 3,
|
DIALOG_STATUS_UNK1 = 3, // 3.1
|
||||||
DIALOG_STATUS_REWARD_REP = 4,
|
DIALOG_STATUS_UNK2 = 4, // 3.1
|
||||||
DIALOG_STATUS_AVAILABLE_REP = 5,
|
DIALOG_STATUS_INCOMPLETE = 5,
|
||||||
DIALOG_STATUS_AVAILABLE = 6,
|
DIALOG_STATUS_REWARD_REP = 6,
|
||||||
DIALOG_STATUS_REWARD2 = 7, // not yellow dot on minimap
|
DIALOG_STATUS_AVAILABLE_REP = 7,
|
||||||
DIALOG_STATUS_REWARD = 8 // yellow dot on minimap
|
DIALOG_STATUS_AVAILABLE = 8,
|
||||||
|
DIALOG_STATUS_REWARD2 = 9, // no yellow dot on minimap
|
||||||
|
DIALOG_STATUS_REWARD = 10 // yellow dot on minimap
|
||||||
};
|
};
|
||||||
|
|
||||||
enum __QuestFlags
|
enum __QuestFlags
|
||||||
|
|
@ -123,7 +125,7 @@ enum __QuestFlags
|
||||||
//QUEST_FLAGS_NONE2 = 0x00000010, // Not used currently
|
//QUEST_FLAGS_NONE2 = 0x00000010, // Not used currently
|
||||||
QUEST_FLAGS_EPIC = 0x00000020, // Not used currently: Unsure of content
|
QUEST_FLAGS_EPIC = 0x00000020, // Not used currently: Unsure of content
|
||||||
QUEST_FLAGS_RAID = 0x00000040, // Not used currently
|
QUEST_FLAGS_RAID = 0x00000040, // Not used currently
|
||||||
QUEST_FLAGS_TBC = 0x00000080, // Not used currently: Available if TBC expension enabled only
|
QUEST_FLAGS_TBC = 0x00000080, // Not used currently: Available if TBC expansion enabled only
|
||||||
QUEST_FLAGS_UNK2 = 0x00000100, // Not used currently: _DELIVER_MORE Quest needs more than normal _q-item_ drops from mobs
|
QUEST_FLAGS_UNK2 = 0x00000100, // Not used currently: _DELIVER_MORE Quest needs more than normal _q-item_ drops from mobs
|
||||||
QUEST_FLAGS_HIDDEN_REWARDS = 0x00000200, // Items and money rewarded only sent in SMSG_QUESTGIVER_OFFER_REWARD (not in SMSG_QUESTGIVER_QUEST_DETAILS or in client quest log(SMSG_QUEST_QUERY_RESPONSE))
|
QUEST_FLAGS_HIDDEN_REWARDS = 0x00000200, // Items and money rewarded only sent in SMSG_QUESTGIVER_OFFER_REWARD (not in SMSG_QUESTGIVER_QUEST_DETAILS or in client quest log(SMSG_QUEST_QUERY_RESPONSE))
|
||||||
QUEST_FLAGS_AUTO_REWARDED = 0x00000400, // These quests are automatically rewarded on quest complete and they will never appear in quest log client side.
|
QUEST_FLAGS_AUTO_REWARDED = 0x00000400, // These quests are automatically rewarded on quest complete and they will never appear in quest log client side.
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@
|
||||||
#include "WorldPacket.h"
|
#include "WorldPacket.h"
|
||||||
#include "SharedDefines.h"
|
#include "SharedDefines.h"
|
||||||
#include "ByteBuffer.h"
|
#include "ByteBuffer.h"
|
||||||
#include "AddonHandler.h"
|
|
||||||
#include "Opcodes.h"
|
#include "Opcodes.h"
|
||||||
#include "Database/DatabaseEnv.h"
|
#include "Database/DatabaseEnv.h"
|
||||||
#include "Auth/Sha1.h"
|
#include "Auth/Sha1.h"
|
||||||
|
|
|
||||||
|
|
@ -594,3 +594,27 @@ bool ChatHandler::HandleSendSetPhaseShiftCommand(const char* args)
|
||||||
m_session->SendSetPhaseShift(PhaseShift);
|
m_session->SendSetPhaseShift(PhaseShift);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ChatHandler::HandleSetItemFlagCommand(const char* args)
|
||||||
|
{
|
||||||
|
if(!args)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
char* e = strtok((char*)args, " ");
|
||||||
|
char* f = strtok(NULL, " ");
|
||||||
|
|
||||||
|
if (!e || !f)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
uint32 guid = (uint32)atoi(e);
|
||||||
|
uint32 flag = (uint32)atoi(f);
|
||||||
|
|
||||||
|
Item *i = m_session->GetPlayer()->GetItemByGuid(MAKE_NEW_GUID(guid, 0, HIGHGUID_ITEM));
|
||||||
|
|
||||||
|
if(!i)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
i->SetUInt32Value(ITEM_FIELD_FLAGS, flag);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue