[7391] Prevent achievement counter overflow, implement ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE generic support.

Before overflow has been possible at 4294967295 lols for example.

    ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE in many cases require check special conditions and targets.
    For this allow call it from scripts:
    * Add Player::UpdateAchievementCriteria functiona ccessable from scripts
    * In emote case it allowed call in form player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, text_emote_id, achievement_id, target_unit_ptr);

Author: VladimirMangos

--HG--
branch : trunk
This commit is contained in:
megamage
2009-03-06 18:14:05 -06:00
parent 7915fd768a
commit c2261e3502
7 changed files with 78 additions and 41 deletions
+1
View File
@@ -2181,6 +2181,7 @@ class TRINITY_DLL_SPEC Player : public Unit
void AddRunePower(uint8 index);
void InitRunes();
AchievementMgr& GetAchievementMgr() { return m_achievementMgr; }
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1=0, uint32 miscvalue2=0, Unit *unit=NULL, uint32 time=0);
bool HasTitle(uint32 bitIndex);
bool HasTitle(CharTitlesEntry const* title) { return HasTitle(title->bit_index); }
void SetTitle(CharTitlesEntry const* title);