Changeset 154 for trunk

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

[svn] Update zul'aman script. Patch provided by streetrat.

Original author: megamage
Date: 2008-11-03 10:42:25-06:00

Location:
trunk/src/bindings/scripts/scripts/zone/zulaman
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp

    r90 r154  
    2929#include "Weather.h" 
    3030 
    31 #define SPELL_STATIC_DISRUPTION 43622 
    32 #define SPELL_STATIC_VISUAL     45265 
    33 #define SPELL_CALL_LIGHTNING     43661 //Missing timer 
    34 #define SPELL_GUST_OF_WIND      43621 
    35 #define SPELL_ELECTRICAL_STORM  43648 
    36 #define SPELL_BERSERK           45078 
    37  
    38 #define SPELL_EAGLE_SWOOP       44732 
     31#define SPELL_STATIC_DISRUPTION         43622 
     32#define SPELL_STATIC_VISUAL                     45265 
     33#define SPELL_CALL_LIGHTNING            43661 //Missing timer 
     34#define SPELL_GUST_OF_WIND                      43621 
     35#define SPELL_ELECTRICAL_STORM          43648 
     36#define SPELL_BERSERK                           45078 
     37#define SPELL_ELECTRICAL_OVERLOAD       43658 
     38#define SPELL_EAGLE_SWOOP                       44732 
    3939 
    4040//"Your death gonna be quick, strangers. You shoulda never have come to this place..." 
     
    6464    boss_akilzonAI(Creature *c) : ScriptedAI(c) 
    6565    { 
     66                SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_ELECTRICAL_STORM); 
     67        if(TempSpell) 
     68                        TempSpell->Effect[1] = 0;//disable bugged lightning until fixed in core 
    6669        pInstance = ((ScriptedInstance*)c->GetInstanceData()); 
    6770        Reset(); 
     
    6972    ScriptedInstance *pInstance; 
    7073 
     74        uint64 BirdGUIDs[8]; 
    7175    uint64 TargetGUID; 
    7276    uint64 CycloneGUID; 
     
    7781    uint32 CallLighting_Timer; 
    7882    uint32 ElectricalStorm_Timer; 
    79     uint32 SDisruptAOEVisual_Timer; 
    8083    uint32 SummonEagles_Timer; 
    8184    uint32 Enrage_Timer; 
     
    9699        ElectricalStorm_Timer = 60*1000; //60 seconds(bosskillers) 
    97100        Enrage_Timer = 10*60*1000; //10 minutes till enrage(bosskillers) 
    98         SDisruptAOEVisual_Timer = 99999; 
    99101        SummonEagles_Timer = 99999; 
    100102 
     
    102104        CloudGUID = 0; 
    103105        CycloneGUID = 0; 
     106                DespawnSummons(); 
     107                for(uint8 i = 0; i < 8; i++) 
     108                        BirdGUIDs[i] = 0; 
    104109 
    105110        StormCount = 0; 
     
    107112 
    108113        isRaining = false; 
    109  
    110         DespawnSummons(MOB_SOARING_EAGLE); 
     114         
    111115        SetWeather(WEATHER_STATE_FINE, 0.0f);         
    112116    } 
     
    116120        DoYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL); 
    117121        DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); 
    118         DoZoneInCombat(); 
     122        //DoZoneInCombat(); 
    119123        if(pInstance) 
    120124            pInstance->SetData(DATA_AKILZONEVENT, IN_PROGRESS); 
     
    127131        if(pInstance) 
    128132            pInstance->SetData(DATA_AKILZONEVENT, DONE); 
    129         DespawnSummons(MOB_SOARING_EAGLE); 
     133        DespawnSummons(); 
    130134    } 
    131135 
     
    145149    } 
    146150 
    147     void DespawnSummons(uint32 entry) 
    148     { 
    149         std::list<Creature*> templist; 
    150         float x, y, z; 
    151         m_creature->GetPosition(x, y, z); 
    152  
    153         { 
    154             CellPair pair(Trinity::ComputeCellPair(x, y)); 
    155             Cell cell(pair); 
    156             cell.data.Part.reserved = ALL_DISTRICT; 
    157             cell.SetNoCreate(); 
    158  
    159             Trinity::AllCreaturesOfEntryInRange check(m_creature, entry, 100); 
    160             Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(templist, check); 
    161  
    162             TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher); 
    163  
    164             CellLock<GridReadGuard> cell_lock(cell, pair); 
    165             cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap())); 
    166         } 
    167  
    168         for(std::list<Creature*>::iterator i = templist.begin(); i != templist.end(); ++i) 
    169         { 
    170             (*i)->SetVisibility(VISIBILITY_OFF); 
    171             (*i)->setDeathState(JUST_DIED); 
    172         } 
    173     } 
    174  
    175     Player* SelectRandomPlayer(float range = 0.0f, bool alive = true) 
    176     { 
    177         Map *map = m_creature->GetMap(); 
    178         if (!map->IsDungeon()) return NULL; 
    179  
    180         InstanceMap::PlayerList PlayerList = ((InstanceMap*)map)->GetPlayers(); 
    181         InstanceMap::PlayerList::iterator i; 
    182         while(PlayerList.size()) 
    183         { 
    184             i = PlayerList.begin(); 
    185             advance(i, rand()%PlayerList.size()); 
    186             if((range == 0.0f || m_creature->IsWithinDistInMap(*i, range)) 
    187                 && (!alive || (*i)->isTargetableForAttack())) 
    188                 return *i; 
    189             else 
    190                 PlayerList.erase(i); 
    191         } 
    192         return NULL; 
     151    void DespawnSummons() 
     152    { 
     153                for (uint8 i = 0; i < 8; i++)  
     154        { 
     155                        Unit* bird = Unit::GetUnit(*m_creature,BirdGUIDs[i]); 
     156                        if(bird && bird->isAlive()) 
     157                        { 
     158                                bird->SetVisibility(VISIBILITY_OFF); 
     159                                bird->setDeathState(JUST_DIED); 
     160                        } 
     161                } 
    193162    } 
    194163 
     
    231200                cell_lock->Visit(cell_lock, grid_unit_searcher, *(m_creature->GetMap())); 
    232201            } 
    233  
    234             for(std::list<Unit*>::iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i) 
    235             { 
    236                 if(!Cloud->IsWithinDistInMap(*i, 15)) 
     202                        //dealdamege 
     203                        for(std::list<Unit*>::iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i) 
     204            { 
     205                                if(Cloud->GetDistance2d(*i)>= 6) 
    237206                { 
    238                     float x, y, z; 
    239                     (*i)->GetPosition(x, y, z); 
    240                     x = rand()%2 ? x + rand()%5 : x - rand()%5; 
    241                     y = rand()%2 ? y + rand()%5 : y - rand()%5; 
    242                     z = Cloud->GetPositionZ() + 2 - rand()%4;  
    243                     if(Unit *trigger = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000)) 
    244                     { 
    245                         trigger->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); 
    246                         trigger->StopMoving(); 
    247                         trigger->CastSpell(trigger, 37248, true); 
    248                         trigger->CastCustomSpell(*i, 43137, &bp0, NULL, NULL, true, 0, 0, m_creature->GetGUID()); 
    249                     } 
     207                    Cloud->CastCustomSpell(*i, 43137, &bp0, NULL, NULL, true, 0, 0, m_creature->GetGUID()); 
    250208                } 
    251             } 
    252  
     209            }            
    253210            // visual 
    254             float x, y, z; 
    255             for(uint8 i = 0; i < StormCount; ++i) 
    256             { 
    257                 Cloud->GetPosition(x, y, z); 
    258                 x = rand()%2 ? x + rand()%10 : x - rand()%10; 
    259                 y = rand()%2 ? y + rand()%10 : y - rand()%10; 
    260                 z = z + 2 - rand()%4;  
     211            float x,y,z; 
     212                        z = m_creature->GetPositionZ();                  
     213            for(uint8 i = 0; i < 5+rand()%5; ++i) 
     214            {                
     215                x = 343+rand()%60; 
     216                y = 1380+rand()%60; 
    261217                if(Unit *trigger = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000)) 
    262218                { 
    263                     trigger->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); 
    264                     trigger->StopMoving(); 
    265                     trigger->CastSpell(trigger, 37248, true); 
     219                                        trigger->setFaction(35); 
     220                    trigger->SetMaxHealth(100000); 
     221                    trigger->SetHealth(100000); 
     222                                        trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); 
     223                                        if (Cloud) 
     224                                                Cloud->CastCustomSpell(trigger, /*43661*/43137, &bp0, NULL, NULL,true, 0, 0, Cloud->GetGUID()); 
    266225                } 
    267                 Cloud->GetPosition(x, y, z); 
    268                 x = rand()%2 ? x + 10 + rand()%10 : x - 10 - rand()%10; 
    269                 y = rand()%2 ? y + 10 + rand()%10 : y - 10 - rand()%10; 
    270                 if(Unit *trigger = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 2000)) 
    271                 { 
    272                     trigger->SetMaxHealth(9999999); 
    273                     trigger->SetHealth(9999999); 
    274                     trigger->CastSpell(trigger, 43661, true); 
    275                 } 
    276             } 
    277         } 
    278  
     226            }                    
     227        } 
    279228        StormCount++; 
    280229        if(StormCount > 10) 
     
    283232            SummonEagles_Timer = 5000; 
    284233            m_creature->InterruptNonMeleeSpells(false); 
    285             Cloud->RemoveAurasDueToSpell(45213); 
    286234            CloudGUID = 0; 
    287             if(Unit* Cyclone = Unit::GetUnit(*m_creature, CycloneGUID)) 
    288                 Cyclone->RemoveAurasDueToSpell(25160); 
     235                        if (Cloud) 
     236                                Cloud->DealDamage(Cloud, Cloud->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);  
    289237            SetWeather(WEATHER_STATE_FINE, 0.0f); 
    290238            isRaining = false; 
    291239        } 
    292  
    293240        StormSequenceTimer = 1000; 
    294241    } 
     
    331278            StaticDisruption_Timer = (10+rand()%8)*1000; // < 20s 
    332279 
    333             float dist = m_creature->GetDistance(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); 
     280            /*float dist = m_creature->GetDistance(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); 
    334281            if (dist < 5.0f) dist = 5.0f; 
    335             SDisruptAOEVisual_Timer = 1000 + floor(dist / 30 * 1000.0f); 
     282            SDisruptAOEVisual_Timer = 1000 + floor(dist / 30 * 1000.0f);*/ 
    336283        }else StaticDisruption_Timer -= diff; 
    337  
    338         if (SDisruptAOEVisual_Timer < diff) { 
    339             Unit* SDVictim = Unit::GetUnit((*m_creature), TargetGUID); 
    340             if(SDVictim && SDVictim->isAlive()) 
    341                 SDVictim->CastSpell(SDVictim, SPELL_STATIC_VISUAL, true); 
    342             SDisruptAOEVisual_Timer = 99999; 
    343             TargetGUID = 0; 
    344         }else SDisruptAOEVisual_Timer -= diff; 
    345284 
    346285        if (GustOfWind_Timer < diff) { 
     
    362301 
    363302        if (ElectricalStorm_Timer < diff) { 
    364             Unit* target = SelectRandomPlayer(50); 
    365             if(!target) target = m_creature->getVictim(); 
    366             float x, y, z; 
    367             target->GetPosition(x, y, z); 
    368             Unit *Cloud = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, m_creature->GetPositionZ() + 10, 0, TEMPSUMMON_TIMED_DESPAWN, 15000); 
     303            Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 50, true); 
     304            if(!target) 
     305            { 
     306                EnterEvadeMode(); 
     307                return; 
     308            } 
     309                        target->CastSpell(target, 44007, true);//cloud visual 
     310                        m_creature->CastSpell(target, SPELL_ELECTRICAL_STORM, false);//storm cyclon + visual             
     311            float x,y,z; 
     312                        target->GetPosition(x,y,z); 
     313                        if (target) 
     314                        { 
     315                                target->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); 
     316                                target->SendMonsterMove(x,y,m_creature->GetPositionZ()+15,0,0,0); 
     317                        } 
     318                        Unit *Cloud = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, m_creature->GetPositionZ()+16, 0, TEMPSUMMON_TIMED_DESPAWN, 15000); 
    369319            if(Cloud) 
    370320            { 
    371                 CloudGUID = Cloud->GetGUID(); 
    372                 Cloud->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); 
     321                                CloudGUID = Cloud->GetGUID(); 
     322                                Cloud->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); 
    373323                Cloud->StopMoving(); 
    374                 Cloud->SetFloatValue(OBJECT_FIELD_SCALE_X, 3.0f); 
    375                 Cloud->setFaction(35); 
     324                Cloud->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f); 
     325                                Cloud->setFaction(35); 
    376326                Cloud->SetMaxHealth(9999999); 
    377327                Cloud->SetHealth(9999999); 
    378                 Cloud->CastSpell(Cloud, 45213, true); // cloud visual 
    379                 m_creature->StopMoving(); 
    380328                Cloud->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); 
    381                 m_creature->CastSpell(Cloud, 43501, false); // siphon soul 
    382             } 
    383             Unit *Cyclone = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 15000); 
    384             if(Cyclone) 
    385             { 
    386                 Cyclone->CastSpell(Cyclone, 25160, true); // wind visual 
    387                 CycloneGUID = Cyclone->GetGUID(); 
    388329            } 
    389330            ElectricalStorm_Timer = 60000; //60 seconds(bosskillers) 
     
    399340            float x, y, z; 
    400341            m_creature->GetPosition(x, y, z); 
    401             for (uint8 i = 0; i < 6 + rand()%3; i++)  
    402             { 
    403                 if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) 
    404                 { 
    405                     x = target->GetPositionX() + 10 - rand()%20; 
    406                     y = target->GetPositionY() + 10 - rand()%20; 
    407                     z = target->GetPositionZ() + 6 + rand()%5 + 10; 
    408                     if(z > 95) z = 95 - rand()%5; 
    409                 } 
    410  
    411                 Creature *pCreature = m_creature->SummonCreature(MOB_SOARING_EAGLE, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); 
    412                 if (pCreature) 
    413                 { 
    414                     pCreature->AddThreat(m_creature->getVictim(), 1.0f); 
    415                     pCreature->AI()->AttackStart(m_creature->getVictim()); 
    416                 } 
    417             } 
     342 
     343                        for (uint8 i = 0; i < 8; i++)  
     344            { 
     345                                Unit* bird = Unit::GetUnit(*m_creature,BirdGUIDs[i]); 
     346                                if(!bird)//they despawned on die 
     347                                {                                        
     348                                        if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) 
     349                                        { 
     350                                                x = target->GetPositionX() + 10 - rand()%20; 
     351                                                y = target->GetPositionY() + 10 - rand()%20; 
     352                                                z = target->GetPositionZ() + 6 + rand()%5 + 10; 
     353                                                if(z > 95) z = 95 - rand()%5; 
     354                                        } 
     355                                        Creature *pCreature = m_creature->SummonCreature(MOB_SOARING_EAGLE, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); 
     356                                        if (pCreature) 
     357                                        { 
     358                                                pCreature->AddThreat(m_creature->getVictim(), 1.0f); 
     359                                                pCreature->AI()->AttackStart(m_creature->getVictim()); 
     360                                                BirdGUIDs[i] = pCreature->GetGUID(); 
     361                                        } 
     362                                }                                
     363                        } 
    418364            SummonEagles_Timer = 999999; 
    419365        } else SummonEagles_Timer -= diff; 
  • trunk/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp

    r117 r154  
    1919SD%Complete: 80 
    2020SDComment:  
    21 SDCategory: Zul¡äAman 
     21SDCategory: Zul'Aman 
    2222EndScriptData */ 
    2323 
     
    180180        case PHASE_HUMAN: 
    181181            //DoCast(m_creature, SPELL_SUMMON_LYNX, true); 
    182             DoSpawnCreature(MOB_SPIRIT_LYNX, 0,0,0,0, TEMPSUMMON_CORPSE_DESPAWN, 0); 
     182            DoSpawnCreature(MOB_SPIRIT_LYNX, 5,5,0,0, TEMPSUMMON_CORPSE_DESPAWN, 0); 
    183183            m_creature->SetMaxHealth(400000); 
    184184            m_creature->SetHealth(400000); 
     
    266266                if(CheckTimer < diff) 
    267267                { 
    268                     if(m_creature->GetHealth() * 10 < m_creature->GetMaxHealth()) 
     268                    if( ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 20)/*m_creature->GetHealth() * 10 < m_creature->GetMaxHealth()*/) 
    269269                        EnterPhase(PHASE_MERGE); 
    270270                    else 
    271271                    { 
    272272                        Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID); 
    273                         if(Lynx && Lynx->GetHealth() * 10 < Lynx->GetMaxHealth()) 
     273                        if(Lynx && ((Lynx->GetHealth()*100) / Lynx->GetMaxHealth() <= 20)/*Lynx->GetHealth() * 10 < Lynx->GetMaxHealth()*/) 
    274274                            EnterPhase(PHASE_MERGE); 
    275275                    } 
     
    283283            { 
    284284                Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID); 
    285                 if(Lynx && m_creature->IsWithinDistInMap(Lynx, 6.0f)) 
    286                 { 
    287                     if(TransformCount < 3) 
    288                         EnterPhase(PHASE_LYNX); 
    289                     else 
    290                         EnterPhase(PHASE_ENRAGE); 
    291                 } 
     285                                if(Lynx) 
     286                                { 
     287                                        Lynx->GetMotionMaster()->MoveFollow(m_creature, 0, 0); 
     288                                        m_creature->GetMotionMaster()->MoveFollow(Lynx, 0, 0); 
     289                                        if(m_creature->IsWithinDistInMap(Lynx, 6.0f)) 
     290                                        { 
     291                                                if(TransformCount < 3) 
     292                                                        EnterPhase(PHASE_LYNX); 
     293                                                else 
     294                                                        EnterPhase(PHASE_ENRAGE); 
     295                                        } 
     296                                }                 
    292297                CheckTimer = 1000; 
    293298            }else CheckTimer -= diff; 
     
    350355    } 
    351356 
    352     void Aggro(Unit *who) {DoZoneInCombat();} 
     357    void Aggro(Unit *who) {/*DoZoneInCombat();*/} 
    353358 
    354359    void UpdateAI(const uint32 diff)