[8098] Support uint32 spell ids in code.

* 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.
This commit is contained in:
VladimirMangos 2009-06-30 07:37:36 +04:00
parent c24e041794
commit 1baec77845
21 changed files with 638 additions and 565 deletions

View file

@ -422,8 +422,8 @@ void Pet::SavePetToDB(PetSaveMode mode)
// save only spell slots from action bar
for(uint32 i = ACTION_BAR_INDEX_PET_SPELL_START; i < ACTION_BAR_INDEX_PET_SPELL_END; ++i)
{
ss << uint32(m_charmInfo->GetActionBarEntry(i)->Type) << " "
<< uint32(m_charmInfo->GetActionBarEntry(i)->SpellOrAction) << " ";
ss << uint32(m_charmInfo->GetActionBarEntry(i)->GetType()) << " "
<< uint32(m_charmInfo->GetActionBarEntry(i)->GetAction()) << " ";
};
ss << "', "
@ -1102,7 +1102,7 @@ void Pet::_LoadSpells()
{
Field *fields = result->Fetch();
addSpell(fields[0].GetUInt32(), ActiveStates(fields[1].GetUInt16()), PETSPELL_UNCHANGED);
addSpell(fields[0].GetUInt32(), ActiveStates(fields[1].GetUInt8()), PETSPELL_UNCHANGED);
}
while( result->NextRow() );
@ -1404,8 +1404,8 @@ bool Pet::learnSpell(uint32 spell_id)
Unit* owner = GetOwner();
if(owner && owner->GetTypeId() == TYPEID_PLAYER)
{
WorldPacket data(SMSG_PET_LEARNED_SPELL, 2);
data << uint16(spell_id);
WorldPacket data(SMSG_PET_LEARNED_SPELL, 4);
data << uint32(spell_id);
((Player*)owner)->GetSession()->SendPacket(&data);
((Player*)owner)->PetSpellInitialize();
@ -1461,8 +1461,8 @@ bool Pet::unlearnSpell(uint32 spell_id, bool learn_prev, bool clear_ab)
{
if(!m_loading)
{
WorldPacket data(SMSG_PET_REMOVED_SPELL, 2);
data << uint16(spell_id);
WorldPacket data(SMSG_PET_REMOVED_SPELL, 4);
data << uint32(spell_id);
((Player*)GetOwner())->GetSession()->SendPacket(&data);
}
}
@ -1527,8 +1527,9 @@ void Pet::CleanupActionBar()
{
for(int i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i)
if(UnitActionBarEntry const* ab = m_charmInfo->GetActionBarEntry(i))
if(ab->SpellOrAction && ab->IsActionBarForSpell() && !HasSpell(ab->SpellOrAction))
m_charmInfo->SetActionBar(i,0,ACT_DISABLED);
if(uint32 action = ab->GetAction())
if(ab->IsActionBarForSpell() && !HasSpell(action))
m_charmInfo->SetActionBar(i,0,ACT_DISABLED);
}
void Pet::InitPetCreateSpells()
@ -1903,7 +1904,7 @@ void Pet::CastPetAuras(bool current)
void Pet::CastPetAura(PetAura const* aura)
{
uint16 auraId = aura->GetAura(GetEntry());
uint32 auraId = aura->GetAura(GetEntry());
if(!auraId)
return;