mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 10:37:01 +00:00
[9523] Stacking Auras from dual wild weapons.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
da30ea5ed8
commit
0ca87c50a6
4 changed files with 41 additions and 3 deletions
|
|
@ -983,7 +983,8 @@ void Aura::_AddAura()
|
|||
for(Unit::AuraMap::const_iterator itr = m_target->GetAuras().lower_bound(spair); itr != m_target->GetAuras().upper_bound(spair); ++itr)
|
||||
{
|
||||
// allow use single slot only by auras from same caster
|
||||
if(itr->second->GetCasterGUID()==GetCasterGUID())
|
||||
if(itr->second->GetCasterGUID()==GetCasterGUID() &&
|
||||
!isWeaponBuffCoexistableWith(itr->second))
|
||||
{
|
||||
slot = itr->second->GetAuraSlot();
|
||||
secondaura = true;
|
||||
|
|
@ -1412,6 +1413,37 @@ void Aura::ReapplyAffectedPassiveAuras()
|
|||
ReapplyAffectedPassiveAuras(member, false);
|
||||
}
|
||||
|
||||
bool Aura::isWeaponBuffCoexistableWith(Aura* ref)
|
||||
{
|
||||
// Exclude Debuffs
|
||||
if (!IsPositive())
|
||||
return false;
|
||||
|
||||
// Exclude Non-generic Buffs [ie: Runeforging] and Executioner-Enchant
|
||||
if (GetSpellProto()->SpellFamilyName != SPELLFAMILY_GENERIC || GetId() == 42976)
|
||||
return false;
|
||||
|
||||
// Exclude Stackable Buffs [ie: Blood Reserve]
|
||||
if (GetSpellProto()->StackAmount)
|
||||
return false;
|
||||
|
||||
// only self applied player buffs
|
||||
if (m_target->GetTypeId() != TYPEID_PLAYER || m_target->GetGUID() != GetCasterGUID())
|
||||
return false;
|
||||
|
||||
Item* castItem = ((Player*)m_target)->GetItemByGuid(GetCastItemGUID());
|
||||
if (!castItem)
|
||||
return false;
|
||||
|
||||
// Limit to Weapon-Slots
|
||||
if (!castItem->IsEquipped() ||
|
||||
(castItem->GetSlot() != EQUIPMENT_SLOT_MAINHAND && castItem->GetSlot() != EQUIPMENT_SLOT_OFFHAND))
|
||||
return false;
|
||||
|
||||
// form different weapons
|
||||
return ref->GetCastItemGUID() != GetCastItemGUID();
|
||||
}
|
||||
|
||||
/*********************************************************/
|
||||
/*** BASIC AURA FUNCTION ***/
|
||||
/*********************************************************/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue