| 828 | struct TRINITY_DLL_DECL npc_steam_tonkAI : public ScriptedAI |
| 829 | { |
| 830 | npc_steam_tonkAI(Creature *c) : ScriptedAI(c) {Reset();} |
| 831 | |
| 832 | void Reset() {} |
| 833 | void Aggro(Unit *who) {} |
| 834 | |
| 835 | void OnPossess(bool apply) |
| 836 | { |
| 837 | if (apply) |
| 838 | { |
| 839 | // Initialize the action bar without the melee attack command |
| 840 | m_creature->InitCharmInfo(m_creature); |
| 841 | m_creature->GetCharmInfo()->InitEmptyActionBar(false); |
| 842 | } |
| 843 | } |
| 844 | |
| 845 | }; |
| 846 | |
| 847 | CreatureAI* GetAI_npc_steam_tonk(Creature *_Creature) |
| 848 | { |
| 849 | return new npc_steam_tonkAI(_Creature); |
| 850 | } |
| 851 | |
| 852 | #define SPELL_TONK_MINE_DETONATE 25099 |
| 853 | |
| 854 | struct TRINITY_DLL_DECL npc_tonk_mineAI : public ScriptedAI |
| 855 | { |
| 856 | npc_tonk_mineAI(Creature *c) : ScriptedAI(c) {Reset();} |
| 857 | |
| 858 | uint32 ExplosionTimer; |
| 859 | |
| 860 | void Reset() |
| 861 | { |
| 862 | ExplosionTimer = 3000; |
| 863 | } |
| 864 | |
| 865 | void Aggro(Unit *who) {} |
| 866 | void AttackStart(Unit *who) {} |
| 867 | void MoveInLineOfSight(Unit *who) {} |
| 868 | |
| 869 | void UpdateAI(const uint32 diff) |
| 870 | { |
| 871 | if (ExplosionTimer < diff) |
| 872 | { |
| 873 | m_creature->CastSpell(m_creature, SPELL_TONK_MINE_DETONATE, true); |
| 874 | m_creature->setDeathState(DEAD); // unsummon it |
| 875 | } else |
| 876 | ExplosionTimer -= diff; |
| 877 | } |
| 878 | }; |
| 879 | |
| 880 | CreatureAI* GetAI_npc_tonk_mine(Creature *_Creature) |
| 881 | { |
| 882 | return new npc_tonk_mineAI(_Creature); |
| 883 | } |
| 884 | |