mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[6999] Implemented ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT and ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT
Signed-off-by: arrai <array.of.intellect@gmail.com>
This commit is contained in:
parent
d49e934d41
commit
802b35fbb8
4 changed files with 33 additions and 1 deletions
|
|
@ -614,7 +614,26 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
SetCriteriaProgress(achievementCriteria, 1);
|
||||
break;
|
||||
}
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT:
|
||||
{
|
||||
// miscvalue1 = itemid
|
||||
// miscvalue2 = diced value
|
||||
if(!miscvalue1)
|
||||
continue;
|
||||
if(miscvalue2 != achievementCriteria->roll_greed_on_loot.rollValue)
|
||||
continue;
|
||||
ItemPrototype const *pProto = objmgr.GetItemPrototype( miscvalue1 );
|
||||
|
||||
uint32 requiredItemLevel = 0;
|
||||
if (achievementCriteria->ID == 2412 || achievementCriteria->ID == 2358)
|
||||
requiredItemLevel = 185;
|
||||
|
||||
if(!pProto || pProto->ItemLevel <requiredItemLevel)
|
||||
continue;
|
||||
SetCriteriaProgress(achievementCriteria, 1, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(IsCompletedCriteria(achievementCriteria))
|
||||
CompletedCriteria(achievementCriteria);
|
||||
|
|
@ -710,6 +729,9 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achieve
|
|||
return progress->counter >= achievementCriteria->gain_exalted_reputation.numberOfExaltedFactions;
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA:
|
||||
return progress->counter >= 1;
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT:
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT:
|
||||
return progress->counter >= achievementCriteria->roll_greed_on_loot.count;
|
||||
|
||||
// handle all statistic-only criteria here
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND:
|
||||
|
|
|
|||
|
|
@ -727,6 +727,8 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
|
|||
|
||||
if(player && player->GetSession())
|
||||
{
|
||||
player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT, roll->itemid, maxresul);
|
||||
|
||||
ItemPosCountVec dest;
|
||||
LootItem *item = &(roll->getLoot()->items[roll->itemSlot]);
|
||||
uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, roll->itemid, item->count );
|
||||
|
|
@ -772,6 +774,8 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
|
|||
|
||||
if(player && player->GetSession())
|
||||
{
|
||||
player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT, roll->itemid, maxresul);
|
||||
|
||||
ItemPosCountVec dest;
|
||||
LootItem *item = &(roll->getLoot()->items[roll->itemSlot]);
|
||||
uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, roll->itemid, item->count );
|
||||
|
|
|
|||
|
|
@ -325,6 +325,12 @@ struct AchievementCriteriaEntry
|
|||
uint32 rollValue; // 3
|
||||
uint32 count; // 4
|
||||
} roll_need_on_loot;
|
||||
// ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREEDON_LOOT= 51
|
||||
struct
|
||||
{
|
||||
uint32 rollValue; // 3
|
||||
uint32 count; // 4
|
||||
} roll_greed_on_loot;
|
||||
|
||||
// ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS = 52
|
||||
struct
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "6998"
|
||||
#define REVISION_NR "6999"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue