diff options
| author | megamage <none@none> | 2009-06-14 09:57:57 -0500 |
|---|---|---|
| committer | megamage <none@none> | 2009-06-14 09:57:57 -0500 |
| commit | e192d8f39b85ef504762bcbbd5c13a9885510f6b (patch) | |
| tree | b140f635725436e284f3522bc34c93283c175055 /src/bindings/scripts | |
| parent | c6d242c2b6478797fe19897d54308e7ed8228874 (diff) | |
*Some work on vehicle.
--HG--
branch : trunk
Diffstat (limited to 'src/bindings/scripts')
| -rw-r--r-- | src/bindings/scripts/include/sc_creature.h | 2 | ||||
| -rw-r--r-- | src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_flame_leviathan.cpp | 85 |
2 files changed, 87 insertions, 0 deletions
diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h index 6e6a16a9f13..db12a846757 100644 --- a/src/bindings/scripts/include/sc_creature.h +++ b/src/bindings/scripts/include/sc_creature.h @@ -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 diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_flame_leviathan.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_flame_leviathan.cpp index a736b2db12a..a8e2a4198f9 100644 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_flame_leviathan.cpp +++ b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_flame_leviathan.cpp @@ -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(); +} |
