*Backup your DB!

[8098] Support uint32 spell ids in code. Author: VladimirMangos

    * Propertly work with uint32 spell ids in player action bar
    * Fix in same time bug with not save equipment set button with id==0
    * Merge misc field in character_action and playercreateinfo_action to action field as 3 byte
    * Propertly load uint32 spell ids from character_spell
    * Fixed types for some pet/creature related structure for spell id storing.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-07-01 18:07:20 -05:00
parent 8122a15f46
commit e1d93bd00f
16 changed files with 635 additions and 571 deletions

View File

@@ -1040,40 +1040,41 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data)
CHECK_PACKET_SIZE(recv_data,1+2+1+1);
sLog.outDebug( "WORLD: Received CMSG_SET_ACTION_BUTTON" );
uint8 button, misc, type;
uint16 action;
recv_data >> button >> action >> misc >> type;
sLog.outDetail( "BUTTON: %u ACTION: %u TYPE: %u MISC: %u", button, action, type, misc );
if(action==0)
uint8 button;
uint32 packetData;
recv_data >> button >> packetData;
uint32 action = ACTION_BUTTON_ACTION(packetData);
uint8 type = ACTION_BUTTON_TYPE(packetData);
sLog.outDetail( "BUTTON: %u ACTION: %u TYPE: %u", button, action, type );
if (!packetData)
{
sLog.outDetail( "MISC: Remove action from button %u", button );
GetPlayer()->removeActionButton(button);
}
else
{
if(type==ACTION_BUTTON_MACRO || type==ACTION_BUTTON_CMACRO)
switch(type)
{
sLog.outDetail( "MISC: Added Macro %u into button %u", action, button );
GetPlayer()->addActionButton(button,action,type,misc);
case ACTION_BUTTON_MACRO:
case ACTION_BUTTON_CMACRO:
sLog.outDetail( "MISC: Added Macro %u into button %u", action, button );
break;
case ACTION_BUTTON_EQSET:
sLog.outDetail( "MISC: Added EquipmentSet %u into button %u", action, button );
break;
case ACTION_BUTTON_SPELL:
sLog.outDetail( "MISC: Added Spell %u into button %u", action, button );
break;
case ACTION_BUTTON_ITEM:
sLog.outDetail( "MISC: Added Item %u into button %u", action, button );
break;
default:
sLog.outError( "MISC: Unknown action button type %u for action %u into button %u", type, action, button );
return;
}
else if(type==ACTION_BUTTON_EQSET)
{
sLog.outDetail( "MISC: Added EquipmentSet %u into button %u", action, button );
GetPlayer()->addActionButton(button,action,type,misc);
}
else if(type==ACTION_BUTTON_SPELL)
{
sLog.outDetail( "MISC: Added Spell %u into button %u", action, button );
GetPlayer()->addActionButton(button,action,type,misc);
}
else if(type==ACTION_BUTTON_ITEM)
{
sLog.outDetail( "MISC: Added Item %u into button %u", action, button );
GetPlayer()->addActionButton(button,action,type,misc);
}
else
sLog.outError( "MISC: Unknown action button type %u for action %u into button %u", type, action, button );
GetPlayer()->addActionButton(button,action,type);
}
}