*Some scripts of ulduar boss (far from finished)
--HG-- branch : trunk
This commit is contained in:
@@ -653,6 +653,10 @@ extern void AddSC_boss_archavon();
|
||||
extern void AddSC_boss_emalon();
|
||||
extern void AddSC_instance_archavon();
|
||||
|
||||
//Ulduar
|
||||
extern void AddSC_boss_flame_leviathan();
|
||||
extern void AddSC_boss_razorscale();
|
||||
|
||||
//Region
|
||||
extern void AddSC_wintergrasp();
|
||||
|
||||
@@ -1563,6 +1567,10 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf")
|
||||
AddSC_boss_emalon();
|
||||
AddSC_instance_archavon();
|
||||
|
||||
//Ulduar
|
||||
AddSC_boss_flame_leviathan();
|
||||
AddSC_boss_razorscale();
|
||||
|
||||
//Region
|
||||
AddSC_wintergrasp();
|
||||
|
||||
|
||||
@@ -790,7 +790,7 @@ void LoadOverridenDBCData()
|
||||
spellInfo->DurationIndex = 21;
|
||||
spellInfo->Effect[0] = SPELL_EFFECT_APPLY_AREA_AURA_ENEMY;
|
||||
break;
|
||||
// Naxxramas: Gothik : Inform Inf range
|
||||
// Naxxramas : Gothik : Inform Inf range
|
||||
case 27892:
|
||||
case 27928:
|
||||
case 27935:
|
||||
@@ -799,6 +799,12 @@ void LoadOverridenDBCData()
|
||||
case 27937:
|
||||
spellInfo->rangeIndex = 13;
|
||||
break;
|
||||
// Ulduar : Flame Leviathan : Pursued
|
||||
case 62374:
|
||||
spellInfo->MaxAffectedTargets = 1;
|
||||
spellInfo->EffectImplicitTargetB[0] = TARGET_UNIT_AREA_ENTRY_SRC;
|
||||
spellInfo->EffectImplicitTargetB[1] = TARGET_UNIT_AREA_ENTRY_SRC;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,13 @@
|
||||
|
||||
#define SPELL_SEARING_FLAME 62402
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_PURSUE = 1,
|
||||
EVENT_MISSILE,
|
||||
EVENT_VENT,
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_flame_leviathanAI : public BossAI
|
||||
{
|
||||
boss_flame_leviathanAI(Creature *c) : BossAI(c, BOSS_LEVIATHAN)
|
||||
@@ -40,9 +47,93 @@ struct TRINITY_DLL_DECL boss_flame_leviathanAI : public BossAI
|
||||
assert(c->isVehicle());
|
||||
}
|
||||
|
||||
void EnterCombat(Unit *who)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_PURSUE, 0);
|
||||
events.ScheduleEvent(EVENT_MISSILE, 1500);
|
||||
events.ScheduleEvent(EVENT_VENT, 20000);
|
||||
if(Creature *turret = CAST_CRE(CAST_VEH(me)->GetPassenger(7)))
|
||||
turret->AI()->DoZoneInCombat();
|
||||
}
|
||||
|
||||
// TODO: effect 0 and effect 1 may be on different target
|
||||
void SpellHitTarget(Unit *target, const SpellEntry *spell)
|
||||
{
|
||||
if(spell->Id == SPELL_PURSUED)
|
||||
AttackStart(target);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(!UpdateVictim())
|
||||
if(!me->isInCombat())
|
||||
return;
|
||||
|
||||
if(me->getThreatManager().isThreatListEmpty())
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if(me->hasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
uint32 eventId = events.GetEvent();
|
||||
if(!me->getVictim())
|
||||
eventId = EVENT_PURSUE;
|
||||
|
||||
switch(eventId)
|
||||
{
|
||||
case 0:
|
||||
return;
|
||||
case EVENT_PURSUE:
|
||||
DoCastAOE(SPELL_PURSUED);
|
||||
events.RepeatEvent(35000);
|
||||
return;
|
||||
case EVENT_MISSILE:
|
||||
//TODO: without unittarget no visual effect
|
||||
//DoCastAOE(SPELL_MISSILE_BARRAGE);
|
||||
DoCast(me->getVictim(), SPELL_MISSILE_BARRAGE);
|
||||
events.RepeatEvent(1500);
|
||||
return;
|
||||
case EVENT_VENT:
|
||||
DoCastAOE(SPELL_FLAME_VENTS);
|
||||
events.RepeatEvent(20000);
|
||||
return;
|
||||
default:
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
|
||||
DoSpellAttackIfReady(SPELL_BATTERING_RAM);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct TRINITY_DLL_DECL boss_flame_leviathan_turretAI : public ScriptedAI
|
||||
{
|
||||
boss_flame_leviathan_turretAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
EventMap events;
|
||||
|
||||
void EnterCombat(Unit *who)
|
||||
{
|
||||
events.ScheduleEvent(1, 5000);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(!UpdateCombatState())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
@@ -50,7 +141,19 @@ struct TRINITY_DLL_DECL boss_flame_leviathanAI : public BossAI
|
||||
if(me->hasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
if(uint32 eventId = events.GetEvent())
|
||||
{
|
||||
switch(eventId)
|
||||
{
|
||||
case 1:
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM), SPELL_CANNON);
|
||||
events.RepeatEvent(10000);
|
||||
return;
|
||||
default:
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -60,12 +163,55 @@ struct TRINITY_DLL_DECL boss_flame_leviathan_seatAI : public ScriptedAI
|
||||
boss_flame_leviathan_seatAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
assert(c->isVehicle());
|
||||
if(const CreatureInfo *cInfo = me->GetCreatureInfo())
|
||||
me->SetDisplayId(cInfo->DisplayID_A[0]); // 0 invisible, 1 visible
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if(const CreatureInfo *cInfo = me->GetCreatureInfo())
|
||||
me->SetDisplayId(cInfo->DisplayID_H[1]); // A for gm, H1 invisible
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit *who) // for test
|
||||
{
|
||||
if(who->GetTypeId() == TYPEID_PLAYER && !who->m_Vehicle
|
||||
&& !CAST_VEH(me)->GetPassenger(0) && CAST_VEH(me)->GetPassenger(2))
|
||||
who->EnterVehicle(CAST_VEH(me), 0);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(!CAST_VEH(me)->GetPassenger(2))
|
||||
if(Unit *who = CAST_VEH(me)->GetPassenger(0))
|
||||
who->ExitVehicle();
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_flame_leviathan_defense_turretAI : public ScriptedAI
|
||||
{
|
||||
boss_flame_leviathan_defense_turretAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
}
|
||||
|
||||
void DamageTaken(Unit *who, uint32 &damage)
|
||||
{
|
||||
if(!who->m_Vehicle || who->m_Vehicle->GetEntry() != 33114)
|
||||
damage = 0;
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if(me->getVictim())
|
||||
return;
|
||||
|
||||
if(who->GetTypeId() != TYPEID_PLAYER || !who->m_Vehicle || who->m_Vehicle->GetEntry() != 33114)
|
||||
return;
|
||||
|
||||
AttackStart(who);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
@@ -76,7 +222,30 @@ struct TRINITY_DLL_DECL boss_flame_leviathan_seatAI : public ScriptedAI
|
||||
if(me->hasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
DoCast(me->getVictim(), SPELL_SEARING_FLAME);
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_flame_leviathan_overload_deviceAI : public ScriptedAI
|
||||
{
|
||||
boss_flame_leviathan_overload_deviceAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
if(const CreatureInfo *cInfo = me->GetCreatureInfo())
|
||||
me->SetDisplayId(cInfo->DisplayID_H[0]); // A0 gm, H0 device
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
}
|
||||
|
||||
void DamageTaken(Unit *who, uint32 &damage)
|
||||
{
|
||||
if(damage >= me->GetHealth())
|
||||
{
|
||||
damage = 0;
|
||||
if(!me->hasUnitState(UNIT_STAT_CASTING))
|
||||
DoCastAOE(SPELL_OVERLOAD_CIRCUIT);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -85,11 +254,26 @@ CreatureAI* GetAI_boss_flame_leviathan(Creature *_Creature)
|
||||
return new boss_flame_leviathanAI (_Creature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_boss_flame_leviathan_turret(Creature *_Creature)
|
||||
{
|
||||
return new boss_flame_leviathan_turretAI (_Creature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_boss_flame_leviathan_seat(Creature *_Creature)
|
||||
{
|
||||
return new boss_flame_leviathan_seatAI (_Creature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_boss_flame_leviathan_defense_turret(Creature *_Creature)
|
||||
{
|
||||
return new boss_flame_leviathan_defense_turretAI (_Creature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_boss_flame_leviathan_overload_device(Creature *_Creature)
|
||||
{
|
||||
return new boss_flame_leviathan_overload_deviceAI (_Creature);
|
||||
}
|
||||
|
||||
void AddSC_boss_flame_leviathan()
|
||||
{
|
||||
Script *newscript;
|
||||
@@ -98,8 +282,23 @@ void AddSC_boss_flame_leviathan()
|
||||
newscript->GetAI = &GetAI_boss_flame_leviathan;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="boss_flame_leviathan_turret";
|
||||
newscript->GetAI = &GetAI_boss_flame_leviathan_turret;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="boss_flame_leviathan_seat";
|
||||
newscript->GetAI = &GetAI_boss_flame_leviathan_seat;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="boss_flame_leviathan_defense_turret";
|
||||
newscript->GetAI = &GetAI_boss_flame_leviathan_defense_turret;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="boss_flame_leviathan_overload_device";
|
||||
newscript->GetAI = &GetAI_boss_flame_leviathan_overload_device;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user