From 1ae3459cff09c138be5332ab5302394dd9a3b1ab Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 29 Sep 2010 20:44:14 +0200 Subject: [PATCH] Core/Spells: Added partial support for Mixology (duration boost) Update issue #4097. Status: Confirmed Implemented duration part, waiting for the rest --HG-- branch : trunk --- src/server/game/Entities/Unit/Unit.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 834fdd84bd..40c269fb92 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12763,8 +12763,23 @@ int32 Unit::ModSpellDuration(SpellEntry const* spellProto, Unit const* target, i if (durationMod != 0) duration = int32(float(duration) * float(100.0f+durationMod) / 100.0f); } - //else positive mods here, there are no currently - //when there will be, change GetTotalAuraModifierByMiscValue to GetTotalPositiveAuraModifierByMiscValue + else + { + //else positive mods here, there are no currently + //when there will be, change GetTotalAuraModifierByMiscValue to GetTotalPositiveAuraModifierByMiscValue + + // Mixology - duration boost + if (target->GetTypeId() == TYPEID_PLAYER) + { + if (spellProto->SpellFamilyName == SPELLFAMILY_POTION && ( + sSpellMgr.IsSpellMemberOfSpellGroup(spellProto->Id, SPELL_GROUP_ELIXIR_BATTLE) || + sSpellMgr.IsSpellMemberOfSpellGroup(spellProto->Id, SPELL_GROUP_ELIXIR_GUARDIAN))) + { + if (target->HasAura(53042) && target->HasSpell(spellProto->EffectTriggerSpell[0])) + duration *= 2; + } + } + } // Glyphs which increase duration of selfcasted buffs if (target == this)