Update Spell code for 322a. Part 2

--HG--
branch : trunk
This commit is contained in:
n0n4m3
2009-12-17 12:23:01 +01:00
parent 515cf192ef
commit 772cf54fb5
6 changed files with 550 additions and 475 deletions

View File

@@ -325,7 +325,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
else
{
// not have spell in spellbook or spell passive and not casted by client
if (!((Creature*)mover)->HasSpell(spellId) || IsPassiveSpell(spellId) )
if ((mover->GetTypeId() == TYPEID_UNIT && !((Creature*)mover)->HasSpell(spellId)) || IsPassiveSpell(spellId))
{
//cheater? kick? ban?
recvPacket.rpos(recvPacket.wpos()); // prevent spam at ignore packet
@@ -356,10 +356,18 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
{
//recvPacket.read_skip<float>(); // unk1, coords?
//recvPacket.read_skip<float>(); // unk1, coords?
recvPacket.read_skip<uint8>(); // >> 1
recvPacket.read_skip<uint32>(); // >> MSG_MOVE_STOP
MovementInfo movementInfo;
ReadMovementInfo(recvPacket, &movementInfo);
uint8 unk1;
recvPacket >> unk1; // >> 1 or 0
if(unk1)
{
recvPacket.read_skip<uint32>(); // >> MSG_MOVE_STOP
uint64 guid; // guid - unused
if(!recvPacket.readPackGUID(guid))
return;
MovementInfo movementInfo;
ReadMovementInfo(recvPacket, &movementInfo);
}
}
// auto-selection buff level base at target level (in spellInfo)
@@ -632,4 +640,3 @@ void WorldSession::HandleMirrrorImageDataRequest( WorldPacket & recv_data )
}
SendPacket( &data );
}