mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
*Changes in Grandmaster Vorpil - by Iskander
*Target limitation for spell 39835 --HG-- branch : trunk
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -36,22 +36,20 @@ EndScriptData */
|
||||
#define SPELL_RAIN_OF_FIRE 33617
|
||||
#define H_SPELL_RAIN_OF_FIRE 39363
|
||||
|
||||
#define SPELL_DRAWN_SHADOWS 33563
|
||||
#define SPELL_DRAW_SHADOWS 33563
|
||||
#define SPELL_SHADOWBOLT_VOLLEY 33841
|
||||
#define SPELL_BANISH 38791
|
||||
|
||||
#define MOB_VOID_TRAVELER 19226
|
||||
#define SPELL_SACRIFICE 33587
|
||||
#define SPELL_SHADOW_NOVA 33846
|
||||
#define SPELL_HEALVORPIL 33783
|
||||
#define H_SPELL_HEALVORPIL 39364
|
||||
#define SPELL_EMPOWERING_SHADOWS 33783
|
||||
#define H_SPELL_EMPOWERING_SHADOWS 39364
|
||||
|
||||
#define MOB_VOID_PORTAL 19224
|
||||
#define SPELL_VOID_PORTAL_VISUAL 33569
|
||||
|
||||
float VorpilPosition[1][3] =
|
||||
{
|
||||
{-252.8820,-264.3030,17.1}
|
||||
};
|
||||
float VorpilPosition[3] = {-252.8820,-264.3030,17.1};
|
||||
|
||||
float VoidPortalCoords[5][3] =
|
||||
{
|
||||
@@ -62,76 +60,154 @@ float VoidPortalCoords[5][3] =
|
||||
{-261.4533, -297.3298, 17.1}
|
||||
};
|
||||
|
||||
class EmpoweringShadowsAura: public Aura
|
||||
{
|
||||
public:
|
||||
EmpoweringShadowsAura(SpellEntry *spell, uint32 eff, int32 *bp, Unit *target, Unit *caster) : Aura(spell, eff, bp, target, caster, NULL) {}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_voidtravelerAI : public ScriptedAI
|
||||
{
|
||||
mob_voidtravelerAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
HeroicMode = m_creature->GetMap()->IsHeroic();
|
||||
Reset();
|
||||
}
|
||||
|
||||
bool HeroicMode;
|
||||
Unit *Vorpil;
|
||||
uint32 move;
|
||||
bool sacrificed;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Vorpil = NULL;
|
||||
move = 0;
|
||||
sacrificed = false;
|
||||
}
|
||||
|
||||
void Aggro(Unit *who){}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(!Vorpil)
|
||||
{
|
||||
m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
return;
|
||||
}
|
||||
if(move < diff)
|
||||
{
|
||||
if(sacrificed)
|
||||
{
|
||||
SpellEntry *spell = (SpellEntry *)GetSpellStore()->LookupEntry(HeroicMode?H_SPELL_EMPOWERING_SHADOWS:SPELL_EMPOWERING_SHADOWS);
|
||||
if( spell )
|
||||
Vorpil->AddAura(new EmpoweringShadowsAura(spell, 0, NULL, Vorpil, m_creature));
|
||||
Vorpil->SetHealth(Vorpil->GetHealth()+Vorpil->GetMaxHealth()/25);
|
||||
DoCast(m_creature, SPELL_SHADOW_NOVA, true);
|
||||
m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
return;
|
||||
}
|
||||
m_creature->GetMotionMaster()->MoveFollow(Vorpil,0,0);
|
||||
if(m_creature->GetDistance(Vorpil) < 3)
|
||||
{
|
||||
DoCast(m_creature, SPELL_SACRIFICE, false);
|
||||
sacrificed = true;
|
||||
move = 500;
|
||||
return;
|
||||
}
|
||||
if(!Vorpil->isInCombat() || Vorpil->isDead())
|
||||
{
|
||||
m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
return;
|
||||
}
|
||||
move = 1000;
|
||||
}else move -= diff;
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_mob_voidtraveler(Creature *_Creature)
|
||||
{
|
||||
return new mob_voidtravelerAI (_Creature);
|
||||
}
|
||||
|
||||
struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI
|
||||
{
|
||||
boss_grandmaster_vorpilAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = ((ScriptedInstance*)c->GetInstanceData());
|
||||
HeroicMode = m_creature->GetMap()->IsHeroic();
|
||||
Intro = false;
|
||||
Reset();
|
||||
}
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
bool Intro;
|
||||
bool Intro, HelpYell;
|
||||
bool sumportals;
|
||||
bool HeroicMode;
|
||||
|
||||
uint32 ShadowBoltVolley_Timer;
|
||||
uint32 DrawnShadows_Timer;
|
||||
uint32 sumportals_Timer;
|
||||
uint32 DrawShadows_Timer;
|
||||
uint32 summonTraveler_Timer;
|
||||
uint64 PortalsGuid[5];
|
||||
uint32 banish_Timer;
|
||||
uint64 PortalsGuid[5];
|
||||
|
||||
void Reset()
|
||||
{
|
||||
ShadowBoltVolley_Timer = 15000;
|
||||
DrawShadows_Timer = 45000;
|
||||
summonTraveler_Timer = 90000;
|
||||
banish_Timer = 17000;
|
||||
HelpYell = false;
|
||||
destroyPortals();
|
||||
if(pInstance)
|
||||
pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void summonPortals()
|
||||
{
|
||||
for (int i = 0;i<5;i++)
|
||||
if(!sumportals)
|
||||
{
|
||||
Creature *Portal = NULL;
|
||||
Portal = m_creature->SummonCreature(MOB_VOID_PORTAL,VoidPortalCoords[i][0],VoidPortalCoords[i][1],VoidPortalCoords[i][2],0,TEMPSUMMON_CORPSE_DESPAWN,3000000);
|
||||
PortalsGuid[i] = Portal->GetGUID();
|
||||
Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false);
|
||||
for (int i = 0;i<5;i++)
|
||||
{
|
||||
Creature *Portal = NULL;
|
||||
Portal = m_creature->SummonCreature(MOB_VOID_PORTAL,VoidPortalCoords[i][0],VoidPortalCoords[i][1],VoidPortalCoords[i][2],0,TEMPSUMMON_CORPSE_DESPAWN,3000000);
|
||||
PortalsGuid[i] = Portal->GetGUID();
|
||||
Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false);
|
||||
}
|
||||
sumportals = true;
|
||||
summonTraveler_Timer = 5000;
|
||||
}
|
||||
sumportals = true;
|
||||
summonTraveler_Timer = 5000;
|
||||
}
|
||||
|
||||
void destroyPortals()
|
||||
{
|
||||
for (int i = 0;i < 5; i ++)
|
||||
if(sumportals)
|
||||
{
|
||||
Unit *Portal = Unit::GetUnit((*m_creature), PortalsGuid[i]);
|
||||
if (Portal)
|
||||
if (Portal->isAlive())
|
||||
for (int i = 0;i < 5; i ++)
|
||||
{
|
||||
Unit *Portal = Unit::GetUnit((*m_creature), PortalsGuid[i]);
|
||||
if (Portal && Portal->isAlive())
|
||||
Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
PortalsGuid[i] = 0;
|
||||
}
|
||||
PortalsGuid[i] = 0;
|
||||
}
|
||||
sumportals = false;
|
||||
}
|
||||
}
|
||||
|
||||
void spawnVoidTraveler()
|
||||
{
|
||||
srand( (unsigned) time(NULL) ) ;
|
||||
int pos = rand()%5;
|
||||
Creature *traveler;
|
||||
traveler = m_creature->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000);
|
||||
m_creature->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,5000);
|
||||
if(!HelpYell)
|
||||
{
|
||||
DoScriptText(SAY_HELP, m_creature);
|
||||
HelpYell = true;
|
||||
}
|
||||
}
|
||||
|
||||
void Reset()
|
||||
void JustSummoned(Creature *summoned)
|
||||
{
|
||||
HeroicMode = m_creature->GetMap()->IsHeroic();
|
||||
if( HeroicMode )
|
||||
debug_log("SD2: creature %u is in heroic mode",m_creature->GetEntry());
|
||||
|
||||
ShadowBoltVolley_Timer = 15000;
|
||||
DrawnShadows_Timer = 45000;
|
||||
sumportals_Timer = 10000;
|
||||
summonTraveler_Timer = 90000;
|
||||
|
||||
InCombat = false;
|
||||
sumportals = false;
|
||||
destroyPortals();
|
||||
|
||||
if(pInstance)
|
||||
pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED);
|
||||
if (summoned && summoned->GetEntry() == MOB_VOID_TRAVELER)
|
||||
((mob_voidtravelerAI*)summoned->AI())->Vorpil = m_creature;
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
@@ -151,7 +227,7 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI
|
||||
pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE);
|
||||
}
|
||||
|
||||
void StartEvent()
|
||||
void Aggro(Unit *who)
|
||||
{
|
||||
switch(rand()%3)
|
||||
{
|
||||
@@ -159,55 +235,27 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI
|
||||
case 1: DoScriptText(SAY_AGGRO2, m_creature); break;
|
||||
case 2: DoScriptText(SAY_AGGRO3, m_creature); break;
|
||||
}
|
||||
|
||||
summonPortals();
|
||||
if(pInstance)
|
||||
pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void Aggro(Unit *who)
|
||||
{
|
||||
if(!InCombat)
|
||||
{
|
||||
InCombat = true;
|
||||
StartEvent();
|
||||
}
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if (!who || m_creature->getVictim())
|
||||
return;
|
||||
|
||||
if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
{
|
||||
float attackRadius = m_creature->GetAttackDistance(who);
|
||||
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
|
||||
{
|
||||
AttackStart(who);
|
||||
}
|
||||
}
|
||||
else if (!Intro && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 100) ) //not sure about right radius
|
||||
if(who && !m_creature->getVictim() && m_creature->canStartAttack(who))
|
||||
AttackStart(who);
|
||||
if (!Intro && who && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 100) && m_creature->IsHostileTo(who))
|
||||
{
|
||||
DoScriptText(SAY_INTRO, m_creature);
|
||||
Intro = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
|
||||
if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
|
||||
return;
|
||||
|
||||
if (!sumportals)
|
||||
if (sumportals_Timer < diff)
|
||||
{
|
||||
DoScriptText(SAY_HELP, m_creature);
|
||||
summonPortals();
|
||||
sumportals_Timer = 1000000;
|
||||
|
||||
}else sumportals_Timer -= diff;
|
||||
|
||||
if (ShadowBoltVolley_Timer < diff)
|
||||
{
|
||||
@@ -215,23 +263,41 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI
|
||||
ShadowBoltVolley_Timer = 15000;
|
||||
}else ShadowBoltVolley_Timer -= diff;
|
||||
|
||||
if ( DrawnShadows_Timer < diff)
|
||||
if (HeroicMode && banish_Timer < diff)
|
||||
{
|
||||
DoTeleportAll(VorpilPosition[0][0],VorpilPosition[0][1],VorpilPosition[0][2],0);
|
||||
m_creature->Relocate(VorpilPosition[0][0],VorpilPosition[0][1],VorpilPosition[0][2],0);
|
||||
DoCast(m_creature,SPELL_DRAWN_SHADOWS,true);
|
||||
Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0,30,false);
|
||||
if (target)
|
||||
{
|
||||
DoCast(target,SPELL_BANISH);
|
||||
banish_Timer = 16000;
|
||||
}
|
||||
}else banish_Timer -= diff;
|
||||
|
||||
if(!HeroicMode) DoCast(m_creature,SPELL_RAIN_OF_FIRE);
|
||||
else DoCast(m_creature,H_SPELL_RAIN_OF_FIRE);
|
||||
if ( DrawShadows_Timer < diff)
|
||||
{
|
||||
Map *map = m_creature->GetMap();
|
||||
Map::PlayerList const &PlayerList = map->GetPlayers();
|
||||
for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* i_pl = i->getSource())
|
||||
if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH,0))
|
||||
i_pl->TeleportTo(m_creature->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT);
|
||||
|
||||
m_creature->Relocate(VorpilPosition[0],VorpilPosition[1],VorpilPosition[2]);
|
||||
DoCast(m_creature,SPELL_DRAW_SHADOWS,true);
|
||||
|
||||
DoCast(m_creature,HeroicMode?H_SPELL_RAIN_OF_FIRE:SPELL_RAIN_OF_FIRE);
|
||||
|
||||
ShadowBoltVolley_Timer = 6000;
|
||||
DrawnShadows_Timer = 45000;
|
||||
}else DrawnShadows_Timer -= diff;
|
||||
DrawShadows_Timer = 30000;
|
||||
}else DrawShadows_Timer -= diff;
|
||||
|
||||
if ( summonTraveler_Timer < diff)
|
||||
{
|
||||
spawnVoidTraveler();
|
||||
summonTraveler_Timer = 10000;
|
||||
//enrage at 20%
|
||||
if((m_creature->GetHealth()*5) < m_creature->GetMaxHealth())
|
||||
summonTraveler_Timer = 5000;
|
||||
}else summonTraveler_Timer -=diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -242,118 +308,6 @@ CreatureAI* GetAI_boss_grandmaster_vorpil(Creature *_Creature)
|
||||
return new boss_grandmaster_vorpilAI (_Creature);
|
||||
}
|
||||
|
||||
struct TRINITY_DLL_DECL mob_voidtravelerAI : public ScriptedAI
|
||||
{
|
||||
mob_voidtravelerAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = ((ScriptedInstance*)c->GetInstanceData());
|
||||
Reset();
|
||||
}
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
uint32 VorpilCheck_Timer;
|
||||
uint32 eventCheck_Timer;
|
||||
bool sacrifice;
|
||||
bool sacrificed;
|
||||
bool oneTarget;
|
||||
bool HeroicMode;
|
||||
|
||||
uint32 target_timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
HeroicMode = m_creature->GetMap()->IsHeroic();
|
||||
if( HeroicMode )
|
||||
debug_log("SD2: creature %u is in heroic mode",m_creature->GetEntry());
|
||||
|
||||
VorpilCheck_Timer = 5000;
|
||||
eventCheck_Timer = 1000;
|
||||
target_timer = 2000;
|
||||
oneTarget = false;
|
||||
sacrificed = false;
|
||||
sacrifice = false;
|
||||
}
|
||||
void EnterEvadeMode(){}
|
||||
void Aggro(Unit *who) {}
|
||||
void AttackStart(Unit *who){}
|
||||
void MoveInLineOfSight(Unit *who){}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (eventCheck_Timer < diff)
|
||||
{
|
||||
if(pInstance)
|
||||
{
|
||||
Unit *Vorpil = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_GRANDMASTERVORPIL));
|
||||
if (Vorpil)
|
||||
{
|
||||
if (Vorpil->isDead())
|
||||
{
|
||||
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
}
|
||||
|
||||
if (Vorpil->getVictim())
|
||||
{
|
||||
if((*m_creature).GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
|
||||
(*m_creature).GetMotionMaster()->MoveFollow(Vorpil,1,0);
|
||||
}
|
||||
}
|
||||
if(pInstance->GetData(DATA_GRANDMASTERVORPILEVENT) != IN_PROGRESS)
|
||||
{
|
||||
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
}
|
||||
}
|
||||
eventCheck_Timer = 5000;
|
||||
}else eventCheck_Timer -=diff;
|
||||
|
||||
if (VorpilCheck_Timer < diff)
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
if (!sacrificed)
|
||||
{
|
||||
if (!sacrifice)
|
||||
{
|
||||
Unit *Vorpil = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_GRANDMASTERVORPIL));
|
||||
if (Vorpil)
|
||||
if (Vorpil->isAlive())
|
||||
{
|
||||
if (m_creature->IsWithinDistInMap(Vorpil, 2))
|
||||
{
|
||||
sacrifice = true;
|
||||
DoCast(m_creature,SPELL_SACRIFICE);
|
||||
VorpilCheck_Timer = 2000;
|
||||
}
|
||||
}
|
||||
|
||||
if (!sacrifice)
|
||||
VorpilCheck_Timer = 3000;
|
||||
}
|
||||
else
|
||||
{
|
||||
Unit *Vorpil = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_GRANDMASTERVORPIL));
|
||||
if (Vorpil)
|
||||
if (Vorpil->isAlive())
|
||||
{
|
||||
if(!HeroicMode) Vorpil->CastSpell(Vorpil,SPELL_HEALVORPIL,true);
|
||||
else Vorpil->CastSpell(Vorpil,H_SPELL_HEALVORPIL,true);
|
||||
};
|
||||
DoCast(m_creature,SPELL_SHADOW_NOVA);
|
||||
sacrificed = true;
|
||||
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
VorpilCheck_Timer = 100000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}else VorpilCheck_Timer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_voidtraveler(Creature *_Creature)
|
||||
{
|
||||
return new mob_voidtravelerAI (_Creature);
|
||||
}
|
||||
|
||||
void AddSC_boss_grandmaster_vorpil()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
@@ -2159,6 +2159,7 @@ void SpellMgr::LoadSpellCustomAttr()
|
||||
case 37790: //Spread Shot
|
||||
case 46771: //Flame Sear
|
||||
case 45248: //Shadow Blades
|
||||
case 39835: //Needle Spine
|
||||
spellInfo->MaxAffectedTargets = 3;
|
||||
break;
|
||||
case 38310: //Multi-Shot
|
||||
|
||||
Reference in New Issue
Block a user