Fixed SMSG_PET_SPELLS opcode.

This commit is contained in:
tomrus88 2009-05-08 15:30:39 +04:00
parent 216b947002
commit 930f3304de
4 changed files with 39 additions and 42 deletions

View file

@ -1308,18 +1308,18 @@ void WorldSession::HandleEquipmentSetSave(WorldPacket &recv_data)
if(!recv_data.readPackGUID(setGuid)) if(!recv_data.readPackGUID(setGuid))
return; return;
CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+4); CHECK_PACKET_SIZE(recv_data, recv_data.rpos() + 4);
uint32 index; uint32 index;
recv_data >> index; recv_data >> index;
if(index >= MAX_EQUIPMENT_SET_INDEX) // client set slots amount if(index >= MAX_EQUIPMENT_SET_INDEX) // client set slots amount
return; return;
CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+1); CHECK_PACKET_SIZE(recv_data, recv_data.rpos() + 1);
std::string name; std::string name;
recv_data >> name; recv_data >> name;
CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+1); CHECK_PACKET_SIZE(recv_data, recv_data.rpos() + 1);
std::string iconName; std::string iconName;
recv_data >> iconName; recv_data >> iconName;
@ -1336,10 +1336,18 @@ void WorldSession::HandleEquipmentSetSave(WorldPacket &recv_data)
if(!recv_data.readPackGUID(itemGuid)) if(!recv_data.readPackGUID(itemGuid))
return; return;
Item *item = _player->GetItemByPos(INVENTORY_SLOT_BAG_0, i);
if(!item && itemGuid) // cheating check 1
return;
if(item && item->GetGUID() != itemGuid) // cheating check 2
return;
eqSet.Items[i] = GUID_LOPART(itemGuid); eqSet.Items[i] = GUID_LOPART(itemGuid);
} }
_player->SetEquipmentSet(index,eqSet); _player->SetEquipmentSet(index, eqSet);
} }
void WorldSession::HandleEquipmentSetDelete(WorldPacket &recv_data) void WorldSession::HandleEquipmentSetDelete(WorldPacket &recv_data)

View file

@ -233,7 +233,7 @@ Item::Item( )
{ {
m_objectType |= TYPEMASK_ITEM; m_objectType |= TYPEMASK_ITEM;
m_objectTypeId = TYPEID_ITEM; m_objectTypeId = TYPEID_ITEM;
// 3.1.2 - 0x10
m_updateFlag = UPDATEFLAG_HIGHGUID; m_updateFlag = UPDATEFLAG_HIGHGUID;
m_valuesCount = ITEM_END; m_valuesCount = ITEM_END;

View file

@ -16108,9 +16108,8 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent)
if(pet->isControlled()) if(pet->isControlled())
{ {
WorldPacket data(SMSG_PET_SPELLS, 8+4); WorldPacket data(SMSG_PET_SPELLS, 8);
data << uint64(0); data << uint64(0);
data << uint32(0);
GetSession()->SendPacket(&data); GetSession()->SendPacket(&data);
if(GetGroup()) if(GetGroup())
@ -16253,9 +16252,9 @@ void Player::PetSpellInitialize()
CharmInfo *charmInfo = pet->GetCharmInfo(); CharmInfo *charmInfo = pet->GetCharmInfo();
WorldPacket data(SMSG_PET_SPELLS, 8+4+4+4+10*4); WorldPacket data(SMSG_PET_SPELLS, 8+2+4+4+4*10+1+1);
data << uint64(pet->GetGUID()); data << uint64(pet->GetGUID());
data << uint32(pet->GetCreatureInfo()->family); // creature family (required for pet talents) data << uint16(pet->GetCreatureInfo()->family); // creature family (required for pet talents)
data << uint32(0); data << uint32(0);
data << uint8(charmInfo->GetReactState()) << uint8(charmInfo->GetCommandState()) << uint16(0); data << uint8(charmInfo->GetReactState()) << uint8(charmInfo->GetCommandState()) << uint16(0);
@ -16330,24 +16329,19 @@ void Player::PossessSpellInitialize()
return; return;
} }
uint8 addlist = 0; WorldPacket data(SMSG_PET_SPELLS, 8+2+4+4+4*10+1+1);
WorldPacket data(SMSG_PET_SPELLS, 16+40+1+4*addlist+25);// first line + actionbar + spellcount + spells + last adds
//16
data << uint64(charm->GetGUID()); data << uint64(charm->GetGUID());
data << uint32(0x00000000); data << uint16(0);
data << uint32(0); data << uint32(0);
data << uint32(0); data << uint32(0);
for(uint32 i = 0; i < 10; ++i) //40 for(uint32 i = 0; i < 10; ++i)
{ {
data << uint16(charmInfo->GetActionBarEntry(i)->SpellOrAction) << uint16(charmInfo->GetActionBarEntry(i)->Type); data << uint16(charmInfo->GetActionBarEntry(i)->SpellOrAction) << uint16(charmInfo->GetActionBarEntry(i)->Type);
} }
data << uint8(addlist); //1 data << uint8(0); // spells count
data << uint8(0); // cooldowns count
uint8 count = 0;
data << uint8(count); // cooldowns count
GetSession()->SendPacket(&data); GetSession()->SendPacket(&data);
} }
@ -16382,23 +16376,22 @@ void Player::CharmSpellInitialize()
} }
} }
WorldPacket data(SMSG_PET_SPELLS, 16+40+1+4*addlist+25);// first line + actionbar + spellcount + spells + last adds WorldPacket data(SMSG_PET_SPELLS, 8+2+4+4+4*10+1+4*addlist+1);
data << uint64(charm->GetGUID()); data << uint64(charm->GetGUID());
data << uint32(0x00000000);
data << uint32(0);
if(charm->GetTypeId() != TYPEID_PLAYER)
data << uint8(charmInfo->GetReactState()) << uint8(charmInfo->GetCommandState());
else
data << uint8(0) << uint8(0);
data << uint16(0); data << uint16(0);
data << uint32(0);
for(uint32 i = 0; i < 10; ++i) //40 if(charm->GetTypeId() != TYPEID_PLAYER)
data << uint8(charmInfo->GetReactState()) << uint8(charmInfo->GetCommandState()) << uint16(0);
else
data << uint8(0) << uint8(0) << uint16(0);
for(uint32 i = 0; i < 10; ++i)
{ {
data << uint16(charmInfo->GetActionBarEntry(i)->SpellOrAction) << uint16(charmInfo->GetActionBarEntry(i)->Type); data << uint16(charmInfo->GetActionBarEntry(i)->SpellOrAction) << uint16(charmInfo->GetActionBarEntry(i)->Type);
} }
data << uint8(addlist); //1 data << uint8(addlist);
if(addlist) if(addlist)
{ {
@ -16413,8 +16406,7 @@ void Player::CharmSpellInitialize()
} }
} }
uint8 count = 0; data << uint8(0); // cooldowns count
data << uint8(count); // cooldowns count
GetSession()->SendPacket(&data); GetSession()->SendPacket(&data);
} }
@ -19156,10 +19148,10 @@ void Player::EnterVehicle(Vehicle *vehicle)
data << uint32(0); // fall time data << uint32(0); // fall time
GetSession()->SendPacket(&data); GetSession()->SendPacket(&data);
data.Initialize(SMSG_PET_SPELLS, 8+4+4+4+4*10+1+1); data.Initialize(SMSG_PET_SPELLS, 8+2+4+4+4*10+1+1);
data << uint64(vehicle->GetGUID()); data << uint64(vehicle->GetGUID());
data << uint32(0x00000000); data << uint16(0);
data << uint32(0x00000000); data << uint32(0);
data << uint32(0x00000101); data << uint32(0x00000101);
for(uint32 i = 0; i < 10; ++i) for(uint32 i = 0; i < 10; ++i)
@ -19195,9 +19187,8 @@ void Player::ExitVehicle(Vehicle *vehicle)
data << uint32(0); // fall time data << uint32(0); // fall time
GetSession()->SendPacket(&data); GetSession()->SendPacket(&data);
data.Initialize(SMSG_PET_SPELLS, 8+4); data.Initialize(SMSG_PET_SPELLS, 8);
data << uint64(0); data << uint64(0);
data << uint32(0);
GetSession()->SendPacket(&data); GetSession()->SendPacket(&data);
// maybe called at dummy aura remove? // maybe called at dummy aura remove?
@ -20066,7 +20057,7 @@ void Player::SendEquipmentSetList()
++count; // client have limit but it checked at loading and set ++count; // client have limit but it checked at loading and set
} }
data.put<uint32>(count_pos,count); data.put<uint32>(count_pos, count);
GetSession()->SendPacket(&data); GetSession()->SendPacket(&data);
} }
@ -20102,7 +20093,7 @@ void Player::SetEquipmentSet(uint32 index, EquipmentSet eqset)
{ {
eqslot.Guid = objmgr.GenerateEquipmentSetGuid(); eqslot.Guid = objmgr.GenerateEquipmentSetGuid();
WorldPacket data(SMSG_EQUIPMENT_SET_SAVED, 4+1); WorldPacket data(SMSG_EQUIPMENT_SET_SAVED, 4 + 1);
data << uint32(index); data << uint32(index);
data.appendPackGUID(eqslot.Guid); data.appendPackGUID(eqslot.Guid);
GetSession()->SendPacket(&data); GetSession()->SendPacket(&data);

View file

@ -3142,9 +3142,8 @@ void Aura::HandleModPossess(bool apply, bool Real)
((Player*)caster)->SetFarSightGUID(0); ((Player*)caster)->SetFarSightGUID(0);
((Player*)caster)->SetClientControl(m_target,0); ((Player*)caster)->SetClientControl(m_target,0);
WorldPacket data(SMSG_PET_SPELLS, 8+4); WorldPacket data(SMSG_PET_SPELLS, 8);
data << uint64(0); data << uint64(0);
data << uint32(0);
((Player*)caster)->GetSession()->SendPacket(&data); ((Player*)caster)->GetSession()->SendPacket(&data);
} }
@ -3297,9 +3296,8 @@ void Aura::HandleModCharm(bool apply, bool Real)
if(caster->GetTypeId() == TYPEID_PLAYER) if(caster->GetTypeId() == TYPEID_PLAYER)
{ {
WorldPacket data(SMSG_PET_SPELLS, 8+4); WorldPacket data(SMSG_PET_SPELLS, 8);
data << uint64(0); data << uint64(0);
data << uint32(0);
((Player*)caster)->GetSession()->SendPacket(&data); ((Player*)caster)->GetSession()->SendPacket(&data);
} }
if(m_target->GetTypeId() == TYPEID_UNIT) if(m_target->GetTypeId() == TYPEID_UNIT)