diff options
| author | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-07-21 00:57:15 +0200 |
|---|---|---|
| committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-07-21 00:57:15 +0200 |
| commit | 40b87aca8f81ce9511478c31c0fe7fb31f56ea3c (patch) | |
| tree | fc6244a2b6c9bbeff9b18f8ffc86643b5fea7197 /src | |
| parent | b3e9ca7a6a4ea97e1b06fda70ef759f822bd4fde (diff) | |
Core/Spells: Small cleanup in b3e9ca7a6a4ea97e1b06fda70ef759f822bd4fde
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index a9c28159345..3dabd772ed3 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -197,25 +197,17 @@ class spell_gen_alchemist_stone : public SpellScriptLoader PreventDefaultAction(); uint32 spellId = 0; - int32 basepoints0 = 0; - TC_LOG_ERROR(LOG_FILTER_GENERAL, "procSpell: %u", eventInfo.GetDamageInfo()->GetSpellInfo()->Id); - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - { - if (eventInfo.GetDamageInfo()->GetSpellInfo()->Effects[i].Effect == SPELL_EFFECT_HEAL) - spellId = ALECHEMIST_STONE_HEAL; - else if (eventInfo.GetDamageInfo()->GetSpellInfo()->Effects[i].Effect == SPELL_EFFECT_ENERGIZE) - spellId = ALECHEMIST_STONE_MANA; - else - continue; - - basepoints0 = int32(GetTarget()->CalculateSpellDamage(GetTarget(), eventInfo.GetDamageInfo()->GetSpellInfo(), i) * 0.4f); - } + int32 bp = int32(eventInfo.GetDamageInfo()->GetDamage() * 0.4f); + if (eventInfo.GetDamageInfo()->GetSpellInfo()->HasEffect(SPELL_EFFECT_HEAL)) + spellId = ALECHEMIST_STONE_HEAL; + else if (eventInfo.GetDamageInfo()->GetSpellInfo()->HasEffect(SPELL_EFFECT_ENERGIZE)) + spellId = ALECHEMIST_STONE_MANA; + TC_LOG_ERROR(LOG_FILTER_GENERAL, "spellId: %u, procSpell: %u", spellId, eventInfo.GetDamageInfo()->GetSpellInfo()->Id); if (!spellId) return; - - GetTarget()->CastCustomSpell(GetTarget(), spellId, &basepoints0, NULL, NULL, true, NULL, aurEff); + GetTarget()->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, bp, GetTarget(), true, NULL, aurEff); } |
