Jump to content

[fix] Spell::EffectQuestComplete


Guest KiriX

Recommended Posts

This patch fix target select for spell effect EffectQuestComplete. So spell as http://www.wowhead.com/spell=31336 should work correctly. Now for MaNGOS all spells with EffectQuestComplete should be cast by player:

if(m_caster->GetTypeId() != TYPEID_PLAYER)

return;

and effects would be apply at caster:

Player *_player = (Player*)m_caster;

_player->AreaExploredOrEventHappens(quest_id);

ignoring all spell's targets from DBC.

But spell 31336 has EffectQuestComplete and target for this effect - (TARGET_CASTER_COORDINATES, TARGET_ALL_ENEMY_IN_AREA) and effect will never be apply at player. Also this spell should be cast by NPC http://www.wowhead.com/npc=17664, but with current Spell::EffectQuestComplete implemention will never be apply at player.

Patch fix this.

diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 096dae3..70ea439 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -7182,10 +7182,10 @@ void Spell::EffectReputation(SpellEffectIndex eff_idx)

void Spell::EffectQuestComplete(SpellEffectIndex eff_idx)
{
-    if(m_caster->GetTypeId() != TYPEID_PLAYER)
+    if(unitTarget->GetTypeId() != TYPEID_PLAYER)
        return;

-    Player *_player = (Player*)m_caster;
+    Player *_player = (Player*)unitTarget;

    uint32 quest_id = m_spellInfo->EffectMiscValue[eff_idx];
    _player->AreaExploredOrEventHappens(quest_id);

Author: me

Link to comment
Share on other sites

  • 1 year later...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use