Skip to content

Commit

Permalink
Core/Spells/Auras: fix the way we handle spells that use SPELL_EFFECT…
Browse files Browse the repository at this point in the history
…_TRIGGER_SPELL_WITH_VALUE and SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE Closes #7622
  • Loading branch information
Star-lion committed Apr 3, 2013
1 parent e277f04 commit e2444c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/server/game/Spells/Auras/SpellAuraEffects.cpp
Expand Up @@ -5796,7 +5796,7 @@ void AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick(Unit* target, Unit*
{
if (Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster() ? caster : target)
{
int32 basepoints0 = GetAmount();
int32 basepoints0 = triggeredSpellInfo->Effects[EFFECT_0].CalcValue(triggerCaster) <= 1 ? triggeredSpellInfo->Effects[EFFECT_0].CalcValue(triggerCaster) : GetAmount();

This comment has been minimized.

Copy link
@Morgoporc

Morgoporc Apr 6, 2013

With :

triggeredSpellInfo->Effects[EFFECT_0].CalcValue(triggerCaster) >= 1 ? triggeredSpellInfo->Effects[EFFECT_0].CalcValue(triggerCaster) : GetAmount();

Mind flay works fine but SpellID 50989 deals 14058 at first tick and 1409 for the others.

This comment has been minimized.

Copy link
@Aokromes

Aokromes Apr 6, 2013

Member

How about update core and remove modifications before report bugs?

triggerCaster->CastCustomSpell(target, triggerSpellId, &basepoints0, 0, 0, true, 0, this);
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell %u Trigger %u", GetId(), triggeredSpellInfo->Id);
}
Expand Down
5 changes: 2 additions & 3 deletions src/server/game/Spells/SpellEffects.cpp
Expand Up @@ -939,9 +939,8 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex)
if (m_spellInfo->Effects[effIndex].Effect == SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE)
{
// maybe need to set value only when basepoints == 0?
values.AddSpellMod(SPELLVALUE_BASE_POINT0, damage);
values.AddSpellMod(SPELLVALUE_BASE_POINT1, damage);
values.AddSpellMod(SPELLVALUE_BASE_POINT2, damage);
if (m_spellInfo->Effects[effIndex].BasePoints == 0)
values.AddSpellMod((SpellValueMod)effIndex, damage);
}

// Remove spell cooldown (not category) if spell triggering spell with cooldown and same category
Expand Down

1 comment on commit e2444c0

@garyfisher
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not work http://wotlk.openwow.com/spell=15407 [Mind Flay] 0 dmg ;/

Please sign in to comment.