Scripts/Violet Hold: Properly fixed achievement Dehydration

This commit is contained in:
Lopin
2011-06-24 14:43:03 +02:00
parent 2e1542d738
commit 5af6bf41b3
2 changed files with 37 additions and 12 deletions
@@ -0,0 +1,6 @@
DELETE FROM `disables` WHERE `entry`=7320 AND `sourceType`=4;
DELETE FROM `achievement_criteria_data` WHERE `criteria_id`=7320 AND `type`=11;
INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`,`ScriptName`)
VALUES
(7320,11,0,0,'achievement_dehydration');
@@ -50,11 +50,6 @@ enum Yells
SAY_BUBBLE = -1608026 SAY_BUBBLE = -1608026
}; };
enum Achievements
{
ACHIEVEMENT_DEHYDRATION = 2041,
};
enum Actions enum Actions
{ {
ACTION_WATER_ELEMENT_HIT = 1, ACTION_WATER_ELEMENT_HIT = 1,
@@ -72,6 +67,8 @@ static Position SpawnLoc[MAX_SPAWN_LOC]=
{1935.50f, 796.224f, 52.492f, 4.224f}, {1935.50f, 796.224f, 52.492f, 4.224f},
}; };
#define DATA_DEHYDRATION 1
class boss_ichoron : public CreatureScript class boss_ichoron : public CreatureScript
{ {
public: public:
@@ -91,7 +88,7 @@ public:
bool bIsExploded; bool bIsExploded;
bool bIsFrenzy; bool bIsFrenzy;
bool bAchievement; bool dehydration;
uint32 uiBubbleCheckerTimer; uint32 uiBubbleCheckerTimer;
uint32 uiWaterBoltVolleyTimer; uint32 uiWaterBoltVolleyTimer;
@@ -104,7 +101,7 @@ public:
{ {
bIsExploded = false; bIsExploded = false;
bIsFrenzy = false; bIsFrenzy = false;
bAchievement = true; dehydration = true;
uiBubbleCheckerTimer = 1000; uiBubbleCheckerTimer = 1000;
uiWaterBoltVolleyTimer = urand(10000, 15000); uiWaterBoltVolleyTimer = urand(10000, 15000);
@@ -168,7 +165,7 @@ public:
if (bIsExploded) if (bIsExploded)
DoExplodeCompleted(); DoExplodeCompleted();
bAchievement = false; dehydration = false;
break; break;
case ACTION_WATER_ELEMENT_KILLED: case ACTION_WATER_ELEMENT_KILLED:
uint32 damage = me->CountPctFromMaxHealth(3); uint32 damage = me->CountPctFromMaxHealth(3);
@@ -199,11 +196,18 @@ public:
me->GetMotionMaster()->MoveChase(me->getVictim()); me->GetMotionMaster()->MoveChase(me->getVictim());
} }
uint32 GetData(uint32 type)
{
if (type == DATA_DEHYDRATION)
return dehydration ? 1 : 0;
return 0;
}
void MoveInLineOfSight(Unit* /*pWho*/) {} void MoveInLineOfSight(Unit* /*pWho*/) {}
void UpdateAI(const uint32 uiDiff) void UpdateAI(const uint32 uiDiff)
{ {
//Return since we have no target
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
@@ -284,9 +288,6 @@ public:
if (pInstance) if (pInstance)
{ {
if (IsHeroic() && bAchievement)
pInstance->DoCompleteAchievement(ACHIEVEMENT_DEHYDRATION);
if (pInstance->GetData(DATA_WAVE_COUNT) == 6) if (pInstance->GetData(DATA_WAVE_COUNT) == 6)
{ {
pInstance->SetData(DATA_1ST_BOSS_EVENT, DONE); pInstance->SetData(DATA_1ST_BOSS_EVENT, DONE);
@@ -394,8 +395,26 @@ public:
}; };
class achievement_dehydration : public AchievementCriteriaScript
{
public:
achievement_dehydration() : AchievementCriteriaScript("achievement_dehydration")
{
}
bool OnCheck(Player* /*player*/, Unit* target)
{
if (Creature* Ichoron = target->ToCreature())
if (Ichoron->AI()->GetData(DATA_DEHYDRATION))
return true;
return false;
}
};
void AddSC_boss_ichoron() void AddSC_boss_ichoron()
{ {
new boss_ichoron(); new boss_ichoron();
new mob_ichor_globule(); new mob_ichor_globule();
new achievement_dehydration();
} }