Merge remote branch 'origin/master' into 330

This commit is contained in:
tomrus88 2009-12-21 17:06:32 +03:00
commit d69abfcae1
15 changed files with 98 additions and 167 deletions

View file

@ -274,6 +274,33 @@ std::ostringstream& operator<< (std::ostringstream& ss, PlayerTaxi const& taxi)
return ss;
}
SpellModifier::SpellModifier( SpellModOp _op, SpellModType _type, int32 _value, SpellEntry const* spellEntry, uint8 eff, int16 _charges /*= 0*/ ) : op(_op), type(_type), charges(_charges), value(_value), spellId(spellEntry->Id), lastAffected(NULL)
{
uint32 const* ptr = spellEntry->GetEffectSpellClassMask(eff);
mask = uint64(ptr[0]) | (uint64(ptr[1]) << 32);
mask2= ptr[2];
}
SpellModifier::SpellModifier( SpellModOp _op, SpellModType _type, int32 _value, Aura const* aura, int16 _charges /*= 0*/ ) : op(_op), type(_type), charges(_charges), value(_value), spellId(aura->GetId()), lastAffected(NULL)
{
uint32 const* ptr = aura->getAuraSpellClassMask();
mask = uint64(ptr[0]) | (uint64(ptr[1]) << 32);
mask2= ptr[2];
}
bool SpellModifier::isAffectedOnSpell( SpellEntry const *spell ) const
{
SpellEntry const *affect_spell = sSpellStore.LookupEntry(spellId);
// False if affect_spell == NULL or spellFamily not equal
if (!affect_spell || affect_spell->SpellFamilyName != spell->SpellFamilyName)
return false;
if (mask & spell->SpellFamilyFlags)
return true;
if (mask2 & spell->SpellFamilyFlags2)
return true;
return false;
}
//== Player ====================================================
UpdateMask Player::updateVisualBits;
@ -17168,7 +17195,7 @@ bool Player::IsAffectedBySpellmod(SpellEntry const *spellInfo, SpellModifier *mo
return false;
}
return sSpellMgr.IsAffectedByMod(spellInfo, mod);
return mod->isAffectedOnSpell(spellInfo);
}
void Player::AddSpellMod(SpellModifier* mod, bool apply)
@ -17178,9 +17205,9 @@ void Player::AddSpellMod(SpellModifier* mod, bool apply)
for(int eff=0;eff<96;++eff)
{
uint64 _mask = 0;
uint64 _mask2= 0;
uint32 _mask2= 0;
if (eff<64) _mask = uint64(1) << (eff- 0);
else _mask2= uint64(1) << (eff-64);
else _mask2= uint32(1) << (eff-64);
if ( mod->mask & _mask || mod->mask2 & _mask2)
{
int32 val = 0;
@ -21287,3 +21314,4 @@ void Player::SetHomebindToCurrentPos()
CharacterDatabase.PExecute("UPDATE character_homebind SET map = '%u', zone = '%u', position_x = '%f', position_y = '%f', position_z = '%f' WHERE guid = '%u'",
m_homebindMapId, m_homebindZoneId, m_homebindX, m_homebindY, m_homebindZ, GetGUIDLow());
}