Jump to content
  • Quest reward spells are cast incorrectly...

    • Status: Confirmed
      Main Category: Database
      Sub-Category: NPC
      Version: 21.0 Milestone: 21 Priority: Normal
      Implemented Version: 0.20

    Quest reward spells are cast incorrectly...

    When completing a quest I got a message "not enough mana". This was odd. I redid the quest and when turning it in, my own character (a shaman) cast "Power Word: Fortitude" on himself. It even took my mana to do it. I then tested a few other quests and this seems to be how quest rewards are being handled. This is incorrect. The rewarding NPC should cast whatever buff on the player.

    User Feedback

    Recommended Comments

    yeah...it's not db error,it's core error- -! i fixed it.

    src/game/Object/Player.cpp | 22 ++++++++++++++++++++--
    1 file changed, 20 insertions(+), 2 deletions(-)

    diff --git a/src/game/Object/Player.cpp b/src/game/Object/Player.cpp
    index 0915f4f..127a4e0 100644
    --- a/src/game/Object/Player.cpp
    +++ b/src/game/Object/Player.cpp
    @@ -12322,9 +12322,27 @@ void Player::RewardQuest(Quest const* pQuest, uint32 reward, Object* questGiver,

    // cast spells after mark quest complete (some spells have quest completed state reqyurements in spell_area data)
    if (pQuest->GetRewSpellCast() > 0)
    - { CastSpell(this, pQuest->GetRewSpellCast(), true); }
    + {
    + SpellInfo const* spellInfo = sSpellStore.LookupEntry(pQuest->GetRewSpellCast());
    + if (questGiver->isType(TYPEMASK_UNIT) && !spellInfo->HasEffect(SPELL_EFFECT_LEARN_SPELL) && !spellInfo->HasEffect(SPELL_EFFECT_CREATE_ITEM))
    + {
    + if (Creature* creature = GetMap()->GetCreature(questGiver->GetGUID()))
    + creature->CastSpell(this, pQuest->GetRewSpellCast(), true);
    + }
    + else
    + CastSpell(this, pQuest->GetRewSpellCast(), true);
    + }
    else if (pQuest->GetRewSpell() > 0)
    - { CastSpell(this, pQuest->GetRewSpell(), true); }
    + {
    + SpellInfo const* spellInfo = sSpellStore.LookupEntry(pQuest->GetRewSpell());
    + if (questGiver->isType(TYPEMASK_UNIT) && spellInfo->HasEffect(SPELL_EFFECT_LEARN_SPELL) && !spellInfo->HasEffect(SPELL_EFFECT_CREATE_ITEM))
    + {
    + if (Creature* creature = GetMap()->GetCreature(questGiver->GetGUID()))
    + creature->CastSpell(this, pQuest->GetRewSpell(), true);
    + }
    + else
    + CastSpell(this, pQuest->GetRewSpell(), true);
    + }

    // remove auras from spells with quest reward state limitations
    // Some spells applied at quest reward

    Link to comment
    Share on other sites

    Unfortunately, this copypaste from TC will not compile in Zero due to missing SpellInfo class.

    The problem of the casting mode for such spells, either player->player or questender->player, looks permanent :) The correct solution seems to use both modes depending on conditions. The above patch provides an incomplete list of the conditions.

    In general, the questender->player mode seems to be the reasonable one, except the spells which cannot be casted in this mode. Most of later spells have TARGET_SELF=1 (we don't need usually the questender to cast the reward spell on itself, do we?). After a brief look on the spells actually used for RewSpell, we've to add the spells either with TARGET_NONE=0 (the core interprets it as TARGET_SELF) or with SPELL_EFFECT_LEARN_SPELL=36, SPELL_EFFECT_TRADE_SKILL=47. The difference between these two solutions on the actual DB arises just for dummy auras 23356,23357. Checking if the core allows .cast back the auras from mob to player will solve the dilemma: if yes, then 2nd way (check spell effects); else 1st way (check TARGET_NONE=0 for non-empty spell effects).

    Again, due to missing SpellInfo class, a special method has to be created to check the mentioned conditions correctly basing on SpellEntry entity.

    Link to comment
    Share on other sites

    OK , it's a patch from TC.BUT it's not hard to buid spellinfo class.So I did it ,but not all compelete:)
    I think it necessary to write spellinfo class for mangoszero.we could do it in develop21

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

  • 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