Violet Hold: Cleansing, fix & completion of boss Erekem's script

--HG--
branch : trunk
This commit is contained in:
tartalo
2009-10-18 01:29:11 +02:00
parent 0e322e79ac
commit 45152bd308
4 changed files with 39 additions and 36 deletions

View File

@@ -1205,7 +1205,7 @@ UPDATE `creature_template` SET `ScriptName`='boss_lavanthor' WHERE `entry`=29312
UPDATE `creature_template` SET `ScriptName`='boss_ichoron' WHERE `entry`=29313;
UPDATE `creature_template` SET `ScriptName`='boss_zuramat' WHERE `entry`=29314;
UPDATE `creature_template` SET `ScriptName`='boss_erekem' WHERE `entry`=29315;
UPDATE `creature_template` SET `ScriptName`='mob_erekem_guard' WHERE `entry`=32226;
UPDATE `creature_template` SET `ScriptName`='mob_erekem_guard' WHERE `entry`=29395;
UPDATE `creature_template` SET `ScriptName`='boss_moragg' WHERE `entry`=29316;
UPDATE `creature_template` SET `ScriptName`='boss_xevozz' WHERE `entry`=29266;
UPDATE `creature_template` SET `ScriptName`='boss_cyanigosa' WHERE `entry`=31134;

View File

@@ -0,0 +1 @@
UPDATE `creature_template` SET `ScriptName`='mob_erekem_guard' WHERE `entry`=29395;

View File

@@ -63,6 +63,8 @@ struct TRINITY_DLL_DECL boss_erekemAI : public ScriptedAI
uiEarthShockTimer = urand(2000,8000);
uiLightningBoltTimer = urand(5000,10000);
uiEarthShieldTimer = 20000;
pGuard1 = NULL;
pGuard2 = NULL;
if (pInstance)
{
if (pInstance->GetData(DATA_WAVE_COUNT) == 6)
@@ -133,10 +135,7 @@ struct TRINITY_DLL_DECL boss_erekemAI : public ScriptedAI
if (uiLightningBoltTimer < diff)
{
Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
while (pTarget && pTarget->GetTypeId() != TYPEID_PLAYER)
SelectUnit(SELECT_TARGET_RANDOM,0);
if (pTarget)
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM,0,100,true))
DoCast(pTarget, SPELL_LIGHTNING_BOLT);
uiLightningBoltTimer = urand(18000,24000);
} else uiLightningBoltTimer -= diff;
@@ -182,6 +181,13 @@ CreatureAI* GetAI_boss_erekem(Creature* pCreature)
return new boss_erekemAI (pCreature);
}
enum GuardSpells
{
SPELL_GUSHING_WOUND = 39215,
SPELL_HOWLING_SCREECH = 54462,
SPELL_STRIKE = 14516
};
struct TRINITY_DLL_DECL mob_erekem_guardAI : public ScriptedAI
{
mob_erekem_guardAI(Creature *c) : ScriptedAI(c)
@@ -189,46 +195,45 @@ struct TRINITY_DLL_DECL mob_erekem_guardAI : public ScriptedAI
pInstance = c->GetInstanceData();
}
uint32 uiEarthShieldTimer;
uint32 uiLightningBoltTimer;
uint32 uiBloodlustTimer;
uint32 uiGushingWoundTimer;
uint32 uiHowlingScreechTimer;
uint32 uiStrikeTimer;
ScriptedInstance* pInstance;
void Reset()
{
uiEarthShieldTimer = 20000;
uiLightningBoltTimer = urand(0,5000);
uiBloodlustTimer = urand(8000,18000);
}
void EnterCombat(Unit* who)
{
DoCast(m_creature, H_SPELL_EARTH_SHIELD);
uiStrikeTimer = urand(4000,8000);
uiHowlingScreechTimer = urand(8000,13000);
uiGushingWoundTimer = urand(1000,3000);
}
void MoveInLineOfSight(Unit* who) {}
void UpdateAI(const uint32 diff)
{
if (uiEarthShieldTimer < diff)
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
if (uiStrikeTimer < diff)
{
DoCast(m_creature, H_SPELL_EARTH_SHIELD);
uiEarthShieldTimer = 20000;
} else uiEarthShieldTimer -= diff;
if (uiLightningBoltTimer < diff)
DoCast(m_creature->getVictim(), SPELL_STRIKE);
uiStrikeTimer = urand(4000,8000);
} else uiStrikeTimer -= diff;
if (uiHowlingScreechTimer < diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_LIGHTNING_BOLT);
uiLightningBoltTimer = urand(18000,24000);
} else uiLightningBoltTimer -= diff;
if (uiBloodlustTimer < diff)
DoCast(m_creature->getVictim(), SPELL_HOWLING_SCREECH);
uiHowlingScreechTimer = urand(8000,13000);
} else uiHowlingScreechTimer -= diff;
if (uiGushingWoundTimer < diff)
{
DoCast(m_creature,SPELL_BLOODLUST);
uiBloodlustTimer = urand(35000,45000);
} else uiBloodlustTimer -= diff;
DoCast(m_creature->getVictim(), SPELL_GUSHING_WOUND);
uiGushingWoundTimer = urand(7000,12000);
} else uiGushingWoundTimer -= diff;
}
};

View File

@@ -277,13 +277,10 @@ struct TRINITY_DLL_DECL instance_violet_hold : public ScriptedInstance
break;
case 1: //Erekem
HandleGameObject(uiErekemCell,true);
HandleGameObject(uiErekemRightGuardCell,true);
HandleGameObject(uiErekemLeftGuardCell,true);
if (pBoss = instance->GetCreature(uiErekem))
{
if (HeroicMode)
{
HandleGameObject(uiErekemRightGuardCell,true);
HandleGameObject(uiErekemLeftGuardCell,true);
}
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}