mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +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)
|
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
|
// 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();
|
slot = itr->second->GetAuraSlot();
|
||||||
secondaura = true;
|
secondaura = true;
|
||||||
|
|
@ -1412,6 +1413,37 @@ void Aura::ReapplyAffectedPassiveAuras()
|
||||||
ReapplyAffectedPassiveAuras(member, false);
|
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 ***/
|
/*** BASIC AURA FUNCTION ***/
|
||||||
/*********************************************************/
|
/*********************************************************/
|
||||||
|
|
|
||||||
|
|
@ -352,6 +352,7 @@ class MANGOS_DLL_SPEC Aura
|
||||||
|
|
||||||
uint32 const *getAuraSpellClassMask() const { return m_spellProto->GetEffectSpellClassMask(m_effIndex); }
|
uint32 const *getAuraSpellClassMask() const { return m_spellProto->GetEffectSpellClassMask(m_effIndex); }
|
||||||
bool isAffectedOnSpell(SpellEntry const *spell) const;
|
bool isAffectedOnSpell(SpellEntry const *spell) const;
|
||||||
|
bool isWeaponBuffCoexistableWith(Aura* ref);
|
||||||
protected:
|
protected:
|
||||||
Aura(SpellEntry const* spellproto, SpellEffectIndex eff, int32 *currentBasePoints, Unit *target, Unit *caster = NULL, Item* castItem = NULL);
|
Aura(SpellEntry const* spellproto, SpellEffectIndex eff, int32 *currentBasePoints, Unit *target, Unit *caster = NULL, Item* castItem = NULL);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3813,8 +3813,13 @@ bool Unit::AddAura(Aura *Aur)
|
||||||
delete Aur;
|
delete Aur;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check for coexisting Weapon-proced Auras
|
||||||
|
if (Aur->isWeaponBuffCoexistableWith(aur2))
|
||||||
|
continue;
|
||||||
|
|
||||||
// Carry over removed Aura's remaining damage if Aura still has ticks remaining
|
// Carry over removed Aura's remaining damage if Aura still has ticks remaining
|
||||||
else if (aur2->GetSpellProto()->AttributesEx4 & SPELL_ATTR_EX4_STACK_DOT_MODIFIER && aurName == SPELL_AURA_PERIODIC_DAMAGE && aur2->GetAuraDuration() > 0)
|
if (aur2->GetSpellProto()->AttributesEx4 & SPELL_ATTR_EX4_STACK_DOT_MODIFIER && aurName == SPELL_AURA_PERIODIC_DAMAGE && aur2->GetAuraDuration() > 0)
|
||||||
{
|
{
|
||||||
int32 remainingTicks = aur2->GetAuraMaxTicks() - aur2->GetAuraTicks();
|
int32 remainingTicks = aur2->GetAuraMaxTicks() - aur2->GetAuraTicks();
|
||||||
int32 remainingDamage = aur2->GetModifier()->m_amount * remainingTicks;
|
int32 remainingDamage = aur2->GetModifier()->m_amount * remainingTicks;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "9522"
|
#define REVISION_NR "9523"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue