*Small fix in Nethermancer Sepethrea script - by Anubisss

--HG--
branch : trunk
This commit is contained in:
Blaymoira
2009-02-21 10:57:39 +01:00
parent f538c2253d
commit 34ade920cf
3 changed files with 38 additions and 37 deletions

View File

@@ -33,6 +33,7 @@ EndScriptData */
#define SAY_DEATH -1554019
#define SPELL_SUMMON_RAGIN_FLAMES 35275
#define H_SPELL_SUMMON_RAGIN_FLAMES 39084
#define SPELL_FROST_ATTACK 35263
#define SPELL_ARCANE_BLAST 35314
@@ -66,18 +67,18 @@ boss_nethermancer_sepethreaAI(Creature *c) : ScriptedAI(c)
dragons_breath_Timer = 18000 + rand()%4000;
knockback_Timer = 22000 + rand()%6000;
solarburn_Timer = 30000;
if(pInstance)
pInstance->SetData(DATA_NETHERMANCER_EVENT, NOT_STARTED);
}
void Aggro(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
if(pInstance)
pInstance->SetData(DATA_NETHERMANCER_EVENT, IN_PROGRESS);
//Summon two guards, three in heroic
uint8 am = (HeroicMode ? 1 : 2);
for(int i = 0; i < am; i++)
{
DoCast(who,SPELL_SUMMON_RAGIN_FLAMES);
}
DoScriptText(SAY_AGGRO, m_creature);
DoCast(who, HeroicMode ? H_SPELL_SUMMON_RAGIN_FLAMES : SPELL_SUMMON_RAGIN_FLAMES);
DoScriptText(SAY_SUMMON, m_creature);
}
@@ -93,8 +94,9 @@ boss_nethermancer_sepethreaAI(Creature *c) : ScriptedAI(c)
void JustDied(Unit* Killer)
{
DoScriptText(SAY_DEATH, m_creature);
if(pInstance)
pInstance->SetData(DATA_SEPETHREA_DEATH, 0);
pInstance->SetData(DATA_NETHERMANCER_EVENT, DONE);
}
void UpdateAI(const uint32 diff)
@@ -190,6 +192,7 @@ struct TRINITY_DLL_DECL mob_ragin_flamesAI : public ScriptedAI
onlyonce = false;
m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
m_creature->SetSpeed(MOVE_RUN, HeroicMode ? 0.7f : 0.5f);
}
void Aggro(Unit* who)
@@ -201,6 +204,21 @@ struct TRINITY_DLL_DECL mob_ragin_flamesAI : public ScriptedAI
if (!UpdateVictim())
return;
//Check_Timer
if(Check_Timer < diff)
{
if(pInstance)
{
if(pInstance->GetData(DATA_NETHERMANCER_EVENT) != IN_PROGRESS)
{
//remove
m_creature->setDeathState(JUST_DIED);
m_creature->RemoveCorpse();
}
}
Check_Timer = 1000;
}else Check_Timer -= diff;
if (!onlyonce)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
@@ -221,22 +239,6 @@ struct TRINITY_DLL_DECL mob_ragin_flamesAI : public ScriptedAI
flame_timer = 500;
}else flame_timer -=diff;
//Check_Timer
if(Check_Timer < diff)
{
if(pInstance)
{
if(pInstance->GetData(DATA_SEPETHREAISDEAD))
{
//remove
m_creature->setDeathState(JUST_DIED);
m_creature->RemoveCorpse();
}
}
Check_Timer = 1000;
}else Check_Timer -= diff;
DoMeleeAttackIfReady();
}

View File

@@ -1,7 +1,6 @@
#ifndef DEF_MECHANAR_H
#define DEF_MECHANAR_H
#define DATA_SEPETHREA_DEATH 1
#define DATA_SEPETHREAISDEAD 2
#define DATA_NETHERMANCER_EVENT 1
#endif

View File

@@ -24,12 +24,14 @@ EndScriptData */
#include "precompiled.h"
#include "def_mechanar.h"
#define ENCOUNTERS 1
struct TRINITY_DLL_DECL instance_mechanar : public ScriptedInstance
{
instance_mechanar(Map *map) : ScriptedInstance(map) {Initialize();};
bool IsBossDied[1];
uint32 Encounters[ENCOUNTERS];
void OnCreatureCreate (Creature *creature, uint32 creature_entry)
{
@@ -37,12 +39,15 @@ struct TRINITY_DLL_DECL instance_mechanar : public ScriptedInstance
void Initialize()
{
IsBossDied[0] = false;
for(uint8 i = 0; i < ENCOUNTERS; ++i)
Encounters[i] = NOT_STARTED;
}
bool IsEncounterInProgress() const
{
//not active
for(uint8 i = 0; i < ENCOUNTERS; ++i)
if(Encounters[i]) return true;
return false;
}
@@ -50,13 +55,10 @@ struct TRINITY_DLL_DECL instance_mechanar : public ScriptedInstance
{
switch(type)
{
case DATA_SEPETHREAISDEAD:
if(IsBossDied[0])
return 1;
break;
case DATA_NETHERMANCER_EVENT: return Encounters[0];
}
return 0;
return false;
}
uint64 GetData64 (uint32 identifier)
@@ -68,9 +70,7 @@ struct TRINITY_DLL_DECL instance_mechanar : public ScriptedInstance
{
switch(type)
{
case DATA_SEPETHREA_DEATH:
IsBossDied[0] = true;
break;
case DATA_NETHERMANCER_EVENT: Encounters[0] = data; break;
}
}
};