Skip to content

Commit

Permalink
[11981] Fix targeting of most pet spells. They expect to target alive…
Browse files Browse the repository at this point in the history
… pets

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
  • Loading branch information
Den authored and Schmoozerd committed Apr 26, 2012
1 parent 4784c49 commit 65e675e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/game/Spell.cpp
Expand Up @@ -4920,17 +4920,20 @@ SpellCastResult Spell::CheckCast(bool strict)
}

// check pet presents

This comment has been minimized.

Copy link
@DomGries

DomGries Apr 26, 2012

Contributor

Someone kill this typo! Makes me really uncomfortable looking at it :)

This comment has been minimized.

Copy link
@Schmoozerd

Schmoozerd Apr 26, 2012

Contributor

come on - friendly pets make presents to their owner sometimes!

for(int j = 0; j < MAX_EFFECT_INDEX; ++j)
for (int j = 0; j < MAX_EFFECT_INDEX; ++j)
{
if(m_spellInfo->EffectImplicitTargetA[j] == TARGET_PET)
if (m_spellInfo->EffectImplicitTargetA[j] == TARGET_PET)
{
if(!m_caster->GetPet())
Pet* pet = m_caster->GetPet();
if (!pet)
{
if(m_triggeredByAuraSpell) // not report pet not existence for triggered spells
if (m_triggeredByAuraSpell) // not report pet not existence for triggered spells
return SPELL_FAILED_DONT_REPORT;
else
return SPELL_FAILED_NO_PET;
}
else if (!pet->isAlive())
return SPELL_FAILED_TARGETS_DEAD;
break;
}
}
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 "11980"
#define REVISION_NR "11981"
#endif // __REVISION_NR_H__

2 comments on commit 65e675e

@Kreegoth
Copy link

Choose a reason for hiding this comment

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

Does anyone have Heart of the pheonix working correctly. That spell expects a dead pet so is 'kindof' related to this... in a way... Somewhat...

@Schmoozerd
Copy link
Contributor

Choose a reason for hiding this comment

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

If I see this correctly, spells
55709 needs a simple implementation to check if the there is a pet, and this pet is dead (might even be required into check-cast..)
If this spell can be cast, then the effect should most likely be to cast
54114 to revive the dead pet

Please sign in to comment.