| | 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 | m_creature->SetAggressive(false); |
| | 844 | } |
| | 845 | else |
| | 846 | m_creature->SetAggressive(true); |
| | 847 | } |
| | 848 | |
| | 849 | }; |
| | 850 | |
| | 851 | CreatureAI* GetAI_npc_steam_tonk(Creature *_Creature) |
| | 852 | { |
| | 853 | return new npc_steam_tonkAI(_Creature); |
| | 854 | } |
| | 855 | |
| | 856 | #define SPELL_TONK_MINE_DETONATE 25099 |
| | 857 | |
| | 858 | struct TRINITY_DLL_DECL npc_tonk_mineAI : public ScriptedAI |
| | 859 | { |
| | 860 | npc_tonk_mineAI(Creature *c) : ScriptedAI(c) |
| | 861 | { |
| | 862 | m_creature->SetAggressive(false); |
| | 863 | Reset(); |
| | 864 | } |
| | 865 | |
| | 866 | uint32 ExplosionTimer; |
| | 867 | |
| | 868 | void Reset() |
| | 869 | { |
| | 870 | ExplosionTimer = 3000; |
| | 871 | } |
| | 872 | |
| | 873 | void Aggro(Unit *who) {} |
| | 874 | void AttackStart(Unit *who) {} |
| | 875 | void MoveInLineOfSight(Unit *who) {} |
| | 876 | |
| | 877 | void UpdateAI(const uint32 diff) |
| | 878 | { |
| | 879 | if (ExplosionTimer < diff) |
| | 880 | { |
| | 881 | m_creature->CastSpell(m_creature, SPELL_TONK_MINE_DETONATE, true); |
| | 882 | m_creature->setDeathState(DEAD); // unsummon it |
| | 883 | } else |
| | 884 | ExplosionTimer -= diff; |
| | 885 | } |
| | 886 | }; |
| | 887 | |
| | 888 | CreatureAI* GetAI_npc_tonk_mine(Creature *_Creature) |
| | 889 | { |
| | 890 | return new npc_tonk_mineAI(_Creature); |
| | 891 | } |
| | 892 | |