This commit is contained in:
Antz 2017-07-03 20:38:49 +01:00
commit 7d083148f0
19 changed files with 222 additions and 112 deletions

View File

@ -309,8 +309,10 @@ bool ChatHandler::HandleDebugSendQuestPartyMsgCommand(char* args)
uint32 msg;
if (!ExtractUInt32(&args, msg))
{ return false; }
if (msg > 0xFF)
{ return false; }
m_session->GetPlayer()->SendPushToPartyResponse(m_session->GetPlayer(), msg);
m_session->GetPlayer()->SendPushToPartyResponse(m_session->GetPlayer(), uint8(msg));
return true;
}

View File

@ -456,7 +456,8 @@ bool Creature::UpdateEntry(uint32 Entry, Team team, const CreatureData* data /*=
if (factionTemplate->factionFlags & FACTION_TEMPLATE_FLAG_PVP)
SetPvP(true);
else
SetPvP(false);
if (!IsRacialLeader())
SetPvP(false);
}
// Try difficulty dependend version before falling back to base entry

View File

@ -33,6 +33,16 @@
#include "SharedDefines.h"
#include <map>
enum GMTicketResponse
{
GMTICKET_RESPONSE_ALREADY_EXIST = 1,
GMTICKET_RESPONSE_CREATE_SUCCESS = 2,
GMTICKET_RESPONSE_CREATE_ERROR = 3,
GMTICKET_RESPONSE_UPDATE_SUCCESS = 4,
GMTICKET_RESPONSE_UPDATE_ERROR = 5,
GMTICKET_RESPONSE_TICKET_DELETED = 9
};
/**
* \addtogroup game
* @{

View File

@ -11212,6 +11212,14 @@ void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint
GetSession()->SendPacket(&data);
}
void Player::SendOpenContainer()
{
DEBUG_LOG("WORLD: Sent SMSG_OPEN_CONTAINER");
WorldPacket data(SMSG_OPEN_CONTAINER, 8); // opens the main bag in the UI
data << GetObjectGuid();
GetSession()->SendPacket(&data);
}
void Player::SendBuyError(BuyResult msg, Creature* pCreature, uint32 item, uint32 param)
{
DEBUG_LOG("WORLD: Sent SMSG_BUY_FAILED");
@ -13742,14 +13750,13 @@ void Player::SendQuestConfirmAccept(const Quest* pQuest, Player* pReceiver)
}
}
void Player::SendPushToPartyResponse(Player* pPlayer, uint32 msg)
void Player::SendPushToPartyResponse(Player* pPlayer, uint8 msg)
{
if (pPlayer)
{
WorldPacket data(MSG_QUEST_PUSH_RESULT, (8 + 4 + 1));
WorldPacket data(MSG_QUEST_PUSH_RESULT, (8 + 1));
data << pPlayer->GetObjectGuid();
data << uint32(msg); // valid values: 0-8
data << uint8(0);
data << uint8(msg); // enum QuestShareMessages
GetSession()->SendPacket(&data);
DEBUG_LOG("WORLD: Sent MSG_QUEST_PUSH_RESULT");
}
@ -17184,6 +17191,71 @@ void Player::ContinueTaxiFlight()
GetSession()->SendDoFlight(mountDisplayId, path, startNode);
}
void Player::Mount(uint32 mount, uint32 spellId)
{
if (!mount)
{ return; }
Unit::Mount(mount, spellId);
// Called by Taxi system / GM command
if (!spellId)
{
UnsummonPetTemporaryIfAny();
}
// Called by mount aura
else
{
// Normal case (Unsummon only permanent pet)
if (Pet* pet = GetPet())
{
if (pet->IsPermanentPetFor((Player*)this) &&
sWorld.getConfig(CONFIG_BOOL_PET_UNSUMMON_AT_MOUNT))
{
UnsummonPetTemporaryIfAny();
}
else
{
pet->ApplyModeFlags(PET_MODE_DISABLE_ACTIONS, true);
}
}
}
}
void Player::Unmount(bool from_aura)
{
if (!IsMounted())
{ return; }
Unit::Unmount(from_aura);
// only resummon old pet if the player is already added to a map
// this prevents adding a pet to a not created map which would otherwise cause a crash
// (it could probably happen when logging in after a previous crash)
if (Pet* pet = GetPet())
{
pet->ApplyModeFlags(PET_MODE_DISABLE_ACTIONS, false);
}
else
{
ResummonPetTemporaryUnSummonedIfAny();
}
}
void Player::SendMountResult(PlayerMountResult result)
{
WorldPacket data(SMSG_MOUNTRESULT, 4);
data << uint32(result);
GetSession()->SendPacket(&data);
}
void Player::SendDismountResult(PlayerDismountResult result)
{
WorldPacket data(SMSG_DISMOUNTRESULT, 4);
data << uint32(result);
GetSession()->SendPacket(&data);
}
void Player::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs)
{
// last check 1.12
@ -17465,7 +17537,7 @@ void Player::UpdateHomebindTime(uint32 time)
// hide reminder
WorldPacket data(SMSG_RAID_GROUP_ONLY, 4 + 4);
data << uint32(0);
data << uint32(ERR_RAID_GROUP_NONE); // error used only when timer = 0
data << uint32(ERR_RAID_GROUP_REQUIRED); // error used only when timer = 0
GetSession()->SendPacket(&data);
}
// instance is valid, reset homebind timer
@ -17488,7 +17560,7 @@ void Player::UpdateHomebindTime(uint32 time)
// send message to player
WorldPacket data(SMSG_RAID_GROUP_ONLY, 4 + 4);
data << uint32(m_HomebindTimer);
data << uint32(ERR_RAID_GROUP_NONE); // error used only when timer = 0
data << uint32(ERR_RAID_GROUP_REQUIRED); // error used only when timer = 0
GetSession()->SendPacket(&data);
DEBUG_LOG("PLAYER: Player '%s' (GUID: %u) will be teleported to homebind in 60 seconds", GetName(), GetGUIDLow());
}

View File

@ -330,11 +330,13 @@ typedef std::list<Item*> ItemDurationList;
enum RaidGroupError
{
ERR_RAID_GROUP_NONE = 0,
ERR_RAID_GROUP_LOWLEVEL = 1,
ERR_RAID_GROUP_ONLY = 2,
ERR_RAID_GROUP_FULL = 3,
ERR_RAID_GROUP_REQUIREMENTS_UNMATCH = 4
ERR_RAID_GROUP_REQUIRED = 1,
ERR_RAID_GROUP_FULL = 2
//ERR_RAID_GROUP_NONE = 0,
//ERR_RAID_GROUP_LOWLEVEL = 1,
//ERR_RAID_GROUP_ONLY = 2,
//ERR_RAID_GROUP_FULL = 3,
//ERR_RAID_GROUP_REQUIREMENTS_UNMATCH = 4
};
enum DrunkenState
@ -600,13 +602,12 @@ enum TradeSlots
TRADE_SLOT_NONTRADED = 6
};
// [-ZERO] Need fix, or maybe not exists
enum TransferAbortReason
{
TRANSFER_ABORT_NONE = 0x00,
TRANSFER_ABORT_MAX_PLAYERS = 0x01, // Transfer Aborted: instance is full
TRANSFER_ABORT_NOT_FOUND = 0x02, // Transfer Aborted: instance not found
TRANSFER_ABORT_TOO_MANY_INSTANCES = 0x03, // You have entered too many instances recently.
TRANSFER_ABORT_SILENTLY = 0x04, // no message shown; the same effect give values above 5
TRANSFER_ABORT_ZONE_IN_COMBAT = 0x05, // Unable to zone in while an encounter is in progress.
};
@ -723,6 +724,29 @@ enum PlayerRestState
REST_STATE_RAF_LINKED = 0x04 // Exact use unknown
};
enum PlayerMountResult
{
MOUNTRESULT_INVALIDMOUNTEE = 0, // You can't mount that unit!
MOUNTRESULT_TOOFARAWAY = 1, // That mount is too far away!
MOUNTRESULT_ALREADYMOUNTED = 2, // You're already mounted!
MOUNTRESULT_NOTMOUNTABLE = 3, // That unit can't be mounted!
MOUNTRESULT_NOTYOURPET = 4, // That mount isn't your pet!
MOUNTRESULT_OTHER = 5, // internal
MOUNTRESULT_LOOTING = 6, // You can't mount while looting!
MOUNTRESULT_RACECANTMOUNT = 7, // You can't mount because of your race!
MOUNTRESULT_SHAPESHIFTED = 8, // You can't mount while shapeshifted!
MOUNTRESULT_FORCEDDISMOUNT = 9, // You dismount before continuing.
MOUNTRESULT_OK = 10 // no error
};
enum PlayerDismountResult
{
DISMOUNTRESULT_NOPET = 0, // internal
DISMOUNTRESULT_NOTMOUNTED = 1, // You're not mounted!
DISMOUNTRESULT_NOTYOURPET = 2, // internal
DISMOUNTRESULT_OK = 3 // no error
};
class PlayerTaxi
{
public:
@ -990,6 +1014,10 @@ class Player : public Unit
bool ActivateTaxiPathTo(uint32 taxi_path_id, uint32 spellid = 0);
// mount_id can be used in scripting calls
void ContinueTaxiFlight();
void Mount(uint32 mount, uint32 spellId = 0) override;
void Unmount(bool from_aura = false) override;
void SendMountResult(PlayerMountResult result);
void SendDismountResult(PlayerDismountResult result);
bool isAcceptTickets() const { return GetSession()->GetSecurity() >= SEC_GAMEMASTER && (m_ExtraFlags & PLAYER_EXTRA_GM_ACCEPT_TICKETS); }
void SetAcceptTicket(bool on) { if (on) { m_ExtraFlags |= PLAYER_EXTRA_GM_ACCEPT_TICKETS; } else { m_ExtraFlags &= ~PLAYER_EXTRA_GM_ACCEPT_TICKETS; } }
bool isAcceptWhispers() const { return m_ExtraFlags & PLAYER_EXTRA_ACCEPT_WHISPERS; }
@ -1220,6 +1248,7 @@ class Player : public Unit
void SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2 = NULL, uint32 itemid = 0) const;
void SendBuyError(BuyResult msg, Creature* pCreature, uint32 item, uint32 param);
void SendSellError(SellResult msg, Creature* pCreature, ObjectGuid itemGuid, uint32 param);
void SendOpenContainer();
void AddWeaponProficiency(uint32 newflag)
{
m_WeaponProficiency |= newflag;
@ -1385,7 +1414,7 @@ class Player : public Unit
void SendQuestTimerFailed(uint32 quest_id);
void SendCanTakeQuestResponse(uint32 msg) const;
void SendQuestConfirmAccept(Quest const* pQuest, Player* pReceiver);
void SendPushToPartyResponse(Player* pPlayer, uint32 msg);
void SendPushToPartyResponse(Player* pPlayer, uint8 msg);
void SendQuestUpdateAddItem(Quest const* pQuest, uint32 item_idx, uint32 count);
void SendQuestUpdateAddCreatureOrGo(Quest const* pQuest, ObjectGuid guid, uint32 creatureOrGO_idx, uint32 count);

View File

@ -904,16 +904,6 @@ bool IsPositiveSpell(SpellEntry const* spellproto)
bool IsSingleTargetSpell(SpellEntry const* spellInfo)
{
switch (spellInfo->Id)
{
case 339: // Druid Roots Rank 1
case 1062: // Druid Roots Rank 2
case 5195: // Druid Roots Rank 3
case 5196: // Druid Roots Rank 4
case 9852: // Druid Roots Rank 5
case 9853: // Druid Roots Rank 6
return true;
}
// hunter's mark and similar
if (spellInfo->SpellVisual == 3239)
{ return true; }
@ -943,19 +933,21 @@ bool IsSingleTargetSpell(SpellEntry const* spellInfo)
case 24664: // Sleep (group targets)
return false;
}
// can not be cast on another target while not cooled down anyway
if (GetSpellDuration(spellInfo) < int32(GetSpellRecoveryTime(spellInfo)))
{ return false; }
// all other single target spells have if it has AttributesEx
if (spellInfo->AttributesEx & (1 << 18))
if (spellInfo->HasAttribute(SPELL_ATTR_EX_UNK18))
{ return true; }
// can not be cast on another target while not cooled down anyway
//if (GetSpellDuration(spellInfo) < int32(GetSpellRecoveryTime(spellInfo)))
// { return true; }
// other single target
// Fear
if ((spellInfo->SpellIconID == 98 && spellInfo->SpellVisual == 336)
// Banish
|| (spellInfo->SpellIconID == 96 && spellInfo->SpellVisual == 1305)
// Entangling roots
|| spellInfo->IsFitToFamily(SPELLFAMILY_DRUID, ClassFamilyMask(UI64LIT(0x0200)))
) { return true; }
// TODO - need found Judgements rule

View File

@ -6407,28 +6407,6 @@ void Unit::Mount(uint32 mount, uint32 spellId)
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MOUNTING);
SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, mount);
if (GetTypeId() == TYPEID_PLAYER)
{
// Called by Taxi system / GM command
if (!spellId)
{ ((Player*)this)->UnsummonPetTemporaryIfAny(); }
// Called by mount aura
else
{
// Normal case (Unsummon only permanent pet)
if (Pet* pet = GetPet())
{
if (pet->IsPermanentPetFor((Player*)this) &&
sWorld.getConfig(CONFIG_BOOL_PET_UNSUMMON_AT_MOUNT))
{
((Player*)this)->UnsummonPetTemporaryIfAny();
}
else
{ pet->ApplyModeFlags(PET_MODE_DISABLE_ACTIONS, true); }
}
}
}
}
void Unit::Unmount(bool from_aura)
@ -6447,17 +6425,6 @@ void Unit::Unmount(bool from_aura)
data << GetPackGUID();
SendMessageToSet(&data, true);
}
// only resummon old pet if the player is already added to a map
// this prevents adding a pet to a not created map which would otherwise cause a crash
// (it could probably happen when logging in after a previous crash)
if (GetTypeId() == TYPEID_PLAYER)
{
if (Pet* pet = GetPet())
{ pet->ApplyModeFlags(PET_MODE_DISABLE_ACTIONS, false); }
else
{ ((Player*)this)->ResummonPetTemporaryUnSummonedIfAny(); }
}
}
bool Unit::IsNearWaypoint(float currentPositionX, float currentPositionY, float currentPositionZ, float destinationPostionX, float destinationPostionY, float destinationPostionZ, float distanceX, float distanceY, float distanceZ)
@ -8801,12 +8768,18 @@ bool Unit::IsStandState() const
return !IsSitState() && s != UNIT_STAND_STATE_SLEEP && s != UNIT_STAND_STATE_KNEEL;
}
bool Unit::IsSeatedState() const
{
uint8 standState = getStandState();
return standState != UNIT_STAND_STATE_SLEEP && standState != UNIT_STAND_STATE_STAND;
}
void Unit::SetStandState(uint8 state)
{
SetByteValue(UNIT_FIELD_BYTES_1, 0, state);
if (IsStandState())
{ RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_NOT_SEATED); }
if (!IsSeatedState())
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_NOT_SEATED);
if (GetTypeId() == TYPEID_PLAYER)
{

View File

@ -1785,6 +1785,8 @@ class Unit : public WorldObject
* @return true if the Unit is standing normally, false otherwise
*/
bool IsStandState() const;
bool IsSeatedState() const;
/**
* Change the stand state for this Unit. For possible values check
* UnitStandStateType.
@ -1813,7 +1815,7 @@ class Unit : public WorldObject
* @param spellId id of the spell used to summon the mount, if 0 is passed in this is treated
* as a GM command or the Taxi service mounting the Player.
*/
void Mount(uint32 mount, uint32 spellId = 0);
virtual void Mount(uint32 mount, uint32 spellId = 0);
/**
* Unmounts this Unit by sending the SMSG_DISMOUNT to the client if it was a dismount
* not issued by a GM / the Taxi service. Also changes the UNIT_FIELD_MOUNTDISPLAYID
@ -1821,7 +1823,7 @@ class Unit : public WorldObject
* @param from_aura if this was true the Unit was probably interrupted by a spell
* or something hitting it forcing a dismount.
*/
void Unmount(bool from_aura = false);
virtual void Unmount(bool from_aura = false);
/**
* Returns the maximum skill value the given Unit can have. Ie: the sword skill can

View File

@ -123,8 +123,8 @@ void Opcodes::BuildOpcodeList()
/*0x03C*/ StoreOpcode(SMSG_CHAR_DELETE, "SMSG_CHAR_DELETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*0x03D*/ StoreOpcode(CMSG_PLAYER_LOGIN, "CMSG_PLAYER_LOGIN", STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandlePlayerLoginOpcode);
/*[-ZERO] Need check */ /*0x03E*/ StoreOpcode(SMSG_NEW_WORLD, "SMSG_NEW_WORLD", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*[-ZERO] Need check */ /*0x03F*/ StoreOpcode(SMSG_TRANSFER_PENDING, "SMSG_TRANSFER_PENDING", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*[-ZERO] Need check */ /*0x040*/ StoreOpcode(SMSG_TRANSFER_ABORTED, "SMSG_TRANSFER_ABORTED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*0x03F*/ StoreOpcode(SMSG_TRANSFER_PENDING, "SMSG_TRANSFER_PENDING", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*0x040*/ StoreOpcode(SMSG_TRANSFER_ABORTED, "SMSG_TRANSFER_ABORTED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*[-ZERO] Need check */ /*0x041*/ StoreOpcode(SMSG_CHARACTER_LOGIN_FAILED, "SMSG_CHARACTER_LOGIN_FAILED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*[-ZERO] Need check */ /*0x042*/ StoreOpcode(SMSG_LOGIN_SETTIMESPEED, "SMSG_LOGIN_SETTIMESPEED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*[-ZERO] Need check */ /*0x043*/ StoreOpcode(SMSG_GAMETIME_UPDATE, "SMSG_GAMETIME_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
@ -285,7 +285,7 @@ void Opcodes::BuildOpcodeList()
/*0x0DE*/ StoreOpcode(SMSG_MOVE_WATER_WALK, "SMSG_MOVE_WATER_WALK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*0x0DF*/ StoreOpcode(SMSG_MOVE_LAND_WALK, "SMSG_MOVE_LAND_WALK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*0x0E0*/ StoreOpcode(MSG_MOVE_SET_RAW_POSITION_ACK, "MSG_MOVE_SET_RAW_POSITION_ACK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL);
/*0x0E1*/ StoreOpcode(CMSG_MOVE_SET_RAW_POSITION, "CMSG_MOVE_SET_RAW_POSITION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL);
/*0x0E1*/ StoreOpcode(CMSG_MOVE_SET_RAW_POSITION, "CMSG_MOVE_SET_RAW_POSITION", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveSetRawPosition);
/*0x0E2*/ StoreOpcode(SMSG_FORCE_RUN_SPEED_CHANGE, "SMSG_FORCE_RUN_SPEED_CHANGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*0x0E3*/ StoreOpcode(CMSG_FORCE_RUN_SPEED_CHANGE_ACK, "CMSG_FORCE_RUN_SPEED_CHANGE_ACK", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAckOpcodes);
/*0x0E4*/ StoreOpcode(SMSG_FORCE_RUN_BACK_SPEED_CHANGE, "SMSG_FORCE_RUN_BACK_SPEED_CHANGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
@ -426,8 +426,8 @@ void Opcodes::BuildOpcodeList()
/*[-ZERO] Need check */ /*0x16B*/ StoreOpcode(SMSG_DUEL_WINNER, "SMSG_DUEL_WINNER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*[-ZERO] Need check */ /*0x16C*/ StoreOpcode(CMSG_DUEL_ACCEPTED, "CMSG_DUEL_ACCEPTED", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelAcceptedOpcode);
/*[-ZERO] Need check */ /*0x16D*/ StoreOpcode(CMSG_DUEL_CANCELLED, "CMSG_DUEL_CANCELLED", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelCancelledOpcode);
/*[-ZERO] Need check */ /*0x16E*/ StoreOpcode(SMSG_MOUNTRESULT, "SMSG_MOUNTRESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*[-ZERO] Need check */ /*0x16F*/ StoreOpcode(SMSG_DISMOUNTRESULT, "SMSG_DISMOUNTRESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*0x16E*/ StoreOpcode(SMSG_MOUNTRESULT, "SMSG_MOUNTRESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*0x16F*/ StoreOpcode(SMSG_DISMOUNTRESULT, "SMSG_DISMOUNTRESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*[-ZERO] Need check */ /*0x170*/ StoreOpcode(SMSG_PUREMOUNT_CANCELLED_OBSOLETE, "SMSG_PUREMOUNT_CANCELLED_OBSOLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*[-ZERO] Need check */ /*0x171*/ StoreOpcode(CMSG_MOUNTSPECIAL_ANIM, "CMSG_MOUNTSPECIAL_ANIM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMountSpecialAnimOpcode);
/*[-ZERO] Need check */ /*0x172*/ StoreOpcode(SMSG_MOUNTSPECIAL_ANIM, "SMSG_MOUNTSPECIAL_ANIM", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
@ -519,9 +519,9 @@ void Opcodes::BuildOpcodeList()
/*[-ZERO] Need check */ /*0x1C8*/ StoreOpcode(SMSG_FISH_NOT_HOOKED, "SMSG_FISH_NOT_HOOKED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*[-ZERO] Need check */ /*0x1C9*/ StoreOpcode(SMSG_FISH_ESCAPED, "SMSG_FISH_ESCAPED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*[-ZERO] Need check */ /*0x1CA*/ StoreOpcode(CMSG_BUG, "CMSG_BUG", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleBugOpcode);
/*[-ZERO] Need check */ /*0x1CB*/ StoreOpcode(SMSG_NOTIFICATION, "SMSG_NOTIFICATION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*0x1CB*/ StoreOpcode(SMSG_NOTIFICATION, "SMSG_NOTIFICATION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*[-ZERO] Need check */ /*0x1CC*/ StoreOpcode(CMSG_PLAYED_TIME, "CMSG_PLAYED_TIME", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandlePlayedTime);
/*[-ZERO] Need check */ /*0x1CD*/ StoreOpcode(SMSG_PLAYED_TIME, "SMSG_PLAYED_TIME", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*0x1CD*/ StoreOpcode(SMSG_PLAYED_TIME, "SMSG_PLAYED_TIME", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*[-ZERO] Need check */ /*0x1CE*/ StoreOpcode(CMSG_QUERY_TIME, "CMSG_QUERY_TIME", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleQueryTimeOpcode);
/*[-ZERO] Need check */ /*0x1CF*/ StoreOpcode(SMSG_QUERY_TIME_RESPONSE, "SMSG_QUERY_TIME_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*[-ZERO] Need check */ /*0x1D0*/ StoreOpcode(SMSG_LOG_XPGAIN, "SMSG_LOG_XPGAIN", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
@ -688,7 +688,7 @@ void Opcodes::BuildOpcodeList()
/*[-ZERO] Need check */ /*0x273*/ StoreOpcode(SMSG_STABLE_RESULT, "SMSG_STABLE_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*[-ZERO] Need check */ /*0x274*/ StoreOpcode(CMSG_STABLE_REVIVE_PET, "CMSG_STABLE_REVIVE_PET", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStableRevivePet);
/*0x275*/ StoreOpcode(CMSG_STABLE_SWAP_PET, "CMSG_STABLE_SWAP_PET", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStableSwapPet);
/*[-ZERO] Need check */ /*0x276*/ StoreOpcode(MSG_QUEST_PUSH_RESULT, "MSG_QUEST_PUSH_RESULT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPushResult);
/*0x276*/ StoreOpcode(MSG_QUEST_PUSH_RESULT, "MSG_QUEST_PUSH_RESULT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPushResult);
/*[-ZERO] Need check */ /*0x277*/ StoreOpcode(SMSG_PLAY_MUSIC, "SMSG_PLAY_MUSIC", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*[-ZERO] Need check */ /*0x278*/ StoreOpcode(SMSG_PLAY_OBJECT_SOUND, "SMSG_PLAY_OBJECT_SOUND", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*[-ZERO] Need check */ /*0x279*/ StoreOpcode(CMSG_REQUEST_PET_INFO, "CMSG_REQUEST_PET_INFO", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPetInfoOpcode);
@ -755,8 +755,8 @@ void Opcodes::BuildOpcodeList()
/*[-ZERO] Need check */ /*0x2B6*/ StoreOpcode(SMSG_SCRIPT_MESSAGE, "SMSG_SCRIPT_MESSAGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*0x2B7*/ StoreOpcode(SMSG_DUEL_COUNTDOWN, "SMSG_DUEL_COUNTDOWN", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*[-ZERO] Need check */ /*0x2B8*/ StoreOpcode(SMSG_AREA_TRIGGER_MESSAGE, "SMSG_AREA_TRIGGER_MESSAGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*[-ZERO] Need check */ /*0x2B9*/ StoreOpcode(CMSG_TOGGLE_HELM, "CMSG_TOGGLE_HELM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingHelmOpcode);
/*[-ZERO] Need check */ /*0x2BA*/ StoreOpcode(CMSG_TOGGLE_CLOAK, "CMSG_TOGGLE_CLOAK", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingCloakOpcode);
/*0x2B9*/ StoreOpcode(CMSG_TOGGLE_HELM, "CMSG_TOGGLE_HELM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingHelmOpcode);
/*0x2BA*/ StoreOpcode(CMSG_TOGGLE_CLOAK, "CMSG_TOGGLE_CLOAK", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingCloakOpcode);
/*0x2BB*/ StoreOpcode(SMSG_MEETINGSTONE_JOINFAILED, "SMSG_MEETINGSTONE_JOINFAILED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*[-ZERO] Need check */ /*0x2BC*/ StoreOpcode(SMSG_PLAYER_SKINNED, "SMSG_PLAYER_SKINNED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);
/*[-ZERO] Need check */ /*0x2BD*/ StoreOpcode(SMSG_DURABILITY_DAMAGE_DEATH, "SMSG_DURABILITY_DAMAGE_DEATH", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide);

View File

@ -780,10 +780,8 @@ void WorldSession::SaveTutorialsData()
// Send chat information about aborted transfer (mostly used by Player::SendTransferAbortedByLockstatus())
void WorldSession::SendTransferAborted(uint32 mapid, uint8 reason, uint8 arg)
{
WorldPacket data(SMSG_TRANSFER_ABORTED, 4 + 2);
data << uint32(mapid);
WorldPacket data(SMSG_TRANSFER_ABORTED, 1);
data << uint8(reason); // transfer abort reason
data << uint8(0); // arg. not used
SendPacket(&data);
}

View File

@ -709,6 +709,7 @@ class WorldSession
void HandleWardenDataOpcode(WorldPacket& recv_data);
void HandleWorldTeleportOpcode(WorldPacket& recv_data);
void HandleMoveSetRawPosition(WorldPacket& recv_data);
void HandleMinimapPingOpcode(WorldPacket& recv_data);
void HandleRandomRollOpcode(WorldPacket& recv_data);
void HandleFarSightOpcode(WorldPacket& recv_data);

View File

@ -78,11 +78,20 @@ void WorldSession::HandleGMTicketUpdateTextOpcode(WorldPacket& recv_data)
std::string ticketText;
recv_data >> ticketText;
GMTicketResponse responce = GMTICKET_RESPONSE_UPDATE_SUCCESS;
if (GMTicket* ticket = sTicketMgr.GetGMTicket(GetPlayer()->GetObjectGuid()))
{ ticket->SetText(ticketText.c_str()); }
{
ticket->SetText(ticketText.c_str());
}
else
{ sLog.outError("Ticket update: Player %s (GUID: %u) doesn't have active ticket", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow()); }
{
sLog.outError("Ticket update: Player %s (GUID: %u) doesn't have active ticket", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow());
responce = GMTICKET_RESPONSE_UPDATE_ERROR;
}
WorldPacket data(SMSG_GMTICKET_UPDATETEXT, 4);
data << uint32(responce);
SendPacket(&data);
}
//A statusCode of 3 would mean that the client should show the survey now
@ -102,7 +111,7 @@ void WorldSession::HandleGMTicketDeleteTicketOpcode(WorldPacket& /*recv_data*/)
sTicketMgr.Delete(GetPlayer()->GetObjectGuid());
WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4);
data << uint32(9);
data << uint32(GMTICKET_RESPONSE_TICKET_DELETED);
SendPacket(&data);
SendGMTicketGetTicket(0x0A);
@ -126,7 +135,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket& recv_data)
if (sTicketMgr.GetGMTicket(GetPlayer()->GetObjectGuid()))
{
WorldPacket data(SMSG_GMTICKET_CREATE, 4);
data << uint32(1); // 1 - You already have GM ticket
data << uint32(GMTICKET_RESPONSE_ALREADY_EXIST); // 1 - You already have GM ticket
SendPacket(&data);
return;
}
@ -136,7 +145,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket& recv_data)
SendQueryTimeResponse();
WorldPacket data(SMSG_GMTICKET_CREATE, 4);
data << uint32(2); // 2 - nothing appears (3-error creating, 5-error updating)
data << uint32(GMTICKET_RESPONSE_CREATE_SUCCESS); // 2 - nothing appears (3-error creating, 5-error updating)
SendPacket(&data);
// TODO: Guard player map

View File

@ -457,9 +457,10 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* pQuest, ObjectGuid guid
{
ItemPrototype const* IProto;
data << uint32(pQuest->GetRewChoiceItemsCount());
uint32 count = pQuest->GetRewChoiceItemsCount();
data << uint32(count);
for (uint32 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
for (uint32 i = 0; i < count; ++i)
{
data << uint32(pQuest->RewChoiceItemId[i]);
data << uint32(pQuest->RewChoiceItemCount[i]);
@ -472,9 +473,10 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* pQuest, ObjectGuid guid
{ data << uint32(0x00); }
}
data << uint32(pQuest->GetRewItemsCount());
count = pQuest->GetRewItemsCount();
data << uint32(count);
for (uint32 i = 0; i < QUEST_REWARDS_COUNT; ++i)
for (uint32 i = 0; i < count; ++i)
{
data << uint32(pQuest->RewItemId[i]);
data << uint32(pQuest->RewItemCount[i]);
@ -490,19 +492,14 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* pQuest, ObjectGuid guid
data << uint32(pQuest->GetRewOrReqMoney());
}
data << pQuest->GetReqItemsCount();
for (uint32 i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
{
data << pQuest->ReqItemId[i];
data << pQuest->ReqItemCount[i];
}
data << uint32(pQuest->GetRewSpell());
data << pQuest->GetReqCreatureOrGOcount();
for (uint32 i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
uint32 count = pQuest->GetDetailsEmoteCount();
data << uint32(count);
for (uint32 i = 0; i < count; ++i)
{
data << uint32(pQuest->ReqCreatureOrGOId[i]);
data << pQuest->ReqCreatureOrGOCount[i];
data << uint32(pQuest->DetailsEmote[i]);
data << uint32(pQuest->DetailsEmoteDelay[i]); // delay between emotes in ms
}
GetMenuSession()->SendPacket(&data);

View File

@ -1065,6 +1065,27 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data)
{ SendNotification(LANG_YOU_NOT_HAVE_PERMISSION); }
}
void WorldSession::HandleMoveSetRawPosition(WorldPacket& recv_data)
{
DEBUG_LOG("WORLD: Received opcode CMSG_MOVE_SET_RAW_POSITION from %s", GetPlayer()->GetGuidStr().c_str());
// write in client console: setrawpos x y z o
// For now, it is implemented like worldport but on the same map. Consider using MSG_MOVE_SET_RAW_POSITION_ACK.
float PosX, PosY, PosZ, PosO;
recv_data >> PosX >> PosY >> PosZ >> PosO;
//DEBUG_LOG("Set to: X=%f, Y=%f, Z=%f, orient=%f", PosX, PosY, PosZ, PosO);
if (!GetPlayer()->IsInWorld() || GetPlayer()->IsTaxiFlying())
{
DEBUG_LOG("Player '%s' (GUID: %u) in a transfer, ignore setrawpos command.", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow());
return;
}
if (GetSecurity() >= SEC_ADMINISTRATOR)
{ GetPlayer()->TeleportTo(GetPlayer()->GetMapId(), PosX, PosY, PosZ, PosO); }
else
{ SendNotification(LANG_YOU_NOT_HAVE_PERMISSION); }
}
void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data)
{
DEBUG_LOG("WORLD: Received opcode CMSG_WHOIS");

View File

@ -695,10 +695,6 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket)
void WorldSession::SendPetNameInvalid(uint32 error, const std::string& name)
{
// [-ZERO] Need check
WorldPacket data(SMSG_PET_NAME_INVALID, 4 + name.size() + 1 + 1);
data << uint32(error);
data << name;
data << uint8(0); // possible not exist in 1.12.*
WorldPacket data(SMSG_PET_NAME_INVALID, 0);
SendPacket(&data);
}

View File

@ -165,7 +165,8 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket& recv_data)
else
{ data << uint32(Creature::ChooseDisplayId(ci)); } // workaround, way to manage models must be fixed
data << uint16(ci->civilian); // wdbFeild14
data << uint8(ci->civilian); // wdbFeild14
data << uint8(ci->RacialLeader);
SendPacket(&data);
DEBUG_LOG("WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE");
}

View File

@ -115,8 +115,13 @@ Quest::Quest(Field* questRecord)
PointY = questRecord[103].GetFloat();
PointOpt = questRecord[104].GetUInt32();
m_detailsemotecount = 0;
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
{ DetailsEmote[i] = questRecord[105 + i].GetUInt32(); }
{
DetailsEmote[i] = questRecord[105 + i].GetUInt32();
if (DetailsEmote[i] != 0)
m_detailsemotecount = i + 1;
}
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
{ DetailsEmoteDelay[i] = questRecord[109 + i].GetUInt32(); }

View File

@ -249,6 +249,7 @@ class Quest
uint32 GetPointOpt() const { return PointOpt; }
uint32 GetIncompleteEmote() const { return IncompleteEmote; }
uint32 GetCompleteEmote() const { return CompleteEmote; }
uint32 GetDetailsEmoteCount() const { return m_detailsemotecount; }
uint32 GetQuestStartScript() const { return QuestStartScript; }
uint32 GetQuestCompleteScript() const { return QuestCompleteScript; }
@ -296,6 +297,7 @@ class Quest
uint32 m_reqCreatureOrGOcount;
uint32 m_rewchoiceitemscount;
uint32 m_rewitemscount;
uint32 m_detailsemotecount; // actual allowed value 0..4
bool m_isActive;

View File

@ -489,10 +489,9 @@ void WorldSession::HandleQuestPushResult(WorldPacket& recvPacket)
if (Player* pPlayer = ObjectAccessor::FindPlayer(_player->GetDividerGuid()))
{
WorldPacket data(MSG_QUEST_PUSH_RESULT, (8 + 4 + 1));
WorldPacket data(MSG_QUEST_PUSH_RESULT, (8 + 1));
data << ObjectGuid(guid);
data << uint32(msg); // valid values: 0-8
data << uint8(0);
data << uint8(msg); // enum QuestShareMessages
pPlayer->GetSession()->SendPacket(&data);
_player->ClearDividerGuid();
}