Changeset 160

Show
Ignore:
Timestamp:
11/19/08 13:41:50 (17 years ago)
Author:
yumileroy
Message:

[svn] Update black temple boss 1, 2 script.

Original author: megamage
Date: 2008-11-03 20:44:32-06:00

Location:
trunk
Files:
1 added
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/sql/updates/146_world.sql

    r138 r160  
    1414VALUES 
    1515   (44008, 45265, 1, 'Static Disruption Visual'); 
    16  
    17 INSERT INTO spell_linked_spell 
    18    (`spell_trigger`, `spell_effect`, `type`, `comment`) 
    19 VALUES 
    20    (42052, 40118, 0, 'Volcanic Geyser Visual'); 
    21  
    22 INSERT INTO spell_linked_spell 
    23    (`spell_trigger`, `spell_effect`, `type`, `comment`) 
    24 VALUES 
    25    (-41914, 41915, 0, 'Summon Parasitic Shadowfiend\r\n'); 
    26  
    27 INSERT INTO spell_linked_spell 
    28    (`spell_trigger`, `spell_effect`, `type`, `comment`) 
    29 VALUES 
    30    (46021, 44852, 1, 'Spectral Realm Aura'); 
    31  
    32 INSERT INTO spell_linked_spell 
    33    (`spell_trigger`, `spell_effect`, `type`, `comment`) 
    34 VALUES 
    35    (-46021, 44867, 0, 'Spectral Exhaustion'); 
    3616 
    3717INSERT INTO spell_linked_spell 
  • trunk/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp

    r158 r160  
    2626 
    2727//Spells 
     28#define SPELL_MOLTEN_PUNCH          40126 
    2829#define SPELL_HURTFUL_STRIKE        41926 
    29 #define SPELL_DEMON_FIRE            40029 
    3030#define SPELL_MOLTEN_FLAME          40253 
    31 #define SPELL_VOLCANIC_ERUPTION     40276 
    32 #define SPELL_VOLCANIC_FIREBALL     40118 
    33 #define SPELL_VOLCANIC_GEYSER       42055 
    34 #define SPELL_MOLTEN_PUNCH          40126 
     31#define SPELL_VOLCANIC_ERUPTION     40117 
     32#define SPELL_VOLCANIC_SUMMON       40276 
    3533#define SPELL_BERSERK               45078 
    3634 
     
    4240    molten_flameAI(Creature *c) : ScriptedAI(c) 
    4341    { 
    44         Reset(); 
    45     } 
    46  
    47     uint64 SupremusGUID; 
    48     bool TargetLocked; 
    49     uint32 CheckTimer; 
    50  
    51     void Reset() 
    52     { 
    53         SupremusGUID = 0; 
    54         TargetLocked = false; 
    55  
    56         CheckTimer = 1000; 
    57     } 
    58  
     42        FlameTimer = 0; 
     43        float x, y, z; 
     44        m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); 
     45        m_creature->GetNearPoint(m_creature, x, y, z, 1, 50, M_PI*2*rand_norm()); 
     46        m_creature->GetMotionMaster()->MovePoint(0, x, y, z); 
     47    } 
     48 
     49    uint32 FlameTimer; 
     50 
     51    void Reset() {} 
    5952    void Aggro(Unit *who) {} 
    6053    void AttackStart(Unit* who) {} 
    61     void MoveInLineOfSight(Unit *who) 
    62     { 
    63         if(TargetLocked) 
    64             return;                                         // stop it from aggroing players who move in LOS if we have a target. 
    65         if(who && (who != m_creature) && (m_creature->IsWithinDistInMap(who, 10))) 
    66             StalkTarget(who); 
    67     } 
    68  
    69     void SetSupremusGUID(uint64 GUID) { SupremusGUID = GUID; } 
    70  
    71     void StalkTarget(Unit* target) 
    72     { 
    73         if(!target) return; 
    74  
    75         m_creature->AddThreat(target, 50000000.0f); 
    76         m_creature->GetMotionMaster()->MoveChase(target); 
    77         DoCast(m_creature, SPELL_DEMON_FIRE, true); 
    78         // DoCast(m_creature, SPELL_MOLTEN_FLAME, true); // This spell damages self, so disabled for now 
    79         TargetLocked = true; 
    80     } 
    81  
     54    void MoveInLineOfSight(Unit *who) {} 
    8255    void UpdateAI(const uint32 diff) 
    8356    { 
    84         if (!m_creature->SelectHostilTarget()) 
    85             return; 
    86  
    87         if(m_creature->getVictim() && m_creature->isAlive()) 
    88         { 
    89             if(CheckTimer < diff) 
    90             { 
    91                 if(SupremusGUID) 
    92                 { 
    93                     Unit* Supremus = NULL; 
    94                     Supremus = Unit::GetUnit((*m_creature), SupremusGUID); 
    95                     if(Supremus && (!Supremus->isAlive())) 
    96                         m_creature->DealDamage(m_creature, m_creature->GetHealth(), 0, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); 
    97                 } 
    98                 CheckTimer = 2000; 
    99             }else CheckTimer -= diff; 
    100         } 
     57        if(FlameTimer < diff) 
     58        { 
     59            m_creature->CastSpell(m_creature, SPELL_MOLTEN_FLAME, true); 
     60            FlameTimer = 1000; 
     61        }else FlameTimer -= diff; 
    10162    } 
    10263}; 
     
    10465struct TRINITY_DLL_DECL npc_volcanoAI : public ScriptedAI 
    10566{ 
    106     npc_volcanoAI(Creature *c) : ScriptedAI(c) {Reset();} 
    107  
    108     uint32 CheckTimer; 
    109     uint64 SupremusGUID; 
    110     uint32 FireballTimer; 
    111     uint32 GeyserTimer; 
    112  
    113     void Reset() 
    114     { 
    115         CheckTimer = 1000; 
    116         SupremusGUID = 0; 
    117         FireballTimer = 500; 
    118         GeyserTimer = 0; 
     67    npc_volcanoAI(Creature *c) : ScriptedAI(c) 
     68    { 
     69        m_creature->CastSpell(m_creature, SPELL_VOLCANIC_ERUPTION, false); 
    11970        m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); 
    12071        m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); 
    12172    } 
    12273 
     74    void Reset() {} 
    12375    void Aggro(Unit *who) {} 
    12476    void AttackStart(Unit* who) {} 
    12577    void MoveInLineOfSight(Unit* who) {} 
    126  
    127     void UpdateAI(const uint32 diff) 
    128     { 
    129         if(GeyserTimer < diff) 
    130         { 
    131             DoCast(m_creature, SPELL_VOLCANIC_GEYSER); 
    132             GeyserTimer = 18000; 
    133         }else GeyserTimer -= diff; 
    134  
    135         if(FireballTimer < diff) 
    136         { 
    137             DoCast(m_creature, SPELL_VOLCANIC_FIREBALL, true); 
    138             FireballTimer = 1000; 
    139         }else FireballTimer -= diff; 
    140     } 
     78    void UpdateAI(const uint32 diff) {} 
    14179}; 
    14280 
    14381struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI 
    14482{ 
    145     boss_supremusAI(Creature *c) : ScriptedAI(c) 
     83    boss_supremusAI(Creature *c) : ScriptedAI(c), summons(m_creature) 
    14684    { 
    14785        pInstance = ((ScriptedInstance*)c->GetInstanceData()); 
     
    16098    bool Phase1; 
    16199 
     100    SummonList summons; 
     101 
    162102    void Reset() 
    163103    { 
     
    180120 
    181121        Phase1 = true; 
     122        summons.DespawnAll(); 
    182123    } 
    183124 
     
    206147            ToggleDoors(false); 
    207148        } 
    208     } 
    209  
    210     float CalculateRandomCoord(float initial) 
    211     { 
    212         float coord = 0; 
    213  
    214         switch(rand()%2) 
    215         { 
    216             case 0: coord = initial + 20 + rand()%20; break; 
    217             case 1: coord = initial - 20 - rand()%20; break; 
    218         } 
    219  
    220         return coord; 
    221     } 
    222  
    223     Creature* SummonCreature(uint32 entry, Unit* target) 
    224     { 
    225         if(target && entry) 
    226         { 
    227             Creature* Summon = m_creature->SummonCreature(entry, CalculateRandomCoord(target->GetPositionX()), CalculateRandomCoord(target->GetPositionY()), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 20000); 
    228             if(Summon) 
    229             { 
    230                 Summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); 
    231                 Summon->setFaction(m_creature->getFaction()); 
    232                 return Summon; 
    233             } 
    234         } 
    235         return NULL; 
    236     } 
     149        summons.DespawnAll(); 
     150    } 
     151 
     152    void JustSummoned(Creature *summon) {summons.Summon(summon);} 
     153    void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} 
    237154 
    238155    Unit* CalculateHurtfulStrikeTarget() 
     
    271188        if(SummonFlameTimer < diff) 
    272189        { 
    273             Unit* target = NULL; 
    274             target = SelectUnit(SELECT_TARGET_RANDOM, 1); 
    275  
    276             if(!target)                                     // someone is trying to solo, set target as current victim. 
    277                 target = m_creature->getVictim(); 
    278  
    279             if(target) 
    280             { 
    281                 Creature* MoltenFlame = SummonCreature(CREATURE_STALKER, target); 
    282                 if(MoltenFlame) 
    283                 { 
    284                     // Invisible model 
    285                     MoltenFlame->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686); 
    286                     ((molten_flameAI*)MoltenFlame->AI())->SetSupremusGUID(m_creature->GetGUID()); 
    287                     ((molten_flameAI*)MoltenFlame->AI())->StalkTarget(target); 
    288                     SummonFlameTimer = 20000; 
    289                 } 
    290             } 
     190            DoCast(m_creature, SPELL_MOLTEN_PUNCH); 
     191            SummonFlameTimer = 20000; 
    291192        }else SummonFlameTimer -= diff; 
    292193 
     
    295196            if(HurtfulStrikeTimer < diff) 
    296197            { 
    297                 Unit* target = CalculateHurtfulStrikeTarget(); 
    298                 if(target) 
     198                if(Unit* target = CalculateHurtfulStrikeTarget()) 
    299199                { 
    300200                    DoCast(target, SPELL_HURTFUL_STRIKE); 
     
    308208            if(SwitchTargetTimer < diff) 
    309209            { 
    310                 Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); 
    311                 if(target) 
     210                if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1, 100, true)) 
    312211                { 
    313212                    DoResetThreat(); 
     
    316215                    SwitchTargetTimer = 10000; 
    317216                } 
    318  
    319217            }else SwitchTargetTimer -= diff; 
    320218 
    321219            if(SummonVolcanoTimer < diff) 
    322220            { 
    323                 Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); 
    324  
    325                 if(!target) 
    326                     target = m_creature->getVictim(); 
    327  
    328                 if(target) 
    329                 { 
    330                     DoCast(target, SPELL_VOLCANIC_ERUPTION); 
     221                if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 999, true)) 
     222                { 
     223                    DoCast(target, SPELL_VOLCANIC_SUMMON); 
    331224                    DoTextEmote("roars and the ground begins to crack open!", NULL); 
    332225                    SummonVolcanoTimer = 10000; 
     
    342235                DoResetThreat(); 
    343236                PhaseSwitchTimer = 60000; 
    344                 m_creature->SetSpeed(MOVE_RUN, 1.0f); 
     237                m_creature->SetSpeed(MOVE_RUN, 1.2f); 
    345238                DoZoneInCombat(); 
    346239            } 
  • trunk/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp

    r90 r160  
    5959 
    6060//Spells 
    61 #define SPELL_NEEDLE_SPINE             39835 
    62 #define SPELL_NEEDLE_AOE               39968 
     61#define SPELL_NEEDLE_SPINE             39992 
    6362#define SPELL_TIDAL_BURST              39878 
    6463#define SPELL_TIDAL_SHIELD             39872 
     
    181180        }else EnrageTimer -= diff; 
    182181 
    183         // Needle 
    184182        if(NeedleSpineTimer < diff) 
    185183        { 
    186             for(uint8 i = 0; i < 3; ++i) 
    187             { 
    188                 if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))  
    189                     m_creature->CastSpell(target, SPELL_NEEDLE_SPINE, true); 
    190             } 
    191             NeedleSpineTimer = 30000; 
     184            //m_creature->CastSpell(m_creature, SPELL_NEEDLE_SPINE, true); 
     185            std::list<Unit*> target; 
     186            SelectUnitList(target, 3, SELECT_TARGET_RANDOM, 80, true); 
     187            for(std::list<Unit*>::iterator i = target.begin(); i != target.end(); ++i) 
     188                m_creature->CastSpell(*i, 39835, true); 
     189            NeedleSpineTimer = 20000+rand()%5000; 
    192190        }else NeedleSpineTimer -= diff; 
    193191 
  • trunk/src/game/SpellEffects.cpp

    r157 r160  
    48544854        case 28698: unitTarget->CastSpell(unitTarget, 28694, true); break; 
    48554855        // Needle Spine 
    4856         case 39835: unitTarget->CastSpell(unitTarget, 39968, true); break; 
     4856        //case 39835: unitTarget->CastSpell(unitTarget, 39968, true); break; 
    48574857        // Draw Soul 
    48584858        case 40904: unitTarget->CastSpell(m_caster, 40903, true); break; 
    48594859        // Flame Crash 
    4860         case 41126: unitTarget->CastSpell(unitTarget, 41131, true); break; 
     4860        //case 41126: unitTarget->CastSpell(unitTarget, 41131, true); break; 
    48614861        case 41931: 
    48624862        { 
  • trunk/src/game/SpellMgr.cpp

    r157 r160  
    20322032    tempAttr.attr[SPELL_EXTRA_ATTR_MAX_TARGETS] = 3; 
    20332033    mSpellExtraAttrMap[41376] = tempAttr;   //Spite 
     2034    mSpellExtraAttrMap[39992] = tempAttr;   //Needle Spine 
    20342035    tempAttr.attr[SPELL_EXTRA_ATTR_MAX_TARGETS] = 0; 
    20352036