aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-07-20 12:30:37 +0800
committermegamage <none@none>2009-07-20 12:30:37 +0800
commitffcbd11b2c4f72f9390486081d813bcf54a41179 (patch)
tree1897f9b0984d421a7ed269859f540c065b32a79c /src/game/Player.cpp
parent80b7b3c1fc2186d6e4c3f2105fea3928681625d6 (diff)
[8190] Update killing quest objectives base at creature_template KillCredit fields. Author: GriffonHeart
Note: for avoid double counting must be removed C++ scripts and EventAI scripts that do same thing in old way. Signed-off-by: VladimirMangos <vladimir@getmangos.com> Also implement KillCreditN field check at loading. --HG-- branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r--src/game/Player.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index fd27607a402..27014c97f76 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -13807,7 +13807,17 @@ void Player::ItemRemovedQuestCheck( uint32 entry, uint32 count )
UpdateForQuestWorldObjects();
}
-void Player::KilledMonster( uint32 entry, uint64 guid )
+void Player::KilledMonster( CreatureInfo const* cInfo, uint64 guid )
+{
+ if(cInfo->Entry)
+ KilledMonsterCredit(cInfo->Entry,guid);
+
+ for(int i = 0; i < MAX_KILL_CREDIT; ++i)
+ if(cInfo->KillCredit[i])
+ KilledMonsterCredit(cInfo->KillCredit[i],guid);
+}
+
+void Player::KilledMonsterCredit( uint32 entry, uint64 guid )
{
uint32 addkillcount = 1;
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, entry, addkillcount);
@@ -19795,7 +19805,7 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim)
{
// normal creature (not pet/etc) can be only in !PvP case
if(pVictim->GetTypeId()==TYPEID_UNIT)
- pGroupGuy->KilledMonster(pVictim->GetEntry(), pVictim->GetGUID());
+ pGroupGuy->KilledMonster(((Creature*)pVictim)->GetCreatureInfo(), pVictim->GetGUID());
}
}
}
@@ -19820,7 +19830,7 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim)
// normal creature (not pet/etc) can be only in !PvP case
if(pVictim->GetTypeId()==TYPEID_UNIT)
- KilledMonster(pVictim->GetEntry(),pVictim->GetGUID());
+ KilledMonster(((Creature*)pVictim)->GetCreatureInfo(), pVictim->GetGUID());
}
}
return xp || honored_kill;
@@ -19844,11 +19854,11 @@ void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewar
// quest objectives updated only for alive group member or dead but with not released body
if(pGroupGuy->isAlive()|| !pGroupGuy->GetCorpse())
- pGroupGuy->KilledMonster(creature_id, creature_guid);
+ pGroupGuy->KilledMonsterCredit(creature_id, creature_guid);
}
}
else // if (!pGroup)
- KilledMonster(creature_id, creature_guid);
+ KilledMonsterCredit(creature_id, creature_guid);
}
bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const