*Do not allow toggle unautocastable spells for pet.
--HG-- branch : trunk
This commit is contained in:
@@ -560,7 +560,7 @@ void WorldSession::HandlePetSpellAutocastOpcode( WorldPacket& recvPacket )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// do not add not learned spells/ passive spells
|
// do not add not learned spells/ passive spells
|
||||||
if(!pet->HasSpell(spellid) || IsPassiveSpell(spellid))
|
if(!pet->HasSpell(spellid) || IsAutocastableSpell(spellid))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CharmInfo *charmInfo = pet->GetCharmInfo();
|
CharmInfo *charmInfo = pet->GetCharmInfo();
|
||||||
|
|||||||
@@ -263,6 +263,18 @@ bool IsPassiveSpell(uint32 spellId)
|
|||||||
return (spellInfo->Attributes & SPELL_ATTR_PASSIVE) != 0;
|
return (spellInfo->Attributes & SPELL_ATTR_PASSIVE) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsAutocastableSpell(uint32 spellId)
|
||||||
|
{
|
||||||
|
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
|
||||||
|
if(!spellInfo)
|
||||||
|
return false;
|
||||||
|
if(spellInfo->Attributes & SPELL_ATTR_PASSIVE)
|
||||||
|
return false;
|
||||||
|
if(spellInfo->AttributesEx & SPELL_ATTR_EX_UNAUTOCASTABLE_BY_PET)
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/*bool IsNoStackAuraDueToAura(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2)
|
/*bool IsNoStackAuraDueToAura(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2)
|
||||||
{
|
{
|
||||||
SpellEntry const *spellInfo_1 = sSpellStore.LookupEntry(spellId_1);
|
SpellEntry const *spellInfo_1 = sSpellStore.LookupEntry(spellId_1);
|
||||||
|
|||||||
@@ -202,6 +202,7 @@ int32 CompareAuraRanks(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, ui
|
|||||||
bool IsSingleFromSpellSpecificPerCaster(uint32 spellSpec1, uint32 spellSpec2);
|
bool IsSingleFromSpellSpecificPerCaster(uint32 spellSpec1, uint32 spellSpec2);
|
||||||
bool IsSingleFromSpellSpecificPerTarget(uint32 spellSpec1, uint32 spellSpec2);
|
bool IsSingleFromSpellSpecificPerTarget(uint32 spellSpec1, uint32 spellSpec2);
|
||||||
bool IsPassiveSpell(uint32 spellId);
|
bool IsPassiveSpell(uint32 spellId);
|
||||||
|
bool IsAutocastableSpell(uint32 spellId);
|
||||||
|
|
||||||
inline bool IsPassiveSpellStackableWithRanks(SpellEntry const* spellProto)
|
inline bool IsPassiveSpellStackableWithRanks(SpellEntry const* spellProto)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user