*Implement Aura Type 247 (SPELL_AURA_CLONE_CASTER) and 279 (SPELL_AURA_INITIALIZE_IMAGES)

*Handle CMSG_GET_MIRRORIMAGE_DATA opcode.
*Save Minions follow angle to allow themmoving in a formation
*Improvements in SpellAI: correctly evade and select attack target for creatures without threat list
*Use SpellAI instead of PetAI for not controllable guardians
*Only guardians with SUMMON_TYPE_PET are controllable now
*Add script and template data for Mirror Image.
*Thanks to Drahy for help.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-07-22 17:10:30 +02:00
parent a00473d795
commit 2ff21d4cef
30 changed files with 278 additions and 54 deletions

View File

@@ -537,3 +537,79 @@ void WorldSession::HandleSpellClick( WorldPacket & recv_data )
if(unit->isVehicle())
_player->EnterVehicle((Vehicle*)unit);
}
void WorldSession::HandleMirrrorImageDataRequest( WorldPacket & recv_data )
{
sLog.outDebug("WORLD: CMSG_GET_MIRRORIMAGE_DATA");
CHECK_PACKET_SIZE(recv_data, 8);
uint64 guid;
recv_data >> guid;
// Get unit for which data is needed by client
Unit *unit = ObjectAccessor::GetObjectInWorld(guid, (Unit*)NULL);
if(!unit)
return;
// Get creator of the unit
Unit *creator = ObjectAccessor::GetObjectInWorld(unit->GetCreatorGUID(),(Unit*)NULL);
if (!creator)
return;
WorldPacket data(SMSG_MIRRORIMAGE_DATA, 68);
data << (uint64)guid;
data << (uint32)creator->GetDisplayId();
if (creator->GetTypeId()==TYPEID_PLAYER)
{
Player * pCreator = (Player *)creator;
data << (uint8)pCreator->getRace();
data << (uint8)pCreator->getGender();
data << (uint8)pCreator->getClass();
data << (uint8)pCreator->GetByteValue(PLAYER_BYTES, 0); // skin
data << (uint8)pCreator->GetByteValue(PLAYER_BYTES, 1); // face
data << (uint8)pCreator->GetByteValue(PLAYER_BYTES, 2); // hair
data << (uint8)pCreator->GetByteValue(PLAYER_BYTES, 3); // haircolor
data << (uint8)pCreator->GetByteValue(PLAYER_BYTES_2, 0); // facialhair
data << (uint32)0; // unk
static const EquipmentSlots ItemSlots[] =
{
EQUIPMENT_SLOT_HEAD,
EQUIPMENT_SLOT_SHOULDERS,
EQUIPMENT_SLOT_BODY,
EQUIPMENT_SLOT_CHEST,
EQUIPMENT_SLOT_WAIST,
EQUIPMENT_SLOT_LEGS,
EQUIPMENT_SLOT_FEET,
EQUIPMENT_SLOT_WRISTS,
EQUIPMENT_SLOT_HANDS,
EQUIPMENT_SLOT_BACK,
EQUIPMENT_SLOT_TABARD,
EQUIPMENT_SLOT_END
};
// Display items in visible slots
for (EquipmentSlots const* itr = &ItemSlots[0];*itr!=EQUIPMENT_SLOT_END;++itr)
if (Item const *item = pCreator->GetItemByPos(INVENTORY_SLOT_BAG_0, *itr))
data << (uint32)item->GetProto()->DisplayInfoID;
else
data << (uint32)0;
}
else
{
// Skip player data for creatures
data << (uint32)0;
data << (uint32)0;
data << (uint32)0;
data << (uint32)0;
data << (uint32)0;
data << (uint32)0;
data << (uint32)0;
data << (uint32)0;
data << (uint32)0;
data << (uint32)0;
data << (uint32)0;
data << (uint32)0;
data << (uint32)0;
data << (uint32)0;
}
SendPacket( &data );
}