* Rename InstanceData to InstanceScript
* Rename *mgr to their new names in scripts project * Mass convert all the scripts (NEEDS THOROUGH TESTING, because it was done automatically) Please, report bugs on issue tracker. --HG-- branch : trunk rename : src/server/game/Instances/InstanceData.cpp => src/server/game/Instances/InstanceScript.cpp rename : src/server/game/Instances/InstanceData.h => src/server/game/Instances/InstanceScript.h
This commit is contained in:
@@ -32,83 +32,85 @@ EndScriptData */
|
||||
#define SPELL_BLASTWAVE 23331
|
||||
#define SPELL_MORTALSTRIKE 24573
|
||||
#define SPELL_KNOCKBACK 25778
|
||||
|
||||
struct boss_broodlordAI : public ScriptedAI
|
||||
␍class boss_broodlord : public CreatureScript
|
||||
{
|
||||
boss_broodlordAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_broodlord() : CreatureScript("boss_broodlord") { }
|
||||
|
||||
uint32 Cleave_Timer;
|
||||
uint32 BlastWave_Timer;
|
||||
uint32 MortalStrike_Timer;
|
||||
uint32 KnockBack_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
Cleave_Timer = 8000; //These times are probably wrong
|
||||
BlastWave_Timer = 12000;
|
||||
MortalStrike_Timer = 20000;
|
||||
KnockBack_Timer = 30000;
|
||||
return new boss_broodlordAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_broodlordAI : public ScriptedAI
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
boss_broodlordAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 BlastWave_Timer;
|
||||
uint32 MortalStrike_Timer;
|
||||
uint32 KnockBack_Timer;
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 7000;
|
||||
} else Cleave_Timer -= diff;
|
||||
Cleave_Timer = 8000; //These times are probably wrong
|
||||
BlastWave_Timer = 12000;
|
||||
MortalStrike_Timer = 20000;
|
||||
KnockBack_Timer = 30000;
|
||||
}
|
||||
|
||||
// BlastWave
|
||||
if (BlastWave_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_BLASTWAVE);
|
||||
BlastWave_Timer = urand(8000,16000);
|
||||
} else BlastWave_Timer -= diff;
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
//MortalStrike_Timer
|
||||
if (MortalStrike_Timer <= diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_MORTALSTRIKE);
|
||||
MortalStrike_Timer = urand(25000,35000);
|
||||
} else MortalStrike_Timer -= diff;
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (KnockBack_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_KNOCKBACK);
|
||||
//Drop 50% aggro
|
||||
if (DoGetThreat(me->getVictim()))
|
||||
DoModifyThreatPercent(me->getVictim(),-50);
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 7000;
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
KnockBack_Timer = urand(15000,30000);
|
||||
} else KnockBack_Timer -= diff;
|
||||
// BlastWave
|
||||
if (BlastWave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_BLASTWAVE);
|
||||
BlastWave_Timer = urand(8000,16000);
|
||||
} else BlastWave_Timer -= diff;
|
||||
|
||||
if (EnterEvadeIfOutOfCombatArea(diff))
|
||||
DoScriptText(SAY_LEASH, me);
|
||||
//MortalStrike_Timer
|
||||
if (MortalStrike_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_MORTALSTRIKE);
|
||||
MortalStrike_Timer = urand(25000,35000);
|
||||
} else MortalStrike_Timer -= diff;
|
||||
|
||||
if (KnockBack_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_KNOCKBACK);
|
||||
//Drop 50% aggro
|
||||
if (DoGetThreat(me->getVictim()))
|
||||
DoModifyThreatPercent(me->getVictim(),-50);
|
||||
|
||||
KnockBack_Timer = urand(15000,30000);
|
||||
} else KnockBack_Timer -= diff;
|
||||
|
||||
if (EnterEvadeIfOutOfCombatArea(diff))
|
||||
DoScriptText(SAY_LEASH, me);
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_broodlord(Creature* pCreature)
|
||||
{
|
||||
return new boss_broodlordAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_broodlord()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_broodlord";
|
||||
newscript->GetAI = &GetAI_boss_broodlord;
|
||||
newscript->RegisterSelf();
|
||||
new boss_broodlord();
|
||||
}
|
||||
|
||||
|
||||
@@ -58,246 +58,248 @@ enum Spells
|
||||
SPELL_FRENZY = 28371, //The frenzy spell may be wrong
|
||||
SPELL_ENRAGE = 28747
|
||||
};
|
||||
|
||||
struct boss_chromaggusAI : public ScriptedAI
|
||||
␍class boss_chromaggus : public CreatureScript
|
||||
{
|
||||
boss_chromaggusAI(Creature *c) : ScriptedAI(c)
|
||||
public:
|
||||
boss_chromaggus() : CreatureScript("boss_chromaggus") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
//Select the 2 breaths that we are going to use until despawned
|
||||
//5 possiblities for the first breath, 4 for the second, 20 total possiblites
|
||||
//This way we don't end up casting 2 of the same breath
|
||||
//TL TL would be stupid
|
||||
switch (urand(0,19))
|
||||
{
|
||||
//B1 - Incin
|
||||
case 0:
|
||||
Breath1_Spell = SPELL_INCINERATE;
|
||||
Breath2_Spell = SPELL_TIMELAPSE;
|
||||
break;
|
||||
case 1:
|
||||
Breath1_Spell = SPELL_INCINERATE;
|
||||
Breath2_Spell = SPELL_CORROSIVEACID;
|
||||
break;
|
||||
case 2:
|
||||
Breath1_Spell = SPELL_INCINERATE;
|
||||
Breath2_Spell = SPELL_IGNITEFLESH;
|
||||
break;
|
||||
case 3:
|
||||
Breath1_Spell = SPELL_INCINERATE;
|
||||
Breath2_Spell = SPELL_FROSTBURN;
|
||||
break;
|
||||
|
||||
//B1 - TL
|
||||
case 4:
|
||||
Breath1_Spell = SPELL_TIMELAPSE;
|
||||
Breath2_Spell = SPELL_INCINERATE;
|
||||
break;
|
||||
case 5:
|
||||
Breath1_Spell = SPELL_TIMELAPSE;
|
||||
Breath2_Spell = SPELL_CORROSIVEACID;
|
||||
break;
|
||||
case 6:
|
||||
Breath1_Spell = SPELL_TIMELAPSE;
|
||||
Breath2_Spell = SPELL_IGNITEFLESH;
|
||||
break;
|
||||
case 7:
|
||||
Breath1_Spell = SPELL_TIMELAPSE;
|
||||
Breath2_Spell = SPELL_FROSTBURN;
|
||||
break;
|
||||
|
||||
//B1 - Acid
|
||||
case 8:
|
||||
Breath1_Spell = SPELL_CORROSIVEACID;
|
||||
Breath2_Spell = SPELL_INCINERATE;
|
||||
break;
|
||||
case 9:
|
||||
Breath1_Spell = SPELL_CORROSIVEACID;
|
||||
Breath2_Spell = SPELL_TIMELAPSE;
|
||||
break;
|
||||
case 10:
|
||||
Breath1_Spell = SPELL_CORROSIVEACID;
|
||||
Breath2_Spell = SPELL_IGNITEFLESH;
|
||||
break;
|
||||
case 11:
|
||||
Breath1_Spell = SPELL_CORROSIVEACID;
|
||||
Breath2_Spell = SPELL_FROSTBURN;
|
||||
break;
|
||||
|
||||
//B1 - Ignite
|
||||
case 12:
|
||||
Breath1_Spell = SPELL_IGNITEFLESH;
|
||||
Breath2_Spell = SPELL_INCINERATE;
|
||||
break;
|
||||
case 13:
|
||||
Breath1_Spell = SPELL_IGNITEFLESH;
|
||||
Breath2_Spell = SPELL_CORROSIVEACID;
|
||||
break;
|
||||
case 14:
|
||||
Breath1_Spell = SPELL_IGNITEFLESH;
|
||||
Breath2_Spell = SPELL_TIMELAPSE;
|
||||
break;
|
||||
case 15:
|
||||
Breath1_Spell = SPELL_IGNITEFLESH;
|
||||
Breath2_Spell = SPELL_FROSTBURN;
|
||||
break;
|
||||
|
||||
//B1 - Frost
|
||||
case 16:
|
||||
Breath1_Spell = SPELL_FROSTBURN;
|
||||
Breath2_Spell = SPELL_INCINERATE;
|
||||
break;
|
||||
case 17:
|
||||
Breath1_Spell = SPELL_FROSTBURN;
|
||||
Breath2_Spell = SPELL_TIMELAPSE;
|
||||
break;
|
||||
case 18:
|
||||
Breath1_Spell = SPELL_FROSTBURN;
|
||||
Breath2_Spell = SPELL_CORROSIVEACID;
|
||||
break;
|
||||
case 19:
|
||||
Breath1_Spell = SPELL_FROSTBURN;
|
||||
Breath2_Spell = SPELL_IGNITEFLESH;
|
||||
break;
|
||||
};
|
||||
|
||||
EnterEvadeMode();
|
||||
return new boss_chromaggusAI (pCreature);
|
||||
}
|
||||
|
||||
uint32 Breath1_Spell;
|
||||
uint32 Breath2_Spell;
|
||||
uint32 CurrentVurln_Spell;
|
||||
|
||||
uint32 Shimmer_Timer;
|
||||
uint32 Breath1_Timer;
|
||||
uint32 Breath2_Timer;
|
||||
uint32 Affliction_Timer;
|
||||
uint32 Frenzy_Timer;
|
||||
bool Enraged;
|
||||
|
||||
void Reset()
|
||||
struct boss_chromaggusAI : public ScriptedAI
|
||||
{
|
||||
CurrentVurln_Spell = 0; //We use this to store our last vulnerabilty spell so we can remove it later
|
||||
|
||||
Shimmer_Timer = 0; //Time till we change vurlnerabilites
|
||||
Breath1_Timer = 30000; //First breath is 30 seconds
|
||||
Breath2_Timer = 60000; //Second is 1 minute so that we can alternate
|
||||
Affliction_Timer = 10000; //This is special - 5 seconds means that we cast this on 1 player every 5 sconds
|
||||
Frenzy_Timer = 15000;
|
||||
|
||||
Enraged = false;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Shimmer_Timer Timer
|
||||
if (Shimmer_Timer <= diff)
|
||||
boss_chromaggusAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
//Remove old vulnerabilty spell
|
||||
if (CurrentVurln_Spell)
|
||||
me->RemoveAurasDueToSpell(CurrentVurln_Spell);
|
||||
|
||||
//Cast new random vulnerabilty on self
|
||||
uint32 spell = RAND(SPELL_FIRE_VULNERABILITY, SPELL_FROST_VULNERABILITY,
|
||||
SPELL_SHADOW_VULNERABILITY, SPELL_NATURE_VULNERABILITY, SPELL_ARCANE_VULNERABILITY);
|
||||
|
||||
DoCast(me, spell);
|
||||
CurrentVurln_Spell = spell;
|
||||
|
||||
DoScriptText(EMOTE_SHIMMER, me);
|
||||
Shimmer_Timer = 45000;
|
||||
} else Shimmer_Timer -= diff;
|
||||
|
||||
//Breath1_Timer
|
||||
if (Breath1_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), Breath1_Spell);
|
||||
Breath1_Timer = 60000;
|
||||
} else Breath1_Timer -= diff;
|
||||
|
||||
//Breath2_Timer
|
||||
if (Breath2_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), Breath2_Spell);
|
||||
Breath2_Timer = 60000;
|
||||
} else Breath2_Timer -= diff;
|
||||
|
||||
//Affliction_Timer
|
||||
if (Affliction_Timer <= diff)
|
||||
{
|
||||
std::list<HostileReference*> threatlist = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
//Select the 2 breaths that we are going to use until despawned
|
||||
//5 possiblities for the first breath, 4 for the second, 20 total possiblites
|
||||
//This way we don't end up casting 2 of the same breath
|
||||
//TL TL would be stupid
|
||||
switch (urand(0,19))
|
||||
{
|
||||
Unit* pUnit;
|
||||
if ((*i) && (*i)->getSource())
|
||||
//B1 - Incin
|
||||
case 0:
|
||||
Breath1_Spell = SPELL_INCINERATE;
|
||||
Breath2_Spell = SPELL_TIMELAPSE;
|
||||
break;
|
||||
case 1:
|
||||
Breath1_Spell = SPELL_INCINERATE;
|
||||
Breath2_Spell = SPELL_CORROSIVEACID;
|
||||
break;
|
||||
case 2:
|
||||
Breath1_Spell = SPELL_INCINERATE;
|
||||
Breath2_Spell = SPELL_IGNITEFLESH;
|
||||
break;
|
||||
case 3:
|
||||
Breath1_Spell = SPELL_INCINERATE;
|
||||
Breath2_Spell = SPELL_FROSTBURN;
|
||||
break;
|
||||
|
||||
//B1 - TL
|
||||
case 4:
|
||||
Breath1_Spell = SPELL_TIMELAPSE;
|
||||
Breath2_Spell = SPELL_INCINERATE;
|
||||
break;
|
||||
case 5:
|
||||
Breath1_Spell = SPELL_TIMELAPSE;
|
||||
Breath2_Spell = SPELL_CORROSIVEACID;
|
||||
break;
|
||||
case 6:
|
||||
Breath1_Spell = SPELL_TIMELAPSE;
|
||||
Breath2_Spell = SPELL_IGNITEFLESH;
|
||||
break;
|
||||
case 7:
|
||||
Breath1_Spell = SPELL_TIMELAPSE;
|
||||
Breath2_Spell = SPELL_FROSTBURN;
|
||||
break;
|
||||
|
||||
//B1 - Acid
|
||||
case 8:
|
||||
Breath1_Spell = SPELL_CORROSIVEACID;
|
||||
Breath2_Spell = SPELL_INCINERATE;
|
||||
break;
|
||||
case 9:
|
||||
Breath1_Spell = SPELL_CORROSIVEACID;
|
||||
Breath2_Spell = SPELL_TIMELAPSE;
|
||||
break;
|
||||
case 10:
|
||||
Breath1_Spell = SPELL_CORROSIVEACID;
|
||||
Breath2_Spell = SPELL_IGNITEFLESH;
|
||||
break;
|
||||
case 11:
|
||||
Breath1_Spell = SPELL_CORROSIVEACID;
|
||||
Breath2_Spell = SPELL_FROSTBURN;
|
||||
break;
|
||||
|
||||
//B1 - Ignite
|
||||
case 12:
|
||||
Breath1_Spell = SPELL_IGNITEFLESH;
|
||||
Breath2_Spell = SPELL_INCINERATE;
|
||||
break;
|
||||
case 13:
|
||||
Breath1_Spell = SPELL_IGNITEFLESH;
|
||||
Breath2_Spell = SPELL_CORROSIVEACID;
|
||||
break;
|
||||
case 14:
|
||||
Breath1_Spell = SPELL_IGNITEFLESH;
|
||||
Breath2_Spell = SPELL_TIMELAPSE;
|
||||
break;
|
||||
case 15:
|
||||
Breath1_Spell = SPELL_IGNITEFLESH;
|
||||
Breath2_Spell = SPELL_FROSTBURN;
|
||||
break;
|
||||
|
||||
//B1 - Frost
|
||||
case 16:
|
||||
Breath1_Spell = SPELL_FROSTBURN;
|
||||
Breath2_Spell = SPELL_INCINERATE;
|
||||
break;
|
||||
case 17:
|
||||
Breath1_Spell = SPELL_FROSTBURN;
|
||||
Breath2_Spell = SPELL_TIMELAPSE;
|
||||
break;
|
||||
case 18:
|
||||
Breath1_Spell = SPELL_FROSTBURN;
|
||||
Breath2_Spell = SPELL_CORROSIVEACID;
|
||||
break;
|
||||
case 19:
|
||||
Breath1_Spell = SPELL_FROSTBURN;
|
||||
Breath2_Spell = SPELL_IGNITEFLESH;
|
||||
break;
|
||||
};
|
||||
|
||||
EnterEvadeMode();
|
||||
}
|
||||
|
||||
uint32 Breath1_Spell;
|
||||
uint32 Breath2_Spell;
|
||||
uint32 CurrentVurln_Spell;
|
||||
|
||||
uint32 Shimmer_Timer;
|
||||
uint32 Breath1_Timer;
|
||||
uint32 Breath2_Timer;
|
||||
uint32 Affliction_Timer;
|
||||
uint32 Frenzy_Timer;
|
||||
bool Enraged;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
CurrentVurln_Spell = 0; //We use this to store our last vulnerabilty spell so we can remove it later
|
||||
|
||||
Shimmer_Timer = 0; //Time till we change vurlnerabilites
|
||||
Breath1_Timer = 30000; //First breath is 30 seconds
|
||||
Breath2_Timer = 60000; //Second is 1 minute so that we can alternate
|
||||
Affliction_Timer = 10000; //This is special - 5 seconds means that we cast this on 1 player every 5 sconds
|
||||
Frenzy_Timer = 15000;
|
||||
|
||||
Enraged = false;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Shimmer_Timer Timer
|
||||
if (Shimmer_Timer <= diff)
|
||||
{
|
||||
//Remove old vulnerabilty spell
|
||||
if (CurrentVurln_Spell)
|
||||
me->RemoveAurasDueToSpell(CurrentVurln_Spell);
|
||||
|
||||
//Cast new random vulnerabilty on self
|
||||
uint32 spell = RAND(SPELL_FIRE_VULNERABILITY, SPELL_FROST_VULNERABILITY,
|
||||
SPELL_SHADOW_VULNERABILITY, SPELL_NATURE_VULNERABILITY, SPELL_ARCANE_VULNERABILITY);
|
||||
|
||||
DoCast(me, spell);
|
||||
CurrentVurln_Spell = spell;
|
||||
|
||||
DoScriptText(EMOTE_SHIMMER, me);
|
||||
Shimmer_Timer = 45000;
|
||||
} else Shimmer_Timer -= diff;
|
||||
|
||||
//Breath1_Timer
|
||||
if (Breath1_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), Breath1_Spell);
|
||||
Breath1_Timer = 60000;
|
||||
} else Breath1_Timer -= diff;
|
||||
|
||||
//Breath2_Timer
|
||||
if (Breath2_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), Breath2_Spell);
|
||||
Breath2_Timer = 60000;
|
||||
} else Breath2_Timer -= diff;
|
||||
|
||||
//Affliction_Timer
|
||||
if (Affliction_Timer <= diff)
|
||||
{
|
||||
std::list<HostileReference*> threatlist = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
{
|
||||
pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
|
||||
if (pUnit)
|
||||
Unit* pUnit;
|
||||
if ((*i) && (*i)->getSource())
|
||||
{
|
||||
//Cast affliction
|
||||
DoCast(pUnit, RAND(SPELL_BROODAF_BLUE, SPELL_BROODAF_BLACK,
|
||||
SPELL_BROODAF_RED, SPELL_BROODAF_BRONZE, SPELL_BROODAF_GREEN), true);
|
||||
|
||||
//Chromatic mutation if target is effected by all afflictions
|
||||
if (pUnit->HasAura(SPELL_BROODAF_BLUE)
|
||||
&& pUnit->HasAura(SPELL_BROODAF_BLACK)
|
||||
&& pUnit->HasAura(SPELL_BROODAF_RED)
|
||||
&& pUnit->HasAura(SPELL_BROODAF_BRONZE)
|
||||
&& pUnit->HasAura(SPELL_BROODAF_GREEN))
|
||||
pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
|
||||
if (pUnit)
|
||||
{
|
||||
//pTarget->RemoveAllAuras();
|
||||
//DoCast(pTarget, SPELL_CHROMATIC_MUT_1);
|
||||
//Cast affliction
|
||||
DoCast(pUnit, RAND(SPELL_BROODAF_BLUE, SPELL_BROODAF_BLACK,
|
||||
SPELL_BROODAF_RED, SPELL_BROODAF_BRONZE, SPELL_BROODAF_GREEN), true);
|
||||
|
||||
//Chromatic mutation is causing issues
|
||||
//Assuming it is caused by a lack of core support for Charm
|
||||
//So instead we instant kill our target
|
||||
//Chromatic mutation if target is effected by all afflictions
|
||||
if (pUnit->HasAura(SPELL_BROODAF_BLUE)
|
||||
&& pUnit->HasAura(SPELL_BROODAF_BLACK)
|
||||
&& pUnit->HasAura(SPELL_BROODAF_RED)
|
||||
&& pUnit->HasAura(SPELL_BROODAF_BRONZE)
|
||||
&& pUnit->HasAura(SPELL_BROODAF_GREEN))
|
||||
{
|
||||
//pTarget->RemoveAllAuras();
|
||||
//DoCast(pTarget, SPELL_CHROMATIC_MUT_1);
|
||||
|
||||
//WORKAROUND
|
||||
if (pUnit->GetTypeId() == TYPEID_PLAYER)
|
||||
pUnit->CastSpell(pUnit, 5, false);
|
||||
//Chromatic mutation is causing issues
|
||||
//Assuming it is caused by a lack of core support for Charm
|
||||
//So instead we instant kill our target
|
||||
|
||||
//WORKAROUND
|
||||
if (pUnit->GetTypeId() == TYPEID_PLAYER)
|
||||
pUnit->CastSpell(pUnit, 5, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Affliction_Timer = 10000;
|
||||
} else Affliction_Timer -= diff;
|
||||
|
||||
//Frenzy_Timer
|
||||
if (Frenzy_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
DoScriptText(EMOTE_FRENZY, me);
|
||||
Frenzy_Timer = urand(10000,15000);
|
||||
} else Frenzy_Timer -= diff;
|
||||
|
||||
//Enrage if not already enraged and below 20%
|
||||
if (!Enraged && (me->GetHealth()*100 / me->GetMaxHealth()) < 20)
|
||||
{
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
Enraged = true;
|
||||
}
|
||||
|
||||
Affliction_Timer = 10000;
|
||||
} else Affliction_Timer -= diff;
|
||||
|
||||
//Frenzy_Timer
|
||||
if (Frenzy_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
DoScriptText(EMOTE_FRENZY, me);
|
||||
Frenzy_Timer = urand(10000,15000);
|
||||
} else Frenzy_Timer -= diff;
|
||||
|
||||
//Enrage if not already enraged and below 20%
|
||||
if (!Enraged && (me->GetHealth()*100 / me->GetMaxHealth()) < 20)
|
||||
{
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
Enraged = true;
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_chromaggus(Creature* pCreature)
|
||||
{
|
||||
return new boss_chromaggusAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_chromaggus()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_chromaggus";
|
||||
newscript->GetAI = &GetAI_boss_chromaggus;
|
||||
newscript->RegisterSelf();
|
||||
new boss_chromaggus();
|
||||
}
|
||||
|
||||
|
||||
@@ -29,78 +29,80 @@ EndScriptData */
|
||||
#define SPELL_WINGBUFFET 18500
|
||||
#define SPELL_SHADOWOFEBONROC 23340
|
||||
#define SPELL_HEAL 41386 //Thea Heal spell of his Shadow
|
||||
|
||||
struct boss_ebonrocAI : public ScriptedAI
|
||||
␍class boss_ebonroc : public CreatureScript
|
||||
{
|
||||
boss_ebonrocAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_ebonroc() : CreatureScript("boss_ebonroc") { }
|
||||
|
||||
uint32 ShadowFlame_Timer;
|
||||
uint32 WingBuffet_Timer;
|
||||
uint32 ShadowOfEbonroc_Timer;
|
||||
uint32 Heal_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
ShadowFlame_Timer = 15000; //These times are probably wrong
|
||||
WingBuffet_Timer = 30000;
|
||||
ShadowOfEbonroc_Timer = 45000;
|
||||
Heal_Timer = 1000;
|
||||
return new boss_ebonrocAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_ebonrocAI : public ScriptedAI
|
||||
{
|
||||
DoZoneInCombat();
|
||||
}
|
||||
boss_ebonrocAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 ShadowFlame_Timer;
|
||||
uint32 WingBuffet_Timer;
|
||||
uint32 ShadowOfEbonroc_Timer;
|
||||
uint32 Heal_Timer;
|
||||
|
||||
//Shadowflame Timer
|
||||
if (ShadowFlame_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWFLAME);
|
||||
ShadowFlame_Timer = urand(12000,15000);
|
||||
} else ShadowFlame_Timer -= diff;
|
||||
|
||||
//Wing Buffet Timer
|
||||
if (WingBuffet_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WINGBUFFET);
|
||||
WingBuffet_Timer = 25000;
|
||||
} else WingBuffet_Timer -= diff;
|
||||
|
||||
//Shadow of Ebonroc Timer
|
||||
if (ShadowOfEbonroc_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWOFEBONROC);
|
||||
ShadowOfEbonroc_Timer = urand(25000,350000);
|
||||
} else ShadowOfEbonroc_Timer -= diff;
|
||||
|
||||
if (me->getVictim()->HasAura(SPELL_SHADOWOFEBONROC))
|
||||
{
|
||||
if (Heal_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_HEAL);
|
||||
Heal_Timer = urand(1000,3000);
|
||||
} else Heal_Timer -= diff;
|
||||
ShadowFlame_Timer = 15000; //These times are probably wrong
|
||||
WingBuffet_Timer = 30000;
|
||||
ShadowOfEbonroc_Timer = 45000;
|
||||
Heal_Timer = 1000;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Shadowflame Timer
|
||||
if (ShadowFlame_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWFLAME);
|
||||
ShadowFlame_Timer = urand(12000,15000);
|
||||
} else ShadowFlame_Timer -= diff;
|
||||
|
||||
//Wing Buffet Timer
|
||||
if (WingBuffet_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WINGBUFFET);
|
||||
WingBuffet_Timer = 25000;
|
||||
} else WingBuffet_Timer -= diff;
|
||||
|
||||
//Shadow of Ebonroc Timer
|
||||
if (ShadowOfEbonroc_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWOFEBONROC);
|
||||
ShadowOfEbonroc_Timer = urand(25000,350000);
|
||||
} else ShadowOfEbonroc_Timer -= diff;
|
||||
|
||||
if (me->getVictim()->HasAura(SPELL_SHADOWOFEBONROC))
|
||||
{
|
||||
if (Heal_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_HEAL);
|
||||
Heal_Timer = urand(1000,3000);
|
||||
} else Heal_Timer -= diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
CreatureAI* GetAI_boss_ebonroc(Creature* pCreature)
|
||||
{
|
||||
return new boss_ebonrocAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_ebonroc()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_ebonroc";
|
||||
newscript->GetAI = &GetAI_boss_ebonroc;
|
||||
newscript->RegisterSelf();
|
||||
new boss_ebonroc();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,70 +28,72 @@ EndScriptData */
|
||||
#define SPELL_SHADOWFLAME 22539
|
||||
#define SPELL_WINGBUFFET 23339
|
||||
#define SPELL_FLAMEBUFFET 23341
|
||||
|
||||
struct boss_firemawAI : public ScriptedAI
|
||||
␍class boss_firemaw : public CreatureScript
|
||||
{
|
||||
boss_firemawAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_firemaw() : CreatureScript("boss_firemaw") { }
|
||||
|
||||
uint32 ShadowFlame_Timer;
|
||||
uint32 WingBuffet_Timer;
|
||||
uint32 FlameBuffet_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
ShadowFlame_Timer = 30000; //These times are probably wrong
|
||||
WingBuffet_Timer = 24000;
|
||||
FlameBuffet_Timer = 5000;
|
||||
return new boss_firemawAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_firemawAI : public ScriptedAI
|
||||
{
|
||||
DoZoneInCombat();
|
||||
}
|
||||
boss_firemawAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 ShadowFlame_Timer;
|
||||
uint32 WingBuffet_Timer;
|
||||
uint32 FlameBuffet_Timer;
|
||||
|
||||
//ShadowFlame_Timer
|
||||
if (ShadowFlame_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWFLAME);
|
||||
ShadowFlame_Timer = urand(15000,18000);
|
||||
} else ShadowFlame_Timer -= diff;
|
||||
|
||||
//WingBuffet_Timer
|
||||
if (WingBuffet_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WINGBUFFET);
|
||||
if (DoGetThreat(me->getVictim()))
|
||||
DoModifyThreatPercent(me->getVictim(),-75);
|
||||
|
||||
WingBuffet_Timer = 25000;
|
||||
} else WingBuffet_Timer -= diff;
|
||||
|
||||
//FlameBuffet_Timer
|
||||
if (FlameBuffet_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FLAMEBUFFET);
|
||||
ShadowFlame_Timer = 30000; //These times are probably wrong
|
||||
WingBuffet_Timer = 24000;
|
||||
FlameBuffet_Timer = 5000;
|
||||
} else FlameBuffet_Timer -= diff;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//ShadowFlame_Timer
|
||||
if (ShadowFlame_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWFLAME);
|
||||
ShadowFlame_Timer = urand(15000,18000);
|
||||
} else ShadowFlame_Timer -= diff;
|
||||
|
||||
//WingBuffet_Timer
|
||||
if (WingBuffet_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WINGBUFFET);
|
||||
if (DoGetThreat(me->getVictim()))
|
||||
DoModifyThreatPercent(me->getVictim(),-75);
|
||||
|
||||
WingBuffet_Timer = 25000;
|
||||
} else WingBuffet_Timer -= diff;
|
||||
|
||||
//FlameBuffet_Timer
|
||||
if (FlameBuffet_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FLAMEBUFFET);
|
||||
FlameBuffet_Timer = 5000;
|
||||
} else FlameBuffet_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_firemaw(Creature* pCreature)
|
||||
{
|
||||
return new boss_firemawAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_firemaw()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_firemaw";
|
||||
newscript->GetAI = &GetAI_boss_firemaw;
|
||||
newscript->RegisterSelf();
|
||||
new boss_firemaw();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,71 +30,73 @@ EndScriptData */
|
||||
#define SPELL_SHADOWFLAME 22539
|
||||
#define SPELL_WINGBUFFET 23339
|
||||
#define SPELL_FRENZY 23342 //This spell periodically triggers fire nova
|
||||
|
||||
struct boss_flamegorAI : public ScriptedAI
|
||||
␍class boss_flamegor : public CreatureScript
|
||||
{
|
||||
boss_flamegorAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_flamegor() : CreatureScript("boss_flamegor") { }
|
||||
|
||||
uint32 ShadowFlame_Timer;
|
||||
uint32 WingBuffet_Timer;
|
||||
uint32 Frenzy_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
ShadowFlame_Timer = 21000; //These times are probably wrong
|
||||
WingBuffet_Timer = 35000;
|
||||
Frenzy_Timer = 10000;
|
||||
return new boss_flamegorAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_flamegorAI : public ScriptedAI
|
||||
{
|
||||
DoZoneInCombat();
|
||||
}
|
||||
boss_flamegorAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 ShadowFlame_Timer;
|
||||
uint32 WingBuffet_Timer;
|
||||
uint32 Frenzy_Timer;
|
||||
|
||||
//ShadowFlame_Timer
|
||||
if (ShadowFlame_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWFLAME);
|
||||
ShadowFlame_Timer = 15000 + rand()%7000;
|
||||
} else ShadowFlame_Timer -= diff;
|
||||
ShadowFlame_Timer = 21000; //These times are probably wrong
|
||||
WingBuffet_Timer = 35000;
|
||||
Frenzy_Timer = 10000;
|
||||
}
|
||||
|
||||
//WingBuffet_Timer
|
||||
if (WingBuffet_Timer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WINGBUFFET);
|
||||
if (DoGetThreat(me->getVictim()))
|
||||
DoModifyThreatPercent(me->getVictim(),-75);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
WingBuffet_Timer = 25000;
|
||||
} else WingBuffet_Timer -= diff;
|
||||
|
||||
//Frenzy_Timer
|
||||
if (Frenzy_Timer <= diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
DoScriptText(EMOTE_FRENZY, me);
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
Frenzy_Timer = urand(8000, 10000);
|
||||
} else Frenzy_Timer -= diff;
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//ShadowFlame_Timer
|
||||
if (ShadowFlame_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWFLAME);
|
||||
ShadowFlame_Timer = 15000 + rand()%7000;
|
||||
} else ShadowFlame_Timer -= diff;
|
||||
|
||||
//WingBuffet_Timer
|
||||
if (WingBuffet_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WINGBUFFET);
|
||||
if (DoGetThreat(me->getVictim()))
|
||||
DoModifyThreatPercent(me->getVictim(),-75);
|
||||
|
||||
WingBuffet_Timer = 25000;
|
||||
} else WingBuffet_Timer -= diff;
|
||||
|
||||
//Frenzy_Timer
|
||||
if (Frenzy_Timer <= diff)
|
||||
{
|
||||
DoScriptText(EMOTE_FRENZY, me);
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
Frenzy_Timer = urand(8000, 10000);
|
||||
} else Frenzy_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_flamegor(Creature* pCreature)
|
||||
{
|
||||
return new boss_flamegorAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_flamegor()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_flamegor";
|
||||
newscript->GetAI = &GetAI_boss_flamegor;
|
||||
newscript->RegisterSelf();
|
||||
new boss_flamegor();
|
||||
}
|
||||
|
||||
|
||||
@@ -59,175 +59,177 @@ EndScriptData */
|
||||
#define SPELL_WARLOCK 23427 //infernals
|
||||
#define SPELL_HUNTER 23436 //bow broke
|
||||
#define SPELL_ROGUE 23414 //Paralise
|
||||
|
||||
struct boss_nefarianAI : public ScriptedAI
|
||||
␍class boss_nefarian : public CreatureScript
|
||||
{
|
||||
boss_nefarianAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_nefarian() : CreatureScript("boss_nefarian") { }
|
||||
|
||||
uint32 ShadowFlame_Timer;
|
||||
uint32 BellowingRoar_Timer;
|
||||
uint32 VeilOfShadow_Timer;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 TailLash_Timer;
|
||||
uint32 ClassCall_Timer;
|
||||
bool Phase3;
|
||||
|
||||
uint32 DespawnTimer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
ShadowFlame_Timer = 12000; //These times are probably wrong
|
||||
BellowingRoar_Timer = 30000;
|
||||
VeilOfShadow_Timer = 15000;
|
||||
Cleave_Timer = 7000;
|
||||
TailLash_Timer = 10000;
|
||||
ClassCall_Timer = 35000; //35-40 seconds
|
||||
Phase3 = false;
|
||||
|
||||
DespawnTimer = 5000;
|
||||
return new boss_nefarianAI (pCreature);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* Victim)
|
||||
struct boss_nefarianAI : public ScriptedAI
|
||||
{
|
||||
if (rand()%5)
|
||||
return;
|
||||
boss_nefarianAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
DoScriptText(SAY_SLAY, me, Victim);
|
||||
}
|
||||
uint32 ShadowFlame_Timer;
|
||||
uint32 BellowingRoar_Timer;
|
||||
uint32 VeilOfShadow_Timer;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 TailLash_Timer;
|
||||
uint32 ClassCall_Timer;
|
||||
bool Phase3;
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
}
|
||||
uint32 DespawnTimer;
|
||||
|
||||
void EnterCombat(Unit * who)
|
||||
{
|
||||
DoScriptText(RAND(SAY_XHEALTH,SAY_AGGRO,SAY_SHADOWFLAME), me);
|
||||
|
||||
DoCast(who, SPELL_SHADOWFLAME_INITIAL);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (DespawnTimer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
me->ForcedDespawn();
|
||||
DespawnTimer = 5000;
|
||||
} else DespawnTimer -= diff;
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//ShadowFlame_Timer
|
||||
if (ShadowFlame_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWFLAME);
|
||||
ShadowFlame_Timer = 12000;
|
||||
} else ShadowFlame_Timer -= diff;
|
||||
|
||||
//BellowingRoar_Timer
|
||||
if (BellowingRoar_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_BELLOWINGROAR);
|
||||
ShadowFlame_Timer = 12000; //These times are probably wrong
|
||||
BellowingRoar_Timer = 30000;
|
||||
} else BellowingRoar_Timer -= diff;
|
||||
|
||||
//VeilOfShadow_Timer
|
||||
if (VeilOfShadow_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_VEILOFSHADOW);
|
||||
VeilOfShadow_Timer = 15000;
|
||||
} else VeilOfShadow_Timer -= diff;
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 7000;
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
//TailLash_Timer
|
||||
if (TailLash_Timer <= diff)
|
||||
{
|
||||
//Cast NYI since we need a better check for behind target
|
||||
//DoCast(me->getVictim(), SPELL_TAILLASH);
|
||||
|
||||
TailLash_Timer = 10000;
|
||||
} else TailLash_Timer -= diff;
|
||||
ClassCall_Timer = 35000; //35-40 seconds
|
||||
Phase3 = false;
|
||||
|
||||
//ClassCall_Timer
|
||||
if (ClassCall_Timer <= diff)
|
||||
{
|
||||
//Cast a random class call
|
||||
//On official it is based on what classes are currently on the hostil list
|
||||
//but we can't do that yet so just randomly call one
|
||||
|
||||
switch (urand(0,8))
|
||||
{
|
||||
case 0:
|
||||
DoScriptText(SAY_MAGE, me);
|
||||
DoCast(me, SPELL_MAGE);
|
||||
break;
|
||||
case 1:
|
||||
DoScriptText(SAY_WARRIOR, me);
|
||||
DoCast(me, SPELL_WARRIOR);
|
||||
break;
|
||||
case 2:
|
||||
DoScriptText(SAY_DRUID, me);
|
||||
DoCast(me, SPELL_DRUID);
|
||||
break;
|
||||
case 3:
|
||||
DoScriptText(SAY_PRIEST, me);
|
||||
DoCast(me, SPELL_PRIEST);
|
||||
break;
|
||||
case 4:
|
||||
DoScriptText(SAY_PALADIN, me);
|
||||
DoCast(me, SPELL_PALADIN);
|
||||
break;
|
||||
case 5:
|
||||
DoScriptText(SAY_SHAMAN, me);
|
||||
DoCast(me, SPELL_SHAMAN);
|
||||
break;
|
||||
case 6:
|
||||
DoScriptText(SAY_WARLOCK, me);
|
||||
DoCast(me, SPELL_WARLOCK);
|
||||
break;
|
||||
case 7:
|
||||
DoScriptText(SAY_HUNTER, me);
|
||||
DoCast(me, SPELL_HUNTER);
|
||||
break;
|
||||
case 8:
|
||||
DoScriptText(SAY_ROGUE, me);
|
||||
DoCast(me, SPELL_ROGUE);
|
||||
break;
|
||||
}
|
||||
|
||||
ClassCall_Timer = 35000 + (rand() % 5000);
|
||||
} else ClassCall_Timer -= diff;
|
||||
|
||||
//Phase3 begins when we are below X health
|
||||
if (!Phase3 && (me->GetHealth()*100 / me->GetMaxHealth()) < 20)
|
||||
{
|
||||
Phase3 = true;
|
||||
DoScriptText(SAY_RAISE_SKELETONS, me);
|
||||
DespawnTimer = 5000;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void KilledUnit(Unit* Victim)
|
||||
{
|
||||
if (rand()%5)
|
||||
return;
|
||||
|
||||
DoScriptText(SAY_SLAY, me, Victim);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * who)
|
||||
{
|
||||
DoScriptText(RAND(SAY_XHEALTH,SAY_AGGRO,SAY_SHADOWFLAME), me);
|
||||
|
||||
DoCast(who, SPELL_SHADOWFLAME_INITIAL);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (DespawnTimer <= diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
me->ForcedDespawn();
|
||||
DespawnTimer = 5000;
|
||||
} else DespawnTimer -= diff;
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//ShadowFlame_Timer
|
||||
if (ShadowFlame_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SHADOWFLAME);
|
||||
ShadowFlame_Timer = 12000;
|
||||
} else ShadowFlame_Timer -= diff;
|
||||
|
||||
//BellowingRoar_Timer
|
||||
if (BellowingRoar_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_BELLOWINGROAR);
|
||||
BellowingRoar_Timer = 30000;
|
||||
} else BellowingRoar_Timer -= diff;
|
||||
|
||||
//VeilOfShadow_Timer
|
||||
if (VeilOfShadow_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_VEILOFSHADOW);
|
||||
VeilOfShadow_Timer = 15000;
|
||||
} else VeilOfShadow_Timer -= diff;
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 7000;
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
//TailLash_Timer
|
||||
if (TailLash_Timer <= diff)
|
||||
{
|
||||
//Cast NYI since we need a better check for behind target
|
||||
//DoCast(me->getVictim(), SPELL_TAILLASH);
|
||||
|
||||
TailLash_Timer = 10000;
|
||||
} else TailLash_Timer -= diff;
|
||||
|
||||
//ClassCall_Timer
|
||||
if (ClassCall_Timer <= diff)
|
||||
{
|
||||
//Cast a random class call
|
||||
//On official it is based on what classes are currently on the hostil list
|
||||
//but we can't do that yet so just randomly call one
|
||||
|
||||
switch (urand(0,8))
|
||||
{
|
||||
case 0:
|
||||
DoScriptText(SAY_MAGE, me);
|
||||
DoCast(me, SPELL_MAGE);
|
||||
break;
|
||||
case 1:
|
||||
DoScriptText(SAY_WARRIOR, me);
|
||||
DoCast(me, SPELL_WARRIOR);
|
||||
break;
|
||||
case 2:
|
||||
DoScriptText(SAY_DRUID, me);
|
||||
DoCast(me, SPELL_DRUID);
|
||||
break;
|
||||
case 3:
|
||||
DoScriptText(SAY_PRIEST, me);
|
||||
DoCast(me, SPELL_PRIEST);
|
||||
break;
|
||||
case 4:
|
||||
DoScriptText(SAY_PALADIN, me);
|
||||
DoCast(me, SPELL_PALADIN);
|
||||
break;
|
||||
case 5:
|
||||
DoScriptText(SAY_SHAMAN, me);
|
||||
DoCast(me, SPELL_SHAMAN);
|
||||
break;
|
||||
case 6:
|
||||
DoScriptText(SAY_WARLOCK, me);
|
||||
DoCast(me, SPELL_WARLOCK);
|
||||
break;
|
||||
case 7:
|
||||
DoScriptText(SAY_HUNTER, me);
|
||||
DoCast(me, SPELL_HUNTER);
|
||||
break;
|
||||
case 8:
|
||||
DoScriptText(SAY_ROGUE, me);
|
||||
DoCast(me, SPELL_ROGUE);
|
||||
break;
|
||||
}
|
||||
|
||||
ClassCall_Timer = 35000 + (rand() % 5000);
|
||||
} else ClassCall_Timer -= diff;
|
||||
|
||||
//Phase3 begins when we are below X health
|
||||
if (!Phase3 && (me->GetHealth()*100 / me->GetMaxHealth()) < 20)
|
||||
{
|
||||
Phase3 = true;
|
||||
DoScriptText(SAY_RAISE_SKELETONS, me);
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
CreatureAI* GetAI_boss_nefarian(Creature* pCreature)
|
||||
{
|
||||
return new boss_nefarianAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_nefarian()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_nefarian";
|
||||
newscript->GetAI = &GetAI_boss_nefarian;
|
||||
newscript->RegisterSelf();
|
||||
new boss_nefarian();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,92 +36,94 @@ EndScriptData */
|
||||
#define SPELL_WARSTOMP 24375
|
||||
#define SPELL_FIREBALLVOLLEY 22425
|
||||
#define SPELL_CONFLAGRATION 23023
|
||||
|
||||
struct boss_razorgoreAI : public ScriptedAI
|
||||
␍class boss_razorgore : public CreatureScript
|
||||
{
|
||||
boss_razorgoreAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_razorgore() : CreatureScript("boss_razorgore") { }
|
||||
|
||||
uint32 Cleave_Timer;
|
||||
uint32 WarStomp_Timer;
|
||||
uint32 FireballVolley_Timer;
|
||||
uint32 Conflagration_Timer;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
Cleave_Timer = 15000; //These times are probably wrong
|
||||
WarStomp_Timer = 35000;
|
||||
FireballVolley_Timer = 7000;
|
||||
Conflagration_Timer = 12000;
|
||||
return new boss_razorgoreAI (pCreature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
struct boss_razorgoreAI : public ScriptedAI
|
||||
{
|
||||
DoZoneInCombat();
|
||||
}
|
||||
boss_razorgoreAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
}
|
||||
uint32 Cleave_Timer;
|
||||
uint32 WarStomp_Timer;
|
||||
uint32 FireballVolley_Timer;
|
||||
uint32 Conflagration_Timer;
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = urand(7000,10000);
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
//WarStomp_Timer
|
||||
if (WarStomp_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WARSTOMP);
|
||||
WarStomp_Timer = urand(15000,25000);
|
||||
} else WarStomp_Timer -= diff;
|
||||
|
||||
//FireballVolley_Timer
|
||||
if (FireballVolley_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FIREBALLVOLLEY);
|
||||
FireballVolley_Timer = urand(12000,15000);
|
||||
} else FireballVolley_Timer -= diff;
|
||||
|
||||
//Conflagration_Timer
|
||||
if (Conflagration_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CONFLAGRATION);
|
||||
//We will remove this threat reduction and add an aura check.
|
||||
|
||||
//if (DoGetThreat(me->getVictim()))
|
||||
//DoModifyThreatPercent(me->getVictim(),-50);
|
||||
|
||||
Cleave_Timer = 15000; //These times are probably wrong
|
||||
WarStomp_Timer = 35000;
|
||||
FireballVolley_Timer = 7000;
|
||||
Conflagration_Timer = 12000;
|
||||
} else Conflagration_Timer -= diff;
|
||||
}
|
||||
|
||||
// Aura Check. If the gamer is affected by confliguration we attack a random gamer.
|
||||
if (me->getVictim() && me->getVictim()->HasAura(SPELL_CONFLAGRATION))
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
|
||||
me->TauntApply(pTarget);
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = urand(7000,10000);
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
//WarStomp_Timer
|
||||
if (WarStomp_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WARSTOMP);
|
||||
WarStomp_Timer = urand(15000,25000);
|
||||
} else WarStomp_Timer -= diff;
|
||||
|
||||
//FireballVolley_Timer
|
||||
if (FireballVolley_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FIREBALLVOLLEY);
|
||||
FireballVolley_Timer = urand(12000,15000);
|
||||
} else FireballVolley_Timer -= diff;
|
||||
|
||||
//Conflagration_Timer
|
||||
if (Conflagration_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CONFLAGRATION);
|
||||
//We will remove this threat reduction and add an aura check.
|
||||
|
||||
//if (DoGetThreat(me->getVictim()))
|
||||
//DoModifyThreatPercent(me->getVictim(),-50);
|
||||
|
||||
Conflagration_Timer = 12000;
|
||||
} else Conflagration_Timer -= diff;
|
||||
|
||||
// Aura Check. If the gamer is affected by confliguration we attack a random gamer.
|
||||
if (me->getVictim() && me->getVictim()->HasAura(SPELL_CONFLAGRATION))
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
|
||||
me->TauntApply(pTarget);
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_razorgore(Creature* pCreature)
|
||||
{
|
||||
return new boss_razorgoreAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_razorgore()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_razorgore";
|
||||
newscript->GetAI = &GetAI_boss_razorgore;
|
||||
newscript->RegisterSelf();
|
||||
new boss_razorgore();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,226 +39,225 @@ EndScriptData */
|
||||
#define SPELL_TAILSWIPE 15847
|
||||
#define SPELL_BURNINGADRENALINE 23620
|
||||
#define SPELL_CLEAVE 20684 //Chain cleave is most likely named something different and contains a dummy effect
|
||||
|
||||
struct boss_vaelAI : public ScriptedAI
|
||||
␍class boss_vaelastrasz : public CreatureScript
|
||||
{
|
||||
boss_vaelAI(Creature *c) : ScriptedAI(c)
|
||||
public:
|
||||
boss_vaelastrasz() : CreatureScript("boss_vaelastrasz") { }
|
||||
|
||||
void SendDefaultMenu(Player* pPlayer, Creature* pCreature, uint32 uiAction)
|
||||
{
|
||||
c->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
c->setFaction(35);
|
||||
c->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
uint64 PlayerGUID;
|
||||
uint32 SpeechTimer;
|
||||
uint32 SpeechNum;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 FlameBreath_Timer;
|
||||
uint32 FireNova_Timer;
|
||||
uint32 BurningAdrenalineCaster_Timer;
|
||||
uint32 BurningAdrenalineTank_Timer;
|
||||
uint32 TailSwipe_Timer;
|
||||
bool HasYelled;
|
||||
bool DoingSpeech;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
PlayerGUID = 0;
|
||||
SpeechTimer = 0;
|
||||
SpeechNum = 0;
|
||||
Cleave_Timer = 8000; //These times are probably wrong
|
||||
FlameBreath_Timer = 11000;
|
||||
BurningAdrenalineCaster_Timer = 15000;
|
||||
BurningAdrenalineTank_Timer = 45000;
|
||||
FireNova_Timer = 5000;
|
||||
TailSwipe_Timer = 20000;
|
||||
HasYelled = false;
|
||||
DoingSpeech = false;
|
||||
}
|
||||
|
||||
void BeginSpeech(Unit *pTarget)
|
||||
{
|
||||
//Stand up and begin speach
|
||||
PlayerGUID = pTarget->GetGUID();
|
||||
|
||||
//10 seconds
|
||||
DoScriptText(SAY_LINE1, me);
|
||||
|
||||
SpeechTimer = 10000;
|
||||
SpeechNum = 0;
|
||||
DoingSpeech = true;
|
||||
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * victim)
|
||||
{
|
||||
if (rand()%5)
|
||||
return;
|
||||
|
||||
DoScriptText(SAY_KILLTARGET, me, victim);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me, SPELL_ESSENCEOFTHERED);
|
||||
DoZoneInCombat();
|
||||
me->SetHealth(int(me->GetMaxHealth()*.3));
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Speech
|
||||
if (DoingSpeech)
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
|
||||
{
|
||||
if (SpeechTimer <= diff)
|
||||
{
|
||||
switch (SpeechNum)
|
||||
{
|
||||
case 0:
|
||||
//16 seconds till next line
|
||||
DoScriptText(SAY_LINE2, me);
|
||||
SpeechTimer = 16000;
|
||||
++SpeechNum;
|
||||
break;
|
||||
case 1:
|
||||
//This one is actually 16 seconds but we only go to 10 seconds because he starts attacking after he says "I must fight this!"
|
||||
DoScriptText(SAY_LINE3, me);
|
||||
SpeechTimer = 10000;
|
||||
++SpeechNum;
|
||||
break;
|
||||
case 2:
|
||||
me->setFaction(103);
|
||||
if (PlayerGUID && Unit::GetUnit((*me),PlayerGUID))
|
||||
{
|
||||
AttackStart(Unit::GetUnit((*me),PlayerGUID));
|
||||
DoCast(me, SPELL_ESSENCEOFTHERED);
|
||||
}
|
||||
SpeechTimer = 0;
|
||||
DoingSpeech = false;
|
||||
break;
|
||||
}
|
||||
} else SpeechTimer -= diff;
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
CAST_AI(boss_vaelastrasz::boss_vaelAI, pCreature->AI())->BeginSpeech(pPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
|
||||
{
|
||||
if (uiSender == GOSSIP_SENDER_MAIN)
|
||||
SendDefaultMenu(pPlayer, pCreature, uiAction);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
if (pCreature->isQuestGiver())
|
||||
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
|
||||
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
return new boss_vaelAI (pCreature);
|
||||
}
|
||||
|
||||
struct boss_vaelAI : public ScriptedAI
|
||||
{
|
||||
boss_vaelAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
c->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
c->setFaction(35);
|
||||
c->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint64 PlayerGUID;
|
||||
uint32 SpeechTimer;
|
||||
uint32 SpeechNum;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 FlameBreath_Timer;
|
||||
uint32 FireNova_Timer;
|
||||
uint32 BurningAdrenalineCaster_Timer;
|
||||
uint32 BurningAdrenalineTank_Timer;
|
||||
uint32 TailSwipe_Timer;
|
||||
bool HasYelled;
|
||||
bool DoingSpeech;
|
||||
|
||||
// Yell if hp lower than 15%
|
||||
if (me->GetHealth()*100 / me->GetMaxHealth() < 15 && !HasYelled)
|
||||
void Reset()
|
||||
{
|
||||
DoScriptText(SAY_HALFLIFE, me);
|
||||
HasYelled = true;
|
||||
}
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 15000;
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
//FlameBreath_Timer
|
||||
if (FlameBreath_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FLAMEBREATH);
|
||||
FlameBreath_Timer = urand(4000,8000);
|
||||
} else FlameBreath_Timer -= diff;
|
||||
|
||||
//BurningAdrenalineCaster_Timer
|
||||
if (BurningAdrenalineCaster_Timer <= diff)
|
||||
{
|
||||
Unit *pTarget = NULL;
|
||||
|
||||
uint8 i = 0;
|
||||
while (i < 3) // max 3 tries to get a random target with power_mana
|
||||
{
|
||||
++i;
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); //not aggro leader
|
||||
if (pTarget && pTarget->getPowerType() == POWER_MANA)
|
||||
i = 3;
|
||||
}
|
||||
if (pTarget) // cast on self (see below)
|
||||
pTarget->CastSpell(pTarget,SPELL_BURNINGADRENALINE,1);
|
||||
|
||||
PlayerGUID = 0;
|
||||
SpeechTimer = 0;
|
||||
SpeechNum = 0;
|
||||
Cleave_Timer = 8000; //These times are probably wrong
|
||||
FlameBreath_Timer = 11000;
|
||||
BurningAdrenalineCaster_Timer = 15000;
|
||||
} else BurningAdrenalineCaster_Timer -= diff;
|
||||
|
||||
//BurningAdrenalineTank_Timer
|
||||
if (BurningAdrenalineTank_Timer <= diff)
|
||||
{
|
||||
// have the victim cast the spell on himself otherwise the third effect aura will be applied
|
||||
// to Vael instead of the player
|
||||
me->getVictim()->CastSpell(me->getVictim(),SPELL_BURNINGADRENALINE,1);
|
||||
|
||||
BurningAdrenalineTank_Timer = 45000;
|
||||
} else BurningAdrenalineTank_Timer -= diff;
|
||||
|
||||
//FireNova_Timer
|
||||
if (FireNova_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FIRENOVA);
|
||||
FireNova_Timer = 5000;
|
||||
} else FireNova_Timer -= diff;
|
||||
|
||||
//TailSwipe_Timer
|
||||
if (TailSwipe_Timer <= diff)
|
||||
{
|
||||
//Only cast if we are behind
|
||||
/*if (!me->HasInArc(M_PI, me->getVictim()))
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_TAILSWIPE);
|
||||
}*/
|
||||
|
||||
TailSwipe_Timer = 20000;
|
||||
} else TailSwipe_Timer -= diff;
|
||||
HasYelled = false;
|
||||
DoingSpeech = false;
|
||||
}
|
||||
|
||||
void BeginSpeech(Unit *pTarget)
|
||||
{
|
||||
//Stand up and begin speach
|
||||
PlayerGUID = pTarget->GetGUID();
|
||||
|
||||
//10 seconds
|
||||
DoScriptText(SAY_LINE1, me);
|
||||
|
||||
SpeechTimer = 10000;
|
||||
SpeechNum = 0;
|
||||
DoingSpeech = true;
|
||||
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * victim)
|
||||
{
|
||||
if (rand()%5)
|
||||
return;
|
||||
|
||||
DoScriptText(SAY_KILLTARGET, me, victim);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me, SPELL_ESSENCEOFTHERED);
|
||||
DoZoneInCombat();
|
||||
me->SetHealth(int(me->GetMaxHealth()*.3));
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Speech
|
||||
if (DoingSpeech)
|
||||
{
|
||||
if (SpeechTimer <= diff)
|
||||
{
|
||||
switch (SpeechNum)
|
||||
{
|
||||
case 0:
|
||||
//16 seconds till next line
|
||||
DoScriptText(SAY_LINE2, me);
|
||||
SpeechTimer = 16000;
|
||||
++SpeechNum;
|
||||
break;
|
||||
case 1:
|
||||
//This one is actually 16 seconds but we only go to 10 seconds because he starts attacking after he says "I must fight this!"
|
||||
DoScriptText(SAY_LINE3, me);
|
||||
SpeechTimer = 10000;
|
||||
++SpeechNum;
|
||||
break;
|
||||
case 2:
|
||||
me->setFaction(103);
|
||||
if (PlayerGUID && Unit::GetUnit((*me),PlayerGUID))
|
||||
{
|
||||
AttackStart(Unit::GetUnit((*me),PlayerGUID));
|
||||
DoCast(me, SPELL_ESSENCEOFTHERED);
|
||||
}
|
||||
SpeechTimer = 0;
|
||||
DoingSpeech = false;
|
||||
break;
|
||||
}
|
||||
} else SpeechTimer -= diff;
|
||||
}
|
||||
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
// Yell if hp lower than 15%
|
||||
if (me->GetHealth()*100 / me->GetMaxHealth() < 15 && !HasYelled)
|
||||
{
|
||||
DoScriptText(SAY_HALFLIFE, me);
|
||||
HasYelled = true;
|
||||
}
|
||||
|
||||
//Cleave_Timer
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = 15000;
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
//FlameBreath_Timer
|
||||
if (FlameBreath_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FLAMEBREATH);
|
||||
FlameBreath_Timer = urand(4000,8000);
|
||||
} else FlameBreath_Timer -= diff;
|
||||
|
||||
//BurningAdrenalineCaster_Timer
|
||||
if (BurningAdrenalineCaster_Timer <= diff)
|
||||
{
|
||||
Unit *pTarget = NULL;
|
||||
|
||||
uint8 i = 0;
|
||||
while (i < 3) // max 3 tries to get a random target with power_mana
|
||||
{
|
||||
++i;
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); //not aggro leader
|
||||
if (pTarget && pTarget->getPowerType() == POWER_MANA)
|
||||
i = 3;
|
||||
}
|
||||
if (pTarget) // cast on self (see below)
|
||||
pTarget->CastSpell(pTarget,SPELL_BURNINGADRENALINE,1);
|
||||
|
||||
BurningAdrenalineCaster_Timer = 15000;
|
||||
} else BurningAdrenalineCaster_Timer -= diff;
|
||||
|
||||
//BurningAdrenalineTank_Timer
|
||||
if (BurningAdrenalineTank_Timer <= diff)
|
||||
{
|
||||
// have the victim cast the spell on himself otherwise the third effect aura will be applied
|
||||
// to Vael instead of the player
|
||||
me->getVictim()->CastSpell(me->getVictim(),SPELL_BURNINGADRENALINE,1);
|
||||
|
||||
BurningAdrenalineTank_Timer = 45000;
|
||||
} else BurningAdrenalineTank_Timer -= diff;
|
||||
|
||||
//FireNova_Timer
|
||||
if (FireNova_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FIRENOVA);
|
||||
FireNova_Timer = 5000;
|
||||
} else FireNova_Timer -= diff;
|
||||
|
||||
//TailSwipe_Timer
|
||||
if (TailSwipe_Timer <= diff)
|
||||
{
|
||||
//Only cast if we are behind
|
||||
/*if (!me->HasInArc(M_PI, me->getVictim()))
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_TAILSWIPE);
|
||||
}*/
|
||||
|
||||
TailSwipe_Timer = 20000;
|
||||
} else TailSwipe_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
void SendDefaultMenu_boss_vael(Player* pPlayer, Creature* pCreature, uint32 uiAction)
|
||||
{
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
|
||||
{
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
CAST_AI(boss_vaelAI, pCreature->AI())->BeginSpeech(pPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
bool GossipSelect_boss_vael(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
|
||||
{
|
||||
if (uiSender == GOSSIP_SENDER_MAIN)
|
||||
SendDefaultMenu_boss_vael(pPlayer, pCreature, uiAction);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipHello_boss_vael(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
if (pCreature->isQuestGiver())
|
||||
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
|
||||
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_boss_vael(Creature* pCreature)
|
||||
{
|
||||
return new boss_vaelAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_vael()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_vaelastrasz";
|
||||
newscript->GetAI = &GetAI_boss_vael;
|
||||
newscript->pGossipHello = &GossipHello_boss_vael;
|
||||
newscript->pGossipSelect = &GossipSelect_boss_vael;
|
||||
newscript->RegisterSelf();
|
||||
new boss_vaelastrasz();
|
||||
}
|
||||
|
||||
|
||||
@@ -68,320 +68,321 @@ EndScriptData */
|
||||
//and allow players to start the event over
|
||||
//If nefarian dies then he will kill himself then he will kill himself in his hiding place
|
||||
//To prevent players from doing the event twice
|
||||
|
||||
struct boss_victor_nefariusAI : public ScriptedAI
|
||||
␍class boss_victor_nefarius : public CreatureScript
|
||||
{
|
||||
boss_victor_nefariusAI(Creature *c) : ScriptedAI(c)
|
||||
public:
|
||||
boss_victor_nefarius() : CreatureScript("boss_victor_nefarius") { }
|
||||
|
||||
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
|
||||
{
|
||||
NefarianGUID = 0;
|
||||
switch (urand(0,19))
|
||||
switch (uiAction)
|
||||
{
|
||||
case 0:
|
||||
DrakType1 = CREATURE_BRONZE_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLUE_DRAKANOID;
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
pPlayer->SEND_GOSSIP_MENU(7198, pCreature->GetGUID());
|
||||
break;
|
||||
case 1:
|
||||
DrakType1 = CREATURE_BRONZE_DRAKANOID;
|
||||
DrakType2 = CREATURE_RED_DRAKANOID;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
|
||||
pPlayer->SEND_GOSSIP_MENU(7199, pCreature->GetGUID());
|
||||
break;
|
||||
case 2:
|
||||
DrakType1 = CREATURE_BRONZE_DRAKANOID;
|
||||
DrakType2 = CREATURE_GREEN_DRAKANOID;
|
||||
break;
|
||||
case 3:
|
||||
DrakType1 = CREATURE_BRONZE_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLACK_DRAKANOID;
|
||||
break;
|
||||
case 4:
|
||||
DrakType1 = CREATURE_BLUE_DRAKANOID;
|
||||
DrakType2 = CREATURE_BRONZE_DRAKANOID;
|
||||
break;
|
||||
case 5:
|
||||
DrakType1 = CREATURE_BLUE_DRAKANOID;
|
||||
DrakType2 = CREATURE_RED_DRAKANOID;
|
||||
break;
|
||||
case 6:
|
||||
DrakType1 = CREATURE_BLUE_DRAKANOID;
|
||||
DrakType2 = CREATURE_GREEN_DRAKANOID;
|
||||
break;
|
||||
case 7:
|
||||
DrakType1 = CREATURE_BLUE_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLACK_DRAKANOID;
|
||||
break;
|
||||
case 8:
|
||||
DrakType1 = CREATURE_RED_DRAKANOID;
|
||||
DrakType2 = CREATURE_BRONZE_DRAKANOID;
|
||||
break;
|
||||
case 9:
|
||||
DrakType1 = CREATURE_RED_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLUE_DRAKANOID;
|
||||
break;
|
||||
case 10:
|
||||
DrakType1 = CREATURE_RED_DRAKANOID;
|
||||
DrakType2 = CREATURE_GREEN_DRAKANOID;
|
||||
break;
|
||||
case 11:
|
||||
DrakType1 = CREATURE_RED_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLACK_DRAKANOID;
|
||||
break;
|
||||
case 12:
|
||||
DrakType1 = CREATURE_GREEN_DRAKANOID;
|
||||
DrakType2 = CREATURE_BRONZE_DRAKANOID;
|
||||
break;
|
||||
case 13:
|
||||
DrakType1 = CREATURE_GREEN_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLUE_DRAKANOID;
|
||||
break;
|
||||
case 14:
|
||||
DrakType1 = CREATURE_GREEN_DRAKANOID;
|
||||
DrakType2 = CREATURE_RED_DRAKANOID;
|
||||
break;
|
||||
case 15:
|
||||
DrakType1 = CREATURE_GREEN_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLACK_DRAKANOID;
|
||||
break;
|
||||
case 16:
|
||||
DrakType1 = CREATURE_BLACK_DRAKANOID;
|
||||
DrakType2 = CREATURE_BRONZE_DRAKANOID;
|
||||
break;
|
||||
case 17:
|
||||
DrakType1 = CREATURE_BLACK_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLUE_DRAKANOID;
|
||||
break;
|
||||
case 18:
|
||||
DrakType1 = CREATURE_BLACK_DRAKANOID;
|
||||
DrakType2 = CREATURE_GREEN_DRAKANOID;
|
||||
break;
|
||||
case 19:
|
||||
DrakType1 = CREATURE_BLACK_DRAKANOID;
|
||||
DrakType2 = CREATURE_RED_DRAKANOID;
|
||||
case GOSSIP_ACTION_INFO_DEF+3:
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
DoScriptText(SAY_GAMESBEGIN_1, pCreature);
|
||||
CAST_AI(boss_victor_nefarius::boss_victor_nefariusAI, pCreature->AI())->BeginEvent(pPlayer);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32 SpawnedAdds;
|
||||
uint32 AddSpawnTimer;
|
||||
uint32 ShadowBoltTimer;
|
||||
uint32 FearTimer;
|
||||
uint32 MindControlTimer;
|
||||
uint32 ResetTimer;
|
||||
uint32 DrakType1;
|
||||
uint32 DrakType2;
|
||||
uint64 NefarianGUID;
|
||||
uint32 NefCheckTime;
|
||||
|
||||
void Reset()
|
||||
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
SpawnedAdds = 0;
|
||||
AddSpawnTimer = 10000;
|
||||
ShadowBoltTimer = 5000;
|
||||
FearTimer = 8000;
|
||||
ResetTimer = 900000; //On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier
|
||||
NefarianGUID = 0;
|
||||
NefCheckTime = 2000;
|
||||
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS,1);
|
||||
me->setFaction(35);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_1 , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
pPlayer->SEND_GOSSIP_MENU(7134, pCreature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
void BeginEvent(Player *pTarget)
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
DoScriptText(SAY_GAMESBEGIN_2, me);
|
||||
return new boss_victor_nefariusAI (pCreature);
|
||||
}
|
||||
|
||||
//Trinity::Singleton<MapManager>::Instance().GetMap(me->GetMapId(), me)->GetPlayers().begin();
|
||||
/*
|
||||
list <Player*>::const_iterator i = sMapMgr.GetMap(me->GetMapId(), me)->GetPlayers().begin();
|
||||
|
||||
for (i = sMapMgr.GetMap(me->GetMapId(), me)->GetPlayers().begin(); i != sMapMgr.GetMap(me->GetMapId(), me)->GetPlayers().end(); ++i)
|
||||
struct boss_victor_nefariusAI : public ScriptedAI
|
||||
{
|
||||
boss_victor_nefariusAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
AttackStart((*i));
|
||||
NefarianGUID = 0;
|
||||
switch (urand(0,19))
|
||||
{
|
||||
case 0:
|
||||
DrakType1 = CREATURE_BRONZE_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLUE_DRAKANOID;
|
||||
break;
|
||||
case 1:
|
||||
DrakType1 = CREATURE_BRONZE_DRAKANOID;
|
||||
DrakType2 = CREATURE_RED_DRAKANOID;
|
||||
break;
|
||||
case 2:
|
||||
DrakType1 = CREATURE_BRONZE_DRAKANOID;
|
||||
DrakType2 = CREATURE_GREEN_DRAKANOID;
|
||||
break;
|
||||
case 3:
|
||||
DrakType1 = CREATURE_BRONZE_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLACK_DRAKANOID;
|
||||
break;
|
||||
case 4:
|
||||
DrakType1 = CREATURE_BLUE_DRAKANOID;
|
||||
DrakType2 = CREATURE_BRONZE_DRAKANOID;
|
||||
break;
|
||||
case 5:
|
||||
DrakType1 = CREATURE_BLUE_DRAKANOID;
|
||||
DrakType2 = CREATURE_RED_DRAKANOID;
|
||||
break;
|
||||
case 6:
|
||||
DrakType1 = CREATURE_BLUE_DRAKANOID;
|
||||
DrakType2 = CREATURE_GREEN_DRAKANOID;
|
||||
break;
|
||||
case 7:
|
||||
DrakType1 = CREATURE_BLUE_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLACK_DRAKANOID;
|
||||
break;
|
||||
case 8:
|
||||
DrakType1 = CREATURE_RED_DRAKANOID;
|
||||
DrakType2 = CREATURE_BRONZE_DRAKANOID;
|
||||
break;
|
||||
case 9:
|
||||
DrakType1 = CREATURE_RED_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLUE_DRAKANOID;
|
||||
break;
|
||||
case 10:
|
||||
DrakType1 = CREATURE_RED_DRAKANOID;
|
||||
DrakType2 = CREATURE_GREEN_DRAKANOID;
|
||||
break;
|
||||
case 11:
|
||||
DrakType1 = CREATURE_RED_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLACK_DRAKANOID;
|
||||
break;
|
||||
case 12:
|
||||
DrakType1 = CREATURE_GREEN_DRAKANOID;
|
||||
DrakType2 = CREATURE_BRONZE_DRAKANOID;
|
||||
break;
|
||||
case 13:
|
||||
DrakType1 = CREATURE_GREEN_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLUE_DRAKANOID;
|
||||
break;
|
||||
case 14:
|
||||
DrakType1 = CREATURE_GREEN_DRAKANOID;
|
||||
DrakType2 = CREATURE_RED_DRAKANOID;
|
||||
break;
|
||||
case 15:
|
||||
DrakType1 = CREATURE_GREEN_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLACK_DRAKANOID;
|
||||
break;
|
||||
case 16:
|
||||
DrakType1 = CREATURE_BLACK_DRAKANOID;
|
||||
DrakType2 = CREATURE_BRONZE_DRAKANOID;
|
||||
break;
|
||||
case 17:
|
||||
DrakType1 = CREATURE_BLACK_DRAKANOID;
|
||||
DrakType2 = CREATURE_BLUE_DRAKANOID;
|
||||
break;
|
||||
case 18:
|
||||
DrakType1 = CREATURE_BLACK_DRAKANOID;
|
||||
DrakType2 = CREATURE_GREEN_DRAKANOID;
|
||||
break;
|
||||
case 19:
|
||||
DrakType1 = CREATURE_BLACK_DRAKANOID;
|
||||
DrakType2 = CREATURE_RED_DRAKANOID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
*/
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS,0);
|
||||
me->setFaction(103);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
AttackStart(pTarget);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
}
|
||||
uint32 SpawnedAdds;
|
||||
uint32 AddSpawnTimer;
|
||||
uint32 ShadowBoltTimer;
|
||||
uint32 FearTimer;
|
||||
uint32 MindControlTimer;
|
||||
uint32 ResetTimer;
|
||||
uint32 DrakType1;
|
||||
uint32 DrakType2;
|
||||
uint64 NefarianGUID;
|
||||
uint32 NefCheckTime;
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
//We simply use this function to find players until we can use pMap->GetPlayers()
|
||||
|
||||
if (who && who->GetTypeId() == TYPEID_PLAYER && me->IsHostileTo(who))
|
||||
void Reset()
|
||||
{
|
||||
//Add them to our threat list
|
||||
me->AddThreat(who, 0.0f);
|
||||
SpawnedAdds = 0;
|
||||
AddSpawnTimer = 10000;
|
||||
ShadowBoltTimer = 5000;
|
||||
FearTimer = 8000;
|
||||
ResetTimer = 900000; //On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier
|
||||
NefarianGUID = 0;
|
||||
NefCheckTime = 2000;
|
||||
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS,1);
|
||||
me->setFaction(35);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Only do this if we haven't spawned nef yet
|
||||
if (SpawnedAdds < 42)
|
||||
void BeginEvent(Player *pTarget)
|
||||
{
|
||||
//ShadowBoltTimer
|
||||
if (ShadowBoltTimer <= diff)
|
||||
DoScriptText(SAY_GAMESBEGIN_2, me);
|
||||
|
||||
//Trinity::Singleton<MapManager>::Instance().GetMap(me->GetMapId(), me)->GetPlayers().begin();
|
||||
/*
|
||||
list <Player*>::const_iterator i = sMapMgr.GetMap(me->GetMapId(), me)->GetPlayers().begin();
|
||||
|
||||
for (i = sMapMgr.GetMap(me->GetMapId(), me)->GetPlayers().begin(); i != sMapMgr.GetMap(me->GetMapId(), me)->GetPlayers().end(); ++i)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_SHADOWBOLT);
|
||||
AttackStart((*i));
|
||||
}
|
||||
*/
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS,0);
|
||||
me->setFaction(103);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
AttackStart(pTarget);
|
||||
}
|
||||
|
||||
ShadowBoltTimer = urand(3000,10000);
|
||||
} else ShadowBoltTimer -= diff;
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
}
|
||||
|
||||
//FearTimer
|
||||
if (FearTimer <= diff)
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
//We simply use this function to find players until we can use pMap->GetPlayers()
|
||||
|
||||
if (who && who->GetTypeId() == TYPEID_PLAYER && me->IsHostileTo(who))
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_FEAR);
|
||||
//Add them to our threat list
|
||||
me->AddThreat(who, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
FearTimer = 10000 + (rand()%10000);
|
||||
} else FearTimer -= diff;
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Add spawning mechanism
|
||||
if (AddSpawnTimer <= diff)
|
||||
//Only do this if we haven't spawned nef yet
|
||||
if (SpawnedAdds < 42)
|
||||
{
|
||||
//Spawn 2 random types of creatures at the 2 locations
|
||||
uint32 CreatureID;
|
||||
Creature* Spawned = NULL;
|
||||
Unit *pTarget = NULL;
|
||||
|
||||
//1 in 3 chance it will be a chromatic
|
||||
if (urand(0,2) == 0)
|
||||
CreatureID = CREATURE_CHROMATIC_DRAKANOID;
|
||||
else
|
||||
CreatureID = DrakType1;
|
||||
|
||||
++SpawnedAdds;
|
||||
|
||||
//Spawn Creature and force it to start attacking a random target
|
||||
Spawned = me->SummonCreature(CreatureID,ADD_X1,ADD_Y1,ADD_Z1,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
if (pTarget && Spawned)
|
||||
//ShadowBoltTimer
|
||||
if (ShadowBoltTimer <= diff)
|
||||
{
|
||||
Spawned->AI()->AttackStart(pTarget);
|
||||
Spawned->setFaction(103);
|
||||
}
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_SHADOWBOLT);
|
||||
|
||||
//1 in 3 chance it will be a chromatic
|
||||
if (urand(0,2) == 0)
|
||||
CreatureID = CREATURE_CHROMATIC_DRAKANOID;
|
||||
else
|
||||
CreatureID = DrakType2;
|
||||
ShadowBoltTimer = urand(3000,10000);
|
||||
} else ShadowBoltTimer -= diff;
|
||||
|
||||
++SpawnedAdds;
|
||||
|
||||
Spawned = me->SummonCreature(CreatureID,ADD_X2,ADD_Y2,ADD_Z2,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
if (pTarget && Spawned)
|
||||
//FearTimer
|
||||
if (FearTimer <= diff)
|
||||
{
|
||||
Spawned->AI()->AttackStart(pTarget);
|
||||
Spawned->setFaction(103);
|
||||
}
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_FEAR);
|
||||
|
||||
//Begin phase 2 by spawning Nefarian and what not
|
||||
if (SpawnedAdds >= 42)
|
||||
FearTimer = 10000 + (rand()%10000);
|
||||
} else FearTimer -= diff;
|
||||
|
||||
//Add spawning mechanism
|
||||
if (AddSpawnTimer <= diff)
|
||||
{
|
||||
//Teleport Victor Nefarius way out of the map
|
||||
//sMapMgr.GetMap(me->GetMapId(), me)->CreatureRelocation(me,0,0,-5000,0);
|
||||
//Spawn 2 random types of creatures at the 2 locations
|
||||
uint32 CreatureID;
|
||||
Creature* Spawned = NULL;
|
||||
Unit *pTarget = NULL;
|
||||
|
||||
//Interrupt any spell casting
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
//1 in 3 chance it will be a chromatic
|
||||
if (urand(0,2) == 0)
|
||||
CreatureID = CREATURE_CHROMATIC_DRAKANOID;
|
||||
else
|
||||
CreatureID = DrakType1;
|
||||
|
||||
//Root self
|
||||
DoCast(me, 33356);
|
||||
++SpawnedAdds;
|
||||
|
||||
//Make super invis
|
||||
DoCast(me, 8149);
|
||||
|
||||
//Teleport self to a hiding spot (this causes errors in the Trinity log but no real issues)
|
||||
DoTeleportTo(HIDE_X,HIDE_Y,HIDE_Z);
|
||||
me->addUnitState(UNIT_STAT_FLEEING);
|
||||
|
||||
//Spawn nef and have him attack a random target
|
||||
Creature* Nefarian = me->SummonCreature(CREATURE_NEFARIAN,NEF_X,NEF_Y,NEF_Z,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000);
|
||||
//Spawn Creature and force it to start attacking a random target
|
||||
Spawned = me->SummonCreature(CreatureID,ADD_X1,ADD_Y1,ADD_Z1,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
if (pTarget && Nefarian)
|
||||
if (pTarget && Spawned)
|
||||
{
|
||||
Nefarian->AI()->AttackStart(pTarget);
|
||||
Nefarian->setFaction(103);
|
||||
NefarianGUID = Nefarian->GetGUID();
|
||||
Spawned->AI()->AttackStart(pTarget);
|
||||
Spawned->setFaction(103);
|
||||
}
|
||||
else sLog.outError("TSCR: Blackwing Lair: Unable to spawn nefarian properly.");
|
||||
}
|
||||
|
||||
AddSpawnTimer = 4000;
|
||||
} else AddSpawnTimer -= diff;
|
||||
}
|
||||
else if (NefarianGUID)
|
||||
{
|
||||
if (NefCheckTime <= diff)
|
||||
//1 in 3 chance it will be a chromatic
|
||||
if (urand(0,2) == 0)
|
||||
CreatureID = CREATURE_CHROMATIC_DRAKANOID;
|
||||
else
|
||||
CreatureID = DrakType2;
|
||||
|
||||
++SpawnedAdds;
|
||||
|
||||
Spawned = me->SummonCreature(CreatureID,ADD_X2,ADD_Y2,ADD_Z2,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
if (pTarget && Spawned)
|
||||
{
|
||||
Spawned->AI()->AttackStart(pTarget);
|
||||
Spawned->setFaction(103);
|
||||
}
|
||||
|
||||
//Begin phase 2 by spawning Nefarian and what not
|
||||
if (SpawnedAdds >= 42)
|
||||
{
|
||||
//Teleport Victor Nefarius way out of the map
|
||||
//sMapMgr.GetMap(me->GetMapId(), me)->CreatureRelocation(me,0,0,-5000,0);
|
||||
|
||||
//Interrupt any spell casting
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
|
||||
//Root self
|
||||
DoCast(me, 33356);
|
||||
|
||||
//Make super invis
|
||||
DoCast(me, 8149);
|
||||
|
||||
//Teleport self to a hiding spot (this causes errors in the Trinity log but no real issues)
|
||||
DoTeleportTo(HIDE_X,HIDE_Y,HIDE_Z);
|
||||
me->addUnitState(UNIT_STAT_FLEEING);
|
||||
|
||||
//Spawn nef and have him attack a random target
|
||||
Creature* Nefarian = me->SummonCreature(CREATURE_NEFARIAN,NEF_X,NEF_Y,NEF_Z,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000);
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
if (pTarget && Nefarian)
|
||||
{
|
||||
Nefarian->AI()->AttackStart(pTarget);
|
||||
Nefarian->setFaction(103);
|
||||
NefarianGUID = Nefarian->GetGUID();
|
||||
}
|
||||
else sLog.outError("TSCR: Blackwing Lair: Unable to spawn nefarian properly.");
|
||||
}
|
||||
|
||||
AddSpawnTimer = 4000;
|
||||
} else AddSpawnTimer -= diff;
|
||||
}
|
||||
else if (NefarianGUID)
|
||||
{
|
||||
Unit* Nefarian = Unit::GetCreature((*me),NefarianGUID);
|
||||
|
||||
//If nef is dead then we die to so the players get out of combat
|
||||
//and cannot repeat the event
|
||||
if (!Nefarian || !Nefarian->isAlive())
|
||||
if (NefCheckTime <= diff)
|
||||
{
|
||||
NefarianGUID = 0;
|
||||
me->ForcedDespawn();
|
||||
}
|
||||
Unit* Nefarian = Unit::GetCreature((*me),NefarianGUID);
|
||||
|
||||
NefCheckTime = 2000;
|
||||
} else NefCheckTime -= diff;
|
||||
//If nef is dead then we die to so the players get out of combat
|
||||
//and cannot repeat the event
|
||||
if (!Nefarian || !Nefarian->isAlive())
|
||||
{
|
||||
NefarianGUID = 0;
|
||||
me->ForcedDespawn();
|
||||
}
|
||||
|
||||
NefCheckTime = 2000;
|
||||
} else NefCheckTime -= diff;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_victor_nefarius(Creature* pCreature)
|
||||
{
|
||||
return new boss_victor_nefariusAI (pCreature);
|
||||
}
|
||||
|
||||
bool GossipHello_boss_victor_nefarius(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_1 , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
pPlayer->SEND_GOSSIP_MENU(7134, pCreature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect_boss_victor_nefarius(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
|
||||
{
|
||||
switch (uiAction)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
pPlayer->SEND_GOSSIP_MENU(7198, pCreature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
|
||||
pPlayer->SEND_GOSSIP_MENU(7199, pCreature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+3:
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
DoScriptText(SAY_GAMESBEGIN_1, pCreature);
|
||||
CAST_AI(boss_victor_nefariusAI, pCreature->AI())->BeginEvent(pPlayer);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void AddSC_boss_victor_nefarius()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_victor_nefarius";
|
||||
newscript->GetAI = &GetAI_boss_victor_nefarius;
|
||||
newscript->pGossipHello = &GossipHello_boss_victor_nefarius;
|
||||
newscript->pGossipSelect = &GossipSelect_boss_victor_nefarius;
|
||||
newscript->RegisterSelf();
|
||||
new boss_victor_nefarius();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user