aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r--src/game/Player.cpp45
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)