diff options
author | Machiavelli <none@none> | 2009-12-22 14:06:26 +0100 |
---|---|---|
committer | Machiavelli <none@none> | 2009-12-22 14:06:26 +0100 |
commit | da35e70579775c3000275af9e1ce117708bed631 (patch) | |
tree | 07e9e888418700ad6b7cdd0ebe9f81834e92ccf6 | |
parent | e78bf5d666fca5fbab0a399a333745ca92ad9014 (diff) |
Allow spell cast on an NPC that is linked to a KillCredit to count toward the KillCredit.
--HG--
branch : trunk
-rw-r--r-- | src/game/Player.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index b84336079a1..d578a243a01 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]; |