*Update script of heigan.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-06 09:36:51 -05:00
parent 50dc00cce0
commit 22667d3ee6
3 changed files with 56 additions and 22 deletions
@@ -29,20 +29,22 @@ EndScriptData */
#define SAY_TAUNT RAND(-1533113,-1533114,-1533115,-1533116,-1533117)
#define SAY_DEATH -1533118
//Spells by boss
#define SPELL_WILT 23772
#define SPELL_FEAVER 29998
#define SPELL_SPELL_DISRUPTION 29310
#define SPELL_DECREPIT_FEVER HEROIC(29998,55011)
#define SPELL_PLAGUE_CLOUD 30122
#define SPELL_PLAGUE_CLOUD 29350
enum Events
{
EVENT_DISRUPT = 1,
EVENT_FEVER,
EVENT_CLOUD,
EVENT_ERUPT,
EVENT_PHASE,
};
enum Phases
{
PHASE_FIGHT = 1,
PHASE_DANCE,
};
//Spell by eye stalks
@@ -57,6 +59,9 @@ struct TRINITY_DLL_DECL boss_heiganAI : public ScriptedAI
EventMap events;
ScriptedInstance *instance;
uint32 eruptSection;
bool eruptDirection;
Phases phase;
void Reset()
{
@@ -80,12 +85,33 @@ struct TRINITY_DLL_DECL boss_heiganAI : public ScriptedAI
{
DoScriptText(SAY_AGGRO, me);
DoZoneInCombat();
events.ScheduleEvent(EVENT_FEVER, 1200);
events.ScheduleEvent(EVENT_CLOUD, 360000);
events.ScheduleEvent(EVENT_ERUPT, 3000);
EnterPhase(PHASE_FIGHT);
instance->SetBossState(BOSS_HEIGAN, IN_PROGRESS);
}
void EnterPhase(Phases newPhase)
{
phase = newPhase;
events.Reset();
eruptSection = 3;
if(phase == PHASE_FIGHT)
{
events.ScheduleEvent(EVENT_DISRUPT, 0);
events.ScheduleEvent(EVENT_FEVER, 20000);
events.ScheduleEvent(EVENT_PHASE, 85000);
events.ScheduleEvent(EVENT_ERUPT, 10000);
}
else
{
float x, y, z, o;
me->GetHomePosition(x, y, z, o);
me->NearTeleportTo(x, y, z, o);
DoCastAOE(SPELL_PLAGUE_CLOUD);
events.ScheduleEvent(EVENT_PHASE, 45000);
events.ScheduleEvent(EVENT_ERUPT, 5000);
}
}
void UpdateAI(const uint32 diff)
{
if(!UpdateVictim())
@@ -98,21 +124,27 @@ struct TRINITY_DLL_DECL boss_heiganAI : public ScriptedAI
switch(eventId)
{
case EVENT_DISRUPT:
events.ScheduleEvent(EVENT_DISRUPT, 1200);
DoCastAOE(SPELL_SPELL_DISRUPTION);
events.ScheduleEvent(EVENT_DISRUPT, 5000);
return;
case EVENT_FEVER:
events.ScheduleEvent(EVENT_FEVER, 2000);
DoCastAOE(SPELL_DECREPIT_FEVER);
events.ScheduleEvent(EVENT_FEVER, 20000);
return;
case EVENT_CLOUD:
events.ScheduleEvent(EVENT_CLOUD, 2000);
case EVENT_PHASE:
EnterPhase(phase == PHASE_FIGHT ? PHASE_DANCE : PHASE_FIGHT);
return;
case EVENT_ERUPT:
if(instance)
{
uint32 section = rand()%4;
instance->SetData(DATA_HEIGAN_ERUPT, section);
}
events.ScheduleEvent(EVENT_ERUPT, 2000);
instance->SetData(DATA_HEIGAN_ERUPT, eruptSection);
if(eruptSection == 0)
eruptDirection = true;
else if(eruptSection == 3)
eruptDirection = false;
eruptDirection ? ++eruptSection : --eruptSection;
events.ScheduleEvent(EVENT_ERUPT, phase == PHASE_FIGHT ? 10000 : 3000);
break;
}
}
+2 -1
View File
@@ -2297,7 +2297,8 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect* triggeredByAura
ReSetTimer();
//Containers for channeled spells have to be set
//TODO:Apply this to all casted spells if needed
if(m_IsTriggeredSpell && !IsChanneledSpell(m_spellInfo))
// Why check m_casttime? 29350: channelled triggers channelled
if(m_IsTriggeredSpell && (!IsChanneledSpell(m_spellInfo) || !m_casttime))
cast(true);
else
{
+3 -2
View File
@@ -13861,11 +13861,12 @@ void Unit::NearTeleportTo( float x, float y, float z, float orientation, bool ca
DestroyForNearbyPlayers();
GetMap()->CreatureRelocation((Creature*)this, x, y, z, orientation);
ObjectAccessor::UpdateObjectVisibility(this);
//WorldPacket data;
// Work strange for many spells: triggered active mover set for targeted player to creature
//BuildTeleportAckMsg(&data, x, y, z, orientation);
BuildHeartBeatMsg(&data);
SendMessageToSet(&data, false);
//BuildHeartBeatMsg(&data);
//SendMessageToSet(&data, false);
}
}