mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-16 04:49:38 -04:00
*Implement achievement On The Rocks.
--HG-- branch : trunk
This commit is contained in:
@@ -28,6 +28,8 @@ EndScriptData */
|
||||
|
||||
enum
|
||||
{
|
||||
ACHIEVEMENT_ON_THE_ROCKS = 1919,
|
||||
|
||||
SPELL_SHADOWBOLT = 43667,
|
||||
SPELL_SHADOWBOLT_HEROIC = 59389,
|
||||
SPELL_FROST_TOMB = 48400,
|
||||
@@ -57,6 +59,8 @@ float SkeletonSpawnPoint[5][5]=
|
||||
|
||||
float AttackLoc[3]={197.636, 194.046, 40.8164};
|
||||
|
||||
bool ShatterFrostTomb; // needed for achievement: On The Rocks(1919)
|
||||
|
||||
struct TRINITY_DLL_DECL mob_frost_tombAI : public ScriptedAI
|
||||
{
|
||||
mob_frost_tombAI(Creature *c) : ScriptedAI(c)
|
||||
@@ -78,6 +82,9 @@ struct TRINITY_DLL_DECL mob_frost_tombAI : public ScriptedAI
|
||||
|
||||
void JustDied(Unit *killer)
|
||||
{
|
||||
if(killer->GetGUID() != m_creature->GetGUID())
|
||||
ShatterFrostTomb = true;
|
||||
|
||||
if(FrostTombGUID)
|
||||
{
|
||||
Unit* FrostTomb = Unit::GetUnit((*m_creature),FrostTombGUID);
|
||||
@@ -118,6 +125,8 @@ struct TRINITY_DLL_DECL boss_kelesethAI : public ScriptedAI
|
||||
ShadowboltTimer = 0;
|
||||
Skeletons = false;
|
||||
|
||||
ShatterFrostTomb = false;
|
||||
|
||||
ResetTimer();
|
||||
|
||||
if(pInstance)
|
||||
@@ -136,6 +145,21 @@ struct TRINITY_DLL_DECL boss_kelesethAI : public ScriptedAI
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
|
||||
if(Heroic && !ShatterFrostTomb)
|
||||
{
|
||||
AchievementEntry const *AchievOnTheRocks = GetAchievementStore()->LookupEntry(ACHIEVEMENT_ON_THE_ROCKS);
|
||||
if(AchievOnTheRocks)
|
||||
{
|
||||
Map *map = m_creature->GetMap();
|
||||
if(map && map->IsDungeon())
|
||||
{
|
||||
Map::PlayerList const &players = map->GetPlayers();
|
||||
for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
itr->getSource()->CompletedAchievement(AchievOnTheRocks);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(pInstance)
|
||||
pInstance->SetData(DATA_PRINCEKELESETH_EVENT, DONE);
|
||||
}
|
||||
|
||||
@@ -234,6 +234,7 @@ class AchievementMgr
|
||||
void SaveToDB();
|
||||
void ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1=0, uint32 miscvalue2=0);
|
||||
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1=0, uint32 miscvalue2=0, Unit *unit=NULL, uint32 time=0);
|
||||
void CompletedAchievement(AchievementEntry const* entry);
|
||||
void CheckAllAchievementCriteria();
|
||||
void SendAllAchievementData();
|
||||
void SendRespondInspectAchievements(Player* player);
|
||||
@@ -245,7 +246,6 @@ class AchievementMgr
|
||||
void SendCriteriaUpdate(uint32 id, CriteriaProgress const* progress);
|
||||
void SetCriteriaProgress(AchievementCriteriaEntry const* entry, uint32 changeValue, ProgressType ptype = PROGRESS_SET);
|
||||
void CompletedCriteriaFor(AchievementEntry const* achievement);
|
||||
void CompletedAchievement(AchievementEntry const* entry);
|
||||
bool IsCompletedCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement);
|
||||
bool IsCompletedAchievement(AchievementEntry const* entry);
|
||||
void CompleteAchievementsWithRefs(AchievementEntry const* entry);
|
||||
|
||||
@@ -696,3 +696,4 @@ TRINITY_DLL_SPEC DBCStorage <ItemEntry> const* GetItemDisplayStore()
|
||||
TRINITY_DLL_SPEC DBCStorage <CreatureDisplayInfoEntry> const* GetCreatureDisplayStore() { return &sCreatureDisplayInfoStore; }
|
||||
TRINITY_DLL_SPEC DBCStorage <EmotesEntry> const* GetEmotesStore() { return &sEmotesStore; }
|
||||
TRINITY_DLL_SPEC DBCStorage <EmotesTextEntry> const* GetEmotesTextStore() { return &sEmotesTextStore; }
|
||||
TRINITY_DLL_SPEC DBCStorage <AchievementEntry> const* GetAchievementStore() { return &sAchievementStore; }
|
||||
|
||||
@@ -158,4 +158,5 @@ TRINITY_DLL_SPEC DBCStorage <ItemEntry> const* GetItemDisplaySt
|
||||
TRINITY_DLL_SPEC DBCStorage <CreatureDisplayInfoEntry> const* GetCreatureDisplayStore();
|
||||
TRINITY_DLL_SPEC DBCStorage <EmotesEntry> const* GetEmotesStore();
|
||||
TRINITY_DLL_SPEC DBCStorage <EmotesTextEntry> const* GetEmotesTextStore();
|
||||
TRINITY_DLL_SPEC DBCStorage <AchievementEntry> const* GetAchievementStore();
|
||||
#endif
|
||||
|
||||
@@ -20725,7 +20725,12 @@ void Player::HandleFall(MovementInfo const& movementInfo)
|
||||
|
||||
void Player::UpdateAchievementCriteria( AchievementCriteriaTypes type, uint32 miscvalue1/*=0*/, uint32 miscvalue2/*=0*/, Unit *unit/*=NULL*/, uint32 time/*=0*/ )
|
||||
{
|
||||
GetAchievementMgr().UpdateAchievementCriteria(type, miscvalue1,miscvalue2,unit,time);
|
||||
GetAchievementMgr().UpdateAchievementCriteria(type, miscvalue1, miscvalue2, unit, time);
|
||||
}
|
||||
|
||||
void Player::CompletedAchievement(AchievementEntry const* entry)
|
||||
{
|
||||
GetAchievementMgr().CompletedAchievement(entry);
|
||||
}
|
||||
|
||||
void Player::LearnTalent(uint32 talentId, uint32 talentRank)
|
||||
|
||||
@@ -2144,8 +2144,11 @@ class TRINITY_DLL_SPEC Player : public Unit
|
||||
void ResyncRunes(uint8 count);
|
||||
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);
|
||||
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1 = 0, uint32 miscvalue2 = 0, Unit *unit = NULL, uint32 time = 0);
|
||||
void CompletedAchievement(AchievementEntry const* entry);
|
||||
|
||||
bool HasTitle(uint32 bitIndex);
|
||||
bool HasTitle(CharTitlesEntry const* title) { return HasTitle(title->bit_index); }
|
||||
void SetTitle(CharTitlesEntry const* title, bool lost = false);
|
||||
|
||||
Reference in New Issue
Block a user