/* Copyright (C) 2006 - 2008 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*/#include "../../../sc_defines.h"#include "def_hyjal.h"#include "../../../../../../game/TargetedMovementGenerator.h"#include "../../../../../../game/SpellAuras.h"#define SPELL_DENOUEMENT_WISP 32124 // Wisps use this#define SPELL_PROTECTION_OF_ELUNE 38528#define SPELL_DRAIN_WORLD_TREE 39140#define SPELL_DRAIN_WORLD_TREE_2 39141#define SPELL_FINGER_OF_DEATH 31984#define SPELL_HAND_OF_DEATH 35354#define SPELL_AIR_BURST 32014#define SPELL_GRIP_OF_THE_LEGION 31972#define SPELL_DOOMFIRE_SPAWN 32045#define SPELL_DOOMFIRE_VISUAL 31945#define SPELL_DOOMFIRE_DAMAGE 31969#define SPELL_SOUL_CHARGE_YELLOW 32045#define SPELL_SOUL_CHARGE_GREEN 32051#define SPELL_SOUL_CHARGE_RED 32052#define SPELL_UNLEASH_SOUL_YELLOW 32054#define SPELL_UNLEASH_SOUL_GREEN 32057#define SPELL_UNLEASH_SOUL_RED 32053#define SPELL_FEAR 41150#define SAY_AGGRO "Your resistance is insignificant!"#define SOUND_AGGRO 10987#define SAY_DOOMFIRE1 "This world will burn!"#define SOUND_DOOMFIRE1 10990#define SAY_DOOMFIRE2 "Manach sheek-thrish!"#define SOUND_DOOMFIRE2 11041#define SAY_AIR_BURST "A-kreesh!"#define SOUND_AIR_BURST 10989#define SAY_AIR_BURST2 "Away vermin!"#define SOUND_AIR_BURST2 11043#define SAY_SLAY1 "All creation will be devoured!"#define SOUND_SLAY1 11044#define SAY_SLAY2 "Your soul will languish for eternity."#define SOUND_SLAY2 10991#define SAY_SLAY3 "I am the coming of the end!"#define SOUND_SLAY3 11045#define SAY_UNK1 "You are mine now."#define SOUND_UNK1 10988#define SAY_UNK2 "Bow to my will."#define SOUND_UNK2 11042#define SAY_ENRAGE "At last it is here. Mourn and lament the passing of all you have ever known and all that would have been! Akmin-kurai!"#define SOUND_ENRAGE 10993#define SAY_DEATH "No, it cannot be! Nooo!"#define SOUND_DEATH 10992struct MANGOS_DLL_DECL boss_archimondeAI : public ScriptedAI{ boss_archimondeAI(Creature *c) : ScriptedAI(c) { pInstance = ((ScriptedInstance*)c->GetInstanceData()); Reset(); } ScriptedInstance* pInstance; bool InCombat; void Reset() { if(pInstance) pInstance->SetData(DATA_ARCHIMONDEEVENT, 0); InCombat = false; } void AttackStart(Unit *who) { if(!who) return; if(who->isTargetableForAttack() && who!= m_creature) { DoStartMeleeAttack(who); if(!InCombat) { DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL); DoPlaySoundToSet(m_creature, SOUND_AGGRO); InCombat = true; } } } void MoveInLineOfSight(Unit *who) { if (!who || m_creature->getVictim()) return; if(who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) { float attackRadius = m_creature->GetAttackDistance(who); if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who)) { if(who->HasStealthAura()) who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); DoStartMeleeAttack(who); if(!InCombat) { DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL); DoPlaySoundToSet(m_creature, SOUND_AGGRO); pInstance->SetData(DATA_ARCHIMONDEEVENT, 1); InCombat = true; } } } } void KilledUnit(Unit *victim) { switch(rand()%2) { case 0: DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL); DoPlaySoundToSet(m_creature, SOUND_SLAY1); break; case 1: DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL); DoPlaySoundToSet(m_creature, SOUND_SLAY2); break; case 2: DoYell(SAY_SLAY3,LANG_UNIVERSAL,NULL); DoPlaySoundToSet(m_creature, SOUND_SLAY3); break; } } void JustDied(Unit *victim) { InCombat = false; DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL); DoPlaySoundToSet(m_creature,SOUND_DEATH); } void UpdateAI(const uint32 diff) { if(!m_creature->SelectHostilTarget() || !m_creature->getVictim()) return; DoMeleeAttackIfReady(); }};CreatureAI* GetAI_boss_archimonde(Creature *_Creature){ return new boss_archimondeAI (_Creature);}void AddSC_boss_archimonde(){ Script *newscript; newscript = new Script; newscript->Name="boss_archimonde"; newscript->GetAI = GetAI_boss_archimonde; m_scripts[nrscripts++] = newscript;}