Changeset 117

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

[svn] Fix Eredar twins, Al'ar and Zul'jin's AttackStart?() function.
Update Shade of Akama script, Lady Vashj script and Shadowmoon Valley script. Patches provided by Blaymoira.
Remove some hacks since core has provided spell target support.

Original author: megamage
Date: 2008-10-27 07:34:38-05:00

Location:
trunk/src/bindings/scripts
Files:
1 added
10 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp

    r109 r117  
    211211                    Channeler->Respawn(); 
    212212                } 
     213                                if(m_creature->isAlive()) 
     214                                { 
    213215                Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL, true); 
    214216                Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL_2, true); 
    215217                Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); 
     218                                } 
    216219            } 
    217220        } 
     
    389392                                                            // They move towards AKama 
    390393                            Defender->GetMotionMaster()->MovePoint(0, x, y, z); 
     394                                                        Defender->AI()->AttackStart(Akama); 
    391395                        }else move = false; 
    392396                    }else move = false; 
  • trunk/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp

    r109 r117  
    8080#define COILFANG_STRIDER              22056 
    8181#define COILFANG_ELITE                22055 
    82 #define FATHOM_SPOREBAT               22140 
     82#define TOXIC_SPOREBAT               22140 
    8383 
    8484float ElementPos[8][4] = 
     
    128128 
    129129    uint64 ShieldGeneratorChannel[4]; 
     130        uint64 AggroTargetGUID; 
    130131 
    131132    uint32 ShockBlast_Timer; 
     
    140141    uint32 SummonSporebat_Timer; 
    141142    uint32 SummonSporebat_StaticTimer; 
     143        uint32 AggroTimer; 
     144 
    142145    uint8 EnchantedElemental_Pos; 
    143146    uint8 Phase; 
    144147 
    145148    bool Entangle; 
     149        bool Intro; 
    146150 
    147151    void Reset() 
     
    160164        EnchantedElemental_Pos = 0; 
    161165        Phase = 0; 
     166                AggroTimer = 19000; 
     167        AggroTargetGUID = 0; 
     168 
     169                m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); 
     170        // Start off unattackable so that the intro is done properly 
     171        m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); 
    162172 
    163173        Entangle = false; 
     174                Intro = false; 
    164175 
    165176        if(pInstance) 
    166             pInstance->SetData(DATA_LADYVASHJEVENT, 0); 
     177            pInstance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED); 
    167178 
    168179        ShieldGeneratorChannel[0] = 0; 
     
    170181        ShieldGeneratorChannel[2] = 0; 
    171182        ShieldGeneratorChannel[3] = 0; 
    172  
    173183    } 
    174184 
     
    179189        if(TaintedElemental_Timer > 50000) 
    180190            TaintedElemental_Timer = 50000; 
     191    } 
     192 
     193        void MoveInLineOfSight(Unit *who) 
     194    { 
     195        if(!who || (!who->isAlive())) return; 
     196 
     197        if(who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) 
     198        { 
     199            float attackRadius = m_creature->GetAttackDistance(who); 
     200 
     201            if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who)) 
     202            { 
     203                if(who->HasStealthAura()) 
     204                    who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); 
     205 
     206                m_creature->AddThreat(who, 1.0f); 
     207            } 
     208 
     209            if(!InCombat && !Intro && m_creature->IsWithinDistInMap(who, 40.0f) && (who->GetTypeId() == TYPEID_PLAYER)) 
     210            { 
     211                if(pInstance) 
     212                    pInstance->SetData(DATA_LADYVASHJEVENT, IN_PROGRESS); 
     213 
     214                m_creature->GetMotionMaster()->Clear(false); 
     215                m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); 
     216                DoYell(SAY_INTRO,LANG_UNIVERSAL,NULL); 
     217                DoPlaySoundToSet(m_creature, SOUND_INTRO); 
     218                m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK); 
     219                AggroTargetGUID = who->GetGUID(); 
     220                Intro = true; 
     221            } 
     222        } 
    181223    } 
    182224 
     
    203245 
    204246        if(pInstance) 
    205             pInstance->SetData(DATA_LADYVASHJEVENT, 0); 
    206     } 
    207  
    208     void StartEvent() 
     247            pInstance->SetData(DATA_LADYVASHJEVENT, DONE); 
     248    } 
     249 
     250/*    void StartEvent() 
    209251    { 
    210252        switch(rand()%4) 
     
    231273 
    232274        if(pInstance) 
    233             pInstance->SetData(DATA_LADYVASHJEVENT, 1); 
    234     } 
    235  
    236     void Aggro(Unit *who) 
    237     { 
    238         //Begin melee attack if we are within range 
    239         if(Phase != 2) 
    240             DoStartMovement(who); 
    241  
    242         StartEvent(); 
    243     } 
     275            pInstance->SetData(DATA_LADYVASHJEVENT, IN_PROGRESS); 
     276    }*/ 
     277 
     278    void Aggro(Unit *who){} 
    244279 
    245280    void CastShootOrMultishot() 
     
    279314        //to prevent abuses during phase 2 
    280315        if(Phase == 2 && !m_creature->getVictim() && InCombat) 
    281             EnterEvadeMode(); 
     316                { 
     317         EnterEvadeMode(); 
     318                 return; 
     319                } 
    282320 
    283321        //Return since we have no target 
    284322        if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() ) 
    285323            return; 
     324 
     325                //Intro 
     326                if(Intro) 
     327        { 
     328            if(AggroTimer < diff) 
     329            { 
     330                m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); 
     331                m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); 
     332                                switch(rand()%4) 
     333                                { 
     334                                case 0: 
     335                                        DoPlaySoundToSet(m_creature, SOUND_AGGRO1); 
     336                                        DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL); 
     337                                        break; 
     338                                case 1: 
     339                                        DoPlaySoundToSet(m_creature, SOUND_AGGRO2); 
     340                                        DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL); 
     341                                        break; 
     342                                case 2: 
     343                                        DoPlaySoundToSet(m_creature, SOUND_AGGRO3); 
     344                                        DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL); 
     345                                        break; 
     346                                case 3: 
     347                                        DoPlaySoundToSet(m_creature, SOUND_AGGRO4); 
     348                                        DoYell(SAY_AGGRO4, LANG_UNIVERSAL, NULL); 
     349                                        break; 
     350                                } 
     351                                Phase = 1; 
     352                m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); 
     353                Intro = false; 
     354                                //Begin melee attack if we are within range 
     355                if(AggroTargetGUID && Phase != 2) 
     356                { 
     357                    Unit* pUnit = Unit::GetUnit((*m_creature), AggroTargetGUID); 
     358                    if(pUnit) 
     359                    { 
     360                        m_creature->GetMotionMaster()->MoveChase(pUnit); 
     361                        AttackStart(pUnit); 
     362                    } 
     363                    DoZoneInCombat(); 
     364                }else EnterEvadeMode(); 
     365            }else AggroTimer -= diff; 
     366        } 
    286367 
    287368        if(Phase == 1 || Phase == 3) 
     
    369450                { 
    370451                    Creature *Sporebat = NULL; 
    371                     Sporebat = m_creature->SummonCreature(FATHOM_SPOREBAT, SPOREBAT_X, SPOREBAT_Y, SPOREBAT_Z, SPOREBAT_O, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); 
     452                    Sporebat = m_creature->SummonCreature(TOXIC_SPOREBAT, SPOREBAT_X, SPOREBAT_Y, SPOREBAT_Z, SPOREBAT_O, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); 
    372453 
    373454                    if(Sporebat) 
     
    486567                Creature *CoilfangStrider; 
    487568                uint32 pos = rand()%3; 
    488                 CoilfangStrider = m_creature->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); 
     569                CoilfangStrider = m_creature->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); 
    489570                if(CoilfangStrider) 
    490571                { 
     
    635716}; 
    636717 
    637 //Fathom Sporebat 
     718//Toxic Sporebat 
    638719//Toxic Spores: Used in Phase 3 by the Spore Bats, it creates a contaminated green patch of ground, dealing about 2775-3225 nature damage every second to anyone who stands in it. 
    639 struct TRINITY_DLL_DECL mob_fathom_sporebatAI : public ScriptedAI 
    640 { 
    641     mob_fathom_sporebatAI(Creature *c) : ScriptedAI(c) 
     720struct TRINITY_DLL_DECL mob_toxic_sporebatAI : public ScriptedAI 
     721{ 
     722    mob_toxic_sporebatAI(Creature *c) : ScriptedAI(c) 
    642723    { 
    643724        pInstance = ((ScriptedInstance*)c->GetInstanceData()); 
     
    652733    void Reset() 
    653734    { 
    654         m_creature->setFaction(14); 
     735                m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT);         
     736                m_creature->setFaction(14); 
    655737        ToxicSpore_Timer = 5000; 
    656738        Check_Timer = 1000; 
     
    868950} 
    869951 
    870 CreatureAI* GetAI_mob_fathom_sporebat(Creature *_Creature) 
    871 { 
    872     return new mob_fathom_sporebatAI (_Creature); 
     952CreatureAI* GetAI_mob_toxic_sporebat(Creature *_Creature) 
     953{ 
     954    return new mob_toxic_sporebatAI (_Creature); 
    873955} 
    874956 
     
    897979 
    898980    newscript = new Script; 
    899     newscript->Name="mob_fathom_sporebat"; 
    900     newscript->GetAI = GetAI_mob_fathom_sporebat; 
     981    newscript->Name="mob_toxic_sporebat"; 
     982    newscript->GetAI = GetAI_mob_toxic_sporebat; 
    901983    m_scripts[nrscripts++] = newscript; 
    902984 
  • trunk/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp

    r90 r117  
    430430    void MoveInLineOfSight(Unit*) {} 
    431431 
    432     // bugged 
    433     /*void DamageTaken(Unit*, uint32 &damage) 
     432    void DamageTaken(Unit*, uint32 &damage) 
    434433    { 
    435434        if(damage >= m_creature->GetHealth()) 
    436435            m_creature->CastSpell(m_creature, SPELL_SOUL_TRANSFER, true); 
    437     }*/ 
     436    } 
    438437 
    439438    void JustDied(Unit*) 
  • trunk/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp

    r90 r117  
    4848            TempSpell->EffectImplicitTargetB[0] = 0; 
    4949        } 
    50         TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SOUL_TRANSFER); 
    51         if(TempSpell && TempSpell->EffectImplicitTargetB[0] != 30) 
    52         { 
    53             TempSpell->EffectImplicitTargetA[0] = 1; 
    54             TempSpell->EffectImplicitTargetA[1] = 1; 
    55             TempSpell->EffectImplicitTargetA[2] = 1; 
    56             TempSpell->EffectImplicitTargetB[0] = 0; 
    57             TempSpell->EffectImplicitTargetB[1] = 0; 
    58             TempSpell->EffectImplicitTargetB[2] = 0; 
    59         } 
    60         // target 8, but core only push back the caster 
    61         TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_DEBRIS_DAMAGE); 
    62         if(TempSpell && TempSpell->EffectImplicitTargetA[0] != 53) 
    63         { 
    64             TempSpell->EffectImplicitTargetA[0] = 53; 
    65             TempSpell->EffectImplicitTargetB[0] = 16; 
    66         }   
    67         TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_DEBRIS_KNOCKDOWN); 
    68         if(TempSpell && TempSpell->EffectImplicitTargetA[0] != 53) 
    69         { 
    70             TempSpell->EffectImplicitTargetA[0] = 53; 
    71             TempSpell->EffectImplicitTargetB[0] = 16; 
    72             TempSpell->EffectImplicitTargetA[1] = 53; 
    73             TempSpell->EffectImplicitTargetB[1] = 16; 
    74         }   
    7550    } 
    7651 
     
    220195                    if(Channeler && Channeler->isAlive()) 
    221196                    { 
    222                         Channeler->CastSpell(Channeler, SPELL_SOUL_TRANSFER, true); 
     197                        //Channeler->CastSpell(Channeler, SPELL_SOUL_TRANSFER, true); 
    223198                        data = IN_PROGRESS; 
     199                                                break; 
    224200                    } 
    225201                }break; 
  • trunk/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp

    r90 r117  
    1818SDName: Shadowmoon_Valley 
    1919SD%Complete: 100 
    20 SDComment: Quest support: 10519, 10583, 10601, 10814, 10804, 10854, 11082. Vendor Drake Dealer Hurlunk. Teleporter TO Invasion Point: Cataclysm 
     20SDComment: Quest support: 10519, 10583, 10601, 10814, 10804, 10854, 11082, 11108. Vendor Drake Dealer Hurlunk. Teleporter TO Invasion Point: Cataclysm 
    2121SDCategory: Shadowmoon Valley 
    2222EndScriptData */ 
     
    385385}; 
    386386 
     387CreatureAI* GetAI_mob_dragonmaw_peon(Creature* _Creature) 
     388{ 
     389    return new mob_dragonmaw_peonAI(_Creature); 
     390} 
     391 
    387392/*###### 
    388393## npc_drake_dealer_hurlunk 
     
    693698} 
    694699 
     700/*#### 
     701# quest_lord_illidan_stormrage 
     702####*/ 
     703#define QUEST_LORD_ILLIDAN_STORMRAGE 11108 
     704#define LORD_ILLIDAN_STORMRAGE 22083 
     705 
     706#define SPELL_ONE 39990 // Red Lightning Bolt 
     707#define SPELL_TWO 41528 // Mark of Stormrage 
     708#define SPELL_THREE 40216 // Dragonaw Faction 
     709#define SPELL_FOUR 42016 // Dragonaw Trasform 
     710 
     711#define OVERLORD_SAY_1 "Come, $N. Lord Stormrage awaits." 
     712#define OVERLORD_SAY_2 "Lord Illidan will be here shortly." 
     713#define OVERLORD_SAY_3 "Lord Illidan, this is the Dragonmaw that I, and others, have told you about. He will lead us to victory!" 
     714#define OVERLORD_SAY_4 "But... My lord, I do not understand. $N... He is the orc that has..." 
     715#define OVERLORD_SAY_5 "It will be done, my lord." 
     716#define OVERLORD_SAY_6 "So you thought to make a fool of Mor'ghor, eh? Before you are delivered to Lord Illidan, you will feel pain that you could not know to exist. I will take pleasure in exacting my own vengeance." 
     717 
     718#define OVERLORD_YELL_1 "Warriors of Dragonmaw, gather 'round! One among you has attained the rank of highlord! Bow your heads in reverence! Show your respect and allegiance to Highlord $N!" 
     719#define OVERLORD_YELL_2 "All hail Lord Illidan!" 
     720 
     721#define LORD_ILLIDAN_SAY_1 "What is the meaning of this, Mor'ghor?" 
     722#define LORD_ILLIDAN_SAY_2 "SILENCE!" 
     723#define LORD_ILLIDAN_SAY_3 "Blathering idiot. You incomprehensibly incompetent buffoon..." 
     724#define LORD_ILLIDAN_SAY_4 "THIS is your hero?" 
     725#define LORD_ILLIDAN_SAY_5 "You have been deceived, imbecile." 
     726#define LORD_ILLIDAN_SAY_6 "This... whole... operation... HAS BEEN COMPROMISED!" 
     727#define LORD_ILLIDAN_SAY_7 "I expect to see this insect's carcass in pieces in my lair within the hour. Fail and you will suffer a fate so much worse than death." 
     728 
     729#define YARZILL_THE_MERC_SAY "You will not harm the boy, Mor'ghor! Quickly, $N, climb on my back!" 
     730 
     731#define GOSSIP_FLY "Lets Do! <MISSING TEXT>" 
     732 
     733bool GossipHello_npc_yarzill_fly(Player *player, Creature *_Creature) 
     734{ 
     735        if (player->GetQuestStatus(QUEST_LORD_ILLIDAN_STORMRAGE) == QUEST_STATUS_COMPLETE) 
     736        { 
     737                player->ADD_GOSSIP_ITEM(0, GOSSIP_FLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); 
     738                player->SEND_GOSSIP_MENU(3961,_Creature->GetGUID()); 
     739                return true; 
     740        }else{ 
     741                return false; 
     742        } 
     743} 
     744 
     745bool GossipSelect_npc_yarzill_fly(Player *player, Creature *_Creature, uint32 sender, uint32 action) 
     746{ 
     747        if (action == GOSSIP_ACTION_INFO_DEF + 1) 
     748        { 
     749                std::vector<uint32> nodes; 
     750                nodes.resize(2); 
     751                nodes[0] = 173; 
     752                nodes[1] = 174; 
     753                error_log("SD2: Player %s started quest 11108 which has disabled taxi node, need to be fixed in core", player->GetName()); 
     754                //player->ActivateTaxiPathTo(nodes, 23468); 
     755                return true; 
     756        } 
     757        return false; 
     758} 
     759 
     760struct TRINITY_DLL_DECL Yarzill_The_MercAI : public ScriptedAI 
     761{ 
     762        Yarzill_The_MercAI(Creature *c) : ScriptedAI(c) {Reset();} 
     763 
     764void Reset(){} 
     765 
     766void Aggro(Unit *who){} 
     767 
     768void DoSpeach(Unit *target) 
     769{ 
     770DoSay(YARZILL_THE_MERC_SAY,LANG_UNIVERSAL,target); 
     771} 
     772}; 
     773 
     774struct TRINITY_DLL_DECL Lord_IllidanAI : public ScriptedAI 
     775{ 
     776Lord_IllidanAI(Creature *c) : ScriptedAI(c) {Reset();} 
     777 
     778void Reset(){} 
     779 
     780void Aggro(Unit *who){} 
     781 
     782void DoSpeach(int phase) 
     783{ 
     784        switch(phase) 
     785        { 
     786        case 1: 
     787                DoSay(LORD_ILLIDAN_SAY_1,LANG_UNIVERSAL,NULL); 
     788                break; 
     789        case 2: 
     790                DoSay(LORD_ILLIDAN_SAY_2,LANG_UNIVERSAL,NULL); 
     791                break; 
     792        case 3: 
     793                DoSay(LORD_ILLIDAN_SAY_3,LANG_UNIVERSAL,NULL); 
     794                break; 
     795        case 4: 
     796                DoSay(LORD_ILLIDAN_SAY_4,LANG_UNIVERSAL,NULL); 
     797                break; 
     798        case 5: 
     799                DoSay(LORD_ILLIDAN_SAY_5,LANG_UNIVERSAL,NULL); 
     800                break; 
     801        case 6: 
     802                DoSay(LORD_ILLIDAN_SAY_6,LANG_UNIVERSAL,NULL); 
     803                break; 
     804        case 7: 
     805                DoSay(LORD_ILLIDAN_SAY_7,LANG_UNIVERSAL,NULL); 
     806                break; 
     807        case 0: 
     808        default: 
     809                break; 
     810        } 
     811} 
     812}; 
     813 
     814struct TRINITY_DLL_DECL Overlord_MorghorAI : public ScriptedAI 
     815{ 
     816Overlord_MorghorAI(Creature *c) : ScriptedAI(c) {Reset();} 
     817 
     818        Unit* m_player; 
     819        Unit* PlayerCheck; 
     820         
     821        uint32 SpeachTimer; 
     822        uint32 SpeachNum; 
     823         
     824        uint64 PlayerGUID; 
     825        uint64 YazillGUID; 
     826         
     827        bool DoingSpeach; 
     828        bool Failed; 
     829 
     830        Creature* Lord; 
     831        Creature* Yarzill; 
     832 
     833void Reset() 
     834{ 
     835        if (Lord) 
     836        { 
     837                Lord->SetUInt64Value(UNIT_FIELD_TARGET, 0); 
     838                Lord->SetVisibility(VISIBILITY_OFF); 
     839                Lord->setDeathState(JUST_DIED); 
     840        } 
     841 
     842        if (Yarzill) 
     843        { 
     844        Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, 0); 
     845        } 
     846         
     847        m_creature->Relocate(-5085.77, 577.231, 86.6719, 2.32608); 
     848        m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 2); 
     849        m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); 
     850        m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); 
     851        m_player = NULL; 
     852        PlayerCheck = NULL; 
     853        PlayerGUID = 0; 
     854        YazillGUID = 0; 
     855        Lord = NULL; 
     856        Yarzill = NULL; 
     857        DoingSpeach = false; 
     858        Failed = false; 
     859        SpeachNum = 0; 
     860        SpeachTimer = 0; 
     861} 
     862 
     863void BeginSpeach(Unit* target) 
     864{ 
     865        m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); 
     866        m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); 
     867        DoSay(OVERLORD_SAY_1,LANG_UNIVERSAL,target); 
     868        m_player = target; 
     869        PlayerCheck = NULL; 
     870        PlayerGUID = target->GetGUID(); 
     871        SpeachTimer = 4200; 
     872        SpeachNum = 0; 
     873        DoingSpeach = true; 
     874} 
     875         
     876void Aggro(Unit *who){} 
     877 
     878void MoveInLineOfSight(Unit *who) 
     879{ 
     880        if (!who) 
     881        return; 
     882 
     883        if (DoingSpeach) 
     884        { 
     885                if (who->GetEntry() == 23141 && m_creature->IsWithinDistInMap(who, 15)) 
     886                { 
     887                        if (!YazillGUID) 
     888                        { 
     889                                YazillGUID = who->GetGUID(); 
     890                        } 
     891                } 
     892        } 
     893} 
     894 
     895void UpdateAI(const uint32 diff) 
     896{ 
     897        //Speach 
     898        if (DoingSpeach) 
     899        { 
     900                if (SpeachTimer < diff) 
     901                { 
     902                        if (YazillGUID && !Yarzill) 
     903                        Yarzill = ((Creature*)Unit::GetUnit((*m_creature), YazillGUID)); 
     904 
     905                                if (!m_creature->IsWithinDistInMap(m_player, 50) && ((Player*)m_player)->GetQuestStatus(QUEST_LORD_ILLIDAN_STORMRAGE) == QUEST_STATUS_INCOMPLETE) 
     906                                { 
     907                                ((Player*)m_player)->FailQuest(QUEST_LORD_ILLIDAN_STORMRAGE); 
     908                                SpeachNum = 30; 
     909                                } 
     910 
     911        switch (SpeachNum) 
     912        { 
     913        // Overlord Movement 
     914        case 0: 
     915                m_creature->GetMotionMaster()->MovePoint(0, -5104.41, 595.297, 85.6838); 
     916                SpeachTimer = 9000; SpeachNum++; break; 
     917        // Overlord Yell 1 
     918        case 1: 
     919                m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_SHOUT); 
     920                DoYell(OVERLORD_YELL_1,LANG_UNIVERSAL,m_player); 
     921                SpeachTimer = 4500; SpeachNum++; break; 
     922        // Overlord Angle 
     923        case 2: 
     924                m_creature->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); 
     925                SpeachTimer = 3200; SpeachNum++; break; 
     926                // Overlord Say 2 
     927        case 3: 
     928                DoSay(OVERLORD_SAY_2,LANG_UNIVERSAL,NULL); 
     929                SpeachTimer = 2000; SpeachNum++; break; 
     930        // Summon Illidan 
     931        case 4: 
     932                Lord = m_creature->SummonCreature(LORD_ILLIDAN_STORMRAGE, -5107.83, 602.584, 85.2393, 4.92598, TEMPSUMMON_CORPSE_DESPAWN, 0); 
     933                Lord->LoadCreaturesAddon(); 
     934                SpeachTimer = 350; SpeachNum++; break; 
     935        // Illidan Cast Red Bolt 
     936        case 5: 
     937                Lord->CastSpell(Lord, SPELL_ONE, true); 
     938                Lord->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); 
     939                m_creature->SetUInt64Value(UNIT_FIELD_TARGET, Lord->GetGUID()); 
     940                SpeachTimer = 2000; SpeachNum++; break; 
     941        // Overlord Yell 2 
     942        case 6: 
     943                DoYell(OVERLORD_YELL_2,LANG_UNIVERSAL,NULL); 
     944                SpeachTimer = 4500; SpeachNum++; break; 
     945        // Overlord Kneel 
     946        case 7: 
     947                m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,8); 
     948                SpeachTimer = 2500; SpeachNum++; break; 
     949        // Overlord Say 3 
     950        case 8: 
     951                DoSay(OVERLORD_SAY_3,LANG_UNIVERSAL,NULL); 
     952                SpeachTimer = 6500; SpeachNum++; break; 
     953        // Illidan Say 1 
     954        case 9: 
     955                ((Lord_IllidanAI*)Lord->AI())->DoSpeach(1); 
     956                SpeachTimer = 5000; SpeachNum++; break; 
     957        // Overlord Say 4 
     958        case 10: 
     959                DoSay(OVERLORD_SAY_4,LANG_UNIVERSAL,m_player); 
     960                SpeachTimer = 6000; SpeachNum++; break; 
     961        // Illidan Say 2 
     962        case 11: 
     963                ((Lord_IllidanAI*)Lord->AI())->DoSpeach(2); 
     964                SpeachTimer = 5500; SpeachNum++; break; 
     965        // Illidan Say 3 
     966        case 12: 
     967                ((Lord_IllidanAI*)Lord->AI())->DoSpeach(3); 
     968                SpeachTimer = 4000; SpeachNum++; break; 
     969        // Illidan Angle 
     970        case 13: 
     971                Lord->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); 
     972                SpeachTimer = 1500; SpeachNum++; break; 
     973        // Illidan Say 4 
     974        case 14: 
     975                ((Lord_IllidanAI*)Lord->AI())->DoSpeach(4); 
     976                SpeachTimer = 1500; SpeachNum++; break; 
     977        // Illidan Cast 
     978        case 15: 
     979                PlayerCheck = Unit::GetUnit(*Lord, PlayerGUID); 
     980                if (PlayerCheck) 
     981                { 
     982                        Lord->CastSpell(m_player, SPELL_TWO, true); 
     983                        m_player->RemoveAurasDueToSpell(SPELL_THREE); 
     984                        m_player->RemoveAurasDueToSpell(SPELL_FOUR); 
     985                        SpeachTimer = 5000; SpeachNum++; 
     986                } 
     987                        else 
     988                        { 
     989                        ((Player*)m_player)->FailQuest(QUEST_LORD_ILLIDAN_STORMRAGE); 
     990                        SpeachTimer = 100; SpeachNum = 30; 
     991                } 
     992                break; 
     993                // Illidan Say 5 
     994        case 16: 
     995                ((Lord_IllidanAI*)Lord->AI())->DoSpeach(5); 
     996                SpeachTimer = 5000; SpeachNum++; break; 
     997        // Illidan Say 6 
     998        case 17: 
     999                ((Lord_IllidanAI*)Lord->AI())->DoSpeach(6); 
     1000                SpeachTimer = 5000; SpeachNum++; break; 
     1001        // Illidan Say 7 
     1002        case 18: 
     1003                ((Lord_IllidanAI*)Lord->AI())->DoSpeach(7); 
     1004                SpeachTimer = 5000; SpeachNum++; break; 
     1005        // Illidan Fly 
     1006        case 19: 
     1007                Lord->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); 
     1008                Lord->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); 
     1009                SpeachTimer = 500; SpeachNum++; break; 
     1010        // Overlord Say 5 
     1011        case 20: 
     1012                DoSay(OVERLORD_SAY_5,LANG_UNIVERSAL,NULL); 
     1013                SpeachTimer = 500; SpeachNum++; break; 
     1014        // Illidan Despawn 
     1015        case 21: 
     1016                Lord->SetVisibility(VISIBILITY_OFF); 
     1017                Lord->setDeathState(JUST_DIED); 
     1018                Lord = NULL; 
     1019                SpeachTimer = 1000; SpeachNum++; break; 
     1020        // Overlord Stand Up 
     1021        case 22: 
     1022                m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); 
     1023                SpeachTimer = 2000; SpeachNum++; break; 
     1024        // Overlord Angle 
     1025        case 23: 
     1026                m_creature->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); 
     1027                SpeachTimer = 5000; SpeachNum++; break; 
     1028        // Overlord Say 6 
     1029        case 24: 
     1030                DoSay(OVERLORD_SAY_6,LANG_UNIVERSAL,NULL); 
     1031                SpeachTimer = 2000; SpeachNum++; break; 
     1032        // Complete Quest 
     1033        case 25: 
     1034                ((Player*)m_player)->CompleteQuest(QUEST_LORD_ILLIDAN_STORMRAGE); 
     1035                SpeachTimer = 6000; SpeachNum++; break; 
     1036        // Goblin Angle 
     1037        case 26: 
     1038                if (Yarzill) 
     1039                Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); 
     1040                SpeachTimer = 500; SpeachNum++; break; 
     1041        // Cast Again Dragonaw Illusion 
     1042        case 27: 
     1043                m_player->RemoveAurasDueToSpell(SPELL_TWO); 
     1044                m_player->RemoveAurasDueToSpell(41519); 
     1045                m_player->CastSpell(m_player, SPELL_THREE, true); 
     1046                m_player->CastSpell(m_player, SPELL_FOUR, true); 
     1047                SpeachTimer = 1000; SpeachNum++; break; 
     1048        // Goblin 
     1049        case 28: 
     1050        if (Yarzill) 
     1051                ((Yarzill_The_MercAI*)Yarzill->AI())->DoSpeach(m_player); 
     1052                SpeachTimer = 5000; SpeachNum++; break; 
     1053        // Goblin Off 
     1054        case 29: 
     1055                if (Yarzill) 
     1056                Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, 0); 
     1057                SpeachTimer = 5000; SpeachNum++; break; 
     1058        // Overlord Go Back 
     1059        case 30: 
     1060                m_creature->GetMotionMaster()->MovePoint(0, -5085.77, 577.231, 86.6719); 
     1061                SpeachTimer = 5000; SpeachNum++; break; 
     1062        // Reset 
     1063        case 31: 
     1064                Reset(); 
     1065                break; 
     1066                default: break; 
     1067        } 
     1068        }else SpeachTimer -= diff; 
     1069} 
     1070} 
     1071}; 
     1072 
     1073CreatureAI* GetAI_Overlord_Morghor(Creature *_Creature) 
     1074{ 
     1075return new Overlord_MorghorAI(_Creature); 
     1076} 
     1077 
     1078CreatureAI* GetAI_Lord_Illidan(Creature *_Creature) 
     1079{ 
     1080return new Lord_IllidanAI(_Creature); 
     1081} 
     1082 
     1083CreatureAI* GetAI_Yarzill_The_Merc(Creature *_Creature) 
     1084{ 
     1085return new Yarzill_The_MercAI(_Creature); 
     1086} 
     1087bool QuestAccept_Overlord_Morghor(Player *player, Creature *_Creature, const Quest *_Quest ) 
     1088{ 
     1089        if(_Quest->GetQuestId() == QUEST_LORD_ILLIDAN_STORMRAGE) 
     1090        { 
     1091                ((Overlord_MorghorAI*)_Creature->AI())->BeginSpeach((Unit*)player); 
     1092                return true; 
     1093        } 
     1094        return false; 
     1095} 
     1096 
    6951097void AddSC_shadowmoon_valley() 
    6961098{ 
     
    7061108    newscript->GetAI = GetAI_mob_enslaved_netherwing_drake; 
    7071109    m_scripts[nrscripts++] = newscript; 
     1110 
     1111        newscript = new Script; 
     1112        newscript->Name = "mob_dragonmaw_peon"; 
     1113        newscript->GetAI = GetAI_mob_dragonmaw_peon; 
     1114        m_scripts[nrscripts++] = newscript; 
    7081115 
    7091116    newscript = new Script; 
     
    7461153    newscript->pGossipSelect = &GossipSelect_npc_oronok_tornheart; 
    7471154    m_scripts[nrscripts++] = newscript; 
    748 } 
     1155 
     1156        newscript = new Script; 
     1157        newscript->Name = "npc_overlord_morghor"; 
     1158        newscript->GetAI = GetAI_Overlord_Morghor; 
     1159        newscript->pQuestAccept = &QuestAccept_Overlord_Morghor; 
     1160        m_scripts[nrscripts++] = newscript; 
     1161 
     1162        newscript = new Script; 
     1163        newscript->Name = "npc_lord_illidan_stormrage"; 
     1164        newscript->GetAI = GetAI_Lord_Illidan; 
     1165        m_scripts[nrscripts++] = newscript; 
     1166 
     1167        newscript = new Script; 
     1168        newscript->Name = "npc_yarzill_the_merc"; 
     1169        newscript->GetAI = GetAI_Yarzill_The_Merc; 
     1170        newscript->pGossipHello = &GossipHello_npc_yarzill_fly; 
     1171        newscript->pGossipSelect = &GossipSelect_npc_yarzill_fly; 
     1172        m_scripts[nrscripts++] = newscript; 
     1173} 
  • trunk/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp

    r109 r117  
    405405            Unit* Temp =  Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH)); 
    406406            if (Temp && Temp->isAlive() && !(Temp->getVictim())) 
    407                 Temp->getThreatManager().addThreat(who,0.0f); 
    408         } 
    409     } 
    410  
    411     void AttackStart(Unit *who) 
    412     { 
    413         if (!who) 
    414             return; 
    415  
    416         if (who->isTargetableForAttack() && who!= m_creature) 
    417         { 
    418             if (!InCombat) 
    419             { 
    420                 DoStartNoMovement(who); 
    421                 Aggro(who); 
    422                 InCombat = true; 
    423             } 
    424         } 
    425     } 
     407                                Temp->getThreatManager().addThreat(who,0.0f); 
     408                } 
     409        } 
     410 
     411        void AttackStart(Unit *who) 
     412        { 
     413                if (!InCombat) 
     414                { 
     415                        ScriptedAI::AttackStart(who); 
     416                } 
     417        } 
    426418 
    427419    void MoveInLineOfSight(Unit *who) 
  • trunk/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp

    r109 r117  
    150150    void AttackStart(Unit* who) 
    151151    { 
    152         if(!who) 
    153             return; 
    154  
    155         if(who->isTargetableForAttack()) 
    156         { 
    157             //Begin attack 
    158             if(Phase1) 
    159                 DoStartNoMovement(who); 
    160             else 
    161                 DoStartMovement(who); 
    162  
    163             if(!InCombat) 
    164             { 
    165                 Aggro(who); 
    166                 InCombat = true; 
    167             } 
    168         } 
     152        if(Phase1) 
     153            ScriptedAI::AttackStart(who, false); 
     154        else 
     155            ScriptedAI::AttackStart(who, true); 
    169156    } 
    170157 
  • trunk/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp

    r90 r117  
    6767 
    6868        Pounding_Timer = 12000; 
    69         ArcaneOrb_Timer = 6000; 
     69        ArcaneOrb_Timer = 3000; 
    7070        KnockAway_Timer = 30000; 
    7171        Berserk_Timer = 600000; 
     
    156156                m_creature->CastSpell(target, SPELL_ARCANE_ORB, true); 
    157157 
    158             ArcaneOrb_Timer = 6000; 
     158            ArcaneOrb_Timer = 3000; 
    159159        }else ArcaneOrb_Timer -= diff; 
    160160 
  • trunk/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp

    r90 r117  
    7878        pInstance = ((ScriptedInstance*)c->GetInstanceData()); 
    7979        Reset(); 
    80         // wait for core patch be accepted 
    81         SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SUMMON_TOTEM); 
    82         if(TempSpell && TempSpell->EffectImplicitTargetA[0] != 1) 
    83             TempSpell->EffectImplicitTargetA[0] = 1; 
    8480        // need to find out what controls totem's spell cooldown 
    85         TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_LIGHTNING); 
     81        SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_LIGHTNING); 
    8682        if(TempSpell && TempSpell->CastingTimeIndex != 5) 
    8783            TempSpell->CastingTimeIndex = 5; // 2000 ms casting time 
  • trunk/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp

    r109 r117  
    269269    void AttackStart(Unit *who) 
    270270    { 
    271         if(!who) 
    272             return; 
    273  
    274         if (who->isTargetableForAttack()) 
    275         { 
    276             if(Phase == 2) 
    277                 m_creature->Attack(who, false); 
    278             else 
    279                 DoStartMovement(who); 
    280  
    281             if (!InCombat) 
    282             { 
    283                 Aggro(who); 
    284                 InCombat = true; 
    285             } 
    286         } 
     271        if(Phase == 2) 
     272            ScriptedAI::AttackStart(who, false); 
     273        else 
     274            ScriptedAI::AttackStart(who, true); 
    287275    } 
    288276