diff options
| author | Blaymoira <none@none> | 2009-01-21 17:27:28 +0100 | 
|---|---|---|
| committer | Blaymoira <none@none> | 2009-01-21 17:27:28 +0100 | 
| commit | 83ea3d51bb1b36f771c5db063e8412445b4fbaf9 (patch) | |
| tree | d4d1cd3fa58ac7094f8d8a34440998945732ad20 | |
| parent | 371a49179f099603b3e44a66fd75a22ee41a9c7a (diff) | |
*Updated Kelidan the Breaker script - by Iskander
--HG--
branch : trunk
11 files changed, 291 insertions, 13 deletions
| diff --git a/sql/updates/935_world_scripts.sql b/sql/updates/935_world_scripts.sql new file mode 100644 index 00000000000..de02b51d490 --- /dev/null +++ b/sql/updates/935_world_scripts.sql @@ -0,0 +1,6 @@ +DELETE FROM `creature` WHERE `id` = '17653'; + +UPDATE `gameobject_template` SET `flags` = '4' WHERE `entry` IN ('181766','181823'); +UPDATE `gameobject` SET `SpawnMask` = '3',`state` = '1' WHERE `id` IN ('181766','181823'); + +UPDATE `instance_template` SET `script` = 'instance_blood_furnace' WHERE `map` = '542';
\ No newline at end of file diff --git a/sql/updates/CMakeLists.txt b/sql/updates/CMakeLists.txt index 015f451db77..e8130764307 100644 --- a/sql/updates/CMakeLists.txt +++ b/sql/updates/CMakeLists.txt @@ -144,4 +144,5 @@ INSTALL(FILES  927_characters.sql  930_characters.sql  933_world_scripts.sql +935_world_scripts.sql  DESTINATION share/trinity/sql/updates) diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index 1995d80e9f6..511eec691c0 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -157,6 +157,8 @@ SET(trinityscript_LIB_SRCS     scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp     scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp     scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp +   scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp +   scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h     scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp     scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp     scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp diff --git a/src/bindings/scripts/Makefile.am b/src/bindings/scripts/Makefile.am index e5eb629a84d..564fa1c16b2 100644 --- a/src/bindings/scripts/Makefile.am +++ b/src/bindings/scripts/Makefile.am @@ -191,6 +191,8 @@ scripts/zone/gruuls_lair/instance_gruuls_lair.cpp \  scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp \  scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp \  scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp \ +scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp \ +scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h \  scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp \  scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp \  scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp \ diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp index c39102a1d7a..c34cb02e4bc 100644 --- a/src/bindings/scripts/ScriptMgr.cpp +++ b/src/bindings/scripts/ScriptMgr.cpp @@ -299,6 +299,7 @@ extern void AddSC_instance_gruuls_lair();  extern void AddSC_boss_broggok();  extern void AddSC_boss_kelidan_the_breaker();  extern void AddSC_boss_the_maker(); +extern void AddSC_instance_blood_furnace();  //--Magtheridon's Lair  extern void AddSC_boss_magtheridon(); @@ -1503,6 +1504,7 @@ void ScriptsInit()      AddSC_boss_broggok();      AddSC_boss_kelidan_the_breaker();      AddSC_boss_the_maker(); +	AddSC_instance_blood_furnace();      //--Magtheridon's Lair      AddSC_boss_magtheridon(); diff --git a/src/bindings/scripts/VC71/71ScriptDev2.vcproj b/src/bindings/scripts/VC71/71ScriptDev2.vcproj index cf7ffbe6c49..1fc365b2ef9 100644 --- a/src/bindings/scripts/VC71/71ScriptDev2.vcproj +++ b/src/bindings/scripts/VC71/71ScriptDev2.vcproj @@ -1431,6 +1431,14 @@  							RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\boss_the_maker.cpp"  							>  						</File> +						<File +							RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\def_blood_furnace.h" +							> +						</File> +						<File +							RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\instance_blood_furnace.cpp" +							> +						</File>  					</Filter>  					<Filter  						Name="Magtheridon's lair" diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index 3ec35fdab77..cd14a38e0d7 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -1608,6 +1608,14 @@  							RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\boss_the_maker.cpp"  							>  						</File> +						<File +							RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\def_blood_furnace.h" +							> +						</File> +						<File +							RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\instance_blood_furnace.cpp" +							> +						</File>  					</Filter>  					<Filter  						Name="Magtheridon's lair" diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj index 5f78d46ec93..e9ee048714e 100644 --- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj +++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj @@ -1601,6 +1601,14 @@  							RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\boss_the_maker.cpp"  							>  						</File> +						<File +							RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\def_blood_furnace.h" +							> +						</File> +						<File +							RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\instance_blood_furnace.cpp" +							> +						</File>  					</Filter>  					<Filter  						Name="Magtheridon's lair" diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp index 73d07388f6e..ec2fe76e96e 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp @@ -16,8 +16,8 @@  /* ScriptData  SDName: Boss_Kelidan_The_Breaker -SD%Complete: 60 -SDComment: Event with channeleres vs. boss not implemented yet +SD%Complete: 100 +SDComment:   SDCategory: Hellfire Citadel, Blood Furnace  EndScriptData */ @@ -27,6 +27,7 @@ mob_shadowmoon_channeler  EndContentData */  #include "precompiled.h" +#include "def_blood_furnace.h"  #define SAY_WAKE                    -1542000 @@ -40,6 +41,8 @@ EndContentData */  #define SAY_DIE                     -1542007  #define SPELL_CORRUPTION            30938 +#define SPELL_EVOCATION             30935 +#define SPELL_BURNING_NOVA          30940  #define SPELL_FIRE_NOVA             33132  #define H_SPELL_FIRE_NOVA           37371 @@ -47,8 +50,23 @@ EndContentData */  #define SPELL_SHADOW_BOLT_VOLLEY    28599  #define H_SPELL_SHADOW_BOLT_VOLLEY  40070 -#define SPELL_BURNING_NOVA          30940 -#define SPELL_VORTEX                37370 +#define ENTRY_KELIDAN               17377 +#define ENTRY_CHANNELER             17653 + +const float ShadowmoonChannelers[5][4]= +{ +    {302,-87,-24.4,0.157}, +    {321,-63.5,-24.6,4.887}, +    {346,-74.5,-24.6,3.595}, +    {344,-103.5,-24.5,2.356}, +    {316,-109,-24.6,1.257} +}; + +class TRINITY_DLL_DECL BurningNovaAura : public Aura +{ +    public: +        BurningNovaAura(SpellEntry *spell, uint32 eff, Unit *target, Unit *caster) : Aura(spell, eff, NULL, target, caster, NULL){} +};  struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI  { @@ -56,6 +74,7 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI      {          pInstance = ((ScriptedInstance*)c->GetInstanceData());          HeroicMode = m_creature->GetMap()->IsHeroic(); +        for(int i=0; i<5; i++) Channelers[i] = NULL;          Reset();      } @@ -66,19 +85,28 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI      uint32 BurningNova_Timer;      uint32 Firenova_Timer;      uint32 Corruption_Timer; +    uint32 check_Timer;      bool Firenova; +    bool addYell; +    Creature *Channelers[5];      void Reset()      {          ShadowVolley_Timer = 1000;          BurningNova_Timer = 15000;          Corruption_Timer = 5000; +        check_Timer = 0;          Firenova = false; +        addYell = false; +        SummonChannelers();      }      void Aggro(Unit *who)      {          DoScriptText(SAY_WAKE, m_creature); +        if (m_creature->IsNonMeleeSpellCasted(false)) +            m_creature->InterruptNonMeleeSpells(true); +        DoStartMovement(who);      }      void KilledUnit(Unit* victim) @@ -93,21 +121,83 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI          }      } +    void ChannelerEngaged(Unit* who) +    { +        if(who && !addYell) +        { +            addYell = true; +            switch(rand()%3) +            { +                case 0: DoScriptText(SAY_ADD_AGGRO_1, m_creature); break; +                case 1: DoScriptText(SAY_ADD_AGGRO_2, m_creature); break; +                default: DoScriptText(SAY_ADD_AGGRO_3, m_creature); break; +            } +        } +        for(int i=0; i<5; i++) +            if(who && Channelers[i] && !Channelers[i]->isInCombat()) +                Channelers[i]->AI()->AttackStart(who); +    } + +    void ChannelerDied(Unit* killer) +    { +        for(int i=0; i<5; i++) +            if(Channelers[i] && Channelers[i]->isAlive()) +                return; +        if(killer) +            m_creature->AI()->AttackStart(killer); +    } + +    Creature* GetChanneled(Creature *channeler) +    { +        SummonChannelers(); +        if(!channeler) return NULL; +        int i; +        for(i=0; i<5; i++) +            if(Channelers[i] && Channelers[i]->GetGUID()==channeler->GetGUID()) +                break; +        return Channelers[(i+2)%5]; +    } + +    void SummonChannelers() +    { +        for(int i=0; i<5; i++) +            if(!Channelers[i] || Channelers[i]->isDead()) +                Channelers[i] = m_creature->SummonCreature(ENTRY_CHANNELER,ShadowmoonChannelers[i][0],ShadowmoonChannelers[i][1],ShadowmoonChannelers[i][2],ShadowmoonChannelers[i][3],TEMPSUMMON_CORPSE_TIMED_DESPAWN,300000); +    } +     +    void JustSummoned(Creature *summon) +    { +        for(int i=0; i<5; i++) +            if(!Channelers[i] || Channelers[i]->isDead()) +                return; +        DoCast(m_creature,SPELL_EVOCATION); +    } +      void JustDied(Unit* Killer)      {          DoScriptText(SAY_DIE, m_creature); +       if(pInstance)  +		   pInstance->SetData(DATA_KELIDANEVENT, DONE);      }      void UpdateAI(const uint32 diff)      {          if (!m_creature->SelectHostilTarget() || !m_creature->getVictim()) +        { +            if(check_Timer < diff) +            { +                if (!m_creature->IsNonMeleeSpellCasted(false)) +                    DoCast(m_creature,SPELL_EVOCATION); +                check_Timer = 5000; +            }else check_Timer -= diff;              return; +        }          if (Firenova)          {              if (Firenova_Timer < diff)              { -                DoCast(m_creature,HeroicMode ? H_SPELL_FIRE_NOVA : SPELL_FIRE_NOVA); +                DoCast(m_creature,HeroicMode ? H_SPELL_FIRE_NOVA : SPELL_FIRE_NOVA,true);                  Firenova = false;                  ShadowVolley_Timer = 2000;              }else Firenova_Timer -=diff; @@ -134,10 +224,18 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI              DoScriptText(SAY_NOVA, m_creature); -            if (HeroicMode) -                DoCast(m_creature,SPELL_VORTEX); +            if(SpellEntry *nova = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_BURNING_NOVA)) +            { +                for(uint32 i = 0; i < 3; ++i) +                    if(nova->Effect[i] == SPELL_EFFECT_APPLY_AURA) +                    { +                        Aura *Aur = new BurningNovaAura(nova, i, m_creature, m_creature); +                        m_creature->AddAura(Aur); +                    } +            } -            DoCast(m_creature,SPELL_BURNING_NOVA); +            if (HeroicMode) +                DoTeleportAll(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation());              BurningNova_Timer = 20000+rand()%8000;              Firenova_Timer= 5000; @@ -161,9 +259,7 @@ CreatureAI* GetAI_boss_kelidan_the_breaker(Creature *_Creature)  #define H_SPELL_SHADOW_BOLT     15472  #define SPELL_MARK_OF_SHADOW    30937 - -#define SPELL_CHANNELING        0                           //initial spell channeling boss/each other not known -                                                            //when engaged all channelers must stop, trigger yell (SAY_ADD_AGGRO_*), and engage. +#define SPELL_CHANNELING        39123  struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI  { @@ -179,22 +275,46 @@ struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI      uint32 ShadowBolt_Timer;      uint32 MarkOfShadow_Timer; +    uint32 check_Timer;      void Reset()      {          ShadowBolt_Timer = 1000+rand()%1000;          MarkOfShadow_Timer = 5000+rand()%2000; +        check_Timer = 0; +        if (m_creature->IsNonMeleeSpellCasted(false)) +            m_creature->InterruptNonMeleeSpells(true);      }      void Aggro(Unit* who)      { -        //trigger boss to yell +        if(Creature *Kelidan = (Creature *)FindCreature(ENTRY_KELIDAN, 100)) +            ((boss_kelidan_the_breakerAI*)Kelidan->AI())->ChannelerEngaged(who); +        if (m_creature->IsNonMeleeSpellCasted(false)) +            m_creature->InterruptNonMeleeSpells(true); +        DoStartMovement(who); +    } + +    void JustDied(Unit* Killer) +    { +       if(Creature *Kelidan = (Creature *)FindCreature(ENTRY_KELIDAN, 100)) +           ((boss_kelidan_the_breakerAI*)Kelidan->AI())->ChannelerDied(Killer);      }      void UpdateAI(const uint32 diff)      {          if (!m_creature->SelectHostilTarget() || !m_creature->getVictim()) +        { +            if(check_Timer < diff) +            { +                if (!m_creature->IsNonMeleeSpellCasted(false)) +                    if(Creature *Kelidan = (Creature *)FindCreature(ENTRY_KELIDAN, 100)) +                        if(Creature *channeled = ((boss_kelidan_the_breakerAI*)Kelidan->AI())->GetChanneled(m_creature)) +                            DoCast(channeled,SPELL_CHANNELING); +                check_Timer = 5000; +            }else check_Timer -= diff;              return; +        }          if (MarkOfShadow_Timer < diff)          { @@ -231,4 +351,4 @@ void AddSC_boss_kelidan_the_breaker()      newscript->Name="mob_shadowmoon_channeler";      newscript->GetAI = &GetAI_mob_shadowmoon_channeler;      newscript->RegisterSelf(); -} +}
\ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h new file mode 100644 index 00000000000..6462b401d3d --- /dev/null +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h @@ -0,0 +1,9 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_BLOOD_FURNACE_H +#define DEF_BLOOD_FURNACE_H + +#define DATA_KELIDANEVENT           1 +#endif
\ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp new file mode 100644 index 00000000000..f0a10f74129 --- /dev/null +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp @@ -0,0 +1,112 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Blood_Furnace +SD%Complete: 85 +SDComment:  +SDCategory: Hellfire Citadel, Blood Furnace +EndScriptData */ + +#include "precompiled.h" +#include "def_blood_furnace.h" + +#define ENTRY_DOOR1                 181823 +#define ENTRY_DOOR2                 181766 + +struct TRINITY_DLL_DECL instance_blood_furnace : public ScriptedInstance +{ +    instance_blood_furnace(Map *map) : ScriptedInstance(map) {Initialize();}; + + +    uint64 Door1GUID; +    uint64 Door2GUID; + + +    void Initialize() +    { +        Door1GUID = 0; +        Door2GUID = 0; +    } + +    void OnObjectCreate(GameObject *go) +    { +        switch(go->GetEntry()) +        { +            case ENTRY_DOOR1: Door1GUID = go->GetGUID(); break; +            case ENTRY_DOOR2: Door2GUID = go->GetGUID(); break; +        } +    } + +    Player* GetPlayerInMap() +    { +        Map::PlayerList const& players = instance->GetPlayers(); + +        if (!players.isEmpty()) +        { +            for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) +            { +                if (Player* plr = itr->getSource()) +                    return plr; +            } +        } +	 	  +        debug_log("SD2: Instance Blood Furnace: GetPlayerInMap, but PlayerList is empty!"); +        return NULL; +    } +	 	  +    void HandleGameObject(uint64 guid, uint32 state) +    { +        Player *player = GetPlayerInMap(); +	  +        if (!player || !guid) +        { +            debug_log("SD2: Blood Furnace: HandleGameObject fail"); +            return; +        } +	 	  +        if (GameObject *go = GameObject::GetGameObject(*player,guid)) +            go->SetGoState(state); +    } + +    void SetData(uint32 type, uint32 data) +    { +        switch(type) +        { +            case DATA_KELIDANEVENT: +                if( data == DONE ) +                { +                    HandleGameObject(Door1GUID,0); +                    HandleGameObject(Door2GUID,0); +                } +                break; +        } +    } +}; + +InstanceData* GetInstanceData_instance_blood_furnace(Map* map) +{ +    return new instance_blood_furnace(map); +} + +void AddSC_instance_blood_furnace() +{ +    Script *newscript; +    newscript = new Script; +    newscript->Name = "instance_blood_furnace"; +    newscript->GetInstanceData = &GetInstanceData_instance_blood_furnace; +    newscript->RegisterSelf(); +}
\ No newline at end of file | 
