*Some work on vehicle.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-06-14 09:57:57 -05:00
parent c6d242c2b6
commit e192d8f39b
11 changed files with 160 additions and 12 deletions
@@ -17,10 +17,12 @@
#ifdef USE_DYNAMIC_CAST
#define CAST_PLR(a) (dynamic_cast<Player*>(a))
#define CAST_CRE(a) (dynamic_cast<Creature*>(a))
#define CAST_VEH(a) (dynamic_cast<Vehicle*>(a))
#define CAST_AI(a,b) (dynamic_cast<a*>(b))
#else
#define CAST_PLR(a) (static_cast<Player*>(a))
#define CAST_CRE(a) (static_cast<Creature*>(a))
#define CAST_VEH(a) (static_cast<Vehicle*>(a))
#define CAST_AI(a,b) (static_cast<a*>(b))
#endif
@@ -18,3 +18,88 @@
#include "precompiled.h"
#include "def_ulduar.h"
#include "vehicle.h"
#define SPELL_PURSUED 62374
#define SPELL_GATHERING_SPEED 62375
#define SPELL_BATTERING_RAM 62376
#define SPELL_FLAME_VENTS 62396
#define SPELL_MISSILE_BARRAGE 62400
#define SPELL_SYSTEMS_SHUTDOWN 62475
#define SPELL_CANNON 62397
#define SPELL_OVERLOAD_CIRCUIT 62399
#define SPELL_SEARING_FLAME 62402
struct TRINITY_DLL_DECL boss_flame_leviathanAI : public BossAI
{
boss_flame_leviathanAI(Creature *c) : BossAI(c, BOSS_LEVIATHAN)
{
assert(c->isVehicle());
}
void UpdateAI(const uint32 diff)
{
if(!UpdateVictim())
return;
events.Update(diff);
if(me->hasUnitState(UNIT_STAT_CASTING))
return;
DoMeleeAttackIfReady();
}
};
struct TRINITY_DLL_DECL boss_flame_leviathan_seatAI : public ScriptedAI
{
boss_flame_leviathan_seatAI(Creature *c) : ScriptedAI(c)
{
assert(c->isVehicle());
}
void Reset()
{
if(const CreatureInfo *cInfo = me->GetCreatureInfo())
me->SetDisplayId(cInfo->DisplayID_H2); // A for gm, H1 invisible
}
void UpdateAI(const uint32 diff)
{
if(!UpdateVictim())
return;
if(me->hasUnitState(UNIT_STAT_CASTING))
return;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_flame_leviathan(Creature *_Creature)
{
return new boss_flame_leviathanAI (_Creature);
}
CreatureAI* GetAI_boss_flame_leviathan_seat(Creature *_Creature)
{
return new boss_flame_leviathan_seatAI (_Creature);
}
void AddSC_boss_flame_leviathan()
{
Script *newscript;
newscript = new Script;
newscript->Name="boss_flame_leviathan";
newscript->GetAI = &GetAI_boss_flame_leviathan;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="boss_flame_leviathan_seat";
newscript->GetAI = &GetAI_boss_flame_leviathan_seat;
newscript->RegisterSelf();
}