From da35e70579775c3000275af9e1ce117708bed631 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Tue, 22 Dec 2009 14:06:26 +0100 Subject: [PATCH] Allow spell cast on an NPC that is linked to a KillCredit to count toward the KillCredit. --HG-- branch : trunk --- src/game/Player.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index b84336079a..d578a243a0 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -14572,8 +14572,17 @@ void Player::CastedCreatureOrGO(uint32 entry, uint64 guid, uint32 spell_id) { // creature activate objectives if (qInfo->ReqCreatureOrGOId[j] > 0) + { // checked at quest_template loading reqTarget = qInfo->ReqCreatureOrGOId[j]; + if (reqTarget != entry) // if entry doesn't match, check for killcredits referenced in template + { + CreatureInfo const *cinfo = objmgr.GetCreatureTemplate(entry); + for (uint8 i = 0; i < MAX_KILL_CREDIT; ++i) + if (cinfo->KillCredit[i] == reqTarget) + entry = cinfo->KillCredit[i]; + } + } } else { @@ -14584,7 +14593,7 @@ void Player::CastedCreatureOrGO(uint32 entry, uint64 guid, uint32 spell_id) } // other not this creature/GO related objectives - if(reqTarget != entry) + if (reqTarget != entry) continue; uint32 reqCastCount = qInfo->ReqCreatureOrGOCount[j];