Skip to content

Commit

Permalink
[12868] Implement spells required for quest 27347
Browse files Browse the repository at this point in the history
This implements spell effects 42485, 42489 and 42492

Thanks to @Grz3s for testing

Close unified-db/Database#18
  • Loading branch information
xfurry committed Apr 19, 2015
1 parent d68d838 commit 618dc04
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
37 changes: 37 additions & 0 deletions src/game/SpellEffects.cpp
Expand Up @@ -1550,6 +1550,31 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)

return;
}
case 42485: // End of Ooze Channel
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT)
return;

unitTarget->CastSpell(m_caster, 42486, true);

// There is no known spell to kill the target
unitTarget->DealDamage(unitTarget, unitTarget->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
return;
}
case 42489: // Cast Ooze Zap When Energized
{
// only process first effect
// the logic is described by spell 42488 - Caster Spell 1 Only if Aura 2 Is On Caster (not used here)
if (eff_idx != EFFECT_INDEX_0)
return;

if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT || !m_caster->HasAura(m_spellInfo->CalculateSimpleValue(EFFECT_INDEX_1)))
return;

m_caster->CastSpell(unitTarget, m_spellInfo->CalculateSimpleValue(eff_idx), true);
((Creature*)unitTarget)->AI()->AttackStart(m_caster);
return;
}
case 42628: // Fire Bomb (throw)
{
if (!unitTarget)
Expand Down Expand Up @@ -7658,6 +7683,18 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
unitTarget->CastSpell(unitTarget, 42291, true);
return;
}
case 42492: // Cast Energized
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;

uint32 questId = m_spellInfo->CalculateSimpleValue(EFFECT_INDEX_1);
if (!questId || !GetQuestTemplateStore(questId) || !((Player*)unitTarget)->IsCurrentQuest(questId))
return;

m_caster->CastSpell(m_caster, m_spellInfo->CalculateSimpleValue(eff_idx), true);
return;
}
case 42578: // Cannon Blast
{
if (!unitTarget)
Expand Down
1 change: 1 addition & 0 deletions src/game/SpellMgr.cpp
Expand Up @@ -704,6 +704,7 @@ bool IsPositiveEffect(SpellEntry const* spellproto, SpellEffectIndex effIndex)
switch (spellproto->Id)
{
case 42436: // Drink!
case 42492: // Cast Energized
case 46650: // Open Brutallus Back Door
case 62488: // Activate Construct
case 64503: // Water
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12867"
#define REVISION_NR "12868"
#endif // __REVISION_NR_H__

1 comment on commit 618dc04

@xfurry
Copy link
Member Author

@xfurry xfurry commented on 618dc04 Apr 19, 2015

Choose a reason for hiding this comment

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

Actually the quest id is 11174.
Sorry for this.

Please sign in to comment.