Show
Ignore:
Timestamp:
11/22/08 01:55:16 (17 years ago)
Author:
yumileroy
Message:

*Alterac Valley. By Bogie and Balrok. Note: some core contents are modified. Will fix them later. Some sql are disabled because of possible conflict with offical DB. Use them at your own risk.

Original author: megamage
Date: 2008-11-21 19:45:49-06:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/bindings/scripts/scripts/npc/npcs_special.cpp

    r282 r283  
    826826} 
    827827 
    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  
    893828void AddSC_npcs_special() 
    894829{ 
     
    941876    newscript->pGossipSelect = &GossipSelect_npc_sayge; 
    942877    newscript->RegisterSelf(); 
    943  
    944     newscript = new Script; 
    945     newscript->Name="npc_steam_tonk"; 
    946     newscript->GetAI = &GetAI_npc_steam_tonk; 
    947     newscript->RegisterSelf(); 
    948  
    949     newscript = new Script; 
    950     newscript->Name="npc_tonk_mine"; 
    951     newscript->GetAI = &GetAI_npc_tonk_mine; 
    952     newscript->RegisterSelf(); 
    953 } 
     878}