diff options
| author | Blaymoira <none@none> | 2009-03-14 19:35:04 +0100 |
|---|---|---|
| committer | Blaymoira <none@none> | 2009-03-14 19:35:04 +0100 |
| commit | 04a42413bf9662c4e9c6cfdf6916e05325d090c7 (patch) | |
| tree | 7689deba162f051770b979d48e2f6279697129f7 /src/game/Player.cpp | |
| parent | ef71840b7ecb62a15ebc74954f26b20f290f8cc7 (diff) | |
| parent | 8cce1ff1ecf795ebe8c620a9469e3b9d7290241a (diff) | |
*Merge
--HG--
branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
| -rw-r--r-- | src/game/Player.cpp | 45 |
1 files changed, 33 insertions, 12 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 68bb5628887..d3af537026f 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -17367,6 +17367,38 @@ void Player::PossessSpellInitialize() GetSession()->SendPacket(&data); } +void Player::VehicleSpellInitialize() +{ + Unit* charm = GetCharm(); + if(!charm || charm->GetTypeId() != TYPEID_UNIT) + return; + + WorldPacket data(SMSG_PET_SPELLS, 8+4+4+4+4*10+1+1); + data << uint64(charm->GetGUID()); + data << uint32(0x00000000); + data << uint32(0x00000000); + data << uint32(0x00000101); + + for(uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i) + { + uint32 spellId = ((Creature*)charm)->m_spells[i]; + if(IsPassiveSpell(spellId)) + { + charm->CastSpell(charm, spellId, true); + data << uint16(0) << uint8(0) << uint8(i+8); + } + else + data << uint16(spellId) << uint8(0) << uint8(i+8); + } + + for(uint32 i = CREATURE_MAX_SPELLS; i < 10; ++i) + data << uint16(0) << uint8(0) << uint8(i+8); + + data << uint8(0); + data << uint8(0); + GetSession()->SendPacket(&data); +} + void Player::CharmSpellInitialize() { Unit* charm = GetCharm(); @@ -20302,18 +20334,7 @@ void Player::EnterVehicle(Vehicle *vehicle) data << uint32(0); // fall time GetSession()->SendPacket(&data); - data.Initialize(SMSG_PET_SPELLS, 8+4+4+4+4*10+1+1); - data << uint64(vehicle->GetGUID()); - data << uint32(0x00000000); - data << uint32(0x00000000); - data << uint32(0x00000101); - - for(uint32 i = 0; i < 10; ++i) - data << uint16(0) << uint8(0) << uint8(i+8); - - data << uint8(0); - data << uint8(0); - GetSession()->SendPacket(&data); + VehicleSpellInitialize(); } void Player::ExitVehicle(Vehicle *vehicle) |
