diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp | 145 | ||||
-rw-r--r-- | src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp | 11 | ||||
-rw-r--r-- | src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp | 33 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 10 | ||||
-rw-r--r-- | src/game/SpellMgr.cpp | 2 |
5 files changed, 88 insertions, 113 deletions
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp index 7a064fb922c..f1deb398cce 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/> * 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 @@ -14,20 +14,16 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* ScriptData -SDName: Boss_Gluth -SD%Complete: 100 -SDComment: -SDCategory: Naxxramas -EndScriptData */ - #include "precompiled.h" +#include "def_naxxramas.h" + +#define SPELL_MORTAL_WOUND 25646 +#define SPELL_ENRAGE HEROIC(28371,54427) +#define SPELL_DECIMATE HEROIC(28374,54426) +#define SPELL_BERSERK 26662 +#define SPELL_INFECTED_WOUND 29306 -#define SPELL_MORTALWOUND 25646 -#define SPELL_DECIMATE 28374 -#define SPELL_TERRIFYINGROAR 29685 -#define SPELL_FRENZY 19812 -#define SPELL_ENRAGE 28747 +#define MOB_ZOMBIE #define ADD_1X 3269.590 #define ADD_1Y -3161.287 @@ -65,96 +61,75 @@ EndScriptData */ #define ADD_9Y -3180.766 #define ADD_9Z 297.423 -struct TRINITY_DLL_DECL boss_gluthAI : public ScriptedAI +enum Events { - boss_gluthAI(Creature *c) : ScriptedAI(c) {} + EVENT_WOUND = 1, + EVENT_ENRAGE, + EVENT_DECIMATE, + EVENT_BERSERK, + EVENT_SUMMON, +}; - uint32 MortalWound_Timer; - uint32 Decimate_Timer; - uint32 TerrifyingRoar_Timer; - uint32 Frenzy_Timer; - uint32 Enrage_Timer; - uint32 Summon_Timer; +struct TRINITY_DLL_DECL boss_gluthAI : public BossAI +{ + boss_gluthAI(Creature *c) : BossAI(c, BOSS_GLUTH) + { + // Do not let Gluth be affected by zombies' debuff + me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_INFECTED_WOUND, true); + } - void Reset() + void MoveInLineOfSight(Unit *who) { - MortalWound_Timer = 8000; - Decimate_Timer = 100000; - TerrifyingRoar_Timer = 21000; - Frenzy_Timer = 15000; - Enrage_Timer = 304000; - Summon_Timer = 10000; + /*if(who->GetEntry() == MOB_ZOMBIE) + { + me->AddThreat(who, 1000000 + } + else + BossAI::MoveInLineOfSight(who);*/ } void EnterCombat(Unit *who) { + _EnterCombat(); + events.ScheduleEvent(EVENT_WOUND, 10000); + events.ScheduleEvent(EVENT_ENRAGE, 30000); + events.ScheduleEvent(EVENT_DECIMATE, 105000); + events.ScheduleEvent(EVENT_BERSERK, 8*60000); + events.ScheduleEvent(EVENT_SUMMON, 10000); } void UpdateAI(const uint32 diff) { - if (!UpdateVictim()) + if(!UpdateVictim()) return; - //MortalWound_Timer - if (MortalWound_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_MORTALWOUND); - MortalWound_Timer = 10000; - }else MortalWound_Timer -= diff; + events.Update(diff); - //Decimate_Timer - if (Decimate_Timer < diff) + while(uint32 eventId = events.ExecuteEvent()) { - DoCast(m_creature->getVictim(),SPELL_DECIMATE); - Decimate_Timer = 100000; - }else Decimate_Timer -= diff; - - //TerrifyingRoar_Timer - if (TerrifyingRoar_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_TERRIFYINGROAR); - TerrifyingRoar_Timer = 20000; - }else TerrifyingRoar_Timer -= diff; - - //Frenzy_Timer - if (Frenzy_Timer < diff) - { - DoCast(m_creature,SPELL_FRENZY); - Frenzy_Timer = 10500; - }else Frenzy_Timer -= diff; - - //Enrage_Timer - if (Enrage_Timer < diff) - { - DoCast(m_creature,SPELL_ENRAGE); - Enrage_Timer = 61000; - }else Enrage_Timer -= diff; - - //Summon_Timer - if (Summon_Timer < diff) - { - Unit* target = NULL; - Unit* SummonedZombies = NULL; - - SummonedZombies = m_creature->SummonCreature(16360,ADD_1X,ADD_1Y,ADD_1Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); - SummonedZombies = m_creature->SummonCreature(16360,ADD_2X,ADD_2Y,ADD_2Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); - SummonedZombies = m_creature->SummonCreature(16360,ADD_3X,ADD_3Y,ADD_3Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); - SummonedZombies = m_creature->SummonCreature(16360,ADD_4X,ADD_4Y,ADD_4Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); - SummonedZombies = m_creature->SummonCreature(16360,ADD_5X,ADD_5Y,ADD_5Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); - SummonedZombies = m_creature->SummonCreature(16360,ADD_6X,ADD_6Y,ADD_6Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); - SummonedZombies = m_creature->SummonCreature(16360,ADD_7X,ADD_7Y,ADD_7Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); - SummonedZombies = m_creature->SummonCreature(16360,ADD_8X,ADD_8Y,ADD_8Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); - SummonedZombies = m_creature->SummonCreature(16360,ADD_9X,ADD_9Y,ADD_9Z,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000); - - if (SummonedZombies) + switch(eventId) { - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) - SummonedZombies->AddThreat(target,1.0f); + case EVENT_WOUND: + DoCast(me->getVictim(), SPELL_MORTAL_WOUND); + events.ScheduleEvent(EVENT_WOUND, 10000); + return; + case EVENT_ENRAGE: + DoCast(me, SPELL_ENRAGE); + events.ScheduleEvent(EVENT_ENRAGE, 30000); + return; + case EVENT_DECIMATE: + DoCastAOE(SPELL_DECIMATE); + events.ScheduleEvent(EVENT_DECIMATE, 105000); + return; + case EVENT_BERSERK: + DoCast(me, SPELL_BERSERK); + return; + case EVENT_SUMMON: + for(uint32 i = 0; i < HEROIC(1,2); ++i) + //SummonZombie(HEROIC(1,2)); + return; } - - Summon_Timer = 28000; - } else Summon_Timer -= diff; + } DoMeleeAttackIfReady(); } diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp index 7def6c370f4..90b82679c68 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp @@ -202,16 +202,7 @@ struct TRINITY_DLL_DECL boss_gothikAI : public BossAI void UpdateAI(const uint32 diff) { - if(!me->isInCombat()) - return; - - if(me->getThreatManager().isThreatListEmpty()) - { - EnterEvadeMode(); - return; - } - - if(me->HasReactState(REACT_AGGRESSIVE) && !UpdateVictim()) + if(!UpdateVictimByReact()) return; events.Update(diff); diff --git a/src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp b/src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp index e5913660c3f..92f6180045a 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp @@ -44,6 +44,18 @@ const DoorData doorData[] = {0, 0, DOOR_TYPE_ROOM}, // EOF }; +const MinionData minionData[] = +{ + //{16573, BOSS_ANUBREKHAN}, there is no spawn point in db, so we do not add them here + {16506, BOSS_FAERLINA}, + {16803, BOSS_RAZUVIOUS}, + {16063, BOSS_HORSEMEN}, + {16064, BOSS_HORSEMEN}, + {16065, BOSS_HORSEMEN}, + {30549, BOSS_HORSEMEN}, + {0, 0,} +}; + #define GO_GOTHIK_GATE 181170 #define SPELL_ERUPTION 29371 @@ -84,9 +96,9 @@ struct TRINITY_DLL_DECL instance_naxxramas : public InstanceData { SetBossNumber(MAX_BOSS_NUMBER); LoadDoorData(doorData); + LoadMinionData(minionData); } - std::set<Creature*> Worshipper; std::set<GameObject*> HeiganEruption[4]; GameObject *GothikGate; Creature *Sapphiron; @@ -95,9 +107,10 @@ struct TRINITY_DLL_DECL instance_naxxramas : public InstanceData { switch(creature->GetEntry()) { - case 15989: Sapphiron = add ? creature : NULL; break; - case 16506: if(add) Worshipper.insert(creature); else Worshipper.erase(creature); break; + case 15989: Sapphiron = add ? creature : NULL; return; } + + AddMinion(creature, add); } void OnObjectCreate(GameObject* go, bool add) @@ -121,20 +134,6 @@ struct TRINITY_DLL_DECL instance_naxxramas : public InstanceData AddDoor(go, add); } - void SetBossState(uint32 id, EncounterState state) - { - InstanceData::SetBossState(id, state); - switch(id) - { - case BOSS_FAERLINA: - if(state == NOT_STARTED) - for(std::set<Creature*>::iterator itr = Worshipper.begin(); itr != Worshipper.end(); ++itr) - if(!(*itr)->isAlive()) - (*itr)->Respawn(); - break; - } - } - void SetData(uint32 id, uint32 value) { switch(id) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 330b0b9027b..39d2c3796b8 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -4612,6 +4612,16 @@ void Spell::EffectScriptEffect(uint32 effIndex) unitTarget->RemoveAurasByTypeWithDispel(SPELL_AURA_MOD_DECREASE_SPEED, this); return; } + // Decimate + case 28374: + case 54426: + if(unitTarget) + { + int32 damage = (int32)unitTarget->GetHealth() - (int32)unitTarget->GetMaxHealth() * 0.05f; + if(damage > 0) + m_caster->CastCustomSpell(28375, SPELLVALUE_BASE_POINT0, damage, unitTarget); + } + return; // Mirren's Drinking Hat case 29830: { diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 50e41dce8a7..8ff309a9581 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -1952,7 +1952,7 @@ void SpellMgr::LoadPetLevelupSpellMap() for (uint8 j = 0; j < 2; ++j) { - if (creatureFamily->skillLine[j]==0) + if (!creatureFamily->skillLine[j]) continue; for (uint32 k = 0; k < sSkillLineAbilityStore.GetNumRows(); ++k) |