mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
Fix
This commit is contained in:
parent
835a8da42a
commit
41b400dac9
11 changed files with 103 additions and 94 deletions
|
|
@ -638,18 +638,18 @@ struct ChrRacesEntry
|
|||
// 3 unused
|
||||
uint32 model_m; // 4
|
||||
uint32 model_f; // 5
|
||||
// 6-7 unused
|
||||
uint32 TeamID; // 8 (7-Alliance 1-Horde)
|
||||
// 9-12 unused
|
||||
uint32 CinematicSequence; // 13 id from CinematicSequences.dbc
|
||||
char* name[16]; // 14-29 used for DBC language detection/selection
|
||||
// 30 string flags, unused
|
||||
//char* nameFemale[16]; // 31-46, if different from base (male) case
|
||||
// 47 string flags, unused
|
||||
//char* nameNeutralGender[16]; // 48-63, if different from base (male) case
|
||||
// 64 string flags, unused
|
||||
// 65-67 unused
|
||||
uint32 addon; // 68 (0 - original race, 1 - tbc addon, ...)
|
||||
// 6 unused
|
||||
uint32 TeamID; // 7 (7-Alliance 1-Horde)
|
||||
// 8-11 unused
|
||||
uint32 CinematicSequence; // 12 id from CinematicSequences.dbc
|
||||
char* name[16]; // 13-28 used for DBC language detection/selection
|
||||
// 29 string flags, unused
|
||||
//char* nameFemale[16]; // 30-45, if different from base (male) case
|
||||
// 46 string flags, unused
|
||||
//char* nameNeutralGender[16]; // 47-62, if different from base (male) case
|
||||
// 63 string flags, unused
|
||||
// 64-66 unused
|
||||
uint32 addon; // 67 (0 - original race, 1 - tbc addon, ...)
|
||||
};
|
||||
|
||||
/* not used
|
||||
|
|
@ -1118,6 +1118,16 @@ struct MapEntry
|
|||
}
|
||||
};
|
||||
|
||||
struct MapDifficultyEntry
|
||||
{
|
||||
uint32 Id; // 0
|
||||
uint32 MapId; // 1
|
||||
uint32 Difficulty; // 2
|
||||
char* transferFailedText[16]; // 3-18
|
||||
uint32 textFlags; // 19
|
||||
uint32 resetTime; // 20
|
||||
};
|
||||
|
||||
struct MovieEntry
|
||||
{
|
||||
uint32 Id; // 0 index
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ const char CharTitlesEntryfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi";
|
|||
const char ChatChannelsEntryfmt[]="iixssssssssssssssssxxxxxxxxxxxxxxxxxx";
|
||||
// ChatChannelsEntryfmt, index not used (more compact store)
|
||||
const char ChrClassesEntryfmt[]="nxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixii";
|
||||
const char ChrRacesEntryfmt[]="nxixiixxixxxxissssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi";
|
||||
const char ChrRacesEntryfmt[]="nxixiixixxxxissssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi";
|
||||
const char CinematicSequencesEntryfmt[]="nxxxxxxxxx";
|
||||
const char CreatureDisplayInfofmt[]="nxxxfxxxxxxxxxxx";
|
||||
const char CreatureFamilyfmt[]="nfifiiiiixssssssssssssssssxx";
|
||||
|
|
|
|||
|
|
@ -240,13 +240,13 @@ void Object::BuildOutOfRangeUpdateBlock(UpdateData * data) const
|
|||
data->AddOutOfRangeGUID(GetGUID());
|
||||
}
|
||||
|
||||
void Object::DestroyForPlayer(Player *target) const
|
||||
void Object::DestroyForPlayer( Player *target, bool anim ) const
|
||||
{
|
||||
ASSERT(target);
|
||||
|
||||
WorldPacket data(SMSG_DESTROY_OBJECT, 8);
|
||||
data << uint64(GetGUID());
|
||||
data << uint8(0); // WotLK (bool)
|
||||
data << uint8(anim ? 1 : 0); // WotLK (bool), may be despawn animation
|
||||
target->GetSession()->SendPacket( &data );
|
||||
}
|
||||
|
||||
|
|
@ -314,7 +314,14 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags, uint32 flags2
|
|||
*data << (uint32)((Player*)this)->GetTransTime();
|
||||
*data << (int8)((Player*)this)->GetTransSeat();
|
||||
}
|
||||
else
|
||||
{
|
||||
//MaNGOS currently not have support for other than player on transport
|
||||
*data << uint8(0);
|
||||
*data << float(0) << float(0) << float(0) << float(0);
|
||||
*data << uint32(0);
|
||||
*data << uint8(-1);
|
||||
}
|
||||
}
|
||||
|
||||
// 0x02200000
|
||||
|
|
@ -1534,7 +1541,7 @@ void WorldObject::SendMessageToSetInRange(WorldPacket *data, float dist, bool /*
|
|||
void WorldObject::SendObjectDeSpawnAnim(uint64 guid)
|
||||
{
|
||||
WorldPacket data(SMSG_GAMEOBJECT_DESPAWN_ANIM, 8);
|
||||
data << guid;
|
||||
data << uint64(guid);
|
||||
SendMessageToSet(&data, true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ class MANGOS_DLL_SPEC Object
|
|||
void BuildMovementUpdateBlock( UpdateData * data, uint32 flags = 0 ) const;
|
||||
void BuildUpdate(UpdateDataMapType &);
|
||||
|
||||
virtual void DestroyForPlayer( Player *target ) const;
|
||||
virtual void DestroyForPlayer( Player *target, bool anim = false ) const;
|
||||
|
||||
const int32& GetInt32Value( uint16 index ) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1023,7 +1023,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] =
|
|||
/*0x3E2*/ { "SMSG_COMSAT_CONNECT_FAIL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
|
||||
/*0x3E3*/ { "SMSG_VOICE_CHAT_STATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
|
||||
/*0x3E4*/ { "CMSG_REPORT_PVP_AFK", STATUS_LOGGEDIN, &WorldSession::HandleReportPvPAFK },
|
||||
/*0x3E5*/ { "CMSG_REPORT_PVP_AFK_RESULT", STATUS_NEVER, &WorldSession::Handle_NULL },
|
||||
/*0x3E5*/ { "SMSG_REPORT_PVP_AFK_RESULT", STATUS_NEVER, &WorldSession::Handle_NULL },
|
||||
/*0x3E6*/ { "CMSG_GUILD_BANKER_ACTIVATE", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankerActivate },
|
||||
/*0x3E7*/ { "CMSG_GUILD_BANK_QUERY_TAB", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankQueryTab },
|
||||
/*0x3E8*/ { "SMSG_GUILD_BANK_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
|
||||
|
|
|
|||
|
|
@ -692,7 +692,7 @@ enum Opcodes
|
|||
CMSG_GROUP_ASSISTANT_LEADER = 0x28F,
|
||||
CMSG_BUYBACK_ITEM = 0x290,
|
||||
SMSG_SERVER_MESSAGE = 0x291,
|
||||
CMSG_MEETINGSTONE_JOIN = 0x292,
|
||||
CMSG_MEETINGSTONE_JOIN = 0x292, // lua: SetSavedInstanceExtend
|
||||
SMSG_MEETINGSTONE_LEAVE = 0x293,
|
||||
CMSG_MEETINGSTONE_CHEAT = 0x294,
|
||||
SMSG_MEETINGSTONE_SETQUEUE = 0x295,
|
||||
|
|
@ -1031,7 +1031,7 @@ enum Opcodes
|
|||
SMSG_COMSAT_CONNECT_FAIL = 0x3E2,
|
||||
SMSG_VOICE_CHAT_STATUS = 0x3E3,
|
||||
CMSG_REPORT_PVP_AFK = 0x3E4,
|
||||
CMSG_REPORT_PVP_AFK_RESULT = 0x3E5,
|
||||
SMSG_REPORT_PVP_AFK_RESULT = 0x3E5, // SMSG?
|
||||
CMSG_GUILD_BANKER_ACTIVATE = 0x3E6,
|
||||
CMSG_GUILD_BANK_QUERY_TAB = 0x3E7,
|
||||
SMSG_GUILD_BANK_LIST = 0x3E8,
|
||||
|
|
|
|||
|
|
@ -3743,9 +3743,9 @@ void Player::BuildCreateUpdateBlockForPlayer( UpdateData *data, Player *target )
|
|||
Unit::BuildCreateUpdateBlockForPlayer( data, target );
|
||||
}
|
||||
|
||||
void Player::DestroyForPlayer( Player *target ) const
|
||||
void Player::DestroyForPlayer( Player *target, bool anim ) const
|
||||
{
|
||||
Unit::DestroyForPlayer( target );
|
||||
Unit::DestroyForPlayer( target, anim );
|
||||
|
||||
for(int i = 0; i < INVENTORY_SLOT_BAG_END; ++i)
|
||||
{
|
||||
|
|
@ -5522,7 +5522,7 @@ ActionButton* Player::addActionButton(uint8 button, uint32 action, uint8 type)
|
|||
{
|
||||
if(button >= MAX_ACTION_BUTTONS)
|
||||
{
|
||||
sLog.outError( "Action %u not added into button %u for player %s: button must be < 132", action, button, GetName() );
|
||||
sLog.outError( "Action %u not added into button %u for player %s: button must be < 144", action, button, GetName() );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -5564,6 +5564,7 @@ ActionButton* Player::addActionButton(uint8 button, uint32 action, uint8 type)
|
|||
|
||||
// set data and update to CHANGED if not NEW
|
||||
ab.SetActionAndType(action,ActionButtonType(type));
|
||||
}
|
||||
|
||||
sLog.outDetail( "Player '%u' Added Action '%u' (type %u) to Button '%u'", GetGUIDLow(), action, uint32(type), button );
|
||||
return &ab;
|
||||
|
|
@ -10328,7 +10329,6 @@ Item* Player::EquipNewItem( uint16 pos, uint32 item, bool update )
|
|||
|
||||
Item* Player::EquipItem( uint16 pos, Item *pItem, bool update )
|
||||
{
|
||||
|
||||
AddEnchantmentDurations(pItem);
|
||||
AddItemDurations(pItem);
|
||||
|
||||
|
|
@ -15331,8 +15331,10 @@ void Player::SendRaidInfo()
|
|||
data << uint32(save->GetMapId()); // map id
|
||||
data << uint32(save->GetDifficulty()); // difficulty
|
||||
data << uint64(save->GetInstanceId()); // instance id
|
||||
data << uint8(0);
|
||||
data << uint8(0);
|
||||
data << uint32(save->GetResetTime() - now); // reset time
|
||||
data << uint32(0); // is extended
|
||||
//data << uint32(0); // is extended
|
||||
++counter;
|
||||
}
|
||||
}
|
||||
|
|
@ -16147,10 +16149,10 @@ void Player::SendAttackSwingBadFacingAttack()
|
|||
GetSession()->SendPacket( &data );
|
||||
}
|
||||
|
||||
void Player::SendAutoRepeatCancel()
|
||||
void Player::SendAutoRepeatCancel(Unit *target)
|
||||
{
|
||||
WorldPacket data(SMSG_CANCEL_AUTO_REPEAT, GetPackGUID().size());
|
||||
data.append(GetPackGUID()); // may be it's target guid
|
||||
WorldPacket data(SMSG_CANCEL_AUTO_REPEAT, target->GetPackGUID().size());
|
||||
data.append(target->GetPackGUID()); // may be it's target guid
|
||||
GetSession()->SendPacket( &data );
|
||||
}
|
||||
|
||||
|
|
@ -18050,14 +18052,10 @@ void Player::SetGroup(Group *group, int8 subgroup)
|
|||
|
||||
void Player::SendInitialPacketsBeforeAddToMap()
|
||||
{
|
||||
WorldPacket data(SMSG_SET_REST_START_OBSOLETE, 4);
|
||||
data << uint32(0); // unknown, may be rest state time or experience
|
||||
GetSession()->SendPacket(&data);
|
||||
|
||||
GetSocial()->SendSocialList();
|
||||
|
||||
// Homebind
|
||||
data.Initialize(SMSG_BINDPOINTUPDATE, 5*4);
|
||||
WorldPacket data(SMSG_BINDPOINTUPDATE, 5*4);
|
||||
data << m_homebindX << m_homebindY << m_homebindZ;
|
||||
data << (uint32) m_homebindMapId;
|
||||
data << (uint32) m_homebindZoneId;
|
||||
|
|
@ -19495,11 +19493,20 @@ bool Player::HasTitle(uint32 bitIndex)
|
|||
return HasFlag(PLAYER__FIELD_KNOWN_TITLES + fieldIndexOffset, flag);
|
||||
}
|
||||
|
||||
void Player::SetTitle(CharTitlesEntry const* title)
|
||||
void Player::SetTitle(CharTitlesEntry const* title, bool lost)
|
||||
{
|
||||
uint32 fieldIndexOffset = title->bit_index / 32;
|
||||
uint32 flag = 1 << (title->bit_index % 32);
|
||||
|
||||
if(lost)
|
||||
RemoveFlag(PLAYER__FIELD_KNOWN_TITLES + fieldIndexOffset, flag);
|
||||
else
|
||||
SetFlag(PLAYER__FIELD_KNOWN_TITLES + fieldIndexOffset, flag);
|
||||
|
||||
WorldPacket data(SMSG_TITLE_EARNED, 4 + 4);
|
||||
data << uint32(title->bit_index);
|
||||
data << uint32(lost ? 0 : 1); // 1 - earned, 0 - lost
|
||||
GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
void Player::ConvertRune(uint8 index, uint8 newType)
|
||||
|
|
|
|||
|
|
@ -135,11 +135,12 @@ enum ActionButtonUpdateState
|
|||
|
||||
enum ActionButtonType
|
||||
{
|
||||
ACTION_BUTTON_SPELL = 0,
|
||||
ACTION_BUTTON_EQSET = 32,
|
||||
ACTION_BUTTON_MACRO = 64,
|
||||
ACTION_BUTTON_CMACRO= 65,
|
||||
ACTION_BUTTON_ITEM = 128
|
||||
ACTION_BUTTON_SPELL = 0x00,
|
||||
ACTION_BUTTON_C = 0x01, // click?
|
||||
ACTION_BUTTON_EQSET = 0x20,
|
||||
ACTION_BUTTON_MACRO = 0x40,
|
||||
ACTION_BUTTON_CMACRO = ACTION_BUTTON_C | ACTION_BUTTON_MACRO,
|
||||
ACTION_BUTTON_ITEM = 0x80
|
||||
};
|
||||
|
||||
#define ACTION_BUTTON_ACTION(X) (uint32(X) & 0x00FFFFFF)
|
||||
|
|
@ -168,7 +169,7 @@ struct ActionButton
|
|||
}
|
||||
};
|
||||
|
||||
#define MAX_ACTION_BUTTONS 132 //checked in 2.3.0
|
||||
#define MAX_ACTION_BUTTONS 144 //checked in 2.3.0
|
||||
|
||||
typedef std::map<uint8,ActionButton> ActionButtonList;
|
||||
|
||||
|
|
@ -1685,7 +1686,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
|||
void SetSession(WorldSession *s) { m_session = s; }
|
||||
|
||||
void BuildCreateUpdateBlockForPlayer( UpdateData *data, Player *target ) const;
|
||||
void DestroyForPlayer( Player *target ) const;
|
||||
void DestroyForPlayer( Player *target, bool anim = false ) const;
|
||||
void SendDelayResponse(const uint32);
|
||||
void SendLogXPGain(uint32 GivenXP,Unit* victim,uint32 RestXP);
|
||||
|
||||
|
|
@ -1695,7 +1696,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
|||
void SendAttackSwingDeadTarget();
|
||||
void SendAttackSwingNotInRange();
|
||||
void SendAttackSwingBadFacingAttack();
|
||||
void SendAutoRepeatCancel();
|
||||
void SendAutoRepeatCancel(Unit *target);
|
||||
void SendExplorationExperience(uint32 Area, uint32 Experience);
|
||||
|
||||
void SendDungeonDifficulty(bool IsInGroup);
|
||||
|
|
@ -2172,7 +2173,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
|||
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1=0, uint32 miscvalue2=0, Unit *unit=NULL, uint32 time=0);
|
||||
bool HasTitle(uint32 bitIndex);
|
||||
bool HasTitle(CharTitlesEntry const* title) { return HasTitle(title->bit_index); }
|
||||
void SetTitle(CharTitlesEntry const* title);
|
||||
void SetTitle(CharTitlesEntry const* title, bool lost = false);
|
||||
|
||||
bool isActiveObject() const { return true; }
|
||||
bool canSeeSpellClickOn(Creature const* creature) const;
|
||||
|
|
|
|||
|
|
@ -823,10 +823,6 @@ void Spell::EffectDummy(uint32 i)
|
|||
DEBUG_LOG("AddObject at SpellEfects.cpp EffectDummy");
|
||||
map->Add(pGameObj);
|
||||
|
||||
WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);
|
||||
data << uint64(pGameObj->GetGUID());
|
||||
m_caster->SendMessageToSet(&data, true);
|
||||
|
||||
return;
|
||||
}
|
||||
case 23074: // Arcanite Dragonling
|
||||
|
|
@ -5699,9 +5695,6 @@ void Spell::EffectSummonObject(uint32 i)
|
|||
m_caster->AddGameObject(pGameObj);
|
||||
|
||||
map->Add(pGameObj);
|
||||
WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);
|
||||
data << uint64(pGameObj->GetGUID());
|
||||
m_caster->SendMessageToSet(&data, true);
|
||||
|
||||
m_caster->m_ObjectSlot[slot] = pGameObj->GetGUID();
|
||||
}
|
||||
|
|
@ -6313,10 +6306,8 @@ void Spell::EffectTransmitted(uint32 effIndex)
|
|||
case GAMEOBJECT_TYPE_FISHINGHOLE:
|
||||
case GAMEOBJECT_TYPE_CHEST:
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0);
|
||||
|
||||
|
|
@ -6331,10 +6322,6 @@ void Spell::EffectTransmitted(uint32 effIndex)
|
|||
|
||||
cMap->Add(pGameObj);
|
||||
|
||||
WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);
|
||||
data << uint64(pGameObj->GetGUID());
|
||||
m_caster->SendMessageToSet(&data,true);
|
||||
|
||||
if(uint32 linkedEntry = pGameObj->GetLinkedGameObjectEntry())
|
||||
{
|
||||
GameObject* linkedGO = new GameObject;
|
||||
|
|
|
|||
|
|
@ -53,8 +53,6 @@ void Totem::Update( uint32 time )
|
|||
|
||||
void Totem::Summon(Unit* owner)
|
||||
{
|
||||
sLog.outDebug("AddObject at Totem.cpp line 49");
|
||||
|
||||
SetInstanceId(owner->GetInstanceId());
|
||||
owner->GetMap()->Add((Creature*)this);
|
||||
|
||||
|
|
@ -69,30 +67,28 @@ void Totem::Summon(Unit* owner)
|
|||
SetDisplayId(display_id);
|
||||
}
|
||||
|
||||
WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);
|
||||
data << GetGUID();
|
||||
SendMessageToSet(&data,true);
|
||||
|
||||
AIM_Initialize();
|
||||
|
||||
switch(m_type)
|
||||
{
|
||||
case TOTEM_PASSIVE: CastSpell(this, GetSpell(), true); break;
|
||||
case TOTEM_STATUE: CastSpell(GetOwner(), GetSpell(), true); break;
|
||||
case TOTEM_PASSIVE:
|
||||
CastSpell(this, GetSpell(), true);
|
||||
break;
|
||||
case TOTEM_STATUE:
|
||||
CastSpell(GetOwner(), GetSpell(), true);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
void Totem::UnSummon()
|
||||
{
|
||||
SendObjectDeSpawnAnim(GetGUID());
|
||||
|
||||
CombatStop();
|
||||
RemoveAurasDueToSpell(GetSpell());
|
||||
Unit *owner = GetOwner();
|
||||
if (owner)
|
||||
{
|
||||
// clear owenr's totem slot
|
||||
// clear owner's totem slot
|
||||
for(int i = 0; i < MAX_TOTEM; ++i)
|
||||
{
|
||||
if(owner->m_TotemSlot[i] == GetGUID())
|
||||
|
|
@ -105,11 +101,12 @@ void Totem::UnSummon()
|
|||
owner->RemoveAurasDueToSpell(GetSpell());
|
||||
|
||||
//remove aura all party members too
|
||||
Group *pGroup = NULL;
|
||||
if (owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
((Player*)owner)->SendAutoRepeatCancel(this);
|
||||
|
||||
// Not only the player can summon the totem (scripted AI)
|
||||
pGroup = ((Player*)owner)->GetGroup();
|
||||
Group *pGroup = ((Player*)owner)->GetGroup();
|
||||
if (pGroup)
|
||||
{
|
||||
for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
|
|
@ -160,7 +157,7 @@ void Totem::SetTypeBySummonSpell(SpellEntry const * spellProto)
|
|||
|
||||
bool Totem::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) const
|
||||
{
|
||||
// TODO: possibly all negative auras immuned?
|
||||
// TODO: possibly all negative auras immune?
|
||||
switch(spellInfo->EffectApplyAuraName[index])
|
||||
{
|
||||
case SPELL_AURA_PERIODIC_DAMAGE:
|
||||
|
|
|
|||
|
|
@ -3139,7 +3139,7 @@ void Unit::InterruptSpell(uint32 spellType, bool withDelayed)
|
|||
if (spellType == CURRENT_AUTOREPEAT_SPELL)
|
||||
{
|
||||
if(GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)this)->SendAutoRepeatCancel();
|
||||
((Player*)this)->SendAutoRepeatCancel(this);
|
||||
}
|
||||
|
||||
if (m_currentSpells[spellType]->getState() != SPELL_STATE_FINISHED)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue