Scripts/Violet Hold: Properly fixed achievement Dehydration
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
enum Achievements
|
||||
{
|
||||
ACHIEVEMENT_DEHYDRATION = 2041,
|
||||
};
|
||||
|
||||
enum Actions
|
||||
{
|
||||
ACTION_WATER_ELEMENT_HIT = 1,
|
||||
@@ -72,6 +67,8 @@ static Position SpawnLoc[MAX_SPAWN_LOC]=
|
||||
{1935.50f, 796.224f, 52.492f, 4.224f},
|
||||
};
|
||||
|
||||
#define DATA_DEHYDRATION 1
|
||||
|
||||
class boss_ichoron : public CreatureScript
|
||||
{
|
||||
public:
|
||||
@@ -91,7 +88,7 @@ public:
|
||||
|
||||
bool bIsExploded;
|
||||
bool bIsFrenzy;
|
||||
bool bAchievement;
|
||||
bool dehydration;
|
||||
|
||||
uint32 uiBubbleCheckerTimer;
|
||||
uint32 uiWaterBoltVolleyTimer;
|
||||
@@ -104,7 +101,7 @@ public:
|
||||
{
|
||||
bIsExploded = false;
|
||||
bIsFrenzy = false;
|
||||
bAchievement = true;
|
||||
dehydration = true;
|
||||
uiBubbleCheckerTimer = 1000;
|
||||
uiWaterBoltVolleyTimer = urand(10000, 15000);
|
||||
|
||||
@@ -168,7 +165,7 @@ public:
|
||||
if (bIsExploded)
|
||||
DoExplodeCompleted();
|
||||
|
||||
bAchievement = false;
|
||||
dehydration = false;
|
||||
break;
|
||||
case ACTION_WATER_ELEMENT_KILLED:
|
||||
uint32 damage = me->CountPctFromMaxHealth(3);
|
||||
@@ -199,11 +196,18 @@ public:
|
||||
me->GetMotionMaster()->MoveChase(me->getVictim());
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type)
|
||||
{
|
||||
if (type == DATA_DEHYDRATION)
|
||||
return dehydration ? 1 : 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* /*pWho*/) {}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
@@ -284,9 +288,6 @@ public:
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
if (IsHeroic() && bAchievement)
|
||||
pInstance->DoCompleteAchievement(ACHIEVEMENT_DEHYDRATION);
|
||||
|
||||
if (pInstance->GetData(DATA_WAVE_COUNT) == 6)
|
||||
{
|
||||
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()
|
||||
{
|
||||
new boss_ichoron();
|
||||
new mob_ichor_globule();
|
||||
new achievement_dehydration();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user