[9425] More achievement types support.

Implemented new achievement criteria requirement:
* ACHIEVEMENT_CRITERIA_REQUIRE_S_EQUIPED_ITEM_LVL (item level and item quality equiped in specific slot)

Implemented suppoprt achievement types:
* ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM (required DB data)
* ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL (required DB data)

Also achievment types used only for statistics:
* ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION
* ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS
* ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS
* ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS
* ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM
* ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM
This commit is contained in:
VladimirMangos 2010-02-21 03:12:29 +03:00
parent 8bb13412e5
commit df652c56c0
10 changed files with 123 additions and 17 deletions

View file

@ -697,14 +697,18 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
{
DEBUG_LOG("DealDamage: victim just died");
if (pVictim->GetTypeId() == TYPEID_PLAYER)
((Player*)pVictim)->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED, health);
// find player: owner of controlled `this` or `this` itself maybe
Player *player = GetCharmerOrOwnerPlayerOrPlayerItself();
if(pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->GetLootRecipient())
player = ((Creature*)pVictim)->GetLootRecipient();
if (pVictim->GetTypeId() == TYPEID_PLAYER)
{
((Player*)pVictim)->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED, health);
if (player)
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL,1,0,pVictim);
}
// Reward player, his pets, and group/raid members
// call kill spell proc event (before real die and combat stop to triggering auras removed at death/combat stop)
if(player && player!=pVictim)